@quillsql/react 1.7.5 → 1.7.6
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/lib/ReportBuilder.js +1 -0
- package/lib/ReportBuilder.js.map +1 -1
- package/lib/SQLEditor.js +3 -3
- package/lib/SQLEditor.js.map +1 -1
- package/lib/Table.js +1 -1
- package/lib/Table.js.map +1 -1
- package/lib/components/BigModal/BigModal.js +1 -0
- package/lib/components/BigModal/BigModal.js.map +1 -1
- package/lib/components/Modal/Modal.js +1 -0
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/hooks/useQuill.js +1 -0
- package/lib/hooks/useQuill.js.map +1 -1
- package/package.json +11 -4
- package/.eslintrc.json +0 -19
- package/.prettierrc +0 -11
- package/.vscode/settings.json +0 -10
- package/src/AddToDashboardModal.tsx +0 -1220
- package/src/BarList.tsx +0 -580
- package/src/Chart.tsx +0 -1337
- package/src/Context.tsx +0 -252
- package/src/Dashboard.tsx +0 -820
- package/src/DateRangePicker/Calendar.tsx +0 -442
- package/src/DateRangePicker/DateRangePicker.tsx +0 -261
- package/src/DateRangePicker/DateRangePickerButton.tsx +0 -250
- package/src/DateRangePicker/dateRangePickerUtils.tsx +0 -480
- package/src/DateRangePicker/index.ts +0 -4
- package/src/PieChart.tsx +0 -845
- package/src/QuillProvider.tsx +0 -81
- package/src/ReportBuilder.tsx +0 -2208
- package/src/SQLEditor.tsx +0 -1093
- package/src/Table.tsx +0 -1074
- package/src/TableChart.tsx +0 -428
- package/src/assets/ArrowDownHeadIcon.tsx +0 -11
- package/src/assets/ArrowDownIcon.tsx +0 -14
- package/src/assets/ArrowDownRightIcon.tsx +0 -14
- package/src/assets/ArrowLeftHeadIcon.tsx +0 -11
- package/src/assets/ArrowRightHeadIcon.tsx +0 -11
- package/src/assets/ArrowRightIcon.tsx +0 -14
- package/src/assets/ArrowUpHeadIcon.tsx +0 -11
- package/src/assets/ArrowUpIcon.tsx +0 -14
- package/src/assets/ArrowUpRightIcon.tsx +0 -14
- package/src/assets/CalendarIcon.tsx +0 -14
- package/src/assets/DoubleArrowLeftHeadIcon.tsx +0 -18
- package/src/assets/DoubleArrowRightHeadIcon.tsx +0 -20
- package/src/assets/ExclamationFilledIcon.tsx +0 -14
- package/src/assets/LoadingSpinner.tsx +0 -11
- package/src/assets/SearchIcon.tsx +0 -14
- package/src/assets/XCircleIcon.tsx +0 -14
- package/src/assets/index.ts +0 -16
- package/src/components/BigModal/BigModal.tsx +0 -108
- package/src/components/Dropdown/Dropdown.tsx +0 -169
- package/src/components/Dropdown/DropdownItem.tsx +0 -68
- package/src/components/Dropdown/index.ts +0 -2
- package/src/components/Modal/Modal.tsx +0 -132
- package/src/components/Modal/index.ts +0 -1
- package/src/components/selectUtils.ts +0 -60
- package/src/contexts/BaseColorContext.tsx +0 -5
- package/src/contexts/HoveredValueContext.tsx +0 -12
- package/src/contexts/RootStylesContext.tsx +0 -5
- package/src/contexts/SelectedValueContext.tsx +0 -13
- package/src/contexts/index.ts +0 -4
- package/src/hooks/index.ts +0 -4
- package/src/hooks/useInternalState.tsx +0 -18
- package/src/hooks/useOnClickOutside.tsx +0 -23
- package/src/hooks/useOnWindowResize.tsx +0 -17
- package/src/hooks/useQuill.ts +0 -138
- package/src/hooks/useSelectOnKeyDown.tsx +0 -80
- package/src/index.ts +0 -9
- package/src/lib/font.ts +0 -14
- package/src/lib/index.ts +0 -3
- package/src/lib/inputTypes.ts +0 -81
- package/src/lib/utils.tsx +0 -46
- package/tsconfig.json +0 -22
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
import React, { Dispatch, Ref, SetStateAction } from 'react';
|
|
2
|
-
|
|
3
|
-
import { ArrowDownHeadIcon, CalendarIcon } from '../assets';
|
|
4
|
-
|
|
5
|
-
import { DateRangePickerOption, DateRangePickerValue } from './DateRangePicker';
|
|
6
|
-
import { formatSelectedDates } from './dateRangePickerUtils';
|
|
7
|
-
import { hasValue } from '../components/selectUtils';
|
|
8
|
-
|
|
9
|
-
interface DateRangePickerButtonProps {
|
|
10
|
-
value: DateRangePickerValue;
|
|
11
|
-
options: DateRangePickerOption[];
|
|
12
|
-
placeholder: string;
|
|
13
|
-
disabled: boolean;
|
|
14
|
-
calendarRef: Ref<HTMLButtonElement>;
|
|
15
|
-
showCalendar: boolean;
|
|
16
|
-
setShowCalendar: Dispatch<SetStateAction<boolean>>;
|
|
17
|
-
onCalendarKeyDown: (e: React.KeyboardEvent<HTMLButtonElement>) => void;
|
|
18
|
-
enableDropdown: boolean;
|
|
19
|
-
dropdownRef: Ref<HTMLButtonElement>;
|
|
20
|
-
showDropdown: boolean;
|
|
21
|
-
setShowDropdown: Dispatch<SetStateAction<boolean>>;
|
|
22
|
-
onDropdownKeyDown: (e: React.KeyboardEvent<HTMLButtonElement>) => void;
|
|
23
|
-
locale?: Locale;
|
|
24
|
-
dropdownPlaceholder?: string;
|
|
25
|
-
theme: any;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const DateRangePickerButton = ({
|
|
29
|
-
value,
|
|
30
|
-
options,
|
|
31
|
-
placeholder,
|
|
32
|
-
disabled,
|
|
33
|
-
calendarRef,
|
|
34
|
-
showCalendar,
|
|
35
|
-
setShowCalendar,
|
|
36
|
-
onCalendarKeyDown,
|
|
37
|
-
enableDropdown,
|
|
38
|
-
dropdownRef,
|
|
39
|
-
showDropdown,
|
|
40
|
-
setShowDropdown,
|
|
41
|
-
onDropdownKeyDown,
|
|
42
|
-
locale,
|
|
43
|
-
dropdownPlaceholder = 'Select',
|
|
44
|
-
theme,
|
|
45
|
-
}: DateRangePickerButtonProps) => {
|
|
46
|
-
const [startDate, endDate, dropdownValue] = value;
|
|
47
|
-
|
|
48
|
-
const hasDateSelection =
|
|
49
|
-
(startDate || endDate) !== null && (startDate || endDate) !== undefined;
|
|
50
|
-
const hasDropdownSelection = hasValue(dropdownValue);
|
|
51
|
-
|
|
52
|
-
const calendarText = hasDateSelection
|
|
53
|
-
? formatSelectedDates(startDate as Date, endDate as Date, locale)
|
|
54
|
-
: placeholder;
|
|
55
|
-
const dropdownText = dropdownValue
|
|
56
|
-
? String(options.find(option => option.value === dropdownValue)?.text)
|
|
57
|
-
: dropdownPlaceholder;
|
|
58
|
-
|
|
59
|
-
return (
|
|
60
|
-
<div
|
|
61
|
-
style={{
|
|
62
|
-
display: 'flex',
|
|
63
|
-
alignItems: 'center',
|
|
64
|
-
justifyContent: 'space-between',
|
|
65
|
-
borderRadius: '0.375rem',
|
|
66
|
-
background: theme?.backgroundColor,
|
|
67
|
-
fontFamily: theme?.fontFamily,
|
|
68
|
-
boxShadow: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
|
|
69
|
-
}}
|
|
70
|
-
// className={twMerge(
|
|
71
|
-
// 'qq-flex qq-items-center qq-justify-between',
|
|
72
|
-
// getColorClassNames('white').bgColor,
|
|
73
|
-
// borderRadius.md.all,
|
|
74
|
-
// boxShadow.sm
|
|
75
|
-
// )}
|
|
76
|
-
>
|
|
77
|
-
<button
|
|
78
|
-
type="button"
|
|
79
|
-
style={{
|
|
80
|
-
fontFamily: theme?.fontFamily,
|
|
81
|
-
borderColor: theme?.borderColor || '#E5E7EB',
|
|
82
|
-
borderStyle: 'solid',
|
|
83
|
-
borderWidth: 1,
|
|
84
|
-
borderRadius: '0.375rem',
|
|
85
|
-
minHeight: 38,
|
|
86
|
-
borderRight: 'none',
|
|
87
|
-
borderTopRightRadius: 0,
|
|
88
|
-
borderBottomRightRadius: 0,
|
|
89
|
-
color: theme?.primaryTextColor,
|
|
90
|
-
cursor: 'pointer',
|
|
91
|
-
display: 'flex',
|
|
92
|
-
alignItems: 'center',
|
|
93
|
-
width: '100%',
|
|
94
|
-
overflow: 'hidden',
|
|
95
|
-
textOverflow: 'ellipsis',
|
|
96
|
-
whiteSpace: 'nowrap',
|
|
97
|
-
background: theme?.backgroundColor,
|
|
98
|
-
fontWeight: theme?.fontWeightMedium || '500',
|
|
99
|
-
fontSize: theme?.fontSizeSmall || '0.875rem',
|
|
100
|
-
paddingLeft: 10,
|
|
101
|
-
// borderRight: enableDropdown
|
|
102
|
-
// ? border.none.right
|
|
103
|
-
// : twMerge(borderRadius.md.right, border.sm.right),
|
|
104
|
-
}}
|
|
105
|
-
ref={calendarRef}
|
|
106
|
-
onClick={() => setShowCalendar(!showCalendar)}
|
|
107
|
-
onKeyDown={onCalendarKeyDown}
|
|
108
|
-
// className={twMerge(
|
|
109
|
-
// 'qq-flex qq-items-center qq-w-full qq-truncate focus:qq-outline-none focus:qq-ring-2',
|
|
110
|
-
// getSelectButtonColors(hasDateSelection, disabled),
|
|
111
|
-
// enableDropdown
|
|
112
|
-
// ? border.none.right
|
|
113
|
-
// : twMerge(borderRadius.md.right, border.sm.right),
|
|
114
|
-
// getColorClassNames(BaseColors.Blue, colorPalette.lightRing)
|
|
115
|
-
// .focusRingColor,
|
|
116
|
-
// spacing.twoXl.paddingX,
|
|
117
|
-
// spacing.sm.paddingY,
|
|
118
|
-
// borderRadius.md.left,
|
|
119
|
-
// border.sm.all
|
|
120
|
-
// )}
|
|
121
|
-
disabled={disabled}
|
|
122
|
-
>
|
|
123
|
-
<CalendarIcon
|
|
124
|
-
style={{
|
|
125
|
-
flex: 'none',
|
|
126
|
-
color: theme?.secondaryTextColor,
|
|
127
|
-
height: '1.25rem',
|
|
128
|
-
width: '1.25rem',
|
|
129
|
-
// marginLeft: '0.125rem',
|
|
130
|
-
marginRight: '0.75rem',
|
|
131
|
-
}}
|
|
132
|
-
// className={twMerge(
|
|
133
|
-
// 'qq-flex-none',
|
|
134
|
-
// getColorClassNames(DEFAULT_COLOR, colorPalette.lightText).textColor,
|
|
135
|
-
// sizing.lg.height,
|
|
136
|
-
// sizing.lg.width,
|
|
137
|
-
// spacing.threeXs.negativeMarginLeft,
|
|
138
|
-
// spacing.lg.marginRight
|
|
139
|
-
// )}
|
|
140
|
-
aria-hidden="true"
|
|
141
|
-
/>
|
|
142
|
-
<p
|
|
143
|
-
style={{
|
|
144
|
-
margin: 0,
|
|
145
|
-
fontFamily: theme?.fontFamily,
|
|
146
|
-
color: theme?.primaryTextColor,
|
|
147
|
-
overflow: 'hidden',
|
|
148
|
-
textOverflow: 'ellipsis',
|
|
149
|
-
whiteSpace: 'nowrap',
|
|
150
|
-
fontWeight: theme?.fontWeightMedium || '500',
|
|
151
|
-
fontSize: theme?.fontSizeSmall || '0.875rem',
|
|
152
|
-
}}
|
|
153
|
-
// className={twMerge(
|
|
154
|
-
// 'qq-whitespace-nowrap qq-truncate',
|
|
155
|
-
// fontSize.sm,
|
|
156
|
-
// fontWeight.md
|
|
157
|
-
// )}
|
|
158
|
-
>
|
|
159
|
-
{calendarText}
|
|
160
|
-
</p>
|
|
161
|
-
</button>
|
|
162
|
-
{enableDropdown ? (
|
|
163
|
-
<button
|
|
164
|
-
type="button"
|
|
165
|
-
style={{
|
|
166
|
-
// fontFamily: theme?.fontFamily,
|
|
167
|
-
borderColor: theme?.borderColor || '#E5E7EB',
|
|
168
|
-
borderStyle: 'solid',
|
|
169
|
-
borderWidth: 1,
|
|
170
|
-
cursor: 'pointer',
|
|
171
|
-
marginLeft: -1,
|
|
172
|
-
borderRadius: '0.375rem',
|
|
173
|
-
width: '12rem',
|
|
174
|
-
overflow: 'hidden',
|
|
175
|
-
textOverflow: 'ellipsis',
|
|
176
|
-
whiteSpace: 'nowrap',
|
|
177
|
-
paddingLeft: '1rem',
|
|
178
|
-
paddingRight: '1rem',
|
|
179
|
-
display: 'inline-flex',
|
|
180
|
-
minHeight: 38,
|
|
181
|
-
borderTopLeftRadius: 0,
|
|
182
|
-
borderBottomLeftRadius: 0,
|
|
183
|
-
justifyContent: 'space-between',
|
|
184
|
-
alignItems: 'center',
|
|
185
|
-
background: theme?.backgroundColor,
|
|
186
|
-
fontSize: theme?.fontSizeSmall || '0.875rem',
|
|
187
|
-
// fontWeight: theme?.fontWeightMedium || '800',
|
|
188
|
-
}}
|
|
189
|
-
ref={dropdownRef}
|
|
190
|
-
onClick={() => setShowDropdown(!showDropdown)}
|
|
191
|
-
// className={twMerge(
|
|
192
|
-
// 'qq-inline-flex qq-justify-between qq-w-48 qq-truncate focus:qq-outline-none focus:qq-ring-2',
|
|
193
|
-
// getSelectButtonColors(hasDropdownSelection, disabled),
|
|
194
|
-
// getColorClassNames(BaseColors.Blue, colorPalette.lightRing)
|
|
195
|
-
// .focusRingColor,
|
|
196
|
-
// spacing.twoXl.paddingX,
|
|
197
|
-
// spacing.sm.paddingY
|
|
198
|
-
// spacing.px.negativeMarginLeft,
|
|
199
|
-
// borderRadius.md.right,
|
|
200
|
-
// border.sm.all
|
|
201
|
-
// )}
|
|
202
|
-
onKeyDown={onDropdownKeyDown}
|
|
203
|
-
disabled={disabled}
|
|
204
|
-
>
|
|
205
|
-
<p
|
|
206
|
-
style={{
|
|
207
|
-
margin: 0,
|
|
208
|
-
fontFamily: theme?.fontFamily,
|
|
209
|
-
// fontFamily: 'Avenir',
|
|
210
|
-
color: theme?.primaryTextColor || '#364153',
|
|
211
|
-
overflow: 'hidden',
|
|
212
|
-
textOverflow: 'ellipsis',
|
|
213
|
-
whiteSpace: 'nowrap',
|
|
214
|
-
fontWeight: theme?.fontWeightMedium || '500',
|
|
215
|
-
fontSize: theme?.fontSizeSmall || '0.875rem',
|
|
216
|
-
// background: 'red',
|
|
217
|
-
}}
|
|
218
|
-
// className={twMerge(
|
|
219
|
-
// 'qq-whitespace-nowrap qq-truncate',
|
|
220
|
-
// fontSize.sm,
|
|
221
|
-
// fontWeight.md
|
|
222
|
-
// )}
|
|
223
|
-
>
|
|
224
|
-
{dropdownText}
|
|
225
|
-
</p>
|
|
226
|
-
<ArrowDownHeadIcon
|
|
227
|
-
style={{
|
|
228
|
-
height: '1.25rem',
|
|
229
|
-
width: '1.25rem',
|
|
230
|
-
flex: 'none',
|
|
231
|
-
color: theme?.secondaryTextColor,
|
|
232
|
-
marginRight: '-0.25rem',
|
|
233
|
-
}}
|
|
234
|
-
// className={twMerge(
|
|
235
|
-
// 'qq-flex-none',
|
|
236
|
-
// sizing.lg.height,
|
|
237
|
-
// sizing.lg.width,
|
|
238
|
-
// spacing.twoXs.negativeMarginRight,
|
|
239
|
-
// getColorClassNames(DEFAULT_COLOR, colorPalette.lightText)
|
|
240
|
-
// .textColor
|
|
241
|
-
// )}
|
|
242
|
-
aria-hidden="true"
|
|
243
|
-
/>
|
|
244
|
-
</button>
|
|
245
|
-
) : null}
|
|
246
|
-
</div>
|
|
247
|
-
);
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
export default DateRangePickerButton;
|