catchup-library-web 1.2.14 → 1.2.16

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/index.d.mts CHANGED
@@ -470,6 +470,7 @@ declare const retrieveCategoryVersionCodeOptionList: () => {
470
470
  declare const filterCategoryVersionCodeOptionList: (categoryVersionCodeOptionList: any, coterieType: string, level: any) => any;
471
471
  declare const filterCategoryVersionCodeOptionListByGradeDTO: (categoryVersionCodeOptionList: any, coterieType: string, gradeDTO: any) => any;
472
472
  declare const filterCategoryVersionCodeOptionListByInstitutionDTO: (categoryVersionCodeOptionList: any, coterieType: string, institutionDTO: any) => any;
473
+ declare const constructCategoryTreeFromParentCode: (categorySet: any[]) => any;
473
474
 
474
475
  declare const ONE_HOUR = 3600000;
475
476
  declare const ONE_DAY = 86400000;
@@ -687,4 +688,4 @@ declare const retrieveTokenUsageSubTypeOptionList: () => {
687
688
  value: string;
688
689
  }[];
689
690
 
690
- export { ActivityBodyContent, ActivityPreviewByData, ActivitySolutionContent, ActivityTemplateLabel, ApproveButton, BaseImage, BaseLoading, BaseLoadingWithText, BaseModal, BaseTitle, BlueVerticalDividerLine, BrandLabel, CancelButton, CoterieLabel, CreateButton, DeleteButton, DividerLine, DropdownActivityContent, FillInTheBlanksActivityContent, GradeLabel, GroupingActivityContent, InfoWithText, InputGroup, InputWithSpecialExpression, LeftTextRightInputGroup, MCMAActivityContent, MCSAActivityContent, MatchingActivityContent, ONE_DAY, ONE_HOUR, ONE_MONTH, ONE_WEEK, OpenEndedActivityContent, OrderingActivityContent, OutcomeLabel, PersonalLabel, PrimaryButton, PublishingHouseLabel, SecondaryButton, SelectionBox, SelectionCheckbox, SelectionTab, SelectionTabFill, SubTitle, THREE_MONTHS, TrueFalseActivityContent, VerticalDividerLine, base64ToFile, calculateLevenshteinDistance, checkActivityAnswerState, checkIfAnswerIsEmpty, constructActivityAnswerMap, constructActivityAnswerStateList, constructActivityData, constructActivityItemListBodyOnly, constructActivityItemListMaterialOnly, constructActivityItemListSolutionOnly, constructActivityItemListWithAnswersForAI, constructActivityItemListWithSolutionForAI, constructAnswerBasedOnData, constructBaseNumericIndividualModel, constructBaseVerbalIndvidualModel, constructInputWithSpecialExpressionList, constructUserProfileQueryParams, constructWeekName, convertDataURLtoFile, convertToBase64, convertToBodyMapString, convertToEvaluationRubricMapString, convertToSolutionMapString, convertTurkishCharactersToEnglish, filterCategoryVersionCodeOptionList, filterCategoryVersionCodeOptionListByGradeDTO, filterCategoryVersionCodeOptionListByInstitutionDTO, filterCoterieTypeOptionList, filterGradeLevelOptionList, filterUserRoleOptionList, findAISettingsFromCurrentProfile, findBestFitActivity, getColorByIndex, ignoreMathematicalExpression, mergeObjects, parseBodyMapFromData, parseContentMapFromData, parseJwt, parseMaterialMapFromData, retrieveActivityAnswerFromAnswerList, retrieveActivityTemplateDTOOptionList, retrieveAllEarnedBadgeDTOListByCoterieType, retrieveAllEarnedBadgeDTOListByCoterieTypeList, retrieveAnnouncementAudienceOptionList, retrieveAnnouncementTypeOptionList, retrieveBadgeRuleListByParams, retrieveBadgeRuleTextByParams, retrieveBranchDTOByUserProfileOptionList, retrieveBranchDTOOptionList, retrieveBrandDTOByUserProfileOptionList, retrieveBrandDTOOptionList, retrieveCampusDTOByUserProfileOptionList, retrieveCampusDTOOptionList, retrieveCategoryVersionCodeOptionList, retrieveClockTimeLeft, retrieveColorByScore, retrieveContentTypeOptionList, retrieveContestTypeOptionList, retrieveCoterieTypeFromStandardExamCoterieType, retrieveCoterieTypeOptionList, retrieveCountryCodeOptionList, retrieveCountryNameOptionList, retrieveCurrentDefaultDataMap, retrieveDateIntervalOptionList, retrieveDefaultUserRoleOptionList, retrieveDistintCoterieTypeFromCatchtivityApplicationDTO, retrieveDocumentTypeFromAcceptedFormat, retrieveDocumentTypeFromExtension, retrieveDurationInMinutesOptionList, retrieveDurationInSecondsOptionList, retrieveDurationTypeOptionList, retrieveEachTimeSpentInSeconds, retrieveEnableOptionList, retrieveExternalRegistrationDTOOptionList, retrieveFrequencyTypeOptionList, retrieveGenderOptionList, retrieveGradeDTOByUserProfileOptionList, retrieveGradeDTOOptionList, retrieveGradeLevelOptionList, retrieveInstitutionDTOByUserProfileOptionList, retrieveInstitutionDTOOptionList, retrieveInstitutionTypeOptionList, retrieveMonthNameByIndex, retrieveOtherBadgeDTOList, retrievePhoneNumberAreaCodeList, retrieveProvinceNameOptionList, retrieveReportTypeOptionList, retrieveSeasonDTOByUserProfileOptionList, retrieveSeasonDTOOptionList, retrieveStandardExamCoterieTypeOptionListByStandardExamType, retrieveStandardExamTypeIcon, retrieveStandardExamTypeOptionList, retrieveStatusOptionList, retrieveTaxonomyGroupName, retrieveTaxonomyName, retrieveTaxonomyType, retrieveTokenUsageSubTypeOptionList, retrieveTokenUsageTypeOptionList, retrieveTotalTimeSpentInMinutes, retrieveTotalTimeSpentInSeconds, retrieveUserAuthorityGeneralOptionList, retrieveUserRoleOptionList, retrieveValidationRequirementList, shuffleArray, useScreenSize };
691
+ export { ActivityBodyContent, ActivityPreviewByData, ActivitySolutionContent, ActivityTemplateLabel, ApproveButton, BaseImage, BaseLoading, BaseLoadingWithText, BaseModal, BaseTitle, BlueVerticalDividerLine, BrandLabel, CancelButton, CoterieLabel, CreateButton, DeleteButton, DividerLine, DropdownActivityContent, FillInTheBlanksActivityContent, GradeLabel, GroupingActivityContent, InfoWithText, InputGroup, InputWithSpecialExpression, LeftTextRightInputGroup, MCMAActivityContent, MCSAActivityContent, MatchingActivityContent, ONE_DAY, ONE_HOUR, ONE_MONTH, ONE_WEEK, OpenEndedActivityContent, OrderingActivityContent, OutcomeLabel, PersonalLabel, PrimaryButton, PublishingHouseLabel, SecondaryButton, SelectionBox, SelectionCheckbox, SelectionTab, SelectionTabFill, SubTitle, THREE_MONTHS, TrueFalseActivityContent, VerticalDividerLine, base64ToFile, calculateLevenshteinDistance, checkActivityAnswerState, checkIfAnswerIsEmpty, constructActivityAnswerMap, constructActivityAnswerStateList, constructActivityData, constructActivityItemListBodyOnly, constructActivityItemListMaterialOnly, constructActivityItemListSolutionOnly, constructActivityItemListWithAnswersForAI, constructActivityItemListWithSolutionForAI, constructAnswerBasedOnData, constructBaseNumericIndividualModel, constructBaseVerbalIndvidualModel, constructCategoryTreeFromParentCode, constructInputWithSpecialExpressionList, constructUserProfileQueryParams, constructWeekName, convertDataURLtoFile, convertToBase64, convertToBodyMapString, convertToEvaluationRubricMapString, convertToSolutionMapString, convertTurkishCharactersToEnglish, filterCategoryVersionCodeOptionList, filterCategoryVersionCodeOptionListByGradeDTO, filterCategoryVersionCodeOptionListByInstitutionDTO, filterCoterieTypeOptionList, filterGradeLevelOptionList, filterUserRoleOptionList, findAISettingsFromCurrentProfile, findBestFitActivity, getColorByIndex, ignoreMathematicalExpression, mergeObjects, parseBodyMapFromData, parseContentMapFromData, parseJwt, parseMaterialMapFromData, retrieveActivityAnswerFromAnswerList, retrieveActivityTemplateDTOOptionList, retrieveAllEarnedBadgeDTOListByCoterieType, retrieveAllEarnedBadgeDTOListByCoterieTypeList, retrieveAnnouncementAudienceOptionList, retrieveAnnouncementTypeOptionList, retrieveBadgeRuleListByParams, retrieveBadgeRuleTextByParams, retrieveBranchDTOByUserProfileOptionList, retrieveBranchDTOOptionList, retrieveBrandDTOByUserProfileOptionList, retrieveBrandDTOOptionList, retrieveCampusDTOByUserProfileOptionList, retrieveCampusDTOOptionList, retrieveCategoryVersionCodeOptionList, retrieveClockTimeLeft, retrieveColorByScore, retrieveContentTypeOptionList, retrieveContestTypeOptionList, retrieveCoterieTypeFromStandardExamCoterieType, retrieveCoterieTypeOptionList, retrieveCountryCodeOptionList, retrieveCountryNameOptionList, retrieveCurrentDefaultDataMap, retrieveDateIntervalOptionList, retrieveDefaultUserRoleOptionList, retrieveDistintCoterieTypeFromCatchtivityApplicationDTO, retrieveDocumentTypeFromAcceptedFormat, retrieveDocumentTypeFromExtension, retrieveDurationInMinutesOptionList, retrieveDurationInSecondsOptionList, retrieveDurationTypeOptionList, retrieveEachTimeSpentInSeconds, retrieveEnableOptionList, retrieveExternalRegistrationDTOOptionList, retrieveFrequencyTypeOptionList, retrieveGenderOptionList, retrieveGradeDTOByUserProfileOptionList, retrieveGradeDTOOptionList, retrieveGradeLevelOptionList, retrieveInstitutionDTOByUserProfileOptionList, retrieveInstitutionDTOOptionList, retrieveInstitutionTypeOptionList, retrieveMonthNameByIndex, retrieveOtherBadgeDTOList, retrievePhoneNumberAreaCodeList, retrieveProvinceNameOptionList, retrieveReportTypeOptionList, retrieveSeasonDTOByUserProfileOptionList, retrieveSeasonDTOOptionList, retrieveStandardExamCoterieTypeOptionListByStandardExamType, retrieveStandardExamTypeIcon, retrieveStandardExamTypeOptionList, retrieveStatusOptionList, retrieveTaxonomyGroupName, retrieveTaxonomyName, retrieveTaxonomyType, retrieveTokenUsageSubTypeOptionList, retrieveTokenUsageTypeOptionList, retrieveTotalTimeSpentInMinutes, retrieveTotalTimeSpentInSeconds, retrieveUserAuthorityGeneralOptionList, retrieveUserRoleOptionList, retrieveValidationRequirementList, shuffleArray, useScreenSize };
package/dist/index.d.ts CHANGED
@@ -470,6 +470,7 @@ declare const retrieveCategoryVersionCodeOptionList: () => {
470
470
  declare const filterCategoryVersionCodeOptionList: (categoryVersionCodeOptionList: any, coterieType: string, level: any) => any;
471
471
  declare const filterCategoryVersionCodeOptionListByGradeDTO: (categoryVersionCodeOptionList: any, coterieType: string, gradeDTO: any) => any;
472
472
  declare const filterCategoryVersionCodeOptionListByInstitutionDTO: (categoryVersionCodeOptionList: any, coterieType: string, institutionDTO: any) => any;
473
+ declare const constructCategoryTreeFromParentCode: (categorySet: any[]) => any;
473
474
 
474
475
  declare const ONE_HOUR = 3600000;
475
476
  declare const ONE_DAY = 86400000;
@@ -687,4 +688,4 @@ declare const retrieveTokenUsageSubTypeOptionList: () => {
687
688
  value: string;
688
689
  }[];
689
690
 
690
- export { ActivityBodyContent, ActivityPreviewByData, ActivitySolutionContent, ActivityTemplateLabel, ApproveButton, BaseImage, BaseLoading, BaseLoadingWithText, BaseModal, BaseTitle, BlueVerticalDividerLine, BrandLabel, CancelButton, CoterieLabel, CreateButton, DeleteButton, DividerLine, DropdownActivityContent, FillInTheBlanksActivityContent, GradeLabel, GroupingActivityContent, InfoWithText, InputGroup, InputWithSpecialExpression, LeftTextRightInputGroup, MCMAActivityContent, MCSAActivityContent, MatchingActivityContent, ONE_DAY, ONE_HOUR, ONE_MONTH, ONE_WEEK, OpenEndedActivityContent, OrderingActivityContent, OutcomeLabel, PersonalLabel, PrimaryButton, PublishingHouseLabel, SecondaryButton, SelectionBox, SelectionCheckbox, SelectionTab, SelectionTabFill, SubTitle, THREE_MONTHS, TrueFalseActivityContent, VerticalDividerLine, base64ToFile, calculateLevenshteinDistance, checkActivityAnswerState, checkIfAnswerIsEmpty, constructActivityAnswerMap, constructActivityAnswerStateList, constructActivityData, constructActivityItemListBodyOnly, constructActivityItemListMaterialOnly, constructActivityItemListSolutionOnly, constructActivityItemListWithAnswersForAI, constructActivityItemListWithSolutionForAI, constructAnswerBasedOnData, constructBaseNumericIndividualModel, constructBaseVerbalIndvidualModel, constructInputWithSpecialExpressionList, constructUserProfileQueryParams, constructWeekName, convertDataURLtoFile, convertToBase64, convertToBodyMapString, convertToEvaluationRubricMapString, convertToSolutionMapString, convertTurkishCharactersToEnglish, filterCategoryVersionCodeOptionList, filterCategoryVersionCodeOptionListByGradeDTO, filterCategoryVersionCodeOptionListByInstitutionDTO, filterCoterieTypeOptionList, filterGradeLevelOptionList, filterUserRoleOptionList, findAISettingsFromCurrentProfile, findBestFitActivity, getColorByIndex, ignoreMathematicalExpression, mergeObjects, parseBodyMapFromData, parseContentMapFromData, parseJwt, parseMaterialMapFromData, retrieveActivityAnswerFromAnswerList, retrieveActivityTemplateDTOOptionList, retrieveAllEarnedBadgeDTOListByCoterieType, retrieveAllEarnedBadgeDTOListByCoterieTypeList, retrieveAnnouncementAudienceOptionList, retrieveAnnouncementTypeOptionList, retrieveBadgeRuleListByParams, retrieveBadgeRuleTextByParams, retrieveBranchDTOByUserProfileOptionList, retrieveBranchDTOOptionList, retrieveBrandDTOByUserProfileOptionList, retrieveBrandDTOOptionList, retrieveCampusDTOByUserProfileOptionList, retrieveCampusDTOOptionList, retrieveCategoryVersionCodeOptionList, retrieveClockTimeLeft, retrieveColorByScore, retrieveContentTypeOptionList, retrieveContestTypeOptionList, retrieveCoterieTypeFromStandardExamCoterieType, retrieveCoterieTypeOptionList, retrieveCountryCodeOptionList, retrieveCountryNameOptionList, retrieveCurrentDefaultDataMap, retrieveDateIntervalOptionList, retrieveDefaultUserRoleOptionList, retrieveDistintCoterieTypeFromCatchtivityApplicationDTO, retrieveDocumentTypeFromAcceptedFormat, retrieveDocumentTypeFromExtension, retrieveDurationInMinutesOptionList, retrieveDurationInSecondsOptionList, retrieveDurationTypeOptionList, retrieveEachTimeSpentInSeconds, retrieveEnableOptionList, retrieveExternalRegistrationDTOOptionList, retrieveFrequencyTypeOptionList, retrieveGenderOptionList, retrieveGradeDTOByUserProfileOptionList, retrieveGradeDTOOptionList, retrieveGradeLevelOptionList, retrieveInstitutionDTOByUserProfileOptionList, retrieveInstitutionDTOOptionList, retrieveInstitutionTypeOptionList, retrieveMonthNameByIndex, retrieveOtherBadgeDTOList, retrievePhoneNumberAreaCodeList, retrieveProvinceNameOptionList, retrieveReportTypeOptionList, retrieveSeasonDTOByUserProfileOptionList, retrieveSeasonDTOOptionList, retrieveStandardExamCoterieTypeOptionListByStandardExamType, retrieveStandardExamTypeIcon, retrieveStandardExamTypeOptionList, retrieveStatusOptionList, retrieveTaxonomyGroupName, retrieveTaxonomyName, retrieveTaxonomyType, retrieveTokenUsageSubTypeOptionList, retrieveTokenUsageTypeOptionList, retrieveTotalTimeSpentInMinutes, retrieveTotalTimeSpentInSeconds, retrieveUserAuthorityGeneralOptionList, retrieveUserRoleOptionList, retrieveValidationRequirementList, shuffleArray, useScreenSize };
691
+ export { ActivityBodyContent, ActivityPreviewByData, ActivitySolutionContent, ActivityTemplateLabel, ApproveButton, BaseImage, BaseLoading, BaseLoadingWithText, BaseModal, BaseTitle, BlueVerticalDividerLine, BrandLabel, CancelButton, CoterieLabel, CreateButton, DeleteButton, DividerLine, DropdownActivityContent, FillInTheBlanksActivityContent, GradeLabel, GroupingActivityContent, InfoWithText, InputGroup, InputWithSpecialExpression, LeftTextRightInputGroup, MCMAActivityContent, MCSAActivityContent, MatchingActivityContent, ONE_DAY, ONE_HOUR, ONE_MONTH, ONE_WEEK, OpenEndedActivityContent, OrderingActivityContent, OutcomeLabel, PersonalLabel, PrimaryButton, PublishingHouseLabel, SecondaryButton, SelectionBox, SelectionCheckbox, SelectionTab, SelectionTabFill, SubTitle, THREE_MONTHS, TrueFalseActivityContent, VerticalDividerLine, base64ToFile, calculateLevenshteinDistance, checkActivityAnswerState, checkIfAnswerIsEmpty, constructActivityAnswerMap, constructActivityAnswerStateList, constructActivityData, constructActivityItemListBodyOnly, constructActivityItemListMaterialOnly, constructActivityItemListSolutionOnly, constructActivityItemListWithAnswersForAI, constructActivityItemListWithSolutionForAI, constructAnswerBasedOnData, constructBaseNumericIndividualModel, constructBaseVerbalIndvidualModel, constructCategoryTreeFromParentCode, constructInputWithSpecialExpressionList, constructUserProfileQueryParams, constructWeekName, convertDataURLtoFile, convertToBase64, convertToBodyMapString, convertToEvaluationRubricMapString, convertToSolutionMapString, convertTurkishCharactersToEnglish, filterCategoryVersionCodeOptionList, filterCategoryVersionCodeOptionListByGradeDTO, filterCategoryVersionCodeOptionListByInstitutionDTO, filterCoterieTypeOptionList, filterGradeLevelOptionList, filterUserRoleOptionList, findAISettingsFromCurrentProfile, findBestFitActivity, getColorByIndex, ignoreMathematicalExpression, mergeObjects, parseBodyMapFromData, parseContentMapFromData, parseJwt, parseMaterialMapFromData, retrieveActivityAnswerFromAnswerList, retrieveActivityTemplateDTOOptionList, retrieveAllEarnedBadgeDTOListByCoterieType, retrieveAllEarnedBadgeDTOListByCoterieTypeList, retrieveAnnouncementAudienceOptionList, retrieveAnnouncementTypeOptionList, retrieveBadgeRuleListByParams, retrieveBadgeRuleTextByParams, retrieveBranchDTOByUserProfileOptionList, retrieveBranchDTOOptionList, retrieveBrandDTOByUserProfileOptionList, retrieveBrandDTOOptionList, retrieveCampusDTOByUserProfileOptionList, retrieveCampusDTOOptionList, retrieveCategoryVersionCodeOptionList, retrieveClockTimeLeft, retrieveColorByScore, retrieveContentTypeOptionList, retrieveContestTypeOptionList, retrieveCoterieTypeFromStandardExamCoterieType, retrieveCoterieTypeOptionList, retrieveCountryCodeOptionList, retrieveCountryNameOptionList, retrieveCurrentDefaultDataMap, retrieveDateIntervalOptionList, retrieveDefaultUserRoleOptionList, retrieveDistintCoterieTypeFromCatchtivityApplicationDTO, retrieveDocumentTypeFromAcceptedFormat, retrieveDocumentTypeFromExtension, retrieveDurationInMinutesOptionList, retrieveDurationInSecondsOptionList, retrieveDurationTypeOptionList, retrieveEachTimeSpentInSeconds, retrieveEnableOptionList, retrieveExternalRegistrationDTOOptionList, retrieveFrequencyTypeOptionList, retrieveGenderOptionList, retrieveGradeDTOByUserProfileOptionList, retrieveGradeDTOOptionList, retrieveGradeLevelOptionList, retrieveInstitutionDTOByUserProfileOptionList, retrieveInstitutionDTOOptionList, retrieveInstitutionTypeOptionList, retrieveMonthNameByIndex, retrieveOtherBadgeDTOList, retrievePhoneNumberAreaCodeList, retrieveProvinceNameOptionList, retrieveReportTypeOptionList, retrieveSeasonDTOByUserProfileOptionList, retrieveSeasonDTOOptionList, retrieveStandardExamCoterieTypeOptionListByStandardExamType, retrieveStandardExamTypeIcon, retrieveStandardExamTypeOptionList, retrieveStatusOptionList, retrieveTaxonomyGroupName, retrieveTaxonomyName, retrieveTaxonomyType, retrieveTokenUsageSubTypeOptionList, retrieveTokenUsageTypeOptionList, retrieveTotalTimeSpentInMinutes, retrieveTotalTimeSpentInSeconds, retrieveUserAuthorityGeneralOptionList, retrieveUserRoleOptionList, retrieveValidationRequirementList, shuffleArray, useScreenSize };
package/dist/index.js CHANGED
@@ -129,6 +129,7 @@ __export(index_exports, {
129
129
  constructAnswerBasedOnData: () => constructAnswerBasedOnData,
130
130
  constructBaseNumericIndividualModel: () => constructBaseNumericIndividualModel,
131
131
  constructBaseVerbalIndvidualModel: () => constructBaseVerbalIndvidualModel,
132
+ constructCategoryTreeFromParentCode: () => constructCategoryTreeFromParentCode,
132
133
  constructInputWithSpecialExpressionList: () => constructInputWithSpecialExpressionList,
133
134
  constructUserProfileQueryParams: () => constructUserProfileQueryParams,
134
135
  constructWeekName: () => constructWeekName,
@@ -3541,7 +3542,7 @@ var InputGroup = ({
3541
3542
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "my-1 flex-1 flex flex-col relative", children: [
3542
3543
  /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex flex-row justify-between items-center", children: [
3543
3544
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { children: title ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "text-md font-semibold pl-2 py-1 text-catchup-gray-400", children: title }) : null }),
3544
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { children: limit ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("p", { className: "text-md font-semibold pr-2 py-1 text-catchup-gray-400", children: [
3545
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { children: value && limit ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("p", { className: "text-md font-semibold pr-2 py-1 text-catchup-gray-400", children: [
3545
3546
  value.length,
3546
3547
  " / ",
3547
3548
  limit
@@ -8061,6 +8062,26 @@ var filterCategoryVersionCodeOptionListByInstitutionDTO = (categoryVersionCodeOp
8061
8062
  }
8062
8063
  return currentCategoryVersionCodeOptionList;
8063
8064
  };
8065
+ var constructCategoryTreeFromParentCode = (categorySet) => {
8066
+ const nodeMap = /* @__PURE__ */ new Map();
8067
+ const rootNodes = [];
8068
+ categorySet.forEach((item) => {
8069
+ const node = __spreadProps(__spreadValues({}, item), {
8070
+ subCategoryDTOList: []
8071
+ });
8072
+ nodeMap.set(item.code, node);
8073
+ });
8074
+ categorySet.forEach((item) => {
8075
+ const node = nodeMap.get(item.code);
8076
+ if (item.parentCode && nodeMap.has(item.parentCode)) {
8077
+ const parent = nodeMap.get(item.parentCode);
8078
+ parent.subCategoryDTOList.push(node);
8079
+ } else {
8080
+ rootNodes.push(node);
8081
+ }
8082
+ });
8083
+ return rootNodes;
8084
+ };
8064
8085
 
8065
8086
  // src/utilization/DateUtilization.ts
8066
8087
  var ONE_HOUR = 36e5;
@@ -8910,6 +8931,7 @@ var retrieveTokenUsageSubTypeOptionList = () => {
8910
8931
  constructAnswerBasedOnData,
8911
8932
  constructBaseNumericIndividualModel,
8912
8933
  constructBaseVerbalIndvidualModel,
8934
+ constructCategoryTreeFromParentCode,
8913
8935
  constructInputWithSpecialExpressionList,
8914
8936
  constructUserProfileQueryParams,
8915
8937
  constructWeekName,
package/dist/index.mjs CHANGED
@@ -3356,7 +3356,7 @@ var InputGroup = ({
3356
3356
  return /* @__PURE__ */ jsxs9("div", { className: "my-1 flex-1 flex flex-col relative", children: [
3357
3357
  /* @__PURE__ */ jsxs9("div", { className: "flex flex-row justify-between items-center", children: [
3358
3358
  /* @__PURE__ */ jsx15("div", { children: title ? /* @__PURE__ */ jsx15("p", { className: "text-md font-semibold pl-2 py-1 text-catchup-gray-400", children: title }) : null }),
3359
- /* @__PURE__ */ jsx15("div", { children: limit ? /* @__PURE__ */ jsxs9("p", { className: "text-md font-semibold pr-2 py-1 text-catchup-gray-400", children: [
3359
+ /* @__PURE__ */ jsx15("div", { children: value && limit ? /* @__PURE__ */ jsxs9("p", { className: "text-md font-semibold pr-2 py-1 text-catchup-gray-400", children: [
3360
3360
  value.length,
3361
3361
  " / ",
3362
3362
  limit
@@ -7876,6 +7876,26 @@ var filterCategoryVersionCodeOptionListByInstitutionDTO = (categoryVersionCodeOp
7876
7876
  }
7877
7877
  return currentCategoryVersionCodeOptionList;
7878
7878
  };
7879
+ var constructCategoryTreeFromParentCode = (categorySet) => {
7880
+ const nodeMap = /* @__PURE__ */ new Map();
7881
+ const rootNodes = [];
7882
+ categorySet.forEach((item) => {
7883
+ const node = __spreadProps(__spreadValues({}, item), {
7884
+ subCategoryDTOList: []
7885
+ });
7886
+ nodeMap.set(item.code, node);
7887
+ });
7888
+ categorySet.forEach((item) => {
7889
+ const node = nodeMap.get(item.code);
7890
+ if (item.parentCode && nodeMap.has(item.parentCode)) {
7891
+ const parent = nodeMap.get(item.parentCode);
7892
+ parent.subCategoryDTOList.push(node);
7893
+ } else {
7894
+ rootNodes.push(node);
7895
+ }
7896
+ });
7897
+ return rootNodes;
7898
+ };
7879
7899
 
7880
7900
  // src/utilization/DateUtilization.ts
7881
7901
  var ONE_HOUR = 36e5;
@@ -8724,6 +8744,7 @@ export {
8724
8744
  constructAnswerBasedOnData,
8725
8745
  constructBaseNumericIndividualModel,
8726
8746
  constructBaseVerbalIndvidualModel,
8747
+ constructCategoryTreeFromParentCode,
8727
8748
  constructInputWithSpecialExpressionList,
8728
8749
  constructUserProfileQueryParams,
8729
8750
  constructWeekName,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "catchup-library-web",
3
- "version": "1.2.14",
3
+ "version": "1.2.16",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -230,7 +230,7 @@ const InputGroup = ({
230
230
  ) : null}
231
231
  </div>
232
232
  <div>
233
- {limit ? (
233
+ {value && limit ? (
234
234
  <p className="text-md font-semibold pr-2 py-1 text-catchup-gray-400">
235
235
  {value.length} / {limit}
236
236
  </p>
@@ -312,3 +312,29 @@ export const filterCategoryVersionCodeOptionListByInstitutionDTO = (
312
312
 
313
313
  return currentCategoryVersionCodeOptionList;
314
314
  };
315
+
316
+ export const constructCategoryTreeFromParentCode = (categorySet: any[]) => {
317
+ const nodeMap = new Map();
318
+ const rootNodes: any = [];
319
+
320
+ categorySet.forEach((item) => {
321
+ const node = {
322
+ ...item,
323
+ subCategoryDTOList: [],
324
+ };
325
+ nodeMap.set(item.code, node);
326
+ });
327
+
328
+ categorySet.forEach((item) => {
329
+ const node = nodeMap.get(item.code);
330
+
331
+ if (item.parentCode && nodeMap.has(item.parentCode)) {
332
+ const parent = nodeMap.get(item.parentCode);
333
+ parent.subCategoryDTOList.push(node);
334
+ } else {
335
+ rootNodes.push(node);
336
+ }
337
+ });
338
+
339
+ return rootNodes;
340
+ };