fuse-importer 0.0.8-testing → 0.1.1-testing
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/esm/Importer/ImporterWithContext.js +63 -0
- package/lib/esm/Importer/Matcher/EnumFieldsMatchers/EnumFieldMatcher/index.js +68 -0
- package/lib/esm/Importer/Matcher/EnumFieldsMatchers/EnumFieldMatcher/tableColumns.js +58 -0
- package/lib/esm/Importer/Matcher/EnumFieldsMatchers/EnumFieldMatcherContext.js +21 -0
- package/lib/esm/Importer/Matcher/EnumFieldsMatchers/index.js +23 -0
- package/lib/esm/Importer/Matcher/HeaderMatcher/index.js +61 -0
- package/lib/esm/Importer/Matcher/HeaderMatcher/tableColumns.js +55 -0
- package/lib/esm/Importer/Matcher/common/icons/index.js +14 -0
- package/lib/esm/Importer/Matcher/common/index.js +39 -0
- package/lib/esm/Importer/Matcher/common/types.js +9 -0
- package/lib/esm/Importer/Matcher/index.js +22 -0
- package/lib/esm/Importer/PreviewFirstTime.js +81 -0
- package/lib/esm/Importer/PreviewModeBanner.js +19 -0
- package/lib/esm/Importer/Review/AppResponseModal.js +35 -0
- package/lib/esm/Importer/Review/ReviewContextProvider.js +318 -0
- package/lib/esm/Importer/Review/ReviewWithContext.js +33 -0
- package/lib/esm/Importer/Review/index.js +4 -0
- package/lib/esm/Importer/Stepper/ConfirmCloseModal.js +24 -0
- package/lib/esm/Importer/Stepper/Step.js +19 -0
- package/lib/esm/Importer/Stepper/StepIndex.js +27 -0
- package/lib/esm/Importer/Stepper/StepperSubmitModal.js +24 -0
- package/lib/esm/Importer/Stepper/UnmatchedHeadersModal.js +31 -0
- package/lib/esm/Importer/Stepper/common/getEnumFieldValueMatchingsInitialValue.js +33 -0
- package/lib/esm/Importer/Stepper/common/icons.js +18 -0
- package/lib/esm/Importer/Stepper/index.js +118 -0
- package/lib/esm/Importer/TrialModeBanner.js +22 -0
- package/lib/esm/Importer/Uploader/DragAndDropImporter/DragAndDropImporter.styles.js +11 -0
- package/lib/esm/Importer/Uploader/DragAndDropImporter/ImporterDropzone.js +123 -0
- package/lib/esm/Importer/Uploader/DragAndDropImporter/ImporterSectionHeader/ImporterSectionHeader.styles.js +11 -0
- package/lib/esm/Importer/Uploader/DragAndDropImporter/ImporterSectionHeader/index.js +44 -0
- package/lib/esm/Importer/Uploader/DragAndDropImporter/backgrounds.js +14 -0
- package/lib/esm/Importer/Uploader/DragAndDropImporter/index.js +45 -0
- package/lib/esm/Importer/Uploader/HeaderButtons.js +28 -0
- package/lib/esm/Importer/Uploader/HeadersPreview.js +44 -0
- package/lib/esm/Importer/Uploader/UploaderContextProvider.js +27 -0
- package/lib/esm/Importer/Uploader/index.js +13 -0
- package/lib/esm/Importer/common/AppLoading.js +24 -0
- package/lib/esm/Importer/common/Footer.js +17 -0
- package/lib/esm/Importer/common/FuseApi.js +48 -0
- package/lib/esm/Importer/common/GlobalStyle.js +7 -0
- package/lib/esm/Importer/common/ImporterFonts.js +5 -0
- package/lib/esm/Importer/common/Spreadsheet/SpreadsheetContextProvider/filterMethods.js +56 -0
- package/lib/esm/Importer/common/Spreadsheet/SpreadsheetContextProvider/index.js +176 -0
- package/lib/esm/Importer/common/Spreadsheet/SpreadsheetContextProvider/useSpreadsheetFilter.js +45 -0
- package/lib/esm/Importer/common/Spreadsheet/SpreadsheetContextProvider/utils.js +14 -0
- package/lib/esm/Importer/common/Spreadsheet/common/index.js +63 -0
- package/lib/esm/Importer/common/Spreadsheet/common/types.js +5 -0
- package/lib/esm/Importer/common/Spreadsheet/components/FieldHeader.js +66 -0
- package/lib/esm/Importer/common/Spreadsheet/components/GlobalStyle.js +9 -0
- package/lib/esm/Importer/common/Spreadsheet/components/SpreadsheetData.js +110 -0
- package/lib/esm/Importer/common/Spreadsheet/components/SpreadsheetRowCheckboxes.js +186 -0
- package/lib/esm/Importer/common/Spreadsheet/components/SpreadsheetRowNumbers.js +55 -0
- package/lib/esm/Importer/common/Spreadsheet/components/ValidationProgress.js +19 -0
- package/lib/esm/Importer/common/Spreadsheet/components/fields/SpeadsheetAutocomplete.js +43 -0
- package/lib/esm/Importer/common/Spreadsheet/components/fields/SpreadsheetInput.js +74 -0
- package/lib/esm/Importer/common/Spreadsheet/components/fields/index.d.ts +2 -1
- package/lib/esm/Importer/common/Spreadsheet/components/fields/index.js +114 -0
- package/lib/esm/Importer/common/Spreadsheet/components/fields/utils.d.ts +11 -0
- package/lib/esm/Importer/common/Spreadsheet/components/fields/utils.js +29 -0
- package/lib/esm/Importer/common/Spreadsheet/components/inputs/Boolean.js +18 -0
- package/lib/esm/Importer/common/Spreadsheet/components/inputs/EmailInput.js +14 -0
- package/lib/esm/Importer/common/Spreadsheet/components/inputs/EnumInput.js +30 -0
- package/lib/esm/Importer/common/Spreadsheet/components/inputs/FloatInput.js +16 -0
- package/lib/esm/Importer/common/Spreadsheet/components/inputs/IntegerInput.js +16 -0
- package/lib/esm/Importer/common/Spreadsheet/components/inputs/StringInput.js +14 -0
- package/lib/esm/Importer/common/Spreadsheet/components/inputs/index.d.ts +1 -0
- package/lib/esm/Importer/common/Spreadsheet/components/inputs/index.js +20 -0
- package/lib/esm/Importer/common/Spreadsheet/hooks.js +245 -0
- package/lib/esm/Importer/common/Spreadsheet/index.js +119 -0
- package/lib/esm/Importer/common/Spreadsheet/styles.js +16 -0
- package/lib/esm/Importer/common/Spreadsheet/transformation/index.js +47 -0
- package/lib/esm/Importer/common/Spreadsheet/transformation/transformators.js +236 -0
- package/lib/esm/Importer/common/Spreadsheet/validation/index.js +202 -0
- package/lib/esm/Importer/common/Spreadsheet/validation/validators.js +181 -0
- package/lib/esm/Importer/common/icons/index.js +18 -0
- package/lib/esm/Importer/common/index.js +13 -0
- package/lib/esm/Importer/common/theme.js +19 -0
- package/lib/esm/Importer/common/utils.js +100 -0
- package/lib/esm/Importer/contexts/ImporterContextProvider.js +247 -0
- package/lib/esm/Importer/data/index.js +172 -0
- package/lib/esm/Importer/index.js +28 -0
- package/lib/esm/api/index.js +93 -0
- package/lib/esm/api/responseHandlers.js +49 -0
- package/lib/esm/common/AppLoadingContextProvider/AppLoadingUI.js +26 -0
- package/lib/esm/common/AppLoadingContextProvider/index.js +25 -0
- package/lib/esm/common/ConfirmationModal.js +19 -0
- package/lib/esm/common/Modal.js +31 -0
- package/lib/esm/common/Spinner.js +41 -0
- package/lib/esm/common/Table/Pagination/icons.js +42 -0
- package/lib/esm/common/Table/Pagination/index.js +32 -0
- package/lib/esm/common/Table/TableActions/DeleteSelectedRows.js +50 -0
- package/lib/esm/common/Table/TableActions/ExportData.js +23 -0
- package/lib/esm/common/Table/TableActions/FilterByErrors/FilterByErrors.js +47 -0
- package/lib/esm/common/Table/TableActions/FilterByErrors/FilterByErrors.styles.js +24 -0
- package/lib/esm/common/Table/TableActions/FilterByErrors/functions.js +35 -0
- package/lib/esm/common/Table/TableActions/FilterByErrors/index.js +1 -0
- package/lib/esm/common/Table/TableActions/RowFilters.js +42 -0
- package/lib/esm/common/Table/TableActions/SearchRows.js +72 -0
- package/lib/esm/common/Table/TableActions/TableActions.js +35 -0
- package/lib/esm/common/Table/TableActions/TableActions.styles.js +18 -0
- package/lib/esm/common/Table/TableActions/TransformedRecordsCount.js +83 -0
- package/lib/esm/common/Table/TableActions/common.js +1 -0
- package/lib/esm/common/Table/TableActions/hooks.js +41 -0
- package/lib/esm/common/Table/TableActions/icons.js +17 -0
- package/lib/esm/common/Table/TableActions/index.js +1 -0
- package/lib/esm/common/Table/TableDataProvider.js +127 -0
- package/lib/esm/common/Table/TableView/TableHeaders.js +69 -0
- package/lib/esm/common/Table/TableView/TableRows/TableRow.js +57 -0
- package/lib/esm/common/Table/TableView/TableRows/index.js +48 -0
- package/lib/esm/common/Table/TableView/common/index.js +37 -0
- package/lib/esm/common/Table/TableView/index.js +132 -0
- package/lib/esm/common/Table/TableView/types.js +1 -0
- package/lib/esm/common/Table/icons.js +15 -0
- package/lib/esm/common/Table/index.js +140 -0
- package/lib/esm/common/Table/useReorderRows.js +83 -0
- package/lib/esm/common/Toast.js +69 -0
- package/lib/esm/common/TooltipProvider.js +57 -0
- package/lib/esm/common/buttons.js +97 -0
- package/lib/esm/common/columnsTransformations.js +94 -0
- package/lib/esm/common/columnsValidations.d.ts +1 -27
- package/lib/esm/common/columnsValidations.js +401 -0
- package/lib/esm/common/datePatterns.d.ts +26 -0
- package/lib/esm/common/datePatterns.js +327 -0
- package/lib/esm/common/icons/index.js +30 -0
- package/lib/esm/common/index.d.ts +1 -0
- package/lib/esm/common/index.js +46 -0
- package/lib/esm/common/inputs/Autocomplete.js +110 -0
- package/lib/esm/common/inputs/Checkbox.js +53 -0
- package/lib/esm/common/inputs/SelectMenu.js +74 -0
- package/lib/esm/common/inputs/TextInput.js +89 -0
- package/lib/esm/common/inputs/index.js +5 -0
- package/lib/esm/common/inputs/tooltip.js +38 -0
- package/lib/esm/common/logo.js +13 -0
- package/lib/esm/hooks/index.d.ts +1 -0
- package/lib/esm/hooks/index.js +16 -0
- package/lib/esm/index.js +218 -0
- package/lib/esm/locales/de.js +126 -0
- package/lib/esm/locales/en.js +126 -0
- package/lib/esm/locales/es.js +126 -0
- package/lib/esm/locales/fr.js +126 -0
- package/lib/esm/locales/index.js +4 -0
- package/lib/esm/styled/fontsURL.js +27 -0
- package/lib/esm/styled/index.js +3 -0
- package/lib/esm/styled/theme/animations.js +9 -0
- package/lib/esm/styled/theme/colorPalette.js +109 -0
- package/lib/esm/styled/theme/debugCss.js +16 -0
- package/lib/esm/styled/theme/dimensionsCss.js +20 -0
- package/lib/esm/styled/theme/fontCss.js +17 -0
- package/lib/esm/styled/theme/globalCss.js +26 -0
- package/lib/esm/styled/theme/index.js +33 -0
- package/lib/esm/styled/theme/layoutCss.js +26 -0
- package/lib/esm/styled/theme/mediaQueries.js +4 -0
- package/lib/esm/styled/theme/positionCss.js +27 -0
- package/lib/esm/styled/theme/textCss.js +18 -0
- package/lib/esm/styled/theme/textStyles.js +27 -0
- package/lib/esm/styled/themeType.js +6 -0
- package/lib/esm/styled/utils.js +17 -0
- package/lib/esm/types.d.ts +7 -6
- package/lib/esm/types.js +65 -0
- package/lib/esm/utils/hooks/useWindowSize.js +23 -0
- package/lib/esm/utils/hooks.js +1 -0
- package/lib/esm/utils/index.d.ts +1 -0
- package/lib/esm/utils/index.js +41 -0
- package/lib/main.js +6 -6
- package/package.json +1 -1
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
export var datePatterns = [
|
|
2
|
+
{
|
|
3
|
+
value: "MM/dd/yyyy",
|
|
4
|
+
label: "MM/dd/yyyy (e.g. 08/31/2023)",
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
value: "MMM dd yyyy",
|
|
8
|
+
label: "MMM dd yyyy (e.g. Jan 15 1990)",
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
value: "yyyy-MM-dd",
|
|
12
|
+
label: "yyyy-MM-dd (e.g. 2023-08-31",
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
value: "dd/MM/yyyy",
|
|
16
|
+
label: "dd/MM/yyyy (e.g. 31/08/2023",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
value: "MM-dd-yyyy",
|
|
20
|
+
label: "MM-dd-yyyy (e.g. 08-31-2023)",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
value: "yyyy/MM/dd",
|
|
24
|
+
label: "yyyy/MM/dd (e.g. 2023/08/31)",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
value: "dd-MMMM-yyyy",
|
|
28
|
+
label: "dd-MMMM-yyyy (e.g. 31-August-2023)",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
value: "MMMM dd, yyyy",
|
|
32
|
+
label: "MMMM dd, yyyy (e.g. August 31, 2023)",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
value: "dd/MM/yy",
|
|
36
|
+
label: "dd/MM/yy (e.g. 31/08/23)",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
value: "MMMM dd, yy",
|
|
40
|
+
label: "MMMM dd, yy (e.g. August 31, 23)",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
value: "yy/MM/dd",
|
|
44
|
+
label: "yy/MM/dd (e.g. 23/08/31)",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
value: "EEEE MMMM yyyy",
|
|
48
|
+
label: "Day MMMM Year (e.g. Tuesday August 2023)",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
value: "EEEE dd MMMM yyyy",
|
|
52
|
+
label: "Day Day-of-Month Month Year (e.g. Tuesday 08 August 2023)",
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
value: "MM-dd-yy",
|
|
56
|
+
label: "MM-dd-yy (e.g. 01-15-90)",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
value: "M-dd-yy",
|
|
60
|
+
label: "M-dd-yy (e.g. 1-15-90)",
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
value: "dd-MM-yy",
|
|
64
|
+
label: "dd-MM-yy (e.g. 15-01-90)",
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
value: "dd-MM-yyyy",
|
|
68
|
+
label: "dd-MM-yyyy (e.g. 15-01-1990)",
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
value: "dd-M-yy",
|
|
72
|
+
label: "dd-M-yy (e.g. 15-1-90)",
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
value: "MM/dd/yy",
|
|
76
|
+
label: "MM/dd/yy (e.g. 01/15/90)",
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
value: "M/dd/yy",
|
|
80
|
+
label: "M/dd/yy (e.g. 1/15/90)",
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
value: "MM.dd.yy",
|
|
84
|
+
label: "MM.dd.yy (e.g. 01.15.90)",
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
value: "M.dd.yy",
|
|
88
|
+
label: "M.dd.yy (e.g. 1.15.90)",
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
value: "MMM-dd-yy",
|
|
92
|
+
label: "MMM-dd-yy (e.g. Jan-15-90)",
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
value: "MMMM-dd-yy",
|
|
96
|
+
label: "MMMM-dd-yy (e.g. January-15-90)",
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
value: "dd-MMM-yy",
|
|
100
|
+
label: "dd-MMM-yy (e.g. 15-Jan-90)",
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
value: "yyyy-M-dd",
|
|
104
|
+
label: "yyyy-M-dd (e.g. 1990-1-15)",
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
value: "M-dd-yyyy",
|
|
108
|
+
label: "M-dd-yyyy (e.g. 1-15-1990)",
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
value: "M/dd/yyyy",
|
|
112
|
+
label: "M/dd/yyyy (e.g. 1/15/1990)",
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
value: "dd/M/yyyy",
|
|
116
|
+
label: "dd/M/yyyy (e.g. 15/1/1990)",
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
value: "yyyy/M/dd",
|
|
120
|
+
label: "yyyy/M/dd (e.g. 1990/1/15)",
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
value: "dd.MM.yyyy",
|
|
124
|
+
label: "dd.MM.yyyy (e.g. 15.01.1990)",
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
value: "dd.M.yyyy",
|
|
128
|
+
label: "dd.M.yyyy (e.g. 15.1.1990)",
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
value: "yyyy.MM.dd",
|
|
132
|
+
label: "yyyy.MM.dd (e.g. 1990.01.15)",
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
value: "yyyy.M.dd",
|
|
136
|
+
label: "yyyy.M.dd (e.g. 1990.1.15)",
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
value: "MMM. dd, yyyy",
|
|
140
|
+
label: "MMM. dd, yyyy (e.g. Jan. 15, 1990)",
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
value: "dd MMM. yyyy",
|
|
144
|
+
label: "dd MMM. yyyy (e.g. 15 Jan. 1990)",
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
value: "MMM dd",
|
|
148
|
+
label: "MMM dd (e.g. Jan 15)",
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
value: "MMMM dd",
|
|
152
|
+
label: "MMMM dd (e.g. January 15)",
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
value: "MMM d",
|
|
156
|
+
label: "MMM d (e.g. Jan 5)",
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
value: "MMMM d",
|
|
160
|
+
label: "MMMM d (e.g. January 5)",
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
value: "dd. MMM. yyyy",
|
|
164
|
+
label: "dd. MMM. yyyy (e.g. 15. Jan. 1990)",
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
value: "EEE, MMM dd, yyyy",
|
|
168
|
+
label: "EEE, MMM dd, yyyy (e.g. Mon, Jan 15, 1990)",
|
|
169
|
+
},
|
|
170
|
+
];
|
|
171
|
+
export var dateTimePatterns = [
|
|
172
|
+
{
|
|
173
|
+
value: "MM/dd/yyyy HH:mm",
|
|
174
|
+
label: "MM/dd/yyyy HH:mm (e.g. 08/31/2023 12:30)",
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
value: "MM/dd/yyyy HH:mm:ss",
|
|
178
|
+
label: "MM/dd/yyyy HH:mm:ss (e.g. 08/31/2023 12:30:45)",
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
value: "MM/dd/yyyy HH:mm:ss.SSS",
|
|
182
|
+
label: "MM/dd/yyyy HH:mm:ss.SSS (e.g. 08/31/2023 12:30:45.500)",
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
value: "MM/dd/yyyy h:mm a",
|
|
186
|
+
label: "MM/dd/yyyy h:mm a (e.g. 08/31/2023 1:30 PM)",
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
value: "MM/dd/yyyy h:mm:ss a",
|
|
190
|
+
label: "MM/dd/yyyy h:mm:ss a (e.g. 08/31/2023 1:30:45 PM)",
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
value: "MMM dd HH:mm:ss yyyy",
|
|
194
|
+
label: "MMM dd HH:mm:ss yyyy (e.g. Jan 15 00:34:59 1990)",
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
value: "MMM dd yyyy HH:mm:ss",
|
|
198
|
+
label: "MMM dd yyyy HH:mm:ss (e.g. Jan 15 1990 00:34:59)",
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
value: "dd MMM HH:mm:ss yyyy",
|
|
202
|
+
label: "dd MMM HH:mm:ss yyyy (e.g. 15 Jan 00:34:59 1990)",
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
value: "MM/dd/yyyy h:mm:ss.SSS a",
|
|
206
|
+
label: "MM/dd/yyyy h:mm:ss.SSS a (e.g. 08/31/2023 1:30:45.500 PM)",
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
value: "MMMM dd, yyyy HH:mm",
|
|
210
|
+
label: "MMMM dd, yyyy HH:mm (e.g. August 31, 2023 12:30)",
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
value: "MMMM dd, yyyy HH:mm:ss",
|
|
214
|
+
label: "MMMM dd, yyyy HH:mm:ss (e.g. August 31, 2023 12:30:45)",
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
value: "MMMM dd, yyyy h:mm a",
|
|
218
|
+
label: "MMMM dd, yyyy h:mm a (e.g. August 31, 2023 1:30 PM)",
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
value: "MMMM dd, yyyy h:mm:ss a",
|
|
222
|
+
label: "MMMM dd, yyyy h:mm:ss a (e.g. August 31, 2023 1:30:45 PM)",
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
value: "MMMM dd, yyyy h:mm:ss.SSS a",
|
|
226
|
+
label: "MMMM dd, yyyy h:mm:ss.SSS a (e.g. August 31, 2023 1:30:45.500 PM)",
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
value: "MM-dd-yy HH:mm",
|
|
230
|
+
label: "MM-dd-yy HH:mm (e.g. 01-15-90 10:10)",
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
value: "dd-MM-yyyy HH:mm",
|
|
234
|
+
label: "dd-MM-yyyy HH:mm (e.g. 15-01-1990 10:10)",
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
value: "dd/MM/yyyy HH:mm",
|
|
238
|
+
label: "dd/MM/yyyy HH:mm (e.g. 15/01/1990 10:10)",
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
value: "dd-MM-yyyy h:mm a",
|
|
242
|
+
label: "dd-MM-yyyy h:mm a (e.g. 15-01-1990 10:10 AM)",
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
value: "dd/MM/yyyy h:mm a",
|
|
246
|
+
label: "dd/MM/yyyy h:mm a (e.g. 15/01/1990 10:10 AM)",
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
value: "MM/dd/yy HH:mm",
|
|
250
|
+
label: "MM/dd/yy HH:mm (e.g. 01/15/90 10:10)",
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
value: "MM/dd/yy HH:mm:ss",
|
|
254
|
+
label: "MM/dd/yy HH:mm:ss (e.g. 01/15/90 10:10:14)",
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
value: "MM/dd/yy h:mm:ss a",
|
|
258
|
+
label: "MM/dd/yy h:mm:ss a (e.g. 01/15/90 5:10:14 AM)",
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
value: "yyyy/MM/dd HH:mm",
|
|
262
|
+
label: "yyyy/MM/dd HH:mm (e.g. 1990/01/15 10:10)",
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
value: "MM-dd-yyyy HH:mm",
|
|
266
|
+
label: "MM-dd-yyyy HH:mm (e.g. 01-15-1990 10:10)",
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
value: "yyyy-MM-dd HH:mm",
|
|
270
|
+
label: "yyyy-MM-dd HH:mm (e.g. 1990-01-15 10:10)",
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
value: "MMM dd HH:mm:ss",
|
|
274
|
+
label: "MMM dd HH:mm:ss (e.g. Jan 15 10:10:25)",
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
value: "MMMM dd HH:mm:ss",
|
|
278
|
+
label: "MMMM dd HH:mm:ss (e.g. January 15 10:10:25)",
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
value: "MMM d HH:mm:ss",
|
|
282
|
+
label: "MMM d HH:mm:ss (e.g. Jan 5 10:10:25)",
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
value: "MMMM d HH:mm:ss",
|
|
286
|
+
label: "MMMM d HH:mm:ss (e.g. January 5 10:10:25)",
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
value: "yyyy-MM-dd'T'HH:mm:ss.SSSZ",
|
|
290
|
+
label: "ISO 8601 (e.g. 1990-01-15T00:34:55.020+09:30)",
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
value: "yyyy-MM-dd'T'HH:mm:ss.SSS",
|
|
294
|
+
label: "ISO 8601 without timezone offset (e.g. 1990-01-15T00:34:55.020)",
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
value: "yyyy-MM-dd'T'HH:mmZ",
|
|
298
|
+
label: "yyyy-MM-dd'T'HH:mm+offset (e.g. 1990-01-15T10:10+09:30)",
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
value: "yyyy-MM-dd'T'HH:mm",
|
|
302
|
+
label: "yyyy-MM-dd'T'HH:mm (e.g. 1990-01-15T10:10)",
|
|
303
|
+
},
|
|
304
|
+
];
|
|
305
|
+
export var timePatterns = [
|
|
306
|
+
{
|
|
307
|
+
value: "HH:mm",
|
|
308
|
+
label: "HH:mm (e.g. 12:30)",
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
value: "HH:mm:ss",
|
|
312
|
+
label: "HH:mm:ss (e.g. 12:30:45)",
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
value: "hh:mm a",
|
|
316
|
+
label: "hh:mm a (e.g. 01:30 PM)",
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
value: "hh:mm:ss a",
|
|
320
|
+
label: "hh:mm:ss a (e.g. 01:30:45 PM)",
|
|
321
|
+
},
|
|
322
|
+
];
|
|
323
|
+
export var allowedPatterns = {
|
|
324
|
+
date: datePatterns,
|
|
325
|
+
datetime: dateTimePatterns,
|
|
326
|
+
time: timePatterns,
|
|
327
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useTheme } from "styled-components";
|
|
14
|
+
export var closeIcon = (_jsxs("svg", __assign({ width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [_jsx("path", { d: "M6 6.00003L18.7742 18.7742", stroke: "black", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M6 18.7742L18.7742 6.00001", stroke: "black", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })] })));
|
|
15
|
+
export var closeIconCondensed = (_jsxs("svg", __assign({ width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [_jsx("path", { d: "M6 6.00003L18.7742 18.7742", stroke: "#333333", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M6 18.7742L18.7742 6.00001", stroke: "#333333", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })] })));
|
|
16
|
+
export var checkIcon = (_jsx("svg", __assign({ width: "12", height: "10", viewBox: "0 0 12 10", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { d: "M1.37805 5.80142L3.94469 8.28708L10.6827 1.52003", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })));
|
|
17
|
+
export var greenCheckIcon = (_jsx("svg", __assign({ width: "22", height: "22", viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11 22C17.0751 22 22 17.0751 22 11C22 4.92487 17.0751 0 11 0C4.92487 0 0 4.92487 0 11C0 17.0751 4.92487 22 11 22ZM8.70711 10.2426C8.31658 9.85208 7.68342 9.85208 7.29289 10.2426C6.90237 10.6331 6.90237 11.2663 7.29289 11.6568L9.41421 13.7781L10.1213 14.4852L10.8284 13.7781L15.0711 9.53549C15.4616 9.14497 15.4616 8.5118 15.0711 8.12128C14.6805 7.73076 14.0474 7.73076 13.6569 8.12128L10.1213 11.6568L8.70711 10.2426Z", fill: "#00D085" }) })));
|
|
18
|
+
export var redXIcon = (_jsxs("svg", __assign({ width: "19", height: "18", viewBox: "0 0 19 18", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [_jsx("circle", { cx: "9.49967", cy: "8.99992", r: "7.79167", stroke: "currentColor", strokeWidth: "1.5" }), _jsx("path", { d: "M7.375 6.875L11.625 11.125", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M7.375 11.125L11.625 6.875", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] })));
|
|
19
|
+
export var defaultCheckIcon = (_jsxs("svg", __assign({ width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [_jsx("circle", { cx: "12", cy: "12", r: "11", stroke: "currentColor", strokeWidth: "2" }), _jsx("path", { d: "M9 11.9497L11.1213 14.071L15.364 9.82839", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" })] })));
|
|
20
|
+
export var WhiteCheckIcon = function () {
|
|
21
|
+
var theme = useTheme();
|
|
22
|
+
return (_jsx("svg", __assign({ width: "22", height: "22", viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11 22C17.0751 22 22 17.0751 22 11C22 4.92487 17.0751 0 11 0C4.92487 0 0 4.92487 0 11C0 17.0751 4.92487 22 11 22ZM8.70711 10.2426C8.31658 9.85208 7.68342 9.85208 7.29289 10.2426C6.90237 10.6331 6.90237 11.2663 7.29289 11.6568L9.41421 13.7781L10.1213 14.4852L10.8284 13.7781L15.0711 9.53549C15.4616 9.14497 15.4616 8.5118 15.0711 8.12128C14.6805 7.73076 14.0474 7.73076 13.6569 8.12128L10.1213 11.6568L8.70711 10.2426Z", fill: theme.colors.blue500 }) })));
|
|
23
|
+
};
|
|
24
|
+
export var chevronLeftIcon = (_jsx("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", width: "8", height: "14", viewBox: "0 0 8 14", fill: "none" }, { children: _jsx("path", { d: "M6.22266 1.75L1.00028 6.97238L6.22266 12.1948", stroke: "#000000", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })));
|
|
25
|
+
export var ChevronRightIcon = function () {
|
|
26
|
+
var theme = useTheme();
|
|
27
|
+
return (_jsx("svg", __assign({ width: "9", height: "16", viewBox: "0 0 9 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { d: "M1 1L7.96317 7.96317L1 14.9263", stroke: theme.colors.black || "#3333", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })));
|
|
28
|
+
};
|
|
29
|
+
export var weatherStarsIcon = (_jsxs("svg", __assign({ width: "22", height: "22", viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [_jsx("path", { d: "M13.0159 4.5609C13.1442 4.0594 13.8565 4.0594 13.9847 4.5609L14.3163 5.85753C14.8596 7.98189 16.5184 9.64072 18.6428 10.184L19.9394 10.5155C20.4409 10.6438 20.4409 11.3561 19.9394 11.4844L18.6428 11.816C16.5184 12.3592 14.8596 14.018 14.3163 16.1424L13.9847 17.439C13.8565 17.9405 13.1442 17.9405 13.0159 17.439L12.6843 16.1424C12.1411 14.018 10.4823 12.3592 8.3579 11.816L7.06127 11.4844C6.55977 11.3561 6.55977 10.6438 7.06127 10.5155L8.3579 10.184C10.4823 9.64072 12.1411 7.98189 12.6843 5.85754L13.0159 4.5609Z", stroke: "white", strokeWidth: "2" }), _jsx("path", { d: "M3.5 1.83337V5.16671", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M5.16634 3.5H1.83301", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M4.33301 16.8334V20.1667", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M6.00033 18.5H2.66699", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })] })));
|
|
30
|
+
export var chevronDownIcon = (_jsx("svg", __assign({ width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { d: "M18.9258 10L11.9626 16.9632L4.99944 10", stroke: "black", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })));
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
+
import styled, { css } from "styled-components";
|
|
18
|
+
import { Div, themeProps, Label } from "../styled/utils";
|
|
19
|
+
import { colors } from "../styled/theme/colorPalette";
|
|
20
|
+
export var fuseImporterId = "fuse-importer-root";
|
|
21
|
+
export var MenuItem = styled(Div)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border-radius: 8px;\n padding: 12px 16px;\n display: flex;\n align-items: center;\n background: ", ";\n color: ", ";\n ", "\n ", ";\n ", "\n :hover {\n background: ", ";\n cursor: pointer;\n }\n"], ["\n border-radius: 8px;\n padding: 12px 16px;\n display: flex;\n align-items: center;\n background: ", ";\n color: ", ";\n ", "\n ", ";\n ", "\n :hover {\n background: ", ";\n cursor: pointer;\n }\n"])), function (props) { return props.theme.colors.white; }, function (props) { return props.color || props.theme.colors.text; }, function (props) { return props.theme.css.body1; }, function (p) { return p.theme.css.selectNone; }, function (p) {
|
|
22
|
+
return p.isSelected && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), function (p) { return p.theme.colors.blue500; });
|
|
23
|
+
}, function (props) { return props.theme.colors.blue100; });
|
|
24
|
+
export var FormInputLabel = styled(Label)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n ", ";\n color: ", ";\n ", "\n display: block;\n"], ["\n ", ";\n color: ", ";\n ", "\n display: block;\n"])), function (props) { return props.theme.css.body4; }, function (props) { return props.theme.colors.text; }, function (props) {
|
|
25
|
+
return props.isDisabled && css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), function (props) { return props.theme.colors.gray500; });
|
|
26
|
+
});
|
|
27
|
+
export var InfoDivider = function (_a) {
|
|
28
|
+
var msg = _a.msg;
|
|
29
|
+
return (_jsxs(Div, __assign({ dflex: true, alignCenter: true, mt: 7, mb: 7 }, { children: [_jsx(Div, { w100: true, h: 1, bg: colors.gray300 }), _jsx(Div, __assign({ w100: true, textAlignCenter: true, c: colors.gray700, body1: true, centered: true, p: 20 }, { children: msg })), _jsx(Div, { w100: true, h: 1, bg: colors.gray300 })] })));
|
|
30
|
+
};
|
|
31
|
+
export var Avatar = styled.img(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n ", ";\n border-radius: 100%;\n height: 36px;\n width: 36px;\n"], ["\n ", ";\n border-radius: 100%;\n height: 36px;\n width: 36px;\n"])), themeProps);
|
|
32
|
+
export var Divider = styled(Div)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n width: 100%;\n height: 1px;\n background: ", ";\n"], ["\n width: 100%;\n height: 1px;\n background: ", ";\n"])), colors.black);
|
|
33
|
+
export * from "./icons";
|
|
34
|
+
export * from "./inputs";
|
|
35
|
+
export * from "./Table";
|
|
36
|
+
export * from "./buttons";
|
|
37
|
+
export * from "./Toast";
|
|
38
|
+
export * from "./logo";
|
|
39
|
+
export * from "./Modal";
|
|
40
|
+
export * from "./Spinner";
|
|
41
|
+
export * from "./TooltipProvider";
|
|
42
|
+
export * from "./ConfirmationModal";
|
|
43
|
+
export * from "./columnsValidations";
|
|
44
|
+
export * from "./columnsTransformations";
|
|
45
|
+
export * from "./datePatterns";
|
|
46
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
|
+
var t = {};
|
|
18
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
19
|
+
t[p] = s[p];
|
|
20
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
21
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
23
|
+
t[p[i]] = s[p[i]];
|
|
24
|
+
}
|
|
25
|
+
return t;
|
|
26
|
+
};
|
|
27
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
|
+
import { useEffect, useMemo, useState } from "react";
|
|
29
|
+
import styled, { css } from "styled-components";
|
|
30
|
+
import { MenuItem } from "..";
|
|
31
|
+
import { Div } from "../../styled/utils";
|
|
32
|
+
import { SelectMenu } from "./SelectMenu";
|
|
33
|
+
import { TextInput as TextInputBase } from "./TextInput";
|
|
34
|
+
import { useTranslation } from "react-i18next";
|
|
35
|
+
var TextInput = styled(TextInputBase)(function (_a) {
|
|
36
|
+
var _b = _a.theme, colors = _b.colors, c = _b.css;
|
|
37
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n "], ["\n ", "\n "])), function (props) {
|
|
38
|
+
return props.isDisabled && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n cursor: not-allowed;\n pointer-events: none;\n "], ["\n cursor: not-allowed;\n pointer-events: none;\n "])));
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
var ClearIcon = styled(Div)(function (_a) {
|
|
42
|
+
var _b = _a.theme, colors = _b.colors, c = _b.css;
|
|
43
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n pointer-events: auto;\n "], ["\n pointer-events: auto;\n "])));
|
|
44
|
+
});
|
|
45
|
+
var ClickableArea = styled(Div)(function (_a) {
|
|
46
|
+
var _b = _a.theme, colors = _b.colors, c = _b.css, isInputDisabled = _a.isInputDisabled;
|
|
47
|
+
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n ", "\n "], ["\n ", "\n "])), isInputDisabled && css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n :hover {\n cursor: pointer;\n opacity: 0.9;\n }\n "], ["\n :hover {\n cursor: pointer;\n opacity: 0.9;\n }\n "]))));
|
|
48
|
+
});
|
|
49
|
+
var Autocomplete = function (_a) {
|
|
50
|
+
var _b = _a.label, label = _b === void 0 ? null : _b, _c = _a.isDisabled, isDisabled = _c === void 0 ? false : _c, _d = _a.isInputDisabled, isInputDisabled = _d === void 0 ? false : _d, _e = _a.placeholder, placeholder = _e === void 0 ? "general:autocomplete.placeholder" : _e, value = _a.value, icon = _a.icon, onChange = _a.onChange, placement = _a.placement, options = _a.options, onToggle = _a.onToggle, id = _a.id, labelTooltip = _a.labelTooltip, prefix = _a.prefix, props = __rest(_a, ["label", "isDisabled", "isInputDisabled", "placeholder", "value", "icon", "onChange", "placement", "options", "onToggle", "id", "labelTooltip", "prefix"]);
|
|
51
|
+
var _f = useState(false), updatedText = _f[0], setUpdatedText = _f[1];
|
|
52
|
+
var selectedLabel = useMemo(function () { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.find(function (o) { return (o === null || o === void 0 ? void 0 : o.value) === value; })) === null || _a === void 0 ? void 0 : _a.label) || ""; }, [value]);
|
|
53
|
+
var _g = useState(selectedLabel), text = _g[0], setText = _g[1];
|
|
54
|
+
var _h = useState(false), isMenuOpen = _h[0], setIsMenuOpen = _h[1];
|
|
55
|
+
var _j = useState(null), referenceElement = _j[0], setReferenceElement = _j[1];
|
|
56
|
+
var _k = useState(false), isTyping = _k[0], setIsTyping = _k[1];
|
|
57
|
+
var t = useTranslation().t;
|
|
58
|
+
useEffect(function () {
|
|
59
|
+
if (value)
|
|
60
|
+
setText(selectedLabel);
|
|
61
|
+
else
|
|
62
|
+
setText("");
|
|
63
|
+
}, [value]);
|
|
64
|
+
useEffect(function () {
|
|
65
|
+
setUpdatedText(true);
|
|
66
|
+
}, [text]);
|
|
67
|
+
useEffect(function () {
|
|
68
|
+
setUpdatedText(false);
|
|
69
|
+
setText(selectedLabel);
|
|
70
|
+
if (onToggle)
|
|
71
|
+
onToggle(isMenuOpen);
|
|
72
|
+
}, [isMenuOpen]);
|
|
73
|
+
var onSelect = function (v) {
|
|
74
|
+
var _a;
|
|
75
|
+
setText((_a = options.find(function (o) { return (o === null || o === void 0 ? void 0 : o.value) === v; })) === null || _a === void 0 ? void 0 : _a.label);
|
|
76
|
+
onChange(v);
|
|
77
|
+
setIsMenuOpen(false);
|
|
78
|
+
};
|
|
79
|
+
var filteredOptions = useMemo(function () {
|
|
80
|
+
return updatedText
|
|
81
|
+
? options.filter(function (o) {
|
|
82
|
+
return o.label.toLowerCase().includes(text.toLowerCase());
|
|
83
|
+
})
|
|
84
|
+
: options;
|
|
85
|
+
}, [updatedText, text, options]);
|
|
86
|
+
var inputIconUI = text ? (_jsx(ClearIcon, __assign({ clickable: true, dim: 24, centered: true, id: id ? "".concat(id, "-clear") : null, onClick: function (evt) {
|
|
87
|
+
evt.preventDefault();
|
|
88
|
+
evt.stopPropagation();
|
|
89
|
+
onChange(undefined);
|
|
90
|
+
} }, { children: clearIcon }))) : (_jsx(Div, __assign({ centered: true, dim: 24 }, { children: icon || chevronDownIcon })));
|
|
91
|
+
var textWithPrefix = "".concat(prefix).concat(text);
|
|
92
|
+
var shouldShowPrefix = prefix && !isTyping && !isMenuOpen;
|
|
93
|
+
var inputValue = shouldShowPrefix ? textWithPrefix : text;
|
|
94
|
+
return (_jsxs(Div, __assign({ w100: true }, props, { children: [_jsx(ClickableArea, __assign({ isInputDisabled: isDisabled || isInputDisabled, onClick: function () { return setIsMenuOpen(true); } }, { children: _jsx(TextInput, { setInputRef: setReferenceElement, id: id, onBlur: function () {
|
|
95
|
+
if (isTyping && prefix)
|
|
96
|
+
setIsTyping(false);
|
|
97
|
+
if (filteredOptions.length === 0) {
|
|
98
|
+
setText(selectedLabel);
|
|
99
|
+
setIsMenuOpen(false);
|
|
100
|
+
}
|
|
101
|
+
}, label: label, isDisabled: isDisabled || isInputDisabled, placeholder: t(placeholder), value: inputValue, onChange: function (v) {
|
|
102
|
+
if (!isTyping && prefix)
|
|
103
|
+
setIsTyping(true);
|
|
104
|
+
setText(v);
|
|
105
|
+
}, icon: isDisabled ? null : inputIconUI, labelTooltip: labelTooltip }) })), !isDisabled && filteredOptions.length > 0 && (_jsx(SelectMenu, __assign({ referenceElement: referenceElement, placement: placement, isOpen: isMenuOpen, onClose: function () { return setIsMenuOpen(false); } }, { children: filteredOptions.map(function (o, index) { return (_jsx(Div, __assign({ "data-test-id": "autocomplete-menu-item" }, { children: _jsx(MenuItem, __assign({ id: id ? "".concat(id, "-option-").concat(o.label) : null, isSelected: value === (o === null || o === void 0 ? void 0 : o.value), onClick: function () { return onSelect(o === null || o === void 0 ? void 0 : o.value); } }, { children: o.label })) }), index)); }) })))] })));
|
|
106
|
+
};
|
|
107
|
+
var chevronDownIcon = (_jsx("svg", __assign({ width: "16", height: "9", viewBox: "0 0 16 9", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { d: "M14.9263 1L7.9631 7.96317L0.999928 1", stroke: "black", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })));
|
|
108
|
+
var clearIcon = (_jsxs("svg", __assign({ width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [_jsx("path", { d: "M4 4L12.5161 12.5161", stroke: "#333333", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M4 12.5161L12.5161 3.99998", stroke: "#333333", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })] })));
|
|
109
|
+
export { Autocomplete };
|
|
110
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
|
+
var t = {};
|
|
18
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
19
|
+
t[p] = s[p];
|
|
20
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
21
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
23
|
+
t[p[i]] = s[p[i]];
|
|
24
|
+
}
|
|
25
|
+
return t;
|
|
26
|
+
};
|
|
27
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
28
|
+
import styled, { css } from "styled-components";
|
|
29
|
+
import { Div } from "../../styled/utils";
|
|
30
|
+
var Container = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n height: 20px;\n width: 20px;\n border: 1px solid ", ";\n background-color: ", ";\n border-radius: 4px;\n ", ";\n\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n\n ", "\n"], ["\n height: 20px;\n width: 20px;\n border: 1px solid ", ";\n background-color: ", ";\n border-radius: 4px;\n ", ";\n\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n\n ", "\n"])), function (props) { return props.theme.colors.gray400; }, function (props) { return props.theme.colors.white; }, function (props) {
|
|
31
|
+
return (props.isChecked || props.isIndeterminate) && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border: 1px solid white;\n background-color: ", ";\n "], ["\n border: 1px solid white;\n background-color: ", ";\n "])), props.theme.colors.pink500);
|
|
32
|
+
}, function (_a) {
|
|
33
|
+
var isDisabled = _a.isDisabled;
|
|
34
|
+
return isDisabled && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n opacity: 0.6;\n\n :hover {\n cursor: not-allowed;\n }\n "], ["\n opacity: 0.6;\n\n :hover {\n cursor: not-allowed;\n }\n "])));
|
|
35
|
+
});
|
|
36
|
+
var Checkbox = function (_a) {
|
|
37
|
+
var isChecked = _a.isChecked, isIndeterminate = _a.isIndeterminate, _b = _a.icon, icon = _b === void 0 ? null : _b, onChange = _a.onChange, onShiftKeyPressed = _a.onShiftKeyPressed, _c = _a.isDisabled, isDisabled = _c === void 0 ? false : _c, props = __rest(_a, ["isChecked", "isIndeterminate", "icon", "onChange", "onShiftKeyPressed", "isDisabled"]);
|
|
38
|
+
var handleOnChange = function (event) {
|
|
39
|
+
if (!onChange)
|
|
40
|
+
return;
|
|
41
|
+
if ((event.shiftKey || event.nativeEvent.metaKey) && onShiftKeyPressed) {
|
|
42
|
+
onShiftKeyPressed();
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
var newValue = !isChecked || isIndeterminate;
|
|
46
|
+
onChange(newValue);
|
|
47
|
+
};
|
|
48
|
+
return (_jsx(Container, __assign({}, __assign({ isChecked: isChecked, isDisabled: isDisabled, isIndeterminate: isIndeterminate, onClick: handleOnChange }, props), { "data-test-id": "checkbox" }, { children: isIndeterminate ? (_jsx(IndeterminateIcon, {})) : (_jsx(Div, __assign({ centered: true }, { children: isChecked && (icon || checkIcon) }))) })));
|
|
49
|
+
};
|
|
50
|
+
var checkIcon = (_jsx("svg", __assign({ width: "14", height: "10", viewBox: "0 0 14 10", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { d: "M1.10254 4.74355L5.2051 8.84612L12.8974 1.15381", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })));
|
|
51
|
+
var IndeterminateIcon = function () { return (_jsx("svg", __assign({ width: "14", height: "2", viewBox: "0 0 14 2", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { d: "M1 1H13", stroke: "white", strokeWidth: "2", strokeLinecap: "round" }) }))); };
|
|
52
|
+
export { Checkbox };
|
|
53
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
|
+
var t = {};
|
|
18
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
19
|
+
t[p] = s[p];
|
|
20
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
21
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
23
|
+
t[p[i]] = s[p[i]];
|
|
24
|
+
}
|
|
25
|
+
return t;
|
|
26
|
+
};
|
|
27
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
28
|
+
import { useEffect, useLayoutEffect, useState } from "react";
|
|
29
|
+
import { usePopper } from "react-popper";
|
|
30
|
+
import styled, { css } from "styled-components";
|
|
31
|
+
import { Div } from "../../styled/utils";
|
|
32
|
+
export var SelectMenuBackdrop = styled(Div)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: fixed;\n top: 0px;\n left: 0px;\n margin: 0px;\n width: 100vw;\n height: 100vh;\n z-index: 99999999;\n display: flex;\n"], ["\n position: fixed;\n top: 0px;\n left: 0px;\n margin: 0px;\n width: 100vw;\n height: 100vh;\n z-index: 99999999;\n display: flex;\n"])));
|
|
33
|
+
export var SelectMenuDiv = styled(Div)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: white;\n border: solid 1px ", ";\n position: absolute;\n border-radius: 16px;\n overflow: hidden;\n z-index: 10000000000;\n box-shadow: 0px 0px 16px rgba(0, 0, 0, 0.12);\n"], ["\n background-color: white;\n border: solid 1px ", ";\n position: absolute;\n border-radius: 16px;\n overflow: hidden;\n z-index: 10000000000;\n box-shadow: 0px 0px 16px rgba(0, 0, 0, 0.12);\n"])), function (p) { return p.theme.colors.gray5; });
|
|
34
|
+
export var SelectMenuScrollArea = styled(Div)(function (_a) {
|
|
35
|
+
var _b = _a.theme, colors = _b.colors, c = _b.css;
|
|
36
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n padding: 16px;\n overflow-y: auto;\n max-height: 250px;\n ", ";\n "], ["\n padding: 16px;\n overflow-y: auto;\n max-height: 250px;\n ", ";\n "])), function (p) { return p.theme.css.scrollbarDark; });
|
|
37
|
+
});
|
|
38
|
+
export var SelectMenu = function (_a) {
|
|
39
|
+
var _b;
|
|
40
|
+
var _c = _a.isOpen, isOpen = _c === void 0 ? false : _c, _d = _a.onClose, onClose = _d === void 0 ? null : _d, _e = _a.placement, placement = _e === void 0 ? "auto" : _e, referenceElement = _a.referenceElement, children = _a.children, props = __rest(_a, ["isOpen", "onClose", "placement", "referenceElement", "children"]);
|
|
41
|
+
var _f = useState(null), popperElement = _f[0], setPopperElement = _f[1];
|
|
42
|
+
var _g = useState(null), width = _g[0], setWidth = _g[1];
|
|
43
|
+
var options = {
|
|
44
|
+
placement: placement,
|
|
45
|
+
strategy: "absolute",
|
|
46
|
+
modifiers: [
|
|
47
|
+
{
|
|
48
|
+
name: "offset",
|
|
49
|
+
options: {
|
|
50
|
+
offset: [2, 3],
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "preventOverflow",
|
|
55
|
+
options: {
|
|
56
|
+
altAxis: true,
|
|
57
|
+
boundary: "viewport",
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
};
|
|
62
|
+
var _h = usePopper(referenceElement, popperElement, options), styles = _h.styles, attributes = _h.attributes, update = _h.update;
|
|
63
|
+
useEffect(function () {
|
|
64
|
+
if (update)
|
|
65
|
+
update();
|
|
66
|
+
}, [isOpen]);
|
|
67
|
+
var referenceElementWidth = (_b = referenceElement === null || referenceElement === void 0 ? void 0 : referenceElement.getBoundingClientRect()) === null || _b === void 0 ? void 0 : _b.width;
|
|
68
|
+
useLayoutEffect(function () {
|
|
69
|
+
if (referenceElement)
|
|
70
|
+
setWidth(referenceElementWidth);
|
|
71
|
+
}, [referenceElementWidth]);
|
|
72
|
+
return (_jsx(_Fragment, { children: isOpen && (_jsxs(Div, __assign({ pRelative: true }, props, { children: [_jsx(SelectMenuBackdrop, { onClick: onClose }), _jsx(SelectMenuDiv, __assign({ ref: setPopperElement, style: __assign(__assign({}, styles.popper), { width: width }) }, attributes.popper, { children: _jsx(SelectMenuScrollArea, { children: children }) }))] }))) }));
|
|
73
|
+
};
|
|
74
|
+
var templateObject_1, templateObject_2, templateObject_3;
|