From 7fa3804503af5ba7388a291784c718e88a37c3a6 Mon Sep 17 00:00:00 2001 From: rakesh-wt-egov <73687298+rakesh-wt-egov@users.noreply.github.com> Date: Thu, 19 Oct 2023 14:08:26 +0530 Subject: [PATCH] Fixed HRMS UI issues --- .../components/pageComponents/Multiselect.js | 276 +++++++++++++++--- .../components/pageComponents/jurisdiction.js | 18 +- 2 files changed, 239 insertions(+), 55 deletions(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/Multiselect.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/Multiselect.js index 43c2fe704..5f1fffa09 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/Multiselect.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/Multiselect.js @@ -1,85 +1,269 @@ -import React, { useRef, useState } from "react"; -import { ArrowDown, CheckSvg } from "@egovernments/digit-ui-react-components"; +import React, { useEffect, useReducer, useRef, useState } from "react"; import { useTranslation } from "react-i18next"; -const MultiSelect = ({ options, optionsKey, selected = [], onSelect, defaultLabel = "", defaultUnit = "",BlockNumber=1,isOBPSMultiple=false}) => { +const MultiSelectDropdown = ({ + options, + optionsKey, + selected = [], + onSelect, + defaultLabel = "", + defaultUnit = "", + BlockNumber = 1, + isOBPSMultiple = false, + props = {}, + isPropsNeeded = false, + ServerStyle = {}, + config, + showSelectAll = false, +}) => { const [active, setActive] = useState(false); const [searchQuery, setSearchQuery] = useState(); const [optionIndex, setOptionIndex] = useState(-1); const dropdownRef = useRef(); const { t } = useTranslation(); - Digit.Hooks.useClickOutside(dropdownRef, () => setActive(false), active); + + const CheckSvg = ({ className, style = {} }) => ( + + ); + + const ArrowDown = ({ className, onClick, styles, disable }) => ( + + ); + + const RemoveableTag = ({ text, onClick, extraStyles, disabled = false }) => ( +
{t(option[optionsKey]&&typeof option[optionsKey]=="string" && option[optionsKey])}
++ {t(option[optionsKey] && typeof option[optionsKey] == "string" && option[optionsKey])} +
{t("SELECT_ALL")}
+{selected.length > 0 ? `${selected.length} ${defaultUnit}` : defaultLabel}
-{alreadyQueuedSelectedState.length > 0 ? `${alreadyQueuedSelectedState.length} ${defaultUnit}` : defaultLabel}
+