react-core-ts 2.0.13 → 2.0.15

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.
@@ -0,0 +1,97 @@
1
+ .qbs-tree-list-container {
2
+ display: flex;
3
+ flex-direction: column;
4
+ }
5
+ .qbs-tree-list-container-sub {
6
+ display: flex;
7
+ flex-direction: row;
8
+ align-items: flex-start;
9
+ gap: 7px;
10
+ }
11
+
12
+ .qbs-tree-list-container-sub .no-children {
13
+ margin-left: 1.75rem; /* Corresponds to ml-7 in Tailwind */
14
+ }
15
+ .qbs-tree-list-container-sub-icon {
16
+ margin-top: 0.25rem; /* Corresponds to mt-1 in Tailwind */
17
+ cursor: pointer;
18
+ padding-top: 0.5rem; /* Corresponds to py-2 in Tailwind */
19
+ padding-bottom: 0.5rem;
20
+ transition: transform 0.3s ease; /* Smooth rotation transition */
21
+ color: #003c71;
22
+ }
23
+
24
+ .qbs-tree-list-container-sub-icon.expanded {
25
+ transform: rotate(90deg); /* Corresponds to rotate-90 in Tailwind */
26
+ }
27
+ .qbs-tree-list-container-sub-container {
28
+ display: flex;
29
+ gap: 15px; /* Corresponds to gap-2 in Tailwind */
30
+ padding: 0.5rem; /* Corresponds to p-2 in Tailwind */
31
+ flex-direction: row; /* Corresponds to flex-row in Tailwind */
32
+ width: 100%; /* Corresponds to w-full in Tailwind */
33
+ color: #3d414a;
34
+ }
35
+ .qbs-tree-list-container-sub-container-hideicon {
36
+ display: flex;
37
+ gap: 6px; /* Corresponds to gap-2 in Tailwind */
38
+ padding: 0.5rem; /* Corresponds to p-2 in Tailwind */
39
+ flex-direction: row; /* Corresponds to flex-row in Tailwind */
40
+ width: 100%; /* Corresponds to w-full in Tailwind */
41
+ color: #3d414a;
42
+ }
43
+ .qbs-tree-list-container-sub-container-hideicon:hover {
44
+ color: #003c71;
45
+ background-color: rgba(141, 194, 240, 0.15) !important;
46
+ }
47
+ .qbs-tree-list-container-sub-container:hover {
48
+ color: #003c71;
49
+ background-color: rgba(141, 194, 240, 0.15) !important;
50
+ }
51
+ .qbs-tree-list-container-sub-container.qbs-expanded-child {
52
+ color: #003c71;
53
+ }
54
+ .qbs-tree-list-container-sub-text.qbs-expanded-child {
55
+ color: #003c71;
56
+ }
57
+ .qbs-tree-list-container-sub-text:hover {
58
+ color: #003c71;
59
+ /* background-color: rgba(141, 194, 240, 0.15) !important; */
60
+ }
61
+
62
+ .qbs-tree-list-container-sub-container.checked,
63
+ .qbs-tree-list-container-sub-container-hideicon.checked {
64
+ color: #003c71;
65
+ background-color: rgba(
66
+ 141,
67
+ 194,
68
+ 240,
69
+ 0.15
70
+ ) !important; /* Corresponds to bg-green-200 in Tailwind */
71
+ }
72
+
73
+ .marginLeft {
74
+ margin-left: 28px; /* Corresponds to ml-2 in Tailwind */
75
+ }
76
+ .lightmarginLeft {
77
+ margin-left: 19px; /* Corresponds to ml-2 in Tailwind */
78
+ }
79
+ .qbs-tree-list-container-sub- {
80
+ line-height: 18px; /* Corresponds to leading-[18px] in Tailwind */
81
+ font-size: 0.875rem; /* Corresponds to text-sm in Tailwind (14px) */
82
+ }
83
+ .qbs-tree-list-container-child {
84
+ margin-left: 1rem; /* Corresponds to ml-4 in Tailwind */
85
+ margin-top: 0.5rem; /* Corresponds to mt-2 in Tailwind */
86
+ display: flex; /* Corresponds to flex in Tailwind */
87
+ flex-direction: column; /* Corresponds to flex-col in Tailwind */
88
+ gap: 0.5rem; /* Corresponds to gap-2 in Tailwind */
89
+ }
90
+ .qbs-tree-list-container-sub-text {
91
+ line-height: 18px; /* Corresponds to leading-[18px] in Tailwind */
92
+ font-size: 14px; /* Corresponds to text-sm in Tailwind (14px) */
93
+ font-weight: 500;
94
+ letter-spacing: 0.28px;
95
+ font-family: 'Noto Sans';
96
+ /* color: #3d414a; */
97
+ }
@@ -0,0 +1,8 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
4
+
5
+ @import './components/autocomplete.css';
6
+ @import './components/treedropdown.css';
7
+ @import './components/selectedautocomplete.css';
8
+ @import './components/tooltip.css';
package/docs/App.tsx CHANGED
@@ -1,12 +1,13 @@
1
1
  import React, { useState } from "react";
2
2
 
3
3
  import { ValueProps } from "../src/commontypes";
4
- import { AutoComplete, AutoCompleteWithSelectedList, AutoCompleteWithTabFilter, AutoCompleteWithTreeStructure, ExpandableAutoComplete, ModernAutoComplete, ModernAutoCompleteDropdown, ModernTextField, ReactAutoCompleteTableView } from "../src/index";
4
+ import { AutoComplete, AutoCompleteWithSelectedList, AutoCompleteWithTabFilter, AutoCompleteWithTreeStructure, ExpandableAutoComplete, ModernAutoComplete, ModernAutoCompleteDropdown, ModernAutoCompleteTableView, ModernTextField } from "../src/index";
5
5
  import ModernTextArea from "../src/ReactTextArea";
6
6
  import TextField from "../src/ReactTextField";
7
7
  import { treeDropData } from "./store";
8
8
 
9
9
  import "../src/styles/global.css";
10
+ import SettingsIcon from "../src/components/customIcons/Settings";
10
11
 
11
12
  export default function App() {
12
13
  const [dropData, setDropData] = useState();
@@ -95,7 +96,7 @@ export default function App() {
95
96
  }}
96
97
  >
97
98
  <div style={{ width: 300 }}>
98
- <ReactAutoCompleteTableView
99
+ <ModernAutoCompleteTableView
99
100
  name="sample"
100
101
  label="TextField"
101
102
  id="id"
@@ -196,6 +197,11 @@ export default function App() {
196
197
  autoDropdown={true}
197
198
  tabInlineSearch={false}
198
199
  //autoTabSelectAll={false}
200
+ moreOptionTab={
201
+ <MoreOptionsComponent />
202
+ }
203
+ moreOptionTabLabel="Settings"
204
+ onMoreOptionChange={(values) => console.log(values, "onMoreOptionChange")}
199
205
  />
200
206
  </div>
201
207
 
@@ -685,3 +691,39 @@ export default function App() {
685
691
  </React.Fragment>
686
692
  );
687
693
  }
694
+
695
+
696
+ interface MoreOptionsComponentProps {
697
+ onApply?: (values?: any) => void;
698
+ onValueChange?: (values?: any) => void;
699
+ }
700
+
701
+ const MoreOptionsComponent = ({ onApply, onValueChange }: MoreOptionsComponentProps) => {
702
+ const [checked, setChecked] = useState(false);
703
+
704
+ const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
705
+ const newValue = e.target.checked;
706
+ setChecked(newValue);
707
+ // Trigger onValueChange when value changes
708
+ onValueChange?.({ includeAll: newValue });
709
+ };
710
+
711
+ const handleApply = () => {
712
+ // Pass values to onApply callback
713
+ onApply?.({ includeAll: checked });
714
+ };
715
+
716
+ return (
717
+ <div className="qbs-gap-2 ms-2">
718
+ <input
719
+ type="checkbox"
720
+ checked={checked}
721
+ onChange={handleChange}
722
+ />
723
+ Include all items
724
+ <div className="qbs-flex qbs-items-center qbs-justify-end">
725
+ <button onClick={handleApply}>Apply</button>
726
+ </div>
727
+ </div>
728
+ );
729
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-core-ts",
3
- "version": "2.0.13",
3
+ "version": "2.0.15",
4
4
  "description": "React Components",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -89,7 +89,11 @@ const AutoCompleteWithTabFilter = forwardRef<
89
89
  toolTabClearSwitch = false,
90
90
  onToolTabChange,
91
91
  autoRefreshMainDropdown = true,
92
- autoTabSelectAll = true
92
+ autoTabSelectAll = true,
93
+ moreOptionTab,
94
+ moreOptionTabLabel,
95
+ moreOptionTabIcon,
96
+ onMoreOptionChange
93
97
  },
94
98
  ref
95
99
  ) => {
@@ -961,10 +965,11 @@ const AutoCompleteWithTabFilter = forwardRef<
961
965
  setAllDataLoaded(false);
962
966
  }, [showToolsTab]);
963
967
 
964
- const handleApplyTabFilter = useCallback(() => {
968
+ const handleApplyTabFilter = useCallback((moreOptionValues?: any) => {
965
969
  // Set flag to trigger effect when data loads
966
970
  setApplyTabFilter(true);
967
971
  handlePickSuggestions(searchValue ? searchValue : '*', 1);
972
+ // Note: onMoreOptionChange is called when values change in the component, not here
968
973
  }, [searchValue, handlePickSuggestions]);
969
974
 
970
975
  useEffect(() => {
@@ -1421,6 +1426,10 @@ const AutoCompleteWithTabFilter = forwardRef<
1421
1426
  enableSelectAll={enableSelectAll}
1422
1427
  applyTabFilter={handleApplyTabFilter}
1423
1428
  onToolClose={() => setShowToolsTab(false)}
1429
+ moreOptionTab={moreOptionTab}
1430
+ moreOptionTabLabel={moreOptionTabLabel}
1431
+ moreOptionTabIcon={moreOptionTabIcon}
1432
+ onMoreOptionChange={onMoreOptionChange}
1424
1433
  />)
1425
1434
  }
1426
1435
  </div>