gantt-source_management 3.37.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/.editorconfig +9 -0
  2. package/.eslintrc.json +39 -0
  3. package/.prettierrc.cjs +5 -0
  4. package/README.md +129 -0
  5. package/cypress/e2e/add-rows-items.test.ts +26 -0
  6. package/cypress/e2e/basic.test.ts +173 -0
  7. package/cypress/e2e/calculated-zoom-mode.test.ts +163 -0
  8. package/cypress/e2e/calendar-dates.test.ts +285 -0
  9. package/cypress/e2e/dst.test.ts +691 -0
  10. package/cypress/e2e/grid-cells.test.ts +72 -0
  11. package/cypress/e2e/items-vertical.test.ts +305 -0
  12. package/cypress/e2e/items.test.ts +501 -0
  13. package/cypress/e2e/list-columns-toggle.test.ts +124 -0
  14. package/cypress/e2e/list-header-resize.test.ts +30 -0
  15. package/cypress/e2e/locale.test.ts +102 -0
  16. package/cypress/e2e/move-items-outside.test.ts +437 -0
  17. package/cypress/e2e/rows.test.ts +50 -0
  18. package/cypress/e2e/scroll-bar.test.ts +357 -0
  19. package/cypress/e2e/time-bookmarks.test.ts +92 -0
  20. package/cypress/e2e/utc-mode.test.ts +51 -0
  21. package/cypress/fixtures/example.json +5 -0
  22. package/cypress/helpers.ts +12 -0
  23. package/cypress/plugins/index.js +22 -0
  24. package/cypress/support/commands.ts +175 -0
  25. package/cypress/support/e2e.ts +31 -0
  26. package/cypress.config.js +24 -0
  27. package/dist/api/api.d.ts +182 -0
  28. package/dist/api/helpers.d.ts +9 -0
  29. package/dist/api/id.d.ts +14 -0
  30. package/dist/api/locale.d.ts +3 -0
  31. package/dist/api/main.d.ts +47 -0
  32. package/dist/api/public.d.ts +32 -0
  33. package/dist/api/slots.d.ts +22 -0
  34. package/dist/api/time.d.ts +104 -0
  35. package/dist/assets/2f1f893a.wasm +0 -0
  36. package/dist/gstc.d.ts +708 -0
  37. package/dist/gstc.esm.min.d.ts +708 -0
  38. package/dist/gstc.esm.min.js +574 -0
  39. package/dist/gstc.umd.min.d.ts +708 -0
  40. package/dist/gstc.umd.min.js +701 -0
  41. package/dist/gstc.wasm.esm.min.d.ts +708 -0
  42. package/dist/gstc.wasm.esm.min.js +574 -0
  43. package/dist/gstc.wasm.umd.min.d.ts +708 -0
  44. package/dist/gstc.wasm.umd.min.js +701 -0
  45. package/dist/plugins/calendar-scroll.d.ts +15 -0
  46. package/dist/plugins/calendar-scroll.esm.min.d.ts +15 -0
  47. package/dist/plugins/calendar-scroll.esm.min.js +13 -0
  48. package/dist/plugins/calendar-scroll.umd.min.d.ts +15 -0
  49. package/dist/plugins/calendar-scroll.umd.min.js +13 -0
  50. package/dist/plugins/dependency-lines.d.ts +47 -0
  51. package/dist/plugins/dependency-lines.esm.min.d.ts +47 -0
  52. package/dist/plugins/dependency-lines.esm.min.js +38 -0
  53. package/dist/plugins/dependency-lines.umd.min.d.ts +47 -0
  54. package/dist/plugins/dependency-lines.umd.min.js +38 -0
  55. package/dist/plugins/export-image.d.ts +12 -0
  56. package/dist/plugins/export-image.esm.min.d.ts +12 -0
  57. package/dist/plugins/export-image.esm.min.js +28 -0
  58. package/dist/plugins/export-image.umd.min.d.ts +12 -0
  59. package/dist/plugins/export-image.umd.min.js +34 -0
  60. package/dist/plugins/export-pdf.d.ts +12 -0
  61. package/dist/plugins/export-pdf.esm.min.d.ts +12 -0
  62. package/dist/plugins/export-pdf.esm.min.js +389 -0
  63. package/dist/plugins/export-pdf.umd.min.d.ts +12 -0
  64. package/dist/plugins/export-pdf.umd.min.js +511 -0
  65. package/dist/plugins/grab-scroll.d.ts +14 -0
  66. package/dist/plugins/grab-scroll.esm.min.d.ts +14 -0
  67. package/dist/plugins/grab-scroll.umd.min.d.ts +14 -0
  68. package/dist/plugins/highlight-weekends.d.ts +12 -0
  69. package/dist/plugins/highlight-weekends.esm.min.d.ts +12 -0
  70. package/dist/plugins/highlight-weekends.esm.min.js +14 -0
  71. package/dist/plugins/highlight-weekends.umd.min.d.ts +12 -0
  72. package/dist/plugins/highlight-weekends.umd.min.js +14 -0
  73. package/dist/plugins/item-movement.d.ts +97 -0
  74. package/dist/plugins/item-movement.esm.min.d.ts +97 -0
  75. package/dist/plugins/item-movement.esm.min.js +25 -0
  76. package/dist/plugins/item-movement.umd.min.d.ts +97 -0
  77. package/dist/plugins/item-movement.umd.min.js +25 -0
  78. package/dist/plugins/item-resizing.d.ts +102 -0
  79. package/dist/plugins/item-resizing.esm.min.d.ts +102 -0
  80. package/dist/plugins/item-resizing.esm.min.js +37 -0
  81. package/dist/plugins/item-resizing.umd.min.d.ts +102 -0
  82. package/dist/plugins/item-resizing.umd.min.js +37 -0
  83. package/dist/plugins/item-types.d.ts +13 -0
  84. package/dist/plugins/item-types.esm.min.d.ts +13 -0
  85. package/dist/plugins/item-types.esm.min.js +127 -0
  86. package/dist/plugins/item-types.umd.min.d.ts +13 -0
  87. package/dist/plugins/item-types.umd.min.js +127 -0
  88. package/dist/plugins/progress-bar.d.ts +13 -0
  89. package/dist/plugins/progress-bar.esm.min.d.ts +13 -0
  90. package/dist/plugins/progress-bar.esm.min.js +27 -0
  91. package/dist/plugins/progress-bar.umd.min.d.ts +13 -0
  92. package/dist/plugins/progress-bar.umd.min.js +27 -0
  93. package/dist/plugins/selection.d.ts +94 -0
  94. package/dist/plugins/selection.esm.min.d.ts +94 -0
  95. package/dist/plugins/selection.esm.min.js +26 -0
  96. package/dist/plugins/selection.umd.min.d.ts +94 -0
  97. package/dist/plugins/selection.umd.min.js +26 -0
  98. package/dist/plugins/time-bookmarks.d.ts +38 -0
  99. package/dist/plugins/time-bookmarks.esm.min.d.ts +38 -0
  100. package/dist/plugins/time-bookmarks.esm.min.js +50 -0
  101. package/dist/plugins/time-bookmarks.umd.min.d.ts +38 -0
  102. package/dist/plugins/time-bookmarks.umd.min.js +50 -0
  103. package/dist/plugins/timeline-pointer.d.ts +83 -0
  104. package/dist/plugins/timeline-pointer.esm.min.d.ts +83 -0
  105. package/dist/plugins/timeline-pointer.esm.min.js +13 -0
  106. package/dist/plugins/timeline-pointer.umd.min.d.ts +83 -0
  107. package/dist/plugins/timeline-pointer.umd.min.js +13 -0
  108. package/dist/style.css +811 -0
  109. package/dist/vendor.esm.min.js +128 -0
  110. package/examples/complex-1/faces/face-1.jpg +0 -0
  111. package/examples/complex-1/faces/face-10.jpg +0 -0
  112. package/examples/complex-1/faces/face-11.jpg +0 -0
  113. package/examples/complex-1/faces/face-12.jpg +0 -0
  114. package/examples/complex-1/faces/face-13.jpg +0 -0
  115. package/examples/complex-1/faces/face-14.jpg +0 -0
  116. package/examples/complex-1/faces/face-15.jpg +0 -0
  117. package/examples/complex-1/faces/face-16.jpg +0 -0
  118. package/examples/complex-1/faces/face-17.jpg +0 -0
  119. package/examples/complex-1/faces/face-18.jpg +0 -0
  120. package/examples/complex-1/faces/face-19.jpg +0 -0
  121. package/examples/complex-1/faces/face-2.jpg +0 -0
  122. package/examples/complex-1/faces/face-20.jpg +0 -0
  123. package/examples/complex-1/faces/face-21.jpg +0 -0
  124. package/examples/complex-1/faces/face-22.jpg +0 -0
  125. package/examples/complex-1/faces/face-23.jpg +0 -0
  126. package/examples/complex-1/faces/face-24.jpg +0 -0
  127. package/examples/complex-1/faces/face-25.jpg +0 -0
  128. package/examples/complex-1/faces/face-26.jpg +0 -0
  129. package/examples/complex-1/faces/face-27.jpg +0 -0
  130. package/examples/complex-1/faces/face-28.jpg +0 -0
  131. package/examples/complex-1/faces/face-29.jpg +0 -0
  132. package/examples/complex-1/faces/face-3.jpg +0 -0
  133. package/examples/complex-1/faces/face-30.jpg +0 -0
  134. package/examples/complex-1/faces/face-31.jpg +0 -0
  135. package/examples/complex-1/faces/face-32.jpg +0 -0
  136. package/examples/complex-1/faces/face-33.jpg +0 -0
  137. package/examples/complex-1/faces/face-34.jpg +0 -0
  138. package/examples/complex-1/faces/face-35.jpg +0 -0
  139. package/examples/complex-1/faces/face-36.jpg +0 -0
  140. package/examples/complex-1/faces/face-37.jpg +0 -0
  141. package/examples/complex-1/faces/face-38.jpg +0 -0
  142. package/examples/complex-1/faces/face-39.jpg +0 -0
  143. package/examples/complex-1/faces/face-4.jpg +0 -0
  144. package/examples/complex-1/faces/face-40.jpg +0 -0
  145. package/examples/complex-1/faces/face-41.jpg +0 -0
  146. package/examples/complex-1/faces/face-42.jpg +0 -0
  147. package/examples/complex-1/faces/face-43.jpg +0 -0
  148. package/examples/complex-1/faces/face-44.jpg +0 -0
  149. package/examples/complex-1/faces/face-45.jpg +0 -0
  150. package/examples/complex-1/faces/face-46.jpg +0 -0
  151. package/examples/complex-1/faces/face-47.jpg +0 -0
  152. package/examples/complex-1/faces/face-48.jpg +0 -0
  153. package/examples/complex-1/faces/face-49.jpg +0 -0
  154. package/examples/complex-1/faces/face-5.jpg +0 -0
  155. package/examples/complex-1/faces/face-50.jpg +0 -0
  156. package/examples/complex-1/faces/face-6.jpg +0 -0
  157. package/examples/complex-1/faces/face-7.jpg +0 -0
  158. package/examples/complex-1/faces/face-8.jpg +0 -0
  159. package/examples/complex-1/faces/face-9.jpg +0 -0
  160. package/examples/complex-1/index.html +61 -0
  161. package/examples/complex-1/index.js +923 -0
  162. package/examples/index.html +22 -0
  163. package/examples/reset.css +455 -0
  164. package/examples/server.js +18 -0
  165. package/package.json +150 -0
  166. package/tsconfig.json +17 -0
@@ -0,0 +1,15 @@
1
+ /**
2
+ * CalendarScroll plugin
3
+ *
4
+ * @header --gstc--header--
5
+ */
6
+ export interface Point {
7
+ x: number;
8
+ y: number;
9
+ }
10
+ export interface Options {
11
+ enabled: boolean;
12
+ bodyClassName: string;
13
+ }
14
+ export declare function Plugin(options?: Options): (vidoInstance: any) => () => void;
15
+ //# sourceMappingURL=calendar-scroll.d.ts.map
@@ -0,0 +1,15 @@
1
+ /**
2
+ * CalendarScroll plugin
3
+ *
4
+ * @header --gstc--header--
5
+ */
6
+ export interface Point {
7
+ x: number;
8
+ y: number;
9
+ }
10
+ export interface Options {
11
+ enabled: boolean;
12
+ bodyClassName: string;
13
+ }
14
+ export declare function Plugin(options?: Options): (vidoInstance: any) => () => void;
15
+ //# sourceMappingURL=calendar-scroll.d.ts.map
@@ -0,0 +1,13 @@
1
+ /**
2
+ * CalendarScroll plugin
3
+ *
4
+ * @copyright NEURONET - Rafal Pospiech
5
+ * @author Rafal Pospiech <neuronet.io@gmail.com>
6
+ * @module gantt-schedule-timeline-calendar
7
+ * @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
8
+ * @link https://gantt-schedule-timeline-calendar.neuronet.io
9
+ * @version 3.37.5
10
+ * @released 2024-07-19
11
+ * @license SEE LICENSE IN LICENSE FILE
12
+ */
13
+ const t={enabled:!0,bodyClassName:"gstc-scrolling"};function e(e=t){let i,n,o,s=e.enabled;class r{constructor(t){this.moving=!1,this.initialDataIndex={x:0,y:0},this.pointerDown=this.pointerDown.bind(this),this.pointerUp=this.pointerUp.bind(this),this.destroy=this.destroy.bind(this),this.pointerMove=i.schedule(this.pointerMove.bind(this)),t.addEventListener("pointerdown",this.pointerDown),document.addEventListener("pointermove",this.pointerMove,{passive:!0}),document.addEventListener("pointerup",this.pointerUp),t.style.cursor="grab"}destroy(t){t.removeEventListener("pointerdown",this.pointerDown),document.removeEventListener("pointermove",this.pointerMove),document.removeEventListener("pointerup",this.pointerUp)}resetInitialPoint(t){this.initialPoint={x:t.screenX,y:t.screenY}}pointerDown(t){if(!s)return;document.body.classList.add(e.bodyClassName),this.moving=!0,this.resetInitialPoint(t);const i=o.get("$data.scroll");this.initialDataIndex={x:i.horizontal.dataIndex||0,y:i.vertical.dataIndex||0}}pointerUp(){s&&(document.body.classList.remove(e.bodyClassName),this.moving&&(this.moving=!1))}handleHorizontalMovement(t,e){const i=o.get("$data.chart.time"),s=o.get("config.scroll.horizontal");if(t.x>0){if(0===this.initialDataIndex.x)return this.resetInitialPoint(e);const o=i.allDates[i.level];let r,l=this.initialDataIndex.x-1,a=0;for(;l>0&&(r=o[l],a+=r.width,!(a>=t.x));l--);let d=0;r&&(d=r.leftPx),s.byPixels?n.setScrollLeft(d):n.setScrollLeft(l)}else if(t.x<0){let r=this.initialDataIndex.x;const l=o.get("$data.scroll.horizontal"),a=i.allDates[i.level];if(r-1>=a.length-l.lastPageCount)return this.resetInitialPoint(e);let d,c=0;for(let e=a.length;r<e&&(d=a[r],c+=d.width,!(-c<=t.x));r++);if(r-1>=a.length-l.lastPageCount)return;let h=0;d&&(h=d.leftPx),s.byPixels?n.setScrollLeft(h):n.setScrollLeft(r)}}pointerMove(t){if(!s||!this.moving)return;const e={x:t.screenX-this.initialPoint.x,y:t.screenY-this.initialPoint.y};this.handleHorizontalMovement(e,t)}}return function(t){i=t,n=i.api,o=i.state;const l="config.plugin.CalendarScroll",a=t.state.get(l);return a&&(e=n.mergeDeep({},e,a)),o.update(l,e),o.subscribe("config.plugin.CalendarScroll.enabled",(t=>s=t)),o.update("config.actions.chart-calendar",(t=>(t.push(r),t))),n.pluginInitialized("CalendarScroll"),function(){o.update("config.actions.chart-calendar",(t=>t.filter((t=>t!==r)))),n.pluginDestroyed("CalendarScroll")}}}export{e as Plugin};
@@ -0,0 +1,15 @@
1
+ /**
2
+ * CalendarScroll plugin
3
+ *
4
+ * @header --gstc--header--
5
+ */
6
+ export interface Point {
7
+ x: number;
8
+ y: number;
9
+ }
10
+ export interface Options {
11
+ enabled: boolean;
12
+ bodyClassName: string;
13
+ }
14
+ export declare function Plugin(options?: Options): (vidoInstance: any) => () => void;
15
+ //# sourceMappingURL=calendar-scroll.d.ts.map
@@ -0,0 +1,13 @@
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).CalendarScroll={})}(this,(function(t){"use strict";
2
+ /**
3
+ * CalendarScroll plugin
4
+ *
5
+ * @copyright NEURONET - Rafal Pospiech
6
+ * @author Rafal Pospiech <neuronet.io@gmail.com>
7
+ * @module gantt-schedule-timeline-calendar
8
+ * @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
9
+ * @link https://gantt-schedule-timeline-calendar.neuronet.io
10
+ * @version 3.37.5
11
+ * @released 2024-07-19
12
+ * @license SEE LICENSE IN LICENSE FILE
13
+ */const e={enabled:!0,bodyClassName:"gstc-scrolling"};t.Plugin=function(t=e){let i,n,o,s=t.enabled;class l{constructor(t){this.moving=!1,this.initialDataIndex={x:0,y:0},this.pointerDown=this.pointerDown.bind(this),this.pointerUp=this.pointerUp.bind(this),this.destroy=this.destroy.bind(this),this.pointerMove=i.schedule(this.pointerMove.bind(this)),t.addEventListener("pointerdown",this.pointerDown),document.addEventListener("pointermove",this.pointerMove,{passive:!0}),document.addEventListener("pointerup",this.pointerUp),t.style.cursor="grab"}destroy(t){t.removeEventListener("pointerdown",this.pointerDown),document.removeEventListener("pointermove",this.pointerMove),document.removeEventListener("pointerup",this.pointerUp)}resetInitialPoint(t){this.initialPoint={x:t.screenX,y:t.screenY}}pointerDown(e){if(!s)return;document.body.classList.add(t.bodyClassName),this.moving=!0,this.resetInitialPoint(e);const i=o.get("$data.scroll");this.initialDataIndex={x:i.horizontal.dataIndex||0,y:i.vertical.dataIndex||0}}pointerUp(){s&&(document.body.classList.remove(t.bodyClassName),this.moving&&(this.moving=!1))}handleHorizontalMovement(t,e){const i=o.get("$data.chart.time"),s=o.get("config.scroll.horizontal");if(t.x>0){if(0===this.initialDataIndex.x)return this.resetInitialPoint(e);const o=i.allDates[i.level];let l,r=this.initialDataIndex.x-1,a=0;for(;r>0&&(l=o[r],a+=l.width,!(a>=t.x));r--);let d=0;l&&(d=l.leftPx),s.byPixels?n.setScrollLeft(d):n.setScrollLeft(r)}else if(t.x<0){let l=this.initialDataIndex.x;const r=o.get("$data.scroll.horizontal"),a=i.allDates[i.level];if(l-1>=a.length-r.lastPageCount)return this.resetInitialPoint(e);let d,c=0;for(let e=a.length;l<e&&(d=a[l],c+=d.width,!(-c<=t.x));l++);if(l-1>=a.length-r.lastPageCount)return;let h=0;d&&(h=d.leftPx),s.byPixels?n.setScrollLeft(h):n.setScrollLeft(l)}}pointerMove(t){if(!s||!this.moving)return;const e={x:t.screenX-this.initialPoint.x,y:t.screenY-this.initialPoint.y};this.handleHorizontalMovement(e,t)}}return function(e){i=e,n=i.api,o=i.state;const r="config.plugin.CalendarScroll",a=e.state.get(r);return a&&(t=n.mergeDeep({},t,a)),o.update(r,t),o.subscribe("config.plugin.CalendarScroll.enabled",(t=>s=t)),o.update("config.actions.chart-calendar",(t=>(t.push(l),t))),n.pluginInitialized("CalendarScroll"),function(){o.update("config.actions.chart-calendar",(t=>t.filter((t=>t!==l)))),n.pluginDestroyed("CalendarScroll")}}},Object.defineProperty(t,"__esModule",{value:!0})}));
@@ -0,0 +1,47 @@
1
+ /**
2
+ * DependencyLines plugin
3
+ *
4
+ * @header --gstc--header--
5
+ */
6
+ import type { htmlResult, Item, ItemData, RowData, Vido } from '../gstc';
7
+ export type LineType = 'straight' | 'square' | 'square-alt' | 'smooth';
8
+ export interface DefaultPoint {
9
+ content: htmlResult;
10
+ width: number;
11
+ height: number;
12
+ }
13
+ export interface Options {
14
+ type?: LineType;
15
+ onLines?: ((lines: Line[]) => Line[])[];
16
+ onLine?: ((line: Line) => Line)[];
17
+ leftPoint?: DefaultPoint;
18
+ rightPoint?: DefaultPoint;
19
+ }
20
+ export interface PluginData extends Options {
21
+ lines: Line[];
22
+ }
23
+ export interface Point {
24
+ x: number;
25
+ y: number;
26
+ type: 'M' | 'L' | 'Q' | 'T' | 'C' | 'S' | '';
27
+ content?: htmlResult;
28
+ }
29
+ export interface Line {
30
+ x: number;
31
+ y: number;
32
+ width: number;
33
+ height: number;
34
+ topOffset: number;
35
+ leftOffset: number;
36
+ type: LineType;
37
+ fromItemData: ItemData;
38
+ toItemData: ItemData;
39
+ fromItem: Item;
40
+ toItem: Item;
41
+ fromRowData: RowData;
42
+ toRowData: RowData;
43
+ points: Point[];
44
+ className: string;
45
+ }
46
+ export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
47
+ //# sourceMappingURL=dependency-lines.d.ts.map
@@ -0,0 +1,47 @@
1
+ /**
2
+ * DependencyLines plugin
3
+ *
4
+ * @header --gstc--header--
5
+ */
6
+ import type { htmlResult, Item, ItemData, RowData, Vido } from '../gstc';
7
+ export type LineType = 'straight' | 'square' | 'square-alt' | 'smooth';
8
+ export interface DefaultPoint {
9
+ content: htmlResult;
10
+ width: number;
11
+ height: number;
12
+ }
13
+ export interface Options {
14
+ type?: LineType;
15
+ onLines?: ((lines: Line[]) => Line[])[];
16
+ onLine?: ((line: Line) => Line)[];
17
+ leftPoint?: DefaultPoint;
18
+ rightPoint?: DefaultPoint;
19
+ }
20
+ export interface PluginData extends Options {
21
+ lines: Line[];
22
+ }
23
+ export interface Point {
24
+ x: number;
25
+ y: number;
26
+ type: 'M' | 'L' | 'Q' | 'T' | 'C' | 'S' | '';
27
+ content?: htmlResult;
28
+ }
29
+ export interface Line {
30
+ x: number;
31
+ y: number;
32
+ width: number;
33
+ height: number;
34
+ topOffset: number;
35
+ leftOffset: number;
36
+ type: LineType;
37
+ fromItemData: ItemData;
38
+ toItemData: ItemData;
39
+ fromItem: Item;
40
+ toItem: Item;
41
+ fromRowData: RowData;
42
+ toRowData: RowData;
43
+ points: Point[];
44
+ className: string;
45
+ }
46
+ export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
47
+ //# sourceMappingURL=dependency-lines.d.ts.map
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Gantt-Schedule-Timeline-Calendar helpers
3
+ *
4
+ * @copyright NEURONET - Rafal Pospiech
5
+ * @author Rafal Pospiech <neuronet.io@gmail.com>
6
+ * @module gantt-schedule-timeline-calendar
7
+ * @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
8
+ * @link https://gantt-schedule-timeline-calendar.neuronet.io
9
+ * @version 3.37.5
10
+ * @released 2024-07-19
11
+ * @license SEE LICENSE IN LICENSE FILE
12
+ */
13
+ const t="gstc";function i(i,e=""){let n=`${t}__${i}`;return i===t&&(n=t),e?`${n} ${n}--${e.replace(":","-")}`:n}
14
+ /**
15
+ * DependencyLines plugin
16
+ *
17
+ * @copyright NEURONET - Rafal Pospiech
18
+ * @author Rafal Pospiech <neuronet.io@gmail.com>
19
+ * @module gantt-schedule-timeline-calendar
20
+ * @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
21
+ * @link https://gantt-schedule-timeline-calendar.neuronet.io
22
+ * @version 3.37.5
23
+ * @released 2024-07-19
24
+ * @license SEE LICENSE IN LICENSE FILE
25
+ */const e="DependencyLines",n="config.plugin.DependencyLines",s="config.slots.chart-timeline-items.outer",o=i("chart-timeline-dependency-lines-lines"),p=i("chart-timeline-dependency-lines-lines-line"),a=i("chart-timeline-dependency-lines-points"),h=i("chart-timeline-dependency-lines-points-point");class d{constructor(t,i){this.onDestroy=[],this.vido=t,this.api=this.vido.api,this.state=this.vido.state;const e=this.vido.html`<div class=${h+"--left"}></div>`,o=this.vido.html`<div class=${h+"--right"}></div>`;this.data=function(t){return Object.assign(Object.assign({},t),{lines:[]})}(function(t,i,e){const n=Object.assign(Object.assign({},function(t,i){return{type:"smooth",onLines:[],onLine:[],leftPoint:{content:t,width:10,height:10},rightPoint:{content:i,width:10,height:10}}}(i,e)),t);return t.leftPoint&&(n.leftPoint=Object.assign(Object.assign({},n.leftPoint),t.leftPoint)),t.rightPoint&&(n.rightPoint=Object.assign(Object.assign({},n.rightPoint),t.rightPoint)),n}(i,e,o)),this.PluginDependencyLinesSlot=this.PluginDependencyLinesSlot.bind(this),this.generateLines=this.generateLines.bind(this),this.destroy=this.destroy.bind(this),this.updateData(),this.onDestroy.push(this.state.subscribe(n,(t=>{this.data=t}))),this.state.update(s,(t=>(t.includes(this.PluginDependencyLinesSlot)||t.push(this.PluginDependencyLinesSlot),t))),this.onDestroy.push(this.state.subscribeAll(["$data.chart.items","$data.list.rowsHeight","$data.scroll","$data.chart.time.leftGlobal","$data.chart.time.rightPx"],this.generateLines,{group:!0}))}destroy(){this.state.update(s,(t=>t.filter((t=>t!==this.PluginDependencyLinesSlot)))),this.onDestroy.forEach((t=>t())),this.api.pluginDestroyed(e)}updateData(){this.state.update(n,this.data),this.vido.update()}setStraightPoints(t){const{topOffset:i,leftOffset:e,fromItemData:n,toItemData:s,fromRowData:o,toRowData:p}=t;if(!this.api.parentsExpanded(o.id)||!this.api.parentsExpanded(p.id))return;const a=this.api.getRowViewTop(o.id),h=this.api.getRowViewTop(p.id);t.points.push({x:n.position.right+e,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:a,type:"M",content:this.data.leftPoint.content}),t.points.push({x:s.position.left-e,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:h,type:"L",content:this.data.rightPoint.content})}setSquareAltPoints(t){const{topOffset:i,leftOffset:e,fromItemData:n,toItemData:s,fromRowData:o,toRowData:p}=t;if(!this.api.parentsExpanded(o.id)&&!this.api.parentsExpanded(p.id))return;const a=(s.position.left-n.position.right)/2,h=n.position.right+a,d=(s.position.viewTop-n.position.viewTop)/2,r=n.position.viewTop+d,l=this.api.getRowViewTop(o.id),c=this.api.getRowViewTop(p.id);t.points.push({x:n.position.right+e,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:l,type:"M",content:this.data.leftPoint.content}),s.position.left<n.position.right?(t.points.push({x:n.position.right+e+10,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:l,type:"L",content:null}),t.points.push({x:n.position.right+e+10,y:this.api.parentsExpanded(o.id)?r+i:l,type:"L",content:null})):t.points.push({x:h,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:l,type:"L",content:null}),t.points.push({x:h,y:this.api.parentsExpanded(o.id)?r+i:l,type:"L",content:null}),this.api.parentsExpanded(p.id)?(s.position.left<n.position.right?(t.points.push({x:s.position.left-e-10,y:this.api.parentsExpanded(o.id)?r+i:l,type:"L",content:null}),t.points.push({x:s.position.left-e-10,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:l,type:"L",content:null})):t.points.push({x:h,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:l,type:"L",content:null}),t.points.push({x:s.position.left-e,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:c,type:"L",content:this.data.rightPoint.content})):t.points.push({x:h,y:c,type:"L",content:this.data.rightPoint.content})}setSquarePoints(t){const{topOffset:i,leftOffset:e,fromItemData:n,toItemData:s,fromRowData:o,toRowData:p}=t;if(!this.api.parentsExpanded(o.id)&&!this.api.parentsExpanded(p.id))return;const a=this.api.getRowViewTop(o.id),h=this.api.getRowViewTop(p.id);t.points.push({x:n.position.right+e,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:a,type:"M",content:this.data.leftPoint.content}),n.position.viewTop!==s.position.viewTop?s.position.left<n.position.right?(t.points.push({x:n.position.right+e+10,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:a,type:"L",content:null}),s.position.viewTop>n.position.viewTop?(t.points.push({x:n.position.right+e+10,y:this.api.parentsExpanded(o.id)?a+o.outerHeight:a,type:"L",content:null}),t.points.push({x:s.position.left+e+10,y:this.api.parentsExpanded(o.id)?a+o.outerHeight:a,type:"L",content:null}),t.points.push({x:s.position.left+e+10,y:this.api.parentsExpanded(p.id)?s.position.viewTop:h,type:"L",content:this.data.rightPoint.content})):(t.points.push({x:n.position.right+e+10,y:a,type:"L",content:null}),t.points.push({x:s.position.left+e+10,y:a,type:"L",content:null}),t.points.push({x:s.position.left+e+10,y:this.api.parentsExpanded(p.id)?s.position.viewTop+s.actualHeight:h,type:"L",content:this.data.rightPoint.content}))):(t.points.push({x:s.position.left+10,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:a,type:"L",content:null}),s.position.viewTop>n.position.viewTop?t.points.push({x:s.position.left+10,y:this.api.parentsExpanded(p.id)?s.position.viewTop:h,type:"L",content:this.data.rightPoint.content}):t.points.push({x:s.position.left+10,y:this.api.parentsExpanded(p.id)?s.position.viewTop+s.actualHeight:h,type:"L",content:this.data.rightPoint.content})):t.points.push({x:s.position.left-e,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:h,type:"L",content:this.data.rightPoint.content})}setSmoothPoints(t){const{topOffset:i,leftOffset:e,fromItemData:n,toItemData:s,fromRowData:o,toRowData:p}=t;if(!this.api.parentsExpanded(o.id)&&!this.api.parentsExpanded(p.id))return;const a=this.api.getRowViewTop(o.id),h=this.api.getRowViewTop(p.id);if(t.points.push({x:n.position.right+e,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:a,type:"M",content:this.data.leftPoint.content}),n.position.viewTop===s.position.viewTop)return void t.points.push({x:s.position.left-e,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:h,type:"L",content:this.data.rightPoint.content});const d=(s.position.left-n.position.right)/2,r=n.position.right+d;if(n.position.right<=s.position.left)t.points.push({x:r,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:a,type:"C",content:null}),t.points.push({x:r,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:h,type:"",content:null}),t.points.push({x:s.position.left-e,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:h,type:"",content:this.data.rightPoint.content});else{const d=(s.position.viewTop-n.position.viewTop)/2,l=n.position.viewTop+d+i;t.points.push({x:n.position.right+20,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:a,type:"C",content:null}),t.points.push({x:n.position.right+40,y:l,type:"",content:null}),t.points.push({x:r,y:l,type:"",content:null}),t.points.push({x:s.position.left+e-20,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:h,type:"S",content:null}),t.points.push({x:s.position.left+e,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:h,type:"",content:this.data.rightPoint.content})}}setPoints(t){const{fromItemData:i,toItemData:e,fromRowData:n,toRowData:s,toItem:o,fromItem:p}=t,a=this.state.get("$data.chart.time");if(!this.state.get("$data.chart.allItemsOnTheLeftOrRight"))switch(this.api.calculateItemPosition(i.id,i,n,a,p),this.api.calculateItemPosition(e.id,e,s,a,o),t.type){case"straight":this.setStraightPoints(t);break;case"square":this.setSquarePoints(t);break;case"smooth":this.setSmoothPoints(t);break;case"square-alt":this.setSquareAltPoints(t)}}generateLines(){const t=[],i=this.api.getAllItems(),e=this.api.getRowsData(),n=this.api.getItemsData(),s=this.state.get("$data.chart.time"),o=this.state.get("$data.chart.dimensions"),a=this.state.get("$data.scroll.vertical"),h=Math.round(s.rightPx-s.leftPx),d=this.data.type;if(!this.state.get("$data.chart.allItemsOnTheLeftOrRight"))for(const r in i){const l=i[r];if(!l.dependant)continue;if(!l.dependant.length)continue;const c=e[l.rowId],u=n[r],f=l;if(u&&c)for(const g of l.dependant){const l=i[g],y=l,x=e[l.rowId],w=n[g];if(!w||!x)continue;if(s.calculatedZoomMode){if(f.time.end<s.leftGlobal&&y.time.start>s.rightGlobal)continue;if(y.time.end<s.leftGlobal&&f.time.start>s.rightGlobal)continue;if(f.time.start>s.rightGlobal&&y.time.start>s.rightGlobal)continue;if(f.time.end<s.leftGlobal&&y.time.end<s.leftGlobal)continue}if(this.api.calculateItemPosition(r,u,c,s),this.api.calculateItemPosition(g,w,x,s),-1===u.width&&-1===w.width)continue;const m=u.actualHeight/2,v=0;let $={x:0,y:0,width:h,height:o.height-a.preciseOffset,topOffset:m,leftOffset:v,points:[],type:d,fromItemData:u,toItemData:w,fromItem:f,toItem:y,fromRowData:c,toRowData:x,className:p};for(const t of this.data.onLine)$=t($);this.setPoints($),t.push($)}}this.data.lines=t;for(const t of this.data.onLines)this.data.lines=t(this.data.lines);this.updateData()}PluginDependencyLinesSlot(t){const{html:i,svg:e,state:n,onDestroy:s,StyleMap:p}=t,d=new p({});s(n.subscribeAll(["$data.chart.time","$data.chart.dimensions","$data.scroll.vertical.preciseOffset"],(()=>{const t=n.get("$data.chart.time");d.style.width=Math.round(t.rightPx-t.leftPx)+"px";const i=n.get("$data.chart.dimensions"),e=n.get("$data.scroll.vertical.preciseOffset");d.style.height=i.innerHeight-e+"px"})));const r=t=>{if(!t.points.length)return"";const i=t.points.slice(),e=i.shift();return[`${e.type} ${e.x} ${e.y}`,[...i.map((t=>`${t.type} ${t.x} ${t.y}`))]].join(" ")},l=(t,e)=>{const n=`left:${t.x-(0===e?this.data.leftPoint.width/2:this.data.rightPoint.width/2)}px;top:${t.y-(0===e?this.data.leftPoint.height/2:this.data.rightPoint.height/2)}px;width:${0===e?this.data.leftPoint.width:this.data.rightPoint.width}px;height:${0===e?this.data.leftPoint.width:this.data.rightPoint.width}px`;return t.content?i`<div class=${h+" "+h+"--"+this.data.type} style=${n}>
26
+ ${t.content}
27
+ </div>`:null},c=t=>e`<svg width=${t.width} height=${t.height} xmlns="http://www.w3.org/2000/svg">
28
+ <path d=${(t=>{switch(t.type){case"straight":return(t=>{const i=t.points;return[`${i[0].type} ${i[0].x} ${i[0].y}`,`${i[1].type} ${i[1].x} ${i[1].y}`].join(" ")})(t);case"square":case"square-alt":return r(t);case"smooth":return(t=>{if(!t.points.length)return"";const i=t.points.slice(),e=i.shift();return[`${e.type} ${e.x} ${e.y}`,[...i.map((t=>`${t.type} ${t.x} ${t.y}`))]].join(" ")})(t)}})(t)} />
29
+ </svg>`;return t=>i`<div class="${o}">${this.data.lines.map((t=>(t=>i`<div
30
+ class=${t.className}
31
+ style="left: ${t.x}px; top: ${t.y}px; width: ${t.width}px; height: ${t.height}px;"
32
+ >
33
+ ${c(t)}
34
+ </div>`)(t)))}</div>
35
+ ${t}
36
+ <div class="${a}" style=${d.directive()}>
37
+ ${this.data.lines.map((t=>(t=>t.points.map(((t,i)=>l(t,i))))(t)))}
38
+ </div>`}}function r(t={}){return function(i){const s=i.api,o=i.state.get(n);o&&(t=i.api.mergeDeep({},t,o));const p=new d(i,t);return s.pluginInitialized(e),p.destroy}}export{r as Plugin};
@@ -0,0 +1,47 @@
1
+ /**
2
+ * DependencyLines plugin
3
+ *
4
+ * @header --gstc--header--
5
+ */
6
+ import type { htmlResult, Item, ItemData, RowData, Vido } from '../gstc';
7
+ export type LineType = 'straight' | 'square' | 'square-alt' | 'smooth';
8
+ export interface DefaultPoint {
9
+ content: htmlResult;
10
+ width: number;
11
+ height: number;
12
+ }
13
+ export interface Options {
14
+ type?: LineType;
15
+ onLines?: ((lines: Line[]) => Line[])[];
16
+ onLine?: ((line: Line) => Line)[];
17
+ leftPoint?: DefaultPoint;
18
+ rightPoint?: DefaultPoint;
19
+ }
20
+ export interface PluginData extends Options {
21
+ lines: Line[];
22
+ }
23
+ export interface Point {
24
+ x: number;
25
+ y: number;
26
+ type: 'M' | 'L' | 'Q' | 'T' | 'C' | 'S' | '';
27
+ content?: htmlResult;
28
+ }
29
+ export interface Line {
30
+ x: number;
31
+ y: number;
32
+ width: number;
33
+ height: number;
34
+ topOffset: number;
35
+ leftOffset: number;
36
+ type: LineType;
37
+ fromItemData: ItemData;
38
+ toItemData: ItemData;
39
+ fromItem: Item;
40
+ toItem: Item;
41
+ fromRowData: RowData;
42
+ toRowData: RowData;
43
+ points: Point[];
44
+ className: string;
45
+ }
46
+ export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
47
+ //# sourceMappingURL=dependency-lines.d.ts.map
@@ -0,0 +1,38 @@
1
+ !function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i((t="undefined"!=typeof globalThis?globalThis:t||self).DependencyLines={})}(this,(function(t){"use strict";
2
+ /**
3
+ * Gantt-Schedule-Timeline-Calendar helpers
4
+ *
5
+ * @copyright NEURONET - Rafal Pospiech
6
+ * @author Rafal Pospiech <neuronet.io@gmail.com>
7
+ * @module gantt-schedule-timeline-calendar
8
+ * @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
9
+ * @link https://gantt-schedule-timeline-calendar.neuronet.io
10
+ * @version 3.37.5
11
+ * @released 2024-07-19
12
+ * @license SEE LICENSE IN LICENSE FILE
13
+ */const i="gstc";function e(t,e=""){let n=`${i}__${t}`;return t===i&&(n=i),e?`${n} ${n}--${e.replace(":","-")}`:n}
14
+ /**
15
+ * DependencyLines plugin
16
+ *
17
+ * @copyright NEURONET - Rafal Pospiech
18
+ * @author Rafal Pospiech <neuronet.io@gmail.com>
19
+ * @module gantt-schedule-timeline-calendar
20
+ * @link https://github.com/neuronetio/gantt-schedule-timeline-calendar
21
+ * @link https://gantt-schedule-timeline-calendar.neuronet.io
22
+ * @version 3.37.5
23
+ * @released 2024-07-19
24
+ * @license SEE LICENSE IN LICENSE FILE
25
+ */const n="DependencyLines",s="config.plugin.DependencyLines",o="config.slots.chart-timeline-items.outer",p=e("chart-timeline-dependency-lines-lines"),a=e("chart-timeline-dependency-lines-lines-line"),h=e("chart-timeline-dependency-lines-points"),d=e("chart-timeline-dependency-lines-points-point");class r{constructor(t,i){this.onDestroy=[],this.vido=t,this.api=this.vido.api,this.state=this.vido.state;const e=this.vido.html`<div class=${d+"--left"}></div>`,n=this.vido.html`<div class=${d+"--right"}></div>`;this.data=function(t){return Object.assign(Object.assign({},t),{lines:[]})}(function(t,i,e){const n=Object.assign(Object.assign({},function(t,i){return{type:"smooth",onLines:[],onLine:[],leftPoint:{content:t,width:10,height:10},rightPoint:{content:i,width:10,height:10}}}(i,e)),t);return t.leftPoint&&(n.leftPoint=Object.assign(Object.assign({},n.leftPoint),t.leftPoint)),t.rightPoint&&(n.rightPoint=Object.assign(Object.assign({},n.rightPoint),t.rightPoint)),n}(i,e,n)),this.PluginDependencyLinesSlot=this.PluginDependencyLinesSlot.bind(this),this.generateLines=this.generateLines.bind(this),this.destroy=this.destroy.bind(this),this.updateData(),this.onDestroy.push(this.state.subscribe(s,(t=>{this.data=t}))),this.state.update(o,(t=>(t.includes(this.PluginDependencyLinesSlot)||t.push(this.PluginDependencyLinesSlot),t))),this.onDestroy.push(this.state.subscribeAll(["$data.chart.items","$data.list.rowsHeight","$data.scroll","$data.chart.time.leftGlobal","$data.chart.time.rightPx"],this.generateLines,{group:!0}))}destroy(){this.state.update(o,(t=>t.filter((t=>t!==this.PluginDependencyLinesSlot)))),this.onDestroy.forEach((t=>t())),this.api.pluginDestroyed(n)}updateData(){this.state.update(s,this.data),this.vido.update()}setStraightPoints(t){const{topOffset:i,leftOffset:e,fromItemData:n,toItemData:s,fromRowData:o,toRowData:p}=t;if(!this.api.parentsExpanded(o.id)||!this.api.parentsExpanded(p.id))return;const a=this.api.getRowViewTop(o.id),h=this.api.getRowViewTop(p.id);t.points.push({x:n.position.right+e,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:a,type:"M",content:this.data.leftPoint.content}),t.points.push({x:s.position.left-e,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:h,type:"L",content:this.data.rightPoint.content})}setSquareAltPoints(t){const{topOffset:i,leftOffset:e,fromItemData:n,toItemData:s,fromRowData:o,toRowData:p}=t;if(!this.api.parentsExpanded(o.id)&&!this.api.parentsExpanded(p.id))return;const a=(s.position.left-n.position.right)/2,h=n.position.right+a,d=(s.position.viewTop-n.position.viewTop)/2,r=n.position.viewTop+d,l=this.api.getRowViewTop(o.id),c=this.api.getRowViewTop(p.id);t.points.push({x:n.position.right+e,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:l,type:"M",content:this.data.leftPoint.content}),s.position.left<n.position.right?(t.points.push({x:n.position.right+e+10,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:l,type:"L",content:null}),t.points.push({x:n.position.right+e+10,y:this.api.parentsExpanded(o.id)?r+i:l,type:"L",content:null})):t.points.push({x:h,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:l,type:"L",content:null}),t.points.push({x:h,y:this.api.parentsExpanded(o.id)?r+i:l,type:"L",content:null}),this.api.parentsExpanded(p.id)?(s.position.left<n.position.right?(t.points.push({x:s.position.left-e-10,y:this.api.parentsExpanded(o.id)?r+i:l,type:"L",content:null}),t.points.push({x:s.position.left-e-10,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:l,type:"L",content:null})):t.points.push({x:h,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:l,type:"L",content:null}),t.points.push({x:s.position.left-e,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:c,type:"L",content:this.data.rightPoint.content})):t.points.push({x:h,y:c,type:"L",content:this.data.rightPoint.content})}setSquarePoints(t){const{topOffset:i,leftOffset:e,fromItemData:n,toItemData:s,fromRowData:o,toRowData:p}=t;if(!this.api.parentsExpanded(o.id)&&!this.api.parentsExpanded(p.id))return;const a=this.api.getRowViewTop(o.id),h=this.api.getRowViewTop(p.id);t.points.push({x:n.position.right+e,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:a,type:"M",content:this.data.leftPoint.content}),n.position.viewTop!==s.position.viewTop?s.position.left<n.position.right?(t.points.push({x:n.position.right+e+10,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:a,type:"L",content:null}),s.position.viewTop>n.position.viewTop?(t.points.push({x:n.position.right+e+10,y:this.api.parentsExpanded(o.id)?a+o.outerHeight:a,type:"L",content:null}),t.points.push({x:s.position.left+e+10,y:this.api.parentsExpanded(o.id)?a+o.outerHeight:a,type:"L",content:null}),t.points.push({x:s.position.left+e+10,y:this.api.parentsExpanded(p.id)?s.position.viewTop:h,type:"L",content:this.data.rightPoint.content})):(t.points.push({x:n.position.right+e+10,y:a,type:"L",content:null}),t.points.push({x:s.position.left+e+10,y:a,type:"L",content:null}),t.points.push({x:s.position.left+e+10,y:this.api.parentsExpanded(p.id)?s.position.viewTop+s.actualHeight:h,type:"L",content:this.data.rightPoint.content}))):(t.points.push({x:s.position.left+10,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:a,type:"L",content:null}),s.position.viewTop>n.position.viewTop?t.points.push({x:s.position.left+10,y:this.api.parentsExpanded(p.id)?s.position.viewTop:h,type:"L",content:this.data.rightPoint.content}):t.points.push({x:s.position.left+10,y:this.api.parentsExpanded(p.id)?s.position.viewTop+s.actualHeight:h,type:"L",content:this.data.rightPoint.content})):t.points.push({x:s.position.left-e,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:h,type:"L",content:this.data.rightPoint.content})}setSmoothPoints(t){const{topOffset:i,leftOffset:e,fromItemData:n,toItemData:s,fromRowData:o,toRowData:p}=t;if(!this.api.parentsExpanded(o.id)&&!this.api.parentsExpanded(p.id))return;const a=this.api.getRowViewTop(o.id),h=this.api.getRowViewTop(p.id);if(t.points.push({x:n.position.right+e,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:a,type:"M",content:this.data.leftPoint.content}),n.position.viewTop===s.position.viewTop)return void t.points.push({x:s.position.left-e,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:h,type:"L",content:this.data.rightPoint.content});const d=(s.position.left-n.position.right)/2,r=n.position.right+d;if(n.position.right<=s.position.left)t.points.push({x:r,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:a,type:"C",content:null}),t.points.push({x:r,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:h,type:"",content:null}),t.points.push({x:s.position.left-e,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:h,type:"",content:this.data.rightPoint.content});else{const d=(s.position.viewTop-n.position.viewTop)/2,l=n.position.viewTop+d+i;t.points.push({x:n.position.right+20,y:this.api.parentsExpanded(o.id)?n.position.viewTop+i:a,type:"C",content:null}),t.points.push({x:n.position.right+40,y:l,type:"",content:null}),t.points.push({x:r,y:l,type:"",content:null}),t.points.push({x:s.position.left+e-20,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:h,type:"S",content:null}),t.points.push({x:s.position.left+e,y:this.api.parentsExpanded(p.id)?s.position.viewTop+i:h,type:"",content:this.data.rightPoint.content})}}setPoints(t){const{fromItemData:i,toItemData:e,fromRowData:n,toRowData:s,toItem:o,fromItem:p}=t,a=this.state.get("$data.chart.time");if(!this.state.get("$data.chart.allItemsOnTheLeftOrRight"))switch(this.api.calculateItemPosition(i.id,i,n,a,p),this.api.calculateItemPosition(e.id,e,s,a,o),t.type){case"straight":this.setStraightPoints(t);break;case"square":this.setSquarePoints(t);break;case"smooth":this.setSmoothPoints(t);break;case"square-alt":this.setSquareAltPoints(t)}}generateLines(){const t=[],i=this.api.getAllItems(),e=this.api.getRowsData(),n=this.api.getItemsData(),s=this.state.get("$data.chart.time"),o=this.state.get("$data.chart.dimensions"),p=this.state.get("$data.scroll.vertical"),h=Math.round(s.rightPx-s.leftPx),d=this.data.type;if(!this.state.get("$data.chart.allItemsOnTheLeftOrRight"))for(const r in i){const l=i[r];if(!l.dependant)continue;if(!l.dependant.length)continue;const c=e[l.rowId],u=n[r],f=l;if(u&&c)for(const g of l.dependant){const l=i[g],y=l,x=e[l.rowId],w=n[g];if(!w||!x)continue;if(s.calculatedZoomMode){if(f.time.end<s.leftGlobal&&y.time.start>s.rightGlobal)continue;if(y.time.end<s.leftGlobal&&f.time.start>s.rightGlobal)continue;if(f.time.start>s.rightGlobal&&y.time.start>s.rightGlobal)continue;if(f.time.end<s.leftGlobal&&y.time.end<s.leftGlobal)continue}if(this.api.calculateItemPosition(r,u,c,s),this.api.calculateItemPosition(g,w,x,s),-1===u.width&&-1===w.width)continue;const m=u.actualHeight/2,v=0;let $={x:0,y:0,width:h,height:o.height-p.preciseOffset,topOffset:m,leftOffset:v,points:[],type:d,fromItemData:u,toItemData:w,fromItem:f,toItem:y,fromRowData:c,toRowData:x,className:a};for(const t of this.data.onLine)$=t($);this.setPoints($),t.push($)}}this.data.lines=t;for(const t of this.data.onLines)this.data.lines=t(this.data.lines);this.updateData()}PluginDependencyLinesSlot(t){const{html:i,svg:e,state:n,onDestroy:s,StyleMap:o}=t,a=new o({});s(n.subscribeAll(["$data.chart.time","$data.chart.dimensions","$data.scroll.vertical.preciseOffset"],(()=>{const t=n.get("$data.chart.time");a.style.width=Math.round(t.rightPx-t.leftPx)+"px";const i=n.get("$data.chart.dimensions"),e=n.get("$data.scroll.vertical.preciseOffset");a.style.height=i.innerHeight-e+"px"})));const r=t=>{if(!t.points.length)return"";const i=t.points.slice(),e=i.shift();return[`${e.type} ${e.x} ${e.y}`,[...i.map((t=>`${t.type} ${t.x} ${t.y}`))]].join(" ")},l=(t,e)=>{const n=`left:${t.x-(0===e?this.data.leftPoint.width/2:this.data.rightPoint.width/2)}px;top:${t.y-(0===e?this.data.leftPoint.height/2:this.data.rightPoint.height/2)}px;width:${0===e?this.data.leftPoint.width:this.data.rightPoint.width}px;height:${0===e?this.data.leftPoint.width:this.data.rightPoint.width}px`;return t.content?i`<div class=${d+" "+d+"--"+this.data.type} style=${n}>
26
+ ${t.content}
27
+ </div>`:null},c=t=>e`<svg width=${t.width} height=${t.height} xmlns="http://www.w3.org/2000/svg">
28
+ <path d=${(t=>{switch(t.type){case"straight":return(t=>{const i=t.points;return[`${i[0].type} ${i[0].x} ${i[0].y}`,`${i[1].type} ${i[1].x} ${i[1].y}`].join(" ")})(t);case"square":case"square-alt":return r(t);case"smooth":return(t=>{if(!t.points.length)return"";const i=t.points.slice(),e=i.shift();return[`${e.type} ${e.x} ${e.y}`,[...i.map((t=>`${t.type} ${t.x} ${t.y}`))]].join(" ")})(t)}})(t)} />
29
+ </svg>`;return t=>i`<div class="${p}">${this.data.lines.map((t=>(t=>i`<div
30
+ class=${t.className}
31
+ style="left: ${t.x}px; top: ${t.y}px; width: ${t.width}px; height: ${t.height}px;"
32
+ >
33
+ ${c(t)}
34
+ </div>`)(t)))}</div>
35
+ ${t}
36
+ <div class="${h}" style=${a.directive()}>
37
+ ${this.data.lines.map((t=>(t=>t.points.map(((t,i)=>l(t,i))))(t)))}
38
+ </div>`}}t.Plugin=function(t={}){return function(i){const e=i.api,o=i.state.get(s);o&&(t=i.api.mergeDeep({},t,o));const p=new r(i,t);return e.pluginInitialized(n),p.destroy}},Object.defineProperty(t,"__esModule",{value:!0})}));
@@ -0,0 +1,12 @@
1
+ /**
2
+ * ImagePDF plugin
3
+ *
4
+ * @header --gstc--header--
5
+ */
6
+ import type { Vido } from '../gstc';
7
+ export declare const pluginName = "ExportImage";
8
+ export declare const pluginPath: string;
9
+ export interface Options {
10
+ }
11
+ export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
12
+ //# sourceMappingURL=export-image.d.ts.map
@@ -0,0 +1,12 @@
1
+ /**
2
+ * ImagePDF plugin
3
+ *
4
+ * @header --gstc--header--
5
+ */
6
+ import type { Vido } from '../gstc';
7
+ export declare const pluginName = "ExportImage";
8
+ export declare const pluginPath: string;
9
+ export interface Options {
10
+ }
11
+ export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
12
+ //# sourceMappingURL=export-image.d.ts.map