udp-react-enterprise-component-library 25.1.0-beta.6 → 25.1.1-beta.1
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/{AmbientGridTemplate-BqlMt5Su.js → AmbientGridTemplate-6xfwTiz-.js} +24 -62
- package/dist/AmbientGridTemplate-6xfwTiz-.js.map +1 -0
- package/dist/ClientSideUdpGrid-CEhDqIId.js +56 -0
- package/dist/ClientSideUdpGrid-CEhDqIId.js.map +1 -0
- package/dist/{EnvironmentRibbon-DaDmKAPO.js → EnvironmentRibbon-oEmbWjEq.js} +4 -148
- package/dist/EnvironmentRibbon-oEmbWjEq.js.map +1 -0
- package/dist/{MenuPage-CO6_GWwB.js → MenuPage-CZHpoopY.js} +12 -13
- package/dist/{MenuPage-CO6_GWwB.js.map → MenuPage-CZHpoopY.js.map} +1 -1
- package/dist/{MyExportsPage-CX9tzqHk.js → MyExportsPage-CS2Bw2mF.js} +56 -69
- package/dist/{MyExportsPage-CX9tzqHk.js.map → MyExportsPage-CS2Bw2mF.js.map} +1 -1
- package/dist/MyExportsPage-hyX42CN6.js +11 -0
- package/dist/{PageContainer-k8KCfGsM.js → PageContainer-BPHLFGju.js} +12 -17
- package/dist/PageContainer-BPHLFGju.js.map +1 -0
- package/dist/{PageNotFoundRoute-CxYZNEhN.js → PageNotFoundRoute-D9dLbM_w.js} +1 -1
- package/dist/{PageNotFoundRoute-CxYZNEhN.js.map → PageNotFoundRoute-D9dLbM_w.js.map} +1 -1
- package/dist/PageNotFoundRoute-DUj0Q9J8.js +3 -0
- package/dist/{PasswordResetRedirect-BHnkAW40.js → PasswordResetRedirect-C3g8L0vA.js} +2 -3
- package/dist/{PasswordResetRedirect-BHnkAW40.js.map → PasswordResetRedirect-C3g8L0vA.js.map} +1 -1
- package/dist/PasswordResetRedirect-Dh-S5Ril.js +3 -0
- package/dist/{SearchUtilities-Bor3HbfB.js → SearchUtilities-Btugro8y.js} +11 -20
- package/dist/{SearchUtilities-Bor3HbfB.js.map → SearchUtilities-Btugro8y.js.map} +1 -1
- package/dist/{SideSheet-DUsxG1FN.js → SideSheet-BsDoeNmq.js} +7 -47
- package/dist/SideSheet-BsDoeNmq.js.map +1 -0
- package/dist/UdpMaintenanceConfigPage-DcHntunS.js +88 -0
- package/dist/UdpMaintenanceConfigPage-DcHntunS.js.map +1 -0
- package/dist/UdpPublicForm-DTt-lMfk.js +4 -0
- package/dist/{UdpPublicForm-Caa1tH6z.js → UdpPublicForm-LDSuOwV2.js} +2 -2
- package/dist/{UdpPublicForm-Caa1tH6z.js.map → UdpPublicForm-LDSuOwV2.js.map} +1 -1
- package/dist/{UtilitySideBar-D4CXGtW2.js → UtilitySideBar-95k0edSA.js} +45 -89
- package/dist/{UtilitySideBar-D4CXGtW2.js.map → UtilitySideBar-95k0edSA.js.map} +1 -1
- package/dist/{VirtualBrowser-BXL0hdy0.js → VirtualBrowser-_epMjUkE.js} +23 -29
- package/dist/{VirtualBrowser-BXL0hdy0.js.map → VirtualBrowser-_epMjUkE.js.map} +1 -1
- package/dist/{WorkflowContainer-DrqzuQtU.js → WorkflowContainer-ClPvY2mG.js} +14 -20
- package/dist/{WorkflowContainer-DrqzuQtU.js.map → WorkflowContainer-ClPvY2mG.js.map} +1 -1
- package/dist/WorkflowContainer-D0QUOc-f.js +11 -0
- package/dist/{apiHelpers-DZots3og.js → apiHelpers-CmM6DWAT.js} +7 -12
- package/dist/{apiHelpers-DZots3og.js.map → apiHelpers-CmM6DWAT.js.map} +1 -1
- package/dist/entityUtilities-Dy-jsB5c.js +22 -0
- package/dist/entityUtilities-Dy-jsB5c.js.map +1 -0
- package/dist/index.js +1494 -1984
- package/dist/index.js.map +1 -1
- package/dist/{propertyTypeEnums-Civy7RJv.js → propertyTypeEnums-BCCGQqVB.js} +2 -2
- package/dist/{propertyTypeEnums-Civy7RJv.js.map → propertyTypeEnums-BCCGQqVB.js.map} +1 -1
- package/dist/types/index.d.ts +1 -4
- package/dist/types/maintenanceEngine/crudBrowser/CrudTableColumnDefs.d.ts +1 -9
- package/dist/types/maintenanceEngine/crudBrowser/crudHelper.d.ts +1 -0
- package/dist/types/menuPage/MenuPage.d.ts +2 -1
- package/dist/types/shell/ui/ShellDropdown.d.ts +15 -0
- package/dist/types/shell/ui/SiteHeader.d.ts +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/types/udp/pages/UdpMaintenanceConfigPage.d.ts +2 -1
- package/dist/useAxiosGet-Dh5pVURP.js +144 -0
- package/dist/useAxiosGet-Dh5pVURP.js.map +1 -0
- package/dist/useAxiosMutate-DlG255x9.js +43 -0
- package/dist/useAxiosMutate-DlG255x9.js.map +1 -0
- package/package.json +2 -2
- package/dist/AmbientGridTemplate-BqlMt5Su.js.map +0 -1
- package/dist/EnvironmentRibbon-DaDmKAPO.js.map +0 -1
- package/dist/MyExportsPage-CkzQ0MRq.js +0 -8
- package/dist/PageContainer-k8KCfGsM.js.map +0 -1
- package/dist/PageNotFoundRoute-BbBtA9Cz.js +0 -3
- package/dist/PasswordResetRedirect-tUV2yEkH.js +0 -3
- package/dist/SideSheet-DUsxG1FN.js.map +0 -1
- package/dist/UdpPublicForm-Cvw5tOHe.js +0 -4
- package/dist/WorkflowContainer-Q8gtuaB7.js +0 -9
- package/dist/types/maintenanceEngine/crudBrowser/CrudTableActionRender.d.ts +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchUtilities-Bor3HbfB.js","names":["getSearchObject: (\n searchFilterElements: SearchFilters[],\n page: number,\n pageSize: number,\n eagerLoad?: boolean,\n logicalSearchOperator?: LogicalSearchOperatorEnums,\n searchFilterGroups?: SearchFilterGroups[]\n) => Search","searchObject: Search","getApiMethodIdByPath: (apiMethodList: Array<{ path: string; apiMethodId?: string | number }>, path: string) => string | number | null","getSearchIdentifiers: (catalogObjects: any[], catalogReturnObject: string) => string[]","useConvertFilterModelToSearchFilters: () => (filterModel: any) => SearchFilters[]","searchFilters: SearchFilters[]"],"sources":["../src/enums/aggridEnums.ts","../src/utilities/search/SearchUtilities.ts"],"sourcesContent":["export enum AgGridFilterOperators {\n CONTAINS = 'contains',\n NOT_CONTAINS = 'notcontains',\n EQUALS = 'equals',\n NOT_EQUALS = 'notequals',\n STARTSWITH = 'startswith',\n ENDSWITH = 'endswith',\n LESS_THAN = 'lessthan',\n LESS_THAN_OR_EQUAL = 'lessthanorequal',\n GREATER_THAN = 'greaterthan',\n GREATER_THAN_OR_EQUAL = 'greaterthanorequal',\n IN_RANGE = 'inrange',\n SET = 'set'\n }\n \n export enum SqlFilterOperators {\n LIKE = 'LIKE',\n EQUALS = '=',\n NOT_EQUALS = '<>',\n LESS_THAN = '<',\n LESS_THAN_OR_EQUAL = '<=',\n GREATER_THAN = '>',\n GREATER_THAN_OR_EQUAL = '>=',\n BETWEEN = 'BETWEEN',\n IN = 'IN',\n STARTSWITH = 'STARTSWITH',\n ENDSWITH = 'ENDSWITH'\n }\n \n export enum AgGridFilterTypes {\n TEXT = 'text',\n NUMBER = 'number',\n DATE = 'date',\n SET = 'set'\n }\n \n export enum SearchValueType {\n Type_String = 1,\n Type_Int = 2,\n Type_Long = 3,\n Type_Double = 4,\n Type_Boolean = 5,\n Type_DateTime = 6,\n Type_Guid = 7\n }\n \n export enum GroupingType {\n DISTINCT = 'DISTINCT',\n AGGREGATE = 'AGGREGATE'\n }","import { useCallback, useMemo } from 'react';\nimport {\n SearchGroupingType,\n LogicalSearchOperatorEnums\n} from '../../enums/unitySystemEnums';\nimport { DateTime, IANAZone } from 'luxon';\nimport { FilterObject, Search, SearchFilters, SearchFilterGroups } from './Search';\nimport {\n AgGridFilterOperators,\n AgGridFilterTypes,\n SearchValueType,\n SqlFilterOperators\n} from '../../enums/aggridEnums';\nimport { useUser } from '../auth/useUser';\nimport { FilterElementParamType } from '../../enums/searchEnums';\n\nexport const getSearchObject: (\n searchFilterElements: SearchFilters[],\n page: number,\n pageSize: number,\n eagerLoad?: boolean,\n logicalSearchOperator?: LogicalSearchOperatorEnums,\n searchFilterGroups?: SearchFilterGroups[]\n) => Search = (\n searchFilterElements,\n page,\n pageSize,\n eagerLoad = false,\n logicalSearchOperator = LogicalSearchOperatorEnums.And,\n searchFilterGroups = []\n) => {\n const searchObject: Search = {\n pageNumber: page || 1,\n pageSize: pageSize || 20,\n filterElements: [],\n filterGroups: [],\n orderElements: [],\n groupingType: '',\n groupProperty: [],\n groupOperationList: [],\n eagerLoad: eagerLoad,\n logicalSearchOperator: logicalSearchOperator\n };\n\n if (searchFilterElements) {\n searchFilterElements.forEach((property) => {\n const formattedPropertyName = property.searchField;\n searchObject.filterElements = searchFilterElements;\n // adds order elements\n if ('sortDirection' in property && property.sortDirection) {\n const orderElement = {\n sortColumn: formattedPropertyName,\n sortDirection: property.sortDirection as string\n };\n searchObject.orderElements.push(orderElement);\n }\n if ('distinct' in property && property.distinct) {\n searchObject.groupingType = SearchGroupingType.Distinct;\n searchObject.groupProperty?.push(formattedPropertyName);\n }\n });\n }\n\n searchObject.filterGroups = searchFilterGroups;\n\n return searchObject;\n};\nexport const getApiMethodIdByPath: (apiMethodList: Array<{ path: string; apiMethodId?: string | number }>, path: string) => string | number | null = (\n apiMethodList,\n path\n) => {\n const foundApiMethod = apiMethodList.find((method) =>\n path.includes(method.path)\n );\n return (foundApiMethod?.apiMethodId ?? null);\n};\n\nexport const getSearchIdentifiers: (catalogObjects: any[], catalogReturnObject: string) => string[] = (catalogObjects, catalogReturnObject) => {\n if (!catalogObjects) return [];\n const matchingCatalogObject = catalogObjects.find(\n (co) => co.catalogObjectName === catalogReturnObject\n );\n const properties = matchingCatalogObject?.properties?.filter(\n (property) => property?.extendedProperties?.identifier\n );\n return properties?.map((property) => property.name) ?? [];\n};\n\n/**\n * Returns a reference to a function that takes an Ag-grid FilterModel object and\n * processes it to create an array of SearchFilters.\n * @param timeZone string or null;\n * @returns Function for processing Ag-grid FilterModel\n */\nexport const useConvertFilterModelToSearchFilters: () => (filterModel: any) => SearchFilters[] = (\n timeZone: string | null = null\n) => {\n const user = useUser();\n\n const zone = useMemo(() => {\n let tz =\n timeZone ?? user?.additionalProperties?.activeUtilityTimeZone ?? 'local';\n const validTimeZone =\n tz !== 'local' &&\n (tz === user?.additionalProperties?.activeUtilityTimeZone ||\n IANAZone.isValidZone(tz))\n ? tz\n : 'local'; // IANAZone.isValidZone is very slow, skip it if known valid timeZone passed\n return validTimeZone;\n }, [timeZone, user]);\n\n const convertFilterModelToSearchFilters = useCallback(\n (filterModel: any = null) => {\n if (!filterModel) {\n return [];\n }\n let searchFilters: SearchFilters[] = [];\n searchFilters = Object.entries(filterModel).map(\n (item: FilterObject | any) => {\n let field = item[0];\n let operator;\n let type;\n let value;\n // Set the filter value; dependent on filter type (e.g. Date, Set, etc.)\n if (item[1]?.filterType === AgGridFilterTypes.DATE) {\n // Applies the applicable timezone to the date filter value for usage when\n // constructing the database query.\n let dateFilterValueWithoutTime = item[1]?.dateFrom?.substring(\n 0,\n 10\n ); // e.g. 2022-02-05\n let dateSplit = dateFilterValueWithoutTime.split('-');\n let date = new Date(dateSplit[0], dateSplit[1] - 1, dateSplit[2]);\n const filterDateTimeMidnight = DateTime.fromJSDate(date).setZone(\n zone,\n { keepLocalTime: true }\n );\n let dateString = filterDateTimeMidnight.toJSDate().toISOString();\n value = dateString;\n } else if (item[1]?.filterType === AgGridFilterTypes.SET) {\n value = item[1].values.join(',');\n operator = SqlFilterOperators.IN;\n } else {\n value = item[1]?.filter;\n }\n\n switch (item[1]?.type?.toLowerCase()) {\n case AgGridFilterOperators.CONTAINS:\n operator = SqlFilterOperators.LIKE;\n break;\n case AgGridFilterOperators.EQUALS:\n operator = SqlFilterOperators.EQUALS;\n if (item[1]?.filterType === AgGridFilterTypes.DATE) {\n type = SearchValueType.Type_DateTime;\n }\n break;\n case AgGridFilterOperators.NOT_EQUALS:\n operator = SqlFilterOperators.NOT_EQUALS;\n break;\n case AgGridFilterOperators.GREATER_THAN:\n operator = SqlFilterOperators.GREATER_THAN;\n break;\n case AgGridFilterOperators.GREATER_THAN_OR_EQUAL:\n operator = SqlFilterOperators.GREATER_THAN_OR_EQUAL;\n break;\n case AgGridFilterOperators.LESS_THAN:\n operator = SqlFilterOperators.LESS_THAN;\n break;\n case AgGridFilterOperators.LESS_THAN_OR_EQUAL:\n operator = SqlFilterOperators.LESS_THAN_OR_EQUAL;\n break;\n case AgGridFilterOperators.STARTSWITH:\n operator = SqlFilterOperators.STARTSWITH;\n break;\n case AgGridFilterOperators.IN_RANGE:\n operator = SqlFilterOperators.BETWEEN;\n if (item[1]?.filterType === AgGridFilterTypes.NUMBER) {\n value += ',' + item[1]?.filterTo;\n } else if (item[1]?.filterType === AgGridFilterTypes.DATE) {\n let dateFilterValueWithoutTime = item[1]?.dateTo?.substring(\n 0,\n 10\n ); // e.g. 2022-02-05\n let dateSplit = dateFilterValueWithoutTime.split('-');\n let date = new Date(\n dateSplit[0],\n dateSplit[1] - 1,\n dateSplit[2]\n );\n const filterDateTimeMidnight = DateTime.fromJSDate(\n date\n ).setZone(zone, { keepLocalTime: true });\n let dateString = filterDateTimeMidnight\n .toJSDate()\n .toISOString();\n value += ',' + dateString;\n }\n break;\n case AgGridFilterOperators.ENDSWITH:\n operator = SqlFilterOperators.ENDSWITH;\n break;\n default:\n break;\n }\n return {\n searchField: field,\n searchValue: value,\n searchOperator: operator,\n searchValueType: type,\n groupId: null\n };\n }\n );\n return searchFilters;\n },\n [zone]\n );\n\n return convertFilterModelToSearchFilters;\n};\n"],"mappings":";;;;;AAAA,IAAY,0EAAL;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGF,IAAY,oEAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGF,IAAY,kEAAL;AACL;AACA;AACA;AACA;;;AAGF,IAAY,8DAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AC3BJ,MAAaA,mBAQX,sBACA,MACA,UACA,YAAY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,KACb,UAAU,IACV,UAAU,KAAK,GACf,UAAU;MAEZ,MAAM,yBAAyB,SAAS,WACtC,MACA,QAAQ,MAAM,EAAE,eAAe;MACjC,IAAI,aAAa,uBACd,WACA;AACH,eAAS,MAAM;;AAEjB;IACF,KAAK,sBAAsB;AACzB,gBAAW,mBAAmB;AAC9B;IACF,QACE;;AAEJ,UAAO;IACL,aAAa;IACb,aAAa;IACb,gBAAgB;IAChB,iBAAiB;IACjB,SAAS;;;AAIf,SAAO;IAET,CAAC;AAGH,QAAO"}
|
|
1
|
+
{"version":3,"file":"SearchUtilities-Btugro8y.js","names":["getSearchObject: (\n searchFilterElements: SearchFilters[],\n page: number,\n pageSize: number,\n eagerLoad?: boolean,\n logicalSearchOperator?: LogicalSearchOperatorEnums,\n searchFilterGroups?: SearchFilterGroups[]\n) => Search","searchObject: Search","getApiMethodIdByPath: (apiMethodList: Array<{ path: string; apiMethodId?: string | number }>, path: string) => string | number | null","getSearchIdentifiers: (catalogObjects: any[], catalogReturnObject: string) => string[]","useConvertFilterModelToSearchFilters: () => (filterModel: any) => SearchFilters[]","searchFilters: SearchFilters[]"],"sources":["../src/enums/aggridEnums.ts","../src/utilities/search/SearchUtilities.ts"],"sourcesContent":["export enum AgGridFilterOperators {\n CONTAINS = 'contains',\n NOT_CONTAINS = 'notcontains',\n EQUALS = 'equals',\n NOT_EQUALS = 'notequals',\n STARTSWITH = 'startswith',\n ENDSWITH = 'endswith',\n LESS_THAN = 'lessthan',\n LESS_THAN_OR_EQUAL = 'lessthanorequal',\n GREATER_THAN = 'greaterthan',\n GREATER_THAN_OR_EQUAL = 'greaterthanorequal',\n IN_RANGE = 'inrange',\n SET = 'set'\n }\n \n export enum SqlFilterOperators {\n LIKE = 'LIKE',\n EQUALS = '=',\n NOT_EQUALS = '<>',\n LESS_THAN = '<',\n LESS_THAN_OR_EQUAL = '<=',\n GREATER_THAN = '>',\n GREATER_THAN_OR_EQUAL = '>=',\n BETWEEN = 'BETWEEN',\n IN = 'IN',\n STARTSWITH = 'STARTSWITH',\n ENDSWITH = 'ENDSWITH'\n }\n \n export enum AgGridFilterTypes {\n TEXT = 'text',\n NUMBER = 'number',\n DATE = 'date',\n SET = 'set'\n }\n \n export enum SearchValueType {\n Type_String = 1,\n Type_Int = 2,\n Type_Long = 3,\n Type_Double = 4,\n Type_Boolean = 5,\n Type_DateTime = 6,\n Type_Guid = 7\n }\n \n export enum GroupingType {\n DISTINCT = 'DISTINCT',\n AGGREGATE = 'AGGREGATE'\n }","import { useCallback, useMemo } from 'react';\nimport {\n SearchGroupingType,\n LogicalSearchOperatorEnums\n} from '../../enums/unitySystemEnums';\nimport { DateTime, IANAZone } from 'luxon';\nimport { FilterObject, Search, SearchFilters, SearchFilterGroups } from './Search';\nimport {\n AgGridFilterOperators,\n AgGridFilterTypes,\n SearchValueType,\n SqlFilterOperators\n} from '../../enums/aggridEnums';\nimport { useUser } from '../auth/useUser';\nimport { FilterElementParamType } from '../../enums/searchEnums';\n\nexport const getSearchObject: (\n searchFilterElements: SearchFilters[],\n page: number,\n pageSize: number,\n eagerLoad?: boolean,\n logicalSearchOperator?: LogicalSearchOperatorEnums,\n searchFilterGroups?: SearchFilterGroups[]\n) => Search = (\n searchFilterElements,\n page,\n pageSize,\n eagerLoad = false,\n logicalSearchOperator = LogicalSearchOperatorEnums.And,\n searchFilterGroups = []\n) => {\n const searchObject: Search = {\n pageNumber: page || 1,\n pageSize: pageSize || 20,\n filterElements: [],\n filterGroups: [],\n orderElements: [],\n groupingType: '',\n groupProperty: [],\n groupOperationList: [],\n eagerLoad: eagerLoad,\n logicalSearchOperator: logicalSearchOperator\n };\n\n if (searchFilterElements) {\n searchFilterElements.forEach((property) => {\n const formattedPropertyName = property.searchField;\n searchObject.filterElements = searchFilterElements;\n // adds order elements\n if ('sortDirection' in property && property.sortDirection) {\n const orderElement = {\n sortColumn: formattedPropertyName,\n sortDirection: property.sortDirection as string\n };\n searchObject.orderElements.push(orderElement);\n }\n if ('distinct' in property && property.distinct) {\n searchObject.groupingType = SearchGroupingType.Distinct;\n searchObject.groupProperty?.push(formattedPropertyName);\n }\n });\n }\n\n searchObject.filterGroups = searchFilterGroups;\n\n return searchObject;\n};\nexport const getApiMethodIdByPath: (apiMethodList: Array<{ path: string; apiMethodId?: string | number }>, path: string) => string | number | null = (\n apiMethodList,\n path\n) => {\n const foundApiMethod = apiMethodList.find((method) =>\n path.includes(method.path)\n );\n return (foundApiMethod?.apiMethodId ?? null);\n};\n\nexport const getSearchIdentifiers: (catalogObjects: any[], catalogReturnObject: string) => string[] = (catalogObjects, catalogReturnObject) => {\n if (!catalogObjects) return [];\n const matchingCatalogObject = catalogObjects.find(\n (co) => co.catalogObjectName === catalogReturnObject\n );\n const properties = matchingCatalogObject?.properties?.filter(\n (property) => property?.extendedProperties?.identifier\n );\n return properties?.map((property) => property.name) ?? [];\n};\n\n/**\n * Returns a reference to a function that takes an Ag-grid FilterModel object and\n * processes it to create an array of SearchFilters.\n * @param timeZone string or null;\n * @returns Function for processing Ag-grid FilterModel\n */\nexport const useConvertFilterModelToSearchFilters: () => (filterModel: any) => SearchFilters[] = (\n timeZone: string | null = null\n) => {\n const user = useUser();\n\n const zone = useMemo(() => {\n let tz =\n timeZone ?? user?.additionalProperties?.activeUtilityTimeZone ?? 'local';\n const validTimeZone =\n tz !== 'local' &&\n (tz === user?.additionalProperties?.activeUtilityTimeZone ||\n IANAZone.isValidZone(tz))\n ? tz\n : 'local'; // IANAZone.isValidZone is very slow, skip it if known valid timeZone passed\n return validTimeZone;\n }, [timeZone, user]);\n\n const convertFilterModelToSearchFilters = useCallback(\n (filterModel: any = null) => {\n if (!filterModel) {\n return [];\n }\n let searchFilters: SearchFilters[] = [];\n searchFilters = Object.entries(filterModel).map(\n (item: FilterObject | any) => {\n let field = item[0];\n let operator;\n let type;\n let value;\n // Set the filter value; dependent on filter type (e.g. Date, Set, etc.)\n if (item[1]?.filterType === AgGridFilterTypes.DATE) {\n // Applies the applicable timezone to the date filter value for usage when\n // constructing the database query.\n let dateFilterValueWithoutTime = item[1]?.dateFrom?.substring(\n 0,\n 10\n ); // e.g. 2022-02-05\n let dateSplit = dateFilterValueWithoutTime.split('-');\n let date = new Date(dateSplit[0], dateSplit[1] - 1, dateSplit[2]);\n const filterDateTimeMidnight = DateTime.fromJSDate(date).setZone(\n zone,\n { keepLocalTime: true }\n );\n let dateString = filterDateTimeMidnight.toJSDate().toISOString();\n value = dateString;\n } else if (item[1]?.filterType === AgGridFilterTypes.SET) {\n value = item[1].values.join(',');\n operator = SqlFilterOperators.IN;\n } else {\n value = item[1]?.filter;\n }\n\n switch (item[1]?.type?.toLowerCase()) {\n case AgGridFilterOperators.CONTAINS:\n operator = SqlFilterOperators.LIKE;\n break;\n case AgGridFilterOperators.EQUALS:\n operator = SqlFilterOperators.EQUALS;\n if (item[1]?.filterType === AgGridFilterTypes.DATE) {\n type = SearchValueType.Type_DateTime;\n }\n break;\n case AgGridFilterOperators.NOT_EQUALS:\n operator = SqlFilterOperators.NOT_EQUALS;\n break;\n case AgGridFilterOperators.GREATER_THAN:\n operator = SqlFilterOperators.GREATER_THAN;\n break;\n case AgGridFilterOperators.GREATER_THAN_OR_EQUAL:\n operator = SqlFilterOperators.GREATER_THAN_OR_EQUAL;\n break;\n case AgGridFilterOperators.LESS_THAN:\n operator = SqlFilterOperators.LESS_THAN;\n break;\n case AgGridFilterOperators.LESS_THAN_OR_EQUAL:\n operator = SqlFilterOperators.LESS_THAN_OR_EQUAL;\n break;\n case AgGridFilterOperators.STARTSWITH:\n operator = SqlFilterOperators.STARTSWITH;\n break;\n case AgGridFilterOperators.IN_RANGE:\n operator = SqlFilterOperators.BETWEEN;\n if (item[1]?.filterType === AgGridFilterTypes.NUMBER) {\n value += ',' + item[1]?.filterTo;\n } else if (item[1]?.filterType === AgGridFilterTypes.DATE) {\n let dateFilterValueWithoutTime = item[1]?.dateTo?.substring(\n 0,\n 10\n ); // e.g. 2022-02-05\n let dateSplit = dateFilterValueWithoutTime.split('-');\n let date = new Date(\n dateSplit[0],\n dateSplit[1] - 1,\n dateSplit[2]\n );\n const filterDateTimeMidnight = DateTime.fromJSDate(\n date\n ).setZone(zone, { keepLocalTime: true });\n let dateString = filterDateTimeMidnight\n .toJSDate()\n .toISOString();\n value += ',' + dateString;\n }\n break;\n case AgGridFilterOperators.ENDSWITH:\n operator = SqlFilterOperators.ENDSWITH;\n break;\n default:\n break;\n }\n return {\n searchField: field,\n searchValue: value,\n searchOperator: operator,\n searchValueType: type,\n groupId: null\n };\n }\n );\n return searchFilters;\n },\n [zone]\n );\n\n return convertFilterModelToSearchFilters;\n};\n"],"mappings":";;;;;;AAAA,IAAY,0EAAL;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGF,IAAY,oEAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGF,IAAY,kEAAL;AACL;AACA;AACA;AACA;;;AAGF,IAAY,8DAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AC3BJ,MAAaA,mBAQX,sBACA,MACA,UACA,YAAY,OACZ,wBAAwB,2BAA2B,KACnD,qBAAqB,EAAE,KACpB;CACH,MAAMC,eAAuB;EAC3B,YAAY,QAAQ;EACpB,UAAU,YAAY;EACtB,gBAAgB,EAAE;EAClB,cAAc,EAAE;EAChB,eAAe,EAAE;EACjB,cAAc;EACd,eAAe,EAAE;EACjB,oBAAoB,EAAE;EACX;EACY;EACxB;AAED,KAAI,qBACF,sBAAqB,SAAS,aAAa;EACzC,MAAM,wBAAwB,SAAS;AACvC,eAAa,iBAAiB;AAE9B,MAAI,mBAAmB,YAAY,SAAS,eAAe;GACzD,MAAM,eAAe;IACnB,YAAY;IACZ,eAAe,SAAS;IACzB;AACD,gBAAa,cAAc,KAAK,aAAa;;AAE/C,MAAI,cAAc,YAAY,SAAS,UAAU;AAC/C,gBAAa,eAAe,mBAAmB;AAC/C,gBAAa,eAAe,KAAK,sBAAsB;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Q,KAAK,IAAI;AAGnB,WAAQ,KAAK,IAAI,MAAM,aAAa,EAApC;IACE,KAAK,sBAAsB;AACzB,gBAAW,mBAAmB;AAC9B;IACF,KAAK,sBAAsB;AACzB,gBAAW,mBAAmB;AAC9B,SAAI,KAAK,IAAI,eAAe,kBAAkB,KAC5C,QAAO,gBAAgB;AAEzB;IACF,KAAK,sBAAsB;AACzB,gBAAW,mBAAmB;AAC9B;IACF,KAAK,sBAAsB;AACzB,gBAAW,mBAAmB;AAC9B;IACF,KAAK,sBAAsB;AACzB,gBAAW,mBAAmB;AAC9B;IACF,KAAK,sBAAsB;AACzB,gBAAW,mBAAmB;AAC9B;IACF,KAAK,sBAAsB;AACzB,gBAAW,mBAAmB;AAC9B;IACF,KAAK,sBAAsB;AACzB,gBAAW,mBAAmB;AAC9B;IACF,KAAK,sBAAsB;AACzB,gBAAW,mBAAmB;AAC9B,SAAI,KAAK,IAAI,eAAe,kBAAkB,OAC5C,UAAS,MAAM,KAAK,IAAI;cACf,KAAK,IAAI,eAAe,kBAAkB,MAAM;MAKzD,IAAI,aAJ6B,KAAK,IAAI,QAAQ,UAChD,GACA,GACD,EAC0C,MAAM,IAAI;MACrD,IAAI,OAAO,IAAI,KACb,UAAU,IACV,UAAU,KAAK,GACf,UAAU,GACX;MAID,IAAI,aAH2B,SAAS,WACtC,KACD,CAAC,QAAQ,MAAM,EAAE,eAAe,MAAM,CAAC,CAErC,UAAU,CACV,aAAa;AAChB,eAAS,MAAM;;AAEjB;IACF,KAAK,sBAAsB;AACzB,gBAAW,mBAAmB;AAC9B;IACF,QACE;;AAEJ,UAAO;IACL,aAAa;IACb,aAAa;IACb,gBAAgB;IAChB,iBAAiB;IACjB,SAAS;IACV;IAEJ;AACD,SAAO;IAET,CAAC,KAAK,CACP"}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { FluentButton, FluentIcon, FluentIconButton, StandardTitle
|
|
2
|
-
import {
|
|
3
|
-
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo } from "react";
|
|
1
|
+
import { FluentButton, FluentIcon, FluentIconButton, StandardTitle } from "./EnvironmentRibbon-oEmbWjEq.js";
|
|
2
|
+
import React, { forwardRef, useCallback, useImperativeHandle } from "react";
|
|
4
3
|
import { CardContent, CircularProgress, Drawer, LinearProgress, makeStyles } from "@material-ui/core";
|
|
5
4
|
import { Field, Form } from "react-final-form";
|
|
6
5
|
import { getIn } from "final-form";
|
|
7
|
-
import useAxios from "axios-hooks";
|
|
8
|
-
import Axios from "axios";
|
|
9
6
|
import { ChromeCloseIcon } from "@fluentui/react-icons";
|
|
10
7
|
import PropTypes from "prop-types";
|
|
11
8
|
|
|
@@ -35,8 +32,7 @@ const noop = () => {};
|
|
|
35
32
|
const createDecorator = () => (form) => {
|
|
36
33
|
const scrollToFirstError = (errors) => {
|
|
37
34
|
const allInputs = getAllInputs_default();
|
|
38
|
-
const
|
|
39
|
-
const inputToScrollTo = firstInput?.parentElement;
|
|
35
|
+
const inputToScrollTo = findInput_default(allInputs, errors)?.parentElement;
|
|
40
36
|
if (inputToScrollTo) inputToScrollTo.scrollIntoView({ behavior: "smooth" });
|
|
41
37
|
};
|
|
42
38
|
const originalSubmit = form.submit;
|
|
@@ -114,8 +110,8 @@ let Field$1 = forwardRef((props, ref) => {
|
|
|
114
110
|
type
|
|
115
111
|
};
|
|
116
112
|
const makeValidation = useCallback((value$1, allValues, meta) => {
|
|
117
|
-
if (required && (typeof value$1 !== "number" && !!!value$1 || Array.isArray(value$1))) if (Array.isArray(value$1) && value$1.length) return
|
|
118
|
-
else if (!!value$1 && !Array.isArray(value$1)) return
|
|
113
|
+
if (required && (typeof value$1 !== "number" && !!!value$1 || Array.isArray(value$1))) if (Array.isArray(value$1) && value$1.length) return;
|
|
114
|
+
else if (!!value$1 && !Array.isArray(value$1)) return;
|
|
119
115
|
else return "Required";
|
|
120
116
|
if (validate) return validate(value$1, allValues, meta);
|
|
121
117
|
}, [required, validate]);
|
|
@@ -144,42 +140,6 @@ let Field$1 = forwardRef((props, ref) => {
|
|
|
144
140
|
});
|
|
145
141
|
Field$1.displayName = "Field";
|
|
146
142
|
|
|
147
|
-
//#endregion
|
|
148
|
-
//#region src/utilities/useAxiosMutate.js
|
|
149
|
-
axiosInterceptors_default();
|
|
150
|
-
const useAxiosMutate = (baseURL, url, config) => {
|
|
151
|
-
const fullURL = { url: `${baseURL}/${url}` };
|
|
152
|
-
const user = useUser();
|
|
153
|
-
const headers = useMemo(() => {
|
|
154
|
-
const currentHeaders = config.headers ?? {};
|
|
155
|
-
currentHeaders.currentTenantId ||= user?.currentTenantId ?? "";
|
|
156
|
-
return currentHeaders;
|
|
157
|
-
}, [user, config]);
|
|
158
|
-
config.headers = headers;
|
|
159
|
-
const [{ data, loading, error }, execute] = useAxios({
|
|
160
|
-
...fullURL,
|
|
161
|
-
...config
|
|
162
|
-
}, { manual: true });
|
|
163
|
-
useEffect(() => {
|
|
164
|
-
handleResponseErrors(error);
|
|
165
|
-
}, [error]);
|
|
166
|
-
return [{
|
|
167
|
-
data,
|
|
168
|
-
loading,
|
|
169
|
-
error
|
|
170
|
-
}, execute];
|
|
171
|
-
};
|
|
172
|
-
const apiMutate = async (baseURL, url, config, data) => {
|
|
173
|
-
const fullURL = { url: `${baseURL}/${url}` };
|
|
174
|
-
const accessToken = await getAccessToken();
|
|
175
|
-
const mergedConfig = getMergedConfig(accessToken, config);
|
|
176
|
-
return Axios({
|
|
177
|
-
...fullURL,
|
|
178
|
-
...mergedConfig,
|
|
179
|
-
...data
|
|
180
|
-
});
|
|
181
|
-
};
|
|
182
|
-
|
|
183
143
|
//#endregion
|
|
184
144
|
//#region src/UI/dataDisplay/typography/SideSheetHeader.jsx
|
|
185
145
|
const useStyles$1 = makeStyles((theme) => ({
|
|
@@ -325,5 +285,5 @@ SideSheet.defaultProps = {
|
|
|
325
285
|
};
|
|
326
286
|
|
|
327
287
|
//#endregion
|
|
328
|
-
export { BaseSideSheet, Field$1 as Field, Form$1 as Form, SideSheet, SideSheetHeader,
|
|
329
|
-
//# sourceMappingURL=SideSheet-
|
|
288
|
+
export { BaseSideSheet, Field$1 as Field, Form$1 as Form, SideSheet, SideSheetHeader, createDecorator_default };
|
|
289
|
+
//# sourceMappingURL=SideSheet-BsDoeNmq.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SideSheet-BsDoeNmq.js","names":["isFocusableInput","getAllInputs","findInput","createDecorator","FinalForm","Form: React.FC<FormProps>","Field: FieldComponent","value","FinalField","name","useStyles"],"sources":["../src/utilities/form/final-form-scroll/isFocusableInput.js","../src/utilities/form/final-form-scroll/getAllInputs.js","../src/utilities/form/final-form-scroll/findInput.js","../src/utilities/form/final-form-scroll/createDecorator.js","../src/utilities/form/Form.tsx","../src/utilities/form/Field.tsx","../src/UI/dataDisplay/typography/SideSheetHeader.jsx","../src/UI/surfaces/SideSheet.jsx"],"sourcesContent":["const isFocusableInput = (wtf) =>\n !!(wtf && typeof wtf.focus === 'function');\n\nexport default isFocusableInput;\n","import isFocusableInput from './isFocusableInput';\n\nconst getAllInputs = () => {\n if (typeof document === 'undefined') {\n return [];\n }\n return Array.prototype.slice\n .call(document.forms)\n .reduce(\n (accumulator, form) =>\n accumulator.concat(\n Array.prototype.slice.call(form).filter(isFocusableInput)\n ),\n []\n );\n};\n\nexport default getAllInputs;\n","import { getIn } from 'final-form';\n\nconst findInput = (inputs, errors) =>\n inputs.find(input => input.name && getIn(errors, input.name));\n\nexport default findInput;\n","import getAllInputs from './getAllInputs.js';\nimport findInput from './findInput.js';\n\nconst noop = () => {};\n\n/**\n * The decorator is created based on final-form-focus https://github.com/final-form/final-form-focus\n */\nconst createDecorator = () => (form) => {\n const scrollToFirstError = (errors) => {\n const allInputs = getAllInputs();\n const firstInput = findInput(allInputs, errors);\n const inputToScrollTo = firstInput?.parentElement;\n if (inputToScrollTo) {\n inputToScrollTo.scrollIntoView({ behavior: 'smooth' });\n }\n };\n // Save original submit function\n const originalSubmit = form.submit;\n let state = {};\n const unsubscribe = form.subscribe(\n (nextState) => {\n state = nextState;\n },\n { errors: true, submitErrors: true }\n );\n // What to do after submit\n const afterSubmit = () => {\n const { errors, submitErrors } = state;\n if (errors && Object.keys(errors).length) {\n scrollToFirstError(errors);\n } else if (submitErrors && Object.keys(submitErrors).length) {\n scrollToFirstError(submitErrors);\n }\n };\n\n // Rewrite submit function\n form.submit = () => {\n const result = originalSubmit.call(form);\n if (result && typeof result.then === 'function') {\n // async\n result.then(afterSubmit, noop);\n } else {\n // sync\n afterSubmit();\n }\n return result;\n };\n\n return () => {\n unsubscribe();\n form.submit = originalSubmit;\n };\n};\n\nexport default createDecorator;\n","import React, { forwardRef, useImperativeHandle } from 'react';\nimport {\n AnyObject,\n Form as FinalForm,\n FormProps as FinalFormProps,\n FormRenderProps,\n} from 'react-final-form';\nimport createDecorator from './final-form-scroll/createDecorator';\n\nexport interface FormProps<FormValues = AnyObject>\n extends FinalFormProps<FormValues> {\n children?: (props: FormRenderProps<FormValues>) => React.ReactNode;\n id?: string;\n}\nconst scrollToError = createDecorator();\n\n/**\n * final-form Form wrapper with automatic <form> and submit handler\n */\n\nconst _Form = ({ render: renderProp, children, id, ...props }: FormProps, ref: React.Ref<any>) => {\n const render = renderProp || children;\n\n return (\n <FinalForm ref={ref} decorators={[scrollToError]} {...props}>\n {params => {\n useImperativeHandle(ref, () => ({ ...params}))\n return (\n <form onSubmit={params.handleSubmit} noValidate={true} id={id}>\n {typeof render === 'function' ? render(params) : render}\n </form>\n )\n }}\n </FinalForm>\n );\n};\n\nexport const Form: React.FC<FormProps> = forwardRef(_Form)\n","import { InputBaseComponentProps } from '@material-ui/core';\nimport React, {\n ElementType,\n forwardRef,\n useCallback,\n ComponentType,\n} from 'react';\nimport {\n Field as FinalField,\n FieldProps as FinalFieldProps,\n FieldRenderProps,\n} from 'react-final-form';\n\nexport interface MuiFieldComponentProps {\n error?: boolean;\n helperText?: React.ReactNode;\n inputProps?: InputBaseComponentProps;\n onChange: React.ChangeEventHandler;\n ComponentProps?: any;\n}\n\nexport type MuiFieldComponent = ElementType<MuiFieldComponentProps>;\n\nexport type FieldProps<\n FieldValue,\n RP extends FieldRenderProps<FieldValue, T>,\n T extends HTMLElement = HTMLElement\n > = {\n component: MuiFieldComponent;\n // @fixme Some of the onChange handlers pass value instead\n valueForChange?: (event: React.ChangeEvent<T>) => FieldValue;\n pattern?: string;\n } & Pick<\n FinalFieldProps<FieldValue, RP, T>,\n | 'afterSubmit'\n | 'allowNull'\n | 'beforeSubmit'\n | 'defaultValue'\n | 'format'\n | 'formatOnBlur'\n | 'initialValue'\n | 'isEqual'\n | 'name'\n | 'parse'\n | 'subscription'\n | 'type'\n | 'validate'\n | 'validateFields'\n | 'value'\n | 'required'\n > &\n MuiFieldComponentProps; // @fixme Add another generic to extend this with componentProps\n\ntype FieldComponent<\n FieldValue = any,\n RP extends FieldRenderProps<FieldValue, T> = FieldRenderProps<\n FieldValue,\n HTMLElement\n >,\n T extends HTMLElement = HTMLElement\n > = ComponentType<FieldProps<FieldValue, RP, T>>;\n\n/**\n * final-form Field wrapper that supports using Material UI fields as components\n * @todo Implement a validation function that uses required, etc... (or defer this till Redwerks' form library is built)\n */\nexport let Field: FieldComponent = forwardRef((props, ref) => {\n const {\n component: Component,\n afterSubmit,\n allowNull,\n beforeSubmit,\n component,\n defaultValue,\n format,\n formatOnBlur,\n initialValue,\n isEqual,\n name,\n parse,\n // @ts-ignore\n render, // extract the render prop so it doesn't get passed to Field\n subscription,\n validate,\n validateFields,\n value, // radio/checkbox\n helperText,\n valueForChange,\n required,\n ComponentProps,\n type,\n ...componentProps\n } = props;\n const fieldProps = {\n afterSubmit,\n allowNull,\n beforeSubmit,\n defaultValue,\n format,\n formatOnBlur,\n initialValue,\n isEqual,\n name,\n parse,\n subscription,\n validate,\n validateFields,\n value,\n type\n };\n\n // @fixme: will need to add a more generic validator for other valdiation props\n const makeValidation = useCallback(\n (value, allValues, meta) => {\n if (required && ((typeof (value) !== \"number\" && !!!value) || Array.isArray(value))) {\n if (Array.isArray(value) && value.length) {\n return undefined;\n } else if (!!value && !Array.isArray(value)) {\n return undefined;\n } else {\n return 'Required';\n }\n }\n if (validate) {\n return validate(value, allValues, meta);\n }\n },\n [required, validate]\n );\n\n return (\n <FinalField {...fieldProps} validate={makeValidation}>\n {params => {\n const { input, meta } = params;\n const { name, onChange, ...inputProps } = input;\n const showError =\n ((meta.submitError && !meta.dirtySinceLastSubmit) || meta.error) &&\n meta.touched;\n\n return (\n <Component\n ref={ref as any} // @fixme\n required={required}\n {...componentProps}\n {...ComponentProps}\n helperText={showError ? meta.error || meta.submitError : helperText}\n error={showError}\n onChange={(...args: any[]) => {\n if (valueForChange) {\n // @ts-ignore\n args = [valueForChange(...args)];\n }\n // @ts-ignore\n onChange(...args);\n }}\n name={name}\n {...inputProps}\n //value={value}\n />\n );\n }}\n </FinalField>\n );\n});\nField.displayName = 'Field';\n","import React from 'react';\nimport { makeStyles, CircularProgress } from '@material-ui/core';\nimport { StandardTitle } from './StandardTitle';\nimport { FluentIconButton } from '../../inputs/buttons/FluentIconButton';\nimport { FluentButton } from '../../inputs/buttons/FluentButton';\nimport { ChromeCloseIcon } from '@fluentui/react-icons';\nimport { FluentIcon } from '../../../utilities/FluentIcon';\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n display: 'flex',\n flexDirection: 'row',\n padding: theme.spacing(1),\n paddingLeft: 0,\n background:\n theme?.getThemeData()?.mode === 'dark'\n ? theme.palette.grey[800]\n : theme.palette.common.white,\n position: ({ isSticky }) => (isSticky ? 'sticky' : 'relative'),\n top: ({ isSticky }) => (isSticky ? 0 : 'auto'),\n zIndex: ({ isSticky }) => (isSticky ? 1200 : 'auto')\n },\n title: {\n display: 'flex',\n flex: 1,\n alignItems: 'center',\n marginLeft: theme.spacing(1.5)\n },\n actionButton: {\n marginRight: theme.spacing(1),\n position: 'relative'\n },\n fabProgress: {\n position: 'absolute',\n top: 4,\n left: '35%',\n zIndex: 1\n }\n}));\n\nexport const SideSheetHeader = ({ isSticky = false, ...props }) => {\n const classes = useStyles({ isSticky });\n const {\n title,\n onClose,\n buttonLabel,\n onSubmit,\n buttonProgress,\n buttonTwoLabel,\n buttonTwoIcon,\n buttonTwoAction,\n buttonTwoProgress,\n id,\n udprecordid = '',\n buttonOneDisabled,\n buttonTwoDisabled,\n ...otherProps\n } = props;\n\n return (\n <div className={classes.root}>\n <div className={classes.title}>\n <FluentIconButton\n id={id + '-Close'}\n udprecordid={udprecordid + '-Close'}\n icon={ChromeCloseIcon}\n onClick={onClose}\n aria-label='Close Panel'\n />\n <StandardTitle className={classes.title}>{title}</StandardTitle>\n </div>\n {buttonTwoLabel && (\n <div>\n <FluentButton\n // variant='contained'\n color='secondary'\n onClick={buttonTwoAction}\n disabled={buttonTwoDisabled}\n {...otherProps}\n >\n {buttonTwoProgress && (\n <CircularProgress\n size={24}\n color='secondary'\n className={classes.fabProgress}\n />\n )}\n {buttonTwoIcon && (\n <FluentIcon\n size='small'\n component={buttonTwoIcon}\n style={{ marginRight: 8 }}\n />\n )}\n {buttonTwoLabel}\n </FluentButton>\n </div>\n )}\n {buttonLabel && (\n <div className={classes.actionButton}>\n <FluentButton\n id={id + '-CreateView'}\n udprecordid={udprecordid + '-CreateView'}\n variant='contained'\n color='secondary'\n onClick={onSubmit}\n disabled={buttonOneDisabled}\n {...otherProps}\n >\n {buttonProgress && (\n <CircularProgress\n id={id + '-ButtonProgress'}\n udprecordid={udprecordid + '-ButtonProgress'}\n size={24}\n color='secondary'\n className={classes.fabProgress}\n />\n )}\n {buttonLabel}\n </FluentButton>\n </div>\n )}\n </div>\n );\n};\n","import React from 'react';\nimport {\n makeStyles,\n Drawer,\n LinearProgress,\n CardContent\n} from '@material-ui/core';\nimport { SideSheetHeader } from '../dataDisplay/typography/SideSheetHeader';\nimport PropTypes from 'prop-types';\n\nconst useStyles = makeStyles((theme) => ({\n paper: {\n // width: (props) => props.width || 320,\n width: '100%',\n [theme.breakpoints.up('sm')]: {\n width: (props) => props.width || 320\n },\n background:\n theme?.getThemeData()?.mode === 'dark'\n ? theme.palette.grey[700]\n : '#f4f4f4'\n },\n container: {\n height: (props) => (props.contentHeight ? props.contentHeight : ''),\n overflowY: (props) => (props.contentHeight ? 'auto' : ''),\n padding: (props) => (props.noPadding ? 0 : '')\n }\n}));\n\n/**\n * Base right hand side sheet with no contents\n */\nexport const BaseSideSheet = (props) => {\n const classes = useStyles(props);\n const {\n anchor = 'right',\n width,\n children,\n onClose,\n noBackdrop,\n buttonLabel,\n ...drawerProps\n } = props;\n\n return (\n <Drawer\n classes={{ paper: classes.paper }}\n variant='temporary'\n anchor={anchor}\n onClose={onClose}\n {...drawerProps}\n BackdropProps={{ invisible: noBackdrop }}\n >\n {children}\n </Drawer>\n );\n};\n\n/**\n * A right hand material side sheet\n */\nexport const SideSheet = (props) => {\n const classes = useStyles(props);\n const {\n children,\n title,\n progress,\n progressColor,\n buttonLabel,\n noPadding,\n onSubmit,\n variant = 'determinate',\n buttonTwoLabel,\n buttonTwoIcon,\n buttonTwoAction,\n buttonTwoProgress,\n buttonOneDisabled,\n buttonTwoDisabled,\n id,\n udprecordid,\n ...otherProps\n } = props;\n const { onClose } = props;\n return (\n <BaseSideSheet {...otherProps}>\n <SideSheetHeader\n id={id}\n udprecordid={udprecordid}\n onClose={onClose}\n title={title}\n buttonLabel={buttonLabel}\n onSubmit={onSubmit}\n buttonTwoLabel={buttonTwoLabel}\n buttonTwoIcon={buttonTwoIcon}\n buttonTwoAction={buttonTwoAction}\n buttonTwoProgress={buttonTwoProgress}\n isSticky={true}\n buttonOneDisabled={buttonOneDisabled}\n buttonTwoDisabled={buttonTwoDisabled}\n {...otherProps}\n />\n {progress && (\n <LinearProgress\n variant={variant}\n color={progressColor}\n value={progress}\n />\n )}\n <CardContent classes={{ root: classes.container }}>\n {children}\n </CardContent>\n </BaseSideSheet>\n );\n};\n\nSideSheet.propTypes = {\n /**\n * Main content for the modal view\n */\n children: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.node),\n PropTypes.node\n ]),\n /**\n * SideSheet title\n */\n title: PropTypes.string.isRequired,\n /**\n * Function to close SideSheet\n */\n onClose: PropTypes.func,\n /**\n * Determins the open or closed state of the SideSheet\n */\n open: PropTypes.bool,\n /**\n * Value for progress loading\n */\n progress: PropTypes.any, // ToDo: add fix for hiding 0 progress\n /**\n * Progress loading color\n */\n progressColor: PropTypes.string,\n /**\n * Width of the SideSheet\n */\n width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n /**\n * Anchor orgin of card (right, left, top, bottom)\n */\n anchor: PropTypes.string,\n /**\n * Label for top action button (global only)\n */\n buttonLabel: PropTypes.string,\n /**\n * Option to override container padding\n */\n noPadding: PropTypes.string,\n /**\n * Progress loading color\n */\n contentHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number])\n};\n\nSideSheet.defaultProps = {\n anchor: 'right',\n progressColor: 'secondary'\n};\n"],"mappings":";;;;;;;;;AAAA,MAAM,oBAAoB,QACxB,CAAC,EAAE,OAAO,OAAO,IAAI,UAAU;AAEjC,+BAAe;;;;ACDf,MAAM,qBAAqB;AACzB,KAAI,OAAO,aAAa,YACtB,QAAO,EAAE;AAEX,QAAO,MAAM,UAAU,MACpB,KAAK,SAAS,MAAM,CACpB,QACE,aAAa,SACZ,YAAY,OACV,MAAM,UAAU,MAAM,KAAK,KAAK,CAAC,OAAOA,yBAAiB,CAC1D,EACH,EAAE,CACH;;AAGL,2BAAe;;;;ACff,MAAM,aAAa,QAAQ,WACzB,OAAO,MAAK,UAAS,MAAM,QAAQ,MAAM,QAAQ,MAAM,KAAK,CAAC;AAE/D,wBAAe;;;;ACFf,MAAM,aAAa;;;;AAKnB,MAAM,yBAAyB,SAAS;CACtC,MAAM,sBAAsB,WAAW;EACrC,MAAM,YAAYC,sBAAc;EAEhC,MAAM,kBADaC,kBAAU,WAAW,OAAO,EACX;AACpC,MAAI,gBACF,iBAAgB,eAAe,EAAE,UAAU,UAAU,CAAC;;CAI1D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B"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import "./apiHelpers-CmM6DWAT.js";
|
|
2
|
+
import { useAxiosGet } from "./useAxiosGet-Dh5pVURP.js";
|
|
3
|
+
import { useAxiosMutate } from "./useAxiosMutate-DlG255x9.js";
|
|
4
|
+
import { getSanitizedName } from "./entityUtilities-Dy-jsB5c.js";
|
|
5
|
+
import { ClientSideUdpGrid, PageLoading, useAuthedUser } from "./ClientSideUdpGrid-CEhDqIId.js";
|
|
6
|
+
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
7
|
+
import { useHistory } from "react-router-dom";
|
|
8
|
+
import { useTranslation } from "react-i18next";
|
|
9
|
+
|
|
10
|
+
//#region src/udp/pages/UdpMaintenanceConfigPage.jsx
|
|
11
|
+
const UdpMaintenanceConfigPage = (props) => {
|
|
12
|
+
const [apiCatalogId, setApiCatalogId] = useState(null);
|
|
13
|
+
const user = useAuthedUser();
|
|
14
|
+
const history = useHistory();
|
|
15
|
+
const { t } = useTranslation();
|
|
16
|
+
const [{ data: tpacb, loading: loadingTpacb, error: tpacbError }] = useAxiosGet(process.env.REACT_APP_INTEGRATION_API_BASE, `tenantProductApiCatalogBase/tenant/${user?.currentTenantId}/product/${process.env.REACT_APP_UNITY_PRODUCT_ID}`, {}, !!!user, false);
|
|
17
|
+
const [{ data: promotedGetConfigApi, loading: loadingPromotedGetConfigApi, error: promotedGetConfigApiError }] = useAxiosGet(process.env.REACT_APP_INTEGRATION_API_BASE, `apicatalog/${apiCatalogId}/promotedConfigEntity/product/${process.env.REACT_APP_UNITY_PRODUCT_ID}`, {}, !!!apiCatalogId, false);
|
|
18
|
+
const [{ data: tableConfigList, loading: tableConfigListLoading, error: tableConfigListError }, fetchTableConfigList] = useAxiosMutate(process.env.REACT_APP_INTEGRATION_API_BASE, `apimethod/executeQueryWithParameters/${promotedGetConfigApi?.apiMethodId}`, { method: "post" });
|
|
19
|
+
const [{ data: promotedMethods, loading, error }] = useAxiosGet(process.env.REACT_APP_INTEGRATION_API_BASE, `apicatalog/${apiCatalogId}/promotedMethodEntities?productId=${process.env.REACT_APP_UNITY_PRODUCT_ID}`, {}, !!!apiCatalogId, false);
|
|
20
|
+
const rowData = useMemo(() => {
|
|
21
|
+
if (!promotedMethods || !tableConfigList) return [];
|
|
22
|
+
let tmp = [];
|
|
23
|
+
if (Array.isArray(tableConfigList)) tmp = tableConfigList;
|
|
24
|
+
else for (const [key, value] of Object.entries(tableConfigList)) tmp.push(`${key}`);
|
|
25
|
+
return tmp.reduce((mergedData, tableConfig) => {
|
|
26
|
+
const matchingEntityRow = promotedMethods.find((promotedEntity) => promotedEntity.entityName === getSanitizedName(tableConfig));
|
|
27
|
+
if (matchingEntityRow) mergedData.push(matchingEntityRow);
|
|
28
|
+
else {
|
|
29
|
+
const placeholderData = {
|
|
30
|
+
entityName: tableConfig,
|
|
31
|
+
productId: process.env.REACT_APP_UNITY_PRODUCT_ID,
|
|
32
|
+
unityBaseGetAllMethod: null,
|
|
33
|
+
unityBaseGetMethod: null,
|
|
34
|
+
unityBaseCreateMethod: null,
|
|
35
|
+
unityBaseUpdateMethod: null,
|
|
36
|
+
unityBaseDeleteMethod: null
|
|
37
|
+
};
|
|
38
|
+
mergedData.push(placeholderData);
|
|
39
|
+
}
|
|
40
|
+
return mergedData;
|
|
41
|
+
}, []);
|
|
42
|
+
}, [promotedMethods, tableConfigList]);
|
|
43
|
+
const handleOpenEntityMaintenancePage = useCallback((selectedEntity) => {
|
|
44
|
+
history.push(`/crudbrowser`, {
|
|
45
|
+
entityName: getSanitizedName(selectedEntity?.entityName),
|
|
46
|
+
apiCatalogId
|
|
47
|
+
});
|
|
48
|
+
}, [history, apiCatalogId]);
|
|
49
|
+
const actionList = useMemo(() => [{
|
|
50
|
+
id: 0,
|
|
51
|
+
title: t("View table data"),
|
|
52
|
+
iconName: "arrowRight16",
|
|
53
|
+
handleOnClick: (e, params) => handleOpenEntityMaintenancePage(params?.data),
|
|
54
|
+
disabled: false
|
|
55
|
+
}], [handleOpenEntityMaintenancePage, t]);
|
|
56
|
+
const columnDefs = useMemo(() => {
|
|
57
|
+
return [{
|
|
58
|
+
headerName: "Entity Name",
|
|
59
|
+
field: "entityName",
|
|
60
|
+
valueGetter: (params) => params.data?.properties?.displayName || params.data?.sanitizedName || getSanitizedName(params.data?.entityName)
|
|
61
|
+
}, {
|
|
62
|
+
headerName: "Actions",
|
|
63
|
+
field: "actions",
|
|
64
|
+
cellRenderer: "actionsRenderer",
|
|
65
|
+
cellRendererParams: { actionList }
|
|
66
|
+
}];
|
|
67
|
+
}, [actionList]);
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
if (tpacb) setApiCatalogId(tpacb.apiCatalogId);
|
|
70
|
+
}, [tpacb]);
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
if (promotedGetConfigApi?.apiMethodId) fetchTableConfigList({ data: {} });
|
|
73
|
+
}, [fetchTableConfigList, promotedGetConfigApi]);
|
|
74
|
+
if (loadingTpacb || loadingPromotedGetConfigApi || tableConfigListLoading) return /* @__PURE__ */ React.createElement(PageLoading, null);
|
|
75
|
+
if (tpacbError) return /* @__PURE__ */ React.createElement("div", null, t("There is no Api Catalog associated with your tenant and product"));
|
|
76
|
+
if (promotedGetConfigApiError) return /* @__PURE__ */ React.createElement("div", null, t("Please promote your get configuration tables method before proceeding"));
|
|
77
|
+
if (tableConfigListError) return /* @__PURE__ */ React.createElement("div", null, t("No configuration tables could be found"));
|
|
78
|
+
return /* @__PURE__ */ React.createElement(ClientSideUdpGrid, {
|
|
79
|
+
rowData,
|
|
80
|
+
columnDefs,
|
|
81
|
+
gridHeaderConfig: { title: "Table Browser" }
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
var UdpMaintenanceConfigPage_default = UdpMaintenanceConfigPage;
|
|
85
|
+
|
|
86
|
+
//#endregion
|
|
87
|
+
export { UdpMaintenanceConfigPage_default as default };
|
|
88
|
+
//# sourceMappingURL=UdpMaintenanceConfigPage-DcHntunS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UdpMaintenanceConfigPage-DcHntunS.js","names":[],"sources":["../src/udp/pages/UdpMaintenanceConfigPage.jsx"],"sourcesContent":["import React, { useCallback, useEffect, useState, useMemo } from 'react';\nimport { useAxiosGet } from '../../utilities/useAxiosGet';\nimport { useAxiosMutate } from '../../utilities/useAxiosMutate';\nimport { useAuthedUser } from '../../utilities/auth/useAuthedUser';\nimport { getSanitizedName } from '../../utilities/entities/entityUtilities';\nimport { useHistory } from 'react-router-dom';\nimport { PageLoading } from '../../UI/feedback/PageLoading';\nimport { useTranslation } from 'react-i18next';\nimport { ClientSideUdpGrid } from '../../UI/templates/newGrid/ClientSideUdpGrid';\n\nconst UdpMaintenanceConfigPage = (props) => {\n const [apiCatalogId, setApiCatalogId] = useState(null);\n const user = useAuthedUser();\n const history = useHistory();\n const { t } = useTranslation();\n\n /* #region API Methods */\n\n const [{ data: tpacb, loading: loadingTpacb, error: tpacbError }] =\n useAxiosGet(\n process.env.REACT_APP_INTEGRATION_API_BASE,\n `tenantProductApiCatalogBase/tenant/${user?.currentTenantId}/product/${process.env.REACT_APP_UNITY_PRODUCT_ID}`,\n {},\n !!!user,\n false\n );\n\n const [\n {\n data: promotedGetConfigApi,\n loading: loadingPromotedGetConfigApi,\n error: promotedGetConfigApiError\n }\n ] = useAxiosGet(\n process.env.REACT_APP_INTEGRATION_API_BASE,\n `apicatalog/${apiCatalogId}/promotedConfigEntity/product/${process.env.REACT_APP_UNITY_PRODUCT_ID}`,\n {},\n !!!apiCatalogId,\n false\n );\n\n const [\n {\n data: tableConfigList,\n loading: tableConfigListLoading,\n error: tableConfigListError\n },\n fetchTableConfigList\n ] = useAxiosMutate(\n process.env.REACT_APP_INTEGRATION_API_BASE,\n `apimethod/executeQueryWithParameters/${promotedGetConfigApi?.apiMethodId}`,\n {\n method: 'post'\n }\n );\n\n const [{ data: promotedMethods, loading, error }] = useAxiosGet(\n process.env.REACT_APP_INTEGRATION_API_BASE,\n `apicatalog/${apiCatalogId}/promotedMethodEntities?productId=${process.env.REACT_APP_UNITY_PRODUCT_ID}`,\n {},\n !!!apiCatalogId,\n false\n );\n\n /* #endregion */\n\n const rowData = useMemo(() => {\n if (!promotedMethods || !tableConfigList) {\n return [];\n }\n let tmp = [];\n if (Array.isArray(tableConfigList)) {\n tmp = tableConfigList;\n } else {\n // eslint-disable-next-line no-unused-vars\n for (const [key, value] of Object.entries(tableConfigList)) {\n tmp.push(`${key}`);\n }\n }\n\n const result = tmp.reduce((mergedData, tableConfig) => {\n const matchingEntityRow = promotedMethods.find(\n (promotedEntity) =>\n promotedEntity.entityName === getSanitizedName(tableConfig)\n );\n if (matchingEntityRow) {\n mergedData.push(matchingEntityRow);\n } else {\n const placeholderData = {\n entityName: tableConfig,\n productId: process.env.REACT_APP_UNITY_PRODUCT_ID,\n unityBaseGetAllMethod: null,\n unityBaseGetMethod: null,\n unityBaseCreateMethod: null,\n unityBaseUpdateMethod: null,\n unityBaseDeleteMethod: null\n };\n mergedData.push(placeholderData);\n }\n return mergedData;\n }, []);\n return result;\n }, [promotedMethods, tableConfigList]);\n\n const handleOpenEntityMaintenancePage = useCallback(\n (selectedEntity) => {\n history.push(`/crudbrowser`, {\n entityName: getSanitizedName(selectedEntity?.entityName),\n apiCatalogId: apiCatalogId\n });\n },\n [history, apiCatalogId]\n );\n\n const actionList = useMemo(\n () => [\n {\n id: 0,\n title: t('View table data'),\n iconName: 'arrowRight16',\n handleOnClick: (e, params) => handleOpenEntityMaintenancePage(params?.data),\n disabled: false\n }\n ],\n [handleOpenEntityMaintenancePage, t]\n );\n\n const columnDefs = useMemo(() => {\n return [\n {\n headerName: 'Entity Name',\n field: 'entityName',\n valueGetter: (params) =>\n params.data?.properties?.displayName ||\n params.data?.sanitizedName ||\n getSanitizedName(params.data?.entityName),\n },\n {\n headerName: 'Actions',\n field: 'actions',\n cellRenderer: 'actionsRenderer',\n cellRendererParams: {\n actionList: actionList\n }\n }\n ];\n }, [actionList]);\n\n useEffect(() => {\n if (tpacb) {\n setApiCatalogId(tpacb.apiCatalogId);\n }\n }, [tpacb]);\n\n useEffect(() => {\n if (promotedGetConfigApi?.apiMethodId) {\n fetchTableConfigList({ data: {} });\n }\n }, [fetchTableConfigList, promotedGetConfigApi]);\n\n if (loadingTpacb || loadingPromotedGetConfigApi || tableConfigListLoading) {\n return <PageLoading />;\n }\n\n if (tpacbError) {\n return (\n <div>\n {t('There is no Api Catalog associated with your tenant and product')}\n </div>\n );\n }\n\n if (promotedGetConfigApiError) {\n return (\n <div>\n {t(\n 'Please promote your get configuration tables method before proceeding'\n )}\n </div>\n );\n }\n\n if (tableConfigListError) {\n return <div>{t('No configuration tables could be found')}</div>;\n }\n\n return (\n <ClientSideUdpGrid\n rowData={rowData}\n columnDefs={columnDefs}\n gridHeaderConfig={{ title: 'Table Browser' }}\n />\n );\n};\n\nexport default UdpMaintenanceConfigPage;\n"],"mappings":";;;;;;;;;;AAUA,MAAM,4BAA4B,UAAU;CAC1C,MAAM,CAAC,cAAc,mBAAmB,SAAS,KAAK;CACtD,MAAM,OAAO,eAAe;CAC5B,MAAM,UAAU,YAAY;CAC5B,MAAM,EAAE,MAAM,gBAAgB;CAI9B,MAAM,CAAC,EAAE,MAAM,OAAO,SAAS,cAAc,OAAO,gBAClD,YACE,QAAQ,IAAI,gCACZ,sCAAsC,MAAM,gBAAgB,WAAW,QAAQ,IAAI,8BACnF,EAAE,EACF,CAAC,CAAC,CAAC,MACH,MACD;CAEH,MAAM,CACJ,EACE,MAAM,sBACN,SAAS,6BACT,OAAO,+BAEP,YACF,QAAQ,IAAI,gCACZ,cAAc,aAAa,gCAAgC,QAAQ,IAAI,8BACvE,EAAE,EACF,CAAC,CAAC,CAAC,cACH,MACD;CAED,MAAM,CACJ,EACE,MAAM,iBACN,SAAS,wBACT,OAAO,wBAET,wBACE,eACF,QAAQ,IAAI,gCACZ,wCAAwC,sBAAsB,eAC9D,EACE,QAAQ,QACT,CACF;CAED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OAAO,MAAM,WAAW;GAC5C,EACD;GACE,YAAY;GACZ,OAAO;GACP,cAAc;GACd,oBAAoB,EACN,YACb;GACF,CACF;IACA,CAAC,WAAW,CAAC;AAEhB,iBAAgB;AACd,MAAI,MACF,iBAAgB,MAAM,aAAa;IAEpC,CAAC,MAAM,CAAC;AAEX,iBAAgB;AACd,MAAI,sBAAsB,YACxB,sBAAqB,EAAE,MAAM,EAAE,EAAE,CAAC;IAEnC,CAAC,sBAAsB,qBAAqB,CAAC;AAEhD,KAAI,gBAAgB,+BAA+B,uBACjD,QAAO,oCAAC,kBAAc;AAGxB,KAAI,WACF,QACE,oCAAC,aACE,EAAE,kEAAkE,CACjE;AAIV,KAAI,0BACF,QACE,oCAAC,aACE,EACC,wEACD,CACG;AAIV,KAAI,qBACF,QAAO,oCAAC,aAAK,EAAE,yCAAyC,CAAO;AAGjE,QACE,oCAAC;EACU;EACG;EACZ,kBAAkB,EAAE,OAAO,iBAAiB;GAC5C;;AAIN,uCAAe"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useHandleAxiosSnackbar } from "./apiHelpers-
|
|
1
|
+
import { useHandleAxiosSnackbar } from "./apiHelpers-CmM6DWAT.js";
|
|
2
2
|
import React, { useEffect } from "react";
|
|
3
3
|
import { UdpFormsRenderer } from "udp-react-stencil-component-library";
|
|
4
4
|
import { useLocation } from "react-router-dom";
|
|
@@ -47,4 +47,4 @@ var UdpPublicForm_default = UdpPublicForm;
|
|
|
47
47
|
|
|
48
48
|
//#endregion
|
|
49
49
|
export { UdpPublicForm, UdpPublicForm_default, UdpPublicForm_exports, __export };
|
|
50
|
-
//# sourceMappingURL=UdpPublicForm-
|
|
50
|
+
//# sourceMappingURL=UdpPublicForm-LDSuOwV2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UdpPublicForm-
|
|
1
|
+
{"version":3,"file":"UdpPublicForm-LDSuOwV2.js","names":[],"sources":["../src/udp/pages/UdpPublicForm.jsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport { UdpFormsRenderer } from 'udp-react-stencil-component-library';\nimport { useLocation } from 'react-router-dom';\nimport { useHandleAxiosSnackbar } from '../../utilities/apiHelpers';\nconst useSearchParams = () => {\n const search = useLocation().search;\n\n // when params are populated with an internal redirect, like on a Page menu, the useLocation hook does not get the query params\n // so it will fallback with window.location.search in that case\n return new URLSearchParams(search || window.location.search);\n}\nexport const UdpPublicForm = (props) => {\n const { handleErrorSnackbar } = useHandleAxiosSnackbar();\n const queryParams = useSearchParams()\n\n const formId = queryParams.get('udpf_formId');\n const tenantId = queryParams.get('udpf_tenantId');\n const callbackUrl = queryParams.get('udpf_callback_url');\n\n useEffect(() => {\n if (!formId) {\n handleErrorSnackbar({}, 'Form Id not found, please specify udpf_formid in the query params');\n }\n if (!tenantId) {\n handleErrorSnackbar({}, 'tenantId not found, please specify udpf_formid in the query params');\n }\n }, []);\n if (!formId || !tenantId) return null;\n\n return (\n <UdpFormsRenderer\n formId={formId}\n tenantId={tenantId}\n productId={ConfigService.config.UNITY_PRODUCT_ID}\n apiUrlBase={ConfigService.productV1ApiUrl}\n callbackUrl={callbackUrl}\n isPublic\n />\n );\n};\n\nexport default UdpPublicForm;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAIA,MAAM,wBAAwB;CAC5B,MAAM,SAAS,aAAa,CAAC;AAI7B,QAAO,IAAI,gBAAgB,UAAU,OAAO,SAAS,OAAO;;AAE9D,MAAa,iBAAiB,UAAU;CACtC,MAAM,EAAE,wBAAwB,wBAAwB;CACxD,MAAM,cAAc,iBAAiB;CAErC,MAAM,SAAS,YAAY,IAAI,cAAc;CAC7C,MAAM,WAAW,YAAY,IAAI,gBAAgB;CACjD,MAAM,cAAc,YAAY,IAAI,oBAAoB;AAExD,iBAAgB;AACd,MAAI,CAAC,OACH,qBAAoB,EAAE,EAAE,oEAAoE;AAE9F,MAAI,CAAC,SACH,qBAAoB,EAAE,EAAE,qEAAqE;IAE9F,EAAE,CAAC;AACN,KAAI,CAAC,UAAU,CAAC,SAAU,QAAO;AAEjC,QACE,oCAAC;EACS;EACE;EACV,WAAW,cAAc,OAAO;EAChC,YAAY,cAAc;EACb;EACb;GACA;;AAIN,4BAAe"}
|