@revolist/revogrid 4.4.0-next.22 → 4.4.0-next.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-element/localScrollService.js +4 -0
- package/custom-element/localScrollService.js.map +1 -1
- package/custom-element/revogr-viewport-scroll2.js +19 -4
- package/custom-element/revogr-viewport-scroll2.js.map +1 -1
- package/dist/cjs/{localScrollService-a81823c5.js → localScrollService-864b2745.js} +5 -1
- package/dist/cjs/localScrollService-864b2745.js.map +1 -0
- package/dist/cjs/revogr-data_3.cjs.entry.js +20 -5
- package/dist/cjs/revogr-data_3.cjs.entry.js.map +1 -1
- package/dist/cjs/revogr-focus_5.cjs.entry.js +1 -1
- package/dist/collection/components/scroll/revogr-viewport-scroll.d.ts +5 -4
- package/dist/collection/components/scroll/revogr-viewport-scroll.js +16 -7
- package/dist/collection/components/scroll/revogr-viewport-scroll.js.map +1 -1
- package/dist/collection/components.d.ts +0 -12
- package/dist/collection/services/localScrollService.d.ts +1 -0
- package/dist/collection/services/localScrollService.js +4 -0
- package/dist/collection/services/localScrollService.js.map +1 -1
- package/dist/collection/utils/browser.d.ts +1 -0
- package/dist/collection/utils/browser.js +7 -0
- package/dist/collection/utils/browser.js.map +1 -0
- package/dist/esm/{localScrollService-2c98a058.js → localScrollService-7ab1ed2d.js} +5 -1
- package/dist/esm/localScrollService-7ab1ed2d.js.map +1 -0
- package/dist/esm/revogr-data_3.entry.js +20 -5
- package/dist/esm/revogr-data_3.entry.js.map +1 -1
- package/dist/esm/revogr-focus_5.entry.js +1 -1
- package/dist/revo-grid/{localScrollService-2c98a058.js → localScrollService-7ab1ed2d.js} +2 -2
- package/dist/revo-grid/localScrollService-7ab1ed2d.js.map +1 -0
- package/dist/revo-grid/revogr-data_3.entry.js +1 -1
- package/dist/revo-grid/revogr-data_3.entry.js.map +1 -1
- package/dist/revo-grid/revogr-focus_5.entry.js +1 -1
- package/dist/types/components/scroll/revogr-viewport-scroll.d.ts +5 -4
- package/dist/types/components.d.ts +0 -12
- package/dist/types/services/localScrollService.d.ts +1 -0
- package/dist/types/utils/browser.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/localScrollService-a81823c5.js.map +0 -1
- package/dist/esm/localScrollService-2c98a058.js.map +0 -1
- package/dist/revo-grid/localScrollService-2c98a058.js.map +0 -1
|
@@ -29,6 +29,10 @@ class LocalScrollService {
|
|
|
29
29
|
async setScroll(e) {
|
|
30
30
|
this.cancelScroll(e.dimension);
|
|
31
31
|
const frameAnimation = new Promise((resolve, reject) => {
|
|
32
|
+
// for example safari desktop has issues with animation frame
|
|
33
|
+
if (this.cfg.skipAnimationFrame) {
|
|
34
|
+
return resolve();
|
|
35
|
+
}
|
|
32
36
|
const animationId = window.requestAnimationFrame(() => {
|
|
33
37
|
resolve();
|
|
34
38
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"localScrollService.js","mappings":";;;;;
|
|
1
|
+
{"file":"localScrollService.js","mappings":";;;;;AAiBA,MAAM,aAAa,GAAW;EAC5B,WAAW,EAAE,CAAC;EACd,UAAU,EAAE,CAAC;EACb,WAAW,EAAE,CAAC;EACd,OAAO,EAAE,CAAC;CACX,CAAC;AACF,MAAM,aAAa,GAAG,CAAC,CAAC,CAAC;MACJ,kBAAkB;EAMrC,YAAoB,GAAW;IAAX,QAAG,GAAH,GAAG,CAAQ;IALvB,4BAAuB,GAAsD,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;;IAE1G,mBAAc,GAA2C,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC;IACxG,WAAM,GAA2C,EAAE,KAAK,oBAAO,aAAa,CAAE,EAAE,KAAK,oBAAO,aAAa,CAAE,EAAE,CAAC;GAEnF;EAEnC,OAAO,qBAAqB,CAAC,WAAmB,EAAE,UAAkB,EAAE,cAAsB,CAAC;IAC3F,OAAO,WAAW,IAAI,WAAW,GAAG,U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,GAAG,IAAI,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;IACzD,IAAI,QAAQ,EAAE;MACZ,QAAQ,EAAE,CAAC;MACX,IAAI,CAAC,uBAAuB,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;KAChD;GACF;;EAGO,OAAO,CAAC,GAAW,EAAE,KAAa,EAAE,SAAkB,IAAI;IAChE,MAAM,QAAQ,GAAW,KAAK,CAAC,UAAU,CAAC;IAC1C,MAAM,IAAI,GAAqB,CAAC,CAAC,EAAE,KAAK,CAAC,kBAAkB,GAAG,QAAQ,CAAC,CAAC;IACxE,MAAM,EAAE,GAAqB,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC;IACxE,IAAI,MAAM,EAAE;MACV,OAAO,UAAU,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;KAClC;IACD,OAAO,UAAU,CAAC,GAAG,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;GAClC;;;;;","names":[],"sources":["./src/services/localScrollService.ts"],"sourcesContent":["import { scaleValue } from '../utils';\nimport { RevoGrid } from '../interfaces';\n\ninterface Config {\n skipAnimationFrame?: boolean;\n beforeScroll(e: RevoGrid.ViewPortScrollEvent): void;\n afterScroll(e: RevoGrid.ViewPortScrollEvent): void;\n}\n\ntype Params = {\n contentSize: number;\n virtualContentSize?: number;\n clientSize: number;\n virtualSize: number;\n maxSize?: number;\n};\n\nconst initialParams: Params = {\n contentSize: 0,\n clientSize: 0,\n virtualSize: 0,\n maxSize: 0,\n};\nconst NO_COORDINATE = -1;\nexport default class LocalScrollService {\n private preventArtificialScroll: Record<RevoGrid.DimensionType, () => void | null> = { rgRow: null, rgCol: null };\n // to check if scroll changed\n private previousScroll: Record<RevoGrid.DimensionType, number> = { rgRow: NO_COORDINATE, rgCol: NO_COORDINATE };\n private params: Record<RevoGrid.DimensionType, Params> = { rgRow: { ...initialParams }, rgCol: { ...initialParams } };\n\n constructor(private cfg: Config) {}\n\n static getVirtualContentSize(contentSize: number, clientSize: number, virtualSize: number = 0): number {\n return contentSize + (virtualSize ? clientSize - virtualSize : 0);\n }\n\n setParams(params: Params, dimension: RevoGrid.DimensionType) {\n const virtualContentSize = LocalScrollService.getVirtualContentSize(params.contentSize, params.clientSize, params.virtualSize);\n this.params[dimension] = {\n ...params,\n maxSize: virtualContentSize - params.clientSize,\n virtualContentSize,\n };\n }\n\n // apply scroll values after scroll done\n async setScroll(e: RevoGrid.ViewPortScrollEvent) {\n this.cancelScroll(e.dimension);\n\n const frameAnimation = new Promise<void>((resolve, reject) => {\n // for example safari desktop has issues with animation frame\n if (this.cfg.skipAnimationFrame) {\n return resolve();\n }\n const animationId = window.requestAnimationFrame(() => {\n resolve();\n });\n this.preventArtificialScroll[e.dimension] = reject.bind(null, animationId);\n });\n try {\n await frameAnimation;\n const params = this.getParams(e.dimension);\n e.coordinate = Math.ceil(e.coordinate);\n this.previousScroll[e.dimension] = this.wrapCoordinate(e.coordinate, params);\n this.preventArtificialScroll[e.dimension] = null;\n this.cfg.afterScroll({\n ...e,\n coordinate: params.virtualSize ? this.convert(e.coordinate, params, false) : e.coordinate,\n });\n\n } catch (id) {\n window.cancelAnimationFrame(id);\n }\n }\n\n // initiate scrolling event\n scroll(\n coordinate: number,\n dimension: RevoGrid.DimensionType,\n force = false,\n delta?: number,\n outside = false\n ) {\n this.cancelScroll(dimension);\n if (!force && this.previousScroll[dimension] === coordinate) {\n this.previousScroll[dimension] = NO_COORDINATE;\n return;\n }\n\n const param = this.getParams(dimension);\n this.cfg.beforeScroll({\n dimension: dimension,\n coordinate: param.virtualSize ? this.convert(coordinate, param) : coordinate,\n delta,\n outside\n });\n }\n\n private getParams(dimension: RevoGrid.DimensionType): Params {\n return this.params[dimension];\n }\n\n // check if scroll outside of region to avoid looping\n private wrapCoordinate(c: number, param: Params): number {\n if (c < 0) {\n return NO_COORDINATE;\n }\n\n if (c > param.maxSize) {\n return param.maxSize;\n }\n return c;\n }\n\n // prevent already started scroll, performance optimization\n private cancelScroll(dimension: RevoGrid.DimensionType) {\n const canceler = this.preventArtificialScroll[dimension];\n if (canceler) {\n canceler();\n this.preventArtificialScroll[dimension] = null;\n }\n }\n\n /* convert virtual to real and back, scale range */\n private convert(pos: number, param: Params, toReal: boolean = true): number {\n const minRange: number = param.clientSize;\n const from: [number, number] = [0, param.virtualContentSize - minRange];\n const to: [number, number] = [0, param.contentSize - param.virtualSize];\n if (toReal) {\n return scaleValue(pos, from, to);\n }\n return scaleValue(pos, to, from);\n }\n}\n"],"version":3}
|
|
@@ -113,6 +113,10 @@ class GridResizeService {
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
+
function isSafariDesktop() {
|
|
117
|
+
return /Safari/i.test(navigator.userAgent) && !/Chrome/i.test(navigator.userAgent) && !navigator.userAgent.match(/(iPad|iPhone|iPod)/g);
|
|
118
|
+
}
|
|
119
|
+
|
|
116
120
|
const revogrViewportScrollStyleCss = ".revo-drag-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 438 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M421.875,70.40625 C426.432292,70.40625 430.175781,68.9414062 433.105469,66.0117188 C436.035156,63.0820312 437.5,59.3385417 437.5,54.78125 L437.5,54.78125 L437.5,15.71875 C437.5,11.1614583 436.035156,7.41796875 433.105469,4.48828125 C430.175781,1.55859375 426.432292,0.09375 421.875,0.09375 L421.875,0.09375 L15.625,0.09375 C11.0677083,0.09375 7.32421875,1.55859375 4.39453125,4.48828125 C1.46484375,7.41796875 0,11.1614583 0,15.71875 L0,15.71875 L0,54.78125 C0,59.3385417 1.46484375,63.0820312 4.39453125,66.0117188 C7.32421875,68.9414062 11.0677083,70.40625 15.625,70.40625 L15.625,70.40625 L421.875,70.40625 Z M421.875,226.65625 C426.432292,226.65625 430.175781,225.191406 433.105469,222.261719 C436.035156,219.332031 437.5,215.588542 437.5,211.03125 L437.5,211.03125 L437.5,171.96875 C437.5,167.411458 436.035156,163.667969 433.105469,160.738281 C430.175781,157.808594 426.432292,156.34375 421.875,156.34375 L421.875,156.34375 L15.625,156.34375 C11.0677083,156.34375 7.32421875,157.808594 4.39453125,160.738281 C1.46484375,163.667969 0,167.411458 0,171.96875 L0,171.96875 L0,211.03125 C0,215.588542 1.46484375,219.332031 4.39453125,222.261719 C7.32421875,225.191406 11.0677083,226.65625 15.625,226.65625 L15.625,226.65625 L421.875,226.65625 Z M421.875,382.90625 C426.432292,382.90625 430.175781,381.441406 433.105469,378.511719 C436.035156,375.582031 437.5,371.838542 437.5,367.28125 L437.5,367.28125 L437.5,328.21875 C437.5,323.661458 436.035156,319.917969 433.105469,316.988281 C430.175781,314.058594 426.432292,312.59375 421.875,312.59375 L421.875,312.59375 L15.625,312.59375 C11.0677083,312.59375 7.32421875,314.058594 4.39453125,316.988281 C1.46484375,319.917969 0,323.661458 0,328.21875 L0,328.21875 L0,367.28125 C0,371.838542 1.46484375,375.582031 4.39453125,378.511719 C7.32421875,381.441406 11.0677083,382.90625 15.625,382.90625 L15.625,382.90625 L421.875,382.90625 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 438 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M421.875,70.40625 C426.432292,70.40625 430.175781,68.9414062 433.105469,66.0117188 C436.035156,63.0820312 437.5,59.3385417 437.5,54.78125 L437.5,54.78125 L437.5,15.71875 C437.5,11.1614583 436.035156,7.41796875 433.105469,4.48828125 C430.175781,1.55859375 426.432292,0.09375 421.875,0.09375 L421.875,0.09375 L15.625,0.09375 C11.0677083,0.09375 7.32421875,1.55859375 4.39453125,4.48828125 C1.46484375,7.41796875 0,11.1614583 0,15.71875 L0,15.71875 L0,54.78125 C0,59.3385417 1.46484375,63.0820312 4.39453125,66.0117188 C7.32421875,68.9414062 11.0677083,70.40625 15.625,70.40625 L15.625,70.40625 L421.875,70.40625 Z M421.875,226.65625 C426.432292,226.65625 430.175781,225.191406 433.105469,222.261719 C436.035156,219.332031 437.5,215.588542 437.5,211.03125 L437.5,211.03125 L437.5,171.96875 C437.5,167.411458 436.035156,163.667969 433.105469,160.738281 C430.175781,157.808594 426.432292,156.34375 421.875,156.34375 L421.875,156.34375 L15.625,156.34375 C11.0677083,156.34375 7.32421875,157.808594 4.39453125,160.738281 C1.46484375,163.667969 0,167.411458 0,171.96875 L0,171.96875 L0,211.03125 C0,215.588542 1.46484375,219.332031 4.39453125,222.261719 C7.32421875,225.191406 11.0677083,226.65625 15.625,226.65625 L15.625,226.65625 L421.875,226.65625 Z M421.875,382.90625 C426.432292,382.90625 430.175781,381.441406 433.105469,378.511719 C436.035156,375.582031 437.5,371.838542 437.5,367.28125 L437.5,367.28125 L437.5,328.21875 C437.5,323.661458 436.035156,319.917969 433.105469,316.988281 C430.175781,314.058594 426.432292,312.59375 421.875,312.59375 L421.875,312.59375 L15.625,312.59375 C11.0677083,312.59375 7.32421875,314.058594 4.39453125,316.988281 C1.46484375,319.917969 0,323.661458 0,328.21875 L0,328.21875 L0,367.28125 C0,371.838542 1.46484375,375.582031 4.39453125,378.511719 C7.32421875,381.441406 11.0677083,382.90625 15.625,382.90625 L15.625,382.90625 L421.875,382.90625 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:7px;background-size:cover;background-repeat:no-repeat}.revo-alt-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:11px;background-size:cover;background-repeat:no-repeat}.arrow-down{position:absolute;right:5px;top:0}.arrow-down svg{width:8px;margin-top:5px;margin-left:5px;opacity:0.4}.cell-value-wrapper{margin-right:10px;overflow:hidden;text-overflow:ellipsis}.revo-button{position:relative;overflow:hidden;color:#fff;background-color:#6200ee;height:34px;line-height:34px;padding:0 15px;outline:0;border:0;border-radius:7px;box-sizing:border-box;cursor:pointer}.revo-button.green{background-color:#2ee072;border:1px solid #20d565}.revo-button.red{background-color:#E0662E;border:1px solid #d55920}.revo-button:disabled,.revo-button[disabled]{cursor:not-allowed !important;filter:opacity(0.35) !important}.revo-button.light{border:2px solid #cedefa;line-height:32px;background:none;color:#4876ca;box-shadow:none}.rowHeaders{z-index:2;font-size:10px;display:flex;height:100%}.rowHeaders revogr-data .rgCell{text-align:center}.rowHeaders .rgCell{padding:0 1em !important;min-width:100%}revogr-viewport-scroll{-ms-overflow-style:none;scrollbar-width:none;overflow-x:auto;overflow-y:hidden;position:relative;z-index:1;height:100%}revogr-viewport-scroll::-webkit-scrollbar{display:none;-webkit-appearance:none}revogr-viewport-scroll.colPinStart,revogr-viewport-scroll.colPinEnd{z-index:2}revogr-viewport-scroll.colPinEnd:has(.active){overflow:visible}revogr-viewport-scroll.rgCol{flex-grow:1}revogr-viewport-scroll .content-wrapper{overflow:hidden}revogr-viewport-scroll .inner-content-table{display:flex;flex-direction:column;max-height:100%;width:100%;min-width:100%;position:relative;z-index:0}revogr-viewport-scroll .vertical-inner{overflow-y:auto;position:relative;width:100%;flex-grow:1;-ms-overflow-style:none;scrollbar-width:none;}revogr-viewport-scroll .vertical-inner::-webkit-scrollbar{display:none;-webkit-appearance:none}revogr-viewport-scroll .vertical-inner revogr-data,revogr-viewport-scroll .vertical-inner revogr-overlay-selection{height:100%}";
|
|
117
121
|
|
|
118
122
|
const RevogrViewportScroll = /*@__PURE__*/ proxyCustomElement(class RevogrViewportScroll extends HTMLElement {
|
|
@@ -130,7 +134,11 @@ const RevogrViewportScroll = /*@__PURE__*/ proxyCustomElement(class RevogrViewpo
|
|
|
130
134
|
* Last mw event time for trigger scroll function below
|
|
131
135
|
* If mousewheel function was ignored we still need to trigger render
|
|
132
136
|
*/
|
|
133
|
-
this.
|
|
137
|
+
this.mouseWheelScrollTimestamp = {
|
|
138
|
+
rgCol: 0,
|
|
139
|
+
rgRow: 0,
|
|
140
|
+
};
|
|
141
|
+
this.lastKnownScrollCoordinate = {
|
|
134
142
|
rgCol: 0,
|
|
135
143
|
rgRow: 0,
|
|
136
144
|
};
|
|
@@ -204,13 +212,17 @@ const RevogrViewportScroll = /*@__PURE__*/ proxyCustomElement(class RevogrViewpo
|
|
|
204
212
|
* Create local scroll service
|
|
205
213
|
*/
|
|
206
214
|
this.scrollService = new LocalScrollService({
|
|
215
|
+
// to improve safari smoothnes on scroll
|
|
216
|
+
skipAnimationFrame: isSafariDesktop(),
|
|
207
217
|
beforeScroll: e => this.scrollViewport.emit(e),
|
|
208
218
|
afterScroll: e => {
|
|
219
|
+
this.lastKnownScrollCoordinate[e.dimension] = e.coordinate;
|
|
209
220
|
switch (e.dimension) {
|
|
210
221
|
case 'rgCol':
|
|
211
222
|
this.horizontalScroll.scrollLeft = e.coordinate;
|
|
212
223
|
break;
|
|
213
224
|
case 'rgRow':
|
|
225
|
+
// this will trigger on scroll event
|
|
214
226
|
this.verticalScroll.scrollTop = e.coordinate;
|
|
215
227
|
// for mobile devices to skip negative scroll loop. only on vertical scroll
|
|
216
228
|
if (this.verticalScroll.style.transform) {
|
|
@@ -337,17 +349,20 @@ const RevogrViewportScroll = /*@__PURE__*/ proxyCustomElement(class RevogrViewpo
|
|
|
337
349
|
}
|
|
338
350
|
this.applyOnScroll(type, scroll);
|
|
339
351
|
}
|
|
352
|
+
/**
|
|
353
|
+
* Applies scroll on scroll event only if mousewheel event was some time ago
|
|
354
|
+
*/
|
|
340
355
|
applyOnScroll(type, coordinate, outside = false) {
|
|
341
356
|
var _a;
|
|
342
|
-
const change = new Date().getTime() - this.
|
|
357
|
+
const change = new Date().getTime() - this.mouseWheelScrollTimestamp[type];
|
|
343
358
|
// apply after throttling
|
|
344
|
-
if (change > this.scrollThrottling) {
|
|
359
|
+
if (change > this.scrollThrottling && coordinate !== this.lastKnownScrollCoordinate[type]) {
|
|
345
360
|
(_a = this.scrollService) === null || _a === void 0 ? void 0 : _a.scroll(coordinate, type, undefined, undefined, outside);
|
|
346
361
|
}
|
|
347
362
|
}
|
|
348
363
|
/** remember last mw event time */
|
|
349
364
|
latestScrollUpdate(dimension) {
|
|
350
|
-
this.
|
|
365
|
+
this.mouseWheelScrollTimestamp[dimension] = new Date().getTime();
|
|
351
366
|
}
|
|
352
367
|
/**
|
|
353
368
|
* On vertical mousewheel event
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"revogr-viewport-scroll2.js","mappings":";;;;;;;;;MAIa,WAAW,GAAG,SAAS;MACvB,WAAW,GAAG,SAAS;MACvB,YAAY,GAAG,UAAU;MACzB,SAAS,GAAG,OAAO;AAEhC;SACgB,WAAW,CAAC,IAAoB,EAAE,OAAoC;E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;;;;;EAQO,sBAAsB,CAC5B,IAA4B,EAC5B,KAAY,EACZ,CAAmB;;IAEnB,CAAC,CAAC,cAAc,IAAI,CAAC,CAAC,cAAc,EAAE,CAAC;IACvC,MAAM,GAAG,GAAG,IAAI,CAAC,gBAAgB,CAAC,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;IACxD,MAAA,IAAI,CAAC,aAAa,0CAAE,MAAM,CAAC,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3D,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;GAC/B;;;;;;;;;;;;;;;;;;;;;;;;;","names":["isObject","debounce","throttle"],"sources":["./src/components/revoGrid/viewport.helpers.ts","./node_modules/lodash/throttle.js","./src/utils/resizeObserver.ts","./src/components/revoGrid/viewport.resize.service.ts","./src/components/scroll/revogr-viewport-scroll-style.scss?tag=revogr-viewport-scroll","./src/components/scroll/revogr-viewport-scroll.tsx"],"sourcesContent":["/** Collect data for pinned columns in required @ViewportProps format */\nimport { RevoGrid, Selection } from '../../interfaces';\nimport { ViewportColumn } from './viewport.interfaces';\n\nexport const HEADER_SLOT = 'header';\nexport const FOOTER_SLOT = 'footer';\nexport const CONTENT_SLOT = 'content';\nexport const DATA_SLOT = 'data';\n\n/** Receive last visible in viewport by required type */\nexport function getLastCell(data: ViewportColumn, rowType: RevoGrid.MultiDimensionType): Selection.Cell {\n return {\n x: data.viewports[data.colType].store.get('realCount'),\n y: data.viewports[rowType].store.get('realCount'),\n };\n}\n","var debounce = require('./debounce'),\n isObject = require('./isObject');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\nfunction throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n}\n\nmodule.exports = throttle;\n","export async function resizeObserver() {\n if (!('ResizeObserver' in window)) {\n const module = await import('@juggle/resize-observer');\n (window as Window & typeof globalThis).ResizeObserver = (module.ResizeObserver as unknown) as typeof ResizeObserver;\n }\n}\n","import throttle from 'lodash/throttle';\nimport { resizeObserver } from '../../utils/resizeObserver';\ninterface Events {\n resize(entries: ReadonlyArray<ResizeObserverEntry>, observer: ResizeObserver): void;\n}\nexport default class GridResizeService {\n private resizeObserver: ResizeObserver | null = null;\n private resize = throttle((e: ReadonlyArray<ResizeObserverEntry>, o: ResizeObserver) => this.events?.resize(e, o), 10);\n constructor(el: HTMLElement, private events: Events) {\n this.init(el);\n }\n\n async init(el: HTMLElement): Promise<void> {\n await resizeObserver();\n this.resizeObserver = new ResizeObserver(this.resize);\n this.resizeObserver?.observe(el);\n }\n\n public destroy(): void {\n this.resizeObserver?.disconnect();\n this.resizeObserver = null;\n }\n}\n","@mixin noScroll {\n /* Hide scrollbar for IE and Edge */\n -ms-overflow-style: none;\n scrollbar-width: none; /* Firefox */\n /* Hide scrollbar for Chrome, Safari and Opera */\n &::-webkit-scrollbar {\n display: none;\n -webkit-appearance: none;\n }\n}\n\n.rowHeaders {\n z-index: 2;\n font-size: 10px;\n display: flex;\n height: 100%;\n\n revogr-data .rgCell {\n text-align: center;\n }\n\n .rgCell {\n padding: 0 1em !important;\n min-width: 100%;\n }\n}\n\nrevogr-viewport-scroll {\n @include noScroll;\n\n overflow-x: auto;\n overflow-y: hidden;\n position: relative;\n z-index: 1;\n height: 100%;\n\n &.colPinStart,\n &.colPinEnd {\n z-index: 2;\n }\n\n // make sure it would work\n &.colPinEnd:has(.active) {\n overflow: visible;\n }\n\n &.rgCol {\n flex-grow: 1;\n }\n\n .content-wrapper {\n overflow: hidden;\n }\n\n .inner-content-table {\n display: flex;\n flex-direction: column;\n max-height: 100%;\n width: 100%;\n min-width: 100%;\n position: relative;\n z-index: 0;\n }\n\n .vertical-inner {\n overflow-y: auto;\n position: relative;\n width: 100%;\n flex-grow: 1;\n @include noScroll;\n\n revogr-data,\n revogr-overlay-selection {\n height: 100%;\n }\n }\n}\n","import {\n Component,\n Event,\n EventEmitter,\n h,\n Method,\n Element,\n Prop,\n Host,\n Listen,\n} from '@stencil/core';\nimport each from 'lodash/each';\n\nimport GridResizeService from '../revoGrid/viewport.resize.service';\nimport LocalScrollService from '../../services/localScrollService';\nimport { RevoGrid, ScrollCoordinateEvent } from '../../interfaces';\nimport {\n CONTENT_SLOT,\n FOOTER_SLOT,\n HEADER_SLOT,\n} from '../revoGrid/viewport.helpers';\ntype Delta = 'deltaX' | 'deltaY';\ntype LocalScrollEvent = {\n preventDefault(): void;\n} & { [x in Delta]: number };\n/**\n * Service for tracking grid scrolling\n */\n@Component({\n tag: 'revogr-viewport-scroll',\n styleUrl: 'revogr-viewport-scroll-style.scss',\n})\nexport class RevogrViewportScroll {\n @Event({ bubbles: true })\n scrollViewport: EventEmitter<RevoGrid.ViewPortScrollEvent>;\n @Event() resizeViewport: EventEmitter<RevoGrid.ViewPortResizeEvent>;\n @Event() scrollchange: EventEmitter<{\n type: RevoGrid.DimensionType;\n hasScroll: boolean;\n }>;\n\n /**\n * Silently scroll to coordinate\n * Made to align negative coordinates for mobile devices\n */\n @Event()\n silentScroll: EventEmitter<RevoGrid.ViewPortScrollEvent>;\n\n private scrollThrottling = 10;\n\n /**\n * Width of inner content\n */\n @Prop() contentWidth = 0;\n /**\n * Height of inner content\n */\n @Prop() contentHeight = 0;\n\n private oldValY = this.contentHeight;\n private oldValX = this.contentWidth;\n\n @Element() horizontalScroll: HTMLElement;\n private verticalScroll: HTMLElement;\n private header: HTMLElement;\n private footer: HTMLElement;\n\n /**\n * Static functions to bind wheel change\n */\n private horizontalMouseWheel: (e: Partial<LocalScrollEvent>) => void;\n private verticalMouseWheel: (e: Partial<LocalScrollEvent>) => void;\n\n private resizeService: GridResizeService;\n private scrollService: LocalScrollService;\n\n /**\n * Last mw event time for trigger scroll function below\n * If mousewheel function was ignored we still need to trigger render\n */\n private mouseWheelScroll: Record<RevoGrid.DimensionType, number> = {\n rgCol: 0,\n rgRow: 0,\n };\n @Method() async setScroll(e: RevoGrid.ViewPortScrollEvent) {\n this.latestScrollUpdate(e.dimension);\n this.scrollService?.setScroll(e);\n }\n\n /**\n * update on delta in case we don't know existing position or external change\n * @param e\n */\n @Method() async changeScroll(\n e: RevoGrid.ViewPortScrollEvent,\n silent = false,\n ) {\n if (silent) {\n if (e.coordinate) {\n switch (e.dimension) {\n // for mobile devices to skip negative scroll loop. only on vertical scroll\n case 'rgRow':\n this.verticalScroll.style.transform = `translateY(${-1 * e.coordinate}px)`;\n break;\n }\n }\n return null;\n }\n if (e.delta) {\n switch (e.dimension) {\n case 'rgCol':\n e.coordinate = this.horizontalScroll.scrollLeft + e.delta;\n break;\n case 'rgRow':\n e.coordinate = this.verticalScroll.scrollTop + e.delta;\n break;\n }\n this.setScroll(e);\n }\n return e;\n }\n\n /**\n * Dispatch this event to trigger vertical mouse wheel from plugins\n */\n @Listen('mousewheel-vertical') mousewheelVertical({\n detail: e,\n }: CustomEvent<LocalScrollEvent>) {\n this.verticalMouseWheel(e);\n }\n /**\n * Dispatch this event to trigger horizontal mouse wheel from plugins\n */\n @Listen('mousewheel-horizontal') mousewheelHorizontal({\n detail: e,\n }: CustomEvent<LocalScrollEvent>) {\n this.horizontalMouseWheel(e);\n }\n /**\n * Allows to use outside listener\n */\n @Listen('scroll-coordinate') scrollApply({\n detail: { type, coordinate },\n }: CustomEvent<ScrollCoordinateEvent>) {\n this.applyOnScroll(type, coordinate, true);\n }\n\n connectedCallback() {\n /**\n * Bind scroll functions for farther usage\n */\n if ('ontouchstart' in document.documentElement) {\n this.scrollThrottling = 0;\n } else {\n this.verticalMouseWheel = this.onVerticalMouseWheel.bind(\n this,\n 'rgRow',\n 'deltaY',\n );\n this.horizontalMouseWheel = this.onHorizontalMouseWheel.bind(\n this,\n 'rgCol',\n 'deltaX',\n );\n }\n /**\n * Create local scroll service\n */\n this.scrollService = new LocalScrollService({\n beforeScroll: e => this.scrollViewport.emit(e),\n afterScroll: e => {\n switch (e.dimension) {\n case 'rgCol':\n this.horizontalScroll.scrollLeft = e.coordinate;\n break;\n case 'rgRow':\n this.verticalScroll.scrollTop = e.coordinate;\n // for mobile devices to skip negative scroll loop. only on vertical scroll\n if (this.verticalScroll.style.transform) {\n this.verticalScroll.style.transform = '';\n }\n break;\n }\n },\n });\n }\n\n componentDidLoad() {\n // track horizontal viewport resize\n this.resizeService = new GridResizeService(this.horizontalScroll, {\n resize: entries => {\n let height = entries[0]?.contentRect.height || 0;\n if (height) {\n height -= this.header.clientHeight + this.footer.clientHeight;\n }\n const els = {\n rgRow: {\n size: height,\n contentSize: this.contentHeight,\n scroll: this.verticalScroll.scrollTop,\n },\n rgCol: {\n size: entries[0]?.contentRect.width || 0,\n contentSize: this.contentWidth,\n scroll: this.horizontalScroll.scrollLeft,\n },\n };\n each(els, (item, dimension: RevoGrid.DimensionType) => {\n this.resizeViewport.emit({ dimension, size: item.size });\n this.scrollService?.scroll(item.scroll, dimension, true);\n // track scroll visibility on outer element change\n this.setScrollVisibility(dimension, item.size, item.contentSize);\n });\n },\n });\n }\n\n /**\n * Check if scroll present or not per type\n * Trigger this method on inner content size change or on outer element size change\n * If inner content bigger then outer size then scroll is present and mousewheel binding required\n * @param type - dimension type 'rgRow/y' or 'rgCol/x'\n * @param size - outer content size\n * @param innerContentSize - inner content size\n */\n setScrollVisibility(\n type: RevoGrid.DimensionType,\n size: number,\n innerContentSize: number,\n ) {\n // test if scroll present\n const hasScroll = size < innerContentSize;\n let el: HTMLElement;\n // event reference for binding\n switch (type) {\n case 'rgCol':\n el = this.horizontalScroll;\n break;\n case 'rgRow':\n el = this.verticalScroll;\n break;\n }\n // based on scroll visibility assign or remove class and event\n if (hasScroll) {\n el.classList.add(`scroll-${type}`);\n } else {\n el.classList.remove(`scroll-${type}`);\n }\n this.scrollchange.emit({ type, hasScroll });\n }\n\n disconnectedCallback() {\n this.resizeService.destroy();\n }\n\n async componentDidRender() {\n // scroll update if number of rows changed\n if (this.contentHeight < this.oldValY && this.verticalScroll) {\n this.verticalScroll.scrollTop += this.contentHeight - this.oldValY;\n }\n this.oldValY = this.contentHeight;\n\n // scroll update if number of cols changed\n if (this.contentWidth < this.oldValX) {\n this.horizontalScroll.scrollLeft += this.contentWidth - this.oldValX;\n }\n this.oldValX = this.contentWidth;\n\n this.scrollService.setParams(\n {\n contentSize: this.contentHeight,\n clientSize: this.verticalScroll.clientHeight,\n virtualSize: 0,\n },\n 'rgRow',\n );\n\n this.scrollService.setParams(\n {\n contentSize: this.contentWidth,\n clientSize: this.horizontalScroll.clientWidth,\n virtualSize: 0,\n },\n 'rgCol',\n );\n this.setScrollVisibility(\n 'rgRow',\n this.verticalScroll.clientHeight,\n this.contentHeight,\n );\n this.setScrollVisibility(\n 'rgCol',\n this.horizontalScroll.clientWidth,\n this.contentWidth,\n );\n }\n\n render() {\n return (\n <Host\n onWheel={this.horizontalMouseWheel}\n onScroll={(e: UIEvent) => this.onScroll('rgCol', e)}\n >\n <div\n class=\"inner-content-table\"\n style={{ width: `${this.contentWidth}px` }}\n >\n <div class=\"header-wrapper\" ref={e => (this.header = e)}>\n <slot name={HEADER_SLOT} />\n </div>\n <div\n class=\"vertical-inner\"\n ref={el => (this.verticalScroll = el)}\n onWheel={this.verticalMouseWheel}\n onScroll={(e: MouseEvent) => this.onScroll('rgRow', e)}\n >\n <div\n class=\"content-wrapper\"\n style={{ height: `${this.contentHeight}px` }}\n >\n <slot name={CONTENT_SLOT} />\n </div>\n </div>\n <div class=\"footer-wrapper\" ref={e => (this.footer = e)}>\n <slot name={FOOTER_SLOT} />\n </div>\n </div>\n </Host>\n );\n }\n /**\n * Extra layer for scroll event monitoring, where MouseWheel event is not passing\n * We need to trigger scroll event in case there is no mousewheel event\n */\n private onScroll(type: RevoGrid.DimensionType, e: UIEvent) {\n if (!(e.target instanceof HTMLElement)) {\n return;\n }\n const target = e.target;\n let scroll = 0;\n switch (type) {\n case 'rgCol':\n scroll = target?.scrollLeft;\n break;\n case 'rgRow':\n scroll = target?.scrollTop;\n break;\n }\n\n // for mobile devices to skip negative scroll loop\n if (scroll < 0) {\n this.silentScroll.emit({ dimension: type, coordinate: scroll });\n return;\n }\n this.applyOnScroll(type, scroll);\n }\n\n private applyOnScroll(\n type: RevoGrid.DimensionType,\n coordinate: number,\n outside = false,\n ) {\n const change = new Date().getTime() - this.mouseWheelScroll[type];\n // apply after throttling\n if (change > this.scrollThrottling) {\n this.scrollService?.scroll(\n coordinate,\n type,\n undefined,\n undefined,\n outside,\n );\n }\n }\n\n /** remember last mw event time */\n private latestScrollUpdate(dimension: RevoGrid.DimensionType) {\n this.mouseWheelScroll[dimension] = new Date().getTime();\n }\n\n /**\n * On vertical mousewheel event\n * @param type\n * @param delta\n * @param e\n */\n private onVerticalMouseWheel(\n type: RevoGrid.DimensionType,\n delta: Delta,\n e: LocalScrollEvent,\n ) {\n e.preventDefault && e.preventDefault();\n const pos = this.verticalScroll.scrollTop + e[delta];\n this.scrollService?.scroll(pos, type, undefined, e[delta]);\n this.latestScrollUpdate(type);\n }\n\n /**\n * On horizontal mousewheel event\n * @param type\n * @param delta\n * @param e\n */\n private onHorizontalMouseWheel(\n type: RevoGrid.DimensionType,\n delta: Delta,\n e: LocalScrollEvent,\n ) {\n e.preventDefault && e.preventDefault();\n const pos = this.horizontalScroll.scrollLeft + e[delta];\n this.scrollService?.scroll(pos, type, undefined, e[delta]);\n this.latestScrollUpdate(type);\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"revogr-viewport-scroll2.js","mappings":";;;;;;;;;MAIa,WAAW,GAAG,SAAS;MACvB,WAAW,GAAG,SAAS;MACvB,YAAY,GAAG,UAAU;MACzB,SAAS,GAAG,OAAO;AAEhC;SACgB,WAAW,CAAC,IAAoB,EAAE,OAAoC;EACpF,OAAO;IACL,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC;IACtD,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC;GAClD,CAAC;AACJ;;ACZA;AACA,IAAI,eAAe,GAAG,qBAAqB,CAAC;AAC5C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CAAC,CAAC;IACrD,MAAA,IAAI,CAAC,aAAa,0CAAE,MAAM,CAAC,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3D,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;GAC/B;;;;;;;EAQO,sBAAsB,CAC5B,IAA4B,EAC5B,KAAY,EACZ,CAAmB;;IAEnB,CAAC,CAAC,cAAc,IAAI,CAAC,CAAC,cAAc,EAAE,CAAC;IACvC,MAAM,GAAG,GAAG,IAAI,CAAC,gBAAgB,CAAC,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;IACxD,MAAA,IAAI,CAAC,aAAa,0CAAE,MAAM,CAAC,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3D,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;GAC/B;;;;;;;;;;;;;;;;;;;;;;;;;","names":["isObject","debounce","throttle"],"sources":["./src/components/revoGrid/viewport.helpers.ts","./node_modules/lodash/throttle.js","./src/utils/resizeObserver.ts","./src/components/revoGrid/viewport.resize.service.ts","./src/utils/browser.ts","./src/components/scroll/revogr-viewport-scroll-style.scss?tag=revogr-viewport-scroll","./src/components/scroll/revogr-viewport-scroll.tsx"],"sourcesContent":["/** Collect data for pinned columns in required @ViewportProps format */\nimport { RevoGrid, Selection } from '../../interfaces';\nimport { ViewportColumn } from './viewport.interfaces';\n\nexport const HEADER_SLOT = 'header';\nexport const FOOTER_SLOT = 'footer';\nexport const CONTENT_SLOT = 'content';\nexport const DATA_SLOT = 'data';\n\n/** Receive last visible in viewport by required type */\nexport function getLastCell(data: ViewportColumn, rowType: RevoGrid.MultiDimensionType): Selection.Cell {\n return {\n x: data.viewports[data.colType].store.get('realCount'),\n y: data.viewports[rowType].store.get('realCount'),\n };\n}\n","var debounce = require('./debounce'),\n isObject = require('./isObject');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\nfunction throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n}\n\nmodule.exports = throttle;\n","export async function resizeObserver() {\n if (!('ResizeObserver' in window)) {\n const module = await import('@juggle/resize-observer');\n (window as Window & typeof globalThis).ResizeObserver = (module.ResizeObserver as unknown) as typeof ResizeObserver;\n }\n}\n","import throttle from 'lodash/throttle';\nimport { resizeObserver } from '../../utils/resizeObserver';\ninterface Events {\n resize(entries: ReadonlyArray<ResizeObserverEntry>, observer: ResizeObserver): void;\n}\nexport default class GridResizeService {\n private resizeObserver: ResizeObserver | null = null;\n private resize = throttle((e: ReadonlyArray<ResizeObserverEntry>, o: ResizeObserver) => this.events?.resize(e, o), 10);\n constructor(el: HTMLElement, private events: Events) {\n this.init(el);\n }\n\n async init(el: HTMLElement): Promise<void> {\n await resizeObserver();\n this.resizeObserver = new ResizeObserver(this.resize);\n this.resizeObserver?.observe(el);\n }\n\n public destroy(): void {\n this.resizeObserver?.disconnect();\n this.resizeObserver = null;\n }\n}\n","export function isSafariDesktop() {\n return /Safari/i.test(navigator.userAgent) && !/Chrome/i.test(navigator.userAgent) && !navigator.userAgent.match(/(iPad|iPhone|iPod)/g);\n}\n","@mixin noScroll {\n /* Hide scrollbar for IE and Edge */\n -ms-overflow-style: none;\n scrollbar-width: none; /* Firefox */\n /* Hide scrollbar for Chrome, Safari and Opera */\n &::-webkit-scrollbar {\n display: none;\n -webkit-appearance: none;\n }\n}\n\n.rowHeaders {\n z-index: 2;\n font-size: 10px;\n display: flex;\n height: 100%;\n\n revogr-data .rgCell {\n text-align: center;\n }\n\n .rgCell {\n padding: 0 1em !important;\n min-width: 100%;\n }\n}\n\nrevogr-viewport-scroll {\n @include noScroll;\n\n overflow-x: auto;\n overflow-y: hidden;\n position: relative;\n z-index: 1;\n height: 100%;\n\n &.colPinStart,\n &.colPinEnd {\n z-index: 2;\n }\n\n // make sure it would work\n &.colPinEnd:has(.active) {\n overflow: visible;\n }\n\n &.rgCol {\n flex-grow: 1;\n }\n\n .content-wrapper {\n overflow: hidden;\n }\n\n .inner-content-table {\n display: flex;\n flex-direction: column;\n max-height: 100%;\n width: 100%;\n min-width: 100%;\n position: relative;\n z-index: 0;\n }\n\n .vertical-inner {\n overflow-y: auto;\n position: relative;\n width: 100%;\n flex-grow: 1;\n @include noScroll;\n\n revogr-data,\n revogr-overlay-selection {\n height: 100%;\n }\n }\n}\n","import {\n Component,\n Event,\n EventEmitter,\n h,\n Method,\n Element,\n Prop,\n Host,\n Listen,\n} from '@stencil/core';\nimport each from 'lodash/each';\n\nimport GridResizeService from '../revoGrid/viewport.resize.service';\nimport LocalScrollService from '../../services/localScrollService';\nimport { RevoGrid, ScrollCoordinateEvent } from '../../interfaces';\nimport {\n CONTENT_SLOT,\n FOOTER_SLOT,\n HEADER_SLOT,\n} from '../revoGrid/viewport.helpers';\nimport { isSafariDesktop } from '../../utils/browser';\ntype Delta = 'deltaX' | 'deltaY';\ntype LocalScrollEvent = {\n preventDefault(): void;\n} & { [x in Delta]: number };\n@Component({\n tag: 'revogr-viewport-scroll',\n styleUrl: 'revogr-viewport-scroll-style.scss',\n})\nexport class RevogrViewportScroll {\n @Event({ bubbles: true })\n scrollViewport: EventEmitter<RevoGrid.ViewPortScrollEvent>;\n @Event() resizeViewport: EventEmitter<RevoGrid.ViewPortResizeEvent>;\n @Event() scrollchange: EventEmitter<{\n type: RevoGrid.DimensionType;\n hasScroll: boolean;\n }>;\n\n /**\n * Silently scroll to coordinate\n * Made to align negative coordinates for mobile devices\n */\n @Event()\n silentScroll: EventEmitter<RevoGrid.ViewPortScrollEvent>;\n\n private scrollThrottling = 10;\n\n /**\n * Width of inner content\n */\n @Prop() contentWidth = 0;\n /**\n * Height of inner content\n */\n @Prop() contentHeight = 0;\n\n private oldValY = this.contentHeight;\n private oldValX = this.contentWidth;\n\n @Element() horizontalScroll: HTMLElement;\n private verticalScroll: HTMLElement;\n private header: HTMLElement;\n private footer: HTMLElement;\n\n /**\n * Static functions to bind wheel change\n */\n private horizontalMouseWheel: (e: Partial<LocalScrollEvent>) => void;\n private verticalMouseWheel: (e: Partial<LocalScrollEvent>) => void;\n\n private resizeService: GridResizeService;\n private scrollService: LocalScrollService;\n\n /**\n * Last mw event time for trigger scroll function below\n * If mousewheel function was ignored we still need to trigger render\n */\n private mouseWheelScrollTimestamp: Record<RevoGrid.DimensionType, number> = {\n rgCol: 0,\n rgRow: 0,\n };\n private lastKnownScrollCoordinate: Record<RevoGrid.DimensionType, number> = {\n rgCol: 0,\n rgRow: 0,\n };\n @Method() async setScroll(e: RevoGrid.ViewPortScrollEvent) {\n this.latestScrollUpdate(e.dimension);\n this.scrollService?.setScroll(e);\n }\n\n /**\n * update on delta in case we don't know existing position or external change\n * @param e\n */\n @Method() async changeScroll(\n e: RevoGrid.ViewPortScrollEvent,\n silent = false,\n ) {\n if (silent) {\n if (e.coordinate) {\n switch (e.dimension) {\n // for mobile devices to skip negative scroll loop. only on vertical scroll\n case 'rgRow':\n this.verticalScroll.style.transform = `translateY(${-1 * e.coordinate}px)`;\n break;\n }\n }\n return null;\n }\n if (e.delta) {\n switch (e.dimension) {\n case 'rgCol':\n e.coordinate = this.horizontalScroll.scrollLeft + e.delta;\n break;\n case 'rgRow':\n e.coordinate = this.verticalScroll.scrollTop + e.delta;\n break;\n }\n this.setScroll(e);\n }\n return e;\n }\n\n /**\n * Dispatch this event to trigger vertical mouse wheel from plugins\n */\n @Listen('mousewheel-vertical') mousewheelVertical({\n detail: e,\n }: CustomEvent<LocalScrollEvent>) {\n this.verticalMouseWheel(e);\n }\n /**\n * Dispatch this event to trigger horizontal mouse wheel from plugins\n */\n @Listen('mousewheel-horizontal') mousewheelHorizontal({\n detail: e,\n }: CustomEvent<LocalScrollEvent>) {\n this.horizontalMouseWheel(e);\n }\n /**\n * Allows to use outside listener\n */\n @Listen('scroll-coordinate') scrollApply({\n detail: { type, coordinate },\n }: CustomEvent<ScrollCoordinateEvent>) {\n this.applyOnScroll(type, coordinate, true);\n }\n\n connectedCallback() {\n /**\n * Bind scroll functions for farther usage\n */\n if ('ontouchstart' in document.documentElement) {\n this.scrollThrottling = 0;\n } else {\n this.verticalMouseWheel = this.onVerticalMouseWheel.bind(\n this,\n 'rgRow',\n 'deltaY',\n );\n this.horizontalMouseWheel = this.onHorizontalMouseWheel.bind(\n this,\n 'rgCol',\n 'deltaX',\n );\n }\n /**\n * Create local scroll service\n */\n this.scrollService = new LocalScrollService({\n // to improve safari smoothnes on scroll\n skipAnimationFrame: isSafariDesktop(),\n beforeScroll: e => this.scrollViewport.emit(e),\n afterScroll: e => {\n this.lastKnownScrollCoordinate[e.dimension] = e.coordinate;\n switch (e.dimension) {\n case 'rgCol':\n this.horizontalScroll.scrollLeft = e.coordinate;\n break;\n case 'rgRow':\n // this will trigger on scroll event\n this.verticalScroll.scrollTop = e.coordinate;\n // for mobile devices to skip negative scroll loop. only on vertical scroll\n if (this.verticalScroll.style.transform) {\n this.verticalScroll.style.transform = '';\n }\n break;\n }\n },\n });\n }\n\n componentDidLoad() {\n // track horizontal viewport resize\n this.resizeService = new GridResizeService(this.horizontalScroll, {\n resize: entries => {\n let height = entries[0]?.contentRect.height || 0;\n if (height) {\n height -= this.header.clientHeight + this.footer.clientHeight;\n }\n const els = {\n rgRow: {\n size: height,\n contentSize: this.contentHeight,\n scroll: this.verticalScroll.scrollTop,\n },\n rgCol: {\n size: entries[0]?.contentRect.width || 0,\n contentSize: this.contentWidth,\n scroll: this.horizontalScroll.scrollLeft,\n },\n };\n each(els, (item, dimension: RevoGrid.DimensionType) => {\n this.resizeViewport.emit({ dimension, size: item.size });\n this.scrollService?.scroll(item.scroll, dimension, true);\n // track scroll visibility on outer element change\n this.setScrollVisibility(dimension, item.size, item.contentSize);\n });\n },\n });\n }\n\n /**\n * Check if scroll present or not per type\n * Trigger this method on inner content size change or on outer element size change\n * If inner content bigger then outer size then scroll is present and mousewheel binding required\n * @param type - dimension type 'rgRow/y' or 'rgCol/x'\n * @param size - outer content size\n * @param innerContentSize - inner content size\n */\n setScrollVisibility(\n type: RevoGrid.DimensionType,\n size: number,\n innerContentSize: number,\n ) {\n // test if scroll present\n const hasScroll = size < innerContentSize;\n let el: HTMLElement;\n // event reference for binding\n switch (type) {\n case 'rgCol':\n el = this.horizontalScroll;\n break;\n case 'rgRow':\n el = this.verticalScroll;\n break;\n }\n // based on scroll visibility assign or remove class and event\n if (hasScroll) {\n el.classList.add(`scroll-${type}`);\n } else {\n el.classList.remove(`scroll-${type}`);\n }\n this.scrollchange.emit({ type, hasScroll });\n }\n\n disconnectedCallback() {\n this.resizeService.destroy();\n }\n\n async componentDidRender() {\n // scroll update if number of rows changed\n if (this.contentHeight < this.oldValY && this.verticalScroll) {\n this.verticalScroll.scrollTop += this.contentHeight - this.oldValY;\n }\n this.oldValY = this.contentHeight;\n\n // scroll update if number of cols changed\n if (this.contentWidth < this.oldValX) {\n this.horizontalScroll.scrollLeft += this.contentWidth - this.oldValX;\n }\n this.oldValX = this.contentWidth;\n\n this.scrollService.setParams(\n {\n contentSize: this.contentHeight,\n clientSize: this.verticalScroll.clientHeight,\n virtualSize: 0,\n },\n 'rgRow',\n );\n\n this.scrollService.setParams(\n {\n contentSize: this.contentWidth,\n clientSize: this.horizontalScroll.clientWidth,\n virtualSize: 0,\n },\n 'rgCol',\n );\n this.setScrollVisibility(\n 'rgRow',\n this.verticalScroll.clientHeight,\n this.contentHeight,\n );\n this.setScrollVisibility(\n 'rgCol',\n this.horizontalScroll.clientWidth,\n this.contentWidth,\n );\n }\n\n render() {\n return (\n <Host\n onWheel={this.horizontalMouseWheel}\n onScroll={(e: UIEvent) => this.onScroll('rgCol', e)}\n >\n <div\n class=\"inner-content-table\"\n style={{ width: `${this.contentWidth}px` }}\n >\n <div class=\"header-wrapper\" ref={e => (this.header = e)}>\n <slot name={HEADER_SLOT} />\n </div>\n <div\n class=\"vertical-inner\"\n ref={el => (this.verticalScroll = el)}\n onWheel={this.verticalMouseWheel}\n onScroll={(e: MouseEvent) => this.onScroll('rgRow', e)}\n >\n <div\n class=\"content-wrapper\"\n style={{ height: `${this.contentHeight}px` }}\n >\n <slot name={CONTENT_SLOT} />\n </div>\n </div>\n <div class=\"footer-wrapper\" ref={e => (this.footer = e)}>\n <slot name={FOOTER_SLOT} />\n </div>\n </div>\n </Host>\n );\n }\n /**\n * Extra layer for scroll event monitoring, where MouseWheel event is not passing\n * We need to trigger scroll event in case there is no mousewheel event\n */\n private onScroll(type: RevoGrid.DimensionType, e: UIEvent) {\n if (!(e.target instanceof HTMLElement)) {\n return;\n }\n const target = e.target;\n let scroll = 0;\n switch (type) {\n case 'rgCol':\n scroll = target?.scrollLeft;\n break;\n case 'rgRow':\n scroll = target?.scrollTop;\n break;\n }\n\n // for mobile devices to skip negative scroll loop\n if (scroll < 0) {\n this.silentScroll.emit({ dimension: type, coordinate: scroll });\n return;\n }\n this.applyOnScroll(type, scroll);\n }\n\n /**\n * Applies scroll on scroll event only if mousewheel event was some time ago\n */\n private applyOnScroll(\n type: RevoGrid.DimensionType,\n coordinate: number,\n outside = false,\n ) {\n const change = new Date().getTime() - this.mouseWheelScrollTimestamp[type];\n // apply after throttling\n if (change > this.scrollThrottling && coordinate !== this.lastKnownScrollCoordinate[type]) {\n this.scrollService?.scroll(\n coordinate,\n type,\n undefined,\n undefined,\n outside,\n );\n }\n }\n\n /** remember last mw event time */\n private latestScrollUpdate(dimension: RevoGrid.DimensionType) {\n this.mouseWheelScrollTimestamp[dimension] = new Date().getTime();\n }\n\n /**\n * On vertical mousewheel event\n * @param type\n * @param delta\n * @param e\n */\n private onVerticalMouseWheel(\n type: RevoGrid.DimensionType,\n delta: Delta,\n e: LocalScrollEvent,\n ) {\n e.preventDefault && e.preventDefault();\n const pos = this.verticalScroll.scrollTop + e[delta];\n this.scrollService?.scroll(pos, type, undefined, e[delta]);\n this.latestScrollUpdate(type);\n }\n\n /**\n * On horizontal mousewheel event\n * @param type\n * @param delta\n * @param e\n */\n private onHorizontalMouseWheel(\n type: RevoGrid.DimensionType,\n delta: Delta,\n e: LocalScrollEvent,\n ) {\n e.preventDefault && e.preventDefault();\n const pos = this.horizontalScroll.scrollLeft + e[delta];\n this.scrollService?.scroll(pos, type, undefined, e[delta]);\n this.latestScrollUpdate(type);\n }\n}\n"],"version":3}
|
|
@@ -332,6 +332,10 @@ class LocalScrollService {
|
|
|
332
332
|
async setScroll(e) {
|
|
333
333
|
this.cancelScroll(e.dimension);
|
|
334
334
|
const frameAnimation = new Promise((resolve, reject) => {
|
|
335
|
+
// for example safari desktop has issues with animation frame
|
|
336
|
+
if (this.cfg.skipAnimationFrame) {
|
|
337
|
+
return resolve();
|
|
338
|
+
}
|
|
335
339
|
const animationId = window.requestAnimationFrame(() => {
|
|
336
340
|
resolve();
|
|
337
341
|
});
|
|
@@ -400,4 +404,4 @@ class LocalScrollService {
|
|
|
400
404
|
exports.ColumnService = ColumnService;
|
|
401
405
|
exports.LocalScrollService = LocalScrollService;
|
|
402
406
|
|
|
403
|
-
//# sourceMappingURL=localScrollService-
|
|
407
|
+
//# sourceMappingURL=localScrollService-864b2745.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"localScrollService-864b2745.js","mappings":";;;;;;;;;MAmBqB,aAAa;EAEhC,IAAI,OAAO;IACT,OAAOA,0BAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;GAC1C;EAKD,YAAoB,SAAoB,EAAU,MAAoB;IAAlD,cAAS,GAAT,SAAS,CAAW;IAAU,WAAM,GAAN,MAAM,CAAc;IAR9D,gBAAW,GAAmB,EAAE,CAAC;IAKzC,gBAAW,GAAG,KAAK,CAAC;IAIlB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;IACzC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,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AAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;GAC/B;;EAGO,cAAc,CAAC,CAAS,EAAE,KAAa;IAC7C,IAAI,CAAC,GAAG,CAAC,EAAE;MACT,OAAO,aAAa,CAAC;KACtB;IAED,IAAI,CAAC,GAAG,KAAK,CAAC,OAAO,EAAE;MACrB,OAAO,KAAK,CAAC,OAAO,CAAC;KACtB;IACD,OAAO,CAAC,CAAC;GACV;;EAGO,YAAY,CAAC,SAAiC;IACpD,MAAM,QAAQ,GAAG,IAAI,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;IACzD,IAAI,QAAQ,EAAE;MACZ,QAAQ,EAAE,CAAC;MACX,IAAI,CAAC,uBAAuB,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;KAChD;GACF;;EAGO,OAAO,CAAC,GAAW,EAAE,KAAa,EAAE,SAAkB,IAAI;IAChE,MAAM,QAAQ,GAAW,KAAK,CAAC,UAAU,CAAC;IAC1C,MAAM,IAAI,GAAqB,CAAC,CAAC,EAAE,KAAK,CAAC,kBAAkB,GAAG,QAAQ,CAAC,CAAC;IACxE,MAAM,EAAE,GAAqB,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC;IACxE,IAAI,MAAM,EAAE;MACV,OAAOI,gBAAU,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;KAClC;IACD,OAAOA,gBAAU,CAAC,GAAG,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;GAClC;;;;;;","names":["getVisibleSourceItem","isGroupingColumn","CELL_CLASS","DISABLED_CLASS","h","getSourceItem","getRange","setSourceByVirtualIndex","slice","scaleValue"],"sources":["./src/components/data/columnService.ts","./src/services/localScrollService.ts"],"sourcesContent":["import { h, VNode } from '@stencil/core';\nimport { DataSourceState, getSourceItem, getVisibleSourceItem, setSourceByVirtualIndex } from '../../store/dataSource/data.store';\nimport { CELL_CLASS, DISABLED_CLASS } from '../../utils/consts';\nimport { Edition, Observable, RevoGrid, Selection } from '../../interfaces';\nimport { getRange } from '../../store/selection/selection.helpers';\n\nimport { isGroupingColumn } from '../../plugins/groupingRow/grouping.service';\nimport { slice } from 'lodash';\n\nexport type ColumnSource = Observable<DataSourceState<RevoGrid.ColumnRegular, RevoGrid.DimensionCols>>;\nexport type RowSource = Observable<DataSourceState<RevoGrid.DataType, RevoGrid.DimensionRows>>;\n\nexport type ColumnStores = {\n [T in RevoGrid.DimensionCols]: ColumnSource;\n};\nexport type RowStores = {\n [T in RevoGrid.DimensionRows]: RowSource;\n};\n\nexport default class ColumnService {\n private unsubscribe: { (): void }[] = [];\n get columns(): RevoGrid.ColumnRegular[] {\n return getVisibleSourceItem(this.source);\n }\n\n hasGrouping = false;\n type: RevoGrid.DimensionCols;\n\n constructor(private dataStore: RowSource, private source: ColumnSource) {\n this.unsubscribe.push(source.onChange('source', s => this.checkGrouping(s)));\n this.checkGrouping(source.get('source'));\n this.type = source.get('type');\n }\n\n private checkGrouping(cols: RevoGrid.ColumnRegular[]) {\n for (let rgCol of cols) {\n if (isGroupingColumn(rgCol)) {\n this.hasGrouping = true;\n return;\n }\n this.hasGrouping = false;\n }\n }\n\n isReadOnly(r: number, c: number): boolean {\n const readOnly: RevoGrid.ReadOnlyFormat = this.columns[c]?.readonly;\n if (typeof readOnly === 'function') {\n const data = this.rowDataModel(r, c);\n return readOnly(data);\n }\n return readOnly;\n }\n\n static doMerge(existing: RevoGrid.CellProps, extra: RevoGrid.CellProps) {\n let props: RevoGrid.CellProps = { ...extra, ...existing };\n // extend existing props\n if (extra.class) {\n if (typeof extra.class === 'object' && typeof props.class === 'object') {\n props.class = { ...extra.class, ...props.class };\n } else if (typeof extra.class === 'string' && typeof props.class === 'object') {\n props.class[extra.class] = true;\n } else if (typeof props.class === 'string') {\n props.class += ' ' + extra.class;\n }\n }\n if (extra.style) {\n props.style = { ...extra.style, ...props.style };\n }\n return props;\n }\n\n mergeProperties(r: number, c: number, defaultProps: RevoGrid.CellProps): RevoGrid.CellProps {\n const cellClass: { [key: string]: boolean } = {\n [CELL_CLASS]: true,\n [DISABLED_CLASS]: this.isReadOnly(r, c),\n };\n let props: RevoGrid.CellProps = {\n ...defaultProps,\n class: cellClass,\n };\n const extraPropsFunc = this.columns[c]?.cellProperties;\n if (extraPropsFunc) {\n const data = this.rowDataModel(r, c);\n const extra = extraPropsFunc(data);\n if (!extra) {\n return props;\n }\n return ColumnService.doMerge(props, extra);\n }\n return props;\n }\n\n customRenderer(\n c: number, model: RevoGrid.ColumnDataSchemaModel, providers: RevoGrid.Providers, additionalData: any\n ): VNode | string | void {\n const tpl = this.columns[c]?.cellTemplate;\n if (tpl) {\n return tpl(h, { ...model, providers }, additionalData);\n }\n return;\n }\n\n getRowClass(r: number, prop: string): string {\n const model = getSourceItem(this.dataStore, r) || {};\n return model[prop] || '';\n }\n\n getCellData(r: number, c: number): string {\n const data = this.rowDataModel(r, c);\n return ColumnService.getData(data.model[data.prop as number]);\n }\n\n getSaveData(rowIndex: number, c: number, val?: string): Edition.BeforeSaveDataDetails {\n if (typeof val === 'undefined') {\n val = this.getCellData(rowIndex, c);\n }\n const data = this.rowDataModel(rowIndex, c);\n return {\n prop: data.prop,\n rowIndex,\n val,\n model: data.model,\n type: this.dataStore.get('type'),\n };\n }\n\n getCellEditor(_r: number, c: number, editors: Edition.Editors): Edition.EditorCtr | undefined {\n const editor = this.columns[c]?.editor;\n if (!editor) {\n return undefined;\n }\n // reference\n if (typeof editor === 'string') {\n return editors[editor];\n }\n return editor;\n }\n\n rowDataModel(rowIndex: number, c: number): RevoGrid.ColumnDataSchemaModel {\n const column = this.columns[c];\n const prop: RevoGrid.ColumnProp | undefined = column?.prop;\n const model = getSourceItem(this.dataStore, rowIndex) || {};\n return {\n prop,\n model,\n data: this.dataStore.get('source'),\n column,\n rowIndex,\n };\n }\n\n getRangeData(d: Selection.ChangedRange, columns: RevoGrid.ColumnRegular[]): {\n changed: RevoGrid.DataLookup,\n mapping: Selection.OldNewRangeMapping,\n } {\n const changed: RevoGrid.DataLookup = {};\n\n // get original length sizes\n const copyColLength = d.oldRange.x1 - d.oldRange.x + 1;\n const copyRowLength = d.oldRange.y1 - d.oldRange.y + 1;\n const mapping: Selection.OldNewRangeMapping = {};\n\n // rows\n for (let rowIndex = d.newRange.y, i = 0; rowIndex < d.newRange.y1 + 1; rowIndex++, i++) {\n // copy original data link\n const oldRowIndex = d.oldRange.y + i % copyRowLength;\n const copyRow = getSourceItem(this.dataStore, oldRowIndex) || {};\n\n // columns\n for (let colIndex = d.newRange.x, j = 0; colIndex < d.newRange.x1 + 1; colIndex++, j++) {\n // check if old range area\n if (rowIndex >= d.oldRange.y && rowIndex <= d.oldRange.y1 && colIndex >= d.oldRange.x && colIndex <= d.oldRange.x1) {\n continue;\n }\n\n // requested column beyond range\n if (!this.columns[colIndex]) {\n continue;\n }\n const prop = this.columns[colIndex]?.prop;\n const copyColIndex = d.oldRange.x + j % copyColLength;\n const copyColumnProp = columns[copyColIndex].prop;\n\n /** if can write */\n if (!this.isReadOnly(rowIndex, colIndex)) {\n /** to show before save */\n if (!changed[rowIndex]) {\n changed[rowIndex] = {};\n }\n changed[rowIndex][prop] = copyRow[copyColumnProp];\n /** Generate mapping object */\n if (!mapping[rowIndex]) {\n mapping[rowIndex] = {};\n }\n mapping[rowIndex][prop] = {\n colProp: copyColumnProp,\n rowIndex: oldRowIndex\n };\n }\n }\n }\n return {\n changed,\n mapping,\n };\n }\n\n getTransformedDataToApply(\n start: Selection.Cell,\n data: RevoGrid.DataFormat[][],\n ): {\n changed: RevoGrid.DataLookup;\n range: Selection.RangeArea;\n } {\n const changed: RevoGrid.DataLookup = {};\n const copyRowLength = data.length;\n const colLength = this.columns.length;\n const rowLength = this.dataStore.get('items').length;\n // rows\n let rowIndex = start.y;\n let maxCol = 0;\n for (let i = 0; rowIndex < rowLength && i < copyRowLength; rowIndex++, i++) {\n // copy original data link\n const copyRow = data[i % copyRowLength];\n const copyColLength = copyRow?.length || 0;\n // columns\n let colIndex = start.x;\n for (let j = 0; colIndex < colLength && j < copyColLength; colIndex++, j++) {\n const p = this.columns[colIndex].prop;\n const currentCol = j % colLength;\n\n /** if can write */\n if (!this.isReadOnly(rowIndex, colIndex)) {\n /** to show before save */\n if (!changed[rowIndex]) {\n changed[rowIndex] = {};\n }\n changed[rowIndex][p] = copyRow[currentCol];\n }\n }\n maxCol = Math.max(maxCol, colIndex - 1);\n }\n const range = getRange(start, {\n y: rowIndex - 1,\n x: maxCol,\n });\n return {\n changed,\n range,\n };\n }\n\n applyRangeData(data: RevoGrid.DataLookup) {\n const items: Record<number, RevoGrid.DataType> = {};\n for (let rowIndex in data) {\n const oldModel = (items[rowIndex] = getSourceItem(this.dataStore, parseInt(rowIndex, 10)));\n if (!oldModel) {\n continue;\n }\n for (let prop in data[rowIndex]) {\n oldModel[prop] = data[rowIndex][prop];\n }\n }\n setSourceByVirtualIndex(this.dataStore, items);\n }\n\n getRangeStaticData(d: Selection.RangeArea, value: RevoGrid.DataFormat): RevoGrid.DataLookup {\n const changed: RevoGrid.DataLookup = {};\n\n // rows\n for (let rowIndex = d.y, i = 0; rowIndex < d.y1 + 1; rowIndex++, i++) {\n // columns\n for (let colIndex = d.x, j = 0; colIndex < d.x1 + 1; colIndex++, j++) {\n // requested column beyond range\n if (!this.columns[colIndex]) {\n continue;\n }\n const p = this.columns[colIndex].prop;\n\n /** if can write */\n if (!this.isReadOnly(rowIndex, colIndex)) {\n /** to show before save */\n if (!changed[rowIndex]) {\n changed[rowIndex] = {};\n }\n changed[rowIndex][p] = value;\n }\n }\n }\n return changed;\n }\n\n getRangeTransformedToProps(\n d: Selection.RangeArea,\n store: Observable<DataSourceState<RevoGrid.DataType, RevoGrid.DimensionRows>>,\n ) {\n const area: {\n prop: RevoGrid.ColumnProp,\n rowIndex: number,\n model: RevoGrid.DataSource,\n type: RevoGrid.MultiDimensionType,\n }[] = [];\n\n const type = this.dataStore.get('type');\n // rows\n for (let rowIndex = d.y, i = 0; rowIndex < d.y1 + 1; rowIndex++, i++) {\n // columns\n for (let colIndex = d.x, j = 0; colIndex < d.x1 + 1; colIndex++, j++) {\n const prop = this.columns[colIndex]?.prop;\n area.push({\n prop,\n rowIndex,\n model: getSourceItem(store, rowIndex),\n type,\n });\n }\n }\n return area;\n }\n\n copyRangeArray(\n range: Selection.RangeArea,\n store: Observable<DataSourceState<RevoGrid.DataType, RevoGrid.DimensionRows>>,\n ) {\n const cols = [...this.columns];\n const props = slice(cols, range.x, range.x1 + 1).map(v => v.prop);\n const toCopy: RevoGrid.DataFormat[][] = [];\n const mapping: { [rowIndex: number]: { [colProp: RevoGrid.ColumnProp]: any } } = {};\n\n // rows indexes\n for (let i = range.y; i <= range.y1; i++) {\n const rgRow: RevoGrid.DataFormat[] = [];\n mapping[i] = {};\n\n // columns indexes\n for (let prop of props) {\n const item = getSourceItem(store, i);\n\n // if no item - skip\n if (!item) {\n continue;\n }\n const val = item[prop];\n rgRow.push(val);\n mapping[i][prop] = val;\n }\n\n toCopy.push(rgRow);\n }\n return {\n data: toCopy,\n mapping\n };\n }\n\n static getData(val?: any) {\n if (typeof val === 'undefined' || val === null) {\n return '';\n }\n return val;\n }\n\n destroy() {\n this.unsubscribe.forEach(f => f());\n }\n}\n","import { scaleValue } from '../utils';\nimport { RevoGrid } from '../interfaces';\n\ninterface Config {\n skipAnimationFrame?: boolean;\n beforeScroll(e: RevoGrid.ViewPortScrollEvent): void;\n afterScroll(e: RevoGrid.ViewPortScrollEvent): void;\n}\n\ntype Params = {\n contentSize: number;\n virtualContentSize?: number;\n clientSize: number;\n virtualSize: number;\n maxSize?: number;\n};\n\nconst initialParams: Params = {\n contentSize: 0,\n clientSize: 0,\n virtualSize: 0,\n maxSize: 0,\n};\nconst NO_COORDINATE = -1;\nexport default class LocalScrollService {\n private preventArtificialScroll: Record<RevoGrid.DimensionType, () => void | null> = { rgRow: null, rgCol: null };\n // to check if scroll changed\n private previousScroll: Record<RevoGrid.DimensionType, number> = { rgRow: NO_COORDINATE, rgCol: NO_COORDINATE };\n private params: Record<RevoGrid.DimensionType, Params> = { rgRow: { ...initialParams }, rgCol: { ...initialParams } };\n\n constructor(private cfg: Config) {}\n\n static getVirtualContentSize(contentSize: number, clientSize: number, virtualSize: number = 0): number {\n return contentSize + (virtualSize ? clientSize - virtualSize : 0);\n }\n\n setParams(params: Params, dimension: RevoGrid.DimensionType) {\n const virtualContentSize = LocalScrollService.getVirtualContentSize(params.contentSize, params.clientSize, params.virtualSize);\n this.params[dimension] = {\n ...params,\n maxSize: virtualContentSize - params.clientSize,\n virtualContentSize,\n };\n }\n\n // apply scroll values after scroll done\n async setScroll(e: RevoGrid.ViewPortScrollEvent) {\n this.cancelScroll(e.dimension);\n\n const frameAnimation = new Promise<void>((resolve, reject) => {\n // for example safari desktop has issues with animation frame\n if (this.cfg.skipAnimationFrame) {\n return resolve();\n }\n const animationId = window.requestAnimationFrame(() => {\n resolve();\n });\n this.preventArtificialScroll[e.dimension] = reject.bind(null, animationId);\n });\n try {\n await frameAnimation;\n const params = this.getParams(e.dimension);\n e.coordinate = Math.ceil(e.coordinate);\n this.previousScroll[e.dimension] = this.wrapCoordinate(e.coordinate, params);\n this.preventArtificialScroll[e.dimension] = null;\n this.cfg.afterScroll({\n ...e,\n coordinate: params.virtualSize ? this.convert(e.coordinate, params, false) : e.coordinate,\n });\n\n } catch (id) {\n window.cancelAnimationFrame(id);\n }\n }\n\n // initiate scrolling event\n scroll(\n coordinate: number,\n dimension: RevoGrid.DimensionType,\n force = false,\n delta?: number,\n outside = false\n ) {\n this.cancelScroll(dimension);\n if (!force && this.previousScroll[dimension] === coordinate) {\n this.previousScroll[dimension] = NO_COORDINATE;\n return;\n }\n\n const param = this.getParams(dimension);\n this.cfg.beforeScroll({\n dimension: dimension,\n coordinate: param.virtualSize ? this.convert(coordinate, param) : coordinate,\n delta,\n outside\n });\n }\n\n private getParams(dimension: RevoGrid.DimensionType): Params {\n return this.params[dimension];\n }\n\n // check if scroll outside of region to avoid looping\n private wrapCoordinate(c: number, param: Params): number {\n if (c < 0) {\n return NO_COORDINATE;\n }\n\n if (c > param.maxSize) {\n return param.maxSize;\n }\n return c;\n }\n\n // prevent already started scroll, performance optimization\n private cancelScroll(dimension: RevoGrid.DimensionType) {\n const canceler = this.preventArtificialScroll[dimension];\n if (canceler) {\n canceler();\n this.preventArtificialScroll[dimension] = null;\n }\n }\n\n /* convert virtual to real and back, scale range */\n private convert(pos: number, param: Params, toReal: boolean = true): number {\n const minRange: number = param.clientSize;\n const from: [number, number] = [0, param.virtualContentSize - minRange];\n const to: [number, number] = [0, param.contentSize - param.virtualSize];\n if (toReal) {\n return scaleValue(pos, from, to);\n }\n return scaleValue(pos, to, from);\n }\n}\n"],"version":3}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
8
|
const index = require('./index-ee2ef5ae.js');
|
|
9
|
-
const localScrollService = require('./localScrollService-
|
|
9
|
+
const localScrollService = require('./localScrollService-864b2745.js');
|
|
10
10
|
const index$1 = require('./index-effc94b9.js');
|
|
11
11
|
const viewport_helpers = require('./viewport.helpers-70ccec8f.js');
|
|
12
12
|
const filter_button = require('./filter.button-6badec7a.js');
|
|
@@ -867,6 +867,10 @@ class GridResizeService {
|
|
|
867
867
|
}
|
|
868
868
|
}
|
|
869
869
|
|
|
870
|
+
function isSafariDesktop() {
|
|
871
|
+
return /Safari/i.test(navigator.userAgent) && !/Chrome/i.test(navigator.userAgent) && !navigator.userAgent.match(/(iPad|iPhone|iPod)/g);
|
|
872
|
+
}
|
|
873
|
+
|
|
870
874
|
const revogrViewportScrollStyleCss = ".revo-drag-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 438 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M421.875,70.40625 C426.432292,70.40625 430.175781,68.9414062 433.105469,66.0117188 C436.035156,63.0820312 437.5,59.3385417 437.5,54.78125 L437.5,54.78125 L437.5,15.71875 C437.5,11.1614583 436.035156,7.41796875 433.105469,4.48828125 C430.175781,1.55859375 426.432292,0.09375 421.875,0.09375 L421.875,0.09375 L15.625,0.09375 C11.0677083,0.09375 7.32421875,1.55859375 4.39453125,4.48828125 C1.46484375,7.41796875 0,11.1614583 0,15.71875 L0,15.71875 L0,54.78125 C0,59.3385417 1.46484375,63.0820312 4.39453125,66.0117188 C7.32421875,68.9414062 11.0677083,70.40625 15.625,70.40625 L15.625,70.40625 L421.875,70.40625 Z M421.875,226.65625 C426.432292,226.65625 430.175781,225.191406 433.105469,222.261719 C436.035156,219.332031 437.5,215.588542 437.5,211.03125 L437.5,211.03125 L437.5,171.96875 C437.5,167.411458 436.035156,163.667969 433.105469,160.738281 C430.175781,157.808594 426.432292,156.34375 421.875,156.34375 L421.875,156.34375 L15.625,156.34375 C11.0677083,156.34375 7.32421875,157.808594 4.39453125,160.738281 C1.46484375,163.667969 0,167.411458 0,171.96875 L0,171.96875 L0,211.03125 C0,215.588542 1.46484375,219.332031 4.39453125,222.261719 C7.32421875,225.191406 11.0677083,226.65625 15.625,226.65625 L15.625,226.65625 L421.875,226.65625 Z M421.875,382.90625 C426.432292,382.90625 430.175781,381.441406 433.105469,378.511719 C436.035156,375.582031 437.5,371.838542 437.5,367.28125 L437.5,367.28125 L437.5,328.21875 C437.5,323.661458 436.035156,319.917969 433.105469,316.988281 C430.175781,314.058594 426.432292,312.59375 421.875,312.59375 L421.875,312.59375 L15.625,312.59375 C11.0677083,312.59375 7.32421875,314.058594 4.39453125,316.988281 C1.46484375,319.917969 0,323.661458 0,328.21875 L0,328.21875 L0,367.28125 C0,371.838542 1.46484375,375.582031 4.39453125,378.511719 C7.32421875,381.441406 11.0677083,382.90625 15.625,382.90625 L15.625,382.90625 L421.875,382.90625 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 438 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M421.875,70.40625 C426.432292,70.40625 430.175781,68.9414062 433.105469,66.0117188 C436.035156,63.0820312 437.5,59.3385417 437.5,54.78125 L437.5,54.78125 L437.5,15.71875 C437.5,11.1614583 436.035156,7.41796875 433.105469,4.48828125 C430.175781,1.55859375 426.432292,0.09375 421.875,0.09375 L421.875,0.09375 L15.625,0.09375 C11.0677083,0.09375 7.32421875,1.55859375 4.39453125,4.48828125 C1.46484375,7.41796875 0,11.1614583 0,15.71875 L0,15.71875 L0,54.78125 C0,59.3385417 1.46484375,63.0820312 4.39453125,66.0117188 C7.32421875,68.9414062 11.0677083,70.40625 15.625,70.40625 L15.625,70.40625 L421.875,70.40625 Z M421.875,226.65625 C426.432292,226.65625 430.175781,225.191406 433.105469,222.261719 C436.035156,219.332031 437.5,215.588542 437.5,211.03125 L437.5,211.03125 L437.5,171.96875 C437.5,167.411458 436.035156,163.667969 433.105469,160.738281 C430.175781,157.808594 426.432292,156.34375 421.875,156.34375 L421.875,156.34375 L15.625,156.34375 C11.0677083,156.34375 7.32421875,157.808594 4.39453125,160.738281 C1.46484375,163.667969 0,167.411458 0,171.96875 L0,171.96875 L0,211.03125 C0,215.588542 1.46484375,219.332031 4.39453125,222.261719 C7.32421875,225.191406 11.0677083,226.65625 15.625,226.65625 L15.625,226.65625 L421.875,226.65625 Z M421.875,382.90625 C426.432292,382.90625 430.175781,381.441406 433.105469,378.511719 C436.035156,375.582031 437.5,371.838542 437.5,367.28125 L437.5,367.28125 L437.5,328.21875 C437.5,323.661458 436.035156,319.917969 433.105469,316.988281 C430.175781,314.058594 426.432292,312.59375 421.875,312.59375 L421.875,312.59375 L15.625,312.59375 C11.0677083,312.59375 7.32421875,314.058594 4.39453125,316.988281 C1.46484375,319.917969 0,323.661458 0,328.21875 L0,328.21875 L0,367.28125 C0,371.838542 1.46484375,375.582031 4.39453125,378.511719 C7.32421875,381.441406 11.0677083,382.90625 15.625,382.90625 L15.625,382.90625 L421.875,382.90625 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:7px;background-size:cover;background-repeat:no-repeat}.revo-alt-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:11px;background-size:cover;background-repeat:no-repeat}.arrow-down{position:absolute;right:5px;top:0}.arrow-down svg{width:8px;margin-top:5px;margin-left:5px;opacity:0.4}.cell-value-wrapper{margin-right:10px;overflow:hidden;text-overflow:ellipsis}.revo-button{position:relative;overflow:hidden;color:#fff;background-color:#6200ee;height:34px;line-height:34px;padding:0 15px;outline:0;border:0;border-radius:7px;box-sizing:border-box;cursor:pointer}.revo-button.green{background-color:#2ee072;border:1px solid #20d565}.revo-button.red{background-color:#E0662E;border:1px solid #d55920}.revo-button:disabled,.revo-button[disabled]{cursor:not-allowed !important;filter:opacity(0.35) !important}.revo-button.light{border:2px solid #cedefa;line-height:32px;background:none;color:#4876ca;box-shadow:none}.rowHeaders{z-index:2;font-size:10px;display:flex;height:100%}.rowHeaders revogr-data .rgCell{text-align:center}.rowHeaders .rgCell{padding:0 1em !important;min-width:100%}revogr-viewport-scroll{-ms-overflow-style:none;scrollbar-width:none;overflow-x:auto;overflow-y:hidden;position:relative;z-index:1;height:100%}revogr-viewport-scroll::-webkit-scrollbar{display:none;-webkit-appearance:none}revogr-viewport-scroll.colPinStart,revogr-viewport-scroll.colPinEnd{z-index:2}revogr-viewport-scroll.colPinEnd:has(.active){overflow:visible}revogr-viewport-scroll.rgCol{flex-grow:1}revogr-viewport-scroll .content-wrapper{overflow:hidden}revogr-viewport-scroll .inner-content-table{display:flex;flex-direction:column;max-height:100%;width:100%;min-width:100%;position:relative;z-index:0}revogr-viewport-scroll .vertical-inner{overflow-y:auto;position:relative;width:100%;flex-grow:1;-ms-overflow-style:none;scrollbar-width:none;}revogr-viewport-scroll .vertical-inner::-webkit-scrollbar{display:none;-webkit-appearance:none}revogr-viewport-scroll .vertical-inner revogr-data,revogr-viewport-scroll .vertical-inner revogr-overlay-selection{height:100%}";
|
|
871
875
|
|
|
872
876
|
const RevogrViewportScroll = class {
|
|
@@ -883,7 +887,11 @@ const RevogrViewportScroll = class {
|
|
|
883
887
|
* Last mw event time for trigger scroll function below
|
|
884
888
|
* If mousewheel function was ignored we still need to trigger render
|
|
885
889
|
*/
|
|
886
|
-
this.
|
|
890
|
+
this.mouseWheelScrollTimestamp = {
|
|
891
|
+
rgCol: 0,
|
|
892
|
+
rgRow: 0,
|
|
893
|
+
};
|
|
894
|
+
this.lastKnownScrollCoordinate = {
|
|
887
895
|
rgCol: 0,
|
|
888
896
|
rgRow: 0,
|
|
889
897
|
};
|
|
@@ -957,13 +965,17 @@ const RevogrViewportScroll = class {
|
|
|
957
965
|
* Create local scroll service
|
|
958
966
|
*/
|
|
959
967
|
this.scrollService = new localScrollService.LocalScrollService({
|
|
968
|
+
// to improve safari smoothnes on scroll
|
|
969
|
+
skipAnimationFrame: isSafariDesktop(),
|
|
960
970
|
beforeScroll: e => this.scrollViewport.emit(e),
|
|
961
971
|
afterScroll: e => {
|
|
972
|
+
this.lastKnownScrollCoordinate[e.dimension] = e.coordinate;
|
|
962
973
|
switch (e.dimension) {
|
|
963
974
|
case 'rgCol':
|
|
964
975
|
this.horizontalScroll.scrollLeft = e.coordinate;
|
|
965
976
|
break;
|
|
966
977
|
case 'rgRow':
|
|
978
|
+
// this will trigger on scroll event
|
|
967
979
|
this.verticalScroll.scrollTop = e.coordinate;
|
|
968
980
|
// for mobile devices to skip negative scroll loop. only on vertical scroll
|
|
969
981
|
if (this.verticalScroll.style.transform) {
|
|
@@ -1090,17 +1102,20 @@ const RevogrViewportScroll = class {
|
|
|
1090
1102
|
}
|
|
1091
1103
|
this.applyOnScroll(type, scroll);
|
|
1092
1104
|
}
|
|
1105
|
+
/**
|
|
1106
|
+
* Applies scroll on scroll event only if mousewheel event was some time ago
|
|
1107
|
+
*/
|
|
1093
1108
|
applyOnScroll(type, coordinate, outside = false) {
|
|
1094
1109
|
var _a;
|
|
1095
|
-
const change = new Date().getTime() - this.
|
|
1110
|
+
const change = new Date().getTime() - this.mouseWheelScrollTimestamp[type];
|
|
1096
1111
|
// apply after throttling
|
|
1097
|
-
if (change > this.scrollThrottling) {
|
|
1112
|
+
if (change > this.scrollThrottling && coordinate !== this.lastKnownScrollCoordinate[type]) {
|
|
1098
1113
|
(_a = this.scrollService) === null || _a === void 0 ? void 0 : _a.scroll(coordinate, type, undefined, undefined, outside);
|
|
1099
1114
|
}
|
|
1100
1115
|
}
|
|
1101
1116
|
/** remember last mw event time */
|
|
1102
1117
|
latestScrollUpdate(dimension) {
|
|
1103
|
-
this.
|
|
1118
|
+
this.mouseWheelScrollTimestamp[dimension] = new Date().getTime();
|
|
1104
1119
|
}
|
|
1105
1120
|
/**
|
|
1106
1121
|
* On vertical mousewheel event
|