From 19733eb22ae0638edf33305202bf47165c9aa119 Mon Sep 17 00:00:00 2001 From: Bhagwan Singh Date: Thu, 4 Jun 2026 13:42:02 +0530 Subject: [PATCH] Propeties StyleCheck + Temporal use Current Time stamp state is shared between all temporal FIXED --- .../tagProperties/TagProperties.tsx | 173 ++++++++++++------ .../attributes/CurrTimeStampAttr.tsx | 39 ++-- 2 files changed, 137 insertions(+), 75 deletions(-) diff --git a/src/components/process/processStepTwo/tagProperties/TagProperties.tsx b/src/components/process/processStepTwo/tagProperties/TagProperties.tsx index c1b4e62..8b4ed2a 100644 --- a/src/components/process/processStepTwo/tagProperties/TagProperties.tsx +++ b/src/components/process/processStepTwo/tagProperties/TagProperties.tsx @@ -143,6 +143,21 @@ const TagProperties: React.FC = ( setDropDownToggle(null) } + {/* Font */ } + const smeFonts = [ + "Arial", + "Helvetica", + "Times New Roman", + "Georgia", + "Verdana", + "Tahoma", + "Trebuchet MS", + "Courier New", + "Lucida Console", + "Impact", + ]; + + // useEffect(() => { // if (selectedTag.label == "temporal" && !("dateFormat" in selectedTag)) { // handlePropertyChange("dateFormat", TEMPORAL.DATE); @@ -360,7 +375,11 @@ const TagProperties: React.FC = ( { selectedTag.type.toLowerCase() == TagsTypes.TEMPORAL && - + } @@ -451,66 +470,104 @@ const TagProperties: React.FC = ( className="block mb-2 font-medium">Styles - { - styleOpen && <> - {/* Font */} -
- - handleStyleChange("font", e.target.value)} - /> -
+ {styleOpen && ( +
+
+ {/* Font */} +
+ + +
- {/* Text Size */} -
- - - handleStyleChange("textSize", parseInt(e.target.value, 10) || 0) - } - /> -
- - {/* Color */} -
- - handleStyleChange("color", e.target.value)} - /> -
- - {/* Toggles for Bold, Italic, Underline */} -
- - -
+ + {/* Color */} +
+ + + handleStyleChange("color", e.target.value) + } + /> +
- - } + + {/* Style Buttons */} +
+ + + + + +
+
+ )} } diff --git a/src/components/process/processStepTwo/tagProperties/attributes/CurrTimeStampAttr.tsx b/src/components/process/processStepTwo/tagProperties/attributes/CurrTimeStampAttr.tsx index 4c61339..ea57994 100644 --- a/src/components/process/processStepTwo/tagProperties/attributes/CurrTimeStampAttr.tsx +++ b/src/components/process/processStepTwo/tagProperties/attributes/CurrTimeStampAttr.tsx @@ -1,37 +1,42 @@ -import React, { useState } from 'react' - interface CurrTimeStampAttrInt { type: string; - handlePropertyChange: (changeTo: string, changeWith: string | boolean | number) => void; + currentTimeStamp?: boolean; + handlePropertyChange: ( + changeTo: string, + changeWith: string | boolean | number + ) => void; } -const CurrTimeStampAttr: React.FC = ({ type, handlePropertyChange}) => { - - const [isCurrentTimeStamp, setIsCurrentTimeStamp] = useState(true); - +const CurrTimeStampAttr: React.FC = ({ + type, + currentTimeStamp = false, + handlePropertyChange, +}) => { const handleIsCurrentTimeStamp = (checked: boolean) => { - if (type.toLowerCase() == "temporal") { - setIsCurrentTimeStamp(checked) + if (type.toLowerCase() === "temporal") { handlePropertyChange("currentTimeStamp", checked); } - } + }; return ( -
+
+ handleIsCurrentTimeStamp(e.target.checked)} id="use_current_timestamp" type="checkbox" + checked={currentTimeStamp} + onChange={(e) => + handleIsCurrentTimeStamp(e.target.checked) + } />
- ) -} + ); +}; -export default CurrTimeStampAttr \ No newline at end of file +export default CurrTimeStampAttr; \ No newline at end of file