@omniumretail/component-library 1.2.34 → 1.2.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.css CHANGED
@@ -32,3 +32,4 @@
32
32
  .OJKeuXyOSPIeCCssVum2{display:flex;gap:32px}.jzxszvL7wzCV5nztJL0S{padding:12px}.OGA8oJw8RDyohcRftjmo{width:100%}.y2_7QVPOhjRZlAHCRWKf{display:grid;grid-template-columns:minmax(200px, 1fr) auto auto auto auto;gap:46px}.Smkcs3LGp1uPuQge2GxE{margin-top:16px}Label{margin-bottom:8px}.djarlYFkE9Kb7wUjUnrY{height:36px}
33
33
  :root{--color-grey: #e4e4e4;--color-grey-100: #E5E5E5}.SF5f_Q_Ggz_4JHUHS2Xa{display:flex;align-items:center;padding:13px 20px;box-sizing:border-box;height:72px}.SF5f_Q_Ggz_4JHUHS2Xa *{box-sizing:border-box}.gSVYvBn1sLbcMsGI32b9{display:flex;flex-grow:1;align-items:flex-end;justify-content:center;max-width:calc(100% - 60px)}.gSVYvBn1sLbcMsGI32b9 img{max-width:196px}.gSVYvBn1sLbcMsGI32b9 .fVSt3bSZBcJGsOdA5nIN{font-weight:var(--font-weight-semibold);text-transform:uppercase;color:var(--color-black)}.BIBQmS_NwoMw2Ncq5yuN{cursor:pointer;padding:4px 4px 4px 0;font-size:20px;width:30px;display:flex;align-items:center;justify-content:center}.ZinSgUtysxITkbGRKdux{position:fixed;top:0;left:-100%;bottom:0;width:100%;max-width:430px;background-color:var(--color-white);padding-inline:15px;z-index:999;box-shadow:0 3px 12px rgba(0,0,0,.45);transition:.6s ease-out}.ZinSgUtysxITkbGRKdux.FW1pOdad0uN5LO9h5PgQ{left:0;transition:.3s ease-in}.ZfA8OEmbRzRsNqLAmdtn{background-color:rgba(0,0,0,.3);backdrop-filter:blur(1px);position:absolute;left:0;top:0;right:0;bottom:0;z-index:998;pointer-events:none;opacity:0;transition:.3s}.ZfA8OEmbRzRsNqLAmdtn.FW1pOdad0uN5LO9h5PgQ{opacity:1;pointer-events:all}.YKSQJmdRP_7tKwvQpeuV{width:calc(100% + 30px);margin-left:-15px;background-color:var(--color-orange);display:flex;align-items:center;justify-content:center}.ISssYC5Uz452JVWP0xDc img{max-width:160px}.E6YZPpa60LxA7qqIW7jQ{position:absolute;top:23px;right:15px;font-size:25px;cursor:pointer;color:var(--color-white)}.YYp3pzktjEDEyW8knAZQ{overflow-y:auto;height:calc(100% - 51px);margin:0;padding:0}.u7k2VQ30AQDk6mKA22GX{height:60px;padding:10px;display:flex;align-items:center;border-bottom:1px solid var(--color-black);cursor:pointer;transition:.3s;text-transform:uppercase;width:100%}.u7k2VQ30AQDk6mKA22GX:hover{background-color:var(--color-grey);color:var(--color-black)}.QQoDB9XPcAK18l2DIym4{list-style:none}.QQoDB9XPcAK18l2DIym4.wrXCksst57UpQuCNgGkN{height:auto;display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;padding-bottom:0}.QQoDB9XPcAK18l2DIym4.wrXCksst57UpQuCNgGkN>.u7k2VQ30AQDk6mKA22GX{position:relative}.QQoDB9XPcAK18l2DIym4.wrXCksst57UpQuCNgGkN>.u7k2VQ30AQDk6mKA22GX .NytmT59TmaWHc4FLM2wa{position:absolute;width:60px;height:100%;background:var(--color-black);right:0;display:flex;align-items:center;justify-content:center}.QQoDB9XPcAK18l2DIym4.wrXCksst57UpQuCNgGkN>.u7k2VQ30AQDk6mKA22GX .NytmT59TmaWHc4FLM2wa:hover{background-color:var(--color-orange)}.QQoDB9XPcAK18l2DIym4.wrXCksst57UpQuCNgGkN>.u7k2VQ30AQDk6mKA22GX .zo7CFksIKx7Fahu4e4S_{color:var(--color-white)}.QQoDB9XPcAK18l2DIym4.wrXCksst57UpQuCNgGkN.yk4DnBgiUlzk23Yg_q6E{background:var(--color-grey)}.QQoDB9XPcAK18l2DIym4.wrXCksst57UpQuCNgGkN.yk4DnBgiUlzk23Yg_q6E .NytmT59TmaWHc4FLM2wa{background-color:var(--color-orange)}.QQoDB9XPcAK18l2DIym4.wrXCksst57UpQuCNgGkN.yk4DnBgiUlzk23Yg_q6E .uLgjMU9sbvfaa0qKEguP{height:auto;opacity:1}.uLgjMU9sbvfaa0qKEguP{padding:0;width:100%;margin:0;background-color:var(--color-orange);color:var(--color-white);height:0;opacity:0;overflow:hidden;transition:height .3s ease,opacity .3s ease}.uLgjMU9sbvfaa0qKEguP .u7k2VQ30AQDk6mKA22GX{min-height:60px;height:auto;padding-inline:40px}.efnjUnudkE0UTVQ6wrgH{cursor:pointer}.u7k2VQ30AQDk6mKA22GX .fjNRYZMP1O0pTvBDBB3L span{margin-left:8px;transform:translateY(-2px);display:inline-block;font-size:var(--font-size-body-3);text-transform:capitalize}
34
34
  @media(max-width: 768px){.muC1BdCbIEMIs70EtJoA{position:unset}}.msELhnfhfo6un3c4Spoc{max-width:300px;max-height:400px;padding:0 !important}@media(max-width: 768px){.msELhnfhfo6un3c4Spoc{max-width:100vw}}@media(min-width: 1024px){.msELhnfhfo6un3c4Spoc{max-width:600px;max-height:700px}}@media(max-width: 768px){.oGsIq0O_Hzwg2mLR72la{position:absolute}}.KSVguXBQ_A1SUSR6e8Wq{overflow-y:auto;max-height:calc(100vh - 60px - 72px - 43px)}.GeNg2HVTmhQDmsLLTpWj{display:flex;flex-direction:column;align-items:unset !important;padding:10px;border-bottom:1px solid #f0f0f0;background-color:#fff !important;cursor:pointer}.GeNg2HVTmhQDmsLLTpWj:hover{background-color:#f9f9f9}@media(max-width: 768px){.GeNg2HVTmhQDmsLLTpWj{padding:8px}}.GBb48KXbGnQtAY8xqmUp{display:flex;justify-content:space-between;align-items:center;padding:10px;background-color:#f5f5f5;border-bottom:1px solid #e8e8e8}.LoCH7sYpmK3VgRASqTgz{font-size:20px;cursor:pointer;color:#595959}.Xjs10kZPSsD_BVFomnIe{color:#ff674c;margin-right:8px}.oibCayv_cOyhyWCKzHSr{display:flex;align-items:center;gap:10px}.oibCayv_cOyhyWCKzHSr span{font-size:14px;font-weight:500;color:#595959}.hhwYXSd0CR75D8ETnUML{display:flex;align-items:center;position:relative;padding-left:12px}@media(max-width: 768px){.hhwYXSd0CR75D8ETnUML{padding-left:8px}}.LkP1cqeAyAYI9rCurnE8{position:absolute;left:0;top:50%;transform:translateY(-50%);font-size:16px}@media(max-width: 768px){.LkP1cqeAyAYI9rCurnE8{font-size:12px}}.u_jT9kmq2kyThRlj8HT1{width:50px;height:50px;margin-left:10px;margin-right:10px}@media(max-width: 768px){.u_jT9kmq2kyThRlj8HT1{width:40px;height:40px;margin-left:8px;margin-right:8px}}.ieGdf5FTgLUPcfuZi7Xz{flex:1;overflow:hidden}.QgZ3oHW9IRTexL8xWVqP{font-weight:bold;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;max-width:100%}@media(max-width: 768px){.QgZ3oHW9IRTexL8xWVqP{font-size:12px}}.JwfbSOSIRAz5OO2hiSFc{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;max-width:100%;font-size:12px;color:#666;margin-top:2px}@media(max-width: 768px){.JwfbSOSIRAz5OO2hiSFc{font-size:10px}}.XfXQBYqMfZc4p8s2Mhla{width:6px;height:6px;background-color:#1890ff;border-radius:50%;margin-left:10px}@media(max-width: 768px){.XfXQBYqMfZc4p8s2Mhla{width:4px;height:4px;margin-left:8px}}.RGXTlVxCxbZpD6__J5_g{font-size:12px}.rWa5cnbZQLDtxFxJU6qA{font-size:20px;cursor:pointer}@media(max-width: 768px){.rWa5cnbZQLDtxFxJU6qA{font-size:18px}}.Pus_rAoqX05D4Qz2pYxo{animation:Pus_rAoqX05D4Qz2pYxo 1s ease-in-out infinite}@keyframes Pus_rAoqX05D4Qz2pYxo{0%{transform:rotate(0deg)}25%{transform:rotate(10deg)}50%{transform:rotate(-10deg)}75%{transform:rotate(10deg)}100%{transform:rotate(0deg)}}
35
+ .rUOcBpTPxrzfRw36v939{display:flex;align-items:center;width:100%;margin:16px 0;box-sizing:border-box}.rUOcBpTPxrzfRw36v939 .ant-descriptions{width:calc(100vw - 24px)}.rUOcBpTPxrzfRw36v939 .ant-descriptions-item-label{max-width:140px !important;padding:8px 16px !important;color:var(--color-blue) !important;font-weight:700 !important;font-size:12px !important}.rUOcBpTPxrzfRw36v939 .ant-descriptions-item-content{padding:8px 16px !important;font-size:12px !important}.cyz9pmVdkD7z1n7QUlfu{width:100vw !important;max-width:100vw !important}.PQ794lq3KZF_sigL5bbI{overflow:hidden !important}.PQ794lq3KZF_sigL5bbI .ant-modal .ant-modal-body{overflow-y:auto;overflow-x:hidden;max-height:80vh}.PQ794lq3KZF_sigL5bbI .ant-modal .ant-modal-content{padding:20px 12px !important}.PQ794lq3KZF_sigL5bbI .ant-modal-header{text-align:center !important}.PQ794lq3KZF_sigL5bbI .ant-modal-close{color:var(--button-default-background-hover-color)}.b23UIWngPXOEh5FC2mcC{display:flex;justify-content:center}.b23UIWngPXOEh5FC2mcC.DEfmwZ5CmWvodIcPVgfo{justify-content:space-between}.lIEwxxVD_vq2cGux3ehI{color:var(--button-default-background);font-size:26px}.ckRiBia09XQRtMVbNqvy{color:#c7cac9;pointer-events:none}
@@ -0,0 +1,21 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ interface Action {
3
+ key: string;
4
+ label: string;
5
+ onClick: () => void;
6
+ }
7
+ interface MobileTableProps {
8
+ data: Record<string, any>;
9
+ translation: string;
10
+ modalVisible: boolean;
11
+ setModalVisible: Dispatch<SetStateAction<boolean>>;
12
+ actions: Action[];
13
+ hasArrows?: boolean;
14
+ handlePrev?: () => void;
15
+ handleNext?: () => void;
16
+ hiddenColumns?: string[];
17
+ modalTableData?: any;
18
+ currentIndex?: number;
19
+ }
20
+ export declare const MobileTable: ({ data, translation, modalVisible, setModalVisible, actions, hiddenColumns, hasArrows, handleNext, handlePrev, modalTableData, currentIndex }: MobileTableProps) => import("react/jsx-runtime").JSX.Element;
21
+ export {};
@@ -0,0 +1,22 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ interface Action {
3
+ key: string;
4
+ label: string;
5
+ onClick: () => void;
6
+ }
7
+ interface MobileTableProps {
8
+ data: Record<string, any>;
9
+ translation: string;
10
+ modalVisible: boolean;
11
+ setModalVisible: Dispatch<SetStateAction<boolean>>;
12
+ actions: Action[];
13
+ title: string;
14
+ hasArrows?: boolean;
15
+ handlePrev?: () => void;
16
+ handleNext?: () => void;
17
+ hiddenColumns?: string[];
18
+ modalTableData?: any;
19
+ currentIndex?: number;
20
+ }
21
+ export declare const MobileTable: ({ data, title, translation, modalVisible, setModalVisible, actions, hiddenColumns, hasArrows, handleNext, handlePrev, modalTableData, currentIndex }: MobileTableProps) => import("react/jsx-runtime").JSX.Element;
22
+ export {};
@@ -18,5 +18,6 @@ export interface customTagProps extends TagProps {
18
18
  value: string;
19
19
  }[];
20
20
  inputPlacehold?: string;
21
+ inputDefaultAdvancedFilter?: string;
21
22
  }
22
23
  export declare const TagField: (props: customTagProps) => import("react/jsx-runtime").JSX.Element;
@@ -30,3 +30,4 @@ export * from './WebCam';
30
30
  export * from './ResponseType';
31
31
  export * from './Header';
32
32
  export * from './BellNotifications';
33
+ export * from './MobileTable';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/component-library",
3
- "version": "1.2.34",
3
+ "version": "1.2.36",
4
4
  "private": false,
5
5
  "main": "dist/bundle.js",
6
6
  "typings": "./dist/types/index",
@@ -0,0 +1,99 @@
1
+ import styles from './styles.module.scss';
2
+ import { Descriptions, Dropdown, Menu, Modal } from 'antd';
3
+ import { useTranslation } from 'react-i18next';
4
+ import {
5
+ LeftCircleOutlined,
6
+ RightCircleOutlined,
7
+ } from "@ant-design/icons";
8
+ import { Dispatch, SetStateAction } from 'react';
9
+ import React from 'react';
10
+ import { Button } from '../Button';
11
+
12
+ interface Action {
13
+ key: string;
14
+ label: string;
15
+ onClick: () => void;
16
+ }
17
+
18
+ interface MobileTableProps {
19
+ data: Record<string, any>;
20
+ translation: string;
21
+ modalVisible: boolean;
22
+ setModalVisible: Dispatch<SetStateAction<boolean>>;
23
+ actions: Action[];
24
+ title: string;
25
+ hasArrows?: boolean;
26
+ handlePrev?: () => void;
27
+ handleNext?: () => void;
28
+ hiddenColumns?: string[];
29
+ modalTableData?: any;
30
+ currentIndex?: number;
31
+ }
32
+
33
+ export const MobileTable = (
34
+ {
35
+ data, title, translation, modalVisible, setModalVisible, actions = [], hiddenColumns = [], hasArrows = true, handleNext, handlePrev, modalTableData, currentIndex
36
+ }: MobileTableProps) => {
37
+
38
+ const { t } = useTranslation();
39
+
40
+ const menu = (
41
+ <Menu>
42
+ {actions.map((action, index) => (
43
+ <React.Fragment key={action.key}>
44
+ <Menu.Item key={action.key} onClick={action.onClick}>
45
+ {action.label}
46
+ </Menu.Item>
47
+
48
+ {index < actions.length - 1 && <Menu.Divider />}
49
+ </React.Fragment>
50
+ ))}
51
+ </Menu>
52
+ );
53
+
54
+ return (
55
+ <Modal
56
+ title={title}
57
+ open={modalVisible}
58
+ onCancel={() => setModalVisible(false)}
59
+ className={styles.fullScreenModal}
60
+ wrapClassName={styles.wrapModal}
61
+ centered
62
+ footer={(
63
+ <div className={`${styles.footer} ${hasArrows ? styles.center : ""}`}>
64
+ {hasArrows &&
65
+ <LeftCircleOutlined
66
+ className={`${styles.arrowIcons} ${currentIndex === 0 ? styles.disabledIcon : ""}`}
67
+ onClick={handlePrev}
68
+ disabled={currentIndex === 0}
69
+ />
70
+ }
71
+
72
+ <Dropdown overlay={menu}>
73
+ <Button>{t("tableHeadings.action")}</Button>
74
+ </Dropdown>
75
+
76
+ {hasArrows &&
77
+ <RightCircleOutlined
78
+ className={`${styles.arrowIcons} ${currentIndex === modalTableData?.length! - 1 ? styles.disabledIcon : ""}`}
79
+ onClick={handleNext}
80
+ disabled={currentIndex === modalTableData?.length! - 1}
81
+ />
82
+ }
83
+ </div>
84
+ )}
85
+ >
86
+ <div className={styles.details}>
87
+ <Descriptions bordered column={{ xs: 1, sm: 1, md: 1 }}>
88
+ {Object.entries(data)
89
+ .filter(([key]) => !hiddenColumns.includes(key))
90
+ .map(([key, value]) => (
91
+ <Descriptions.Item key={key} label={t(`${translation}.${key}`, key)}>
92
+ {Array.isArray(value) ? value.join(", ") : value ?? "-"}
93
+ </Descriptions.Item>
94
+ ))}
95
+ </Descriptions>
96
+ </div>
97
+ </Modal>
98
+ );
99
+ };
@@ -0,0 +1,74 @@
1
+ .details {
2
+ display: flex;
3
+ align-items: center;
4
+ width: 100%;
5
+ margin: 16px 0;
6
+ box-sizing: border-box;
7
+
8
+ :global {
9
+ .ant-descriptions {
10
+ width: calc(100vw - 24px);
11
+ }
12
+
13
+ .ant-descriptions-item-label {
14
+ max-width: 140px !important;
15
+ padding: 8px 16px !important;
16
+ color: var(--color-blue) !important;
17
+ font-weight: 700 !important;
18
+ font-size: 12px !important;
19
+ }
20
+
21
+ .ant-descriptions-item-content {
22
+ padding: 8px 16px !important;
23
+ font-size: 12px !important;
24
+ }
25
+ }
26
+ }
27
+
28
+ .fullScreenModal {
29
+ width: 100vw !important;
30
+ max-width: 100vw !important;
31
+ }
32
+
33
+ .wrapModal {
34
+ overflow: hidden !important;
35
+
36
+ :global {
37
+ .ant-modal .ant-modal-body {
38
+ overflow-y: auto;
39
+ overflow-x: hidden;
40
+ max-height: 80vh;
41
+ }
42
+
43
+ .ant-modal .ant-modal-content {
44
+ padding: 20px 12px !important;
45
+ }
46
+
47
+ .ant-modal-header {
48
+ text-align: center !important;
49
+ }
50
+
51
+ .ant-modal-close {
52
+ color: var(--button-default-background-hover-color);
53
+ }
54
+ }
55
+ }
56
+
57
+ .footer {
58
+ display: flex;
59
+ justify-content: center;
60
+
61
+ &.center {
62
+ justify-content: space-between;
63
+ }
64
+ }
65
+
66
+ .arrowIcons {
67
+ color: var(--button-default-background);
68
+ font-size: 26px;
69
+ }
70
+
71
+ .disabledIcon {
72
+ color: #c7cac9;
73
+ pointer-events: none;
74
+ }
@@ -22,7 +22,8 @@ const Template: Story<TagProps> = (args) => {
22
22
  advancedTags={advancedsFilters}
23
23
  tagsInfo={setTagsInfo}
24
24
  advancedTagsInfo={setAdvancedTagsInfo}
25
- addExtraTags={"ola"}>
25
+ inputPlacehold="ola"
26
+ >
26
27
  </TagField>;
27
28
  }
28
29
 
@@ -20,15 +20,17 @@ export interface customTagProps extends TagProps {
20
20
  hideAdvancedFilters?: boolean;
21
21
  defaultAdvancedFilters?: { display: string; value: string }[];
22
22
  inputPlacehold?: string;
23
+ inputDefaultAdvancedFilter?: string;
23
24
  }
24
25
 
25
26
  export const TagField = (props: customTagProps) => {
26
- const { customTags = [], advancedTags, disable, defaultAdvancedFilters = [], hideAdvancedFilters = false, inputPlacehold } = props;
27
+ const { customTags = [], advancedTags, disable, defaultAdvancedFilters = [], hideAdvancedFilters = false, inputPlacehold, inputDefaultAdvancedFilter = "" } = props;
27
28
 
28
29
  const [tags, setTags] = useState<string[]>(customTags.filter(tag => !tag.includes('=')));
29
30
  const [inputVisible, setInputVisible] = useState<boolean>(false);
30
- const [inputValue, setInputValue] = useState('');
31
- // const [switchValue, setSwitchValue] = useState<boolean>(false);
31
+ const [inputValue, setInputValue] = useState(
32
+ inputDefaultAdvancedFilter !== "" ? inputDefaultAdvancedFilter + '=' : ''
33
+ ); // const [switchValue, setSwitchValue] = useState<boolean>(false);
32
34
  const inputRef = useRef<InputRef>(null);
33
35
  const [advancedTagList, setAdvancedTagList] = useState<Array<{ display: string; value: string }>>(
34
36
  defaultAdvancedFilters
@@ -30,3 +30,4 @@ export * from './WebCam';
30
30
  export * from './ResponseType';
31
31
  export * from './Header';
32
32
  export * from './BellNotifications';
33
+ export * from './MobileTable';
@@ -7,7 +7,7 @@
7
7
  "role": "Posição",
8
8
  "type": "Tipo",
9
9
  "id": "Id",
10
- "action": "Ação"
10
+ "action": "Ações"
11
11
  },
12
12
  "userInfoColumn": {
13
13
  "Date": "Data",