@pega/lists-core 10.0.0-build.5.26 → 10.0.0-build.5.27
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rowDragDropUtils.d.ts","sourceRoot":"","sources":["../../../../../src/core/test/utils/rowDragDropUtils.js"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"rowDragDropUtils.d.ts","sourceRoot":"","sources":["../../../../../src/core/test/utils/rowDragDropUtils.js"],"names":[],"mappings":";;;;;;;;;;;;AAqCA,sFAMC;AAqCD,yGAKC;AAED,mEAIC;AArCD,6IAwBC;AAeD,uHAeC;AA/ED,+DAMC;AA2ED,mHAaC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable no-underscore-dangle */
|
|
2
1
|
const CLASSES = {
|
|
3
2
|
DRAG_START: 'dragStart',
|
|
4
3
|
DRAG_ENTER: 'dragEnter'
|
|
@@ -41,6 +40,7 @@ const addDragListenerToRows = (row, dragProps, dropProps) => {
|
|
|
41
40
|
dragHandle.addEventListener(DRAG_EVENTS.DRAG_END, dragProps.onDragEnd);
|
|
42
41
|
};
|
|
43
42
|
const DROP_EFFECTS = { transition: 'transform 0.25s', transform: 'translate(20px)' };
|
|
43
|
+
const styleMatchesObject = (style, expectedStyles) => Object.entries(expectedStyles).every(([property, value]) => style.getPropertyValue(property) === value);
|
|
44
44
|
const dragTarget = mockFeatureProps => mockFeatureProps.getRsStore().rowDragDropRef.dragTarget.getAttribute(ROW_DATA_INDEX);
|
|
45
45
|
const dropTarget = mockFeatureProps => mockFeatureProps.getRsStore().rowDragDropRef.dropTarget[0].getAttribute(ROW_DATA_INDEX);
|
|
46
46
|
const dragStartEventAssertions = (dragStartEvent, row, rowDragHandle, ghostImage, mockFeatureProps) => {
|
|
@@ -53,23 +53,25 @@ const dragStartEventAssertions = (dragStartEvent, row, rowDragHandle, ghostImage
|
|
|
53
53
|
expect(dragTarget(mockFeatureProps)).toBe(ROWS.FIRST);
|
|
54
54
|
expect(rowDragHandle.classList).toContain(CLASSES.DRAG_START);
|
|
55
55
|
expect(row.style.opacity).toBe('0.5');
|
|
56
|
-
|
|
56
|
+
Object.entries(expectedGhostImageStyles).forEach(([property, value]) => {
|
|
57
|
+
expect(ghostImage.style.getPropertyValue(property)).toBe(value);
|
|
58
|
+
});
|
|
57
59
|
return true;
|
|
58
60
|
};
|
|
59
61
|
const dragEnterEventAssertions = (rowElement, rowIndex, mockFeatureProps) => {
|
|
60
62
|
expect(dropTarget(mockFeatureProps)).toBe(rowIndex);
|
|
61
63
|
expect(rowElement.classList).toContain(CLASSES.DRAG_ENTER);
|
|
62
|
-
expect(rowElement.style
|
|
64
|
+
expect(styleMatchesObject(rowElement.style, DROP_EFFECTS)).toBe(true);
|
|
63
65
|
return true;
|
|
64
66
|
};
|
|
65
67
|
const dragLeaveEventAssertions = rowElement => {
|
|
66
68
|
expect(rowElement.classList).not.toContain(CLASSES.DRAG_ENTER);
|
|
67
|
-
expect(rowElement.style
|
|
69
|
+
expect(styleMatchesObject(rowElement.style, DROP_EFFECTS)).toBe(false);
|
|
68
70
|
return true;
|
|
69
71
|
};
|
|
70
72
|
const dropEventAssertions = (sourceRowElement, destinationRowElement, mockFeatureProps) => {
|
|
71
73
|
expect(destinationRowElement.classList).not.toContain(CLASSES.DRAG_ENTER);
|
|
72
|
-
expect(destinationRowElement.style
|
|
74
|
+
expect(styleMatchesObject(destinationRowElement.style, DROP_EFFECTS)).toBe(false);
|
|
73
75
|
expect(mockFeatureProps.getRsStore().rowDragDropRef).toMatchObject({
|
|
74
76
|
dropTarget: [],
|
|
75
77
|
dropZones: [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rowDragDropUtils.js","sourceRoot":"","sources":["../../../../../src/core/test/utils/rowDragDropUtils.js"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"rowDragDrop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,CAAC;QACnC,mBAAmB,EAAE,KAAK;QAC1B,eAAe,EAAE,KAAK;QACtB,UAAU,EAAE,EAAE;QACd,eAAe,EAAE,IAAI;QACrB,gBAAgB,EAAE,KAAK;KACxB,CAAC,CAAC;IACH,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3C,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,OAAO,EACL,WAAW,EACX,IAAI,EACJ,qBAAqB,EACrB,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,EACxB,mBAAmB,EACnB,YAAY,EACZ,sBAAsB,EACvB,CAAC","sourcesContent":["const CLASSES = {\n DRAG_START: 'dragStart',\n DRAG_ENTER: 'dragEnter'\n};\n\nconst DRAG_EVENTS = {\n DRAG_START: 'dragstart',\n DRAG_END: 'dragend',\n DRAG_ENTER: 'dragenter',\n DRAG_LEAVE: 'dragleave',\n DROP: 'drop'\n};\n\nconst ROW_DATA_INDEX = 'data-index';\nconst ROWS = {\n FIRST: '0',\n SECOND: '1',\n THIRD: '2'\n};\nconst expectedGhostImageStyles = {\n height: '0px',\n width: '0px',\n position: 'absolute',\n top: '-1000000px',\n left: '-10000000px',\n 'background-color': 'rgba(0, 0, 0, 0.21)',\n background: 'rgba(0, 0, 0, 0.21)',\n 'z-index': '-1'\n};\nconst getDragEvent = eventType => {\n const event = new CustomEvent(eventType);\n Object.assign(event, {\n dataTransfer: {}\n });\n return event;\n};\n\nconst addDragListenerToRows = (row, dragProps, dropProps) => {\n row.addEventListener(DRAG_EVENTS.DRAG_ENTER, dropProps.onDragEnter);\n row.addEventListener(DRAG_EVENTS.DRAG_LEAVE, dropProps.onDragLeave);\n const dragHandle = row.querySelector('div[data-drag-type=row]');\n dragHandle.addEventListener(DRAG_EVENTS.DRAG_START, dragProps.onDragStart);\n dragHandle.addEventListener(DRAG_EVENTS.DRAG_END, dragProps.onDragEnd);\n};\nconst DROP_EFFECTS = { transition: 'transform 0.25s', transform: 'translate(20px)' };\nconst styleMatchesObject = (style, expectedStyles) =>\n Object.entries(expectedStyles).every(\n ([property, value]) => style.getPropertyValue(property) === value\n );\nconst dragTarget = mockFeatureProps =>\n mockFeatureProps.getRsStore().rowDragDropRef.dragTarget.getAttribute(ROW_DATA_INDEX);\nconst dropTarget = mockFeatureProps =>\n mockFeatureProps.getRsStore().rowDragDropRef.dropTarget[0].getAttribute(ROW_DATA_INDEX);\n\nconst dragStartEventAssertions = (\n dragStartEvent,\n row,\n rowDragHandle,\n ghostImage,\n mockFeatureProps\n) => {\n expect(dragStartEvent.dataTransfer.setDragImage).toHaveBeenCalledWith(\n expect.any(HTMLElement),\n 0,\n 0\n );\n expect(mockFeatureProps.getRsStore().rowDragDropRef).toMatchObject({\n contextDragOverCb: expect.any(Function),\n contextDropCb: expect.any(Function),\n isDragTargetTypeRow: true\n });\n expect(dragTarget(mockFeatureProps)).toBe(ROWS.FIRST);\n expect(rowDragHandle.classList).toContain(CLASSES.DRAG_START);\n expect(row.style.opacity).toBe('0.5');\n Object.entries(expectedGhostImageStyles).forEach(([property, value]) => {\n expect(ghostImage.style.getPropertyValue(property)).toBe(value);\n });\n return true;\n};\n\nconst dragEnterEventAssertions = (rowElement, rowIndex, mockFeatureProps) => {\n expect(dropTarget(mockFeatureProps)).toBe(rowIndex);\n expect(rowElement.classList).toContain(CLASSES.DRAG_ENTER);\n expect(styleMatchesObject(rowElement.style, DROP_EFFECTS)).toBe(true);\n return true;\n};\n\nconst dragLeaveEventAssertions = rowElement => {\n expect(rowElement.classList).not.toContain(CLASSES.DRAG_ENTER);\n expect(styleMatchesObject(rowElement.style, DROP_EFFECTS)).toBe(false);\n return true;\n};\n\nconst dropEventAssertions = (sourceRowElement, destinationRowElement, mockFeatureProps) => {\n expect(destinationRowElement.classList).not.toContain(CLASSES.DRAG_ENTER);\n expect(styleMatchesObject(destinationRowElement.style, DROP_EFFECTS)).toBe(false);\n expect(mockFeatureProps.getRsStore().rowDragDropRef).toMatchObject({\n dropTarget: [],\n dropZones: [],\n isDragTargetTypeRow: false,\n dropTargetCoord: null,\n forcedDragLeave: false\n });\n expect(mockFeatureProps.getView().type.handleRowReorder).toHaveBeenCalledWith(\n sourceRowElement.getAttribute('data-key'),\n destinationRowElement.getAttribute('data-key')\n );\n return true;\n};\n\nconst dragEndEventAssertions = (rowElement, rowDragHandleElement, mockFeatureProps) => {\n expect(rowDragHandleElement.classList).not.toContain(CLASSES.DRAG_START);\n expect(mockFeatureProps.getRsStore().rowDragDropRef).toMatchObject({\n contextDragOverCb: expect.any(Function),\n contextDropCb: expect.any(Function),\n isDragTargetTypeRow: false,\n forcedDragLeave: false,\n dropTarget: [],\n dropTargetCoord: null,\n dragLeaveSkipped: false\n });\n expect(rowElement.style.opacity).toBe('1');\n return true;\n};\n\nexport {\n DRAG_EVENTS,\n ROWS,\n addDragListenerToRows,\n dragEnterEventAssertions,\n dragLeaveEventAssertions,\n dragStartEventAssertions,\n dropEventAssertions,\n getDragEvent,\n dragEndEventAssertions\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/lists-core",
|
|
3
|
-
"version": "10.0.0-build.5.
|
|
3
|
+
"version": "10.0.0-build.5.27",
|
|
4
4
|
"description": "Core headless UI library that the users can use to write their own UI and create repeating structures like table, gallery, timeline etc.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Pegasystems",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"build": "tsc -b tsconfig.build.json"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@pega/cosmos-react-condition-builder": "10.0.0-build.5.
|
|
18
|
-
"@pega/cosmos-react-core": "10.0.0-build.5.
|
|
17
|
+
"@pega/cosmos-react-condition-builder": "10.0.0-build.5.27",
|
|
18
|
+
"@pega/cosmos-react-core": "10.0.0-build.5.27",
|
|
19
19
|
"@types/lodash-es": "^4.17.12",
|
|
20
20
|
"dayjs": "^1.11.13",
|
|
21
21
|
"fast-deep-equal": "^3.1.3",
|