@pega/lists-core 9.0.0-build.29.11 → 9.0.0-build.29.13

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.
Files changed (70) hide show
  1. package/lib/index.d.ts +1 -1
  2. package/lib/index.d.ts.map +1 -1
  3. package/lib/index.js +1 -1
  4. package/lib/index.js.map +1 -1
  5. package/lib/src/core/RsInternal.d.ts +23 -0
  6. package/lib/src/core/RsInternal.d.ts.map +1 -1
  7. package/lib/src/core/RsInternal.js +17 -0
  8. package/lib/src/core/RsInternal.js.map +1 -1
  9. package/lib/src/core/a11y/BaseA11y.d.ts.map +1 -1
  10. package/lib/src/core/a11y/BaseA11y.js +2 -1
  11. package/lib/src/core/a11y/BaseA11y.js.map +1 -1
  12. package/lib/src/core/constants.d.ts +4 -0
  13. package/lib/src/core/constants.d.ts.map +1 -1
  14. package/lib/src/core/constants.js +16 -1
  15. package/lib/src/core/constants.js.map +1 -1
  16. package/lib/src/core/features/featureFactory.d.ts +5 -0
  17. package/lib/src/core/features/featureFactory.d.ts.map +1 -1
  18. package/lib/src/core/features/featureFactory.js +5 -3
  19. package/lib/src/core/features/featureFactory.js.map +1 -1
  20. package/lib/src/core/features/uIFeatures/afterRender/animation.d.ts.map +1 -1
  21. package/lib/src/core/features/uIFeatures/afterRender/animation.js +5 -2
  22. package/lib/src/core/features/uIFeatures/afterRender/animation.js.map +1 -1
  23. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/index.d.ts +1 -1
  24. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/index.d.ts.map +1 -1
  25. package/lib/src/core/features/uIFeatures/afterRender/columnSizing/index.js.map +1 -1
  26. package/lib/src/core/features/uIFeatures/beforeRender/adjustHeight.d.ts +4 -1
  27. package/lib/src/core/features/uIFeatures/beforeRender/adjustHeight.d.ts.map +1 -1
  28. package/lib/src/core/features/uIFeatures/beforeRender/adjustHeight.js +15 -14
  29. package/lib/src/core/features/uIFeatures/beforeRender/adjustHeight.js.map +1 -1
  30. package/lib/src/core/features/uIFeatures/beforeRender/animation.d.ts.map +1 -1
  31. package/lib/src/core/features/uIFeatures/beforeRender/animation.js +3 -2
  32. package/lib/src/core/features/uIFeatures/beforeRender/animation.js.map +1 -1
  33. package/lib/src/core/features/uIFeatures/beforeRender/columnReOrder.d.ts.map +1 -1
  34. package/lib/src/core/features/uIFeatures/beforeRender/columnReOrder.js +18 -15
  35. package/lib/src/core/features/uIFeatures/beforeRender/columnReOrder.js.map +1 -1
  36. package/lib/src/core/features/uIFeatures/beforeRender/columnSizing/resize.d.ts +1 -1
  37. package/lib/src/core/features/uIFeatures/beforeRender/columnSizing/resize.d.ts.map +1 -1
  38. package/lib/src/core/features/uIFeatures/beforeRender/columnSizing/resize.js +6 -7
  39. package/lib/src/core/features/uIFeatures/beforeRender/columnSizing/resize.js.map +1 -1
  40. package/lib/src/core/features/uIFeatures/beforeRender/prepareColumns.d.ts.map +1 -1
  41. package/lib/src/core/features/uIFeatures/beforeRender/prepareColumns.js +9 -2
  42. package/lib/src/core/features/uIFeatures/beforeRender/prepareColumns.js.map +1 -1
  43. package/lib/src/core/features/uIFeatures/beforeRender/rowDragDrop.d.ts.map +1 -1
  44. package/lib/src/core/features/uIFeatures/beforeRender/rowDragDrop.js +14 -10
  45. package/lib/src/core/features/uIFeatures/beforeRender/rowDragDrop.js.map +1 -1
  46. package/lib/src/core/features/uIFeatures/beforeRender/stateHydration.d.ts.map +1 -1
  47. package/lib/src/core/features/uIFeatures/beforeRender/stateHydration.js +4 -3
  48. package/lib/src/core/features/uIFeatures/beforeRender/stateHydration.js.map +1 -1
  49. package/lib/src/core/features/uIFeatures/beforeRender/stateSanitization.d.ts.map +1 -1
  50. package/lib/src/core/features/uIFeatures/beforeRender/stateSanitization.js +2 -1
  51. package/lib/src/core/features/uIFeatures/beforeRender/stateSanitization.js.map +1 -1
  52. package/lib/src/core/features/uIFeatures/index.d.ts.map +1 -1
  53. package/lib/src/core/test/junitMocks.d.ts.map +1 -1
  54. package/lib/src/core/test/junitMocks.js +3 -0
  55. package/lib/src/core/test/junitMocks.js.map +1 -1
  56. package/lib/src/core/utils/util.d.ts +5 -0
  57. package/lib/src/core/utils/util.d.ts.map +1 -1
  58. package/lib/src/core/utils/util.js +30 -4
  59. package/lib/src/core/utils/util.js.map +1 -1
  60. package/lib/types/ApiContext.types.d.ts +11 -2
  61. package/lib/types/ApiContext.types.d.ts.map +1 -1
  62. package/lib/types/ApiContext.types.js.map +1 -1
  63. package/lib/types/Meta.types.d.ts +24 -2
  64. package/lib/types/Meta.types.d.ts.map +1 -1
  65. package/lib/types/Meta.types.js +4 -0
  66. package/lib/types/Meta.types.js.map +1 -1
  67. package/lib/types.d.ts +4 -2
  68. package/lib/types.d.ts.map +1 -1
  69. package/lib/types.js.map +1 -1
  70. package/package.json +3 -3
package/lib/index.d.ts CHANGED
@@ -2,7 +2,7 @@ export { default as initializeRsCore } from './src/core/index';
2
2
  export { convertMetaIntoState } from './src/core/features/uIFeatures/beforeRender/stateHydration';
3
3
  export { filterParams, typeMap, comparatorMap } from './src/core/config/filterConfig';
4
4
  export { getVisibileFields, dateFunctionLabels, getScrollbarWidth, getScrollerElem, getRowContextData, getFilterInitializers, getFilterConditions, isFilterApplied, addFilter, getFilters, removeEmptyValues, isEmpty, normalizeMeta } from './src/core/utils/util';
5
- export { ACTION_FIELD_TYPE, expandCollapseAllMeta, rowErrorColumnMeta, rowDragDropColumnMeta } from './src/core/constants';
5
+ export { ACTION_FIELD_TYPE, expandCollapseAllMeta, rowErrorColumnMeta, rowDragDropColumnMeta, rowDeleteColumnMeta } from './src/core/constants';
6
6
  export declare const UPDATE_DEBUG_INFO: "updateDebugInfo", TOGGLE_DISABLE_SELECTION: "toggleDisableSelection", TOGGLE_REQUIRED: "toggleRequired", NOTIFY_DATA_REFRESH: "notifyDataRefresh", USER_CONFIRMATION_ACTION: "userConfirmationAction", SET_IN_EXTERNAL_STATE: "setInExternalState", UPDATE_SELECTED_ROWS: "updateSelectedRows", SET_WARNING_MESSAGES: "setWarningMessages";
7
7
  export { getMockColumn } from './src/core/test/junitMocks';
8
8
  export { getGroupKey, getGroupFromKey } from './src/core/utils/util';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAG/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AAElG,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAEtF,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,OAAO,EACP,aAAa,EACd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAC9B,eAAO,MACL,iBAAiB,qBACjB,wBAAwB,4BACxB,eAAe,oBACf,mBAAmB,uBACnB,wBAAwB,4BACxB,qBAAqB,wBACrB,oBAAoB,wBACpB,oBAAoB,sBACP,CAAC;AAEhB,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAE/D,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,6BAA6B,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEtF,OAAO,EAAE,+BAA+B,EAAE,MAAM,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AE,MAAM,sBAAsB,CAAC"}
package/lib/index.js CHANGED
@@ -4,7 +4,7 @@ export { default as initializeRsCore } from './src/core/index';
4
4
  export { convertMetaIntoState } from './src/core/features/uIFeatures/beforeRender/stateHydration';
5
5
  export { filterParams, typeMap, comparatorMap } from './src/core/config/filterConfig';
6
6
  export { getVisibileFields, dateFunctionLabels, getScrollbarWidth, getScrollerElem, getRowContextData, getFilterInitializers, getFilterConditions, isFilterApplied, addFilter, getFilters, removeEmptyValues, isEmpty, normalizeMeta } from './src/core/utils/util';
7
- export { ACTION_FIELD_TYPE, expandCollapseAllMeta, rowErrorColumnMeta, rowDragDropColumnMeta } from './src/core/constants';
7
+ export { ACTION_FIELD_TYPE, expandCollapseAllMeta, rowErrorColumnMeta, rowDragDropColumnMeta, rowDeleteColumnMeta } from './src/core/constants';
8
8
  export const { UPDATE_DEBUG_INFO, TOGGLE_DISABLE_SELECTION, TOGGLE_REQUIRED, NOTIFY_DATA_REFRESH, USER_CONFIRMATION_ACTION, SET_IN_EXTERNAL_STATE, UPDATE_SELECTED_ROWS, SET_WARNING_MESSAGES } = ActionTypes;
9
9
  export { getMockColumn } from './src/core/test/junitMocks';
10
10
  export { getGroupKey, getGroupFromKey } from './src/core/utils/util';
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,oCAAoC,CAAC;AAE7D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAE/D,+BAA+B;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AAElG,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAEtF,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,OAAO,EACP,aAAa,EACd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAC9B,MAAM,CAAC,MAAM,EACX,iBAAiB,EACjB,wBAAwB,EACxB,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACrB,GAAG,WAAW,CAAC;AAEhB,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAI/D,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,6BAA6B,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEtF,OAAO,EAAE,+BAA+B,EAAE,MAAM,+DAA+D,CAAC;AAEhH,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["import ActionTypes from './src/core/actions/actionConstants';\n\nexport { default as initializeRsCore } from './src/core/index';\n\n// FIXME: revisit below exports\nexport { convertMetaIntoState } from './src/core/features/uIFeatures/beforeRender/stateHydration';\n\nexport { filterParams, typeMap, comparatorMap } from './src/core/config/filterConfig';\n\nexport {\n getVisibileFields,\n dateFunctionLabels,\n getScrollbarWidth,\n getScrollerElem,\n getRowContextData,\n getFilterInitializers,\n getFilterConditions,\n isFilterApplied,\n addFilter,\n getFilters,\n removeEmptyValues,\n isEmpty,\n normalizeMeta\n} from './src/core/utils/util';\n\nexport {\n ACTION_FIELD_TYPE,\n expandCollapseAllMeta,\n rowErrorColumnMeta,\n rowDragDropColumnMeta\n} from './src/core/constants';\nexport const {\n UPDATE_DEBUG_INFO,\n TOGGLE_DISABLE_SELECTION,\n TOGGLE_REQUIRED,\n NOTIFY_DATA_REFRESH,\n USER_CONFIRMATION_ACTION,\n SET_IN_EXTERNAL_STATE,\n UPDATE_SELECTED_ROWS,\n SET_WARNING_MESSAGES\n} = ActionTypes;\n\nexport { getMockColumn } from './src/core/test/junitMocks';\nexport { getGroupKey, getGroupFromKey } from './src/core/utils/util';\n\nexport { default as BaseA11y } from './src/core/a11y/BaseA11y';\n\nexport type { RsCoreTypes } from './types';\n\nexport { ROW_DENSITY, FieldType } from './types/Meta.types';\n\nexport { REPEATING_STRUCTURE_TEMPLATES, cellUpdateTrigger } from './types/Meta.types';\n\nexport { sanitizeConditionalStyleFormats } from './src/core/features/uIFeatures/beforeRender/stateSanitization';\n\nexport { rowSelectColumnMeta } from './src/core/constants';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,oCAAoC,CAAC;AAE7D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAE/D,+BAA+B;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AAElG,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAEtF,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,OAAO,EACP,aAAa,EACd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAC9B,MAAM,CAAC,MAAM,EACX,iBAAiB,EACjB,wBAAwB,EACxB,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACrB,GAAG,WAAW,CAAC;AAEhB,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAI/D,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,6BAA6B,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEtF,OAAO,EAAE,+BAA+B,EAAE,MAAM,+DAA+D,CAAC;AAEhH,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["import ActionTypes from './src/core/actions/actionConstants';\n\nexport { default as initializeRsCore } from './src/core/index';\n\n// FIXME: revisit below exports\nexport { convertMetaIntoState } from './src/core/features/uIFeatures/beforeRender/stateHydration';\n\nexport { filterParams, typeMap, comparatorMap } from './src/core/config/filterConfig';\n\nexport {\n getVisibileFields,\n dateFunctionLabels,\n getScrollbarWidth,\n getScrollerElem,\n getRowContextData,\n getFilterInitializers,\n getFilterConditions,\n isFilterApplied,\n addFilter,\n getFilters,\n removeEmptyValues,\n isEmpty,\n normalizeMeta\n} from './src/core/utils/util';\n\nexport {\n ACTION_FIELD_TYPE,\n expandCollapseAllMeta,\n rowErrorColumnMeta,\n rowDragDropColumnMeta,\n rowDeleteColumnMeta\n} from './src/core/constants';\nexport const {\n UPDATE_DEBUG_INFO,\n TOGGLE_DISABLE_SELECTION,\n TOGGLE_REQUIRED,\n NOTIFY_DATA_REFRESH,\n USER_CONFIRMATION_ACTION,\n SET_IN_EXTERNAL_STATE,\n UPDATE_SELECTED_ROWS,\n SET_WARNING_MESSAGES\n} = ActionTypes;\n\nexport { getMockColumn } from './src/core/test/junitMocks';\nexport { getGroupKey, getGroupFromKey } from './src/core/utils/util';\n\nexport { default as BaseA11y } from './src/core/a11y/BaseA11y';\n\nexport type { RsCoreTypes } from './types';\n\nexport { ROW_DENSITY, FieldType } from './types/Meta.types';\n\nexport { REPEATING_STRUCTURE_TEMPLATES, cellUpdateTrigger } from './types/Meta.types';\n\nexport { sanitizeConditionalStyleFormats } from './src/core/features/uIFeatures/beforeRender/stateSanitization';\n\nexport { rowSelectColumnMeta } from './src/core/constants';\n"]}
@@ -2,6 +2,18 @@ import type View from './generators/ViewGenerator';
2
2
  import type StateResolver from './StateResolver';
3
3
  import type RsStore from './RsStore';
4
4
  import type RsProps from './RsProps';
5
+ /**
6
+ * Browser environment context derived from the RS component's owner document.
7
+ * Provides frame-aware alternatives to the global `document` and `window`, so that
8
+ * features work correctly when the table is rendered inside an iFrame.
9
+ * Extend this interface when new browser-global properties need to be exposed to features.
10
+ */
11
+ export interface BrowserContext {
12
+ /** The document that owns the RS DOM container. Use instead of the global `document`. */
13
+ document: Document;
14
+ /** The window associated with the owner document. Use instead of the global `window`. */
15
+ window: Window & typeof globalThis;
16
+ }
5
17
  type SubscriberCallback = () => void;
6
18
  type Subscribers = {
7
19
  [eventName: string]: SubscriberCallback[];
@@ -80,6 +92,17 @@ export default class RsInternal {
80
92
  * @returns rsStateResolver instance
81
93
  */
82
94
  getRsStateResolver: () => StateResolver;
95
+ /**
96
+ * Returns the browser environment context derived from the RS component's owner document.
97
+ *
98
+ * All features should use `browserContext.document` and `browserContext.window` from
99
+ * {@link FeatureProps} instead of the global `document` and `window`. This ensures
100
+ * features work correctly when the table is rendered inside an iFrame, where the
101
+ * globals refer to the parent frame rather than the frame containing the component.
102
+ *
103
+ * @returns A {@link BrowserContext} containing the frame-aware `document` and `window`.
104
+ */
105
+ getBrowserContext: () => BrowserContext;
83
106
  }
84
107
  export {};
85
108
  //# sourceMappingURL=RsInternal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RsInternal.d.ts","sourceRoot":"","sources":["../../../src/core/RsInternal.ts"],"names":[],"mappings":"A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O,UAE5B;IAEF;;;;;OAKG;IACH,UAAU,QAAO,OAAO,CAEtB;IAEF,UAAU,GAAI,SAAS,OAAO,UAE5B;IAEF;;;;OAIG;IACH,UAAU,QAAO,OAAO,CAEtB;IAEF,cAAc,GAAI,aAAa,WAAW,UAExC;IAEF;;;;OAIG;IACH,cAAc,QAAO,WAAW,CAE9B;IAEF,sBAAsB,GAAI,qBAAqB,MAAM,IAAI,UAEvD;IAEF;;;;OAIG;IACH,sBAAsB,QAAO,CAAC,MAAM,IAAI,CAAC,CAEvC;IAEF,cAAc,GAAI,aAAa,WAAW,UAExC;IAEF;;;OAGG;IACH,cAAc,QAAO,WAAW,CAE9B;IAEF,kBAAkB,GAAI,iBAAiB,aAAa,UAElD;IAEF;;;OAGG;IACH,kBAAkB,sBAEhB;IAEF;;;;;;;;;OASG;IACH,iBAAiB,QAAO,cAAc,CAMpC;CACH"}
@@ -99,5 +99,22 @@ export default class RsInternal {
99
99
  getRsStateResolver = () => {
100
100
  return this.#rsStateResolver;
101
101
  };
102
+ /**
103
+ * Returns the browser environment context derived from the RS component's owner document.
104
+ *
105
+ * All features should use `browserContext.document` and `browserContext.window` from
106
+ * {@link FeatureProps} instead of the global `document` and `window`. This ensures
107
+ * features work correctly when the table is rendered inside an iFrame, where the
108
+ * globals refer to the parent frame rather than the frame containing the component.
109
+ *
110
+ * @returns A {@link BrowserContext} containing the frame-aware `document` and `window`.
111
+ */
112
+ getBrowserContext = () => {
113
+ const ownerDocument = this.getView().getDomContainer()?.ownerDocument ?? document;
114
+ return {
115
+ document: ownerDocument,
116
+ window: ownerDocument.defaultView ?? window
117
+ };
118
+ };
102
119
  }
103
120
  //# sourceMappingURL=RsInternal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RsInternal.js","sourceRoot":"","sources":["../../../src/core/RsInternal.ts"],"names":[],"mappings":"AACA,OAAO,kBAAkB,MAAM,iCAAiC,CAAC;AAiCjE;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,UAAU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Q,CAAC;IACvB,CAAC,CAAC;IAEF,cAAc,GAAG,CAAC,WAAwB,EAAE,EAAE;QAC5C,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IAClC,CAAC,CAAC;IAEF;;;;OAIG;IACH,cAAc,GAAG,GAAgB,EAAE;QACjC,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC,CAAC;IAEF,sBAAsB,GAAG,CAAC,mBAA+B,EAAE,EAAE;QAC3D,IAAI,CAAC,oBAAoB,GAAG,mBAAmB,CAAC;IAClD,CAAC,CAAC;IAEF;;;;OAIG;IACH,sBAAsB,GAAG,GAAiB,EAAE;QAC1C,OAAO,IAAI,CAAC,oBAAoB,CAAC;IACnC,CAAC,CAAC;IAEF,cAAc,GAAG,CAAC,WAAwB,EAAE,EAAE;QAC5C,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IAClC,CAAC,CAAC;IAEF;;;OAGG;IACH,cAAc,GAAG,GAAgB,EAAE;QACjC,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC,CAAC;IAEF,kBAAkB,GAAG,CAAC,eAA8B,EAAE,EAAE;QACtD,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;IAC1C,CAAC,CAAC;IAEF;;;OAGG;IACH,kBAAkB,GAAG,GAAG,EAAE;QACxB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC,CAAC;CACH","sourcesContent":["import type { UtilityFunctions } from './generators/viewUtilityMethods';\nimport viewUtilityMethods from './generators/viewUtilityMethods';\nimport type View from './generators/ViewGenerator';\nimport type StateResolver from './StateResolver';\nimport type RsStore from './RsStore';\nimport type RsProps from './RsProps';\n\ntype SubscriberCallback = () => void;\ntype Subscribers = {\n [eventName: string]: SubscriberCallback[];\n};\ntype PubSubUtils = {\n /**\n *\n * @param eventName - A unique event name that needs to be published\n * @param args - Any optional extra arguments of type functions to be passed to subscriber callbacks.\n * @returns void\n */\n publish: (eventName: string, ...args: (() => void)[]) => void;\n /**\n *\n * @param eventName eventName - A unique event name which needs to be subscribed.\n * @param callback Any optional extra arguments of type functions passed by publisher.\n * @returns - an unsubscribe callback.\n */\n subscribe: (\n eventName: string,\n callback: () => void\n ) =>\n | {\n unsubscribe: () => void;\n }\n | undefined;\n};\n/**\n * Represents the internal state of the core library.\n * The building blocks like features, state resolver, reducers will receive getter methods for properties from this class.\n */\nexport default class RsInternal {\n #rsStore = {} as RsStore;\n\n #rsProps = {} as RsProps;\n\n #view!: View;\n\n #subscribers: Subscribers = {};\n\n #pubSubUtils!: PubSubUtils;\n\n #rsStateResolver!: StateResolver;\n\n #afterRenderFeatures!: () => void;\n /** A set of utility functions avaliable on view using view.type */\n #viewUtilityMethods: UtilityFunctions;\n /** A unique identifier */\n id: string;\n constructor() {\n this.id = crypto.randomUUID();\n // TODO: check we have a better way to initialize the util methods on the view\n this.#viewUtilityMethods = viewUtilityMethods(this);\n }\n\n /** Returns the uuid for the rsInternal instance. */\n getRsID() {\n return this.id;\n }\n\n /** Get the latest view object */\n getView = () => {\n return this.#view;\n };\n\n /** Update the newly generated view on the internal state and attach additional methods and callback to the view. */\n updateView = (latestView: View) => {\n this.#view = latestView;\n this.#view.addUtilityFunctions(this.#viewUtilityMethods);\n this.#view.setViewUpdateCallback(this.updateView);\n };\n\n setRsStore = (rsStore: RsStore) => {\n this.#rsStore = rsStore;\n };\n\n /**\n * Get the rsStore object that can be used to store properties which are not supposed to trigger state change,\n * references or any intermediate values that the features might need.\n *\n * @returns reference to rsStore object\n */\n getRsStore = (): RsStore => {\n return this.#rsStore;\n };\n\n setRsProps = (rsProps: RsProps) => {\n this.#rsProps = rsProps;\n };\n\n /**\n * Get the rsProps object that is used to store readOnly props like apiContext, formatters etc.\n *\n * @returns reference to rsProps object\n */\n getRsProps = (): RsProps => {\n return this.#rsProps;\n };\n\n setPubSubUtils = (pubSubUtils: PubSubUtils) => {\n this.#pubSubUtils = pubSubUtils;\n };\n\n /**\n * Returns the pubSub utility methods that can be used to publish/subscribe to events like MOUNT, BEFORE_FETCH, AFTER_FETCH etc.\n *\n * @returns pubSub utils\n */\n getPubSubUtils = (): PubSubUtils => {\n return this.#pubSubUtils;\n };\n\n setAfterRenderFeatures = (afterRenderFeatures: () => void) => {\n this.#afterRenderFeatures = afterRenderFeatures;\n };\n\n /**\n * Returns the array of features like autosize that will run after the rendering has completed.\n *\n * @returns afterRender features\n */\n getAfterRenderFeatures = (): (() => void) => {\n return this.#afterRenderFeatures;\n };\n\n setSubscribers = (subscribers: Subscribers) => {\n this.#subscribers = subscribers;\n };\n\n /**\n * Returns the list of subscribers for respective events.\n * @returns - {@link Subscribers}\n */\n getSubscribers = (): Subscribers => {\n return this.#subscribers;\n };\n\n setRsStateResolver = (rsStateResolver: StateResolver) => {\n this.#rsStateResolver = rsStateResolver;\n };\n\n /**\n * Returns the instance of StateResolver.\n * @returns rsStateResolver instance\n */\n getRsStateResolver = () => {\n return this.#rsStateResolver;\n };\n}\n"]}
1
+ {"version":3,"file":"RsInternal.js","sourceRoot":"","sources":["../../../src/core/RsInternal.ts"],"names":[],"mappings":"AACA,OAAO,kBAAkB,MAAM,iCAAiC,CAAC;AA8CjE;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B,QAAQ,GAAG,EAAa,CAAC;IAEzB,QAAQ,GAAG,EAAa,CAAC;IAEzB,KAAK,CAAQ;IAEb,YAAY,GAAgB,EAAE,CAAC;IAE/B,YAAY,CAAe;IAE3B,gBAAgB,CAAiB;IAEjC,oBAAoB,CAAc;IAClC,mEAAmE;IACnE,mBAAmB,CAAmB;IACtC,0BAA0B;IAC1B,EAAE,CAAS;IACX;QACE,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QAC9B,8EAA8E;QAC9E,IAAI,CAAC,mBAAmB,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAED,oDAAoD;IACpD,OAAO;QACL,OAAO,IAAI,CAAC,EAAE,CAAC;I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CAAC,WAAwB,EAAE,EAAE;QAC5C,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IAClC,CAAC,CAAC;IAEF;;;OAGG;IACH,cAAc,GAAG,GAAgB,EAAE;QACjC,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC,CAAC;IAEF,kBAAkB,GAAG,CAAC,eAA8B,EAAE,EAAE;QACtD,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;IAC1C,CAAC,CAAC;IAEF;;;OAGG;IACH,kBAAkB,GAAG,GAAG,EAAE;QACxB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC,CAAC;IAEF;;;;;;;;;OASG;IACH,iBAAiB,GAAG,GAAmB,EAAE;QACvC,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,eAAe,EAAE,EAAE,aAAa,IAAI,QAAQ,CAAC;QAClF,OAAO;YACL,QAAQ,EAAE,aAAa;YACvB,MAAM,EAAE,aAAa,CAAC,WAAW,IAAI,MAAM;SAC5C,CAAC;IACJ,CAAC,CAAC;CACH","sourcesContent":["import type { UtilityFunctions } from './generators/viewUtilityMethods';\nimport viewUtilityMethods from './generators/viewUtilityMethods';\nimport type View from './generators/ViewGenerator';\nimport type StateResolver from './StateResolver';\nimport type RsStore from './RsStore';\nimport type RsProps from './RsProps';\n\n/**\n * Browser environment context derived from the RS component's owner document.\n * Provides frame-aware alternatives to the global `document` and `window`, so that\n * features work correctly when the table is rendered inside an iFrame.\n * Extend this interface when new browser-global properties need to be exposed to features.\n */\nexport interface BrowserContext {\n /** The document that owns the RS DOM container. Use instead of the global `document`. */\n document: Document;\n /** The window associated with the owner document. Use instead of the global `window`. */\n window: Window & typeof globalThis;\n}\n\ntype SubscriberCallback = () => void;\ntype Subscribers = {\n [eventName: string]: SubscriberCallback[];\n};\ntype PubSubUtils = {\n /**\n *\n * @param eventName - A unique event name that needs to be published\n * @param args - Any optional extra arguments of type functions to be passed to subscriber callbacks.\n * @returns void\n */\n publish: (eventName: string, ...args: (() => void)[]) => void;\n /**\n *\n * @param eventName eventName - A unique event name which needs to be subscribed.\n * @param callback Any optional extra arguments of type functions passed by publisher.\n * @returns - an unsubscribe callback.\n */\n subscribe: (\n eventName: string,\n callback: () => void\n ) =>\n | {\n unsubscribe: () => void;\n }\n | undefined;\n};\n/**\n * Represents the internal state of the core library.\n * The building blocks like features, state resolver, reducers will receive getter methods for properties from this class.\n */\nexport default class RsInternal {\n #rsStore = {} as RsStore;\n\n #rsProps = {} as RsProps;\n\n #view!: View;\n\n #subscribers: Subscribers = {};\n\n #pubSubUtils!: PubSubUtils;\n\n #rsStateResolver!: StateResolver;\n\n #afterRenderFeatures!: () => void;\n /** A set of utility functions avaliable on view using view.type */\n #viewUtilityMethods: UtilityFunctions;\n /** A unique identifier */\n id: string;\n constructor() {\n this.id = crypto.randomUUID();\n // TODO: check we have a better way to initialize the util methods on the view\n this.#viewUtilityMethods = viewUtilityMethods(this);\n }\n\n /** Returns the uuid for the rsInternal instance. */\n getRsID() {\n return this.id;\n }\n\n /** Get the latest view object */\n getView = () => {\n return this.#view;\n };\n\n /** Update the newly generated view on the internal state and attach additional methods and callback to the view. */\n updateView = (latestView: View) => {\n this.#view = latestView;\n this.#view.addUtilityFunctions(this.#viewUtilityMethods);\n this.#view.setViewUpdateCallback(this.updateView);\n };\n\n setRsStore = (rsStore: RsStore) => {\n this.#rsStore = rsStore;\n };\n\n /**\n * Get the rsStore object that can be used to store properties which are not supposed to trigger state change,\n * references or any intermediate values that the features might need.\n *\n * @returns reference to rsStore object\n */\n getRsStore = (): RsStore => {\n return this.#rsStore;\n };\n\n setRsProps = (rsProps: RsProps) => {\n this.#rsProps = rsProps;\n };\n\n /**\n * Get the rsProps object that is used to store readOnly props like apiContext, formatters etc.\n *\n * @returns reference to rsProps object\n */\n getRsProps = (): RsProps => {\n return this.#rsProps;\n };\n\n setPubSubUtils = (pubSubUtils: PubSubUtils) => {\n this.#pubSubUtils = pubSubUtils;\n };\n\n /**\n * Returns the pubSub utility methods that can be used to publish/subscribe to events like MOUNT, BEFORE_FETCH, AFTER_FETCH etc.\n *\n * @returns pubSub utils\n */\n getPubSubUtils = (): PubSubUtils => {\n return this.#pubSubUtils;\n };\n\n setAfterRenderFeatures = (afterRenderFeatures: () => void) => {\n this.#afterRenderFeatures = afterRenderFeatures;\n };\n\n /**\n * Returns the array of features like autosize that will run after the rendering has completed.\n *\n * @returns afterRender features\n */\n getAfterRenderFeatures = (): (() => void) => {\n return this.#afterRenderFeatures;\n };\n\n setSubscribers = (subscribers: Subscribers) => {\n this.#subscribers = subscribers;\n };\n\n /**\n * Returns the list of subscribers for respective events.\n * @returns - {@link Subscribers}\n */\n getSubscribers = (): Subscribers => {\n return this.#subscribers;\n };\n\n setRsStateResolver = (rsStateResolver: StateResolver) => {\n this.#rsStateResolver = rsStateResolver;\n };\n\n /**\n * Returns the instance of StateResolver.\n * @returns rsStateResolver instance\n */\n getRsStateResolver = () => {\n return this.#rsStateResolver;\n };\n\n /**\n * Returns the browser environment context derived from the RS component's owner document.\n *\n * All features should use `browserContext.document` and `browserContext.window` from\n * {@link FeatureProps} instead of the global `document` and `window`. This ensures\n * features work correctly when the table is rendered inside an iFrame, where the\n * globals refer to the parent frame rather than the frame containing the component.\n *\n * @returns A {@link BrowserContext} containing the frame-aware `document` and `window`.\n */\n getBrowserContext = (): BrowserContext => {\n const ownerDocument = this.getView().getDomContainer()?.ownerDocument ?? document;\n return {\n document: ownerDocument,\n window: ownerDocument.defaultView ?? window\n };\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"BaseA11y.d.ts","sourceRoot":"","sources":["../../../../src/core/a11y/BaseA11y.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,qBAAqB,CAAC,EAAE,MAAM,CAAC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,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW;IAW7D;;;;;;;;;;;OAWG;IACH,mBAAmB,CAAC,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO;IAwBhF;;OAEG;IACH,6BAA6B,IAAI,WAAW,GAAG,IAAI;IAkBnD;;;;;;;OAOG;IACH,sBAAsB;IAOtB;;;;OAIG;IACH,2BAA2B,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM;;;;;IASnF;;;;OAIG;IAEH,gCAAgC,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO;IAiLtE;;OAEG;IACH,4BAA4B,CAAC,KAAK,EAAE,aAAa;IA6BjD;;;;OAIG;IACH,WAAW,CAAC,KAAK,EAAE,aAAa;IAsBhC;;;;;;;;;;OAUG;IACH,cAAc,CAAC,QAAQ,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE;IAwChD,iBAAiB;IAWjB;;;;;;;;;;OAUG;IACH,4BAA4B,CAAC,KAAK,EAAE,UAAU;IAmB9C,cAAc;IAId,aAAa,CAAC,KAAK,EAAE,UAAU;CAWhC;AAED,eAAe,QAAQ,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { isInstance } from '@pega/cosmos-react-core';
1
2
  const keys = {
2
3
  TAB: 9,
3
4
  ENTER: 13,
@@ -468,7 +469,7 @@ class BaseA11y {
468
469
  */
469
470
  a11yHandler(event) {
470
471
  const rootNode = this.container.getRootNode();
471
- if (!(rootNode instanceof Document || rootNode instanceof ShadowRoot))
472
+ if (!isInstance(rootNode, Document, ShadowRoot))
472
473
  return;
473
474
  const currentCol = rootNode.activeElement?.closest(this.selectors.focusElementSelector);
474
475
  const belowLoader = this.selectors.belowLoader
@@ -1 +1 @@
1
- {"version":3,"file":"BaseA11y.js","sourceRoot":"","sources":["../../../../src/core/a11y/BaseA11y.ts"],"names":[],"mapp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AA4B,CAAC,EAAE,CAAC;YAC7E,IAAI,eAAe,CAAC;YAEpB,IAAK,KAAK,CAAC,MAAsB,CAAC,YAAY,CAAC,gBAAgB,CAAC,EAAE,CAAC;gBACjE,eAAe,GAAG;oBAChB,WAAW,EAAE,QAAQ,CAAE,KAAK,CAAC,MAAsB,CAAC,YAAY,CAAC,gBAAgB,CAAE,EAAE,EAAE,CAAC;iBACzF,CAAC;YACJ,CAAC;YACD,IAAI,eAAe,EAAE,CAAC;gBACpB,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;YACvC,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC3B,CAAC;QACH,CAAC;IACH,CAAC;IAED,cAAc;QACZ,IAAI,CAAC,UAAU,CAAC,QAAQ,GAAG,IAAI,CAAC;IAClC,CAAC;IAED,aAAa,CAAC,KAAiB;QAC7B,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC;QAC1C,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC;QAC1C,sIAAsI;QACtI,IACE,aAAa,KAAK,IAAI;YACtB,CAAC,CAAC,aAAa,IAAK,aAA6B,CAAC,QAAQ,CAAC,aAA4B,CAAC,CAAC,EACzF,CAAC;YACD,IAAI,CAAC,UAAU,CAAC,QAAQ,GAAG,KAAK,CAAC;QACnC,CAAC;IACH,CAAC;CACF;AAED,eAAe,QAAQ,CAAC","sourcesContent":["export type Selectors = {\n topFocusRef?: string;\n bottomFocusRef?: string;\n focusElementSelector: string;\n parentElementSelector?: string;\n aboveLoader?: string;\n belowLoader?: string;\n addActionSelector?: string;\n};\n\nconst keys: Record<string, number> = {\n TAB: 9,\n ENTER: 13,\n SPACE: 32,\n ESCAPE: 27,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40,\n HOME: 36\n} as const;\n\nconst TAB_INDEX = 'tabindex';\nconst DATA_COLUMNINDEX = 'data-columnIndex';\n\n/**\n * Sets focus on the provided HTML element.\n * It sets the `tabindex` attribute to \"0\" to ensure the element can receive keyboard focus.\n *\n * @param element - The HTML element to be focused. If `undefined`, the function does not performing any action.\n */\nfunction gainFocus(element: HTMLElement | undefined): void {\n if (!element) return;\n element.setAttribute(TAB_INDEX, '0');\n element.focus();\n}\n\n/**\n * Recursively finds the first parent element that has scrollable content.\n *\n * This function checks whether the given HTML element or any of its parent\n * elements has a scrollable content area.\n *\n * @param node - The starting HTML element to check for scrollable content.\n * If null, the function will return null.\n *\n * @returns - The first parent element with scrollable content, or null if no such element is found.\n */\nfunction getScrollParent(node: HTMLElement | null): HTMLElement | null {\n // eslint-disable-next-line eqeqeq\n if (node == null) {\n return null;\n }\n\n if (node.scrollHeight > node.clientHeight) {\n return node;\n }\n\n return getScrollParent(node.parentNode as HTMLElement);\n}\n\nclass BaseA11y {\n selectors: Selectors;\n keys: Record<string, number>;\n container: HTMLElement;\n focusableSelectors: string[];\n actionableSelectors?: string[];\n ariaLabel?: string;\n focusState: {\n focusSnapshot: {\n rowIndex: number | undefined;\n colIndex: number | undefined;\n rowKey: string | undefined;\n };\n hadFocus: boolean;\n };\n\n /**\n *\n * @param selectors\n * @param focusableSelectors Selectors which doesn't require arrow keys/typing interaction from user\n * @param customKeys\n * @param container\n * @param actionableSelectors Selectors which require arrow keys/typing interaction from user\n * @param ariaLabel\n *\n * selectors = {\n topFocusRef: '.top',\n bottomFocusRef: '.bottom',\n focusElementSelector: '.cell',\n parentElementSelector: '.row'\n };\n customKeys = {\n TAB: 9,\n ENTER: 13,\n SPACE: 32,\n ESCAPE: 27,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40\n };\n focusableSelectors = ['button', 'a[href]'];\n actionableSelectors = ['select', 'textarea']\n ariaLabel = 'Interactive content'\n */\n constructor(\n selectors: Selectors,\n focusableSelectors: string[],\n // eslint-disable-next-line @typescript-eslint/default-param-last\n customKeys: Record<string, number> = {},\n container: HTMLElement,\n actionableSelectors?: string[],\n ariaLabel?: string\n ) {\n this.selectors = { ...selectors };\n this.keys = { ...keys, ...customKeys };\n this.container = container;\n this.focusableSelectors = focusableSelectors;\n this.actionableSelectors = actionableSelectors;\n this.ariaLabel = ariaLabel;\n this.focusState = {\n focusSnapshot: { rowIndex: undefined, colIndex: undefined, rowKey: undefined },\n hadFocus: false\n };\n }\n\n /**\n * Sets the container element\n */\n setContainer(container: HTMLElement) {\n this.container = container;\n }\n\n /**\n * Handles tab key navigation within a focusable region. It focuses on the top or bottom\n * focusable element based on the `Shift` key press in combination with the `Tab` key.\n *\n * - If `Shift + Tab` is pressed, it focuses the `topFocusableElement`.\n * - If only `Tab` is pressed, it focuses the `bottomFocusableElement`.\n *\n * @param event - The keyboard event object containing details of the pressed key.\n */\n tabHandler(event: KeyboardEvent) {\n const topFocusableElement = this.selectors.topFocusRef\n ? this.container.parentElement?.querySelector(this.selectors.topFocusRef)\n : null;\n const bottomFocusableElement = this.selectors.bottomFocusRef\n ? this.container.parentElement?.querySelector(this.selectors.bottomFocusRef)\n : null;\n if (event.shiftKey && topFocusableElement) {\n const shiftTabKeyEvent = new KeyboardEvent('keypress', {\n bubbles: true,\n cancelable: true,\n key: 'Tab',\n shiftKey: true,\n keyCode: 9\n });\n\n (topFocusableElement as HTMLElement).focus();\n topFocusableElement.dispatchEvent(shiftTabKeyEvent);\n } else if (bottomFocusableElement) {\n const keyboardEvent = new KeyboardEvent('keypress', {\n bubbles: true,\n cancelable: true,\n key: 'Tab',\n shiftKey: false,\n keyCode: 9\n });\n\n (bottomFocusableElement as HTMLElement).focus();\n bottomFocusableElement.dispatchEvent(keyboardEvent);\n }\n }\n\n /**\n * Determines whether an element can receive focus.\n * Checks that the element is not disabled, not inside an inert container, and is visible.\n *\n * @param el - The element to check for focusability.\n * @returns `true` if the element can receive focus, `false` otherwise.\n */\n static isElementFocusable(el: HTMLElement): boolean {\n return (\n !el.hasAttribute('disabled') &&\n !el.closest('[inert]') &&\n (el.checkVisibility?.() ?? getComputedStyle(el).visibility !== 'hidden')\n );\n }\n\n /**\n * Retrieves all focusable elements within a given element based on the `focusableSelectors` array.\n * Filters out disabled elements, those inside inert containers, and visually hidden elements.\n *\n * @param column - The element from which to get focusable elements.\n * @returns An array of all focusable HTML elements found inside element.\n */\n getFocusableElementsInCell(column: Element): HTMLElement[] {\n const elements = column.querySelectorAll<HTMLElement>(this.focusableSelectors.join(','));\n return [...elements].filter(el => BaseA11y.isElementFocusable(el));\n }\n\n /**\n * Determines whether a given DOM element is a grid cell.\n * @param column - The DOM element to check.\n * @returns Returns `true` if the element contains the specified CSS class, indicating it's a grid cell, otherwise `false`.\n *\n * @private\n */\n #isGridCell(column: Element): boolean {\n return column.classList.contains(this.selectors.focusElementSelector.substring(1));\n }\n\n /**\n * @param row\n */\n getSortedColumns(row: HTMLElement | null): (Element | HTMLElement)[] {\n return [...(row?.querySelectorAll(this.selectors.focusElementSelector) ?? [])];\n }\n\n /**\n * @param event\n */\n stopEventHandler(event: KeyboardEvent) {\n return (\n (event.target as HTMLElement).getAttribute('aria-expanded') === 'true' ||\n (event.target as HTMLElement).closest('.popper') ||\n !Object.values(this.keys).includes(event.keyCode)\n );\n }\n\n /**\n * Sets focus on the loader element and stores the column index of the current focused element.\n *\n * @param loader - The loader element that will receive focus.\n * @param currentCol - The currently focused column element whose index will be stored.\n *\n * @returns void\n */\n setFocusOnLoader(loader: HTMLElement, currentCol: HTMLElement) {\n // Store the current focussed cell - useful when coming back\n const restoreFocusRef = {\n columnIndex: [\n ...this.container.querySelectorAll(this.selectors.focusElementSelector)\n ].indexOf(currentCol)\n };\n loader.setAttribute(DATA_COLUMNINDEX, restoreFocusRef.columnIndex.toString());\n loader.focus();\n }\n\n /**\n * Handles the `Tab` key navigation within a container element .\n * Ensures that when the user tabs out of the repeating structures, focus can be restored to the\n * previously active cell (from which the user tabbed out). If `shiftKey` is pressed (indicating reverse tabbing), the focus will move to the\n * top boundary element, otherwise, it moves to the bottom boundary element.\n *\n * @param event - The keyboard event triggered by the `Tab` key.\n * @param currentCol - The current column (cell) element from which the user is tabbing out.\n * @param shiftKey - A boolean indicating if the `Shift` key is pressed (for reverse tabbing).\n *\n * @returns void\n */\n containerTabHandler(event: KeyboardEvent, currentCol: Element, shiftKey: boolean) {\n // focus should be restored to the cell\n // from which user has tabbed out from the table\n let hiddenBoundaryElement = this.selectors.bottomFocusRef\n ? this.container.parentElement?.querySelector(this.selectors.bottomFocusRef)\n : null;\n if (shiftKey) {\n hiddenBoundaryElement = this.selectors.topFocusRef\n ? this.container.parentElement?.querySelector(this.selectors.topFocusRef)\n : null;\n }\n\n const restoreFocusRef = {\n columnIndex: [\n ...this.container.querySelectorAll(this.selectors.focusElementSelector)\n ].indexOf(currentCol)\n };\n if (hiddenBoundaryElement) {\n hiddenBoundaryElement.setAttribute(DATA_COLUMNINDEX, restoreFocusRef.columnIndex.toString());\n }\n\n this.tabHandler(event);\n }\n\n /**\n * Returns the first focusable element in the `container`.\n */\n getFocusableElementOnCtrlHome(): HTMLElement | null {\n return this.container.querySelector(this.selectors.focusElementSelector);\n }\n\n /**\n * Scrolls the nearest scrollable parent of a focusable element to the top.\n *\n * @private\n */\n #scrollToTop() {\n const scrollableParent = getScrollParent(\n this.container.querySelector(this.selectors.focusElementSelector)\n );\n if (scrollableParent) {\n scrollableParent.scrollTop = 0;\n }\n }\n\n /**\n * Handles the `Ctrl + Home` keypress event.\n *\n * It focuses the first focusable element in the container of the repeating structures,\n * and ensures that the view scrolls to the top after focusing.\n *\n * @returns void\n */\n handleCtrlHomeKeypress() {\n const cellToFocus = this.getFocusableElementOnCtrlHome();\n this.#focusFirstElementInCell(cellToFocus);\n\n this.#scrollToTop();\n }\n\n /**\n * @param nextItem\n * @param currentCol\n * @param keyCode\n */\n handleAnnouncementForErrors(nextItem: Element, currentCol: Element, keyCode: number) {\n return {\n ...this,\n nextItem,\n currentCol,\n keyCode\n };\n }\n\n /**\n * @param nextCol - The next item to focus on.\n * @param currentCol- The current element that has focus.\n * override this method for specific RS template\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, class-methods-use-this\n toggleStyleFormatAriaDescription(nextCol: Element, currentCol: Element) {}\n /**\n * Handles keyboard navigation. This method processes keyboard events like arrow keys, tab, home. It updates the `tabindex` of elements and supports accessibility\n * announcements for error handling.\n *\n * @param event - The keyboard event triggered by the user.\n * @param currentCol - The current element that has focus.\n *\n * @returns void\n *\n * @private\n */\n #containerEventHandlers(event: KeyboardEvent, currentCol: Element) {\n const { keyCode, shiftKey, ctrlKey } = event;\n if (this.stopEventHandler(event)) {\n return;\n }\n let nextItem: Element | undefined | null;\n\n if (this.selectors.parentElementSelector) {\n ({ nextItem } = this.#processWithParentSelector(\n currentCol as HTMLElement,\n keyCode,\n ctrlKey,\n nextItem\n ));\n } else {\n switch (keyCode) {\n case this.keys.UP:\n case this.keys.LEFT:\n nextItem = currentCol.previousElementSibling;\n break;\n case this.keys.RIGHT:\n case this.keys.DOWN:\n nextItem = currentCol.nextElementSibling;\n break;\n case this.keys.HOME:\n if (ctrlKey) {\n nextItem = this.container.querySelector(this.selectors.focusElementSelector);\n }\n break;\n default:\n }\n }\n\n if (keyCode === this.keys.TAB) {\n this.containerTabHandler(event, currentCol, shiftKey);\n }\n if (nextItem && currentCol) {\n event.preventDefault();\n const focusableElements = this.getFocusableElementsInCell(nextItem);\n // we will be supporting focus directly on the inner focusable elements so\n // tags like a, buttons should be skipped for focus on pressing tab\n if (!!this.actionableSelectors && !!this.ariaLabel) {\n const nextActionableElements = nextItem.querySelectorAll(\n this.actionableSelectors.join(',')\n );\n const nextFocusableElements = nextItem.querySelectorAll(this.focusableSelectors.join(','));\n const currentActionableElements = currentCol.querySelectorAll(\n this.actionableSelectors.join(',')\n );\n const currentFocusableElements = nextItem.querySelectorAll(\n this.focusableSelectors.join(',')\n );\n if (nextActionableElements.length || nextFocusableElements.length > 1) {\n nextItem.setAttribute('aria-label', this.ariaLabel);\n }\n if (currentActionableElements.length || currentFocusableElements.length > 1) {\n currentCol.removeAttribute('aria-label');\n }\n }\n currentCol.setAttribute('tabindex', '-1');\n if (focusableElements.length === 1 && this.#isGridCell(nextItem)) {\n this.handleAnnouncementForErrors(focusableElements[0], currentCol, keyCode);\n gainFocus(focusableElements[0]);\n } else {\n this.handleAnnouncementForErrors(nextItem, currentCol, keyCode);\n\n gainFocus(nextItem as HTMLElement);\n }\n\n this.toggleStyleFormatAriaDescription(nextItem, currentCol);\n }\n }\n\n /**\n * This method processes keyboard navigation events and moves focus between elements inside containers,\n * based on the arrow keys (up, down, left, right) and the Home key.\n *\n * @param currentCol - The current focused column element.\n * @param keyCode - The keycode of the pressed key (e.g., arrow keys, home key).\n * @param ctrlKey - Indicates if the `Ctrl` key was held down during the key press.\n * @param nextItem - The next item to focus on, updated by this function.\n *\n * @returns - Returns an object containing the index of the current element within its parent, the index of its parent element, and the next item to focus on.\n */\n #processWithParentSelector(\n currentCol: HTMLElement,\n keyCode: number,\n ctrlKey: boolean,\n nextItem: Element | undefined | null\n ) {\n const parentElements = this.container.querySelectorAll(this.selectors.parentElementSelector!);\n const indexOfCurrentEleInParent = [\n ...(currentCol\n .closest(this.selectors.parentElementSelector!)\n ?.querySelectorAll(this.selectors.focusElementSelector) ?? [])\n ].indexOf(currentCol);\n const currentEleParentIndex = [...parentElements].indexOf(\n currentCol.closest(this.selectors.parentElementSelector!)!\n );\n const sortedColumns = this.getSortedColumns(\n currentCol.closest(this.selectors.parentElementSelector!)\n );\n switch (keyCode) {\n case this.keys.HOME:\n if (ctrlKey) {\n this.handleCtrlHomeKeypress();\n }\n break;\n case this.keys.UP: {\n // Above Loader handler\n const aboveLoader = this.selectors.aboveLoader\n ? (this.container.querySelector(this.selectors.aboveLoader) as HTMLElement | null)\n : null;\n if (aboveLoader && currentEleParentIndex - 1 === 0) {\n this.setFocusOnLoader(aboveLoader, currentCol);\n } else if (currentEleParentIndex - 1 >= 0) {\n nextItem = parentElements[currentEleParentIndex - 1].querySelectorAll(\n this.selectors.focusElementSelector\n )[indexOfCurrentEleInParent];\n }\n break;\n }\n case this.keys.DOWN: {\n // Below Loader handler\n const belowLoader = this.selectors.belowLoader\n ? (this.container.querySelector(this.selectors.belowLoader) as HTMLElement | null)\n : null;\n if (belowLoader && parentElements.length === currentEleParentIndex + 1) {\n this.setFocusOnLoader(belowLoader, currentCol);\n } else if (parentElements.length > currentEleParentIndex + 1) {\n nextItem = parentElements[currentEleParentIndex + 1].querySelectorAll(\n this.selectors.focusElementSelector\n )[indexOfCurrentEleInParent];\n }\n break;\n }\n case this.keys.LEFT:\n nextItem = sortedColumns[sortedColumns.indexOf(currentCol) - 1];\n break;\n case this.keys.RIGHT:\n nextItem = sortedColumns[sortedColumns.indexOf(currentCol) + 1];\n break;\n default:\n }\n return { indexOfCurrentEleInParent, currentEleParentIndex, nextItem };\n }\n\n /**\n * Determines if the current element contains any `focusable` element.\n */\n #isFocusableElement(element: HTMLElement) {\n const colItem = element.closest(this.selectors.focusElementSelector);\n if (!colItem) return false;\n return [...colItem.querySelectorAll(this.focusableSelectors.join(','))].includes(element);\n }\n\n /**\n * Determines if the current element contains any `Actionable` elements like TextInput, TextArea\n */\n #isActionableElement(element: HTMLElement) {\n const colItem = element.closest(this.selectors.focusElementSelector);\n if (!colItem || !this.actionableSelectors) return false;\n return [...colItem.querySelectorAll(this.actionableSelectors.join(','))].includes(element);\n }\n\n /**\n * @param event\n */\n dynamicLoadersKeyDownHandler(event: KeyboardEvent) {\n const { keyCode } = event;\n event.stopPropagation();\n event.preventDefault();\n\n if (\n this.container &&\n (((event.target as HTMLElement).classList.contains(\n this.selectors.aboveLoader!.substring(1)\n ) &&\n keyCode === this.keys.DOWN) ||\n ((event.target as HTMLElement).classList.contains(\n this.selectors.belowLoader!.substring(1)\n ) &&\n keyCode === this.keys.UP))\n ) {\n let restoreFocusRef;\n\n if ((event.target as HTMLElement).hasAttribute(DATA_COLUMNINDEX)) {\n restoreFocusRef = {\n columnIndex: parseInt((event.target as HTMLElement).getAttribute(DATA_COLUMNINDEX)!, 10)\n };\n this.setFocusToCell(restoreFocusRef);\n return true;\n }\n }\n return false;\n }\n\n /**\n * Handles the keyboard navigation of a repeating structures.\n *\n * @public\n */\n a11yHandler(event: KeyboardEvent) {\n const rootNode = this.container.getRootNode();\n if (!(rootNode instanceof Document || rootNode instanceof ShadowRoot)) return;\n const currentCol = rootNode.activeElement?.closest(this.selectors.focusElementSelector);\n const belowLoader = this.selectors.belowLoader\n ? this.container.querySelector(this.selectors.belowLoader)\n : null;\n const aboveLoader = this.selectors.aboveLoader\n ? this.container.querySelector(this.selectors.aboveLoader)\n : null;\n\n if (\n currentCol === rootNode.activeElement ||\n this.#isFocusableElement(rootNode.activeElement as HTMLElement) ||\n this.#isActionableElement(rootNode.activeElement as HTMLElement)\n ) {\n this.#containerEventHandlers(event, currentCol as HTMLElement);\n } else if (belowLoader === event.target || aboveLoader === event.target) {\n this.dynamicLoadersKeyDownHandler(event);\n }\n }\n\n /**\n * Sets the focus to a specific cell in the grid based on the given position. If there is exactly one focusable element in a cell,\n * focus is set on it. Otherwise, the entire cell receives focus.\n *\n * If the specified cell cannot be found, focus is set on the first focusable element.\n *\n * @param position - The position of the cell to focus.\n * @param position.columnIndex - The index of the column for which the focus should be set.\n *\n * @returns void\n */\n setFocusToCell(position: { columnIndex: number }) {\n const { columnIndex } = position;\n const cellToFocus = this.container.querySelectorAll(this.selectors.focusElementSelector)[\n columnIndex\n ];\n if (cellToFocus) {\n const focusableElements = this.getFocusableElementsInCell(cellToFocus);\n // we will be supporting focus directly on the inner focusable elements so\n // tags like a, buttons should be skipped for focus on pressing tab\n if (\n focusableElements.length === 1 &&\n this.#isGridCell(cellToFocus)\n // Enable this in EPIC-80524\n // || isSelectAllCheckbox(focusableElements[0])\n ) {\n gainFocus(focusableElements[0]);\n } else {\n gainFocus(cellToFocus as HTMLElement);\n }\n } else {\n this.focusFirstElement();\n }\n }\n\n /**\n * @param firstCell\n */\n #focusFirstElementInCell(firstCell: Element | null) {\n if (!firstCell) return;\n const focusableElements = this.getFocusableElementsInCell(firstCell);\n // if there is only one focusable element in cell, e.g. a[href], radio etc, focus on that\n if (focusableElements.length === 1 && this.#isGridCell(firstCell)) {\n gainFocus(focusableElements[0]);\n } else {\n // if there are multiple focusable elements in cell or the cell is not a grid cell, focus on whole cell\n\n gainFocus(firstCell as HTMLElement);\n }\n }\n\n focusFirstElement() {\n const row = this.selectors.parentElementSelector\n ? this.container.querySelector(this.selectors.parentElementSelector)\n : null;\n if (row) {\n const firstCell = row.querySelector(this.selectors.focusElementSelector);\n\n this.#focusFirstElementInCell(firstCell);\n }\n }\n\n /**\n * Handles focus events on boundary elements within the container.\n * This method stops the propagation of the focus event and checks whether the focus has moved\n * outside of the specified container. If so, it determines whether to restore focus to a specific\n * cell or to the first focusable element within the container.\n *\n * @param event - The focus event object, which includes the element that lost focus\n * (via the `relatedTarget` property).\n *\n * @returns void\n */\n boundaryElementsFocusHandler(event: FocusEvent) {\n const { relatedTarget } = event;\n event.stopPropagation();\n if (this.container && !this.container.contains(relatedTarget as HTMLElement)) {\n let restoreFocusRef;\n\n if ((event.target as HTMLElement).hasAttribute(DATA_COLUMNINDEX)) {\n restoreFocusRef = {\n columnIndex: parseInt((event.target as HTMLElement).getAttribute(DATA_COLUMNINDEX)!, 10)\n };\n }\n if (restoreFocusRef) {\n this.setFocusToCell(restoreFocusRef);\n } else {\n this.focusFirstElement();\n }\n }\n }\n\n onFocusHandler() {\n this.focusState.hadFocus = true;\n }\n\n onBlurHandler(event: FocusEvent) {\n const currentTarget = event.currentTarget;\n const relatedTarget = event.relatedTarget;\n // If relatedTarget is within the currentTarget i.e. RS container, skip the blur event capture as focus is still within the container.\n if (\n relatedTarget === null ||\n !(currentTarget && (currentTarget as HTMLElement).contains(relatedTarget as HTMLElement))\n ) {\n this.focusState.hadFocus = false;\n }\n }\n}\n\nexport default BaseA11y;\n"]}
1
+ {"version":3,"file":"BaseA11y.js","sourceRoot":"","sources":["../../../../src/core/a11y/BaseA11y.ts"],"names":[],"mappings":"AAAA,OAAO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C,SAAS,CAAC,QAAQ,CAAC,aAA4B,CAAC,EAAE,CAAC;YAC7E,IAAI,eAAe,CAAC;YAEpB,IAAK,KAAK,CAAC,MAAsB,CAAC,YAAY,CAAC,gBAAgB,CAAC,EAAE,CAAC;gBACjE,eAAe,GAAG;oBAChB,WAAW,EAAE,QAAQ,CAAE,KAAK,CAAC,MAAsB,CAAC,YAAY,CAAC,gBAAgB,CAAE,EAAE,EAAE,CAAC;iBACzF,CAAC;YACJ,CAAC;YACD,IAAI,eAAe,EAAE,CAAC;gBACpB,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;YACvC,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC3B,CAAC;QACH,CAAC;IACH,CAAC;IAED,cAAc;QACZ,IAAI,CAAC,UAAU,CAAC,QAAQ,GAAG,IAAI,CAAC;IAClC,CAAC;IAED,aAAa,CAAC,KAAiB;QAC7B,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC;QAC1C,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC;QAC1C,sIAAsI;QACtI,IACE,aAAa,KAAK,IAAI;YACtB,CAAC,CAAC,aAAa,IAAK,aAA6B,CAAC,QAAQ,CAAC,aAA4B,CAAC,CAAC,EACzF,CAAC;YACD,IAAI,CAAC,UAAU,CAAC,QAAQ,GAAG,KAAK,CAAC;QACnC,CAAC;IACH,CAAC;CACF;AAED,eAAe,QAAQ,CAAC","sourcesContent":["import { isInstance } from '@pega/cosmos-react-core';\n\nexport type Selectors = {\n topFocusRef?: string;\n bottomFocusRef?: string;\n focusElementSelector: string;\n parentElementSelector?: string;\n aboveLoader?: string;\n belowLoader?: string;\n addActionSelector?: string;\n};\n\nconst keys: Record<string, number> = {\n TAB: 9,\n ENTER: 13,\n SPACE: 32,\n ESCAPE: 27,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40,\n HOME: 36\n} as const;\n\nconst TAB_INDEX = 'tabindex';\nconst DATA_COLUMNINDEX = 'data-columnIndex';\n\n/**\n * Sets focus on the provided HTML element.\n * It sets the `tabindex` attribute to \"0\" to ensure the element can receive keyboard focus.\n *\n * @param element - The HTML element to be focused. If `undefined`, the function does not performing any action.\n */\nfunction gainFocus(element: HTMLElement | undefined): void {\n if (!element) return;\n element.setAttribute(TAB_INDEX, '0');\n element.focus();\n}\n\n/**\n * Recursively finds the first parent element that has scrollable content.\n *\n * This function checks whether the given HTML element or any of its parent\n * elements has a scrollable content area.\n *\n * @param node - The starting HTML element to check for scrollable content.\n * If null, the function will return null.\n *\n * @returns - The first parent element with scrollable content, or null if no such element is found.\n */\nfunction getScrollParent(node: HTMLElement | null): HTMLElement | null {\n // eslint-disable-next-line eqeqeq\n if (node == null) {\n return null;\n }\n\n if (node.scrollHeight > node.clientHeight) {\n return node;\n }\n\n return getScrollParent(node.parentNode as HTMLElement);\n}\n\nclass BaseA11y {\n selectors: Selectors;\n keys: Record<string, number>;\n container: HTMLElement;\n focusableSelectors: string[];\n actionableSelectors?: string[];\n ariaLabel?: string;\n focusState: {\n focusSnapshot: {\n rowIndex: number | undefined;\n colIndex: number | undefined;\n rowKey: string | undefined;\n };\n hadFocus: boolean;\n };\n\n /**\n *\n * @param selectors\n * @param focusableSelectors Selectors which doesn't require arrow keys/typing interaction from user\n * @param customKeys\n * @param container\n * @param actionableSelectors Selectors which require arrow keys/typing interaction from user\n * @param ariaLabel\n *\n * selectors = {\n topFocusRef: '.top',\n bottomFocusRef: '.bottom',\n focusElementSelector: '.cell',\n parentElementSelector: '.row'\n };\n customKeys = {\n TAB: 9,\n ENTER: 13,\n SPACE: 32,\n ESCAPE: 27,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40\n };\n focusableSelectors = ['button', 'a[href]'];\n actionableSelectors = ['select', 'textarea']\n ariaLabel = 'Interactive content'\n */\n constructor(\n selectors: Selectors,\n focusableSelectors: string[],\n // eslint-disable-next-line @typescript-eslint/default-param-last\n customKeys: Record<string, number> = {},\n container: HTMLElement,\n actionableSelectors?: string[],\n ariaLabel?: string\n ) {\n this.selectors = { ...selectors };\n this.keys = { ...keys, ...customKeys };\n this.container = container;\n this.focusableSelectors = focusableSelectors;\n this.actionableSelectors = actionableSelectors;\n this.ariaLabel = ariaLabel;\n this.focusState = {\n focusSnapshot: { rowIndex: undefined, colIndex: undefined, rowKey: undefined },\n hadFocus: false\n };\n }\n\n /**\n * Sets the container element\n */\n setContainer(container: HTMLElement) {\n this.container = container;\n }\n\n /**\n * Handles tab key navigation within a focusable region. It focuses on the top or bottom\n * focusable element based on the `Shift` key press in combination with the `Tab` key.\n *\n * - If `Shift + Tab` is pressed, it focuses the `topFocusableElement`.\n * - If only `Tab` is pressed, it focuses the `bottomFocusableElement`.\n *\n * @param event - The keyboard event object containing details of the pressed key.\n */\n tabHandler(event: KeyboardEvent) {\n const topFocusableElement = this.selectors.topFocusRef\n ? this.container.parentElement?.querySelector(this.selectors.topFocusRef)\n : null;\n const bottomFocusableElement = this.selectors.bottomFocusRef\n ? this.container.parentElement?.querySelector(this.selectors.bottomFocusRef)\n : null;\n if (event.shiftKey && topFocusableElement) {\n const shiftTabKeyEvent = new KeyboardEvent('keypress', {\n bubbles: true,\n cancelable: true,\n key: 'Tab',\n shiftKey: true,\n keyCode: 9\n });\n\n (topFocusableElement as HTMLElement).focus();\n topFocusableElement.dispatchEvent(shiftTabKeyEvent);\n } else if (bottomFocusableElement) {\n const keyboardEvent = new KeyboardEvent('keypress', {\n bubbles: true,\n cancelable: true,\n key: 'Tab',\n shiftKey: false,\n keyCode: 9\n });\n\n (bottomFocusableElement as HTMLElement).focus();\n bottomFocusableElement.dispatchEvent(keyboardEvent);\n }\n }\n\n /**\n * Determines whether an element can receive focus.\n * Checks that the element is not disabled, not inside an inert container, and is visible.\n *\n * @param el - The element to check for focusability.\n * @returns `true` if the element can receive focus, `false` otherwise.\n */\n static isElementFocusable(el: HTMLElement): boolean {\n return (\n !el.hasAttribute('disabled') &&\n !el.closest('[inert]') &&\n (el.checkVisibility?.() ?? getComputedStyle(el).visibility !== 'hidden')\n );\n }\n\n /**\n * Retrieves all focusable elements within a given element based on the `focusableSelectors` array.\n * Filters out disabled elements, those inside inert containers, and visually hidden elements.\n *\n * @param column - The element from which to get focusable elements.\n * @returns An array of all focusable HTML elements found inside element.\n */\n getFocusableElementsInCell(column: Element): HTMLElement[] {\n const elements = column.querySelectorAll<HTMLElement>(this.focusableSelectors.join(','));\n return [...elements].filter(el => BaseA11y.isElementFocusable(el));\n }\n\n /**\n * Determines whether a given DOM element is a grid cell.\n * @param column - The DOM element to check.\n * @returns Returns `true` if the element contains the specified CSS class, indicating it's a grid cell, otherwise `false`.\n *\n * @private\n */\n #isGridCell(column: Element): boolean {\n return column.classList.contains(this.selectors.focusElementSelector.substring(1));\n }\n\n /**\n * @param row\n */\n getSortedColumns(row: HTMLElement | null): (Element | HTMLElement)[] {\n return [...(row?.querySelectorAll(this.selectors.focusElementSelector) ?? [])];\n }\n\n /**\n * @param event\n */\n stopEventHandler(event: KeyboardEvent) {\n return (\n (event.target as HTMLElement).getAttribute('aria-expanded') === 'true' ||\n (event.target as HTMLElement).closest('.popper') ||\n !Object.values(this.keys).includes(event.keyCode)\n );\n }\n\n /**\n * Sets focus on the loader element and stores the column index of the current focused element.\n *\n * @param loader - The loader element that will receive focus.\n * @param currentCol - The currently focused column element whose index will be stored.\n *\n * @returns void\n */\n setFocusOnLoader(loader: HTMLElement, currentCol: HTMLElement) {\n // Store the current focussed cell - useful when coming back\n const restoreFocusRef = {\n columnIndex: [\n ...this.container.querySelectorAll(this.selectors.focusElementSelector)\n ].indexOf(currentCol)\n };\n loader.setAttribute(DATA_COLUMNINDEX, restoreFocusRef.columnIndex.toString());\n loader.focus();\n }\n\n /**\n * Handles the `Tab` key navigation within a container element .\n * Ensures that when the user tabs out of the repeating structures, focus can be restored to the\n * previously active cell (from which the user tabbed out). If `shiftKey` is pressed (indicating reverse tabbing), the focus will move to the\n * top boundary element, otherwise, it moves to the bottom boundary element.\n *\n * @param event - The keyboard event triggered by the `Tab` key.\n * @param currentCol - The current column (cell) element from which the user is tabbing out.\n * @param shiftKey - A boolean indicating if the `Shift` key is pressed (for reverse tabbing).\n *\n * @returns void\n */\n containerTabHandler(event: KeyboardEvent, currentCol: Element, shiftKey: boolean) {\n // focus should be restored to the cell\n // from which user has tabbed out from the table\n let hiddenBoundaryElement = this.selectors.bottomFocusRef\n ? this.container.parentElement?.querySelector(this.selectors.bottomFocusRef)\n : null;\n if (shiftKey) {\n hiddenBoundaryElement = this.selectors.topFocusRef\n ? this.container.parentElement?.querySelector(this.selectors.topFocusRef)\n : null;\n }\n\n const restoreFocusRef = {\n columnIndex: [\n ...this.container.querySelectorAll(this.selectors.focusElementSelector)\n ].indexOf(currentCol)\n };\n if (hiddenBoundaryElement) {\n hiddenBoundaryElement.setAttribute(DATA_COLUMNINDEX, restoreFocusRef.columnIndex.toString());\n }\n\n this.tabHandler(event);\n }\n\n /**\n * Returns the first focusable element in the `container`.\n */\n getFocusableElementOnCtrlHome(): HTMLElement | null {\n return this.container.querySelector(this.selectors.focusElementSelector);\n }\n\n /**\n * Scrolls the nearest scrollable parent of a focusable element to the top.\n *\n * @private\n */\n #scrollToTop() {\n const scrollableParent = getScrollParent(\n this.container.querySelector(this.selectors.focusElementSelector)\n );\n if (scrollableParent) {\n scrollableParent.scrollTop = 0;\n }\n }\n\n /**\n * Handles the `Ctrl + Home` keypress event.\n *\n * It focuses the first focusable element in the container of the repeating structures,\n * and ensures that the view scrolls to the top after focusing.\n *\n * @returns void\n */\n handleCtrlHomeKeypress() {\n const cellToFocus = this.getFocusableElementOnCtrlHome();\n this.#focusFirstElementInCell(cellToFocus);\n\n this.#scrollToTop();\n }\n\n /**\n * @param nextItem\n * @param currentCol\n * @param keyCode\n */\n handleAnnouncementForErrors(nextItem: Element, currentCol: Element, keyCode: number) {\n return {\n ...this,\n nextItem,\n currentCol,\n keyCode\n };\n }\n\n /**\n * @param nextCol - The next item to focus on.\n * @param currentCol- The current element that has focus.\n * override this method for specific RS template\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, class-methods-use-this\n toggleStyleFormatAriaDescription(nextCol: Element, currentCol: Element) {}\n /**\n * Handles keyboard navigation. This method processes keyboard events like arrow keys, tab, home. It updates the `tabindex` of elements and supports accessibility\n * announcements for error handling.\n *\n * @param event - The keyboard event triggered by the user.\n * @param currentCol - The current element that has focus.\n *\n * @returns void\n *\n * @private\n */\n #containerEventHandlers(event: KeyboardEvent, currentCol: Element) {\n const { keyCode, shiftKey, ctrlKey } = event;\n if (this.stopEventHandler(event)) {\n return;\n }\n let nextItem: Element | undefined | null;\n\n if (this.selectors.parentElementSelector) {\n ({ nextItem } = this.#processWithParentSelector(\n currentCol as HTMLElement,\n keyCode,\n ctrlKey,\n nextItem\n ));\n } else {\n switch (keyCode) {\n case this.keys.UP:\n case this.keys.LEFT:\n nextItem = currentCol.previousElementSibling;\n break;\n case this.keys.RIGHT:\n case this.keys.DOWN:\n nextItem = currentCol.nextElementSibling;\n break;\n case this.keys.HOME:\n if (ctrlKey) {\n nextItem = this.container.querySelector(this.selectors.focusElementSelector);\n }\n break;\n default:\n }\n }\n\n if (keyCode === this.keys.TAB) {\n this.containerTabHandler(event, currentCol, shiftKey);\n }\n if (nextItem && currentCol) {\n event.preventDefault();\n const focusableElements = this.getFocusableElementsInCell(nextItem);\n // we will be supporting focus directly on the inner focusable elements so\n // tags like a, buttons should be skipped for focus on pressing tab\n if (!!this.actionableSelectors && !!this.ariaLabel) {\n const nextActionableElements = nextItem.querySelectorAll(\n this.actionableSelectors.join(',')\n );\n const nextFocusableElements = nextItem.querySelectorAll(this.focusableSelectors.join(','));\n const currentActionableElements = currentCol.querySelectorAll(\n this.actionableSelectors.join(',')\n );\n const currentFocusableElements = nextItem.querySelectorAll(\n this.focusableSelectors.join(',')\n );\n if (nextActionableElements.length || nextFocusableElements.length > 1) {\n nextItem.setAttribute('aria-label', this.ariaLabel);\n }\n if (currentActionableElements.length || currentFocusableElements.length > 1) {\n currentCol.removeAttribute('aria-label');\n }\n }\n currentCol.setAttribute('tabindex', '-1');\n if (focusableElements.length === 1 && this.#isGridCell(nextItem)) {\n this.handleAnnouncementForErrors(focusableElements[0], currentCol, keyCode);\n gainFocus(focusableElements[0]);\n } else {\n this.handleAnnouncementForErrors(nextItem, currentCol, keyCode);\n\n gainFocus(nextItem as HTMLElement);\n }\n\n this.toggleStyleFormatAriaDescription(nextItem, currentCol);\n }\n }\n\n /**\n * This method processes keyboard navigation events and moves focus between elements inside containers,\n * based on the arrow keys (up, down, left, right) and the Home key.\n *\n * @param currentCol - The current focused column element.\n * @param keyCode - The keycode of the pressed key (e.g., arrow keys, home key).\n * @param ctrlKey - Indicates if the `Ctrl` key was held down during the key press.\n * @param nextItem - The next item to focus on, updated by this function.\n *\n * @returns - Returns an object containing the index of the current element within its parent, the index of its parent element, and the next item to focus on.\n */\n #processWithParentSelector(\n currentCol: HTMLElement,\n keyCode: number,\n ctrlKey: boolean,\n nextItem: Element | undefined | null\n ) {\n const parentElements = this.container.querySelectorAll(this.selectors.parentElementSelector!);\n const indexOfCurrentEleInParent = [\n ...(currentCol\n .closest(this.selectors.parentElementSelector!)\n ?.querySelectorAll(this.selectors.focusElementSelector) ?? [])\n ].indexOf(currentCol);\n const currentEleParentIndex = [...parentElements].indexOf(\n currentCol.closest(this.selectors.parentElementSelector!)!\n );\n const sortedColumns = this.getSortedColumns(\n currentCol.closest(this.selectors.parentElementSelector!)\n );\n switch (keyCode) {\n case this.keys.HOME:\n if (ctrlKey) {\n this.handleCtrlHomeKeypress();\n }\n break;\n case this.keys.UP: {\n // Above Loader handler\n const aboveLoader = this.selectors.aboveLoader\n ? (this.container.querySelector(this.selectors.aboveLoader) as HTMLElement | null)\n : null;\n if (aboveLoader && currentEleParentIndex - 1 === 0) {\n this.setFocusOnLoader(aboveLoader, currentCol);\n } else if (currentEleParentIndex - 1 >= 0) {\n nextItem = parentElements[currentEleParentIndex - 1].querySelectorAll(\n this.selectors.focusElementSelector\n )[indexOfCurrentEleInParent];\n }\n break;\n }\n case this.keys.DOWN: {\n // Below Loader handler\n const belowLoader = this.selectors.belowLoader\n ? (this.container.querySelector(this.selectors.belowLoader) as HTMLElement | null)\n : null;\n if (belowLoader && parentElements.length === currentEleParentIndex + 1) {\n this.setFocusOnLoader(belowLoader, currentCol);\n } else if (parentElements.length > currentEleParentIndex + 1) {\n nextItem = parentElements[currentEleParentIndex + 1].querySelectorAll(\n this.selectors.focusElementSelector\n )[indexOfCurrentEleInParent];\n }\n break;\n }\n case this.keys.LEFT:\n nextItem = sortedColumns[sortedColumns.indexOf(currentCol) - 1];\n break;\n case this.keys.RIGHT:\n nextItem = sortedColumns[sortedColumns.indexOf(currentCol) + 1];\n break;\n default:\n }\n return { indexOfCurrentEleInParent, currentEleParentIndex, nextItem };\n }\n\n /**\n * Determines if the current element contains any `focusable` element.\n */\n #isFocusableElement(element: HTMLElement) {\n const colItem = element.closest(this.selectors.focusElementSelector);\n if (!colItem) return false;\n return [...colItem.querySelectorAll(this.focusableSelectors.join(','))].includes(element);\n }\n\n /**\n * Determines if the current element contains any `Actionable` elements like TextInput, TextArea\n */\n #isActionableElement(element: HTMLElement) {\n const colItem = element.closest(this.selectors.focusElementSelector);\n if (!colItem || !this.actionableSelectors) return false;\n return [...colItem.querySelectorAll(this.actionableSelectors.join(','))].includes(element);\n }\n\n /**\n * @param event\n */\n dynamicLoadersKeyDownHandler(event: KeyboardEvent) {\n const { keyCode } = event;\n event.stopPropagation();\n event.preventDefault();\n\n if (\n this.container &&\n (((event.target as HTMLElement).classList.contains(\n this.selectors.aboveLoader!.substring(1)\n ) &&\n keyCode === this.keys.DOWN) ||\n ((event.target as HTMLElement).classList.contains(\n this.selectors.belowLoader!.substring(1)\n ) &&\n keyCode === this.keys.UP))\n ) {\n let restoreFocusRef;\n\n if ((event.target as HTMLElement).hasAttribute(DATA_COLUMNINDEX)) {\n restoreFocusRef = {\n columnIndex: parseInt((event.target as HTMLElement).getAttribute(DATA_COLUMNINDEX)!, 10)\n };\n this.setFocusToCell(restoreFocusRef);\n return true;\n }\n }\n return false;\n }\n\n /**\n * Handles the keyboard navigation of a repeating structures.\n *\n * @public\n */\n a11yHandler(event: KeyboardEvent) {\n const rootNode = this.container.getRootNode();\n if (!isInstance(rootNode, Document, ShadowRoot)) return;\n const currentCol = rootNode.activeElement?.closest(this.selectors.focusElementSelector);\n const belowLoader = this.selectors.belowLoader\n ? this.container.querySelector(this.selectors.belowLoader)\n : null;\n const aboveLoader = this.selectors.aboveLoader\n ? this.container.querySelector(this.selectors.aboveLoader)\n : null;\n\n if (\n currentCol === rootNode.activeElement ||\n this.#isFocusableElement(rootNode.activeElement as HTMLElement) ||\n this.#isActionableElement(rootNode.activeElement as HTMLElement)\n ) {\n this.#containerEventHandlers(event, currentCol as HTMLElement);\n } else if (belowLoader === event.target || aboveLoader === event.target) {\n this.dynamicLoadersKeyDownHandler(event);\n }\n }\n\n /**\n * Sets the focus to a specific cell in the grid based on the given position. If there is exactly one focusable element in a cell,\n * focus is set on it. Otherwise, the entire cell receives focus.\n *\n * If the specified cell cannot be found, focus is set on the first focusable element.\n *\n * @param position - The position of the cell to focus.\n * @param position.columnIndex - The index of the column for which the focus should be set.\n *\n * @returns void\n */\n setFocusToCell(position: { columnIndex: number }) {\n const { columnIndex } = position;\n const cellToFocus = this.container.querySelectorAll(this.selectors.focusElementSelector)[\n columnIndex\n ];\n if (cellToFocus) {\n const focusableElements = this.getFocusableElementsInCell(cellToFocus);\n // we will be supporting focus directly on the inner focusable elements so\n // tags like a, buttons should be skipped for focus on pressing tab\n if (\n focusableElements.length === 1 &&\n this.#isGridCell(cellToFocus)\n // Enable this in EPIC-80524\n // || isSelectAllCheckbox(focusableElements[0])\n ) {\n gainFocus(focusableElements[0]);\n } else {\n gainFocus(cellToFocus as HTMLElement);\n }\n } else {\n this.focusFirstElement();\n }\n }\n\n /**\n * @param firstCell\n */\n #focusFirstElementInCell(firstCell: Element | null) {\n if (!firstCell) return;\n const focusableElements = this.getFocusableElementsInCell(firstCell);\n // if there is only one focusable element in cell, e.g. a[href], radio etc, focus on that\n if (focusableElements.length === 1 && this.#isGridCell(firstCell)) {\n gainFocus(focusableElements[0]);\n } else {\n // if there are multiple focusable elements in cell or the cell is not a grid cell, focus on whole cell\n\n gainFocus(firstCell as HTMLElement);\n }\n }\n\n focusFirstElement() {\n const row = this.selectors.parentElementSelector\n ? this.container.querySelector(this.selectors.parentElementSelector)\n : null;\n if (row) {\n const firstCell = row.querySelector(this.selectors.focusElementSelector);\n\n this.#focusFirstElementInCell(firstCell);\n }\n }\n\n /**\n * Handles focus events on boundary elements within the container.\n * This method stops the propagation of the focus event and checks whether the focus has moved\n * outside of the specified container. If so, it determines whether to restore focus to a specific\n * cell or to the first focusable element within the container.\n *\n * @param event - The focus event object, which includes the element that lost focus\n * (via the `relatedTarget` property).\n *\n * @returns void\n */\n boundaryElementsFocusHandler(event: FocusEvent) {\n const { relatedTarget } = event;\n event.stopPropagation();\n if (this.container && !this.container.contains(relatedTarget as HTMLElement)) {\n let restoreFocusRef;\n\n if ((event.target as HTMLElement).hasAttribute(DATA_COLUMNINDEX)) {\n restoreFocusRef = {\n columnIndex: parseInt((event.target as HTMLElement).getAttribute(DATA_COLUMNINDEX)!, 10)\n };\n }\n if (restoreFocusRef) {\n this.setFocusToCell(restoreFocusRef);\n } else {\n this.focusFirstElement();\n }\n }\n }\n\n onFocusHandler() {\n this.focusState.hadFocus = true;\n }\n\n onBlurHandler(event: FocusEvent) {\n const currentTarget = event.currentTarget;\n const relatedTarget = event.relatedTarget;\n // If relatedTarget is within the currentTarget i.e. RS container, skip the blur event capture as focus is still within the container.\n if (\n relatedTarget === null ||\n !(currentTarget && (currentTarget as HTMLElement).contains(relatedTarget as HTMLElement))\n ) {\n this.focusState.hadFocus = false;\n }\n }\n}\n\nexport default BaseA11y;\n"]}
@@ -20,6 +20,10 @@ export declare const rowErrorColumnMeta: {
20
20
  field: ColumnConfig['field'];
21
21
  options: OmitStrict<ColumnConfig, 'field'>;
22
22
  };
23
+ export declare const rowDeleteColumnMeta: {
24
+ field: ColumnConfig['field'];
25
+ options: OmitStrict<ColumnConfig, 'field'>;
26
+ };
23
27
  export declare const UNSUPPORTED_HEADER_ICON_FIELD_TYPES: string[];
24
28
  export declare const RICH_TEXT = "RichText";
25
29
  export declare const STATE: {
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/core/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAI1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAEvE,eAAO,MAAM,yBAAyB,8BAA8B,CAAC;AACrE,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,eAAO,MAAM,gBAAgB,oBAAoB,CAAC;AAClD,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAqB1C,eAAO,MAAM,mBAAmB,EAAE;IAChC,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IAC7B,OAAO,EAAE,UAAU,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;CAc5C,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE;IAChC,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IAC7B,OAAO,EAAE,UAAU,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;CAe5C,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE;IAClC,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IAC7B,OAAO,EAAE,UAAU,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;CAa5C,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE;IAC/B,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IAC7B,OAAO,EAAE,UAAU,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;CAa5C,C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
79
+ export const rowDeleteColumnMeta = {
80
+ field: {
81
+ type: FieldType.ACTION_FIELD_TYPE,
82
+ name: 'RowDeleteAction',
83
+ label: 'Delete',
84
+ cellRenderer: 'RowDeleteAction',
85
+ id: 'RowDeleteAction',
86
+ ...ootbFieldMeta,
87
+ freeze: false
88
+ },
89
+ options: {
90
+ classList: ['cell-action']
91
+ }
92
+ };
79
93
  export const UNSUPPORTED_HEADER_ICON_FIELD_TYPES = [ACTION_FIELD_TYPE];
80
94
  export const RICH_TEXT = 'RichText';
81
95
  export const STATE = {
@@ -121,6 +135,7 @@ export const expandCollapseAllMeta = {
121
135
  export const NON_DRAGGABLE_COLUMNS = [
122
136
  rowSelectColumnMeta.field.id,
123
137
  rowDragDropColumnMeta.field.id,
124
- rowActionColumnMeta.field.id
138
+ rowActionColumnMeta.field.id,
139
+ rowDeleteColumnMeta.field.id
125
140
  ];
126
141
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/core/constants.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAiB,MAAM,wBAAwB,CAAC;AAIrF,MAAM,CAAC,MAAM,yBAAyB,GAAG,2BAA2B,CAAC;AACrE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AACtC,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAClD,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,CAAC;AAE1C,MAAM,aAAa,GAAsB;IACvC,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,KAAK;IACX,QAAQ,EAAE,KAAK;IACf,oEAAoE;IACpE,MAAM,EAAE,IAAI;IACZ,WAAW,EAAE,KAAK;IAClB,MAAM,EAAE,KAAK;IACb,QAAQ,EAAE,KAAK;IACf,eAAe,EAAE,KAAK;IACtB,aAAa,EAAE,KAAK;IACpB,QAAQ,EAAE,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C,MAAM,SAAS,GAAG;IACvB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;CACrB,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,CAAC;AACxC,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,KAAK,EAAE,EAAE;IACT,sLAAsL;IACtL,QAAQ,EAAE,sBAAsB;CACjC,CAAC;AACF,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,mBAAmB,CAAC,KAAK,CAAC,EAAE;IAC5B,qBAAqB,CAAC,KAAK,CAAC,EAAE;IAC9B,mBAAmB,CAAC,KAAK,CAAC,EAAE;CAC7B,CAAC","sourcesContent":["import type { OmitStrict } from '@pega/cosmos-react-core';\n\nimport { cellUpdateTrigger, FieldType, type FieldDef } from '../../types/Meta.types';\n\nimport type { ColumnConfig } from './generators/ColumnGenerator.types';\n\nexport const nonPersonalizationViewKey = 'nonPersonalizationViewKey';\nexport const defaultPresetIdIndex = 0;\nexport const EXTERNAL_FILTERS = 'externalFilters';\nexport const ACTION_FIELD_TYPE = 'action';\n\nconst ootbFieldMeta: Partial<FieldDef> = {\n resize: false,\n filter: false,\n sort: false,\n autosize: false,\n // Added freeze: true for OOTB columns to ensure state sanitization.\n freeze: true,\n aggregation: false,\n toggle: false,\n grouping: false,\n customizeColumn: false,\n combineColumn: false,\n showMenu: false,\n noContextMenu: true,\n showTooltip: false,\n reorderFields: false,\n cellUpdateTriggers: [cellUpdateTrigger.ROW_DENSITY_CHANGE]\n};\n\nexport const rowActionColumnMeta: {\n field: ColumnConfig['field'];\n options: OmitStrict<ColumnConfig, 'field'>;\n} = {\n field: {\n type: FieldType.ACTION_FIELD_TYPE,\n name: 'RowActionMenu',\n label: 'Actions',\n cellRenderer: 'RowActionMenu',\n id: 'RowActionMenu',\n ...ootbFieldMeta,\n freeze: false\n },\n options: {\n classList: ['cell-action']\n }\n};\n\nexport const rowSelectColumnMeta: {\n field: ColumnConfig['field'];\n options: OmitStrict<ColumnConfig, 'field'>;\n} = {\n field: {\n type: FieldType.ACTION_FIELD_TYPE,\n name: 'RowSelect',\n label: 'Select',\n cellRenderer: 'RowSelectHandle',\n id: 'RowSelect',\n headerCellRenderer: 'selectAllCheckboxRenderer',\n ...ootbFieldMeta\n },\n options: {\n classList: ['row-select-handle'],\n label: 'Select'\n }\n};\n\nexport const rowDragDropColumnMeta: {\n field: ColumnConfig['field'];\n options: OmitStrict<ColumnConfig, 'field'>;\n} = {\n field: {\n type: FieldType.ACTION_FIELD_TYPE,\n name: 'RowDragDrop',\n label: 'Reorder',\n cellRenderer: 'RowDragDropHandle',\n id: 'RowDragDrop',\n ...ootbFieldMeta\n },\n options: {\n classList: ['row-reorder-handle']\n }\n};\n\nexport const rowErrorColumnMeta: {\n field: ColumnConfig['field'];\n options: OmitStrict<ColumnConfig, 'field'>;\n} = {\n field: {\n type: FieldType.ACTION_FIELD_TYPE,\n name: 'RowError',\n label: 'Error',\n cellRenderer: 'RowError',\n id: 'RowError',\n ...ootbFieldMeta\n },\n options: {\n classList: ['row-error-column']\n }\n};\n\nexport const UNSUPPORTED_HEADER_ICON_FIELD_TYPES = [ACTION_FIELD_TYPE];\n\nexport const RICH_TEXT = 'RichText';\n\nexport const STATE = {\n NOT_STARTED: 'NOT_STARTED',\n IN_PROGRESS: 'IN_PROGRESS',\n FAILED: 'FAILED'\n};\n\nexport const SELECTION_MODES = {\n single: 'single',\n multi: 'multi',\n multi_on_hover: 'multi_on_hover'\n};\nexport const SUPPORTED_MODES_FOR_SELECTALL = [\n SELECTION_MODES.multi_on_hover,\n SELECTION_MODES.multi\n];\n\nexport const SUPPORTED_FLUSH_KEYS = [\n 'filterExpression',\n 'search',\n 'selectedRows',\n 'sourceID',\n 'destinationID'\n];\nexport const SUPPORTED_AVOIDABLE_FEATURES = ['rowAnimation', 'columnAnimation'];\n\n// FIXME: this should be injectable in core\nexport const rowDensityClasses: {\n [key: number]: { id: string; className: string; rowHeight?: number };\n} = {\n 1: { id: '1', className: 'short-height', rowHeight: 25 },\n 2: { id: '2', className: 'medium-height', rowHeight: 35 },\n 3: { id: '3', className: 'tall-height', rowHeight: 45.04 },\n 4: { id: '4', className: 'wrap-content-height' }\n};\n\nexport const TEMPLATES = {\n GALLERY: 'Gallery',\n TABLE: 'Table',\n TIMELINE: 'Timeline'\n};\n\nexport const DEFAULT_FORMAT = 'Default';\nexport const expandCollapseAllMeta = {\n width: 32,\n // TODO: RsCore should take this as part of contract. It wil be fixed, after setting up css classes contract OR go with some other approach if accepting CSS classes is not an option.\n selector: '.expand-collapse-all'\n};\nexport const NON_DRAGGABLE_COLUMNS = [\n rowSelectColumnMeta.field.id,\n rowDragDropColumnMeta.field.id,\n rowActionColumnMeta.field.id\n];\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/core/constants.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAiB,MAAM,wBAAwB,CAAC;AAIrF,MAAM,CAAC,MAAM,yBAAyB,GAAG,2BAA2B,CAAC;AACrE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AACtC,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAClD,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,CAAC;AAE1C,MAAM,aAAa,GAAsB;IACvC,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,KAAK;IACX,QAAQ,EAAE,KAAK;IACf,oEAAoE;IACpE,MAAM,EAAE,IAAI;IACZ,WAAW,EAAE,KAAK;IAClB,MAAM,EAAE,KAAK;IACb,QAAQ,EAAE,KAAK;IACf,eAAe,EAAE,KAAK;IACtB,aAAa,EAAE,KAAK;IACpB,QAAQ,EAAE,KAAK;IACf,aAAa,EAAE,IAAI;IACnB,WAAW,EAAE,KAAK;IAClB,aAAa,EAAE,KAAK;IACpB,kBAAkB,EAAE,CAAC,iBAA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,EAAE;IACzD,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,KAAK,EAAE;IAC1D,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,qBAAqB,EAAE;CACjD,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;CACrB,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,CAAC;AACxC,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,KAAK,EAAE,EAAE;IACT,sLAAsL;IACtL,QAAQ,EAAE,sBAAsB;CACjC,CAAC;AACF,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,mBAAmB,CAAC,KAAK,CAAC,EAAE;IAC5B,qBAAqB,CAAC,KAAK,CAAC,EAAE;IAC9B,mBAAmB,CAAC,KAAK,CAAC,EAAE;IAC5B,mBAAmB,CAAC,KAAK,CAAC,EAAE;CAC7B,CAAC","sourcesContent":["import type { OmitStrict } from '@pega/cosmos-react-core';\n\nimport { cellUpdateTrigger, FieldType, type FieldDef } from '../../types/Meta.types';\n\nimport type { ColumnConfig } from './generators/ColumnGenerator.types';\n\nexport const nonPersonalizationViewKey = 'nonPersonalizationViewKey';\nexport const defaultPresetIdIndex = 0;\nexport const EXTERNAL_FILTERS = 'externalFilters';\nexport const ACTION_FIELD_TYPE = 'action';\n\nconst ootbFieldMeta: Partial<FieldDef> = {\n resize: false,\n filter: false,\n sort: false,\n autosize: false,\n // Added freeze: true for OOTB columns to ensure state sanitization.\n freeze: true,\n aggregation: false,\n toggle: false,\n grouping: false,\n customizeColumn: false,\n combineColumn: false,\n showMenu: false,\n noContextMenu: true,\n showTooltip: false,\n reorderFields: false,\n cellUpdateTriggers: [cellUpdateTrigger.ROW_DENSITY_CHANGE]\n};\n\nexport const rowActionColumnMeta: {\n field: ColumnConfig['field'];\n options: OmitStrict<ColumnConfig, 'field'>;\n} = {\n field: {\n type: FieldType.ACTION_FIELD_TYPE,\n name: 'RowActionMenu',\n label: 'Actions',\n cellRenderer: 'RowActionMenu',\n id: 'RowActionMenu',\n ...ootbFieldMeta,\n freeze: false\n },\n options: {\n classList: ['cell-action']\n }\n};\n\nexport const rowSelectColumnMeta: {\n field: ColumnConfig['field'];\n options: OmitStrict<ColumnConfig, 'field'>;\n} = {\n field: {\n type: FieldType.ACTION_FIELD_TYPE,\n name: 'RowSelect',\n label: 'Select',\n cellRenderer: 'RowSelectHandle',\n id: 'RowSelect',\n headerCellRenderer: 'selectAllCheckboxRenderer',\n ...ootbFieldMeta\n },\n options: {\n classList: ['row-select-handle'],\n label: 'Select'\n }\n};\n\nexport const rowDragDropColumnMeta: {\n field: ColumnConfig['field'];\n options: OmitStrict<ColumnConfig, 'field'>;\n} = {\n field: {\n type: FieldType.ACTION_FIELD_TYPE,\n name: 'RowDragDrop',\n label: 'Reorder',\n cellRenderer: 'RowDragDropHandle',\n id: 'RowDragDrop',\n ...ootbFieldMeta\n },\n options: {\n classList: ['row-reorder-handle']\n }\n};\n\nexport const rowErrorColumnMeta: {\n field: ColumnConfig['field'];\n options: OmitStrict<ColumnConfig, 'field'>;\n} = {\n field: {\n type: FieldType.ACTION_FIELD_TYPE,\n name: 'RowError',\n label: 'Error',\n cellRenderer: 'RowError',\n id: 'RowError',\n ...ootbFieldMeta\n },\n options: {\n classList: ['row-error-column']\n }\n};\n\nexport const rowDeleteColumnMeta: {\n field: ColumnConfig['field'];\n options: OmitStrict<ColumnConfig, 'field'>;\n} = {\n field: {\n type: FieldType.ACTION_FIELD_TYPE,\n name: 'RowDeleteAction',\n label: 'Delete',\n cellRenderer: 'RowDeleteAction',\n id: 'RowDeleteAction',\n ...ootbFieldMeta,\n freeze: false\n },\n options: {\n classList: ['cell-action']\n }\n};\n\nexport const UNSUPPORTED_HEADER_ICON_FIELD_TYPES = [ACTION_FIELD_TYPE];\n\nexport const RICH_TEXT = 'RichText';\n\nexport const STATE = {\n NOT_STARTED: 'NOT_STARTED',\n IN_PROGRESS: 'IN_PROGRESS',\n FAILED: 'FAILED'\n};\n\nexport const SELECTION_MODES = {\n single: 'single',\n multi: 'multi',\n multi_on_hover: 'multi_on_hover'\n};\nexport const SUPPORTED_MODES_FOR_SELECTALL = [\n SELECTION_MODES.multi_on_hover,\n SELECTION_MODES.multi\n];\n\nexport const SUPPORTED_FLUSH_KEYS = [\n 'filterExpression',\n 'search',\n 'selectedRows',\n 'sourceID',\n 'destinationID'\n];\nexport const SUPPORTED_AVOIDABLE_FEATURES = ['rowAnimation', 'columnAnimation'];\n\n// FIXME: this should be injectable in core\nexport const rowDensityClasses: {\n [key: number]: { id: string; className: string; rowHeight?: number };\n} = {\n 1: { id: '1', className: 'short-height', rowHeight: 25 },\n 2: { id: '2', className: 'medium-height', rowHeight: 35 },\n 3: { id: '3', className: 'tall-height', rowHeight: 45.04 },\n 4: { id: '4', className: 'wrap-content-height' }\n};\n\nexport const TEMPLATES = {\n GALLERY: 'Gallery',\n TABLE: 'Table',\n TIMELINE: 'Timeline'\n};\n\nexport const DEFAULT_FORMAT = 'Default';\nexport const expandCollapseAllMeta = {\n width: 32,\n // TODO: RsCore should take this as part of contract. It wil be fixed, after setting up css classes contract OR go with some other approach if accepting CSS classes is not an option.\n selector: '.expand-collapse-all'\n};\nexport const NON_DRAGGABLE_COLUMNS = [\n rowSelectColumnMeta.field.id,\n rowDragDropColumnMeta.field.id,\n rowActionColumnMeta.field.id,\n rowDeleteColumnMeta.field.id\n];\n"]}
@@ -1,6 +1,7 @@
1
1
  import type { State } from 'pega-repeating-structures-core/lib/types/State.types';
2
2
  import type View from '../generators/ViewGenerator';
3
3
  import type RsInternal from '../RsInternal';
4
+ import type { BrowserContext } from '../RsInternal';
4
5
  import type RsProps from '../RsProps';
5
6
  import type StateResolver from '../StateResolver';
6
7
  import type RsStore from '../RsStore';
@@ -18,6 +19,10 @@ export type FeatureProps<WithQueuedActions extends boolean = false> = {
18
19
  getOriginalState: StateResolver['getOriginalState'];
19
20
  /** A dispatcher to dispatch RS actions. */
20
21
  dispatch: StateResolver['dispatch'];
22
+ /** Frame-aware browser environment context. Use {@link BrowserContext.document} and
23
+ * {@link BrowserContext.window} instead of the global `document` and `window` so that
24
+ * features work correctly when rendered inside an iFrame. */
25
+ browserContext: BrowserContext;
21
26
  } & (WithQueuedActions extends true ? {
22
27
  /** A queue of current actions that are dispatched. */
23
28
  queuedActions: Action[];
@@ -1 +1 @@
1
- {"version":3,"file":"featureFactory.d.ts","sourceRoot":"","sources":["../../../../src/core/features/featureFactory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sDAAsD,CAAC;AAElF,OAAO,KAAK,IAAI,MAAM,6BAA6B,CAAC;AAKpD,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,aAAa,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAIvD,MAAM,MAAM,YAAY,CAAC,iBAAiB,SAAS,OAAO,GAAG,KAAK,IAAI;IACpE,gDAAgD;IAChD,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,2CAA2C;IAC3C,UAAU,EAAE,MAAM,OAAO,CAAC;IAC1B,2CAA2C;IAC3C,UAAU,EAAE,MAAM,OAAO,CAAC;IAC1B,wDAAwD;IACxD,QAAQ,EAAE,MAAM,KAAK,CAAC;IACtB,0FAA0F;IAC1F,gBAAgB,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;IACpD,2CAA2C;IAC3C,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;CACrC,GAAG,CAAC,iBAAiB,SAAS,IAAI,GAC/B;IACE,sDAAsD;IACtD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M,OAAO,CAAC,iBAAiB,SAAS,OAAO,GAAG,KAAK,IAAI,CAC/D,UAAU,EAAE,UAAU,KACnB,CAAC,CAAC,YAAY,EAAE,YAAY,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC;AAEtE,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AAC1D,iBAAS,aAAa;kBAEJ,OAAO,CAAC,IAAI,CAAC,EAAE;iBAChB,OAAO,EAAE;EA8DzB;AAuDD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,UAAU,EAAE,UAAU,GACrB,CAAC,CAAC,YAAY,EAAE,sBAAsB,KAAK,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,MAAM,IAAI,CAAC,CAE9E"}
@@ -77,7 +77,8 @@ function initializeBeforeRenderFeatures(rsInternal) {
77
77
  getState: featureProps.getState,
78
78
  getOriginalState: featureProps.getOriginalState,
79
79
  dispatch: featureProps.dispatch,
80
- queuedActions: featureProps.queuedActions
80
+ queuedActions: featureProps.queuedActions,
81
+ browserContext: featureProps.rsInternal.getBrowserContext()
81
82
  });
82
83
  });
83
84
  }, Promise.resolve());
@@ -92,14 +93,15 @@ function initializeAfterRenderFeatures(rsInternal) {
92
93
  const afterRenderUIFeatures = features.afterRender.map(t => t(rsInternal)).filter(Boolean);
93
94
  return () => {
94
95
  afterRenderUIFeatures.forEach(feature => {
95
- if (rsInternal.getRsStore().isMounted) {
96
+ if (rsInternal.getRsStore().isMounted && rsInternal.getRsStateResolver()) {
96
97
  feature({
97
98
  getView: rsInternal.getView,
98
99
  getRsStore: rsInternal.getRsStore,
99
100
  getRsProps: rsInternal.getRsProps,
100
101
  getState: rsInternal.getRsStateResolver().getState,
101
102
  getOriginalState: rsInternal.getRsStateResolver().getOriginalState,
102
- dispatch: rsInternal.getRsStateResolver().dispatch
103
+ dispatch: rsInternal.getRsStateResolver().dispatch,
104
+ browserContext: rsInternal.getBrowserContext()
103
105
  });
104
106
  }
105
107
  });