Skip to content

Commit

Permalink
Modifed date and updated stepper (#39)
Browse files Browse the repository at this point in the history
* updated breadcrumb and sample config

* changes required

* added timline component and stringmanipulator

* modified date and stepper

* updated versions

* added version changes for css

---------

Co-authored-by: Jagankumar <[email protected]>
  • Loading branch information
Swathi-eGov and jagankumar-egov authored Apr 4, 2024
1 parent 53ffa9c commit d3fbd6e
Show file tree
Hide file tree
Showing 21 changed files with 138 additions and 158 deletions.
1 change: 1 addition & 0 deletions react/css/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ frontend/micro-ui/web/public/index.html
# Changelog
```bash
1.8.2-coreui.3 styles for stepper and fixed date issue
1.8.0-beta.13 fixed the login text styling issue
1.8.0-beta.1 styles for login dropdown and homepage dropdowns
1.8.0-beta added workbench related css and some new Digit v2 constants based on em
Expand Down
2 changes: 1 addition & 1 deletion react/css/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-css",
"version": "1.8.2-coreui.2",
"version": "1.8.2-coreui.3",
"license": "MIT",
"main": "dist/index.css",
"author": "Jagankumar <[email protected]>",
Expand Down
45 changes: 19 additions & 26 deletions react/css/src/digitv2/components/stepper.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,26 @@
color: theme(digitv2.lightTheme.paper-primary);
}

.secondary-color {
@apply text-center font-regular;
.stepper-label {
@extend .typography.body-s;
@apply text-center;
color: theme(digitv2.lightTheme.text-secondary);
font-family: theme(digitv2.fontFamily.sans);
font-size: 1rem;
line-height: 1.5rem;
letter-spacing: 0rem;
height: 1.5rem;

@media (max-width: 30rem) {
font-size: 0.875rem;
line-height: 1.25rem;
}

&.text-done {
&.completed {
color: theme(digitv2.lightTheme.text-primary);
}

&.text-active {
&.current {
@extend .typography.heading-s;
color: theme(digitv2.lightTheme.text-primary);
font-weight: theme(digitv2.fontWeight.bold);
line-height: 1.172rem;

@media (max-width: 30rem) {
font-size: 1rem;
}
}
}

Expand All @@ -56,13 +50,13 @@
}
}

.circle {
.stepper-circle {
@apply flex text-center justify-center items-center font-regular;
width: 2rem;
height: 2rem;
background-color: theme(digitv2.lightTheme.text-disabled);
border-radius: 50%;
margin-top:0.25rem;
margin-top: 0.25rem;


@media (max-width: 30rem) {
Expand All @@ -77,7 +71,7 @@
border-color: theme(digitv2.lightTheme.primary-orange);
}

.line {
.stepper-connect {
@apply absolute;
top: 1.25rem;
left: calc(50% + 0.5rem);
Expand Down Expand Up @@ -126,18 +120,16 @@
}

.digit-stepper-content:hover {
.circle.active {
.stepper-circle.active {
outline: 0.25rem solid #F477381F;
}

.text-done {
color: theme(digitv2.lightTheme.text-primary);
font-weight: theme(digitv2.fontWeight.bold);
line-height: 1.188rem;

@media (max-width: 30rem) {
font-size: 1rem;
line-height: 1.172rem;
.stepper-label{
font-size: 1rem;
line-height: 1.5rem;

&.completed{
@extend .typography.heading-s;
}
}
}
Expand All @@ -149,13 +141,14 @@
}

.digit-stepper-container::-webkit-scrollbar {
width: 0.625rem;
width: 0.313rem;
height: 0.625rem;
background-color: #F5F5F5;
}

.digit-stepper-container::-webkit-scrollbar-thumb {
background-color: #C1C1C1;
border-radius: 0.625rem;
border-radius: 0.313rem;
}

.digit-stepper-container::-webkit-scrollbar-thumb:hover {
Expand Down
28 changes: 2 additions & 26 deletions react/css/src/digitv2/components/textInputV2.scss
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@
filter: invert(85%) sepia(0%) saturate(337%) hue-rotate(50deg) brightness(99%) contrast(99%);
}

input[type="date"]:in-range::-webkit-datetime-edit,
input[type="time"]:in-range::-webkit-datetime-edit,
input[type="date"][value=""]::-webkit-datetime-edit,
input[type="time"][value=""]::-webkit-datetime-edit,
input[type="date"]:disabled::-webkit-datetime-edit,
input[type="time"]:disabled::-webkit-datetime-edit,
input[type="search"]::-webkit-search-cancel-button,
Expand Down Expand Up @@ -197,30 +197,6 @@
}
}
}

&.editableTime {

input[type="time"]:in-range::-webkit-datetime-edit,
input[type="time"]:disabled::-webkit-datetime-edit {
display: block !important;
}

input[type="time"][value=""]:not(:placeholder-shown)::before {
display: none !important;
}
}

&.editableDate {

input[type="date"]:in-range::-webkit-datetime-edit,
input[type="date"]:disabled::-webkit-datetime-edit {
display: block !important;
}

input[type="date"][value=""]:not(:placeholder-shown)::before {
display: none !important;
}
}
}


Expand Down
2 changes: 1 addition & 1 deletion react/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"build": "webpack --mode production"
},
"dependencies": {
"@egovernments/digit-ui-components": "0.0.1-beta.3",
"@egovernments/digit-ui-components": "0.0.1-beta.4",
"@egovernments/digit-ui-libraries": "1.8.2-beta.1",
"@egovernments/digit-ui-module-common": "1.7.10",
"@egovernments/digit-ui-module-core": "1.8.1-beta.6",
Expand Down
2 changes: 1 addition & 1 deletion react/modules/Project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"dependencies": {
"@egovernments/digit-ui-react-components": "1.8.1-beta.4",
"@egovernments/digit-ui-components": "0.0.1-beta.3",
"@egovernments/digit-ui-components": "0.0.1-beta.4",
"lodash": "^4.17.21",
"react": "17.0.2",
"react-date-range": "^1.4.0",
Expand Down
2 changes: 1 addition & 1 deletion react/modules/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"prepublish": "yarn build"
},
"dependencies": {
"@egovernments/digit-ui-components": "0.0.1-beta.3",
"@egovernments/digit-ui-components": "0.0.1-beta.4",
"@egovernments/digit-ui-react-components": "1.8.1-beta.4",
"react": "17.0.2",
"react-dom": "17.0.2",
Expand Down
2 changes: 1 addition & 1 deletion react/modules/sample/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"dependencies": {
"@egovernments/digit-ui-react-components": "1.8.1-beta.4",
"@egovernments/digit-ui-components": "0.0.1-beta.3",
"@egovernments/digit-ui-components": "0.0.1-beta.4",
"react": "17.0.2",
"react-date-range": "^1.4.0",
"react-dom": "17.0.2",
Expand Down
20 changes: 1 addition & 19 deletions react/modules/sample/src/configs/SampleConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,16 +261,7 @@ export const newConfig = [
disable: false,
infoMessage: "Select the date",
populators: { name: "date-With Info", error: "Error!" },
},
{
inline: true,
label: "EditableDate",
isMandatory: false,
description: "",
type: "date",
disable: false,
populators: { name: "date-EditableDate", error: "Error!" ,editableDate:true},
},
}
],
},
{
Expand Down Expand Up @@ -333,15 +324,6 @@ export const newConfig = [
infoMessage: "Select time",
populators: { name: "time-With Info", error: "Error!" },
},
{
inline: true,
label: "EditableTime",
isMandatory: false,
description: "",
type: "time",
disable: false,
populators: { name: "time-EditableTime", error: "Error!" ,editableTime:true},
},
],
},
{
Expand Down
8 changes: 5 additions & 3 deletions react/modules/sample/src/pages/employee/Sample.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ import {
InfoCard,
Stepper,
Button,
Timeline
Timeline,
} from "@egovernments/digit-ui-components";
import { Header } from "@egovernments/digit-ui-react-components";
import React from "react";
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import { newConfig } from "../../configs/SampleConfig";
import { useState } from "react";

const Create = () => {
const { t } = useTranslation();
Expand Down Expand Up @@ -186,6 +185,9 @@ const Create = () => {
"password-Error": "password",
"password-With Description": "password",
"password-With InfoMessage": "password",

"date-Noneditable": "2024-04-03",
"time-Noneditable": "03:00",
};

const onSubmit = (data) => {
Expand Down
2 changes: 1 addition & 1 deletion react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"@egovernments/digit-ui-module-sample": "0.0.1",
"@egovernments/digit-ui-react-components": "1.7.10",
"@egovernments/digit-ui-svg-components": "1.0.4",
"@egovernments/digit-ui-components": "0.0.1-beta.3",
"@egovernments/digit-ui-components": "0.0.1-beta.4",
"babel-loader": "8.1.0",
"clean-webpack-plugin": "4.0.0",
"css-loader": "5.2.6",
Expand Down
1 change: 1 addition & 0 deletions react/ui-components/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ yarn storybook
# Changelog

```bash
0.0.1-beta.4 fixed some date issues
0.0.3 Added new components
0.0.1 base version
```
Expand Down
4 changes: 2 additions & 2 deletions react/ui-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-components",
"version": "0.0.1-beta.3",
"version": "0.0.1-beta.4",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/index.modern.js",
Expand Down Expand Up @@ -51,7 +51,7 @@
"dist"
],
"dependencies": {
"@egovernments/digit-ui-css": "1.8.2-coreui.2",
"@egovernments/digit-ui-css": "1.8.2-coreui.3",
"@egovernments/digit-ui-libraries": "1.8.1-beta.1",
"@egovernments/digit-ui-svg-components": "1.0.4",
"@googlemaps/js-api-loader": "1.13.10",
Expand Down
33 changes: 23 additions & 10 deletions react/ui-components/src/atoms/MultiSelectDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const MultiSelectDropdown = ({
window?.Digit?.Hooks.useClickOutside(dropdownRef, handleOutsideClickAndSubmitSimultaneously, active, { capture: true });
const filtOptns =
searchQuery?.length > 0
? options.filter(
? options?.filter(
(option) =>
t(option[optionsKey] && typeof option[optionsKey] == "string" && option[optionsKey].toUpperCase())
.toLowerCase()
Expand All @@ -86,7 +86,7 @@ const MultiSelectDropdown = ({
function onSelectToAddToQueue(...props) {
if (variant === "treemultiselect") {
const currentoptions = props[0];
currentoptions.forEach((option) => {
currentoptions?.forEach((option) => {
const isAlreadySelected = alreadyQueuedSelectedState.some((selectedOption) => selectedOption.code === option.code);
if (!isAlreadySelected) {
dispatch({ type: "ADD_TO_SELECTED_EVENT_QUEUE", payload: [null, option] });
Expand Down Expand Up @@ -142,7 +142,7 @@ const MultiSelectDropdown = ({

const countFinalChildOptions = (totalselectedOptions) => {
let count = 0;
totalselectedOptions.forEach((option) => {
totalselectedOptions?.forEach((option) => {
if (!option.propsData[1]?.options) {
count += 1;
}
Expand Down Expand Up @@ -175,7 +175,7 @@ const MultiSelectDropdown = ({

const filteredOptions =
searchQuery?.length > 0
? options.filter(
? options?.filter(
(option) =>
t(option[optionsKey] && typeof option[optionsKey] == "string" && option[optionsKey].toUpperCase())
.toLowerCase()
Expand All @@ -185,7 +185,7 @@ const MultiSelectDropdown = ({

const flattenOptions = (options) => {
let flattened = [];
options.forEach((option) => {
options?.forEach((option) => {
if (option.options) {
flattened.push(option);
flattened = flattened.concat(option.options);
Expand Down Expand Up @@ -222,8 +222,13 @@ const MultiSelectDropdown = ({
alreadyQueuedSelectedState.find((selectedOption) => selectedOption.code === option.code) ? "checked" : ""
}`}
onMouseDown={() => setIsActive(true)}
onMouseUp={() => setIsActive(false)}
onMouseLeave={() => setIsActive(false)}
onMouseUp={() => setIsActive(false)}
onMouseLeave={() => setIsActive(false)}
style={
index === optionIndex && !alreadyQueuedSelectedState.find((selectedOption) => selectedOption.code === option.code)
? { opacity: 1, backgroundColor: "#FFFAF7", border: "0.5px solid #F47738" }
: {}
}
>
<input
type="checkbox"
Expand All @@ -245,7 +250,11 @@ const MultiSelectDropdown = ({
<div style={{ display: "flex", gap: "0.25rem", alignItems: "center", width: "100%" }}>
{config?.showIcon &&
option?.icon &&
IconRender(option?.icon, isActive,alreadyQueuedSelectedState.find((selectedOption) => selectedOption.code === option.code) ? true : false)}
IconRender(
option?.icon,
isActive,
alreadyQueuedSelectedState.find((selectedOption) => selectedOption.code === option.code) ? true : false
)}
<p className="digit-label">{t(option[optionsKey] && typeof option[optionsKey] == "string" && option[optionsKey])}</p>
</div>
{variant === "nestedtextmultiselect" && option.description && <div className="option-description">{option.description}</div>}
Expand All @@ -257,7 +266,11 @@ const MultiSelectDropdown = ({
const Menu = () => {
const optionsToRender = variant === "nestedmultiselect" ? flattenedOptions : filteredOptions;

return optionsToRender.map((option, index) => {
if (!optionsToRender) {
return null;
}

return optionsToRender?.map((option, index) => {
if (option.options) {
return (
<div key={index} className="digit-nested-category">
Expand Down Expand Up @@ -350,7 +363,7 @@ const MultiSelectDropdown = ({
border: "1px solid #F47738",
background: "#FAFAFA",
}}
textStyles={{height:"auto",fontSize: "0.875rem", fontWeight: "400", width: "100%", lineHeight: "16px", color: "#F47738" }}
textStyles={{ height: "auto", fontSize: "0.875rem", fontWeight: "400", width: "100%", lineHeight: "16px", color: "#F47738" }}
/>
)}
</div>
Expand Down
Loading

0 comments on commit d3fbd6e

Please sign in to comment.