udp-react-enterprise-component-library 25.1.0-beta.4 → 25.1.0-beta.9
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-BLwgiqwK.js → AmbientGridTemplate-BqlMt5Su.js} +152 -137
- package/dist/AmbientGridTemplate-BqlMt5Su.js.map +1 -0
- package/dist/{EnvironmentRibbon-BMvQEZPZ.js → EnvironmentRibbon-DaDmKAPO.js} +2 -2
- package/dist/{EnvironmentRibbon-BMvQEZPZ.js.map → EnvironmentRibbon-DaDmKAPO.js.map} +1 -1
- package/dist/{MenuPage-DLsNc-P8.js → MenuPage-CO6_GWwB.js} +97 -27
- package/dist/MenuPage-CO6_GWwB.js.map +1 -0
- package/dist/{MyExportsPage-BYH2Wl9k.js → MyExportsPage-CX9tzqHk.js} +5 -5
- package/dist/{MyExportsPage-BYH2Wl9k.js.map → MyExportsPage-CX9tzqHk.js.map} +1 -1
- package/dist/MyExportsPage-CkzQ0MRq.js +8 -0
- package/dist/{PageContainer-B65gsUfF.js → PageContainer-k8KCfGsM.js} +2 -2
- package/dist/{PageContainer-B65gsUfF.js.map → PageContainer-k8KCfGsM.js.map} +1 -1
- package/dist/{SearchUtilities-dbXvMYoa.js → SearchUtilities-Bor3HbfB.js} +2 -2
- package/dist/{SearchUtilities-dbXvMYoa.js.map → SearchUtilities-Bor3HbfB.js.map} +1 -1
- package/dist/{SideSheet-CPHhyWLB.js → SideSheet-DUsxG1FN.js} +3 -3
- package/dist/{SideSheet-CPHhyWLB.js.map → SideSheet-DUsxG1FN.js.map} +1 -1
- package/dist/{UdpPublicForm-DFCL1GzD.js → UdpPublicForm-Caa1tH6z.js} +2 -2
- package/dist/{UdpPublicForm-DFCL1GzD.js.map → UdpPublicForm-Caa1tH6z.js.map} +1 -1
- package/dist/UdpPublicForm-Cvw5tOHe.js +4 -0
- package/dist/{UtilitySideBar-B4r2IAv5.js → UtilitySideBar-D4CXGtW2.js} +12 -9
- package/dist/UtilitySideBar-D4CXGtW2.js.map +1 -0
- package/dist/{VirtualBrowser-C_IJ0I6f.js → VirtualBrowser-BXL0hdy0.js} +7 -7
- package/dist/{VirtualBrowser-C_IJ0I6f.js.map → VirtualBrowser-BXL0hdy0.js.map} +1 -1
- package/dist/{WorkflowContainer-DKwRWi1i.js → WorkflowContainer-DrqzuQtU.js} +35 -7
- package/dist/WorkflowContainer-DrqzuQtU.js.map +1 -0
- package/dist/WorkflowContainer-Q8gtuaB7.js +9 -0
- package/dist/{apiHelpers-t3rfkjFZ.js → apiHelpers-DZots3og.js} +2 -2
- package/dist/apiHelpers-DZots3og.js.map +1 -0
- package/dist/index.js +2718 -2466
- package/dist/index.js.map +1 -1
- package/dist/{propertyTypeEnums-DTGsK5-s.js → propertyTypeEnums-Civy7RJv.js} +2 -2
- package/dist/{propertyTypeEnums-DTGsK5-s.js.map → propertyTypeEnums-Civy7RJv.js.map} +1 -1
- package/dist/types/AGLicense.d.ts +1 -1
- package/dist/types/UI/maps/UdpMap.d.ts +2 -0
- package/dist/types/UI/maps/UdpMapComponent.d.ts +2 -0
- package/dist/types/UI/utilityDisplay/ChipSection.d.ts +2 -1
- package/dist/types/UI/utilityDisplay/GridPrimaryBar.d.ts +2 -1
- package/dist/types/hooks/usePromotedMethodEntities.d.ts +6 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/shell/ui/ShellDropdown.d.ts +15 -0
- package/dist/types/shell/ui/SiteHeader.d.ts +1 -0
- package/dist/types/stores/catalogStore.d.ts +2 -0
- package/dist/types/stores/inquiryStore.d.ts +3 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/types/utilities/catalog/CatalogUtilities.d.ts +1 -0
- package/dist/types/utilities/tree/TreeUtilities.d.ts +1 -1
- package/package.json +2 -2
- package/dist/AmbientGridTemplate-BLwgiqwK.js.map +0 -1
- package/dist/MenuPage-DLsNc-P8.js.map +0 -1
- package/dist/MyExportsPage-CVUIXWTf.js +0 -8
- package/dist/UdpPublicForm-BrVSSMCN.js +0 -4
- package/dist/UtilitySideBar-B4r2IAv5.js.map +0 -1
- package/dist/WorkflowContainer-8-mmebY0.js +0 -9
- package/dist/WorkflowContainer-DKwRWi1i.js.map +0 -1
- package/dist/apiHelpers-t3rfkjFZ.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchUtilities-dbXvMYoa.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,OAClB;CACH,MAAMC,eAAuB;EAC3B,YAAY,QAAQ;EACpB,UAAU,YAAY;EACtB,gBAAgB;EAChB,cAAc;EACd,eAAe;EACf,cAAc;EACd,eAAe;EACf,oBAAoB;EACT;EACY;;AAGzB,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;;AAE1B,gBAAa,cAAc,KAAK;;AAElC,MAAI,cAAc,YAAY,SAAS,UAAU;AAC/C,gBAAa,eAAe,mBAAmB;AAC/C,gBAAa,eAAe,KAAK;;;AAKvC,cAAa,eAAe;AAE5B,QAAO;;AAET,MAAaC,wBACX,eACA,SACG;CACH,MAAM,iBAAiB,cAAc,MAAM,WACzC,KAAK,SAAS,OAAO;AAEvB,QAAQ,gBAAgB,eAAe;;AAGzC,MAAaC,wBAA0F,gBAA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B,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;MACzD,IAAI,6BAA6B,KAAK,IAAI,QAAQ,UAChD,GACA;MAEF,IAAI,YAAY,2BAA2B,MAAM;MACjD,IAAI,OAAO,IAAI,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-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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BAA2B,MAAM;MACjD,IAAI,OAAO,IAAI,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,5 +1,5 @@
|
|
|
1
|
-
import { FluentButton, FluentIcon, FluentIconButton, StandardTitle, axiosInterceptors_default, useUser } from "./EnvironmentRibbon-
|
|
2
|
-
import { getAccessToken, getMergedConfig, handleResponseErrors } from "./apiHelpers-
|
|
1
|
+
import { FluentButton, FluentIcon, FluentIconButton, StandardTitle, axiosInterceptors_default, useUser } from "./EnvironmentRibbon-DaDmKAPO.js";
|
|
2
|
+
import { getAccessToken, getMergedConfig, handleResponseErrors } from "./apiHelpers-DZots3og.js";
|
|
3
3
|
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo } from "react";
|
|
4
4
|
import { CardContent, CircularProgress, Drawer, LinearProgress, makeStyles } from "@material-ui/core";
|
|
5
5
|
import { Field, Form } from "react-final-form";
|
|
@@ -326,4 +326,4 @@ SideSheet.defaultProps = {
|
|
|
326
326
|
|
|
327
327
|
//#endregion
|
|
328
328
|
export { BaseSideSheet, Field$1 as Field, Form$1 as Form, SideSheet, SideSheetHeader, apiMutate, createDecorator_default, useAxiosMutate };
|
|
329
|
-
//# sourceMappingURL=SideSheet-
|
|
329
|
+
//# sourceMappingURL=SideSheet-DUsxG1FN.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideSheet-CPHhyWLB.js","names":["isFocusableInput","getAllInputs","findInput","createDecorator","FinalForm","Form: React.FC<FormProps>","Field: FieldComponent","value","FinalField","name","enableAxiosInterceptors","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/utilities/useAxiosMutate.js","../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 { useEffect, useMemo } from 'react';\nimport useAxios from 'axios-hooks';\nimport Axios from 'axios';\nimport {\n handleResponseErrors,\n getMergedConfig,\n getAccessToken\n} from './apiHelpers';\nimport enableAxiosInterceptors from './axiosInterceptors';\nimport { useUser } from './auth/useUser';\n\nenableAxiosInterceptors();\n\nexport const useAxiosMutate = (baseURL, url, config) => {\n\n const fullURL = { url: `${baseURL}/${url}` };\n const user = useUser()\n\n const headers = useMemo(() => {\n const currentHeaders = config.headers ?? {}\n currentHeaders.currentTenantId ||= user?.currentTenantId ?? ''\n return currentHeaders\n }, [user, config])\n config.headers = headers\n\n const [{ data, loading, error }, execute] = useAxios(\n { ...fullURL, ...config },\n { manual: true }\n );\n\n useEffect(() => {\n handleResponseErrors(error);\n }, [error]);\n\n return [{ data, loading, error }, execute];\n};\n\nexport const apiMutate = async (baseURL, url, config, data) => {\n const fullURL = { url: `${baseURL}/${url}` };\n const accessToken = await getAccessToken();\n const mergedConfig = getMergedConfig(accessToken, config);\n return Axios({ ...fullURL, ...mergedConfig, ...data });\n};\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;AAET,QAAO,MAAM,UAAU,MACpB,KAAK,SAAS,OACd,QACE,aAAa,SACZ,YAAY,OACV,MAAM,UAAU,MAAM,KAAK,MAAM,OAAOA,4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,YACjB,oCAAC;EACK;EACS;EACJ;EACF;EACM;EACH;EACM;EACD;EACE;EACE;EACnB,UAAU;EACS;EACA;EACnB,GAAI;KAEL,YACC,oCAAC;EACU;EACT,OAAO;EACP,OAAO;KAGX,oCAAC,eAAY,SAAS,EAAE,MAAM,QAAQ,eACnC;;AAMT,UAAU,YAAY;CAIpB,UAAU,UAAU,UAAU,CAC5B,UAAU,QAAQ,UAAU,OAC5B,UAAU;CAKZ,OAAO,UAAU,OAAO;CAIxB,SAAS,UAAU;CAInB,MAAM,UAAU;CAIhB,UAAU,UAAU;CAIpB,eAAe,UAAU;CAIzB,OAAO,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU;CAIxD,QAAQ,UAAU;CAIlB,aAAa,UAAU;CAIvB,WAAW,UAAU;CAIrB,eAAe,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU;;AAGlE,UAAU,eAAe;CACvB,QAAQ;CACR,eAAe"}
|
|
1
|
+
{"version":3,"file":"SideSheet-DUsxG1FN.js","names":["isFocusableInput","getAllInputs","findInput","createDecorator","FinalForm","Form: React.FC<FormProps>","Field: FieldComponent","value","FinalField","name","enableAxiosInterceptors","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/utilities/useAxiosMutate.js","../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 { useEffect, useMemo } from 'react';\nimport useAxios from 'axios-hooks';\nimport Axios from 'axios';\nimport {\n handleResponseErrors,\n getMergedConfig,\n getAccessToken\n} from './apiHelpers';\nimport enableAxiosInterceptors from './axiosInterceptors';\nimport { useUser } from './auth/useUser';\n\nenableAxiosInterceptors();\n\nexport const useAxiosMutate = (baseURL, url, config) => {\n\n const fullURL = { url: `${baseURL}/${url}` };\n const user = useUser()\n\n const headers = useMemo(() => {\n const currentHeaders = config.headers ?? {}\n currentHeaders.currentTenantId ||= user?.currentTenantId ?? ''\n return currentHeaders\n }, [user, config])\n config.headers = headers\n\n const [{ data, loading, error }, execute] = useAxios(\n { ...fullURL, ...config },\n { manual: true }\n );\n\n useEffect(() => {\n handleResponseErrors(error);\n }, [error]);\n\n return [{ data, loading, error }, execute];\n};\n\nexport const apiMutate = async (baseURL, url, config, data) => {\n const fullURL = { url: `${baseURL}/${url}` };\n const accessToken = await getAccessToken();\n const mergedConfig = getMergedConfig(accessToken, config);\n return Axios({ ...fullURL, ...mergedConfig, ...data });\n};\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;AAET,QAAO,MAAM,UAAU,MACpB,KAAK,SAAS,OACd,QACE,aAAa,SACZ,YAAY,OACV,MAAM,UAAU,MAAM,KAAK,MAAM,OAAOA,4BAE5C;;AAIN,2BAAe;;;;ACff,MAAM,aAAa,QAAQ,WACzB,OAAO,MAAK,UAAS,MAAM,QAAQ,MAAM,QAAQ,MAAM;AAEzD,wBAAe;;;;ACFf,MAAM,aAAa;;;;AAKnB,MAAM,yBAAyB,SAAS;CACtC,MAAM,sBAAsB,WAAW;EACrC,MAAM,YAAYC;EAClB,MAAM,aAAaC,kBAAU,WAAW;EACxC,MAAM,kBAAkB,YAAY;AACpC,MAAI,gBACF,iBAAgB,eAAe,EAAE,UAAU;;CAI/C,MAAM,iBAAiB,KAAK;CAC5B,IAAI,QAAQ;CACZ,MAAM,cAAc,KAAK,WACtB,cAAc;AACb,UAAQ;IAEV;EAAE,QAAQ;EAAM,cAAc;;CAGhC,MAAM,oBAAoB;EACxB,MAAM,EAAE,QAAQ,iBAAiB;AACjC,MAAI,UAAU,OAAO,KAAK,QA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AGlE,UAAU,eAAe;CACvB,QAAQ;CACR,eAAe"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useHandleAxiosSnackbar } from "./apiHelpers-
|
|
1
|
+
import { useHandleAxiosSnackbar } from "./apiHelpers-DZots3og.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-Caa1tH6z.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UdpPublicForm-
|
|
1
|
+
{"version":3,"file":"UdpPublicForm-Caa1tH6z.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,cAAc;AAI7B,QAAO,IAAI,gBAAgB,UAAU,OAAO,SAAS;;AAEvD,MAAa,iBAAiB,UAAU;CACtC,MAAM,EAAE,wBAAwB;CAChC,MAAM,cAAc;CAEpB,MAAM,SAAS,YAAY,IAAI;CAC/B,MAAM,WAAW,YAAY,IAAI;CACjC,MAAM,cAAc,YAAY,IAAI;AAEpC,iBAAgB;AACd,MAAI,CAAC,OACH,qBAAoB,IAAI;AAE1B,MAAI,CAAC,SACH,qBAAoB,IAAI;IAEzB;AACH,KAAI,CAAC,UAAU,CAAC,SAAU,QAAO;AAEjC,QACE,oCAAC;EACS;EACE;EACV,WAAW,cAAc,OAAO;EAChC,YAAY,cAAc;EACb;EACb;;;AAKN,4BAAe"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { APP_RIBBON_SPACE, CardinalityTypeEnums, FluentButton, FluentIconButton, LayoutUnit, NodeGroupOutlierEnums, NodeGroupTypeEnums, SeverityTypeEnums, StatusChip, executeQueryInstance, getEllipseColor, toLowerFirstChar, toUpperFirstChar, useAxiosGet, useBuildEnvironment } from "./EnvironmentRibbon-
|
|
2
|
-
import { getSearchIdentifiers, getSearchObject } from "./SearchUtilities-
|
|
1
|
+
import { APP_RIBBON_SPACE, CardinalityTypeEnums, FluentButton, FluentIconButton, LayoutUnit, NodeGroupOutlierEnums, NodeGroupTypeEnums, SeverityTypeEnums, StatusChip, executeQueryInstance, getEllipseColor, toLowerFirstChar, toUpperFirstChar, useAxiosGet, useBuildEnvironment } from "./EnvironmentRibbon-DaDmKAPO.js";
|
|
2
|
+
import { getSearchIdentifiers, getSearchObject } from "./SearchUtilities-Bor3HbfB.js";
|
|
3
3
|
import React, { memo, useCallback, useEffect, useMemo, useState } from "react";
|
|
4
4
|
import { Button, ButtonBase, CardContent, CardMedia, CircularProgress, Collapse, Paper, Typography, lighten, makeStyles, useTheme } from "@material-ui/core";
|
|
5
5
|
import { ConfigService } from "udp-react-stencil-component-library";
|
|
@@ -763,6 +763,7 @@ const updateNodeForStaticGrouping = (displayTree, nodeGroup, nodeChildren, treeL
|
|
|
763
763
|
updatedDisplayTree.children = displayTree.children ? cloneDeep(displayTree.children) : displayTree.children;
|
|
764
764
|
updatedDisplayTree["parentId"] = nodeGroup.id;
|
|
765
765
|
updatedDisplayTree["parentGroupId"] = nodeGroup.id;
|
|
766
|
+
updatedDisplayTree["parentGroupName"] = nodeGroup.properties.label;
|
|
766
767
|
if (updatedDisplayTree.isGroupNode) nodeGroup.children.push(updatedDisplayTree);
|
|
767
768
|
else nodeChildren.push(updatedDisplayTree);
|
|
768
769
|
if (treeList) treeList.push(updatedDisplayTree);
|
|
@@ -896,7 +897,7 @@ const constructDynamicNodeGroups = (results, tree, shouldUseNewId = false) => {
|
|
|
896
897
|
const nodeIsHidden = checkNodeIsHidden(updatedDisplayTree, item, false);
|
|
897
898
|
!nodeIsHidden && processItemForDynamicNodeGroups(updatedDisplayTree, dynamicTreeStructure, groupSet, groupSet, isSingleGroup);
|
|
898
899
|
});
|
|
899
|
-
groupSet.forEach((group) => updateTreeIds(group, null, v4(), v4()));
|
|
900
|
+
groupSet.forEach((group) => updateTreeIds(group, null, v4(), v4(), null));
|
|
900
901
|
nodeGroups = nodeGroups.concat(groupSet);
|
|
901
902
|
}
|
|
902
903
|
});
|
|
@@ -981,7 +982,7 @@ const processItemForDynamicNodeGroups = (displayTree, node, groupNodes, previous
|
|
|
981
982
|
const orderByGroupOrder = (groups = []) => {
|
|
982
983
|
return orderBy(groups, ["order"], ["asc"]);
|
|
983
984
|
};
|
|
984
|
-
const updateTreeIds = (node, lastEntityNodeId, newId = v4(), newParentId = v4()) => {
|
|
985
|
+
const updateTreeIds = (node, lastEntityNodeId, newId = v4(), newParentId = v4(), parentGroupName = null) => {
|
|
985
986
|
let entityNodeParentId = lastEntityNodeId;
|
|
986
987
|
if (node) {
|
|
987
988
|
node.id = newId;
|
|
@@ -989,10 +990,11 @@ const updateTreeIds = (node, lastEntityNodeId, newId = v4(), newParentId = v4())
|
|
|
989
990
|
node.parentId = newParentId;
|
|
990
991
|
node.parentGroupId = newParentId;
|
|
991
992
|
}
|
|
993
|
+
if (parentGroupName) node["parentGroupName"] = parentGroupName;
|
|
992
994
|
if (!node.isGroupNode && entityNodeParentId) node["entityNodeParentId"] = entityNodeParentId;
|
|
993
995
|
if (!node.isGroupNode) entityNodeParentId = node.id;
|
|
994
996
|
}
|
|
995
|
-
if (node?.children?.length) node.children.forEach((child) => updateTreeIds(child, entityNodeParentId, v4(), newId));
|
|
997
|
+
if (node?.children?.length) node.children.forEach((child) => updateTreeIds(child, entityNodeParentId, v4(), newId, parentGroupName));
|
|
996
998
|
};
|
|
997
999
|
const processGroupNodesAndAddToTreeList = (node, treeList, lastEntityNodeId, item, wasLazyLoaded) => {
|
|
998
1000
|
let entityNodeParentId = lastEntityNodeId;
|
|
@@ -1049,7 +1051,7 @@ const constructPreloadedTree = (treeStructure, pageList) => {
|
|
|
1049
1051
|
});
|
|
1050
1052
|
const updatedNodeGroup = mapNodeGroupChildren(nodeGroup, nodeGroupChildren);
|
|
1051
1053
|
updatedNodeGroup.children.forEach((child) => {
|
|
1052
|
-
updateTreeIds(child, null, v4(), v4());
|
|
1054
|
+
updateTreeIds(child, null, v4(), updatedNodeGroup.id || v4(), updatedNodeGroup?.properties.label || null);
|
|
1053
1055
|
});
|
|
1054
1056
|
preloadedList.push(updatedNodeGroup);
|
|
1055
1057
|
});
|
|
@@ -1064,7 +1066,7 @@ const constructPreloadedTree = (treeStructure, pageList) => {
|
|
|
1064
1066
|
const displayTree = makeTreeStructure(treeArr, "id", "parentId");
|
|
1065
1067
|
const nodeIsHidden = checkNodeIsHidden(displayTree, item, false);
|
|
1066
1068
|
if (!nodeIsHidden) {
|
|
1067
|
-
updateTreeIds(displayTree, null, v4(), v4());
|
|
1069
|
+
updateTreeIds(displayTree, null, v4(), v4(), null);
|
|
1068
1070
|
preloadedList.push(displayTree);
|
|
1069
1071
|
}
|
|
1070
1072
|
}
|
|
@@ -1494,7 +1496,8 @@ const AmbientCard = (props) => {
|
|
|
1494
1496
|
const [expanded, setExpanded] = useState(false);
|
|
1495
1497
|
const { adornment = "secondary", ariaLabel, baseLoading, cardHeight, children, collapseChildrenWhenExpanded, customAdornment = " ", deleteEvent, deleteOption, editEvent, editOption, extendedContent, extendedList, fullWidth, globalToggle, header, image, imageTitle, label, large, launchEvent, launchOption, loading, mediaHeight, more, moreMessage, moreButton, moreButtonExpanded, noAdornment = false, overrideStatusSuccess, overrideStatusError, overrideStatusWarning, overrideStatusInfo, removeTopLayoutUnit, status, subCard, title, toggleGlobalExpanded = true, visualization, subtitle,...otherProps } = props;
|
|
1496
1498
|
const [globalExpanded, setGlobalExpanded] = useState(toggleGlobalExpanded);
|
|
1497
|
-
|
|
1499
|
+
if (baseLoading) return null;
|
|
1500
|
+
return /* @__PURE__ */ React.createElement(Paper, {
|
|
1498
1501
|
elevation: 0,
|
|
1499
1502
|
className: classes.paper
|
|
1500
1503
|
}, !noAdornment && /* @__PURE__ */ React.createElement("div", { className: classes.adornment }, customAdornment ? customAdornment : /* @__PURE__ */ React.createElement(Adornment, { color: adornment })), title && /* @__PURE__ */ React.createElement(CardContent, {
|
|
@@ -2017,4 +2020,4 @@ const UtilitySideBar = (props) => {
|
|
|
2017
2020
|
|
|
2018
2021
|
//#endregion
|
|
2019
2022
|
export { Adornment, AggregateChip, AlertPill, AmbientCard, AmbientCardButton, GroupNode, NodeLoader, SidebarCollapseButton, UtilityBarInport, UtilityBarInportTarget, UtilitySideBar, checkNodeIsHidden, collapseAllNodes, constructBusinessObjectArrFromTree, constructDynamicNodeGroups, constructDynamicNodeGroups2, constructPreloadedTree, constructStaticNodeGroups, deleteNode, deleteNodeAndChildren, evaluateRule, expandAllNodes, findAllParentIds, findLastNode, findNodeById, findNodeByIdAndLabel, findNodesByIdAndLabel, formatTreeLabel, formatTreeMenuItem, getAllChildrenNodesToDelete, getDisplayDetails, getDisplayName, getHeaderTitle, getIconFromName, getLazyLoadChildrenArr, getNodeIdForRightBorder, getOrderedDynamicGroups, getPropertyMappingList, getPropertyMappingObj, getSearchValueString, getUnityIconFromName, makeDynamicGroupStructures, makeDynamicTreeStructure, makeTreeStaticGroupStructure, makeTreeStructure, mapNodeGroupChildren, mapNodeObjValuesToSearchParameters, mapRule, mapRuleData, processCatalogObjectKeysInOrder, processItemForDynamicNodeGroups, processItemForStaticNodeGroup, processObjIndex, processObjectToTree, processOrderedTreeData, processReferences, searchForMatchingNode, searchTree, transformMenuPageTree, unityIcons, updateTreeIds };
|
|
2020
|
-
//# sourceMappingURL=UtilitySideBar-
|
|
2023
|
+
//# sourceMappingURL=UtilitySideBar-D4CXGtW2.js.map
|