mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-09-20 14:39:34 +02:00
chore: format number
This commit is contained in:
121
.idea/workspace.xml
generated
121
.idea/workspace.xml
generated
@@ -4,12 +4,10 @@
|
|||||||
<option name="autoReloadType" value="SELECTIVE" />
|
<option name="autoReloadType" value="SELECTIVE" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="b30e2810-c4c1-4aad-b134-794e52cc1c7d" name="Changes" comment="feat: reverse list ui">
|
<list default="true" id="b30e2810-c4c1-4aad-b134-794e52cc1c7d" name="Changes" comment="feat: self host">
|
||||||
<change afterPath="$PROJECT_DIR$/.dockerignore" afterDir="false" />
|
<change afterPath="$PROJECT_DIR$/src/utils/number.ts" afterDir="false" />
|
||||||
<change afterPath="$PROJECT_DIR$/Dockerfile" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/img.png" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/pages/list/group/index.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/pages/list/group/index.tsx" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
@@ -31,9 +29,9 @@
|
|||||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||||
<option name="RESET_MODE" value="HARD" />
|
<option name="RESET_MODE" value="HARD" />
|
||||||
</component>
|
</component>
|
||||||
<component name="KubernetesApiProvider"><![CDATA[{
|
<component name="KubernetesApiProvider">{
|
||||||
"isMigrated": true
|
"isMigrated": true
|
||||||
}]]></component>
|
}</component>
|
||||||
<component name="MarkdownSettingsMigration">
|
<component name="MarkdownSettingsMigration">
|
||||||
<option name="stateVersion" value="1" />
|
<option name="stateVersion" value="1" />
|
||||||
</component>
|
</component>
|
||||||
@@ -49,46 +47,46 @@
|
|||||||
<option name="hideEmptyMiddlePackages" value="true" />
|
<option name="hideEmptyMiddlePackages" value="true" />
|
||||||
<option name="showLibraryContents" value="true" />
|
<option name="showLibraryContents" value="true" />
|
||||||
</component>
|
</component>
|
||||||
<component name="PropertiesComponent"><![CDATA[{
|
<component name="PropertiesComponent">{
|
||||||
"keyToString": {
|
"keyToString": {
|
||||||
"ASKED_ADD_EXTERNAL_FILES": "true",
|
"ASKED_ADD_EXTERNAL_FILES": "true",
|
||||||
"ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
"ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
||||||
"Docker.Dockerfile build.executor": "Run",
|
"Docker.Dockerfile build.executor": "Run",
|
||||||
"Docker.Dockerfile.executor": "Run",
|
"Docker.Dockerfile.executor": "Run",
|
||||||
"Playwright.JoinText Component.executor": "Run",
|
"Playwright.JoinText Component.executor": "Run",
|
||||||
"Playwright.JoinText Component.should merge text pieces with specified join character.executor": "Run",
|
"Playwright.JoinText Component.should merge text pieces with specified join character.executor": "Run",
|
||||||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||||
"Vitest.compute function (1).executor": "Run",
|
"Vitest.compute function (1).executor": "Run",
|
||||||
"Vitest.compute function.executor": "Run",
|
"Vitest.compute function.executor": "Run",
|
||||||
"Vitest.mergeText.executor": "Run",
|
"Vitest.mergeText.executor": "Run",
|
||||||
"Vitest.mergeText.should merge lines and preserve blank lines when deleteBlankLines is false.executor": "Run",
|
"Vitest.mergeText.should merge lines and preserve blank lines when deleteBlankLines is false.executor": "Run",
|
||||||
"Vitest.mergeText.should merge lines, preserve blank lines and trailing spaces when both deleteBlankLines and deleteTrailingSpaces are false.executor": "Run",
|
"Vitest.mergeText.should merge lines, preserve blank lines and trailing spaces when both deleteBlankLines and deleteTrailingSpaces are false.executor": "Run",
|
||||||
"git-widget-placeholder": "main",
|
"git-widget-placeholder": "main",
|
||||||
"ignore.virus.scanning.warn.message": "true",
|
"ignore.virus.scanning.warn.message": "true",
|
||||||
"kotlin-language-version-configured": "true",
|
"kotlin-language-version-configured": "true",
|
||||||
"last_opened_file_path": "C:/Users/HP/IdeaProjects/omni-tools/src/components/options",
|
"last_opened_file_path": "C:/Users/HP/IdeaProjects/omni-tools/src/components/options",
|
||||||
"node.js.detected.package.eslint": "true",
|
"node.js.detected.package.eslint": "true",
|
||||||
"node.js.detected.package.tslint": "true",
|
"node.js.detected.package.tslint": "true",
|
||||||
"node.js.selected.package.eslint": "(autodetect)",
|
"node.js.selected.package.eslint": "(autodetect)",
|
||||||
"node.js.selected.package.tslint": "(autodetect)",
|
"node.js.selected.package.tslint": "(autodetect)",
|
||||||
"nodejs_package_manager_path": "npm",
|
"nodejs_package_manager_path": "npm",
|
||||||
"npm.dev.executor": "Run",
|
"npm.dev.executor": "Run",
|
||||||
"npm.lint.executor": "Run",
|
"npm.lint.executor": "Run",
|
||||||
"npm.prebuild.executor": "Run",
|
"npm.prebuild.executor": "Run",
|
||||||
"npm.script:create:tool.executor": "Run",
|
"npm.script:create:tool.executor": "Run",
|
||||||
"npm.test.executor": "Run",
|
"npm.test.executor": "Run",
|
||||||
"npm.test:e2e.executor": "Run",
|
"npm.test:e2e.executor": "Run",
|
||||||
"npm.test:e2e:run.executor": "Run",
|
"npm.test:e2e:run.executor": "Run",
|
||||||
"prettierjs.PrettierConfiguration.Package": "C:\\Users\\HP\\IdeaProjects\\omni-tools\\node_modules\\prettier",
|
"prettierjs.PrettierConfiguration.Package": "C:\\Users\\HP\\IdeaProjects\\omni-tools\\node_modules\\prettier",
|
||||||
"project.structure.last.edited": "Problems",
|
"project.structure.last.edited": "Problems",
|
||||||
"project.structure.proportion": "0.0",
|
"project.structure.proportion": "0.0",
|
||||||
"project.structure.side.proportion": "0.2",
|
"project.structure.side.proportion": "0.2",
|
||||||
"settings.editor.selected.configurable": "settings.typescriptcompiler",
|
"settings.editor.selected.configurable": "settings.typescriptcompiler",
|
||||||
"ts.external.directory.path": "C:\\Users\\HP\\IdeaProjects\\omni-tools\\node_modules\\typescript\\lib",
|
"ts.external.directory.path": "C:\\Users\\HP\\IdeaProjects\\omni-tools\\node_modules\\typescript\\lib",
|
||||||
"vue.rearranger.settings.migration": "true"
|
"vue.rearranger.settings.migration": "true"
|
||||||
}
|
}
|
||||||
}]]></component>
|
}</component>
|
||||||
<component name="ReactDesignerToolWindowState">
|
<component name="ReactDesignerToolWindowState">
|
||||||
<option name="myId2Visible">
|
<option name="myId2Visible">
|
||||||
<map>
|
<map>
|
||||||
@@ -113,7 +111,7 @@
|
|||||||
<recent name="C:\Users\HP\IdeaProjects\omni-tools\src\tools" />
|
<recent name="C:\Users\HP\IdeaProjects\omni-tools\src\tools" />
|
||||||
</key>
|
</key>
|
||||||
</component>
|
</component>
|
||||||
<component name="RunManager" selected="Docker.Dockerfile">
|
<component name="RunManager" selected="npm.dev">
|
||||||
<configuration name="Dockerfile build" type="docker-deploy" factoryName="dockerfile" temporary="true" server-name="Docker">
|
<configuration name="Dockerfile build" type="docker-deploy" factoryName="dockerfile" temporary="true" server-name="Docker">
|
||||||
<deployment type="dockerfile">
|
<deployment type="dockerfile">
|
||||||
<settings>
|
<settings>
|
||||||
@@ -180,9 +178,9 @@
|
|||||||
</list>
|
</list>
|
||||||
<recent_temporary>
|
<recent_temporary>
|
||||||
<list>
|
<list>
|
||||||
|
<item itemvalue="npm.dev" />
|
||||||
<item itemvalue="Docker.Dockerfile build" />
|
<item itemvalue="Docker.Dockerfile build" />
|
||||||
<item itemvalue="Docker.Dockerfile" />
|
<item itemvalue="Docker.Dockerfile" />
|
||||||
<item itemvalue="npm.dev" />
|
|
||||||
<item itemvalue="npm.lint" />
|
<item itemvalue="npm.lint" />
|
||||||
<item itemvalue="npm.test:e2e" />
|
<item itemvalue="npm.test:e2e" />
|
||||||
</list>
|
</list>
|
||||||
@@ -225,15 +223,8 @@
|
|||||||
<workItem from="1720564427492" duration="1523000" />
|
<workItem from="1720564427492" duration="1523000" />
|
||||||
<workItem from="1720613598176" duration="8000" />
|
<workItem from="1720613598176" duration="8000" />
|
||||||
<workItem from="1720655252208" duration="3975000" />
|
<workItem from="1720655252208" duration="3975000" />
|
||||||
<workItem from="1720661825389" duration="3107000" />
|
<workItem from="1720661825389" duration="4305000" />
|
||||||
</task>
|
<workItem from="1720729165596" duration="730000" />
|
||||||
<task id="LOCAL-00046" summary="feat: change colors in png init">
|
|
||||||
<option name="closed" value="true" />
|
|
||||||
<created>1719193884293</created>
|
|
||||||
<option name="number" value="00046" />
|
|
||||||
<option name="presentableId" value="LOCAL-00046" />
|
|
||||||
<option name="project" value="LOCAL" />
|
|
||||||
<updated>1719193884293</updated>
|
|
||||||
</task>
|
</task>
|
||||||
<task id="LOCAL-00047" summary="feat: change colors in png">
|
<task id="LOCAL-00047" summary="feat: change colors in png">
|
||||||
<option name="closed" value="true" />
|
<option name="closed" value="true" />
|
||||||
@@ -619,7 +610,15 @@
|
|||||||
<option name="project" value="LOCAL" />
|
<option name="project" value="LOCAL" />
|
||||||
<updated>1720658257129</updated>
|
<updated>1720658257129</updated>
|
||||||
</task>
|
</task>
|
||||||
<option name="localTasksCounter" value="95" />
|
<task id="LOCAL-00095" summary="feat: self host">
|
||||||
|
<option name="closed" value="true" />
|
||||||
|
<created>1720665220407</created>
|
||||||
|
<option name="number" value="00095" />
|
||||||
|
<option name="presentableId" value="LOCAL-00095" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1720665220408</updated>
|
||||||
|
</task>
|
||||||
|
<option name="localTasksCounter" value="96" />
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="TypeScriptGeneratedFilesManager">
|
<component name="TypeScriptGeneratedFilesManager">
|
||||||
@@ -663,7 +662,6 @@
|
|||||||
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
|
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
|
||||||
<option name="CHECK_NEW_TODO" value="false" />
|
<option name="CHECK_NEW_TODO" value="false" />
|
||||||
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
|
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
|
||||||
<MESSAGE value="feat: make tool responsive" />
|
|
||||||
<MESSAGE value="chore: make tool examples responsive" />
|
<MESSAGE value="chore: make tool examples responsive" />
|
||||||
<MESSAGE value="chore: loading screen" />
|
<MESSAGE value="chore: loading screen" />
|
||||||
<MESSAGE value="chore: shuffle tools search" />
|
<MESSAGE value="chore: shuffle tools search" />
|
||||||
@@ -688,7 +686,8 @@
|
|||||||
<MESSAGE value="feat: find unique ui" />
|
<MESSAGE value="feat: find unique ui" />
|
||||||
<MESSAGE value="feat: group list ui" />
|
<MESSAGE value="feat: group list ui" />
|
||||||
<MESSAGE value="feat: reverse list ui" />
|
<MESSAGE value="feat: reverse list ui" />
|
||||||
<option name="LAST_COMMIT_MESSAGE" value="feat: reverse list ui" />
|
<MESSAGE value="feat: self host" />
|
||||||
|
<option name="LAST_COMMIT_MESSAGE" value="feat: self host" />
|
||||||
</component>
|
</component>
|
||||||
<component name="XSLT-Support.FileAssociations.UIState">
|
<component name="XSLT-Support.FileAssociations.UIState">
|
||||||
<expand />
|
<expand />
|
||||||
|
@@ -9,6 +9,7 @@ import ToolInputAndResult from '../../../components/ToolInputAndResult';
|
|||||||
import SimpleRadio from '../../../components/options/SimpleRadio';
|
import SimpleRadio from '../../../components/options/SimpleRadio';
|
||||||
import TextFieldWithDesc from '../../../components/options/TextFieldWithDesc';
|
import TextFieldWithDesc from '../../../components/options/TextFieldWithDesc';
|
||||||
import CheckboxWithDesc from '../../../components/options/CheckboxWithDesc';
|
import CheckboxWithDesc from '../../../components/options/CheckboxWithDesc';
|
||||||
|
import { formatNumber } from '../../../utils/number';
|
||||||
|
|
||||||
const initialValues = {
|
const initialValues = {
|
||||||
splitOperatorType: 'symbol' as SplitOperatorType,
|
splitOperatorType: 'symbol' as SplitOperatorType,
|
||||||
@@ -121,7 +122,7 @@ export default function FindUnique() {
|
|||||||
description={'Number of items in a group'}
|
description={'Number of items in a group'}
|
||||||
type={'number'}
|
type={'number'}
|
||||||
onOwnChange={(value) =>
|
onOwnChange={(value) =>
|
||||||
updateField('groupNumber', Number(value))
|
updateField('groupNumber', formatNumber(value, 1))
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<TextFieldWithDesc
|
<TextFieldWithDesc
|
||||||
|
11
src/utils/number.ts
Normal file
11
src/utils/number.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
export function formatNumber(
|
||||||
|
num: number | string,
|
||||||
|
fallback: number = 0
|
||||||
|
): number {
|
||||||
|
if (!num) return fallback;
|
||||||
|
const result: number = Number(num);
|
||||||
|
if (!result) {
|
||||||
|
return fallback;
|
||||||
|
}
|
||||||
|
return result >= 0 ? result : fallback;
|
||||||
|
}
|
Reference in New Issue
Block a user