├── .gitignore
├── .npmignore
├── .prettierrc.cjs
├── examples
├── plugin-item-image
│ ├── style.css
│ ├── images
│ │ ├── 0.jpg
│ │ ├── 1.jpg
│ │ ├── 2.jpg
│ │ └── 3.jpg
│ ├── index.html
│ ├── item-image.js
│ └── index.js
├── complex-1
│ ├── faces
│ │ ├── face-1.jpg
│ │ ├── face-10.jpg
│ │ ├── face-11.jpg
│ │ ├── face-12.jpg
│ │ ├── face-13.jpg
│ │ ├── face-14.jpg
│ │ ├── face-15.jpg
│ │ ├── face-16.jpg
│ │ ├── face-17.jpg
│ │ ├── face-18.jpg
│ │ ├── face-19.jpg
│ │ ├── face-2.jpg
│ │ ├── face-20.jpg
│ │ ├── face-21.jpg
│ │ ├── face-22.jpg
│ │ ├── face-23.jpg
│ │ ├── face-24.jpg
│ │ ├── face-25.jpg
│ │ ├── face-26.jpg
│ │ ├── face-27.jpg
│ │ ├── face-28.jpg
│ │ ├── face-29.jpg
│ │ ├── face-3.jpg
│ │ ├── face-30.jpg
│ │ ├── face-31.jpg
│ │ ├── face-32.jpg
│ │ ├── face-33.jpg
│ │ ├── face-34.jpg
│ │ ├── face-35.jpg
│ │ ├── face-36.jpg
│ │ ├── face-37.jpg
│ │ ├── face-38.jpg
│ │ ├── face-39.jpg
│ │ ├── face-4.jpg
│ │ ├── face-40.jpg
│ │ ├── face-41.jpg
│ │ ├── face-42.jpg
│ │ ├── face-43.jpg
│ │ ├── face-44.jpg
│ │ ├── face-45.jpg
│ │ ├── face-46.jpg
│ │ ├── face-47.jpg
│ │ ├── face-48.jpg
│ │ ├── face-49.jpg
│ │ ├── face-5.jpg
│ │ ├── face-50.jpg
│ │ ├── face-6.jpg
│ │ ├── face-7.jpg
│ │ ├── face-8.jpg
│ │ └── face-9.jpg
│ └── index.html
├── one-month
│ ├── faces
│ │ ├── face-1.jpg
│ │ ├── face-10.jpg
│ │ ├── face-11.jpg
│ │ ├── face-12.jpg
│ │ ├── face-13.jpg
│ │ ├── face-14.jpg
│ │ ├── face-15.jpg
│ │ ├── face-16.jpg
│ │ ├── face-17.jpg
│ │ ├── face-18.jpg
│ │ ├── face-19.jpg
│ │ ├── face-2.jpg
│ │ ├── face-20.jpg
│ │ ├── face-21.jpg
│ │ ├── face-22.jpg
│ │ ├── face-23.jpg
│ │ ├── face-24.jpg
│ │ ├── face-25.jpg
│ │ ├── face-26.jpg
│ │ ├── face-27.jpg
│ │ ├── face-28.jpg
│ │ ├── face-29.jpg
│ │ ├── face-3.jpg
│ │ ├── face-30.jpg
│ │ ├── face-31.jpg
│ │ ├── face-32.jpg
│ │ ├── face-33.jpg
│ │ ├── face-34.jpg
│ │ ├── face-35.jpg
│ │ ├── face-36.jpg
│ │ ├── face-37.jpg
│ │ ├── face-38.jpg
│ │ ├── face-39.jpg
│ │ ├── face-4.jpg
│ │ ├── face-40.jpg
│ │ ├── face-41.jpg
│ │ ├── face-42.jpg
│ │ ├── face-43.jpg
│ │ ├── face-44.jpg
│ │ ├── face-45.jpg
│ │ ├── face-46.jpg
│ │ ├── face-47.jpg
│ │ ├── face-48.jpg
│ │ ├── face-49.jpg
│ │ ├── face-5.jpg
│ │ ├── face-50.jpg
│ │ ├── face-6.jpg
│ │ ├── face-7.jpg
│ │ ├── face-8.jpg
│ │ └── face-9.jpg
│ └── index.html
├── slots
│ └── index.html
├── simple
│ ├── simple.esm.html
│ ├── index.js
│ └── simple.umd.html
├── grid-content
│ ├── index.html
│ └── index.js
├── hide-weekends
│ ├── index.html
│ └── index.js
├── items-content
│ ├── index.html
│ └── index.js
├── rows-content
│ ├── index.html
│ └── index.js
├── seconds-zoom
│ ├── index.html
│ └── index.js
├── working-hours
│ └── index.html
├── item-types-plugin
│ └── index.html
├── big-dataset
│ ├── prebid-ads.js
│ └── index.html
├── multiple-components
│ └── index.html
├── resizing-plugin
│ └── index.html
├── one-calendar-row
│ └── index.html
├── server.js
├── dependency-lines
│ └── index.html
├── custom-period
│ └── index.html
├── minutes-zoom
│ ├── index.html
│ └── index.js
├── custom-period-advanced
│ └── index.html
├── add-rows-items
│ └── index.html
├── tooltip
│ └── index.html
├── minimal-item-width
│ └── index.html
├── movement-plugin
│ └── index.html
├── list-columns-toggle
│ └── index.html
├── selection-plugin
│ └── index.html
├── grab-scroll
│ └── index.html
├── item-slot-html-content
│ └── index.html
├── messing-with-templates
│ └── index.html
└── index.html
├── dist
├── assets
│ └── a0c86d43.wasm
├── api
│ ├── helpers.d.ts
│ ├── id.d.ts
│ ├── slots.d.ts
│ ├── locale.d.ts
│ ├── public.d.ts
│ └── main.d.ts
└── plugins
│ ├── highlight-weekends.d.ts
│ ├── highlight-weekends.esm.min.d.ts
│ ├── highlight-weekends.umd.min.d.ts
│ ├── export-pdf.d.ts
│ ├── export-image.d.ts
│ ├── export-pdf.esm.min.d.ts
│ ├── export-pdf.umd.min.d.ts
│ ├── export-image.esm.min.d.ts
│ ├── export-image.umd.min.d.ts
│ ├── calendar-scroll.d.ts
│ ├── calendar-scroll.esm.min.d.ts
│ ├── calendar-scroll.umd.min.d.ts
│ ├── progress-bar.d.ts
│ ├── progress-bar.esm.min.d.ts
│ ├── progress-bar.umd.min.d.ts
│ ├── item-types.d.ts
│ ├── item-types.esm.min.d.ts
│ ├── item-types.umd.min.d.ts
│ ├── grab-scroll.d.ts
│ ├── grab-scroll.esm.min.d.ts
│ ├── grab-scroll.umd.min.d.ts
│ ├── time-bookmarks.d.ts
│ ├── time-bookmarks.esm.min.d.ts
│ ├── time-bookmarks.umd.min.d.ts
│ ├── dependency-lines.d.ts
│ ├── dependency-lines.esm.min.d.ts
│ ├── dependency-lines.umd.min.d.ts
│ ├── highlight-weekends.esm.min.js
│ ├── highlight-weekends.umd.min.js
│ ├── progress-bar.esm.min.js
│ ├── progress-bar.umd.min.js
│ ├── item-movement.d.ts
│ ├── calendar-scroll.esm.min.js
│ ├── item-movement.esm.min.d.ts
│ ├── item-movement.umd.min.d.ts
│ ├── selection.d.ts
│ ├── selection.esm.min.d.ts
│ ├── selection.umd.min.d.ts
│ ├── timeline-pointer.d.ts
│ ├── timeline-pointer.esm.min.d.ts
│ ├── timeline-pointer.umd.min.d.ts
│ ├── calendar-scroll.umd.min.js
│ ├── item-resizing.d.ts
│ ├── item-resizing.esm.min.d.ts
│ ├── item-resizing.umd.min.d.ts
│ ├── time-bookmarks.esm.min.js
│ └── time-bookmarks.umd.min.js
├── .editorconfig
├── cypress
├── fixtures
│ └── example.json
├── helpers.ts
├── plugins
│ └── index.js
├── e2e
│ ├── add-rows-items.test.ts
│ ├── list-header-resize.test.ts
│ ├── rows.test.ts
│ ├── utc-mode.test.ts
│ ├── locale.test.ts
│ ├── grid-cells.test.ts
│ └── time-bookmarks.test.ts
└── support
│ └── e2e.ts
├── .travis.yml
├── tsconfig.json
├── .github
└── ISSUE_TEMPLATE
│ ├── bug_report.md
│ ├── question-or-help-needed.md
│ └── feature_request.md
├── cypress.config.js
└── .eslintrc.json
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .history
3 | cypress/screenshots
4 | cypress/videos
5 | npm-shrinkwrap.json
6 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | .history
2 | .github
3 | .travis.yml
4 | npm-shrinkwrap.json
5 | cypress/downloads
6 | examples
7 |
--------------------------------------------------------------------------------
/.prettierrc.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | singleQuote: true,
3 | semi: true,
4 | printWidth: 120
5 | };
6 |
--------------------------------------------------------------------------------
/examples/plugin-item-image/style.css:
--------------------------------------------------------------------------------
1 | .item-image {
2 | margin-right: 8px;
3 | border-radius: 3px;
4 | }
5 |
--------------------------------------------------------------------------------
/dist/assets/a0c86d43.wasm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/dist/assets/a0c86d43.wasm
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-1.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-10.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-10.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-11.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-11.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-12.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-12.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-13.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-13.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-14.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-14.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-15.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-15.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-16.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-16.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-17.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-17.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-18.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-18.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-19.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-19.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-2.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-20.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-20.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-21.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-21.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-22.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-22.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-23.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-23.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-24.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-24.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-25.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-25.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-26.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-26.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-27.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-27.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-28.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-28.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-29.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-29.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-3.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-30.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-30.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-31.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-31.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-32.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-32.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-33.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-33.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-34.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-34.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-35.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-35.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-36.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-36.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-37.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-37.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-38.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-38.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-39.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-39.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-4.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-40.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-40.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-41.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-41.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-42.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-42.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-43.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-43.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-44.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-44.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-45.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-45.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-46.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-46.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-47.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-47.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-48.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-48.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-49.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-49.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-5.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-50.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-50.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-6.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-7.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-7.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-8.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-8.jpg
--------------------------------------------------------------------------------
/examples/complex-1/faces/face-9.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/complex-1/faces/face-9.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-1.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-10.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-10.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-11.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-11.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-12.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-12.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-13.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-13.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-14.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-14.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-15.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-15.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-16.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-16.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-17.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-17.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-18.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-18.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-19.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-19.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-2.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-20.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-20.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-21.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-21.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-22.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-22.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-23.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-23.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-24.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-24.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-25.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-25.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-26.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-26.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-27.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-27.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-28.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-28.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-29.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-29.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-3.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-30.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-30.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-31.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-31.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-32.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-32.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-33.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-33.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-34.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-34.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-35.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-35.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-36.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-36.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-37.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-37.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-38.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-38.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-39.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-39.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-4.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-40.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-40.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-41.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-41.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-42.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-42.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-43.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-43.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-44.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-44.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-45.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-45.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-46.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-46.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-47.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-47.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-48.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-48.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-49.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-49.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-5.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-50.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-50.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-6.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-7.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-7.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-8.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-8.jpg
--------------------------------------------------------------------------------
/examples/one-month/faces/face-9.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/one-month/faces/face-9.jpg
--------------------------------------------------------------------------------
/examples/plugin-item-image/images/0.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/plugin-item-image/images/0.jpg
--------------------------------------------------------------------------------
/examples/plugin-item-image/images/1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/plugin-item-image/images/1.jpg
--------------------------------------------------------------------------------
/examples/plugin-item-image/images/2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/plugin-item-image/images/2.jpg
--------------------------------------------------------------------------------
/examples/plugin-item-image/images/3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neuronetio/gantt-schedule-timeline-calendar/HEAD/examples/plugin-item-image/images/3.jpg
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
--------------------------------------------------------------------------------
/cypress/fixtures/example.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Using fixtures to represent data",
3 | "email": "hello@cypress.io",
4 | "body": "Fixtures are a great way to mock data for responses to routes"
5 | }
6 |
--------------------------------------------------------------------------------
/dist/api/helpers.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Gantt-Schedule-Timeline-Calendar helpers
3 | *
4 | * @header --gstc--header--
5 | */
6 | export declare const lib = "gstc";
7 | export declare function getClass(name: string, appendix?: string): string;
8 | export declare function getId(name: string, id: string): string;
9 | //# sourceMappingURL=helpers.d.ts.map
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - '16'
4 | cache:
5 | directories:
6 | - node_modules
7 | before_install:
8 | - export TZ=Europe/Warsaw
9 | before_script:
10 | - echo 'Europe/Warsaw' | sudo tee /etc/timezone
11 | - sudo dpkg-reconfigure --frontend noninteractive tzdata
12 | script:
13 | - npm test
14 | - npm run build
15 |
--------------------------------------------------------------------------------
/dist/api/id.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Gantt-Schedule-Timeline-Calendar IDApi
3 | *
4 | * @header --gstc--header--
5 | */
6 | declare class IDApi {
7 | constructor();
8 | GSTCID(originalId: string): string;
9 | isGSTCID(id: string): boolean;
10 | sourceID(id: string): string;
11 | }
12 | declare const _default: IDApi;
13 | export default _default;
14 | //# sourceMappingURL=id.d.ts.map
--------------------------------------------------------------------------------
/dist/plugins/highlight-weekends.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * HighlightWeekends plugin
3 | *
4 | * @header --gstc--header--
5 | */
6 | import type { Vido } from '../gstc';
7 | export interface Options {
8 | weekdays?: number[];
9 | className?: string;
10 | }
11 | export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
12 | //# sourceMappingURL=highlight-weekends.d.ts.map
--------------------------------------------------------------------------------
/dist/plugins/highlight-weekends.esm.min.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * HighlightWeekends plugin
3 | *
4 | * @header --gstc--header--
5 | */
6 | import type { Vido } from '../gstc';
7 | export interface Options {
8 | weekdays?: number[];
9 | className?: string;
10 | }
11 | export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
12 | //# sourceMappingURL=highlight-weekends.d.ts.map
--------------------------------------------------------------------------------
/dist/plugins/highlight-weekends.umd.min.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * HighlightWeekends plugin
3 | *
4 | * @header --gstc--header--
5 | */
6 | import type { Vido } from '../gstc';
7 | export interface Options {
8 | weekdays?: number[];
9 | className?: string;
10 | }
11 | export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
12 | //# sourceMappingURL=highlight-weekends.d.ts.map
--------------------------------------------------------------------------------
/dist/plugins/export-pdf.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * ExportPDF plugin
3 | *
4 | * @header --gstc--header--
5 | */
6 | import type { Vido } from '../gstc';
7 | export declare const pluginName = "ExportPDF";
8 | export declare const pluginPath: string;
9 | export interface Options {
10 | }
11 | export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
12 | //# sourceMappingURL=export-pdf.d.ts.map
--------------------------------------------------------------------------------
/dist/plugins/export-image.d.ts:
--------------------------------------------------------------------------------
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
--------------------------------------------------------------------------------
/dist/plugins/export-pdf.esm.min.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * ExportPDF plugin
3 | *
4 | * @header --gstc--header--
5 | */
6 | import type { Vido } from '../gstc';
7 | export declare const pluginName = "ExportPDF";
8 | export declare const pluginPath: string;
9 | export interface Options {
10 | }
11 | export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
12 | //# sourceMappingURL=export-pdf.d.ts.map
--------------------------------------------------------------------------------
/dist/plugins/export-pdf.umd.min.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * ExportPDF plugin
3 | *
4 | * @header --gstc--header--
5 | */
6 | import type { Vido } from '../gstc';
7 | export declare const pluginName = "ExportPDF";
8 | export declare const pluginPath: string;
9 | export interface Options {
10 | }
11 | export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
12 | //# sourceMappingURL=export-pdf.d.ts.map
--------------------------------------------------------------------------------
/cypress/helpers.ts:
--------------------------------------------------------------------------------
1 | export function fixed(nr: string | number) {
2 | return parseFloat(parseFloat(nr.toString()).toFixed(2));
3 | }
4 | export function round(nr: string | number) {
5 | return Math.round(parseFloat(nr.toString()));
6 | }
7 | export const examples = [
8 | '/examples/complex-1',
9 | '/examples/item-types-plugin',
10 | '/examples/add-rows-items',
11 | '/examples/item-slot-html-content',
12 | ];
13 |
--------------------------------------------------------------------------------
/dist/plugins/export-image.esm.min.d.ts:
--------------------------------------------------------------------------------
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
--------------------------------------------------------------------------------
/dist/plugins/export-image.umd.min.d.ts:
--------------------------------------------------------------------------------
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
--------------------------------------------------------------------------------
/dist/plugins/calendar-scroll.d.ts:
--------------------------------------------------------------------------------
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 | string[];
13 | }
14 | export declare function Plugin(options?: Options): (vidoInstance: any) => () => void;
15 | //# sourceMappingURL=calendar-scroll.d.ts.map
--------------------------------------------------------------------------------
/dist/plugins/calendar-scroll.esm.min.d.ts:
--------------------------------------------------------------------------------
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 | string[];
13 | }
14 | export declare function Plugin(options?: Options): (vidoInstance: any) => () => void;
15 | //# sourceMappingURL=calendar-scroll.d.ts.map
--------------------------------------------------------------------------------
/dist/plugins/calendar-scroll.umd.min.d.ts:
--------------------------------------------------------------------------------
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 | string[];
13 | }
14 | export declare function Plugin(options?: Options): (vidoInstance: any) => () => void;
15 | //# sourceMappingURL=calendar-scroll.d.ts.map
--------------------------------------------------------------------------------
/dist/plugins/progress-bar.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * ProgressBar plugin
3 | *
4 | * @header --gstc--header--
5 | */
6 | import type { Vido } from '../gstc';
7 | export declare const pluginPath = "config.plugin.ProgressBar";
8 | export interface Options {
9 | enabled?: boolean;
10 | className?: string;
11 | }
12 | export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
13 | //# sourceMappingURL=progress-bar.d.ts.map
--------------------------------------------------------------------------------
/dist/plugins/progress-bar.esm.min.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * ProgressBar plugin
3 | *
4 | * @header --gstc--header--
5 | */
6 | import type { Vido } from '../gstc';
7 | export declare const pluginPath = "config.plugin.ProgressBar";
8 | export interface Options {
9 | enabled?: boolean;
10 | className?: string;
11 | }
12 | export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
13 | //# sourceMappingURL=progress-bar.d.ts.map
--------------------------------------------------------------------------------
/dist/plugins/progress-bar.umd.min.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * ProgressBar plugin
3 | *
4 | * @header --gstc--header--
5 | */
6 | import type { Vido } from '../gstc';
7 | export declare const pluginPath = "config.plugin.ProgressBar";
8 | export interface Options {
9 | enabled?: boolean;
10 | className?: string;
11 | }
12 | export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
13 | //# sourceMappingURL=progress-bar.d.ts.map
--------------------------------------------------------------------------------
/examples/slots/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | GSTC slots example
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/examples/simple/simple.esm.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | GSTC simple example
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/examples/grid-content/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | GSTC grid content example
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/examples/hide-weekends/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | GSTC hide weekends example
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/examples/items-content/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | GSTC items content example
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/examples/rows-content/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | GSTC rows content example
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/examples/seconds-zoom/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | GSTC seconds zoom example
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/examples/working-hours/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | GSTC working hours example
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/examples/item-types-plugin/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | GSTC ItemTypes plugin example
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/dist/plugins/item-types.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * ItemTypes plugin
3 | *
4 | * @header --gstc--header--
5 | */
6 | import type { Template, Vido } from '../gstc';
7 | export declare const pluginPath = "config.plugin.ItemTypes";
8 | export declare const templatePath = "config.templates.chart-timeline-items-row-item";
9 | export interface Options {
10 | [key: string]: Template;
11 | }
12 | export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
13 | //# sourceMappingURL=item-types.d.ts.map
--------------------------------------------------------------------------------
/examples/big-dataset/prebid-ads.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Just ad blocker detector (ad blockers can slow down dom significantly)
3 | */
4 | async function detectAdBlock() {
5 | let adBlockEnabled = false;
6 | const googleAdUrl = 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js';
7 | try {
8 | await fetch(new Request(googleAdUrl)).catch((_) => (adBlockEnabled = true));
9 | } catch (e) {
10 | adBlockEnabled = true;
11 | }
12 | return adBlockEnabled;
13 | }
14 | export default detectAdBlock;
15 |
--------------------------------------------------------------------------------
/dist/plugins/item-types.esm.min.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * ItemTypes plugin
3 | *
4 | * @header --gstc--header--
5 | */
6 | import type { Template, Vido } from '../gstc';
7 | export declare const pluginPath = "config.plugin.ItemTypes";
8 | export declare const templatePath = "config.templates.chart-timeline-items-row-item";
9 | export interface Options {
10 | [key: string]: Template;
11 | }
12 | export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
13 | //# sourceMappingURL=item-types.d.ts.map
--------------------------------------------------------------------------------
/dist/plugins/item-types.umd.min.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * ItemTypes plugin
3 | *
4 | * @header --gstc--header--
5 | */
6 | import type { Template, Vido } from '../gstc';
7 | export declare const pluginPath = "config.plugin.ItemTypes";
8 | export declare const templatePath = "config.templates.chart-timeline-items-row-item";
9 | export interface Options {
10 | [key: string]: Template;
11 | }
12 | export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
13 | //# sourceMappingURL=item-types.d.ts.map
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "include": ["./*.ts", "./cypress/**/*.ts"],
3 | "exclude": ["node_modules/**", "dist/**", "cypress.config.js"],
4 | "compilerOptions": {
5 | "moduleResolution": "node",
6 | "esModuleInterop": true,
7 | "strict": false,
8 | "module": "ESNext",
9 | "downlevelIteration": true,
10 | "allowSyntheticDefaultImports": true,
11 | "allowJs": true,
12 | "target": "ES2015",
13 | "skipLibCheck": true,
14 | "skipDefaultLibCheck": true,
15 | "types": ["cypress"]
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/examples/multiple-components/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | GSTC multiple components example
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/examples/plugin-item-image/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | GSTC item image plugin example
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/examples/resizing-plugin/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | GSTC Items resizing plugin example
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/examples/one-calendar-row/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | GSTC one calendar row example
6 |
7 |
8 |
9 |
10 |
11 | Zoom
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/examples/server.js:
--------------------------------------------------------------------------------
1 | import path from 'path';
2 | import Polonez from 'polonez';
3 | import ServeStatic from 'serve-static';
4 | import compression from 'compression';
5 |
6 | const polonez = Polonez();
7 | polonez.use(compression());
8 | polonez.use(ServeStatic(path.resolve('./')));
9 |
10 | let port = 8080;
11 | if (process.argv.length > 2) {
12 | port = Number(process.argv[2]);
13 | }
14 | if (process.env.PORT) {
15 | port = Number(process.env.PORT);
16 | }
17 | polonez.listen(port);
18 | console.log(`Visit: http://localhost:${port}/examples/index.html`); // eslint-disable-line no-console
19 |
--------------------------------------------------------------------------------
/examples/dependency-lines/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | GSTC add rows and items example
6 |
7 |
8 |
9 |
10 |
11 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/examples/custom-period/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | GSTC custom period example
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/examples/minutes-zoom/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | GSTC minutes zoom example
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 | ---
8 |
9 | **Describe the bug**
10 | A clear and concise description of what the bug is.
11 |
12 | **Code**
13 | How to reproduce this error?
14 | Paste your code here with example data.
15 |
16 | ```js
17 | your code here
18 | ```
19 |
20 | **gantt-schedule-timeline-calendar version**
21 | What version are you using?
22 | You can get it from `package.json` or with `state.get('config.version')`.
23 |
24 | **Screenshots or movies**
25 | If applicable, add screenshots or movie to help explain your problem.
26 |
--------------------------------------------------------------------------------
/examples/custom-period-advanced/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | GSTC custom period (advanced)
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/dist/plugins/grab-scroll.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GrabScroll plugin
3 | *
4 | * @header --gstc--header--
5 | */
6 | import type { Vido } from '../gstc';
7 | export declare const pluginName = "GrabScroll";
8 | export declare const pluginPath = "config.plugin.GrabScroll";
9 | export declare const templatePath = "config.templates.chart-timeline-items-row-item";
10 | export interface Options {
11 | enabled?: boolean;
12 | multiplier?: {
13 | x: number;
14 | y: number;
15 | };
16 | bodyClassName?: string | string[];
17 | timelineClassName?: string | string[];
18 | }
19 | export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
20 | //# sourceMappingURL=grab-scroll.d.ts.map
--------------------------------------------------------------------------------
/dist/plugins/grab-scroll.esm.min.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GrabScroll plugin
3 | *
4 | * @header --gstc--header--
5 | */
6 | import type { Vido } from '../gstc';
7 | export declare const pluginName = "GrabScroll";
8 | export declare const pluginPath = "config.plugin.GrabScroll";
9 | export declare const templatePath = "config.templates.chart-timeline-items-row-item";
10 | export interface Options {
11 | enabled?: boolean;
12 | multiplier?: {
13 | x: number;
14 | y: number;
15 | };
16 | bodyClassName?: string | string[];
17 | timelineClassName?: string | string[];
18 | }
19 | export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
20 | //# sourceMappingURL=grab-scroll.d.ts.map
--------------------------------------------------------------------------------
/dist/plugins/grab-scroll.umd.min.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GrabScroll plugin
3 | *
4 | * @header --gstc--header--
5 | */
6 | import type { Vido } from '../gstc';
7 | export declare const pluginName = "GrabScroll";
8 | export declare const pluginPath = "config.plugin.GrabScroll";
9 | export declare const templatePath = "config.templates.chart-timeline-items-row-item";
10 | export interface Options {
11 | enabled?: boolean;
12 | multiplier?: {
13 | x: number;
14 | y: number;
15 | };
16 | bodyClassName?: string | string[];
17 | timelineClassName?: string | string[];
18 | }
19 | export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
20 | //# sourceMappingURL=grab-scroll.d.ts.map
--------------------------------------------------------------------------------
/cypress.config.js:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'cypress';
2 |
3 | export default defineConfig({
4 | viewportWidth: 1600,
5 | viewportHeight: 1040,
6 | video: true,
7 | videoUploadOnPasses: false,
8 | projectId: 'qdqmtw',
9 | env: {
10 | wait: 1,
11 | wait_load: 1,
12 | },
13 | e2e: {
14 | // We've imported your old cypress plugins here.
15 | // You may want to clean this up later by importing these.
16 | // async setupNodeEvents(on, config) {
17 | // return import('./cypress/plugins/index.js').then((fn) => {
18 | // fn.default(on, config);
19 | // });
20 | // },
21 | baseUrl: 'http://localhost:8080',
22 | specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}',
23 | },
24 | });
25 |
--------------------------------------------------------------------------------
/examples/add-rows-items/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | GSTC add rows and items example
6 |
7 |
8 |
9 |
10 |
11 |
12 | Add items
13 | Add item
14 | Add rows
15 | Add row
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/dist/api/slots.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Gantt-Schedule-Timeline-Calendar Slots
3 | *
4 | * @header --gstc--header--
5 | */
6 | import { Vido } from '../gstc';
7 | import { Slots as VidoSlots, ComponentInstance, Component } from '@neuronet.io/vido';
8 | export type SlotInstances = {
9 | [key: string]: ComponentInstance[];
10 | };
11 | export interface SlotStorage {
12 | [key: string]: Component[];
13 | }
14 | export declare class Slots extends VidoSlots {
15 | private name;
16 | private subs;
17 | constructor(name: string, vido: Vido, props: unknown);
18 | destroy(): void;
19 | getName(): string;
20 | }
21 | export declare function generateSlots(name: string, vido: Vido, props: unknown): Slots;
22 | //# sourceMappingURL=slots.d.ts.map
--------------------------------------------------------------------------------
/examples/tooltip/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | GSTC tooltip example
6 |
7 |
8 |
9 |
10 |
11 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/question-or-help-needed.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Question or help needed
3 | about: If you need help with something you don't understand or you want to ask about
4 | something related to this project.
5 | title: How to ...
6 | labels: "\U0001F468\U0001F3EB Help wanted, ❓ Question"
7 | assignees: ''
8 |
9 | ---
10 |
11 | **Your question and description of the problem goes here**
12 | To be, or not to be?
13 |
14 | **Code**
15 | You can paste your code and data examples here if it will help to answer the question.
16 |
17 | ```js
18 | your code and example data you have
19 | ```
20 |
21 | **Screenshots or movies / GIF's**
22 | Prepare some screenshots and edit them in an image editor (if you want to point something out) or create short videos or GIFs showing exactly what you are talking about.
23 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Screenshots or movies / GIF's**
20 | Prepare some screenshots and edit them in an image editor (if you want to point something out) or create short videos or GIF's showing exactly what you are talking about.
21 |
--------------------------------------------------------------------------------
/cypress/plugins/index.js:
--------------------------------------------------------------------------------
1 | ///
2 | // ***********************************************************
3 | // This example plugins/index.js can be used to load plugins
4 | //
5 | // You can change the location of this file or turn off loading
6 | // the plugins file with the 'pluginsFile' configuration option.
7 | //
8 | // You can read more here:
9 | // https://on.cypress.io/plugins-guide
10 | // ***********************************************************
11 |
12 | // This function is called when a project is opened or re-opened (e.g. due to
13 | // the project's config changing)
14 |
15 | /**
16 | * @type {Cypress.PluginConfig}
17 | */
18 | // eslint-disable-next-line no-unused-vars
19 | export default (on, config) => {
20 | // `on` is used to hook into various events Cypress emits
21 | // `config` is the resolved Cypress config
22 | };
23 |
--------------------------------------------------------------------------------
/examples/one-month/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | GSTC one-month example
6 |
7 |
8 |
9 |
10 |
11 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/examples/minimal-item-width/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | GSTC minimal item width example
6 |
7 |
8 |
9 |
10 |
11 |
19 |
20 | Show items whose width is smaller than what can be displayed.
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/examples/movement-plugin/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | GSTC movement plugin example
6 |
7 |
8 |
9 |
10 |
11 |
12 | Item can change
14 | row
16 | Item can collide
18 | with others in the same row
20 |
21 |
22 |
23 |
24 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/examples/list-columns-toggle/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | GSTC List columns toggle
6 |
7 |
8 |
9 |
10 |
11 |
12 | Columns:
13 | ID
14 | Name
15 | Surname
16 | Progress
17 |
18 |
19 |
20 |
21 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "env": {
3 | "browser": true,
4 | "es6": true,
5 | "es2017": true,
6 | "jest": true,
7 | "node": true,
8 | "cypress/globals": true
9 | },
10 | "extends": ["eslint:recommended", "plugin:@typescript-eslint/eslint-recommended"],
11 | "globals": {
12 | "page": true,
13 | "browser": true,
14 | "context": true,
15 | "jestPuppeteer": true
16 | },
17 | "parser": "@typescript-eslint/parser",
18 | "parserOptions": {
19 | "ecmaVersion": 11,
20 | "sourceType": "module"
21 | },
22 | "plugins": ["@typescript-eslint", "prettier", "cypress"],
23 | "rules": {
24 | "semi": ["error", "always"],
25 | "quotes": [
26 | "error",
27 | "single",
28 | {
29 | "avoidEscape": true,
30 | "allowTemplateLiterals": true
31 | }
32 | ],
33 | "no-undef": "warn",
34 | "no-unused-vars": "warn",
35 | "@typescript-eslint/no-unused-vars": "warn",
36 | "no-console": "error"
37 | },
38 | "ignorePatterns": ["**/*.d.ts", "node_modules", ".git", ".history", "dist", "types", "./*.js", "examples/**/*.*"]
39 | }
40 |
--------------------------------------------------------------------------------
/dist/api/locale.d.ts:
--------------------------------------------------------------------------------
1 | export type localeName = 'af' | 'ar' | 'ar-dz' | 'ar-kw' | 'ar-ly' | 'ar-ma' | 'ar-sa' | 'ar-tn' | 'az' | 'be' | 'bg' | 'bm' | 'bn' | 'bo' | 'br' | 'bs' | 'ca' | 'cs' | 'cv' | 'cy' | 'da' | 'de' | 'de-at' | 'de-ch' | 'dv' | 'el' | 'en' | 'en-au' | 'en-ca' | 'en-gb' | 'en-ie' | 'en-il' | 'en-nz' | 'en-SG' | 'eo' | 'es' | 'es-do' | 'es-us' | 'et' | 'eu' | 'fa' | 'fi' | 'fo' | 'fr' | 'fr-ca' | 'fr-ch' | 'fy' | 'ga' | 'gd' | 'gl' | 'gom-latn' | 'gu' | 'he' | 'hi' | 'hr' | 'hu' | 'hy-am' | 'id' | 'is' | 'it' | 'it-ch' | 'ja' | 'jv' | 'ka' | 'kk' | 'km' | 'kn' | 'ko' | 'ku' | 'ky' | 'lb' | 'lo' | 'lt' | 'lv' | 'me' | 'mi' | 'mk' | 'ml' | 'mn' | 'mr' | 'ms' | 'ms-my' | 'mt' | 'my' | 'nb' | 'ne' | 'nl' | 'nl-be' | 'nn' | 'oc-lnc' | 'pa-in' | 'pl' | 'pt' | 'pt-br' | 'ro' | 'ru' | 'sd' | 'se' | 'si' | 'sk' | 'sl' | 'sq' | 'sr' | 'sr-cyrl' | 'ss' | 'sv' | 'sw' | 'ta' | 'te' | 'tet' | 'tg' | 'th' | 'tl-ph' | 'tlh' | 'tr' | 'tzl' | 'tzm' | 'tzm-latn' | 'ug-cn' | 'uk' | 'ur' | 'uz' | 'uz-latn' | 'vi' | 'x-pseudo' | 'yo' | 'zh-cn' | 'zh-hk' | 'zh-tw';
2 | export declare const locales: string[];
3 | //# sourceMappingURL=locale.d.ts.map
--------------------------------------------------------------------------------
/cypress/e2e/add-rows-items.test.ts:
--------------------------------------------------------------------------------
1 | import { GridRows } from '../../dist/gstc';
2 |
3 | describe('Add rows & items', () => {
4 | it('should add rows and display grid properly', () => {
5 | let state;
6 | cy.load('/examples/add-rows-items')
7 | .window()
8 | .then((win) => {
9 | // @ts-ignore
10 | state = win.state;
11 | })
12 | .then(() => {
13 | const gridRows: GridRows = state.get('$data.chart.grid.rows');
14 | const keys = Object.keys(gridRows);
15 | expect(keys.length).to.eq(11);
16 | expect(Object.keys(gridRows[keys[0]].cells).length).to.be.greaterThan(0);
17 | }).get('.gstc__chart-timeline-grid-row-cell').should('be.visible')
18 | .get('#add-rows').click().wait(Cypress.env('wait'))
19 | .then(() => {
20 | const gridRows: GridRows = state.get('$data.chart.grid.rows');
21 | const keys = Object.keys(gridRows);
22 | expect(keys.length).to.eq(11);
23 | expect(Object.keys(gridRows[keys[0]].cells).length).to.be.greaterThan(0);
24 | }).get('.gstc__chart-timeline-grid-row-cell').should('be.visible');
25 | });
26 | });
27 |
--------------------------------------------------------------------------------
/dist/plugins/time-bookmarks.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * TimeBookmarks plugin
3 | *
4 | * @header --gstc--header--
5 | */
6 | import type { Vido } from '../gstc';
7 | import type { Dayjs } from 'dayjs';
8 | import type { StyleInfo, StyleMap } from '@neuronet.io/vido';
9 | export declare const pluginPath = "config.plugin.TimeBookmarks";
10 | export declare const slotPath = "config.slots.chart-timeline-items.outer";
11 | export interface Bookmark {
12 | time: string | number;
13 | label: string;
14 | className?: string;
15 | /**
16 | * @deprecated Use style instead of color
17 | */
18 | color?: string;
19 | style?: StyleInfo;
20 | }
21 | export interface InternalBookmark extends Bookmark {
22 | id: string;
23 | leftViewPx: number;
24 | absoluteLeftPx: number;
25 | visible: boolean;
26 | date: Dayjs;
27 | styleMap: StyleMap;
28 | }
29 | export interface Bookmarks {
30 | [key: string]: Bookmark;
31 | }
32 | export interface Options {
33 | enabled?: boolean;
34 | className?: string;
35 | bookmarks?: Bookmarks;
36 | }
37 | export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
38 | //# sourceMappingURL=time-bookmarks.d.ts.map
--------------------------------------------------------------------------------
/cypress/support/e2e.ts:
--------------------------------------------------------------------------------
1 | // ***********************************************************
2 | // This example support/index.js is processed and
3 | // loaded automatically before your test files.
4 | //
5 | // This is a great place to put global configuration and
6 | // behavior that modifies Cypress.
7 | //
8 | // You can change the location of this file or turn off
9 | // automatically serving support files with the
10 | // 'supportFile' configuration option.
11 | //
12 | // You can read more here:
13 | // https://on.cypress.io/configuration
14 | // ***********************************************************
15 |
16 | // Import commands.js using ES2015 syntax:
17 | import './commands';
18 | // Alternatively you can use CommonJS syntax:
19 | // require('./commands')
20 |
21 | declare global {
22 | namespace Cypress {
23 | interface Chainable {
24 | load(url: string): Chainable;
25 | scrollH(movementX: number): Chainable;
26 | scrollV(movementY: number): Chainable;
27 | move(selector: string, movementX: number, movementY: number): Chainable;
28 | moveDirect(selector: string, movementX: number, movementY: number): Chainable;
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/dist/plugins/time-bookmarks.esm.min.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * TimeBookmarks plugin
3 | *
4 | * @header --gstc--header--
5 | */
6 | import type { Vido } from '../gstc';
7 | import type { Dayjs } from 'dayjs';
8 | import type { StyleInfo, StyleMap } from '@neuronet.io/vido';
9 | export declare const pluginPath = "config.plugin.TimeBookmarks";
10 | export declare const slotPath = "config.slots.chart-timeline-items.outer";
11 | export interface Bookmark {
12 | time: string | number;
13 | label: string;
14 | className?: string;
15 | /**
16 | * @deprecated Use style instead of color
17 | */
18 | color?: string;
19 | style?: StyleInfo;
20 | }
21 | export interface InternalBookmark extends Bookmark {
22 | id: string;
23 | leftViewPx: number;
24 | absoluteLeftPx: number;
25 | visible: boolean;
26 | date: Dayjs;
27 | styleMap: StyleMap;
28 | }
29 | export interface Bookmarks {
30 | [key: string]: Bookmark;
31 | }
32 | export interface Options {
33 | enabled?: boolean;
34 | className?: string;
35 | bookmarks?: Bookmarks;
36 | }
37 | export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
38 | //# sourceMappingURL=time-bookmarks.d.ts.map
--------------------------------------------------------------------------------
/dist/plugins/time-bookmarks.umd.min.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * TimeBookmarks plugin
3 | *
4 | * @header --gstc--header--
5 | */
6 | import type { Vido } from '../gstc';
7 | import type { Dayjs } from 'dayjs';
8 | import type { StyleInfo, StyleMap } from '@neuronet.io/vido';
9 | export declare const pluginPath = "config.plugin.TimeBookmarks";
10 | export declare const slotPath = "config.slots.chart-timeline-items.outer";
11 | export interface Bookmark {
12 | time: string | number;
13 | label: string;
14 | className?: string;
15 | /**
16 | * @deprecated Use style instead of color
17 | */
18 | color?: string;
19 | style?: StyleInfo;
20 | }
21 | export interface InternalBookmark extends Bookmark {
22 | id: string;
23 | leftViewPx: number;
24 | absoluteLeftPx: number;
25 | visible: boolean;
26 | date: Dayjs;
27 | styleMap: StyleMap;
28 | }
29 | export interface Bookmarks {
30 | [key: string]: Bookmark;
31 | }
32 | export interface Options {
33 | enabled?: boolean;
34 | className?: string;
35 | bookmarks?: Bookmarks;
36 | }
37 | export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
38 | //# sourceMappingURL=time-bookmarks.d.ts.map
--------------------------------------------------------------------------------
/cypress/e2e/list-header-resize.test.ts:
--------------------------------------------------------------------------------
1 | describe('List header', () => {
2 | it('should stay at similar time when changing list column width', () => {
3 | let state,
4 | initialDataIndex = 0,
5 | timeFrom;
6 | cy.load('/examples/add-rows-items')
7 | .window()
8 | .then((win) => {
9 | // @ts-ignore
10 | state = win.state;
11 | })
12 | .wait(200) // wait for scroll event on gstc-loaded
13 | .get('.gstc__chart-timeline-grid-row-cell.current')
14 | .should('be.visible')
15 | .then(() => {
16 | initialDataIndex = state.get('$data.scroll.horizontal.dataIndex');
17 | timeFrom = state.get('$data.chart.time.fromDate');
18 | state.update('config.list.columns.data.gstcid-label.width', 100);
19 | })
20 | .wait(100)
21 | .then(() => {
22 | const currentDataIndex = state.get('$data.scroll.horizontal.dataIndex');
23 | const currentTimeFrom = state.get('$data.chart.time.fromDate');
24 | expect(initialDataIndex).to.eq(currentDataIndex);
25 | expect(timeFrom.format('YYYY-MM-DD')).to.eq(currentTimeFrom.format('YYYY-MM-DD'));
26 | })
27 | .get('.gstc__chart-timeline-grid-row-cell.current')
28 | .should('be.visible');
29 | });
30 | });
31 |
--------------------------------------------------------------------------------
/examples/selection-plugin/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | GSTC Selection plugin example
6 |
7 |
8 |
9 |
10 |
11 |
12 | Select cells
13 | Select items
14 | Multiple selection
15 | Show selecting area under the cursor
16 | Select item 3
17 | Select 2020-01-09 cells
18 | Get selected items (console)
19 | Clear selection
20 | Scroll to cell 10
21 |
22 |
23 |
24 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/examples/grab-scroll/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | GSTC grab-scroll example
6 |
7 |
8 |
9 |
10 |
11 |
19 |
20 | Select mode:
21 |
22 |
23 |
24 | Grab Scroll
25 |
26 |
27 |
28 |
29 | Selection
30 |
31 |
32 |
33 |
34 | Speed multiplier
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/examples/item-slot-html-content/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | GSTC Item slot html content example
6 |
7 |
8 |
9 |
42 |
43 |
44 |
45 |
46 |
47 | ... GENERATING DATA PLEASE WAIT ...
48 |
49 |
50 |
--------------------------------------------------------------------------------
/dist/plugins/dependency-lines.d.ts:
--------------------------------------------------------------------------------
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
--------------------------------------------------------------------------------
/dist/plugins/dependency-lines.esm.min.d.ts:
--------------------------------------------------------------------------------
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
--------------------------------------------------------------------------------
/dist/plugins/dependency-lines.umd.min.d.ts:
--------------------------------------------------------------------------------
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
--------------------------------------------------------------------------------
/dist/plugins/highlight-weekends.esm.min.js:
--------------------------------------------------------------------------------
1 | class t{constructor(){this.isAction=!0}}
2 | /**
3 | * HighlightWeekends plugin
4 | *
5 | * @copyright NEURONET - Rafal Pospiech
6 | * @author Rafal Pospiech
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.41.2
11 | * @released 2025-09-10
12 | * @license SEE LICENSE IN LICENSE FILE
13 | */
14 | function e(e={}){const i=e.weekdays||[6,0];let s,a,n=!0;class c extends t{constructor(t,e){super(),this.highlight(t,e.time.leftGlobalDate)}update(t,e){this.highlight(t,e.time.leftGlobalDate)}highlight(t,e){const a=t.classList.contains(s);if(!n)return void(a&&t.classList.remove(s));const c=i.includes(e.day());!a&&c?t.classList.add(s):a&&!c&&t.classList.remove(s)}}return function(t){const i=t.api.mergeDeep,l=[];a=t.api,s=e.className||a.getClass("chart-timeline-grid-row-cell")+"--weekend";const o=t.state.get("config.plugin.HighlightWeekends");return o&&(e=i({},e,o)),l.push(t.state.subscribe("$data.chart.time.format.period",t=>n="day"===t)),t.state.update("config.actions.chart-timeline-grid-row-cell",t=>(t.push(c),t)),a.pluginInitialized("HighlightWeekends"),function(){l.forEach(t=>t()),t.state.update("config.actions.chart-timeline-grid-row-cell",t=>t.filter(t=>t!==c)),a.pluginDestroyed("HighlightWeekends")}}}t.prototype.isAction=!0;export{e as Plugin};
--------------------------------------------------------------------------------
/dist/api/public.d.ts:
--------------------------------------------------------------------------------
1 | import DeepState from 'deep-state-observer';
2 | import dayjs from 'dayjs';
3 | import type { Config, Locale, Period } from '../gstc';
4 | import { lithtml } from '@neuronet.io/vido';
5 | import * as vido from '@neuronet.io/vido';
6 | export declare const mergeDeep: typeof import("@neuronet.io/vido/dist/types/helpers").mergeDeep;
7 | export declare function prepareState(userConfig: Config): {
8 | config: unknown;
9 | };
10 | export declare function stateFromConfig(userConfig: Config): DeepState;
11 | export declare function wasmStateFromConfig(userConfig: Config, wasmFile?: string): Promise;
12 | declare function clone(object: object): unknown;
13 | export declare const publicApi: {
14 | name: string;
15 | GSTCID: (originalId: string) => string;
16 | isGSTCID: (id: string) => boolean;
17 | sourceID: (id: string) => string;
18 | fromArray(array: any): Record;
19 | stateFromConfig: typeof stateFromConfig;
20 | wasmStateFromConfig: typeof wasmStateFromConfig;
21 | merge: typeof import("@neuronet.io/vido/dist/types/helpers").mergeDeep;
22 | mergeDeep: typeof import("@neuronet.io/vido/dist/types/helpers").mergeDeep;
23 | clone: typeof clone;
24 | lithtml: typeof lithtml;
25 | html: typeof lithtml;
26 | vido: typeof vido;
27 | date(time?: any, utcMode?: boolean, localeConfig?: Locale): dayjs.Dayjs;
28 | setPeriod(period: Period): number;
29 | dayjs: typeof dayjs;
30 | };
31 | export {};
32 | //# sourceMappingURL=public.d.ts.map
--------------------------------------------------------------------------------
/examples/big-dataset/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | GSTC Big dataset example
6 |
7 |
8 |
9 |
33 |
34 |
35 |
36 | 1K rows and items
37 | 5K rows and items
38 | 10K rows and items
39 | 20K rows and items
40 | 30K rows and items
41 | 50K rows and items
42 | 100K rows and items
43 |
45 |
46 |
47 |
48 |
49 |
50 | ... GENERATING DATA PLEASE WAIT ...
51 |
52 |
53 |
--------------------------------------------------------------------------------
/dist/plugins/highlight-weekends.umd.min.js:
--------------------------------------------------------------------------------
1 | !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).HighlightWeekends={})}(this,function(e){"use strict";class t{constructor(){this.isAction=!0}}t.prototype.isAction=!0,e.Plugin=
2 | /**
3 | * HighlightWeekends plugin
4 | *
5 | * @copyright NEURONET - Rafal Pospiech
6 | * @author Rafal Pospiech
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.41.2
11 | * @released 2025-09-10
12 | * @license SEE LICENSE IN LICENSE FILE
13 | */
14 | function(e={}){const i=e.weekdays||[6,0];let s,n,o=!0;class l extends t{constructor(e,t){super(),this.highlight(e,t.time.leftGlobalDate)}update(e,t){this.highlight(e,t.time.leftGlobalDate)}highlight(e,t){const n=e.classList.contains(s);if(!o)return void(n&&e.classList.remove(s));const l=i.includes(t.day());!n&&l?e.classList.add(s):n&&!l&&e.classList.remove(s)}}return function(t){const i=t.api.mergeDeep,c=[];n=t.api,s=e.className||n.getClass("chart-timeline-grid-row-cell")+"--weekend";const a=t.state.get("config.plugin.HighlightWeekends");return a&&(e=i({},e,a)),c.push(t.state.subscribe("$data.chart.time.format.period",e=>o="day"===e)),t.state.update("config.actions.chart-timeline-grid-row-cell",e=>(e.push(l),e)),n.pluginInitialized("HighlightWeekends"),function(){c.forEach(e=>e()),t.state.update("config.actions.chart-timeline-grid-row-cell",e=>e.filter(e=>e!==l)),n.pluginDestroyed("HighlightWeekends")}}},Object.defineProperty(e,"__esModule",{value:!0})});
--------------------------------------------------------------------------------
/examples/messing-with-templates/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | GSTC Item slot html content example
6 |
7 |
8 |
9 |
56 |
57 |
58 |
59 |
60 |
61 | ... GENERATING DATA PLEASE WAIT ...
62 |
63 |
64 |
--------------------------------------------------------------------------------
/examples/complex-1/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | GSTC complex-1 example
6 |
7 |
8 |
9 |
10 |
11 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/cypress/e2e/rows.test.ts:
--------------------------------------------------------------------------------
1 | describe('Rows', () => {
2 | it('should hide items from collapsed rows', () => {
3 | let state, gstc;
4 | const toggleClass = '.gstc__list-column-row-expander-toggle[data-gstcid="gstcid-1"]';
5 | cy.load('/examples/one-month')
6 | .window()
7 | .then((win) => {
8 | // @ts-ignore
9 | state = win.state;
10 | // @ts-ignore
11 | gstc = win.gstc;
12 | function getRandomFaceImage() {
13 | return `./faces/face-${Math.ceil(Math.random() * 50)}.jpg`;
14 | }
15 | const iterations = 100;
16 | const GSTCID = gstc.api.GSTCID;
17 | const rows = {};
18 | for (let i = 0; i < iterations; i++) {
19 | const id = GSTCID(String(i));
20 | rows[id] = {
21 | id,
22 | label: `John Doe ${i}`,
23 | parentId: i === 1 ? undefined : GSTCID(String(1)), //withParent ? GSTCID(String(i - 1)) : undefined,
24 | expanded: false,
25 | img: getRandomFaceImage(),
26 | progress: Math.floor(Math.random() * 100),
27 | };
28 | }
29 | state.update('config.list.rows', rows);
30 | })
31 | .wait(Cypress.env('wait'))
32 | .get(toggleClass)
33 | .click()
34 | .wait(Cypress.env('wait'))
35 | .click()
36 | .wait(Cypress.env('wait'))
37 | .move('.gstc__list-column-header-resizer-dots--gstcid-progress', 20, 0)
38 | .wait(Cypress.env('wait'))
39 | .get('.gstc__chart-timeline-items-row-item[data-gstcid="gstcid-2"]')
40 | .should('not.exist')
41 | .get('#btn-next-month')
42 | .click()
43 | .wait(300)
44 | .get('#btn-prev-month')
45 | .click()
46 | .wait(300)
47 | .get('.gstc__chart-timeline-items-row-item[data-gstcid="gstcid-2"]')
48 | .should('not.exist');
49 | });
50 | });
51 |
--------------------------------------------------------------------------------
/cypress/e2e/utc-mode.test.ts:
--------------------------------------------------------------------------------
1 | import { DataChartTime } from '../../dist/gstc';
2 | const date = '2020-01-01';
3 | describe('UTC mode', () => {
4 | it('should display dates according to utc mode', () => {
5 | let GSTC, state;
6 | cy.load('/examples/one-month')
7 | .window()
8 | .then((win) => {
9 | // @ts-ignore
10 | GSTC = win.GSTC;
11 | // @ts-ignore
12 | state = win.state;
13 | })
14 | .then(() => {
15 | const chartTime: DataChartTime = state.get('$data.chart.time');
16 | expect(chartTime.fromDate.format('YYYY-MM-DD')).to.eq(
17 | chartTime.levels[1][0].leftGlobalDate.format('YYYY-MM-DD')
18 | );
19 | expect(GSTC.api.date(date, true).valueOf()).not.to.eq(GSTC.api.date(date).valueOf());
20 | })
21 | // Invalid time
22 | .then(() => {
23 | state.update('config.utcMode', true);
24 | state.update('config.chart.time', (time) => {
25 | time.from = GSTC.api.date(date).startOf('month').valueOf();
26 | time.to = GSTC.api.date(date).endOf('month').valueOf();
27 | return time;
28 | });
29 | })
30 | .wait(Cypress.env('wait'))
31 | .then(() => {
32 | const chartTime: DataChartTime = state.get('$data.chart.time');
33 | expect(chartTime.fromDate.format('YYYY-MM-DD')).not.to.eq(date);
34 | })
35 | // Valid time
36 | .then(() => {
37 | state.update('config.chart.time', (time) => {
38 | time.from = GSTC.api.date(date, true).startOf('month').valueOf();
39 | time.to = GSTC.api.date(date, true).endOf('month').valueOf();
40 | return time;
41 | });
42 | })
43 | .wait(Cypress.env('wait'))
44 | .then(() => {
45 | const chartTime: DataChartTime = state.get('$data.chart.time');
46 | expect(chartTime.fromDate.format('YYYY-MM-DD')).to.eq(
47 | chartTime.levels[1][0].leftGlobalDate.format('YYYY-MM-DD')
48 | );
49 | });
50 | });
51 | });
52 |
--------------------------------------------------------------------------------
/examples/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | GSTC Examples
7 |
8 |
13 |
14 |
15 |
16 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/dist/plugins/progress-bar.esm.min.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Gantt-Schedule-Timeline-Calendar helpers
3 | *
4 | * @copyright NEURONET - Rafal Pospiech
5 | * @author Rafal Pospiech
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.41.2
10 | * @released 2025-09-10
11 | * @license SEE LICENSE IN LICENSE FILE
12 | */
13 | const t="gstc";function i(i,s=""){let e=`${t}__${i}`;return i===t&&(e=t),s?`${e} ${e}--${s.replace(":","-")}`:e}
14 | /**
15 | * ProgressBar plugin
16 | *
17 | * @copyright NEURONET - Rafal Pospiech
18 | * @author Rafal Pospiech
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.41.2
23 | * @released 2025-09-10
24 | * @license SEE LICENSE IN LICENSE FILE
25 | */const s="config.plugin.ProgressBar";class e{constructor(t,s){this.options=function(t){return Object.assign({enabled:!0,className:i("chart-timeline-items-row-item-progress-bar")},t)}(t),this.vido=s,this.state=s.state,this.className=this.options.className,this.PluginProgressBarSlot=this.PluginProgressBarSlot.bind(this),this.destroy=this.destroy.bind(this),this.state.update("config.slots.chart-timeline-items-row-item.inner",t=>(t.includes(this.PluginProgressBarSlot)||t.push(this.PluginProgressBarSlot),t))}destroy(){this.state.update("config.slots.chart-timeline-items-row-item.inner",t=>t.filter(t=>t!==this.PluginProgressBarSlot)),this.vido.api.pluginDestroyed("ProgressBar")}PluginProgressBarSlot(t,i){let s;const e=new t.StyleMap({width:"0px"});return t.onChange(r=>{if(!(i=r)||!i.item)return void(e.style.width="0px");const o=t.api.getItemData(i.item.id);if(!o||void 0===i.item.progress)return void(e.style.width="0px");if(!i.item)return;const n=i.item,a=void 0===n.progress?100:n.progress;0===Math.floor(o.width)?e.style.width=100-a+"%":(s=o.width-o.width/100*a,s-=o.position.right-o.position.actualRight,s<0&&(s=0),e.style.width=Math.floor(s)+"px")}),t=>i&&i.item&&void 0!==i.item.progress?this.vido.html`
26 |
${t}
27 | `:null}}function r(t={}){return function(i){const r=i.state.get(s);r&&(t=i.api.mergeDeep({},t,r));const o=new e(t,i);return i.api.pluginInitialized("ProgressBar"),o.destroy}}export{r as Plugin,s as pluginPath};
--------------------------------------------------------------------------------
/dist/plugins/progress-bar.umd.min.js:
--------------------------------------------------------------------------------
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).ProgressBar={})}(this,function(t){"use strict";
2 | /**
3 | * Gantt-Schedule-Timeline-Calendar helpers
4 | *
5 | * @copyright NEURONET - Rafal Pospiech
6 | * @author Rafal Pospiech
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.41.2
11 | * @released 2025-09-10
12 | * @license SEE LICENSE IN LICENSE FILE
13 | */const e="gstc";function i(t,i=""){let s=`${e}__${t}`;return t===e&&(s=e),i?`${s} ${s}--${i.replace(":","-")}`:s}
14 | /**
15 | * ProgressBar plugin
16 | *
17 | * @copyright NEURONET - Rafal Pospiech
18 | * @author Rafal Pospiech
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.41.2
23 | * @released 2025-09-10
24 | * @license SEE LICENSE IN LICENSE FILE
25 | */const s="config.plugin.ProgressBar";class r{constructor(t,e){this.options=function(t){return Object.assign({enabled:!0,className:i("chart-timeline-items-row-item-progress-bar")},t)}(t),this.vido=e,this.state=e.state,this.className=this.options.className,this.PluginProgressBarSlot=this.PluginProgressBarSlot.bind(this),this.destroy=this.destroy.bind(this),this.state.update("config.slots.chart-timeline-items-row-item.inner",t=>(t.includes(this.PluginProgressBarSlot)||t.push(this.PluginProgressBarSlot),t))}destroy(){this.state.update("config.slots.chart-timeline-items-row-item.inner",t=>t.filter(t=>t!==this.PluginProgressBarSlot)),this.vido.api.pluginDestroyed("ProgressBar")}PluginProgressBarSlot(t,e){let i;const s=new t.StyleMap({width:"0px"});return t.onChange(r=>{if(!(e=r)||!e.item)return void(s.style.width="0px");const o=t.api.getItemData(e.item.id);if(!o||void 0===e.item.progress)return void(s.style.width="0px");if(!e.item)return;const n=e.item,l=void 0===n.progress?100:n.progress;0===Math.floor(o.width)?s.style.width=100-l+"%":(i=o.width-o.width/100*l,i-=o.position.right-o.position.actualRight,i<0&&(i=0),s.style.width=Math.floor(i)+"px")}),t=>e&&e.item&&void 0!==e.item.progress?this.vido.html`
26 |
${t}
27 | `:null}}t.Plugin=function(t={}){return function(e){const i=e.state.get(s);i&&(t=e.api.mergeDeep({},t,i));const o=new r(t,e);return e.api.pluginInitialized("ProgressBar"),o.destroy}},t.pluginPath=s,Object.defineProperty(t,"__esModule",{value:!0})});
--------------------------------------------------------------------------------
/dist/api/main.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Main api
3 | *
4 | * @header --gstc--header--
5 | */
6 | import { Dayjs } from 'dayjs';
7 | import { DataChartTime, DataChartTimeLevel, DataChartTimeLevelDate, ChartCalendarLevel, ChartTimeDate, ChartTimeDates, ChartCalendarLevelFormat, Item, Vido, Reason, DataScrollHorizontal } from '../gstc';
8 | export default function main(vido: Vido, mergeDeep: any): {
9 | className: string;
10 | styleMap: import("@neuronet.io/vido").StyleMap;
11 | initializePlugins(): void;
12 | heightChange(): void;
13 | resizerActiveChange(active: boolean): void;
14 | generateTreeFromVisibleRows(): void;
15 | generateTree(fullReload?: boolean): void;
16 | prepareExpanded(): void;
17 | generateVisibleRowsAndItems(): void;
18 | updateItemsVerticalPositionsOfVisibleRows(): void;
19 | getMutedListeners(): any[];
20 | triggerLoadedEvent(): void;
21 | getLastPageDatesWidth(chartWidth: number, allDates: DataChartTimeLevelDate[]): number;
22 | formatDate(formatting: ChartCalendarLevelFormat, date: DataChartTimeLevelDate, localeName: string): import("../gstc").htmlResult;
23 | generatePeriodDates(formatting: ChartCalendarLevelFormat, time: DataChartTime, level: ChartCalendarLevel, levelIndex: number): DataChartTimeLevel;
24 | limitGlobal(time: DataChartTime): DataChartTime;
25 | setCenter(time: DataChartTime): void;
26 | guessPeriod(time: DataChartTime, levels: ChartCalendarLevel[]): DataChartTime;
27 | getFormatAndLevelIndexForZoom(zoom: number, levels?: ChartCalendarLevel[]): {
28 | levelIndex: number;
29 | format: ChartCalendarLevelFormat;
30 | };
31 | generateAllDates(time: DataChartTime, levels: ChartCalendarLevel[]): ChartTimeDates[];
32 | getPeriodDatesAndCalculateViewOffsetFromAllDates(allLevelDates: ChartTimeDates, time: DataChartTime): ChartTimeDate[];
33 | updateLevels(time: DataChartTime, levels: ChartCalendarLevel[]): void;
34 | updateLocale(): void;
35 | calculateTotalViewDurationFromDates(time: DataChartTime): void;
36 | calculateRightGlobal(leftGlobalDate: Dayjs, chartWidth: number, allMainDates: DataChartTimeLevelDate[], offsetPx: any, offsetMs: any): number;
37 | updateViewPortVisibleItems(justSetWithoutNotify?: boolean, time?: DataChartTime): Item[];
38 | updateViewPortVisibleItemsPositions(time?: DataChartTime, multi?: import("deep-state-observer").Multi): import("deep-state-observer").Multi;
39 | calculateLeftAndRightGlobalNormally(time: DataChartTime, horizontalScroll: DataScrollHorizontal): void;
40 | calculateLeftAndRightGlobalFromCenter(time: DataChartTime, oldDataTime: DataChartTime, horizontalScroll: DataScrollHorizontal): void | DataChartTime;
41 | updateFromToBasedOnDates(time: DataChartTime): void;
42 | recalculateTimes(reasons: Reason[]): void;
43 | minimalReload(eventInfo: any, bulk: any): void;
44 | partialReload(fullReload: boolean, eventInfo: any, bulk: any): void;
45 | fullReload(eventInfo: any, bulk: any): void;
46 | };
47 | //# sourceMappingURL=main.d.ts.map
--------------------------------------------------------------------------------
/dist/plugins/item-movement.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * ItemMovement plugin
3 | *
4 | * @header --gstc--header--
5 | */
6 | import type { Vido, Item, DataChartTime, ItemData, DataItems, DataScrollVertical, DataScrollHorizontal } from '../gstc';
7 | import type DeepState from 'deep-state-observer';
8 | import type { Dayjs } from 'dayjs';
9 | export interface SnapArg {
10 | time: DataChartTime;
11 | item: Item | null;
12 | movement: Movement;
13 | vido: Vido;
14 | }
15 | export interface SnapStartArg extends SnapArg {
16 | startTime: Dayjs;
17 | }
18 | export interface SnapEndArg extends SnapArg {
19 | endTime: Dayjs;
20 | }
21 | export interface Movement {
22 | x: number;
23 | y: number;
24 | time: number;
25 | }
26 | export interface SnapToTime {
27 | start?: (snapStartArgs: SnapStartArg) => Dayjs;
28 | end?: (snapEndArgs: SnapEndArg) => Dayjs;
29 | }
30 | export interface BeforeAfterInitialItems {
31 | initial: Item[];
32 | before: Item[];
33 | after: Item[];
34 | targetData: Item | null;
35 | }
36 | export interface OnArg {
37 | items: BeforeAfterInitialItems;
38 | addedDependantIds: string[];
39 | selectedIds: string[];
40 | vido: Vido;
41 | state: DeepState;
42 | time: DataChartTime;
43 | }
44 | export interface Events {
45 | onStart?: (onArg: OnArg) => Item[];
46 | onMove?: (onArg: OnArg) => Item[];
47 | onEnd?: (onArg: OnArg) => Item[];
48 | }
49 | export interface Threshold {
50 | horizontal?: number;
51 | vertical?: number;
52 | }
53 | export interface ScrollSpeed {
54 | horizontal?: number;
55 | vertical?: number;
56 | timeout?: number;
57 | }
58 | export interface AutoScroll {
59 | speed?: ScrollSpeed;
60 | edgeThreshold?: Threshold;
61 | }
62 | export interface Options {
63 | enabled?: boolean;
64 | dependant?: boolean;
65 | moveDependantVertically?: boolean;
66 | debug?: boolean;
67 | bodyClass?: string;
68 | itemClass?: string;
69 | events?: Events;
70 | snapToTime?: SnapToTime;
71 | threshold?: Threshold;
72 | autoScroll?: AutoScroll;
73 | ignoreMissingDates?: boolean;
74 | allowItemsToGoOutsideTheArea?: boolean;
75 | shouldMuteNotNeededMethods?: boolean;
76 | }
77 | export type State = 'start' | 'move' | 'end' | '';
78 | export interface ThresholdReached {
79 | horizontal: boolean;
80 | vertical: boolean;
81 | }
82 | export interface PluginData extends Options {
83 | isMoving: boolean;
84 | initialItems: Item[];
85 | initialItemsData: DataItems;
86 | addedDependantIds: string[];
87 | selectedIds: string[];
88 | clickedItem: Item;
89 | clickedItemData: ItemData;
90 | initialVerticalScroll: DataScrollVertical;
91 | initialHorizontalScroll: DataScrollHorizontal;
92 | initialPointerTime: Dayjs | null;
93 | thresholdReached: ThresholdReached;
94 | state: State;
95 | movement: Movement;
96 | }
97 | export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
98 | //# sourceMappingURL=item-movement.d.ts.map
--------------------------------------------------------------------------------
/dist/plugins/calendar-scroll.esm.min.js:
--------------------------------------------------------------------------------
1 | /**
2 | * CalendarScroll plugin
3 | *
4 | * @copyright NEURONET - Rafal Pospiech
5 | * @author Rafal Pospiech
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.41.2
10 | * @released 2025-09-10
11 | * @license SEE LICENSE IN LICENSE FILE
12 | */
13 | const t={enabled:!0,bodyClassName:["gstc-scrolling","gstc-cursor-grabbing"]};function e(e=t){let i,n,o,s=e.enabled;class a{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;e.bodyClassName&&(Array.isArray(e.bodyClassName)?document.body.classList.add(...e.bodyClassName):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&&(e.bodyClassName&&(Array.isArray(e.bodyClassName)?document.body.classList.remove(...e.bodyClassName):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 a,r=this.initialDataIndex.x-1,l=0;for(;r>0&&(a=o[r],l+=a.width,!(l>=t.x));r--);let d=0;a&&(d=a.leftPx),s.byPixels?n.setScrollLeft(d):n.setScrollLeft(r)}else if(t.x<0){let a=this.initialDataIndex.x;const r=o.get("$data.scroll.horizontal"),l=i.allDates[i.level];if(a-1>=l.length-r.lastPageCount)return this.resetInitialPoint(e);let d,c=0;for(let e=l.length;a=l.length-r.lastPageCount)return;let h=0;d&&(h=d.leftPx),s.byPixels?n.setScrollLeft(h):n.setScrollLeft(a)}}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 r="config.plugin.CalendarScroll",l=t.state.get(r);return l&&(e=n.mergeDeep({},e,l)),o.update(r,e),o.subscribe("config.plugin.CalendarScroll.enabled",t=>s=t),o.update("config.actions.chart-calendar",t=>(t.push(a),t)),n.pluginInitialized("CalendarScroll"),function(){o.update("config.actions.chart-calendar",t=>t.filter(t=>t!==a)),n.pluginDestroyed("CalendarScroll")}}}export{e as Plugin};
--------------------------------------------------------------------------------
/dist/plugins/item-movement.esm.min.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * ItemMovement plugin
3 | *
4 | * @header --gstc--header--
5 | */
6 | import type { Vido, Item, DataChartTime, ItemData, DataItems, DataScrollVertical, DataScrollHorizontal } from '../gstc';
7 | import type DeepState from 'deep-state-observer';
8 | import type { Dayjs } from 'dayjs';
9 | export interface SnapArg {
10 | time: DataChartTime;
11 | item: Item | null;
12 | movement: Movement;
13 | vido: Vido;
14 | }
15 | export interface SnapStartArg extends SnapArg {
16 | startTime: Dayjs;
17 | }
18 | export interface SnapEndArg extends SnapArg {
19 | endTime: Dayjs;
20 | }
21 | export interface Movement {
22 | x: number;
23 | y: number;
24 | time: number;
25 | }
26 | export interface SnapToTime {
27 | start?: (snapStartArgs: SnapStartArg) => Dayjs;
28 | end?: (snapEndArgs: SnapEndArg) => Dayjs;
29 | }
30 | export interface BeforeAfterInitialItems {
31 | initial: Item[];
32 | before: Item[];
33 | after: Item[];
34 | targetData: Item | null;
35 | }
36 | export interface OnArg {
37 | items: BeforeAfterInitialItems;
38 | addedDependantIds: string[];
39 | selectedIds: string[];
40 | vido: Vido;
41 | state: DeepState;
42 | time: DataChartTime;
43 | }
44 | export interface Events {
45 | onStart?: (onArg: OnArg) => Item[];
46 | onMove?: (onArg: OnArg) => Item[];
47 | onEnd?: (onArg: OnArg) => Item[];
48 | }
49 | export interface Threshold {
50 | horizontal?: number;
51 | vertical?: number;
52 | }
53 | export interface ScrollSpeed {
54 | horizontal?: number;
55 | vertical?: number;
56 | timeout?: number;
57 | }
58 | export interface AutoScroll {
59 | speed?: ScrollSpeed;
60 | edgeThreshold?: Threshold;
61 | }
62 | export interface Options {
63 | enabled?: boolean;
64 | dependant?: boolean;
65 | moveDependantVertically?: boolean;
66 | debug?: boolean;
67 | bodyClass?: string;
68 | itemClass?: string;
69 | events?: Events;
70 | snapToTime?: SnapToTime;
71 | threshold?: Threshold;
72 | autoScroll?: AutoScroll;
73 | ignoreMissingDates?: boolean;
74 | allowItemsToGoOutsideTheArea?: boolean;
75 | shouldMuteNotNeededMethods?: boolean;
76 | }
77 | export type State = 'start' | 'move' | 'end' | '';
78 | export interface ThresholdReached {
79 | horizontal: boolean;
80 | vertical: boolean;
81 | }
82 | export interface PluginData extends Options {
83 | isMoving: boolean;
84 | initialItems: Item[];
85 | initialItemsData: DataItems;
86 | addedDependantIds: string[];
87 | selectedIds: string[];
88 | clickedItem: Item;
89 | clickedItemData: ItemData;
90 | initialVerticalScroll: DataScrollVertical;
91 | initialHorizontalScroll: DataScrollHorizontal;
92 | initialPointerTime: Dayjs | null;
93 | thresholdReached: ThresholdReached;
94 | state: State;
95 | movement: Movement;
96 | }
97 | export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
98 | //# sourceMappingURL=item-movement.d.ts.map
--------------------------------------------------------------------------------
/dist/plugins/item-movement.umd.min.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * ItemMovement plugin
3 | *
4 | * @header --gstc--header--
5 | */
6 | import type { Vido, Item, DataChartTime, ItemData, DataItems, DataScrollVertical, DataScrollHorizontal } from '../gstc';
7 | import type DeepState from 'deep-state-observer';
8 | import type { Dayjs } from 'dayjs';
9 | export interface SnapArg {
10 | time: DataChartTime;
11 | item: Item | null;
12 | movement: Movement;
13 | vido: Vido;
14 | }
15 | export interface SnapStartArg extends SnapArg {
16 | startTime: Dayjs;
17 | }
18 | export interface SnapEndArg extends SnapArg {
19 | endTime: Dayjs;
20 | }
21 | export interface Movement {
22 | x: number;
23 | y: number;
24 | time: number;
25 | }
26 | export interface SnapToTime {
27 | start?: (snapStartArgs: SnapStartArg) => Dayjs;
28 | end?: (snapEndArgs: SnapEndArg) => Dayjs;
29 | }
30 | export interface BeforeAfterInitialItems {
31 | initial: Item[];
32 | before: Item[];
33 | after: Item[];
34 | targetData: Item | null;
35 | }
36 | export interface OnArg {
37 | items: BeforeAfterInitialItems;
38 | addedDependantIds: string[];
39 | selectedIds: string[];
40 | vido: Vido;
41 | state: DeepState;
42 | time: DataChartTime;
43 | }
44 | export interface Events {
45 | onStart?: (onArg: OnArg) => Item[];
46 | onMove?: (onArg: OnArg) => Item[];
47 | onEnd?: (onArg: OnArg) => Item[];
48 | }
49 | export interface Threshold {
50 | horizontal?: number;
51 | vertical?: number;
52 | }
53 | export interface ScrollSpeed {
54 | horizontal?: number;
55 | vertical?: number;
56 | timeout?: number;
57 | }
58 | export interface AutoScroll {
59 | speed?: ScrollSpeed;
60 | edgeThreshold?: Threshold;
61 | }
62 | export interface Options {
63 | enabled?: boolean;
64 | dependant?: boolean;
65 | moveDependantVertically?: boolean;
66 | debug?: boolean;
67 | bodyClass?: string;
68 | itemClass?: string;
69 | events?: Events;
70 | snapToTime?: SnapToTime;
71 | threshold?: Threshold;
72 | autoScroll?: AutoScroll;
73 | ignoreMissingDates?: boolean;
74 | allowItemsToGoOutsideTheArea?: boolean;
75 | shouldMuteNotNeededMethods?: boolean;
76 | }
77 | export type State = 'start' | 'move' | 'end' | '';
78 | export interface ThresholdReached {
79 | horizontal: boolean;
80 | vertical: boolean;
81 | }
82 | export interface PluginData extends Options {
83 | isMoving: boolean;
84 | initialItems: Item[];
85 | initialItemsData: DataItems;
86 | addedDependantIds: string[];
87 | selectedIds: string[];
88 | clickedItem: Item;
89 | clickedItemData: ItemData;
90 | initialVerticalScroll: DataScrollVertical;
91 | initialHorizontalScroll: DataScrollHorizontal;
92 | initialPointerTime: Dayjs | null;
93 | thresholdReached: ThresholdReached;
94 | state: State;
95 | movement: Movement;
96 | }
97 | export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
98 | //# sourceMappingURL=item-movement.d.ts.map
--------------------------------------------------------------------------------
/examples/plugin-item-image/item-image.js:
--------------------------------------------------------------------------------
1 | /**
2 | * ItemImage plugin example
3 | */
4 |
5 | const pluginPath = 'config.plugin.ItemImage';
6 | const slotPath = 'config.slots.chart-timeline-items-row-item.content';
7 |
8 | function getDefaultOptions() {
9 | return {
10 | size: 20,
11 | imageField: 'image',
12 | };
13 | }
14 |
15 | /**
16 | * ItemImage class - plugin meat
17 | */
18 | class ItemImage {
19 | constructor(options, vidoInstance) {
20 | this.vidoInstance = vidoInstance;
21 | // merge options with default
22 | this.options = { ...getDefaultOptions(), ...options };
23 | this.state = vidoInstance.state;
24 | this.onDestroy = [];
25 | // permanently bind item slot to this class (because we want to get options from it)
26 | this.itemSlot = this.itemSlot.bind(this);
27 | // save options
28 | this.state.update(pluginPath, this.options);
29 | // subscribe options so we can programmatically change something
30 | this.onDestroy.push(
31 | this.state.subscribe(pluginPath, (options) => {
32 | this.options = options;
33 | vidoInstance.update();
34 | })
35 | );
36 | // add new slot with image to item
37 | this.state.update(slotPath, (itemContentSlots) => {
38 | if (!itemContentSlots.includes(this.itemSlot)) itemContentSlots.push(this.itemSlot);
39 | return itemContentSlots;
40 | });
41 | }
42 |
43 | destroy() {
44 | // clear slots
45 | this.state.update(slotPath, (itemContentSlots) => {
46 | return itemContentSlots.filter((slot) => slot !== this.itemSlot);
47 | });
48 | // stop listening to changes
49 | this.onDestroy.forEach((unsubscribe) => unsubscribe());
50 | this.vidoInstance.api.pluginDestroyed('ItemImage');
51 | }
52 |
53 | /**
54 | * This is a slot that will add image to item content
55 | */
56 | itemSlot(vido, props) {
57 | const { html, onChange, update } = vido;
58 |
59 | let imageSource = '';
60 | onChange((modifiedProps) => {
61 | props = modifiedProps;
62 | if (!props || !props.item) return;
63 | if (props.item && props.item[this.options.imageField]) {
64 | imageSource = props.item[this.options.imageField];
65 | }
66 | update();
67 | });
68 |
69 | return (content) =>
70 | imageSource
71 | ? html` ${content}`
77 | : content;
78 | }
79 | }
80 |
81 | /**
82 | * Plugin initialization
83 | */
84 | export function Plugin(options = {}) {
85 | return function initialize(vidoInstance) {
86 | const currentOptions = vidoInstance.state.get(pluginPath);
87 | if (currentOptions) {
88 | options = vidoInstance.api.mergeDeep({}, options, currentOptions);
89 | }
90 | const itemImage = new ItemImage(options, vidoInstance);
91 | vidoInstance.api.pluginInitialized('ItemImage');
92 | return itemImage.destroy;
93 | };
94 | }
95 |
--------------------------------------------------------------------------------
/dist/plugins/selection.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Selection plugin
3 | *
4 | * @header --gstc--header--
5 | */
6 | import { ITEM, ITEM_TYPE, CELL, CELL_TYPE, TimelinePointerPoint, TimelinePointerState } from './timeline-pointer';
7 | import type { Item, GridCell, Vido } from '../gstc';
8 | export type ModKey = 'shift' | 'ctrl' | 'alt' | '';
9 | export interface SelectionItems {
10 | [key: string]: Item[];
11 | }
12 | export interface SelectState {
13 | selecting?: SelectionItems;
14 | selected?: SelectionItems;
15 | }
16 | export interface Events {
17 | onStart?: (lastSelected: EventSelection) => void;
18 | onSelecting?: (selecting: EventSelection, last: EventSelection) => EventSelection;
19 | onEnd?: (selected: EventSelection, last: EventSelection) => EventSelection;
20 | }
21 | export interface Options {
22 | enabled?: boolean;
23 | cells?: boolean;
24 | items?: boolean;
25 | showOverlay?: boolean;
26 | rectangularSelection?: boolean;
27 | multipleSelection?: boolean;
28 | selectKey?: ModKey;
29 | multiKey?: ModKey;
30 | selectedClassName?: string;
31 | selectingClassName?: string;
32 | bodySelectedClassName?: string;
33 | bodySelectingClassName?: string;
34 | events?: Events;
35 | pointerEvents?: PointerEvents;
36 | /**
37 | * @deprecated use `events.onStart`
38 | */
39 | onStart?: (lastSelected: EventSelection) => void;
40 | /**
41 | * @deprecated use `events.onSelecting`
42 | */
43 | onSelecting?: (selecting: EventSelection, last: EventSelection) => EventSelection;
44 | /**
45 | * @deprecated use `events.onEnd`
46 | */
47 | onSelected?: (selected: EventSelection, last: EventSelection) => EventSelection;
48 | }
49 | export interface Area {
50 | x: number;
51 | y: number;
52 | width: number;
53 | height: number;
54 | }
55 | export interface Selection {
56 | [CELL]: string[];
57 | [ITEM]: string[];
58 | }
59 | export type GridCellOrId = GridCell | string;
60 | export type ItemOrId = Item | string;
61 | export interface EventSelection {
62 | [CELL]: GridCellOrId[];
63 | [ITEM]: ItemOrId[];
64 | }
65 | export interface SelectedCell {
66 | rowId: string;
67 | cellId: string;
68 | }
69 | export interface PointerEvents {
70 | down: PointerEvent | null;
71 | move: PointerEvent | null;
72 | up: PointerEvent | null;
73 | }
74 | export interface PluginData extends Options {
75 | enabled: boolean;
76 | isSelecting: boolean;
77 | showOverlay: boolean;
78 | pointerState: TimelinePointerState;
79 | initialPosition: TimelinePointerPoint;
80 | currentPosition: TimelinePointerPoint;
81 | selectionAreaLocal: Area;
82 | selectionAreaGlobal: Area;
83 | selected: Selection;
84 | lastSelected: Selection;
85 | selecting: Selection;
86 | lastSelecting: Selection;
87 | automaticallySelected: Selection;
88 | pointerEvents: PointerEvents;
89 | events: Events;
90 | targetType: ITEM_TYPE | CELL_TYPE | '';
91 | targetData: any;
92 | }
93 | export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
94 | //# sourceMappingURL=selection.d.ts.map
--------------------------------------------------------------------------------
/dist/plugins/selection.esm.min.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Selection plugin
3 | *
4 | * @header --gstc--header--
5 | */
6 | import { ITEM, ITEM_TYPE, CELL, CELL_TYPE, TimelinePointerPoint, TimelinePointerState } from './timeline-pointer';
7 | import type { Item, GridCell, Vido } from '../gstc';
8 | export type ModKey = 'shift' | 'ctrl' | 'alt' | '';
9 | export interface SelectionItems {
10 | [key: string]: Item[];
11 | }
12 | export interface SelectState {
13 | selecting?: SelectionItems;
14 | selected?: SelectionItems;
15 | }
16 | export interface Events {
17 | onStart?: (lastSelected: EventSelection) => void;
18 | onSelecting?: (selecting: EventSelection, last: EventSelection) => EventSelection;
19 | onEnd?: (selected: EventSelection, last: EventSelection) => EventSelection;
20 | }
21 | export interface Options {
22 | enabled?: boolean;
23 | cells?: boolean;
24 | items?: boolean;
25 | showOverlay?: boolean;
26 | rectangularSelection?: boolean;
27 | multipleSelection?: boolean;
28 | selectKey?: ModKey;
29 | multiKey?: ModKey;
30 | selectedClassName?: string;
31 | selectingClassName?: string;
32 | bodySelectedClassName?: string;
33 | bodySelectingClassName?: string;
34 | events?: Events;
35 | pointerEvents?: PointerEvents;
36 | /**
37 | * @deprecated use `events.onStart`
38 | */
39 | onStart?: (lastSelected: EventSelection) => void;
40 | /**
41 | * @deprecated use `events.onSelecting`
42 | */
43 | onSelecting?: (selecting: EventSelection, last: EventSelection) => EventSelection;
44 | /**
45 | * @deprecated use `events.onEnd`
46 | */
47 | onSelected?: (selected: EventSelection, last: EventSelection) => EventSelection;
48 | }
49 | export interface Area {
50 | x: number;
51 | y: number;
52 | width: number;
53 | height: number;
54 | }
55 | export interface Selection {
56 | [CELL]: string[];
57 | [ITEM]: string[];
58 | }
59 | export type GridCellOrId = GridCell | string;
60 | export type ItemOrId = Item | string;
61 | export interface EventSelection {
62 | [CELL]: GridCellOrId[];
63 | [ITEM]: ItemOrId[];
64 | }
65 | export interface SelectedCell {
66 | rowId: string;
67 | cellId: string;
68 | }
69 | export interface PointerEvents {
70 | down: PointerEvent | null;
71 | move: PointerEvent | null;
72 | up: PointerEvent | null;
73 | }
74 | export interface PluginData extends Options {
75 | enabled: boolean;
76 | isSelecting: boolean;
77 | showOverlay: boolean;
78 | pointerState: TimelinePointerState;
79 | initialPosition: TimelinePointerPoint;
80 | currentPosition: TimelinePointerPoint;
81 | selectionAreaLocal: Area;
82 | selectionAreaGlobal: Area;
83 | selected: Selection;
84 | lastSelected: Selection;
85 | selecting: Selection;
86 | lastSelecting: Selection;
87 | automaticallySelected: Selection;
88 | pointerEvents: PointerEvents;
89 | events: Events;
90 | targetType: ITEM_TYPE | CELL_TYPE | '';
91 | targetData: any;
92 | }
93 | export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
94 | //# sourceMappingURL=selection.d.ts.map
--------------------------------------------------------------------------------
/dist/plugins/selection.umd.min.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Selection plugin
3 | *
4 | * @header --gstc--header--
5 | */
6 | import { ITEM, ITEM_TYPE, CELL, CELL_TYPE, TimelinePointerPoint, TimelinePointerState } from './timeline-pointer';
7 | import type { Item, GridCell, Vido } from '../gstc';
8 | export type ModKey = 'shift' | 'ctrl' | 'alt' | '';
9 | export interface SelectionItems {
10 | [key: string]: Item[];
11 | }
12 | export interface SelectState {
13 | selecting?: SelectionItems;
14 | selected?: SelectionItems;
15 | }
16 | export interface Events {
17 | onStart?: (lastSelected: EventSelection) => void;
18 | onSelecting?: (selecting: EventSelection, last: EventSelection) => EventSelection;
19 | onEnd?: (selected: EventSelection, last: EventSelection) => EventSelection;
20 | }
21 | export interface Options {
22 | enabled?: boolean;
23 | cells?: boolean;
24 | items?: boolean;
25 | showOverlay?: boolean;
26 | rectangularSelection?: boolean;
27 | multipleSelection?: boolean;
28 | selectKey?: ModKey;
29 | multiKey?: ModKey;
30 | selectedClassName?: string;
31 | selectingClassName?: string;
32 | bodySelectedClassName?: string;
33 | bodySelectingClassName?: string;
34 | events?: Events;
35 | pointerEvents?: PointerEvents;
36 | /**
37 | * @deprecated use `events.onStart`
38 | */
39 | onStart?: (lastSelected: EventSelection) => void;
40 | /**
41 | * @deprecated use `events.onSelecting`
42 | */
43 | onSelecting?: (selecting: EventSelection, last: EventSelection) => EventSelection;
44 | /**
45 | * @deprecated use `events.onEnd`
46 | */
47 | onSelected?: (selected: EventSelection, last: EventSelection) => EventSelection;
48 | }
49 | export interface Area {
50 | x: number;
51 | y: number;
52 | width: number;
53 | height: number;
54 | }
55 | export interface Selection {
56 | [CELL]: string[];
57 | [ITEM]: string[];
58 | }
59 | export type GridCellOrId = GridCell | string;
60 | export type ItemOrId = Item | string;
61 | export interface EventSelection {
62 | [CELL]: GridCellOrId[];
63 | [ITEM]: ItemOrId[];
64 | }
65 | export interface SelectedCell {
66 | rowId: string;
67 | cellId: string;
68 | }
69 | export interface PointerEvents {
70 | down: PointerEvent | null;
71 | move: PointerEvent | null;
72 | up: PointerEvent | null;
73 | }
74 | export interface PluginData extends Options {
75 | enabled: boolean;
76 | isSelecting: boolean;
77 | showOverlay: boolean;
78 | pointerState: TimelinePointerState;
79 | initialPosition: TimelinePointerPoint;
80 | currentPosition: TimelinePointerPoint;
81 | selectionAreaLocal: Area;
82 | selectionAreaGlobal: Area;
83 | selected: Selection;
84 | lastSelected: Selection;
85 | selecting: Selection;
86 | lastSelecting: Selection;
87 | automaticallySelected: Selection;
88 | pointerEvents: PointerEvents;
89 | events: Events;
90 | targetType: ITEM_TYPE | CELL_TYPE | '';
91 | targetData: any;
92 | }
93 | export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
94 | //# sourceMappingURL=selection.d.ts.map
--------------------------------------------------------------------------------
/dist/plugins/timeline-pointer.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * TimelinePointer plugin
3 | *
4 | * @header --gstc--header--
5 | */
6 | import type { Vido } from '../gstc';
7 | export declare const CELL = "chart-timeline-grid-row-cell";
8 | export type CELL_TYPE = 'chart-timeline-grid-row-cell';
9 | export declare const ITEM = "chart-timeline-items-row-item";
10 | export type ITEM_TYPE = 'chart-timeline-items-row-item';
11 | export type SELECTION_TYPE = typeof CELL | typeof ITEM;
12 | export interface TimelinePointerEvents {
13 | down: PointerEvent | null;
14 | move: PointerEvent | null;
15 | up: PointerEvent | null;
16 | }
17 | export interface TimelinePointerPoint {
18 | x: number;
19 | y: number;
20 | }
21 | export type TimelinePointerState = 'up' | 'down' | 'move';
22 | export interface TimelinePointerCaptureEvents {
23 | up?: boolean;
24 | down?: boolean;
25 | move?: boolean;
26 | }
27 | export interface TimelinePointerLocked {
28 | up: boolean | string;
29 | down: boolean | string;
30 | move: boolean | string;
31 | }
32 | export interface Options {
33 | enabled?: boolean;
34 | captureEvents?: TimelinePointerCaptureEvents;
35 | }
36 | export interface TimelinePointerOffset {
37 | top: number;
38 | left: number;
39 | }
40 | export interface Movement {
41 | x: number;
42 | y: number;
43 | }
44 | export type TargetType = ITEM_TYPE | CELL_TYPE | '';
45 | export interface PluginData extends Options {
46 | isMoving: boolean;
47 | pointerState: TimelinePointerState;
48 | currentTarget: HTMLElement | null;
49 | realTarget: HTMLElement | null;
50 | targetType: TargetType;
51 | targetData: any | null;
52 | events: TimelinePointerEvents;
53 | initialPosition: TimelinePointerPoint;
54 | currentPosition: TimelinePointerPoint;
55 | initialPositionOrigin: TimelinePointerPoint;
56 | currentPositionOrigin: TimelinePointerPoint;
57 | movement: Movement;
58 | }
59 | export interface ScrollPosPx {
60 | horizontal: number;
61 | vertical: number;
62 | }
63 | export interface TimelinePointerEvent {
64 | type: TimelinePointerState;
65 | originalEvent: PointerEvent;
66 | targetElement: HTMLElement;
67 | targetData: any;
68 | targetType: TargetType;
69 | initialScrollPosPx: ScrollPosPx;
70 | initialScrollOffset: TimelinePointerOffset;
71 | initialPositionOrigin: TimelinePointerPoint;
72 | currentPositionOrigin: TimelinePointerPoint;
73 | initialPosition: TimelinePointerPoint;
74 | currentPosition: TimelinePointerPoint;
75 | movement: Movement;
76 | isMoving: boolean;
77 | allEvents: TimelinePointerEvents;
78 | }
79 | export type PointerListener = (event: TimelinePointerEvent) => void;
80 | export interface ApiPointerListeners {
81 | down: Set;
82 | move: Set;
83 | up: Set;
84 | }
85 | export type AddPointerListener = (type: TimelinePointerState, callback: PointerListener) => void;
86 | export type RemovePointerListener = (type: TimelinePointerState, callback: PointerListener) => void;
87 | export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
88 | //# sourceMappingURL=timeline-pointer.d.ts.map
--------------------------------------------------------------------------------
/dist/plugins/timeline-pointer.esm.min.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * TimelinePointer plugin
3 | *
4 | * @header --gstc--header--
5 | */
6 | import type { Vido } from '../gstc';
7 | export declare const CELL = "chart-timeline-grid-row-cell";
8 | export type CELL_TYPE = 'chart-timeline-grid-row-cell';
9 | export declare const ITEM = "chart-timeline-items-row-item";
10 | export type ITEM_TYPE = 'chart-timeline-items-row-item';
11 | export type SELECTION_TYPE = typeof CELL | typeof ITEM;
12 | export interface TimelinePointerEvents {
13 | down: PointerEvent | null;
14 | move: PointerEvent | null;
15 | up: PointerEvent | null;
16 | }
17 | export interface TimelinePointerPoint {
18 | x: number;
19 | y: number;
20 | }
21 | export type TimelinePointerState = 'up' | 'down' | 'move';
22 | export interface TimelinePointerCaptureEvents {
23 | up?: boolean;
24 | down?: boolean;
25 | move?: boolean;
26 | }
27 | export interface TimelinePointerLocked {
28 | up: boolean | string;
29 | down: boolean | string;
30 | move: boolean | string;
31 | }
32 | export interface Options {
33 | enabled?: boolean;
34 | captureEvents?: TimelinePointerCaptureEvents;
35 | }
36 | export interface TimelinePointerOffset {
37 | top: number;
38 | left: number;
39 | }
40 | export interface Movement {
41 | x: number;
42 | y: number;
43 | }
44 | export type TargetType = ITEM_TYPE | CELL_TYPE | '';
45 | export interface PluginData extends Options {
46 | isMoving: boolean;
47 | pointerState: TimelinePointerState;
48 | currentTarget: HTMLElement | null;
49 | realTarget: HTMLElement | null;
50 | targetType: TargetType;
51 | targetData: any | null;
52 | events: TimelinePointerEvents;
53 | initialPosition: TimelinePointerPoint;
54 | currentPosition: TimelinePointerPoint;
55 | initialPositionOrigin: TimelinePointerPoint;
56 | currentPositionOrigin: TimelinePointerPoint;
57 | movement: Movement;
58 | }
59 | export interface ScrollPosPx {
60 | horizontal: number;
61 | vertical: number;
62 | }
63 | export interface TimelinePointerEvent {
64 | type: TimelinePointerState;
65 | originalEvent: PointerEvent;
66 | targetElement: HTMLElement;
67 | targetData: any;
68 | targetType: TargetType;
69 | initialScrollPosPx: ScrollPosPx;
70 | initialScrollOffset: TimelinePointerOffset;
71 | initialPositionOrigin: TimelinePointerPoint;
72 | currentPositionOrigin: TimelinePointerPoint;
73 | initialPosition: TimelinePointerPoint;
74 | currentPosition: TimelinePointerPoint;
75 | movement: Movement;
76 | isMoving: boolean;
77 | allEvents: TimelinePointerEvents;
78 | }
79 | export type PointerListener = (event: TimelinePointerEvent) => void;
80 | export interface ApiPointerListeners {
81 | down: Set;
82 | move: Set;
83 | up: Set;
84 | }
85 | export type AddPointerListener = (type: TimelinePointerState, callback: PointerListener) => void;
86 | export type RemovePointerListener = (type: TimelinePointerState, callback: PointerListener) => void;
87 | export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
88 | //# sourceMappingURL=timeline-pointer.d.ts.map
--------------------------------------------------------------------------------
/dist/plugins/timeline-pointer.umd.min.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * TimelinePointer plugin
3 | *
4 | * @header --gstc--header--
5 | */
6 | import type { Vido } from '../gstc';
7 | export declare const CELL = "chart-timeline-grid-row-cell";
8 | export type CELL_TYPE = 'chart-timeline-grid-row-cell';
9 | export declare const ITEM = "chart-timeline-items-row-item";
10 | export type ITEM_TYPE = 'chart-timeline-items-row-item';
11 | export type SELECTION_TYPE = typeof CELL | typeof ITEM;
12 | export interface TimelinePointerEvents {
13 | down: PointerEvent | null;
14 | move: PointerEvent | null;
15 | up: PointerEvent | null;
16 | }
17 | export interface TimelinePointerPoint {
18 | x: number;
19 | y: number;
20 | }
21 | export type TimelinePointerState = 'up' | 'down' | 'move';
22 | export interface TimelinePointerCaptureEvents {
23 | up?: boolean;
24 | down?: boolean;
25 | move?: boolean;
26 | }
27 | export interface TimelinePointerLocked {
28 | up: boolean | string;
29 | down: boolean | string;
30 | move: boolean | string;
31 | }
32 | export interface Options {
33 | enabled?: boolean;
34 | captureEvents?: TimelinePointerCaptureEvents;
35 | }
36 | export interface TimelinePointerOffset {
37 | top: number;
38 | left: number;
39 | }
40 | export interface Movement {
41 | x: number;
42 | y: number;
43 | }
44 | export type TargetType = ITEM_TYPE | CELL_TYPE | '';
45 | export interface PluginData extends Options {
46 | isMoving: boolean;
47 | pointerState: TimelinePointerState;
48 | currentTarget: HTMLElement | null;
49 | realTarget: HTMLElement | null;
50 | targetType: TargetType;
51 | targetData: any | null;
52 | events: TimelinePointerEvents;
53 | initialPosition: TimelinePointerPoint;
54 | currentPosition: TimelinePointerPoint;
55 | initialPositionOrigin: TimelinePointerPoint;
56 | currentPositionOrigin: TimelinePointerPoint;
57 | movement: Movement;
58 | }
59 | export interface ScrollPosPx {
60 | horizontal: number;
61 | vertical: number;
62 | }
63 | export interface TimelinePointerEvent {
64 | type: TimelinePointerState;
65 | originalEvent: PointerEvent;
66 | targetElement: HTMLElement;
67 | targetData: any;
68 | targetType: TargetType;
69 | initialScrollPosPx: ScrollPosPx;
70 | initialScrollOffset: TimelinePointerOffset;
71 | initialPositionOrigin: TimelinePointerPoint;
72 | currentPositionOrigin: TimelinePointerPoint;
73 | initialPosition: TimelinePointerPoint;
74 | currentPosition: TimelinePointerPoint;
75 | movement: Movement;
76 | isMoving: boolean;
77 | allEvents: TimelinePointerEvents;
78 | }
79 | export type PointerListener = (event: TimelinePointerEvent) => void;
80 | export interface ApiPointerListeners {
81 | down: Set;
82 | move: Set;
83 | up: Set;
84 | }
85 | export type AddPointerListener = (type: TimelinePointerState, callback: PointerListener) => void;
86 | export type RemovePointerListener = (type: TimelinePointerState, callback: PointerListener) => void;
87 | export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
88 | //# sourceMappingURL=timeline-pointer.d.ts.map
--------------------------------------------------------------------------------
/dist/plugins/calendar-scroll.umd.min.js:
--------------------------------------------------------------------------------
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
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.41.2
11 | * @released 2025-09-10
12 | * @license SEE LICENSE IN LICENSE FILE
13 | */const e={enabled:!0,bodyClassName:["gstc-scrolling","gstc-cursor-grabbing"]};t.Plugin=function(t=e){let i,n,o,s=t.enabled;class a{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;t.bodyClassName&&(Array.isArray(t.bodyClassName)?document.body.classList.add(...t.bodyClassName):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&&(t.bodyClassName&&(Array.isArray(t.bodyClassName)?document.body.classList.remove(...t.bodyClassName):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 a,r=this.initialDataIndex.x-1,l=0;for(;r>0&&(a=o[r],l+=a.width,!(l>=t.x));r--);let d=0;a&&(d=a.leftPx),s.byPixels?n.setScrollLeft(d):n.setScrollLeft(r)}else if(t.x<0){let a=this.initialDataIndex.x;const r=o.get("$data.scroll.horizontal"),l=i.allDates[i.level];if(a-1>=l.length-r.lastPageCount)return this.resetInitialPoint(e);let d,c=0;for(let e=l.length;a=l.length-r.lastPageCount)return;let h=0;d&&(h=d.leftPx),s.byPixels?n.setScrollLeft(h):n.setScrollLeft(a)}}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",l=e.state.get(r);return l&&(t=n.mergeDeep({},t,l)),o.update(r,t),o.subscribe("config.plugin.CalendarScroll.enabled",t=>s=t),o.update("config.actions.chart-calendar",t=>(t.push(a),t)),n.pluginInitialized("CalendarScroll"),function(){o.update("config.actions.chart-calendar",t=>t.filter(t=>t!==a)),n.pluginDestroyed("CalendarScroll")}}},Object.defineProperty(t,"__esModule",{value:!0})});
--------------------------------------------------------------------------------
/dist/plugins/item-resizing.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * ItemResizing plugin
3 | *
4 | * @header --gstc--header--
5 | */
6 | import type { Vido, htmlResult, Item, DataChartTime, DataItems, DataScrollHorizontal } from '../gstc';
7 | import type DeepState from 'deep-state-observer';
8 | import type { Dayjs } from 'dayjs';
9 | export interface Handle {
10 | width?: number;
11 | outsideWidth?: number;
12 | horizontalMargin?: number;
13 | outsideHorizontalMargin?: number;
14 | verticalMargin?: number;
15 | outside?: boolean;
16 | onlyWhenSelected?: boolean;
17 | }
18 | export interface SnapArg {
19 | item: Item;
20 | time: DataChartTime;
21 | vido: Vido;
22 | movement: Movement;
23 | }
24 | export interface SnapStartArg extends SnapArg {
25 | startTime: Dayjs;
26 | }
27 | export interface SnapEndArg extends SnapArg {
28 | endTime: Dayjs;
29 | }
30 | export interface Movement {
31 | px: number;
32 | time: number;
33 | }
34 | export interface SnapToTime {
35 | start?: (snapStartArgs: SnapStartArg) => Dayjs;
36 | end?: (snapEndArgs: SnapEndArg) => Dayjs;
37 | }
38 | export interface BeforeAfterInitialItems {
39 | initial: Item[];
40 | before: Item[];
41 | after: Item[];
42 | }
43 | export interface OnArg {
44 | items: BeforeAfterInitialItems;
45 | addedDependantIds: string[];
46 | selectedIds: string[];
47 | vido: Vido;
48 | state: DeepState;
49 | time: DataChartTime;
50 | }
51 | export interface Events {
52 | onStart?: (onArg: OnArg) => Item[];
53 | onResize?: (onArg: OnArg) => Item[];
54 | onEnd?: (onArg: OnArg) => Item[];
55 | }
56 | export interface AutoScroll {
57 | speed?: number;
58 | timeout?: number;
59 | edgeThreshold?: number;
60 | }
61 | export interface HandleContentObject {
62 | left: htmlResult;
63 | right: htmlResult;
64 | }
65 | export type HandleContentFunctionArgument = {
66 | item: Item;
67 | vido: Vido;
68 | };
69 | export type HandleContentFunction = (arg: HandleContentFunctionArgument) => HandleContentObject;
70 | export type HandleContent = HandleContentObject | HandleContentFunction | htmlResult;
71 | export interface Options {
72 | enabled?: boolean;
73 | dependant?: boolean;
74 | debug?: boolean;
75 | handle?: Handle;
76 | content?: HandleContent;
77 | bodyClass?: string;
78 | bodyClassLeft?: string;
79 | bodyClassRight?: string;
80 | events?: Events;
81 | snapToTime?: SnapToTime;
82 | outsideWidthThreshold?: number;
83 | autoScroll?: AutoScroll;
84 | ignoreMissingDates?: boolean;
85 | allowItemsToGoOutsideTheArea?: boolean;
86 | threshold?: number;
87 | shouldMuteNotNeededMethods?: boolean;
88 | }
89 | export type State = 'start' | 'resize' | 'end' | '';
90 | export interface PluginData extends Options {
91 | leftIsMoving: boolean;
92 | rightIsMoving: boolean;
93 | initialItems: Item[];
94 | initialItemsData: DataItems;
95 | addedDependantIds: string[];
96 | selectedIds: string[];
97 | initialHorizontalScroll: DataScrollHorizontal;
98 | state: State;
99 | movement: Movement;
100 | thresholdReached: boolean;
101 | }
102 | export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
103 | //# sourceMappingURL=item-resizing.d.ts.map
--------------------------------------------------------------------------------
/dist/plugins/item-resizing.esm.min.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * ItemResizing plugin
3 | *
4 | * @header --gstc--header--
5 | */
6 | import type { Vido, htmlResult, Item, DataChartTime, DataItems, DataScrollHorizontal } from '../gstc';
7 | import type DeepState from 'deep-state-observer';
8 | import type { Dayjs } from 'dayjs';
9 | export interface Handle {
10 | width?: number;
11 | outsideWidth?: number;
12 | horizontalMargin?: number;
13 | outsideHorizontalMargin?: number;
14 | verticalMargin?: number;
15 | outside?: boolean;
16 | onlyWhenSelected?: boolean;
17 | }
18 | export interface SnapArg {
19 | item: Item;
20 | time: DataChartTime;
21 | vido: Vido;
22 | movement: Movement;
23 | }
24 | export interface SnapStartArg extends SnapArg {
25 | startTime: Dayjs;
26 | }
27 | export interface SnapEndArg extends SnapArg {
28 | endTime: Dayjs;
29 | }
30 | export interface Movement {
31 | px: number;
32 | time: number;
33 | }
34 | export interface SnapToTime {
35 | start?: (snapStartArgs: SnapStartArg) => Dayjs;
36 | end?: (snapEndArgs: SnapEndArg) => Dayjs;
37 | }
38 | export interface BeforeAfterInitialItems {
39 | initial: Item[];
40 | before: Item[];
41 | after: Item[];
42 | }
43 | export interface OnArg {
44 | items: BeforeAfterInitialItems;
45 | addedDependantIds: string[];
46 | selectedIds: string[];
47 | vido: Vido;
48 | state: DeepState;
49 | time: DataChartTime;
50 | }
51 | export interface Events {
52 | onStart?: (onArg: OnArg) => Item[];
53 | onResize?: (onArg: OnArg) => Item[];
54 | onEnd?: (onArg: OnArg) => Item[];
55 | }
56 | export interface AutoScroll {
57 | speed?: number;
58 | timeout?: number;
59 | edgeThreshold?: number;
60 | }
61 | export interface HandleContentObject {
62 | left: htmlResult;
63 | right: htmlResult;
64 | }
65 | export type HandleContentFunctionArgument = {
66 | item: Item;
67 | vido: Vido;
68 | };
69 | export type HandleContentFunction = (arg: HandleContentFunctionArgument) => HandleContentObject;
70 | export type HandleContent = HandleContentObject | HandleContentFunction | htmlResult;
71 | export interface Options {
72 | enabled?: boolean;
73 | dependant?: boolean;
74 | debug?: boolean;
75 | handle?: Handle;
76 | content?: HandleContent;
77 | bodyClass?: string;
78 | bodyClassLeft?: string;
79 | bodyClassRight?: string;
80 | events?: Events;
81 | snapToTime?: SnapToTime;
82 | outsideWidthThreshold?: number;
83 | autoScroll?: AutoScroll;
84 | ignoreMissingDates?: boolean;
85 | allowItemsToGoOutsideTheArea?: boolean;
86 | threshold?: number;
87 | shouldMuteNotNeededMethods?: boolean;
88 | }
89 | export type State = 'start' | 'resize' | 'end' | '';
90 | export interface PluginData extends Options {
91 | leftIsMoving: boolean;
92 | rightIsMoving: boolean;
93 | initialItems: Item[];
94 | initialItemsData: DataItems;
95 | addedDependantIds: string[];
96 | selectedIds: string[];
97 | initialHorizontalScroll: DataScrollHorizontal;
98 | state: State;
99 | movement: Movement;
100 | thresholdReached: boolean;
101 | }
102 | export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
103 | //# sourceMappingURL=item-resizing.d.ts.map
--------------------------------------------------------------------------------
/dist/plugins/item-resizing.umd.min.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * ItemResizing plugin
3 | *
4 | * @header --gstc--header--
5 | */
6 | import type { Vido, htmlResult, Item, DataChartTime, DataItems, DataScrollHorizontal } from '../gstc';
7 | import type DeepState from 'deep-state-observer';
8 | import type { Dayjs } from 'dayjs';
9 | export interface Handle {
10 | width?: number;
11 | outsideWidth?: number;
12 | horizontalMargin?: number;
13 | outsideHorizontalMargin?: number;
14 | verticalMargin?: number;
15 | outside?: boolean;
16 | onlyWhenSelected?: boolean;
17 | }
18 | export interface SnapArg {
19 | item: Item;
20 | time: DataChartTime;
21 | vido: Vido;
22 | movement: Movement;
23 | }
24 | export interface SnapStartArg extends SnapArg {
25 | startTime: Dayjs;
26 | }
27 | export interface SnapEndArg extends SnapArg {
28 | endTime: Dayjs;
29 | }
30 | export interface Movement {
31 | px: number;
32 | time: number;
33 | }
34 | export interface SnapToTime {
35 | start?: (snapStartArgs: SnapStartArg) => Dayjs;
36 | end?: (snapEndArgs: SnapEndArg) => Dayjs;
37 | }
38 | export interface BeforeAfterInitialItems {
39 | initial: Item[];
40 | before: Item[];
41 | after: Item[];
42 | }
43 | export interface OnArg {
44 | items: BeforeAfterInitialItems;
45 | addedDependantIds: string[];
46 | selectedIds: string[];
47 | vido: Vido;
48 | state: DeepState;
49 | time: DataChartTime;
50 | }
51 | export interface Events {
52 | onStart?: (onArg: OnArg) => Item[];
53 | onResize?: (onArg: OnArg) => Item[];
54 | onEnd?: (onArg: OnArg) => Item[];
55 | }
56 | export interface AutoScroll {
57 | speed?: number;
58 | timeout?: number;
59 | edgeThreshold?: number;
60 | }
61 | export interface HandleContentObject {
62 | left: htmlResult;
63 | right: htmlResult;
64 | }
65 | export type HandleContentFunctionArgument = {
66 | item: Item;
67 | vido: Vido;
68 | };
69 | export type HandleContentFunction = (arg: HandleContentFunctionArgument) => HandleContentObject;
70 | export type HandleContent = HandleContentObject | HandleContentFunction | htmlResult;
71 | export interface Options {
72 | enabled?: boolean;
73 | dependant?: boolean;
74 | debug?: boolean;
75 | handle?: Handle;
76 | content?: HandleContent;
77 | bodyClass?: string;
78 | bodyClassLeft?: string;
79 | bodyClassRight?: string;
80 | events?: Events;
81 | snapToTime?: SnapToTime;
82 | outsideWidthThreshold?: number;
83 | autoScroll?: AutoScroll;
84 | ignoreMissingDates?: boolean;
85 | allowItemsToGoOutsideTheArea?: boolean;
86 | threshold?: number;
87 | shouldMuteNotNeededMethods?: boolean;
88 | }
89 | export type State = 'start' | 'resize' | 'end' | '';
90 | export interface PluginData extends Options {
91 | leftIsMoving: boolean;
92 | rightIsMoving: boolean;
93 | initialItems: Item[];
94 | initialItemsData: DataItems;
95 | addedDependantIds: string[];
96 | selectedIds: string[];
97 | initialHorizontalScroll: DataScrollHorizontal;
98 | state: State;
99 | movement: Movement;
100 | thresholdReached: boolean;
101 | }
102 | export declare function Plugin(options?: Options): (vidoInstance: Vido) => () => void;
103 | //# sourceMappingURL=item-resizing.d.ts.map
--------------------------------------------------------------------------------
/cypress/e2e/locale.test.ts:
--------------------------------------------------------------------------------
1 | function plural(n) {
2 | return n % 10 < 5 && n % 10 > 1 && ~~(n / 10) % 10 !== 1; // eslint-disable-line
3 | }
4 | /* eslint-disable */
5 | function translate(number, withoutSuffix, key) {
6 | const result = `${number} `;
7 | switch (key) {
8 | case 'm':
9 | return withoutSuffix ? 'minuta' : 'minutę';
10 | case 'mm':
11 | return result + (plural(number) ? 'minuty' : 'minut');
12 | case 'h':
13 | return withoutSuffix ? 'godzina' : 'godzinę';
14 | case 'hh':
15 | return result + (plural(number) ? 'godziny' : 'godzin');
16 | case 'MM':
17 | return result + (plural(number) ? 'miesiące' : 'miesięcy');
18 | case 'yy':
19 | return result + (plural(number) ? 'lata' : 'lat');
20 | }
21 | }
22 | /* eslint-enable */
23 |
24 | const monthFormat =
25 | 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split('_');
26 | const monthStandalone =
27 | 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split('_');
28 | const MONTHS_IN_FORMAT = /D MMMM/;
29 |
30 | const months = (dayjsInstance, format) => {
31 | if (MONTHS_IN_FORMAT.test(format)) {
32 | return monthFormat[dayjsInstance.month()];
33 | }
34 | return monthStandalone[dayjsInstance.month()];
35 | };
36 | months.s = monthStandalone;
37 | months.f = monthFormat;
38 |
39 | const locale = {
40 | name: 'pl',
41 | weekdays: 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split('_'),
42 | weekdaysShort: 'ndz_pon_wt_śr_czw_pt_sob'.split('_'),
43 | weekdaysMin: 'Nd_Pn_Wt_Śr_Cz_Pt_So'.split('_'),
44 | months,
45 | monthsShort: 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'),
46 | ordinal: (n) => `${n}.`,
47 | weekStart: 1,
48 | yearStart: 4,
49 | relativeTime: {
50 | future: 'za %s',
51 | past: '%s temu',
52 | s: 'kilka sekund',
53 | m: translate,
54 | mm: translate,
55 | h: translate,
56 | hh: translate,
57 | d: '1 dzień',
58 | dd: '%d dni',
59 | M: 'miesiąc',
60 | MM: translate,
61 | y: 'rok',
62 | yy: translate,
63 | },
64 | formats: {
65 | LT: 'HH:mm',
66 | LTS: 'HH:mm:ss',
67 | L: 'DD.MM.YYYY',
68 | LL: 'D MMMM YYYY',
69 | LLL: 'D MMMM YYYY HH:mm',
70 | LLLL: 'dddd, D MMMM YYYY HH:mm',
71 | },
72 | };
73 |
74 | describe('Locale', () => {
75 | it('should update and display locale configuration', () => {
76 | let state;
77 | cy.load('/examples/complex-1')
78 | .window()
79 | .then((win) => {
80 | // @ts-ignore
81 | state = win.state;
82 | expect(state.get('config.locale.weekdays.6')).to.eq('Saturday');
83 | })
84 | .get('.gstc__chart-calendar-date[data-gstcid="gstcid-1580511600000"] .gstc-date-small')
85 | .should('be.visible')
86 | .then(($el) => {
87 | expect($el.text()).to.eq('Saturday');
88 | state.update('config.locale', locale);
89 | })
90 | .wait(Cypress.env('wait'))
91 | .then(() => {
92 | expect(state.get('config.locale.weekdays.6')).to.eq('sobota');
93 | })
94 | .get('.gstc__chart-calendar-date[data-gstcid="gstcid-1580511600000"] .gstc-date-small')
95 | .should('be.visible')
96 | .wait(Cypress.env('wait'))
97 | .then(($el) => {
98 | // @ts-ignore
99 | expect($el.text()).to.eq('sobota');
100 | });
101 | });
102 | });
103 |
--------------------------------------------------------------------------------
/cypress/e2e/grid-cells.test.ts:
--------------------------------------------------------------------------------
1 | import { DataChartTime } from '../../dist/gstc';
2 | import { fixed } from '../helpers';
3 |
4 | describe('Grid cells', () => {
5 | it('should display grid cell properly', () => {
6 | let gstc, state;
7 | cy.load('/examples/one-month')
8 | .window()
9 | .then((win) => {
10 | // @ts-ignore
11 | gstc = win.gstc;
12 | // @ts-ignore
13 | state = win.state;
14 | })
15 | .log('start')
16 | .then(() => {
17 | const chartTime: DataChartTime = state.get('$data.chart.time');
18 | let cell = Cypress.$('.gstc__chart-timeline-grid-row-cell').get(0);
19 | let date = Cypress.$('.gstc__chart-calendar-date--day').get(0);
20 | let data = chartTime.levels[chartTime.level][0];
21 | expect(fixed(date.style.width)).to.eq(fixed(cell.style.width));
22 | expect(fixed(date.offsetLeft)).to.eq(fixed(cell.offsetLeft));
23 | expect(fixed(data.currentView.width)).to.eq(fixed(date.style.width));
24 | cell = Cypress.$('.gstc__chart-timeline-grid-row-cell').get(20);
25 | date = Cypress.$('.gstc__chart-calendar-date--day').get(20);
26 | data = chartTime.levels[chartTime.level][20];
27 | expect(fixed(date.style.width)).to.eq(fixed(cell.style.width));
28 | expect(fixed(date.offsetLeft)).to.eq(fixed(cell.offsetLeft));
29 | expect(fixed(data.currentView.width)).to.eq(fixed(date.style.width));
30 | })
31 | .log('#btn-next-month click')
32 | .get('#btn-next-month')
33 | .click()
34 | .wait(300)
35 | .then(() => {
36 | const chartTime: DataChartTime = state.get('$data.chart.time');
37 | let cell = Cypress.$('.gstc__chart-timeline-grid-row-cell').get(0);
38 | let date = Cypress.$('.gstc__chart-calendar-date--day').get(0);
39 | let data = chartTime.levels[chartTime.level][0];
40 | expect(fixed(date.style.width)).to.eq(fixed(cell.style.width));
41 | expect(fixed(date.offsetLeft)).to.eq(fixed(cell.offsetLeft));
42 | expect(fixed(data.currentView.width)).to.eq(fixed(date.style.width));
43 | cell = Cypress.$('.gstc__chart-timeline-grid-row-cell').get(20);
44 | date = Cypress.$('.gstc__chart-calendar-date--day').get(20);
45 | data = chartTime.levels[chartTime.level][20];
46 | expect(fixed(date.style.width)).to.eq(fixed(cell.style.width));
47 | expect(fixed(date.offsetLeft)).to.eq(fixed(cell.offsetLeft));
48 | expect(fixed(data.currentView.width)).to.eq(fixed(date.style.width));
49 | })
50 | .log('#btn-prev-month click')
51 | .get('#btn-prev-month')
52 | .click()
53 | .wait(300)
54 | .click()
55 | .wait(300)
56 | .then(() => {
57 | const chartTime: DataChartTime = state.get('$data.chart.time');
58 | let cell = Cypress.$('.gstc__chart-timeline-grid-row-cell').get(0);
59 | let date = Cypress.$('.gstc__chart-calendar-date--day').get(0);
60 | let data = chartTime.levels[chartTime.level][0];
61 | expect(fixed(date.style.width)).to.eq(fixed(cell.style.width));
62 | expect(fixed(date.offsetLeft)).to.eq(fixed(cell.offsetLeft));
63 | expect(fixed(data.currentView.width)).to.eq(fixed(date.style.width));
64 | cell = Cypress.$('.gstc__chart-timeline-grid-row-cell').get(20);
65 | date = Cypress.$('.gstc__chart-calendar-date--day').get(20);
66 | data = chartTime.levels[chartTime.level][20];
67 | expect(fixed(date.style.width)).to.eq(fixed(cell.style.width));
68 | expect(fixed(date.offsetLeft)).to.eq(fixed(cell.offsetLeft));
69 | expect(fixed(data.currentView.width)).to.eq(fixed(date.style.width));
70 | });
71 | });
72 | });
73 |
--------------------------------------------------------------------------------
/examples/plugin-item-image/index.js:
--------------------------------------------------------------------------------
1 | import GSTC from '../../dist/gstc.wasm.esm.min.js';
2 | import { Plugin as ItemImage } from './item-image.js';
3 |
4 | const rowsFromDB = [
5 | {
6 | id: '1',
7 | label: 'Row 1',
8 | },
9 | {
10 | id: '2',
11 | label: 'Row 2',
12 | },
13 | ];
14 |
15 | const itemsFromDB = [
16 | {
17 | id: '1',
18 | label: 'Item 1',
19 | rowId: '1',
20 | time: {
21 | start: GSTC.api.date('2020-01-01').startOf('day').valueOf(),
22 | end: GSTC.api.date('2020-01-02').endOf('day').valueOf(),
23 | },
24 | image: './images/0.jpg',
25 | },
26 | {
27 | id: '2',
28 | label: 'Item 2',
29 | rowId: '1',
30 | time: {
31 | start: GSTC.api.date('2020-02-01').startOf('day').valueOf(),
32 | end: GSTC.api.date('2020-02-02').endOf('day').valueOf(),
33 | },
34 | image: './images/1.jpg',
35 | },
36 | {
37 | id: '3',
38 | label: 'Item 3',
39 | rowId: '2',
40 | time: {
41 | start: GSTC.api.date('2020-01-15').startOf('day').valueOf(),
42 | end: GSTC.api.date('2020-01-20').endOf('day').valueOf(),
43 | },
44 | image: './images/2.jpg',
45 | },
46 | ];
47 |
48 | const columnsFromDB = [
49 | {
50 | id: 'id',
51 | label: 'ID',
52 | data: ({ row }) => GSTC.api.sourceID(row.id), // show original id (not internal GSTCID)
53 | sortable: ({ row }) => Number(GSTC.api.sourceID(row.id)), // sort by id converted to number
54 | width: 80,
55 | header: {
56 | content: 'ID',
57 | },
58 | },
59 | {
60 | id: 'label',
61 | data: 'label',
62 | sortable: 'label',
63 | isHTML: false,
64 | width: 230,
65 | header: {
66 | content: 'Label',
67 | },
68 | },
69 | ];
70 |
71 | // Configuration object
72 |
73 | // Typescript usage:
74 | // import { Config } from 'gantt-schedule-timeline-calendar';
75 | // const config: Config = {...};
76 | /**
77 | * @type {import('../../dist/gstc').Config} // or {import('gantt-schedule-timeline-calendar').Config}
78 | */
79 | const config = {
80 | licenseKey:
81 | '====BEGIN LICENSE KEY====\nXOfH/lnVASM6et4Co473t9jPIvhmQ/l0X3Ewog30VudX6GVkOB0n3oDx42NtADJ8HjYrhfXKSNu5EMRb5KzCLvMt/pu7xugjbvpyI1glE7Ha6E5VZwRpb4AC8T1KBF67FKAgaI7YFeOtPFROSCKrW5la38jbE5fo+q2N6wAfEti8la2ie6/7U2V+SdJPqkm/mLY/JBHdvDHoUduwe4zgqBUYLTNUgX6aKdlhpZPuHfj2SMeB/tcTJfH48rN1mgGkNkAT9ovROwI7ReLrdlHrHmJ1UwZZnAfxAC3ftIjgTEHsd/f+JrjW6t+kL6Ef1tT1eQ2DPFLJlhluTD91AsZMUg==||U2FsdGVkX1/SWWqU9YmxtM0T6Nm5mClKwqTaoF9wgZd9rNw2xs4hnY8Ilv8DZtFyNt92xym3eB6WA605N5llLm0D68EQtU9ci1rTEDopZ1ODzcqtTVSoFEloNPFSfW6LTIC9+2LSVBeeHXoLEQiLYHWihHu10Xll3KsH9iBObDACDm1PT7IV4uWvNpNeuKJc\npY3C5SG+3sHRX1aeMnHlKLhaIsOdw2IexjvMqocVpfRpX4wnsabNA0VJ3k95zUPS3vTtSegeDhwbl6j+/FZcGk9i+gAy6LuetlKuARjPYn2LH5Be3Ah+ggSBPlxf3JW9rtWNdUoFByHTcFlhzlU9HnpnBUrgcVMhCQ7SAjN9h2NMGmCr10Rn4OE0WtelNqYVig7KmENaPvFT+k2I0cYZ4KWwxxsQNKbjEAxJxrzK4HkaczCvyQbzj4Ppxx/0q+Cns44OeyWcwYD/vSaJm4Kptwpr+L4y5BoSO/WeqhSUQQ85nvOhtE0pSH/ZXYo3pqjPdQRfNm6NFeBl2lwTmZUEuw==\n====END LICENSE KEY====',
82 |
83 | list: {
84 | columns: {
85 | data: GSTC.api.fromArray(columnsFromDB),
86 | },
87 | rows: GSTC.api.fromArray(rowsFromDB),
88 | },
89 | chart: {
90 | items: GSTC.api.fromArray(itemsFromDB),
91 | },
92 | plugins: [ItemImage()],
93 | };
94 |
95 | // Generate GSTC state from configuration object
96 | const state = GSTC.api.stateFromConfig(config);
97 |
98 | // for testing
99 | globalThis.state = state;
100 |
101 | const element = document.getElementById('gstc');
102 | if (!element) throw new Error('Element not found');
103 |
104 | // Mount the component
105 | const app = GSTC({
106 | element,
107 | state,
108 | });
109 |
110 | //for testing
111 | globalThis.gstc = app;
112 |
--------------------------------------------------------------------------------
/dist/plugins/time-bookmarks.esm.min.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Gantt-Schedule-Timeline-Calendar helpers
3 | *
4 | * @copyright NEURONET - Rafal Pospiech
5 | * @author Rafal Pospiech
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.41.2
10 | * @released 2025-09-10
11 | * @license SEE LICENSE IN LICENSE FILE
12 | */
13 | const t="gstc";
14 | /**
15 | * TimeBookmarks plugin
16 | *
17 | * @copyright NEURONET - Rafal Pospiech
18 | * @author Rafal Pospiech
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.41.2
23 | * @released 2025-09-10
24 | * @license SEE LICENSE IN LICENSE FILE
25 | */
26 | const s="config.plugin.TimeBookmarks",e="config.slots.chart-timeline-items.outer";class i{constructor(i,a){this.unsub=[],this.options=function(t){return Object.assign({enabled:!0,className:""},t)}(i),this.vido=a,this.state=a.state,this.className=function(s,e=""){let i=`${t}__${s}`;return s===t&&(i=t),e?`${i} ${i}--${e.replace(":","-")}`:i}("chart-time-bookmark")+(this.options.className?` ${this.options.className}`:""),this.PluginTimeBookmarksSlot=this.PluginTimeBookmarksSlot.bind(this),this.destroy=this.destroy.bind(this),this.state.update(s,this.options),this.state.update(e,t=>(t.includes(this.PluginTimeBookmarksSlot)||t.push(this.PluginTimeBookmarksSlot),t)),this.unsub.push(this.state.subscribe(s,t=>this.options=t))}destroy(){this.unsub.forEach(t=>t()),this.state.update(e,t=>t.filter(t=>t!==this.PluginTimeBookmarksSlot)),this.vido.api.pluginDestroyed("TimeBookmarks")}PluginTimeBookmarksSlot(t){const{html:e,onDestroy:i,state:a,update:l,api:o,StyleMap:n}=t,c=[];i(a.subscribeAll([s,"$data.chart.time","$data.scroll.horizontal.dataIndex"],()=>{var t;const e=a.get("$data.chart.time"),i=a.get(s);c.length=0;for(const s in i.bookmarks){const a=o.time.date(i.bookmarks[s].time);if(!o.time.isInCurrentView(a,e))continue;const l=Object.assign(Object.assign({},i.bookmarks[s]),{id:s,leftViewPx:0,absoluteLeftPx:0,visible:!1,date:null,styleMap:new n(Object.assign(null!==(t=i.bookmarks[s].style)&&void 0!==t?t:{},{left:"",height:""}))});l.styleMap.style.background=l.styleMap.style.background||l.color||"#3498DB",l.id=s,l.date=a,l.leftViewPx=o.time.getViewOffsetPxFromDates(a,!1,e),l.absoluteLeftPx=o.time.getGlobalOffsetPxFromDates(l.date,!1,e),l.visible=l.absoluteLeftPx>=e.leftPx&&l.absoluteLeftPx<=e.rightPx,c.push(l)}l()},{group:!0}));let r=0,h=0;i(a.subscribe("$data.scroll.vertical",t=>{r=Math.round(o.getRealChartHeight()),h=Math.round(-t.preciseOffset),l()}));const m=t=>e``,d=t=>e`
38 |
42 | ${t.label}
43 |
44 |
`;return t=>e`
45 | ${c.filter(t=>t.visible).map(t=>m(t))}
46 |
47 | ${t}
48 |
49 | ${c.filter(t=>t.visible).map(t=>d(t))}
50 |
`}}function a(t={}){return function(e){const a=e.state.get(s);a&&(t=e.api.mergeDeep({},t,a));const l=new i(t,e);return e.api.pluginInitialized("TimeBookmarks"),l.destroy}}export{a as Plugin,s as pluginPath,e as slotPath};
--------------------------------------------------------------------------------
/examples/items-content/index.js:
--------------------------------------------------------------------------------
1 | import GSTC from '../../dist/gstc.wasm.esm.min.js';
2 |
3 | const rowsFromDB = [
4 | {
5 | id: '1',
6 | label: 'Row 1',
7 | },
8 | {
9 | id: '2',
10 | label: 'Row 2',
11 | },
12 | ];
13 |
14 | function onItemClick(item) {
15 | alert('Item ' + GSTC.api.sourceID(item.id) + ' clicked!');
16 | }
17 |
18 | function itemLabelContent({ item, vido }) {
19 | return vido.html`
20 | onItemClick(
21 | item
22 | )}> My HTML content here!
`;
23 | }
24 |
25 | const itemsFromDB = [
26 | {
27 | id: '1',
28 | label: itemLabelContent,
29 | rowId: '1',
30 | time: {
31 | start: GSTC.api.date('2020-01-01').startOf('day').valueOf(),
32 | end: GSTC.api.date('2020-01-06').endOf('day').valueOf(),
33 | },
34 | },
35 | {
36 | id: '2',
37 | label: 'Default simple text label here',
38 | rowId: '1',
39 | time: {
40 | start: GSTC.api.date('2020-02-01').startOf('day').valueOf(),
41 | end: GSTC.api.date('2020-02-15').endOf('day').valueOf(),
42 | },
43 | },
44 | {
45 | id: '3',
46 | label: itemLabelContent,
47 | rowId: '2',
48 | time: {
49 | start: GSTC.api.date('2020-01-15').startOf('day').valueOf(),
50 | end: GSTC.api.date('2020-01-20').endOf('day').valueOf(),
51 | },
52 | },
53 | ];
54 |
55 | const columnsFromDB = [
56 | {
57 | id: 'id',
58 | label: 'ID',
59 | data: ({ row }) => Number(GSTC.api.sourceID(row.id)), // show original id
60 | sortable: ({ row }) => Number(GSTC.api.sourceID(row.id)), // sort by id converted to number
61 | width: 80,
62 | header: {
63 | content: 'ID',
64 | },
65 | },
66 | {
67 | id: 'label',
68 | data: 'label',
69 | sortable: 'label',
70 | isHTML: false,
71 | width: 300,
72 | header: {
73 | content: 'Label',
74 | },
75 | },
76 | ];
77 |
78 | // Typescript usage:
79 | // import { Config } from 'gantt-schedule-timeline-calendar';
80 | // const config: Config = {...};
81 | /**
82 | * @type {import('../../dist/gstc').Config} // or {import('gantt-schedule-timeline-calendar').Config}
83 | */
84 | const config = {
85 | // for trial key for your domain please visit https://gstc.neuronet.io/free-key
86 | // if you need commercial license please visit https://gantt-schedule-timeline-calendar.neuronet.io/pricing
87 |
88 | licenseKey:
89 | '====BEGIN LICENSE KEY====\nXOfH/lnVASM6et4Co473t9jPIvhmQ/l0X3Ewog30VudX6GVkOB0n3oDx42NtADJ8HjYrhfXKSNu5EMRb5KzCLvMt/pu7xugjbvpyI1glE7Ha6E5VZwRpb4AC8T1KBF67FKAgaI7YFeOtPFROSCKrW5la38jbE5fo+q2N6wAfEti8la2ie6/7U2V+SdJPqkm/mLY/JBHdvDHoUduwe4zgqBUYLTNUgX6aKdlhpZPuHfj2SMeB/tcTJfH48rN1mgGkNkAT9ovROwI7ReLrdlHrHmJ1UwZZnAfxAC3ftIjgTEHsd/f+JrjW6t+kL6Ef1tT1eQ2DPFLJlhluTD91AsZMUg==||U2FsdGVkX1/SWWqU9YmxtM0T6Nm5mClKwqTaoF9wgZd9rNw2xs4hnY8Ilv8DZtFyNt92xym3eB6WA605N5llLm0D68EQtU9ci1rTEDopZ1ODzcqtTVSoFEloNPFSfW6LTIC9+2LSVBeeHXoLEQiLYHWihHu10Xll3KsH9iBObDACDm1PT7IV4uWvNpNeuKJc\npY3C5SG+3sHRX1aeMnHlKLhaIsOdw2IexjvMqocVpfRpX4wnsabNA0VJ3k95zUPS3vTtSegeDhwbl6j+/FZcGk9i+gAy6LuetlKuARjPYn2LH5Be3Ah+ggSBPlxf3JW9rtWNdUoFByHTcFlhzlU9HnpnBUrgcVMhCQ7SAjN9h2NMGmCr10Rn4OE0WtelNqYVig7KmENaPvFT+k2I0cYZ4KWwxxsQNKbjEAxJxrzK4HkaczCvyQbzj4Ppxx/0q+Cns44OeyWcwYD/vSaJm4Kptwpr+L4y5BoSO/WeqhSUQQ85nvOhtE0pSH/ZXYo3pqjPdQRfNm6NFeBl2lwTmZUEuw==\n====END LICENSE KEY====',
90 |
91 | list: {
92 | columns: {
93 | data: GSTC.api.fromArray(columnsFromDB),
94 | },
95 | rows: GSTC.api.fromArray(rowsFromDB),
96 | },
97 | chart: {
98 | items: GSTC.api.fromArray(itemsFromDB),
99 | },
100 | };
101 |
102 | // Generate GSTC state from configuration object
103 | const state = GSTC.api.stateFromConfig(config);
104 |
105 | // for testing
106 | globalThis.state = state;
107 |
108 | const element = document.getElementById('gstc');
109 | if (!element) throw new Error('Element not found');
110 |
111 | // Mount the component
112 | const app = GSTC({
113 | element,
114 | state,
115 | });
116 |
117 | //for testing
118 | globalThis.gstc = app;
119 |
--------------------------------------------------------------------------------
/examples/seconds-zoom/index.js:
--------------------------------------------------------------------------------
1 | import GSTC from '../../dist/gstc.wasm.esm.min.js';
2 |
3 | const rowsFromDB = [
4 | {
5 | id: '1',
6 | label: 'Row 1',
7 | },
8 | {
9 | id: '2',
10 | label: 'Row 2',
11 | },
12 | ];
13 |
14 | const itemsFromDB = [
15 | {
16 | id: '1',
17 | label: 'Item 1',
18 | rowId: '1',
19 | time: {
20 | start: GSTC.api.date('2020-01-01 00:00:00').valueOf(),
21 | end: GSTC.api.date('2020-01-01 00:00:05').endOf('second').valueOf(),
22 | },
23 | },
24 | {
25 | id: '2',
26 | label: 'Item 2',
27 | rowId: '2',
28 | time: {
29 | start: GSTC.api.date('2020-01-01 00:01:00').valueOf(),
30 | end: GSTC.api.date('2020-01-01 00:01:10').endOf('second').valueOf(),
31 | },
32 | },
33 | ];
34 |
35 | const columnsFromDB = [
36 | {
37 | id: 'id',
38 | label: 'ID',
39 | data: ({ row }) => Number(GSTC.api.sourceID(row.id)), // show original id
40 | sortable: ({ row }) => Number(GSTC.api.sourceID(row.id)), // sort by id converted to number
41 | width: 80,
42 | header: {
43 | content: 'ID',
44 | },
45 | },
46 | {
47 | id: 'label',
48 | data: 'label',
49 | sortable: 'label',
50 | isHTML: false,
51 | width: 300,
52 | header: {
53 | content: 'Label',
54 | },
55 | },
56 | ];
57 |
58 | /**
59 | * @type {import("../../dist/gstc").ChartCalendarLevel}
60 | */
61 | const seconds = [
62 | {
63 | zoomTo: 100, // we want to display this format for all zoom levels until 100
64 | period: 'second',
65 | periodIncrement: 1,
66 | main: true,
67 | format({ timeStart, vido }) {
68 | return vido.html`${timeStart.format('HH:mm:ss')}
`; // full list of formats: https://day.js.org/docs/en/display/format
69 | },
70 | },
71 | ];
72 |
73 | // Configuration object
74 |
75 | // Typescript usage:
76 | // import { Config } from 'gantt-schedule-timeline-calendar';
77 | // const config: Config = {...};
78 | /**
79 | * @type {import('../../dist/gstc').Config} // or {import('gantt-schedule-timeline-calendar').Config}
80 | */
81 | const config = {
82 | // for free key for your domain please visit https://gstc.neuronet.io/free-key
83 | // if you need commercial license please visit https://gantt-schedule-timeline-calendar.neuronet.io/pricing
84 |
85 | licenseKey:
86 | '====BEGIN LICENSE KEY====\nXOfH/lnVASM6et4Co473t9jPIvhmQ/l0X3Ewog30VudX6GVkOB0n3oDx42NtADJ8HjYrhfXKSNu5EMRb5KzCLvMt/pu7xugjbvpyI1glE7Ha6E5VZwRpb4AC8T1KBF67FKAgaI7YFeOtPFROSCKrW5la38jbE5fo+q2N6wAfEti8la2ie6/7U2V+SdJPqkm/mLY/JBHdvDHoUduwe4zgqBUYLTNUgX6aKdlhpZPuHfj2SMeB/tcTJfH48rN1mgGkNkAT9ovROwI7ReLrdlHrHmJ1UwZZnAfxAC3ftIjgTEHsd/f+JrjW6t+kL6Ef1tT1eQ2DPFLJlhluTD91AsZMUg==||U2FsdGVkX1/SWWqU9YmxtM0T6Nm5mClKwqTaoF9wgZd9rNw2xs4hnY8Ilv8DZtFyNt92xym3eB6WA605N5llLm0D68EQtU9ci1rTEDopZ1ODzcqtTVSoFEloNPFSfW6LTIC9+2LSVBeeHXoLEQiLYHWihHu10Xll3KsH9iBObDACDm1PT7IV4uWvNpNeuKJc\npY3C5SG+3sHRX1aeMnHlKLhaIsOdw2IexjvMqocVpfRpX4wnsabNA0VJ3k95zUPS3vTtSegeDhwbl6j+/FZcGk9i+gAy6LuetlKuARjPYn2LH5Be3Ah+ggSBPlxf3JW9rtWNdUoFByHTcFlhzlU9HnpnBUrgcVMhCQ7SAjN9h2NMGmCr10Rn4OE0WtelNqYVig7KmENaPvFT+k2I0cYZ4KWwxxsQNKbjEAxJxrzK4HkaczCvyQbzj4Ppxx/0q+Cns44OeyWcwYD/vSaJm4Kptwpr+L4y5BoSO/WeqhSUQQ85nvOhtE0pSH/ZXYo3pqjPdQRfNm6NFeBl2lwTmZUEuw==\n====END LICENSE KEY====',
87 |
88 | list: {
89 | columns: {
90 | data: GSTC.api.fromArray(columnsFromDB),
91 | },
92 | rows: GSTC.api.fromArray(rowsFromDB),
93 | },
94 | chart: {
95 | items: GSTC.api.fromArray(itemsFromDB),
96 | calendarLevels: [seconds],
97 | time: {
98 | zoom: 4,
99 | period: 'second',
100 | from: GSTC.api.date('2020-01-01T00:00:00').startOf('hour').valueOf(),
101 | to: GSTC.api.date('2020-01-01T00:00:0').endOf('hour').valueOf(),
102 | },
103 | },
104 | };
105 |
106 | // Generate GSTC state from configuration object
107 | const state = GSTC.api.stateFromConfig(config);
108 |
109 | // for testing
110 | globalThis.state = state;
111 |
112 | const element = document.getElementById('gstc');
113 | if (!element) throw new Error('Element not found');
114 |
115 | // Mount the component
116 | const app = GSTC({
117 | element,
118 | state,
119 | });
120 |
121 | //for testing
122 | globalThis.gstc = app;
123 |
--------------------------------------------------------------------------------
/dist/plugins/time-bookmarks.umd.min.js:
--------------------------------------------------------------------------------
1 | !function(t,s){"object"==typeof exports&&"undefined"!=typeof module?s(exports):"function"==typeof define&&define.amd?define(["exports"],s):s((t="undefined"!=typeof globalThis?globalThis:t||self).TimeBookmarks={})}(this,function(t){"use strict";
2 | /**
3 | * Gantt-Schedule-Timeline-Calendar helpers
4 | *
5 | * @copyright NEURONET - Rafal Pospiech
6 | * @author Rafal Pospiech
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.41.2
11 | * @released 2025-09-10
12 | * @license SEE LICENSE IN LICENSE FILE
13 | */const s="gstc";
14 | /**
15 | * TimeBookmarks plugin
16 | *
17 | * @copyright NEURONET - Rafal Pospiech
18 | * @author Rafal Pospiech
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.41.2
23 | * @released 2025-09-10
24 | * @license SEE LICENSE IN LICENSE FILE
25 | */
26 | const e="config.plugin.TimeBookmarks",i="config.slots.chart-timeline-items.outer";class a{constructor(t,a){this.unsub=[],this.options=function(t){return Object.assign({enabled:!0,className:""},t)}(t),this.vido=a,this.state=a.state,this.className=function(t,e=""){let i=`${s}__${t}`;return t===s&&(i=s),e?`${i} ${i}--${e.replace(":","-")}`:i}("chart-time-bookmark")+(this.options.className?` ${this.options.className}`:""),this.PluginTimeBookmarksSlot=this.PluginTimeBookmarksSlot.bind(this),this.destroy=this.destroy.bind(this),this.state.update(e,this.options),this.state.update(i,t=>(t.includes(this.PluginTimeBookmarksSlot)||t.push(this.PluginTimeBookmarksSlot),t)),this.unsub.push(this.state.subscribe(e,t=>this.options=t))}destroy(){this.unsub.forEach(t=>t()),this.state.update(i,t=>t.filter(t=>t!==this.PluginTimeBookmarksSlot)),this.vido.api.pluginDestroyed("TimeBookmarks")}PluginTimeBookmarksSlot(t){const{html:s,onDestroy:i,state:a,update:l,api:o,StyleMap:n}=t,c=[];i(a.subscribeAll([e,"$data.chart.time","$data.scroll.horizontal.dataIndex"],()=>{var t;const s=a.get("$data.chart.time"),i=a.get(e);c.length=0;for(const e in i.bookmarks){const a=o.time.date(i.bookmarks[e].time);if(!o.time.isInCurrentView(a,s))continue;const l=Object.assign(Object.assign({},i.bookmarks[e]),{id:e,leftViewPx:0,absoluteLeftPx:0,visible:!1,date:null,styleMap:new n(Object.assign(null!==(t=i.bookmarks[e].style)&&void 0!==t?t:{},{left:"",height:""}))});l.styleMap.style.background=l.styleMap.style.background||l.color||"#3498DB",l.id=e,l.date=a,l.leftViewPx=o.time.getViewOffsetPxFromDates(a,!1,s),l.absoluteLeftPx=o.time.getGlobalOffsetPxFromDates(l.date,!1,s),l.visible=l.absoluteLeftPx>=s.leftPx&&l.absoluteLeftPx<=s.rightPx,c.push(l)}l()},{group:!0}));let r=0,d=0;i(a.subscribe("$data.scroll.vertical",t=>{r=Math.round(o.getRealChartHeight()),d=Math.round(-t.preciseOffset),l()}));const h=t=>s``,m=t=>s`
38 |
42 | ${t.label}
43 |
44 |
`;return t=>s`
45 | ${c.filter(t=>t.visible).map(t=>h(t))}
46 |
47 | ${t}
48 |
49 | ${c.filter(t=>t.visible).map(t=>m(t))}
50 |
`}}t.Plugin=function(t={}){return function(s){const i=s.state.get(e);i&&(t=s.api.mergeDeep({},t,i));const l=new a(t,s);return s.api.pluginInitialized("TimeBookmarks"),l.destroy}},t.pluginPath=e,t.slotPath=i,Object.defineProperty(t,"__esModule",{value:!0})});
--------------------------------------------------------------------------------
/examples/grid-content/index.js:
--------------------------------------------------------------------------------
1 | import GSTC from '../../dist/gstc.wasm.esm.min.js';
2 |
3 | const rowsFromDB = [
4 | {
5 | id: '1',
6 | label: 'Row 1',
7 | },
8 | {
9 | id: '2',
10 | label: 'Row 2',
11 | },
12 | ];
13 |
14 | const itemsFromDB = [
15 | {
16 | id: '1',
17 | label: 'Item 1',
18 | rowId: '1',
19 | time: {
20 | start: GSTC.api.date('2020-01-01').startOf('day').valueOf(),
21 | end: GSTC.api.date('2020-01-02').endOf('day').valueOf(),
22 | },
23 | },
24 | {
25 | id: '2',
26 | label: 'Item 2',
27 | rowId: '1',
28 | time: {
29 | start: GSTC.api.date('2020-02-01').startOf('day').valueOf(),
30 | end: GSTC.api.date('2020-02-02').endOf('day').valueOf(),
31 | },
32 | },
33 | {
34 | id: '3',
35 | label: 'Item 3',
36 | rowId: '2',
37 | time: {
38 | start: GSTC.api.date('2020-01-15').startOf('day').valueOf(),
39 | end: GSTC.api.date('2020-01-20').endOf('day').valueOf(),
40 | },
41 | },
42 | ];
43 |
44 | const columnsFromDB = [
45 | {
46 | id: 'id',
47 | label: 'ID',
48 | data: ({ row }) => GSTC.api.sourceID(row.id), // show original id (not internal GSTCID)
49 | sortable: ({ row }) => Number(GSTC.api.sourceID(row.id)), // sort by id converted to number
50 | width: 80,
51 | header: {
52 | content: 'ID',
53 | },
54 | },
55 | {
56 | id: 'label',
57 | data: 'label',
58 | sortable: 'label',
59 | isHTML: false,
60 | width: 230,
61 | header: {
62 | content: 'Label',
63 | },
64 | },
65 | ];
66 |
67 | function onCellClick(row, time) {
68 | alert('Cell for row ' + GSTC.api.sourceID(row.id) + ' ' + time.leftGlobalDate.format('YYYY-MM-DD') + ' clicked!');
69 | }
70 |
71 | function onCellCreate1({ time, row, vido }) {
72 | return vido.html`
73 | onCellClick(
74 | row,
75 | time
76 | )} style="background:red;color:white;border-radius:100%;cursor:pointer;width:20px;height:20px;">!
`;
77 | }
78 |
79 | function onCellCreate2({ content, vido }) {
80 | return vido.html`${content}
`;
81 | }
82 |
83 | // Configuration object
84 |
85 | // Typescript usage:
86 | // import { Config } from 'gantt-schedule-timeline-calendar';
87 | // const config: Config = {...};
88 | /**
89 | * @type {import('../../dist/gstc').Config} // or {import('gantt-schedule-timeline-calendar').Config}
90 | */
91 | const config = {
92 | // for trial key for your domain please visit https://gstc.neuronet.io/free-key
93 | // if you need commercial license please visit https://gantt-schedule-timeline-calendar.neuronet.io/pricing
94 |
95 | licenseKey:
96 | '====BEGIN LICENSE KEY====\nXOfH/lnVASM6et4Co473t9jPIvhmQ/l0X3Ewog30VudX6GVkOB0n3oDx42NtADJ8HjYrhfXKSNu5EMRb5KzCLvMt/pu7xugjbvpyI1glE7Ha6E5VZwRpb4AC8T1KBF67FKAgaI7YFeOtPFROSCKrW5la38jbE5fo+q2N6wAfEti8la2ie6/7U2V+SdJPqkm/mLY/JBHdvDHoUduwe4zgqBUYLTNUgX6aKdlhpZPuHfj2SMeB/tcTJfH48rN1mgGkNkAT9ovROwI7ReLrdlHrHmJ1UwZZnAfxAC3ftIjgTEHsd/f+JrjW6t+kL6Ef1tT1eQ2DPFLJlhluTD91AsZMUg==||U2FsdGVkX1/SWWqU9YmxtM0T6Nm5mClKwqTaoF9wgZd9rNw2xs4hnY8Ilv8DZtFyNt92xym3eB6WA605N5llLm0D68EQtU9ci1rTEDopZ1ODzcqtTVSoFEloNPFSfW6LTIC9+2LSVBeeHXoLEQiLYHWihHu10Xll3KsH9iBObDACDm1PT7IV4uWvNpNeuKJc\npY3C5SG+3sHRX1aeMnHlKLhaIsOdw2IexjvMqocVpfRpX4wnsabNA0VJ3k95zUPS3vTtSegeDhwbl6j+/FZcGk9i+gAy6LuetlKuARjPYn2LH5Be3Ah+ggSBPlxf3JW9rtWNdUoFByHTcFlhzlU9HnpnBUrgcVMhCQ7SAjN9h2NMGmCr10Rn4OE0WtelNqYVig7KmENaPvFT+k2I0cYZ4KWwxxsQNKbjEAxJxrzK4HkaczCvyQbzj4Ppxx/0q+Cns44OeyWcwYD/vSaJm4Kptwpr+L4y5BoSO/WeqhSUQQ85nvOhtE0pSH/ZXYo3pqjPdQRfNm6NFeBl2lwTmZUEuw==\n====END LICENSE KEY====',
97 |
98 | list: {
99 | columns: {
100 | data: GSTC.api.fromArray(columnsFromDB),
101 | },
102 | rows: GSTC.api.fromArray(rowsFromDB),
103 | },
104 | chart: {
105 | items: GSTC.api.fromArray(itemsFromDB),
106 | grid: {
107 | cell: {
108 | onCreate: [onCellCreate1, onCellCreate2],
109 | },
110 | },
111 | },
112 | };
113 |
114 | // Generate GSTC state from configuration object
115 | const state = GSTC.api.stateFromConfig(config);
116 |
117 | // for testing
118 | globalThis.state = state;
119 |
120 | const element = document.getElementById('gstc');
121 | if (!element) throw new Error('Element not found');
122 |
123 | // Mount the component
124 | const app = GSTC({
125 | element,
126 | state,
127 | });
128 |
129 | //for testing
130 | globalThis.gstc = app;
131 |
--------------------------------------------------------------------------------
/examples/rows-content/index.js:
--------------------------------------------------------------------------------
1 | import GSTC from '../../dist/gstc.wasm.esm.min.js';
2 |
3 | globalThis.row = '';
4 |
5 | function onRowClick(row) {
6 | //@ts-ignore
7 | globalThis.row = GSTC.api.sourceID(row.id);
8 | alert('Row ' + GSTC.api.sourceID(row.id) + ' clicked!');
9 | }
10 |
11 | const rowsFromDB = [
12 | {
13 | id: '1',
14 | label({ row, vido }) {
15 | return vido.html`
16 | onRowClick(
17 | row
18 | )} style="color:red;cursor:pointer;"> ROW HTML HERE - CLICK ME
`;
19 | },
20 | },
21 | {
22 | id: '2',
23 | label: 'Row 2',
24 | },
25 | ];
26 |
27 | const itemsFromDB = [
28 | {
29 | id: '1',
30 | label: 'Item 1',
31 | rowId: '1',
32 | time: {
33 | start: GSTC.api.date('2020-01-01').startOf('day').valueOf(),
34 | end: GSTC.api.date('2020-01-02').endOf('day').valueOf(),
35 | },
36 | },
37 | {
38 | id: '2',
39 | label: 'Item 2',
40 | rowId: '1',
41 | time: {
42 | start: GSTC.api.date('2020-02-01').startOf('day').valueOf(),
43 | end: GSTC.api.date('2020-02-02').endOf('day').valueOf(),
44 | },
45 | },
46 | {
47 | id: '3',
48 | label: 'Item 3',
49 | rowId: '2',
50 | time: {
51 | start: GSTC.api.date('2020-01-15').startOf('day').valueOf(),
52 | end: GSTC.api.date('2020-01-20').endOf('day').valueOf(),
53 | },
54 | },
55 | ];
56 |
57 | const columnsFromDB = [
58 | {
59 | id: 'id',
60 | label: 'ID',
61 | data: ({ row, vido }) =>
62 | vido.html`
63 | onRowClick(row)}>${GSTC.api.sourceID(row.id)}
`, // show original id (not internal GSTCID)
64 | sortable: ({ row }) => Number(GSTC.api.sourceID(row.id)), // sort by id converted to number
65 | width: 80,
66 | header: {
67 | content: 'ID',
68 | },
69 | },
70 | {
71 | id: 'label',
72 | data: 'label',
73 | sortable: 'label',
74 | isHTML: false,
75 | width: 300,
76 | header: {
77 | content: 'Label',
78 | },
79 | },
80 | ];
81 |
82 | // Configuration object
83 |
84 | // Typescript usage:
85 | // import { Config } from 'gantt-schedule-timeline-calendar';
86 | // const config: Config = {...};
87 | /**
88 | * @type {import('../../dist/gstc').Config} // or {import('gantt-schedule-timeline-calendar').Config}
89 | */
90 | const config = {
91 | // for trial key for your domain please visit https://gstc.neuronet.io/free-key
92 | // if you need commercial license please visit https://gantt-schedule-timeline-calendar.neuronet.io/pricing
93 |
94 | licenseKey:
95 | '====BEGIN LICENSE KEY====\nXOfH/lnVASM6et4Co473t9jPIvhmQ/l0X3Ewog30VudX6GVkOB0n3oDx42NtADJ8HjYrhfXKSNu5EMRb5KzCLvMt/pu7xugjbvpyI1glE7Ha6E5VZwRpb4AC8T1KBF67FKAgaI7YFeOtPFROSCKrW5la38jbE5fo+q2N6wAfEti8la2ie6/7U2V+SdJPqkm/mLY/JBHdvDHoUduwe4zgqBUYLTNUgX6aKdlhpZPuHfj2SMeB/tcTJfH48rN1mgGkNkAT9ovROwI7ReLrdlHrHmJ1UwZZnAfxAC3ftIjgTEHsd/f+JrjW6t+kL6Ef1tT1eQ2DPFLJlhluTD91AsZMUg==||U2FsdGVkX1/SWWqU9YmxtM0T6Nm5mClKwqTaoF9wgZd9rNw2xs4hnY8Ilv8DZtFyNt92xym3eB6WA605N5llLm0D68EQtU9ci1rTEDopZ1ODzcqtTVSoFEloNPFSfW6LTIC9+2LSVBeeHXoLEQiLYHWihHu10Xll3KsH9iBObDACDm1PT7IV4uWvNpNeuKJc\npY3C5SG+3sHRX1aeMnHlKLhaIsOdw2IexjvMqocVpfRpX4wnsabNA0VJ3k95zUPS3vTtSegeDhwbl6j+/FZcGk9i+gAy6LuetlKuARjPYn2LH5Be3Ah+ggSBPlxf3JW9rtWNdUoFByHTcFlhzlU9HnpnBUrgcVMhCQ7SAjN9h2NMGmCr10Rn4OE0WtelNqYVig7KmENaPvFT+k2I0cYZ4KWwxxsQNKbjEAxJxrzK4HkaczCvyQbzj4Ppxx/0q+Cns44OeyWcwYD/vSaJm4Kptwpr+L4y5BoSO/WeqhSUQQ85nvOhtE0pSH/ZXYo3pqjPdQRfNm6NFeBl2lwTmZUEuw==\n====END LICENSE KEY====',
96 |
97 | list: {
98 | columns: {
99 | data: GSTC.api.fromArray(columnsFromDB),
100 | },
101 | rows: GSTC.api.fromArray(rowsFromDB),
102 | },
103 | chart: {
104 | items: GSTC.api.fromArray(itemsFromDB),
105 | },
106 | };
107 |
108 | // Generate GSTC state from configuration object
109 | const state = GSTC.api.stateFromConfig(config);
110 |
111 | // for testing
112 | globalThis.state = state;
113 |
114 | const element = document.getElementById('gstc');
115 | if (!element) throw new Error('Element not found');
116 |
117 | // Mount the component
118 | const app = GSTC({
119 | element,
120 | state,
121 | });
122 |
123 | //for testing
124 | globalThis.gstc = app;
125 |
--------------------------------------------------------------------------------
/examples/simple/index.js:
--------------------------------------------------------------------------------
1 | import GSTC from '../../dist/gstc.wasm.esm.min.js';
2 |
3 | const rowsFromDB = [
4 | {
5 | id: '1',
6 | label: 'Row 1',
7 | },
8 | {
9 | id: '2',
10 | label: 'Row 2',
11 | },
12 | {
13 | id: '3',
14 | label: 'Row 3',
15 | },
16 | {
17 | id: '4',
18 | label: 'Row 4',
19 | },
20 | {
21 | id: '5',
22 | label: 'Row 5',
23 | },
24 | {
25 | id: '6',
26 | label: 'Row 6',
27 | },
28 | {
29 | id: '7',
30 | label: 'Row 7',
31 | },
32 | {
33 | id: '8',
34 | label: 'Row 8',
35 | },
36 | {
37 | id: '9',
38 | label: 'Row 9',
39 | },
40 | {
41 | id: '10',
42 | label: 'Row 10',
43 | },
44 | {
45 | id: '11',
46 | label: 'Row 11',
47 | },
48 | {
49 | id: '12',
50 | label: 'Row 12',
51 | },
52 | ];
53 |
54 | const itemsFromDB = [
55 | {
56 | id: '1',
57 | label: 'Item 1',
58 | rowId: '1',
59 | time: {
60 | start: GSTC.api.date('2020-01-01').startOf('day').valueOf(),
61 | end: GSTC.api.date('2020-01-02').endOf('day').valueOf(),
62 | },
63 | },
64 | {
65 | id: '2',
66 | label: 'Item 2',
67 | rowId: '1',
68 | time: {
69 | start: GSTC.api.date('2020-02-01').startOf('day').valueOf(),
70 | end: GSTC.api.date('2020-02-02').endOf('day').valueOf(),
71 | },
72 | },
73 | {
74 | id: '3',
75 | label: 'Item 3',
76 | rowId: '2',
77 | time: {
78 | start: GSTC.api.date('2020-01-15').startOf('day').valueOf(),
79 | end: GSTC.api.date('2020-01-20').endOf('day').valueOf(),
80 | },
81 | },
82 | ];
83 |
84 | const columnsFromDB = [
85 | {
86 | id: 'id',
87 | label: 'ID',
88 | data: ({ row }) => GSTC.api.sourceID(row.id), // show original id (not internal GSTCID)
89 | sortable: ({ row }) => Number(GSTC.api.sourceID(row.id)), // sort by id converted to number
90 | width: 80,
91 | header: {
92 | content: 'ID',
93 | },
94 | },
95 | {
96 | id: 'label',
97 | data: 'label',
98 | sortable: 'label',
99 | isHTML: false,
100 | width: 230,
101 | header: {
102 | content: 'Label',
103 | },
104 | },
105 | ];
106 |
107 | // Configuration object
108 |
109 | // Typescript usage:
110 | // import { Config } from 'gantt-schedule-timeline-calendar';
111 | // const config: Config = {...};
112 | /**
113 | * @type {import('../../dist/gstc').Config} // or {import('gantt-schedule-timeline-calendar').Config}
114 | */
115 | const config = {
116 | // for free key for your domain please visit https://gstc.neuronet.io/free-key
117 | // if you need commercial license please visit https://gantt-schedule-timeline-calendar.neuronet.io/pricing
118 |
119 | licenseKey:
120 | '====BEGIN LICENSE KEY====\nXOfH/lnVASM6et4Co473t9jPIvhmQ/l0X3Ewog30VudX6GVkOB0n3oDx42NtADJ8HjYrhfXKSNu5EMRb5KzCLvMt/pu7xugjbvpyI1glE7Ha6E5VZwRpb4AC8T1KBF67FKAgaI7YFeOtPFROSCKrW5la38jbE5fo+q2N6wAfEti8la2ie6/7U2V+SdJPqkm/mLY/JBHdvDHoUduwe4zgqBUYLTNUgX6aKdlhpZPuHfj2SMeB/tcTJfH48rN1mgGkNkAT9ovROwI7ReLrdlHrHmJ1UwZZnAfxAC3ftIjgTEHsd/f+JrjW6t+kL6Ef1tT1eQ2DPFLJlhluTD91AsZMUg==||U2FsdGVkX1/SWWqU9YmxtM0T6Nm5mClKwqTaoF9wgZd9rNw2xs4hnY8Ilv8DZtFyNt92xym3eB6WA605N5llLm0D68EQtU9ci1rTEDopZ1ODzcqtTVSoFEloNPFSfW6LTIC9+2LSVBeeHXoLEQiLYHWihHu10Xll3KsH9iBObDACDm1PT7IV4uWvNpNeuKJc\npY3C5SG+3sHRX1aeMnHlKLhaIsOdw2IexjvMqocVpfRpX4wnsabNA0VJ3k95zUPS3vTtSegeDhwbl6j+/FZcGk9i+gAy6LuetlKuARjPYn2LH5Be3Ah+ggSBPlxf3JW9rtWNdUoFByHTcFlhzlU9HnpnBUrgcVMhCQ7SAjN9h2NMGmCr10Rn4OE0WtelNqYVig7KmENaPvFT+k2I0cYZ4KWwxxsQNKbjEAxJxrzK4HkaczCvyQbzj4Ppxx/0q+Cns44OeyWcwYD/vSaJm4Kptwpr+L4y5BoSO/WeqhSUQQ85nvOhtE0pSH/ZXYo3pqjPdQRfNm6NFeBl2lwTmZUEuw==\n====END LICENSE KEY====',
121 | list: {
122 | columns: {
123 | data: GSTC.api.fromArray(columnsFromDB),
124 | },
125 | rows: GSTC.api.fromArray(rowsFromDB),
126 | },
127 | chart: {
128 | items: GSTC.api.fromArray(itemsFromDB),
129 | },
130 | };
131 |
132 | // Generate GSTC state from configuration object
133 | const state = GSTC.api.stateFromConfig(config);
134 |
135 | // for testing
136 | globalThis.state = state;
137 |
138 | const element = document.getElementById('gstc');
139 | if (!element) throw new Error('Element not found');
140 |
141 | element.addEventListener('gstc-loaded', (ev) => {
142 | // @ts-ignore
143 | globalThis.dispatchEvent(new Event('gstc-loaded', ev.target));
144 | });
145 |
146 | // Mount the component
147 | const app = (globalThis.gstc = GSTC({
148 | element,
149 | state,
150 | }));
151 |
--------------------------------------------------------------------------------
/examples/hide-weekends/index.js:
--------------------------------------------------------------------------------
1 | import GSTC from '../../dist/gstc.wasm.esm.min.js';
2 | import { Plugin as TimelinePointer } from '../../dist/plugins/timeline-pointer.esm.min.js';
3 | import { Plugin as Selection } from '../../dist/plugins/selection.esm.min.js';
4 | import { Plugin as ItemMovement } from '../../dist/plugins/item-movement.esm.min.js';
5 | import { Plugin as ItemResizing } from '../../dist/plugins/item-resizing.esm.min.js';
6 |
7 | const rowsFromDB = [
8 | {
9 | id: '1',
10 | label: 'Row 1',
11 | },
12 | {
13 | id: '2',
14 | label: 'Row 2',
15 | },
16 | ];
17 |
18 | const itemsFromDB = [
19 | {
20 | id: '1',
21 | label: 'Item 1',
22 | rowId: '1',
23 | time: {
24 | start: GSTC.api.date('2021-01-01').startOf('day').valueOf(),
25 | end: GSTC.api.date('2021-01-04').endOf('day').valueOf(),
26 | },
27 | },
28 | {
29 | id: '2',
30 | label: 'Item 2',
31 | rowId: '1',
32 | time: {
33 | start: GSTC.api.date('2021-02-01').startOf('day').valueOf(),
34 | end: GSTC.api.date('2021-02-02').endOf('day').valueOf(),
35 | },
36 | },
37 | {
38 | id: '3',
39 | label: 'Item 3',
40 | rowId: '2',
41 | time: {
42 | start: GSTC.api.date('2021-01-15').startOf('day').valueOf(),
43 | end: GSTC.api.date('2021-01-20').endOf('day').valueOf(),
44 | },
45 | },
46 | ];
47 |
48 | const columnsFromDB = [
49 | {
50 | id: 'id',
51 | label: 'ID',
52 | data: ({ row }) => GSTC.api.sourceID(row.id), // show original id (not internal GSTCID)
53 | sortable: ({ row }) => Number(GSTC.api.sourceID(row.id)), // sort by id converted to number
54 | width: 80,
55 | header: {
56 | content: 'ID',
57 | },
58 | },
59 | {
60 | id: 'label',
61 | data: 'label',
62 | sortable: 'label',
63 | isHTML: false,
64 | width: 230,
65 | header: {
66 | content: 'Label',
67 | },
68 | },
69 | ];
70 |
71 | function onLevelDates({ dates, format }) {
72 | if (format.period !== 'day') return dates; // do nothing on months level
73 | return dates.filter((date) => date.leftGlobalDate.day() !== 0 && date.leftGlobalDate.day() !== 6);
74 | }
75 |
76 | // Configuration object
77 |
78 | // Typescript usage:
79 | // import { Config } from 'gantt-schedule-timeline-calendar';
80 | // const config: Config = {...};
81 | /**
82 | * @type {import('../../dist/gstc').Config} // or {import('gantt-schedule-timeline-calendar').Config}
83 | */
84 | const config = {
85 | // for trial key for your domain please visit https://gstc.neuronet.io/free-key
86 | // if you need commercial license please visit https://gantt-schedule-timeline-calendar.neuronet.io/pricing
87 |
88 | licenseKey:
89 | '====BEGIN LICENSE KEY====\nXOfH/lnVASM6et4Co473t9jPIvhmQ/l0X3Ewog30VudX6GVkOB0n3oDx42NtADJ8HjYrhfXKSNu5EMRb5KzCLvMt/pu7xugjbvpyI1glE7Ha6E5VZwRpb4AC8T1KBF67FKAgaI7YFeOtPFROSCKrW5la38jbE5fo+q2N6wAfEti8la2ie6/7U2V+SdJPqkm/mLY/JBHdvDHoUduwe4zgqBUYLTNUgX6aKdlhpZPuHfj2SMeB/tcTJfH48rN1mgGkNkAT9ovROwI7ReLrdlHrHmJ1UwZZnAfxAC3ftIjgTEHsd/f+JrjW6t+kL6Ef1tT1eQ2DPFLJlhluTD91AsZMUg==||U2FsdGVkX1/SWWqU9YmxtM0T6Nm5mClKwqTaoF9wgZd9rNw2xs4hnY8Ilv8DZtFyNt92xym3eB6WA605N5llLm0D68EQtU9ci1rTEDopZ1ODzcqtTVSoFEloNPFSfW6LTIC9+2LSVBeeHXoLEQiLYHWihHu10Xll3KsH9iBObDACDm1PT7IV4uWvNpNeuKJc\npY3C5SG+3sHRX1aeMnHlKLhaIsOdw2IexjvMqocVpfRpX4wnsabNA0VJ3k95zUPS3vTtSegeDhwbl6j+/FZcGk9i+gAy6LuetlKuARjPYn2LH5Be3Ah+ggSBPlxf3JW9rtWNdUoFByHTcFlhzlU9HnpnBUrgcVMhCQ7SAjN9h2NMGmCr10Rn4OE0WtelNqYVig7KmENaPvFT+k2I0cYZ4KWwxxsQNKbjEAxJxrzK4HkaczCvyQbzj4Ppxx/0q+Cns44OeyWcwYD/vSaJm4Kptwpr+L4y5BoSO/WeqhSUQQ85nvOhtE0pSH/ZXYo3pqjPdQRfNm6NFeBl2lwTmZUEuw==\n====END LICENSE KEY====',
90 |
91 | list: {
92 | columns: {
93 | data: GSTC.api.fromArray(columnsFromDB),
94 | },
95 | rows: GSTC.api.fromArray(rowsFromDB),
96 | },
97 | chart: {
98 | items: GSTC.api.fromArray(itemsFromDB),
99 | time: {
100 | onLevelDates: [onLevelDates],
101 | },
102 | },
103 | //plugins: [TimelinePointer(), Selection(), ItemResizing(), ItemMovement({ ignoreMissingDates: true })],
104 | };
105 |
106 | // Generate GSTC state from configuration object
107 | const state = GSTC.api.stateFromConfig(config);
108 |
109 | // for testing
110 | globalThis.state = state;
111 | const element = document.getElementById('gstc');
112 | if (!element) throw new Error('Element not found');
113 |
114 | // Mount the component
115 | const app = GSTC({
116 | element,
117 | state,
118 | });
119 |
120 | //for testing
121 | globalThis.gstc = app;
122 |
--------------------------------------------------------------------------------
/cypress/e2e/time-bookmarks.test.ts:
--------------------------------------------------------------------------------
1 | import { Time } from '../../dist/api/time';
2 | import { DataChartTime } from '../../dist/gstc';
3 | import { round } from '../helpers';
4 |
5 | describe('Time bookmarks', () => {
6 | it('should display the bookmarks at the right positions', () => {
7 | let gstc, state;
8 | cy.load('/examples/one-month')
9 | .window()
10 | .then((win) => {
11 | // @ts-ignore
12 | gstc = win.gstc;
13 | // @ts-ignore
14 | state = win.state;
15 | })
16 | .then(() => {
17 | const chartTime: DataChartTime = state.get('$data.chart.time');
18 | const thirdDateLeft = round(chartTime.levels[1][2].currentView.leftPx);
19 | let thirdDateFromAll;
20 | for (const currentDate of chartTime.allDates[1]) {
21 | if (currentDate.leftGlobalDate.format('YYYY-MM-DD') === '2020-01-03') {
22 | thirdDateFromAll = currentDate;
23 | continue;
24 | }
25 | }
26 | const fromAllDates = round(thirdDateFromAll.currentView.leftPx);
27 | cy.log('thirdDateFromAll', fromAllDates);
28 | cy.log('thirdDateLeft width', thirdDateLeft);
29 | expect(fromAllDates).to.eq(thirdDateLeft);
30 | })
31 | .get('.gstc__chart-time-bookmark-label-content--1-st')
32 | .then(($el) => {
33 | const left = round($el.parent().css('left'));
34 | const time: Time = gstc.api.time;
35 | const chartTime: DataChartTime = state.get('$data.chart.time');
36 | const thirdDateLeft = round(chartTime.levels[1][2].currentView.leftPx);
37 | const added2Days = chartTime.leftGlobalDate.startOf('day').add(2, 'day').startOf('day');
38 | expect(added2Days.format('YYYY-MM-DD')).to.eq('2020-01-03');
39 | const shouldLeft = round(time.getViewOffsetPxFromDates(added2Days, false, chartTime));
40 | expect(added2Days.format('YYYY-MM-DD')).to.eq('2020-01-03');
41 | expect(thirdDateLeft).to.eq(shouldLeft);
42 | expect(chartTime.leftGlobalDate.format('YYYY-MM-DD')).to.eq('2020-01-01');
43 | expect(left).to.eq(shouldLeft);
44 | expect($el.text().trim()).to.eq('1-st');
45 | })
46 | .get('.gstc__chart-time-bookmark-label-content--bookmark-1')
47 | .then(($el) => {
48 | const left = round($el.parent().css('left'));
49 | const time: Time = gstc.api.time;
50 | const chartTime: DataChartTime = state.get('$data.chart.time');
51 | const added4Days = chartTime.leftGlobalDate.startOf('day').add(4, 'day').startOf('day');
52 | expect(added4Days.format('YYYY-MM-DD')).to.eq('2020-01-05');
53 | const shouldLeft = round(time.getViewOffsetPxFromDates(added4Days, false, chartTime));
54 | expect(added4Days.format('YYYY-MM-DD')).to.eq('2020-01-05');
55 | expect(chartTime.leftGlobalDate.format('YYYY-MM-DD')).to.eq('2020-01-01');
56 | expect(left).to.eq(shouldLeft);
57 | expect($el.text().trim()).to.eq('Bookmark 2020-01-05');
58 | })
59 | .get('.gstc__chart-time-bookmark-label-content--bookmark-1')
60 | .should('be.visible')
61 | .get('.gstc__chart-time-bookmark-label')
62 | .then(($labels) => {
63 | expect($labels.length).to.eq(8);
64 | })
65 | .get('#btn-next-month')
66 | .click()
67 | .wait(300) // because on site there is setTimeout 250 to show the results
68 | .get('.gstc__chart-time-bookmark-label')
69 | .then(($labels) => {
70 | expect($labels.length).to.eq(2);
71 | })
72 | .get('.gstc__chart-time-bookmark-label-content--bookmark-8')
73 | .then(($el) => {
74 | const left = round($el.parent().css('left'));
75 | const time: Time = gstc.api.time;
76 | const chartTime: DataChartTime = state.get('$data.chart.time');
77 | const added1Day = chartTime.leftGlobalDate.startOf('day').add(1, 'day').startOf('day');
78 | expect(added1Day.format('YYYY-MM-DD')).to.eq('2020-02-02');
79 | const shouldLeft = round(time.getViewOffsetPxFromDates(added1Day, false, chartTime));
80 | expect(added1Day.format('YYYY-MM-DD')).to.eq('2020-02-02');
81 | expect(chartTime.leftGlobalDate.format('YYYY-MM-DD')).to.eq('2020-02-01');
82 | expect(left).to.eq(shouldLeft);
83 | expect($el.text().trim()).to.eq('Bookmark 2020-02-02');
84 | })
85 | .get('.gstc__chart-time-bookmark-line-content--bookmark-8')
86 | .should('be.visible')
87 | .get('.gstc__chart-time-bookmark-label-content--1-st')
88 | .should('not.exist')
89 | .get('.gstc__chart-time-bookmark-label-content--bookmark-1')
90 | .should('not.exist');
91 | });
92 | });
93 |
--------------------------------------------------------------------------------
/examples/minutes-zoom/index.js:
--------------------------------------------------------------------------------
1 | import GSTC from '../../dist/gstc.wasm.esm.min.js';
2 |
3 | // @ts-ignore
4 | GSTC.api.dayjs.extend(globalThis.dayjs_plugin_weekOfYear);
5 | //@ts-ignore
6 | GSTC.api.dayjs.extend(globalThis.dayjs_plugin_advancedFormat);
7 |
8 | const rowsFromDB = [
9 | {
10 | id: '1',
11 | label: 'Row 1',
12 | },
13 | {
14 | id: '2',
15 | label: 'Row 2',
16 | },
17 | ];
18 |
19 | const itemsFromDB = [
20 | {
21 | id: '1',
22 | label: 'Item 1',
23 | rowId: '1',
24 | time: {
25 | start: GSTC.api.date('2020-01-01 00:00:00').valueOf(),
26 | end: GSTC.api.date('2020-01-01 00:00:00').endOf('hour').valueOf(),
27 | },
28 | },
29 | {
30 | id: '2',
31 | label: 'Item 2',
32 | rowId: '1',
33 | time: {
34 | start: GSTC.api.date('2020-01-01 08:00:00').startOf('hour').valueOf(),
35 | end: GSTC.api.date('2020-01-01 10:00:00').endOf('hour').valueOf(),
36 | },
37 | },
38 | ];
39 |
40 | const columnsFromDB = [
41 | {
42 | id: 'id',
43 | label: 'ID',
44 | data: ({ row }) => Number(GSTC.api.sourceID(row.id)), // show original id
45 | sortable: ({ row }) => Number(GSTC.api.sourceID(row.id)), // sort by id converted to number
46 | width: 80,
47 | header: {
48 | content: 'ID',
49 | },
50 | },
51 | {
52 | id: 'label',
53 | data: 'label',
54 | sortable: 'label',
55 | isHTML: false,
56 | width: 300,
57 | header: {
58 | content: 'Label',
59 | },
60 | },
61 | ];
62 |
63 | /**
64 | * @type {import("../../dist/gstc").ChartCalendarLevel}
65 | */
66 | const hours = [
67 | {
68 | zoomTo: 100, // we want to display this format for all zoom levels until 100
69 | period: 'hour',
70 | periodIncrement: 1,
71 | format({ timeStart }) {
72 | return timeStart.format('HH:mm DD MMMM YYYY'); // full list of formats: https://day.js.org/docs/en/display/format
73 | },
74 | },
75 | ];
76 |
77 | /**
78 | * @type {import("../../dist/gstc").ChartCalendarLevel}
79 | */
80 | const minutes = [
81 | {
82 | zoomTo: 100, // we want to display this format for all zoom levels until 100
83 | period: 'minute',
84 | periodIncrement: 15,
85 | main: true,
86 | format({ timeStart, vido }) {
87 | return vido.html`${timeStart.format('HH:mm')}
`; // full list of formats: https://day.js.org/docs/en/display/format
88 | },
89 | },
90 | ];
91 |
92 | // Configuration object
93 |
94 | // Typescript usage:
95 | // import { Config } from 'gantt-schedule-timeline-calendar';
96 | // const config: Config = {...};
97 | /**
98 | * @type {import('../../dist/gstc').Config} // or {import('gantt-schedule-timeline-calendar').Config}
99 | */
100 | const config = {
101 | // for free key for your domain please visit https://gstc.neuronet.io/free-key
102 | // if you need commercial license please visit https://gantt-schedule-timeline-calendar.neuronet.io/pricing
103 |
104 | licenseKey:
105 | '====BEGIN LICENSE KEY====\nXOfH/lnVASM6et4Co473t9jPIvhmQ/l0X3Ewog30VudX6GVkOB0n3oDx42NtADJ8HjYrhfXKSNu5EMRb5KzCLvMt/pu7xugjbvpyI1glE7Ha6E5VZwRpb4AC8T1KBF67FKAgaI7YFeOtPFROSCKrW5la38jbE5fo+q2N6wAfEti8la2ie6/7U2V+SdJPqkm/mLY/JBHdvDHoUduwe4zgqBUYLTNUgX6aKdlhpZPuHfj2SMeB/tcTJfH48rN1mgGkNkAT9ovROwI7ReLrdlHrHmJ1UwZZnAfxAC3ftIjgTEHsd/f+JrjW6t+kL6Ef1tT1eQ2DPFLJlhluTD91AsZMUg==||U2FsdGVkX1/SWWqU9YmxtM0T6Nm5mClKwqTaoF9wgZd9rNw2xs4hnY8Ilv8DZtFyNt92xym3eB6WA605N5llLm0D68EQtU9ci1rTEDopZ1ODzcqtTVSoFEloNPFSfW6LTIC9+2LSVBeeHXoLEQiLYHWihHu10Xll3KsH9iBObDACDm1PT7IV4uWvNpNeuKJc\npY3C5SG+3sHRX1aeMnHlKLhaIsOdw2IexjvMqocVpfRpX4wnsabNA0VJ3k95zUPS3vTtSegeDhwbl6j+/FZcGk9i+gAy6LuetlKuARjPYn2LH5Be3Ah+ggSBPlxf3JW9rtWNdUoFByHTcFlhzlU9HnpnBUrgcVMhCQ7SAjN9h2NMGmCr10Rn4OE0WtelNqYVig7KmENaPvFT+k2I0cYZ4KWwxxsQNKbjEAxJxrzK4HkaczCvyQbzj4Ppxx/0q+Cns44OeyWcwYD/vSaJm4Kptwpr+L4y5BoSO/WeqhSUQQ85nvOhtE0pSH/ZXYo3pqjPdQRfNm6NFeBl2lwTmZUEuw==\n====END LICENSE KEY====',
106 |
107 | list: {
108 | columns: {
109 | data: GSTC.api.fromArray(columnsFromDB),
110 | },
111 | rows: GSTC.api.fromArray(rowsFromDB),
112 | },
113 | chart: {
114 | items: GSTC.api.fromArray(itemsFromDB),
115 | calendarLevels: [hours, minutes],
116 | time: {
117 | zoom: 13,
118 | from: GSTC.api.date('2020-01-01').startOf('month').valueOf(),
119 | to: GSTC.api.date('2020-01-01').endOf('month').valueOf(),
120 | },
121 | },
122 | };
123 |
124 | // Generate GSTC state from configuration object
125 | const state = GSTC.api.stateFromConfig(config);
126 |
127 | // for testing
128 | globalThis.state = state;
129 |
130 | const element = document.getElementById('gstc');
131 | if (!element) throw new Error('element not found');
132 |
133 | // Mount the component
134 | const app = GSTC({
135 | element,
136 | state,
137 | });
138 |
139 | //for testing
140 | globalThis.gstc = app;
141 |
--------------------------------------------------------------------------------
/examples/simple/simple.umd.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | GSTC simple example
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
119 |
120 |
121 |
--------------------------------------------------------------------------------