analytica-frontend-lib 1.2.84 → 1.2.86
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/RecommendedLessonsHistory/index.js +337 -165
- package/dist/RecommendedLessonsHistory/index.js.map +1 -1
- package/dist/RecommendedLessonsHistory/index.mjs +286 -114
- package/dist/RecommendedLessonsHistory/index.mjs.map +1 -1
- package/dist/hooks/useGoalDrafts/index.d.ts +57 -0
- package/dist/hooks/useGoalDrafts/index.d.ts.map +1 -0
- package/dist/hooks/useGoalDrafts/index.js +189 -0
- package/dist/hooks/useGoalDrafts/index.js.map +1 -0
- package/dist/hooks/useGoalDrafts/index.mjs +151 -0
- package/dist/hooks/useGoalDrafts/index.mjs.map +1 -0
- package/dist/hooks/useGoalDrafts.d.ts +57 -0
- package/dist/hooks/useGoalDrafts.d.ts.map +1 -0
- package/dist/hooks/useRecommendedLessonsPage/index.d.ts +4 -0
- package/dist/hooks/useRecommendedLessonsPage/index.d.ts.map +1 -1
- package/dist/hooks/useRecommendedLessonsPage/index.js +24 -0
- package/dist/hooks/useRecommendedLessonsPage/index.js.map +1 -1
- package/dist/hooks/useRecommendedLessonsPage/index.mjs +24 -0
- package/dist/hooks/useRecommendedLessonsPage/index.mjs.map +1 -1
- package/dist/hooks/useRecommendedLessonsPage.d.ts +4 -0
- package/dist/hooks/useRecommendedLessonsPage.d.ts.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +690 -430
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +567 -316
- package/dist/index.mjs.map +1 -1
- package/dist/types/lessonAvailability.d.ts +33 -0
- package/dist/types/lessonAvailability.d.ts.map +1 -0
- package/dist/utils/lessonAvailabilityUtils.d.ts +45 -0
- package/dist/utils/lessonAvailabilityUtils.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -37,7 +37,7 @@ __export(RecommendedLessonsHistory_exports, {
|
|
|
37
37
|
module.exports = __toCommonJS(RecommendedLessonsHistory_exports);
|
|
38
38
|
|
|
39
39
|
// src/components/RecommendedLessonsHistory/RecommendedLessonsHistory.tsx
|
|
40
|
-
var
|
|
40
|
+
var import_react24 = require("react");
|
|
41
41
|
var import_phosphor_react17 = require("phosphor-react");
|
|
42
42
|
|
|
43
43
|
// src/utils/utils.ts
|
|
@@ -580,7 +580,7 @@ var injectStore = (children, store) => import_react2.Children.map(children, (chi
|
|
|
580
580
|
});
|
|
581
581
|
|
|
582
582
|
// src/components/TableProvider/TableProvider.tsx
|
|
583
|
-
var
|
|
583
|
+
var import_react23 = require("react");
|
|
584
584
|
|
|
585
585
|
// src/components/Table/Table.tsx
|
|
586
586
|
var import_react4 = require("react");
|
|
@@ -2678,7 +2678,7 @@ Search.displayName = "Search";
|
|
|
2678
2678
|
var Search_default = Search;
|
|
2679
2679
|
|
|
2680
2680
|
// src/components/CheckBoxGroup/CheckBoxGroup.tsx
|
|
2681
|
-
var
|
|
2681
|
+
var import_react22 = require("react");
|
|
2682
2682
|
|
|
2683
2683
|
// src/components/CheckBox/CheckBox.tsx
|
|
2684
2684
|
var import_react12 = require("react");
|
|
@@ -5875,13 +5875,90 @@ var createUseGoalModels = (fetchGoalModels, deleteGoalModel) => {
|
|
|
5875
5875
|
};
|
|
5876
5876
|
};
|
|
5877
5877
|
|
|
5878
|
+
// src/hooks/useGoalDrafts.ts
|
|
5879
|
+
var import_react20 = require("react");
|
|
5880
|
+
var DEFAULT_GOAL_DRAFTS_PAGINATION = {
|
|
5881
|
+
total: 0,
|
|
5882
|
+
page: 1,
|
|
5883
|
+
limit: 10,
|
|
5884
|
+
totalPages: 0
|
|
5885
|
+
};
|
|
5886
|
+
var handleGoalDraftFetchError = createFetchErrorHandler(
|
|
5887
|
+
"Erro ao validar dados de rascunhos de aulas",
|
|
5888
|
+
"Erro ao carregar rascunhos de aulas"
|
|
5889
|
+
);
|
|
5890
|
+
var createUseGoalDrafts = (fetchGoalDrafts, deleteGoalDraft) => {
|
|
5891
|
+
return () => {
|
|
5892
|
+
const [state, setState] = (0, import_react20.useState)({
|
|
5893
|
+
models: [],
|
|
5894
|
+
loading: false,
|
|
5895
|
+
error: null,
|
|
5896
|
+
pagination: DEFAULT_GOAL_DRAFTS_PAGINATION
|
|
5897
|
+
});
|
|
5898
|
+
const fetchModels = (0, import_react20.useCallback)(
|
|
5899
|
+
async (filters, subjectsMap) => {
|
|
5900
|
+
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
5901
|
+
try {
|
|
5902
|
+
const responseData = await fetchGoalDrafts(filters);
|
|
5903
|
+
const validatedData = goalModelsApiResponseSchema.parse(responseData);
|
|
5904
|
+
const tableItems = validatedData.data.drafts.map(
|
|
5905
|
+
(draft) => transformGoalModelToTableItem(draft, subjectsMap)
|
|
5906
|
+
);
|
|
5907
|
+
const limit = filters?.limit || 10;
|
|
5908
|
+
const page = filters?.page || 1;
|
|
5909
|
+
const total = validatedData.data.total;
|
|
5910
|
+
const totalPages = Math.ceil(total / limit);
|
|
5911
|
+
setState({
|
|
5912
|
+
models: tableItems,
|
|
5913
|
+
loading: false,
|
|
5914
|
+
error: null,
|
|
5915
|
+
pagination: {
|
|
5916
|
+
total,
|
|
5917
|
+
page,
|
|
5918
|
+
limit,
|
|
5919
|
+
totalPages
|
|
5920
|
+
}
|
|
5921
|
+
});
|
|
5922
|
+
} catch (error) {
|
|
5923
|
+
const errorMessage = handleGoalDraftFetchError(error);
|
|
5924
|
+
setState((prev) => ({
|
|
5925
|
+
...prev,
|
|
5926
|
+
loading: false,
|
|
5927
|
+
error: errorMessage
|
|
5928
|
+
}));
|
|
5929
|
+
}
|
|
5930
|
+
},
|
|
5931
|
+
[fetchGoalDrafts]
|
|
5932
|
+
);
|
|
5933
|
+
const deleteModel = (0, import_react20.useCallback)(
|
|
5934
|
+
async (id) => {
|
|
5935
|
+
try {
|
|
5936
|
+
await deleteGoalDraft(id);
|
|
5937
|
+
return true;
|
|
5938
|
+
} catch (error) {
|
|
5939
|
+
console.error("Erro ao deletar rascunho:", error);
|
|
5940
|
+
return false;
|
|
5941
|
+
}
|
|
5942
|
+
},
|
|
5943
|
+
[deleteGoalDraft]
|
|
5944
|
+
);
|
|
5945
|
+
return {
|
|
5946
|
+
...state,
|
|
5947
|
+
fetchModels,
|
|
5948
|
+
deleteModel
|
|
5949
|
+
};
|
|
5950
|
+
};
|
|
5951
|
+
};
|
|
5952
|
+
|
|
5953
|
+
// src/components/shared/ModelsTabBase/ModelsTabBase.tsx
|
|
5954
|
+
var import_react21 = require("react");
|
|
5955
|
+
var import_phosphor_react15 = require("phosphor-react");
|
|
5956
|
+
|
|
5878
5957
|
// src/components/ActivitiesHistory/components/ErrorDisplay.tsx
|
|
5879
5958
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
5880
5959
|
var ErrorDisplay = ({ error }) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex items-center justify-center bg-background rounded-xl w-full min-h-[705px]", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text_default, { size: "lg", color: "text-error-500", children: error }) });
|
|
5881
5960
|
|
|
5882
5961
|
// src/components/shared/ModelsTabBase/ModelsTabBase.tsx
|
|
5883
|
-
var import_react20 = require("react");
|
|
5884
|
-
var import_phosphor_react15 = require("phosphor-react");
|
|
5885
5962
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
5886
5963
|
var ModelsTabBase = ({
|
|
5887
5964
|
fetchModels: fetchModelsProp,
|
|
@@ -5900,16 +5977,16 @@ var ModelsTabBase = ({
|
|
|
5900
5977
|
buildFiltersFromParams: buildFiltersFromParams2,
|
|
5901
5978
|
createUseModels
|
|
5902
5979
|
}) => {
|
|
5903
|
-
const [deleteDialogOpen, setDeleteDialogOpen] = (0,
|
|
5904
|
-
const [modelToDelete, setModelToDelete] = (0,
|
|
5980
|
+
const [deleteDialogOpen, setDeleteDialogOpen] = (0, import_react21.useState)(false);
|
|
5981
|
+
const [modelToDelete, setModelToDelete] = (0, import_react21.useState)(null);
|
|
5905
5982
|
const { addToast } = useToast();
|
|
5906
|
-
const fetchModelsRef = (0,
|
|
5983
|
+
const fetchModelsRef = (0, import_react21.useRef)(fetchModelsProp);
|
|
5907
5984
|
fetchModelsRef.current = fetchModelsProp;
|
|
5908
|
-
const deleteModelRef = (0,
|
|
5985
|
+
const deleteModelRef = (0, import_react21.useRef)(deleteModelProp);
|
|
5909
5986
|
deleteModelRef.current = deleteModelProp;
|
|
5910
|
-
const subjectsMapRef = (0,
|
|
5987
|
+
const subjectsMapRef = (0, import_react21.useRef)(subjectsMap);
|
|
5911
5988
|
subjectsMapRef.current = subjectsMap;
|
|
5912
|
-
const useModels = (0,
|
|
5989
|
+
const useModels = (0, import_react21.useMemo)(
|
|
5913
5990
|
() => createUseModels(
|
|
5914
5991
|
(filters) => fetchModelsRef.current(filters),
|
|
5915
5992
|
(id) => deleteModelRef.current(id)
|
|
@@ -5924,15 +6001,15 @@ var ModelsTabBase = ({
|
|
|
5924
6001
|
fetchModels,
|
|
5925
6002
|
deleteModel
|
|
5926
6003
|
} = useModels();
|
|
5927
|
-
const modelsFilterConfigs = (0,
|
|
6004
|
+
const modelsFilterConfigs = (0, import_react21.useMemo)(
|
|
5928
6005
|
() => createFiltersConfig(userFilterData),
|
|
5929
6006
|
[createFiltersConfig, userFilterData]
|
|
5930
6007
|
);
|
|
5931
|
-
const handleDeleteClick = (0,
|
|
6008
|
+
const handleDeleteClick = (0, import_react21.useCallback)((model) => {
|
|
5932
6009
|
setModelToDelete(model);
|
|
5933
6010
|
setDeleteDialogOpen(true);
|
|
5934
6011
|
}, []);
|
|
5935
|
-
const modelsTableColumns = (0,
|
|
6012
|
+
const modelsTableColumns = (0, import_react21.useMemo)(
|
|
5936
6013
|
() => createTableColumns2(
|
|
5937
6014
|
mapSubjectNameToEnum,
|
|
5938
6015
|
onSend,
|
|
@@ -5947,17 +6024,17 @@ var ModelsTabBase = ({
|
|
|
5947
6024
|
handleDeleteClick
|
|
5948
6025
|
]
|
|
5949
6026
|
);
|
|
5950
|
-
const handleParamsChange = (0,
|
|
6027
|
+
const handleParamsChange = (0, import_react21.useCallback)(
|
|
5951
6028
|
(params) => {
|
|
5952
6029
|
const filters = buildFiltersFromParams2(params);
|
|
5953
6030
|
fetchModels(filters, subjectsMapRef.current);
|
|
5954
6031
|
},
|
|
5955
6032
|
[buildFiltersFromParams2, fetchModels]
|
|
5956
6033
|
);
|
|
5957
|
-
(0,
|
|
6034
|
+
(0, import_react21.useEffect)(() => {
|
|
5958
6035
|
fetchModels({ page: 1, limit: 10 }, subjectsMapRef.current);
|
|
5959
6036
|
}, [fetchModels]);
|
|
5960
|
-
const handleConfirmDelete = (0,
|
|
6037
|
+
const handleConfirmDelete = (0, import_react21.useCallback)(async () => {
|
|
5961
6038
|
if (modelToDelete) {
|
|
5962
6039
|
const success = await deleteModel(modelToDelete.id);
|
|
5963
6040
|
if (success) {
|
|
@@ -5970,7 +6047,7 @@ var ModelsTabBase = ({
|
|
|
5970
6047
|
setDeleteDialogOpen(false);
|
|
5971
6048
|
setModelToDelete(null);
|
|
5972
6049
|
}, [modelToDelete, deleteModel, fetchModels, addToast]);
|
|
5973
|
-
const handleCancelDelete = (0,
|
|
6050
|
+
const handleCancelDelete = (0, import_react21.useCallback)(() => {
|
|
5974
6051
|
setDeleteDialogOpen(false);
|
|
5975
6052
|
setModelToDelete(null);
|
|
5976
6053
|
}, []);
|
|
@@ -6060,6 +6137,98 @@ var ModelsTabBase = ({
|
|
|
6060
6137
|
] });
|
|
6061
6138
|
};
|
|
6062
6139
|
|
|
6140
|
+
// src/components/RecommendedLessonsHistory/config/draftsFiltersConfig.ts
|
|
6141
|
+
var getSubjectOptions = (data) => {
|
|
6142
|
+
if (!data?.subjects) return [];
|
|
6143
|
+
return data.subjects.map((subject) => ({
|
|
6144
|
+
id: subject.id,
|
|
6145
|
+
name: subject.name
|
|
6146
|
+
}));
|
|
6147
|
+
};
|
|
6148
|
+
var createGoalDraftsFiltersConfig = (userData) => [
|
|
6149
|
+
{
|
|
6150
|
+
key: "content",
|
|
6151
|
+
label: "CONTE\xDADO",
|
|
6152
|
+
categories: [
|
|
6153
|
+
{
|
|
6154
|
+
key: "subject",
|
|
6155
|
+
label: "Mat\xE9ria",
|
|
6156
|
+
selectedIds: [],
|
|
6157
|
+
itens: getSubjectOptions(userData)
|
|
6158
|
+
}
|
|
6159
|
+
]
|
|
6160
|
+
}
|
|
6161
|
+
];
|
|
6162
|
+
|
|
6163
|
+
// src/components/RecommendedLessonsHistory/utils/filterBuilders.ts
|
|
6164
|
+
var buildGoalModelsFiltersFromParams = (params) => {
|
|
6165
|
+
const filters = {
|
|
6166
|
+
page: params.page,
|
|
6167
|
+
limit: params.limit
|
|
6168
|
+
};
|
|
6169
|
+
if (params.search) {
|
|
6170
|
+
filters.search = params.search;
|
|
6171
|
+
}
|
|
6172
|
+
if (Array.isArray(params.subject) && params.subject.length > 0) {
|
|
6173
|
+
filters.subjectId = params.subject[0];
|
|
6174
|
+
}
|
|
6175
|
+
return filters;
|
|
6176
|
+
};
|
|
6177
|
+
|
|
6178
|
+
// src/components/RecommendedLessonsHistory/tabs/DraftsTab.tsx
|
|
6179
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
6180
|
+
var GOAL_DRAFTS_CONFIG = {
|
|
6181
|
+
entityName: "rascunho",
|
|
6182
|
+
entityNamePlural: "rascunhos",
|
|
6183
|
+
testId: "goal-drafts-tab",
|
|
6184
|
+
emptyStateTitle: "Voc\xEA n\xE3o tem aulas recomendadas em rascunho",
|
|
6185
|
+
emptyStateDescription: "As aulas recomendadas que voc\xEA come\xE7ar a criar, aparecer\xE3o aqui automaticamente como rascunhos. Tudo \xE9 salvo enquanto voc\xEA cria, continue de onde parou quando quiser!",
|
|
6186
|
+
searchPlaceholder: "Buscar rascunho"
|
|
6187
|
+
};
|
|
6188
|
+
var GOAL_DRAFTS_COLUMNS_CONFIG = {
|
|
6189
|
+
sendButtonLabel: "Enviar aula",
|
|
6190
|
+
sendButtonAriaLabel: "Enviar rascunho",
|
|
6191
|
+
deleteButtonAriaLabel: "Deletar rascunho",
|
|
6192
|
+
editButtonAriaLabel: "Editar rascunho"
|
|
6193
|
+
};
|
|
6194
|
+
var GoalDraftsTab = ({
|
|
6195
|
+
fetchGoalDrafts,
|
|
6196
|
+
deleteGoalDraft,
|
|
6197
|
+
onCreateDraft,
|
|
6198
|
+
onSendDraft,
|
|
6199
|
+
onEditDraft,
|
|
6200
|
+
emptyStateImage,
|
|
6201
|
+
noSearchImage,
|
|
6202
|
+
mapSubjectNameToEnum,
|
|
6203
|
+
userFilterData,
|
|
6204
|
+
subjectsMap
|
|
6205
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6206
|
+
ModelsTabBase,
|
|
6207
|
+
{
|
|
6208
|
+
fetchModels: fetchGoalDrafts,
|
|
6209
|
+
deleteModel: deleteGoalDraft,
|
|
6210
|
+
onCreateModel: onCreateDraft,
|
|
6211
|
+
onSend: onSendDraft,
|
|
6212
|
+
onEditModel: onEditDraft,
|
|
6213
|
+
emptyStateImage,
|
|
6214
|
+
noSearchImage,
|
|
6215
|
+
mapSubjectNameToEnum,
|
|
6216
|
+
userFilterData,
|
|
6217
|
+
subjectsMap,
|
|
6218
|
+
config: GOAL_DRAFTS_CONFIG,
|
|
6219
|
+
createTableColumns: (mapSubject, send, edit, del) => createModelsTableColumnsBase(
|
|
6220
|
+
mapSubject,
|
|
6221
|
+
send,
|
|
6222
|
+
edit,
|
|
6223
|
+
del,
|
|
6224
|
+
GOAL_DRAFTS_COLUMNS_CONFIG
|
|
6225
|
+
),
|
|
6226
|
+
createFiltersConfig: createGoalDraftsFiltersConfig,
|
|
6227
|
+
buildFiltersFromParams: buildGoalModelsFiltersFromParams,
|
|
6228
|
+
createUseModels: createUseGoalDrafts
|
|
6229
|
+
}
|
|
6230
|
+
);
|
|
6231
|
+
|
|
6063
6232
|
// src/components/CheckBoxGroup/CheckBoxGroup.helpers.ts
|
|
6064
6233
|
var areSelectedIdsEqual = (ids1, ids2) => {
|
|
6065
6234
|
if (ids1 === ids2) return true;
|
|
@@ -6142,7 +6311,7 @@ var calculateFormattedItemsForAutoSelection = (category, allCategories) => {
|
|
|
6142
6311
|
};
|
|
6143
6312
|
|
|
6144
6313
|
// src/components/CheckBoxGroup/CheckBoxGroup.tsx
|
|
6145
|
-
var
|
|
6314
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
6146
6315
|
var CheckboxGroup = ({
|
|
6147
6316
|
categories,
|
|
6148
6317
|
onCategoriesChange,
|
|
@@ -6150,14 +6319,14 @@ var CheckboxGroup = ({
|
|
|
6150
6319
|
showDivider = true,
|
|
6151
6320
|
showSingleItem = false
|
|
6152
6321
|
}) => {
|
|
6153
|
-
const [openAccordion, setOpenAccordion] = (0,
|
|
6154
|
-
const onCategoriesChangeRef = (0,
|
|
6155
|
-
const previousCategoriesRef = (0,
|
|
6156
|
-
const appliedAutoSelectionRef = (0,
|
|
6157
|
-
(0,
|
|
6322
|
+
const [openAccordion, setOpenAccordion] = (0, import_react22.useState)("");
|
|
6323
|
+
const onCategoriesChangeRef = (0, import_react22.useRef)(onCategoriesChange);
|
|
6324
|
+
const previousCategoriesRef = (0, import_react22.useRef)(categories);
|
|
6325
|
+
const appliedAutoSelectionRef = (0, import_react22.useRef)("");
|
|
6326
|
+
(0, import_react22.useEffect)(() => {
|
|
6158
6327
|
onCategoriesChangeRef.current = onCategoriesChange;
|
|
6159
6328
|
}, [onCategoriesChange]);
|
|
6160
|
-
const categoriesWithAutoSelection = (0,
|
|
6329
|
+
const categoriesWithAutoSelection = (0, import_react22.useMemo)(() => {
|
|
6161
6330
|
return categories.map((category) => {
|
|
6162
6331
|
const filteredItems = calculateFormattedItemsForAutoSelection(
|
|
6163
6332
|
category,
|
|
@@ -6172,7 +6341,7 @@ var CheckboxGroup = ({
|
|
|
6172
6341
|
return category;
|
|
6173
6342
|
});
|
|
6174
6343
|
}, [categories]);
|
|
6175
|
-
(0,
|
|
6344
|
+
(0, import_react22.useEffect)(() => {
|
|
6176
6345
|
const categoriesChanged = categories !== previousCategoriesRef.current;
|
|
6177
6346
|
previousCategoriesRef.current = categories;
|
|
6178
6347
|
const hasAutoSelectionChanges = categoriesWithAutoSelection.some(
|
|
@@ -6294,7 +6463,7 @@ var CheckboxGroup = ({
|
|
|
6294
6463
|
);
|
|
6295
6464
|
return groupedItems.length ? groupedItems : [{ itens: [] }];
|
|
6296
6465
|
};
|
|
6297
|
-
const formattedItemsMap = (0,
|
|
6466
|
+
const formattedItemsMap = (0, import_react22.useMemo)(() => {
|
|
6298
6467
|
const formattedItemsMap2 = {};
|
|
6299
6468
|
for (const category of categories) {
|
|
6300
6469
|
const formattedItems = calculateFormattedItems(category.key);
|
|
@@ -6449,8 +6618,8 @@ var CheckboxGroup = ({
|
|
|
6449
6618
|
};
|
|
6450
6619
|
const renderCheckboxItem = (item, categoryKey) => {
|
|
6451
6620
|
const uniqueId = `${categoryKey}-${item.id}`;
|
|
6452
|
-
return /* @__PURE__ */ (0,
|
|
6453
|
-
/* @__PURE__ */ (0,
|
|
6621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-3 px-2", children: [
|
|
6622
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6454
6623
|
CheckBox_default,
|
|
6455
6624
|
{
|
|
6456
6625
|
id: uniqueId,
|
|
@@ -6458,7 +6627,7 @@ var CheckboxGroup = ({
|
|
|
6458
6627
|
onChange: () => toggleItem(categoryKey, item.id)
|
|
6459
6628
|
}
|
|
6460
6629
|
),
|
|
6461
|
-
/* @__PURE__ */ (0,
|
|
6630
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6462
6631
|
"label",
|
|
6463
6632
|
{
|
|
6464
6633
|
htmlFor: uniqueId,
|
|
@@ -6468,12 +6637,12 @@ var CheckboxGroup = ({
|
|
|
6468
6637
|
)
|
|
6469
6638
|
] }, item.id);
|
|
6470
6639
|
};
|
|
6471
|
-
const renderFormattedGroup = (formattedGroup, idx, categoryKey) => /* @__PURE__ */ (0,
|
|
6640
|
+
const renderFormattedGroup = (formattedGroup, idx, categoryKey) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
6472
6641
|
"div",
|
|
6473
6642
|
{
|
|
6474
6643
|
className: "flex flex-col gap-3",
|
|
6475
6644
|
children: [
|
|
6476
|
-
"groupLabel" in formattedGroup && formattedGroup.groupLabel && /* @__PURE__ */ (0,
|
|
6645
|
+
"groupLabel" in formattedGroup && formattedGroup.groupLabel && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text_default, { size: "sm", className: "mt-2", weight: "semibold", children: formattedGroup.groupLabel }),
|
|
6477
6646
|
formattedGroup.itens?.map(
|
|
6478
6647
|
(item) => renderCheckboxItem(item, categoryKey)
|
|
6479
6648
|
)
|
|
@@ -6481,9 +6650,9 @@ var CheckboxGroup = ({
|
|
|
6481
6650
|
},
|
|
6482
6651
|
formattedGroup.groupLabel || `group-${idx}`
|
|
6483
6652
|
);
|
|
6484
|
-
const renderAccordionTrigger = (category, isEnabled) => /* @__PURE__ */ (0,
|
|
6485
|
-
/* @__PURE__ */ (0,
|
|
6486
|
-
/* @__PURE__ */ (0,
|
|
6653
|
+
const renderAccordionTrigger = (category, isEnabled) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center justify-between w-full p-2", children: [
|
|
6654
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
6655
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6487
6656
|
CheckBox_default,
|
|
6488
6657
|
{
|
|
6489
6658
|
checked: isMinimalOneCheckBoxIsSelected(category.key),
|
|
@@ -6492,7 +6661,7 @@ var CheckboxGroup = ({
|
|
|
6492
6661
|
onChange: () => toggleAllInCategory(category.key)
|
|
6493
6662
|
}
|
|
6494
6663
|
),
|
|
6495
|
-
/* @__PURE__ */ (0,
|
|
6664
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6496
6665
|
Text_default,
|
|
6497
6666
|
{
|
|
6498
6667
|
size: "sm",
|
|
@@ -6502,7 +6671,7 @@ var CheckboxGroup = ({
|
|
|
6502
6671
|
}
|
|
6503
6672
|
)
|
|
6504
6673
|
] }),
|
|
6505
|
-
(openAccordion === category.key || isEnabled) && /* @__PURE__ */ (0,
|
|
6674
|
+
(openAccordion === category.key || isEnabled) && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Badge_default, { variant: "solid", action: "info", children: getBadgeText2(category) })
|
|
6506
6675
|
] });
|
|
6507
6676
|
const renderCompactSingleItem = (category) => {
|
|
6508
6677
|
const formattedItems = getFormattedItems(category.key);
|
|
@@ -6511,13 +6680,13 @@ var CheckboxGroup = ({
|
|
|
6511
6680
|
return null;
|
|
6512
6681
|
}
|
|
6513
6682
|
const singleItem = allItems[0];
|
|
6514
|
-
return /* @__PURE__ */ (0,
|
|
6683
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
6515
6684
|
"div",
|
|
6516
6685
|
{
|
|
6517
6686
|
className: "flex items-center justify-between w-full px-3 py-2",
|
|
6518
6687
|
children: [
|
|
6519
|
-
/* @__PURE__ */ (0,
|
|
6520
|
-
/* @__PURE__ */ (0,
|
|
6688
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text_default, { size: "sm", weight: "bold", className: "text-text-800", children: category.label }),
|
|
6689
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text_default, { size: "sm", className: "text-text-950", children: singleItem.name })
|
|
6521
6690
|
]
|
|
6522
6691
|
},
|
|
6523
6692
|
category.key
|
|
@@ -6533,16 +6702,16 @@ var CheckboxGroup = ({
|
|
|
6533
6702
|
const allItems = formattedItems.flatMap((group) => group.itens || []);
|
|
6534
6703
|
const hasOnlyOneAvailableItem = allItems.length === 1;
|
|
6535
6704
|
if (compactSingleItem && hasOnlyOneAvailableItem && isEnabled) {
|
|
6536
|
-
return /* @__PURE__ */ (0,
|
|
6705
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { children: [
|
|
6537
6706
|
renderCompactSingleItem(category),
|
|
6538
|
-
showDivider && /* @__PURE__ */ (0,
|
|
6707
|
+
showDivider && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Divider_default, {})
|
|
6539
6708
|
] }, category.key);
|
|
6540
6709
|
}
|
|
6541
6710
|
const hasNoItems = formattedItems.every(
|
|
6542
6711
|
(group) => !group.itens || group.itens.length === 0
|
|
6543
6712
|
);
|
|
6544
|
-
return /* @__PURE__ */ (0,
|
|
6545
|
-
/* @__PURE__ */ (0,
|
|
6713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { children: [
|
|
6714
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6546
6715
|
CardAccordation,
|
|
6547
6716
|
{
|
|
6548
6717
|
value: category.key,
|
|
@@ -6552,15 +6721,15 @@ var CheckboxGroup = ({
|
|
|
6552
6721
|
openAccordion === category.key && "bg-background-50 border-none"
|
|
6553
6722
|
),
|
|
6554
6723
|
trigger: renderAccordionTrigger(category, isEnabled),
|
|
6555
|
-
children: /* @__PURE__ */ (0,
|
|
6724
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "flex flex-col gap-3 pt-2", children: hasNoItems && isEnabled ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "px-2 py-4", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text_default, { size: "sm", className: "text-text-500 text-center", children: "Sem dados" }) }) : formattedItems.map(
|
|
6556
6725
|
(formattedGroup, idx) => renderFormattedGroup(formattedGroup, idx, category.key)
|
|
6557
6726
|
) })
|
|
6558
6727
|
}
|
|
6559
6728
|
),
|
|
6560
|
-
openAccordion !== category.key && showDivider && /* @__PURE__ */ (0,
|
|
6729
|
+
openAccordion !== category.key && showDivider && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Divider_default, {})
|
|
6561
6730
|
] }, category.key);
|
|
6562
6731
|
};
|
|
6563
|
-
(0,
|
|
6732
|
+
(0, import_react22.useEffect)(() => {
|
|
6564
6733
|
if (!openAccordion) return;
|
|
6565
6734
|
const category = categories.find((c) => c.key === openAccordion);
|
|
6566
6735
|
if (!category) return;
|
|
@@ -6571,7 +6740,7 @@ var CheckboxGroup = ({
|
|
|
6571
6740
|
}, 0);
|
|
6572
6741
|
}
|
|
6573
6742
|
}, [categories, openAccordion]);
|
|
6574
|
-
return /* @__PURE__ */ (0,
|
|
6743
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6575
6744
|
AccordionGroup,
|
|
6576
6745
|
{
|
|
6577
6746
|
type: "single",
|
|
@@ -6584,7 +6753,7 @@ var CheckboxGroup = ({
|
|
|
6584
6753
|
};
|
|
6585
6754
|
|
|
6586
6755
|
// src/components/Filter/FilterModal.tsx
|
|
6587
|
-
var
|
|
6756
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
6588
6757
|
var FilterModal = ({
|
|
6589
6758
|
isOpen,
|
|
6590
6759
|
onClose,
|
|
@@ -6612,20 +6781,20 @@ var FilterModal = ({
|
|
|
6612
6781
|
const handleClear = () => {
|
|
6613
6782
|
onClear();
|
|
6614
6783
|
};
|
|
6615
|
-
return /* @__PURE__ */ (0,
|
|
6784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6616
6785
|
Modal_default,
|
|
6617
6786
|
{
|
|
6618
6787
|
isOpen,
|
|
6619
6788
|
onClose,
|
|
6620
6789
|
title,
|
|
6621
6790
|
size,
|
|
6622
|
-
footer: /* @__PURE__ */ (0,
|
|
6623
|
-
/* @__PURE__ */ (0,
|
|
6624
|
-
/* @__PURE__ */ (0,
|
|
6791
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex gap-3 justify-end w-full", children: [
|
|
6792
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Button_default, { variant: "outline", onClick: handleClear, children: clearLabel }),
|
|
6793
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Button_default, { onClick: handleApply, children: applyLabel })
|
|
6625
6794
|
] }),
|
|
6626
|
-
children: /* @__PURE__ */ (0,
|
|
6627
|
-
/* @__PURE__ */ (0,
|
|
6628
|
-
config.key === "academic" && /* @__PURE__ */ (0,
|
|
6795
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "flex flex-col gap-6", children: filterConfigs.map((config, index) => /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
6796
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-center gap-2 text-text-400 text-sm font-medium uppercase", children: [
|
|
6797
|
+
config.key === "academic" && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
6629
6798
|
"svg",
|
|
6630
6799
|
{
|
|
6631
6800
|
width: "16",
|
|
@@ -6635,7 +6804,7 @@ var FilterModal = ({
|
|
|
6635
6804
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6636
6805
|
className: "text-text-400",
|
|
6637
6806
|
children: [
|
|
6638
|
-
/* @__PURE__ */ (0,
|
|
6807
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6639
6808
|
"path",
|
|
6640
6809
|
{
|
|
6641
6810
|
d: "M8 2L2 5.33333L8 8.66667L14 5.33333L8 2Z",
|
|
@@ -6645,7 +6814,7 @@ var FilterModal = ({
|
|
|
6645
6814
|
strokeLinejoin: "round"
|
|
6646
6815
|
}
|
|
6647
6816
|
),
|
|
6648
|
-
/* @__PURE__ */ (0,
|
|
6817
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6649
6818
|
"path",
|
|
6650
6819
|
{
|
|
6651
6820
|
d: "M2 10.6667L8 14L14 10.6667",
|
|
@@ -6655,7 +6824,7 @@ var FilterModal = ({
|
|
|
6655
6824
|
strokeLinejoin: "round"
|
|
6656
6825
|
}
|
|
6657
6826
|
),
|
|
6658
|
-
/* @__PURE__ */ (0,
|
|
6827
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6659
6828
|
"path",
|
|
6660
6829
|
{
|
|
6661
6830
|
d: "M2 8L8 11.3333L14 8",
|
|
@@ -6668,7 +6837,7 @@ var FilterModal = ({
|
|
|
6668
6837
|
]
|
|
6669
6838
|
}
|
|
6670
6839
|
),
|
|
6671
|
-
config.key === "content" && /* @__PURE__ */ (0,
|
|
6840
|
+
config.key === "content" && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
6672
6841
|
"svg",
|
|
6673
6842
|
{
|
|
6674
6843
|
width: "16",
|
|
@@ -6678,7 +6847,7 @@ var FilterModal = ({
|
|
|
6678
6847
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6679
6848
|
className: "text-text-400",
|
|
6680
6849
|
children: [
|
|
6681
|
-
/* @__PURE__ */ (0,
|
|
6850
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6682
6851
|
"path",
|
|
6683
6852
|
{
|
|
6684
6853
|
d: "M3.33333 2H12.6667C13.403 2 14 2.59695 14 3.33333V12.6667C14 13.403 13.403 14 12.6667 14H3.33333C2.59695 14 2 13.403 2 12.6667V3.33333C2 2.59695 2.59695 2 3.33333 2Z",
|
|
@@ -6688,7 +6857,7 @@ var FilterModal = ({
|
|
|
6688
6857
|
strokeLinejoin: "round"
|
|
6689
6858
|
}
|
|
6690
6859
|
),
|
|
6691
|
-
/* @__PURE__ */ (0,
|
|
6860
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6692
6861
|
"path",
|
|
6693
6862
|
{
|
|
6694
6863
|
d: "M2 6H14",
|
|
@@ -6698,7 +6867,7 @@ var FilterModal = ({
|
|
|
6698
6867
|
strokeLinejoin: "round"
|
|
6699
6868
|
}
|
|
6700
6869
|
),
|
|
6701
|
-
/* @__PURE__ */ (0,
|
|
6870
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6702
6871
|
"path",
|
|
6703
6872
|
{
|
|
6704
6873
|
d: "M6 2V14",
|
|
@@ -6711,9 +6880,9 @@ var FilterModal = ({
|
|
|
6711
6880
|
]
|
|
6712
6881
|
}
|
|
6713
6882
|
),
|
|
6714
|
-
/* @__PURE__ */ (0,
|
|
6883
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: config.label })
|
|
6715
6884
|
] }),
|
|
6716
|
-
/* @__PURE__ */ (0,
|
|
6885
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6717
6886
|
CheckboxGroup,
|
|
6718
6887
|
{
|
|
6719
6888
|
categories: config.categories,
|
|
@@ -6727,7 +6896,7 @@ var FilterModal = ({
|
|
|
6727
6896
|
|
|
6728
6897
|
// src/components/TableProvider/TableProvider.tsx
|
|
6729
6898
|
var import_phosphor_react16 = require("phosphor-react");
|
|
6730
|
-
var
|
|
6899
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
6731
6900
|
function TableProvider({
|
|
6732
6901
|
data,
|
|
6733
6902
|
headers,
|
|
@@ -6751,7 +6920,7 @@ function TableProvider({
|
|
|
6751
6920
|
containerClassName,
|
|
6752
6921
|
children
|
|
6753
6922
|
}) {
|
|
6754
|
-
const [searchQuery, setSearchQuery] = (0,
|
|
6923
|
+
const [searchQuery, setSearchQuery] = (0, import_react23.useState)("");
|
|
6755
6924
|
const sortResultRaw = useTableSort(data, { syncWithUrl: true });
|
|
6756
6925
|
const sortResult = enableTableSort ? sortResultRaw : {
|
|
6757
6926
|
sortedData: data,
|
|
@@ -6762,7 +6931,7 @@ function TableProvider({
|
|
|
6762
6931
|
};
|
|
6763
6932
|
const { sortedData, sortColumn, sortDirection, handleSort } = sortResult;
|
|
6764
6933
|
const filterResultRaw = useTableFilter(initialFilters, { syncWithUrl: true });
|
|
6765
|
-
const disabledFilterResult = (0,
|
|
6934
|
+
const disabledFilterResult = (0, import_react23.useMemo)(
|
|
6766
6935
|
() => ({
|
|
6767
6936
|
filterConfigs: [],
|
|
6768
6937
|
activeFilters: {},
|
|
@@ -6792,10 +6961,10 @@ function TableProvider({
|
|
|
6792
6961
|
totalItems,
|
|
6793
6962
|
totalPages
|
|
6794
6963
|
} = paginationConfig;
|
|
6795
|
-
const [currentPage, setCurrentPage] = (0,
|
|
6796
|
-
const [itemsPerPage, setItemsPerPage] = (0,
|
|
6797
|
-
const [isFilterModalOpen, setIsFilterModalOpen] = (0,
|
|
6798
|
-
const combinedParams = (0,
|
|
6964
|
+
const [currentPage, setCurrentPage] = (0, import_react23.useState)(1);
|
|
6965
|
+
const [itemsPerPage, setItemsPerPage] = (0, import_react23.useState)(defaultItemsPerPage);
|
|
6966
|
+
const [isFilterModalOpen, setIsFilterModalOpen] = (0, import_react23.useState)(false);
|
|
6967
|
+
const combinedParams = (0, import_react23.useMemo)(() => {
|
|
6799
6968
|
const params = {
|
|
6800
6969
|
page: currentPage,
|
|
6801
6970
|
limit: itemsPerPage
|
|
@@ -6822,26 +6991,26 @@ function TableProvider({
|
|
|
6822
6991
|
enableFilters,
|
|
6823
6992
|
enableTableSort
|
|
6824
6993
|
]);
|
|
6825
|
-
(0,
|
|
6994
|
+
(0, import_react23.useEffect)(() => {
|
|
6826
6995
|
onParamsChange?.(combinedParams);
|
|
6827
6996
|
}, [combinedParams]);
|
|
6828
|
-
const handleSearchChange = (0,
|
|
6997
|
+
const handleSearchChange = (0, import_react23.useCallback)((value) => {
|
|
6829
6998
|
setSearchQuery(value);
|
|
6830
6999
|
setCurrentPage(1);
|
|
6831
7000
|
}, []);
|
|
6832
|
-
const handleFilterApply = (0,
|
|
7001
|
+
const handleFilterApply = (0, import_react23.useCallback)(() => {
|
|
6833
7002
|
applyFilters();
|
|
6834
7003
|
setIsFilterModalOpen(false);
|
|
6835
7004
|
setCurrentPage(1);
|
|
6836
7005
|
}, [applyFilters]);
|
|
6837
|
-
const handlePageChange = (0,
|
|
7006
|
+
const handlePageChange = (0, import_react23.useCallback)((page) => {
|
|
6838
7007
|
setCurrentPage(page);
|
|
6839
7008
|
}, []);
|
|
6840
|
-
const handleItemsPerPageChange = (0,
|
|
7009
|
+
const handleItemsPerPageChange = (0, import_react23.useCallback)((items) => {
|
|
6841
7010
|
setItemsPerPage(items);
|
|
6842
7011
|
setCurrentPage(1);
|
|
6843
7012
|
}, []);
|
|
6844
|
-
const handleRowClickInternal = (0,
|
|
7013
|
+
const handleRowClickInternal = (0, import_react23.useCallback)(
|
|
6845
7014
|
(row, index) => {
|
|
6846
7015
|
if (enableRowClick && onRowClick) {
|
|
6847
7016
|
onRowClick(row, index);
|
|
@@ -6849,7 +7018,7 @@ function TableProvider({
|
|
|
6849
7018
|
},
|
|
6850
7019
|
[enableRowClick, onRowClick]
|
|
6851
7020
|
);
|
|
6852
|
-
const useInternalPagination = (0,
|
|
7021
|
+
const useInternalPagination = (0, import_react23.useMemo)(
|
|
6853
7022
|
() => enablePagination && !onParamsChange && totalItems === void 0 && totalPages === void 0,
|
|
6854
7023
|
[enablePagination, onParamsChange, totalItems, totalPages]
|
|
6855
7024
|
);
|
|
@@ -6857,7 +7026,7 @@ function TableProvider({
|
|
|
6857
7026
|
(totalItems ?? (useInternalPagination ? sortedData.length : data.length)) / itemsPerPage
|
|
6858
7027
|
);
|
|
6859
7028
|
const calculatedTotalItems = totalItems ?? (useInternalPagination ? sortedData.length : data.length);
|
|
6860
|
-
const displayData = (0,
|
|
7029
|
+
const displayData = (0, import_react23.useMemo)(() => {
|
|
6861
7030
|
if (!useInternalPagination) {
|
|
6862
7031
|
return sortedData;
|
|
6863
7032
|
}
|
|
@@ -6868,21 +7037,21 @@ function TableProvider({
|
|
|
6868
7037
|
const showLoading = loading;
|
|
6869
7038
|
const showNoSearchResult = !loading && data.length === 0 && searchQuery.trim() !== "";
|
|
6870
7039
|
const showEmpty = !loading && data.length === 0 && searchQuery.trim() === "";
|
|
6871
|
-
const controls = (enableSearch || enableFilters) && /* @__PURE__ */ (0,
|
|
6872
|
-
enableFilters && /* @__PURE__ */ (0,
|
|
7040
|
+
const controls = (enableSearch || enableFilters) && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex items-center gap-4", children: [
|
|
7041
|
+
enableFilters && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
6873
7042
|
Button_default,
|
|
6874
7043
|
{
|
|
6875
7044
|
variant: "outline",
|
|
6876
7045
|
size: "medium",
|
|
6877
7046
|
onClick: () => setIsFilterModalOpen(true),
|
|
6878
7047
|
children: [
|
|
6879
|
-
/* @__PURE__ */ (0,
|
|
7048
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_phosphor_react16.Funnel, { size: 20 }),
|
|
6880
7049
|
"Filtros",
|
|
6881
|
-
hasActiveFilters && /* @__PURE__ */ (0,
|
|
7050
|
+
hasActiveFilters && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "ml-2 rounded-full bg-primary-500 px-2 py-0.5 text-xs text-white", children: Object.keys(activeFilters).length })
|
|
6882
7051
|
]
|
|
6883
7052
|
}
|
|
6884
7053
|
),
|
|
6885
|
-
enableSearch && /* @__PURE__ */ (0,
|
|
7054
|
+
enableSearch && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6886
7055
|
Search_default,
|
|
6887
7056
|
{
|
|
6888
7057
|
value: searchQuery,
|
|
@@ -6893,11 +7062,11 @@ function TableProvider({
|
|
|
6893
7062
|
}
|
|
6894
7063
|
) })
|
|
6895
7064
|
] });
|
|
6896
|
-
const headerSection = (headerContent || controls) && /* @__PURE__ */ (0,
|
|
6897
|
-
headerContent && /* @__PURE__ */ (0,
|
|
6898
|
-
controls && /* @__PURE__ */ (0,
|
|
7065
|
+
const headerSection = (headerContent || controls) && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex flex-col md:flex-row items-stretch md:items-center justify-between gap-4", children: [
|
|
7066
|
+
headerContent && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { children: headerContent }),
|
|
7067
|
+
controls && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "flex-1 md:flex-none", children: controls })
|
|
6899
7068
|
] });
|
|
6900
|
-
const table = /* @__PURE__ */ (0,
|
|
7069
|
+
const table = /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "w-full overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
6901
7070
|
Table_default,
|
|
6902
7071
|
{
|
|
6903
7072
|
variant,
|
|
@@ -6908,11 +7077,11 @@ function TableProvider({
|
|
|
6908
7077
|
showEmpty,
|
|
6909
7078
|
emptyState,
|
|
6910
7079
|
children: [
|
|
6911
|
-
/* @__PURE__ */ (0,
|
|
7080
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6912
7081
|
TableRow,
|
|
6913
7082
|
{
|
|
6914
7083
|
variant: variant === "borderless" ? "defaultBorderless" : "default",
|
|
6915
|
-
children: headers.map((header, index) => /* @__PURE__ */ (0,
|
|
7084
|
+
children: headers.map((header, index) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6916
7085
|
TableHead,
|
|
6917
7086
|
{
|
|
6918
7087
|
sortable: enableTableSort && header.sortable,
|
|
@@ -6926,7 +7095,7 @@ function TableProvider({
|
|
|
6926
7095
|
))
|
|
6927
7096
|
}
|
|
6928
7097
|
) }),
|
|
6929
|
-
/* @__PURE__ */ (0,
|
|
7098
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TableBody, { children: loading ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TableCell, { colSpan: headers.length, className: "text-center py-8", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-text-400 text-sm", children: "Carregando..." }) }) }) : displayData.map((row, rowIndex) => {
|
|
6930
7099
|
const effectiveIndex = useInternalPagination ? (currentPage - 1) * itemsPerPage + rowIndex : rowIndex;
|
|
6931
7100
|
const rowKeyValue = rowKey ? (() => {
|
|
6932
7101
|
const keyValue = row[rowKey];
|
|
@@ -6938,7 +7107,7 @@ function TableProvider({
|
|
|
6938
7107
|
}
|
|
6939
7108
|
return String(keyValue);
|
|
6940
7109
|
})() : `row-${effectiveIndex}`;
|
|
6941
|
-
return /* @__PURE__ */ (0,
|
|
7110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6942
7111
|
TableRow,
|
|
6943
7112
|
{
|
|
6944
7113
|
variant: variant === "borderless" ? "defaultBorderless" : "default",
|
|
@@ -6959,7 +7128,7 @@ function TableProvider({
|
|
|
6959
7128
|
}
|
|
6960
7129
|
}
|
|
6961
7130
|
const content = header.render ? header.render(value, row, effectiveIndex) : defaultContent;
|
|
6962
|
-
return /* @__PURE__ */ (0,
|
|
7131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6963
7132
|
TableCell,
|
|
6964
7133
|
{
|
|
6965
7134
|
className: header.className,
|
|
@@ -6978,7 +7147,7 @@ function TableProvider({
|
|
|
6978
7147
|
]
|
|
6979
7148
|
}
|
|
6980
7149
|
) });
|
|
6981
|
-
const pagination = enablePagination && !isEmpty && /* @__PURE__ */ (0,
|
|
7150
|
+
const pagination = enablePagination && !isEmpty && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6982
7151
|
TablePagination_default,
|
|
6983
7152
|
{
|
|
6984
7153
|
currentPage,
|
|
@@ -6992,13 +7161,13 @@ function TableProvider({
|
|
|
6992
7161
|
}
|
|
6993
7162
|
) });
|
|
6994
7163
|
if (children) {
|
|
6995
|
-
return /* @__PURE__ */ (0,
|
|
7164
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
6996
7165
|
children({
|
|
6997
7166
|
controls: headerSection || controls || null,
|
|
6998
7167
|
table,
|
|
6999
7168
|
pagination
|
|
7000
7169
|
}),
|
|
7001
|
-
enableFilters && /* @__PURE__ */ (0,
|
|
7170
|
+
enableFilters && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
7002
7171
|
FilterModal,
|
|
7003
7172
|
{
|
|
7004
7173
|
isOpen: isFilterModalOpen,
|
|
@@ -7012,11 +7181,11 @@ function TableProvider({
|
|
|
7012
7181
|
] });
|
|
7013
7182
|
}
|
|
7014
7183
|
const wrapperClassName = containerClassName || "w-full space-y-4";
|
|
7015
|
-
return /* @__PURE__ */ (0,
|
|
7184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: wrapperClassName, children: [
|
|
7016
7185
|
headerSection,
|
|
7017
7186
|
table,
|
|
7018
7187
|
pagination,
|
|
7019
|
-
enableFilters && /* @__PURE__ */ (0,
|
|
7188
|
+
enableFilters && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
7020
7189
|
FilterModal,
|
|
7021
7190
|
{
|
|
7022
7191
|
isOpen: isFilterModalOpen,
|
|
@@ -7031,7 +7200,7 @@ function TableProvider({
|
|
|
7031
7200
|
}
|
|
7032
7201
|
|
|
7033
7202
|
// src/components/RecommendedLessonsHistory/config/modelsFiltersConfig.ts
|
|
7034
|
-
var
|
|
7203
|
+
var getSubjectOptions2 = (data) => {
|
|
7035
7204
|
if (!data?.subjects) return [];
|
|
7036
7205
|
return data.subjects.map((subject) => ({
|
|
7037
7206
|
id: subject.id,
|
|
@@ -7047,29 +7216,14 @@ var createGoalModelsFiltersConfig = (userData) => [
|
|
|
7047
7216
|
key: "subject",
|
|
7048
7217
|
label: "Mat\xE9ria",
|
|
7049
7218
|
selectedIds: [],
|
|
7050
|
-
itens:
|
|
7219
|
+
itens: getSubjectOptions2(userData)
|
|
7051
7220
|
}
|
|
7052
7221
|
]
|
|
7053
7222
|
}
|
|
7054
7223
|
];
|
|
7055
7224
|
|
|
7056
|
-
// src/components/RecommendedLessonsHistory/utils/filterBuilders.ts
|
|
7057
|
-
var buildGoalModelsFiltersFromParams = (params) => {
|
|
7058
|
-
const filters = {
|
|
7059
|
-
page: params.page,
|
|
7060
|
-
limit: params.limit
|
|
7061
|
-
};
|
|
7062
|
-
if (params.search) {
|
|
7063
|
-
filters.search = params.search;
|
|
7064
|
-
}
|
|
7065
|
-
if (Array.isArray(params.subject) && params.subject.length > 0) {
|
|
7066
|
-
filters.subjectId = params.subject[0];
|
|
7067
|
-
}
|
|
7068
|
-
return filters;
|
|
7069
|
-
};
|
|
7070
|
-
|
|
7071
7225
|
// src/components/RecommendedLessonsHistory/tabs/ModelsTab.tsx
|
|
7072
|
-
var
|
|
7226
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
7073
7227
|
var GOAL_MODELS_CONFIG = {
|
|
7074
7228
|
entityName: "aula",
|
|
7075
7229
|
entityNamePlural: "aulas",
|
|
@@ -7095,7 +7249,7 @@ var GoalModelsTab = ({
|
|
|
7095
7249
|
mapSubjectNameToEnum,
|
|
7096
7250
|
userFilterData,
|
|
7097
7251
|
subjectsMap
|
|
7098
|
-
}) => /* @__PURE__ */ (0,
|
|
7252
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
7099
7253
|
ModelsTabBase,
|
|
7100
7254
|
{
|
|
7101
7255
|
fetchModels: fetchGoalModels,
|
|
@@ -7123,7 +7277,7 @@ var GoalModelsTab = ({
|
|
|
7123
7277
|
);
|
|
7124
7278
|
|
|
7125
7279
|
// src/components/RecommendedLessonsHistory/RecommendedLessonsHistory.tsx
|
|
7126
|
-
var
|
|
7280
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
7127
7281
|
var GoalPageTab = /* @__PURE__ */ ((GoalPageTab2) => {
|
|
7128
7282
|
GoalPageTab2["HISTORY"] = "history";
|
|
7129
7283
|
GoalPageTab2["DRAFTS"] = "drafts";
|
|
@@ -7169,7 +7323,7 @@ var getSchoolOptions = (data) => {
|
|
|
7169
7323
|
name: school.name
|
|
7170
7324
|
}));
|
|
7171
7325
|
};
|
|
7172
|
-
var
|
|
7326
|
+
var getSubjectOptions3 = (data) => {
|
|
7173
7327
|
if (!data?.subjects) return [];
|
|
7174
7328
|
return data.subjects.map((subject) => ({
|
|
7175
7329
|
id: subject.id,
|
|
@@ -7235,7 +7389,7 @@ var createGoalFiltersConfig = (userData) => [
|
|
|
7235
7389
|
key: "subject",
|
|
7236
7390
|
label: "Mat\xE9ria",
|
|
7237
7391
|
selectedIds: [],
|
|
7238
|
-
itens:
|
|
7392
|
+
itens: getSubjectOptions3(userData)
|
|
7239
7393
|
},
|
|
7240
7394
|
{
|
|
7241
7395
|
key: "theme",
|
|
@@ -7288,7 +7442,7 @@ var createTableColumns = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
|
|
|
7288
7442
|
className: "max-w-[200px] truncate",
|
|
7289
7443
|
render: (value) => {
|
|
7290
7444
|
const title = typeof value === "string" ? value : "";
|
|
7291
|
-
return /* @__PURE__ */ (0,
|
|
7445
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Text_default, { size: "sm", title, children: title });
|
|
7292
7446
|
}
|
|
7293
7447
|
},
|
|
7294
7448
|
{
|
|
@@ -7298,7 +7452,7 @@ var createTableColumns = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
|
|
|
7298
7452
|
className: "max-w-[150px] truncate",
|
|
7299
7453
|
render: (value) => {
|
|
7300
7454
|
const school = typeof value === "string" ? value : "";
|
|
7301
|
-
return /* @__PURE__ */ (0,
|
|
7455
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Text_default, { size: "sm", title: school, children: school });
|
|
7302
7456
|
}
|
|
7303
7457
|
},
|
|
7304
7458
|
{
|
|
@@ -7315,11 +7469,11 @@ var createTableColumns = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
|
|
|
7315
7469
|
const subjectName = typeof value === "string" ? value : "";
|
|
7316
7470
|
const subjectEnum = mapSubjectNameToEnum?.(subjectName);
|
|
7317
7471
|
if (!subjectEnum) {
|
|
7318
|
-
return /* @__PURE__ */ (0,
|
|
7472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Text_default, { size: "sm", className: "truncate", title: subjectName, children: subjectName });
|
|
7319
7473
|
}
|
|
7320
7474
|
const subjectInfo = getSubjectInfo(subjectEnum);
|
|
7321
|
-
return /* @__PURE__ */ (0,
|
|
7322
|
-
/* @__PURE__ */ (0,
|
|
7475
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex items-center gap-2", title: subjectName, children: [
|
|
7476
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7323
7477
|
"span",
|
|
7324
7478
|
{
|
|
7325
7479
|
className: cn(
|
|
@@ -7329,7 +7483,7 @@ var createTableColumns = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
|
|
|
7329
7483
|
children: subjectInfo.icon
|
|
7330
7484
|
}
|
|
7331
7485
|
),
|
|
7332
|
-
/* @__PURE__ */ (0,
|
|
7486
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Text_default, { size: "sm", className: "truncate", children: subjectName })
|
|
7333
7487
|
] });
|
|
7334
7488
|
}
|
|
7335
7489
|
},
|
|
@@ -7345,9 +7499,9 @@ var createTableColumns = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
|
|
|
7345
7499
|
render: (value) => {
|
|
7346
7500
|
const status = typeof value === "string" ? value : "";
|
|
7347
7501
|
if (!status) {
|
|
7348
|
-
return /* @__PURE__ */ (0,
|
|
7502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Text_default, { size: "sm", color: "text-text-500", children: "-" });
|
|
7349
7503
|
}
|
|
7350
|
-
return /* @__PURE__ */ (0,
|
|
7504
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7351
7505
|
Badge_default,
|
|
7352
7506
|
{
|
|
7353
7507
|
variant: "solid",
|
|
@@ -7362,7 +7516,7 @@ var createTableColumns = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
|
|
|
7362
7516
|
key: "completionPercentage",
|
|
7363
7517
|
label: "Conclus\xE3o",
|
|
7364
7518
|
sortable: true,
|
|
7365
|
-
render: (value) => /* @__PURE__ */ (0,
|
|
7519
|
+
render: (value) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7366
7520
|
ProgressBar_default,
|
|
7367
7521
|
{
|
|
7368
7522
|
value: Number(value),
|
|
@@ -7388,20 +7542,20 @@ var createTableColumns = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
|
|
|
7388
7542
|
e.stopPropagation();
|
|
7389
7543
|
onEditGoal?.(row.id);
|
|
7390
7544
|
};
|
|
7391
|
-
return /* @__PURE__ */ (0,
|
|
7392
|
-
/* @__PURE__ */ (0,
|
|
7545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex justify-center gap-2", children: [
|
|
7546
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7393
7547
|
IconButton_default,
|
|
7394
7548
|
{
|
|
7395
|
-
icon: /* @__PURE__ */ (0,
|
|
7549
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_phosphor_react17.Trash, { size: 20 }),
|
|
7396
7550
|
size: "sm",
|
|
7397
7551
|
title: "Excluir",
|
|
7398
7552
|
onClick: handleDelete
|
|
7399
7553
|
}
|
|
7400
7554
|
),
|
|
7401
|
-
/* @__PURE__ */ (0,
|
|
7555
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7402
7556
|
IconButton_default,
|
|
7403
7557
|
{
|
|
7404
|
-
icon: /* @__PURE__ */ (0,
|
|
7558
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_phosphor_react17.PencilSimple, { size: 20 }),
|
|
7405
7559
|
size: "sm",
|
|
7406
7560
|
title: "Editar",
|
|
7407
7561
|
onClick: handleEdit
|
|
@@ -7415,7 +7569,7 @@ var createTableColumns = (mapSubjectNameToEnum, onDeleteGoal, onEditGoal) => [
|
|
|
7415
7569
|
label: "",
|
|
7416
7570
|
sortable: false,
|
|
7417
7571
|
className: "w-12",
|
|
7418
|
-
render: () => /* @__PURE__ */ (0,
|
|
7572
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_phosphor_react17.CaretRight, { size: 20, className: "text-text-600" }) })
|
|
7419
7573
|
}
|
|
7420
7574
|
];
|
|
7421
7575
|
var RecommendedLessonsHistory = ({
|
|
@@ -7437,18 +7591,22 @@ var RecommendedLessonsHistory = ({
|
|
|
7437
7591
|
onSendLesson,
|
|
7438
7592
|
onEditModel,
|
|
7439
7593
|
subjectsMap,
|
|
7594
|
+
fetchGoalDrafts,
|
|
7595
|
+
deleteGoalDraft,
|
|
7596
|
+
onSendDraft,
|
|
7597
|
+
onEditDraft,
|
|
7440
7598
|
defaultTab,
|
|
7441
7599
|
onTabChange
|
|
7442
7600
|
}) => {
|
|
7443
|
-
const [activeTab, setActiveTab] = (0,
|
|
7601
|
+
const [activeTab, setActiveTab] = (0, import_react24.useState)(
|
|
7444
7602
|
defaultTab ?? "history" /* HISTORY */
|
|
7445
7603
|
);
|
|
7446
|
-
(0,
|
|
7604
|
+
(0, import_react24.useEffect)(() => {
|
|
7447
7605
|
if (defaultTab !== void 0) {
|
|
7448
7606
|
setActiveTab(defaultTab);
|
|
7449
7607
|
}
|
|
7450
7608
|
}, [defaultTab]);
|
|
7451
|
-
const handleTabChange = (0,
|
|
7609
|
+
const handleTabChange = (0, import_react24.useCallback)(
|
|
7452
7610
|
(value) => {
|
|
7453
7611
|
const newTab = value;
|
|
7454
7612
|
setActiveTab(newTab);
|
|
@@ -7456,9 +7614,9 @@ var RecommendedLessonsHistory = ({
|
|
|
7456
7614
|
},
|
|
7457
7615
|
[onTabChange]
|
|
7458
7616
|
);
|
|
7459
|
-
const fetchGoalsHistoryRef = (0,
|
|
7617
|
+
const fetchGoalsHistoryRef = (0, import_react24.useRef)(fetchGoalsHistory);
|
|
7460
7618
|
fetchGoalsHistoryRef.current = fetchGoalsHistory;
|
|
7461
|
-
const useGoalsHistory = (0,
|
|
7619
|
+
const useGoalsHistory = (0, import_react24.useMemo)(
|
|
7462
7620
|
() => createUseRecommendedLessonsHistory(
|
|
7463
7621
|
(filters) => fetchGoalsHistoryRef.current(filters)
|
|
7464
7622
|
),
|
|
@@ -7471,31 +7629,31 @@ var RecommendedLessonsHistory = ({
|
|
|
7471
7629
|
pagination,
|
|
7472
7630
|
fetchGoals
|
|
7473
7631
|
} = useGoalsHistory();
|
|
7474
|
-
const initialFilterConfigs = (0,
|
|
7632
|
+
const initialFilterConfigs = (0, import_react24.useMemo)(
|
|
7475
7633
|
() => createGoalFiltersConfig(userFilterData),
|
|
7476
7634
|
[userFilterData]
|
|
7477
7635
|
);
|
|
7478
|
-
const tableColumns = (0,
|
|
7636
|
+
const tableColumns = (0, import_react24.useMemo)(
|
|
7479
7637
|
() => createTableColumns(mapSubjectNameToEnum, onDeleteGoal, onEditGoal),
|
|
7480
7638
|
[mapSubjectNameToEnum, onDeleteGoal, onEditGoal]
|
|
7481
7639
|
);
|
|
7482
|
-
const handleParamsChange = (0,
|
|
7640
|
+
const handleParamsChange = (0, import_react24.useCallback)(
|
|
7483
7641
|
(params) => {
|
|
7484
7642
|
const filters = buildFiltersFromParams(params);
|
|
7485
7643
|
fetchGoals(filters);
|
|
7486
7644
|
},
|
|
7487
7645
|
[fetchGoals]
|
|
7488
7646
|
);
|
|
7489
|
-
return /* @__PURE__ */ (0,
|
|
7647
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
7490
7648
|
"div",
|
|
7491
7649
|
{
|
|
7492
7650
|
"data-testid": "recommended-lessons-history",
|
|
7493
7651
|
className: "flex flex-col w-full h-auto relative justify-center items-center mb-5 overflow-hidden",
|
|
7494
7652
|
children: [
|
|
7495
|
-
/* @__PURE__ */ (0,
|
|
7496
|
-
/* @__PURE__ */ (0,
|
|
7497
|
-
/* @__PURE__ */ (0,
|
|
7498
|
-
/* @__PURE__ */ (0,
|
|
7653
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "absolute top-0 left-0 h-[150px] w-full z-0" }),
|
|
7654
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex flex-col w-full h-full max-w-[1350px] mx-auto z-10 lg:px-0 px-4 pt-4 sm:pt-0", children: [
|
|
7655
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex flex-col sm:flex-row w-full mb-6 items-start sm:items-center sm:justify-between gap-0 sm:gap-4", children: [
|
|
7656
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7499
7657
|
Text_default,
|
|
7500
7658
|
{
|
|
7501
7659
|
as: "h1",
|
|
@@ -7504,7 +7662,7 @@ var RecommendedLessonsHistory = ({
|
|
|
7504
7662
|
children: title
|
|
7505
7663
|
}
|
|
7506
7664
|
),
|
|
7507
|
-
/* @__PURE__ */ (0,
|
|
7665
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "flex-shrink-0 lg:w-auto self-center sm:self-auto", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7508
7666
|
Menu,
|
|
7509
7667
|
{
|
|
7510
7668
|
defaultValue: "history" /* HISTORY */,
|
|
@@ -7512,13 +7670,13 @@ var RecommendedLessonsHistory = ({
|
|
|
7512
7670
|
onValueChange: handleTabChange,
|
|
7513
7671
|
variant: "menu2",
|
|
7514
7672
|
className: "bg-transparent shadow-none px-0",
|
|
7515
|
-
children: /* @__PURE__ */ (0,
|
|
7673
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
7516
7674
|
MenuContent,
|
|
7517
7675
|
{
|
|
7518
7676
|
variant: "menu2",
|
|
7519
7677
|
className: "w-full lg:w-auto max-w-full min-w-0",
|
|
7520
7678
|
children: [
|
|
7521
|
-
/* @__PURE__ */ (0,
|
|
7679
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7522
7680
|
MenuItem,
|
|
7523
7681
|
{
|
|
7524
7682
|
variant: "menu2",
|
|
@@ -7528,7 +7686,7 @@ var RecommendedLessonsHistory = ({
|
|
|
7528
7686
|
children: "Hist\xF3rico"
|
|
7529
7687
|
}
|
|
7530
7688
|
),
|
|
7531
|
-
/* @__PURE__ */ (0,
|
|
7689
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7532
7690
|
MenuItem,
|
|
7533
7691
|
{
|
|
7534
7692
|
variant: "menu2",
|
|
@@ -7538,7 +7696,7 @@ var RecommendedLessonsHistory = ({
|
|
|
7538
7696
|
children: "Rascunhos"
|
|
7539
7697
|
}
|
|
7540
7698
|
),
|
|
7541
|
-
/* @__PURE__ */ (0,
|
|
7699
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7542
7700
|
MenuItem,
|
|
7543
7701
|
{
|
|
7544
7702
|
variant: "menu2",
|
|
@@ -7554,8 +7712,8 @@ var RecommendedLessonsHistory = ({
|
|
|
7554
7712
|
}
|
|
7555
7713
|
) })
|
|
7556
7714
|
] }),
|
|
7557
|
-
/* @__PURE__ */ (0,
|
|
7558
|
-
activeTab === "history" /* HISTORY */ && /* @__PURE__ */ (0,
|
|
7715
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex flex-col items-center w-full min-h-0 flex-1", children: [
|
|
7716
|
+
activeTab === "history" /* HISTORY */ && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_jsx_runtime42.Fragment, { children: error ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "flex items-center justify-center bg-background rounded-xl w-full min-h-[705px]", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Text_default, { size: "lg", color: "text-error-500", children: error }) }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7559
7717
|
TableProvider,
|
|
7560
7718
|
{
|
|
7561
7719
|
data: goals,
|
|
@@ -7580,14 +7738,14 @@ var RecommendedLessonsHistory = ({
|
|
|
7580
7738
|
image: noSearchImage
|
|
7581
7739
|
},
|
|
7582
7740
|
emptyState: {
|
|
7583
|
-
component: /* @__PURE__ */ (0,
|
|
7741
|
+
component: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7584
7742
|
EmptyState_default,
|
|
7585
7743
|
{
|
|
7586
7744
|
image: emptyStateImage,
|
|
7587
7745
|
title: "Crie uma nova aula",
|
|
7588
7746
|
description: "Selecione um conjunto de aulas organizadas por tema e ajude seus alunos a estudarem de forma estruturada e eficiente!",
|
|
7589
7747
|
buttonText: createButtonText,
|
|
7590
|
-
buttonIcon: /* @__PURE__ */ (0,
|
|
7748
|
+
buttonIcon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_phosphor_react17.Plus, { size: 18 }),
|
|
7591
7749
|
buttonVariant: "outline",
|
|
7592
7750
|
buttonAction: "primary",
|
|
7593
7751
|
onButtonClick: onCreateLesson
|
|
@@ -7602,22 +7760,22 @@ var RecommendedLessonsHistory = ({
|
|
|
7602
7760
|
table,
|
|
7603
7761
|
pagination: paginationComponent
|
|
7604
7762
|
} = renderProps;
|
|
7605
|
-
return /* @__PURE__ */ (0,
|
|
7606
|
-
/* @__PURE__ */ (0,
|
|
7607
|
-
/* @__PURE__ */ (0,
|
|
7763
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "space-y-4", children: [
|
|
7764
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
7765
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7608
7766
|
Button_default,
|
|
7609
7767
|
{
|
|
7610
7768
|
variant: "solid",
|
|
7611
7769
|
action: "primary",
|
|
7612
7770
|
size: "medium",
|
|
7613
7771
|
onClick: onCreateLesson,
|
|
7614
|
-
iconLeft: /* @__PURE__ */ (0,
|
|
7772
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_phosphor_react17.Plus, { size: 18, weight: "bold" }),
|
|
7615
7773
|
children: createButtonText
|
|
7616
7774
|
}
|
|
7617
7775
|
),
|
|
7618
7776
|
controls
|
|
7619
7777
|
] }),
|
|
7620
|
-
/* @__PURE__ */ (0,
|
|
7778
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "bg-background rounded-xl p-6 space-y-4", children: [
|
|
7621
7779
|
table,
|
|
7622
7780
|
paginationComponent
|
|
7623
7781
|
] })
|
|
@@ -7625,8 +7783,22 @@ var RecommendedLessonsHistory = ({
|
|
|
7625
7783
|
}
|
|
7626
7784
|
}
|
|
7627
7785
|
) }) }),
|
|
7628
|
-
activeTab === "drafts" /* DRAFTS */ &&
|
|
7629
|
-
|
|
7786
|
+
activeTab === "drafts" /* DRAFTS */ && fetchGoalDrafts && deleteGoalDraft && onCreateLesson && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7787
|
+
GoalDraftsTab,
|
|
7788
|
+
{
|
|
7789
|
+
fetchGoalDrafts,
|
|
7790
|
+
deleteGoalDraft,
|
|
7791
|
+
onCreateDraft: onCreateLesson,
|
|
7792
|
+
onSendDraft,
|
|
7793
|
+
onEditDraft,
|
|
7794
|
+
emptyStateImage,
|
|
7795
|
+
noSearchImage,
|
|
7796
|
+
mapSubjectNameToEnum,
|
|
7797
|
+
userFilterData,
|
|
7798
|
+
subjectsMap
|
|
7799
|
+
}
|
|
7800
|
+
),
|
|
7801
|
+
activeTab === "models" /* MODELS */ && fetchGoalModels && deleteGoalModel && onCreateModel && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7630
7802
|
GoalModelsTab,
|
|
7631
7803
|
{
|
|
7632
7804
|
fetchGoalModels,
|