@agilant/toga-blox 1.0.47 → 1.0.49
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/components/Badge/Badge.js +1 -1
- package/dist/components/Dropdown/Dropdown.js +1 -1
- package/dist/components/HeaderFilterIcon/HeaderFilterIcon.d.ts +4 -0
- package/dist/components/HeaderFilterIcon/HeaderFilterIcon.js +60 -0
- package/dist/components/HeaderFilterIcon/HeaderFilterIcon.stories.d.ts +9 -0
- package/dist/components/HeaderFilterIcon/HeaderFilterIcon.stories.js +76 -0
- package/dist/components/HeaderFilterIcon/HeaderFilterIcon.test.d.ts +1 -0
- package/dist/components/HeaderFilterIcon/HeaderFilterIcon.test.js +104 -0
- package/dist/components/HeaderFilterIcon/index.d.ts +2 -0
- package/dist/components/HeaderFilterIcon/index.js +2 -0
- package/dist/components/HeaderFilterIcon/types.d.ts +22 -0
- package/dist/components/HeaderFilterIcon/types.js +1 -0
- package/dist/components/Input/Input.js +3 -3
- package/dist/components/InputAndCheck/InputAndCheck.js +0 -9
- package/dist/components/MagnifyingIcon/MagnifyingIcon.js +1 -1
- package/dist/components/MagnifyingIcon/MagnifyingIcon.stories.js +1 -0
- package/dist/components/PrimaryTableHeader/PrimaryTableHeader.js +2 -2
- package/dist/components/SearchInput/SearchDropdownInput.d.ts +1 -0
- package/dist/components/SearchInput/SearchDropdownInput.js +2 -3
- package/dist/components/SearchInput/SearchInput.d.ts +1 -1
- package/dist/components/SearchInput/SearchInput.js +9 -51
- package/dist/components/SearchInput/SearchInput.stories.d.ts +1 -1
- package/dist/components/SearchInput/SearchInput.stories.js +32 -53
- package/dist/components/SearchInput/SearchInput.test.d.ts +1 -0
- package/dist/components/SearchInput/SearchInput.test.js +519 -0
- package/dist/components/SearchInput/SearchInput.types.d.ts +8 -12
- package/dist/components/SearchInput/SearchInputDatePicker.d.ts +23 -0
- package/dist/components/SearchInput/SearchInputDatePicker.js +72 -0
- package/dist/components/SearchInput/SearchNumberInput.d.ts +2 -14
- package/dist/components/SearchInput/SearchNumberInput.js +16 -35
- package/dist/components/SearchInput/SearchTextInput.d.ts +2 -11
- package/dist/components/SearchInput/SearchTextInput.js +8 -27
- package/package.json +2 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import SearchInput from "./SearchInput";
|
|
3
|
-
import { getFontAwesomeIcon } from "../../utils/getFontAwesomeIcon";
|
|
4
3
|
import { useState } from "react";
|
|
5
4
|
export default {
|
|
6
5
|
title: "Components/SearchInput",
|
|
@@ -13,10 +12,6 @@ export default {
|
|
|
13
12
|
options: ["text", "number", "boolean", "date", "multiSelect"],
|
|
14
13
|
},
|
|
15
14
|
},
|
|
16
|
-
closeOutSearch: { control: "none", table: { disable: true } },
|
|
17
|
-
setResetSearch: { control: "none", table: { disable: true } },
|
|
18
|
-
column: { control: "none", table: { disable: true } },
|
|
19
|
-
setEditingHeader: { control: "none", table: { disable: true } },
|
|
20
15
|
dropdownIconProp: {
|
|
21
16
|
control: "object",
|
|
22
17
|
description: "Icon configuration for dropdown",
|
|
@@ -56,6 +51,10 @@ const Template = (args) => {
|
|
|
56
51
|
const [minValue, setMinValue] = useState();
|
|
57
52
|
const [maxValue, setMaxValue] = useState();
|
|
58
53
|
const [selectedValue, setSelectedValue] = useState(args.selectedValue || []);
|
|
54
|
+
// NEW: State for date control
|
|
55
|
+
const [selectedDate, setSelectedDate] = useState(args.selectedDate);
|
|
56
|
+
const [selectedStartDate, setSelectedStartDate] = useState(args.selectedStartDate);
|
|
57
|
+
const [selectedEndDate, setSelectedEndDate] = useState(args.selectedEndDate);
|
|
59
58
|
// Handle onChange from the multi-select
|
|
60
59
|
const handleOnChange = (newSelected) => {
|
|
61
60
|
setSelectedValue(newSelected);
|
|
@@ -63,23 +62,25 @@ const Template = (args) => {
|
|
|
63
62
|
args.onChange?.(newSelected);
|
|
64
63
|
console.log("Selected items:", newSelected);
|
|
65
64
|
};
|
|
66
|
-
return (_jsx(SearchInput, { ...args, selectedDropdownOption: selectedOption, onDropdownOptionSelect: (option) => setSelectedOption(option), searchItems: searchItems, setSearchItems: setSearchItems, toggleStatus: toggleStatus, setToggleStatus: setToggleStatus, minValue: minValue, maxValue: maxValue, setMinValue: setMinValue, setMaxValue: setMaxValue, onChange: handleOnChange, selectedValue: selectedValue }));
|
|
65
|
+
return (_jsx(SearchInput, { ...args, selectedDropdownOption: selectedOption, onDropdownOptionSelect: (option) => setSelectedOption(option), searchItems: searchItems, setSearchItems: setSearchItems, toggleStatus: toggleStatus, setToggleStatus: setToggleStatus, minValue: minValue, maxValue: maxValue, setMinValue: setMinValue, setMaxValue: setMaxValue, onChange: handleOnChange, selectedValue: selectedValue, selectedDate: selectedDate, onDateSelect: setSelectedDate, selectedStartDate: selectedStartDate, onStartDateSelect: setSelectedStartDate, selectedEndDate: selectedEndDate, onEndDateSelect: setSelectedEndDate }));
|
|
67
66
|
};
|
|
68
67
|
export const Default = Template.bind({});
|
|
69
68
|
Default.args = {
|
|
70
69
|
inputType: "text",
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
handleFilter: () => console.log(`Filter applied`),
|
|
71
|
+
dropdownOptions: [
|
|
72
|
+
"Starts with",
|
|
73
|
+
"Ends with",
|
|
74
|
+
"Exactly",
|
|
75
|
+
"Includes",
|
|
76
|
+
"Excludes",
|
|
77
|
+
],
|
|
78
|
+
selectedDropdownOption: "Starts with",
|
|
75
79
|
};
|
|
76
80
|
export const TextInput = Template.bind({});
|
|
77
81
|
TextInput.args = {
|
|
78
82
|
inputType: "text",
|
|
79
|
-
|
|
80
|
-
closeOutSearch: (value) => console.log(`Search cleared: ${value}`),
|
|
81
|
-
setResetSearch: () => console.log("Reset search triggered"),
|
|
82
|
-
setEditingHeader: (value) => console.log(`Editing header: ${value}`),
|
|
83
|
+
handleFilter: () => console.log(`Filter applied`),
|
|
83
84
|
pillColor: "bg-sky-500",
|
|
84
85
|
textHighlight: "text-sky-500",
|
|
85
86
|
dropdownIconProp: {
|
|
@@ -99,10 +100,7 @@ TextInput.args = {
|
|
|
99
100
|
export const NumberInput = Template.bind({});
|
|
100
101
|
NumberInput.args = {
|
|
101
102
|
inputType: "number",
|
|
102
|
-
|
|
103
|
-
closeOutSearch: (value) => console.log(`Search cleared: ${value}`),
|
|
104
|
-
setResetSearch: () => console.log("Reset search triggered"),
|
|
105
|
-
setEditingHeader: (value) => console.log(`Editing header: ${value}`),
|
|
103
|
+
handleFilter: () => console.log(`Filter applied`),
|
|
106
104
|
dropdownIconProp: {
|
|
107
105
|
iconClasses: "text-sky-500",
|
|
108
106
|
name: "chevronDown",
|
|
@@ -114,67 +112,48 @@ NumberInput.args = {
|
|
|
114
112
|
export const DropdownInput = Template.bind({});
|
|
115
113
|
DropdownInput.args = {
|
|
116
114
|
inputType: "multiSelect",
|
|
117
|
-
|
|
118
|
-
closeOutSearch: (value) => console.log(`Search cleared: ${value}`),
|
|
119
|
-
setResetSearch: () => console.log("Reset search triggered"),
|
|
120
|
-
setEditingHeader: (value) => console.log(`Editing header: ${value}`),
|
|
115
|
+
handleFilter: () => console.log(`Filter applied`),
|
|
121
116
|
placeholder: "Search",
|
|
122
117
|
dropdownOptions: [
|
|
123
118
|
{ uuid: "1", name: "Option 1", value: "option1" },
|
|
124
119
|
{ uuid: "2", name: "Option 2", value: "option2" },
|
|
125
120
|
{ uuid: "3", name: "Option 3", value: "option3" },
|
|
126
121
|
],
|
|
127
|
-
/** For multi-select, `value` is typically an array */
|
|
128
122
|
selectedValue: [],
|
|
129
|
-
// onChange: (selected: OptionType[]) => {
|
|
130
|
-
// console.log("Selected items:", selected);
|
|
131
|
-
// },
|
|
132
|
-
/** Additional props you might want to set */
|
|
133
123
|
isSearchable: true,
|
|
134
124
|
hasSelectAll: true,
|
|
135
125
|
disabled: false,
|
|
136
126
|
isLoading: false,
|
|
137
127
|
type: "multiSelect",
|
|
138
|
-
// etc...
|
|
139
128
|
};
|
|
140
129
|
export const BooleanInput = Template.bind({});
|
|
141
130
|
BooleanInput.args = {
|
|
142
131
|
inputType: "multiSelect",
|
|
143
|
-
|
|
144
|
-
closeOutSearch: (value) => console.log(`Search cleared: ${value}`),
|
|
145
|
-
setResetSearch: () => console.log("Reset search triggered"),
|
|
146
|
-
setEditingHeader: (value) => console.log(`Editing header: ${value}`),
|
|
132
|
+
handleFilter: () => console.log(`Filter applied`),
|
|
147
133
|
placeholder: "Search",
|
|
148
134
|
dropdownOptions: [
|
|
149
135
|
{ uuid: "1", name: "True", value: "true" },
|
|
150
136
|
{ uuid: "2", name: "False", value: "false" },
|
|
151
137
|
],
|
|
152
138
|
selectedValue: [],
|
|
153
|
-
// onChange: (selected: OptionType[]) => {
|
|
154
|
-
// console.log("Selected items:", selected);
|
|
155
|
-
// },
|
|
156
139
|
isSearchable: true,
|
|
157
140
|
hasSelectAll: true,
|
|
158
141
|
disabled: false,
|
|
159
142
|
isLoading: false,
|
|
160
143
|
type: "multiSelect",
|
|
161
|
-
// etc...
|
|
162
144
|
};
|
|
163
|
-
export const
|
|
164
|
-
|
|
165
|
-
inputType: "
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
buttonIconClasses: "text-gray-400",
|
|
178
|
-
containerClasses: "flex items-center",
|
|
179
|
-
onButtonClick: () => alert("Button is disabled."),
|
|
145
|
+
export const DatePickerInput = Template.bind({});
|
|
146
|
+
DatePickerInput.args = {
|
|
147
|
+
inputType: "date",
|
|
148
|
+
handleFilter: () => console.log(`Filter applied`),
|
|
149
|
+
textHighlight: "text-sky-500",
|
|
150
|
+
dropdownOptions: ["Exactly", "Before", "After"],
|
|
151
|
+
selectedDropdownOption: "Exactly",
|
|
152
|
+
onDropdownOptionSelect: (option) => console.log(`Option selected: ${option}`),
|
|
153
|
+
searchItems: [],
|
|
154
|
+
setSearchItems: () => { },
|
|
155
|
+
toggleStatus: false,
|
|
156
|
+
setToggleStatus: () => { },
|
|
157
|
+
themeBgColor: "bg-sky-500",
|
|
158
|
+
lightThemeBg: "bg-sky-100",
|
|
180
159
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|