@pega/lists-core 10.0.0-build.4.2 → 10.0.0-build.4.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/src/core/RsStore.d.ts +10 -0
- package/lib/src/core/RsStore.d.ts.map +1 -1
- package/lib/src/core/RsStore.js +2 -0
- package/lib/src/core/RsStore.js.map +1 -1
- package/lib/src/core/StateResolver.js +1 -1
- package/lib/src/core/StateResolver.js.map +1 -1
- package/lib/src/core/actions/actions.d.ts +1 -1
- package/lib/src/core/actions/actions.d.ts.map +1 -1
- package/lib/src/core/actions/actions.js +3 -3
- package/lib/src/core/actions/actions.js.map +1 -1
- package/lib/src/core/actions/actions.types.d.ts +1 -1
- package/lib/src/core/actions/actions.types.d.ts.map +1 -1
- package/lib/src/core/constants.d.ts +1 -0
- package/lib/src/core/constants.d.ts.map +1 -1
- package/lib/src/core/constants.js +1 -0
- package/lib/src/core/constants.js.map +1 -1
- package/lib/src/core/features/uIFeatures/afterRender/animation.d.ts +1 -1
- package/lib/src/core/features/uIFeatures/afterRender/animation.js +2 -2
- package/lib/src/core/features/uIFeatures/afterRender/animation.js.map +1 -1
- package/lib/src/core/features/uIFeatures/afterRender/columnSizing/index.d.ts +2 -2
- package/lib/src/core/features/uIFeatures/afterRender/columnSizing/index.d.ts.map +1 -1
- package/lib/src/core/features/uIFeatures/afterRender/columnSizing/index.js +5 -5
- package/lib/src/core/features/uIFeatures/afterRender/columnSizing/index.js.map +1 -1
- package/lib/src/core/features/uIFeatures/afterRender/customizeParentContainer/index.d.ts +1 -1
- package/lib/src/core/features/uIFeatures/afterRender/customizeParentContainer/index.js +1 -1
- package/lib/src/core/features/uIFeatures/afterRender/customizeParentContainer/index.js.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/columnSizing/resize.js +2 -2
- package/lib/src/core/features/uIFeatures/beforeRender/columnSizing/resize.js.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/customColumn.d.ts.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/customColumn.js +2 -1
- package/lib/src/core/features/uIFeatures/beforeRender/customColumn.js.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/grouping.d.ts +5 -0
- package/lib/src/core/features/uIFeatures/beforeRender/grouping.d.ts.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/grouping.js +195 -23
- package/lib/src/core/features/uIFeatures/beforeRender/grouping.js.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/stateHydration.d.ts.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/stateHydration.js +9 -2
- package/lib/src/core/features/uIFeatures/beforeRender/stateHydration.js.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/stateSanitization.d.ts.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/stateSanitization.js +21 -15
- package/lib/src/core/features/uIFeatures/beforeRender/stateSanitization.js.map +1 -1
- package/lib/src/core/features/uIFeatures/index.d.ts.map +1 -1
- package/lib/src/core/generators/ViewGenerator.d.ts.map +1 -1
- package/lib/src/core/generators/ViewGenerator.js +4 -3
- package/lib/src/core/generators/ViewGenerator.js.map +1 -1
- package/lib/src/core/generators/ViewGenerator.types.d.ts +2 -0
- package/lib/src/core/generators/ViewGenerator.types.d.ts.map +1 -1
- package/lib/src/core/generators/ViewGenerator.types.js.map +1 -1
- package/lib/src/core/reducers/error.d.ts.map +1 -1
- package/lib/src/core/reducers/index.d.ts.map +1 -1
- package/lib/src/core/reducers/personalizationDirtyReducer.d.ts.map +1 -1
- package/lib/src/core/reducers/personalizationDirtyReducer.js +18 -3
- package/lib/src/core/reducers/personalizationDirtyReducer.js.map +1 -1
- package/lib/src/core/reducers/personalizationReducer.d.ts +1 -1
- package/lib/src/core/reducers/visibility.d.ts.map +1 -1
- package/lib/src/core/reducers/visibility.js +5 -3
- package/lib/src/core/reducers/visibility.js.map +1 -1
- package/lib/src/core/utils/util.d.ts +22 -5
- package/lib/src/core/utils/util.d.ts.map +1 -1
- package/lib/src/core/utils/util.js +75 -18
- package/lib/src/core/utils/util.js.map +1 -1
- package/lib/types/ApiContext.types.d.ts +8 -4
- package/lib/types/ApiContext.types.d.ts.map +1 -1
- package/lib/types/ApiContext.types.js +2 -1
- package/lib/types/ApiContext.types.js.map +1 -1
- package/lib/types/Meta.types.d.ts +123 -64
- package/lib/types/Meta.types.d.ts.map +1 -1
- package/lib/types/Meta.types.js +2 -1
- package/lib/types/Meta.types.js.map +1 -1
- package/lib/types/RsCoreBootArgs.types.d.ts +1 -1
- package/lib/types/RsCoreBootArgs.types.js.map +1 -1
- package/lib/types/State.types.d.ts +2 -1
- package/lib/types/State.types.d.ts.map +1 -1
- package/lib/types/State.types.js.map +1 -1
- package/lib/types.d.ts +2 -1
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewGenerator.types.d.ts","sourceRoot":"","sources":["../../../../src/core/generators/ViewGenerator.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAEtE,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAGxC,MAAM,MAAM,UAAU,GAAG,OAAO,CAC9B,IAAI,CACF,IAAI,EACF,MAAM,GACN,SAAS,GACT,MAAM,GACN,cAAc,GACd,cAAc,GACd,gBAAgB,GAChB,WAAW,GACX,gBAAgB,GAChB,sBAAsB,GACtB,YAAY,GACZ,eAAe,GACf,WAAW,GACX,gBAAgB,GAChB,iBAAiB,GACjB,WAAW,GACX,YAAY,GACZ,OAAO,GACP,cAAc,GACd,cAAc,GACd,aAAa,GACb,oBAAoB,GACpB,WAAW,GACX,aAAa,GACb,0BAA0B,GAC1B,2BAA2B,GAC3B,mBAAmB,GACnB,uBAAuB,GACvB,0BAA0B,GAC1B,iBAAiB,GACjB,YAAY,GACZ,qBAAqB,GACrB,eAAe,GACf,oBAAoB,GACpB,iBAAiB,GACjB,UAAU,CACb,CACF,GACC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG;IAAE,qBAAqB,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAC1D,MAAM,MAAM,WAAW,GAAG;IACxB,yCAAyC;IACzC,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5B,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9B,+CAA+C;IAC/C,UAAU,EAAE,MAAM,IAAI,CAAC,SAAS,CAAC,CAAC;IAClC,uFAAuF;IACvF,2BAA2B,EAAE,IAAI,CAAC,6BAA6B,CAAC,CAAC;IACjE,yEAAyE;IACzE,oBAAoB,EAAE,IAAI,CAAC,sBAAsB,CAAC,CAAC;IACnD,yDAAyD;IACzD,YAAY,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IACnC,6DAA6D;IAC7D,cAAc,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACvC,uDAAuD;IACvD,cAAc,EAAE,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC;IAC1C,2DAA2D;IAC3D,aAAa,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;IACrC,mEAAmE;IACnE,iBAAiB,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"ViewGenerator.types.d.ts","sourceRoot":"","sources":["../../../../src/core/generators/ViewGenerator.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC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AG,eAAe,CAAC;CAChC;AAED,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,MAAM,UAAU,CAAC,CAAC;AAE7D,MAAM,WAAW,mBAAmB;IAClC,kFAAkF;IAClF,EAAE,EAAE,MAAM,CAAC;IACX,qEAAqE;IACrE,OAAO,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,kBAAkB,EAAE,MAAM,CAAC;CAC5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewGenerator.types.js","sourceRoot":"","sources":["../../../../src/core/generators/ViewGenerator.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { OmitStrict } from '@pega/cosmos-react-core';\n\nimport type { State } from '../../../types/State.types';\nimport type { FieldDef } from '../../../types/Meta.types';\nimport type { Formatters } from '../../../types/RsCoreBootArgs.types';\n\nimport type View from './ViewGenerator';\n\n// @ts-check findout which are the mandatory properties in View options.\nexport type ViewConfig = Partial<\n Pick<\n View,\n | 'data'\n | 'columns'\n | 'rows'\n | 'groupHeaders'\n | 'resultsCount'\n | 'hasMoreResults'\n | 'showCount'\n | 'totalItemCount'\n | 'selectedRecordsCount'\n | 'bodyHeight'\n | 'bodyMaxHeight'\n | 'rowHeight'\n | 'rowHeightClass'\n | 'isFilterApplied'\n | 'isLoading'\n | 'freezeLine'\n | 'state'\n | 'domContainer'\n | 'scrollerNode'\n | 'itemElement'\n | 'virtualizeElements'\n | 'debugInfo'\n | 'requiredDef'\n | 'hierarchicalGroupEnabled'\n | 'confirmationActionDetails'\n | 'externalStateKeys'\n | 'isCountUpdateRequired'\n | 'countGeneratedInternally'\n | 'isInstantRender'\n | 'viewHeight'\n | 'refreshNotification'\n | 'announceCount'\n | 'enableGlobalSearch'\n | 'warningMessages'\n | 'template'\n >\n> &\n Pick<View, 'meta'> & { singleSelectionRowKey?: string };\nexport type ViewContext = {\n /** Returns the {@link View.meta meta} */\n getMeta: () => View['meta'];\n /** Returns the {@link View.state state} */\n getState: () => View['state'];\n /** Returns the {@link View.columns columns} */\n getColumns: () => View['columns'];\n /** Returns the {@link View.getRenderingEnginePropsById getRenderingEnginePropsById} */\n getRenderingEnginePropsById: View['getRenderingEnginePropsById'];\n /** Returns the {@link View.selectedRecordsCount selectedRecordsCount} */\n selectedRecordsCount: View['selectedRecordsCount'];\n /** Returns the {@link View.resultsCount resultsCount} */\n resultsCount: View['resultsCount'];\n /** Returns the {@link View.hasMoreResults hasMoreResults} */\n hasMoreResults: View['hasMoreResults'];\n /** Returns the {@link View.requiredDef requiredDef} */\n getRequiredDef: () => View['requiredDef'];\n /** Returns the {@link View.getRowDensity getRowDensity} */\n getRowDensity: View['getRowDensity'];\n /** Returns the {@link View.getVisibleColumns getVisibleColumns} */\n getVisibleColumns: View['getVisibleColumns'];\n};\n\n/** Interface exposed for confirmation dialogue */\nexport interface ConfirmationActionDetails {\n /** Labels for the confirmation dialogue */\n labels: {\n /** Header of the confirmation dialogue pop up */\n heading: string;\n\n /** Description of the confirmation dialogue pop up */\n description: string;\n\n /** Label of the submit button inside confirmation dialogue pop up */\n submitButtonLabel: string;\n\n /** Label of the cancel button inside confirmation dialogue pop up */\n cancelButtonLabel: string;\n };\n\n /** Boolean to toggle the show/visibility */\n showConfirmationAction: boolean;\n\n /** Function to be executed upon submission of the concerned modal */\n onSubmit: (value?: any) => void;\n\n /** Function to be executed upon cancellation of the concerned modal */\n onCancel: (reason?: any) => void;\n}\n\n/** Interface for displaying API stats on the view */\nexport interface DebugInfo {\n /** Class name of the data page */\n className: string;\n\n /** Name of the data page */\n dataPage: string;\n\n /** Source of the data page */\n dataSource?: string;\n\n /** Unique identifier for the insight */\n insightId?: string;\n\n /** Time taken by the API */\n timeTaken?: string;\n}\n\n/** Style interface for freezeline */\nexport interface FreezeLine {\n styles: {\n left: string;\n };\n}\n\n/** An interface used for group headers, consisting of grouping and hierarchical grouping properties */\nexport interface GroupHeader {\n /** Applied aggregation to be displayed in group header */\n aggregation: { [key: FieldDef['name']]: { [key: string]: number } };\n\n /** Count to be displayed in group header */\n count: number;\n\n /** Data */\n data: object;\n\n /** End index of the rows in a particular group */\n endIndex: number;\n\n /** group-key: Computed using getGroupKey utility */\n groupBy: string;\n\n /** String array denoting hierarchy */\n hierarchy: string[];\n\n /** Hierarchical grouping info object */\n info: object;\n\n /** Indicates expanded state */\n isExpanded: boolean;\n\n /** Indicates if its hierarchical grouping */\n isHierarchical: boolean;\n\n /** Indicates if it is a leaf node. */\n isLeafNode: boolean;\n\n /** Indicates visibility */\n isVisible: boolean;\n\n /** Label of the group header to be displayed on UI */\n label: string;\n\n /** Level denoting the nesting level of a group header */\n level: number;\n\n /** Name attribute on a group header */\n name: string;\n\n /** Boolean to toggle displaying the hierarchical footer */\n showHierarchicalFooter: boolean;\n\n /** End index of the rows in a particular group */\n startIndex: number;\n}\n\nexport interface RequiredDefinition {\n required: boolean;\n validatemessage: string;\n}\n\n/**\n * Warning detail structure from DX API responses.\n * Contains message information that can be localized and displayed to users.\n */\nexport interface WarningDetail {\n /** Localized Message */\n message?: string;\n}\n\n/** UI props to be set on the view for A11Y purpose */\nexport interface UIProps {\n /** This attribute conveys the number of columns in the repeating structures to screen readers. */\n 'aria-colcount': number;\n\n /** This attribute conveys the label of the repeating structures to screen readers. */\n 'aria-label': string;\n\n /** This attribute conveys the number of rows in the repeating structures to screen readers. */\n 'aria-rowcount': number;\n\n /** HTML role attribute for the view.\n * @default 'grid'\n */\n role: string;\n}\n\nexport type ViewState = OmitStrict<\n State,\n | 'groupFilters'\n | 'forceUpdateFeatures'\n | 'template'\n | 'presetId'\n | 'version'\n | 'renderFormatter'\n | 'hierarchicalGroup'\n> & { searchText?: string };\n\n/** Personalization information object */\ninterface PersonalizationInfo {\n /** Coordinates of current row index. */\n existingItemBoundingBox: DOMRect;\n\n /** Common visible item in view before and after paint (previous and next paint) */\n currentRowIndex: number;\n\n /** Possible index on view top */\n topRowIndex: number;\n\n /** Buffer coordinates while pagination. */\n bufferOldCords: DOMRect;\n\n /** Buffer coordinates while pagination is in progress and user scroll. */\n bufferNewCords: DOMRect;\n\n /** View object containing start index and end index */\n view: {\n startIndex: number;\n endIndex: number;\n };\n}\n\n/** Interface structure for virtualizer instance */\ninterface VirtualizeInstance {\n /** DOM element for body container */\n bContainer: HTMLElement;\n\n /** Multiplier to be used when calculating the buffer rows to be loaded, bufferRows = bufferMultiplier * totalrows */\n bufferMultiplier: number;\n\n /** Number denoting the row height */\n itemHeight: number;\n\n /** DOM element for parent container */\n pContainer: HTMLElement;\n\n /** Virtualizer specific information */\n pInfo: PersonalizationInfo;\n\n /** DOM element for row container */\n rContainer: HTMLElement;\n}\n\n/**\n * Attributes of the virtualizer being used\n */\nexport interface RootVirtualizer {\n /**\n * Returns the parent container pContainer set on the virtualizer\n * @returns div with id pContainer\n */\n getParentContainer: () => HTMLElement;\n\n /** Unique identifier of the virtualizer */\n id: string;\n\n /** Function to execute to scroll the virtualizer to top */\n scrollToTop: () => void;\n\n /** Additional information set on the virtualizer instance */\n vi: VirtualizeInstance;\n}\n\nexport interface VirtualizeElement {\n [key: string]: RootVirtualizer;\n}\n\nexport type FormatterFunction = Formatters[keyof Formatters];\n\nexport interface RefreshNotification {\n /** A unique identifier for a refresh notification published by consumer of RS. */\n id: number;\n /** The message that needs to be displayed as refresh notification */\n message: string;\n /** The label for the refresh action button. */\n refreshActionLabel: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ViewGenerator.types.js","sourceRoot":"","sources":["../../../../src/core/generators/ViewGenerator.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { OmitStrict } from '@pega/cosmos-react-core';\n\nimport type { State } from '../../../types/State.types';\nimport type { FieldDef } from '../../../types/Meta.types';\nimport type { Formatters } from '../../../types/RsCoreBootArgs.types';\n\nimport type View from './ViewGenerator';\n\n// @ts-check findout which are the mandatory properties in View options.\nexport type ViewConfig = Partial<\n Pick<\n View,\n | 'data'\n | 'columns'\n | 'rows'\n | 'groupHeaders'\n | 'resultsCount'\n | 'hasMoreResults'\n | 'showCount'\n | 'totalItemCount'\n | 'selectedRecordsCount'\n | 'bodyHeight'\n | 'bodyMaxHeight'\n | 'rowHeight'\n | 'rowHeightClass'\n | 'isFilterApplied'\n | 'isLoading'\n | 'freezeLine'\n | 'state'\n | 'domContainer'\n | 'scrollerNode'\n | 'itemElement'\n | 'virtualizeElements'\n | 'debugInfo'\n | 'requiredDef'\n | 'hierarchicalGroupEnabled'\n | 'confirmationActionDetails'\n | 'externalStateKeys'\n | 'isCountUpdateRequired'\n | 'countGeneratedInternally'\n | 'isInstantRender'\n | 'viewHeight'\n | 'refreshNotification'\n | 'announceCount'\n | 'enableGlobalSearch'\n | 'warningMessages'\n | 'template'\n >\n> &\n Pick<View, 'meta'> & { singleSelectionRowKey?: string };\nexport type ViewContext = {\n /** Returns the {@link View.meta meta} */\n getMeta: () => View['meta'];\n /** Returns the {@link View.state state} */\n getState: () => View['state'];\n /** Returns the {@link View.columns columns} */\n getColumns: () => View['columns'];\n /** Returns the {@link View.getRenderingEnginePropsById getRenderingEnginePropsById} */\n getRenderingEnginePropsById: View['getRenderingEnginePropsById'];\n /** Returns the {@link View.selectedRecordsCount selectedRecordsCount} */\n selectedRecordsCount: View['selectedRecordsCount'];\n /** Returns the {@link View.resultsCount resultsCount} */\n resultsCount: View['resultsCount'];\n /** Returns the {@link View.hasMoreResults hasMoreResults} */\n hasMoreResults: View['hasMoreResults'];\n /** Returns the {@link View.requiredDef requiredDef} */\n getRequiredDef: () => View['requiredDef'];\n /** Returns the {@link View.getRowDensity getRowDensity} */\n getRowDensity: View['getRowDensity'];\n /** Returns the {@link View.getVisibleColumns getVisibleColumns} */\n getVisibleColumns: View['getVisibleColumns'];\n /** Returns the {@link View.template template} */\n template: View['template'];\n};\n\n/** Interface exposed for confirmation dialogue */\nexport interface ConfirmationActionDetails {\n /** Labels for the confirmation dialogue */\n labels: {\n /** Header of the confirmation dialogue pop up */\n heading: string;\n\n /** Description of the confirmation dialogue pop up */\n description: string;\n\n /** Label of the submit button inside confirmation dialogue pop up */\n submitButtonLabel: string;\n\n /** Label of the cancel button inside confirmation dialogue pop up */\n cancelButtonLabel: string;\n };\n\n /** Boolean to toggle the show/visibility */\n showConfirmationAction: boolean;\n\n /** Function to be executed upon submission of the concerned modal */\n onSubmit: (value?: any) => void;\n\n /** Function to be executed upon cancellation of the concerned modal */\n onCancel: (reason?: any) => void;\n}\n\n/** Interface for displaying API stats on the view */\nexport interface DebugInfo {\n /** Class name of the data page */\n className: string;\n\n /** Name of the data page */\n dataPage: string;\n\n /** Source of the data page */\n dataSource?: string;\n\n /** Unique identifier for the insight */\n insightId?: string;\n\n /** Time taken by the API */\n timeTaken?: string;\n}\n\n/** Style interface for freezeline */\nexport interface FreezeLine {\n styles: {\n left: string;\n };\n}\n\n/** An interface used for group headers, consisting of grouping and hierarchical grouping properties */\nexport interface GroupHeader {\n /** Applied aggregation to be displayed in group header */\n aggregation: { [key: FieldDef['name']]: { [key: string]: number } };\n\n /** Count to be displayed in group header */\n count: number;\n\n /** Data */\n data: object;\n\n /** End index of the rows in a particular group */\n endIndex: number;\n\n /** group-key: Computed using getGroupKey utility */\n groupBy: string;\n\n /** String array denoting hierarchy */\n hierarchy: string[];\n\n /** Hierarchical grouping info object */\n info: object;\n\n /** Indicates expanded state */\n isExpanded: boolean;\n\n /** Indicates if its hierarchical grouping */\n isHierarchical: boolean;\n\n /** Indicates if it is a leaf node. */\n isLeafNode: boolean;\n\n /** Indicates visibility */\n isVisible: boolean;\n\n /** Label of the group header to be displayed on UI */\n label: string;\n\n /** Level denoting the nesting level of a group header */\n level: number;\n\n /** Name attribute on a group header */\n name: string;\n\n /** Boolean to toggle displaying the hierarchical footer */\n showHierarchicalFooter: boolean;\n\n /** End index of the rows in a particular group */\n startIndex: number;\n}\n\nexport interface RequiredDefinition {\n required: boolean;\n validatemessage: string;\n}\n\n/**\n * Warning detail structure from DX API responses.\n * Contains message information that can be localized and displayed to users.\n */\nexport interface WarningDetail {\n /** Localized Message */\n message?: string;\n}\n\n/** UI props to be set on the view for A11Y purpose */\nexport interface UIProps {\n /** This attribute conveys the number of columns in the repeating structures to screen readers. */\n 'aria-colcount': number;\n\n /** This attribute conveys the label of the repeating structures to screen readers. */\n 'aria-label': string;\n\n /** This attribute conveys the number of rows in the repeating structures to screen readers. */\n 'aria-rowcount': number;\n\n /** HTML role attribute for the view.\n * @default 'grid'\n */\n role: string;\n}\n\nexport type ViewState = OmitStrict<\n State,\n | 'groupFilters'\n | 'forceUpdateFeatures'\n | 'template'\n | 'presetId'\n | 'version'\n | 'renderFormatter'\n | 'hierarchicalGroup'\n> & { searchText?: string };\n\n/** Personalization information object */\ninterface PersonalizationInfo {\n /** Coordinates of current row index. */\n existingItemBoundingBox: DOMRect;\n\n /** Common visible item in view before and after paint (previous and next paint) */\n currentRowIndex: number;\n\n /** Possible index on view top */\n topRowIndex: number;\n\n /** Buffer coordinates while pagination. */\n bufferOldCords: DOMRect;\n\n /** Buffer coordinates while pagination is in progress and user scroll. */\n bufferNewCords: DOMRect;\n\n /** View object containing start index and end index */\n view: {\n startIndex: number;\n endIndex: number;\n };\n}\n\n/** Interface structure for virtualizer instance */\ninterface VirtualizeInstance {\n /** DOM element for body container */\n bContainer: HTMLElement;\n\n /** Multiplier to be used when calculating the buffer rows to be loaded, bufferRows = bufferMultiplier * totalrows */\n bufferMultiplier: number;\n\n /** Number denoting the row height */\n itemHeight: number;\n\n /** DOM element for parent container */\n pContainer: HTMLElement;\n\n /** Virtualizer specific information */\n pInfo: PersonalizationInfo;\n\n /** DOM element for row container */\n rContainer: HTMLElement;\n}\n\n/**\n * Attributes of the virtualizer being used\n */\nexport interface RootVirtualizer {\n /**\n * Returns the parent container pContainer set on the virtualizer\n * @returns div with id pContainer\n */\n getParentContainer: () => HTMLElement;\n\n /** Unique identifier of the virtualizer */\n id: string;\n\n /** Function to execute to scroll the virtualizer to top */\n scrollToTop: () => void;\n\n /** Additional information set on the virtualizer instance */\n vi: VirtualizeInstance;\n}\n\nexport interface VirtualizeElement {\n [key: string]: RootVirtualizer;\n}\n\nexport type FormatterFunction = Formatters[keyof Formatters];\n\nexport interface RefreshNotification {\n /** A unique identifier for a refresh notification published by consumer of RS. */\n id: number;\n /** The message that needs to be displayed as refresh notification */\n message: string;\n /** The label for the refresh action button. */\n refreshActionLabel: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../../src/core/reducers/error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAExD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;yBAEvC,OAAO,KAAK,EAAE,QAAQ,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../../src/core/reducers/error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAExD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;yBAEvC,OAAO,KAAK,EAAE,QAAQ,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAmBotU,CAAC;+BAAkI,CAAC;0BAAmJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAnBxhV,wBAkBE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/reducers/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAkExD,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EAAE,UAAU,EAAE,EAAE,UAAU,IAC3D,OAAO,KAAK,EAAE,QAAQ,MAAM,EAAE,YAAY,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/reducers/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAkExD,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EAAE,UAAU,EAAE,EAAE,UAAU,IAC3D,OAAO,KAAK,EAAE,QAAQ,MAAM,EAAE,YAAY,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAeuzQ,CAAC;+BAAkI,CAAC;0BAAmJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAD5oR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"personalizationDirtyReducer.d.ts","sourceRoot":"","sources":["../../../../src/core/reducers/personalizationDirtyReducer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"personalizationDirtyReducer.d.ts","sourceRoot":"","sources":["../../../../src/core/reducers/personalizationDirtyReducer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAqEvD,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAC5C,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,MAAM,EACf,EAAE,OAAO,EAAE,EAAE,UAAU,GACtB,KAAK,CA2BP"}
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import { pickProperties, deepEqual } from '../utils/util';
|
|
2
2
|
import { personalizationProps } from './personalizationReducer';
|
|
3
3
|
import { getCurrentVersionedState } from './versioning';
|
|
4
|
-
function
|
|
4
|
+
function excludeAutoManagedWidths(comparable, autoManagedWidthColumnIds) {
|
|
5
|
+
if (!autoManagedWidthColumnIds.length || !comparable.columnWidths) {
|
|
6
|
+
return comparable;
|
|
7
|
+
}
|
|
8
|
+
const columnWidths = { ...comparable.columnWidths };
|
|
9
|
+
autoManagedWidthColumnIds.forEach(id => {
|
|
10
|
+
delete columnWidths[id];
|
|
11
|
+
});
|
|
12
|
+
return { ...comparable, columnWidths };
|
|
13
|
+
}
|
|
14
|
+
function markStateDirty(state, isPreset, autoManagedWidthColumnIds) {
|
|
5
15
|
const pickedState = pickProperties(state, personalizationProps) ?? {};
|
|
6
16
|
const personalizationKey = state.personalization.active;
|
|
7
17
|
const personalizedState = getCurrentVersionedState(state.personalization.allPersonalizations?.[personalizationKey]?.personalizationState) || {};
|
|
@@ -9,7 +19,7 @@ function markStateDirty(state, isPreset) {
|
|
|
9
19
|
// since 'visibleColumns' is a newly introduced state slice and older personalization data does not have it.
|
|
10
20
|
const { visibleColumns: CurrentVisible, ...comparableCurrentState } = pickedState;
|
|
11
21
|
const { visibleColumns: SavedVisible, ...comparableSavedState } = pickProperties(personalizedState, personalizationProps) ?? {};
|
|
12
|
-
const isStateDirty = !deepEqual(comparableCurrentState, comparableSavedState);
|
|
22
|
+
const isStateDirty = !deepEqual(excludeAutoManagedWidths(comparableCurrentState, autoManagedWidthColumnIds), excludeAutoManagedWidths(comparableSavedState, autoManagedWidthColumnIds));
|
|
13
23
|
const isStateMarkedDirty = state.personalization.dirty;
|
|
14
24
|
// markStateDirtyIfValid
|
|
15
25
|
if (!isPreset && isStateDirty && !isStateMarkedDirty) {
|
|
@@ -43,7 +53,12 @@ export default function personalizationReducer(state, _action, { getView }) {
|
|
|
43
53
|
const isPreset = !!state.personalization?.allPersonalizations?.[activePersonalization]?.isPreset ||
|
|
44
54
|
(state.personalization?.active === 'APP_DEFAULT' && !enableAppDefault);
|
|
45
55
|
if (activePersonalization) {
|
|
46
|
-
|
|
56
|
+
// The first visual column's width is auto-managed (grouping chevron, meta fields), so
|
|
57
|
+
// it is excluded from the dirty comparison to avoid false "unsaved changes" prompts.
|
|
58
|
+
const firstVisualColumnId = getView().columns?.find(column => column.isFirstVisualColumn)?.field
|
|
59
|
+
?.id;
|
|
60
|
+
const autoManagedWidthColumnIds = firstVisualColumnId ? [firstVisualColumnId] : [];
|
|
61
|
+
return markStateDirty(state, isPreset, autoManagedWidthColumnIds);
|
|
47
62
|
}
|
|
48
63
|
return state;
|
|
49
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"personalizationDirtyReducer.js","sourceRoot":"","sources":["../../../../src/core/reducers/personalizationDirtyReducer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAExD,SAAS,
|
|
1
|
+
{"version":3,"file":"personalizationDirtyReducer.js","sourceRoot":"","sources":["../../../../src/core/reducers/personalizationDirtyReducer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAExD,SAAS,wBAAwB,CAC/B,UAAa,EACb,yBAAmC;IAEnC,IAAI,CAAC,yBAAyB,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC;QAClE,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,MAAM,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sInternal from '../RsInternal';\nimport type { Action } from '../actions/actions.types';\nimport { pickProperties, deepEqual } from '../utils/util';\n\nimport { personalizationProps } from './personalizationReducer';\nimport { getCurrentVersionedState } from './versioning';\n\nfunction excludeAutoManagedWidths<T extends { columnWidths?: State['columnWidths'] }>(\n comparable: T,\n autoManagedWidthColumnIds: string[]\n): T {\n if (!autoManagedWidthColumnIds.length || !comparable.columnWidths) {\n return comparable;\n }\n\n const columnWidths = { ...comparable.columnWidths };\n autoManagedWidthColumnIds.forEach(id => {\n delete columnWidths[id];\n });\n return { ...comparable, columnWidths };\n}\n\nfunction markStateDirty(\n state: State,\n isPreset: boolean,\n autoManagedWidthColumnIds: string[]\n): State {\n const pickedState = pickProperties(state, personalizationProps) ?? {};\n const personalizationKey = state.personalization!.active;\n const personalizedState =\n getCurrentVersionedState(\n state.personalization!.allPersonalizations?.[personalizationKey]?.personalizationState\n ) || {};\n\n // Compares two state objects for deep equality while excluding `visibleColumns`,\n // since 'visibleColumns' is a newly introduced state slice and older personalization data does not have it.\n const { visibleColumns: CurrentVisible, ...comparableCurrentState } = pickedState;\n const { visibleColumns: SavedVisible, ...comparableSavedState } =\n pickProperties(personalizedState, personalizationProps) ?? {};\n\n const isStateDirty = !deepEqual(\n excludeAutoManagedWidths(comparableCurrentState, autoManagedWidthColumnIds),\n excludeAutoManagedWidths(comparableSavedState, autoManagedWidthColumnIds)\n );\n\n const isStateMarkedDirty = state.personalization!.dirty;\n\n // markStateDirtyIfValid\n if (!isPreset && isStateDirty && !isStateMarkedDirty) {\n return {\n ...state,\n personalization: {\n ...state.personalization!,\n dirty: true\n }\n };\n }\n if ((isPreset || !isStateDirty) && isStateMarkedDirty) {\n return {\n ...state,\n personalization: {\n ...state.personalization!,\n dirty: false\n }\n };\n }\n\n return state;\n}\n\nexport default function personalizationReducer(\n state: State,\n _action: Action,\n { getView }: RsInternal\n): State {\n // All other dispatched actions which might have caused state changes\n // see means to see or check object reference before creating newState\n // As some dispatched actions might have just bailed out with same state\n\n const activePersonalization = state.personalization?.active!;\n const {\n meta: { enableAppDefault }\n } = getView();\n\n // APP default view cannot be modified in runtime, i.e enableAppDefault = false. Treat it as preset\n // APP default view modification is allowed/enabled only in preview mode, i.e enableAppDefault = true. Treat it as personalized view\n\n const isPreset =\n !!state.personalization?.allPersonalizations?.[activePersonalization]?.isPreset ||\n (state.personalization?.active === 'APP_DEFAULT' && !enableAppDefault);\n\n if (activePersonalization) {\n // The first visual column's width is auto-managed (grouping chevron, meta fields), so\n // it is excluded from the dirty comparison to avoid false \"unsaved changes\" prompts.\n const firstVisualColumnId = getView().columns?.find(column => column.isFirstVisualColumn)?.field\n ?.id;\n const autoManagedWidthColumnIds = firstVisualColumnId ? [firstVisualColumnId] : [];\n return markStateDirty(state, isPreset, autoManagedWidthColumnIds);\n }\n\n return state;\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { State } from '../../../types/State.types';
|
|
2
2
|
import type { Action } from '../actions/actions.types';
|
|
3
3
|
import type RsInternal from '../RsInternal';
|
|
4
|
-
export declare const personalizationProps: ("template" | "version" | "groups" | "showHeaderIcons" | "filterExpression" | "
|
|
4
|
+
export declare const personalizationProps: ("template" | "version" | "groups" | "showHeaderIcons" | "filterExpression" | "visibleColumns" | "customFields" | "externalState" | "sortingOrder" | "freezeColumns" | "hiddenColumns" | "columnWidths" | "colOrder" | "aggregationInfo" | "hierarchicalGroup" | "renderFormatter" | "galleryLayout" | "presetId" | "selectedHeightOption" | "_groupsSnapshot" | "columnAlias" | "allGroupsExpanded")[];
|
|
5
5
|
export default function personalizationReducer(state: State, action: Action, { getView }: RsInternal): State;
|
|
6
6
|
//# sourceMappingURL=personalizationReducer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visibility.d.ts","sourceRoot":"","sources":["../../../../src/core/reducers/visibility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAExD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;yBAG5B,OAAO,KAAK,EAAE,QAAQ,MAAM,EAAE,aAAa,UAAU;AAArE,
|
|
1
|
+
{"version":3,"file":"visibility.d.ts","sourceRoot":"","sources":["../../../../src/core/reducers/visibility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAExD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;yBAG5B,OAAO,KAAK,EAAE,QAAQ,MAAM,EAAE,aAAa,UAAU;AAArE,wBA4GE"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import ActionTypes from '../actions/actionConstants';
|
|
2
2
|
import { rowDragDropColumnMeta } from '../constants';
|
|
3
3
|
import { getVisibleOotbColumns } from '../features/uIFeatures/beforeRender/stateHydration';
|
|
4
|
-
import { getVisibleColumnsFromHidden } from '../utils/util';
|
|
4
|
+
import { getHiddenColumnsFromVisible, getVisibleColumnsFromHidden } from '../utils/util';
|
|
5
5
|
export default (state, action, { getView }) => {
|
|
6
6
|
const { type } = action;
|
|
7
7
|
if (type === ActionTypes.COLUMN_TOGGLE) {
|
|
8
8
|
const { payload: toggledIds } = action;
|
|
9
|
-
|
|
9
|
+
// TODO: hiddenColumns is deprecated, remove it.
|
|
10
|
+
const currentHidden = new Set(state.hiddenColumns ?? getHiddenColumnsFromVisible(getView().meta, state.visibleColumns));
|
|
10
11
|
const currentVisible = new Set(state.visibleColumns ?? []);
|
|
11
12
|
for (const id of toggledIds) {
|
|
12
13
|
if (currentHidden.has(id)) {
|
|
@@ -53,7 +54,8 @@ export default (state, action, { getView }) => {
|
|
|
53
54
|
if (type === ActionTypes.UPDATE_COLUMNS_VISIBILITY) {
|
|
54
55
|
const { payload: columns = {} } = action;
|
|
55
56
|
const updatedVisibleColumns = new Set(state.visibleColumns ?? []);
|
|
56
|
-
|
|
57
|
+
// TODO: hiddenColumns is deprecated, remove it.
|
|
58
|
+
const updatedHiddenColumns = new Set(state.hiddenColumns ?? getHiddenColumnsFromVisible(getView().meta, state.visibleColumns));
|
|
57
59
|
let isUpdated = false;
|
|
58
60
|
for (const [column, isVisible] of Object.entries(columns)) {
|
|
59
61
|
if (isVisible && !updatedVisibleColumns.has(column)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visibility.js","sourceRoot":"","sources":["../../../../src/core/reducers/visibility.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,4BAA4B,CAAC;AAErD,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAE3F,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"visibility.js","sourceRoot":"","sources":["../../../../src/core/reducers/visibility.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,4BAA4B,CAAC;AAErD,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAE3F,OAAO,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAEzF,eAAe,CAAC,KAAY,EAAE,MAAc,EAAE,EAAE,OAAO,EAAc,EAAE,EAAE;IACvE,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IAExB,IAAI,IAAI,KAAK,WAAW,CAAC,aAAa,EAAE,CAAC;QACvC,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;QACvC,gDAAgD;QAChD,MAAM,aAAa,GAAG,IAAI,GAAG,CAC3B,KAAK,CAAC,aAAa,IAAI,2BAA2B,CAAC,OAAO,EAAE,CAAC,IAAI,EA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,CAAC,CAAC","sourcesContent":["import type { State } from '../../../types/State.types';\nimport ActionTypes from '../actions/actionConstants';\nimport type { Action } from '../actions/actions.types';\nimport { rowDragDropColumnMeta } from '../constants';\nimport { getVisibleOotbColumns } from '../features/uIFeatures/beforeRender/stateHydration';\nimport type RsInternal from '../RsInternal';\nimport { getHiddenColumnsFromVisible, getVisibleColumnsFromHidden } from '../utils/util';\n\nexport default (state: State, action: Action, { getView }: RsInternal) => {\n const { type } = action;\n\n if (type === ActionTypes.COLUMN_TOGGLE) {\n const { payload: toggledIds } = action;\n // TODO: hiddenColumns is deprecated, remove it.\n const currentHidden = new Set(\n state.hiddenColumns ?? getHiddenColumnsFromVisible(getView().meta, state.visibleColumns)\n );\n const currentVisible = new Set(state.visibleColumns ?? []);\n\n for (const id of toggledIds) {\n if (currentHidden.has(id)) {\n currentHidden.delete(id);\n currentVisible.add(id);\n } else {\n currentHidden.add(id);\n currentVisible.delete(id);\n }\n }\n\n // TODO , HiddenColumns are no longer required instead use visibleColumns only.\n return {\n ...state,\n hiddenColumns: Array.from(currentHidden),\n visibleColumns: Array.from(currentVisible)\n };\n }\n\n if (type === ActionTypes.HIDDEN_COLUMN_UPDATE) {\n const { payload } = action;\n // TODO TASK-1532916 #AvoidPersonalisationDirty\n const { ootbColumns = {} } = payload;\n const columnsToHide = new Set<string>(payload.hiddenColumns ?? []);\n const visibleColumns = new Set([\n ...getVisibleColumnsFromHidden(getView().meta, payload.hiddenColumns),\n ...getVisibleOotbColumns(getView().meta)\n ]);\n const dragDropId = rowDragDropColumnMeta.field.id;\n\n if (ootbColumns.dragHandle) {\n columnsToHide.add(dragDropId);\n visibleColumns.delete(dragDropId);\n } else if (ootbColumns.dragHandle === false) {\n // Show drag handle: add to visible if not already present, remove from hidden.\n columnsToHide.delete(dragDropId);\n visibleColumns.add(dragDropId);\n }\n\n return {\n ...state,\n hiddenColumns: Array.from(columnsToHide),\n visibleColumns: Array.from(visibleColumns)\n };\n }\n\n if (type === ActionTypes.UPDATE_COLUMNS_VISIBILITY) {\n const { payload: columns = {} } = action;\n const updatedVisibleColumns = new Set(state.visibleColumns ?? []);\n // TODO: hiddenColumns is deprecated, remove it.\n const updatedHiddenColumns = new Set(\n state.hiddenColumns ?? getHiddenColumnsFromVisible(getView().meta, state.visibleColumns)\n );\n let isUpdated = false;\n\n for (const [column, isVisible] of Object.entries(columns)) {\n if (isVisible && !updatedVisibleColumns.has(column)) {\n // Show column: add to visibleColumns, remove from hiddenColumns.\n updatedVisibleColumns.add(column);\n updatedHiddenColumns.delete(column);\n isUpdated = true;\n } else if (!isVisible && updatedVisibleColumns.has(column)) {\n // Hide column: remove from visibleColumns, add to hiddenColumns.\n updatedVisibleColumns.delete(column);\n updatedHiddenColumns.add(column);\n isUpdated = true;\n }\n }\n return isUpdated\n ? {\n ...state,\n hiddenColumns: Array.from(updatedHiddenColumns),\n visibleColumns: Array.from(updatedVisibleColumns)\n }\n : state;\n }\n\n if (type === ActionTypes.ADD_COLUMN_VISIBILITY) {\n const columnIds = Array.isArray(action.payload) ? action.payload : [action.payload];\n\n const existingVisibleColumns = state.visibleColumns ?? [];\n const newlyAddedVisibleColumns = columnIds.filter(id => !existingVisibleColumns.includes(id));\n\n if (newlyAddedVisibleColumns.length === 0) return state;\n\n return {\n ...state,\n visibleColumns: [...existingVisibleColumns, ...newlyAddedVisibleColumns]\n };\n }\n\n if (type === ActionTypes.VISIBLE_COLUMN_UPDATE) {\n return {\n ...state,\n visibleColumns: [...action.payload]\n };\n }\n return state;\n};\n"]}
|
|
@@ -148,15 +148,15 @@ export declare function isFilterApplied(column: Column, filterExpression: Condit
|
|
|
148
148
|
*/
|
|
149
149
|
export declare function addFilter({ filterExpression, column, comparator, input }: AddFilterParams): Condition | null;
|
|
150
150
|
/**
|
|
151
|
-
* Retrieves the visible fields in the current view by considering the
|
|
152
|
-
* This function also accounts for columns from custom fields
|
|
151
|
+
* Retrieves the visible fields in the current view by considering the visible columns state.
|
|
152
|
+
* This function also accounts for source columns from visible custom fields.
|
|
153
153
|
*
|
|
154
154
|
* @param fieldDefs - The {@link Meta.fieldDefs fieldDefs}.
|
|
155
|
-
* @param
|
|
155
|
+
* @param visibleColumns - The list of {@link State.visibleColumns visibleColumns}.
|
|
156
156
|
* @param customFields - The {@link State.customFields customFields}.
|
|
157
157
|
* @returns The list of visible fields.
|
|
158
158
|
*/
|
|
159
|
-
export declare const getVisibileFields: (fieldDefs?: FieldDef[],
|
|
159
|
+
export declare const getVisibileFields: (fieldDefs?: FieldDef[], visibleColumns?: State["visibleColumns"], customFields?: State["customFields"]) => FieldDef[];
|
|
160
160
|
/**
|
|
161
161
|
* Retrieves the data of the closest row to the `targetElement` from the view {@link View.data data}.
|
|
162
162
|
*
|
|
@@ -198,6 +198,7 @@ export declare function compareArray<T extends unknown>(t1: T[], t2: T[], props?
|
|
|
198
198
|
* @returns calculated hash
|
|
199
199
|
*/
|
|
200
200
|
export declare function generateHash(string: string): number;
|
|
201
|
+
export declare function isCustomGroupingSupported(fieldType: FieldDef['type'] | undefined, customGrouping: FieldDef['customGrouping'] | Group['customFunction'], template?: Meta['template']): boolean;
|
|
201
202
|
/**
|
|
202
203
|
* Normalizes the {@link FieldDef} with {@link defaultFieldDef defaultFieldDef config} if not already set.
|
|
203
204
|
*
|
|
@@ -206,7 +207,7 @@ export declare function generateHash(string: string): number;
|
|
|
206
207
|
*
|
|
207
208
|
* @returns The normalized fieldDef object with the updated configurations.
|
|
208
209
|
*/
|
|
209
|
-
export declare function normalizeFieldDef(field: FieldDef, defaultFieldDef: NonNullable<DefaultConfigType['defaultFieldDef']
|
|
210
|
+
export declare function normalizeFieldDef(field: FieldDef, defaultFieldDef: NonNullable<DefaultConfigType['defaultFieldDef']>, template?: Meta['template']): void;
|
|
210
211
|
/**
|
|
211
212
|
* Normalizes the RS meta with the {@link defaultConfig default configuration} if not already set:
|
|
212
213
|
* - Updates the {@link Meta.minheight minHeight} option from the {@link defaultConfig}.
|
|
@@ -360,6 +361,14 @@ export declare const getGroupKey: (group: Group) => string;
|
|
|
360
361
|
* @returns matched group
|
|
361
362
|
*/
|
|
362
363
|
export declare const getGroupFromKey: (groupBy: string, groups: State["groups"]) => Group | undefined;
|
|
364
|
+
/**
|
|
365
|
+
* Determines whether the view uses the Kanban template (its level-0 group is the board lane).
|
|
366
|
+
* The lane's presence at runtime is checked separately via `state.groups[0]`, so this predicate
|
|
367
|
+
* intentionally reads only the template — it must stay valid before hydration seeds the lane.
|
|
368
|
+
* @param meta - View metadata.
|
|
369
|
+
* @returns Whether the view is a Kanban board.
|
|
370
|
+
*/
|
|
371
|
+
export declare const isKanbanTemplate: (meta: Meta | undefined) => boolean;
|
|
363
372
|
/**
|
|
364
373
|
* Checks if the column widths have been calculated.
|
|
365
374
|
*
|
|
@@ -404,6 +413,14 @@ export declare const isFreezingEnabled: (meta: Meta) => boolean;
|
|
|
404
413
|
* @returns Array of visible column IDs.
|
|
405
414
|
*/
|
|
406
415
|
export declare function getVisibleColumnsFromHidden(meta: Meta, hiddenColumns: State['hiddenColumns']): string[];
|
|
416
|
+
/**
|
|
417
|
+
* Derives hidden column IDs from fieldDefs by excluding visible columns.
|
|
418
|
+
*
|
|
419
|
+
* @param meta - View meta containing fieldDefs.
|
|
420
|
+
* @param visibleColumns - Array of visible column IDs.
|
|
421
|
+
* @returns Array of hidden column IDs.
|
|
422
|
+
*/
|
|
423
|
+
export declare function getHiddenColumnsFromVisible(meta: Meta, visibleColumns?: State['visibleColumns'], hiddenColumns?: State['hiddenColumns']): string[];
|
|
407
424
|
/**
|
|
408
425
|
* Derives visible column IDs from fieldDefs where show is true.
|
|
409
426
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../src/core/utils/util.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAW,KAAK,aAAa,EAAE,MAAM,yBAAyB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E,CAIV;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,IAAI,EACV,cAAc,GAAE,KAAK,CAAC,gBAAgB,CAAM,EAC5C,aAAa,GAAE,KAAK,CAAC,eAAe,CAAM,GACzC,MAAM,EAAE,CAWV;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,EAAE,CAEnE;AAED,eAAO,MAAM,gBAAgB,GAAI,KAAK,MAAM,KAAG,GAAG,IAAI,MAAM,OAAO,mBACvC,CAAC;AAE7B;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GACzB,OAAO,MAAM,EACb,WAAW,CAAC,GAAG,EAAE,MAAM,OAAO,mBAAmB,KAAK,MAAM,KAC3D,MAA8D,CAAC;AAElE;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,GAAI,MAAM,IAAI,EAAE,UAAU,QAAQ,KAAG,OAuD3E,CAAC"}
|
|
@@ -353,30 +353,31 @@ export function addFilter({ filterExpression, column, comparator, input }) {
|
|
|
353
353
|
}
|
|
354
354
|
/* End : APIs specific to condition builder */
|
|
355
355
|
/**
|
|
356
|
-
* Retrieves the visible fields in the current view by considering the
|
|
357
|
-
* This function also accounts for columns from custom fields
|
|
356
|
+
* Retrieves the visible fields in the current view by considering the visible columns state.
|
|
357
|
+
* This function also accounts for source columns from visible custom fields.
|
|
358
358
|
*
|
|
359
359
|
* @param fieldDefs - The {@link Meta.fieldDefs fieldDefs}.
|
|
360
|
-
* @param
|
|
360
|
+
* @param visibleColumns - The list of {@link State.visibleColumns visibleColumns}.
|
|
361
361
|
* @param customFields - The {@link State.customFields customFields}.
|
|
362
362
|
* @returns The list of visible fields.
|
|
363
363
|
*/
|
|
364
|
-
export const getVisibileFields = (fieldDefs = [],
|
|
364
|
+
export const getVisibileFields = (fieldDefs = [], visibleColumns = [], customFields = []) => {
|
|
365
365
|
const fieldMap = fieldDefs.reduce((acc, field) => {
|
|
366
366
|
acc[field.id] = field;
|
|
367
367
|
return acc;
|
|
368
368
|
}, {});
|
|
369
|
-
const visibleFields = fieldDefs.filter(({ id }) =>
|
|
369
|
+
const visibleFields = fieldDefs.filter(({ id }) => visibleColumns.includes(id));
|
|
370
370
|
const fieldIdsFromCustomField = (customField) => customField?.expression.filter(item => !Array.isArray(item)); // taking all non template items
|
|
371
371
|
const visibleUnderCustomFields = [
|
|
372
372
|
...new Set(customFields
|
|
373
|
-
.filter(({ id }) =>
|
|
373
|
+
.filter(({ id }) => visibleColumns.includes(id)) // Only visible custom fields
|
|
374
374
|
.map(field => fieldIdsFromCustomField(field))
|
|
375
375
|
.flat() // flat the multiple custom field fieldIds
|
|
376
376
|
) // Getting unique fieldIds
|
|
377
377
|
]
|
|
378
|
-
.filter(fieldId =>
|
|
379
|
-
.map(fieldId => fieldMap[fieldId])
|
|
378
|
+
.filter(fieldId => !visibleColumns.includes(fieldId)) // taking only fields that are not already visible to avoid duplicates
|
|
379
|
+
.map(fieldId => fieldMap[fieldId])
|
|
380
|
+
.filter(field => Boolean(field));
|
|
380
381
|
return [...visibleFields, ...visibleUnderCustomFields];
|
|
381
382
|
};
|
|
382
383
|
/**
|
|
@@ -527,6 +528,23 @@ const prepareDefaultFieldConfig = (defaultFieldConfig, field) => {
|
|
|
527
528
|
return [key, value];
|
|
528
529
|
}));
|
|
529
530
|
};
|
|
531
|
+
export function isCustomGroupingSupported(fieldType, customGrouping, template) {
|
|
532
|
+
const isTextCustomGrouping = fieldType === FieldType.TEXT && customGrouping?.type === 'TEXT_GROUPING';
|
|
533
|
+
const isNumericCustomGrouping = (fieldType === FieldType.NUMBER || fieldType === FieldType.CURRENCY) &&
|
|
534
|
+
(customGrouping?.type === 'RANGE_GROUPING' || customGrouping?.type === 'INTERVAL_GROUPING');
|
|
535
|
+
return (isTextCustomGrouping ||
|
|
536
|
+
(template !== REPEATING_STRUCTURE_TEMPLATES.KANBAN && isNumericCustomGrouping));
|
|
537
|
+
}
|
|
538
|
+
function sanitizeFieldDef(field, template) {
|
|
539
|
+
if (field.customGrouping &&
|
|
540
|
+
!isCustomGroupingSupported(field.type, field.customGrouping, template)) {
|
|
541
|
+
delete field.customGrouping;
|
|
542
|
+
}
|
|
543
|
+
if (template === REPEATING_STRUCTURE_TEMPLATES.KANBAN) {
|
|
544
|
+
delete field.groupedDateFunction;
|
|
545
|
+
delete field.groupedAdditionalFields;
|
|
546
|
+
}
|
|
547
|
+
}
|
|
530
548
|
/**
|
|
531
549
|
* Normalizes the {@link FieldDef} with {@link defaultFieldDef defaultFieldDef config} if not already set.
|
|
532
550
|
*
|
|
@@ -535,7 +553,7 @@ const prepareDefaultFieldConfig = (defaultFieldConfig, field) => {
|
|
|
535
553
|
*
|
|
536
554
|
* @returns The normalized fieldDef object with the updated configurations.
|
|
537
555
|
*/
|
|
538
|
-
export function normalizeFieldDef(field, defaultFieldDef) {
|
|
556
|
+
export function normalizeFieldDef(field, defaultFieldDef, template) {
|
|
539
557
|
const properties = Object.keys(defaultFieldDef);
|
|
540
558
|
field.idHash = generateHash(field.id);
|
|
541
559
|
properties.forEach((prop) => {
|
|
@@ -557,6 +575,7 @@ export function normalizeFieldDef(field, defaultFieldDef) {
|
|
|
557
575
|
else {
|
|
558
576
|
field.filterParams = undefined;
|
|
559
577
|
}
|
|
578
|
+
sanitizeFieldDef(field, template);
|
|
560
579
|
}
|
|
561
580
|
/**
|
|
562
581
|
* Normalizes the RS meta with the {@link defaultConfig default configuration} if not already set:
|
|
@@ -581,12 +600,12 @@ export function normalizeMeta(_meta, defaultConfig) {
|
|
|
581
600
|
normalizeFieldDef(column, {
|
|
582
601
|
...prepareDefaultFieldConfig(defaultConfig.defaultFieldDef, column),
|
|
583
602
|
/*
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
603
|
+
TODO: Deprecation - The defaultFieldDef in meta is no longer necessary and is not utilized by any consumers.
|
|
604
|
+
- Consumers should provide the exact fieldDef configuration instead of relying on explicit defaults in meta.
|
|
605
|
+
- Only the in-house defaultFieldDef from `defaultConfig.defaultFieldDef` will be honored.
|
|
606
|
+
*/
|
|
588
607
|
...meta.defaultFieldDef
|
|
589
|
-
});
|
|
608
|
+
}, meta.template);
|
|
590
609
|
});
|
|
591
610
|
updateMetaSettings(meta, defaultConfig);
|
|
592
611
|
return meta;
|
|
@@ -892,6 +911,16 @@ export const getGroupFromKey = (groupBy, groups) => {
|
|
|
892
911
|
return getGroupKey(group) === groupBy;
|
|
893
912
|
});
|
|
894
913
|
};
|
|
914
|
+
/**
|
|
915
|
+
* Determines whether the view uses the Kanban template (its level-0 group is the board lane).
|
|
916
|
+
* The lane's presence at runtime is checked separately via `state.groups[0]`, so this predicate
|
|
917
|
+
* intentionally reads only the template — it must stay valid before hydration seeds the lane.
|
|
918
|
+
* @param meta - View metadata.
|
|
919
|
+
* @returns Whether the view is a Kanban board.
|
|
920
|
+
*/
|
|
921
|
+
export const isKanbanTemplate = (meta) => {
|
|
922
|
+
return meta?.template === REPEATING_STRUCTURE_TEMPLATES.KANBAN;
|
|
923
|
+
};
|
|
895
924
|
/**
|
|
896
925
|
* Checks if the column widths have been calculated.
|
|
897
926
|
*
|
|
@@ -1013,6 +1042,23 @@ export function getVisibleColumnsFromHidden(meta, hiddenColumns) {
|
|
|
1013
1042
|
.filter(fieldDef => !hiddenColumns?.includes(fieldDef.id))
|
|
1014
1043
|
.map(fieldDef => fieldDef.id);
|
|
1015
1044
|
}
|
|
1045
|
+
/**
|
|
1046
|
+
* Derives hidden column IDs from fieldDefs by excluding visible columns.
|
|
1047
|
+
*
|
|
1048
|
+
* @param meta - View meta containing fieldDefs.
|
|
1049
|
+
* @param visibleColumns - Array of visible column IDs.
|
|
1050
|
+
* @returns Array of hidden column IDs.
|
|
1051
|
+
*/
|
|
1052
|
+
export function getHiddenColumnsFromVisible(meta, visibleColumns = [], hiddenColumns = []) {
|
|
1053
|
+
const fieldDefIds = new Set(meta.fieldDefs.map(({ id }) => id));
|
|
1054
|
+
const hiddenColumnsOutsideMeta = hiddenColumns.filter(id => !fieldDefIds.has(id) && !visibleColumns.includes(id));
|
|
1055
|
+
return [
|
|
1056
|
+
...hiddenColumnsOutsideMeta,
|
|
1057
|
+
...meta.fieldDefs
|
|
1058
|
+
.filter(fieldDef => !visibleColumns.includes(fieldDef.id))
|
|
1059
|
+
.map(fieldDef => fieldDef.id)
|
|
1060
|
+
];
|
|
1061
|
+
}
|
|
1016
1062
|
/**
|
|
1017
1063
|
* Derives visible column IDs from fieldDefs where show is true.
|
|
1018
1064
|
*
|
|
@@ -1054,11 +1100,22 @@ export const shouldCreateColumnForField = (meta, fieldDef) => {
|
|
|
1054
1100
|
].filter(Boolean);
|
|
1055
1101
|
return referenceNames.includes(fieldDef.name);
|
|
1056
1102
|
}
|
|
1057
|
-
if (template === REPEATING_STRUCTURE_TEMPLATES.GALLERY
|
|
1058
|
-
|
|
1103
|
+
if (template === REPEATING_STRUCTURE_TEMPLATES.GALLERY ||
|
|
1104
|
+
template === REPEATING_STRUCTURE_TEMPLATES.KANBAN) {
|
|
1105
|
+
const cardConfig = template === REPEATING_STRUCTURE_TEMPLATES.GALLERY
|
|
1106
|
+
? { ...meta.galleryConfig, ...meta.cardConfig }
|
|
1107
|
+
: meta.cardConfig ?? {};
|
|
1059
1108
|
const referenceIds = [
|
|
1060
|
-
|
|
1061
|
-
|
|
1109
|
+
cardConfig.header?.field,
|
|
1110
|
+
cardConfig.heroImage?.source?.field,
|
|
1111
|
+
cardConfig.heroImage?.altText && 'field' in cardConfig.heroImage.altText
|
|
1112
|
+
? cardConfig.heroImage.altText.field
|
|
1113
|
+
: undefined,
|
|
1114
|
+
cardConfig.tile?.foregroundColor?.field,
|
|
1115
|
+
cardConfig.tile?.backgroundColor?.field,
|
|
1116
|
+
cardConfig.tile?.iconName?.field,
|
|
1117
|
+
cardConfig.tile?.text?.field,
|
|
1118
|
+
...(cardConfig.subHeadings?.map(({ field }) => field) ?? [])
|
|
1062
1119
|
].filter(Boolean);
|
|
1063
1120
|
return referenceIds.includes(fieldDef.id);
|
|
1064
1121
|
}
|