diff --git a/404.html b/404.html index 7027053..79d4b8d 100644 --- a/404.html +++ b/404.html @@ -1,6 +1,6 @@ Error 404 - NoLogWeb - - - -
- - -``` - -## Usage with NPM and ES modules - -```sh -npm install fullcalendar -``` - -```js -import { Calendar } from 'fullcalendar' - -document.addEventListener('DOMContentLoaded', function() { - const calendarEl = document.getElementById('calendar') - const calendar = new Calendar(calendarEl, { - initialView: 'dayGridMonth' - }) - calendar.render() -}) -``` diff --git a/fullcalendar-main/bundle/package.json b/fullcalendar-main/bundle/package.json deleted file mode 100644 index de1608f..0000000 --- a/fullcalendar-main/bundle/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "fullcalendar", - "version": "6.1.11", - "title": "FullCalendar Standard Bundle", - "description": "Easily render a full-sized drag & drop calendar with a combination of standard plugins", - "homepage": "https://fullcalendar.io/docs/initialize-globals", - "dependencies": { - "@fullcalendar/core": "~6.1.11", - "@fullcalendar/daygrid": "~6.1.11", - "@fullcalendar/interaction": "~6.1.11", - "@fullcalendar/list": "~6.1.11", - "@fullcalendar/multimonth": "~6.1.11", - "@fullcalendar/timegrid": "~6.1.11" - }, - "devDependencies": { - "@fullcalendar-scripts/standard": "*" - }, - "scripts": { - "build": "standard-scripts pkg:build", - "clean": "standard-scripts pkg:clean", - "lint": "eslint ." - }, - "type": "module", - "tsConfig": { - "extends": "@fullcalendar-scripts/standard/config/tsconfig.browser.json", - "compilerOptions": { - "rootDir": "./src", - "outDir": "./dist/.tsout" - }, - "include": [ - "./src/**/*" - ] - }, - "buildConfig": { - "exports": { - ".": { - "iife": true - } - }, - "iifeGlobals": { - ".": "FullCalendar", - "*": "" - } - }, - "publishConfig": { - "directory": "./dist", - "linkDirectory": true - } -} diff --git a/fullcalendar-main/bundle/src/index.global.ts b/fullcalendar-main/bundle/src/index.global.ts deleted file mode 100644 index d6040ae..0000000 --- a/fullcalendar-main/bundle/src/index.global.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as Internal from '@fullcalendar/core/internal' -import * as Preact from '@fullcalendar/core/preact' - -export { Internal, Preact } -export * from './index.js' diff --git a/fullcalendar-main/bundle/src/index.ts b/fullcalendar-main/bundle/src/index.ts deleted file mode 100644 index 8d83cd5..0000000 --- a/fullcalendar-main/bundle/src/index.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { globalPlugins } from '@fullcalendar/core' -import interactionPlugin from '@fullcalendar/interaction' -import dayGridPlugin from '@fullcalendar/daygrid' -import timeGridPlugin from '@fullcalendar/timegrid' -import listPlugin from '@fullcalendar/list' -import multiMonthPlugin from '@fullcalendar/multimonth' - -globalPlugins.push( - interactionPlugin, - dayGridPlugin, - timeGridPlugin, - listPlugin, - multiMonthPlugin, -) - -export * from '@fullcalendar/core' -export * from '@fullcalendar/interaction' // for Draggable diff --git a/fullcalendar-main/package.json b/fullcalendar-main/package.json deleted file mode 100644 index f9fbbfa..0000000 --- a/fullcalendar-main/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "private": true, - "name": "@fullcalendar-monorepos/standard", - "description": "Full-sized drag & drop event calendar in JavaScript", - "version": "6.1.11", - "keywords": [ - "calendar", - "event", - "full-sized", - "fullcalendar" - ], - "homepage": "https://fullcalendar.io", - "bugs": "https://fullcalendar.io/reporting-bugs", - "repository": { - "type": "git", - "url": "https://github.com/fullcalendar/fullcalendar.git" - }, - "license": "MIT", - "author": { - "name": "Adam Shaw", - "email": "arshaw@arshaw.com", - "url": "http://arshaw.com/" - }, - "copyright": "2023 Adam Shaw", - "devDependencies": { - "@fullcalendar-scripts/standard": "*" - }, - "type": "module", - "scripts": { - "postinstall": "standard-scripts postinstall", - "lint": "standard-scripts lint", - "build": "standard-scripts build", - "dev": "standard-scripts dev", - "test": "standard-scripts test", - "test:dev": "standard-scripts test --dev", - "clean": "standard-scripts clean", - "ci": "pnpm run lint && pnpm run build && pnpm run test" - }, - "engines": { - "pnpm": ">=7.9.5" - }, - "pnpm": { - "patchedDependencies": { - "jasmine-jquery@2.1.1": "scripts/patches/jasmine-jquery@2.1.1.patch" - } - } -} diff --git a/fullcalendar-main/packages/bootstrap4/.eslintrc.cjs b/fullcalendar-main/packages/bootstrap4/.eslintrc.cjs deleted file mode 100644 index c58b543..0000000 --- a/fullcalendar-main/packages/bootstrap4/.eslintrc.cjs +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - root: true, - extends: require.resolve('@fullcalendar-scripts/standard/config/eslint.pkg.browser.cjs'), -} diff --git a/fullcalendar-main/packages/bootstrap4/README.md b/fullcalendar-main/packages/bootstrap4/README.md deleted file mode 100644 index 8bce53a..0000000 --- a/fullcalendar-main/packages/bootstrap4/README.md +++ /dev/null @@ -1,46 +0,0 @@ - -# FullCalendar Bootstrap 4 Plugin - -[Bootstrap 4](https://getbootstrap.com/docs/4.6/getting-started/introduction/) theme for [FullCalendar](https://fullcalendar.io) - -> For [Bootstrap 5](https://getbootstrap.com/), use the [@fullcalendar/bootstrap5](https://github.com/fullcalendar/fullcalendar/tree/main/packages/bootstrap5) package - -## Installation - -First, ensure the necessary Bootstrap packages are installed: - -```sh -npm install bootstrap@4 @fortawesome/fontawesome-free -``` - -Then, install the FullCalendar core package, the Bootstrap plugin, and any other plugins (like [daygrid](https://fullcalendar.io/docs/month-view)): - -```sh -npm install @fullcalendar/core @fullcalendar/bootstrap @fullcalendar/daygrid -``` - -## Usage - -Instantiate a Calendar with the necessary plugins and options: - -```js -import { Calendar } from '@fullcalendar/core' -import bootstrapPlugin from '@fullcalendar/bootstrap' -import dayGridPlugin from '@fullcalendar/daygrid' - -// import third-party stylesheets directly from your JS -import 'bootstrap/dist/css/bootstrap.css' -import '@fortawesome/fontawesome-free/css/all.css' // needs additional webpack config! - -const calendarEl = document.getElementById('calendar') -const calendar = new Calendar(calendarEl, { - plugins: [ - bootstrapPlugin, - dayGridPlugin - ], - themeSystem: 'bootstrap', // important! - initialView: 'dayGridMonth' -}) - -calendar.render() -``` diff --git a/fullcalendar-main/packages/bootstrap4/package.json b/fullcalendar-main/packages/bootstrap4/package.json deleted file mode 100644 index 90d40fc..0000000 --- a/fullcalendar-main/packages/bootstrap4/package.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "@fullcalendar/bootstrap", - "version": "6.1.11", - "title": "FullCalendar Bootstrap 4 Plugin", - "description": "Bootstrap 4 theme for FullCalendar", - "keywords": [ - "bootstrap", - "bootstrap4" - ], - "homepage": "https://fullcalendar.io/docs/bootstrap4", - "peerDependencies": { - "@fullcalendar/core": "~6.1.11" - }, - "devDependencies": { - "@fullcalendar/core": "~6.1.11", - "@fullcalendar-scripts/standard": "*" - }, - "scripts": { - "build": "standard-scripts pkg:build", - "clean": "standard-scripts pkg:clean", - "lint": "eslint ." - }, - "type": "module", - "tsConfig": { - "extends": "@fullcalendar-scripts/standard/config/tsconfig.browser.json", - "compilerOptions": { - "rootDir": "./src", - "outDir": "./dist/.tsout" - }, - "include": [ - "./src/**/*" - ] - }, - "buildConfig": { - "exports": { - ".": { - "iife": true - }, - "./internal": {} - }, - "iifeGlobals": { - ".": "FullCalendar.Bootstrap", - "./internal": "FullCalendar.Bootstrap.Internal" - } - }, - "publishConfig": { - "directory": "./dist", - "linkDirectory": true - } -} diff --git a/fullcalendar-main/packages/bootstrap4/src/BootstrapTheme.ts b/fullcalendar-main/packages/bootstrap4/src/BootstrapTheme.ts deleted file mode 100644 index 973edaa..0000000 --- a/fullcalendar-main/packages/bootstrap4/src/BootstrapTheme.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { Theme } from '@fullcalendar/core/internal' - -class BootstrapTheme extends Theme { -} - -BootstrapTheme.prototype.classes = { - root: 'fc-theme-bootstrap', // TODO: compute this off of registered theme name - table: 'table-bordered', // don't attache the `table` class. we only want the borders, not any layout - tableCellShaded: 'table-active', - buttonGroup: 'btn-group', - button: 'btn btn-primary', - buttonActive: 'active', - popover: 'popover', - popoverHeader: 'popover-header', - popoverContent: 'popover-body', -} - -BootstrapTheme.prototype.baseIconClass = 'fa' -BootstrapTheme.prototype.iconClasses = { - close: 'fa-times', - prev: 'fa-chevron-left', - next: 'fa-chevron-right', - prevYear: 'fa-angle-double-left', - nextYear: 'fa-angle-double-right', -} -BootstrapTheme.prototype.rtlIconClasses = { - prev: 'fa-chevron-right', - next: 'fa-chevron-left', - prevYear: 'fa-angle-double-right', - nextYear: 'fa-angle-double-left', -} - -BootstrapTheme.prototype.iconOverrideOption = 'bootstrapFontAwesome' // TODO: make TS-friendly. move the option-processing into this plugin -BootstrapTheme.prototype.iconOverrideCustomButtonOption = 'bootstrapFontAwesome' -BootstrapTheme.prototype.iconOverridePrefix = 'fa-' - -export { BootstrapTheme } diff --git a/fullcalendar-main/packages/bootstrap4/src/index.css b/fullcalendar-main/packages/bootstrap4/src/index.css deleted file mode 100644 index 5f0cb05..0000000 --- a/fullcalendar-main/packages/bootstrap4/src/index.css +++ /dev/null @@ -1,12 +0,0 @@ - -.fc-theme-bootstrap { - - & a:not([href]) { - color: inherit; // natural color for navlinks - } - - & .fc-more-link:hover { - text-decoration: none; - } - -} diff --git a/fullcalendar-main/packages/bootstrap4/src/index.global.ts b/fullcalendar-main/packages/bootstrap4/src/index.global.ts deleted file mode 100644 index c70b8e6..0000000 --- a/fullcalendar-main/packages/bootstrap4/src/index.global.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { globalPlugins } from '@fullcalendar/core' -import plugin from './index.js' -import * as Internal from './internal.js' - -globalPlugins.push(plugin) - -export { plugin as default, Internal } -export * from './index.js' diff --git a/fullcalendar-main/packages/bootstrap4/src/index.ts b/fullcalendar-main/packages/bootstrap4/src/index.ts deleted file mode 100644 index 66e13ee..0000000 --- a/fullcalendar-main/packages/bootstrap4/src/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { createPlugin, PluginDef } from '@fullcalendar/core' -import { BootstrapTheme } from './BootstrapTheme.js' -import './index.css' - -export default createPlugin({ - name: '<%= pkgName %>', - themeClasses: { - bootstrap: BootstrapTheme, - }, -}) as PluginDef diff --git a/fullcalendar-main/packages/bootstrap4/src/internal.ts b/fullcalendar-main/packages/bootstrap4/src/internal.ts deleted file mode 100644 index 5361cda..0000000 --- a/fullcalendar-main/packages/bootstrap4/src/internal.ts +++ /dev/null @@ -1,3 +0,0 @@ -import './index.css' - -export { BootstrapTheme } from './BootstrapTheme.js' diff --git a/fullcalendar-main/packages/bootstrap5/.eslintrc.cjs b/fullcalendar-main/packages/bootstrap5/.eslintrc.cjs deleted file mode 100644 index c58b543..0000000 --- a/fullcalendar-main/packages/bootstrap5/.eslintrc.cjs +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - root: true, - extends: require.resolve('@fullcalendar-scripts/standard/config/eslint.pkg.browser.cjs'), -} diff --git a/fullcalendar-main/packages/bootstrap5/README.md b/fullcalendar-main/packages/bootstrap5/README.md deleted file mode 100644 index a83ec28..0000000 --- a/fullcalendar-main/packages/bootstrap5/README.md +++ /dev/null @@ -1,44 +0,0 @@ - -# FullCalendar Bootstrap 5 Plugin - -[Bootstrap 5](https://getbootstrap.com/) theme for [FullCalendar](https://fullcalendar.io) - -## Installation - -First, ensure the necessary Bootstrap packages are installed: - -```sh -npm install bootstrap@5 bootstrap-icons -``` - -Then, install the FullCalendar core package, the Bootstrap plugin, and any other plugins (like [daygrid](https://fullcalendar.io/docs/month-view)): - -```sh -npm install @fullcalendar/core @fullcalendar/bootstrap5 @fullcalendar/daygrid -``` - -## Usage - -Instantiate a Calendar with the necessary plugins and options: - -```js -import { Calendar } from '@fullcalendar/core' -import bootstrap5Plugin from '@fullcalendar/bootstrap5' -import dayGridPlugin from '@fullcalendar/daygrid' - -// import bootstrap stylesheets directly from your JS -import 'bootstrap/dist/css/bootstrap.css' -import 'bootstrap-icons/font/bootstrap-icons.css' // needs additional webpack config! - -const calendarEl = document.getElementById('calendar') -const calendar = new Calendar(calendarEl, { - plugins: [ - bootstrap5Plugin, - dayGridPlugin - ], - themeSystem: 'bootstrap5', // important! - initialView: 'dayGridMonth' -}) - -calendar.render() -``` diff --git a/fullcalendar-main/packages/bootstrap5/package.json b/fullcalendar-main/packages/bootstrap5/package.json deleted file mode 100644 index fe3a718..0000000 --- a/fullcalendar-main/packages/bootstrap5/package.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "@fullcalendar/bootstrap5", - "version": "6.1.11", - "title": "FullCalendar Bootstrap 5 Plugin", - "description": "Bootstrap 5 theme for FullCalendar", - "keywords": [ - "bootstrap", - "bootstrap5" - ], - "homepage": "https://fullcalendar.io/docs/bootstrap5", - "peerDependencies": { - "@fullcalendar/core": "~6.1.11" - }, - "devDependencies": { - "@fullcalendar/core": "~6.1.11", - "@fullcalendar-scripts/standard": "*" - }, - "scripts": { - "build": "standard-scripts pkg:build", - "clean": "standard-scripts pkg:clean", - "lint": "eslint ." - }, - "type": "module", - "tsConfig": { - "extends": "@fullcalendar-scripts/standard/config/tsconfig.browser.json", - "compilerOptions": { - "rootDir": "./src", - "outDir": "./dist/.tsout" - }, - "include": [ - "./src/**/*" - ] - }, - "buildConfig": { - "exports": { - ".": { - "iife": true - }, - "./internal": {} - }, - "iifeGlobals": { - ".": "FullCalendar.Bootstrap5", - "./internal": "FullCalendar.Bootstrap5.Internal" - } - }, - "publishConfig": { - "directory": "./dist", - "linkDirectory": true - } -} diff --git a/fullcalendar-main/packages/bootstrap5/src/BootstrapTheme.ts b/fullcalendar-main/packages/bootstrap5/src/BootstrapTheme.ts deleted file mode 100644 index dd67468..0000000 --- a/fullcalendar-main/packages/bootstrap5/src/BootstrapTheme.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { Theme } from '@fullcalendar/core/internal' - -export class BootstrapTheme extends Theme { -} - -BootstrapTheme.prototype.classes = { - root: 'fc-theme-bootstrap5', - tableCellShaded: 'fc-theme-bootstrap5-shaded', - buttonGroup: 'btn-group', - button: 'btn btn-primary', - buttonActive: 'active', - popover: 'popover', - popoverHeader: 'popover-header', - popoverContent: 'popover-body', -} - -BootstrapTheme.prototype.baseIconClass = 'bi' -BootstrapTheme.prototype.iconClasses = { - close: 'bi-x-lg', - prev: 'bi-chevron-left', - next: 'bi-chevron-right', - prevYear: 'bi-chevron-double-left', - nextYear: 'bi-chevron-double-right', -} -BootstrapTheme.prototype.rtlIconClasses = { - prev: 'bi-chevron-right', - next: 'bi-chevron-left', - prevYear: 'bi-chevron-double-right', - nextYear: 'bi-chevron-double-left', -} - -// wtf -BootstrapTheme.prototype.iconOverrideOption = 'buttonIcons' // TODO: make TS-friendly -BootstrapTheme.prototype.iconOverrideCustomButtonOption = 'icon' -BootstrapTheme.prototype.iconOverridePrefix = 'bi-' - -export { Theme } diff --git a/fullcalendar-main/packages/bootstrap5/src/index.css b/fullcalendar-main/packages/bootstrap5/src/index.css deleted file mode 100644 index 776b1b7..0000000 --- a/fullcalendar-main/packages/bootstrap5/src/index.css +++ /dev/null @@ -1,25 +0,0 @@ - -.fc-theme-bootstrap5 { - - & a:not([href]) { - color: inherit; - text-decoration: inherit; - } - - & .fc-list, - & .fc-scrollgrid, - & td, - & th { - border: 1px solid var(--bs-gray-400); - } - - // HACK: reapply core styles after highe-precedence border statement above - & .fc-scrollgrid { - border-right-width: 0; - border-bottom-width: 0; - } -} - -.fc-theme-bootstrap5-shaded { - background-color: var(--bs-gray-200); -} diff --git a/fullcalendar-main/packages/bootstrap5/src/index.global.ts b/fullcalendar-main/packages/bootstrap5/src/index.global.ts deleted file mode 100644 index c70b8e6..0000000 --- a/fullcalendar-main/packages/bootstrap5/src/index.global.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { globalPlugins } from '@fullcalendar/core' -import plugin from './index.js' -import * as Internal from './internal.js' - -globalPlugins.push(plugin) - -export { plugin as default, Internal } -export * from './index.js' diff --git a/fullcalendar-main/packages/bootstrap5/src/index.ts b/fullcalendar-main/packages/bootstrap5/src/index.ts deleted file mode 100644 index 280071f..0000000 --- a/fullcalendar-main/packages/bootstrap5/src/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { createPlugin, PluginDef } from '@fullcalendar/core' -import { BootstrapTheme } from './BootstrapTheme.js' -import './index.css' - -export default createPlugin({ - name: '<%= pkgName %>', - themeClasses: { - bootstrap5: BootstrapTheme, - }, -}) as PluginDef diff --git a/fullcalendar-main/packages/bootstrap5/src/internal.ts b/fullcalendar-main/packages/bootstrap5/src/internal.ts deleted file mode 100644 index 5361cda..0000000 --- a/fullcalendar-main/packages/bootstrap5/src/internal.ts +++ /dev/null @@ -1,3 +0,0 @@ -import './index.css' - -export { BootstrapTheme } from './BootstrapTheme.js' diff --git a/fullcalendar-main/packages/core/.eslintrc.cjs b/fullcalendar-main/packages/core/.eslintrc.cjs deleted file mode 100644 index c58b543..0000000 --- a/fullcalendar-main/packages/core/.eslintrc.cjs +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - root: true, - extends: require.resolve('@fullcalendar-scripts/standard/config/eslint.pkg.browser.cjs'), -} diff --git a/fullcalendar-main/packages/core/README.md b/fullcalendar-main/packages/core/README.md deleted file mode 100644 index b91980e..0000000 --- a/fullcalendar-main/packages/core/README.md +++ /dev/null @@ -1,44 +0,0 @@ - -# FullCalendar Core - -FullCalendar core package for rendering a calendar - -## Installation - -This package is never used alone. Use it with least one plugin (like [daygrid](https://fullcalendar.io/docs/month-view)): - -```sh -npm install @fullcalendar/core @fullcalendar/daygrid -``` - -## Usage - -First, ensure there's a DOM element for your calendar to render into: - -```html - -
- -``` - -Then, instantiate a Calendar object with [options](https://fullcalendar.io/docs#toc) and call its `render` method: - -```js -import { Calendar } from '@fullcalendar/core' -import dayGridPlugin from '@fullcalendar/daygrid' - -const calendarEl = document.getElementById('calendar') -const calendar = new Calendar(calendarEl, { - plugins: [ - dayGridPlugin - // any other plugins - ], - initialView: 'dayGridMonth', - weekends: false, - events: [ - { title: 'Meeting', start: new Date() } - ] -}) - -calendar.render() -``` diff --git a/fullcalendar-main/packages/core/package.json b/fullcalendar-main/packages/core/package.json deleted file mode 100644 index 875d318..0000000 --- a/fullcalendar-main/packages/core/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "@fullcalendar/core", - "version": "6.1.11", - "title": "FullCalendar Core", - "description": "FullCalendar core package for rendering a calendar", - "dependencies": { - "preact": "~10.12.1" - }, - "devDependencies": { - "@fullcalendar-scripts/standard": "*", - "globby": "^13.1.2", - "handlebars": "^4.1.2" - }, - "scripts": { - "build": "standard-scripts pkg:build", - "clean": "standard-scripts pkg:clean", - "lint": "eslint ." - }, - "type": "module", - "tsConfig": { - "extends": "@fullcalendar-scripts/standard/config/tsconfig.browser.json", - "compilerOptions": { - "rootDir": "./src", - "outDir": "./dist/.tsout" - }, - "include": [ - "./src/**/*" - ] - }, - "buildConfig": { - "exports": { - ".": { - "iife": true - }, - "./preact": {}, - "./internal": {}, - "./locales-all": { - "iife": true, - "generator": "./scripts/generate-locales-all.js" - }, - "./locales/*": { - "iife": true, - "iifeGenerator": "./scripts/generate-locale-iife.js" - } - }, - "iifeGlobals": { - ".": "FullCalendar", - "./preact": "FullCalendar.Preact", - "./internal": "FullCalendar.Internal", - "preact": "", - "preact/compat": "" - } - }, - "publishConfig": { - "directory": "./dist", - "linkDirectory": true - } -} diff --git a/fullcalendar-main/packages/core/scripts/generate-locale-iife.js b/fullcalendar-main/packages/core/scripts/generate-locale-iife.js deleted file mode 100644 index 48ab798..0000000 --- a/fullcalendar-main/packages/core/scripts/generate-locale-iife.js +++ /dev/null @@ -1,21 +0,0 @@ -import { join as joinPaths, basename } from 'path' -import { fileURLToPath } from 'url' -import { readFile } from 'fs/promises' -import handlebars from 'handlebars' - -const thisPkgDir = joinPaths(fileURLToPath(import.meta.url), '../..') -const templatePath = joinPaths(thisPkgDir, 'src/locales/global.js.tpl') - -export function getWatchPaths() { - return [templatePath, templatePath] -} - -export default async function(config) { - const localeCode = basename(config.entryAlias) - - const templateText = await readFile(templatePath, 'utf8') - const template = handlebars.compile(templateText) - const code = template({ localeCode }) - - return code -} diff --git a/fullcalendar-main/packages/core/scripts/generate-locales-all.js b/fullcalendar-main/packages/core/scripts/generate-locales-all.js deleted file mode 100644 index d946336..0000000 --- a/fullcalendar-main/packages/core/scripts/generate-locales-all.js +++ /dev/null @@ -1,27 +0,0 @@ -import { join as joinPaths } from 'path' -import { fileURLToPath } from 'url' -import { readFile } from 'fs/promises' -import { globby } from 'globby' -import handlebars from 'handlebars' - -const thisPkgDir = joinPaths(fileURLToPath(import.meta.url), '../..') -const templatePath = joinPaths(thisPkgDir, 'src/locales-all.js.tpl') -const localesDir = joinPaths(thisPkgDir, 'src/locales') - -export function getWatchPaths() { - return [ - templatePath, - localesDir, - ] -} - -export default async function() { - const localeFilenames = await globby('*.ts', { cwd: localesDir }) - const localeCodes = localeFilenames.map((filename) => filename.replace(/\.ts$/, '')) - - const templateText = await readFile(templatePath, 'utf8') - const template = handlebars.compile(templateText) - const code = template({ localeCodes }) - - return code -} diff --git a/fullcalendar-main/packages/core/src/Calendar.tsx b/fullcalendar-main/packages/core/src/Calendar.tsx deleted file mode 100644 index 2299094..0000000 --- a/fullcalendar-main/packages/core/src/Calendar.tsx +++ /dev/null @@ -1,156 +0,0 @@ -import { CalendarOptions } from './options.js' -import { DelayedRunner } from './util/DelayedRunner.js' -import { CalendarDataManager } from './reducers/CalendarDataManager.js' -import { Action } from './reducers/Action.js' -import { CalendarData } from './reducers/data-types.js' -import { CalendarRoot } from './CalendarRoot.js' -import { CalendarContent } from './CalendarContent.js' -import { createElement, render, flushSync } from './preact.js' -import { isArraysEqual } from './util/array.js' -import { CssDimValue } from './scrollgrid/util.js' -import { applyStyleProp } from './util/dom-manip.js' -import { RenderId } from './content-inject/RenderId.js' -import { CalendarImpl } from './api/CalendarImpl.js' -import { ensureElHasStyles } from './styleUtils.js' - -export class Calendar extends CalendarImpl { - el: HTMLElement - - private currentData: CalendarData - private renderRunner: DelayedRunner - private isRendering = false - private isRendered = false - private currentClassNames: string[] = [] - private customContentRenderId = 0 - - constructor(el: HTMLElement, optionOverrides: CalendarOptions = {}) { - super() - ensureElHasStyles(el) - - this.el = el - this.renderRunner = new DelayedRunner(this.handleRenderRequest) - - new CalendarDataManager({ // eslint-disable-line no-new - optionOverrides, - calendarApi: this, - onAction: this.handleAction, - onData: this.handleData, - }) - } - - private handleAction = (action: Action) => { - // actions we know we want to render immediately - switch (action.type) { - case 'SET_EVENT_DRAG': - case 'SET_EVENT_RESIZE': - this.renderRunner.tryDrain() - } - } - - private handleData = (data: CalendarData) => { - this.currentData = data - this.renderRunner.request(data.calendarOptions.rerenderDelay) - } - - private handleRenderRequest = () => { - if (this.isRendering) { - this.isRendered = true - let { currentData } = this - - flushSync(() => { - render( - - {(classNames, height, isHeightAuto, forPrint) => { - this.setClassNames(classNames) - this.setHeight(height) - - return ( - - - - ) - }} - , - this.el, - ) - }) - } else if (this.isRendered) { - this.isRendered = false - render(null, this.el) - - this.setClassNames([]) - this.setHeight('') - } - } - - render() { - let wasRendering = this.isRendering - - if (!wasRendering) { - this.isRendering = true - } else { - this.customContentRenderId += 1 - } - - this.renderRunner.request() - - if (wasRendering) { - this.updateSize() - } - } - - destroy(): void { - if (this.isRendering) { - this.isRendering = false - this.renderRunner.request() - } - } - - updateSize(): void { - flushSync(() => { - super.updateSize() - }) - } - - batchRendering(func): void { - this.renderRunner.pause('batchRendering') - func() - this.renderRunner.resume('batchRendering') - } - - pauseRendering() { // available to plugins - this.renderRunner.pause('pauseRendering') - } - - resumeRendering() { // available to plugins - this.renderRunner.resume('pauseRendering', true) - } - - resetOptions(optionOverrides, changedOptionNames?: string[]) { - this.currentDataManager.resetOptions(optionOverrides, changedOptionNames) - } - - private setClassNames(classNames: string[]) { - if (!isArraysEqual(classNames, this.currentClassNames)) { - let { classList } = this.el - - for (let className of this.currentClassNames) { - classList.remove(className) - } - - for (let className of classNames) { - classList.add(className) - } - - this.currentClassNames = classNames - } - } - - private setHeight(height: CssDimValue) { - applyStyleProp(this.el, 'height', height) - } -} diff --git a/fullcalendar-main/packages/core/src/CalendarContent.tsx b/fullcalendar-main/packages/core/src/CalendarContent.tsx deleted file mode 100644 index 4eb5ecc..0000000 --- a/fullcalendar-main/packages/core/src/CalendarContent.tsx +++ /dev/null @@ -1,289 +0,0 @@ -import { ViewContextType, buildViewContext } from './ViewContext.js' -import { ViewSpec } from './structs/view-spec.js' -import { ViewProps } from './View.js' -import { Toolbar } from './Toolbar.js' -import { DateProfileGenerator, DateProfile } from './DateProfileGenerator.js' -import { rangeContainsMarker } from './datelib/date-range.js' -import { memoize } from './util/memoize.js' -import { DateMarker } from './datelib/marker.js' -import { CalendarData } from './reducers/data-types.js' -import { ViewPropsTransformerClass } from './plugin-system-struct.js' -import { createElement, createRef, Fragment, VNode } from './preact.js' -import { ViewHarness } from './ViewHarness.js' -import { - Interaction, - InteractionSettingsInput, - InteractionClass, - parseInteractionSettings, - interactionSettingsStore, -} from './interactions/interaction.js' -import { DateComponent } from './component/DateComponent.js' -import { EventClicking } from './interactions/EventClicking.js' -import { EventHovering } from './interactions/EventHovering.js' -import { getNow } from './reducers/current-date.js' -import { CalendarInteraction } from './calendar-utils.js' -import { DelayedRunner } from './util/DelayedRunner.js' -import { PureComponent } from './vdom-util.js' -import { getUniqueDomId } from './util/dom-manip.js' - -export interface CalendarContentProps extends CalendarData { - forPrint: boolean - isHeightAuto: boolean -} - -export class CalendarContent extends PureComponent { - private buildViewContext = memoize(buildViewContext) - private buildViewPropTransformers = memoize(buildViewPropTransformers) - private buildToolbarProps = memoize(buildToolbarProps) - private headerRef = createRef() - private footerRef = createRef() - private interactionsStore: { [componentUid: string]: Interaction[] } = {} - private calendarInteractions: CalendarInteraction[] - - // eslint-disable-next-line - state = { - viewLabelId: getUniqueDomId(), - } - - /* - renders INSIDE of an outer div - */ - render() { - let { props } = this - let { toolbarConfig, options } = props - - let toolbarProps = this.buildToolbarProps( - props.viewSpec, - props.dateProfile, - props.dateProfileGenerator, - props.currentDate, - getNow(props.options.now, props.dateEnv), // TODO: use NowTimer???? - props.viewTitle, - ) - - let viewVGrow = false - let viewHeight: string | number = '' - let viewAspectRatio: number | undefined - - if (props.isHeightAuto || props.forPrint) { - viewHeight = '' - } else if (options.height != null) { - viewVGrow = true - } else if (options.contentHeight != null) { - viewHeight = options.contentHeight - } else { - viewAspectRatio = Math.max(options.aspectRatio, 0.5) // prevent from getting too tall - } - - let viewContext = this.buildViewContext( - props.viewSpec, - props.viewApi, - props.options, - props.dateProfileGenerator, - props.dateEnv, - props.theme, - props.pluginHooks, - props.dispatch, - props.getCurrentData, - props.emitter, - props.calendarApi, - this.registerInteractiveComponent, - this.unregisterInteractiveComponent, - ) - - let viewLabelId = (toolbarConfig.header && toolbarConfig.header.hasTitle) - ? this.state.viewLabelId - : undefined - - return ( - - {toolbarConfig.header && ( - - )} - - {this.renderView(props)} - {this.buildAppendContent()} - - {toolbarConfig.footer && ( - - )} - - ) - } - - componentDidMount() { - let { props } = this - - this.calendarInteractions = props.pluginHooks.calendarInteractions - .map((CalendarInteractionClass) => new CalendarInteractionClass(props)) - - window.addEventListener('resize', this.handleWindowResize) - - let { propSetHandlers } = props.pluginHooks - for (let propName in propSetHandlers) { - propSetHandlers[propName](props[propName], props) - } - } - - componentDidUpdate(prevProps: CalendarContentProps) { - let { props } = this - - let { propSetHandlers } = props.pluginHooks - for (let propName in propSetHandlers) { - if (props[propName] !== prevProps[propName]) { - propSetHandlers[propName](props[propName], props) - } - } - } - - componentWillUnmount() { - window.removeEventListener('resize', this.handleWindowResize) - this.resizeRunner.clear() - - for (let interaction of this.calendarInteractions) { - interaction.destroy() - } - - this.props.emitter.trigger('_unmount') - } - - buildAppendContent(): VNode { - let { props } = this - - let children = props.pluginHooks.viewContainerAppends.map( - (buildAppendContent) => buildAppendContent(props), - ) - - return createElement(Fragment, {}, ...children) - } - - renderView(props: CalendarContentProps) { - let { pluginHooks } = props - let { viewSpec } = props - - let viewProps: ViewProps = { - dateProfile: props.dateProfile, - businessHours: props.businessHours, - eventStore: props.renderableEventStore, // ! - eventUiBases: props.eventUiBases, - dateSelection: props.dateSelection, - eventSelection: props.eventSelection, - eventDrag: props.eventDrag, - eventResize: props.eventResize, - isHeightAuto: props.isHeightAuto, - forPrint: props.forPrint, - } - - let transformers = this.buildViewPropTransformers(pluginHooks.viewPropsTransformers) - - for (let transformer of transformers) { - Object.assign( - viewProps, - transformer.transform(viewProps, props), - ) - } - - let ViewComponent = viewSpec.component - - return ( - - ) - } - - // Component Registration - // ----------------------------------------------------------------------------------------------------------------- - - registerInteractiveComponent = (component: DateComponent, settingsInput: InteractionSettingsInput) => { - let settings = parseInteractionSettings(component, settingsInput) - let DEFAULT_INTERACTIONS: InteractionClass[] = [ - EventClicking, - EventHovering, - ] - let interactionClasses: InteractionClass[] = DEFAULT_INTERACTIONS.concat( - this.props.pluginHooks.componentInteractions, - ) - let interactions = interactionClasses.map((TheInteractionClass) => new TheInteractionClass(settings)) - - this.interactionsStore[component.uid] = interactions - interactionSettingsStore[component.uid] = settings - } - - unregisterInteractiveComponent = (component: DateComponent) => { - let listeners = this.interactionsStore[component.uid] - - if (listeners) { - for (let listener of listeners) { - listener.destroy() - } - delete this.interactionsStore[component.uid] - } - - delete interactionSettingsStore[component.uid] - } - - // Resizing - // ----------------------------------------------------------------------------------------------------------------- - - resizeRunner = new DelayedRunner(() => { - this.props.emitter.trigger('_resize', true) // should window resizes be considered "forced" ? - this.props.emitter.trigger('windowResize', { view: this.props.viewApi }) - }) - - handleWindowResize = (ev: UIEvent) => { - let { options } = this.props - - if ( - options.handleWindowResize && - ev.target === window // avoid jqui events - ) { - this.resizeRunner.request(options.windowResizeDelay) - } - } -} - -function buildToolbarProps( - viewSpec: ViewSpec, - dateProfile: DateProfile, - dateProfileGenerator: DateProfileGenerator, - currentDate: DateMarker, - now: DateMarker, - title: string, -) { - // don't force any date-profiles to valid date profiles (the `false`) so that we can tell if it's invalid - let todayInfo = dateProfileGenerator.build(now, undefined, false) // TODO: need `undefined` or else INFINITE LOOP for some reason - let prevInfo = dateProfileGenerator.buildPrev(dateProfile, currentDate, false) - let nextInfo = dateProfileGenerator.buildNext(dateProfile, currentDate, false) - - return { - title, - activeButton: viewSpec.type, - navUnit: viewSpec.singleUnit, - isTodayEnabled: todayInfo.isValid && !rangeContainsMarker(dateProfile.currentRange, now), - isPrevEnabled: prevInfo.isValid, - isNextEnabled: nextInfo.isValid, - } -} - -// Plugin -// ----------------------------------------------------------------------------------------------------------------- - -function buildViewPropTransformers(theClasses: ViewPropsTransformerClass[]) { - return theClasses.map((TheClass) => new TheClass()) -} diff --git a/fullcalendar-main/packages/core/src/CalendarContext.ts b/fullcalendar-main/packages/core/src/CalendarContext.ts deleted file mode 100644 index acba94a..0000000 --- a/fullcalendar-main/packages/core/src/CalendarContext.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { DateEnv } from './datelib/env.js' -import { BaseOptionsRefined, CalendarListeners } from './options.js' -import { PluginHooks } from './plugin-system-struct.js' -import { Emitter } from './common/Emitter.js' -import { Action } from './reducers/Action.js' -import { CalendarImpl } from './api/CalendarImpl.js' -import { CalendarData } from './reducers/data-types.js' - -export interface CalendarContext { - dateEnv: DateEnv - options: BaseOptionsRefined // does not have calendar-specific properties. aims to be compatible with ViewOptionsRefined - pluginHooks: PluginHooks - emitter: Emitter - dispatch(action: Action): void - getCurrentData(): CalendarData - calendarApi: CalendarImpl -} diff --git a/fullcalendar-main/packages/core/src/CalendarRoot.tsx b/fullcalendar-main/packages/core/src/CalendarRoot.tsx deleted file mode 100644 index 1b27c77..0000000 --- a/fullcalendar-main/packages/core/src/CalendarRoot.tsx +++ /dev/null @@ -1,70 +0,0 @@ -import { ComponentChildren, flushSync } from './preact.js' -import { BaseComponent } from './vdom-util.js' -import { CssDimValue } from './scrollgrid/util.js' -import { CalendarOptions, CalendarListeners } from './options.js' -import { Theme } from './theme/Theme.js' -import { getCanVGrowWithinCell } from './util/table-styling.js' -import { Emitter } from './common/Emitter.js' - -export interface CalendarRootProps { - options: CalendarOptions - theme: Theme - emitter: Emitter - children: (classNames: string[], height: CssDimValue, isHeightAuto: boolean, forPrint: boolean) => ComponentChildren -} - -interface CalendarRootState { - forPrint: boolean -} - -export class CalendarRoot extends BaseComponent { - state = { - forPrint: false, - } - - render() { - let { props } = this - let { options } = props - let { forPrint } = this.state - - let isHeightAuto = forPrint || options.height === 'auto' || options.contentHeight === 'auto' - let height = (!isHeightAuto && options.height != null) ? options.height : '' - - let classNames: string[] = [ - 'fc', - forPrint ? 'fc-media-print' : 'fc-media-screen', - `fc-direction-${options.direction}`, - props.theme.getClass('root'), - ] - - if (!getCanVGrowWithinCell()) { - classNames.push('fc-liquid-hack') - } - - return props.children(classNames, height, isHeightAuto, forPrint) - } - - componentDidMount() { - let { emitter } = this.props - emitter.on('_beforeprint', this.handleBeforePrint) - emitter.on('_afterprint', this.handleAfterPrint) - } - - componentWillUnmount() { - let { emitter } = this.props - emitter.off('_beforeprint', this.handleBeforePrint) - emitter.off('_afterprint', this.handleAfterPrint) - } - - handleBeforePrint = () => { - flushSync(() => { - this.setState({ forPrint: true }) - }) - } - - handleAfterPrint = () => { - flushSync(() => { - this.setState({ forPrint: false }) - }) - } -} diff --git a/fullcalendar-main/packages/core/src/DateProfileGenerator.ts b/fullcalendar-main/packages/core/src/DateProfileGenerator.ts deleted file mode 100644 index fcd9ec1..0000000 --- a/fullcalendar-main/packages/core/src/DateProfileGenerator.ts +++ /dev/null @@ -1,455 +0,0 @@ -import { DateMarker, startOfDay, addDays } from './datelib/marker.js' -import { Duration, createDuration, asRoughDays, asRoughMs, greatestDurationDenominator } from './datelib/duration.js' -import { - DateRange, - OpenDateRange, - constrainMarkerToRange, - intersectRanges, - rangeContainsMarker, - rangesIntersect, - parseRange, - DateRangeInput, -} from './datelib/date-range.js' -import { DateEnv, DateInput } from './datelib/env.js' -import { computeVisibleDayRange } from './util/date.js' -import { getNow } from './reducers/current-date.js' -import { CalendarImpl } from './api/CalendarImpl.js' - -export interface DateProfile { - currentDate: DateMarker - isValid: boolean - validRange: OpenDateRange // dates in past/present/future the user can interact with - renderRange: DateRange // dates that get rendered (even if they're completely blank) - activeRange: DateRange | null // dates where content is rendered - currentRange: DateRange // dates for current interval (TODO: include slotMinTime/slotMaxTime?) - currentRangeUnit: string - isRangeAllDay: boolean - dateIncrement: Duration - slotMinTime: Duration - slotMaxTime: Duration -} - -export interface DateProfileGeneratorProps extends DateProfileOptions { - dateProfileGeneratorClass: DateProfileGeneratorClass // not used by DateProfileGenerator itself - duration: Duration - durationUnit: string - usesMinMaxTime: boolean - dateEnv: DateEnv - calendarApi: CalendarImpl -} - -export interface DateProfileOptions { - slotMinTime: Duration - slotMaxTime: Duration - showNonCurrentDates?: boolean - dayCount?: number - dateAlignment?: string - dateIncrement?: Duration - hiddenDays?: number[] - weekends?: boolean - nowInput?: DateInput | (() => DateInput) - validRangeInput?: DateRangeInput | ((this: CalendarImpl, nowDate: Date) => DateRangeInput) - visibleRangeInput?: DateRangeInput | ((this: CalendarImpl, nowDate: Date) => DateRangeInput) - fixedWeekCount?: boolean -} - -export type DateProfileGeneratorClass = { - new(props: DateProfileGeneratorProps): DateProfileGenerator -} - -export class DateProfileGenerator { // only publicly used for isHiddenDay :( - nowDate: DateMarker - - isHiddenDayHash: boolean[] - - constructor(protected props: DateProfileGeneratorProps) { - this.nowDate = getNow(props.nowInput, props.dateEnv) - this.initHiddenDays() - } - - /* Date Range Computation - ------------------------------------------------------------------------------------------------------------------*/ - - // Builds a structure with info about what the dates/ranges will be for the "prev" view. - buildPrev(currentDateProfile: DateProfile, currentDate: DateMarker, forceToValid?: boolean): DateProfile { - let { dateEnv } = this.props - - let prevDate = dateEnv.subtract( - dateEnv.startOf(currentDate, currentDateProfile.currentRangeUnit), // important for start-of-month - currentDateProfile.dateIncrement, - ) - - return this.build(prevDate, -1, forceToValid) - } - - // Builds a structure with info about what the dates/ranges will be for the "next" view. - buildNext(currentDateProfile: DateProfile, currentDate: DateMarker, forceToValid?: boolean): DateProfile { - let { dateEnv } = this.props - - let nextDate = dateEnv.add( - dateEnv.startOf(currentDate, currentDateProfile.currentRangeUnit), // important for start-of-month - currentDateProfile.dateIncrement, - ) - - return this.build(nextDate, 1, forceToValid) - } - - // Builds a structure holding dates/ranges for rendering around the given date. - // Optional direction param indicates whether the date is being incremented/decremented - // from its previous value. decremented = -1, incremented = 1 (default). - build(currentDate: DateMarker, direction?, forceToValid = true): DateProfile { - let { props } = this - let validRange: DateRange - let currentInfo - let isRangeAllDay - let renderRange: DateRange - let activeRange: DateRange - let isValid - - validRange = this.buildValidRange() - validRange = this.trimHiddenDays(validRange) - - if (forceToValid) { - currentDate = constrainMarkerToRange(currentDate, validRange) - } - - currentInfo = this.buildCurrentRangeInfo(currentDate, direction) - isRangeAllDay = /^(year|month|week|day)$/.test(currentInfo.unit) - renderRange = this.buildRenderRange( - this.trimHiddenDays(currentInfo.range), - currentInfo.unit, - isRangeAllDay, - ) - renderRange = this.trimHiddenDays(renderRange) - activeRange = renderRange - - if (!props.showNonCurrentDates) { - activeRange = intersectRanges(activeRange, currentInfo.range) - } - - activeRange = this.adjustActiveRange(activeRange) - activeRange = intersectRanges(activeRange, validRange) // might return null - - // it's invalid if the originally requested date is not contained, - // or if the range is completely outside of the valid range. - isValid = rangesIntersect(currentInfo.range, validRange) - - // HACK: constrain to render-range so `currentDate` is more useful to view rendering - if (!rangeContainsMarker(renderRange, currentDate)) { - currentDate = renderRange.start - } - - return { - currentDate, - - // constraint for where prev/next operations can go and where events can be dragged/resized to. - // an object with optional start and end properties. - validRange, - - // range the view is formally responsible for. - // for example, a month view might have 1st-31st, excluding padded dates - currentRange: currentInfo.range, - - // name of largest unit being displayed, like "month" or "week" - currentRangeUnit: currentInfo.unit, - - isRangeAllDay, - - // dates that display events and accept drag-n-drop - // will be `null` if no dates accept events - activeRange, - - // date range with a rendered skeleton - // includes not-active days that need some sort of DOM - renderRange, - - // Duration object that denotes the first visible time of any given day - slotMinTime: props.slotMinTime, - - // Duration object that denotes the exclusive visible end time of any given day - slotMaxTime: props.slotMaxTime, - - isValid, - - // how far the current date will move for a prev/next operation - dateIncrement: this.buildDateIncrement(currentInfo.duration), - // pass a fallback (might be null) ^ - } - } - - // Builds an object with optional start/end properties. - // Indicates the minimum/maximum dates to display. - // not responsible for trimming hidden days. - buildValidRange(): OpenDateRange { - let input = this.props.validRangeInput - let simpleInput = typeof input === 'function' - ? input.call(this.props.calendarApi, this.nowDate) - : input - - return this.refineRange(simpleInput) || - { start: null, end: null } // completely open-ended - } - - // Builds a structure with info about the "current" range, the range that is - // highlighted as being the current month for example. - // See build() for a description of `direction`. - // Guaranteed to have `range` and `unit` properties. `duration` is optional. - buildCurrentRangeInfo(date: DateMarker, direction) { - let { props } = this - let duration = null - let unit = null - let range = null - let dayCount - - if (props.duration) { - duration = props.duration - unit = props.durationUnit - range = this.buildRangeFromDuration(date, direction, duration, unit) - } else if ((dayCount = this.props.dayCount)) { - unit = 'day' - range = this.buildRangeFromDayCount(date, direction, dayCount) - } else if ((range = this.buildCustomVisibleRange(date))) { - unit = props.dateEnv.greatestWholeUnit(range.start, range.end).unit - } else { - duration = this.getFallbackDuration() - unit = greatestDurationDenominator(duration).unit - range = this.buildRangeFromDuration(date, direction, duration, unit) - } - - return { duration, unit, range } - } - - getFallbackDuration(): Duration { - return createDuration({ day: 1 }) - } - - // Returns a new activeRange to have time values (un-ambiguate) - // slotMinTime or slotMaxTime causes the range to expand. - adjustActiveRange(range: DateRange) { - let { dateEnv, usesMinMaxTime, slotMinTime, slotMaxTime } = this.props - let { start, end } = range - - if (usesMinMaxTime) { - // expand active range if slotMinTime is negative (why not when positive?) - if (asRoughDays(slotMinTime) < 0) { - start = startOfDay(start) // necessary? - start = dateEnv.add(start, slotMinTime) - } - - // expand active range if slotMaxTime is beyond one day (why not when negative?) - if (asRoughDays(slotMaxTime) > 1) { - end = startOfDay(end) // necessary? - end = addDays(end, -1) - end = dateEnv.add(end, slotMaxTime) - } - } - - return { start, end } - } - - // Builds the "current" range when it is specified as an explicit duration. - // `unit` is the already-computed greatestDurationDenominator unit of duration. - buildRangeFromDuration(date: DateMarker, direction, duration: Duration, unit) { - let { dateEnv, dateAlignment } = this.props - let start: DateMarker - let end: DateMarker - let res - - // compute what the alignment should be - if (!dateAlignment) { - let { dateIncrement } = this.props - - if (dateIncrement) { - // use the smaller of the two units - if (asRoughMs(dateIncrement) < asRoughMs(duration)) { - dateAlignment = greatestDurationDenominator(dateIncrement).unit - } else { - dateAlignment = unit - } - } else { - dateAlignment = unit - } - } - - // if the view displays a single day or smaller - if (asRoughDays(duration) <= 1) { - if (this.isHiddenDay(start)) { - start = this.skipHiddenDays(start, direction) - start = startOfDay(start) - } - } - - function computeRes() { - start = dateEnv.startOf(date, dateAlignment) - end = dateEnv.add(start, duration) - res = { start, end } - } - - computeRes() - - // if range is completely enveloped by hidden days, go past the hidden days - if (!this.trimHiddenDays(res)) { - date = this.skipHiddenDays(date, direction) - computeRes() - } - - return res - } - - // Builds the "current" range when a dayCount is specified. - buildRangeFromDayCount(date: DateMarker, direction, dayCount) { - let { dateEnv, dateAlignment } = this.props - let runningCount = 0 - let start: DateMarker = date - let end: DateMarker - - if (dateAlignment) { - start = dateEnv.startOf(start, dateAlignment) - } - - start = startOfDay(start) - start = this.skipHiddenDays(start, direction) - - end = start - do { - end = addDays(end, 1) - if (!this.isHiddenDay(end)) { - runningCount += 1 - } - } while (runningCount < dayCount) - - return { start, end } - } - - // Builds a normalized range object for the "visible" range, - // which is a way to define the currentRange and activeRange at the same time. - buildCustomVisibleRange(date: DateMarker) { - let { props } = this - let input = props.visibleRangeInput - let simpleInput = typeof input === 'function' - ? input.call(props.calendarApi, props.dateEnv.toDate(date)) - : input - - let range = this.refineRange(simpleInput) - - if (range && (range.start == null || range.end == null)) { - return null - } - - return range - } - - // Computes the range that will represent the element/cells for *rendering*, - // but which may have voided days/times. - // not responsible for trimming hidden days. - buildRenderRange(currentRange: DateRange, currentRangeUnit, isRangeAllDay) { - return currentRange - } - - // Compute the duration value that should be added/substracted to the current date - // when a prev/next operation happens. - buildDateIncrement(fallback): Duration { - let { dateIncrement } = this.props - let customAlignment - - if (dateIncrement) { - return dateIncrement - } - - if ((customAlignment = this.props.dateAlignment)) { - return createDuration(1, customAlignment) - } - - if (fallback) { - return fallback - } - - return createDuration({ days: 1 }) - } - - refineRange(rangeInput: DateRangeInput | undefined): DateRange | null { - if (rangeInput) { - let range = parseRange(rangeInput, this.props.dateEnv) - - if (range) { - range = computeVisibleDayRange(range) - } - - return range - } - - return null - } - - /* Hidden Days - ------------------------------------------------------------------------------------------------------------------*/ - - // Initializes internal variables related to calculating hidden days-of-week - initHiddenDays() { - let hiddenDays = this.props.hiddenDays || [] // array of day-of-week indices that are hidden - let isHiddenDayHash = [] // is the day-of-week hidden? (hash with day-of-week-index -> bool) - let dayCnt = 0 - let i - - if (this.props.weekends === false) { - hiddenDays.push(0, 6) // 0=sunday, 6=saturday - } - - for (i = 0; i < 7; i += 1) { - if ( - !(isHiddenDayHash[i] = hiddenDays.indexOf(i) !== -1) - ) { - dayCnt += 1 - } - } - - if (!dayCnt) { - throw new Error('invalid hiddenDays') // all days were hidden? bad. - } - - this.isHiddenDayHash = isHiddenDayHash - } - - // Remove days from the beginning and end of the range that are computed as hidden. - // If the whole range is trimmed off, returns null - trimHiddenDays(range: DateRange): DateRange | null { - let { start, end } = range - - if (start) { - start = this.skipHiddenDays(start) - } - - if (end) { - end = this.skipHiddenDays(end, -1, true) - } - - if (start == null || end == null || start < end) { - return { start, end } - } - - return null - } - - // Is the current day hidden? - // `day` is a day-of-week index (0-6), or a Date (used for UTC) - isHiddenDay(day) { - if (day instanceof Date) { - day = day.getUTCDay() - } - return this.isHiddenDayHash[day] - } - - // Incrementing the current day until it is no longer a hidden day, returning a copy. - // DOES NOT CONSIDER validRange! - // If the initial value of `date` is not a hidden day, don't do anything. - // Pass `isExclusive` as `true` if you are dealing with an end date. - // `inc` defaults to `1` (increment one day forward each time) - skipHiddenDays(date: DateMarker, inc = 1, isExclusive = false) { - while ( - this.isHiddenDayHash[(date.getUTCDay() + (isExclusive ? inc : 0) + 7) % 7] - ) { - date = addDays(date, inc) - } - return date - } -} diff --git a/fullcalendar-main/packages/core/src/NowTimer.ts b/fullcalendar-main/packages/core/src/NowTimer.ts deleted file mode 100644 index 5f23989..0000000 --- a/fullcalendar-main/packages/core/src/NowTimer.ts +++ /dev/null @@ -1,94 +0,0 @@ -import { DateMarker, addMs, startOfDay, addDays } from './datelib/marker.js' -import { createDuration } from './datelib/duration.js' -import { ViewContext, ViewContextType } from './ViewContext.js' -import { ComponentChildren, Component } from './preact.js' -import { DateRange } from './datelib/date-range.js' -import { getNow } from './reducers/current-date.js' - -export interface NowTimerProps { - unit: string // TODO: add type of unit - children: (now: DateMarker, todayRange: DateRange) => ComponentChildren -} - -interface NowTimerState { - nowDate: DateMarker - todayRange: DateRange -} - -export class NowTimer extends Component { - static contextType: any = ViewContextType - context: ViewContext // do this for all components that use the context!!! - initialNowDate: DateMarker - initialNowQueriedMs: number - timeoutId: any - - constructor(props: NowTimerProps, context: ViewContext) { - super(props, context) - - this.initialNowDate = getNow(context.options.now, context.dateEnv) - this.initialNowQueriedMs = new Date().valueOf() - - this.state = this.computeTiming().currentState - } - - render() { - let { props, state } = this - return props.children(state.nowDate, state.todayRange) - } - - componentDidMount() { - this.setTimeout() - } - - componentDidUpdate(prevProps: NowTimerProps) { - if (prevProps.unit !== this.props.unit) { - this.clearTimeout() - this.setTimeout() - } - } - - componentWillUnmount() { - this.clearTimeout() - } - - private computeTiming() { - let { props, context } = this - let unroundedNow = addMs(this.initialNowDate, new Date().valueOf() - this.initialNowQueriedMs) - let currentUnitStart = context.dateEnv.startOf(unroundedNow, props.unit) - let nextUnitStart = context.dateEnv.add(currentUnitStart, createDuration(1, props.unit)) - let waitMs = nextUnitStart.valueOf() - unroundedNow.valueOf() - - // there is a max setTimeout ms value (https://stackoverflow.com/a/3468650/96342) - // ensure no longer than a day - waitMs = Math.min(1000 * 60 * 60 * 24, waitMs) - - return { - currentState: { nowDate: currentUnitStart, todayRange: buildDayRange(currentUnitStart) } as NowTimerState, - nextState: { nowDate: nextUnitStart, todayRange: buildDayRange(nextUnitStart) } as NowTimerState, - waitMs, - } - } - - private setTimeout() { - let { nextState, waitMs } = this.computeTiming() - - this.timeoutId = setTimeout(() => { - this.setState(nextState, () => { - this.setTimeout() - }) - }, waitMs) - } - - private clearTimeout() { - if (this.timeoutId) { - clearTimeout(this.timeoutId) - } - } -} - -function buildDayRange(date: DateMarker): DateRange { // TODO: make this a general util - let start = startOfDay(date) - let end = addDays(start, 1) - - return { start, end } -} diff --git a/fullcalendar-main/packages/core/src/ScrollResponder.ts b/fullcalendar-main/packages/core/src/ScrollResponder.ts deleted file mode 100644 index 3568fd9..0000000 --- a/fullcalendar-main/packages/core/src/ScrollResponder.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { Duration } from './datelib/duration.js' -import { Emitter } from './common/Emitter.js' -import { CalendarListeners } from './options.js' - -export interface ScrollRequest { - time?: Duration - [otherProp: string]: any -} - -export type ScrollRequestHandler = (request: ScrollRequest) => boolean - -export class ScrollResponder { - queuedRequest: ScrollRequest - - constructor( - private execFunc: ScrollRequestHandler, - private emitter: Emitter, - private scrollTime: Duration, - private scrollTimeReset: boolean, - ) { - emitter.on('_scrollRequest', this.handleScrollRequest) - this.fireInitialScroll() - } - - detach() { - this.emitter.off('_scrollRequest', this.handleScrollRequest) - } - - update(isDatesNew: boolean) { - if (isDatesNew && this.scrollTimeReset) { - this.fireInitialScroll() // will drain - } else { - this.drain() - } - } - - private fireInitialScroll() { - this.handleScrollRequest({ - time: this.scrollTime, - }) - } - - private handleScrollRequest = (request: ScrollRequest) => { - this.queuedRequest = Object.assign({}, this.queuedRequest || {}, request) - this.drain() - } - - private drain() { - if (this.queuedRequest && this.execFunc(this.queuedRequest)) { - this.queuedRequest = null - } - } -} diff --git a/fullcalendar-main/packages/core/src/Toolbar.tsx b/fullcalendar-main/packages/core/src/Toolbar.tsx deleted file mode 100644 index beac4e2..0000000 --- a/fullcalendar-main/packages/core/src/Toolbar.tsx +++ /dev/null @@ -1,67 +0,0 @@ -import { createElement } from './preact.js' -import { BaseComponent } from './vdom-util.js' -import { ToolbarModel, ToolbarWidget } from './toolbar-struct.js' -import { ToolbarSection, ToolbarContent } from './ToolbarSection.js' - -export interface ToolbarProps extends ToolbarContent { - extraClassName: string // wish this could be array, but easier for pureness - model: ToolbarModel - titleId: string -} - -export class Toolbar extends BaseComponent { - render() { - let { model, extraClassName } = this.props - let forceLtr = false - let startContent - let endContent - let sectionWidgets = model.sectionWidgets - let centerContent = sectionWidgets.center - - if (sectionWidgets.left) { - forceLtr = true - startContent = sectionWidgets.left - } else { - startContent = sectionWidgets.start - } - - if (sectionWidgets.right) { - forceLtr = true - endContent = sectionWidgets.right - } else { - endContent = sectionWidgets.end - } - - let classNames = [ - extraClassName || '', - 'fc-toolbar', - forceLtr ? 'fc-toolbar-ltr' : '', - ] - - return ( -
- {this.renderSection('start', startContent || [])} - {this.renderSection('center', centerContent || [])} - {this.renderSection('end', endContent || [])} -
- ) - } - - renderSection(key: string, widgetGroups: ToolbarWidget[][]) { - let { props } = this - - return ( - - ) - } -} diff --git a/fullcalendar-main/packages/core/src/ToolbarSection.tsx b/fullcalendar-main/packages/core/src/ToolbarSection.tsx deleted file mode 100644 index 6028d59..0000000 --- a/fullcalendar-main/packages/core/src/ToolbarSection.tsx +++ /dev/null @@ -1,74 +0,0 @@ -import { createElement, VNode } from './preact.js' -import { BaseComponent } from './vdom-util.js' -import { ToolbarWidget } from './toolbar-struct.js' - -export interface ToolbarContent { - title: string - titleId: string - navUnit: string - activeButton: string - isTodayEnabled: boolean - isPrevEnabled: boolean - isNextEnabled: boolean -} - -export interface ToolbarSectionProps extends ToolbarContent { - widgetGroups: ToolbarWidget[][] -} - -export class ToolbarSection extends BaseComponent { - render(): any { - let children = this.props.widgetGroups.map((widgetGroup) => this.renderWidgetGroup(widgetGroup)) - - return createElement('div', { className: 'fc-toolbar-chunk' }, ...children) - } - - renderWidgetGroup(widgetGroup: ToolbarWidget[]): any { - let { props } = this - let { theme } = this.context - let children: VNode[] = [] - let isOnlyButtons = true - - for (let widget of widgetGroup) { - let { buttonName, buttonClick, buttonText, buttonIcon, buttonHint } = widget - - if (buttonName === 'title') { - isOnlyButtons = false - children.push( -

{props.title}

, - ) - } else { - let isPressed = buttonName === props.activeButton - let isDisabled = - (!props.isTodayEnabled && buttonName === 'today') || - (!props.isPrevEnabled && buttonName === 'prev') || - (!props.isNextEnabled && buttonName === 'next') - - let buttonClasses = [`fc-${buttonName}-button`, theme.getClass('button')] - if (isPressed) { - buttonClasses.push(theme.getClass('buttonActive')) - } - - children.push( - , - ) - } - } - - if (children.length > 1) { - let groupClassName = (isOnlyButtons && theme.getClass('buttonGroup')) || '' - - return createElement('div', { className: groupClassName }, ...children) - } - return children[0] - } -} diff --git a/fullcalendar-main/packages/core/src/View.ts b/fullcalendar-main/packages/core/src/View.ts deleted file mode 100644 index 65d4277..0000000 --- a/fullcalendar-main/packages/core/src/View.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { DateProfile } from './DateProfileGenerator.js' -import { EventStore } from './structs/event-store.js' -import { EventUiHash } from './component/event-ui.js' -import { sliceEventStore, EventRenderRange } from './component/event-rendering.js' -import { DateSpan } from './structs/date-span.js' -import { EventInteractionState } from './interactions/event-interaction-state.js' -import { Duration } from './datelib/duration.js' - -export interface ViewProps { - dateProfile: DateProfile - businessHours: EventStore - eventStore: EventStore - eventUiBases: EventUiHash - dateSelection: DateSpan | null - eventSelection: string - eventDrag: EventInteractionState | null - eventResize: EventInteractionState | null - isHeightAuto: boolean - forPrint: boolean -} - -// HELPERS - -/* -if nextDayThreshold is specified, slicing is done in an all-day fashion. -you can get nextDayThreshold from context.nextDayThreshold -*/ -export function sliceEvents( - props: ViewProps & { dateProfile: DateProfile, nextDayThreshold: Duration }, - allDay?: boolean, -): EventRenderRange[] { - return sliceEventStore( - props.eventStore, - props.eventUiBases, - props.dateProfile.activeRange, - allDay ? props.nextDayThreshold : null, - ).fg -} diff --git a/fullcalendar-main/packages/core/src/ViewContext.ts b/fullcalendar-main/packages/core/src/ViewContext.ts deleted file mode 100644 index 3a004a4..0000000 --- a/fullcalendar-main/packages/core/src/ViewContext.ts +++ /dev/null @@ -1,85 +0,0 @@ -import { CalendarImpl } from './api/CalendarImpl.js' -import { ViewImpl } from './api/ViewImpl.js' -import { Theme } from './theme/Theme.js' -import { DateEnv } from './datelib/env.js' -import { PluginHooks } from './plugin-system-struct.js' -import { createContext, Context } from './preact.js' -import { ScrollResponder, ScrollRequestHandler } from './ScrollResponder.js' -import { DateProfileGenerator } from './DateProfileGenerator.js' -import { ViewSpec } from './structs/view-spec.js' -import { CalendarData } from './reducers/data-types.js' -import { Action } from './reducers/Action.js' -import { Emitter } from './common/Emitter.js' -import { InteractionSettingsInput } from './interactions/interaction.js' -import { DateComponent } from './component/DateComponent.js' -import { CalendarContext } from './CalendarContext.js' -import { createDuration } from './datelib/duration.js' -import { ViewOptionsRefined, CalendarListeners } from './options.js' - -export const ViewContextType: Context = createContext({} as any) // for Components -export type ResizeHandler = (force: boolean) => void - -/* -it's important that ViewContext extends CalendarContext so that components that subscribe to ViewContext -can pass in their ViewContext to util functions that accept CalendarContext. -*/ -export interface ViewContext extends CalendarContext { - options: ViewOptionsRefined // more specific than BaseOptionsRefined - theme: Theme - isRtl: boolean - dateProfileGenerator: DateProfileGenerator - viewSpec: ViewSpec - viewApi: ViewImpl - addResizeHandler: (handler: ResizeHandler) => void - removeResizeHandler: (handler: ResizeHandler) => void - createScrollResponder: (execFunc: ScrollRequestHandler) => ScrollResponder - registerInteractiveComponent: (component: DateComponent, settingsInput: InteractionSettingsInput) => void - unregisterInteractiveComponent: (component: DateComponent) => void -} - -export function buildViewContext( - viewSpec: ViewSpec, - viewApi: ViewImpl, - viewOptions: ViewOptionsRefined, - dateProfileGenerator: DateProfileGenerator, - dateEnv: DateEnv, - theme: Theme, - pluginHooks: PluginHooks, - dispatch: (action: Action) => void, - getCurrentData: () => CalendarData, - emitter: Emitter, - calendarApi: CalendarImpl, - registerInteractiveComponent: (component: DateComponent, settingsInput: InteractionSettingsInput) => void, - unregisterInteractiveComponent: (component: DateComponent) => void, -): ViewContext { - return { - dateEnv, - options: viewOptions, - pluginHooks, - emitter, - dispatch, - getCurrentData, - calendarApi, - viewSpec, - viewApi, - dateProfileGenerator, - theme, - isRtl: viewOptions.direction === 'rtl', - addResizeHandler(handler: ResizeHandler) { - emitter.on('_resize', handler) - }, - removeResizeHandler(handler: ResizeHandler) { - emitter.off('_resize', handler) - }, - createScrollResponder(execFunc: ScrollRequestHandler) { - return new ScrollResponder( - execFunc, - emitter, - createDuration(viewOptions.scrollTime), - viewOptions.scrollTimeReset, - ) - }, - registerInteractiveComponent, - unregisterInteractiveComponent, - } -} diff --git a/fullcalendar-main/packages/core/src/ViewHarness.tsx b/fullcalendar-main/packages/core/src/ViewHarness.tsx deleted file mode 100644 index f2611cd..0000000 --- a/fullcalendar-main/packages/core/src/ViewHarness.tsx +++ /dev/null @@ -1,90 +0,0 @@ -import { BaseComponent, setRef } from './vdom-util.js' -import { ComponentChildren, Ref, createElement } from './preact.js' -import { CssDimValue } from './scrollgrid/util.js' - -export interface ViewHarnessProps { - elRef?: Ref - labeledById?: string - liquid?: boolean - height?: CssDimValue - aspectRatio?: number - children?: ComponentChildren -} - -interface ViewHarnessState { - availableWidth: number | null -} - -export class ViewHarness extends BaseComponent { - el: HTMLElement - - state: ViewHarnessState = { - availableWidth: null, - } - - render() { - let { props, state } = this - let { aspectRatio } = props - - let classNames = [ - 'fc-view-harness', - (aspectRatio || props.liquid || props.height) - ? 'fc-view-harness-active' // harness controls the height - : 'fc-view-harness-passive', // let the view do the height - ] - let height: CssDimValue = '' - let paddingBottom: CssDimValue = '' - - if (aspectRatio) { - if (state.availableWidth !== null) { - height = state.availableWidth / aspectRatio - } else { - // while waiting to know availableWidth, we can't set height to *zero* - // because will cause lots of unnecessary scrollbars within scrollgrid. - // BETTER: don't start rendering ANYTHING yet until we know container width - // NOTE: why not always use paddingBottom? Causes height oscillation (issue 5606) - paddingBottom = `${(1 / aspectRatio) * 100}%` - } - } else { - height = props.height || '' - } - - return ( -
- {props.children} -
- ) - } - - componentDidMount() { - this.context.addResizeHandler(this.handleResize) - } - - componentWillUnmount() { - this.context.removeResizeHandler(this.handleResize) - } - - handleEl = (el: HTMLElement | null) => { - this.el = el - setRef(this.props.elRef, el) - this.updateAvailableWidth() - } - - handleResize = () => { - this.updateAvailableWidth() - } - - updateAvailableWidth() { - if ( - this.el && // needed. but why? - this.props.aspectRatio // aspectRatio is the only height setting that needs availableWidth - ) { - this.setState({ availableWidth: this.el.offsetWidth }) - } - } -} diff --git a/fullcalendar-main/packages/core/src/api/CalendarApi.ts b/fullcalendar-main/packages/core/src/api/CalendarApi.ts deleted file mode 100644 index 46a64b1..0000000 --- a/fullcalendar-main/packages/core/src/api/CalendarApi.ts +++ /dev/null @@ -1,85 +0,0 @@ -import { ViewApi } from './ViewApi.js' -import { EventSourceApi } from './EventSourceApi.js' -import { EventApi } from './EventApi.js' -import { - CalendarOptions, - CalendarListeners, - DateInput, - DurationInput, - DateRangeInput, - EventSourceInput, - EventInput, - FormatterInput, -} from './structs.js' - -export interface CalendarApi { - view: ViewApi - updateSize(): void - - // Options - // ----------------------------------------------------------------------------------------------------------------- - - setOption(name: OptionName, val: CalendarOptions[OptionName]): void - getOption(name: OptionName): CalendarOptions[OptionName] - getAvailableLocaleCodes(): string[] - - // Trigger - // ----------------------------------------------------------------------------------------------------------------- - - on(handlerName: ListenerName, handler: CalendarListeners[ListenerName]): void - off(handlerName: ListenerName, handler: CalendarListeners[ListenerName]): void - trigger(handlerName: ListenerName, ...args: Parameters): void - - // View - // ----------------------------------------------------------------------------------------------------------------- - - changeView(viewType: string, dateOrRange?: DateRangeInput | DateInput): void - zoomTo(dateMarker: Date, viewType?: string): void - - // Current Date - // ----------------------------------------------------------------------------------------------------------------- - - prev(): void - next(): void - prevYear(): void - nextYear(): void - today(): void - gotoDate(zonedDateInput: DateInput): void - incrementDate(deltaInput: DurationInput): void - getDate(): Date - - // Date Formatting Utils - // ----------------------------------------------------------------------------------------------------------------- - - formatDate(d: DateInput, formatter: FormatterInput): string - formatRange(d0: DateInput, d1: DateInput, settings: any): string // TODO: settings type - formatIso(d: DateInput, omitTime?: boolean): string - - // Date Selection / Event Selection / DayClick - // ----------------------------------------------------------------------------------------------------------------- - - select(dateOrObj: DateInput | any, endDate?: DateInput): void - unselect(): void - - // Public Events API - // ----------------------------------------------------------------------------------------------------------------- - - addEvent(eventInput: EventInput, sourceInput?: EventSourceApi | string | boolean): EventApi | null - getEventById(id: string): EventApi | null - getEvents(): EventApi[] - removeAllEvents(): void - - // Public Event Sources API - // ----------------------------------------------------------------------------------------------------------------- - - getEventSources(): EventSourceApi[] - getEventSourceById(id: string): EventSourceApi | null - addEventSource(sourceInput: EventSourceInput): EventSourceApi - removeAllEventSources(): void - refetchEvents(): void - - // Scroll - // ----------------------------------------------------------------------------------------------------------------- - - scrollToTime(timeInput: DurationInput): void -} diff --git a/fullcalendar-main/packages/core/src/api/CalendarImpl.ts b/fullcalendar-main/packages/core/src/api/CalendarImpl.ts deleted file mode 100644 index b05b3b0..0000000 --- a/fullcalendar-main/packages/core/src/api/CalendarImpl.ts +++ /dev/null @@ -1,511 +0,0 @@ -import { createFormatter, FormatterInput } from '../datelib/formatting.js' -import { createDuration } from '../datelib/duration.js' -import { parseDateSpan } from '../structs/date-span.js' -import { parseEventSource } from '../structs/event-source-parse.js' -import { parseEvent } from '../structs/event-parse.js' -import { eventTupleToStore } from '../structs/event-store.js' -import { ViewSpec } from '../structs/view-spec.js' -import { PointerDragEvent } from '../interactions/pointer.js' -import { getNow } from '../reducers/current-date.js' -import { triggerDateSelect, triggerDateUnselect } from '../calendar-utils.js' -import { hashValuesToArray } from '../util/object.js' -import { CalendarDataManager } from '../reducers/CalendarDataManager.js' -import { Action } from '../reducers/Action.js' -import { EventSource } from '../structs/event-source.js' -import { eventApiToStore, buildEventApis, EventImpl } from './EventImpl.js' -import { CalendarData } from '../reducers/data-types.js' -import { CalendarApi } from './CalendarApi.js' -import { ViewImpl } from './ViewImpl.js' -import { EventSourceImpl } from './EventSourceImpl.js' -import { - CalendarOptions, - CalendarListeners, - DateInput, - DurationInput, - DateSpanInput, - DateRangeInput, - EventSourceInput, - EventInput, -} from './structs.js' - -export class CalendarImpl implements CalendarApi { - currentDataManager?: CalendarDataManager // will be set by CalendarDataManager - - getCurrentData(): CalendarData { - return this.currentDataManager!.getCurrentData() - } - - dispatch(action: Action): void { - this.currentDataManager!.dispatch(action) - } - - get view(): ViewImpl { return this.getCurrentData().viewApi } - - batchRendering(callback: () => void): void { // subclasses should implement - callback() - } - - updateSize(): void { - this.trigger('_resize', true) - } - - // Options - // ----------------------------------------------------------------------------------------------------------------- - - setOption(name: OptionName, val: CalendarOptions[OptionName]): void { - this.dispatch({ - type: 'SET_OPTION', - optionName: name, - rawOptionValue: val, - }) - } - - getOption(name: OptionName): CalendarOptions[OptionName] { - return this.currentDataManager!.currentCalendarOptionsInput[name] - } - - getAvailableLocaleCodes(): string[] { - return Object.keys(this.getCurrentData().availableRawLocales) - } - - // Trigger - // ----------------------------------------------------------------------------------------------------------------- - - on(handlerName: ListenerName, handler: CalendarListeners[ListenerName]): void { - let { currentDataManager } = this - - if (currentDataManager.currentCalendarOptionsRefiners[handlerName]) { - currentDataManager.emitter.on(handlerName, handler) - } else { - console.warn(`Unknown listener name '${handlerName}'`) - } - } - - off(handlerName: ListenerName, handler: CalendarListeners[ListenerName]): void { - this.currentDataManager!.emitter.off(handlerName, handler) - } - - // not meant for public use - trigger(handlerName: ListenerName, ...args: Parameters): void { - this.currentDataManager!.emitter.trigger(handlerName, ...args) - } - - // View - // ----------------------------------------------------------------------------------------------------------------- - - changeView(viewType: string, dateOrRange?: DateRangeInput | DateInput): void { - this.batchRendering(() => { - this.unselect() - - if (dateOrRange) { - if ((dateOrRange as DateRangeInput).start && (dateOrRange as DateRangeInput).end) { // a range - this.dispatch({ - type: 'CHANGE_VIEW_TYPE', - viewType, - }) - this.dispatch({ // not very efficient to do two dispatches - type: 'SET_OPTION', - optionName: 'visibleRange', - rawOptionValue: dateOrRange, - }) - } else { - let { dateEnv } = this.getCurrentData() - - this.dispatch({ - type: 'CHANGE_VIEW_TYPE', - viewType, - dateMarker: dateEnv.createMarker(dateOrRange as DateInput), - }) - } - } else { - this.dispatch({ - type: 'CHANGE_VIEW_TYPE', - viewType, - }) - } - }) - } - - // Forces navigation to a view for the given date. - // `viewType` can be a specific view name or a generic one like "week" or "day". - // needs to change - zoomTo(dateMarker: Date, viewType?: string): void { - let state = this.getCurrentData() - let spec - - viewType = viewType || 'day' // day is default zoom - spec = state.viewSpecs[viewType] || this.getUnitViewSpec(viewType) - - this.unselect() - - if (spec) { - this.dispatch({ - type: 'CHANGE_VIEW_TYPE', - viewType: spec.type, - dateMarker, - }) - } else { - this.dispatch({ - type: 'CHANGE_DATE', - dateMarker, - }) - } - } - - // Given a duration singular unit, like "week" or "day", finds a matching view spec. - // Preference is given to views that have corresponding buttons. - private getUnitViewSpec(unit: string): ViewSpec | null { - let { viewSpecs, toolbarConfig } = this.getCurrentData() - let viewTypes = [].concat( - toolbarConfig.header ? toolbarConfig.header.viewsWithButtons : [], - toolbarConfig.footer ? toolbarConfig.footer.viewsWithButtons : [], - ) - let i - let spec - - for (let viewType in viewSpecs) { - viewTypes.push(viewType) - } - - for (i = 0; i < viewTypes.length; i += 1) { - spec = viewSpecs[viewTypes[i]] - if (spec) { - if (spec.singleUnit === unit) { - return spec - } - } - } - - return null - } - - // Current Date - // ----------------------------------------------------------------------------------------------------------------- - - prev(): void { - this.unselect() - this.dispatch({ type: 'PREV' }) - } - - next(): void { - this.unselect() - this.dispatch({ type: 'NEXT' }) - } - - prevYear(): void { - let state = this.getCurrentData() - this.unselect() - this.dispatch({ - type: 'CHANGE_DATE', - dateMarker: state.dateEnv.addYears(state.currentDate, -1), - }) - } - - nextYear(): void { - let state = this.getCurrentData() - - this.unselect() - this.dispatch({ - type: 'CHANGE_DATE', - dateMarker: state.dateEnv.addYears(state.currentDate, 1), - }) - } - - today(): void { - let state = this.getCurrentData() - - this.unselect() - this.dispatch({ - type: 'CHANGE_DATE', - dateMarker: getNow(state.calendarOptions.now, state.dateEnv), - }) - } - - gotoDate(zonedDateInput: DateInput): void { - let state = this.getCurrentData() - - this.unselect() - this.dispatch({ - type: 'CHANGE_DATE', - dateMarker: state.dateEnv.createMarker(zonedDateInput), - }) - } - - incrementDate(deltaInput: DurationInput): void { - let state = this.getCurrentData() - let delta = createDuration(deltaInput) - - if (delta) { // else, warn about invalid input? - this.unselect() - this.dispatch({ - type: 'CHANGE_DATE', - dateMarker: state.dateEnv.add(state.currentDate, delta), - }) - } - } - - getDate(): Date { - let state = this.getCurrentData() - return state.dateEnv.toDate(state.currentDate) - } - - // Date Formatting Utils - // ----------------------------------------------------------------------------------------------------------------- - - formatDate(d: DateInput, formatter: FormatterInput): string { - let { dateEnv } = this.getCurrentData() - - return dateEnv.format( - dateEnv.createMarker(d), - createFormatter(formatter), - ) - } - - // `settings` is for formatter AND isEndExclusive - formatRange(d0: DateInput, d1: DateInput, settings: any): string { // TODO: settings type - let { dateEnv } = this.getCurrentData() - - return dateEnv.formatRange( - dateEnv.createMarker(d0), - dateEnv.createMarker(d1), - createFormatter(settings), - settings, - ) - } - - formatIso(d: DateInput, omitTime?: boolean): string { - let { dateEnv } = this.getCurrentData() - - return dateEnv.formatIso(dateEnv.createMarker(d), { omitTime }) - } - - // Date Selection / Event Selection / DayClick - // ----------------------------------------------------------------------------------------------------------------- - - select(dateOrObj: DateInput | any, endDate?: DateInput): void { - let selectionInput: DateSpanInput - - if (endDate == null) { - if (dateOrObj.start != null) { - selectionInput = dateOrObj as DateSpanInput - } else { - selectionInput = { - start: dateOrObj, - end: null, - } - } - } else { - selectionInput = { - start: dateOrObj, - end: endDate, - } as DateSpanInput - } - - let state = this.getCurrentData() - let selection = parseDateSpan( - selectionInput, - state.dateEnv, - createDuration({ days: 1 }), // TODO: cache this? - ) - - if (selection) { // throw parse error otherwise? - this.dispatch({ type: 'SELECT_DATES', selection }) - triggerDateSelect(selection, null, state) - } - } - - unselect(pev?: PointerDragEvent): void { - let state = this.getCurrentData() - - if (state.dateSelection) { - this.dispatch({ type: 'UNSELECT_DATES' }) - triggerDateUnselect(pev, state) - } - } - - // Public Events API - // ----------------------------------------------------------------------------------------------------------------- - - addEvent(eventInput: EventInput, sourceInput?: EventSourceImpl | string | boolean): EventImpl | null { - if (eventInput instanceof EventImpl) { - let def = eventInput._def - let instance = eventInput._instance - let currentData = this.getCurrentData() - - // not already present? don't want to add an old snapshot - if (!currentData.eventStore.defs[def.defId]) { - this.dispatch({ - type: 'ADD_EVENTS', - eventStore: eventTupleToStore({ def, instance }), // TODO: better util for two args? - }) - this.triggerEventAdd(eventInput) - } - - return eventInput - } - - let state = this.getCurrentData() - let eventSource: EventSource - - if (sourceInput instanceof EventSourceImpl) { - eventSource = sourceInput.internalEventSource - } else if (typeof sourceInput === 'boolean') { - if (sourceInput) { // true. part of the first event source - [eventSource] = hashValuesToArray(state.eventSources) - } - } else if (sourceInput != null) { // an ID. accepts a number too - let sourceApi = this.getEventSourceById(sourceInput) // TODO: use an internal function - - if (!sourceApi) { - console.warn(`Could not find an event source with ID "${sourceInput}"`) // TODO: test - return null - } - eventSource = sourceApi.internalEventSource - } - - let tuple = parseEvent(eventInput, eventSource, state, false) - - if (tuple) { - let newEventApi = new EventImpl( - state, - tuple.def, - tuple.def.recurringDef ? null : tuple.instance, - ) - this.dispatch({ - type: 'ADD_EVENTS', - eventStore: eventTupleToStore(tuple), - }) - this.triggerEventAdd(newEventApi) - - return newEventApi - } - - return null - } - - private triggerEventAdd(eventApi: EventImpl): void { - let { emitter } = this.getCurrentData() - - emitter.trigger('eventAdd', { - event: eventApi, - relatedEvents: [], - revert: () => { - this.dispatch({ - type: 'REMOVE_EVENTS', - eventStore: eventApiToStore(eventApi), - }) - }, - }) - } - - // TODO: optimize - getEventById(id: string): EventImpl | null { - let state = this.getCurrentData() - let { defs, instances } = state.eventStore - id = String(id) - - for (let defId in defs) { - let def = defs[defId] - - if (def.publicId === id) { - if (def.recurringDef) { - return new EventImpl(state, def, null) - } - - for (let instanceId in instances) { - let instance = instances[instanceId] - - if (instance.defId === def.defId) { - return new EventImpl(state, def, instance) - } - } - } - } - - return null - } - - getEvents(): EventImpl[] { - let currentData = this.getCurrentData() - - return buildEventApis(currentData.eventStore, currentData) - } - - removeAllEvents(): void { - this.dispatch({ type: 'REMOVE_ALL_EVENTS' }) - } - - // Public Event Sources API - // ----------------------------------------------------------------------------------------------------------------- - - getEventSources(): EventSourceImpl[] { - let state = this.getCurrentData() - let sourceHash = state.eventSources - let sourceApis: EventSourceImpl[] = [] - - for (let internalId in sourceHash) { - sourceApis.push(new EventSourceImpl(state, sourceHash[internalId])) - } - - return sourceApis - } - - getEventSourceById(id: string): EventSourceImpl | null { - let state = this.getCurrentData() - let sourceHash = state.eventSources - id = String(id) - - for (let sourceId in sourceHash) { - if (sourceHash[sourceId].publicId === id) { - return new EventSourceImpl(state, sourceHash[sourceId]) - } - } - - return null - } - - addEventSource(sourceInput: EventSourceInput): EventSourceImpl { - let state = this.getCurrentData() - - if (sourceInput instanceof EventSourceImpl) { - // not already present? don't want to add an old snapshot - if (!state.eventSources[sourceInput.internalEventSource.sourceId]) { - this.dispatch({ - type: 'ADD_EVENT_SOURCES', - sources: [sourceInput.internalEventSource], - }) - } - - return sourceInput - } - - let eventSource = parseEventSource(sourceInput, state) - - if (eventSource) { // TODO: error otherwise? - this.dispatch({ type: 'ADD_EVENT_SOURCES', sources: [eventSource] }) - - return new EventSourceImpl(state, eventSource) - } - - return null - } - - removeAllEventSources(): void { - this.dispatch({ type: 'REMOVE_ALL_EVENT_SOURCES' }) - } - - refetchEvents(): void { - this.dispatch({ type: 'FETCH_EVENT_SOURCES', isRefetch: true }) - } - - // Scroll - // ----------------------------------------------------------------------------------------------------------------- - - scrollToTime(timeInput: DurationInput): void { - let time = createDuration(timeInput) - - if (time) { - this.trigger('_scrollRequest', { time }) - } - } -} diff --git a/fullcalendar-main/packages/core/src/api/EventApi.ts b/fullcalendar-main/packages/core/src/api/EventApi.ts deleted file mode 100644 index 6831488..0000000 --- a/fullcalendar-main/packages/core/src/api/EventApi.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { Dictionary } from '../options.js' -import { EventSourceApi } from './EventSourceApi.js' -import { - DateInput, - DurationInput, - FormatterInput, -} from './structs.js' - -export interface EventApi { - source: EventSourceApi | null - start: Date | null - end: Date | null - startStr: string - endStr: string - id: string - groupId: string - allDay: boolean - title: string - url: string - display: string // TODO: better - startEditable: boolean - durationEditable: boolean - constraint: any // TODO: better - overlap: boolean - allow: any // TODO: better - backgroundColor: string - borderColor: string - textColor: string - classNames: string[] - extendedProps: Dictionary - - setProp(name: string, val: any): void - setExtendedProp(name: string, val: any): void - setStart(startInput: DateInput, options?: { granularity?: string, maintainDuration?: boolean }): void - setEnd(endInput: DateInput | null, options?: { granularity?: string }): void - setDates(startInput: DateInput, endInput: DateInput | null, options?: { allDay?: boolean, granularity?: string }): void - moveStart(deltaInput: DurationInput): void - moveEnd(deltaInput: DurationInput): void - moveDates(deltaInput: DurationInput): void - setAllDay(allDay: boolean, options?: { maintainDuration?: boolean }): void - formatRange(formatInput: FormatterInput) - remove(): void - toPlainObject(settings?: { collapseExtendedProps?: boolean, collapseColor?: boolean }): Dictionary - toJSON(): Dictionary -} diff --git a/fullcalendar-main/packages/core/src/api/EventImpl.ts b/fullcalendar-main/packages/core/src/api/EventImpl.ts deleted file mode 100644 index 543d3b8..0000000 --- a/fullcalendar-main/packages/core/src/api/EventImpl.ts +++ /dev/null @@ -1,451 +0,0 @@ -import { EventDef } from '../structs/event-def.js' -import { EVENT_NON_DATE_REFINERS, EVENT_DATE_REFINERS } from '../structs/event-parse.js' -import { EventInstance } from '../structs/event-instance.js' -import { EVENT_UI_REFINERS, EventUiHash } from '../component/event-ui.js' -import { EventMutation, applyMutationToEventStore } from '../structs/event-mutation.js' -import { diffDates, computeAlignedDayRange } from '../util/date.js' -import { createDuration, durationsEqual } from '../datelib/duration.js' -import { createFormatter } from '../datelib/formatting.js' -import { CalendarContext } from '../CalendarContext.js' -import { getRelevantEvents, EventStore } from '../structs/event-store.js' -import { Dictionary } from '../options.js' -import { EventApi } from './EventApi.js' -import { EventSourceImpl } from './EventSourceImpl.js' -import { - DateInput, - DurationInput, - FormatterInput, -} from './structs.js' - -export class EventImpl implements EventApi { - _context: CalendarContext - _def: EventDef - _instance: EventInstance | null - // instance will be null if expressing a recurring event that has no current instances, - // OR if trying to validate an incoming external event that has no dates assigned - - constructor(context: CalendarContext, def: EventDef, instance?: EventInstance) { - this._context = context - this._def = def - this._instance = instance || null - } - - /* - TODO: make event struct more responsible for this - */ - setProp(name: string, val: any): void { - if (name in EVENT_DATE_REFINERS) { - console.warn('Could not set date-related prop \'name\'. Use one of the date-related methods instead.') - // TODO: make proper aliasing system? - } else if (name === 'id') { - val = EVENT_NON_DATE_REFINERS[name](val) - - this.mutate({ - standardProps: { publicId: val }, // hardcoded internal name - }) - } else if (name in EVENT_NON_DATE_REFINERS) { - val = EVENT_NON_DATE_REFINERS[name](val) - - this.mutate({ - standardProps: { [name]: val }, - }) - } else if (name in EVENT_UI_REFINERS) { - let ui = EVENT_UI_REFINERS[name](val) - - if (name === 'color') { - ui = { backgroundColor: val, borderColor: val } - } else if (name === 'editable') { - ui = { startEditable: val, durationEditable: val } - } else { - ui = { [name]: val } - } - - this.mutate({ - standardProps: { ui }, - }) - } else { - console.warn(`Could not set prop '${name}'. Use setExtendedProp instead.`) - } - } - - setExtendedProp(name: string, val: any): void { - this.mutate({ - extendedProps: { [name]: val }, - }) - } - - setStart(startInput: DateInput, options: { granularity?: string, maintainDuration?: boolean } = {}): void { - let { dateEnv } = this._context - let start = dateEnv.createMarker(startInput) - - if (start && this._instance) { // TODO: warning if parsed bad - let instanceRange = this._instance.range - let startDelta = diffDates(instanceRange.start, start, dateEnv, options.granularity) // what if parsed bad!? - - if (options.maintainDuration) { - this.mutate({ datesDelta: startDelta }) - } else { - this.mutate({ startDelta }) - } - } - } - - setEnd(endInput: DateInput | null, options: { granularity?: string } = {}): void { - let { dateEnv } = this._context - let end - - if (endInput != null) { - end = dateEnv.createMarker(endInput) - - if (!end) { - return // TODO: warning if parsed bad - } - } - - if (this._instance) { - if (end) { - let endDelta = diffDates(this._instance.range.end, end, dateEnv, options.granularity) - this.mutate({ endDelta }) - } else { - this.mutate({ standardProps: { hasEnd: false } }) - } - } - } - - setDates(startInput: DateInput, endInput: DateInput | null, options: { allDay?: boolean, granularity?: string } = {}): void { - let { dateEnv } = this._context - let standardProps = { allDay: options.allDay } as any - let start = dateEnv.createMarker(startInput) - let end - - if (!start) { - return // TODO: warning if parsed bad - } - - if (endInput != null) { - end = dateEnv.createMarker(endInput) - - if (!end) { // TODO: warning if parsed bad - return - } - } - - if (this._instance) { - let instanceRange = this._instance.range - - // when computing the diff for an event being converted to all-day, - // compute diff off of the all-day values the way event-mutation does. - if (options.allDay === true) { - instanceRange = computeAlignedDayRange(instanceRange) - } - - let startDelta = diffDates(instanceRange.start, start, dateEnv, options.granularity) - - if (end) { - let endDelta = diffDates(instanceRange.end, end, dateEnv, options.granularity) - - if (durationsEqual(startDelta, endDelta)) { - this.mutate({ datesDelta: startDelta, standardProps }) - } else { - this.mutate({ startDelta, endDelta, standardProps }) - } - } else { // means "clear the end" - standardProps.hasEnd = false - this.mutate({ datesDelta: startDelta, standardProps }) - } - } - } - - moveStart(deltaInput: DurationInput): void { - let delta = createDuration(deltaInput) - - if (delta) { // TODO: warning if parsed bad - this.mutate({ startDelta: delta }) - } - } - - moveEnd(deltaInput: DurationInput): void { - let delta = createDuration(deltaInput) - - if (delta) { // TODO: warning if parsed bad - this.mutate({ endDelta: delta }) - } - } - - moveDates(deltaInput: DurationInput): void { - let delta = createDuration(deltaInput) - - if (delta) { // TODO: warning if parsed bad - this.mutate({ datesDelta: delta }) - } - } - - setAllDay(allDay: boolean, options: { maintainDuration?: boolean } = {}): void { - let standardProps = { allDay } as any - let { maintainDuration } = options - - if (maintainDuration == null) { - maintainDuration = this._context.options.allDayMaintainDuration - } - - if (this._def.allDay !== allDay) { - standardProps.hasEnd = maintainDuration - } - - this.mutate({ standardProps }) - } - - formatRange(formatInput: FormatterInput): string { - let { dateEnv } = this._context - let instance = this._instance - let formatter = createFormatter(formatInput) - - if (this._def.hasEnd) { - return dateEnv.formatRange(instance.range.start, instance.range.end, formatter, { - forcedStartTzo: instance.forcedStartTzo, - forcedEndTzo: instance.forcedEndTzo, - }) - } - return dateEnv.format(instance.range.start, formatter, { - forcedTzo: instance.forcedStartTzo, - }) - } - - mutate(mutation: EventMutation): void { // meant to be private. but plugins need access - let instance = this._instance - - if (instance) { - let def = this._def - let context = this._context - let { eventStore } = context.getCurrentData() - let relevantEvents = getRelevantEvents(eventStore, instance.instanceId) - let eventConfigBase = { - '': { // HACK. always allow API to mutate events - display: '', - startEditable: true, - durationEditable: true, - constraints: [], - overlap: null, - allows: [], - backgroundColor: '', - borderColor: '', - textColor: '', - classNames: [], - }, - } as EventUiHash - - relevantEvents = applyMutationToEventStore(relevantEvents, eventConfigBase, mutation, context) - - let oldEvent = new EventImpl(context, def, instance) // snapshot - this._def = relevantEvents.defs[def.defId] - this._instance = relevantEvents.instances[instance.instanceId] - - context.dispatch({ - type: 'MERGE_EVENTS', - eventStore: relevantEvents, - }) - - context.emitter.trigger('eventChange', { - oldEvent, - event: this, - relatedEvents: buildEventApis(relevantEvents, context, instance), - revert() { - context.dispatch({ - type: 'RESET_EVENTS', - eventStore, // the ORIGINAL store - }) - }, - }) - } - } - - remove(): void { - let context = this._context - let asStore = eventApiToStore(this) - - context.dispatch({ - type: 'REMOVE_EVENTS', - eventStore: asStore, - }) - - context.emitter.trigger('eventRemove', { - event: this, - relatedEvents: [], - revert() { - context.dispatch({ - type: 'MERGE_EVENTS', - eventStore: asStore, - }) - }, - }) - } - - get source(): EventSourceImpl | null { - let { sourceId } = this._def - - if (sourceId) { - return new EventSourceImpl( - this._context, - this._context.getCurrentData().eventSources[sourceId], - ) - } - return null - } - - get start(): Date | null { - return this._instance ? - this._context.dateEnv.toDate(this._instance.range.start) : - null - } - - get end(): Date | null { - return (this._instance && this._def.hasEnd) ? - this._context.dateEnv.toDate(this._instance.range.end) : - null - } - - get startStr(): string { - let instance = this._instance - if (instance) { - return this._context.dateEnv.formatIso(instance.range.start, { - omitTime: this._def.allDay, - forcedTzo: instance.forcedStartTzo, - }) - } - return '' - } - - get endStr(): string { - let instance = this._instance - if (instance && this._def.hasEnd) { - return this._context.dateEnv.formatIso(instance.range.end, { - omitTime: this._def.allDay, - forcedTzo: instance.forcedEndTzo, - }) - } - return '' - } - - // computable props that all access the def - // TODO: find a TypeScript-compatible way to do this at scale - get id() { return this._def.publicId } - get groupId() { return this._def.groupId } - get allDay() { return this._def.allDay } - get title() { return this._def.title } - get url() { return this._def.url } - get display() { return this._def.ui.display || 'auto' } // bad. just normalize the type earlier - get startEditable() { return this._def.ui.startEditable } - get durationEditable() { return this._def.ui.durationEditable } - get constraint() { return this._def.ui.constraints[0] || null } - get overlap() { return this._def.ui.overlap } - get allow() { return this._def.ui.allows[0] || null } - get backgroundColor() { return this._def.ui.backgroundColor } - get borderColor() { return this._def.ui.borderColor } - get textColor() { return this._def.ui.textColor } - - // NOTE: user can't modify these because Object.freeze was called in event-def parsing - get classNames() { return this._def.ui.classNames } - get extendedProps() { return this._def.extendedProps } - - toPlainObject(settings: { collapseExtendedProps?: boolean, collapseColor?: boolean } = {}): Dictionary { - let def = this._def - let { ui } = def - let { startStr, endStr } = this - let res: Dictionary = { - allDay: def.allDay, - } - - if (def.title) { - res.title = def.title - } - - if (startStr) { - res.start = startStr - } - - if (endStr) { - res.end = endStr - } - - if (def.publicId) { - res.id = def.publicId - } - - if (def.groupId) { - res.groupId = def.groupId - } - - if (def.url) { - res.url = def.url - } - - if (ui.display && ui.display !== 'auto') { - res.display = ui.display - } - - // TODO: what about recurring-event properties??? - // TODO: include startEditable/durationEditable/constraint/overlap/allow - - if (settings.collapseColor && ui.backgroundColor && ui.backgroundColor === ui.borderColor) { - res.color = ui.backgroundColor - } else { - if (ui.backgroundColor) { - res.backgroundColor = ui.backgroundColor - } - if (ui.borderColor) { - res.borderColor = ui.borderColor - } - } - - if (ui.textColor) { - res.textColor = ui.textColor - } - - if (ui.classNames.length) { - res.classNames = ui.classNames - } - - if (Object.keys(def.extendedProps).length) { - if (settings.collapseExtendedProps) { - Object.assign(res, def.extendedProps) - } else { - res.extendedProps = def.extendedProps - } - } - - return res - } - - toJSON(): Dictionary { - return this.toPlainObject() - } -} - -export function eventApiToStore(eventApi: EventImpl): EventStore { - let def = eventApi._def - let instance = eventApi._instance - - return { - defs: { [def.defId]: def }, - instances: instance - ? { [instance.instanceId]: instance } - : {}, - } -} - -export function buildEventApis(eventStore: EventStore, context: CalendarContext, excludeInstance?: EventInstance): EventImpl[] { - let { defs, instances } = eventStore - let eventApis: EventImpl[] = [] - let excludeInstanceId = excludeInstance ? excludeInstance.instanceId : '' - - for (let id in instances) { - let instance = instances[id] - let def = defs[instance.defId] - - if (instance.instanceId !== excludeInstanceId) { - eventApis.push(new EventImpl(context, def, instance)) - } - } - - return eventApis -} diff --git a/fullcalendar-main/packages/core/src/api/EventSourceApi.ts b/fullcalendar-main/packages/core/src/api/EventSourceApi.ts deleted file mode 100644 index b183e18..0000000 --- a/fullcalendar-main/packages/core/src/api/EventSourceApi.ts +++ /dev/null @@ -1,8 +0,0 @@ - -export interface EventSourceApi { - id: string - url: string - format: string - remove(): void - refetch(): void -} diff --git a/fullcalendar-main/packages/core/src/api/EventSourceImpl.ts b/fullcalendar-main/packages/core/src/api/EventSourceImpl.ts deleted file mode 100644 index c78eeee..0000000 --- a/fullcalendar-main/packages/core/src/api/EventSourceImpl.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { EventSource } from '../structs/event-source.js' -import { CalendarContext } from '../CalendarContext.js' -import { EventSourceApi } from './EventSourceApi.js' - -export class EventSourceImpl implements EventSourceApi { - constructor( - private context: CalendarContext, - public internalEventSource: EventSource, // rename? - ) { - } - - remove(): void { - this.context.dispatch({ - type: 'REMOVE_EVENT_SOURCE', - sourceId: this.internalEventSource.sourceId, - }) - } - - refetch(): void { - this.context.dispatch({ - type: 'FETCH_EVENT_SOURCES', - sourceIds: [this.internalEventSource.sourceId], - isRefetch: true, - }) - } - - get id(): string { - return this.internalEventSource.publicId - } - - get url(): string { - return this.internalEventSource.meta.url - } - - get format(): string { - return this.internalEventSource.meta.format // TODO: bad. not guaranteed - } -} diff --git a/fullcalendar-main/packages/core/src/api/ViewApi.ts b/fullcalendar-main/packages/core/src/api/ViewApi.ts deleted file mode 100644 index 8df3817..0000000 --- a/fullcalendar-main/packages/core/src/api/ViewApi.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { CalendarApi } from './CalendarApi.js' - -export interface ViewApi { - calendar: CalendarApi - - type: string - title: string - activeStart: Date - activeEnd: Date - currentStart: Date - currentEnd: Date - - getOption(name: string): any -} diff --git a/fullcalendar-main/packages/core/src/api/ViewImpl.ts b/fullcalendar-main/packages/core/src/api/ViewImpl.ts deleted file mode 100644 index e015959..0000000 --- a/fullcalendar-main/packages/core/src/api/ViewImpl.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { DateEnv } from '../datelib/env.js' -import { CalendarData } from '../reducers/data-types.js' -import { CalendarApi } from './CalendarApi.js' -import { ViewApi } from './ViewApi.js' - -// always represents the current view. otherwise, it'd need to change value every time date changes -export class ViewImpl implements ViewApi { - constructor( - public type: string, - private getCurrentData: () => CalendarData, - private dateEnv: DateEnv, - ) { - } - - get calendar(): CalendarApi { - return this.getCurrentData().calendarApi - } - - get title(): string { - return this.getCurrentData().viewTitle - } - - get activeStart(): Date { - return this.dateEnv.toDate(this.getCurrentData().dateProfile.activeRange.start) - } - - get activeEnd(): Date { - return this.dateEnv.toDate(this.getCurrentData().dateProfile.activeRange.end) - } - - get currentStart(): Date { - return this.dateEnv.toDate(this.getCurrentData().dateProfile.currentRange.start) - } - - get currentEnd(): Date { - return this.dateEnv.toDate(this.getCurrentData().dateProfile.currentRange.end) - } - - getOption(name: string): any { - return this.getCurrentData().options[name] // are the view-specific options - } -} diff --git a/fullcalendar-main/packages/core/src/api/structs.ts b/fullcalendar-main/packages/core/src/api/structs.ts deleted file mode 100644 index 44faf99..0000000 --- a/fullcalendar-main/packages/core/src/api/structs.ts +++ /dev/null @@ -1,44 +0,0 @@ -export type { CalendarOptions, CalendarListeners } from '../options.js' -export type { DateInput } from '../datelib/env.js' -export type { DurationInput } from '../datelib/duration.js' -export type { DateSpanInput } from '../structs/date-span.js' -export type { DateRangeInput } from '../datelib/date-range.js' -export type { EventSourceInput } from '../structs/event-source-parse.js' -export type { EventSourceFunc, EventSourceFuncArg } from '../event-sources/func-event-source.js' -export type { EventInput, EventInputTransformer } from '../structs/event-parse.js' -export type { FormatterInput } from '../datelib/formatting.js' -export type { CssDimValue } from '../scrollgrid/util.js' -export type { BusinessHoursInput } from '../structs/business-hours.js' -export type { LocaleSingularArg, LocaleInput } from '../datelib/locale.js' -export type { OverlapFunc, ConstraintInput, AllowFunc } from '../structs/constraint.js' -export type { PluginDef, PluginDefInput } from '../plugin-system-struct.js' -export type { ViewComponentType, SpecificViewContentArg, SpecificViewMountArg } from '../structs/view-config.js' -export type { ClassNamesGenerator, CustomContentGenerator, DidMountHandler, WillUnmountHandler } from '../common/render-hook.js' -export type { NowIndicatorContentArg, NowIndicatorMountArg } from '../common/NowIndicatorContainer.js' -export type { WeekNumberContentArg, WeekNumberMountArg } from '../common/WeekNumberContainer.js' -export type { MoreLinkContentArg, MoreLinkMountArg } from '../common/MoreLinkContainer.js' -export * from '../common/more-link-public-types.js' -export type { - SlotLaneContentArg, SlotLaneMountArg, - SlotLabelContentArg, SlotLabelMountArg, - AllDayContentArg, AllDayMountArg, - DayHeaderContentArg, - DayHeaderMountArg, -} from '../render-hook-misc.js' -export type { DayCellContentArg, DayCellMountArg } from '../common/DayCellContainer.js' -export type { ViewContentArg, ViewMountArg } from '../common/ViewContainer.js' -export type { EventClickArg } from '../interactions/EventClicking.js' -export type { EventHoveringArg } from '../interactions/EventHovering.js' -export type { DateSelectArg, DateUnselectArg } from '../calendar-utils.js' -export type { WeekNumberCalculation } from '../datelib/env.js' -export type { ToolbarInput, CustomButtonInput, ButtonIconsInput, ButtonTextCompoundInput } from '../toolbar-struct.js' -export type { EventContentArg, EventMountArg } from '../component/event-rendering.js' -export type { DatesSetArg } from '../dates-set.js' -export type { EventAddArg, EventChangeArg, EventDropArg, EventRemoveArg } from '../event-crud.js' -export type { ButtonHintCompoundInput } from '../toolbar-struct.js' -export type { CustomRenderingHandler, CustomRenderingStore } from '../content-inject/CustomRenderingStore.js' -export type { DateSpanApi, DatePointApi } from '../structs/date-span.js' -export type { DateSelectionApi } from '../calendar-utils.js' - -// used by some args -export type { Duration } from '../datelib/duration.js' diff --git a/fullcalendar-main/packages/core/src/calendar-utils.ts b/fullcalendar-main/packages/core/src/calendar-utils.ts deleted file mode 100644 index 2ecc711..0000000 --- a/fullcalendar-main/packages/core/src/calendar-utils.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { PointerDragEvent } from './interactions/pointer.js' -import { buildDateSpanApi, DateSpanApi, DatePointApi, DateSpan } from './structs/date-span.js' -import { CalendarContext } from './CalendarContext.js' -import { ViewApi } from './api/ViewApi.js' -import { ViewImpl } from './api/ViewImpl.js' -import { DateMarker, startOfDay } from './datelib/marker.js' - -export interface DateClickApi extends DatePointApi { - dayEl: HTMLElement - jsEvent: UIEvent - view: ViewApi -} - -export interface DateSelectionApi extends DateSpanApi { - jsEvent: UIEvent - view: ViewApi -} - -export type DatePointTransform = (dateSpan: DateSpan, context: CalendarContext) => any -export type DateSpanTransform = (dateSpan: DateSpan, context: CalendarContext) => any - -export type CalendarInteraction = { destroy: () => void } -export type CalendarInteractionClass = { new(context: CalendarContext): CalendarInteraction } - -export type OptionChangeHandler = (propValue: any, context: CalendarContext) => void -export type OptionChangeHandlerMap = { [propName: string]: OptionChangeHandler } - -export interface DateSelectArg extends DateSpanApi { - jsEvent: MouseEvent | null - view: ViewApi -} - -export function triggerDateSelect(selection: DateSpan, pev: PointerDragEvent | null, context: CalendarContext & { viewApi?: ViewImpl }) { - context.emitter.trigger('select', { - ...buildDateSpanApiWithContext(selection, context), - jsEvent: pev ? pev.origEvent as MouseEvent : null, // Is this always a mouse event? See #4655 - view: context.viewApi || context.calendarApi.view, - } as DateSelectArg) -} - -export interface DateUnselectArg { - jsEvent: MouseEvent - view: ViewApi -} - -export function triggerDateUnselect(pev: PointerDragEvent | null, context: CalendarContext & { viewApi?: ViewImpl }) { - context.emitter.trigger('unselect', { - jsEvent: pev ? pev.origEvent as MouseEvent : null, // Is this always a mouse event? See #4655 - view: context.viewApi || context.calendarApi.view, - } as DateUnselectArg) -} - -export function buildDateSpanApiWithContext(dateSpan: DateSpan, context: CalendarContext) { - let props = {} as DateSpanApi - - for (let transform of context.pluginHooks.dateSpanTransforms) { - Object.assign(props, transform(dateSpan, context)) - } - - Object.assign(props, buildDateSpanApi(dateSpan, context.dateEnv)) - - return props -} - -// Given an event's allDay status and start date, return what its fallback end date should be. -// TODO: rename to computeDefaultEventEnd -export function getDefaultEventEnd(allDay: boolean, marker: DateMarker, context: CalendarContext): DateMarker { - let { dateEnv, options } = context - let end = marker - - if (allDay) { - end = startOfDay(end) - end = dateEnv.add(end, options.defaultAllDayEventDuration) - } else { - end = dateEnv.add(end, options.defaultTimedEventDuration) - } - - return end -} diff --git a/fullcalendar-main/packages/core/src/common/DayCellContainer.tsx b/fullcalendar-main/packages/core/src/common/DayCellContainer.tsx deleted file mode 100644 index 593f748..0000000 --- a/fullcalendar-main/packages/core/src/common/DayCellContainer.tsx +++ /dev/null @@ -1,117 +0,0 @@ -import { ComponentChild, createElement } from '../preact.js' -import { DateMarker } from '../datelib/marker.js' -import { DateRange } from '../datelib/date-range.js' -import { getDateMeta, DateMeta, getDayClassNames } from '../component/date-rendering.js' -import { createFormatter } from '../datelib/formatting.js' -import { DateFormatter } from '../datelib/DateFormatter.js' -import { formatDayString } from '../datelib/formatting-utils.js' -import { MountArg } from './render-hook.js' -import { ViewApi } from '../api/ViewApi.js' -import { BaseComponent } from '../vdom-util.js' -import { DateProfile } from '../DateProfileGenerator.js' -import { memoizeObjArg } from '../util/memoize.js' -import { Dictionary, ViewOptions } from '../options.js' -import { DateEnv } from '../datelib/env.js' -import { ContentContainer, InnerContainerFunc } from '../content-inject/ContentContainer.js' -import { ElProps, hasCustomRenderingHandler } from '../content-inject/ContentInjector.js' - -export interface DayCellContentArg extends DateMeta { - date: DateMarker // localized - view: ViewApi - dayNumberText: string - [extraProp: string]: any // so can include a resource -} - -export type DayCellMountArg = MountArg - -export interface DayCellContainerProps extends Partial { - date: DateMarker - dateProfile: DateProfile - todayRange: DateRange - isMonthStart?: boolean - showDayNumber?: boolean // defaults to false - extraRenderProps?: Dictionary - defaultGenerator?: (renderProps: DayCellContentArg) => ComponentChild - children?: InnerContainerFunc -} - -const DAY_NUM_FORMAT = createFormatter({ day: 'numeric' }) - -export class DayCellContainer extends BaseComponent { - refineRenderProps = memoizeObjArg(refineRenderProps) - - render() { - let { props, context } = this - let { options } = context - let renderProps = this.refineRenderProps({ - date: props.date, - dateProfile: props.dateProfile, - todayRange: props.todayRange, - isMonthStart: props.isMonthStart || false, - showDayNumber: props.showDayNumber, - extraRenderProps: props.extraRenderProps, - viewApi: context.viewApi, - dateEnv: context.dateEnv, - monthStartFormat: options.monthStartFormat, - }) - - return ( - - ) - } -} - -export function hasCustomDayCellContent(options: ViewOptions): boolean { - return Boolean(options.dayCellContent || hasCustomRenderingHandler('dayCellContent', options)) -} - -// Render Props - -interface DayCellRenderPropsInput { - date: DateMarker // generic - dateProfile: DateProfile - todayRange: DateRange - dateEnv: DateEnv - viewApi: ViewApi - monthStartFormat: DateFormatter - isMonthStart: boolean // defaults to false - showDayNumber?: boolean // defaults to false - extraRenderProps?: Dictionary // so can include a resource -} - -function refineRenderProps(raw: DayCellRenderPropsInput): DayCellContentArg { - let { date, dateEnv, dateProfile, isMonthStart } = raw - let dayMeta = getDateMeta(date, raw.todayRange, null, dateProfile) - let dayNumberText = raw.showDayNumber ? ( - dateEnv.format(date, isMonthStart ? raw.monthStartFormat : DAY_NUM_FORMAT) - ) : '' - - return { - date: dateEnv.toDate(date), - view: raw.viewApi, - ...dayMeta, - isMonthStart, - dayNumberText, - ...raw.extraRenderProps, - } -} diff --git a/fullcalendar-main/packages/core/src/common/DayHeader.tsx b/fullcalendar-main/packages/core/src/common/DayHeader.tsx deleted file mode 100644 index cc97425..0000000 --- a/fullcalendar-main/packages/core/src/common/DayHeader.tsx +++ /dev/null @@ -1,65 +0,0 @@ -import { BaseComponent } from '../vdom-util.js' -import { DateMarker } from '../datelib/marker.js' -import { computeFallbackHeaderFormat } from './table-utils.js' -import { VNode, createElement } from '../preact.js' -import { TableDateCell } from './TableDateCell.js' -import { TableDowCell } from './TableDowCell.js' -import { NowTimer } from '../NowTimer.js' -import { DateRange } from '../datelib/date-range.js' -import { memoize } from '../util/memoize.js' -import { DateProfile } from '../DateProfileGenerator.js' -import { DateFormatter } from '../datelib/DateFormatter.js' - -export interface DayHeaderProps { - dateProfile: DateProfile - dates: DateMarker[] - datesRepDistinctDays: boolean - renderIntro?: (rowKey: string) => VNode -} - -export class DayHeader extends BaseComponent { // TODO: rename to DayHeaderTr? - createDayHeaderFormatter = memoize(createDayHeaderFormatter) - - render() { - let { context } = this - let { dates, dateProfile, datesRepDistinctDays, renderIntro } = this.props - - let dayHeaderFormat = this.createDayHeaderFormatter( - context.options.dayHeaderFormat, - datesRepDistinctDays, - dates.length, - ) - - return ( - - {(nowDate: DateMarker, todayRange: DateRange) => ( - - {renderIntro && renderIntro('day')} - {dates.map((date) => ( - datesRepDistinctDays ? ( - - ) : ( - - ) - ))} - - )} - - ) - } -} - -function createDayHeaderFormatter(explicitFormat: DateFormatter, datesRepDistinctDays, dateCnt) { - return explicitFormat || computeFallbackHeaderFormat(datesRepDistinctDays, dateCnt) -} diff --git a/fullcalendar-main/packages/core/src/common/DaySeriesModel.ts b/fullcalendar-main/packages/core/src/common/DaySeriesModel.ts deleted file mode 100644 index 940ea65..0000000 --- a/fullcalendar-main/packages/core/src/common/DaySeriesModel.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { DateProfileGenerator } from '../DateProfileGenerator.js' -import { DateMarker, addDays, diffDays } from '../datelib/marker.js' -import { DateRange } from '../datelib/date-range.js' - -export interface DaySeriesSeg { - firstIndex: number - lastIndex: number - isStart: boolean - isEnd: boolean -} - -export class DaySeriesModel { - cnt: number - dates: DateMarker[] // whole-day dates for each column. left to right - indices: number[] // for each day from start, the offset - - constructor(range: DateRange, dateProfileGenerator: DateProfileGenerator) { - let date: DateMarker = range.start - let { end } = range - let indices: number[] = [] - let dates: DateMarker[] = [] - let dayIndex = -1 - - while (date < end) { // loop each day from start to end - if (dateProfileGenerator.isHiddenDay(date)) { - indices.push(dayIndex + 0.5) // mark that it's between indices - } else { - dayIndex += 1 - indices.push(dayIndex) - dates.push(date) - } - date = addDays(date, 1) - } - - this.dates = dates - this.indices = indices - this.cnt = dates.length - } - - sliceRange(range: DateRange): DaySeriesSeg | null { - let firstIndex = this.getDateDayIndex(range.start) // inclusive first index - let lastIndex = this.getDateDayIndex(addDays(range.end, -1)) // inclusive last index - - let clippedFirstIndex = Math.max(0, firstIndex) - let clippedLastIndex = Math.min(this.cnt - 1, lastIndex) - - // deal with in-between indices - clippedFirstIndex = Math.ceil(clippedFirstIndex) // in-between starts round to next cell - clippedLastIndex = Math.floor(clippedLastIndex) // in-between ends round to prev cell - - if (clippedFirstIndex <= clippedLastIndex) { - return { - firstIndex: clippedFirstIndex, - lastIndex: clippedLastIndex, - isStart: firstIndex === clippedFirstIndex, - isEnd: lastIndex === clippedLastIndex, - } - } - return null - } - - // Given a date, returns its chronolocial cell-index from the first cell of the grid. - // If the date lies between cells (because of hiddenDays), returns a floating-point value between offsets. - // If before the first offset, returns a negative number. - // If after the last offset, returns an offset past the last cell offset. - // Only works for *start* dates of cells. Will not work for exclusive end dates for cells. - private getDateDayIndex(date: DateMarker) { - let { indices } = this - let dayOffset = Math.floor(diffDays(this.dates[0], date)) - - if (dayOffset < 0) { - return indices[0] - 1 - } - - if (dayOffset >= indices.length) { - return indices[indices.length - 1] + 1 - } - - return indices[dayOffset] - } -} diff --git a/fullcalendar-main/packages/core/src/common/DayTableModel.ts b/fullcalendar-main/packages/core/src/common/DayTableModel.ts deleted file mode 100644 index 12496ea..0000000 --- a/fullcalendar-main/packages/core/src/common/DayTableModel.ts +++ /dev/null @@ -1,120 +0,0 @@ -import { DaySeriesModel } from './DaySeriesModel.js' -import { DateRange } from '../datelib/date-range.js' -import { DateMarker } from '../datelib/marker.js' -import { Seg } from '../component/DateComponent.js' -import { Dictionary } from '../options.js' - -export interface DayTableSeg extends Seg { - row: number - firstCol: number - lastCol: number -} - -export interface DayTableCell { - key: string // probably just the serialized date, but could be other metadata if this col is specific to another entity - date: DateMarker - extraRenderProps?: Dictionary - extraDataAttrs?: Dictionary - extraClassNames?: string[] - extraDateSpan?: Dictionary -} - -export class DayTableModel { - rowCnt: number - colCnt: number - cells: DayTableCell[][] - headerDates: DateMarker[] - - private daySeries: DaySeriesModel - - constructor(daySeries: DaySeriesModel, breakOnWeeks: boolean) { - let { dates } = daySeries - let daysPerRow - let firstDay - let rowCnt - - if (breakOnWeeks) { - // count columns until the day-of-week repeats - firstDay = dates[0].getUTCDay() - for (daysPerRow = 1; daysPerRow < dates.length; daysPerRow += 1) { - if (dates[daysPerRow].getUTCDay() === firstDay) { - break - } - } - rowCnt = Math.ceil(dates.length / daysPerRow) - } else { - rowCnt = 1 - daysPerRow = dates.length - } - - this.rowCnt = rowCnt - this.colCnt = daysPerRow - this.daySeries = daySeries - this.cells = this.buildCells() - this.headerDates = this.buildHeaderDates() - } - - private buildCells() { - let rows = [] - - for (let row = 0; row < this.rowCnt; row += 1) { - let cells = [] - - for (let col = 0; col < this.colCnt; col += 1) { - cells.push( - this.buildCell(row, col), - ) - } - - rows.push(cells) - } - - return rows - } - - private buildCell(row, col): DayTableCell { - let date = this.daySeries.dates[row * this.colCnt + col] - return { - key: date.toISOString(), - date, - } - } - - private buildHeaderDates() { - let dates = [] - - for (let col = 0; col < this.colCnt; col += 1) { - dates.push(this.cells[0][col].date) - } - - return dates - } - - sliceRange(range: DateRange): DayTableSeg[] { - let { colCnt } = this - let seriesSeg = this.daySeries.sliceRange(range) - let segs: DayTableSeg[] = [] - - if (seriesSeg) { - let { firstIndex, lastIndex } = seriesSeg - let index = firstIndex - - while (index <= lastIndex) { - let row = Math.floor(index / colCnt) - let nextIndex = Math.min((row + 1) * colCnt, lastIndex + 1) - - segs.push({ - row, - firstCol: index % colCnt, - lastCol: (nextIndex - 1) % colCnt, - isStart: seriesSeg.isStart && index === firstIndex, - isEnd: seriesSeg.isEnd && (nextIndex - 1) === lastIndex, - }) - - index = nextIndex - } - } - - return segs - } -} diff --git a/fullcalendar-main/packages/core/src/common/Emitter.ts b/fullcalendar-main/packages/core/src/common/Emitter.ts deleted file mode 100644 index d4c2e6c..0000000 --- a/fullcalendar-main/packages/core/src/common/Emitter.ts +++ /dev/null @@ -1,59 +0,0 @@ -export interface HandlerFuncTypeHash { - [eventName: string]: (...args: any[]) => any // with all properties required -} - -export class Emitter { - private handlers: { [Prop in keyof HandlerFuncs]?: HandlerFuncs[Prop][] } = {} - - private options: Partial - - private thisContext: any = null - - setThisContext(thisContext) { - this.thisContext = thisContext - } - - setOptions(options: Partial) { - this.options = options - } - - on(type: Prop, handler: HandlerFuncs[Prop]) { - addToHash(this.handlers, type, handler) - } - - off(type: Prop, handler?: HandlerFuncs[Prop]) { - removeFromHash(this.handlers, type, handler) - } - - trigger(type: Prop, ...args: Parameters) { - let attachedHandlers = this.handlers[type] || [] - let optionHandler = this.options && this.options[type] - let handlers = [].concat(optionHandler || [], attachedHandlers) - - for (let handler of handlers) { - handler.apply(this.thisContext, args) - } - } - - hasHandlers(type: keyof HandlerFuncs): boolean { - return Boolean( - (this.handlers[type] && this.handlers[type].length) || - (this.options && this.options[type]), - ) - } -} - -function addToHash(hash, type, handler) { - (hash[type] || (hash[type] = [])) - .push(handler) -} - -function removeFromHash(hash, type, handler?) { - if (handler) { - if (hash[type]) { - hash[type] = hash[type].filter((func) => func !== handler) - } - } else { - delete hash[type] // remove all handler funcs for this type - } -} diff --git a/fullcalendar-main/packages/core/src/common/EventContainer.tsx b/fullcalendar-main/packages/core/src/common/EventContainer.tsx deleted file mode 100644 index 78c498d..0000000 --- a/fullcalendar-main/packages/core/src/common/EventContainer.tsx +++ /dev/null @@ -1,99 +0,0 @@ -import { ComponentChild, createElement } from '../preact.js' -import { BaseComponent } from '../vdom-util.js' -import { Seg } from '../component/DateComponent.js' -import { EventImpl } from '../api/EventImpl.js' -import { - computeSegDraggable, - computeSegStartResizable, - computeSegEndResizable, - EventContentArg, - getEventClassNames, - setElSeg, -} from '../component/event-rendering.js' -import { ContentContainer, InnerContainerFunc } from '../content-inject/ContentContainer.js' -import { ElProps } from '../content-inject/ContentInjector.js' - -export interface MinimalEventProps { - seg: Seg - isDragging: boolean // rename to isMirrorDragging? make optional? - isResizing: boolean // rename to isMirrorResizing? make optional? - isDateSelecting: boolean // rename to isMirrorDateSelecting? make optional? - isSelected: boolean - isPast: boolean - isFuture: boolean - isToday: boolean -} - -export type EventContainerProps = ElProps & MinimalEventProps & { - defaultGenerator: (renderProps: EventContentArg) => ComponentChild - disableDragging?: boolean - disableResizing?: boolean - timeText: string - children?: InnerContainerFunc -} - -export class EventContainer extends BaseComponent { - el: HTMLElement - - render() { - const { props, context } = this - const { options } = context - const { seg } = props - const { eventRange } = seg - const { ui } = eventRange - - const renderProps: EventContentArg = { - event: new EventImpl(context, eventRange.def, eventRange.instance), - view: context.viewApi, - timeText: props.timeText, - textColor: ui.textColor, - backgroundColor: ui.backgroundColor, - borderColor: ui.borderColor, - isDraggable: !props.disableDragging && computeSegDraggable(seg, context), - isStartResizable: !props.disableResizing && computeSegStartResizable(seg, context), - isEndResizable: !props.disableResizing && computeSegEndResizable(seg, context), - isMirror: Boolean(props.isDragging || props.isResizing || props.isDateSelecting), - isStart: Boolean(seg.isStart), - isEnd: Boolean(seg.isEnd), - isPast: Boolean(props.isPast), // TODO: don't cast. getDateMeta does it - isFuture: Boolean(props.isFuture), // TODO: don't cast. getDateMeta does it - isToday: Boolean(props.isToday), // TODO: don't cast. getDateMeta does it - isSelected: Boolean(props.isSelected), - isDragging: Boolean(props.isDragging), - isResizing: Boolean(props.isResizing), - } - - return ( - - ) - } - - handleEl = (el: HTMLElement | null) => { - this.el = el - - if (el) { - setElSeg(el, this.props.seg) - } - } - - componentDidUpdate(prevProps: EventContainerProps): void { - if (this.el && this.props.seg !== prevProps.seg) { - setElSeg(this.el, this.props.seg) - } - } -} diff --git a/fullcalendar-main/packages/core/src/common/MoreLinkContainer.tsx b/fullcalendar-main/packages/core/src/common/MoreLinkContainer.tsx deleted file mode 100644 index 4ab638e..0000000 --- a/fullcalendar-main/packages/core/src/common/MoreLinkContainer.tsx +++ /dev/null @@ -1,229 +0,0 @@ -import { EventImpl } from '../api/EventImpl.js' -import { Seg } from '../component/DateComponent.js' -import { DateRange } from '../datelib/date-range.js' -import { addDays, DateMarker } from '../datelib/marker.js' -import { DateProfile } from '../DateProfileGenerator.js' -import { Dictionary } from '../options.js' -import { elementClosest, getUniqueDomId } from '../util/dom-manip.js' -import { formatWithOrdinals } from '../util/misc.js' -import { createElement, Fragment, ComponentChild, RefObject } from '../preact.js' -import { BaseComponent, setRef } from '../vdom-util.js' -import { ViewApi } from '../api/ViewApi.js' -import { ViewContext, ViewContextType } from '../ViewContext.js' -import { MorePopover } from './MorePopover.js' -import { MountArg } from './render-hook.js' -import { ContentContainer, InnerContainerFunc } from '../content-inject/ContentContainer.js' -import { ElProps } from '../content-inject/ContentInjector.js' -import { createAriaClickAttrs } from '../util/dom-event.js' - -export interface MoreLinkContainerProps extends Partial { - dateProfile: DateProfile - todayRange: DateRange - allDayDate: DateMarker | null - moreCnt: number // can't always derive from hiddenSegs. some hiddenSegs might be due to lack of dimensions - allSegs: Seg[] - hiddenSegs: Seg[] - extraDateSpan?: Dictionary - alignmentElRef?: RefObject // will use internal if unspecified - alignGridTop?: boolean // for popover - forceTimed?: boolean // for popover - popoverContent: () => ComponentChild - defaultGenerator?: (renderProps: MoreLinkContentArg) => ComponentChild - children?: InnerContainerFunc -} - -export interface MoreLinkContentArg { - num: number - text: string - shortText: string - view: ViewApi -} - -export type MoreLinkMountArg = MountArg - -interface MoreLinkContainerState { - isPopoverOpen: boolean - popoverId: string -} - -export class MoreLinkContainer extends BaseComponent { - private linkEl: HTMLElement - private parentEl: HTMLElement - - state = { - isPopoverOpen: false, - popoverId: getUniqueDomId(), - } - - render() { - let { props, state } = this - return ( - - {(context: ViewContext) => { - let { viewApi, options, calendarApi } = context - let { moreLinkText } = options - let { moreCnt } = props - let range = computeRange(props) - - let text = typeof moreLinkText === 'function' // TODO: eventually use formatWithOrdinals - ? moreLinkText.call(calendarApi, moreCnt) - : `+${moreCnt} ${moreLinkText}` - let hint = formatWithOrdinals(options.moreLinkHint, [moreCnt], text) - - let renderProps: MoreLinkContentArg = { - num: moreCnt, - shortText: `+${moreCnt}`, // TODO: offer hook or i18n? - text, - view: viewApi, - } - - return ( - - {Boolean(props.moreCnt) && ( - {props.children} - )} - {state.isPopoverOpen && ( - - {props.popoverContent()} - - )} - - ) - }} - - ) - } - - componentDidMount() { - this.updateParentEl() - } - - componentDidUpdate() { - this.updateParentEl() - } - - handleLinkEl = (linkEl: HTMLElement | null) => { - this.linkEl = linkEl - - if (this.props.elRef) { - setRef(this.props.elRef, linkEl) - } - } - - updateParentEl() { - if (this.linkEl) { - this.parentEl = elementClosest(this.linkEl, '.fc-view-harness') - } - } - - handleClick = (ev: MouseEvent) => { - let { props, context } = this - let { moreLinkClick } = context.options - let date = computeRange(props).start - - function buildPublicSeg(seg: Seg) { - let { def, instance, range } = seg.eventRange - return { - event: new EventImpl(context, def, instance), - start: context.dateEnv.toDate(range.start), - end: context.dateEnv.toDate(range.end), - isStart: seg.isStart, - isEnd: seg.isEnd, - } - } - - if (typeof moreLinkClick === 'function') { - moreLinkClick = moreLinkClick({ - date, - allDay: Boolean(props.allDayDate), - allSegs: props.allSegs.map(buildPublicSeg), - hiddenSegs: props.hiddenSegs.map(buildPublicSeg), - jsEvent: ev, - view: context.viewApi, - }) as string | undefined - } - - if (!moreLinkClick || moreLinkClick === 'popover') { - this.setState({ isPopoverOpen: true }) - } else if (typeof moreLinkClick === 'string') { // a view name - context.calendarApi.zoomTo(date, moreLinkClick) - } - } - - handlePopoverClose = () => { - this.setState({ isPopoverOpen: false }) - } -} - -function renderMoreLinkInner(props: MoreLinkContentArg) { - return props.text -} - -function computeRange(props: MoreLinkContainerProps): DateRange { - if (props.allDayDate) { - return { - start: props.allDayDate, - end: addDays(props.allDayDate, 1), - } - } - - let { hiddenSegs } = props - return { - start: computeEarliestSegStart(hiddenSegs), - end: computeLatestSegEnd(hiddenSegs), - } -} - -export function computeEarliestSegStart(segs: Seg[]): DateMarker { - return segs.reduce(pickEarliestStart).eventRange.range.start -} - -function pickEarliestStart(seg0: Seg, seg1: Seg): Seg { - return seg0.eventRange.range.start < seg1.eventRange.range.start ? seg0 : seg1 -} - -function computeLatestSegEnd(segs: Seg[]): DateMarker { - return segs.reduce(pickLatestEnd).eventRange.range.end -} - -function pickLatestEnd(seg0: Seg, seg1: Seg): Seg { - return seg0.eventRange.range.end > seg1.eventRange.range.end ? seg0 : seg1 -} diff --git a/fullcalendar-main/packages/core/src/common/MorePopover.tsx b/fullcalendar-main/packages/core/src/common/MorePopover.tsx deleted file mode 100644 index e2bf8cb..0000000 --- a/fullcalendar-main/packages/core/src/common/MorePopover.tsx +++ /dev/null @@ -1,114 +0,0 @@ -import { DateComponent } from '../component/DateComponent.js' -import { DateRange } from '../datelib/date-range.js' -import { DateMarker } from '../datelib/marker.js' -import { DateProfile } from '../DateProfileGenerator.js' -import { Hit } from '../interactions/hit.js' -import { Dictionary } from '../options.js' -import { createElement, ComponentChildren } from '../preact.js' -import { DayCellContainer, hasCustomDayCellContent } from './DayCellContainer.js' -import { Popover } from './Popover.js' - -export interface MorePopoverProps { - id: string - startDate: DateMarker - endDate: DateMarker - dateProfile: DateProfile - parentEl: HTMLElement - alignmentEl: HTMLElement - alignGridTop?: boolean - forceTimed?: boolean - todayRange: DateRange - extraDateSpan: Dictionary - children: ComponentChildren - onClose?: () => void -} - -export class MorePopover extends DateComponent { - rootEl: HTMLElement - - render() { - let { options, dateEnv } = this.context - let { props } = this - let { startDate, todayRange, dateProfile } = props - let title = dateEnv.format(startDate, options.dayPopoverFormat) - - return ( - - {(InnerContent, renderProps, elAttrs) => ( - - {hasCustomDayCellContent(options) && ( - - )} - {props.children} - - )} - - ) - } - - handleRootEl = (rootEl: HTMLElement | null) => { - this.rootEl = rootEl - - if (rootEl) { - this.context.registerInteractiveComponent(this, { - el: rootEl, - useEventCenter: false, - }) - } else { - this.context.unregisterInteractiveComponent(this) - } - } - - queryHit(positionLeft: number, positionTop: number, elWidth: number, elHeight: number): Hit { - let { rootEl, props } = this - - if ( - positionLeft >= 0 && positionLeft < elWidth && - positionTop >= 0 && positionTop < elHeight - ) { - return { - dateProfile: props.dateProfile, - dateSpan: { - allDay: !props.forceTimed, - range: { - start: props.startDate, - end: props.endDate, - }, - ...props.extraDateSpan, - }, - dayEl: rootEl, - rect: { - left: 0, - top: 0, - right: elWidth, - bottom: elHeight, - }, - layer: 1, // important when comparing with hits from other components - } - } - - return null - } -} diff --git a/fullcalendar-main/packages/core/src/common/NowIndicatorContainer.tsx b/fullcalendar-main/packages/core/src/common/NowIndicatorContainer.tsx deleted file mode 100644 index 1c42c5c..0000000 --- a/fullcalendar-main/packages/core/src/common/NowIndicatorContainer.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import { MountArg } from './render-hook.js' -import { DateMarker } from '../datelib/marker.js' -import { ViewContext, ViewContextType } from '../ViewContext.js' -import { createElement } from '../preact.js' -import { ViewApi } from '../api/ViewApi.js' -import { ElProps } from '../content-inject/ContentInjector.js' -import { InnerContainerFunc, ContentContainer } from '../content-inject/ContentContainer.js' - -export interface NowIndicatorContainerProps extends Partial { - isAxis: boolean - date: DateMarker - children?: InnerContainerFunc -} - -export interface NowIndicatorContentArg { - isAxis: boolean - date: Date - view: ViewApi -} - -export type NowIndicatorMountArg = MountArg - -export const NowIndicatorContainer = (props: NowIndicatorContainerProps) => ( - - {(context: ViewContext) => { - let { options } = context - let renderProps: NowIndicatorContentArg = { - isAxis: props.isAxis, - date: context.dateEnv.toDate(props.date), - view: context.viewApi, - } - - return ( - - ) - }} - -) diff --git a/fullcalendar-main/packages/core/src/common/Popover.tsx b/fullcalendar-main/packages/core/src/common/Popover.tsx deleted file mode 100644 index 1b6be9f..0000000 --- a/fullcalendar-main/packages/core/src/common/Popover.tsx +++ /dev/null @@ -1,132 +0,0 @@ -import { Dictionary } from '../options.js' -import { computeClippedClientRect } from '../util/dom-geom.js' -import { applyStyle, elementClosest, getEventTargetViaRoot, getUniqueDomId } from '../util/dom-manip.js' -import { createElement, ComponentChildren, Ref, createPortal } from '../preact.js' -import { BaseComponent, setRef } from '../vdom-util.js' - -export interface PopoverProps { - elRef?: Ref - id: string - title: string - extraClassNames?: string[] - extraAttrs?: Dictionary - parentEl: HTMLElement - alignmentEl: HTMLElement - alignGridTop?: boolean - children?: ComponentChildren - onClose?: () => void -} - -const PADDING_FROM_VIEWPORT = 10 - -export class Popover extends BaseComponent { - private rootEl: HTMLElement - state = { - titleId: getUniqueDomId(), - } - - render(): any { - let { theme, options } = this.context - let { props, state } = this - let classNames = [ - 'fc-popover', - theme.getClass('popover'), - ].concat( - props.extraClassNames || [], - ) - - return createPortal( -
-
- - {props.title} - - -
-
- {props.children} -
-
, - props.parentEl, - ) - } - - componentDidMount() { - document.addEventListener('mousedown', this.handleDocumentMouseDown) - document.addEventListener('keydown', this.handleDocumentKeyDown) - this.updateSize() - } - - componentWillUnmount() { - document.removeEventListener('mousedown', this.handleDocumentMouseDown) - document.removeEventListener('keydown', this.handleDocumentKeyDown) - } - - handleRootEl = (el: HTMLElement | null) => { - this.rootEl = el - - if (this.props.elRef) { - setRef(this.props.elRef, el) - } - } - - // Triggered when the user clicks *anywhere* in the document, for the autoHide feature - handleDocumentMouseDown = (ev) => { - // only hide the popover if the click happened outside the popover - const target = getEventTargetViaRoot(ev) as HTMLElement - if (!this.rootEl.contains(target)) { - this.handleCloseClick() - } - } - - handleDocumentKeyDown = (ev) => { - if (ev.key === 'Escape') { - this.handleCloseClick() - } - } - - handleCloseClick = () => { - let { onClose } = this.props - if (onClose) { - onClose() - } - } - - private updateSize() { - let { isRtl } = this.context - let { alignmentEl, alignGridTop } = this.props - let { rootEl } = this - - let alignmentRect = computeClippedClientRect(alignmentEl) - if (alignmentRect) { - let popoverDims = rootEl.getBoundingClientRect() - - // position relative to viewport - let popoverTop = alignGridTop - ? elementClosest(alignmentEl, '.fc-scrollgrid').getBoundingClientRect().top - : alignmentRect.top - let popoverLeft = isRtl ? alignmentRect.right - popoverDims.width : alignmentRect.left - - // constrain - popoverTop = Math.max(popoverTop, PADDING_FROM_VIEWPORT) - popoverLeft = Math.min(popoverLeft, document.documentElement.clientWidth - PADDING_FROM_VIEWPORT - popoverDims.width) - popoverLeft = Math.max(popoverLeft, PADDING_FROM_VIEWPORT) - - let origin = rootEl.offsetParent.getBoundingClientRect() - applyStyle(rootEl, { - top: popoverTop - origin.top, - left: popoverLeft - origin.left, - }) - } - } -} diff --git a/fullcalendar-main/packages/core/src/common/PositionCache.ts b/fullcalendar-main/packages/core/src/common/PositionCache.ts deleted file mode 100644 index cc8aede..0000000 --- a/fullcalendar-main/packages/core/src/common/PositionCache.ts +++ /dev/null @@ -1,125 +0,0 @@ -/* -Records offset information for a set of elements, relative to an origin element. -Can record the left/right OR the top/bottom OR both. -Provides methods for querying the cache by position. -*/ -export class PositionCache { - els: HTMLElement[] // assumed to be siblings - originClientRect: ClientRect - - // arrays of coordinates (from topleft of originEl) - // caller can access these directly - lefts: any - rights: any - tops: any - bottoms: any - - constructor(originEl: HTMLElement, els: HTMLElement[], isHorizontal: boolean, isVertical: boolean) { - this.els = els - - let originClientRect = this.originClientRect = originEl.getBoundingClientRect() // relative to viewport top-left - - if (isHorizontal) { - this.buildElHorizontals(originClientRect.left) - } - - if (isVertical) { - this.buildElVerticals(originClientRect.top) - } - } - - // Populates the left/right internal coordinate arrays - buildElHorizontals(originClientLeft: number) { - let lefts = [] - let rights = [] - - for (let el of this.els) { - let rect = el.getBoundingClientRect() - lefts.push(rect.left - originClientLeft) - rights.push(rect.right - originClientLeft) - } - - this.lefts = lefts - this.rights = rights - } - - // Populates the top/bottom internal coordinate arrays - buildElVerticals(originClientTop: number) { - let tops = [] - let bottoms = [] - - for (let el of this.els) { - let rect = el.getBoundingClientRect() - tops.push(rect.top - originClientTop) - bottoms.push(rect.bottom - originClientTop) - } - - this.tops = tops - this.bottoms = bottoms - } - - // Given a left offset (from document left), returns the index of the el that it horizontally intersects. - // If no intersection is made, returns undefined. - leftToIndex(leftPosition: number) { - let { lefts, rights } = this - let len = lefts.length - let i - - for (i = 0; i < len; i += 1) { - if (leftPosition >= lefts[i] && leftPosition < rights[i]) { - return i - } - } - - return undefined // TODO: better - } - - // Given a top offset (from document top), returns the index of the el that it vertically intersects. - // If no intersection is made, returns undefined. - topToIndex(topPosition: number) { - let { tops, bottoms } = this - let len = tops.length - let i - - for (i = 0; i < len; i += 1) { - if (topPosition >= tops[i] && topPosition < bottoms[i]) { - return i - } - } - - return undefined // TODO: better - } - - // Gets the width of the element at the given index - getWidth(leftIndex: number) { - return this.rights[leftIndex] - this.lefts[leftIndex] - } - - // Gets the height of the element at the given index - getHeight(topIndex: number) { - return this.bottoms[topIndex] - this.tops[topIndex] - } - - similarTo(otherCache: PositionCache) { - return similarNumArrays(this.tops || [], otherCache.tops || []) && - similarNumArrays(this.bottoms || [], otherCache.bottoms || []) && - similarNumArrays(this.lefts || [], otherCache.lefts || []) && - similarNumArrays(this.rights || [], otherCache.rights || []) - } -} - -function similarNumArrays(a: number[], b: number[]): boolean { - const len = a.length - - if (len !== b.length) { - return false - } - - for (let i = 0; i < len; i++) { - if (Math.round(a[i]) !== Math.round(b[i])) { - return false - } - } - - return true -} diff --git a/fullcalendar-main/packages/core/src/common/StandardEvent.tsx b/fullcalendar-main/packages/core/src/common/StandardEvent.tsx deleted file mode 100644 index 061d3bd..0000000 --- a/fullcalendar-main/packages/core/src/common/StandardEvent.tsx +++ /dev/null @@ -1,88 +0,0 @@ -import { createElement, Fragment } from '../preact.js' -import { BaseComponent } from '../vdom-util.js' -import { buildSegTimeText, EventContentArg, getSegAnchorAttrs } from '../component/event-rendering.js' -import { DateFormatter } from '../datelib/DateFormatter.js' -import { EventContainer } from './EventContainer.js' -import { Seg } from '../component/DateComponent.js' -import { ElRef } from '../content-inject/ContentInjector.js' - -export interface StandardEventProps { - elRef?: ElRef - elClasses?: string[] - seg: Seg - isDragging: boolean // rename to isMirrorDragging? make optional? - isResizing: boolean // rename to isMirrorResizing? make optional? - isDateSelecting: boolean // rename to isMirrorDateSelecting? make optional? - isSelected: boolean - isPast: boolean - isFuture: boolean - isToday: boolean - disableDragging?: boolean // defaults false - disableResizing?: boolean // defaults false - defaultTimeFormat: DateFormatter - defaultDisplayEventTime?: boolean // default true - defaultDisplayEventEnd?: boolean // default true -} - -// should not be a purecomponent -export class StandardEvent extends BaseComponent { - render() { - let { props, context } = this - let { options } = context - let { seg } = props - let { ui } = seg.eventRange - let timeFormat = options.eventTimeFormat || props.defaultTimeFormat - let timeText = buildSegTimeText( - seg, - timeFormat, - context, - props.defaultDisplayEventTime, - props.defaultDisplayEventEnd, - ) - - return ( - - {(InnerContent, eventContentArg) => ( - - - {Boolean(eventContentArg.isStartResizable) && ( -
- )} - {Boolean(eventContentArg.isEndResizable) && ( -
- )} - - )} - - ) - } -} - -function renderInnerContent(innerProps: EventContentArg) { - return ( -
- {innerProps.timeText && ( -
{innerProps.timeText}
- )} -
-
- {innerProps.event.title ||  } -
-
-
- ) -} diff --git a/fullcalendar-main/packages/core/src/common/TableDateCell.tsx b/fullcalendar-main/packages/core/src/common/TableDateCell.tsx deleted file mode 100644 index f95f656..0000000 --- a/fullcalendar-main/packages/core/src/common/TableDateCell.tsx +++ /dev/null @@ -1,88 +0,0 @@ -import { DateRange } from '../datelib/date-range.js' -import { getDayClassNames, getDateMeta } from '../component/date-rendering.js' -import { DateMarker } from '../datelib/marker.js' -import { createElement } from '../preact.js' -import { DateFormatter } from '../datelib/DateFormatter.js' -import { formatDayString } from '../datelib/formatting-utils.js' -import { BaseComponent } from '../vdom-util.js' -import { buildNavLinkAttrs } from './nav-link.js' -import { DateProfile } from '../DateProfileGenerator.js' -import { DayHeaderContentArg } from '../render-hook-misc.js' -import { Dictionary } from '../options.js' -import { CLASS_NAME, renderInner } from './table-cell-util.js' -import { ContentContainer } from '../content-inject/ContentContainer.js' - -export interface TableDateCellProps { - date: DateMarker - dateProfile: DateProfile - todayRange: DateRange - colCnt: number - dayHeaderFormat: DateFormatter - colSpan?: number - isSticky?: boolean // TODO: get this outta here somehow - extraDataAttrs?: Dictionary - extraRenderProps?: Dictionary -} - -// BAD name for this class now. used in the Header -export class TableDateCell extends BaseComponent { - render() { - let { dateEnv, options, theme, viewApi } = this.context - let { props } = this - let { date, dateProfile } = props - let dayMeta = getDateMeta(date, props.todayRange, null, dateProfile) - - let classNames = [CLASS_NAME].concat( - getDayClassNames(dayMeta, theme), - ) - let text = dateEnv.format(date, props.dayHeaderFormat) - - // if colCnt is 1, we are already in a day-view and don't need a navlink - let navLinkAttrs = (!dayMeta.isDisabled && props.colCnt > 1) - ? buildNavLinkAttrs(this.context, date) - : {} - - let renderProps: DayHeaderContentArg = { - date: dateEnv.toDate(date), - view: viewApi, - ...props.extraRenderProps, - text, - ...dayMeta, - } - - return ( - - {(InnerContainer) => ( -
- {!dayMeta.isDisabled && ( - - )} -
- )} -
- ) - } -} diff --git a/fullcalendar-main/packages/core/src/common/TableDowCell.tsx b/fullcalendar-main/packages/core/src/common/TableDowCell.tsx deleted file mode 100644 index 4999dc8..0000000 --- a/fullcalendar-main/packages/core/src/common/TableDowCell.tsx +++ /dev/null @@ -1,84 +0,0 @@ -import { getDayClassNames, DateMeta } from '../component/date-rendering.js' -import { addDays } from '../datelib/marker.js' -import { createElement } from '../preact.js' -import { DateFormatter } from '../datelib/DateFormatter.js' -import { BaseComponent } from '../vdom-util.js' -import { Dictionary } from '../options.js' -import { CLASS_NAME, renderInner } from './table-cell-util.js' -import { DayHeaderContentArg } from '../render-hook-misc.js' -import { createFormatter } from '../datelib/formatting.js' -import { ContentContainer } from '../content-inject/ContentContainer.js' - -export interface TableDowCellProps { - dow: number - dayHeaderFormat: DateFormatter - colSpan?: number - isSticky?: boolean // TODO: get this outta here somehow - extraRenderProps?: Dictionary - extraDataAttrs?: Dictionary - extraClassNames?: string[] -} - -const WEEKDAY_FORMAT = createFormatter({ weekday: 'long' }) - -export class TableDowCell extends BaseComponent { - render() { - let { props } = this - let { dateEnv, theme, viewApi, options } = this.context - let date = addDays(new Date(259200000), props.dow) // start with Sun, 04 Jan 1970 00:00:00 GMT - let dateMeta: DateMeta = { - dow: props.dow, - isDisabled: false, - isFuture: false, - isPast: false, - isToday: false, - isOther: false, - } - let text = dateEnv.format(date, props.dayHeaderFormat) - let renderProps: DayHeaderContentArg = { // TODO: make this public? - date, - ...dateMeta, - view: viewApi, - ...props.extraRenderProps, - text, - } - - return ( - - {(InnerContent) => ( -
- -
- )} -
- ) - } -} diff --git a/fullcalendar-main/packages/core/src/common/ViewContainer.tsx b/fullcalendar-main/packages/core/src/common/ViewContainer.tsx deleted file mode 100644 index 736ad0b..0000000 --- a/fullcalendar-main/packages/core/src/common/ViewContainer.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import { ViewSpec } from '../structs/view-spec.js' -import { MountArg } from './render-hook.js' -import { ComponentChildren, createElement } from '../preact.js' -import { BaseComponent } from '../vdom-util.js' -import { ViewApi } from '../api/ViewApi.js' -import { ContentContainer } from '../content-inject/ContentContainer.js' -import { ElProps } from '../content-inject/ContentInjector.js' - -export interface ViewContainerProps extends Partial { - viewSpec: ViewSpec - children: ComponentChildren -} - -export interface ViewContentArg { - view: ViewApi -} - -export type ViewMountArg = MountArg - -export class ViewContainer extends BaseComponent { - render() { - let { props, context } = this - let { options } = context - let renderProps: ViewContentArg = { view: context.viewApi } - - return ( - - {() => props.children} - - ) - } -} - -export function buildViewClassNames(viewSpec: ViewSpec): string[] { - return [ - `fc-${viewSpec.type}-view`, - 'fc-view', - ] -} diff --git a/fullcalendar-main/packages/core/src/common/WeekNumberContainer.tsx b/fullcalendar-main/packages/core/src/common/WeekNumberContainer.tsx deleted file mode 100644 index 16d17be..0000000 --- a/fullcalendar-main/packages/core/src/common/WeekNumberContainer.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import { ViewContext, ViewContextType } from '../ViewContext.js' -import { DateMarker } from '../datelib/marker.js' -import { MountArg } from './render-hook.js' -import { createElement } from '../preact.js' -import { DateFormatter } from '../datelib/DateFormatter.js' -import { ElProps } from '../content-inject/ContentInjector.js' -import { ContentContainer, InnerContainerFunc } from '../content-inject/ContentContainer.js' - -export interface WeekNumberContainerProps extends ElProps { - date: DateMarker - defaultFormat: DateFormatter - children?: InnerContainerFunc -} - -export interface WeekNumberContentArg { - num: number - text: string - date: Date -} - -export type WeekNumberMountArg = MountArg - -export const WeekNumberContainer = (props: WeekNumberContainerProps) => ( - - {(context: ViewContext) => { - let { dateEnv, options } = context - let { date } = props - let format = options.weekNumberFormat || props.defaultFormat - let num = dateEnv.computeWeekNumber(date) // TODO: somehow use for formatting as well? - let text = dateEnv.format(date, format) - let renderProps: WeekNumberContentArg = { num, text, date } - - return ( - - ) - }} - -) - -function renderInner(innerProps) { - return innerProps.text -} diff --git a/fullcalendar-main/packages/core/src/common/bg-fill.tsx b/fullcalendar-main/packages/core/src/common/bg-fill.tsx deleted file mode 100644 index f9c0b68..0000000 --- a/fullcalendar-main/packages/core/src/common/bg-fill.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import { createElement } from '../preact.js' -import { BaseComponent } from '../vdom-util.js' -import { Seg } from '../component/DateComponent.js' -import { EventContentArg } from '../component/event-rendering.js' -import { EventContainer } from './EventContainer.js' - -export interface BgEventProps { - seg: Seg - isPast: boolean - isFuture: boolean - isToday: boolean -} - -export class BgEvent extends BaseComponent { - render() { - let { props } = this - let { seg } = props - - return ( - - ) - } -} - -function renderInnerContent(props: EventContentArg) { - let { title } = props.event - - return title && ( -
{props.event.title}
- ) -} - -export function renderFill(fillType: string) { - return ( -
- ) -} diff --git a/fullcalendar-main/packages/core/src/common/more-link-public-types.ts b/fullcalendar-main/packages/core/src/common/more-link-public-types.ts deleted file mode 100644 index a27ac95..0000000 --- a/fullcalendar-main/packages/core/src/common/more-link-public-types.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { EventApi } from '../api/EventApi.js' -import { ViewApi } from '../api/ViewApi.js' - -export interface EventSegment { - event: EventApi - start: Date - end: Date - isStart: boolean - isEnd: boolean -} - -export type MoreLinkAction = MoreLinkSimpleAction | MoreLinkHandler -export type MoreLinkSimpleAction = 'popover' | 'week' | 'day' | 'timeGridWeek' | 'timeGridDay' | string - -export interface MoreLinkArg { - date: Date - allDay: boolean - allSegs: EventSegment[] - hiddenSegs: EventSegment[] - jsEvent: UIEvent - view: ViewApi -} - -export type MoreLinkHandler = (arg: MoreLinkArg) => MoreLinkSimpleAction | void diff --git a/fullcalendar-main/packages/core/src/common/nav-link.ts b/fullcalendar-main/packages/core/src/common/nav-link.ts deleted file mode 100644 index b566960..0000000 --- a/fullcalendar-main/packages/core/src/common/nav-link.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { createFormatter } from '../datelib/formatting.js' -import { DateMarker } from '../datelib/marker.js' -import { createAriaClickAttrs } from '../util/dom-event.js' -import { formatWithOrdinals } from '../util/misc.js' -import { ViewContext } from '../ViewContext.js' - -const DAY_FORMAT = createFormatter({ year: 'numeric', month: 'long', day: 'numeric' }) -const WEEK_FORMAT = createFormatter({ week: 'long' }) - -export function buildNavLinkAttrs( - context: ViewContext, - dateMarker: DateMarker, - viewType = 'day', - isTabbable = true, -) { - const { dateEnv, options, calendarApi } = context - let dateStr = dateEnv.format(dateMarker, viewType === 'week' ? WEEK_FORMAT : DAY_FORMAT) - - if (options.navLinks) { - let zonedDate = dateEnv.toDate(dateMarker) - - const handleInteraction = (ev: UIEvent) => { - let customAction = - viewType === 'day' ? options.navLinkDayClick : - viewType === 'week' ? options.navLinkWeekClick : null - - if (typeof customAction === 'function') { - customAction.call(calendarApi, dateEnv.toDate(dateMarker), ev) - } else { - if (typeof customAction === 'string') { - viewType = customAction - } - calendarApi.zoomTo(dateMarker, viewType) - } - } - - return { - title: formatWithOrdinals(options.navLinkHint, [dateStr, zonedDate], dateStr), - 'data-navlink': '', // for legacy selectors. TODO: use className? - ...(isTabbable - ? createAriaClickAttrs(handleInteraction) - : { onClick: handleInteraction } - ), - } - } - - return { 'aria-label': dateStr } -} diff --git a/fullcalendar-main/packages/core/src/common/render-hook.tsx b/fullcalendar-main/packages/core/src/common/render-hook.tsx deleted file mode 100644 index 6973852..0000000 --- a/fullcalendar-main/packages/core/src/common/render-hook.tsx +++ /dev/null @@ -1,17 +0,0 @@ -/* eslint max-classes-per-file: off */ - -import { ComponentChildren } from '../preact.js' -import { ClassNamesInput } from '../util/html.js' - -export type MountArg = ContentArg & { el: HTMLElement } -export type DidMountHandler = (mountArg: TheMountArg) => void -export type WillUnmountHandler = (mountArg: TheMountArg) => void - -export interface ObjCustomContent { - html: string - domNodes: any[] -} - -export type CustomContent = ComponentChildren | ObjCustomContent -export type CustomContentGenerator = CustomContent | ((renderProps: RenderProps, createElement: any) => (CustomContent | true)) -export type ClassNamesGenerator = ClassNamesInput | ((renderProps: RenderProps) => ClassNamesInput) diff --git a/fullcalendar-main/packages/core/src/common/scroll-controller.ts b/fullcalendar-main/packages/core/src/common/scroll-controller.ts deleted file mode 100644 index dacc5c1..0000000 --- a/fullcalendar-main/packages/core/src/common/scroll-controller.ts +++ /dev/null @@ -1,124 +0,0 @@ -/* eslint max-classes-per-file: "off" */ - -/* -An object for getting/setting scroll-related information for an element. -Internally, this is done very differently for window versus DOM element, -so this object serves as a common interface. -*/ -export abstract class ScrollController { - abstract getScrollTop(): number - abstract getScrollLeft(): number - abstract setScrollTop(top: number): void - abstract setScrollLeft(left: number): void - abstract getClientWidth(): number - abstract getClientHeight(): number - abstract getScrollWidth(): number - abstract getScrollHeight(): number - - getMaxScrollTop() { - return this.getScrollHeight() - this.getClientHeight() - } - - getMaxScrollLeft() { - return this.getScrollWidth() - this.getClientWidth() - } - - canScrollVertically() { - return this.getMaxScrollTop() > 0 - } - - canScrollHorizontally() { - return this.getMaxScrollLeft() > 0 - } - - canScrollUp() { - return this.getScrollTop() > 0 - } - - canScrollDown() { - return this.getScrollTop() < this.getMaxScrollTop() - } - - canScrollLeft() { - return this.getScrollLeft() > 0 - } - - canScrollRight() { - return this.getScrollLeft() < this.getMaxScrollLeft() - } -} - -export class ElementScrollController extends ScrollController { - el: HTMLElement - - constructor(el: HTMLElement) { - super() - this.el = el - } - - getScrollTop() { - return this.el.scrollTop - } - - getScrollLeft() { - return this.el.scrollLeft - } - - setScrollTop(top: number) { - this.el.scrollTop = top - } - - setScrollLeft(left: number) { - this.el.scrollLeft = left - } - - getScrollWidth() { - return this.el.scrollWidth - } - - getScrollHeight() { - return this.el.scrollHeight - } - - getClientHeight() { - return this.el.clientHeight - } - - getClientWidth() { - return this.el.clientWidth - } -} - -export class WindowScrollController extends ScrollController { - getScrollTop() { - return window.pageYOffset - } - - getScrollLeft() { - return window.pageXOffset - } - - setScrollTop(n: number) { - window.scroll(window.pageXOffset, n) - } - - setScrollLeft(n: number) { - window.scroll(n, window.pageYOffset) - } - - getScrollWidth() { - return document.documentElement.scrollWidth - } - - getScrollHeight() { - return document.documentElement.scrollHeight - } - - getClientHeight() { - return document.documentElement.clientHeight - } - - getClientWidth() { - return document.documentElement.clientWidth - } -} diff --git a/fullcalendar-main/packages/core/src/common/slicing-utils.ts b/fullcalendar-main/packages/core/src/common/slicing-utils.ts deleted file mode 100644 index 02158cb..0000000 --- a/fullcalendar-main/packages/core/src/common/slicing-utils.ts +++ /dev/null @@ -1,247 +0,0 @@ -import { DateRange, intersectRanges } from '../datelib/date-range.js' -import { EventStore } from '../structs/event-store.js' -import { EventUiHash } from '../component/event-ui.js' -import { sliceEventStore, EventRenderRange } from '../component/event-rendering.js' -import { DateProfile } from '../DateProfileGenerator.js' -import { Seg, EventSegUiInteractionState } from '../component/DateComponent.js' // TODO: rename EventSegUiInteractionState, move here -import { DateSpan, fabricateEventRange } from '../structs/date-span.js' -import { EventInteractionState } from '../interactions/event-interaction-state.js' -import { Duration } from '../datelib/duration.js' -import { memoize } from '../util/memoize.js' -import { DateMarker, addMs, addDays } from '../datelib/marker.js' -import { CalendarContext } from '../CalendarContext.js' -import { expandRecurring } from '../structs/recurring-event.js' - -export interface SliceableProps { - dateSelection: DateSpan - businessHours: EventStore - eventStore: EventStore - eventDrag: EventInteractionState | null - eventResize: EventInteractionState | null - eventSelection: string - eventUiBases: EventUiHash -} - -export interface SlicedProps { - dateSelectionSegs: SegType[] - businessHourSegs: SegType[] - fgEventSegs: SegType[] - bgEventSegs: SegType[] - eventDrag: EventSegUiInteractionState | null - eventResize: EventSegUiInteractionState | null - eventSelection: string -} - -export abstract class Slicer { - private sliceBusinessHours = memoize(this._sliceBusinessHours) - private sliceDateSelection = memoize(this._sliceDateSpan) - private sliceEventStore = memoize(this._sliceEventStore) - private sliceEventDrag = memoize(this._sliceInteraction) - private sliceEventResize = memoize(this._sliceInteraction) - - abstract sliceRange(dateRange: DateRange, ...extraArgs: ExtraArgs): SegType[] - protected forceDayIfListItem = false // hack - - sliceProps( - props: SliceableProps, - dateProfile: DateProfile, - nextDayThreshold: Duration | null, - context: CalendarContext, - ...extraArgs: ExtraArgs - ): SlicedProps { - let { eventUiBases } = props - let eventSegs = this.sliceEventStore(props.eventStore, eventUiBases, dateProfile, nextDayThreshold, ...extraArgs) - - return { - dateSelectionSegs: this.sliceDateSelection(props.dateSelection, dateProfile, nextDayThreshold, eventUiBases, context, ...extraArgs), - businessHourSegs: this.sliceBusinessHours(props.businessHours, dateProfile, nextDayThreshold, context, ...extraArgs), - fgEventSegs: eventSegs.fg, - bgEventSegs: eventSegs.bg, - eventDrag: this.sliceEventDrag(props.eventDrag, eventUiBases, dateProfile, nextDayThreshold, ...extraArgs), - eventResize: this.sliceEventResize(props.eventResize, eventUiBases, dateProfile, nextDayThreshold, ...extraArgs), - eventSelection: props.eventSelection, - } // TODO: give interactionSegs? - } - - sliceNowDate( // does not memoize - date: DateMarker, - dateProfile: DateProfile, - nextDayThreshold: Duration | null, - context: CalendarContext, - ...extraArgs: ExtraArgs - ): SegType[] { - return this._sliceDateSpan( - { range: { start: date, end: addMs(date, 1) }, allDay: false }, // add 1 ms, protect against null range - dateProfile, - nextDayThreshold, - {}, - context, - ...extraArgs, - ) - } - - private _sliceBusinessHours( - businessHours: EventStore, - dateProfile: DateProfile, - nextDayThreshold: Duration | null, - context: CalendarContext, - ...extraArgs: ExtraArgs - ): SegType[] { - if (!businessHours) { - return [] - } - - return this._sliceEventStore( - expandRecurring( - businessHours, - computeActiveRange(dateProfile, Boolean(nextDayThreshold)), - context, - ), - {}, - dateProfile, - nextDayThreshold, - ...extraArgs, - ).bg - } - - private _sliceEventStore( - eventStore: EventStore, - eventUiBases: EventUiHash, - dateProfile: DateProfile, - nextDayThreshold: Duration | null, - ...extraArgs: ExtraArgs - ): { bg: SegType[], fg: SegType[] } { - if (eventStore) { - let rangeRes = sliceEventStore( - eventStore, - eventUiBases, - computeActiveRange(dateProfile, Boolean(nextDayThreshold)), - nextDayThreshold, - ) - - return { - bg: this.sliceEventRanges(rangeRes.bg, extraArgs), - fg: this.sliceEventRanges(rangeRes.fg, extraArgs), - } - } - return { bg: [], fg: [] } - } - - private _sliceInteraction( - interaction: EventInteractionState, - eventUiBases: EventUiHash, - dateProfile: DateProfile, - nextDayThreshold: Duration | null, - ...extraArgs: ExtraArgs - ): EventSegUiInteractionState { - if (!interaction) { - return null - } - - let rangeRes = sliceEventStore( - interaction.mutatedEvents, - eventUiBases, - computeActiveRange(dateProfile, Boolean(nextDayThreshold)), - nextDayThreshold, - ) - - return { - segs: this.sliceEventRanges(rangeRes.fg, extraArgs), - affectedInstances: interaction.affectedEvents.instances, - isEvent: interaction.isEvent, - } - } - - private _sliceDateSpan( - dateSpan: DateSpan, - dateProfile: DateProfile, - nextDayThreshold: Duration | null, - eventUiBases: EventUiHash, - context: CalendarContext, - ...extraArgs: ExtraArgs - ): SegType[] { - if (!dateSpan) { - return [] - } - - let activeRange = computeActiveRange(dateProfile, Boolean(nextDayThreshold)) - let activeDateSpanRange = intersectRanges(dateSpan.range, activeRange) - - if (activeDateSpanRange) { - dateSpan = { ...dateSpan, range: activeDateSpanRange } - - let eventRange = fabricateEventRange(dateSpan, eventUiBases, context) - let segs = this.sliceRange(dateSpan.range, ...extraArgs) - - for (let seg of segs) { - seg.eventRange = eventRange - } - - return segs - } - - return [] - } - - /* - "complete" seg means it has component and eventRange - */ - private sliceEventRanges( - eventRanges: EventRenderRange[], - extraArgs: ExtraArgs, - ): SegType[] { - let segs: SegType[] = [] - - for (let eventRange of eventRanges) { - segs.push(...this.sliceEventRange(eventRange, extraArgs)) - } - - return segs - } - - /* - "complete" seg means it has component and eventRange - */ - private sliceEventRange( - eventRange: EventRenderRange, - extraArgs: ExtraArgs, - ): SegType[] { - let dateRange = eventRange.range - - // hack to make multi-day events that are being force-displayed as list-items to take up only one day - if (this.forceDayIfListItem && eventRange.ui.display === 'list-item') { - dateRange = { - start: dateRange.start, - end: addDays(dateRange.start, 1), - } - } - - let segs = this.sliceRange(dateRange, ...extraArgs) - - for (let seg of segs) { - seg.eventRange = eventRange - seg.isStart = eventRange.isStart && seg.isStart - seg.isEnd = eventRange.isEnd && seg.isEnd - } - - return segs - } -} - -/* -for incorporating slotMinTime/slotMaxTime if appropriate -TODO: should be part of DateProfile! -TimelineDateProfile already does this btw -*/ -function computeActiveRange(dateProfile: DateProfile, isComponentAllDay: boolean): DateRange { - let range = dateProfile.activeRange - - if (isComponentAllDay) { - return range - } - - return { - start: addMs(range.start, dateProfile.slotMinTime.milliseconds), - end: addMs(range.end, dateProfile.slotMaxTime.milliseconds - 864e5), // 864e5 = ms in a day - } -} diff --git a/fullcalendar-main/packages/core/src/common/table-cell-util.tsx b/fullcalendar-main/packages/core/src/common/table-cell-util.tsx deleted file mode 100644 index f448582..0000000 --- a/fullcalendar-main/packages/core/src/common/table-cell-util.tsx +++ /dev/null @@ -1,8 +0,0 @@ -import { ComponentChild } from '../preact.js' -import { DayHeaderContentArg } from '../render-hook-misc.js' - -export const CLASS_NAME = 'fc-col-header-cell' // do the cushion too? no - -export function renderInner(renderProps: DayHeaderContentArg): ComponentChild { - return renderProps.text -} diff --git a/fullcalendar-main/packages/core/src/common/table-utils.ts b/fullcalendar-main/packages/core/src/common/table-utils.ts deleted file mode 100644 index 90389dd..0000000 --- a/fullcalendar-main/packages/core/src/common/table-utils.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { createFormatter } from '../datelib/formatting.js' -import { DateFormatter } from '../datelib/DateFormatter.js' - -// Computes a default column header formatting string if `colFormat` is not explicitly defined -export function computeFallbackHeaderFormat(datesRepDistinctDays: boolean, dayCnt: number): DateFormatter { - // if more than one week row, or if there are a lot of columns with not much space, - // put just the day numbers will be in each cell - if (!datesRepDistinctDays || dayCnt > 10) { - return createFormatter({ weekday: 'short' }) // "Sat" - } - - if (dayCnt > 1) { - return createFormatter({ weekday: 'short', month: 'numeric', day: 'numeric', omitCommas: true }) // "Sat 11/12" - } - - return createFormatter({ weekday: 'long' }) // "Saturday" -} diff --git a/fullcalendar-main/packages/core/src/component/CalendarDataProvider.ts b/fullcalendar-main/packages/core/src/component/CalendarDataProvider.ts deleted file mode 100644 index 567573e..0000000 --- a/fullcalendar-main/packages/core/src/component/CalendarDataProvider.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { Component, ComponentChildren } from '../preact.js' -import { CalendarDataManager } from '../reducers/CalendarDataManager.js' -import { CalendarImpl } from '../api/CalendarImpl.js' -import { CalendarData } from '../reducers/data-types.js' - -export interface CalendarDataProviderProps { - optionOverrides: any - calendarApi: CalendarImpl - children?: (data: CalendarData) => ComponentChildren -} - -// TODO: move this to react plugin? -export class CalendarDataProvider extends Component { - dataManager: CalendarDataManager - - constructor(props: CalendarDataProviderProps) { - super(props) - - this.dataManager = new CalendarDataManager({ - optionOverrides: props.optionOverrides, - calendarApi: props.calendarApi, - onData: this.handleData, - }) - } - - handleData = (data: CalendarData) => { - if (!this.dataManager) { // still within initial run, before assignment in constructor - // eslint-disable-next-line react/no-direct-mutation-state - this.state = data // can't use setState yet - } else { - this.setState(data) - } - } - - render() { - return this.props.children(this.state) - } - - componentDidUpdate(prevProps: CalendarDataProviderProps) { - let newOptionOverrides = this.props.optionOverrides - - if (newOptionOverrides !== prevProps.optionOverrides) { // prevent recursive handleData - this.dataManager.resetOptions(newOptionOverrides) - } - } -} diff --git a/fullcalendar-main/packages/core/src/component/DateComponent.ts b/fullcalendar-main/packages/core/src/component/DateComponent.ts deleted file mode 100644 index 508a8b5..0000000 --- a/fullcalendar-main/packages/core/src/component/DateComponent.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { BaseComponent } from '../vdom-util.js' -import { EventRenderRange } from './event-rendering.js' -import { EventInstanceHash } from '../structs/event-instance.js' -import { Hit } from '../interactions/hit.js' -import { elementClosest } from '../util/dom-manip.js' -import { guid } from '../util/misc.js' -import { Dictionary } from '../options.js' - -export type DateComponentHash = { [uid: string]: DateComponent } - -// NOTE: for fg-events, eventRange.range is NOT sliced, -// thus, we need isStart/isEnd -export interface Seg { - component?: DateComponent - isStart: boolean - isEnd: boolean - eventRange?: EventRenderRange - [otherProp: string]: any // TODO: remove this. extending Seg will handle this - el?: never - // NOTE: can sometimes have start/end, which are important values :( -} - -export interface EventSegUiInteractionState { - affectedInstances: EventInstanceHash - segs: Seg[] - isEvent: boolean -} - -/* -an INTERACTABLE date component - -PURPOSES: -- hook up to fg, fill, and mirror renderers -- interface for dragging and hits -*/ -export abstract class DateComponent extends BaseComponent { - uid = guid() - - // Hit System - // ----------------------------------------------------------------------------------------------------------------- - - prepareHits() { - } - - queryHit(positionLeft: number, positionTop: number, elWidth: number, elHeight: number): Hit | null { - return null // this should be abstract - } - - // Pointer Interaction Utils - // ----------------------------------------------------------------------------------------------------------------- - - isValidSegDownEl(el: HTMLElement) { - return !(this.props as any).eventDrag && // HACK - !(this.props as any).eventResize && // HACK - !elementClosest(el, '.fc-event-mirror') - } - - isValidDateDownEl(el: HTMLElement) { - return !elementClosest(el, '.fc-event:not(.fc-bg-event)') && - !elementClosest(el, '.fc-more-link') && // a "more.." link - !elementClosest(el, 'a[data-navlink]') && // a clickable nav link - !elementClosest(el, '.fc-popover') // hack - } -} diff --git a/fullcalendar-main/packages/core/src/component/date-rendering.ts b/fullcalendar-main/packages/core/src/component/date-rendering.ts deleted file mode 100644 index 7cf0fdf..0000000 --- a/fullcalendar-main/packages/core/src/component/date-rendering.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { DateMarker, DAY_IDS } from '../datelib/marker.js' -import { rangeContainsMarker, DateRange } from '../datelib/date-range.js' -import { DateProfile } from '../DateProfileGenerator.js' -import { Theme } from '../theme/Theme.js' - -export interface DateMeta { - dow: number - isDisabled: boolean - isOther: boolean // like, is it in the non-current "other" month - isToday: boolean - isPast: boolean - isFuture: boolean -} - -export function getDateMeta(date: DateMarker, todayRange?: DateRange, nowDate?: DateMarker, dateProfile?: DateProfile): DateMeta { - return { - dow: date.getUTCDay(), - isDisabled: Boolean(dateProfile && !rangeContainsMarker(dateProfile.activeRange, date)), - isOther: Boolean(dateProfile && !rangeContainsMarker(dateProfile.currentRange, date)), - isToday: Boolean(todayRange && rangeContainsMarker(todayRange, date)), - isPast: Boolean(nowDate ? (date < nowDate) : todayRange ? (date < todayRange.start) : false), - isFuture: Boolean(nowDate ? (date > nowDate) : todayRange ? (date >= todayRange.end) : false), - } -} - -export function getDayClassNames(meta: DateMeta, theme: Theme) { - let classNames: string[] = [ - 'fc-day', - `fc-day-${DAY_IDS[meta.dow]}`, - ] - - if (meta.isDisabled) { - classNames.push('fc-day-disabled') - } else { - if (meta.isToday) { - classNames.push('fc-day-today') - classNames.push(theme.getClass('today')) - } - - if (meta.isPast) { - classNames.push('fc-day-past') - } - - if (meta.isFuture) { - classNames.push('fc-day-future') - } - - if (meta.isOther) { - classNames.push('fc-day-other') - } - } - - return classNames -} - -export function getSlotClassNames(meta: DateMeta, theme: Theme) { - let classNames: string[] = [ - 'fc-slot', - `fc-slot-${DAY_IDS[meta.dow]}`, - ] - - if (meta.isDisabled) { - classNames.push('fc-slot-disabled') - } else { - if (meta.isToday) { - classNames.push('fc-slot-today') - classNames.push(theme.getClass('today')) - } - - if (meta.isPast) { - classNames.push('fc-slot-past') - } - - if (meta.isFuture) { - classNames.push('fc-slot-future') - } - } - - return classNames -} diff --git a/fullcalendar-main/packages/core/src/component/event-rendering.ts b/fullcalendar-main/packages/core/src/component/event-rendering.ts deleted file mode 100644 index 9ac0dc9..0000000 --- a/fullcalendar-main/packages/core/src/component/event-rendering.ts +++ /dev/null @@ -1,375 +0,0 @@ -import { EventDef, EventDefHash } from '../structs/event-def.js' -import { EventTuple } from '../structs/event-parse.js' -import { EventStore } from '../structs/event-store.js' -import { DateRange, invertRanges, intersectRanges, rangeContainsMarker } from '../datelib/date-range.js' -import { Duration } from '../datelib/duration.js' -import { compareByFieldSpecs, OrderSpec } from '../util/misc.js' -import { computeVisibleDayRange } from '../util/date.js' -import { Seg } from './DateComponent.js' -import { EventImpl } from '../api/EventImpl.js' -import { EventUi, EventUiHash, combineEventUis } from './event-ui.js' -import { mapHash } from '../util/object.js' -import { ViewContext } from '../ViewContext.js' -import { DateFormatter } from '../datelib/DateFormatter.js' -import { addMs, DateMarker, startOfDay } from '../datelib/marker.js' -import { ViewApi } from '../api/ViewApi.js' -import { MountArg } from '../common/render-hook.js' -import { createAriaKeyboardAttrs } from '../util/dom-event.js' - -export interface EventRenderRange extends EventTuple { - ui: EventUi - range: DateRange - isStart: boolean - isEnd: boolean -} - -/* -Specifying nextDayThreshold signals that all-day ranges should be sliced. -*/ -export function sliceEventStore(eventStore: EventStore, eventUiBases: EventUiHash, framingRange: DateRange, nextDayThreshold?: Duration) { - let inverseBgByGroupId: { [groupId: string]: DateRange[] } = {} - let inverseBgByDefId: { [defId: string]: DateRange[] } = {} - let defByGroupId: { [groupId: string]: EventDef } = {} - let bgRanges: EventRenderRange[] = [] - let fgRanges: EventRenderRange[] = [] - let eventUis = compileEventUis(eventStore.defs, eventUiBases) - - for (let defId in eventStore.defs) { - let def = eventStore.defs[defId] - let ui = eventUis[def.defId] - - if (ui.display === 'inverse-background') { - if (def.groupId) { - inverseBgByGroupId[def.groupId] = [] - - if (!defByGroupId[def.groupId]) { - defByGroupId[def.groupId] = def - } - } else { - inverseBgByDefId[defId] = [] - } - } - } - - for (let instanceId in eventStore.instances) { - let instance = eventStore.instances[instanceId] - let def = eventStore.defs[instance.defId] - let ui = eventUis[def.defId] - let origRange = instance.range - - let normalRange = (!def.allDay && nextDayThreshold) ? - computeVisibleDayRange(origRange, nextDayThreshold) : - origRange - - let slicedRange = intersectRanges(normalRange, framingRange) - - if (slicedRange) { - if (ui.display === 'inverse-background') { - if (def.groupId) { - inverseBgByGroupId[def.groupId].push(slicedRange) - } else { - inverseBgByDefId[instance.defId].push(slicedRange) - } - } else if (ui.display !== 'none') { - (ui.display === 'background' ? bgRanges : fgRanges).push({ - def, - ui, - instance, - range: slicedRange, - isStart: normalRange.start && normalRange.start.valueOf() === slicedRange.start.valueOf(), - isEnd: normalRange.end && normalRange.end.valueOf() === slicedRange.end.valueOf(), - }) - } - } - } - - for (let groupId in inverseBgByGroupId) { // BY GROUP - let ranges = inverseBgByGroupId[groupId] - let invertedRanges = invertRanges(ranges, framingRange) - - for (let invertedRange of invertedRanges) { - let def = defByGroupId[groupId] - let ui = eventUis[def.defId] - - bgRanges.push({ - def, - ui, - instance: null, - range: invertedRange, - isStart: false, - isEnd: false, - }) - } - } - - for (let defId in inverseBgByDefId) { - let ranges = inverseBgByDefId[defId] - let invertedRanges = invertRanges(ranges, framingRange) - - for (let invertedRange of invertedRanges) { - bgRanges.push({ - def: eventStore.defs[defId], - ui: eventUis[defId], - instance: null, - range: invertedRange, - isStart: false, - isEnd: false, - }) - } - } - - return { bg: bgRanges, fg: fgRanges } -} - -export function hasBgRendering(def: EventDef) { - return def.ui.display === 'background' || def.ui.display === 'inverse-background' -} - -export function setElSeg(el: HTMLElement, seg: Seg) { - (el as any).fcSeg = seg -} - -export function getElSeg(el: HTMLElement): Seg | null { - return (el as any).fcSeg || - (el.parentNode as any).fcSeg || // for the harness - null -} - -// event ui computation - -export function compileEventUis(eventDefs: EventDefHash, eventUiBases: EventUiHash) { - return mapHash(eventDefs, (eventDef: EventDef) => compileEventUi(eventDef, eventUiBases)) -} - -export function compileEventUi(eventDef: EventDef, eventUiBases: EventUiHash) { - let uis = [] - - if (eventUiBases['']) { - uis.push(eventUiBases['']) - } - - if (eventUiBases[eventDef.defId]) { - uis.push(eventUiBases[eventDef.defId]) - } - - uis.push(eventDef.ui) - - return combineEventUis(uis) -} - -export function sortEventSegs(segs, eventOrderSpecs: OrderSpec[]): Seg[] { - let objs = segs.map(buildSegCompareObj) - - objs.sort((obj0, obj1) => compareByFieldSpecs(obj0, obj1, eventOrderSpecs)) - - return objs.map((c) => c._seg) -} - -// returns a object with all primitive props that can be compared -export function buildSegCompareObj(seg: Seg) { - let { eventRange } = seg - let eventDef = eventRange.def - let range = eventRange.instance ? eventRange.instance.range : eventRange.range - let start = range.start ? range.start.valueOf() : 0 // TODO: better support for open-range events - let end = range.end ? range.end.valueOf() : 0 // " - - return { - ...eventDef.extendedProps, - ...eventDef, - id: eventDef.publicId, - start, - end, - duration: end - start, - allDay: Number(eventDef.allDay), - _seg: seg, // for later retrieval - } -} - -// other stuff - -export interface EventContentArg { // for *Content handlers - event: EventImpl - timeText: string - backgroundColor: string // TODO: add other EventUi props? - borderColor: string // - textColor: string // - isDraggable: boolean - isStartResizable: boolean - isEndResizable: boolean - isMirror: boolean - isStart: boolean - isEnd: boolean - isPast: boolean - isFuture: boolean - isToday: boolean - isSelected: boolean - isDragging: boolean - isResizing: boolean - view: ViewApi // specifically for the API -} - -export type EventMountArg = MountArg - -export function computeSegDraggable(seg: Seg, context: ViewContext) { - let { pluginHooks } = context - let transformers = pluginHooks.isDraggableTransformers - let { def, ui } = seg.eventRange - let val = ui.startEditable - - for (let transformer of transformers) { - val = transformer(val, def, ui, context) - } - - return val -} - -export function computeSegStartResizable(seg: Seg, context: ViewContext) { - return seg.isStart && seg.eventRange.ui.durationEditable && context.options.eventResizableFromStart -} - -export function computeSegEndResizable(seg: Seg, context: ViewContext) { - return seg.isEnd && seg.eventRange.ui.durationEditable -} - -export function buildSegTimeText( - seg: Seg, - timeFormat: DateFormatter, - context: ViewContext, - defaultDisplayEventTime?: boolean, // defaults to true - defaultDisplayEventEnd?: boolean, // defaults to true - startOverride?: DateMarker, - endOverride?: DateMarker, -) { - let { dateEnv, options } = context - let { displayEventTime, displayEventEnd } = options - let eventDef = seg.eventRange.def - let eventInstance = seg.eventRange.instance - - if (displayEventTime == null) { displayEventTime = defaultDisplayEventTime !== false } - if (displayEventEnd == null) { displayEventEnd = defaultDisplayEventEnd !== false } - - let wholeEventStart = eventInstance.range.start - let wholeEventEnd = eventInstance.range.end - let segStart = startOverride || seg.start || seg.eventRange.range.start - let segEnd = endOverride || seg.end || seg.eventRange.range.end - let isStartDay = startOfDay(wholeEventStart).valueOf() === startOfDay(segStart).valueOf() - let isEndDay = startOfDay(addMs(wholeEventEnd, -1)).valueOf() === startOfDay(addMs(segEnd, -1)).valueOf() - - if (displayEventTime && !eventDef.allDay && (isStartDay || isEndDay)) { - segStart = isStartDay ? wholeEventStart : segStart - segEnd = isEndDay ? wholeEventEnd : segEnd - - if (displayEventEnd && eventDef.hasEnd) { - return dateEnv.formatRange(segStart, segEnd, timeFormat, { - forcedStartTzo: startOverride ? null : eventInstance.forcedStartTzo, // nooooooooooooo, give tzo if same date - forcedEndTzo: endOverride ? null : eventInstance.forcedEndTzo, - }) - } - return dateEnv.format(segStart, timeFormat, { - forcedTzo: startOverride ? null : eventInstance.forcedStartTzo, // nooooo, same - }) - } - - return '' -} - -export function getSegMeta(seg: Seg, todayRange: DateRange, nowDate?: DateMarker) { // TODO: make arg order consistent with date util - let segRange = seg.eventRange.range - - return { - isPast: segRange.end <= (nowDate || todayRange.start), - isFuture: segRange.start >= (nowDate || todayRange.end), - isToday: todayRange && rangeContainsMarker(todayRange, segRange.start), - } -} - -export function getEventClassNames(props: EventContentArg) { // weird that we use this interface, but convenient - let classNames: string[] = ['fc-event'] - - if (props.isMirror) { - classNames.push('fc-event-mirror') - } - - if (props.isDraggable) { - classNames.push('fc-event-draggable') - } - - if (props.isStartResizable || props.isEndResizable) { - classNames.push('fc-event-resizable') - } - - if (props.isDragging) { - classNames.push('fc-event-dragging') - } - - if (props.isResizing) { - classNames.push('fc-event-resizing') - } - - if (props.isSelected) { - classNames.push('fc-event-selected') - } - - if (props.isStart) { - classNames.push('fc-event-start') - } - - if (props.isEnd) { - classNames.push('fc-event-end') - } - - if (props.isPast) { - classNames.push('fc-event-past') - } - - if (props.isToday) { - classNames.push('fc-event-today') - } - - if (props.isFuture) { - classNames.push('fc-event-future') - } - - return classNames -} - -export function buildEventRangeKey(eventRange: EventRenderRange) { - return eventRange.instance - ? eventRange.instance.instanceId - : `${eventRange.def.defId}:${eventRange.range.start.toISOString()}` - // inverse-background events don't have specific instances. TODO: better solution -} - -export function getSegAnchorAttrs(seg: Seg, context: ViewContext) { - let { def, instance } = seg.eventRange - let { url } = def - - if (url) { - return { href: url } - } - - let { emitter, options } = context - let { eventInteractive } = options - - if (eventInteractive == null) { - eventInteractive = def.interactive - if (eventInteractive == null) { - eventInteractive = Boolean(emitter.hasHandlers('eventClick')) - } - } - - // mock what happens in EventClicking - if (eventInteractive) { - // only attach keyboard-related handlers because click handler is already done in EventClicking - return createAriaKeyboardAttrs((ev: UIEvent) => { - emitter.trigger('eventClick', { - el: ev.target as HTMLElement, - event: new EventImpl(context, def, instance), - jsEvent: ev as MouseEvent, - view: context.viewApi, - }) - }) - } - - return {} -} diff --git a/fullcalendar-main/packages/core/src/component/event-splitting.ts b/fullcalendar-main/packages/core/src/component/event-splitting.ts deleted file mode 100644 index cb17eea..0000000 --- a/fullcalendar-main/packages/core/src/component/event-splitting.ts +++ /dev/null @@ -1,184 +0,0 @@ -import { EventStore, createEmptyEventStore } from '../structs/event-store.js' -import { EventDef } from '../structs/event-def.js' -import { EventInteractionState } from '../interactions/event-interaction-state.js' -import { mapHash } from '../util/object.js' -import { memoize } from '../util/memoize.js' -import { EventUiHash, EventUi, combineEventUis } from './event-ui.js' -import { DateSpan } from '../structs/date-span.js' - -export interface SplittableProps { - businessHours: EventStore | null // is this really allowed to be null? - dateSelection: DateSpan | null - eventStore: EventStore - eventUiBases: EventUiHash - eventSelection: string - eventDrag: EventInteractionState | null - eventResize: EventInteractionState | null -} - -const EMPTY_EVENT_STORE = createEmptyEventStore() // for purecomponents. TODO: keep elsewhere - -export abstract class Splitter { - private getKeysForEventDefs = memoize(this._getKeysForEventDefs) - private splitDateSelection = memoize(this._splitDateSpan) - private splitEventStore = memoize(this._splitEventStore) - private splitIndividualUi = memoize(this._splitIndividualUi) - private splitEventDrag = memoize(this._splitInteraction) - private splitEventResize = memoize(this._splitInteraction) - private eventUiBuilders = {} // TODO: typescript protection - - abstract getKeyInfo(props: PropsType): { [key: string]: { ui?: EventUi, businessHours?: EventStore } } - abstract getKeysForDateSpan(dateSpan: DateSpan): string[] - abstract getKeysForEventDef(eventDef: EventDef): string[] - - splitProps(props: PropsType): { [key: string]: SplittableProps } { - let keyInfos = this.getKeyInfo(props) - let defKeys = this.getKeysForEventDefs(props.eventStore) - let dateSelections = this.splitDateSelection(props.dateSelection) - let individualUi = this.splitIndividualUi(props.eventUiBases, defKeys) // the individual *bases* - let eventStores = this.splitEventStore(props.eventStore, defKeys) - let eventDrags = this.splitEventDrag(props.eventDrag) - let eventResizes = this.splitEventResize(props.eventResize) - let splitProps: { [key: string]: SplittableProps } = {} - - this.eventUiBuilders = mapHash(keyInfos, (info, key) => this.eventUiBuilders[key] || memoize(buildEventUiForKey)) - - for (let key in keyInfos) { - let keyInfo = keyInfos[key] - let eventStore = eventStores[key] || EMPTY_EVENT_STORE - let buildEventUi = this.eventUiBuilders[key] - - splitProps[key] = { - businessHours: keyInfo.businessHours || props.businessHours, - dateSelection: dateSelections[key] || null, - eventStore, - eventUiBases: buildEventUi(props.eventUiBases[''], keyInfo.ui, individualUi[key]), - eventSelection: eventStore.instances[props.eventSelection] ? props.eventSelection : '', - eventDrag: eventDrags[key] || null, - eventResize: eventResizes[key] || null, - } - } - - return splitProps - } - - private _splitDateSpan(dateSpan: DateSpan | null) { - let dateSpans = {} - - if (dateSpan) { - let keys = this.getKeysForDateSpan(dateSpan) - - for (let key of keys) { - dateSpans[key] = dateSpan - } - } - - return dateSpans - } - - private _getKeysForEventDefs(eventStore: EventStore) { - return mapHash(eventStore.defs, (eventDef: EventDef) => this.getKeysForEventDef(eventDef)) - } - - private _splitEventStore(eventStore: EventStore, defKeys): { [key: string]: EventStore } { - let { defs, instances } = eventStore - let splitStores = {} - - for (let defId in defs) { - for (let key of defKeys[defId]) { - if (!splitStores[key]) { - splitStores[key] = createEmptyEventStore() - } - - splitStores[key].defs[defId] = defs[defId] - } - } - - for (let instanceId in instances) { - let instance = instances[instanceId] - - for (let key of defKeys[instance.defId]) { - if (splitStores[key]) { // must have already been created - splitStores[key].instances[instanceId] = instance - } - } - } - - return splitStores - } - - private _splitIndividualUi(eventUiBases: EventUiHash, defKeys): { [key: string]: EventUiHash } { - let splitHashes: { [key: string]: EventUiHash } = {} - - for (let defId in eventUiBases) { - if (defId) { // not the '' key - for (let key of defKeys[defId]) { - if (!splitHashes[key]) { - splitHashes[key] = {} - } - - splitHashes[key][defId] = eventUiBases[defId] - } - } - } - - return splitHashes - } - - private _splitInteraction(interaction: EventInteractionState | null): { [key: string]: EventInteractionState } { - let splitStates: { [key: string]: EventInteractionState } = {} - - if (interaction) { - let affectedStores = this._splitEventStore( - interaction.affectedEvents, - this._getKeysForEventDefs(interaction.affectedEvents), // can't use cached. might be events from other calendar - ) - - // can't rely on defKeys because event data is mutated - let mutatedKeysByDefId = this._getKeysForEventDefs(interaction.mutatedEvents) - let mutatedStores = this._splitEventStore(interaction.mutatedEvents, mutatedKeysByDefId) - - let populate = (key) => { - if (!splitStates[key]) { - splitStates[key] = { - affectedEvents: affectedStores[key] || EMPTY_EVENT_STORE, - mutatedEvents: mutatedStores[key] || EMPTY_EVENT_STORE, - isEvent: interaction.isEvent, - } - } - } - - for (let key in affectedStores) { - populate(key) - } - - for (let key in mutatedStores) { - populate(key) - } - } - - return splitStates - } -} - -function buildEventUiForKey(allUi: EventUi | null, eventUiForKey: EventUi | null, individualUi: EventUiHash | null) { - let baseParts = [] - - if (allUi) { - baseParts.push(allUi) - } - - if (eventUiForKey) { - baseParts.push(eventUiForKey) - } - - let stuff = { - '': combineEventUis(baseParts), - } - - if (individualUi) { - Object.assign(stuff, individualUi) - } - - return stuff -} diff --git a/fullcalendar-main/packages/core/src/component/event-ui.ts b/fullcalendar-main/packages/core/src/component/event-ui.ts deleted file mode 100644 index 0ae99a1..0000000 --- a/fullcalendar-main/packages/core/src/component/event-ui.ts +++ /dev/null @@ -1,98 +0,0 @@ -import { Constraint, AllowFunc, normalizeConstraint } from '../structs/constraint.js' -import { parseClassNames } from '../util/html.js' -import { CalendarContext } from '../CalendarContext.js' -import { RawOptionsFromRefiners, RefinedOptionsFromRefiners, identity, Identity } from '../options.js' - -// TODO: better called "EventSettings" or "EventConfig" -// TODO: move this file into structs -// TODO: separate constraint/overlap/allow, because selection uses only that, not other props - -export const EVENT_UI_REFINERS = { - display: String, - editable: Boolean, - startEditable: Boolean, - durationEditable: Boolean, - constraint: identity as Identity, // Identity, // circular reference. ts dies. event->constraint->event - overlap: identity as Identity, - allow: identity as Identity, - className: parseClassNames, // will both end up as array of strings - classNames: parseClassNames, // " - color: String, - backgroundColor: String, - borderColor: String, - textColor: String, -} - -const EMPTY_EVENT_UI: EventUi = { - display: null, - startEditable: null, - durationEditable: null, - constraints: [], - overlap: null, - allows: [], - backgroundColor: '', - borderColor: '', - textColor: '', - classNames: [], -} - -type BuiltInEventUiRefiners = typeof EVENT_UI_REFINERS - -interface EventUiRefiners extends BuiltInEventUiRefiners { - // to prevent circular reference (and give is the option for ambient modification for later) -} - -export type EventUiInput = RawOptionsFromRefiners> // Required hack -export type EventUiRefined = RefinedOptionsFromRefiners> // Required hack - -export interface EventUi { - display: string | null - startEditable: boolean | null - durationEditable: boolean | null - constraints: Constraint[] - overlap: boolean | null - allows: AllowFunc[] // crappy name to indicate plural - backgroundColor: string - borderColor: string - textColor: string, - classNames: string[] -} - -export type EventUiHash = { [defId: string]: EventUi } - -export function createEventUi(refined: EventUiRefined, context: CalendarContext): EventUi { - let constraint = normalizeConstraint(refined.constraint, context) - - return { - display: refined.display || null, - startEditable: refined.startEditable != null ? refined.startEditable : refined.editable, - durationEditable: refined.durationEditable != null ? refined.durationEditable : refined.editable, - constraints: constraint != null ? [constraint] : [], - overlap: refined.overlap != null ? refined.overlap : null, - allows: refined.allow != null ? [refined.allow] : [], - backgroundColor: refined.backgroundColor || refined.color || '', - borderColor: refined.borderColor || refined.color || '', - textColor: refined.textColor || '', - classNames: (refined.className || []).concat(refined.classNames || []), // join singular and plural - } -} - -// TODO: prevent against problems with <2 args! -export function combineEventUis(uis: EventUi[]): EventUi { - return uis.reduce(combineTwoEventUis, EMPTY_EVENT_UI) -} - -function combineTwoEventUis(item0: EventUi, item1: EventUi): EventUi { // hash1 has higher precedence - return { - display: item1.display != null ? item1.display : item0.display, - startEditable: item1.startEditable != null ? item1.startEditable : item0.startEditable, - durationEditable: item1.durationEditable != null ? item1.durationEditable : item0.durationEditable, - constraints: item0.constraints.concat(item1.constraints), - overlap: typeof item1.overlap === 'boolean' ? item1.overlap : item0.overlap, - allows: item0.allows.concat(item1.allows), - backgroundColor: item1.backgroundColor || item0.backgroundColor, - borderColor: item1.borderColor || item0.borderColor, - textColor: item1.textColor || item0.textColor, - classNames: item0.classNames.concat(item1.classNames), - } -} diff --git a/fullcalendar-main/packages/core/src/content-inject/ContentContainer.ts b/fullcalendar-main/packages/core/src/content-inject/ContentContainer.ts deleted file mode 100644 index ffcb169..0000000 --- a/fullcalendar-main/packages/core/src/content-inject/ContentContainer.ts +++ /dev/null @@ -1,126 +0,0 @@ -import { createElement, Component, FunctionalComponent, ComponentChildren } from '../preact.js' -import { ClassNamesGenerator } from '../common/render-hook.js' -import { - ContentInjector, - ContentGeneratorProps, - ElAttrsProps, - buildElAttrs, - ElProps, - ElAttrs, -} from './ContentInjector.js' -import { RenderId } from './RenderId.js' -import { setRef } from '../vdom-util.js' - -/* -The `children` prop is a function that defines inner wrappers (ex: ResourceCell) -*/ -export type ContentContainerProps = - ElAttrsProps & - ContentGeneratorProps & { - elTag?: string - classNameGenerator: ClassNamesGenerator | undefined - didMount: ((renderProps: RenderProps & { el: HTMLElement }) => void) | undefined - willUnmount: ((renderProps: RenderProps & { el: HTMLElement }) => void) | undefined - children?: InnerContainerFunc - } - -export class ContentContainer extends Component> { - static contextType = RenderId - didMountMisfire?: boolean - context: number - el: HTMLElement - - InnerContent = InnerContentInjector.bind(undefined, this) - - render() { - const { props } = this - const generatedClassNames = generateClassNames(props.classNameGenerator, props.renderProps) - - if (props.children) { - const elAttrs = buildElAttrs(props, generatedClassNames, this.handleEl) - const children = props.children(this.InnerContent, props.renderProps, elAttrs) - - if (props.elTag) { - return createElement(props.elTag, elAttrs, children) - } else { - return children - } - } else { - return createElement(ContentInjector, { - ...props, - elRef: this.handleEl, - elTag: props.elTag || 'div', - elClasses: (props.elClasses || []).concat(generatedClassNames), - renderId: this.context, - }) - } - } - - handleEl = (el: HTMLElement) => { - this.el = el - - if (this.props.elRef) { - setRef(this.props.elRef, el) - - if (el && this.didMountMisfire) { - this.componentDidMount() - } - } - } - - componentDidMount(): void { - if (this.el) { - this.props.didMount?.({ - ...this.props.renderProps, - el: this.el, - }) - } else { - this.didMountMisfire = true - } - } - - componentWillUnmount(): void { - this.props.willUnmount?.({ - ...this.props.renderProps, - el: this.el, - }) - } -} - -// Inner - -export type InnerContainerComponent = FunctionalComponent -export type InnerContainerFunc = ( - InnerContainer: InnerContainerComponent, - renderProps: RenderProps, - elAttrs: ElAttrs, -) => ComponentChildren - -function InnerContentInjector( - containerComponent: ContentContainer, - props: ElProps, -) { - const parentProps = containerComponent.props - - return createElement(ContentInjector, { - renderProps: parentProps.renderProps, - generatorName: parentProps.generatorName, - customGenerator: parentProps.customGenerator, - defaultGenerator: parentProps.defaultGenerator, - renderId: containerComponent.context, - ...props, - }) -} - -// Utils - -function generateClassNames( - classNameGenerator: ClassNamesGenerator | undefined, - renderProps: RenderProps, -): string[] { - const classNames = typeof classNameGenerator === 'function' ? - classNameGenerator(renderProps) : - classNameGenerator || [] - - return typeof classNames === 'string' ? [classNames] : classNames -} diff --git a/fullcalendar-main/packages/core/src/content-inject/ContentInjector.ts b/fullcalendar-main/packages/core/src/content-inject/ContentInjector.ts deleted file mode 100644 index a552119..0000000 --- a/fullcalendar-main/packages/core/src/content-inject/ContentInjector.ts +++ /dev/null @@ -1,209 +0,0 @@ -import { createElement, ComponentChild, JSX, Ref, isValidElement } from '../preact.js' -import { CustomContentGenerator } from '../common/render-hook.js' -import { BaseComponent, setRef } from '../vdom-util.js' -import { guid } from '../util/misc.js' -import { isArraysEqual } from '../util/array.js' -import { removeElement } from '../util/dom-manip.js' -import { ViewOptions } from '../options.js' -import { isNonHandlerPropsEqual, isPropsEqual } from '../util/object.js' - -export type ElRef = Ref -export type ElAttrs = JSX.HTMLAttributes & JSX.SVGAttributes & { ref?: ElRef } & Record - -export interface ElAttrsProps { - elRef?: ElRef - elClasses?: string[] - elStyle?: JSX.CSSProperties - elAttrs?: ElAttrs -} - -export interface ElProps extends ElAttrsProps { - elTag: string -} - -export interface ContentGeneratorProps { - renderProps: RenderProps - generatorName: string | undefined // for informing UI-framework if `customGenerator` is undefined - customGenerator?: CustomContentGenerator - defaultGenerator?: (renderProps: RenderProps) => ComponentChild -} - -export type ContentInjectorProps = - ElProps & - ContentGeneratorProps & - { renderId: number } - -export class ContentInjector extends BaseComponent> { - private id = guid() - private queuedDomNodes: Node[] = [] - private currentDomNodes: Node[] = [] - private currentGeneratorMeta: any - - render() { - const { props, context } = this - const { options } = context - const { customGenerator, defaultGenerator, renderProps } = props - const attrs = buildElAttrs(props, [], this.handleEl) - let useDefault = false - let innerContent: ComponentChild | undefined - let queuedDomNodes: Node[] = [] - let currentGeneratorMeta: any - - if (customGenerator != null) { - const customGeneratorRes = typeof customGenerator === 'function' ? - customGenerator(renderProps, createElement) : - customGenerator - - if (customGeneratorRes === true) { - useDefault = true - } else { - const isObject = customGeneratorRes && typeof customGeneratorRes === 'object' // non-null - - if (isObject && ('html' in customGeneratorRes)) { - attrs.dangerouslySetInnerHTML = { __html: customGeneratorRes.html } - } else if (isObject && ('domNodes' in customGeneratorRes)) { - queuedDomNodes = Array.prototype.slice.call(customGeneratorRes.domNodes) - } else if ( - isObject - ? isValidElement(customGeneratorRes) // vdom node - : typeof customGeneratorRes !== 'function' // primitive value (like string or number) - ) { - // use in vdom - innerContent = customGeneratorRes - } else { - // an exotic object for handleCustomRendering - currentGeneratorMeta = customGeneratorRes - } - } - } else { - useDefault = !hasCustomRenderingHandler(props.generatorName, options) - } - - if (useDefault && defaultGenerator) { - innerContent = defaultGenerator(renderProps) - } - - this.queuedDomNodes = queuedDomNodes - this.currentGeneratorMeta = currentGeneratorMeta - - return createElement(props.elTag, attrs, innerContent) - } - - componentDidMount(): void { - this.applyQueueudDomNodes() - this.triggerCustomRendering(true) - } - - componentDidUpdate(): void { - this.applyQueueudDomNodes() - this.triggerCustomRendering(true) - } - - componentWillUnmount(): void { - this.triggerCustomRendering(false) // TODO: different API for removal? - } - - private triggerCustomRendering(isActive: boolean) { - const { props, context } = this - const { handleCustomRendering, customRenderingMetaMap } = context.options - - if (handleCustomRendering) { - const generatorMeta = - this.currentGeneratorMeta ?? - customRenderingMetaMap?.[props.generatorName] - - if (generatorMeta) { - handleCustomRendering({ - id: this.id, - isActive, - containerEl: this.base as HTMLElement, - reportNewContainerEl: this.updateElRef, // front-end framework tells us about new container els - generatorMeta, - ...props, - elClasses: (props.elClasses || []).filter(isTruthy), - }) - } - } - } - - private handleEl = (el: HTMLElement | null) => { - const { options } = this.context - const { generatorName } = this.props - - if (!options.customRenderingReplaces || !hasCustomRenderingHandler(generatorName, options)) { - this.updateElRef(el) - } - } - - private updateElRef = (el: HTMLElement | null) => { - if (this.props.elRef) { - setRef(this.props.elRef, el) - } - } - - private applyQueueudDomNodes() { - const { queuedDomNodes, currentDomNodes } = this - const el = this.base - - if (!isArraysEqual(queuedDomNodes, currentDomNodes)) { - currentDomNodes.forEach(removeElement) - - for (let newNode of queuedDomNodes) { - el.appendChild(newNode) - } - - this.currentDomNodes = queuedDomNodes - } - } -} - -ContentInjector.addPropsEquality({ - elClasses: isArraysEqual, - elStyle: isPropsEqual, - elAttrs: isNonHandlerPropsEqual, - renderProps: isPropsEqual, -}) - -// Util - -/* -Does UI-framework provide custom way of rendering that does not use Preact VDOM -AND does the calendar's options define custom rendering? -AKA. Should we NOT render the default content? -*/ -export function hasCustomRenderingHandler( - generatorName: string | undefined, - options: ViewOptions, -): boolean { - return Boolean( - options.handleCustomRendering && - generatorName && - options.customRenderingMetaMap?.[generatorName], - ) -} - -export function buildElAttrs( - props: ElAttrsProps, - extraClassNames?: string[], - elRef?: ElRef, -): ElAttrs { - const attrs: ElAttrs = { ...props.elAttrs, ref: elRef as any } - - if (props.elClasses || extraClassNames) { - attrs.className = (props.elClasses || []) - .concat(extraClassNames || []) - .concat((attrs.className as (string | undefined)) || []) - .filter(Boolean) - .join(' ') - } - - if (props.elStyle) { - attrs.style = props.elStyle - } - - return attrs -} - -function isTruthy(val: any): boolean { - return Boolean(val) -} diff --git a/fullcalendar-main/packages/core/src/content-inject/CustomRenderingStore.ts b/fullcalendar-main/packages/core/src/content-inject/CustomRenderingStore.ts deleted file mode 100644 index a55fe3a..0000000 --- a/fullcalendar-main/packages/core/src/content-inject/CustomRenderingStore.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { Store } from './Store.js' -import { ElProps } from './ContentInjector.js' - -export type CustomRenderingHandler = (customRender: CustomRendering) => void - -export interface CustomRendering extends ElProps { - id: string // TODO: need this? Map can be responsible for storing key? - isActive: boolean - containerEl: HTMLElement - reportNewContainerEl: (el: HTMLElement | null) => void - generatorName: string - generatorMeta: any // could be as simple as boolean - renderProps: RenderProps -} - -/* -Subscribers will get a LIST of CustomRenderings -*/ -export class CustomRenderingStore extends Store>> { - private map = new Map>() - // for consistent order - - handle(customRendering: CustomRendering): void { - const { map } = this - let updated = false - - if (customRendering.isActive) { - map.set(customRendering.id, customRendering as CustomRendering) - updated = true - } else if (map.has(customRendering.id)) { - map.delete(customRendering.id) - updated = true - } - - if (updated) { - this.set(map) - } - } -} diff --git a/fullcalendar-main/packages/core/src/content-inject/RenderId.ts b/fullcalendar-main/packages/core/src/content-inject/RenderId.ts deleted file mode 100644 index 6bc13a3..0000000 --- a/fullcalendar-main/packages/core/src/content-inject/RenderId.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { createContext } from '../preact.js' - -export const RenderId = createContext(0) diff --git a/fullcalendar-main/packages/core/src/content-inject/Store.ts b/fullcalendar-main/packages/core/src/content-inject/Store.ts deleted file mode 100644 index a234e83..0000000 --- a/fullcalendar-main/packages/core/src/content-inject/Store.ts +++ /dev/null @@ -1,21 +0,0 @@ - -export class Store { - private handlers: ((value: Value) => void)[] = [] - private currentValue: Value | undefined - - set(value: Value): void { - this.currentValue = value - - for (let handler of this.handlers) { - handler(value) - } - } - - subscribe(handler: (value: Value) => void) { - this.handlers.push(handler) - - if (this.currentValue !== undefined) { - handler(this.currentValue) - } - } -} diff --git a/fullcalendar-main/packages/core/src/datelib/DateFormatter.ts b/fullcalendar-main/packages/core/src/datelib/DateFormatter.ts deleted file mode 100644 index ad0698f..0000000 --- a/fullcalendar-main/packages/core/src/datelib/DateFormatter.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { DateMarker } from './marker.js' -import { CalendarSystem } from './calendar-system.js' -import { Locale } from './locale.js' -import { ZonedMarker, ExpandedZonedMarker, expandZonedMarker } from './zoned-marker.js' - -export interface VerboseFormattingArg { - date: ExpandedZonedMarker - start: ExpandedZonedMarker - end?: ExpandedZonedMarker - timeZone: string - localeCodes: string[], - defaultSeparator: string -} - -export function createVerboseFormattingArg( - start: ZonedMarker, - end: ZonedMarker, - context: DateFormattingContext, - betterDefaultSeparator?: string, -): VerboseFormattingArg { - let startInfo = expandZonedMarker(start, context.calendarSystem) - let endInfo = end ? expandZonedMarker(end, context.calendarSystem) : null - - return { - date: startInfo, - start: startInfo, - end: endInfo, - timeZone: context.timeZone, - localeCodes: context.locale.codes, - defaultSeparator: betterDefaultSeparator || context.defaultSeparator, - } -} - -export type CmdFormatterFunc = (cmd: string, arg: VerboseFormattingArg) => string - -export interface DateFormattingContext { - timeZone: string, - locale: Locale, - calendarSystem: CalendarSystem - computeWeekNumber: (d: DateMarker) => number - weekText: string - weekTextLong: string - cmdFormatter?: CmdFormatterFunc - defaultSeparator: string -} - -export interface DateFormatter { - format(date: ZonedMarker, context: DateFormattingContext): string - formatRange(start: ZonedMarker, end: ZonedMarker, context: DateFormattingContext, betterDefaultSeparator?: string): string -} diff --git a/fullcalendar-main/packages/core/src/datelib/calendar-system.ts b/fullcalendar-main/packages/core/src/datelib/calendar-system.ts deleted file mode 100644 index a0351a9..0000000 --- a/fullcalendar-main/packages/core/src/datelib/calendar-system.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { DateMarker, arrayToUtcDate, dateToUtcArray } from './marker.js' - -export interface CalendarSystem { - getMarkerYear(d: DateMarker): number - getMarkerMonth(d: DateMarker): number - getMarkerDay(d: DateMarker): number - arrayToMarker(arr: number[]): DateMarker - markerToArray(d: DateMarker): number[] -} - -let calendarSystemClassMap = {} - -export function registerCalendarSystem(name, theClass) { - calendarSystemClassMap[name] = theClass -} - -export function createCalendarSystem(name) { - return new calendarSystemClassMap[name]() -} - -class GregorianCalendarSystem implements CalendarSystem { - getMarkerYear(d: DateMarker) { - return d.getUTCFullYear() - } - - getMarkerMonth(d: DateMarker) { - return d.getUTCMonth() - } - - getMarkerDay(d: DateMarker) { - return d.getUTCDate() - } - - arrayToMarker(arr) { - return arrayToUtcDate(arr) - } - - markerToArray(marker) { - return dateToUtcArray(marker) - } -} - -registerCalendarSystem('gregory', GregorianCalendarSystem) diff --git a/fullcalendar-main/packages/core/src/datelib/date-range.ts b/fullcalendar-main/packages/core/src/datelib/date-range.ts deleted file mode 100644 index 279c253..0000000 --- a/fullcalendar-main/packages/core/src/datelib/date-range.ts +++ /dev/null @@ -1,137 +0,0 @@ -import { DateMarker } from './marker.js' -import { DateEnv, DateInput } from './env.js' - -export interface DateRangeInput { - start?: DateInput - end?: DateInput -} - -export interface OpenDateRange { - start: DateMarker | null - end: DateMarker | null -} - -export interface DateRange { - start: DateMarker - end: DateMarker -} - -export function parseRange(input: DateRangeInput, dateEnv: DateEnv): OpenDateRange { - let start = null - let end = null - - if (input.start) { - start = dateEnv.createMarker(input.start) - } - - if (input.end) { - end = dateEnv.createMarker(input.end) - } - - if (!start && !end) { - return null - } - - if (start && end && end < start) { - return null - } - - return { start, end } -} - -// SIDE-EFFECT: will mutate ranges. -// Will return a new array result. -export function invertRanges(ranges: DateRange[], constraintRange: DateRange): DateRange[] { - let invertedRanges: DateRange[] = [] - let { start } = constraintRange // the end of the previous range. the start of the new range - let i - let dateRange - - // ranges need to be in order. required for our date-walking algorithm - ranges.sort(compareRanges) - - for (i = 0; i < ranges.length; i += 1) { - dateRange = ranges[i] - - // add the span of time before the event (if there is any) - if (dateRange.start > start) { // compare millisecond time (skip any ambig logic) - invertedRanges.push({ start, end: dateRange.start }) - } - - if (dateRange.end > start) { - start = dateRange.end - } - } - - // add the span of time after the last event (if there is any) - if (start < constraintRange.end) { // compare millisecond time (skip any ambig logic) - invertedRanges.push({ start, end: constraintRange.end }) - } - - return invertedRanges -} - -function compareRanges(range0: DateRange, range1: DateRange) { - return range0.start.valueOf() - range1.start.valueOf() // earlier ranges go first -} - -export function intersectRanges(range0: OpenDateRange, range1: OpenDateRange): OpenDateRange { - let { start, end } = range0 - let newRange = null - - if (range1.start !== null) { - if (start === null) { - start = range1.start - } else { - start = new Date(Math.max(start.valueOf(), range1.start.valueOf())) - } - } - - if (range1.end != null) { - if (end === null) { - end = range1.end - } else { - end = new Date(Math.min(end.valueOf(), range1.end.valueOf())) - } - } - - if (start === null || end === null || start < end) { - newRange = { start, end } - } - - return newRange -} - -export function rangesEqual(range0: OpenDateRange, range1: OpenDateRange): boolean { - return (range0.start === null ? null : range0.start.valueOf()) === (range1.start === null ? null : range1.start.valueOf()) && - (range0.end === null ? null : range0.end.valueOf()) === (range1.end === null ? null : range1.end.valueOf()) -} - -export function rangesIntersect(range0: OpenDateRange, range1: OpenDateRange): boolean { - return (range0.end === null || range1.start === null || range0.end > range1.start) && - (range0.start === null || range1.end === null || range0.start < range1.end) -} - -export function rangeContainsRange(outerRange: OpenDateRange, innerRange: OpenDateRange): boolean { - return (outerRange.start === null || (innerRange.start !== null && innerRange.start >= outerRange.start)) && - (outerRange.end === null || (innerRange.end !== null && innerRange.end <= outerRange.end)) -} - -export function rangeContainsMarker(range: OpenDateRange, date: DateMarker | number): boolean { // date can be a millisecond time - return (range.start === null || date >= range.start) && - (range.end === null || date < range.end) -} - -// If the given date is not within the given range, move it inside. -// (If it's past the end, make it one millisecond before the end). -export function constrainMarkerToRange(date: DateMarker, range: DateRange): DateMarker { - if (range.start != null && date < range.start) { - return range.start - } - - if (range.end != null && date >= range.end) { - return new Date(range.end.valueOf() - 1) - } - - return date -} diff --git a/fullcalendar-main/packages/core/src/datelib/duration.ts b/fullcalendar-main/packages/core/src/datelib/duration.ts deleted file mode 100644 index 8bdaa9a..0000000 --- a/fullcalendar-main/packages/core/src/datelib/duration.ts +++ /dev/null @@ -1,226 +0,0 @@ -import { isInt } from '../util/misc.js' - -export type DurationInput = DurationObjectInput | string | number - -export interface DurationObjectInput { - years?: number - year?: number - months?: number - month?: number - weeks?: number - week?: number - days?: number - day?: number - hours?: number - hour?: number - minutes?: number - minute?: number - seconds?: number - second?: number - milliseconds?: number - millisecond?: number - ms?: number -} - -export interface Duration { - years: number - months: number - days: number - milliseconds: number - specifiedWeeks?: boolean -} - -const INTERNAL_UNITS = ['years', 'months', 'days', 'milliseconds'] -const PARSE_RE = /^(-?)(?:(\d+)\.)?(\d+):(\d\d)(?::(\d\d)(?:\.(\d\d\d))?)?/ - -// Parsing and Creation - -export function createDuration(input: DurationInput, unit?: string): Duration | null { - if (typeof input === 'string') { - return parseString(input) - } - - if (typeof input === 'object' && input) { // non-null object - return parseObject(input) - } - - if (typeof input === 'number') { - return parseObject({ [unit || 'milliseconds']: input }) - } - return null -} - -function parseString(s: string): Duration { - let m = PARSE_RE.exec(s) - if (m) { - let sign = m[1] ? -1 : 1 - return { - years: 0, - months: 0, - days: sign * (m[2] ? parseInt(m[2], 10) : 0), - milliseconds: sign * ( - (m[3] ? parseInt(m[3], 10) : 0) * 60 * 60 * 1000 + // hours - (m[4] ? parseInt(m[4], 10) : 0) * 60 * 1000 + // minutes - (m[5] ? parseInt(m[5], 10) : 0) * 1000 + // seconds - (m[6] ? parseInt(m[6], 10) : 0) // ms - ), - } - } - return null -} - -function parseObject(obj: DurationObjectInput): Duration { - let duration: Duration = { - years: obj.years || obj.year || 0, - months: obj.months || obj.month || 0, - days: obj.days || obj.day || 0, - milliseconds: - (obj.hours || obj.hour || 0) * 60 * 60 * 1000 + // hours - (obj.minutes || obj.minute || 0) * 60 * 1000 + // minutes - (obj.seconds || obj.second || 0) * 1000 + // seconds - (obj.milliseconds || obj.millisecond || obj.ms || 0), // ms - } - - let weeks = obj.weeks || obj.week - if (weeks) { - duration.days += weeks * 7 - duration.specifiedWeeks = true - } - - return duration -} - -// Equality - -export function durationsEqual(d0: Duration, d1: Duration): boolean { - return d0.years === d1.years && - d0.months === d1.months && - d0.days === d1.days && - d0.milliseconds === d1.milliseconds -} - -export function asCleanDays(dur: Duration) { - if (!dur.years && !dur.months && !dur.milliseconds) { - return dur.days - } - return 0 -} - -// Simple Math - -export function addDurations(d0: Duration, d1: Duration) { - return { - years: d0.years + d1.years, - months: d0.months + d1.months, - days: d0.days + d1.days, - milliseconds: d0.milliseconds + d1.milliseconds, - } -} - -export function subtractDurations(d1: Duration, d0: Duration): Duration { - return { - years: d1.years - d0.years, - months: d1.months - d0.months, - days: d1.days - d0.days, - milliseconds: d1.milliseconds - d0.milliseconds, - } -} - -export function multiplyDuration(d: Duration, n: number) { - return { - years: d.years * n, - months: d.months * n, - days: d.days * n, - milliseconds: d.milliseconds * n, - } -} - -// Conversions -// "Rough" because they are based on average-case Gregorian months/years - -export function asRoughYears(dur: Duration) { - return asRoughDays(dur) / 365 -} - -export function asRoughMonths(dur: Duration) { - return asRoughDays(dur) / 30 -} - -export function asRoughDays(dur: Duration) { - return asRoughMs(dur) / 864e5 -} - -export function asRoughHours(dur: Duration) { - return asRoughMs(dur) / (1000 * 60 * 60) -} - -export function asRoughMinutes(dur: Duration) { - return asRoughMs(dur) / (1000 * 60) -} - -export function asRoughSeconds(dur: Duration) { - return asRoughMs(dur) / 1000 -} - -export function asRoughMs(dur: Duration) { - return dur.years * (365 * 864e5) + - dur.months * (30 * 864e5) + - dur.days * 864e5 + - dur.milliseconds -} - -// Advanced Math - -export function wholeDivideDurations(numerator: Duration, denominator: Duration): number { - let res = null - - for (let i = 0; i < INTERNAL_UNITS.length; i += 1) { - let unit = INTERNAL_UNITS[i] - - if (denominator[unit]) { - let localRes = numerator[unit] / denominator[unit] - - if (!isInt(localRes) || (res !== null && res !== localRes)) { - return null - } - - res = localRes - } else if (numerator[unit]) { - // needs to divide by something but can't! - return null - } - } - - return res -} - -export function greatestDurationDenominator(dur: Duration) { - let ms = dur.milliseconds - if (ms) { - if (ms % 1000 !== 0) { - return { unit: 'millisecond', value: ms } - } - if (ms % (1000 * 60) !== 0) { - return { unit: 'second', value: ms / 1000 } - } - if (ms % (1000 * 60 * 60) !== 0) { - return { unit: 'minute', value: ms / (1000 * 60) } - } - if (ms) { - return { unit: 'hour', value: ms / (1000 * 60 * 60) } - } - } - if (dur.days) { - if (dur.specifiedWeeks && dur.days % 7 === 0) { - return { unit: 'week', value: dur.days / 7 } - } - return { unit: 'day', value: dur.days } - } - if (dur.months) { - return { unit: 'month', value: dur.months } - } - if (dur.years) { - return { unit: 'year', value: dur.years } - } - return { unit: 'millisecond', value: 0 } -} diff --git a/fullcalendar-main/packages/core/src/datelib/env.ts b/fullcalendar-main/packages/core/src/datelib/env.ts deleted file mode 100644 index 6fa7c82..0000000 --- a/fullcalendar-main/packages/core/src/datelib/env.ts +++ /dev/null @@ -1,463 +0,0 @@ -import { - DateMarker, addMs, - diffHours, diffMinutes, diffSeconds, diffWholeWeeks, diffWholeDays, - startOfDay, startOfHour, startOfMinute, startOfSecond, - weekOfYear, arrayToUtcDate, dateToUtcArray, dateToLocalArray, arrayToLocalDate, timeAsMs, isValidDate, -} from './marker.js' -import { CalendarSystem, createCalendarSystem } from './calendar-system.js' -import { Locale } from './locale.js' -import { NamedTimeZoneImpl, NamedTimeZoneImplClass } from './timezone.js' -import { Duration, asRoughYears, asRoughMonths, asRoughDays, asRoughMs } from './duration.js' -import { DateFormatter, CmdFormatterFunc } from './DateFormatter.js' -import { buildIsoString } from './formatting-utils.js' -import { parse } from './parsing.js' -import { isInt } from '../util/misc.js' - -export type WeekNumberCalculation = 'local' | 'ISO' | ((m: Date) => number) - -export interface DateEnvSettings { - timeZone: string - namedTimeZoneImpl?: NamedTimeZoneImplClass - calendarSystem: string - locale: Locale - weekNumberCalculation?: WeekNumberCalculation - firstDay?: number, // will override what the locale wants - weekText?: string, - weekTextLong?: string - cmdFormatter?: CmdFormatterFunc - defaultSeparator?: string -} - -export type DateInput = Date | string | number | number[] - -export interface DateMarkerMeta { - marker: DateMarker - isTimeUnspecified: boolean - forcedTzo: number | null -} - -export class DateEnv { - timeZone: string - namedTimeZoneImpl: NamedTimeZoneImpl - canComputeOffset: boolean - - calendarSystem: CalendarSystem - locale: Locale - weekDow: number // which day begins the week - weekDoy: number // which day must be within the year, for computing the first week number - weekNumberFunc: any - weekText: string // DON'T LIKE how options are confused with local - weekTextLong: string - cmdFormatter?: CmdFormatterFunc - defaultSeparator: string - - constructor(settings: DateEnvSettings) { - let timeZone = this.timeZone = settings.timeZone - let isNamedTimeZone = timeZone !== 'local' && timeZone !== 'UTC' - - if (settings.namedTimeZoneImpl && isNamedTimeZone) { - this.namedTimeZoneImpl = new settings.namedTimeZoneImpl(timeZone) - } - - this.canComputeOffset = Boolean(!isNamedTimeZone || this.namedTimeZoneImpl) - - this.calendarSystem = createCalendarSystem(settings.calendarSystem) - this.locale = settings.locale - this.weekDow = settings.locale.week.dow - this.weekDoy = settings.locale.week.doy - - if (settings.weekNumberCalculation === 'ISO') { - this.weekDow = 1 - this.weekDoy = 4 - } - - if (typeof settings.firstDay === 'number') { - this.weekDow = settings.firstDay - } - - if (typeof settings.weekNumberCalculation === 'function') { - this.weekNumberFunc = settings.weekNumberCalculation - } - - this.weekText = settings.weekText != null ? settings.weekText : settings.locale.options.weekText - this.weekTextLong = (settings.weekTextLong != null ? settings.weekTextLong : settings.locale.options.weekTextLong) || this.weekText - - this.cmdFormatter = settings.cmdFormatter - this.defaultSeparator = settings.defaultSeparator - } - - // Creating / Parsing - - createMarker(input: DateInput): DateMarker { - let meta = this.createMarkerMeta(input) - if (meta === null) { - return null - } - return meta.marker - } - - createNowMarker(): DateMarker { - if (this.canComputeOffset) { - return this.timestampToMarker(new Date().valueOf()) - } - // if we can't compute the current date val for a timezone, - // better to give the current local date vals than UTC - return arrayToUtcDate(dateToLocalArray(new Date())) - } - - createMarkerMeta(input: DateInput): DateMarkerMeta { - if (typeof input === 'string') { - return this.parse(input) - } - - let marker = null - - if (typeof input === 'number') { - marker = this.timestampToMarker(input) - } else if (input instanceof Date) { - input = input.valueOf() - - if (!isNaN(input)) { - marker = this.timestampToMarker(input) - } - } else if (Array.isArray(input)) { - marker = arrayToUtcDate(input) - } - - if (marker === null || !isValidDate(marker)) { - return null - } - - return { marker, isTimeUnspecified: false, forcedTzo: null } - } - - parse(s: string) { - let parts = parse(s) - if (parts === null) { - return null - } - - let { marker } = parts - let forcedTzo = null - - if (parts.timeZoneOffset !== null) { - if (this.canComputeOffset) { - marker = this.timestampToMarker(marker.valueOf() - parts.timeZoneOffset * 60 * 1000) - } else { - forcedTzo = parts.timeZoneOffset - } - } - - return { marker, isTimeUnspecified: parts.isTimeUnspecified, forcedTzo } - } - - // Accessors - - getYear(marker: DateMarker): number { - return this.calendarSystem.getMarkerYear(marker) - } - - getMonth(marker: DateMarker): number { - return this.calendarSystem.getMarkerMonth(marker) - } - - getDay(marker: DateMarker): number { - return this.calendarSystem.getMarkerDay(marker) - } - - // Adding / Subtracting - - add(marker: DateMarker, dur: Duration): DateMarker { - let a = this.calendarSystem.markerToArray(marker) - a[0] += dur.years - a[1] += dur.months - a[2] += dur.days - a[6] += dur.milliseconds - return this.calendarSystem.arrayToMarker(a) - } - - subtract(marker: DateMarker, dur: Duration): DateMarker { - let a = this.calendarSystem.markerToArray(marker) - a[0] -= dur.years - a[1] -= dur.months - a[2] -= dur.days - a[6] -= dur.milliseconds - return this.calendarSystem.arrayToMarker(a) - } - - addYears(marker: DateMarker, n: number) { - let a = this.calendarSystem.markerToArray(marker) - a[0] += n - return this.calendarSystem.arrayToMarker(a) - } - - addMonths(marker: DateMarker, n: number) { - let a = this.calendarSystem.markerToArray(marker) - a[1] += n - return this.calendarSystem.arrayToMarker(a) - } - - // Diffing Whole Units - - diffWholeYears(m0: DateMarker, m1: DateMarker): number { - let { calendarSystem } = this - - if ( - timeAsMs(m0) === timeAsMs(m1) && - calendarSystem.getMarkerDay(m0) === calendarSystem.getMarkerDay(m1) && - calendarSystem.getMarkerMonth(m0) === calendarSystem.getMarkerMonth(m1) - ) { - return calendarSystem.getMarkerYear(m1) - calendarSystem.getMarkerYear(m0) - } - return null - } - - diffWholeMonths(m0: DateMarker, m1: DateMarker): number { - let { calendarSystem } = this - - if ( - timeAsMs(m0) === timeAsMs(m1) && - calendarSystem.getMarkerDay(m0) === calendarSystem.getMarkerDay(m1) - ) { - return (calendarSystem.getMarkerMonth(m1) - calendarSystem.getMarkerMonth(m0)) + - (calendarSystem.getMarkerYear(m1) - calendarSystem.getMarkerYear(m0)) * 12 - } - return null - } - - // Range / Duration - - greatestWholeUnit(m0: DateMarker, m1: DateMarker) { - let n = this.diffWholeYears(m0, m1) - - if (n !== null) { - return { unit: 'year', value: n } - } - - n = this.diffWholeMonths(m0, m1) - - if (n !== null) { - return { unit: 'month', value: n } - } - - n = diffWholeWeeks(m0, m1) - - if (n !== null) { - return { unit: 'week', value: n } - } - - n = diffWholeDays(m0, m1) - - if (n !== null) { - return { unit: 'day', value: n } - } - - n = diffHours(m0, m1) - - if (isInt(n)) { - return { unit: 'hour', value: n } - } - - n = diffMinutes(m0, m1) - - if (isInt(n)) { - return { unit: 'minute', value: n } - } - - n = diffSeconds(m0, m1) - - if (isInt(n)) { - return { unit: 'second', value: n } - } - - return { unit: 'millisecond', value: m1.valueOf() - m0.valueOf() } - } - - countDurationsBetween(m0: DateMarker, m1: DateMarker, d: Duration) { - // TODO: can use greatestWholeUnit - let diff - - if (d.years) { - diff = this.diffWholeYears(m0, m1) - if (diff !== null) { - return diff / asRoughYears(d) - } - } - - if (d.months) { - diff = this.diffWholeMonths(m0, m1) - if (diff !== null) { - return diff / asRoughMonths(d) - } - } - - if (d.days) { - diff = diffWholeDays(m0, m1) - if (diff !== null) { - return diff / asRoughDays(d) - } - } - - return (m1.valueOf() - m0.valueOf()) / asRoughMs(d) - } - - // Start-Of - // these DON'T return zoned-dates. only UTC start-of dates - - startOf(m: DateMarker, unit: string) { - if (unit === 'year') { - return this.startOfYear(m) - } - if (unit === 'month') { - return this.startOfMonth(m) - } - if (unit === 'week') { - return this.startOfWeek(m) - } - if (unit === 'day') { - return startOfDay(m) - } - if (unit === 'hour') { - return startOfHour(m) - } - if (unit === 'minute') { - return startOfMinute(m) - } - if (unit === 'second') { - return startOfSecond(m) - } - return null - } - - startOfYear(m: DateMarker): DateMarker { - return this.calendarSystem.arrayToMarker([ - this.calendarSystem.getMarkerYear(m), - ]) - } - - startOfMonth(m: DateMarker): DateMarker { - return this.calendarSystem.arrayToMarker([ - this.calendarSystem.getMarkerYear(m), - this.calendarSystem.getMarkerMonth(m), - ]) - } - - startOfWeek(m: DateMarker): DateMarker { - return this.calendarSystem.arrayToMarker([ - this.calendarSystem.getMarkerYear(m), - this.calendarSystem.getMarkerMonth(m), - m.getUTCDate() - ((m.getUTCDay() - this.weekDow + 7) % 7), - ]) - } - - // Week Number - - computeWeekNumber(marker: DateMarker): number { - if (this.weekNumberFunc) { - return this.weekNumberFunc(this.toDate(marker)) - } - return weekOfYear(marker, this.weekDow, this.weekDoy) - } - - // TODO: choke on timeZoneName: long - format(marker: DateMarker, formatter: DateFormatter, dateOptions: { forcedTzo?: number } = {}) { - return formatter.format( - { - marker, - timeZoneOffset: dateOptions.forcedTzo != null ? - dateOptions.forcedTzo : - this.offsetForMarker(marker), - }, - this, - ) - } - - formatRange( - start: DateMarker, - end: DateMarker, - formatter: DateFormatter, - dateOptions: { forcedStartTzo?: number, forcedEndTzo?: number, isEndExclusive?: boolean, defaultSeparator?: string } = {}, - ) { - if (dateOptions.isEndExclusive) { - end = addMs(end, -1) - } - - return formatter.formatRange( - { - marker: start, - timeZoneOffset: dateOptions.forcedStartTzo != null ? - dateOptions.forcedStartTzo : - this.offsetForMarker(start), - }, - { - marker: end, - timeZoneOffset: dateOptions.forcedEndTzo != null ? - dateOptions.forcedEndTzo : - this.offsetForMarker(end), - }, - this, - dateOptions.defaultSeparator, - ) - } - - /* - DUMB: the omitTime arg is dumb. if we omit the time, we want to omit the timezone offset. and if we do that, - might as well use buildIsoString or some other util directly - */ - formatIso(marker: DateMarker, extraOptions: any = {}) { - let timeZoneOffset = null - - if (!extraOptions.omitTimeZoneOffset) { - if (extraOptions.forcedTzo != null) { - timeZoneOffset = extraOptions.forcedTzo - } else { - timeZoneOffset = this.offsetForMarker(marker) - } - } - - return buildIsoString(marker, timeZoneOffset, extraOptions.omitTime) - } - - // TimeZone - - timestampToMarker(ms: number) { - if (this.timeZone === 'local') { - return arrayToUtcDate(dateToLocalArray(new Date(ms))) - } if (this.timeZone === 'UTC' || !this.namedTimeZoneImpl) { - return new Date(ms) - } - return arrayToUtcDate(this.namedTimeZoneImpl.timestampToArray(ms)) - } - - offsetForMarker(m: DateMarker) { - if (this.timeZone === 'local') { - return -arrayToLocalDate(dateToUtcArray(m)).getTimezoneOffset() // convert "inverse" offset to "normal" offset - } if (this.timeZone === 'UTC') { - return 0 - } if (this.namedTimeZoneImpl) { - return this.namedTimeZoneImpl.offsetForArray(dateToUtcArray(m)) - } - return null - } - - // Conversion - - toDate(m: DateMarker, forcedTzo?: number): Date { - if (this.timeZone === 'local') { - return arrayToLocalDate(dateToUtcArray(m)) - } - - if (this.timeZone === 'UTC') { - return new Date(m.valueOf()) // make sure it's a copy - } - - if (!this.namedTimeZoneImpl) { - return new Date(m.valueOf() - (forcedTzo || 0)) - } - - return new Date( - m.valueOf() - - this.namedTimeZoneImpl.offsetForArray(dateToUtcArray(m)) * 1000 * 60, // convert minutes -> ms - ) - } -} diff --git a/fullcalendar-main/packages/core/src/datelib/formatting-cmd.ts b/fullcalendar-main/packages/core/src/datelib/formatting-cmd.ts deleted file mode 100644 index 3e83ae3..0000000 --- a/fullcalendar-main/packages/core/src/datelib/formatting-cmd.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { DateFormatter, DateFormattingContext, createVerboseFormattingArg } from './DateFormatter.js' -import { ZonedMarker } from './zoned-marker.js' - -/* -TODO: fix the terminology of "formatter" vs "formatting func" -*/ - -/* -At the time of instantiation, this object does not know which cmd-formatting system it will use. -It receives this at the time of formatting, as a setting. -*/ -export class CmdFormatter implements DateFormatter { - cmdStr: string - - constructor(cmdStr: string) { - this.cmdStr = cmdStr - } - - format(date: ZonedMarker, context: DateFormattingContext, betterDefaultSeparator?: string) { - return context.cmdFormatter(this.cmdStr, createVerboseFormattingArg(date, null, context, betterDefaultSeparator)) - } - - formatRange(start: ZonedMarker, end: ZonedMarker, context: DateFormattingContext, betterDefaultSeparator?: string) { - return context.cmdFormatter(this.cmdStr, createVerboseFormattingArg(start, end, context, betterDefaultSeparator)) - } -} diff --git a/fullcalendar-main/packages/core/src/datelib/formatting-func.ts b/fullcalendar-main/packages/core/src/datelib/formatting-func.ts deleted file mode 100644 index 97e8ee5..0000000 --- a/fullcalendar-main/packages/core/src/datelib/formatting-func.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { DateFormatter, DateFormattingContext, createVerboseFormattingArg, VerboseFormattingArg } from './DateFormatter.js' -import { ZonedMarker } from './zoned-marker.js' - -export type FuncFormatterFunc = (arg: VerboseFormattingArg) => string - -export class FuncFormatter implements DateFormatter { - func: FuncFormatterFunc - - constructor(func: FuncFormatterFunc) { - this.func = func - } - - format(date: ZonedMarker, context: DateFormattingContext, betterDefaultSeparator?: string) { - return this.func(createVerboseFormattingArg(date, null, context, betterDefaultSeparator)) - } - - formatRange(start: ZonedMarker, end: ZonedMarker, context: DateFormattingContext, betterDefaultSeparator?: string) { - return this.func(createVerboseFormattingArg(start, end, context, betterDefaultSeparator)) - } -} diff --git a/fullcalendar-main/packages/core/src/datelib/formatting-native.ts b/fullcalendar-main/packages/core/src/datelib/formatting-native.ts deleted file mode 100644 index 3a747f1..0000000 --- a/fullcalendar-main/packages/core/src/datelib/formatting-native.ts +++ /dev/null @@ -1,376 +0,0 @@ -import { DateMarker, timeAsMs } from './marker.js' -import { CalendarSystem } from './calendar-system.js' -import { Locale } from './locale.js' -import { DateFormatter, DateFormattingContext } from './DateFormatter.js' -import { ZonedMarker } from './zoned-marker.js' -import { formatTimeZoneOffset } from './formatting-utils.js' -import { memoize } from '../util/memoize.js' - -const EXTENDED_SETTINGS_AND_SEVERITIES = { - week: 3, - separator: 0, // 0 = not applicable - omitZeroMinute: 0, - meridiem: 0, // like am/pm - omitCommas: 0, -} - -const STANDARD_DATE_PROP_SEVERITIES = { - timeZoneName: 7, - era: 6, - year: 5, - month: 4, - day: 2, - weekday: 2, - hour: 1, - minute: 1, - second: 1, -} - -const MERIDIEM_RE = /\s*([ap])\.?m\.?/i // eats up leading spaces too -const COMMA_RE = /,/g // we need re for globalness -const MULTI_SPACE_RE = /\s+/g -const LTR_RE = /\u200e/g // control character -const UTC_RE = /UTC|GMT/ - -export interface NativeFormatterOptions extends Intl.DateTimeFormatOptions { - week?: 'long' | 'short' | 'narrow' | 'numeric' - meridiem?: 'lowercase' | 'short' | 'narrow' | boolean - omitZeroMinute?: boolean - omitCommas?: boolean - separator?: string -} - -export class NativeFormatter implements DateFormatter { - standardDateProps: any - extendedSettings: any - severity: number - private buildFormattingFunc: typeof buildFormattingFunc // caching for efficiency with same date env - - constructor(formatSettings: NativeFormatterOptions) { - let standardDateProps: any = {} - let extendedSettings: any = {} - let severity = 0 - - for (let name in formatSettings) { - if (name in EXTENDED_SETTINGS_AND_SEVERITIES) { - extendedSettings[name] = formatSettings[name] - severity = Math.max(EXTENDED_SETTINGS_AND_SEVERITIES[name], severity) - } else { - standardDateProps[name] = formatSettings[name] - - if (name in STANDARD_DATE_PROP_SEVERITIES) { // TODO: what about hour12? no severity - severity = Math.max(STANDARD_DATE_PROP_SEVERITIES[name], severity) - } - } - } - - this.standardDateProps = standardDateProps - this.extendedSettings = extendedSettings - this.severity = severity - - this.buildFormattingFunc = memoize(buildFormattingFunc) - } - - format(date: ZonedMarker, context: DateFormattingContext) { - return this.buildFormattingFunc(this.standardDateProps, this.extendedSettings, context)(date) - } - - formatRange(start: ZonedMarker, end: ZonedMarker, context: DateFormattingContext, betterDefaultSeparator?: string) { - let { standardDateProps, extendedSettings } = this - - let diffSeverity = computeMarkerDiffSeverity(start.marker, end.marker, context.calendarSystem) - if (!diffSeverity) { - return this.format(start, context) - } - - let biggestUnitForPartial = diffSeverity - if ( - biggestUnitForPartial > 1 && // the two dates are different in a way that's larger scale than time - (standardDateProps.year === 'numeric' || standardDateProps.year === '2-digit') && - (standardDateProps.month === 'numeric' || standardDateProps.month === '2-digit') && - (standardDateProps.day === 'numeric' || standardDateProps.day === '2-digit') - ) { - biggestUnitForPartial = 1 // make it look like the dates are only different in terms of time - } - - let full0 = this.format(start, context) - let full1 = this.format(end, context) - - if (full0 === full1) { - return full0 - } - - let partialDateProps = computePartialFormattingOptions(standardDateProps, biggestUnitForPartial) - let partialFormattingFunc = buildFormattingFunc(partialDateProps, extendedSettings, context) - let partial0 = partialFormattingFunc(start) - let partial1 = partialFormattingFunc(end) - - let insertion = findCommonInsertion(full0, partial0, full1, partial1) - let separator = extendedSettings.separator || betterDefaultSeparator || context.defaultSeparator || '' - - if (insertion) { - return insertion.before + partial0 + separator + partial1 + insertion.after - } - - return full0 + separator + full1 - } - - getLargestUnit() { - switch (this.severity) { - case 7: - case 6: - case 5: - return 'year' - case 4: - return 'month' - case 3: - return 'week' - case 2: - return 'day' - default: - return 'time' // really? - } - } -} - -function buildFormattingFunc( - standardDateProps, - extendedSettings, - context: DateFormattingContext, -): (date: ZonedMarker) => string { - let standardDatePropCnt = Object.keys(standardDateProps).length - - if (standardDatePropCnt === 1 && standardDateProps.timeZoneName === 'short') { - return (date: ZonedMarker) => ( - formatTimeZoneOffset(date.timeZoneOffset) - ) - } - - if (standardDatePropCnt === 0 && extendedSettings.week) { - return (date: ZonedMarker) => ( - formatWeekNumber( - context.computeWeekNumber(date.marker), - context.weekText, - context.weekTextLong, - context.locale, - extendedSettings.week, - ) - ) - } - - return buildNativeFormattingFunc(standardDateProps, extendedSettings, context) -} - -function buildNativeFormattingFunc( - standardDateProps, - extendedSettings, - context: DateFormattingContext, -): (date: ZonedMarker) => string { - standardDateProps = { ...standardDateProps } // copy - extendedSettings = { ...extendedSettings } // copy - - sanitizeSettings(standardDateProps, extendedSettings) - - standardDateProps.timeZone = 'UTC' // we leverage the only guaranteed timeZone for our UTC markers - - let normalFormat = new Intl.DateTimeFormat(context.locale.codes, standardDateProps) - let zeroFormat // needed? - - if (extendedSettings.omitZeroMinute) { - let zeroProps = { ...standardDateProps } - delete zeroProps.minute // seconds and ms were already considered in sanitizeSettings - zeroFormat = new Intl.DateTimeFormat(context.locale.codes, zeroProps) - } - - return (date: ZonedMarker) => { - let { marker } = date - let format - - if (zeroFormat && !marker.getUTCMinutes()) { - format = zeroFormat - } else { - format = normalFormat - } - - let s = format.format(marker) - - return postProcess(s, date, standardDateProps, extendedSettings, context) - } -} - -function sanitizeSettings(standardDateProps, extendedSettings) { - // deal with a browser inconsistency where formatting the timezone - // requires that the hour/minute be present. - if (standardDateProps.timeZoneName) { - if (!standardDateProps.hour) { - standardDateProps.hour = '2-digit' - } - if (!standardDateProps.minute) { - standardDateProps.minute = '2-digit' - } - } - - // only support short timezone names - if (standardDateProps.timeZoneName === 'long') { - standardDateProps.timeZoneName = 'short' - } - - // if requesting to display seconds, MUST display minutes - if (extendedSettings.omitZeroMinute && (standardDateProps.second || standardDateProps.millisecond)) { - delete extendedSettings.omitZeroMinute - } -} - -function postProcess(s: string, date: ZonedMarker, standardDateProps, extendedSettings, context: DateFormattingContext): string { - s = s.replace(LTR_RE, '') // remove left-to-right control chars. do first. good for other regexes - - if (standardDateProps.timeZoneName === 'short') { - s = injectTzoStr( - s, - (context.timeZone === 'UTC' || date.timeZoneOffset == null) ? - 'UTC' : // important to normalize for IE, which does "GMT" - formatTimeZoneOffset(date.timeZoneOffset), - ) - } - - if (extendedSettings.omitCommas) { - s = s.replace(COMMA_RE, '').trim() - } - - if (extendedSettings.omitZeroMinute) { - s = s.replace(':00', '') // zeroFormat doesn't always achieve this - } - - // ^ do anything that might create adjacent spaces before this point, - // because MERIDIEM_RE likes to eat up loading spaces - - if (extendedSettings.meridiem === false) { - s = s.replace(MERIDIEM_RE, '').trim() - } else if (extendedSettings.meridiem === 'narrow') { // a/p - s = s.replace(MERIDIEM_RE, (m0, m1) => m1.toLocaleLowerCase()) - } else if (extendedSettings.meridiem === 'short') { // am/pm - s = s.replace(MERIDIEM_RE, (m0, m1) => `${m1.toLocaleLowerCase()}m`) - } else if (extendedSettings.meridiem === 'lowercase') { // other meridiem transformers already converted to lowercase - s = s.replace(MERIDIEM_RE, (m0) => m0.toLocaleLowerCase()) - } - - s = s.replace(MULTI_SPACE_RE, ' ') - s = s.trim() - - return s -} - -function injectTzoStr(s: string, tzoStr: string): string { - let replaced = false - - s = s.replace(UTC_RE, () => { - replaced = true - return tzoStr - }) - - // IE11 doesn't include UTC/GMT in the original string, so append to end - if (!replaced) { - s += ` ${tzoStr}` - } - - return s -} - -function formatWeekNumber( - num: number, - weekText: string, - weekTextLong: string, - locale: Locale, - display?: 'numeric' | 'narrow' | 'short' | 'long', -): string { - let parts = [] - - if (display === 'long') { - parts.push(weekTextLong) - } else if (display === 'short' || display === 'narrow') { - parts.push(weekText) - } - - if (display === 'long' || display === 'short') { - parts.push(' ') - } - - parts.push(locale.simpleNumberFormat.format(num)) - - if (locale.options.direction === 'rtl') { // TODO: use control characters instead? - parts.reverse() - } - - return parts.join('') -} - -// Range Formatting Utils - -// 0 = exactly the same -// 1 = different by time -// and bigger -function computeMarkerDiffSeverity(d0: DateMarker, d1: DateMarker, ca: CalendarSystem) { - if (ca.getMarkerYear(d0) !== ca.getMarkerYear(d1)) { - return 5 - } - if (ca.getMarkerMonth(d0) !== ca.getMarkerMonth(d1)) { - return 4 - } - if (ca.getMarkerDay(d0) !== ca.getMarkerDay(d1)) { - return 2 - } - if (timeAsMs(d0) !== timeAsMs(d1)) { - return 1 - } - return 0 -} - -function computePartialFormattingOptions(options, biggestUnit) { - let partialOptions = {} - - for (let name in options) { - if ( - !(name in STANDARD_DATE_PROP_SEVERITIES) || // not a date part prop (like timeZone) - STANDARD_DATE_PROP_SEVERITIES[name] <= biggestUnit - ) { - partialOptions[name] = options[name] - } - } - - return partialOptions -} - -function findCommonInsertion(full0, partial0, full1, partial1) { - let i0 = 0 - while (i0 < full0.length) { - let found0 = full0.indexOf(partial0, i0) - if (found0 === -1) { - break - } - - let before0 = full0.substr(0, found0) - i0 = found0 + partial0.length - let after0 = full0.substr(i0) - - let i1 = 0 - while (i1 < full1.length) { - let found1 = full1.indexOf(partial1, i1) - if (found1 === -1) { - break - } - - let before1 = full1.substr(0, found1) - i1 = found1 + partial1.length - let after1 = full1.substr(i1) - - if (before0 === before1 && after0 === after1) { - return { - before: before0, - after: after0, - } - } - } - } - - return null -} diff --git a/fullcalendar-main/packages/core/src/datelib/formatting-utils.ts b/fullcalendar-main/packages/core/src/datelib/formatting-utils.ts deleted file mode 100644 index 734b969..0000000 --- a/fullcalendar-main/packages/core/src/datelib/formatting-utils.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { DateMarker } from './marker.js' -import { padStart } from '../util/misc.js' - -// timeZoneOffset is in minutes -export function buildIsoString(marker: DateMarker, timeZoneOffset?: number, stripZeroTime: boolean = false) { - let s = marker.toISOString() - - s = s.replace('.000', '') - - if (stripZeroTime) { - s = s.replace('T00:00:00Z', '') - } - - if (s.length > 10) { // time part wasn't stripped, can add timezone info - if (timeZoneOffset == null) { - s = s.replace('Z', '') - } else if (timeZoneOffset !== 0) { - s = s.replace('Z', formatTimeZoneOffset(timeZoneOffset, true)) - } - // otherwise, its UTC-0 and we want to keep the Z - } - - return s -} - -// formats the date, but with no time part -// TODO: somehow merge with buildIsoString and stripZeroTime -// TODO: rename. omit "string" -export function formatDayString(marker: DateMarker) { - return marker.toISOString().replace(/T.*$/, '') -} - -export function formatIsoMonthStr(marker: DateMarker) { - return marker.toISOString().match(/^\d{4}-\d{2}/)[0] -} - -// TODO: use Date::toISOString and use everything after the T? -export function formatIsoTimeString(marker: DateMarker) { - return padStart(marker.getUTCHours(), 2) + ':' + - padStart(marker.getUTCMinutes(), 2) + ':' + - padStart(marker.getUTCSeconds(), 2) -} - -export function formatTimeZoneOffset(minutes: number, doIso = false) { - let sign = minutes < 0 ? '-' : '+' - let abs = Math.abs(minutes) - let hours = Math.floor(abs / 60) - let mins = Math.round(abs % 60) - - if (doIso) { - return `${sign + padStart(hours, 2)}:${padStart(mins, 2)}` - } - return `GMT${sign}${hours}${mins ? `:${padStart(mins, 2)}` : ''}` -} diff --git a/fullcalendar-main/packages/core/src/datelib/formatting.ts b/fullcalendar-main/packages/core/src/datelib/formatting.ts deleted file mode 100644 index 07d5618..0000000 --- a/fullcalendar-main/packages/core/src/datelib/formatting.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { NativeFormatter, NativeFormatterOptions } from './formatting-native.js' -import { CmdFormatter } from './formatting-cmd.js' -import { FuncFormatter, FuncFormatterFunc } from './formatting-func.js' -import { DateFormatter } from './DateFormatter.js' - -export type FormatterInput = NativeFormatterOptions | string | FuncFormatterFunc - -export function createFormatter(input: FormatterInput): DateFormatter { - if (typeof input === 'object' && input) { // non-null object - return new NativeFormatter(input) - } - - if (typeof input === 'string') { - return new CmdFormatter(input) - } - - if (typeof input === 'function') { - return new FuncFormatter(input as FuncFormatterFunc) - } - - return null -} diff --git a/fullcalendar-main/packages/core/src/datelib/locale.ts b/fullcalendar-main/packages/core/src/datelib/locale.ts deleted file mode 100644 index 2e7efc8..0000000 --- a/fullcalendar-main/packages/core/src/datelib/locale.ts +++ /dev/null @@ -1,140 +0,0 @@ -import { mergeProps } from '../util/object.js' -import { globalLocales } from '../global-locales.js' // weird to be importing this -import { CalendarOptions, CalendarOptionsRefined } from '../options.js' - -export type LocaleCodeArg = string | string[] -export type LocaleSingularArg = LocaleCodeArg | LocaleInput - -export interface Locale { - codeArg: LocaleCodeArg - codes: string[] - week: { dow: number, doy: number } - simpleNumberFormat: Intl.NumberFormat - options: CalendarOptionsRefined -} - -export interface LocaleInput extends CalendarOptions { - code: string -} - -export type LocaleInputMap = { [code: string]: LocaleInput } - -export interface RawLocaleInfo { - map: LocaleInputMap - defaultCode: string -} - -const MINIMAL_RAW_EN_LOCALE = { - code: 'en', - week: { - dow: 0, // Sunday is the first day of the week - doy: 4, // 4 days need to be within the year to be considered the first week - }, - direction: 'ltr' as ('ltr' | 'rtl'), // TODO: make a real type for this - buttonText: { - prev: 'prev', - next: 'next', - prevYear: 'prev year', - nextYear: 'next year', - year: 'year', - today: 'today', - month: 'month', - week: 'week', - day: 'day', - list: 'list', - }, - weekText: 'W', - weekTextLong: 'Week', - closeHint: 'Close', - timeHint: 'Time', - eventHint: 'Event', - allDayText: 'all-day', - moreLinkText: 'more', - noEventsText: 'No events to display', -} - -const RAW_EN_LOCALE = { - ...MINIMAL_RAW_EN_LOCALE, - // Includes things we don't want other locales to inherit, - // things that derive from other translatable strings. - buttonHints: { - prev: 'Previous $0', - next: 'Next $0', - today(buttonText, unit) { - return (unit === 'day') - ? 'Today' - : `This ${buttonText}` - }, - }, - viewHint: '$0 view', - navLinkHint: 'Go to $0', - moreLinkHint(eventCnt: number) { - return `Show ${eventCnt} more event${eventCnt === 1 ? '' : 's'}` - }, -} - -export function organizeRawLocales(explicitRawLocales: LocaleInput[]): RawLocaleInfo { - let defaultCode = explicitRawLocales.length > 0 ? explicitRawLocales[0].code : 'en' - let allRawLocales = globalLocales.concat(explicitRawLocales) - let rawLocaleMap: LocaleInputMap = { - en: RAW_EN_LOCALE, - } - - for (let rawLocale of allRawLocales) { - rawLocaleMap[rawLocale.code] = rawLocale - } - - return { - map: rawLocaleMap, - defaultCode, - } -} - -export function buildLocale(inputSingular: LocaleSingularArg, available: LocaleInputMap) { - if (typeof inputSingular === 'object' && !Array.isArray(inputSingular)) { - return parseLocale( - inputSingular.code, - [inputSingular.code], - inputSingular, - ) - } - return queryLocale(inputSingular, available) -} - -function queryLocale(codeArg: LocaleCodeArg, available: LocaleInputMap): Locale { - let codes = [].concat(codeArg || []) // will convert to array - let raw = queryRawLocale(codes, available) || RAW_EN_LOCALE - - return parseLocale(codeArg, codes, raw) -} - -function queryRawLocale(codes: string[], available: LocaleInputMap): LocaleInput { - for (let i = 0; i < codes.length; i += 1) { - let parts = codes[i].toLocaleLowerCase().split('-') - - for (let j = parts.length; j > 0; j -= 1) { - let simpleId = parts.slice(0, j).join('-') - - if (available[simpleId]) { - return available[simpleId] - } - } - } - return null -} - -function parseLocale(codeArg: LocaleCodeArg, codes: string[], raw: LocaleInput): Locale { - let merged = mergeProps([MINIMAL_RAW_EN_LOCALE, raw], ['buttonText']) - - delete merged.code // don't want this part of the options - let { week } = merged - delete merged.week - - return { - codeArg, - codes, - week, - simpleNumberFormat: new Intl.NumberFormat(codeArg), - options: merged, - } -} diff --git a/fullcalendar-main/packages/core/src/datelib/marker.ts b/fullcalendar-main/packages/core/src/datelib/marker.ts deleted file mode 100644 index 257646e..0000000 --- a/fullcalendar-main/packages/core/src/datelib/marker.ts +++ /dev/null @@ -1,216 +0,0 @@ -import { Duration } from './duration.js' - -export type DateMarker = Date - -export const DAY_IDS = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] - -// Adding - -export function addWeeks(m: DateMarker, n: number) { - let a = dateToUtcArray(m) - a[2] += n * 7 - return arrayToUtcDate(a) -} - -export function addDays(m: DateMarker, n: number) { - let a = dateToUtcArray(m) - a[2] += n - return arrayToUtcDate(a) -} - -export function addMs(m: DateMarker, n: number) { - let a = dateToUtcArray(m) - a[6] += n - return arrayToUtcDate(a) -} - -// Diffing (all return floats) -// TODO: why not use ranges? - -export function diffWeeks(m0, m1) { - return diffDays(m0, m1) / 7 -} - -export function diffDays(m0, m1) { - return (m1.valueOf() - m0.valueOf()) / (1000 * 60 * 60 * 24) -} - -export function diffHours(m0, m1) { - return (m1.valueOf() - m0.valueOf()) / (1000 * 60 * 60) -} - -export function diffMinutes(m0, m1) { - return (m1.valueOf() - m0.valueOf()) / (1000 * 60) -} - -export function diffSeconds(m0, m1) { - return (m1.valueOf() - m0.valueOf()) / 1000 -} - -export function diffDayAndTime(m0: DateMarker, m1: DateMarker): Duration { - let m0day = startOfDay(m0) - let m1day = startOfDay(m1) - - return { - years: 0, - months: 0, - days: Math.round(diffDays(m0day, m1day)), - milliseconds: (m1.valueOf() - m1day.valueOf()) - (m0.valueOf() - m0day.valueOf()), - } -} - -// Diffing Whole Units - -export function diffWholeWeeks(m0: DateMarker, m1: DateMarker): number { - let d = diffWholeDays(m0, m1) - - if (d !== null && d % 7 === 0) { - return d / 7 - } - - return null -} - -export function diffWholeDays(m0: DateMarker, m1: DateMarker): number { - if (timeAsMs(m0) === timeAsMs(m1)) { - return Math.round(diffDays(m0, m1)) - } - return null -} - -// Start-Of - -export function startOfDay(m: DateMarker): DateMarker { - return arrayToUtcDate([ - m.getUTCFullYear(), - m.getUTCMonth(), - m.getUTCDate(), - ]) -} - -export function startOfHour(m: DateMarker) { - return arrayToUtcDate([ - m.getUTCFullYear(), - m.getUTCMonth(), - m.getUTCDate(), - m.getUTCHours(), - ]) -} - -export function startOfMinute(m: DateMarker) { - return arrayToUtcDate([ - m.getUTCFullYear(), - m.getUTCMonth(), - m.getUTCDate(), - m.getUTCHours(), - m.getUTCMinutes(), - ]) -} - -export function startOfSecond(m: DateMarker) { - return arrayToUtcDate([ - m.getUTCFullYear(), - m.getUTCMonth(), - m.getUTCDate(), - m.getUTCHours(), - m.getUTCMinutes(), - m.getUTCSeconds(), - ]) -} - -// Week Computation - -export function weekOfYear(marker, dow, doy) { - let y = marker.getUTCFullYear() - let w = weekOfGivenYear(marker, y, dow, doy) - - if (w < 1) { - return weekOfGivenYear(marker, y - 1, dow, doy) - } - - let nextW = weekOfGivenYear(marker, y + 1, dow, doy) - if (nextW >= 1) { - return Math.min(w, nextW) - } - - return w -} - -function weekOfGivenYear(marker, year, dow, doy) { - let firstWeekStart = arrayToUtcDate([year, 0, 1 + firstWeekOffset(year, dow, doy)]) - let dayStart = startOfDay(marker) - let days = Math.round(diffDays(firstWeekStart, dayStart)) - - return Math.floor(days / 7) + 1 // zero-indexed -} - -// start-of-first-week - start-of-year -function firstWeekOffset(year, dow, doy) { - // first-week day -- which january is always in the first week (4 for iso, 1 for other) - let fwd = 7 + dow - doy - - // first-week day local weekday -- which local weekday is fwd - let fwdlw = (7 + arrayToUtcDate([year, 0, fwd]).getUTCDay() - dow) % 7 - - return -fwdlw + fwd - 1 -} - -// Array Conversion - -export function dateToLocalArray(date) { - return [ - date.getFullYear(), - date.getMonth(), - date.getDate(), - date.getHours(), - date.getMinutes(), - date.getSeconds(), - date.getMilliseconds(), - ] -} - -export function arrayToLocalDate(a) { - return new Date( - a[0], - a[1] || 0, - a[2] == null ? 1 : a[2], // day of month - a[3] || 0, - a[4] || 0, - a[5] || 0, - ) -} - -export function dateToUtcArray(date) { - return [ - date.getUTCFullYear(), - date.getUTCMonth(), - date.getUTCDate(), - date.getUTCHours(), - date.getUTCMinutes(), - date.getUTCSeconds(), - date.getUTCMilliseconds(), - ] -} - -export function arrayToUtcDate(a) { - // according to web standards (and Safari), a month index is required. - // massage if only given a year. - if (a.length === 1) { - a = a.concat([0]) - } - - return new Date(Date.UTC(...(a as [any, any]))) -} - -// Other Utils - -export function isValidDate(m: DateMarker) { - return !isNaN(m.valueOf()) -} - -export function timeAsMs(m: DateMarker) { - return m.getUTCHours() * 1000 * 60 * 60 + - m.getUTCMinutes() * 1000 * 60 + - m.getUTCSeconds() * 1000 + - m.getUTCMilliseconds() -} diff --git a/fullcalendar-main/packages/core/src/datelib/parsing.ts b/fullcalendar-main/packages/core/src/datelib/parsing.ts deleted file mode 100644 index 2b6584a..0000000 --- a/fullcalendar-main/packages/core/src/datelib/parsing.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { isValidDate } from './marker.js' - -const ISO_RE = /^\s*(\d{4})(-?(\d{2})(-?(\d{2})([T ](\d{2}):?(\d{2})(:?(\d{2})(\.(\d+))?)?(Z|(([-+])(\d{2})(:?(\d{2}))?))?)?)?)?$/ - -export function parse(str) { - let m = ISO_RE.exec(str) - - if (m) { - let marker = new Date(Date.UTC( - Number(m[1]), - m[3] ? Number(m[3]) - 1 : 0, - Number(m[5] || 1), - Number(m[7] || 0), - Number(m[8] || 0), - Number(m[10] || 0), - m[12] ? Number(`0.${m[12]}`) * 1000 : 0, - )) - - if (isValidDate(marker)) { - let timeZoneOffset = null - - if (m[13]) { - timeZoneOffset = (m[15] === '-' ? -1 : 1) * ( - Number(m[16] || 0) * 60 + - Number(m[18] || 0) - ) - } - - return { - marker, - isTimeUnspecified: !m[6], - timeZoneOffset, - } - } - } - - return null -} diff --git a/fullcalendar-main/packages/core/src/datelib/timezone.ts b/fullcalendar-main/packages/core/src/datelib/timezone.ts deleted file mode 100644 index 7c34d8a..0000000 --- a/fullcalendar-main/packages/core/src/datelib/timezone.ts +++ /dev/null @@ -1,13 +0,0 @@ -export abstract class NamedTimeZoneImpl { - timeZoneName: string - - constructor(timeZoneName: string) { - this.timeZoneName = timeZoneName - } - - abstract offsetForArray(a: number[]): number - - abstract timestampToArray(ms: number): number[] -} - -export type NamedTimeZoneImplClass = { new(timeZoneName: string): NamedTimeZoneImpl } diff --git a/fullcalendar-main/packages/core/src/datelib/zoned-marker.ts b/fullcalendar-main/packages/core/src/datelib/zoned-marker.ts deleted file mode 100644 index 4d7d62f..0000000 --- a/fullcalendar-main/packages/core/src/datelib/zoned-marker.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { DateMarker } from './marker.js' -import { CalendarSystem } from './calendar-system.js' - -export interface ZonedMarker { - marker: DateMarker, - timeZoneOffset: number -} - -export interface ExpandedZonedMarker extends ZonedMarker { - array: number[], - year: number, - month: number, - day: number, - hour: number, - minute: number, - second: number, - millisecond: number -} - -export function expandZonedMarker(dateInfo: ZonedMarker, calendarSystem: CalendarSystem): ExpandedZonedMarker { - let a = calendarSystem.markerToArray(dateInfo.marker) - - return { - marker: dateInfo.marker, - timeZoneOffset: dateInfo.timeZoneOffset, - array: a, - year: a[0], - month: a[1], - day: a[2], - hour: a[3], - minute: a[4], - second: a[5], - millisecond: a[6], - } -} diff --git a/fullcalendar-main/packages/core/src/dates-set.ts b/fullcalendar-main/packages/core/src/dates-set.ts deleted file mode 100644 index bc665da..0000000 --- a/fullcalendar-main/packages/core/src/dates-set.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { DateProfile } from './DateProfileGenerator.js' -import { CalendarData } from './reducers/data-types.js' -import { RangeApiWithTimeZone, buildRangeApiWithTimeZone } from './structs/date-span.js' -import { ViewApi } from './api/ViewApi.js' - -export type DatesSetArg = RangeApiWithTimeZone & { view: ViewApi } - -export function handleDateProfile(dateProfile: DateProfile, context: CalendarData) { - context.emitter.trigger('datesSet', { - ...buildRangeApiWithTimeZone(dateProfile.activeRange, context.dateEnv), - view: context.viewApi, - }) -} diff --git a/fullcalendar-main/packages/core/src/event-crud.ts b/fullcalendar-main/packages/core/src/event-crud.ts deleted file mode 100644 index ce41a37..0000000 --- a/fullcalendar-main/packages/core/src/event-crud.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { EventStore } from './structs/event-store.js' -import { CalendarData } from './reducers/data-types.js' -import { EventImpl, buildEventApis } from './api/EventImpl.js' -import { Duration } from './datelib/duration.js' -import { ViewApi } from './index.js' - -export interface EventAddArg { - event: EventImpl - relatedEvents: EventImpl[] - revert: () => void -} - -export interface EventChangeArg { - oldEvent: EventImpl - event: EventImpl - relatedEvents: EventImpl[] - revert: () => void -} - -export interface EventDropArg extends EventChangeArg { // not best place. deals w/ UI - el: HTMLElement - delta: Duration - jsEvent: MouseEvent - view: ViewApi - // and other "transformed" things -} - -export interface EventRemoveArg { - event: EventImpl - relatedEvents: EventImpl[] - revert: () => void -} - -export function handleEventStore(eventStore: EventStore, context: CalendarData) { - let { emitter } = context - - if (emitter.hasHandlers('eventsSet')) { - emitter.trigger('eventsSet', buildEventApis(eventStore, context)) - } -} diff --git a/fullcalendar-main/packages/core/src/event-sources/array-event-source.ts b/fullcalendar-main/packages/core/src/event-sources/array-event-source.ts deleted file mode 100644 index 6de2e52..0000000 --- a/fullcalendar-main/packages/core/src/event-sources/array-event-source.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { createPlugin } from '../plugin-system.js' -import { EventSourceDef } from '../structs/event-source-def.js' -import { EventInput } from '../structs/event-parse.js' - -let eventSourceDef: EventSourceDef = { - ignoreRange: true, - - parseMeta(refined) { - if (Array.isArray(refined.events)) { - return refined.events - } - return null - }, - - fetch(arg, successCallback) { - successCallback({ - rawEvents: arg.eventSource.meta, - }) - }, -} - -export const arrayEventSourcePlugin = createPlugin({ - name: 'array-event-source', - eventSourceDefs: [eventSourceDef], -}) diff --git a/fullcalendar-main/packages/core/src/event-sources/func-event-source.ts b/fullcalendar-main/packages/core/src/event-sources/func-event-source.ts deleted file mode 100644 index 63176c4..0000000 --- a/fullcalendar-main/packages/core/src/event-sources/func-event-source.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { EventSourceDef } from '../structs/event-source-def.js' -import { EventInput } from '../structs/event-parse.js' -import { createPlugin } from '../plugin-system.js' -import { buildRangeApiWithTimeZone } from '../structs/date-span.js' -import { unpromisify } from '../util/promise.js' - -export type EventSourceFuncArg = { - start: Date - end: Date - startStr: string - endStr: string - timeZone: string -} - -export type EventSourceFunc = - (( - arg: EventSourceFuncArg, - successCallback: (eventInputs: EventInput[]) => void, - failureCallback: (error: Error) => void, - ) => void) | - ((arg: EventSourceFuncArg) => Promise) - -let eventSourceDef: EventSourceDef = { - - parseMeta(refined) { - if (typeof refined.events === 'function') { - return refined.events - } - return null - }, - - fetch(arg, successCallback, errorCallback) { - const { dateEnv } = arg.context - const func = arg.eventSource.meta - - unpromisify( - func.bind(null, buildRangeApiWithTimeZone(arg.range, dateEnv)), - (rawEvents) => successCallback({ rawEvents }), - errorCallback, - ) - }, - -} - -export const funcEventSourcePlugin = createPlugin({ - name: 'func-event-source', - eventSourceDefs: [eventSourceDef], -}) diff --git a/fullcalendar-main/packages/core/src/event-sources/json-feed-event-source-refiners.ts b/fullcalendar-main/packages/core/src/event-sources/json-feed-event-source-refiners.ts deleted file mode 100644 index c93906f..0000000 --- a/fullcalendar-main/packages/core/src/event-sources/json-feed-event-source-refiners.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { identity, Identity, Dictionary } from '../options.js' - -export const JSON_FEED_EVENT_SOURCE_REFINERS = { - method: String, - extraParams: identity as Identity Dictionary)>, - startParam: String, - endParam: String, - timeZoneParam: String, -} diff --git a/fullcalendar-main/packages/core/src/event-sources/json-feed-event-source.ts b/fullcalendar-main/packages/core/src/event-sources/json-feed-event-source.ts deleted file mode 100644 index b3a1580..0000000 --- a/fullcalendar-main/packages/core/src/event-sources/json-feed-event-source.ts +++ /dev/null @@ -1,102 +0,0 @@ -import { requestJson } from '../util/requestJson.js' -import { CalendarContext } from '../CalendarContext.js' -import { EventSourceDef } from '../structs/event-source-def.js' -import { DateRange } from '../datelib/date-range.js' -import { createPlugin } from '../plugin-system.js' -import { JSON_FEED_EVENT_SOURCE_REFINERS } from './json-feed-event-source-refiners.js' -import { EventInput } from '../api/structs.js' - -interface JsonFeedMeta { - url: string - format: 'json' // for EventSourceImpl - method: string - extraParams?: any - startParam?: string - endParam?: string - timeZoneParam?: string -} - -let eventSourceDef: EventSourceDef = { - - parseMeta(refined) { - if (refined.url && (refined.format === 'json' || !refined.format)) { - return { - url: refined.url, - format: 'json', - method: (refined.method || 'GET').toUpperCase(), - extraParams: refined.extraParams, - startParam: refined.startParam, - endParam: refined.endParam, - timeZoneParam: refined.timeZoneParam, - } - } - return null - }, - - fetch(arg, successCallback, errorCallback) { - const { meta } = arg.eventSource - const requestParams = buildRequestParams(meta, arg.range, arg.context) - - requestJson( - meta.method, - meta.url, - requestParams, - ).then( - ([rawEvents, response]: [EventInput[], Response]) => { - successCallback({ rawEvents, response }) - }, - errorCallback, - ) - }, - -} - -export const jsonFeedEventSourcePlugin = createPlugin({ - name: 'json-event-source', - eventSourceRefiners: JSON_FEED_EVENT_SOURCE_REFINERS, - eventSourceDefs: [eventSourceDef], -}) - -function buildRequestParams(meta: JsonFeedMeta, range: DateRange, context: CalendarContext) { - let { dateEnv, options } = context - let startParam - let endParam - let timeZoneParam - let customRequestParams - let params = {} - - startParam = meta.startParam - if (startParam == null) { - startParam = options.startParam - } - - endParam = meta.endParam - if (endParam == null) { - endParam = options.endParam - } - - timeZoneParam = meta.timeZoneParam - if (timeZoneParam == null) { - timeZoneParam = options.timeZoneParam - } - - // retrieve any outbound GET/POST data from the options - if (typeof meta.extraParams === 'function') { - // supplied as a function that returns a key/value object - customRequestParams = meta.extraParams() - } else { - // probably supplied as a straight key/value object - customRequestParams = meta.extraParams || {} - } - - Object.assign(params, customRequestParams) - - params[startParam] = dateEnv.formatIso(range.start) - params[endParam] = dateEnv.formatIso(range.end) - - if (dateEnv.timeZone !== 'local') { - params[timeZoneParam] = dateEnv.timeZone - } - - return params -} diff --git a/fullcalendar-main/packages/core/src/formatting-api.ts b/fullcalendar-main/packages/core/src/formatting-api.ts deleted file mode 100644 index a88c7c7..0000000 --- a/fullcalendar-main/packages/core/src/formatting-api.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { DateEnv } from './datelib/env.js' -import { createFormatter } from './datelib/formatting.js' -import { NativeFormatterOptions } from './datelib/formatting-native.js' -import { organizeRawLocales, buildLocale } from './datelib/locale.js' -import { BASE_OPTION_DEFAULTS } from './options.js' - -// public -import { DateInput } from './api/structs.js' - -export interface FormatDateOptions extends NativeFormatterOptions { - locale?: string -} - -export interface FormatRangeOptions extends FormatDateOptions { - separator?: string - isEndExclusive?: boolean -} - -export function formatDate(dateInput: DateInput, options: FormatDateOptions = {}) { - let dateEnv = buildDateEnv(options) - let formatter = createFormatter(options) - let dateMeta = dateEnv.createMarkerMeta(dateInput) - - if (!dateMeta) { // TODO: warning? - return '' - } - - return dateEnv.format(dateMeta.marker, formatter, { - forcedTzo: dateMeta.forcedTzo, - }) -} - -export function formatRange( - startInput: DateInput, - endInput: DateInput, - options: FormatRangeOptions, // mixture of env and formatter settings -) { - let dateEnv = buildDateEnv(typeof options === 'object' && options ? options : {}) // pass in if non-null object - let formatter = createFormatter(options) - let startMeta = dateEnv.createMarkerMeta(startInput) - let endMeta = dateEnv.createMarkerMeta(endInput) - - if (!startMeta || !endMeta) { // TODO: warning? - return '' - } - - return dateEnv.formatRange(startMeta.marker, endMeta.marker, formatter, { - forcedStartTzo: startMeta.forcedTzo, - forcedEndTzo: endMeta.forcedTzo, - isEndExclusive: options.isEndExclusive, - defaultSeparator: BASE_OPTION_DEFAULTS.defaultRangeSeparator, - }) -} - -// TODO: more DRY and optimized -function buildDateEnv(settings: FormatRangeOptions) { - let locale = buildLocale(settings.locale || 'en', organizeRawLocales([]).map) // TODO: don't hardcode 'en' everywhere - - return new DateEnv({ - timeZone: BASE_OPTION_DEFAULTS.timeZone, - calendarSystem: 'gregory', - ...settings, - locale, - }) -} diff --git a/fullcalendar-main/packages/core/src/global-config.ts b/fullcalendar-main/packages/core/src/global-config.ts deleted file mode 100644 index 7f54e1f..0000000 --- a/fullcalendar-main/packages/core/src/global-config.ts +++ /dev/null @@ -1,3 +0,0 @@ -// TODO: get rid of this in favor of options system, -// tho it's really easy to access this globally rather than pass thru options. -export const config = {} as any diff --git a/fullcalendar-main/packages/core/src/global-locales.ts b/fullcalendar-main/packages/core/src/global-locales.ts deleted file mode 100644 index 90c0089..0000000 --- a/fullcalendar-main/packages/core/src/global-locales.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { LocaleInput } from './datelib/locale.js' - -export const globalLocales: LocaleInput[] = [] diff --git a/fullcalendar-main/packages/core/src/global-plugins.ts b/fullcalendar-main/packages/core/src/global-plugins.ts deleted file mode 100644 index 05e601f..0000000 --- a/fullcalendar-main/packages/core/src/global-plugins.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { PluginDef } from './plugin-system-struct.js' -import { createPlugin } from './plugin-system.js' -import { arrayEventSourcePlugin } from './event-sources/array-event-source.js' -import { funcEventSourcePlugin } from './event-sources/func-event-source.js' -import { jsonFeedEventSourcePlugin } from './event-sources/json-feed-event-source.js' -import { simpleRecurringEventsPlugin } from './structs/recurring-event-simple.js' -import { changeHandlerPlugin } from './option-change-handlers.js' -import { handleDateProfile } from './dates-set.js' -import { handleEventStore } from './event-crud.js' -import { computeEventSourcesLoading } from './reducers/eventSources.js' -import { CalendarDataManagerState } from './reducers/data-types.js' - -/* -this array is exposed on the root namespace so that UMD plugins can add to it. -see the rollup-bundles script. -*/ -export const globalPlugins: PluginDef[] = [ - arrayEventSourcePlugin, - funcEventSourcePlugin, - jsonFeedEventSourcePlugin, - simpleRecurringEventsPlugin, - changeHandlerPlugin, - createPlugin({ - name: 'misc', - isLoadingFuncs: [ - (state: CalendarDataManagerState) => computeEventSourcesLoading(state.eventSources), - ], - propSetHandlers: { - dateProfile: handleDateProfile, - eventStore: handleEventStore, - }, - }), -] diff --git a/fullcalendar-main/packages/core/src/index.css b/fullcalendar-main/packages/core/src/index.css deleted file mode 100644 index 93e5ab8..0000000 --- a/fullcalendar-main/packages/core/src/index.css +++ /dev/null @@ -1,21 +0,0 @@ - -@import './styles/mixins'; -@import './styles/vars'; - -@import './styles/page-root'; -@import './styles/calendar-root'; - -@import './styles/icons'; -@import './styles/button'; -@import './styles/button-group'; -@import './styles/toolbar'; -@import './styles/scroller'; -@import './styles/scroller-harness'; -@import './styles/scrollgrid'; -@import './styles/sticky'; -@import './styles/view-harness'; -@import './styles/col-header'; -@import './styles/bg'; -@import './styles/event'; -@import './styles/h-event'; -@import './styles/popover'; diff --git a/fullcalendar-main/packages/core/src/index.global.ts b/fullcalendar-main/packages/core/src/index.global.ts deleted file mode 100644 index e8d7b42..0000000 --- a/fullcalendar-main/packages/core/src/index.global.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as Internal from './internal.js' -import * as Preact from './preact.js' - -export * from './index.js' -export { Internal, Preact } diff --git a/fullcalendar-main/packages/core/src/index.ts b/fullcalendar-main/packages/core/src/index.ts deleted file mode 100644 index 94ec1f0..0000000 --- a/fullcalendar-main/packages/core/src/index.ts +++ /dev/null @@ -1,21 +0,0 @@ -import './index.css' - -export { Calendar } from './Calendar.js' - -export { CalendarApi } from './api/CalendarApi.js' -export { ViewApi } from './api/ViewApi.js' -export { EventSourceApi } from './api/EventSourceApi.js' -export { EventApi } from './api/EventApi.js' -export * from './api/structs.js' - -export { FormatDateOptions, FormatRangeOptions } from './formatting-api.js' -export { formatDate, formatRange } from './formatting-api.js' -export { createPlugin } from './plugin-system.js' -export { sliceEvents } from './View.js' -export { EventRenderRange } from './component/event-rendering.js' // for sliceEvents -export { JsonRequestError } from './util/requestJson.js' - -export { globalLocales } from './global-locales.js' -export { globalPlugins } from './global-plugins.js' - -export const version: string = '<%= pkgVersion %>' diff --git a/fullcalendar-main/packages/core/src/interactions/ElementDragging.ts b/fullcalendar-main/packages/core/src/interactions/ElementDragging.ts deleted file mode 100644 index 833967f..0000000 --- a/fullcalendar-main/packages/core/src/interactions/ElementDragging.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { Emitter } from '../common/Emitter.js' - -/* -An abstraction for a dragging interaction originating on an event. -Does higher-level things than PointerDragger, such as possibly: -- a "mirror" that moves with the pointer -- a minimum number of pixels or other criteria for a true drag to begin - -subclasses must emit: -- pointerdown -- dragstart -- dragmove -- pointerup -- dragend -*/ -export abstract class ElementDragging { // TODO: rename to *Interface? - emitter: Emitter - - constructor(el: HTMLElement, selector?: string) { - this.emitter = new Emitter() - } - - destroy() { - } - - // if given true, should prevent dragstart+dragmove+dragend from firing - abstract setIgnoreMove(bool: boolean): void - - setMirrorIsVisible(bool: boolean) { - // optional if subclass doesn't want to support a mirror - } - - setMirrorNeedsRevert(bool: boolean) { - // optional if subclass doesn't want to support a mirror - } - - setAutoScrollEnabled(bool: boolean) { - // optional - } -} - -export type ElementDraggingClass = { new(el: HTMLElement, selector?: string): ElementDragging } diff --git a/fullcalendar-main/packages/core/src/interactions/EventClicking.ts b/fullcalendar-main/packages/core/src/interactions/EventClicking.ts deleted file mode 100644 index 1c4bfb5..0000000 --- a/fullcalendar-main/packages/core/src/interactions/EventClicking.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { listenBySelector } from '../util/dom-event.js' -import { EventImpl } from '../api/EventImpl.js' -import { elementClosest } from '../util/dom-manip.js' -import { getElSeg } from '../component/event-rendering.js' -import { Interaction, InteractionSettings } from './interaction.js' -import { ViewApi } from '../api/ViewApi.js' - -export interface EventClickArg { - el: HTMLElement - event: EventImpl - jsEvent: MouseEvent - view: ViewApi -} - -/* -Detects when the user clicks on an event within a DateComponent -*/ -export class EventClicking extends Interaction { - constructor(settings: InteractionSettings) { - super(settings) - - this.destroy = listenBySelector( - settings.el, - 'click', - '.fc-event', // on both fg and bg events - this.handleSegClick, - ) - } - - handleSegClick = (ev: Event, segEl: HTMLElement) => { - let { component } = this - let { context } = component - let seg = getElSeg(segEl) - - if ( - seg && // might be the
surrounding the more link - component.isValidSegDownEl(ev.target as HTMLElement) - ) { - // our way to simulate a link click for elements that can't be tags - // grab before trigger fired in case trigger trashes DOM thru rerendering - let hasUrlContainer = elementClosest(ev.target as HTMLElement, '.fc-event-forced-url') - let url = hasUrlContainer ? (hasUrlContainer.querySelector('a[href]') as any).href : '' - - context.emitter.trigger('eventClick', { - el: segEl, - event: new EventImpl( - component.context, - seg.eventRange.def, - seg.eventRange.instance, - ), - jsEvent: ev as MouseEvent, // Is this always a mouse event? See #4655 - view: context.viewApi, - } as EventClickArg) - - if (url && !ev.defaultPrevented) { - window.location.href = url - } - } - } -} diff --git a/fullcalendar-main/packages/core/src/interactions/EventHovering.ts b/fullcalendar-main/packages/core/src/interactions/EventHovering.ts deleted file mode 100644 index fdd889d..0000000 --- a/fullcalendar-main/packages/core/src/interactions/EventHovering.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { listenToHoverBySelector } from '../util/dom-event.js' -import { EventImpl } from '../api/EventImpl.js' -import { getElSeg } from '../component/event-rendering.js' -import { Interaction, InteractionSettings } from './interaction.js' -import { ViewApi } from '../api/ViewApi.js' - -export interface EventHoveringArg { - el: HTMLElement - event: EventImpl - jsEvent: MouseEvent - view: ViewApi -} - -/* -Triggers events and adds/removes core classNames when the user's pointer -enters/leaves event-elements of a component. -*/ -export class EventHovering extends Interaction { - removeHoverListeners: () => void - - currentSegEl: HTMLElement - - constructor(settings: InteractionSettings) { - super(settings) - - this.removeHoverListeners = listenToHoverBySelector( - settings.el, - '.fc-event', // on both fg and bg events - this.handleSegEnter, - this.handleSegLeave, - ) - } - - destroy() { - this.removeHoverListeners() - } - - // for simulating an eventMouseLeave when the event el is destroyed while mouse is over it - handleEventElRemove = (el: HTMLElement) => { - if (el === this.currentSegEl) { - this.handleSegLeave(null, this.currentSegEl) - } - } - - handleSegEnter = (ev: Event, segEl: HTMLElement) => { - if (getElSeg(segEl)) { // TODO: better way to make sure not hovering over more+ link or its wrapper - this.currentSegEl = segEl - this.triggerEvent('eventMouseEnter', ev, segEl) - } - } - - handleSegLeave = (ev: Event | null, segEl: HTMLElement) => { - if (this.currentSegEl) { - this.currentSegEl = null - this.triggerEvent('eventMouseLeave', ev, segEl) - } - } - - triggerEvent(publicEvName: 'eventMouseEnter' | 'eventMouseLeave', ev: Event | null, segEl: HTMLElement) { - let { component } = this - let { context } = component - let seg = getElSeg(segEl)! - - if (!ev || component.isValidSegDownEl(ev.target as HTMLElement)) { - context.emitter.trigger(publicEvName, { - el: segEl, - event: new EventImpl( - context, - seg.eventRange.def, - seg.eventRange.instance, - ), - jsEvent: ev as MouseEvent, // Is this always a mouse event? See #4655 - view: context.viewApi, - } as EventHoveringArg) - } - } -} diff --git a/fullcalendar-main/packages/core/src/interactions/date-selecting.ts b/fullcalendar-main/packages/core/src/interactions/date-selecting.ts deleted file mode 100644 index 5e7fb4c..0000000 --- a/fullcalendar-main/packages/core/src/interactions/date-selecting.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { Hit } from './hit.js' - -export type dateSelectionJoinTransformer = (hit0: Hit, hit1: Hit) => any diff --git a/fullcalendar-main/packages/core/src/interactions/event-dragging.ts b/fullcalendar-main/packages/core/src/interactions/event-dragging.ts deleted file mode 100644 index 5d5a747..0000000 --- a/fullcalendar-main/packages/core/src/interactions/event-dragging.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { EventMutation } from '../structs/event-mutation.js' -import { Hit } from './hit.js' -import { EventDef } from '../structs/event-def.js' -import { EventUi } from '../component/event-ui.js' -import { CalendarContext } from '../CalendarContext.js' -import { Dictionary } from '../options.js' - -export type eventDragMutationMassager = (mutation: EventMutation, hit0: Hit, hit1: Hit) => void -export type EventDropTransformers = (mutation: EventMutation, context: CalendarContext) => Dictionary -export type eventIsDraggableTransformer = (val: boolean, eventDef: EventDef, eventUi: EventUi, context: CalendarContext) => boolean diff --git a/fullcalendar-main/packages/core/src/interactions/event-interaction-state.ts b/fullcalendar-main/packages/core/src/interactions/event-interaction-state.ts deleted file mode 100644 index 6ea99e2..0000000 --- a/fullcalendar-main/packages/core/src/interactions/event-interaction-state.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { EventStore } from '../structs/event-store.js' - -export interface EventInteractionState { // is this ever used alone? - affectedEvents: EventStore - mutatedEvents: EventStore - isEvent: boolean -} diff --git a/fullcalendar-main/packages/core/src/interactions/external-element-dragging.ts b/fullcalendar-main/packages/core/src/interactions/external-element-dragging.ts deleted file mode 100644 index 195f4a3..0000000 --- a/fullcalendar-main/packages/core/src/interactions/external-element-dragging.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { DateSpan } from '../structs/date-span.js' -import { DragMeta } from '../structs/drag-meta.js' - -export type ExternalDefTransform = (dateSpan: DateSpan, dragMeta: DragMeta) => any diff --git a/fullcalendar-main/packages/core/src/interactions/hit.ts b/fullcalendar-main/packages/core/src/interactions/hit.ts deleted file mode 100644 index 618d4d8..0000000 --- a/fullcalendar-main/packages/core/src/interactions/hit.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { DateProfile } from '../DateProfileGenerator.js' -import { DateSpan } from '../structs/date-span.js' -import { Rect } from '../util/geom.js' -import { ViewContext } from '../ViewContext.js' - -export interface Hit { - componentId?: string // will be set by HitDragging - context?: ViewContext // will be set by HitDragging - dateProfile: DateProfile - dateSpan: DateSpan - dayEl: HTMLElement - rect: Rect - layer: number - largeUnit?: string // TODO: have timeline set this! -} diff --git a/fullcalendar-main/packages/core/src/interactions/interaction.ts b/fullcalendar-main/packages/core/src/interactions/interaction.ts deleted file mode 100644 index de0ccb9..0000000 --- a/fullcalendar-main/packages/core/src/interactions/interaction.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { DateComponent } from '../component/DateComponent.js' -import { Hit } from './hit.js' - -export abstract class Interaction { - component: DateComponent - isHitComboAllowed: ((hit0: Hit, hit1: Hit) => boolean) | null - - constructor(settings: InteractionSettings) { - this.component = settings.component - this.isHitComboAllowed = settings.isHitComboAllowed || null - } - - destroy() { - } -} - -export type InteractionClass = { new(settings: InteractionSettings): Interaction } - -export interface InteractionSettingsInput { - el: HTMLElement - useEventCenter?: boolean - isHitComboAllowed?: (hit0: Hit, hit1: Hit) => boolean -} - -export interface InteractionSettings { - component: DateComponent - el: HTMLElement - useEventCenter: boolean - isHitComboAllowed: ((hit0: Hit, hit1: Hit) => boolean) | null -} - -export type InteractionSettingsStore = { [componenUid: string]: InteractionSettings } - -export function parseInteractionSettings(component: DateComponent, input: InteractionSettingsInput): InteractionSettings { - return { - component, - el: input.el, - useEventCenter: input.useEventCenter != null ? input.useEventCenter : true, - isHitComboAllowed: input.isHitComboAllowed || null, - } -} - -export function interactionSettingsToStore(settings: InteractionSettings) { - return { - [settings.component.uid]: settings, - } -} - -// global state -export const interactionSettingsStore: InteractionSettingsStore = {} diff --git a/fullcalendar-main/packages/core/src/interactions/pointer.ts b/fullcalendar-main/packages/core/src/interactions/pointer.ts deleted file mode 100644 index 459ab06..0000000 --- a/fullcalendar-main/packages/core/src/interactions/pointer.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface PointerDragEvent { - origEvent: UIEvent - isTouch: boolean - subjectEl: EventTarget - pageX: number - pageY: number - deltaX: number - deltaY: number -} diff --git a/fullcalendar-main/packages/core/src/internal.ts b/fullcalendar-main/packages/core/src/internal.ts deleted file mode 100644 index 0603f54..0000000 --- a/fullcalendar-main/packages/core/src/internal.ts +++ /dev/null @@ -1,273 +0,0 @@ -import './index.css' - -export { - Identity, Dictionary, - BaseOptionRefiners, BaseOptionsRefined, - ViewOptionsRefined, RawOptionsFromRefiners, RefinedOptionsFromRefiners, - CalendarListenerRefiners, - BASE_OPTION_DEFAULTS, identity, refineProps, -} from './options.js' - -export type { EventDef, EventDefHash } from './structs/event-def.js' -export type { EventInstance, EventInstanceHash } from './structs/event-instance.js' -export { createEventInstance } from './structs/event-instance.js' -export type { EventRefined, EventTuple, EventRefiners } from './structs/event-parse.js' -export { parseEventDef, refineEventDef } from './structs/event-parse.js' -export { parseBusinessHours } from './structs/business-hours.js' - -export type { OrderSpec } from './util/misc.js' -export { - padStart, - isInt, - parseFieldSpecs, - compareByFieldSpecs, - flexibleCompare, - preventSelection, allowSelection, preventContextMenu, allowContextMenu, - compareNumbers, enableCursor, disableCursor, - guid, -} from './util/misc.js' - -export { - computeVisibleDayRange, - isMultiDayRange, - diffDates, -} from './util/date.js' - -export { - removeExact, - isArraysEqual, -} from './util/array.js' - -export type { MemoizeHashFunc, MemoiseArrayFunc } from './util/memoize.js' -export { memoize, memoizeObjArg, memoizeArraylike, memoizeHashlike } from './util/memoize.js' - -export type { Rect, Point } from './util/geom.js' -export { - intersectRects, - pointInsideRect, - constrainPoint, - getRectCenter, diffPoints, - translateRect, -} from './util/geom.js' - -export { mapHash, filterHash, isPropsEqual, compareObjs, collectFromHash } from './util/object.js' - -export { - findElements, - findDirectChildren, - removeElement, - applyStyle, - elementMatches, - elementClosest, - getEventTargetViaRoot, - getUniqueDomId, -} from './util/dom-manip.js' -export { parseClassNames } from './util/html.js' - -export { getCanVGrowWithinCell } from './util/table-styling.js' - -export type { EventStore } from './structs/event-store.js' -export { - createEmptyEventStore, - mergeEventStores, - getRelevantEvents, - eventTupleToStore, -} from './structs/event-store.js' -export type { EventUiHash, EventUi } from './component/event-ui.js' -export { combineEventUis, createEventUi } from './component/event-ui.js' -export type { SplittableProps } from './component/event-splitting.js' -export { Splitter } from './component/event-splitting.js' -export { getDayClassNames, getDateMeta, getSlotClassNames } from './component/date-rendering.js' -export { buildNavLinkAttrs } from './common/nav-link.js' - -export { - preventDefault, - whenTransitionDone, -} from './util/dom-event.js' - -export { - computeInnerRect, - computeEdges, - getClippingParents, - computeRect, -} from './util/dom-geom.js' - -export { unpromisify } from './util/promise.js' - -export { Emitter } from './common/Emitter.js' -export type { DateRange } from './datelib/date-range.js' -export { rangeContainsMarker, intersectRanges, rangesEqual, rangesIntersect, rangeContainsRange } from './datelib/date-range.js' -export { PositionCache } from './common/PositionCache.js' -export { ScrollController, ElementScrollController, WindowScrollController } from './common/scroll-controller.js' -export { Theme } from './theme/Theme.js' -export type { ViewContext } from './ViewContext.js' -export { ViewContextType } from './ViewContext.js' -export type { Seg, EventSegUiInteractionState } from './component/DateComponent.js' -export { DateComponent } from './component/DateComponent.js' -export type { CalendarData } from './reducers/data-types.js' -export type { ViewProps } from './View.js' - -export type { DateProfile } from './DateProfileGenerator.js' -export { DateProfileGenerator } from './DateProfileGenerator.js' -export type { ViewSpec } from './structs/view-spec.js' -export type { DateSpan } from './structs/date-span.js' -export { isDateSpansEqual } from './structs/date-span.js' - -export type { DateMarker } from './datelib/marker.js' -export { - addDays, - startOfDay, - addMs, - addWeeks, - diffWeeks, - diffWholeWeeks, - diffWholeDays, - diffDayAndTime, - diffDays, - isValidDate, -} from './datelib/marker.js' -export { - createDuration, - asCleanDays, multiplyDuration, addDurations, - asRoughMinutes, asRoughSeconds, asRoughMs, - wholeDivideDurations, greatestDurationDenominator, -} from './datelib/duration.js' -export { DateEnv } from './datelib/env.js' - -export { createFormatter } from './datelib/formatting.js' -export type { DateFormatter, VerboseFormattingArg } from './datelib/DateFormatter.js' -export { - formatIsoTimeString, - formatDayString, - buildIsoString, - formatIsoMonthStr, -} from './datelib/formatting-utils.js' -export { NamedTimeZoneImpl } from './datelib/timezone.js' -export { parse as parseMarker } from './datelib/parsing.js' - -export type { EventSourceDef } from './structs/event-source-def.js' -export type { EventSourceRefined } from './structs/event-source-parse.js' -export { EventSourceRefiners } from './structs/event-source-parse.js' - -export type { SegSpan, SegRect, SegEntry, SegInsertion, SegEntryGroup } from './seg-hierarchy.js' -export { - SegHierarchy, buildEntryKey, getEntrySpanEnd, binarySearch, groupIntersectingEntries, - intersectSpans, -} from './seg-hierarchy.js' - -export type { InteractionSettings, InteractionSettingsStore } from './interactions/interaction.js' -export { - Interaction, - interactionSettingsToStore, - interactionSettingsStore, -} from './interactions/interaction.js' -export type { PointerDragEvent } from './interactions/pointer.js' -export type { Hit } from './interactions/hit.js' -export type { dateSelectionJoinTransformer } from './interactions/date-selecting.js' -export type { eventDragMutationMassager, EventDropTransformers } from './interactions/event-dragging.js' -export { ElementDragging } from './interactions/ElementDragging.js' - -export { config } from './global-config.js' - -export type { RecurringType } from './structs/recurring-event.js' - -export type { DragMetaInput, DragMeta } from './structs/drag-meta.js' -export { parseDragMeta } from './structs/drag-meta.js' - -export type { ViewPropsTransformer, PluginDef } from './plugin-system-struct.js' -export type { Action } from './reducers/Action.js' -export type { CalendarContext } from './CalendarContext.js' -export type { CalendarContentProps } from './CalendarContent.js' -export { CalendarRoot } from './CalendarRoot.js' - -export { DayHeader } from './common/DayHeader.js' -export { computeFallbackHeaderFormat } from './common/table-utils.js' -export { TableDateCell } from './common/TableDateCell.js' -export { TableDowCell } from './common/TableDowCell.js' - -export { DaySeriesModel } from './common/DaySeriesModel.js' - -export type { EventInteractionState } from './interactions/event-interaction-state.js' -export { - sliceEventStore, hasBgRendering, getElSeg, - buildSegTimeText, - sortEventSegs, - getSegMeta, buildEventRangeKey, - getSegAnchorAttrs, -} from './component/event-rendering.js' - -export type { DayTableCell } from './common/DayTableModel.js' -export { DayTableModel } from './common/DayTableModel.js' - -export type { SlicedProps } from './common/slicing-utils.js' -export { Slicer } from './common/slicing-utils.js' - -export type { EventMutation } from './structs/event-mutation.js' -export { applyMutationToEventStore } from './structs/event-mutation.js' -export type { Constraint } from './structs/constraint.js' -export { isPropsValid, isInteractionValid, isDateSelectionValid } from './validation.js' - -export { requestJson } from './util/requestJson.js' - -export { BaseComponent, setRef } from './vdom-util.js' -export { DelayedRunner } from './util/DelayedRunner.js' - -export type { - ScrollGridProps, - ScrollGridSectionConfig, - ColGroupConfig, - ScrollGridChunkConfig, -} from './scrollgrid/ScrollGridImpl.js' -export type { SimpleScrollGridSection } from './scrollgrid/SimpleScrollGrid.js' -export { SimpleScrollGrid } from './scrollgrid/SimpleScrollGrid.js' -export type { - ScrollerLike, ColProps, ChunkContentCallbackArgs, - ChunkConfigRowContent, ChunkConfigContent, -} from './scrollgrid/util.js' -export { - hasShrinkWidth, renderMicroColGroup, - getScrollGridClassNames, getSectionClassNames, getSectionHasLiquidHeight, getAllowYScrolling, renderChunkContent, computeShrinkWidth, - sanitizeShrinkWidth, - isColPropsEqual, - renderScrollShim, - getStickyFooterScrollbar, - getStickyHeaderDates, -} from './scrollgrid/util.js' -export type { OverflowValue } from './scrollgrid/Scroller.js' -export { Scroller } from './scrollgrid/Scroller.js' -export { getScrollbarWidths } from './util/scrollbar-width.js' -export { RefMap } from './util/RefMap.js' -export { getIsRtlScrollbarOnLeft } from './util/scrollbar-side.js' - -export { NowTimer } from './NowTimer.js' -export type { ScrollRequest } from './ScrollResponder.js' -export { ScrollResponder } from './ScrollResponder.js' -export type { - CustomContentGenerator, DidMountHandler, WillUnmountHandler, MountArg, -} from './common/render-hook.js' -export { StandardEvent } from './common/StandardEvent.js' -export { NowIndicatorContainer } from './common/NowIndicatorContainer.js' - -export { DayCellContainer, hasCustomDayCellContent } from './common/DayCellContainer.js' -export type { MinimalEventProps } from './common/EventContainer.js' -export { EventContainer } from './common/EventContainer.js' -export { renderFill, BgEvent } from './common/bg-fill.js' -export { WeekNumberContainerProps, WeekNumberContainer } from './common/WeekNumberContainer.js' -export { MoreLinkContainer, computeEarliestSegStart } from './common/MoreLinkContainer.js' - -export type { ViewContainerProps } from './common/ViewContainer.js' -export { ViewContainer } from './common/ViewContainer.js' -export type { DatePointTransform, DateSpanTransform } from './calendar-utils.js' -export { triggerDateSelect, getDefaultEventEnd } from './calendar-utils.js' - -export { injectStyles } from './styleUtils.js' - -export { CalendarImpl } from './api/CalendarImpl.js' -export { EventImpl, buildEventApis } from './api/EventImpl.js' - -export type { ElProps } from './content-inject/ContentInjector.js' -export { buildElAttrs } from './content-inject/ContentInjector.js' -export type { InnerContainerFunc } from './content-inject/ContentContainer.js' -export { ContentContainer } from './content-inject/ContentContainer.js' -export type { CustomRendering } from './content-inject/CustomRenderingStore.js' -export { CustomRenderingStore } from './content-inject/CustomRenderingStore.js' diff --git a/fullcalendar-main/packages/core/src/locales-all.global.ts b/fullcalendar-main/packages/core/src/locales-all.global.ts deleted file mode 100644 index 8b0e5d7..0000000 --- a/fullcalendar-main/packages/core/src/locales-all.global.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { globalLocales } from './index.js' -import localesAll from './locales-all.js' - -globalLocales.push(...localesAll) diff --git a/fullcalendar-main/packages/core/src/locales-all.js.tpl b/fullcalendar-main/packages/core/src/locales-all.js.tpl deleted file mode 100644 index 35d0d22..0000000 --- a/fullcalendar-main/packages/core/src/locales-all.js.tpl +++ /dev/null @@ -1,7 +0,0 @@ -{{#each localeCodes}} -import l{{@index}} from './locales/{{this}}.js' -{{/each}} - -export default [ - {{#each localeCodes}}l{{@index}}, {{/each}} -] diff --git a/fullcalendar-main/packages/core/src/locales-all.ts b/fullcalendar-main/packages/core/src/locales-all.ts deleted file mode 100644 index 085728a..0000000 --- a/fullcalendar-main/packages/core/src/locales-all.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { LocaleInput } from './index.js' - -declare const allLocales: LocaleInput[] - -export default allLocales diff --git a/fullcalendar-main/packages/core/src/locales/af.ts b/fullcalendar-main/packages/core/src/locales/af.ts deleted file mode 100644 index 80026a0..0000000 --- a/fullcalendar-main/packages/core/src/locales/af.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'af', - week: { - dow: 1, // Maandag is die eerste dag van die week. - doy: 4, // Die week wat die 4de Januarie bevat is die eerste week van die jaar. - }, - buttonText: { - prev: 'Vorige', - next: 'Volgende', - today: 'Vandag', - year: 'Jaar', - month: 'Maand', - week: 'Week', - day: 'Dag', - list: 'Agenda', - }, - allDayText: 'Heeldag', - moreLinkText: 'Addisionele', - noEventsText: 'Daar is geen gebeurtenisse nie', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/ar-dz.ts b/fullcalendar-main/packages/core/src/locales/ar-dz.ts deleted file mode 100644 index ad2bcd4..0000000 --- a/fullcalendar-main/packages/core/src/locales/ar-dz.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'ar-dz', - week: { - dow: 0, // Sunday is the first day of the week. - doy: 4, // The week that contains Jan 1st is the first week of the year. - }, - direction: 'rtl', - buttonText: { - prev: 'السابق', - next: 'التالي', - today: 'اليوم', - year: 'سنة', - month: 'شهر', - week: 'أسبوع', - day: 'يوم', - list: 'أجندة', - }, - weekText: 'أسبوع', - allDayText: 'اليوم كله', - moreLinkText: 'أخرى', - noEventsText: 'أي أحداث لعرض', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/ar-kw.ts b/fullcalendar-main/packages/core/src/locales/ar-kw.ts deleted file mode 100644 index 75f302c..0000000 --- a/fullcalendar-main/packages/core/src/locales/ar-kw.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'ar-kw', - week: { - dow: 0, // Sunday is the first day of the week. - doy: 12, // The week that contains Jan 1st is the first week of the year. - }, - direction: 'rtl', - buttonText: { - prev: 'السابق', - next: 'التالي', - today: 'اليوم', - year: 'سنة', - month: 'شهر', - week: 'أسبوع', - day: 'يوم', - list: 'أجندة', - }, - weekText: 'أسبوع', - allDayText: 'اليوم كله', - moreLinkText: 'أخرى', - noEventsText: 'أي أحداث لعرض', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/ar-ly.ts b/fullcalendar-main/packages/core/src/locales/ar-ly.ts deleted file mode 100644 index 3e0f3bc..0000000 --- a/fullcalendar-main/packages/core/src/locales/ar-ly.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'ar-ly', - week: { - dow: 6, // Saturday is the first day of the week. - doy: 12, // The week that contains Jan 1st is the first week of the year. - }, - direction: 'rtl', - buttonText: { - prev: 'السابق', - next: 'التالي', - today: 'اليوم', - year: 'سنة', - month: 'شهر', - week: 'أسبوع', - day: 'يوم', - list: 'أجندة', - }, - weekText: 'أسبوع', - allDayText: 'اليوم كله', - moreLinkText: 'أخرى', - noEventsText: 'أي أحداث لعرض', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/ar-ma.ts b/fullcalendar-main/packages/core/src/locales/ar-ma.ts deleted file mode 100644 index 2d9f304..0000000 --- a/fullcalendar-main/packages/core/src/locales/ar-ma.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'ar-ma', - week: { - dow: 6, // Saturday is the first day of the week. - doy: 12, // The week that contains Jan 1st is the first week of the year. - }, - direction: 'rtl', - buttonText: { - prev: 'السابق', - next: 'التالي', - today: 'اليوم', - year: 'سنة', - month: 'شهر', - week: 'أسبوع', - day: 'يوم', - list: 'أجندة', - }, - weekText: 'أسبوع', - allDayText: 'اليوم كله', - moreLinkText: 'أخرى', - noEventsText: 'أي أحداث لعرض', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/ar-sa.ts b/fullcalendar-main/packages/core/src/locales/ar-sa.ts deleted file mode 100644 index 1685d2a..0000000 --- a/fullcalendar-main/packages/core/src/locales/ar-sa.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'ar-sa', - week: { - dow: 0, // Sunday is the first day of the week. - doy: 6, // The week that contains Jan 1st is the first week of the year. - }, - direction: 'rtl', - buttonText: { - prev: 'السابق', - next: 'التالي', - today: 'اليوم', - year: 'سنة', - month: 'شهر', - week: 'أسبوع', - day: 'يوم', - list: 'أجندة', - }, - weekText: 'أسبوع', - allDayText: 'اليوم كله', - moreLinkText: 'أخرى', - noEventsText: 'أي أحداث لعرض', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/ar-tn.ts b/fullcalendar-main/packages/core/src/locales/ar-tn.ts deleted file mode 100644 index 3f56ab7..0000000 --- a/fullcalendar-main/packages/core/src/locales/ar-tn.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'ar-tn', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - direction: 'rtl', - buttonText: { - prev: 'السابق', - next: 'التالي', - today: 'اليوم', - year: 'سنة', - month: 'شهر', - week: 'أسبوع', - day: 'يوم', - list: 'أجندة', - }, - weekText: 'أسبوع', - allDayText: 'اليوم كله', - moreLinkText: 'أخرى', - noEventsText: 'أي أحداث لعرض', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/ar.ts b/fullcalendar-main/packages/core/src/locales/ar.ts deleted file mode 100644 index abca90b..0000000 --- a/fullcalendar-main/packages/core/src/locales/ar.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'ar', - week: { - dow: 6, // Saturday is the first day of the week. - doy: 12, // The week that contains Jan 1st is the first week of the year. - }, - direction: 'rtl', - buttonText: { - prev: 'السابق', - next: 'التالي', - today: 'اليوم', - year: 'سنة', - month: 'شهر', - week: 'أسبوع', - day: 'يوم', - list: 'أجندة', - }, - weekText: 'أسبوع', - allDayText: 'اليوم كله', - moreLinkText: 'أخرى', - noEventsText: 'أي أحداث لعرض', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/az.ts b/fullcalendar-main/packages/core/src/locales/az.ts deleted file mode 100644 index 21007b6..0000000 --- a/fullcalendar-main/packages/core/src/locales/az.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'az', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'Əvvəl', - next: 'Sonra', - today: 'Bu Gün', - year: 'Il', - month: 'Ay', - week: 'Həftə', - day: 'Gün', - list: 'Gündəm', - }, - weekText: 'Həftə', - allDayText: 'Bütün Gün', - moreLinkText(n) { - return '+ daha çox ' + n - }, - noEventsText: 'Göstərmək üçün hadisə yoxdur', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/bg.ts b/fullcalendar-main/packages/core/src/locales/bg.ts deleted file mode 100644 index 8f4e495..0000000 --- a/fullcalendar-main/packages/core/src/locales/bg.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'bg', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'назад', - next: 'напред', - today: 'днес', - year: 'година', - month: 'Месец', - week: 'Седмица', - day: 'Ден', - list: 'График', - }, - allDayText: 'Цял ден', - moreLinkText(n) { - return '+още ' + n - }, - noEventsText: 'Няма събития за показване', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/bn.ts b/fullcalendar-main/packages/core/src/locales/bn.ts deleted file mode 100644 index 28e8b4f..0000000 --- a/fullcalendar-main/packages/core/src/locales/bn.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'bn', - week: { - dow: 0, // Sunday is the first day of the week. - doy: 6, // The week that contains Jan 1st is the first week of the year. - }, - buttonText: { - prev: 'পেছনে', - next: 'সামনে', - today: 'আজ', - year: 'বছর', - month: 'মাস', - week: 'সপ্তাহ', - day: 'দিন', - list: 'তালিকা', - }, - weekText: 'সপ্তাহ', - allDayText: 'সারাদিন', - moreLinkText(n) { - return '+অন্যান্য ' + n - }, - noEventsText: 'কোনো ইভেন্ট নেই', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/bs.ts b/fullcalendar-main/packages/core/src/locales/bs.ts deleted file mode 100644 index 0bc42dd..0000000 --- a/fullcalendar-main/packages/core/src/locales/bs.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'bs', - week: { - dow: 1, // Monday is the first day of the week. - doy: 7, // The week that contains Jan 1st is the first week of the year. - }, - buttonText: { - prev: 'Prošli', - next: 'Sljedeći', - today: 'Danas', - year: 'Godina', - month: 'Mjesec', - week: 'Sedmica', - day: 'Dan', - list: 'Raspored', - }, - weekText: 'Sed', - allDayText: 'Cijeli dan', - moreLinkText(n) { - return '+ još ' + n - }, - noEventsText: 'Nema događaja za prikazivanje', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/ca.ts b/fullcalendar-main/packages/core/src/locales/ca.ts deleted file mode 100644 index 48aad92..0000000 --- a/fullcalendar-main/packages/core/src/locales/ca.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'ca', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'Anterior', - next: 'Següent', - today: 'Avui', - year: 'Any', - month: 'Mes', - week: 'Setmana', - day: 'Dia', - list: 'Agenda', - }, - weekText: 'Set', - allDayText: 'Tot el dia', - moreLinkText: 'més', - noEventsText: 'No hi ha esdeveniments per mostrar', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/cs.ts b/fullcalendar-main/packages/core/src/locales/cs.ts deleted file mode 100644 index 707b2ef..0000000 --- a/fullcalendar-main/packages/core/src/locales/cs.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'cs', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'Dříve', - next: 'Později', - today: 'Nyní', - year: 'Rok', - month: 'Měsíc', - week: 'Týden', - day: 'Den', - list: 'Agenda', - }, - weekText: 'Týd', - allDayText: 'Celý den', - moreLinkText(n) { - return '+další: ' + n - }, - noEventsText: 'Žádné akce k zobrazení', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/cy.ts b/fullcalendar-main/packages/core/src/locales/cy.ts deleted file mode 100644 index bb9c8e4..0000000 --- a/fullcalendar-main/packages/core/src/locales/cy.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'cy', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'Blaenorol', - next: 'Nesaf', - today: 'Heddiw', - year: 'Blwyddyn', - month: 'Mis', - week: 'Wythnos', - day: 'Dydd', - list: 'Rhestr', - }, - weekText: 'Wythnos', - allDayText: 'Trwy\'r dydd', - moreLinkText: 'Mwy', - noEventsText: 'Dim digwyddiadau', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/da.ts b/fullcalendar-main/packages/core/src/locales/da.ts deleted file mode 100644 index e374937..0000000 --- a/fullcalendar-main/packages/core/src/locales/da.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'da', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'Forrige', - next: 'Næste', - today: 'I dag', - year: 'År', - month: 'Måned', - week: 'Uge', - day: 'Dag', - list: 'Agenda', - }, - weekText: 'Uge', - allDayText: 'Hele dagen', - moreLinkText: 'flere', - noEventsText: 'Ingen arrangementer at vise', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/de-at.ts b/fullcalendar-main/packages/core/src/locales/de-at.ts deleted file mode 100644 index f797edf..0000000 --- a/fullcalendar-main/packages/core/src/locales/de-at.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { LocaleInput } from '../index.js' - -function affix(buttonText: 'Tag' | 'Woche' | 'Monat' | 'Jahr'): string { - return (buttonText === 'Tag' || buttonText === 'Monat') ? 'r' : - buttonText === 'Jahr' ? 's' : '' -} - -export default { - code: 'de-at', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'Zurück', - next: 'Vor', - today: 'Heute', - year: 'Jahr', - month: 'Monat', - week: 'Woche', - day: 'Tag', - list: 'Terminübersicht', - }, - weekText: 'KW', - weekTextLong: 'Woche', - allDayText: 'Ganztägig', - moreLinkText(n) { - return '+ weitere ' + n - }, - noEventsText: 'Keine Ereignisse anzuzeigen', - buttonHints: { - prev(buttonText) { - return `Vorherige${affix(buttonText)} ${buttonText}` - }, - next(buttonText) { - return `Nächste${affix(buttonText)} ${buttonText}` - }, - today(buttonText) { - // → Heute, Diese Woche, Dieser Monat, Dieses Jahr - if (buttonText === 'Tag') { - return 'Heute' - } - return `Diese${affix(buttonText)} ${buttonText}` - }, - }, - viewHint(buttonText) { - // → Tagesansicht, Wochenansicht, Monatsansicht, Jahresansicht - const glue = buttonText === 'Woche' ? 'n' : buttonText === 'Monat' ? 's' : 'es' - return buttonText + glue + 'ansicht' - }, - navLinkHint: 'Gehe zu $0', - moreLinkHint(eventCnt: number) { - return 'Zeige ' + (eventCnt === 1 ? - 'ein weiteres Ereignis' : - eventCnt + ' weitere Ereignisse') - }, - closeHint: 'Schließen', - timeHint: 'Uhrzeit', - eventHint: 'Ereignis', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/de.ts b/fullcalendar-main/packages/core/src/locales/de.ts deleted file mode 100644 index 768d003..0000000 --- a/fullcalendar-main/packages/core/src/locales/de.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { LocaleInput } from '../index.js' - -function affix(buttonText: 'Tag' | 'Woche' | 'Monat' | 'Jahr'): string { - return (buttonText === 'Tag' || buttonText === 'Monat') ? 'r' : - buttonText === 'Jahr' ? 's' : '' -} - -export default { - code: 'de', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'Zurück', - next: 'Vor', - today: 'Heute', - year: 'Jahr', - month: 'Monat', - week: 'Woche', - day: 'Tag', - list: 'Terminübersicht', - }, - weekText: 'KW', - weekTextLong: 'Woche', - allDayText: 'Ganztägig', - moreLinkText(n) { - return '+ weitere ' + n - }, - noEventsText: 'Keine Ereignisse anzuzeigen', - buttonHints: { - prev(buttonText) { - return `Vorherige${affix(buttonText)} ${buttonText}` - }, - next(buttonText) { - return `Nächste${affix(buttonText)} ${buttonText}` - }, - today(buttonText) { - // → Heute, Diese Woche, Dieser Monat, Dieses Jahr - if (buttonText === 'Tag') { - return 'Heute' - } - return `Diese${affix(buttonText)} ${buttonText}` - }, - }, - viewHint(buttonText) { - // → Tagesansicht, Wochenansicht, Monatsansicht, Jahresansicht - const glue = buttonText === 'Woche' ? 'n' : buttonText === 'Monat' ? 's' : 'es' - return buttonText + glue + 'ansicht' - }, - navLinkHint: 'Gehe zu $0', - moreLinkHint(eventCnt: number) { - return 'Zeige ' + (eventCnt === 1 ? - 'ein weiteres Ereignis' : - eventCnt + ' weitere Ereignisse') - }, - closeHint: 'Schließen', - timeHint: 'Uhrzeit', - eventHint: 'Ereignis', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/el.ts b/fullcalendar-main/packages/core/src/locales/el.ts deleted file mode 100644 index 9b8cc98..0000000 --- a/fullcalendar-main/packages/core/src/locales/el.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'el', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4st is the first week of the year. - }, - buttonText: { - prev: 'Προηγούμενος', - next: 'Επόμενος', - today: 'Σήμερα', - year: 'Ετος', - month: 'Μήνας', - week: 'Εβδομάδα', - day: 'Ημέρα', - list: 'Ατζέντα', - }, - weekText: 'Εβδ', - allDayText: 'Ολοήμερο', - moreLinkText: 'περισσότερα', - noEventsText: 'Δεν υπάρχουν γεγονότα προς εμφάνιση', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/en-au.ts b/fullcalendar-main/packages/core/src/locales/en-au.ts deleted file mode 100644 index 220fde0..0000000 --- a/fullcalendar-main/packages/core/src/locales/en-au.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'en-au', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonHints: { - prev: 'Previous $0', - next: 'Next $0', - today: 'This $0', - }, - viewHint: '$0 view', - navLinkHint: 'Go to $0', - moreLinkHint(eventCnt: number) { - return `Show ${eventCnt} more event${eventCnt === 1 ? '' : 's'}` - }, -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/en-gb.ts b/fullcalendar-main/packages/core/src/locales/en-gb.ts deleted file mode 100644 index 391e342..0000000 --- a/fullcalendar-main/packages/core/src/locales/en-gb.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'en-gb', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonHints: { - prev: 'Previous $0', - next: 'Next $0', - today: 'This $0', - }, - viewHint: '$0 view', - navLinkHint: 'Go to $0', - moreLinkHint(eventCnt: number) { - return `Show ${eventCnt} more event${eventCnt === 1 ? '' : 's'}` - }, -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/en-nz.ts b/fullcalendar-main/packages/core/src/locales/en-nz.ts deleted file mode 100644 index 5ede023..0000000 --- a/fullcalendar-main/packages/core/src/locales/en-nz.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'en-nz', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonHints: { - prev: 'Previous $0', - next: 'Next $0', - today: 'This $0', - }, - viewHint: '$0 view', - navLinkHint: 'Go to $0', - moreLinkHint(eventCnt: number) { - return `Show ${eventCnt} more event${eventCnt === 1 ? '' : 's'}` - }, -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/eo.ts b/fullcalendar-main/packages/core/src/locales/eo.ts deleted file mode 100644 index da9e90c..0000000 --- a/fullcalendar-main/packages/core/src/locales/eo.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'eo', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'Antaŭa', - next: 'Sekva', - today: 'Hodiaŭ', - year: 'Jaro', - month: 'Monato', - week: 'Semajno', - day: 'Tago', - list: 'Tagordo', - }, - weekText: 'Sm', - allDayText: 'Tuta tago', - moreLinkText: 'pli', - noEventsText: 'Neniuj eventoj por montri', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/es-us.ts b/fullcalendar-main/packages/core/src/locales/es-us.ts deleted file mode 100644 index de8164a..0000000 --- a/fullcalendar-main/packages/core/src/locales/es-us.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'es', - week: { - dow: 0, // Sunday is the first day of the week. - doy: 6, // The week that contains Jan 1st is the first week of the year. - }, - buttonText: { - prev: 'Ant', - next: 'Sig', - today: 'Hoy', - year: 'Año', - month: 'Mes', - week: 'Semana', - day: 'Día', - list: 'Agenda', - }, - weekText: 'Sm', - allDayText: 'Todo el día', - moreLinkText: 'más', - noEventsText: 'No hay eventos para mostrar', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/es.ts b/fullcalendar-main/packages/core/src/locales/es.ts deleted file mode 100644 index 433cd80..0000000 --- a/fullcalendar-main/packages/core/src/locales/es.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'es', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'Ant', - next: 'Sig', - today: 'Hoy', - year: 'Año', - month: 'Mes', - week: 'Semana', - day: 'Día', - list: 'Agenda', - }, - buttonHints: { - prev: '$0 antes', - next: '$0 siguiente', - today(buttonText) { - return (buttonText === 'Día') ? 'Hoy' : - ((buttonText === 'Semana') ? 'Esta' : 'Este') + ' ' + buttonText.toLocaleLowerCase() - }, - }, - viewHint(buttonText) { - return 'Vista ' + (buttonText === 'Semana' ? 'de la' : 'del') + ' ' + buttonText.toLocaleLowerCase() - }, - weekText: 'Sm', - weekTextLong: 'Semana', - allDayText: 'Todo el día', - moreLinkText: 'más', - moreLinkHint(eventCnt) { - return `Mostrar ${eventCnt} eventos más` - }, - noEventsText: 'No hay eventos para mostrar', - navLinkHint: 'Ir al $0', - closeHint: 'Cerrar', - timeHint: 'La hora', - eventHint: 'Evento', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/et.ts b/fullcalendar-main/packages/core/src/locales/et.ts deleted file mode 100644 index 1aaecf7..0000000 --- a/fullcalendar-main/packages/core/src/locales/et.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'et', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'Eelnev', - next: 'Järgnev', - today: 'Täna', - year: 'Aasta', - month: 'Kuu', - week: 'Nädal', - day: 'Päev', - list: 'Päevakord', - }, - weekText: 'näd', - allDayText: 'Kogu päev', - moreLinkText(n) { - return '+ veel ' + n - }, - noEventsText: 'Kuvamiseks puuduvad sündmused', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/eu.ts b/fullcalendar-main/packages/core/src/locales/eu.ts deleted file mode 100644 index 7561527..0000000 --- a/fullcalendar-main/packages/core/src/locales/eu.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'eu', - week: { - dow: 1, // Monday is the first day of the week. - doy: 7, // The week that contains Jan 1st is the first week of the year. - }, - buttonText: { - prev: 'Aur', - next: 'Hur', - today: 'Gaur', - year: 'Urtea', - month: 'Hilabetea', - week: 'Astea', - day: 'Eguna', - list: 'Agenda', - }, - weekText: 'As', - allDayText: 'Egun osoa', - moreLinkText: 'gehiago', - noEventsText: 'Ez dago ekitaldirik erakusteko', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/fa.ts b/fullcalendar-main/packages/core/src/locales/fa.ts deleted file mode 100644 index b4a2dcb..0000000 --- a/fullcalendar-main/packages/core/src/locales/fa.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'fa', - week: { - dow: 6, // Saturday is the first day of the week. - doy: 12, // The week that contains Jan 1st is the first week of the year. - }, - direction: 'rtl', - buttonText: { - prev: 'قبلی', - next: 'بعدی', - today: 'امروز', - year: 'سال', - month: 'ماه', - week: 'هفته', - day: 'روز', - list: 'برنامه', - }, - weekText: 'هف', - allDayText: 'تمام روز', - moreLinkText(n) { - return 'بیش از ' + n - }, - noEventsText: 'هیچ رویدادی به نمایش', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/fi.ts b/fullcalendar-main/packages/core/src/locales/fi.ts deleted file mode 100644 index f77f401..0000000 --- a/fullcalendar-main/packages/core/src/locales/fi.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'fi', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'Edellinen', - next: 'Seuraava', - today: 'Tänään', - year: 'Vuosi', - month: 'Kuukausi', - week: 'Viikko', - day: 'Päivä', - list: 'Tapahtumat', - }, - weekText: 'Vk', - allDayText: 'Koko päivä', - moreLinkText: 'lisää', - noEventsText: 'Ei näytettäviä tapahtumia', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/fr-ca.ts b/fullcalendar-main/packages/core/src/locales/fr-ca.ts deleted file mode 100644 index 85864e6..0000000 --- a/fullcalendar-main/packages/core/src/locales/fr-ca.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'fr', - buttonText: { - prev: 'Précédent', - next: 'Suivant', - today: 'Aujourd\'hui', - year: 'Année', - month: 'Mois', - week: 'Semaine', - day: 'Jour', - list: 'Mon planning', - }, - weekText: 'Sem.', - allDayText: 'Toute la journée', - moreLinkText: 'en plus', - noEventsText: 'Aucun évènement à afficher', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/fr-ch.ts b/fullcalendar-main/packages/core/src/locales/fr-ch.ts deleted file mode 100644 index 52a8293..0000000 --- a/fullcalendar-main/packages/core/src/locales/fr-ch.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'fr-ch', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'Précédent', - next: 'Suivant', - today: 'Courant', - year: 'Année', - month: 'Mois', - week: 'Semaine', - day: 'Jour', - list: 'Mon planning', - }, - weekText: 'Sm', - allDayText: 'Toute la journée', - moreLinkText: 'en plus', - noEventsText: 'Aucun évènement à afficher', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/fr.ts b/fullcalendar-main/packages/core/src/locales/fr.ts deleted file mode 100644 index 7204925..0000000 --- a/fullcalendar-main/packages/core/src/locales/fr.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'fr', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'Précédent', - next: 'Suivant', - today: 'Aujourd\'hui', - year: 'Année', - month: 'Mois', - week: 'Semaine', - day: 'Jour', - list: 'Planning', - }, - weekText: 'Sem.', - weekTextLong: 'Semaine', - allDayText: 'Toute la journée', - moreLinkText: 'en plus', - noEventsText: 'Aucun évènement à afficher', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/gl.ts b/fullcalendar-main/packages/core/src/locales/gl.ts deleted file mode 100644 index ef7b914..0000000 --- a/fullcalendar-main/packages/core/src/locales/gl.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'gl', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'Ant', - next: 'Seg', - today: 'Hoxe', - year: 'Ano', - month: 'Mes', - week: 'Semana', - day: 'Día', - list: 'Axenda', - }, - buttonHints: { - prev: '$0 antes', - next: '$0 seguinte', - today(buttonText) { - return (buttonText === 'Día') ? 'Hoxe' : - ((buttonText === 'Semana') ? 'Esta' : 'Este') + ' ' + buttonText.toLocaleLowerCase() - }, - }, - viewHint(buttonText) { - return 'Vista ' + (buttonText === 'Semana' ? 'da' : 'do') + ' ' + buttonText.toLocaleLowerCase() - }, - weekText: 'Sm', - weekTextLong: 'Semana', - allDayText: 'Todo o día', - moreLinkText: 'máis', - moreLinkHint(eventCnt) { - return `Amosar ${eventCnt} eventos máis` - }, - noEventsText: 'Non hai eventos para amosar', - navLinkHint: 'Ir ao $0', - closeHint: 'Pechar', - timeHint: 'A hora', - eventHint: 'Evento', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/global.js.tpl b/fullcalendar-main/packages/core/src/locales/global.js.tpl deleted file mode 100644 index 58cbc3b..0000000 --- a/fullcalendar-main/packages/core/src/locales/global.js.tpl +++ /dev/null @@ -1,4 +0,0 @@ -import { globalLocales } from '../index.js' -import locale from './{{localeCode}}.js' - -globalLocales.push(locale); diff --git a/fullcalendar-main/packages/core/src/locales/he.ts b/fullcalendar-main/packages/core/src/locales/he.ts deleted file mode 100644 index f65dcdc..0000000 --- a/fullcalendar-main/packages/core/src/locales/he.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'he', - direction: 'rtl', - buttonText: { - prev: 'הקודם', - next: 'הבא', - today: 'היום', - year: 'שנה', - month: 'חודש', - week: 'שבוע', - day: 'יום', - list: 'סדר יום', - }, - allDayText: 'כל היום', - moreLinkText: 'נוספים', - noEventsText: 'אין אירועים להצגה', - weekText: 'שבוע', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/hi.ts b/fullcalendar-main/packages/core/src/locales/hi.ts deleted file mode 100644 index 3b5cedb..0000000 --- a/fullcalendar-main/packages/core/src/locales/hi.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'hi', - week: { - dow: 0, // Sunday is the first day of the week. - doy: 6, // The week that contains Jan 1st is the first week of the year. - }, - buttonText: { - prev: 'पिछला', - next: 'अगला', - today: 'आज', - year: 'वर्ष', - month: 'महीना', - week: 'सप्ताह', - day: 'दिन', - list: 'कार्यसूची', - }, - weekText: 'हफ्ता', - allDayText: 'सभी दिन', - moreLinkText(n) { - return '+अधिक ' + n - }, - noEventsText: 'कोई घटनाओं को प्रदर्शित करने के लिए', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/hr.ts b/fullcalendar-main/packages/core/src/locales/hr.ts deleted file mode 100644 index e8af9b2..0000000 --- a/fullcalendar-main/packages/core/src/locales/hr.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'hr', - week: { - dow: 1, // Monday is the first day of the week. - doy: 7, // The week that contains Jan 1st is the first week of the year. - }, - buttonText: { - prev: 'Prijašnji', - next: 'Sljedeći', - today: 'Danas', - year: 'Godina', - month: 'Mjesec', - week: 'Tjedan', - day: 'Dan', - list: 'Raspored', - }, - weekText: 'Tje', - allDayText: 'Cijeli dan', - moreLinkText(n) { - return '+ još ' + n - }, - noEventsText: 'Nema događaja za prikaz', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/hu.ts b/fullcalendar-main/packages/core/src/locales/hu.ts deleted file mode 100644 index 2d2248e..0000000 --- a/fullcalendar-main/packages/core/src/locales/hu.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'hu', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'vissza', - next: 'előre', - today: 'ma', - year: 'Év', - month: 'Hónap', - week: 'Hét', - day: 'Nap', - list: 'Lista', - }, - weekText: 'Hét', - allDayText: 'Egész nap', - moreLinkText: 'további', - noEventsText: 'Nincs megjeleníthető esemény', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/hy-am.ts b/fullcalendar-main/packages/core/src/locales/hy-am.ts deleted file mode 100644 index d4a6338..0000000 --- a/fullcalendar-main/packages/core/src/locales/hy-am.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'hy-am', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'Նախորդ', - next: 'Հաջորդ', - today: 'Այսօր', - year: 'Տարի', - month: 'Ամիս', - week: 'Շաբաթ', - day: 'Օր', - list: 'Օրվա ցուցակ', - }, - weekText: 'Շաբ', - allDayText: 'Ամբողջ օր', - moreLinkText(n) { - return '+ ևս ' + n - }, - noEventsText: 'Բացակայում է իրադարձությունը ցուցադրելու', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/id.ts b/fullcalendar-main/packages/core/src/locales/id.ts deleted file mode 100644 index 33bcdb9..0000000 --- a/fullcalendar-main/packages/core/src/locales/id.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'id', - week: { - dow: 1, // Monday is the first day of the week. - doy: 7, // The week that contains Jan 1st is the first week of the year. - }, - buttonText: { - prev: 'mundur', - next: 'maju', - today: 'hari ini', - year: 'Tahun', - month: 'Bulan', - week: 'Minggu', - day: 'Hari', - list: 'Agenda', - }, - weekText: 'Mg', - allDayText: 'Sehari penuh', - moreLinkText: 'lebih', - noEventsText: 'Tidak ada acara untuk ditampilkan', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/is.ts b/fullcalendar-main/packages/core/src/locales/is.ts deleted file mode 100644 index d88b782..0000000 --- a/fullcalendar-main/packages/core/src/locales/is.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'is', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'Fyrri', - next: 'Næsti', - today: 'Í dag', - year: 'Ár', - month: 'Mánuður', - week: 'Vika', - day: 'Dagur', - list: 'Dagskrá', - }, - weekText: 'Vika', - allDayText: 'Allan daginn', - moreLinkText: 'meira', - noEventsText: 'Engir viðburðir til að sýna', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/it.ts b/fullcalendar-main/packages/core/src/locales/it.ts deleted file mode 100644 index 546d47c..0000000 --- a/fullcalendar-main/packages/core/src/locales/it.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'it', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'Prec', - next: 'Succ', - today: 'Oggi', - year: 'Anno', - month: 'Mese', - week: 'Settimana', - day: 'Giorno', - list: 'Agenda', - }, - weekText: 'Sm', - allDayText: 'Tutto il giorno', - moreLinkText(n) { - return '+altri ' + n - }, - noEventsText: 'Non ci sono eventi da visualizzare', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/ja.ts b/fullcalendar-main/packages/core/src/locales/ja.ts deleted file mode 100644 index 05401c6..0000000 --- a/fullcalendar-main/packages/core/src/locales/ja.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'ja', - buttonText: { - prev: '前', - next: '次', - today: '今日', - year: '年', - month: '月', - week: '週', - day: '日', - list: '予定リスト', - }, - weekText: '週', - allDayText: '終日', - moreLinkText(n) { - return '他 ' + n + ' 件' - }, - noEventsText: '表示する予定はありません', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/ka.ts b/fullcalendar-main/packages/core/src/locales/ka.ts deleted file mode 100644 index 9c4c798..0000000 --- a/fullcalendar-main/packages/core/src/locales/ka.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'ka', - week: { - dow: 1, - doy: 7, - }, - buttonText: { - prev: 'წინა', - next: 'შემდეგი', - today: 'დღეს', - year: 'წელიწადი', - month: 'თვე', - week: 'კვირა', - day: 'დღე', - list: 'დღის წესრიგი', - }, - weekText: 'კვ', - allDayText: 'მთელი დღე', - moreLinkText(n) { - return '+ კიდევ ' + n - }, - noEventsText: 'ღონისძიებები არ არის', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/kk.ts b/fullcalendar-main/packages/core/src/locales/kk.ts deleted file mode 100644 index 4780550..0000000 --- a/fullcalendar-main/packages/core/src/locales/kk.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'kk', - week: { - dow: 1, // Monday is the first day of the week. - doy: 7, // The week that contains Jan 1st is the first week of the year. - }, - buttonText: { - prev: 'Алдыңғы', - next: 'Келесі', - today: 'Бүгін', - year: 'Жыл', - month: 'Ай', - week: 'Апта', - day: 'Күн', - list: 'Күн тәртібі', - }, - weekText: 'Не', - allDayText: 'Күні бойы', - moreLinkText(n) { - return '+ тағы ' + n - }, - noEventsText: 'Көрсету үшін оқиғалар жоқ', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/km.ts b/fullcalendar-main/packages/core/src/locales/km.ts deleted file mode 100644 index ba33d48..0000000 --- a/fullcalendar-main/packages/core/src/locales/km.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'km', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'មុន', - next: 'បន្ទាប់', - today: 'ថ្ងៃនេះ', - year: 'ឆ្នាំ', - month: 'ខែ', - week: 'សប្តាហ៍', - day: 'ថ្ងៃ', - list: 'បញ្ជី', - }, - weekText: 'សប្តាហ៍', - allDayText: 'ពេញមួយថ្ងៃ', - moreLinkText: 'ច្រើនទៀត', - noEventsText: 'គ្មានព្រឹត្តិការណ៍ត្រូវបង្ហាញ', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/ko.ts b/fullcalendar-main/packages/core/src/locales/ko.ts deleted file mode 100644 index 6329f39..0000000 --- a/fullcalendar-main/packages/core/src/locales/ko.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'ko', - buttonText: { - prev: '이전달', - next: '다음달', - today: '오늘', - year: '년도', - month: '월', - week: '주', - day: '일', - list: '일정목록', - }, - weekText: '주', - allDayText: '종일', - moreLinkText: '개', - noEventsText: '일정이 없습니다', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/ku.ts b/fullcalendar-main/packages/core/src/locales/ku.ts deleted file mode 100644 index 07312c1..0000000 --- a/fullcalendar-main/packages/core/src/locales/ku.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'ku', - week: { - dow: 6, // Saturday is the first day of the week. - doy: 12, // The week that contains Jan 1st is the first week of the year. - }, - direction: 'rtl', - buttonText: { - prev: 'پێشتر', - next: 'دواتر', - today: 'ئەمڕو', - year: 'ساڵ', - month: 'مانگ', - week: 'هەفتە', - day: 'ڕۆژ', - list: 'بەرنامە', - }, - weekText: 'هەفتە', - allDayText: 'هەموو ڕۆژەکە', - moreLinkText: 'زیاتر', - noEventsText: 'هیچ ڕووداوێك نیە', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/lb.ts b/fullcalendar-main/packages/core/src/locales/lb.ts deleted file mode 100644 index 1005132..0000000 --- a/fullcalendar-main/packages/core/src/locales/lb.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'lb', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'Zréck', - next: 'Weider', - today: 'Haut', - year: 'Joer', - month: 'Mount', - week: 'Woch', - day: 'Dag', - list: 'Terminiwwersiicht', - }, - weekText: 'W', - allDayText: 'Ganzen Dag', - moreLinkText: 'méi', - noEventsText: 'Nee Evenementer ze affichéieren', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/lt.ts b/fullcalendar-main/packages/core/src/locales/lt.ts deleted file mode 100644 index 5a87f2c..0000000 --- a/fullcalendar-main/packages/core/src/locales/lt.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'lt', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'Atgal', - next: 'Pirmyn', - today: 'Šiandien', - year: 'Metai', - month: 'Mėnuo', - week: 'Savaitė', - day: 'Diena', - list: 'Darbotvarkė', - }, - weekText: 'SAV', - allDayText: 'Visą dieną', - moreLinkText: 'daugiau', - noEventsText: 'Nėra įvykių rodyti', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/lv.ts b/fullcalendar-main/packages/core/src/locales/lv.ts deleted file mode 100644 index 21f8d71..0000000 --- a/fullcalendar-main/packages/core/src/locales/lv.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'lv', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'Iepr.', - next: 'Nāk.', - today: 'Šodien', - year: 'Gads', - month: 'Mēnesis', - week: 'Nedēļa', - day: 'Diena', - list: 'Dienas kārtība', - }, - weekText: 'Ned.', - allDayText: 'Visu dienu', - moreLinkText(n) { - return '+vēl ' + n - }, - noEventsText: 'Nav notikumu', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/mk.ts b/fullcalendar-main/packages/core/src/locales/mk.ts deleted file mode 100644 index c25039f..0000000 --- a/fullcalendar-main/packages/core/src/locales/mk.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'mk', - buttonText: { - prev: 'претходно', - next: 'следно', - today: 'Денес', - year: 'година', - month: 'Месец', - week: 'Недела', - day: 'Ден', - list: 'График', - }, - weekText: 'Сед', - allDayText: 'Цел ден', - moreLinkText(n) { - return '+повеќе ' + n - }, - noEventsText: 'Нема настани за прикажување', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/ms.ts b/fullcalendar-main/packages/core/src/locales/ms.ts deleted file mode 100644 index df3e25a..0000000 --- a/fullcalendar-main/packages/core/src/locales/ms.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'ms', - week: { - dow: 1, // Monday is the first day of the week. - doy: 7, // The week that contains Jan 1st is the first week of the year. - }, - buttonText: { - prev: 'Sebelum', - next: 'Selepas', - today: 'hari ini', - year: 'Tahun', - month: 'Bulan', - week: 'Minggu', - day: 'Hari', - list: 'Agenda', - }, - weekText: 'Mg', - allDayText: 'Sepanjang hari', - moreLinkText(n) { - return 'masih ada ' + n + ' acara' - }, - noEventsText: 'Tiada peristiwa untuk dipaparkan', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/nb.ts b/fullcalendar-main/packages/core/src/locales/nb.ts deleted file mode 100644 index 29bfc93..0000000 --- a/fullcalendar-main/packages/core/src/locales/nb.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'nb', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'Forrige', - next: 'Neste', - today: 'I dag', - year: 'År', - month: 'Måned', - week: 'Uke', - day: 'Dag', - list: 'Agenda', - }, - weekText: 'Uke', - weekTextLong: 'Uke', - allDayText: 'Hele dagen', - moreLinkText: 'til', - noEventsText: 'Ingen hendelser å vise', - buttonHints: { - prev: 'Forrige $0', - next: 'Neste $0', - today: 'Nåværende $0', - }, - viewHint: '$0 visning', - navLinkHint: 'Gå til $0', - moreLinkHint(eventCnt: number) { - return `Vis ${eventCnt} flere hendelse${eventCnt === 1 ? '' : 'r'}` - }, -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/ne.ts b/fullcalendar-main/packages/core/src/locales/ne.ts deleted file mode 100644 index 4461fed..0000000 --- a/fullcalendar-main/packages/core/src/locales/ne.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'ne', // code for nepal - week: { - dow: 7, // Sunday is the first day of the week. - doy: 1, // The week that contains Jan 1st is the first week of the year. - }, - buttonText: { - prev: 'अघिल्लो', - next: 'अर्को', - today: 'आज', - year: 'वर्ष', - month: 'महिना', - week: 'हप्ता', - day: 'दिन', - list: 'सूची', - }, - weekText: 'हप्ता', - allDayText: 'दिनभरि', - moreLinkText: 'थप लिंक', - noEventsText: 'देखाउनको लागि कुनै घटनाहरू छैनन्', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/nl.ts b/fullcalendar-main/packages/core/src/locales/nl.ts deleted file mode 100644 index 58e6779..0000000 --- a/fullcalendar-main/packages/core/src/locales/nl.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'nl', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'Vorige', - next: 'Volgende', - today: 'Vandaag', - year: 'Jaar', - month: 'Maand', - week: 'Week', - day: 'Dag', - list: 'Lijst', - }, - allDayText: 'Hele dag', - moreLinkText: 'extra', - noEventsText: 'Geen evenementen om te laten zien', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/nn.ts b/fullcalendar-main/packages/core/src/locales/nn.ts deleted file mode 100644 index a8edf1c..0000000 --- a/fullcalendar-main/packages/core/src/locales/nn.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'nn', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'Førre', - next: 'Neste', - today: 'I dag', - year: 'År', - month: 'Månad', - week: 'Veke', - day: 'Dag', - list: 'Agenda', - }, - weekText: 'Veke', - allDayText: 'Heile dagen', - moreLinkText: 'til', - noEventsText: 'Ingen hendelser å vise', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/pl.ts b/fullcalendar-main/packages/core/src/locales/pl.ts deleted file mode 100644 index bfa83ba..0000000 --- a/fullcalendar-main/packages/core/src/locales/pl.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'pl', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'Poprzedni', - next: 'Następny', - today: 'Dziś', - year: 'Rok', - month: 'Miesiąc', - week: 'Tydzień', - day: 'Dzień', - list: 'Plan dnia', - }, - weekText: 'Tydz', - allDayText: 'Cały dzień', - moreLinkText: 'więcej', - noEventsText: 'Brak wydarzeń do wyświetlenia', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/pt-br.ts b/fullcalendar-main/packages/core/src/locales/pt-br.ts deleted file mode 100644 index 01894d9..0000000 --- a/fullcalendar-main/packages/core/src/locales/pt-br.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'pt-br', - buttonText: { - prev: 'Anterior', - next: 'Próximo', - prevYear: 'Ano anterior', - nextYear: 'Próximo ano', - year: 'Ano', - today: 'Hoje', - month: 'Mês', - week: 'Semana', - day: 'Dia', - list: 'Lista', - }, - buttonHints: { - prev: '$0 Anterior', - next: 'Próximo $0', - today(buttonText) { - return (buttonText === 'Dia') ? 'Hoje' : - ((buttonText === 'Semana') ? 'Esta' : 'Este') + ' ' + buttonText.toLocaleLowerCase() - }, - }, - viewHint(buttonText) { - return 'Visualizar ' + (buttonText === 'Semana' ? 'a' : 'o') + ' ' + buttonText.toLocaleLowerCase() - }, - weekText: 'Sm', - weekTextLong: 'Semana', - allDayText: 'dia inteiro', - moreLinkText(n) { - return 'mais +' + n - }, - moreLinkHint(eventCnt) { - return `Mostrar mais ${eventCnt} eventos` - }, - noEventsText: 'Não há eventos para mostrar', - navLinkHint: 'Ir para $0', - closeHint: 'Fechar', - timeHint: 'A hora', - eventHint: 'Evento', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/pt.ts b/fullcalendar-main/packages/core/src/locales/pt.ts deleted file mode 100644 index 75b1f92..0000000 --- a/fullcalendar-main/packages/core/src/locales/pt.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'pt', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'Anterior', - next: 'Seguinte', - today: 'Hoje', - year: 'Ano', - month: 'Mês', - week: 'Semana', - day: 'Dia', - list: 'Agenda', - }, - weekText: 'Sem', - allDayText: 'Todo o dia', - moreLinkText: 'mais', - noEventsText: 'Não há eventos para mostrar', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/ro.ts b/fullcalendar-main/packages/core/src/locales/ro.ts deleted file mode 100644 index 92c7438..0000000 --- a/fullcalendar-main/packages/core/src/locales/ro.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'ro', - week: { - dow: 1, // Monday is the first day of the week. - doy: 7, // The week that contains Jan 1st is the first week of the year. - }, - buttonText: { - prev: 'precedentă', - next: 'următoare', - today: 'Azi', - year: 'An', - month: 'Lună', - week: 'Săptămână', - day: 'Zi', - list: 'Agendă', - }, - weekText: 'Săpt', - allDayText: 'Toată ziua', - moreLinkText(n) { - return '+alte ' + n - }, - noEventsText: 'Nu există evenimente de afișat', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/ru.ts b/fullcalendar-main/packages/core/src/locales/ru.ts deleted file mode 100644 index dfe113d..0000000 --- a/fullcalendar-main/packages/core/src/locales/ru.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'ru', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'Пред', - next: 'След', - today: 'Сегодня', - year: 'Год', - month: 'Месяц', - week: 'Неделя', - day: 'День', - list: 'Повестка дня', - }, - weekText: 'Нед', - allDayText: 'Весь день', - moreLinkText(n) { - return '+ ещё ' + n - }, - noEventsText: 'Нет событий для отображения', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/si-lk.ts b/fullcalendar-main/packages/core/src/locales/si-lk.ts deleted file mode 100644 index 539c02f..0000000 --- a/fullcalendar-main/packages/core/src/locales/si-lk.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'si-lk', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'පෙර', - next: 'පසු', - today: 'අද', - year: 'අවුරුදු', - month: 'මාසය', - week: 'සතිය', - day: 'දවස', - list: 'ලැයිස්තුව', - }, - weekText: 'සති', - allDayText: 'සියලු', - moreLinkText: 'තවත්', - noEventsText: 'මුකුත් නැත', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/sk.ts b/fullcalendar-main/packages/core/src/locales/sk.ts deleted file mode 100644 index 80cdb34..0000000 --- a/fullcalendar-main/packages/core/src/locales/sk.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'sk', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'Predchádzajúci', - next: 'Nasledujúci', - today: 'Dnes', - year: 'Rok', - month: 'Mesiac', - week: 'Týždeň', - day: 'Deň', - list: 'Rozvrh', - }, - weekText: 'Ty', - allDayText: 'Celý deň', - moreLinkText(n) { - return '+ďalšie: ' + n - }, - noEventsText: 'Žiadne akcie na zobrazenie', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/sl.ts b/fullcalendar-main/packages/core/src/locales/sl.ts deleted file mode 100644 index 551f501..0000000 --- a/fullcalendar-main/packages/core/src/locales/sl.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'sl', - week: { - dow: 1, // Monday is the first day of the week. - doy: 7, // The week that contains Jan 1st is the first week of the year. - }, - buttonText: { - prev: 'Prejšnji', - next: 'Naslednji', - today: 'Trenutni', - year: 'Leto', - month: 'Mesec', - week: 'Teden', - day: 'Dan', - list: 'Dnevni red', - }, - weekText: 'Teden', - allDayText: 'Ves dan', - moreLinkText: 'več', - noEventsText: 'Ni dogodkov za prikaz', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/sm.ts b/fullcalendar-main/packages/core/src/locales/sm.ts deleted file mode 100644 index 747c36d..0000000 --- a/fullcalendar-main/packages/core/src/locales/sm.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'sm', - buttonText: { - prev: 'Talu ai', - next: 'Mulimuli atu', - today: 'Aso nei', - year: 'Tausaga', - month: 'Masina', - week: 'Vaiaso', - day: 'Aso', - list: 'Faasologa', - }, - weekText: 'Vaiaso', - allDayText: 'Aso atoa', - moreLinkText: 'sili atu', - noEventsText: 'Leai ni mea na tutupu', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/sq.ts b/fullcalendar-main/packages/core/src/locales/sq.ts deleted file mode 100644 index a30abc0..0000000 --- a/fullcalendar-main/packages/core/src/locales/sq.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'sq', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'mbrapa', - next: 'Përpara', - today: 'Sot', - year: 'Viti', - month: 'Muaj', - week: 'Javë', - day: 'Ditë', - list: 'Listë', - }, - weekText: 'Ja', - allDayText: 'Gjithë ditën', - moreLinkText(n) { - return '+më tepër ' + n - }, - noEventsText: 'Nuk ka evente për të shfaqur', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/sr-cyrl.ts b/fullcalendar-main/packages/core/src/locales/sr-cyrl.ts deleted file mode 100644 index 3086f61..0000000 --- a/fullcalendar-main/packages/core/src/locales/sr-cyrl.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'sr-cyrl', - week: { - dow: 1, // Monday is the first day of the week. - doy: 7, // The week that contains Jan 1st is the first week of the year. - }, - buttonText: { - prev: 'Претходна', - next: 'следећи', - today: 'Данас', - year: 'Година', - month: 'Месец', - week: 'Недеља', - day: 'Дан', - list: 'Планер', - }, - weekText: 'Сед', - allDayText: 'Цео дан', - moreLinkText(n) { - return '+ још ' + n - }, - noEventsText: 'Нема догађаја за приказ', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/sr.ts b/fullcalendar-main/packages/core/src/locales/sr.ts deleted file mode 100644 index 6e1cafc..0000000 --- a/fullcalendar-main/packages/core/src/locales/sr.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'sr', - week: { - dow: 1, // Monday is the first day of the week. - doy: 7, // The week that contains Jan 1st is the first week of the year. - }, - buttonText: { - prev: 'Prethodna', - next: 'Sledeći', - today: 'Danas', - year: 'Godina', - month: 'Mеsеc', - week: 'Nеdеlja', - day: 'Dan', - list: 'Planеr', - }, - weekText: 'Sed', - allDayText: 'Cеo dan', - moreLinkText(n) { - return '+ još ' + n - }, - noEventsText: 'Nеma događaja za prikaz', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/sv.ts b/fullcalendar-main/packages/core/src/locales/sv.ts deleted file mode 100644 index a6f26fa..0000000 --- a/fullcalendar-main/packages/core/src/locales/sv.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'sv', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'Förra', - next: 'Nästa', - today: 'Idag', - year: 'År', - month: 'Månad', - week: 'Vecka', - day: 'Dag', - list: 'Program', - }, - buttonHints: { - prev(buttonText) { - return `Föregående ${buttonText.toLocaleLowerCase()}` - }, - next(buttonText) { - return `Nästa ${buttonText.toLocaleLowerCase()}` - }, - today(buttonText) { - return (buttonText === 'Program' ? 'Detta' : 'Denna') + ' ' + buttonText.toLocaleLowerCase() - }, - }, - viewHint: '$0 vy', - navLinkHint: 'Gå till $0', - moreLinkHint(eventCnt: number) { - return `Visa ytterligare ${eventCnt} händelse${eventCnt === 1 ? '' : 'r'}` - }, - weekText: 'v.', - weekTextLong: 'Vecka', - allDayText: 'Heldag', - moreLinkText: 'till', - noEventsText: 'Inga händelser att visa', - closeHint: 'Stäng', - timeHint: 'Klockan', - eventHint: 'Händelse', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/ta-in.ts b/fullcalendar-main/packages/core/src/locales/ta-in.ts deleted file mode 100644 index ee3a479..0000000 --- a/fullcalendar-main/packages/core/src/locales/ta-in.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'ta-in', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'முந்தைய', - next: 'அடுத்தது', - today: 'இன்று', - year: 'ஆண்டு', - month: 'மாதம்', - week: 'வாரம்', - day: 'நாள்', - list: 'தினசரி அட்டவணை', - }, - weekText: 'வாரம்', - allDayText: 'நாள் முழுவதும்', - moreLinkText(n) { - return '+ மேலும் ' + n - }, - noEventsText: 'காண்பிக்க நிகழ்வுகள் இல்லை', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/th.ts b/fullcalendar-main/packages/core/src/locales/th.ts deleted file mode 100644 index 4c3bb1d..0000000 --- a/fullcalendar-main/packages/core/src/locales/th.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'th', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'ก่อนหน้า', - next: 'ถัดไป', - prevYear: 'ปีก่อนหน้า', - nextYear: 'ปีถัดไป', - year: 'ปี', - today: 'วันนี้', - month: 'เดือน', - week: 'สัปดาห์', - day: 'วัน', - list: 'กำหนดการ', - }, - weekText: 'สัปดาห์', - allDayText: 'ตลอดวัน', - moreLinkText: 'เพิ่มเติม', - noEventsText: 'ไม่มีกิจกรรมที่จะแสดง', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/tr.ts b/fullcalendar-main/packages/core/src/locales/tr.ts deleted file mode 100644 index f02dc59..0000000 --- a/fullcalendar-main/packages/core/src/locales/tr.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'tr', - week: { - dow: 1, // Monday is the first day of the week. - doy: 7, // The week that contains Jan 1st is the first week of the year. - }, - buttonText: { - prev: 'geri', - next: 'ileri', - today: 'bugün', - year: 'Yıl', - month: 'Ay', - week: 'Hafta', - day: 'Gün', - list: 'Ajanda', - }, - weekText: 'Hf', - allDayText: 'Tüm gün', - moreLinkText: 'daha fazla', - noEventsText: 'Gösterilecek etkinlik yok', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/ug.ts b/fullcalendar-main/packages/core/src/locales/ug.ts deleted file mode 100644 index 83213dc..0000000 --- a/fullcalendar-main/packages/core/src/locales/ug.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'ug', - buttonText: { - prev: 'ئالدىنقى', - next: 'كېيىنكى', - today: 'بۈگۈن', - year: 'يىل', - month: 'ئاي', - week: 'ھەپتە', - day: 'كۈن', - list: 'كۈنتەرتىپ', - }, - allDayText: 'پۈتۈن كۈن', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/uk.ts b/fullcalendar-main/packages/core/src/locales/uk.ts deleted file mode 100644 index f7a72a8..0000000 --- a/fullcalendar-main/packages/core/src/locales/uk.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'uk', - week: { - dow: 1, // Monday is the first day of the week. - doy: 7, // The week that contains Jan 1st is the first week of the year. - }, - buttonText: { - prev: 'Попередній', - next: 'далі', - today: 'Сьогодні', - year: 'рік', - month: 'Місяць', - week: 'Тиждень', - day: 'День', - list: 'Порядок денний', - }, - weekText: 'Тиж', - allDayText: 'Увесь день', - moreLinkText(n) { - return '+ще ' + n + '...' - }, - noEventsText: 'Немає подій для відображення', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/uz-cy.ts b/fullcalendar-main/packages/core/src/locales/uz-cy.ts deleted file mode 100644 index 944acd2..0000000 --- a/fullcalendar-main/packages/core/src/locales/uz-cy.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'uz-cy', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'Олин', - next: 'Кейин', - today: 'Бугун', - month: 'Ой', - week: 'Ҳафта', - day: 'Кун', - list: 'Кун тартиби', - }, - weekText: 'Ҳафта', - allDayText: 'Кун бўйича', - moreLinkText(n) { - return '+ яна ' + n - }, - noEventsText: 'Кўрсатиш учун воқеалар йўқ', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/uz.ts b/fullcalendar-main/packages/core/src/locales/uz.ts deleted file mode 100644 index 394e2ad..0000000 --- a/fullcalendar-main/packages/core/src/locales/uz.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'uz', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'Oldingi', - next: 'Keyingi', - today: 'Bugun', - year: 'Yil', - month: 'Oy', - week: 'Xafta', - day: 'Kun', - list: 'Kun tartibi', - }, - allDayText: 'Kun bo\'yi', - moreLinkText(n) { - return '+ yana ' + n - }, - noEventsText: 'Ko\'rsatish uchun voqealar yo\'q', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/vi.ts b/fullcalendar-main/packages/core/src/locales/vi.ts deleted file mode 100644 index 01eca81..0000000 --- a/fullcalendar-main/packages/core/src/locales/vi.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'vi', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: 'Trước', - next: 'Tiếp', - today: 'Hôm nay', - year: 'Năm', - month: 'Tháng', - week: 'Tuần', - day: 'Ngày', - list: 'Lịch biểu', - }, - weekText: 'Tu', - allDayText: 'Cả ngày', - moreLinkText(n) { - return '+ thêm ' + n - }, - noEventsText: 'Không có sự kiện để hiển thị', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/zh-cn.ts b/fullcalendar-main/packages/core/src/locales/zh-cn.ts deleted file mode 100644 index 4b489ad..0000000 --- a/fullcalendar-main/packages/core/src/locales/zh-cn.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'zh-cn', - week: { - // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效 - dow: 1, // Monday is the first day of the week. - doy: 4, // The week that contains Jan 4th is the first week of the year. - }, - buttonText: { - prev: '上月', - next: '下月', - today: '今天', - year: '年', - month: '月', - week: '周', - day: '日', - list: '日程', - }, - weekText: '周', - allDayText: '全天', - moreLinkText(n) { - return '另外 ' + n + ' 个' - }, - noEventsText: '没有事件显示', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/locales/zh-tw.ts b/fullcalendar-main/packages/core/src/locales/zh-tw.ts deleted file mode 100644 index c3d6c91..0000000 --- a/fullcalendar-main/packages/core/src/locales/zh-tw.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { LocaleInput } from '../index.js' - -export default { - code: 'zh-tw', - buttonText: { - prev: '上個', - next: '下個', - today: '今天', - year: '年', - month: '月', - week: '週', - day: '天', - list: '活動列表', - }, - weekText: '週', - allDayText: '整天', - moreLinkText: '顯示更多', - noEventsText: '沒有任何活動', -} as LocaleInput diff --git a/fullcalendar-main/packages/core/src/option-change-handlers.ts b/fullcalendar-main/packages/core/src/option-change-handlers.ts deleted file mode 100644 index 94c9a3e..0000000 --- a/fullcalendar-main/packages/core/src/option-change-handlers.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { createPlugin } from './plugin-system.js' -import { hashValuesToArray } from './util/object.js' -import { EventSource } from './structs/event-source.js' -import { CalendarContext } from './CalendarContext.js' - -export const changeHandlerPlugin = createPlugin({ - name: 'change-handler', - optionChangeHandlers: { - events(events, context) { - handleEventSources([events], context) - }, - eventSources: handleEventSources, - }, -}) - -/* -BUG: if `event` was supplied, all previously-given `eventSources` will be wiped out -*/ -function handleEventSources(inputs, context: CalendarContext) { - let unfoundSources: EventSource[] = hashValuesToArray(context.getCurrentData().eventSources) - - if ( - unfoundSources.length === 1 && - inputs.length === 1 && - Array.isArray(unfoundSources[0]._raw) && - Array.isArray(inputs[0]) - ) { - context.dispatch({ - type: 'RESET_RAW_EVENTS', - sourceId: unfoundSources[0].sourceId, - rawEvents: inputs[0], - }) - return - } - - let newInputs = [] - - for (let input of inputs) { - let inputFound = false - - for (let i = 0; i < unfoundSources.length; i += 1) { - if (unfoundSources[i]._raw === input) { - unfoundSources.splice(i, 1) // delete - inputFound = true - break - } - } - - if (!inputFound) { - newInputs.push(input) - } - } - - for (let unfoundSource of unfoundSources) { - context.dispatch({ - type: 'REMOVE_EVENT_SOURCE', - sourceId: unfoundSource.sourceId, - }) - } - - for (let newInput of newInputs) { - context.calendarApi.addEventSource(newInput) - } -} diff --git a/fullcalendar-main/packages/core/src/options.ts b/fullcalendar-main/packages/core/src/options.ts deleted file mode 100644 index dae37d5..0000000 --- a/fullcalendar-main/packages/core/src/options.ts +++ /dev/null @@ -1,514 +0,0 @@ -import { createDuration } from './datelib/duration.js' -import { mergeProps, isPropsEqual } from './util/object.js' -import { isArraysEqual } from './util/array.js' -import { createFormatter } from './datelib/formatting.js' -import { parseFieldSpecs } from './util/misc.js' -import { DateProfileGeneratorClass } from './DateProfileGenerator.js' -import { CalendarApi } from './api/CalendarApi.js' -import { ViewApi } from './api/ViewApi.js' -import { EventApi } from './api/EventApi.js' -import { - CssDimValue, - DateInput, - DateRangeInput, - BusinessHoursInput, - EventSourceInput, - LocaleSingularArg, LocaleInput, - EventInput, EventInputTransformer, - OverlapFunc, ConstraintInput, AllowFunc, - PluginDef, - ViewComponentType, - SpecificViewContentArg, SpecificViewMountArg, - ClassNamesGenerator, CustomContentGenerator, DidMountHandler, WillUnmountHandler, - NowIndicatorContentArg, NowIndicatorMountArg, - WeekNumberContentArg, WeekNumberMountArg, - SlotLaneContentArg, SlotLaneMountArg, - SlotLabelContentArg, SlotLabelMountArg, - AllDayContentArg, AllDayMountArg, - DayHeaderContentArg, DayHeaderMountArg, - DayCellContentArg, DayCellMountArg, - ViewContentArg, ViewMountArg, - EventClickArg, - EventHoveringArg, - DateSelectArg, DateUnselectArg, - WeekNumberCalculation, - FormatterInput, - ToolbarInput, CustomButtonInput, ButtonIconsInput, ButtonTextCompoundInput, - EventContentArg, EventMountArg, - DatesSetArg, - EventAddArg, EventChangeArg, EventRemoveArg, - MoreLinkContentArg, - MoreLinkMountArg, - MoreLinkAction, - ButtonHintCompoundInput, - CustomRenderingHandler, -} from './api/structs.js' - -// base options -// ------------ - -export const BASE_OPTION_REFINERS = { - navLinkDayClick: identity as Identity void)>, - navLinkWeekClick: identity as Identity void)>, - duration: createDuration, - bootstrapFontAwesome: identity as Identity, // TODO: move to bootstrap plugin - buttonIcons: identity as Identity, - customButtons: identity as Identity<{ [name: string]: CustomButtonInput }>, - defaultAllDayEventDuration: createDuration, - defaultTimedEventDuration: createDuration, - nextDayThreshold: createDuration, - scrollTime: createDuration, - scrollTimeReset: Boolean, - slotMinTime: createDuration, - slotMaxTime: createDuration, - dayPopoverFormat: createFormatter, - slotDuration: createDuration, - snapDuration: createDuration, - headerToolbar: identity as Identity, - footerToolbar: identity as Identity, - defaultRangeSeparator: String, - titleRangeSeparator: String, - forceEventDuration: Boolean, - - dayHeaders: Boolean, - dayHeaderFormat: createFormatter, - dayHeaderClassNames: identity as Identity>, - dayHeaderContent: identity as Identity>, - dayHeaderDidMount: identity as Identity>, - dayHeaderWillUnmount: identity as Identity>, - - dayCellClassNames: identity as Identity>, - dayCellContent: identity as Identity>, - dayCellDidMount: identity as Identity>, - dayCellWillUnmount: identity as Identity>, - - initialView: String, - aspectRatio: Number, - weekends: Boolean, - - weekNumberCalculation: identity as Identity, - weekNumbers: Boolean, - weekNumberClassNames: identity as Identity>, - weekNumberContent: identity as Identity>, - weekNumberDidMount: identity as Identity>, - weekNumberWillUnmount: identity as Identity>, - - editable: Boolean, - - viewClassNames: identity as Identity>, - viewDidMount: identity as Identity>, - viewWillUnmount: identity as Identity>, - - nowIndicator: Boolean, - nowIndicatorClassNames: identity as Identity>, - nowIndicatorContent: identity as Identity>, - nowIndicatorDidMount: identity as Identity>, - nowIndicatorWillUnmount: identity as Identity>, - - showNonCurrentDates: Boolean, - lazyFetching: Boolean, - startParam: String, - endParam: String, - timeZoneParam: String, - timeZone: String, - locales: identity as Identity, - locale: identity as Identity, - themeSystem: String as Identity<'standard' | string>, - dragRevertDuration: Number, - dragScroll: Boolean, - allDayMaintainDuration: Boolean, - unselectAuto: Boolean, - dropAccept: identity as Identity boolean)>, // TODO: type draggable - eventOrder: parseFieldSpecs, - eventOrderStrict: Boolean, - - handleWindowResize: Boolean, - windowResizeDelay: Number, - longPressDelay: Number, - eventDragMinDistance: Number, - expandRows: Boolean, - height: identity as Identity, - contentHeight: identity as Identity, - direction: String as Identity<'ltr' | 'rtl'>, - weekNumberFormat: createFormatter, - eventResizableFromStart: Boolean, - displayEventTime: Boolean, - displayEventEnd: Boolean, - weekText: String, // the short version - weekTextLong: String, // falls back to weekText - progressiveEventRendering: Boolean, - businessHours: identity as Identity, - initialDate: identity as Identity, - now: identity as Identity DateInput)>, - eventDataTransform: identity as Identity, - stickyHeaderDates: identity as Identity, - stickyFooterScrollbar: identity as Identity, - viewHeight: identity as Identity, - defaultAllDay: Boolean, - eventSourceFailure: identity as Identity<(this: CalendarApi, error: any) => void>, - eventSourceSuccess: identity as Identity<(this: CalendarApi, eventsInput: EventInput[], response?: Response) => EventInput[] | void>, - - eventDisplay: String, // TODO: give more specific - eventStartEditable: Boolean, - eventDurationEditable: Boolean, - eventOverlap: identity as Identity, - eventConstraint: identity as Identity, - eventAllow: identity as Identity, - eventBackgroundColor: String, - eventBorderColor: String, - eventTextColor: String, - eventColor: String, - eventClassNames: identity as Identity>, - eventContent: identity as Identity>, - eventDidMount: identity as Identity>, - eventWillUnmount: identity as Identity>, - - selectConstraint: identity as Identity, - selectOverlap: identity as Identity, - selectAllow: identity as Identity, - - droppable: Boolean, - unselectCancel: String, - - slotLabelFormat: identity as Identity, - - slotLaneClassNames: identity as Identity>, - slotLaneContent: identity as Identity>, - slotLaneDidMount: identity as Identity>, - slotLaneWillUnmount: identity as Identity>, - - slotLabelClassNames: identity as Identity>, - slotLabelContent: identity as Identity>, - slotLabelDidMount: identity as Identity>, - slotLabelWillUnmount: identity as Identity>, - - dayMaxEvents: identity as Identity, - dayMaxEventRows: identity as Identity, - dayMinWidth: Number, - slotLabelInterval: createDuration, - - allDayText: String, - allDayClassNames: identity as Identity>, - allDayContent: identity as Identity>, - allDayDidMount: identity as Identity>, - allDayWillUnmount: identity as Identity>, - - slotMinWidth: Number, // move to timeline? - navLinks: Boolean, - eventTimeFormat: createFormatter, - rerenderDelay: Number, // TODO: move to @fullcalendar/core right? nah keep here - moreLinkText: identity as Identity string)>, // this not enforced :( check others too - moreLinkHint: identity as Identity string)>, - selectMinDistance: Number, - selectable: Boolean, - selectLongPressDelay: Number, - eventLongPressDelay: Number, - - selectMirror: Boolean, - eventMaxStack: Number, - eventMinHeight: Number, - eventMinWidth: Number, - eventShortHeight: Number, - slotEventOverlap: Boolean, - plugins: identity as Identity, - firstDay: Number, - dayCount: Number, - dateAlignment: String, - dateIncrement: createDuration, - hiddenDays: identity as Identity, - fixedWeekCount: Boolean, - validRange: identity as Identity DateRangeInput)>, // `this` works? - visibleRange: identity as Identity DateRangeInput)>, // `this` works? - titleFormat: identity as Identity, // DONT parse just yet. we need to inject titleSeparator - - eventInteractive: Boolean, - - // only used by list-view, but languages define the value, so we need it in base options - noEventsText: String, - - viewHint: identity as Identity string)>, - navLinkHint: identity as Identity string)>, - closeHint: String, - timeHint: String, - eventHint: String, - - moreLinkClick: identity as Identity, - moreLinkClassNames: identity as Identity>, - moreLinkContent: identity as Identity>, - moreLinkDidMount: identity as Identity>, - moreLinkWillUnmount: identity as Identity>, - - monthStartFormat: createFormatter, - - // for connectors - // (can't be part of plugin system b/c must be provided at runtime) - handleCustomRendering: identity as Identity>, - customRenderingMetaMap: identity as Identity<{ [optionName: string]: any }>, - customRenderingReplaces: Boolean, -} - -type BuiltInBaseOptionRefiners = typeof BASE_OPTION_REFINERS - -export interface BaseOptionRefiners extends BuiltInBaseOptionRefiners { - // for ambient-extending -} - -export type BaseOptions = RawOptionsFromRefiners< // as RawOptions - Required // Required is a hack for "Index signature is missing" -> - -// do NOT give a type here. need `typeof BASE_OPTION_DEFAULTS` to give real results. -// raw values. -export const BASE_OPTION_DEFAULTS = { - eventDisplay: 'auto', - defaultRangeSeparator: ' - ', - titleRangeSeparator: ' \u2013 ', // en dash - defaultTimedEventDuration: '01:00:00', - defaultAllDayEventDuration: { day: 1 }, - forceEventDuration: false, - nextDayThreshold: '00:00:00', - dayHeaders: true, - initialView: '', - aspectRatio: 1.35, - headerToolbar: { - start: 'title', - center: '', - end: 'today prev,next', - }, - weekends: true, - weekNumbers: false, - weekNumberCalculation: 'local' as WeekNumberCalculation, - editable: false, - nowIndicator: false, - scrollTime: '06:00:00', - scrollTimeReset: true, - slotMinTime: '00:00:00', - slotMaxTime: '24:00:00', - showNonCurrentDates: true, - lazyFetching: true, - startParam: 'start', - endParam: 'end', - timeZoneParam: 'timeZone', - timeZone: 'local', // TODO: throw error if given falsy value? - locales: [], - locale: '', // blank values means it will compute based off locales[] - themeSystem: 'standard', - dragRevertDuration: 500, - dragScroll: true, - allDayMaintainDuration: false, - unselectAuto: true, - dropAccept: '*', - eventOrder: 'start,-duration,allDay,title', - dayPopoverFormat: { month: 'long', day: 'numeric', year: 'numeric' }, - handleWindowResize: true, - windowResizeDelay: 100, // milliseconds before an updateSize happens - longPressDelay: 1000, - eventDragMinDistance: 5, // only applies to mouse - expandRows: false, - navLinks: false, - selectable: false, - eventMinHeight: 15, - eventMinWidth: 30, - eventShortHeight: 30, - monthStartFormat: { month: 'long', day: 'numeric' }, -} - -export type BaseOptionsRefined = DefaultedRefinedOptions< - RefinedOptionsFromRefiners>, // Required is a hack for "Index signature is missing" - keyof typeof BASE_OPTION_DEFAULTS -> - -// calendar listeners -// ------------------ - -export const CALENDAR_LISTENER_REFINERS = { - datesSet: identity as Identity<(arg: DatesSetArg) => void>, - eventsSet: identity as Identity<(events: EventApi[]) => void>, - eventAdd: identity as Identity<(arg: EventAddArg) => void>, - eventChange: identity as Identity<(arg: EventChangeArg) => void>, - eventRemove: identity as Identity<(arg: EventRemoveArg) => void>, - windowResize: identity as Identity<(arg: { view: ViewApi }) => void>, - eventClick: identity as Identity<(arg: EventClickArg) => void>, // TODO: resource for scheduler???? - eventMouseEnter: identity as Identity<(arg: EventHoveringArg) => void>, - eventMouseLeave: identity as Identity<(arg: EventHoveringArg) => void>, - select: identity as Identity<(arg: DateSelectArg) => void>, // resource for scheduler???? - unselect: identity as Identity<(arg: DateUnselectArg) => void>, - loading: identity as Identity<(isLoading: boolean) => void>, - - // internal - _unmount: identity as Identity<() => void>, - _beforeprint: identity as Identity<() => void>, - _afterprint: identity as Identity<() => void>, - _noEventDrop: identity as Identity<() => void>, - _noEventResize: identity as Identity<() => void>, - _resize: identity as Identity<(forced: boolean) => void>, - _scrollRequest: identity as Identity<(arg: any) => void>, -} - -type BuiltInCalendarListenerRefiners = typeof CALENDAR_LISTENER_REFINERS - -export interface CalendarListenerRefiners extends BuiltInCalendarListenerRefiners { - // for ambient extending -} - -type CalendarListenersLoose = RefinedOptionsFromRefiners> // Required hack -export type CalendarListeners = Required // much more convenient for Emitters and whatnot - -// calendar-specific options -// ------------------------- - -export const CALENDAR_OPTION_REFINERS = { // does not include base nor calendar listeners - buttonText: identity as Identity, - buttonHints: identity as Identity, - views: identity as Identity<{ [viewId: string]: ViewOptions }>, - plugins: identity as Identity, - initialEvents: identity as Identity, - events: identity as Identity, - eventSources: identity as Identity, -} - -type BuiltInCalendarOptionRefiners = typeof CALENDAR_OPTION_REFINERS - -export interface CalendarOptionRefiners extends BuiltInCalendarOptionRefiners { - // for ambient-extending -} - -export type CalendarOptions = - BaseOptions & - CalendarListenersLoose & - RawOptionsFromRefiners> // Required hack https://github.com/microsoft/TypeScript/issues/15300 - -export type CalendarOptionsRefined = - BaseOptionsRefined & - CalendarListenersLoose & - RefinedOptionsFromRefiners> // Required hack - -export const COMPLEX_OPTION_COMPARATORS: { - [optionName in keyof CalendarOptions]: (a: CalendarOptions[optionName], b: CalendarOptions[optionName]) => boolean -} = { - headerToolbar: isMaybeObjectsEqual, - footerToolbar: isMaybeObjectsEqual, - buttonText: isMaybeObjectsEqual, - buttonHints: isMaybeObjectsEqual, - buttonIcons: isMaybeObjectsEqual, - dateIncrement: isMaybeObjectsEqual, - plugins: isMaybeArraysEqual, - events: isMaybeArraysEqual, - eventSources: isMaybeArraysEqual, - ['resources' as any]: isMaybeArraysEqual, -} - -export function isMaybeObjectsEqual(a, b) { - if (typeof a === 'object' && typeof b === 'object' && a && b) { // both non-null objects - return isPropsEqual(a, b) - } - return a === b -} - -function isMaybeArraysEqual(a, b) { - if (Array.isArray(a) && Array.isArray(b)) { - return isArraysEqual(a, b) - } - return a === b -} - -// view-specific options -// --------------------- - -export const VIEW_OPTION_REFINERS: { - [name: string]: any -} = { - type: String, - component: identity as Identity, - buttonText: String, - buttonTextKey: String, // internal only - dateProfileGeneratorClass: identity as Identity, - usesMinMaxTime: Boolean, // internal only - classNames: identity as Identity>, - content: identity as Identity>, - didMount: identity as Identity>, - willUnmount: identity as Identity>, -} - -type BuiltInViewOptionRefiners = typeof VIEW_OPTION_REFINERS - -export interface ViewOptionRefiners extends BuiltInViewOptionRefiners { - // for ambient-extending -} - -export type ViewOptions = - BaseOptions & - CalendarListenersLoose & - RawOptionsFromRefiners> // Required hack - -export type ViewOptionsRefined = - BaseOptionsRefined & - CalendarListenersLoose & - RefinedOptionsFromRefiners> // Required hack - -// util funcs -// ---------------------------------------------------------------------------------------------------- - -export function mergeRawOptions(optionSets: Dictionary[]) { - return mergeProps(optionSets, COMPLEX_OPTION_COMPARATORS) -} - -export function refineProps>( - input: Raw, - refiners: Refiners, -): { - refined: RefinedOptionsFromRefiners, - extra: Dictionary, -} { - let refined = {} as any - let extra = {} as any - - for (let propName in refiners) { - if (propName in input) { - refined[propName] = refiners[propName](input[propName]) - } - } - - for (let propName in input) { - if (!(propName in refiners)) { - extra[propName] = input[propName] - } - } - - return { refined, extra } -} - -// definition utils -// ---------------------------------------------------------------------------------------------------- - -export type GenericRefiners = { - [propName: string]: (input: any) => any -} - -export type GenericListenerRefiners = { - [listenerName: string]: Identity<(this: CalendarApi, ...args: any[]) => void> -} - -export type RawOptionsFromRefiners = { - [Prop in keyof Refiners]?: // all optional - Refiners[Prop] extends ((input: infer RawType) => infer RefinedType) - ? (any extends RawType ? RefinedType : RawType) // if input type `any`, use output (for Boolean/Number/String) - : never -} - -export type RefinedOptionsFromRefiners = { - [Prop in keyof Refiners]?: // all optional - Refiners[Prop] extends ((input: any) => infer RefinedType) ? RefinedType : never -} - -export type DefaultedRefinedOptions = - Required> & - Partial> - -export type Dictionary = Record - -export type Identity = (raw: T) => T - -export function identity(raw: T): T { - return raw -} diff --git a/fullcalendar-main/packages/core/src/plugin-system-struct.ts b/fullcalendar-main/packages/core/src/plugin-system-struct.ts deleted file mode 100644 index a54e535..0000000 --- a/fullcalendar-main/packages/core/src/plugin-system-struct.ts +++ /dev/null @@ -1,113 +0,0 @@ -import { ReducerFunc } from './reducers/CalendarDataManager.js' -import { EventDefMemberAdder } from './structs/event-parse.js' -import { eventDefMutationApplier } from './structs/event-mutation.js' -import { DatePointTransform, DateSpanTransform, CalendarInteractionClass, OptionChangeHandlerMap } from './calendar-utils.js' -import { ViewConfigInputHash } from './structs/view-config.js' -import { ViewProps } from './View.js' -import { CalendarContentProps } from './CalendarContent.js' -import { CalendarContext } from './CalendarContext.js' -import { isPropsValidTester } from './structs/constraint.js' -import { eventDragMutationMassager, eventIsDraggableTransformer, EventDropTransformers } from './interactions/event-dragging.js' -import { dateSelectionJoinTransformer } from './interactions/date-selecting.js' -import { ExternalDefTransform } from './interactions/external-element-dragging.js' -import { InteractionClass } from './interactions/interaction.js' -import { ThemeClass } from './theme/Theme.js' -import { EventSourceDef } from './structs/event-source-def.js' -import { CmdFormatterFunc } from './datelib/DateFormatter.js' -import { RecurringType } from './structs/recurring-event.js' -import { NamedTimeZoneImplClass } from './datelib/timezone.js' -import { ElementDraggingClass } from './interactions/ElementDragging.js' -import { ComponentChildren } from './preact.js' -import { ScrollGridImpl } from './scrollgrid/ScrollGridImpl.js' -import { GenericRefiners, GenericListenerRefiners, Dictionary } from './options.js' -import { CalendarData } from './reducers/data-types.js' - -// TODO: easier way to add new hooks? need to update a million things - -export interface PluginDefInput { - name: string - premiumReleaseDate?: string - deps?: PluginDef[] - reducers?: ReducerFunc[] - isLoadingFuncs?: ((state: Dictionary) => boolean)[] - contextInit?: (context: CalendarContext) => void - eventRefiners?: GenericRefiners // why not an array like others? - eventDefMemberAdders?: EventDefMemberAdder[] - eventSourceRefiners?: GenericRefiners - isDraggableTransformers?: eventIsDraggableTransformer[] - eventDragMutationMassagers?: eventDragMutationMassager[] - eventDefMutationAppliers?: eventDefMutationApplier[] - dateSelectionTransformers?: dateSelectionJoinTransformer[] - datePointTransforms?: DatePointTransform[] - dateSpanTransforms?: DateSpanTransform[] - views?: ViewConfigInputHash - viewPropsTransformers?: ViewPropsTransformerClass[] - isPropsValid?: isPropsValidTester - externalDefTransforms?: ExternalDefTransform[] - viewContainerAppends?: ViewContainerAppend[] - eventDropTransformers?: EventDropTransformers[] - componentInteractions?: InteractionClass[] - calendarInteractions?: CalendarInteractionClass[] - themeClasses?: { [themeSystemName: string]: ThemeClass } - eventSourceDefs?: EventSourceDef[] - cmdFormatter?: CmdFormatterFunc - recurringTypes?: RecurringType[] - namedTimeZonedImpl?: NamedTimeZoneImplClass - initialView?: string - elementDraggingImpl?: ElementDraggingClass - optionChangeHandlers?: OptionChangeHandlerMap - scrollGridImpl?: ScrollGridImpl - listenerRefiners?: GenericListenerRefiners - optionRefiners?: GenericRefiners - propSetHandlers?: { [propName: string]: (val: any, context: CalendarData) => void } // TODO: make better types -} - -export interface PluginHooks { - premiumReleaseDate: Date | undefined - reducers: ReducerFunc[] - isLoadingFuncs: ((state: Dictionary) => boolean)[] - contextInit: ((context: CalendarContext) => void)[] - eventRefiners: GenericRefiners - eventDefMemberAdders: EventDefMemberAdder[] - eventSourceRefiners: GenericRefiners - isDraggableTransformers: eventIsDraggableTransformer[] - eventDragMutationMassagers: eventDragMutationMassager[] - eventDefMutationAppliers: eventDefMutationApplier[] - dateSelectionTransformers: dateSelectionJoinTransformer[] - datePointTransforms: DatePointTransform[] - dateSpanTransforms: DateSpanTransform[] - views: ViewConfigInputHash // TODO: parse before gets to this step? - viewPropsTransformers: ViewPropsTransformerClass[] - isPropsValid: isPropsValidTester | null - externalDefTransforms: ExternalDefTransform[] - viewContainerAppends: ViewContainerAppend[] - eventDropTransformers: EventDropTransformers[] - componentInteractions: InteractionClass[] - calendarInteractions: CalendarInteractionClass[] - themeClasses: { [themeSystemName: string]: ThemeClass } - eventSourceDefs: EventSourceDef[] - cmdFormatter?: CmdFormatterFunc - recurringTypes: RecurringType[] - namedTimeZonedImpl?: NamedTimeZoneImplClass - initialView: string - elementDraggingImpl?: ElementDraggingClass - optionChangeHandlers: OptionChangeHandlerMap - scrollGridImpl: ScrollGridImpl | null - listenerRefiners: GenericListenerRefiners - optionRefiners: GenericRefiners - propSetHandlers: { [propName: string]: (val: any, context: CalendarData) => void } -} - -export interface PluginDef extends PluginHooks { - id: string - name: string - deps: PluginDef[] -} - -export type ViewPropsTransformerClass = new() => ViewPropsTransformer - -export interface ViewPropsTransformer { - transform(viewProps: ViewProps, calendarProps: CalendarContentProps): any -} - -export type ViewContainerAppend = (context: CalendarContext) => ComponentChildren diff --git a/fullcalendar-main/packages/core/src/plugin-system.ts b/fullcalendar-main/packages/core/src/plugin-system.ts deleted file mode 100644 index 048b4f6..0000000 --- a/fullcalendar-main/packages/core/src/plugin-system.ts +++ /dev/null @@ -1,175 +0,0 @@ -import { guid } from './util/misc.js' -import { PluginDefInput, PluginDef, PluginHooks } from './plugin-system-struct.js' -import { isArraysEqual } from './util/array.js' - -// TODO: easier way to add new hooks? need to update a million things - -export function createPlugin(input: PluginDefInput): PluginDef { - return { - id: guid(), - name: input.name, - premiumReleaseDate: input.premiumReleaseDate ? new Date(input.premiumReleaseDate): undefined, - deps: input.deps || [], - reducers: input.reducers || [], - isLoadingFuncs: input.isLoadingFuncs || [], - contextInit: [].concat(input.contextInit || []), - eventRefiners: input.eventRefiners || {}, - eventDefMemberAdders: input.eventDefMemberAdders || [], - eventSourceRefiners: input.eventSourceRefiners || {}, - isDraggableTransformers: input.isDraggableTransformers || [], - eventDragMutationMassagers: input.eventDragMutationMassagers || [], - eventDefMutationAppliers: input.eventDefMutationAppliers || [], - dateSelectionTransformers: input.dateSelectionTransformers || [], - datePointTransforms: input.datePointTransforms || [], - dateSpanTransforms: input.dateSpanTransforms || [], - views: input.views || {}, - viewPropsTransformers: input.viewPropsTransformers || [], - isPropsValid: input.isPropsValid || null, - externalDefTransforms: input.externalDefTransforms || [], - viewContainerAppends: input.viewContainerAppends || [], - eventDropTransformers: input.eventDropTransformers || [], - componentInteractions: input.componentInteractions || [], - calendarInteractions: input.calendarInteractions || [], - themeClasses: input.themeClasses || {}, - eventSourceDefs: input.eventSourceDefs || [], - cmdFormatter: input.cmdFormatter, - recurringTypes: input.recurringTypes || [], - namedTimeZonedImpl: input.namedTimeZonedImpl, - initialView: input.initialView || '', - elementDraggingImpl: input.elementDraggingImpl, - optionChangeHandlers: input.optionChangeHandlers || {}, - scrollGridImpl: input.scrollGridImpl || null, - listenerRefiners: input.listenerRefiners || {}, - optionRefiners: input.optionRefiners || {}, - propSetHandlers: input.propSetHandlers || {}, - } -} - -function buildPluginHooks(pluginDefs: PluginDef[], globalDefs: PluginDef[]): PluginHooks { - let currentPluginIds: { [pluginName: string]: string } = {} - let hooks: PluginHooks = { - premiumReleaseDate: undefined, - reducers: [], - isLoadingFuncs: [], - contextInit: [], - eventRefiners: {}, - eventDefMemberAdders: [], - eventSourceRefiners: {}, - isDraggableTransformers: [], - eventDragMutationMassagers: [], - eventDefMutationAppliers: [], - dateSelectionTransformers: [], - datePointTransforms: [], - dateSpanTransforms: [], - views: {}, - viewPropsTransformers: [], - isPropsValid: null, - externalDefTransforms: [], - viewContainerAppends: [], - eventDropTransformers: [], - componentInteractions: [], - calendarInteractions: [], - themeClasses: {}, - eventSourceDefs: [], - cmdFormatter: null, - recurringTypes: [], - namedTimeZonedImpl: null, - initialView: '', - elementDraggingImpl: null, - optionChangeHandlers: {}, - scrollGridImpl: null, - listenerRefiners: {}, - optionRefiners: {}, - propSetHandlers: {}, - } - - function addDefs(defs: PluginDef[]) { - for (let def of defs) { - const pluginName = def.name - const currentId = currentPluginIds[pluginName] - - if (currentId === undefined) { - currentPluginIds[pluginName] = def.id - addDefs(def.deps) - hooks = combineHooks(hooks, def) - } else if (currentId !== def.id) { - // different ID than the one already added - console.warn(`Duplicate plugin '${pluginName}'`) - } - } - } - - if (pluginDefs) { - addDefs(pluginDefs) - } - - addDefs(globalDefs) - - return hooks -} - -export function buildBuildPluginHooks() { // memoizes - let currentOverrideDefs: PluginDef[] = [] - let currentGlobalDefs: PluginDef[] = [] - let currentHooks: PluginHooks - - return (overrideDefs: PluginDef[], globalDefs: PluginDef[]) => { - if (!currentHooks || !isArraysEqual(overrideDefs, currentOverrideDefs) || !isArraysEqual(globalDefs, currentGlobalDefs)) { - currentHooks = buildPluginHooks(overrideDefs, globalDefs) - } - currentOverrideDefs = overrideDefs - currentGlobalDefs = globalDefs - return currentHooks - } -} - -function combineHooks(hooks0: PluginHooks, hooks1: PluginHooks): PluginHooks { - return { - premiumReleaseDate: compareOptionalDates(hooks0.premiumReleaseDate, hooks1.premiumReleaseDate), - reducers: hooks0.reducers.concat(hooks1.reducers), - isLoadingFuncs: hooks0.isLoadingFuncs.concat(hooks1.isLoadingFuncs), - contextInit: hooks0.contextInit.concat(hooks1.contextInit), - eventRefiners: { ...hooks0.eventRefiners, ...hooks1.eventRefiners }, - eventDefMemberAdders: hooks0.eventDefMemberAdders.concat(hooks1.eventDefMemberAdders), - eventSourceRefiners: { ...hooks0.eventSourceRefiners, ...hooks1.eventSourceRefiners }, - isDraggableTransformers: hooks0.isDraggableTransformers.concat(hooks1.isDraggableTransformers), - eventDragMutationMassagers: hooks0.eventDragMutationMassagers.concat(hooks1.eventDragMutationMassagers), - eventDefMutationAppliers: hooks0.eventDefMutationAppliers.concat(hooks1.eventDefMutationAppliers), - dateSelectionTransformers: hooks0.dateSelectionTransformers.concat(hooks1.dateSelectionTransformers), - datePointTransforms: hooks0.datePointTransforms.concat(hooks1.datePointTransforms), - dateSpanTransforms: hooks0.dateSpanTransforms.concat(hooks1.dateSpanTransforms), - views: { ...hooks0.views, ...hooks1.views }, - viewPropsTransformers: hooks0.viewPropsTransformers.concat(hooks1.viewPropsTransformers), - isPropsValid: hooks1.isPropsValid || hooks0.isPropsValid, - externalDefTransforms: hooks0.externalDefTransforms.concat(hooks1.externalDefTransforms), - viewContainerAppends: hooks0.viewContainerAppends.concat(hooks1.viewContainerAppends), - eventDropTransformers: hooks0.eventDropTransformers.concat(hooks1.eventDropTransformers), - calendarInteractions: hooks0.calendarInteractions.concat(hooks1.calendarInteractions), - componentInteractions: hooks0.componentInteractions.concat(hooks1.componentInteractions), - themeClasses: { ...hooks0.themeClasses, ...hooks1.themeClasses }, - eventSourceDefs: hooks0.eventSourceDefs.concat(hooks1.eventSourceDefs), - cmdFormatter: hooks1.cmdFormatter || hooks0.cmdFormatter, - recurringTypes: hooks0.recurringTypes.concat(hooks1.recurringTypes), - namedTimeZonedImpl: hooks1.namedTimeZonedImpl || hooks0.namedTimeZonedImpl, - initialView: hooks0.initialView || hooks1.initialView, // put earlier plugins FIRST - elementDraggingImpl: hooks0.elementDraggingImpl || hooks1.elementDraggingImpl, // " - optionChangeHandlers: { ...hooks0.optionChangeHandlers, ...hooks1.optionChangeHandlers }, - scrollGridImpl: hooks1.scrollGridImpl || hooks0.scrollGridImpl, - listenerRefiners: { ...hooks0.listenerRefiners, ...hooks1.listenerRefiners }, - optionRefiners: { ...hooks0.optionRefiners, ...hooks1.optionRefiners }, - propSetHandlers: { ...hooks0.propSetHandlers, ...hooks1.propSetHandlers }, - } -} - -function compareOptionalDates( - date0: Date | undefined, - date1: Date | undefined, -): Date | undefined { - if (date0 === undefined) { - return date1 - } - if (date1 === undefined) { - return date0 - } - return new Date(Math.max(date0.valueOf(), date1.valueOf())) -} diff --git a/fullcalendar-main/packages/core/src/preact.ts b/fullcalendar-main/packages/core/src/preact.ts deleted file mode 100644 index d136dd4..0000000 --- a/fullcalendar-main/packages/core/src/preact.ts +++ /dev/null @@ -1,70 +0,0 @@ -import * as preact from 'preact' -export * from 'preact' -export { createPortal } from 'preact/compat' - -/* -NOTE: this can be a public API, especially createElement for hooks. -See examples/typescript-scheduler/src/index.ts -*/ - -export function flushSync(runBeforeFlush) { - runBeforeFlush() - - let oldDebounceRendering = preact.options.debounceRendering // orig - let callbackQ = [] - - function execCallbackSync(callback) { - callbackQ.push(callback) - } - - preact.options.debounceRendering = execCallbackSync - preact.render(preact.createElement(FakeComponent, {}), document.createElement('div')) - - while (callbackQ.length) { - callbackQ.shift()() - } - - preact.options.debounceRendering = oldDebounceRendering -} - -class FakeComponent extends preact.Component { - render() { return preact.createElement('div', {}) } - componentDidMount() { this.setState({}) } -} - -// TODO: use preact/compat instead? -export function createContext(defaultValue: T) { - let ContextType = preact.createContext(defaultValue) - let origProvider = ContextType.Provider - - ContextType.Provider = function () { // eslint-disable-line func-names - let isNew = !this.getChildContext - let children = origProvider.apply(this, arguments as any) // eslint-disable-line prefer-rest-params - - if (isNew) { - let subs = [] - - this.shouldComponentUpdate = (_props) => { - if (this.props.value !== _props.value) { - subs.forEach((c) => { - c.context = _props.value - c.forceUpdate() - }) - } - } - - this.sub = (c) => { - subs.push(c) - let old = c.componentWillUnmount - c.componentWillUnmount = () => { - subs.splice(subs.indexOf(c), 1) - old && old.call(c) - } - } - } - - return children - } - - return ContextType -} diff --git a/fullcalendar-main/packages/core/src/reducers/Action.ts b/fullcalendar-main/packages/core/src/reducers/Action.ts deleted file mode 100644 index 69de83f..0000000 --- a/fullcalendar-main/packages/core/src/reducers/Action.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { EventInput } from '../structs/event-parse.js' -import { DateRange } from '../datelib/date-range.js' -import { EventStore } from '../structs/event-store.js' -import { EventSource } from '../structs/event-source.js' -import { EventInteractionState } from '../interactions/event-interaction-state.js' -import { DateSpan } from '../structs/date-span.js' -import { DateMarker } from '../datelib/marker.js' - -export type Action = - { type: 'NOTHING' } | // hack - { type: 'SET_OPTION', optionName: string, rawOptionValue: any } | // TODO: how to link this to CalendarOptions? - - { type: 'PREV' } | - { type: 'NEXT' } | - { type: 'CHANGE_DATE', dateMarker: DateMarker } | - { type: 'CHANGE_VIEW_TYPE', viewType: string, dateMarker?: DateMarker } | - - { type: 'SELECT_DATES', selection: DateSpan } | - { type: 'UNSELECT_DATES' } | - - { type: 'SELECT_EVENT', eventInstanceId: string } | - { type: 'UNSELECT_EVENT' } | - - { type: 'SET_EVENT_DRAG', state: EventInteractionState } | - { type: 'UNSET_EVENT_DRAG' } | - - { type: 'SET_EVENT_RESIZE', state: EventInteractionState } | - { type: 'UNSET_EVENT_RESIZE' } | - - { type: 'ADD_EVENT_SOURCES', sources: EventSource[] } | - { type: 'REMOVE_EVENT_SOURCE', sourceId: string } | - { type: 'REMOVE_ALL_EVENT_SOURCES' } | - - { type: 'FETCH_EVENT_SOURCES', sourceIds?: string[], isRefetch?: boolean } | // if no sourceIds, fetch all - - { type: 'RECEIVE_EVENTS', sourceId: string, fetchId: string, fetchRange: DateRange | null, rawEvents: EventInput[] } | - { - type: 'RECEIVE_EVENT_ERROR' - sourceId: string - fetchId: string - fetchRange: DateRange | null - error: Error - } | // need all these? - - { type: 'ADD_EVENTS', eventStore: EventStore } | - { type: 'RESET_EVENTS', eventStore: EventStore } | - { type: 'RESET_RAW_EVENTS', rawEvents: EventInput[], sourceId: string } | - { type: 'MERGE_EVENTS', eventStore: EventStore } | - { type: 'REMOVE_EVENTS', eventStore: EventStore } | - { type: 'REMOVE_ALL_EVENTS' } diff --git a/fullcalendar-main/packages/core/src/reducers/CalendarDataManager.ts b/fullcalendar-main/packages/core/src/reducers/CalendarDataManager.ts deleted file mode 100644 index 37d3a0d..0000000 --- a/fullcalendar-main/packages/core/src/reducers/CalendarDataManager.ts +++ /dev/null @@ -1,707 +0,0 @@ -import { buildLocale, RawLocaleInfo, organizeRawLocales, LocaleSingularArg } from '../datelib/locale.js' -import { memoize, memoizeObjArg } from '../util/memoize.js' -import { Action } from './Action.js' -import { buildBuildPluginHooks } from '../plugin-system.js' -import { PluginHooks } from '../plugin-system-struct.js' -import { DateEnv } from '../datelib/env.js' -import { CalendarImpl } from '../api/CalendarImpl.js' -import { StandardTheme } from '../theme/StandardTheme.js' -import { EventSourceHash } from '../structs/event-source.js' -import { buildViewSpecs, ViewSpec } from '../structs/view-spec.js' -import { mapHash, isPropsEqual } from '../util/object.js' -import { DateProfileGenerator, DateProfileGeneratorProps } from '../DateProfileGenerator.js' -import { reduceViewType } from './view-type.js' -import { getInitialDate, reduceCurrentDate } from './current-date.js' -import { reduceDynamicOptionOverrides } from './options.js' -import { reduceDateProfile } from './date-profile.js' -import { reduceEventSources, initEventSources, reduceEventSourcesNewTimeZone, computeEventSourcesLoading } from './eventSources.js' -import { reduceEventStore, rezoneEventStoreDates } from './eventStore.js' -import { reduceDateSelection } from './date-selection.js' -import { reduceSelectedEvent } from './selected-event.js' -import { reduceEventDrag } from './event-drag.js' -import { reduceEventResize } from './event-resize.js' -import { Emitter } from '../common/Emitter.js' -import { EventUiHash, EventUi, createEventUi } from '../component/event-ui.js' -import { EventDefHash } from '../structs/event-def.js' -import { parseToolbars } from '../toolbar-parse.js' -import { - CalendarOptionsRefined, CalendarOptions, - CALENDAR_OPTION_REFINERS, COMPLEX_OPTION_COMPARATORS, - ViewOptions, ViewOptionsRefined, - BASE_OPTION_DEFAULTS, mergeRawOptions, - BASE_OPTION_REFINERS, VIEW_OPTION_REFINERS, - CalendarListeners, CALENDAR_LISTENER_REFINERS, Dictionary, -} from '../options.js' -import { rangeContainsMarker } from '../datelib/date-range.js' -import { ViewImpl } from '../api/ViewImpl.js' -import { parseBusinessHours } from '../structs/business-hours.js' -import { globalPlugins } from '../global-plugins.js' -import { createEmptyEventStore } from '../structs/event-store.js' -import { CalendarContext } from '../CalendarContext.js' -import { CalendarDataManagerState, CalendarOptionsData, CalendarCurrentViewData, CalendarData } from './data-types.js' -import { TaskRunner } from '../util/TaskRunner.js' -import { buildTitle } from './title-formatting.js' - -export interface CalendarDataManagerProps { - optionOverrides: CalendarOptions - calendarApi: CalendarImpl - onAction?: (action: Action) => void - onData?: (data: CalendarData) => void -} - -export type ReducerFunc = ( // TODO: rename to CalendarDataInjector. move view-props-manip hook here as well? - currentState: Dictionary | null, - action: Action | null, - context: CalendarContext & CalendarDataManagerState // more than just context -) => Dictionary - -// in future refactor, do the redux-style function(state=initial) for initial-state -// also, whatever is happening in constructor, have it happen in action queue too - -export class CalendarDataManager { - private computeCurrentViewData = memoize(this._computeCurrentViewData) - private organizeRawLocales = memoize(organizeRawLocales) - private buildLocale = memoize(buildLocale) - private buildPluginHooks = buildBuildPluginHooks() - private buildDateEnv = memoize(buildDateEnv) - private buildTheme = memoize(buildTheme) - private parseToolbars = memoize(parseToolbars) - private buildViewSpecs = memoize(buildViewSpecs) - private buildDateProfileGenerator = memoizeObjArg(buildDateProfileGenerator) - private buildViewApi = memoize(buildViewApi) - private buildViewUiProps = memoizeObjArg(buildViewUiProps) - private buildEventUiBySource = memoize(buildEventUiBySource, isPropsEqual) - private buildEventUiBases = memoize(buildEventUiBases) - private parseContextBusinessHours = memoizeObjArg(parseContextBusinessHours) - private buildTitle = memoize(buildTitle) - - public emitter = new Emitter() - private actionRunner = new TaskRunner(this._handleAction.bind(this), this.updateData.bind(this)) - private props: CalendarDataManagerProps - private state: CalendarDataManagerState - private data: CalendarData - - public currentCalendarOptionsInput: CalendarOptions = {} - private currentCalendarOptionsRefined: CalendarOptionsRefined = ({} as any) - private currentViewOptionsInput: ViewOptions = {} - private currentViewOptionsRefined: ViewOptionsRefined = ({} as any) - public currentCalendarOptionsRefiners: any = {} - - private stableOptionOverrides: CalendarOptions - private stableDynamicOptionOverrides: CalendarOptions - private stableCalendarOptionsData: CalendarOptionsData - private optionsForRefining: string[] = [] - private optionsForHandling: string[] = [] - - constructor(props: CalendarDataManagerProps) { - this.props = props - this.actionRunner.pause() - - let dynamicOptionOverrides: CalendarOptions = {} - let optionsData = this.computeOptionsData( - props.optionOverrides, - dynamicOptionOverrides, - props.calendarApi, - ) - - let currentViewType = optionsData.calendarOptions.initialView || optionsData.pluginHooks.initialView - let currentViewData = this.computeCurrentViewData( - currentViewType, - optionsData, - props.optionOverrides, - dynamicOptionOverrides, - ) - - // wire things up - // TODO: not DRY - props.calendarApi.currentDataManager = this - this.emitter.setThisContext(props.calendarApi) - this.emitter.setOptions(currentViewData.options) - - let currentDate = getInitialDate(optionsData.calendarOptions, optionsData.dateEnv) - let dateProfile = currentViewData.dateProfileGenerator.build(currentDate) - - if (!rangeContainsMarker(dateProfile.activeRange, currentDate)) { - currentDate = dateProfile.currentRange.start - } - - let calendarContext: CalendarContext = { - dateEnv: optionsData.dateEnv, - options: optionsData.calendarOptions, - pluginHooks: optionsData.pluginHooks, - calendarApi: props.calendarApi, - dispatch: this.dispatch, - emitter: this.emitter, - getCurrentData: this.getCurrentData, - } - - // needs to be after setThisContext - for (let callback of optionsData.pluginHooks.contextInit) { - callback(calendarContext) - } - - // NOT DRY - let eventSources = initEventSources(optionsData.calendarOptions, dateProfile, calendarContext) - - let initialState: CalendarDataManagerState = { - dynamicOptionOverrides, - currentViewType, - currentDate, - dateProfile, - businessHours: this.parseContextBusinessHours(calendarContext), // weird to have this in state - eventSources, - eventUiBases: {}, - eventStore: createEmptyEventStore(), - renderableEventStore: createEmptyEventStore(), - dateSelection: null, - eventSelection: '', - eventDrag: null, - eventResize: null, - selectionConfig: this.buildViewUiProps(calendarContext).selectionConfig, - } - let contextAndState = { ...calendarContext, ...initialState } - - for (let reducer of optionsData.pluginHooks.reducers) { - Object.assign(initialState, reducer(null, null, contextAndState)) - } - - if (computeIsLoading(initialState, calendarContext)) { - this.emitter.trigger('loading', true) // NOT DRY - } - - this.state = initialState - this.updateData() - this.actionRunner.resume() - } - - getCurrentData = () => this.data - - dispatch = (action: Action) => { - this.actionRunner.request(action) // protects against recursive calls to _handleAction - } - - resetOptions(optionOverrides: CalendarOptions, changedOptionNames?: string[]) { - let { props } = this - - if (changedOptionNames === undefined) { - props.optionOverrides = optionOverrides - } else { - props.optionOverrides = { ...(props.optionOverrides || {}), ...optionOverrides } - this.optionsForRefining.push(...changedOptionNames) - } - - if (changedOptionNames === undefined || changedOptionNames.length) { - this.actionRunner.request({ // hack. will cause updateData - type: 'NOTHING', - }) - } - } - - _handleAction(action: Action) { - let { props, state, emitter } = this - - let dynamicOptionOverrides = reduceDynamicOptionOverrides(state.dynamicOptionOverrides, action) - let optionsData = this.computeOptionsData( - props.optionOverrides, - dynamicOptionOverrides, - props.calendarApi, - ) - - let currentViewType = reduceViewType(state.currentViewType, action) - let currentViewData = this.computeCurrentViewData( - currentViewType, - optionsData, - props.optionOverrides, - dynamicOptionOverrides, - ) - - // wire things up - // TODO: not DRY - props.calendarApi.currentDataManager = this - emitter.setThisContext(props.calendarApi) - emitter.setOptions(currentViewData.options) - - let calendarContext: CalendarContext = { - dateEnv: optionsData.dateEnv, - options: optionsData.calendarOptions, - pluginHooks: optionsData.pluginHooks, - calendarApi: props.calendarApi, - dispatch: this.dispatch, - emitter, - getCurrentData: this.getCurrentData, - } - - let { currentDate, dateProfile } = state - - if (this.data && this.data.dateProfileGenerator !== currentViewData.dateProfileGenerator) { // hack - dateProfile = currentViewData.dateProfileGenerator.build(currentDate) - } - - currentDate = reduceCurrentDate(currentDate, action) - dateProfile = reduceDateProfile(dateProfile, action, currentDate, currentViewData.dateProfileGenerator) - - if ( - action.type === 'PREV' || // TODO: move this logic into DateProfileGenerator - action.type === 'NEXT' || // " - !rangeContainsMarker(dateProfile.currentRange, currentDate) - ) { - currentDate = dateProfile.currentRange.start - } - - let eventSources = reduceEventSources(state.eventSources, action, dateProfile, calendarContext) - let eventStore = reduceEventStore(state.eventStore, action, eventSources, dateProfile, calendarContext) - let isEventsLoading = computeEventSourcesLoading(eventSources) // BAD. also called in this func in computeIsLoading - - let renderableEventStore = - (isEventsLoading && !currentViewData.options.progressiveEventRendering) ? - (state.renderableEventStore || eventStore) : // try from previous state - eventStore - - let { eventUiSingleBase, selectionConfig } = this.buildViewUiProps(calendarContext) // will memoize obj - let eventUiBySource = this.buildEventUiBySource(eventSources) - let eventUiBases = this.buildEventUiBases(renderableEventStore.defs, eventUiSingleBase, eventUiBySource) - - let newState: CalendarDataManagerState = { - dynamicOptionOverrides, - currentViewType, - currentDate, - dateProfile, - eventSources, - eventStore, - renderableEventStore, - selectionConfig, - eventUiBases, - businessHours: this.parseContextBusinessHours(calendarContext), // will memoize obj - dateSelection: reduceDateSelection(state.dateSelection, action), - eventSelection: reduceSelectedEvent(state.eventSelection, action), - eventDrag: reduceEventDrag(state.eventDrag, action), - eventResize: reduceEventResize(state.eventResize, action), - } - let contextAndState = { ...calendarContext, ...newState } - - for (let reducer of optionsData.pluginHooks.reducers) { - Object.assign(newState, reducer(state, action, contextAndState)) // give the OLD state, for old value - } - - let wasLoading = computeIsLoading(state, calendarContext) - let isLoading = computeIsLoading(newState, calendarContext) - - // TODO: use propSetHandlers in plugin system - if (!wasLoading && isLoading) { - emitter.trigger('loading', true) - } else if (wasLoading && !isLoading) { - emitter.trigger('loading', false) - } - - this.state = newState - - if (props.onAction) { - props.onAction(action) - } - } - - updateData() { - let { props, state } = this - let oldData = this.data - - let optionsData = this.computeOptionsData( - props.optionOverrides, - state.dynamicOptionOverrides, - props.calendarApi, - ) - - let currentViewData = this.computeCurrentViewData( - state.currentViewType, - optionsData, - props.optionOverrides, - state.dynamicOptionOverrides, - ) - - let data: CalendarData = this.data = { - viewTitle: this.buildTitle(state.dateProfile, currentViewData.options, optionsData.dateEnv), - calendarApi: props.calendarApi, - dispatch: this.dispatch, - emitter: this.emitter, - getCurrentData: this.getCurrentData, - ...optionsData, - ...currentViewData, - ...state, - } - - let changeHandlers = optionsData.pluginHooks.optionChangeHandlers - let oldCalendarOptions = oldData && oldData.calendarOptions - let newCalendarOptions = optionsData.calendarOptions - - if (oldCalendarOptions && oldCalendarOptions !== newCalendarOptions) { - if (oldCalendarOptions.timeZone !== newCalendarOptions.timeZone) { - // hack - state.eventSources = data.eventSources = reduceEventSourcesNewTimeZone(data.eventSources, state.dateProfile, data) - state.eventStore = data.eventStore = rezoneEventStoreDates(data.eventStore, oldData.dateEnv, data.dateEnv) - state.renderableEventStore = data.renderableEventStore = rezoneEventStoreDates(data.renderableEventStore, oldData.dateEnv, data.dateEnv) - } - - for (let optionName in changeHandlers) { - if ( - this.optionsForHandling.indexOf(optionName) !== -1 || - oldCalendarOptions[optionName] !== newCalendarOptions[optionName] - ) { - changeHandlers[optionName](newCalendarOptions[optionName], data) - } - } - } - - this.optionsForHandling = [] - - if (props.onData) { - props.onData(data) - } - } - - computeOptionsData( - optionOverrides: CalendarOptions, - dynamicOptionOverrides: CalendarOptions, - calendarApi: CalendarImpl, - ): CalendarOptionsData { - // TODO: blacklist options that are handled by optionChangeHandlers - - if ( - !this.optionsForRefining.length && - optionOverrides === this.stableOptionOverrides && - dynamicOptionOverrides === this.stableDynamicOptionOverrides - ) { - return this.stableCalendarOptionsData - } - - let { - refinedOptions, pluginHooks, localeDefaults, availableLocaleData, extra, - } = this.processRawCalendarOptions(optionOverrides, dynamicOptionOverrides) - - warnUnknownOptions(extra) - - let dateEnv = this.buildDateEnv( - refinedOptions.timeZone, - refinedOptions.locale, - refinedOptions.weekNumberCalculation, - refinedOptions.firstDay, - refinedOptions.weekText, - pluginHooks, - availableLocaleData, - refinedOptions.defaultRangeSeparator, - ) - - let viewSpecs = this.buildViewSpecs(pluginHooks.views, this.stableOptionOverrides, this.stableDynamicOptionOverrides, localeDefaults) - let theme = this.buildTheme(refinedOptions, pluginHooks) - let toolbarConfig = this.parseToolbars(refinedOptions, this.stableOptionOverrides, theme, viewSpecs, calendarApi) - - return this.stableCalendarOptionsData = { - calendarOptions: refinedOptions, - pluginHooks, - dateEnv, - viewSpecs, - theme, - toolbarConfig, - localeDefaults, - availableRawLocales: availableLocaleData.map, - } - } - - // always called from behind a memoizer - processRawCalendarOptions(optionOverrides: CalendarOptions, dynamicOptionOverrides: CalendarOptions) { - let { locales, locale } = mergeRawOptions([ - BASE_OPTION_DEFAULTS, - optionOverrides, - dynamicOptionOverrides, - ]) - let availableLocaleData = this.organizeRawLocales(locales) - let availableRawLocales = availableLocaleData.map - let localeDefaults = this.buildLocale(locale || availableLocaleData.defaultCode, availableRawLocales).options - let pluginHooks = this.buildPluginHooks(optionOverrides.plugins || [], globalPlugins) - let refiners = this.currentCalendarOptionsRefiners = { - ...BASE_OPTION_REFINERS, - ...CALENDAR_LISTENER_REFINERS, - ...CALENDAR_OPTION_REFINERS, - ...pluginHooks.listenerRefiners, - ...pluginHooks.optionRefiners, - } - let extra = {} - - let raw = mergeRawOptions([ - BASE_OPTION_DEFAULTS, - localeDefaults, - optionOverrides, - dynamicOptionOverrides, - ]) - let refined: Partial = {} - let currentRaw = this.currentCalendarOptionsInput - let currentRefined = this.currentCalendarOptionsRefined - let anyChanges = false - - for (let optionName in raw) { - if ( - this.optionsForRefining.indexOf(optionName) === -1 && ( - raw[optionName] === currentRaw[optionName] || ( - COMPLEX_OPTION_COMPARATORS[optionName] && - (optionName in currentRaw) && - COMPLEX_OPTION_COMPARATORS[optionName](currentRaw[optionName], raw[optionName]) - ) - ) - ) { - refined[optionName] = currentRefined[optionName] - } else if (refiners[optionName]) { - refined[optionName] = refiners[optionName](raw[optionName]) - anyChanges = true - } else { - extra[optionName] = currentRaw[optionName] - } - } - - if (anyChanges) { - this.currentCalendarOptionsInput = raw - this.currentCalendarOptionsRefined = refined as CalendarOptionsRefined - - this.stableOptionOverrides = optionOverrides - this.stableDynamicOptionOverrides = dynamicOptionOverrides - } - - this.optionsForHandling.push(...this.optionsForRefining) - this.optionsForRefining = [] - - return { - rawOptions: this.currentCalendarOptionsInput, - refinedOptions: this.currentCalendarOptionsRefined, - pluginHooks, - availableLocaleData, - localeDefaults, - extra, - } - } - - _computeCurrentViewData( - viewType: string, - optionsData: CalendarOptionsData, - optionOverrides: CalendarOptions, - dynamicOptionOverrides: CalendarOptions, - ): CalendarCurrentViewData { - let viewSpec = optionsData.viewSpecs[viewType] - - if (!viewSpec) { - throw new Error(`viewType "${viewType}" is not available. Please make sure you've loaded all neccessary plugins`) - } - - let { refinedOptions, extra } = this.processRawViewOptions( - viewSpec, - optionsData.pluginHooks, - optionsData.localeDefaults, - optionOverrides, - dynamicOptionOverrides, - ) - - warnUnknownOptions(extra) - - let dateProfileGenerator = this.buildDateProfileGenerator({ - dateProfileGeneratorClass: viewSpec.optionDefaults.dateProfileGeneratorClass as any, - duration: viewSpec.duration, - durationUnit: viewSpec.durationUnit, - usesMinMaxTime: viewSpec.optionDefaults.usesMinMaxTime as any, - dateEnv: optionsData.dateEnv, - calendarApi: this.props.calendarApi, // should come from elsewhere? - slotMinTime: refinedOptions.slotMinTime, - slotMaxTime: refinedOptions.slotMaxTime, - showNonCurrentDates: refinedOptions.showNonCurrentDates, - dayCount: refinedOptions.dayCount, - dateAlignment: refinedOptions.dateAlignment, - dateIncrement: refinedOptions.dateIncrement, - hiddenDays: refinedOptions.hiddenDays, - weekends: refinedOptions.weekends, - nowInput: refinedOptions.now, - validRangeInput: refinedOptions.validRange, - visibleRangeInput: refinedOptions.visibleRange, - fixedWeekCount: refinedOptions.fixedWeekCount, - }) - - let viewApi = this.buildViewApi(viewType, this.getCurrentData, optionsData.dateEnv) - - return { viewSpec, options: refinedOptions, dateProfileGenerator, viewApi } - } - - processRawViewOptions( - viewSpec: ViewSpec, - pluginHooks: PluginHooks, - localeDefaults: CalendarOptions, - optionOverrides: CalendarOptions, - dynamicOptionOverrides: CalendarOptions, - ) { - let raw = mergeRawOptions([ - BASE_OPTION_DEFAULTS, - viewSpec.optionDefaults, - localeDefaults, - optionOverrides, - viewSpec.optionOverrides, - dynamicOptionOverrides, - ]) - let refiners = { - ...BASE_OPTION_REFINERS, - ...CALENDAR_LISTENER_REFINERS, - ...CALENDAR_OPTION_REFINERS, - ...VIEW_OPTION_REFINERS, - ...pluginHooks.listenerRefiners, - ...pluginHooks.optionRefiners, - } - let refined: Partial = {} - let currentRaw = this.currentViewOptionsInput - let currentRefined = this.currentViewOptionsRefined - let anyChanges = false - let extra = {} - - for (let optionName in raw) { - if ( - raw[optionName] === currentRaw[optionName] || - (COMPLEX_OPTION_COMPARATORS[optionName] && - COMPLEX_OPTION_COMPARATORS[optionName](raw[optionName], currentRaw[optionName])) - ) { - refined[optionName] = currentRefined[optionName] - } else { - if ( - raw[optionName] === this.currentCalendarOptionsInput[optionName] || - (COMPLEX_OPTION_COMPARATORS[optionName] && - COMPLEX_OPTION_COMPARATORS[optionName](raw[optionName], this.currentCalendarOptionsInput[optionName])) - ) { - if (optionName in this.currentCalendarOptionsRefined) { // might be an "extra" prop - refined[optionName] = this.currentCalendarOptionsRefined[optionName] - } - } else if (refiners[optionName]) { - refined[optionName] = refiners[optionName](raw[optionName]) - } else { - extra[optionName] = raw[optionName] - } - - anyChanges = true - } - } - - if (anyChanges) { - this.currentViewOptionsInput = raw - this.currentViewOptionsRefined = refined as ViewOptionsRefined - } - - return { - rawOptions: this.currentViewOptionsInput, - refinedOptions: this.currentViewOptionsRefined, - extra, - } - } -} - -function buildDateEnv( - timeZone: string, - explicitLocale: LocaleSingularArg, - weekNumberCalculation, - firstDay: number | undefined, - weekText, - pluginHooks: PluginHooks, - availableLocaleData: RawLocaleInfo, - defaultSeparator: string, -) { - let locale = buildLocale(explicitLocale || availableLocaleData.defaultCode, availableLocaleData.map) - - return new DateEnv({ - calendarSystem: 'gregory', // TODO: make this a setting - timeZone, - namedTimeZoneImpl: pluginHooks.namedTimeZonedImpl, - locale, - weekNumberCalculation, - firstDay, - weekText, - cmdFormatter: pluginHooks.cmdFormatter, - defaultSeparator, - }) -} - -function buildTheme(options: CalendarOptionsRefined, pluginHooks: PluginHooks) { - let ThemeClass = pluginHooks.themeClasses[options.themeSystem] || StandardTheme - - return new ThemeClass(options) -} - -function buildDateProfileGenerator(props: DateProfileGeneratorProps): DateProfileGenerator { - let DateProfileGeneratorClass = props.dateProfileGeneratorClass || DateProfileGenerator - - return new DateProfileGeneratorClass(props) -} - -function buildViewApi(type: string, getCurrentData: () => CalendarData, dateEnv: DateEnv) { - return new ViewImpl(type, getCurrentData, dateEnv) -} - -function buildEventUiBySource(eventSources: EventSourceHash): EventUiHash { - return mapHash(eventSources, (eventSource) => eventSource.ui) -} - -function buildEventUiBases(eventDefs: EventDefHash, eventUiSingleBase: EventUi, eventUiBySource: EventUiHash) { - let eventUiBases: EventUiHash = { '': eventUiSingleBase } - - for (let defId in eventDefs) { - let def = eventDefs[defId] - - if (def.sourceId && eventUiBySource[def.sourceId]) { - eventUiBases[defId] = eventUiBySource[def.sourceId] - } - } - - return eventUiBases -} - -function buildViewUiProps(calendarContext: CalendarContext) { - let { options } = calendarContext - - return { - eventUiSingleBase: createEventUi( - { - display: options.eventDisplay, - editable: options.editable, // without "event" at start - startEditable: options.eventStartEditable, - durationEditable: options.eventDurationEditable, - constraint: options.eventConstraint, - overlap: typeof options.eventOverlap === 'boolean' ? options.eventOverlap : undefined, - allow: options.eventAllow, - backgroundColor: options.eventBackgroundColor, - borderColor: options.eventBorderColor, - textColor: options.eventTextColor, - color: options.eventColor, - // classNames: options.eventClassNames // render hook will handle this - }, - calendarContext, - ), - selectionConfig: createEventUi( - { - constraint: options.selectConstraint, - overlap: typeof options.selectOverlap === 'boolean' ? options.selectOverlap : undefined, - allow: options.selectAllow, - }, - calendarContext, - ), - } -} - -function computeIsLoading(state: CalendarDataManagerState, context: CalendarContext) { - for (let isLoadingFunc of context.pluginHooks.isLoadingFuncs) { - if (isLoadingFunc(state)) { - return true - } - } - - return false -} - -function parseContextBusinessHours(calendarContext: CalendarContext) { - return parseBusinessHours(calendarContext.options.businessHours, calendarContext) -} - -function warnUnknownOptions(options: any, viewName?: string) { - for (let optionName in options) { - console.warn( - `Unknown option '${optionName}'` + - (viewName ? ` for view '${viewName}'` : ''), - ) - } -} diff --git a/fullcalendar-main/packages/core/src/reducers/current-date.ts b/fullcalendar-main/packages/core/src/reducers/current-date.ts deleted file mode 100644 index 4f6db41..0000000 --- a/fullcalendar-main/packages/core/src/reducers/current-date.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { DateEnv, DateInput } from '../datelib/env.js' -import { DateMarker } from '../datelib/marker.js' -import { Action } from './Action.js' -import { BaseOptionsRefined } from '../options.js' - -export function reduceCurrentDate(currentDate: DateMarker, action: Action) { - switch (action.type) { - case 'CHANGE_DATE': - return action.dateMarker - default: - return currentDate - } -} - -export function getInitialDate(options: BaseOptionsRefined, dateEnv: DateEnv) { - let initialDateInput = options.initialDate - - // compute the initial ambig-timezone date - if (initialDateInput != null) { - return dateEnv.createMarker(initialDateInput) - } - return getNow(options.now, dateEnv) // getNow already returns unzoned -} - -export function getNow(nowInput: DateInput | (() => DateInput), dateEnv: DateEnv) { - if (typeof nowInput === 'function') { - nowInput = nowInput() - } - - if (nowInput == null) { - return dateEnv.createNowMarker() - } - - return dateEnv.createMarker(nowInput) -} diff --git a/fullcalendar-main/packages/core/src/reducers/data-types.ts b/fullcalendar-main/packages/core/src/reducers/data-types.ts deleted file mode 100644 index 25cfd84..0000000 --- a/fullcalendar-main/packages/core/src/reducers/data-types.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { Action } from './Action.js' -import { PluginHooks } from '../plugin-system-struct.js' -import { DateEnv } from '../datelib/env.js' -import { CalendarImpl } from '../api/CalendarImpl.js' -import { EventSourceHash } from '../structs/event-source.js' -import { ViewSpecHash, ViewSpec } from '../structs/view-spec.js' -import { DateProfileGenerator, DateProfile } from '../DateProfileGenerator.js' -import { Emitter } from '../common/Emitter.js' -import { EventUiHash, EventUi } from '../component/event-ui.js' -import { DateMarker } from '../datelib/marker.js' -import { ViewImpl } from '../api/ViewImpl.js' -import { Theme } from '../theme/Theme.js' -import { EventStore } from '../structs/event-store.js' -import { DateSpan } from '../structs/date-span.js' -import { EventInteractionState } from '../interactions/event-interaction-state.js' -import { CalendarOptionsRefined, ViewOptionsRefined, CalendarOptions, CalendarListeners } from '../options.js' - -export interface CalendarDataManagerState { - dynamicOptionOverrides: CalendarOptions - currentViewType: string - currentDate: DateMarker - dateProfile: DateProfile - businessHours: EventStore - eventSources: EventSourceHash - eventUiBases: EventUiHash - eventStore: EventStore - renderableEventStore: EventStore - dateSelection: DateSpan | null - eventSelection: string - eventDrag: EventInteractionState | null - eventResize: EventInteractionState | null - selectionConfig: EventUi -} - -export interface CalendarOptionsData { - localeDefaults: CalendarOptions - calendarOptions: CalendarOptionsRefined - toolbarConfig: any - availableRawLocales: any - dateEnv: DateEnv - theme: Theme - pluginHooks: PluginHooks - viewSpecs: ViewSpecHash -} - -export interface CalendarCurrentViewData { - viewSpec: ViewSpec - options: ViewOptionsRefined - viewApi: ViewImpl - dateProfileGenerator: DateProfileGenerator -} - -type CalendarDataBase = CalendarOptionsData & CalendarCurrentViewData & CalendarDataManagerState - -// needs to be an interface so we can ambient-extend -// is a superset of CalendarContext -export interface CalendarData extends CalendarDataBase { - viewTitle: string // based on current date - calendarApi: CalendarImpl // TODO: try to remove this - dispatch: (action: Action) => void - emitter: Emitter - getCurrentData(): CalendarData // TODO: try to remove -} diff --git a/fullcalendar-main/packages/core/src/reducers/date-profile.ts b/fullcalendar-main/packages/core/src/reducers/date-profile.ts deleted file mode 100644 index 910b2d3..0000000 --- a/fullcalendar-main/packages/core/src/reducers/date-profile.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { DateProfile, DateProfileGenerator } from '../DateProfileGenerator.js' -import { Action } from './Action.js' -import { DateMarker } from '../datelib/marker.js' - -export function reduceDateProfile( - currentDateProfile: DateProfile | null, - action: Action, - currentDate: DateMarker, - dateProfileGenerator: DateProfileGenerator, -): DateProfile { - let dp: DateProfile - - switch (action.type) { - case 'CHANGE_VIEW_TYPE': - return dateProfileGenerator.build(action.dateMarker || currentDate) - - case 'CHANGE_DATE': - return dateProfileGenerator.build(action.dateMarker) - - case 'PREV': - dp = dateProfileGenerator.buildPrev(currentDateProfile, currentDate) - if (dp.isValid) { - return dp - } - break - - case 'NEXT': - dp = dateProfileGenerator.buildNext(currentDateProfile, currentDate) - if (dp.isValid) { - return dp - } - break - } - - return currentDateProfile -} diff --git a/fullcalendar-main/packages/core/src/reducers/date-selection.ts b/fullcalendar-main/packages/core/src/reducers/date-selection.ts deleted file mode 100644 index baa8d64..0000000 --- a/fullcalendar-main/packages/core/src/reducers/date-selection.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { DateSpan } from '../structs/date-span.js' -import { Action } from './Action.js' - -export function reduceDateSelection(currentSelection: DateSpan | null, action: Action) { - switch (action.type) { - case 'UNSELECT_DATES': - return null - - case 'SELECT_DATES': - return action.selection - - default: - return currentSelection - } -} diff --git a/fullcalendar-main/packages/core/src/reducers/event-drag.ts b/fullcalendar-main/packages/core/src/reducers/event-drag.ts deleted file mode 100644 index ac28eef..0000000 --- a/fullcalendar-main/packages/core/src/reducers/event-drag.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Action } from './Action.js' -import { EventInteractionState } from '../interactions/event-interaction-state.js' - -export function reduceEventDrag(currentDrag: EventInteractionState | null, action: Action): EventInteractionState | null { - let newDrag: EventInteractionState - - switch (action.type) { - case 'UNSET_EVENT_DRAG': - return null - - case 'SET_EVENT_DRAG': - newDrag = action.state - - return { - affectedEvents: newDrag.affectedEvents, - mutatedEvents: newDrag.mutatedEvents, - isEvent: newDrag.isEvent, - } - - default: - return currentDrag - } -} diff --git a/fullcalendar-main/packages/core/src/reducers/event-resize.ts b/fullcalendar-main/packages/core/src/reducers/event-resize.ts deleted file mode 100644 index b3a38b7..0000000 --- a/fullcalendar-main/packages/core/src/reducers/event-resize.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { EventInteractionState } from '../interactions/event-interaction-state.js' -import { Action } from './Action.js' - -export function reduceEventResize(currentResize: EventInteractionState | null, action: Action): EventInteractionState | null { - let newResize: EventInteractionState - - switch (action.type) { - case 'UNSET_EVENT_RESIZE': - return null - - case 'SET_EVENT_RESIZE': - newResize = action.state - - return { - affectedEvents: newResize.affectedEvents, - mutatedEvents: newResize.mutatedEvents, - isEvent: newResize.isEvent, - } - - default: - return currentResize - } -} diff --git a/fullcalendar-main/packages/core/src/reducers/eventSources.ts b/fullcalendar-main/packages/core/src/reducers/eventSources.ts deleted file mode 100644 index 8031af1..0000000 --- a/fullcalendar-main/packages/core/src/reducers/eventSources.ts +++ /dev/null @@ -1,273 +0,0 @@ -import { EventSource, EventSourceHash } from '../structs/event-source.js' -import { parseEventSource, buildEventSourceRefiners } from '../structs/event-source-parse.js' -import { arrayToHash, filterHash } from '../util/object.js' -import { DateRange } from '../datelib/date-range.js' -import { DateProfile } from '../DateProfileGenerator.js' -import { Action } from './Action.js' -import { guid } from '../util/misc.js' -import { CalendarContext } from '../CalendarContext.js' -import { CalendarOptions } from '../options.js' - -export function initEventSources(calendarOptions, dateProfile: DateProfile, context: CalendarContext) { - let activeRange = dateProfile ? dateProfile.activeRange : null - - return addSources( - {}, - parseInitialSources(calendarOptions, context), - activeRange, - context, - ) -} - -export function reduceEventSources( - eventSources: EventSourceHash, - action: Action, - dateProfile: DateProfile, - context: CalendarContext, -): EventSourceHash { - let activeRange = dateProfile ? dateProfile.activeRange : null // need this check? - - switch (action.type) { - case 'ADD_EVENT_SOURCES': // already parsed - return addSources(eventSources, action.sources, activeRange, context) - - case 'REMOVE_EVENT_SOURCE': - return removeSource(eventSources, action.sourceId) - - case 'PREV': // TODO: how do we track all actions that affect dateProfile :( - case 'NEXT': - case 'CHANGE_DATE': - case 'CHANGE_VIEW_TYPE': - if (dateProfile) { - return fetchDirtySources(eventSources, activeRange, context) - } - return eventSources - - case 'FETCH_EVENT_SOURCES': - return fetchSourcesByIds( - eventSources, - (action as any).sourceIds ? // why no type? - arrayToHash((action as any).sourceIds) : - excludeStaticSources(eventSources, context), - activeRange, - action.isRefetch || false, - context, - ) - - case 'RECEIVE_EVENTS': - case 'RECEIVE_EVENT_ERROR': - return receiveResponse(eventSources, action.sourceId, action.fetchId, action.fetchRange) - - case 'REMOVE_ALL_EVENT_SOURCES': - return {} - - default: - return eventSources - } -} - -export function reduceEventSourcesNewTimeZone(eventSources: EventSourceHash, dateProfile: DateProfile, context: CalendarContext) { - let activeRange = dateProfile ? dateProfile.activeRange : null // need this check? - - return fetchSourcesByIds( - eventSources, - excludeStaticSources(eventSources, context), - activeRange, - true, - context, - ) -} - -export function computeEventSourcesLoading(eventSources: EventSourceHash): boolean { - for (let sourceId in eventSources) { - if (eventSources[sourceId].isFetching) { - return true - } - } - - return false -} - -function addSources( - eventSourceHash: EventSourceHash, - sources: EventSource[], - fetchRange: DateRange | null, - context: CalendarContext, -): EventSourceHash { - let hash: EventSourceHash = {} - - for (let source of sources) { - hash[source.sourceId] = source - } - - if (fetchRange) { - hash = fetchDirtySources(hash, fetchRange, context) - } - - return { ...eventSourceHash, ...hash } -} - -function removeSource(eventSourceHash: EventSourceHash, sourceId: string): EventSourceHash { - return filterHash(eventSourceHash, (eventSource: EventSource) => eventSource.sourceId !== sourceId) -} - -function fetchDirtySources(sourceHash: EventSourceHash, fetchRange: DateRange, context: CalendarContext): EventSourceHash { - return fetchSourcesByIds( - sourceHash, - filterHash(sourceHash, (eventSource) => isSourceDirty(eventSource, fetchRange, context)), - fetchRange, - false, - context, - ) -} - -function isSourceDirty(eventSource: EventSource, fetchRange: DateRange, context: CalendarContext) { - if (!doesSourceNeedRange(eventSource, context)) { - return !eventSource.latestFetchId - } - return !context.options.lazyFetching || - !eventSource.fetchRange || - eventSource.isFetching || // always cancel outdated in-progress fetches - fetchRange.start < eventSource.fetchRange.start || - fetchRange.end > eventSource.fetchRange.end -} - -function fetchSourcesByIds( - prevSources: EventSourceHash, - sourceIdHash: { [sourceId: string]: any }, - fetchRange: DateRange, - isRefetch: boolean, - context: CalendarContext, -): EventSourceHash { - let nextSources: EventSourceHash = {} - - for (let sourceId in prevSources) { - let source = prevSources[sourceId] - - if (sourceIdHash[sourceId]) { - nextSources[sourceId] = fetchSource(source, fetchRange, isRefetch, context) - } else { - nextSources[sourceId] = source - } - } - - return nextSources -} - -function fetchSource(eventSource: EventSource, fetchRange: DateRange, isRefetch: boolean, context: CalendarContext) { - let { options, calendarApi } = context - let sourceDef = context.pluginHooks.eventSourceDefs[eventSource.sourceDefId] - let fetchId = guid() - - sourceDef.fetch( - { - eventSource, - range: fetchRange, - isRefetch, - context, - }, - (res) => { - let { rawEvents } = res - - if (options.eventSourceSuccess) { - rawEvents = options.eventSourceSuccess.call(calendarApi, rawEvents, res.response) || rawEvents - } - - if (eventSource.success) { - rawEvents = eventSource.success.call(calendarApi, rawEvents, res.response) || rawEvents - } - - context.dispatch({ - type: 'RECEIVE_EVENTS', - sourceId: eventSource.sourceId, - fetchId, - fetchRange, - rawEvents, - }) - }, - (error) => { - let errorHandled = false - - if (options.eventSourceFailure) { - options.eventSourceFailure.call(calendarApi, error) - errorHandled = true - } - - if (eventSource.failure) { - eventSource.failure(error) - errorHandled = true - } - - if (!errorHandled) { - console.warn(error.message, error) - } - - context.dispatch({ - type: 'RECEIVE_EVENT_ERROR', - sourceId: eventSource.sourceId, - fetchId, - fetchRange, - error, - }) - }, - ) - - return { - ...eventSource, - isFetching: true, - latestFetchId: fetchId, - } -} - -function receiveResponse(sourceHash: EventSourceHash, sourceId: string, fetchId: string, fetchRange: DateRange) { - let eventSource: EventSource = sourceHash[sourceId] - - if ( - eventSource && // not already removed - fetchId === eventSource.latestFetchId - ) { - return { - ...sourceHash, - [sourceId]: { - ...eventSource, - isFetching: false, - fetchRange, // also serves as a marker that at least one fetch has completed - }, - } - } - - return sourceHash -} - -function excludeStaticSources(eventSources: EventSourceHash, context: CalendarContext): EventSourceHash { - return filterHash(eventSources, (eventSource) => doesSourceNeedRange(eventSource, context)) -} - -function parseInitialSources(rawOptions: CalendarOptions, context: CalendarContext) { - let refiners = buildEventSourceRefiners(context) - let rawSources = [].concat(rawOptions.eventSources || []) - let sources = [] // parsed - - if (rawOptions.initialEvents) { - rawSources.unshift(rawOptions.initialEvents) - } - - if (rawOptions.events) { - rawSources.unshift(rawOptions.events) - } - - for (let rawSource of rawSources) { - let source = parseEventSource(rawSource, context, refiners) - if (source) { - sources.push(source) - } - } - - return sources -} - -function doesSourceNeedRange(eventSource: EventSource, context: CalendarContext) { - let defs = context.pluginHooks.eventSourceDefs - - return !defs[eventSource.sourceDefId].ignoreRange -} diff --git a/fullcalendar-main/packages/core/src/reducers/eventStore.ts b/fullcalendar-main/packages/core/src/reducers/eventStore.ts deleted file mode 100644 index 5ca9fe4..0000000 --- a/fullcalendar-main/packages/core/src/reducers/eventStore.ts +++ /dev/null @@ -1,256 +0,0 @@ -import { filterHash, mapHash } from '../util/object.js' -import { EventDef } from '../structs/event-def.js' -import { EventInstance, EventInstanceHash } from '../structs/event-instance.js' -import { EventInput } from '../structs/event-parse.js' -import { - EventStore, - mergeEventStores, - createEmptyEventStore, - filterEventStoreDefs, - excludeSubEventStore, - parseEvents, -} from '../structs/event-store.js' -import { Action } from './Action.js' -import { EventSourceHash, EventSource } from '../structs/event-source.js' -import { DateRange } from '../datelib/date-range.js' -import { DateProfile } from '../DateProfileGenerator.js' -import { DateEnv } from '../datelib/env.js' -import { CalendarContext } from '../CalendarContext.js' -import { expandRecurring } from '../structs/recurring-event.js' - -export function reduceEventStore( - eventStore: EventStore, - action: Action, - eventSources: EventSourceHash, - dateProfile: DateProfile, - context: CalendarContext, -): EventStore { - switch (action.type) { - case 'RECEIVE_EVENTS': // raw - return receiveRawEvents( - eventStore, - eventSources[action.sourceId], - action.fetchId, - action.fetchRange, - action.rawEvents, - context, - ) - - case 'RESET_RAW_EVENTS': - return resetRawEvents( - eventStore, - eventSources[action.sourceId], - action.rawEvents, - dateProfile.activeRange, - context, - ) - - case 'ADD_EVENTS': // already parsed, but not expanded - return addEvent( - eventStore, - action.eventStore, // new ones - dateProfile ? dateProfile.activeRange : null, - context, - ) - - case 'RESET_EVENTS': - return action.eventStore - - case 'MERGE_EVENTS': // already parsed and expanded - return mergeEventStores(eventStore, action.eventStore) - - case 'PREV': // TODO: how do we track all actions that affect dateProfile :( - case 'NEXT': - case 'CHANGE_DATE': - case 'CHANGE_VIEW_TYPE': - if (dateProfile) { - return expandRecurring(eventStore, dateProfile.activeRange, context) - } - return eventStore - - case 'REMOVE_EVENTS': - return excludeSubEventStore(eventStore, action.eventStore) - - case 'REMOVE_EVENT_SOURCE': - return excludeEventsBySourceId(eventStore, action.sourceId) - - case 'REMOVE_ALL_EVENT_SOURCES': - return filterEventStoreDefs(eventStore, (eventDef: EventDef) => ( - !eventDef.sourceId // only keep events with no source id - )) - - case 'REMOVE_ALL_EVENTS': - return createEmptyEventStore() - - default: - return eventStore - } -} - -function receiveRawEvents( - eventStore: EventStore, - eventSource: EventSource, - fetchId: string, - fetchRange: DateRange | null, - rawEvents: EventInput[], - context: CalendarContext, -): EventStore { - if ( - eventSource && // not already removed - fetchId === eventSource.latestFetchId // TODO: wish this logic was always in event-sources - ) { - let subset = parseEvents( - transformRawEvents(rawEvents, eventSource, context), - eventSource, - context, - ) - - if (fetchRange) { - subset = expandRecurring(subset, fetchRange, context) - } - - return mergeEventStores( - excludeEventsBySourceId(eventStore, eventSource.sourceId), - subset, - ) - } - - return eventStore -} - -function resetRawEvents( - existingEventStore: EventStore, - eventSource: EventSource, - rawEvents: EventInput[], - activeRange: DateRange, - context: CalendarContext, -): EventStore { - const { defIdMap, instanceIdMap } = buildPublicIdMaps(existingEventStore) - - let newEventStore = parseEvents( - transformRawEvents(rawEvents, eventSource, context), - eventSource, - context, - false, - defIdMap, - instanceIdMap, - ) - - return expandRecurring(newEventStore, activeRange, context) -} - -function transformRawEvents(rawEvents, eventSource: EventSource, context: CalendarContext) { - let calEachTransform = context.options.eventDataTransform - let sourceEachTransform = eventSource ? eventSource.eventDataTransform : null - - if (sourceEachTransform) { - rawEvents = transformEachRawEvent(rawEvents, sourceEachTransform) - } - - if (calEachTransform) { - rawEvents = transformEachRawEvent(rawEvents, calEachTransform) - } - - return rawEvents -} - -function transformEachRawEvent(rawEvents, func) { - let refinedEvents - - if (!func) { - refinedEvents = rawEvents - } else { - refinedEvents = [] - - for (let rawEvent of rawEvents) { - let refinedEvent = func(rawEvent) - - if (refinedEvent) { - refinedEvents.push(refinedEvent) - } else if (refinedEvent == null) { - refinedEvents.push(rawEvent) - } // if a different falsy value, do nothing - } - } - - return refinedEvents -} - -function addEvent(eventStore: EventStore, subset: EventStore, expandRange: DateRange | null, context: CalendarContext): EventStore { - if (expandRange) { - subset = expandRecurring(subset, expandRange, context) - } - - return mergeEventStores(eventStore, subset) -} - -export function rezoneEventStoreDates(eventStore: EventStore, oldDateEnv: DateEnv, newDateEnv: DateEnv): EventStore { - let { defs } = eventStore - - let instances = mapHash(eventStore.instances, (instance: EventInstance): EventInstance => { - let def = defs[instance.defId] - - if (def.allDay) { - return instance // isn't dependent on timezone - } - return { - ...instance, - range: { - start: newDateEnv.createMarker(oldDateEnv.toDate(instance.range.start, instance.forcedStartTzo)), - end: newDateEnv.createMarker(oldDateEnv.toDate(instance.range.end, instance.forcedEndTzo)), - }, - forcedStartTzo: newDateEnv.canComputeOffset ? null : instance.forcedStartTzo, - forcedEndTzo: newDateEnv.canComputeOffset ? null : instance.forcedEndTzo, - } - }) - - return { defs, instances } -} - -function excludeEventsBySourceId(eventStore: EventStore, sourceId: string) { - return filterEventStoreDefs(eventStore, (eventDef: EventDef) => eventDef.sourceId !== sourceId) -} - -// QUESTION: why not just return instances? do a general object-property-exclusion util -export function excludeInstances(eventStore: EventStore, removals: EventInstanceHash): EventStore { - return { - defs: eventStore.defs, - instances: filterHash(eventStore.instances, (instance: EventInstance) => !removals[instance.instanceId]), - } -} - -// ID reusing -// ------------------------------------------------------------------------------------------------- - -export type EventDefIdMap = { [publicId: string]: string } -export type EventInstanceIdMap = { [publicId: string]: string } - -function buildPublicIdMaps(eventStore: EventStore): { - defIdMap: EventDefIdMap - instanceIdMap: EventInstanceIdMap -} { - const { defs, instances } = eventStore - const defIdMap: EventDefIdMap = {} - const instanceIdMap: EventInstanceIdMap = {} - - for (let defId in defs) { - const def = defs[defId] - const { publicId } = def - - if (publicId) { - defIdMap[publicId] = defId - } - } - - for (let instanceId in instances) { - const instance = instances[instanceId] - const def = defs[instance.defId] - const { publicId } = def - - if (publicId) { - instanceIdMap[publicId] = instanceId - } - } - - return { defIdMap, instanceIdMap } -} diff --git a/fullcalendar-main/packages/core/src/reducers/options.ts b/fullcalendar-main/packages/core/src/reducers/options.ts deleted file mode 100644 index 67921ef..0000000 --- a/fullcalendar-main/packages/core/src/reducers/options.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Action } from './Action.js' - -export function reduceDynamicOptionOverrides(dynamicOptionOverrides, action: Action) { - switch (action.type) { - case 'SET_OPTION': - return { ...dynamicOptionOverrides, [action.optionName]: action.rawOptionValue } - default: - return dynamicOptionOverrides - } -} diff --git a/fullcalendar-main/packages/core/src/reducers/selected-event.ts b/fullcalendar-main/packages/core/src/reducers/selected-event.ts deleted file mode 100644 index 68c32f5..0000000 --- a/fullcalendar-main/packages/core/src/reducers/selected-event.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Action } from './Action.js' - -export function reduceSelectedEvent(currentInstanceId: string, action: Action): string { - switch (action.type) { - case 'UNSELECT_EVENT': - return '' - - case 'SELECT_EVENT': - return action.eventInstanceId - - default: - return currentInstanceId - } -} diff --git a/fullcalendar-main/packages/core/src/reducers/title-formatting.ts b/fullcalendar-main/packages/core/src/reducers/title-formatting.ts deleted file mode 100644 index 48a0677..0000000 --- a/fullcalendar-main/packages/core/src/reducers/title-formatting.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { DateProfile } from '../DateProfileGenerator.js' -import { diffWholeDays } from '../datelib/marker.js' -import { createFormatter, FormatterInput } from '../datelib/formatting.js' -import { DateRange } from '../datelib/date-range.js' -import { DateEnv } from '../datelib/env.js' -import { BaseOptions } from '../options.js' - -// Computes what the title at the top of the calendarApi should be for this view -export function buildTitle(dateProfile: DateProfile, viewOptions: BaseOptions, dateEnv: DateEnv) { - let range: DateRange - - // for views that span a large unit of time, show the proper interval, ignoring stray days before and after - if (/^(year|month)$/.test(dateProfile.currentRangeUnit)) { - range = dateProfile.currentRange - } else { // for day units or smaller, use the actual day range - range = dateProfile.activeRange - } - - return dateEnv.formatRange( - range.start, - range.end, - createFormatter(viewOptions.titleFormat || buildTitleFormat(dateProfile)), - { - isEndExclusive: dateProfile.isRangeAllDay, - defaultSeparator: viewOptions.titleRangeSeparator, - }, - ) -} - -// Generates the format string that should be used to generate the title for the current date range. -// Attempts to compute the most appropriate format if not explicitly specified with `titleFormat`. -function buildTitleFormat(dateProfile: DateProfile): FormatterInput { - let { currentRangeUnit } = dateProfile - - if (currentRangeUnit === 'year') { - return { year: 'numeric' } - } - - if (currentRangeUnit === 'month') { - return { year: 'numeric', month: 'long' } // like "September 2014" - } - - let days = diffWholeDays( - dateProfile.currentRange.start, - dateProfile.currentRange.end, - ) - - if (days !== null && days > 1) { - // multi-day range. shorter, like "Sep 9 - 10 2014" - return { year: 'numeric', month: 'short', day: 'numeric' } - } - - // one day. longer, like "September 9 2014" - return { year: 'numeric', month: 'long', day: 'numeric' } -} diff --git a/fullcalendar-main/packages/core/src/reducers/view-type.ts b/fullcalendar-main/packages/core/src/reducers/view-type.ts deleted file mode 100644 index 5eeb836..0000000 --- a/fullcalendar-main/packages/core/src/reducers/view-type.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Action } from './Action.js' - -export function reduceViewType(viewType: string, action: Action): string { - switch (action.type) { - case 'CHANGE_VIEW_TYPE': - viewType = action.viewType - } - - return viewType -} diff --git a/fullcalendar-main/packages/core/src/render-hook-misc.ts b/fullcalendar-main/packages/core/src/render-hook-misc.ts deleted file mode 100644 index 0591ed5..0000000 --- a/fullcalendar-main/packages/core/src/render-hook-misc.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { DateMeta } from './component/date-rendering.js' -import { Duration } from './datelib/duration.js' -import { ViewApi } from './api/ViewApi.js' -import { MountArg } from './common/render-hook.js' - -export interface SlotLaneContentArg extends Partial { // TODO: move? - time?: Duration - date?: Date - view: ViewApi - // this interface is for date-specific slots AND time-general slots. make an OR? -} -export type SlotLaneMountArg = MountArg - -export interface SlotLabelContentArg { // TODO: move? - level: number - time: Duration - date: Date - view: ViewApi - text: string -} -export type SlotLabelMountArg = MountArg - -export interface AllDayContentArg { - text: string - view: ViewApi -} -export type AllDayMountArg = MountArg - -export interface DayHeaderContentArg extends DateMeta { - date: Date - view: ViewApi - text: string - [otherProp: string]: any -} -export type DayHeaderMountArg = MountArg diff --git a/fullcalendar-main/packages/core/src/scrollgrid/ScrollGridImpl.ts b/fullcalendar-main/packages/core/src/scrollgrid/ScrollGridImpl.ts deleted file mode 100644 index b8036bf..0000000 --- a/fullcalendar-main/packages/core/src/scrollgrid/ScrollGridImpl.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { SectionConfig, ChunkConfig, ColProps, CssDimValue } from './util.js' -import { Component, Ref } from '../preact.js' -import { ViewContext } from '../ViewContext.js' - -export interface ScrollGridProps { - elRef?: Ref - colGroups?: ColGroupConfig[] - sections: ScrollGridSectionConfig[] - liquid: boolean // liquid *height* - forPrint: boolean - collapsibleWidth: boolean // can ALL sections be fully collapsed in width? -} - -export interface ScrollGridSectionConfig extends SectionConfig { - key: string - chunks?: ScrollGridChunkConfig[] // TODO: make this mandatory, somehow also accomodate outerContent -} - -export interface ScrollGridChunkConfig extends ChunkConfig { - key: string -} - -export interface ColGroupConfig { - width?: CssDimValue - cols: ColProps[] -} - -export type ScrollGridImpl = { - new(props: ScrollGridProps, context: ViewContext): Component -} diff --git a/fullcalendar-main/packages/core/src/scrollgrid/Scroller.tsx b/fullcalendar-main/packages/core/src/scrollgrid/Scroller.tsx deleted file mode 100644 index 3aa13e1..0000000 --- a/fullcalendar-main/packages/core/src/scrollgrid/Scroller.tsx +++ /dev/null @@ -1,126 +0,0 @@ -import { createElement, ComponentChildren, Ref } from '../preact.js' -import { BaseComponent, setRef } from '../vdom-util.js' -import { CssDimValue, ScrollerLike } from './util.js' - -export type OverflowValue = 'auto' | 'hidden' | 'scroll' | 'visible' - -export interface ScrollerProps { - elRef?: Ref - overflowX: OverflowValue - overflowY: OverflowValue - overcomeLeft?: number - overcomeRight?: number - overcomeBottom?: number - maxHeight?: CssDimValue - liquid?: boolean - liquidIsAbsolute?: boolean - children?: ComponentChildren -} - -const VISIBLE_HIDDEN_RE = /^(visible|hidden)$/ - -export class Scroller extends BaseComponent implements ScrollerLike { - public el: HTMLElement // TODO: just use this.base? - - render() { - let { props } = this - let { liquid, liquidIsAbsolute } = props - let isAbsolute = liquid && liquidIsAbsolute - let className = ['fc-scroller'] - - if (liquid) { - if (liquidIsAbsolute) { - className.push('fc-scroller-liquid-absolute') - } else { - className.push('fc-scroller-liquid') - } - } - - return ( -
- {props.children} -
- ) - } - - handleEl = (el: HTMLElement) => { - this.el = el - setRef(this.props.elRef, el) - } - - needsXScrolling() { - if (VISIBLE_HIDDEN_RE.test(this.props.overflowX)) { - return false - } - - // testing scrollWidth>clientWidth is unreliable cross-browser when pixel heights aren't integers. - // much more reliable to see if children are taller than the scroller, even tho doesn't account for - // inner-child margins and absolute positioning - - let { el } = this - let realClientWidth = this.el.getBoundingClientRect().width - this.getYScrollbarWidth() - let { children } = el - - for (let i = 0; i < children.length; i += 1) { - let childEl = children[i] - - if (childEl.getBoundingClientRect().width > realClientWidth) { - return true - } - } - - return false - } - - needsYScrolling() { - if (VISIBLE_HIDDEN_RE.test(this.props.overflowY)) { - return false - } - - // testing scrollHeight>clientHeight is unreliable cross-browser when pixel heights aren't integers. - // much more reliable to see if children are taller than the scroller, even tho doesn't account for - // inner-child margins and absolute positioning - - let { el } = this - let realClientHeight = this.el.getBoundingClientRect().height - this.getXScrollbarWidth() - let { children } = el - - for (let i = 0; i < children.length; i += 1) { - let childEl = children[i] - - if (childEl.getBoundingClientRect().height > realClientHeight) { - return true - } - } - - return false - } - - getXScrollbarWidth() { - if (VISIBLE_HIDDEN_RE.test(this.props.overflowX)) { - return 0 - } - return this.el.offsetHeight - this.el.clientHeight // only works because we guarantee no borders. TODO: add to CSS with important? - } - - getYScrollbarWidth() { - if (VISIBLE_HIDDEN_RE.test(this.props.overflowY)) { - return 0 - } - return this.el.offsetWidth - this.el.clientWidth // only works because we guarantee no borders. TODO: add to CSS with important? - } -} diff --git a/fullcalendar-main/packages/core/src/scrollgrid/SimpleScrollGrid.tsx b/fullcalendar-main/packages/core/src/scrollgrid/SimpleScrollGrid.tsx deleted file mode 100644 index 884c699..0000000 --- a/fullcalendar-main/packages/core/src/scrollgrid/SimpleScrollGrid.tsx +++ /dev/null @@ -1,277 +0,0 @@ -import { VNode, createElement, Fragment } from '../preact.js' -import { BaseComponent, setRef } from '../vdom-util.js' -import { Scroller, OverflowValue } from './Scroller.js' -import { RefMap } from '../util/RefMap.js' -import { - ColProps, SectionConfig, renderMicroColGroup, computeShrinkWidth, getScrollGridClassNames, getSectionClassNames, getAllowYScrolling, - renderChunkContent, getSectionHasLiquidHeight, ChunkConfig, hasShrinkWidth, CssDimValue, - isColPropsEqual, -} from './util.js' -import { getCanVGrowWithinCell } from '../util/table-styling.js' -import { memoize } from '../util/memoize.js' -import { isPropsEqual } from '../util/object.js' -import { getScrollbarWidths } from '../util/scrollbar-width.js' - -export interface SimpleScrollGridProps { - cols: ColProps[] - sections: SimpleScrollGridSection[] - liquid: boolean // liquid *height* - collapsibleWidth: boolean // can ALL sections be fully collapsed in width? - height?: CssDimValue // TODO: give to real ScrollGrid -} - -export interface SimpleScrollGridSection extends SectionConfig { - key: string - chunk?: ChunkConfig -} - -interface SimpleScrollGridState { - shrinkWidth: number | null - forceYScrollbars: boolean - scrollerClientWidths: { [key: string]: number } - scrollerClientHeights: { [key: string]: number } -} - -export class SimpleScrollGrid extends BaseComponent { - processCols = memoize((a) => a, isColPropsEqual) // so we get same `cols` props every time - - // yucky to memoize VNodes, but much more efficient for consumers - renderMicroColGroup: typeof renderMicroColGroup = memoize(renderMicroColGroup) - - scrollerRefs = new RefMap() - scrollerElRefs = new RefMap(this._handleScrollerEl.bind(this)) - - state: SimpleScrollGridState = { - shrinkWidth: null, - forceYScrollbars: false, - scrollerClientWidths: {}, - scrollerClientHeights: {}, - } - - render(): VNode { - let { props, state, context } = this - let sectionConfigs = props.sections || [] - let cols = this.processCols(props.cols) - - let microColGroupNode = this.renderMicroColGroup(cols, state.shrinkWidth) - let classNames = getScrollGridClassNames(props.liquid, context) - - if (props.collapsibleWidth) { - classNames.push('fc-scrollgrid-collapsible') - } - - // TODO: make DRY - let configCnt = sectionConfigs.length - let configI = 0 - let currentConfig: SimpleScrollGridSection - let headSectionNodes: VNode[] = [] - let bodySectionNodes: VNode[] = [] - let footSectionNodes: VNode[] = [] - - while (configI < configCnt && (currentConfig = sectionConfigs[configI]).type === 'header') { - headSectionNodes.push(this.renderSection(currentConfig, microColGroupNode, true)) - configI += 1 - } - - while (configI < configCnt && (currentConfig = sectionConfigs[configI]).type === 'body') { - bodySectionNodes.push(this.renderSection(currentConfig, microColGroupNode, false)) - configI += 1 - } - - while (configI < configCnt && (currentConfig = sectionConfigs[configI]).type === 'footer') { - footSectionNodes.push(this.renderSection(currentConfig, microColGroupNode, true)) - configI += 1 - } - - // firefox bug: when setting height on table and there is a thead or tfoot, - // the necessary height:100% on the liquid-height body section forces the *whole* table to be taller. (bug #5524) - // use getCanVGrowWithinCell as a way to detect table-stupid firefox. - // if so, use a simpler dom structure, jam everything into a lone tbody. - let isBuggy = !getCanVGrowWithinCell() - - const roleAttrs = { role: 'rowgroup' } - - return createElement( - 'table', - { - role: 'grid', - className: classNames.join(' '), - style: { height: props.height }, - }, - Boolean(!isBuggy && headSectionNodes.length) && createElement('thead', roleAttrs, ...headSectionNodes), - Boolean(!isBuggy && bodySectionNodes.length) && createElement('tbody', roleAttrs, ...bodySectionNodes), - Boolean(!isBuggy && footSectionNodes.length) && createElement('tfoot', roleAttrs, ...footSectionNodes), - isBuggy && createElement('tbody', roleAttrs, ...headSectionNodes, ...bodySectionNodes, ...footSectionNodes), - ) - } - - renderSection(sectionConfig: SimpleScrollGridSection, microColGroupNode: VNode, isHeader: boolean) { - if ('outerContent' in sectionConfig) { - return ( - - {sectionConfig.outerContent} - - ) - } - - return ( - - {this.renderChunkTd(sectionConfig, microColGroupNode, sectionConfig.chunk, isHeader)} - - ) - } - - renderChunkTd( - sectionConfig: SimpleScrollGridSection, - microColGroupNode: VNode, - chunkConfig: ChunkConfig, - isHeader: boolean, - ): createElement.JSX.Element { - if ('outerContent' in chunkConfig) { - return chunkConfig.outerContent - } - - let { props } = this - let { forceYScrollbars, scrollerClientWidths, scrollerClientHeights } = this.state - - let needsYScrolling = getAllowYScrolling(props, sectionConfig) // TODO: do lazily. do in section config? - let isLiquid = getSectionHasLiquidHeight(props, sectionConfig) - - // for `!props.liquid` - is WHOLE scrollgrid natural height? - // TODO: do same thing in advanced scrollgrid? prolly not b/c always has horizontal scrollbars - let overflowY: OverflowValue = - !props.liquid ? 'visible' : - forceYScrollbars ? 'scroll' : - !needsYScrolling ? 'hidden' : - 'auto' - - let sectionKey = sectionConfig.key - let content = renderChunkContent(sectionConfig, chunkConfig, { - tableColGroupNode: microColGroupNode, - tableMinWidth: '', - clientWidth: (!props.collapsibleWidth && scrollerClientWidths[sectionKey] !== undefined) ? scrollerClientWidths[sectionKey] : null, - clientHeight: scrollerClientHeights[sectionKey] !== undefined ? scrollerClientHeights[sectionKey] : null, - expandRows: sectionConfig.expandRows, - syncRowHeights: false, - rowSyncHeights: [], - reportRowHeightChange: () => {}, - }, isHeader) - - return createElement( - isHeader ? 'th' : 'td', - { - ref: chunkConfig.elRef as any, - role: 'presentation', - }, -
- - {content} - -
, - ) - } - - _handleScrollerEl(scrollerEl: HTMLElement | null, key: string) { - let section = getSectionByKey(this.props.sections, key) - - if (section) { - setRef(section.chunk.scrollerElRef, scrollerEl) - } - } - - // TODO: can do a really simple print-view. dont need to join rows - handleSizing = () => { - this.safeSetState({ - shrinkWidth: this.computeShrinkWidth(), // will create each chunk's . TODO: precompute hasShrinkWidth - ...this.computeScrollerDims(), - }) - } - - componentDidMount() { - this.handleSizing() - this.context.addResizeHandler(this.handleSizing) - } - - componentDidUpdate() { - // TODO: need better solution when state contains non-sizing things - this.handleSizing() - } - - componentWillUnmount() { - this.context.removeResizeHandler(this.handleSizing) - } - - computeShrinkWidth() { - return hasShrinkWidth(this.props.cols) - ? computeShrinkWidth(this.scrollerElRefs.getAll()) - : 0 - } - - computeScrollerDims() { - let scrollbarWidth = getScrollbarWidths() - let { scrollerRefs, scrollerElRefs } = this - - let forceYScrollbars = false - let scrollerClientWidths: { [index: string]: number } = {} - let scrollerClientHeights: { [index: string]: number } = {} - - for (let sectionKey in scrollerRefs.currentMap) { - let scroller = scrollerRefs.currentMap[sectionKey] - - if (scroller && scroller.needsYScrolling()) { - forceYScrollbars = true - break - } - } - - for (let section of this.props.sections) { - let sectionKey = section.key - let scrollerEl = scrollerElRefs.currentMap[sectionKey] - - if (scrollerEl) { - let harnessEl = scrollerEl.parentNode as HTMLElement // TODO: weird way to get this. need harness b/c doesn't include table borders - - scrollerClientWidths[sectionKey] = Math.floor( - harnessEl.getBoundingClientRect().width - ( - forceYScrollbars - ? scrollbarWidth.y // use global because scroller might not have scrollbars yet but will need them in future - : 0 - ), - ) - - scrollerClientHeights[sectionKey] = Math.floor( - harnessEl.getBoundingClientRect().height, // never has horizontal scrollbars - ) - } - } - - return { forceYScrollbars, scrollerClientWidths, scrollerClientHeights } - } -} - -SimpleScrollGrid.addStateEquality({ - scrollerClientWidths: isPropsEqual, - scrollerClientHeights: isPropsEqual, -}) - -function getSectionByKey(sections: SimpleScrollGridSection[], key: string): SimpleScrollGridSection | null { - for (let section of sections) { - if (section.key === key) { - return section - } - } - - return null -} diff --git a/fullcalendar-main/packages/core/src/scrollgrid/util.tsx b/fullcalendar-main/packages/core/src/scrollgrid/util.tsx deleted file mode 100644 index c52d7cc..0000000 --- a/fullcalendar-main/packages/core/src/scrollgrid/util.tsx +++ /dev/null @@ -1,226 +0,0 @@ -import { VNode, createElement, Ref } from '../preact.js' -import { findElements } from '../util/dom-manip.js' -import { ViewContext } from '../ViewContext.js' -import { computeSmallestCellWidth } from '../util/misc.js' -import { isPropsEqual } from '../util/object.js' -import { isArraysEqual } from '../util/array.js' -import { BaseOptionsRefined } from '../options.js' - -export type CssDimValue = string | number // TODO: move to more general file - -export interface ColProps { - width?: CssDimValue - minWidth?: CssDimValue - span?: number -} - -export interface SectionConfig { - outerContent?: VNode - type: 'body' | 'header' | 'footer' - className?: string - maxHeight?: number - liquid?: boolean - expandRows?: boolean // TODO: how to get a bottom rule? - syncRowHeights?: boolean // yuck - isSticky?: boolean -} - -export type ChunkConfigContent = (contentProps: ChunkContentCallbackArgs) => VNode -export type ChunkConfigRowContent = VNode | ChunkConfigContent - -export interface ChunkConfig { - elRef?: Ref - outerContent?: VNode - content?: ChunkConfigContent - rowContent?: ChunkConfigRowContent - scrollerElRef?: Ref - tableClassName?: string -} - -export interface ChunkContentCallbackArgs { // TODO: util for wrapping tables!? - tableColGroupNode: VNode - tableMinWidth: CssDimValue - clientWidth: number | null // important to know whether 0 or not-yet-determined. for headless testing - clientHeight: number | null // - expandRows: boolean - syncRowHeights: boolean - rowSyncHeights: number[] - reportRowHeightChange: (rowEl: HTMLElement, isStable: boolean) => void -} - -export function computeShrinkWidth(chunkEls: HTMLElement[]) { // all in same COL! - let shrinkCells = findElements(chunkEls, '.fc-scrollgrid-shrink') - let largestWidth = 0 - - for (let shrinkCell of shrinkCells) { - largestWidth = Math.max( - largestWidth, - computeSmallestCellWidth(shrinkCell), - ) - } - - return Math.ceil(largestWidth) // elements work best with integers. round up to ensure contents fits -} - -export interface ScrollerLike { // have scrollers implement? - needsYScrolling(): boolean - needsXScrolling(): boolean -} - -export function getSectionHasLiquidHeight(props: { liquid: boolean }, sectionConfig: SectionConfig) { - return props.liquid && sectionConfig.liquid // does the section do liquid-height? (need to have whole scrollgrid liquid-height as well) -} - -export function getAllowYScrolling(props: { liquid: boolean }, sectionConfig: SectionConfig) { - return sectionConfig.maxHeight != null || // if its possible for the height to max out, we might need scrollbars - getSectionHasLiquidHeight(props, sectionConfig) // if the section is liquid height, it might condense enough to require scrollbars -} - -// TODO: ONLY use `arg`. force out internal function to use same API -export function renderChunkContent( - sectionConfig: SectionConfig, - chunkConfig: ChunkConfig, - arg: ChunkContentCallbackArgs, - isHeader: boolean, -) { - let { expandRows } = arg - - let content: VNode = typeof chunkConfig.content === 'function' ? - chunkConfig.content(arg) : - createElement( - 'table', - { - role: 'presentation', - className: [ - chunkConfig.tableClassName, - sectionConfig.syncRowHeights ? 'fc-scrollgrid-sync-table' : '', - ].join(' '), - style: { - minWidth: arg.tableMinWidth, // because colMinWidths arent enough - width: arg.clientWidth, - height: expandRows ? arg.clientHeight : '', // css `height` on a
serves as a min-height - }, - }, - arg.tableColGroupNode, - createElement( - isHeader ? 'thead' : 'tbody', - { - role: 'presentation', - }, - typeof chunkConfig.rowContent === 'function' - ? chunkConfig.rowContent(arg) - : chunkConfig.rowContent, - ), - ) - - return content -} - -export function isColPropsEqual(cols0: ColProps[], cols1: ColProps[]) { - return isArraysEqual(cols0, cols1, isPropsEqual) -} - -export function renderMicroColGroup(cols: ColProps[], shrinkWidth?: number): VNode { - let colNodes: VNode[] = [] - - /* - for ColProps with spans, it would have been great to make a single - HOWEVER, Chrome was getting messing up distributing the width to elements makes Chrome behave. - */ - for (let colProps of cols) { - let span = colProps.span || 1 - - for (let i = 0; i < span; i += 1) { - colNodes.push( - , - ) - } - } - - return createElement('colgroup', {}, ...colNodes) -} - -export function sanitizeShrinkWidth(shrinkWidth?: number) { - /* why 4? if we do 0, it will kill any border, which are needed for computeSmallestCellWidth - 4 accounts for 2 2-pixel borders. TODO: better solution? */ - return shrinkWidth == null ? 4 : shrinkWidth -} - -export function hasShrinkWidth(cols: ColProps[]) { - for (let col of cols) { - if (col.width === 'shrink') { - return true - } - } - - return false -} - -export function getScrollGridClassNames(liquid: boolean, context: ViewContext) { - let classNames = [ - 'fc-scrollgrid', - context.theme.getClass('table'), - ] - - if (liquid) { - classNames.push('fc-scrollgrid-liquid') - } - - return classNames -} - -export function getSectionClassNames(sectionConfig: SectionConfig, wholeTableVGrow: boolean) { - let classNames = [ - 'fc-scrollgrid-section', - `fc-scrollgrid-section-${sectionConfig.type}`, - sectionConfig.className, // used? - ] - - if (wholeTableVGrow && sectionConfig.liquid && sectionConfig.maxHeight == null) { - classNames.push('fc-scrollgrid-section-liquid') - } - - if (sectionConfig.isSticky) { - classNames.push('fc-scrollgrid-section-sticky') - } - - return classNames -} - -export function renderScrollShim(arg: ChunkContentCallbackArgs) { - return ( -
- ) -} - -export function getStickyHeaderDates(options: BaseOptionsRefined) { - let { stickyHeaderDates } = options - - if (stickyHeaderDates == null || stickyHeaderDates === 'auto') { - stickyHeaderDates = options.height === 'auto' || options.viewHeight === 'auto' - } - - return stickyHeaderDates -} - -export function getStickyFooterScrollbar(options: BaseOptionsRefined) { - let { stickyFooterScrollbar } = options - - if (stickyFooterScrollbar == null || stickyFooterScrollbar === 'auto') { - stickyFooterScrollbar = options.height === 'auto' || options.viewHeight === 'auto' - } - - return stickyFooterScrollbar -} diff --git a/fullcalendar-main/packages/core/src/seg-hierarchy.ts b/fullcalendar-main/packages/core/src/seg-hierarchy.ts deleted file mode 100644 index 70daa37..0000000 --- a/fullcalendar-main/packages/core/src/seg-hierarchy.ts +++ /dev/null @@ -1,316 +0,0 @@ -export interface SegSpan { - start: number - end: number -} - -export interface SegEntry { - index: number - thickness?: number // should be an integer - span: SegSpan -} - -// used internally. exposed for subclasses of SegHierarchy -export interface SegInsertion { - level: number // will have an equal coord, or slightly before, entries in existing level - levelCoord: number - lateral: number // where to insert in the existing level. -1 if creating a new level - touchingLevel: number // -1 if no touching - touchingLateral: number // -1 if no touching - touchingEntry: SegEntry // the last touching entry in the level - stackCnt: number -} - -export interface SegRect extends SegEntry { - thickness: number - levelCoord: number -} - -export interface SegEntryGroup { - entries: SegEntry[] - span: SegSpan -} - -export class SegHierarchy { - // settings - strictOrder: boolean = false - allowReslicing: boolean = false - maxCoord: number = -1 // -1 means no max - maxStackCnt: number = -1 // -1 means no max - - levelCoords: number[] = [] // ordered - entriesByLevel: SegEntry[][] = [] // parallel with levelCoords - stackCnts: { [entryId: string]: number } = {} // TODO: use better technique!? - - constructor( - private getEntryThickness = (entry: SegEntry): number => { - // if no thickness known, assume 1 (if 0, so small it always fits) - return entry.thickness || 1 - }, - ) {} - - addSegs(inputs: SegEntry[]): SegEntry[] { - let hiddenEntries: SegEntry[] = [] - - for (let input of inputs) { - this.insertEntry(input, hiddenEntries) - } - - return hiddenEntries - } - - insertEntry(entry: SegEntry, hiddenEntries: SegEntry[]): void { - let insertion = this.findInsertion(entry) - - if (this.isInsertionValid(insertion, entry)) { - this.insertEntryAt(entry, insertion) - } else { - this.handleInvalidInsertion(insertion, entry, hiddenEntries) - } - } - - isInsertionValid(insertion: SegInsertion, entry: SegEntry): boolean { - return (this.maxCoord === -1 || insertion.levelCoord + this.getEntryThickness(entry) <= this.maxCoord) && - (this.maxStackCnt === -1 || insertion.stackCnt < this.maxStackCnt) - } - - handleInvalidInsertion(insertion: SegInsertion, entry: SegEntry, hiddenEntries: SegEntry[]): void { - if (this.allowReslicing && insertion.touchingEntry) { - const hiddenEntry = { - ...entry, - span: intersectSpans(entry.span, insertion.touchingEntry.span), - } - - hiddenEntries.push(hiddenEntry) - this.splitEntry(entry, insertion.touchingEntry, hiddenEntries) - } else { - hiddenEntries.push(entry) - } - } - - /* - Does NOT add what hit the `barrier` into hiddenEntries. Should already be done. - */ - splitEntry(entry: SegEntry, barrier: SegEntry, hiddenEntries: SegEntry[]): void { - let entrySpan = entry.span - let barrierSpan = barrier.span - - if (entrySpan.start < barrierSpan.start) { - this.insertEntry({ - index: entry.index, - thickness: entry.thickness, - span: { start: entrySpan.start, end: barrierSpan.start }, - }, hiddenEntries) - } - - if (entrySpan.end > barrierSpan.end) { - this.insertEntry({ - index: entry.index, - thickness: entry.thickness, - span: { start: barrierSpan.end, end: entrySpan.end }, - }, hiddenEntries) - } - } - - insertEntryAt(entry: SegEntry, insertion: SegInsertion): void { - let { entriesByLevel, levelCoords } = this - - if (insertion.lateral === -1) { - // create a new level - insertAt(levelCoords, insertion.level, insertion.levelCoord) - insertAt(entriesByLevel, insertion.level, [entry]) - } else { - // insert into existing level - insertAt(entriesByLevel[insertion.level], insertion.lateral, entry) - } - - this.stackCnts[buildEntryKey(entry)] = insertion.stackCnt - } - - /* - does not care about limits - */ - findInsertion(newEntry: SegEntry): SegInsertion { - let { levelCoords, entriesByLevel, strictOrder, stackCnts } = this - let levelCnt = levelCoords.length - let candidateCoord = 0 - let touchingLevel: number = -1 - let touchingLateral: number = -1 - let touchingEntry: SegEntry = null - let stackCnt = 0 - - for (let trackingLevel = 0; trackingLevel < levelCnt; trackingLevel += 1) { - const trackingCoord = levelCoords[trackingLevel] - - // if the current level is past the placed entry, we have found a good empty space and can stop. - // if strictOrder, keep finding more lateral intersections. - if (!strictOrder && trackingCoord >= candidateCoord + this.getEntryThickness(newEntry)) { - break - } - - let trackingEntries = entriesByLevel[trackingLevel] - let trackingEntry: SegEntry - let searchRes = binarySearch(trackingEntries, newEntry.span.start, getEntrySpanEnd) // find first entry after newEntry's end - let lateralIndex = searchRes[0] + searchRes[1] // if exact match (which doesn't collide), go to next one - - while ( // loop through entries that horizontally intersect - (trackingEntry = trackingEntries[lateralIndex]) && // but not past the whole entry list - trackingEntry.span.start < newEntry.span.end // and not entirely past newEntry - ) { - let trackingEntryBottom = trackingCoord + this.getEntryThickness(trackingEntry) - // intersects into the top of the candidate? - if (trackingEntryBottom > candidateCoord) { - candidateCoord = trackingEntryBottom - touchingEntry = trackingEntry - touchingLevel = trackingLevel - touchingLateral = lateralIndex - } - // butts up against top of candidate? (will happen if just intersected as well) - if (trackingEntryBottom === candidateCoord) { - // accumulate the highest possible stackCnt of the trackingEntries that butt up - stackCnt = Math.max(stackCnt, stackCnts[buildEntryKey(trackingEntry)] + 1) - } - lateralIndex += 1 - } - } - - // the destination level will be after touchingEntry's level. find it - let destLevel = 0 - if (touchingEntry) { - destLevel = touchingLevel + 1 - while (destLevel < levelCnt && levelCoords[destLevel] < candidateCoord) { - destLevel += 1 - } - } - - // if adding to an existing level, find where to insert - let destLateral = -1 - if (destLevel < levelCnt && levelCoords[destLevel] === candidateCoord) { - destLateral = binarySearch(entriesByLevel[destLevel], newEntry.span.end, getEntrySpanEnd)[0] - } - - return { - touchingLevel, - touchingLateral, - touchingEntry, - stackCnt, - levelCoord: candidateCoord, - level: destLevel, - lateral: destLateral, - } - } - - // sorted by levelCoord (lowest to highest) - toRects(): SegRect[] { - let { entriesByLevel, levelCoords } = this - let levelCnt = entriesByLevel.length - let rects: SegRect[] = [] - - for (let level = 0; level < levelCnt; level += 1) { - let entries = entriesByLevel[level] - let levelCoord = levelCoords[level] - - for (let entry of entries) { - rects.push({ - ...entry, - thickness: this.getEntryThickness(entry), - levelCoord, - }) - } - } - - return rects - } -} - -export function getEntrySpanEnd(entry: SegEntry) { - return entry.span.end -} - -export function buildEntryKey(entry: SegEntry) { // TODO: use Map instead? - return entry.index + ':' + entry.span.start -} - -// returns groups with entries sorted by input order -export function groupIntersectingEntries(entries: SegEntry[]): SegEntryGroup[] { - let merges: SegEntryGroup[] = [] - - for (let entry of entries) { - let filteredMerges: SegEntryGroup[] = [] - let hungryMerge: SegEntryGroup = { // the merge that will eat what it collides with - span: entry.span, - entries: [entry], - } - - for (let merge of merges) { - if (intersectSpans(merge.span, hungryMerge.span)) { - hungryMerge = { - entries: merge.entries.concat(hungryMerge.entries), // keep preexisting merge's items first. maintains order - span: joinSpans(merge.span, hungryMerge.span), - } - } else { - filteredMerges.push(merge) - } - } - - filteredMerges.push(hungryMerge) - merges = filteredMerges - } - - return merges -} - -export function joinSpans(span0: SegSpan, span1: SegSpan): SegSpan { - return { - start: Math.min(span0.start, span1.start), - end: Math.max(span0.end, span1.end), - } -} - -export function intersectSpans(span0: SegSpan, span1: SegSpan): SegSpan | null { - let start = Math.max(span0.start, span1.start) - let end = Math.min(span0.end, span1.end) - - if (start < end) { - return { start, end } - } - - return null -} - -// general util -// --------------------------------------------------------------------------------------------------------------------- - -function insertAt(arr: Item[], index: number, item: Item) { - arr.splice(index, 0, item) -} - -export function binarySearch( - a: Item[], - searchVal: number, - getItemVal: (item: Item) => number, -): [number, number] { // returns [level, isExactMatch ? 1 : 0] - let startIndex = 0 - let endIndex = a.length // exclusive - - if (!endIndex || searchVal < getItemVal(a[startIndex])) { // no items OR before first item - return [0, 0] - } - if (searchVal > getItemVal(a[endIndex - 1])) { // after last item - return [endIndex, 0] - } - - while (startIndex < endIndex) { - let middleIndex = Math.floor(startIndex + (endIndex - startIndex) / 2) - let middleVal = getItemVal(a[middleIndex]) - - if (searchVal < middleVal) { - endIndex = middleIndex - } else if (searchVal > middleVal) { - startIndex = middleIndex + 1 - } else { // equal! - return [middleIndex, 1] - } - } - - return [startIndex, 0] -} diff --git a/fullcalendar-main/packages/core/src/structs/business-hours.ts b/fullcalendar-main/packages/core/src/structs/business-hours.ts deleted file mode 100644 index b6ee007..0000000 --- a/fullcalendar-main/packages/core/src/structs/business-hours.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { EventInput } from './event-parse.js' -import { EventStore, parseEvents } from './event-store.js' -import { CalendarContext } from '../CalendarContext.js' - -/* -Utils for converting raw business hour input into an EventStore, -for both rendering and the constraint system. -*/ - -export type BusinessHoursInput = boolean | EventInput | EventInput[] - -const DEF_DEFAULTS = { - startTime: '09:00', - endTime: '17:00', - daysOfWeek: [1, 2, 3, 4, 5], // monday - friday - display: 'inverse-background', - classNames: 'fc-non-business', - groupId: '_businessHours', // so multiple defs get grouped -} - -/* -TODO: pass around as EventDefHash!!! -*/ -export function parseBusinessHours(input: BusinessHoursInput, context: CalendarContext): EventStore { - return parseEvents( - refineInputs(input), - null, - context, - ) -} - -function refineInputs(input: BusinessHoursInput) { - let rawDefs - - if (input === true) { - rawDefs = [{}] // will get DEF_DEFAULTS verbatim - } else if (Array.isArray(input)) { - // if specifying an array, every sub-definition NEEDS a day-of-week - rawDefs = input.filter((rawDef) => rawDef.daysOfWeek) - } else if (typeof input === 'object' && input) { // non-null object - rawDefs = [input] - } else { // is probably false - rawDefs = [] - } - - rawDefs = rawDefs.map((rawDef) => ({ ...DEF_DEFAULTS, ...rawDef })) - - return rawDefs -} diff --git a/fullcalendar-main/packages/core/src/structs/constraint.ts b/fullcalendar-main/packages/core/src/structs/constraint.ts deleted file mode 100644 index 102dd6d..0000000 --- a/fullcalendar-main/packages/core/src/structs/constraint.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { EventStore, parseEvents } from './event-store.js' -import { EventInput } from './event-parse.js' -import { DateSpanApi } from './date-span.js' -import { EventImpl } from '../api/EventImpl.js' -import { SplittableProps } from '../component/event-splitting.js' -import { CalendarContext } from '../CalendarContext.js' - -// TODO: rename to "criteria" ? -export type ConstraintInput = 'businessHours' | string | EventInput | EventInput[] -export type Constraint = 'businessHours' | string | EventStore | false // false means won't pass at all -export type OverlapFunc = ((stillEvent: EventImpl, movingEvent: EventImpl | null) => boolean) -export type AllowFunc = (span: DateSpanApi, movingEvent: EventImpl | null) => boolean -export type isPropsValidTester = (props: SplittableProps, context: CalendarContext) => boolean - -export function normalizeConstraint(input: ConstraintInput, context: CalendarContext): Constraint | null { - if (Array.isArray(input)) { - return parseEvents(input, null, context, true) // allowOpenRange=true - } if (typeof input === 'object' && input) { // non-null object - return parseEvents([input], null, context, true) // allowOpenRange=true - } if (input != null) { - return String(input) - } - return null -} diff --git a/fullcalendar-main/packages/core/src/structs/date-span.ts b/fullcalendar-main/packages/core/src/structs/date-span.ts deleted file mode 100644 index 5818b4b..0000000 --- a/fullcalendar-main/packages/core/src/structs/date-span.ts +++ /dev/null @@ -1,179 +0,0 @@ -import { DateRange, rangesEqual, OpenDateRange } from '../datelib/date-range.js' -import { DateInput, DateEnv } from '../datelib/env.js' -import { Duration } from '../datelib/duration.js' -import { createEventInstance } from './event-instance.js' -import { parseEventDef, refineEventDef } from './event-parse.js' -import { EventRenderRange, compileEventUi } from '../component/event-rendering.js' -import { EventUiHash } from '../component/event-ui.js' -import { CalendarContext } from '../CalendarContext.js' -import { refineProps, identity, Identity } from '../options.js' - -/* -A data-structure for a date-range that will be visually displayed. -Contains other metadata like allDay, and anything else Components might like to store. - -TODO: in future, put otherProps in own object. -*/ - -export interface OpenDateSpanInput { - start?: DateInput - end?: DateInput - allDay?: boolean - [otherProp: string]: any -} - -export interface DateSpanInput extends OpenDateSpanInput { - start: DateInput - end: DateInput -} - -export interface OpenDateSpan { - range: OpenDateRange - allDay: boolean - [otherProp: string]: any -} - -export interface DateSpan extends OpenDateSpan { - range: DateRange -} - -export interface RangeApi { - start: Date - end: Date - startStr: string - endStr: string -} - -export interface DateSpanApi extends RangeApi { - allDay: boolean -} - -export interface RangeApiWithTimeZone extends RangeApi { - timeZone: string -} - -export interface DatePointApi { - date: Date - dateStr: string - allDay: boolean -} - -const STANDARD_PROPS = { - start: identity as Identity, - end: identity as Identity, - allDay: Boolean, -} - -export function parseDateSpan(raw: DateSpanInput, dateEnv: DateEnv, defaultDuration?: Duration): DateSpan | null { - let span = parseOpenDateSpan(raw, dateEnv) - let { range } = span - - if (!range.start) { - return null - } - - if (!range.end) { - if (defaultDuration == null) { - return null - } - range.end = dateEnv.add(range.start, defaultDuration) - } - - return span as DateSpan -} - -/* -TODO: somehow combine with parseRange? -Will return null if the start/end props were present but parsed invalidly. -*/ -export function parseOpenDateSpan(raw: OpenDateSpanInput, dateEnv: DateEnv): OpenDateSpan | null { - let { refined: standardProps, extra } = refineProps(raw, STANDARD_PROPS) - let startMeta = standardProps.start ? dateEnv.createMarkerMeta(standardProps.start) : null - let endMeta = standardProps.end ? dateEnv.createMarkerMeta(standardProps.end) : null - let { allDay } = standardProps - - if (allDay == null) { - allDay = (startMeta && startMeta.isTimeUnspecified) && - (!endMeta || endMeta.isTimeUnspecified) - } - - return { - range: { - start: startMeta ? startMeta.marker : null, - end: endMeta ? endMeta.marker : null, - }, - allDay, - ...extra, - } -} - -export function isDateSpansEqual(span0: DateSpan, span1: DateSpan): boolean { - return rangesEqual(span0.range, span1.range) && - span0.allDay === span1.allDay && - isSpanPropsEqual(span0, span1) -} - -// the NON-DATE-RELATED props -function isSpanPropsEqual(span0: DateSpan, span1: DateSpan): boolean { - for (let propName in span1) { - if (propName !== 'range' && propName !== 'allDay') { - if (span0[propName] !== span1[propName]) { - return false - } - } - } - - // are there any props that span0 has that span1 DOESN'T have? - // both have range/allDay, so no need to special-case. - for (let propName in span0) { - if (!(propName in span1)) { - return false - } - } - - return true -} - -export function buildDateSpanApi(span: DateSpan, dateEnv: DateEnv): DateSpanApi { - return { - ...buildRangeApi(span.range, dateEnv, span.allDay), - allDay: span.allDay, - } -} - -export function buildRangeApiWithTimeZone(range: DateRange, dateEnv: DateEnv, omitTime?: boolean): RangeApiWithTimeZone { - return { - ...buildRangeApi(range, dateEnv, omitTime), - timeZone: dateEnv.timeZone, - } -} - -export function buildRangeApi(range: DateRange, dateEnv: DateEnv, omitTime?: boolean): RangeApi { - return { - start: dateEnv.toDate(range.start), - end: dateEnv.toDate(range.end), - startStr: dateEnv.formatIso(range.start, { omitTime }), - endStr: dateEnv.formatIso(range.end, { omitTime }), - } -} - -export function fabricateEventRange(dateSpan: DateSpan, eventUiBases: EventUiHash, context: CalendarContext): EventRenderRange { - let res = refineEventDef({ editable: false }, context) - let def = parseEventDef( - res.refined, - res.extra, - '', // sourceId - dateSpan.allDay, - true, // hasEnd - context, - ) - - return { - def, - ui: compileEventUi(def, eventUiBases), - instance: createEventInstance(def.defId, dateSpan.range), - range: dateSpan.range, - isStart: true, - isEnd: true, - } -} diff --git a/fullcalendar-main/packages/core/src/structs/drag-meta.ts b/fullcalendar-main/packages/core/src/structs/drag-meta.ts deleted file mode 100644 index a52241b..0000000 --- a/fullcalendar-main/packages/core/src/structs/drag-meta.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { createDuration, Duration } from '../datelib/duration.js' -import { refineProps, RawOptionsFromRefiners, Dictionary } from '../options.js' - -/* -Information about what will happen when an external element is dragged-and-dropped -onto a calendar. Contains information for creating an event. -*/ - -const DRAG_META_REFINERS = { - startTime: createDuration, - duration: createDuration, - create: Boolean, - sourceId: String, -} - -export type DragMetaInput = - RawOptionsFromRefiners & - { [otherProp: string]: any } // for leftoverProps - -export interface DragMeta { - startTime: Duration | null - duration: Duration | null - create: boolean // create an event when dropped? - sourceId: string // similar to addEvent's parameter - leftoverProps: Dictionary -} - -export function parseDragMeta(raw: DragMetaInput): DragMeta { - let { refined, extra } = refineProps(raw, DRAG_META_REFINERS) - - return { - startTime: refined.startTime || null, - duration: refined.duration || null, - create: refined.create != null ? refined.create : true, - sourceId: refined.sourceId, - leftoverProps: extra, - } -} diff --git a/fullcalendar-main/packages/core/src/structs/event-def.ts b/fullcalendar-main/packages/core/src/structs/event-def.ts deleted file mode 100644 index 39457f1..0000000 --- a/fullcalendar-main/packages/core/src/structs/event-def.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Duration } from '../datelib/duration.js' -import { EventUi } from '../component/event-ui.js' -import { Dictionary } from '../options.js' - -export interface EventDef { // TODO: add recurring type here? - defId: string - sourceId: string - publicId: string - groupId: string - allDay: boolean - hasEnd: boolean - recurringDef: { typeId: number, typeData: any, duration: Duration | null } | null - title: string - url: string - ui: EventUi - interactive?: boolean - extendedProps: Dictionary -} - -export type EventDefHash = { [defId: string]: EventDef } diff --git a/fullcalendar-main/packages/core/src/structs/event-instance.ts b/fullcalendar-main/packages/core/src/structs/event-instance.ts deleted file mode 100644 index 9169bc9..0000000 --- a/fullcalendar-main/packages/core/src/structs/event-instance.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { DateRange } from '../datelib/date-range.js' -import { guid } from '../util/misc.js' - -export interface EventInstance { - instanceId: string - defId: string - range: DateRange - forcedStartTzo: number | null - forcedEndTzo: number | null -} - -export type EventInstanceHash = { [instanceId: string]: EventInstance } - -export function createEventInstance( - defId: string, - range: DateRange, - forcedStartTzo?: number, - forcedEndTzo?: number, -): EventInstance { - return { - instanceId: guid(), - defId, - range, - forcedStartTzo: forcedStartTzo == null ? null : forcedStartTzo, - forcedEndTzo: forcedEndTzo == null ? null : forcedEndTzo, - } -} diff --git a/fullcalendar-main/packages/core/src/structs/event-mutation.ts b/fullcalendar-main/packages/core/src/structs/event-mutation.ts deleted file mode 100644 index 1d38fa8..0000000 --- a/fullcalendar-main/packages/core/src/structs/event-mutation.ts +++ /dev/null @@ -1,146 +0,0 @@ -import { Duration } from '../datelib/duration.js' -import { EventStore, createEmptyEventStore } from './event-store.js' -import { EventDef } from './event-def.js' -import { EventInstance } from './event-instance.js' -import { computeAlignedDayRange } from '../util/date.js' -import { startOfDay } from '../datelib/marker.js' -import { EventUiHash, EventUi } from '../component/event-ui.js' -import { compileEventUis } from '../component/event-rendering.js' -import { CalendarContext } from '../CalendarContext.js' -import { getDefaultEventEnd } from '../calendar-utils.js' - -/* -A data structure for how to modify an EventDef/EventInstance within an EventStore -*/ - -export interface EventMutation { - datesDelta?: Duration // body start+end moving together. for dragging - startDelta?: Duration // for resizing - endDelta?: Duration // for resizing - standardProps?: any // for the def. should not include extendedProps - extendedProps?: any // for the def -} - -// applies the mutation to ALL defs/instances within the event store -export function applyMutationToEventStore( - eventStore: EventStore, - eventConfigBase: EventUiHash, - mutation: EventMutation, - context: CalendarContext, -): EventStore { - let eventConfigs = compileEventUis(eventStore.defs, eventConfigBase) - let dest = createEmptyEventStore() - - for (let defId in eventStore.defs) { - let def = eventStore.defs[defId] - - dest.defs[defId] = applyMutationToEventDef(def, eventConfigs[defId], mutation, context) - } - - for (let instanceId in eventStore.instances) { - let instance = eventStore.instances[instanceId] - let def = dest.defs[instance.defId] // important to grab the newly modified def - - dest.instances[instanceId] = applyMutationToEventInstance(instance, def, eventConfigs[instance.defId], mutation, context) - } - - return dest -} - -export type eventDefMutationApplier = (eventDef: EventDef, mutation: EventMutation, context: CalendarContext) => void - -function applyMutationToEventDef(eventDef: EventDef, eventConfig: EventUi, mutation: EventMutation, context: CalendarContext): EventDef { - let standardProps = mutation.standardProps || {} - - // if hasEnd has not been specified, guess a good value based on deltas. - // if duration will change, there's no way the default duration will persist, - // and thus, we need to mark the event as having a real end - if ( - standardProps.hasEnd == null && - eventConfig.durationEditable && - (mutation.startDelta || mutation.endDelta) - ) { - standardProps.hasEnd = true // TODO: is this mutation okay? - } - - let copy: EventDef = { - ...eventDef, - ...standardProps, - ui: { ...eventDef.ui, ...standardProps.ui }, // the only prop we want to recursively overlay - } - - if (mutation.extendedProps) { - copy.extendedProps = { ...copy.extendedProps, ...mutation.extendedProps } - } - - for (let applier of context.pluginHooks.eventDefMutationAppliers) { - applier(copy, mutation, context) - } - - if (!copy.hasEnd && context.options.forceEventDuration) { - copy.hasEnd = true - } - - return copy -} - -function applyMutationToEventInstance( - eventInstance: EventInstance, - eventDef: EventDef, // must first be modified by applyMutationToEventDef - eventConfig: EventUi, - mutation: EventMutation, - context: CalendarContext, -): EventInstance { - let { dateEnv } = context - let forceAllDay = mutation.standardProps && mutation.standardProps.allDay === true - let clearEnd = mutation.standardProps && mutation.standardProps.hasEnd === false - let copy = { ...eventInstance } as EventInstance - - if (forceAllDay) { - copy.range = computeAlignedDayRange(copy.range) - } - - if (mutation.datesDelta && eventConfig.startEditable) { - copy.range = { - start: dateEnv.add(copy.range.start, mutation.datesDelta), - end: dateEnv.add(copy.range.end, mutation.datesDelta), - } - } - - if (mutation.startDelta && eventConfig.durationEditable) { - copy.range = { - start: dateEnv.add(copy.range.start, mutation.startDelta), - end: copy.range.end, - } - } - - if (mutation.endDelta && eventConfig.durationEditable) { - copy.range = { - start: copy.range.start, - end: dateEnv.add(copy.range.end, mutation.endDelta), - } - } - - if (clearEnd) { - copy.range = { - start: copy.range.start, - end: getDefaultEventEnd(eventDef.allDay, copy.range.start, context), - } - } - - // in case event was all-day but the supplied deltas were not - // better util for this? - if (eventDef.allDay) { - copy.range = { - start: startOfDay(copy.range.start), - end: startOfDay(copy.range.end), - } - } - - // handle invalid durations - if (copy.range.end < copy.range.start) { - copy.range.end = getDefaultEventEnd(eventDef.allDay, copy.range.start, context) - } - - return copy -} diff --git a/fullcalendar-main/packages/core/src/structs/event-parse.ts b/fullcalendar-main/packages/core/src/structs/event-parse.ts deleted file mode 100644 index 098333b..0000000 --- a/fullcalendar-main/packages/core/src/structs/event-parse.ts +++ /dev/null @@ -1,246 +0,0 @@ -import { guid } from '../util/misc.js' -import { DateInput } from '../datelib/env.js' -import { startOfDay } from '../datelib/marker.js' -import { parseRecurring } from './recurring-event.js' -import { CalendarContext } from '../CalendarContext.js' -import { EventDef } from './event-def.js' -import { createEventInstance, EventInstance } from './event-instance.js' -import { EventSource } from './event-source.js' -import { RefinedOptionsFromRefiners, RawOptionsFromRefiners, identity, Identity, Dictionary, refineProps, GenericRefiners } from '../options.js' -import { EVENT_UI_REFINERS, createEventUi, EventUiInput, EventUiRefined } from '../component/event-ui.js' -import { EventDefIdMap, EventInstanceIdMap } from '../reducers/eventStore.js' - -export const EVENT_NON_DATE_REFINERS = { - id: String, - groupId: String, - title: String, - url: String, - interactive: Boolean, -} - -export const EVENT_DATE_REFINERS = { - start: identity as Identity, - end: identity as Identity, - date: identity as Identity, - allDay: Boolean, -} - -const EVENT_REFINERS = { // does NOT include EVENT_UI_REFINERS - ...EVENT_NON_DATE_REFINERS, - ...EVENT_DATE_REFINERS, - extendedProps: identity as Identity, -} - -type BuiltInEventRefiners = typeof EVENT_REFINERS - -export interface EventRefiners extends BuiltInEventRefiners { - // for ambient -} - -export type EventInput = - EventUiInput & - RawOptionsFromRefiners> & // Required hack - { [extendedProp: string]: any } - -export type EventRefined = - EventUiRefined & - RefinedOptionsFromRefiners> // Required hack - -export interface EventTuple { - def: EventDef - instance: EventInstance | null -} - -export type EventInputTransformer = (input: EventInput) => EventInput -export type EventDefMemberAdder = (refined: EventRefined) => Partial - -export function parseEvent( - raw: EventInput, - eventSource: EventSource | null, - context: CalendarContext, - allowOpenRange: boolean, - refiners = buildEventRefiners(context), - defIdMap?: EventDefIdMap, - instanceIdMap?: EventInstanceIdMap, -): EventTuple | null { - let { refined, extra } = refineEventDef(raw, context, refiners) - - let defaultAllDay = computeIsDefaultAllDay(eventSource, context) - let recurringRes = parseRecurring( - refined, - defaultAllDay, - context.dateEnv, - context.pluginHooks.recurringTypes, - ) - - if (recurringRes) { - let def = parseEventDef( - refined, - extra, - eventSource ? eventSource.sourceId : '', - recurringRes.allDay, - Boolean(recurringRes.duration), - context, - defIdMap, - ) - - def.recurringDef = { // don't want all the props from recurringRes. TODO: more efficient way to do this - typeId: recurringRes.typeId, - typeData: recurringRes.typeData, - duration: recurringRes.duration, - } - - return { def, instance: null } - } - - let singleRes = parseSingle(refined, defaultAllDay, context, allowOpenRange) - - if (singleRes) { - let def = parseEventDef(refined, extra, eventSource ? eventSource.sourceId : '', singleRes.allDay, singleRes.hasEnd, context, defIdMap) - let instance = createEventInstance(def.defId, singleRes.range, singleRes.forcedStartTzo, singleRes.forcedEndTzo) - - if (instanceIdMap && def.publicId && instanceIdMap[def.publicId]) { - instance.instanceId = instanceIdMap[def.publicId] - } - - return { def, instance } - } - - return null -} - -export function refineEventDef(raw: EventInput, context: CalendarContext, refiners = buildEventRefiners(context)): { - refined: RefinedOptionsFromRefiners, - extra: Dictionary, -} { - return refineProps(raw, refiners) -} - -export function buildEventRefiners(context: CalendarContext): GenericRefiners { - return { ...EVENT_UI_REFINERS, ...EVENT_REFINERS, ...context.pluginHooks.eventRefiners } -} - -/* -Will NOT populate extendedProps with the leftover properties. -Will NOT populate date-related props. -*/ -export function parseEventDef( - refined: EventRefined, - extra: Dictionary, - sourceId: string, - allDay: boolean, - hasEnd: boolean, - context: CalendarContext, - defIdMap?: EventDefIdMap, -): EventDef { - let def: EventDef = { - title: refined.title || '', - groupId: refined.groupId || '', - publicId: refined.id || '', - url: refined.url || '', - recurringDef: null, - defId: ((defIdMap && refined.id) ? defIdMap[refined.id] : '') || guid(), - sourceId, - allDay, - hasEnd, - interactive: refined.interactive, - ui: createEventUi(refined, context), - extendedProps: { - ...(refined.extendedProps || {}), - ...extra, - }, - } - - for (let memberAdder of context.pluginHooks.eventDefMemberAdders) { - Object.assign(def, memberAdder(refined)) - } - - // help out EventImpl from having user modify props - Object.freeze(def.ui.classNames) - Object.freeze(def.extendedProps) - - return def -} - -function parseSingle(refined: EventRefined, defaultAllDay: boolean | null, context: CalendarContext, allowOpenRange?: boolean) { - let { allDay } = refined - let startMeta - let startMarker = null - let hasEnd = false - let endMeta - let endMarker = null - - let startInput = refined.start != null ? refined.start : refined.date - startMeta = context.dateEnv.createMarkerMeta(startInput) - - if (startMeta) { - startMarker = startMeta.marker - } else if (!allowOpenRange) { - return null - } - - if (refined.end != null) { - endMeta = context.dateEnv.createMarkerMeta(refined.end) - } - - if (allDay == null) { - if (defaultAllDay != null) { - allDay = defaultAllDay - } else { - // fall back to the date props LAST - allDay = (!startMeta || startMeta.isTimeUnspecified) && - (!endMeta || endMeta.isTimeUnspecified) - } - } - - if (allDay && startMarker) { - startMarker = startOfDay(startMarker) - } - - if (endMeta) { - endMarker = endMeta.marker - - if (allDay) { - endMarker = startOfDay(endMarker) - } - - if (startMarker && endMarker <= startMarker) { - endMarker = null - } - } - - if (endMarker) { - hasEnd = true - } else if (!allowOpenRange) { - hasEnd = context.options.forceEventDuration || false - - endMarker = context.dateEnv.add( - startMarker, - allDay ? - context.options.defaultAllDayEventDuration : - context.options.defaultTimedEventDuration, - ) - } - - return { - allDay, - hasEnd, - range: { start: startMarker, end: endMarker }, - forcedStartTzo: startMeta ? startMeta.forcedTzo : null, - forcedEndTzo: endMeta ? endMeta.forcedTzo : null, - } -} - -function computeIsDefaultAllDay(eventSource: EventSource | null, context: CalendarContext): boolean | null { - let res = null - - if (eventSource) { - res = eventSource.defaultAllDay - } - - if (res == null) { - res = context.options.defaultAllDay - } - - return res -} diff --git a/fullcalendar-main/packages/core/src/structs/event-source-def.ts b/fullcalendar-main/packages/core/src/structs/event-source-def.ts deleted file mode 100644 index 7ed1949..0000000 --- a/fullcalendar-main/packages/core/src/structs/event-source-def.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { EventSourceFetcher } from './event-source.js' -import { EventSourceRefined } from './event-source-parse.js' - -export interface EventSourceDef { - ignoreRange?: boolean - parseMeta: (refined: EventSourceRefined) => Meta | null - fetch: EventSourceFetcher -} diff --git a/fullcalendar-main/packages/core/src/structs/event-source-parse.ts b/fullcalendar-main/packages/core/src/structs/event-source-parse.ts deleted file mode 100644 index 8bc1c8f..0000000 --- a/fullcalendar-main/packages/core/src/structs/event-source-parse.ts +++ /dev/null @@ -1,103 +0,0 @@ -import { EventInput, EventInputTransformer } from './event-parse.js' -import { EventSourceFunc } from '../event-sources/func-event-source.js' -import { EventSource, EventSourceSuccessResponseHandler, EventSourceErrorResponseHandler } from './event-source.js' -import { JSON_FEED_EVENT_SOURCE_REFINERS } from '../event-sources/json-feed-event-source-refiners.js' -import { CalendarContext } from '../CalendarContext.js' -import { guid } from '../util/misc.js' -import { EVENT_UI_REFINERS, createEventUi, EventUiInput, EventUiRefined } from '../component/event-ui.js' -import { identity, Identity, RawOptionsFromRefiners, refineProps, RefinedOptionsFromRefiners } from '../options.js' - -const EVENT_SOURCE_REFINERS = { // does NOT include EVENT_UI_REFINERS - id: String, - defaultAllDay: Boolean, - url: String, - format: String, - events: identity as Identity, // array or function - eventDataTransform: identity as Identity, - - // for any network-related sources - success: identity as Identity, - failure: identity as Identity, -} - -type BuiltInEventSourceRefiners = typeof EVENT_SOURCE_REFINERS & - typeof JSON_FEED_EVENT_SOURCE_REFINERS - -export interface EventSourceRefiners extends BuiltInEventSourceRefiners { - // for extending -} - -export type EventSourceInputObject = - EventUiInput & - RawOptionsFromRefiners> // Required hack - -export type EventSourceInput = - EventSourceInputObject | // object in extended form - EventInput[] | - EventSourceFunc | // just a function - string // a URL for a JSON feed - -export type EventSourceRefined = - EventUiRefined & - RefinedOptionsFromRefiners> // Required hack - -export function parseEventSource( - raw: EventSourceInput, - context: CalendarContext, - refiners = buildEventSourceRefiners(context), -): EventSource | null { - let rawObj: EventSourceInputObject - - if (typeof raw === 'string') { - rawObj = { url: raw } - } else if (typeof raw === 'function' || Array.isArray(raw)) { - rawObj = { events: raw } - } else if (typeof raw === 'object' && raw) { // not null - rawObj = raw - } - - if (rawObj) { - let { refined, extra } = refineProps(rawObj, refiners) - let metaRes = buildEventSourceMeta(refined, context) - - if (metaRes) { - return { - _raw: raw, - isFetching: false, - latestFetchId: '', - fetchRange: null, - defaultAllDay: refined.defaultAllDay, - eventDataTransform: refined.eventDataTransform, - success: refined.success, - failure: refined.failure, - publicId: refined.id || '', - sourceId: guid(), - sourceDefId: metaRes.sourceDefId, - meta: metaRes.meta, - ui: createEventUi(refined, context), - extendedProps: extra, - } - } - } - - return null -} - -export function buildEventSourceRefiners(context: CalendarContext) { - return { ...EVENT_UI_REFINERS, ...EVENT_SOURCE_REFINERS, ...context.pluginHooks.eventSourceRefiners } -} - -function buildEventSourceMeta(raw: EventSourceRefined, context: CalendarContext) { - let defs = context.pluginHooks.eventSourceDefs - - for (let i = defs.length - 1; i >= 0; i -= 1) { // later-added plugins take precedence - let def = defs[i] - let meta = def.parseMeta(raw) - - if (meta) { - return { sourceDefId: i, meta } - } - } - - return null -} diff --git a/fullcalendar-main/packages/core/src/structs/event-source.ts b/fullcalendar-main/packages/core/src/structs/event-source.ts deleted file mode 100644 index 9da6ad5..0000000 --- a/fullcalendar-main/packages/core/src/structs/event-source.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { EventInput, EventInputTransformer } from './event-parse.js' -import { DateRange } from '../datelib/date-range.js' -import { EventUi } from '../component/event-ui.js' -import { CalendarContext } from '../CalendarContext.js' -import { CalendarImpl } from '../api/CalendarImpl.js' -import { Dictionary } from '../options.js' - -/* -TODO: "EventSource" is the same name as a built-in type in TypeScript. Rethink. -*/ - -export type EventSourceSuccessResponseHandler = (this: CalendarImpl, rawData: any, response: any) => EventInput[] | void -export type EventSourceErrorResponseHandler = (error: Error) => void - -export interface EventSource { - _raw: any - sourceId: string - sourceDefId: number // one of the few IDs that's a NUMBER not a string - meta: Meta - publicId: string - isFetching: boolean - latestFetchId: string - fetchRange: DateRange | null - defaultAllDay: boolean | null - eventDataTransform: EventInputTransformer // best to have this here? - ui: EventUi - success: EventSourceSuccessResponseHandler | null - failure: EventSourceErrorResponseHandler | null - extendedProps: Dictionary // undocumented -} - -export type EventSourceHash = { [sourceId: string]: EventSource } - -export interface EventSourceFetcherRes { - rawEvents: EventInput[] - response?: Response -} - -export type EventSourceFetcher = ( - arg: { - eventSource: EventSource - range: DateRange - isRefetch: boolean - context: CalendarContext - }, - successCallback: (res: EventSourceFetcherRes) => void, - errorCallback: (error: Error) => void, -) => void diff --git a/fullcalendar-main/packages/core/src/structs/event-store.ts b/fullcalendar-main/packages/core/src/structs/event-store.ts deleted file mode 100644 index bd3f925..0000000 --- a/fullcalendar-main/packages/core/src/structs/event-store.ts +++ /dev/null @@ -1,122 +0,0 @@ -import { EventDef, EventDefHash } from './event-def.js' -import { EventInstance, EventInstanceHash } from './event-instance.js' -import { EventInput, parseEvent, EventTuple, buildEventRefiners } from './event-parse.js' -import { filterHash } from '../util/object.js' -import { CalendarContext } from '../CalendarContext.js' -import { EventSource } from './event-source.js' -import { EventDefIdMap, EventInstanceIdMap } from '../reducers/eventStore.js' - -/* -A data structure that encapsulates EventDefs and EventInstances. -Utils for parsing this data from raw EventInputs. -Utils for manipulating an EventStore. -*/ - -export interface EventStore { - defs: EventDefHash - instances: EventInstanceHash -} - -export function parseEvents( - rawEvents: EventInput[], - eventSource: EventSource | null, - context: CalendarContext, - allowOpenRange?: boolean, - defIdMap?: EventDefIdMap, - instanceIdMap?: EventInstanceIdMap, -): EventStore { - let eventStore = createEmptyEventStore() - let eventRefiners = buildEventRefiners(context) - - for (let rawEvent of rawEvents) { - let tuple = parseEvent(rawEvent, eventSource, context, allowOpenRange, eventRefiners, defIdMap, instanceIdMap) - - if (tuple) { - eventTupleToStore(tuple, eventStore) - } - } - - return eventStore -} - -export function eventTupleToStore(tuple: EventTuple, eventStore: EventStore = createEmptyEventStore()) { - eventStore.defs[tuple.def.defId] = tuple.def - - if (tuple.instance) { - eventStore.instances[tuple.instance.instanceId] = tuple.instance - } - - return eventStore -} - -// retrieves events that have the same groupId as the instance specified by `instanceId` -// or they are the same as the instance. -// why might instanceId not be in the store? an event from another calendar? -export function getRelevantEvents(eventStore: EventStore, instanceId: string): EventStore { - let instance = eventStore.instances[instanceId] - - if (instance) { - let def = eventStore.defs[instance.defId] - - // get events/instances with same group - let newStore = filterEventStoreDefs(eventStore, (lookDef) => isEventDefsGrouped(def, lookDef)) - - // add the original - // TODO: wish we could use eventTupleToStore or something like it - newStore.defs[def.defId] = def - newStore.instances[instance.instanceId] = instance - - return newStore - } - - return createEmptyEventStore() -} - -function isEventDefsGrouped(def0: EventDef, def1: EventDef): boolean { - return Boolean(def0.groupId && def0.groupId === def1.groupId) -} - -export function createEmptyEventStore(): EventStore { - return { defs: {}, instances: {} } -} - -export function mergeEventStores(store0: EventStore, store1: EventStore): EventStore { - return { - defs: { ...store0.defs, ...store1.defs }, - instances: { ...store0.instances, ...store1.instances }, - } -} - -export function filterEventStoreDefs(eventStore: EventStore, filterFunc: (eventDef: EventDef) => boolean): EventStore { - let defs = filterHash(eventStore.defs, filterFunc) - let instances = filterHash(eventStore.instances, (instance: EventInstance) => ( - defs[instance.defId] // still exists? - )) - return { defs, instances } -} - -export function excludeSubEventStore(master: EventStore, sub: EventStore): EventStore { - let { defs, instances } = master - let filteredDefs: { [defId: string]: EventDef } = {} - let filteredInstances: { [instanceId: string]: EventInstance } = {} - - for (let defId in defs) { - if (!sub.defs[defId]) { // not explicitly excluded - filteredDefs[defId] = defs[defId] - } - } - - for (let instanceId in instances) { - if ( - !sub.instances[instanceId] && // not explicitly excluded - filteredDefs[instances[instanceId].defId] // def wasn't filtered away - ) { - filteredInstances[instanceId] = instances[instanceId] - } - } - - return { - defs: filteredDefs, - instances: filteredInstances, - } -} diff --git a/fullcalendar-main/packages/core/src/structs/recurring-event-simple-declare.ts b/fullcalendar-main/packages/core/src/structs/recurring-event-simple-declare.ts deleted file mode 100644 index e1dbffc..0000000 --- a/fullcalendar-main/packages/core/src/structs/recurring-event-simple-declare.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { SIMPLE_RECURRING_REFINERS } from './recurring-event-simple-refiners.js' - -type ExtraRefiners = typeof SIMPLE_RECURRING_REFINERS -declare module './event-parse.js' { - interface EventRefiners extends ExtraRefiners {} -} diff --git a/fullcalendar-main/packages/core/src/structs/recurring-event-simple-refiners.ts b/fullcalendar-main/packages/core/src/structs/recurring-event-simple-refiners.ts deleted file mode 100644 index bf3b332..0000000 --- a/fullcalendar-main/packages/core/src/structs/recurring-event-simple-refiners.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { createDuration } from '../datelib/duration.js' -import { DateInput } from '../datelib/env.js' -import { identity, Identity } from '../options.js' - -export const SIMPLE_RECURRING_REFINERS = { - daysOfWeek: identity as Identity, - startTime: createDuration, - endTime: createDuration, - duration: createDuration, - startRecur: identity as Identity, - endRecur: identity as Identity, -} diff --git a/fullcalendar-main/packages/core/src/structs/recurring-event-simple.ts b/fullcalendar-main/packages/core/src/structs/recurring-event-simple.ts deleted file mode 100644 index e084a33..0000000 --- a/fullcalendar-main/packages/core/src/structs/recurring-event-simple.ts +++ /dev/null @@ -1,109 +0,0 @@ -import { startOfDay, addDays, DateMarker } from '../datelib/marker.js' -import { Duration, subtractDurations } from '../datelib/duration.js' -import { arrayToHash } from '../util/object.js' -import { RecurringType } from './recurring-event.js' -import { EventRefined } from './event-parse.js' -import { DateRange, intersectRanges } from '../datelib/date-range.js' -import { DateEnv } from '../datelib/env.js' -import { createPlugin } from '../plugin-system.js' -import { SIMPLE_RECURRING_REFINERS } from './recurring-event-simple-refiners.js' -import './recurring-event-simple-declare.js' - -/* -An implementation of recurring events that only supports every-day or weekly recurrences. -*/ - -interface SimpleRecurringData { - daysOfWeek: number[] | null - startTime: Duration | null - endTime: Duration | null - startRecur: DateMarker | null - endRecur: DateMarker | null -} - -let recurring: RecurringType = { - - parse(refined: EventRefined, dateEnv: DateEnv) { - if (refined.daysOfWeek || refined.startTime || refined.endTime || refined.startRecur || refined.endRecur) { - let recurringData: SimpleRecurringData = { - daysOfWeek: refined.daysOfWeek || null, - startTime: refined.startTime || null, - endTime: refined.endTime || null, - startRecur: refined.startRecur ? dateEnv.createMarker(refined.startRecur) : null, - endRecur: refined.endRecur ? dateEnv.createMarker(refined.endRecur) : null, - } - - let duration: Duration - - if (refined.duration) { - duration = refined.duration - } - if (!duration && refined.startTime && refined.endTime) { - duration = subtractDurations(refined.endTime, refined.startTime) - } - - return { - allDayGuess: Boolean(!refined.startTime && !refined.endTime), - duration, - typeData: recurringData, // doesn't need endTime anymore but oh well - } - } - - return null - }, - - expand(typeData: SimpleRecurringData, framingRange: DateRange, dateEnv: DateEnv): DateMarker[] { - let clippedFramingRange = intersectRanges( - framingRange, - { start: typeData.startRecur, end: typeData.endRecur }, - ) - - if (clippedFramingRange) { - return expandRanges( - typeData.daysOfWeek, - typeData.startTime, - clippedFramingRange, - dateEnv, - ) - } - return [] - }, - -} - -export const simpleRecurringEventsPlugin = createPlugin({ - name: 'simple-recurring-event', - recurringTypes: [recurring], - eventRefiners: SIMPLE_RECURRING_REFINERS, -}) - -function expandRanges( - daysOfWeek: number[] | null, - startTime: Duration | null, - framingRange: DateRange, - dateEnv: DateEnv, -): DateMarker[] { - let dowHash: { [num: string]: true } | null = daysOfWeek ? arrayToHash(daysOfWeek) : null - let dayMarker = startOfDay(framingRange.start) - let endMarker = framingRange.end - let instanceStarts: DateMarker[] = [] - - while (dayMarker < endMarker) { - let instanceStart - - // if everyday, or this particular day-of-week - if (!dowHash || dowHash[dayMarker.getUTCDay()]) { - if (startTime) { - instanceStart = dateEnv.add(dayMarker, startTime) - } else { - instanceStart = dayMarker - } - - instanceStarts.push(instanceStart) - } - - dayMarker = addDays(dayMarker, 1) - } - - return instanceStarts -} diff --git a/fullcalendar-main/packages/core/src/structs/recurring-event.ts b/fullcalendar-main/packages/core/src/structs/recurring-event.ts deleted file mode 100644 index 3a69c7c..0000000 --- a/fullcalendar-main/packages/core/src/structs/recurring-event.ts +++ /dev/null @@ -1,121 +0,0 @@ -import { EventDef } from './event-def.js' -import { EventInstance, createEventInstance } from './event-instance.js' -import { DateRange } from '../datelib/date-range.js' -import { DateEnv } from '../datelib/env.js' -import { Duration } from '../datelib/duration.js' -import { DateMarker, startOfDay } from '../datelib/marker.js' -import { EventStore } from './event-store.js' -import { CalendarContext } from '../CalendarContext.js' -import { filterHash } from '../util/object.js' -import { EventRefined } from './event-parse.js' - -/* -The plugin system for defining how a recurring event is expanded into individual instances. -*/ - -export interface ParsedRecurring { - typeData: RecurringData - allDayGuess: boolean | null - duration: Duration | null // signals hasEnd -} - -export interface RecurringType { - parse: (refined: EventRefined, dateEnv: DateEnv) => ParsedRecurring | null // TODO: rename to post-process or something - expand: (typeData: any, framingRange: DateRange, dateEnv: DateEnv) => DateMarker[] -} - -export function parseRecurring( - refined: EventRefined, - defaultAllDay: boolean | null, - dateEnv: DateEnv, - recurringTypes: RecurringType[], -) { - for (let i = 0; i < recurringTypes.length; i += 1) { - let parsed = recurringTypes[i].parse(refined, dateEnv) - - if (parsed) { - let { allDay } = refined - if (allDay == null) { - allDay = defaultAllDay - if (allDay == null) { - allDay = parsed.allDayGuess - if (allDay == null) { - allDay = false - } - } - } - - return { - allDay, - duration: parsed.duration, - typeData: parsed.typeData, - typeId: i, - } - } - } - - return null -} - -export function expandRecurring(eventStore: EventStore, framingRange: DateRange, context: CalendarContext): EventStore { - let { dateEnv, pluginHooks, options } = context - let { defs, instances } = eventStore - - // remove existing recurring instances - // TODO: bad. always expand events as a second step - instances = filterHash(instances, (instance: EventInstance) => !defs[instance.defId].recurringDef) - - for (let defId in defs) { - let def = defs[defId] - - if (def.recurringDef) { - let { duration } = def.recurringDef - - if (!duration) { - duration = def.allDay ? - options.defaultAllDayEventDuration : - options.defaultTimedEventDuration - } - - let starts = expandRecurringRanges(def, duration, framingRange, dateEnv, pluginHooks.recurringTypes) - - for (let start of starts) { - let instance = createEventInstance(defId, { - start, - end: dateEnv.add(start, duration), - }) - instances[instance.instanceId] = instance - } - } - } - - return { defs, instances } -} - -/* -Event MUST have a recurringDef -*/ -function expandRecurringRanges( - eventDef: EventDef, - duration: Duration, - framingRange: DateRange, - dateEnv: DateEnv, - recurringTypes: RecurringType[], -): DateMarker[] { - let typeDef = recurringTypes[eventDef.recurringDef.typeId] - let markers = typeDef.expand( - eventDef.recurringDef.typeData, - { - start: dateEnv.subtract(framingRange.start, duration), // for when event starts before framing range and goes into - end: framingRange.end, - }, - dateEnv, - ) - - // the recurrence plugins don't guarantee that all-day events are start-of-day, so we have to - if (eventDef.allDay) { - markers = markers.map(startOfDay) - } - - return markers -} diff --git a/fullcalendar-main/packages/core/src/structs/view-config.tsx b/fullcalendar-main/packages/core/src/structs/view-config.tsx deleted file mode 100644 index 4643dfd..0000000 --- a/fullcalendar-main/packages/core/src/structs/view-config.tsx +++ /dev/null @@ -1,84 +0,0 @@ -import { ViewProps } from '../View.js' -import { mapHash } from '../util/object.js' -import { ComponentType, Component, createElement } from '../preact.js' -import { buildViewClassNames } from '../common/ViewContainer.js' -import { MountArg } from '../common/render-hook.js' -import { ViewContext, ViewContextType } from '../ViewContext.js' -import { ViewOptions } from '../options.js' -import { Duration } from '../datelib/duration.js' -import { ContentContainer } from '../content-inject/ContentContainer.js' -import { BaseComponent } from '../vdom-util.js' - -/* -A view-config represents information for either: -A) creating a new instantiatable view class. in which case, supplied a class/type in addition to options, OR -B) options to customize an existing view, in which case only provides options. -*/ - -export type ViewComponent = Component // an instance -export type ViewComponentType = ComponentType - -export type ViewConfigInput = ViewComponentType | ViewOptions -export type ViewConfigInputHash = { [viewType: string]: ViewConfigInput } - -export interface ViewConfig { - superType: string - component: ViewComponentType | null - rawOptions: ViewOptions -} - -export type ViewConfigHash = { [viewType: string]: ViewConfig } - -export function parseViewConfigs(inputs: ViewConfigInputHash): ViewConfigHash { - return mapHash(inputs, parseViewConfig) -} - -function parseViewConfig(input: ViewConfigInput): ViewConfig { - let rawOptions: ViewOptions = typeof input === 'function' ? - { component: input } : - input - let { component } = rawOptions - - if (rawOptions.content) { - // TODO: remove content/classNames/didMount/etc from options? - component = createViewHookComponent(rawOptions) - } else if (component && !((component as any).prototype instanceof BaseComponent)) { - // WHY?: people were using `component` property for `content` - // TODO: converge on one setting name - component = createViewHookComponent({ ...rawOptions, content: component }) - } - - return { - superType: rawOptions.type as any, - component: component as any, - rawOptions, // includes type and component too :( - } -} - -export interface SpecificViewContentArg extends ViewProps { - nextDayThreshold: Duration -} - -export type SpecificViewMountArg = MountArg - -function createViewHookComponent(options: ViewOptions) { - return (viewProps: ViewProps) => ( - - {(context: ViewContext) => ( - - )} - - ) -} diff --git a/fullcalendar-main/packages/core/src/structs/view-def.ts b/fullcalendar-main/packages/core/src/structs/view-def.ts deleted file mode 100644 index 939df45..0000000 --- a/fullcalendar-main/packages/core/src/structs/view-def.ts +++ /dev/null @@ -1,97 +0,0 @@ -import { ViewConfigHash, ViewComponentType } from './view-config.js' -import { ViewOptions } from '../options.js' - -/* -Represents information for an instantiatable View class along with settings -that are specific to that view. No other settings, like calendar-wide settings, are stored. -*/ -export interface ViewDef { - type: string - component: ViewComponentType - overrides: ViewOptions - defaults: ViewOptions -} - -export type ViewDefHash = { [viewType: string]: ViewDef } - -export function compileViewDefs(defaultConfigs: ViewConfigHash, overrideConfigs: ViewConfigHash): ViewDefHash { - let hash: ViewDefHash = {} - let viewType: string - - for (viewType in defaultConfigs) { - ensureViewDef(viewType, hash, defaultConfigs, overrideConfigs) - } - - for (viewType in overrideConfigs) { - ensureViewDef(viewType, hash, defaultConfigs, overrideConfigs) - } - - return hash -} - -function ensureViewDef( - viewType: string, - hash: ViewDefHash, - defaultConfigs: ViewConfigHash, - overrideConfigs: ViewConfigHash, -): ViewDef | null { - if (hash[viewType]) { - return hash[viewType] - } - - let viewDef = buildViewDef(viewType, hash, defaultConfigs, overrideConfigs) - - if (viewDef) { - hash[viewType] = viewDef - } - - return viewDef -} - -function buildViewDef( - viewType: string, - hash: ViewDefHash, - defaultConfigs: ViewConfigHash, - overrideConfigs: ViewConfigHash, -): ViewDef | null { - let defaultConfig = defaultConfigs[viewType] - let overrideConfig = overrideConfigs[viewType] - - let queryProp = (name) => ( - (defaultConfig && defaultConfig[name] !== null) ? defaultConfig[name] : - ((overrideConfig && overrideConfig[name] !== null) ? overrideConfig[name] : null) - ) - - let theComponent = queryProp('component') as ViewComponentType - let superType = queryProp('superType') as string - let superDef: ViewDef | null = null - - if (superType) { - if (superType === viewType) { - throw new Error('Can\'t have a custom view type that references itself') - } - - superDef = ensureViewDef(superType, hash, defaultConfigs, overrideConfigs) - } - - if (!theComponent && superDef) { - theComponent = superDef.component - } - - if (!theComponent) { - return null // don't throw a warning, might be settings for a single-unit view - } - - return { - type: viewType, - component: theComponent, - defaults: { - ...(superDef ? superDef.defaults : {}), - ...(defaultConfig ? defaultConfig.rawOptions : {}), - }, - overrides: { - ...(superDef ? superDef.overrides : {}), - ...(overrideConfig ? overrideConfig.rawOptions : {}), - }, - } -} diff --git a/fullcalendar-main/packages/core/src/structs/view-spec.ts b/fullcalendar-main/packages/core/src/structs/view-spec.ts deleted file mode 100644 index c2d6c66..0000000 --- a/fullcalendar-main/packages/core/src/structs/view-spec.ts +++ /dev/null @@ -1,154 +0,0 @@ -import { ViewDef, compileViewDefs } from './view-def.js' -import { Duration, createDuration, greatestDurationDenominator, DurationInput } from '../datelib/duration.js' -import { mapHash } from '../util/object.js' -import { ViewOptions, CalendarOptions, BASE_OPTION_DEFAULTS } from '../options.js' -import { ViewConfigInputHash, parseViewConfigs, ViewConfigHash, ViewComponentType } from './view-config.js' - -/* -Represents everything needed to instantiate a new view instance, -including options that have been compiled from view-specific and calendar-wide options, -as well as duration information. - -Overall flow: -ViewConfig -> ViewDef -> ViewSpec -*/ -export interface ViewSpec { - type: string - component: ViewComponentType - duration: Duration - durationUnit: string - singleUnit: string - optionDefaults: ViewOptions - optionOverrides: ViewOptions - buttonTextOverride: string - buttonTextDefault: string - buttonTitleOverride: string | ((...args: any[]) => string) - buttonTitleDefault: string | ((...args: any[]) => string) -} - -export type ViewSpecHash = { [viewType: string]: ViewSpec } - -export function buildViewSpecs( - defaultInputs: ViewConfigInputHash, - optionOverrides: CalendarOptions, - dynamicOptionOverrides: CalendarOptions, - localeDefaults, -): ViewSpecHash { - let defaultConfigs = parseViewConfigs(defaultInputs) - let overrideConfigs = parseViewConfigs(optionOverrides.views) - let viewDefs = compileViewDefs(defaultConfigs, overrideConfigs) - - return mapHash(viewDefs, (viewDef) => buildViewSpec(viewDef, overrideConfigs, optionOverrides, dynamicOptionOverrides, localeDefaults)) -} - -function buildViewSpec( - viewDef: ViewDef, - overrideConfigs: ViewConfigHash, - optionOverrides: CalendarOptions, - dynamicOptionOverrides: CalendarOptions, - localeDefaults, -): ViewSpec { - let durationInput = - viewDef.overrides.duration || - viewDef.defaults.duration || - dynamicOptionOverrides.duration || - optionOverrides.duration - - let duration = null - let durationUnit = '' - let singleUnit = '' - let singleUnitOverrides: ViewOptions = {} - - if (durationInput) { - duration = createDurationCached(durationInput) - - if (duration) { // valid? - let denom = greatestDurationDenominator(duration) - durationUnit = denom.unit - - if (denom.value === 1) { - singleUnit = durationUnit - singleUnitOverrides = overrideConfigs[durationUnit] ? overrideConfigs[durationUnit].rawOptions : {} - } - } - } - - let queryButtonText = (optionsSubset) => { - let buttonTextMap = optionsSubset.buttonText || {} - let buttonTextKey = viewDef.defaults.buttonTextKey as string - - if (buttonTextKey != null && buttonTextMap[buttonTextKey] != null) { - return buttonTextMap[buttonTextKey] - } - if (buttonTextMap[viewDef.type] != null) { - return buttonTextMap[viewDef.type] - } - if (buttonTextMap[singleUnit] != null) { - return buttonTextMap[singleUnit] - } - return null - } - - let queryButtonTitle = (optionsSubset) => { // TODO: more DRY with queryButtonText - let buttonHints = optionsSubset.buttonHints || {} - let buttonKey = viewDef.defaults.buttonTextKey as string // use same key as text - - if (buttonKey != null && buttonHints[buttonKey] != null) { - return buttonHints[buttonKey] - } - if (buttonHints[viewDef.type] != null) { - return buttonHints[viewDef.type] - } - if (buttonHints[singleUnit] != null) { - return buttonHints[singleUnit] - } - return null - } - - return { - type: viewDef.type, - component: viewDef.component, - duration, - durationUnit, - singleUnit, - optionDefaults: viewDef.defaults, - optionOverrides: { ...singleUnitOverrides, ...viewDef.overrides }, - - buttonTextOverride: - queryButtonText(dynamicOptionOverrides) || - queryButtonText(optionOverrides) || // constructor-specified buttonText lookup hash takes precedence - viewDef.overrides.buttonText, // `buttonText` for view-specific options is a string - buttonTextDefault: - queryButtonText(localeDefaults) || - viewDef.defaults.buttonText || - queryButtonText(BASE_OPTION_DEFAULTS) || - viewDef.type, // fall back to given view name - - // not DRY - buttonTitleOverride: - queryButtonTitle(dynamicOptionOverrides) || - queryButtonTitle(optionOverrides) || - viewDef.overrides.buttonHint, - buttonTitleDefault: - queryButtonTitle(localeDefaults) || - viewDef.defaults.buttonHint || - queryButtonTitle(BASE_OPTION_DEFAULTS), - // will eventually fall back to buttonText - } -} - -// hack to get memoization working - -let durationInputMap: { [json: string]: Duration } = {} - -function createDurationCached(durationInput: DurationInput) { - let json = JSON.stringify(durationInput) - let res = durationInputMap[json] - - if (res === undefined) { - res = createDuration(durationInput) - durationInputMap[json] = res - } - - return res -} diff --git a/fullcalendar-main/packages/core/src/styleUtils.ts b/fullcalendar-main/packages/core/src/styleUtils.ts deleted file mode 100644 index 7456373..0000000 --- a/fullcalendar-main/packages/core/src/styleUtils.ts +++ /dev/null @@ -1,103 +0,0 @@ - -const styleTexts: string[] = [] -const styleEls = new Map() - -export function injectStyles(styleText: string): void { - styleTexts.push(styleText) - styleEls.forEach((styleEl) => { - appendStylesTo(styleEl, styleText) - }) -} - -export function ensureElHasStyles(el: HTMLElement): void { - if ( - el.isConnected && // sometimes true if SSR system simulates DOM - el.getRootNode // sometimes undefined if SSR system simulates DOM - ) { - registerStylesRoot(el.getRootNode() as ParentNode) - } -} - -function registerStylesRoot(rootNode: ParentNode): void { - let styleEl: HTMLStyleElement = styleEls.get(rootNode) - - if (!styleEl || !styleEl.isConnected) { - styleEl = rootNode.querySelector('style[data-fullcalendar]') - - if (!styleEl) { - styleEl = document.createElement('style') - styleEl.setAttribute('data-fullcalendar', '') - - const nonce = getNonceValue() - if (nonce) { - styleEl.nonce = nonce - } - - const parentEl = rootNode === document ? document.head : rootNode - const insertBefore = rootNode === document - ? parentEl.querySelector('script,link[rel=stylesheet],link[as=style],style') - : parentEl.firstChild - - parentEl.insertBefore(styleEl, insertBefore) - } - - styleEls.set(rootNode, styleEl) - hydrateStylesRoot(styleEl) - } -} - -function hydrateStylesRoot(styleEl: HTMLStyleElement): void { - for (const styleText of styleTexts) { - appendStylesTo(styleEl, styleText) - } -} - -function appendStylesTo(styleEl: HTMLStyleElement, styleText: string): void { - const { sheet } = styleEl - const ruleCnt = sheet.cssRules.length - - styleText.split('}').forEach((styleStr, i) => { - styleStr = styleStr.trim() - if (styleStr) { - sheet.insertRule(styleStr + '}', ruleCnt + i) - } - }) -} - -// nonce -// ------------------------------------------------------------------------------------------------- - -let queriedNonceValue: string | undefined - -function getNonceValue() { - if (queriedNonceValue === undefined) { - queriedNonceValue = queryNonceValue() - } - return queriedNonceValue -} - -/* -TODO: discourage meta tag and instead put nonce attribute on placeholder - - - -
- - - diff --git a/fullcalendar-main/tests/manual/bootstrap5.html b/fullcalendar-main/tests/manual/bootstrap5.html deleted file mode 100644 index aaec2f9..0000000 --- a/fullcalendar-main/tests/manual/bootstrap5.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - -
- - - diff --git a/fullcalendar-main/tests/manual/csp-nonce.html b/fullcalendar-main/tests/manual/csp-nonce.html deleted file mode 100644 index 47b2340..0000000 --- a/fullcalendar-main/tests/manual/csp-nonce.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - - -
- - - diff --git a/fullcalendar-main/tests/manual/external-dragging-dragula.html b/fullcalendar-main/tests/manual/external-dragging-dragula.html deleted file mode 100644 index d492fe8..0000000 --- a/fullcalendar-main/tests/manual/external-dragging-dragula.html +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - - - - - - -
- -
-

Draggable Events

- -
-
My Event 1
-
My Event 2
-
My Event 3
-
My Event 4
-
My Event 5
-
- -

- - -

-
- -
- -
- -
- - diff --git a/fullcalendar-main/tests/manual/external-dragging-jqueryui.html b/fullcalendar-main/tests/manual/external-dragging-jqueryui.html deleted file mode 100644 index 816c9d9..0000000 --- a/fullcalendar-main/tests/manual/external-dragging-jqueryui.html +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - - - - - - -
- -
-

Draggable Events

-
My Event 1
-
My Event 2
-
My Event 3
-
My Event 4
-
My Event 5
-

- - -

-
- -
- -
- -
- - diff --git a/fullcalendar-main/tests/manual/google-calendar.html b/fullcalendar-main/tests/manual/google-calendar.html deleted file mode 100644 index 700768e..0000000 --- a/fullcalendar-main/tests/manual/google-calendar.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - -
loading...
- -
- - - diff --git a/fullcalendar-main/tests/manual/icalendar.html b/fullcalendar-main/tests/manual/icalendar.html deleted file mode 100644 index 6086d59..0000000 --- a/fullcalendar-main/tests/manual/icalendar.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - -
- ics/feed.ics must be servable -
- -
loading...
- -
- - - diff --git a/fullcalendar-main/tests/manual/ics/feed.ics b/fullcalendar-main/tests/manual/ics/feed.ics deleted file mode 100644 index 6233d3a..0000000 --- a/fullcalendar-main/tests/manual/ics/feed.ics +++ /dev/null @@ -1,65 +0,0 @@ -BEGIN:VCALENDAR -VERSION:2.0 -CALSCALE:GREGORIAN -METHOD:PUBLISH -X-WR-CALNAME:events@fullcalendar.test -X-WR-TIMEZONE:Europe/Paris -BEGIN:VEVENT -DTSTART;VALUE=DATE:20190410 -DTEND;VALUE=DATE:20190413 -DTSTAMP:20201006T124223Z -UID:1234578 -CREATED:20190408T110429Z -DESCRIPTION: -LAST-MODIFIED:20190409T110738Z -LOCATION: -SEQUENCE:0 -STATUS:CONFIRMED -SUMMARY:First conference -TRANSP:OPAQUE -END:VEVENT -BEGIN:VEVENT -DTSTART;VALUE=DATE:20190416 -DTEND;VALUE=DATE:20190417 -DTSTAMP:20201008T153019Z -UID:1234578 -DTSTAMP:20201008T153019Z -DESCRIPTION: -LAST-MODIFIED:20190409T110738Z -LOCATION: -SEQUENCE:0 -STATUS:CONFIRMED -SUMMARY:Second conference -TRANSP:OPAQUE -END:VEVENT -BEGIN:VEVENT -DTSTART:20190415T093000Z -DTEND:20190415T103000Z -DTSTAMP:20201006T124223Z -UID:12345678 -ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;CN=test@fullcalendar.test;X-NUM-GUESTS=0:mailto:test@fullcalendar.test -CREATED:20190412T223947Z -DESCRIPTION: -LAST-MODIFIED:20190412T223947Z -LOCATION: -SEQUENCE:0 -STATUS:CONFIRMED -SUMMARY:Hour long meeting -TRANSP:OPAQUE -END:VEVENT -BEGIN:VEVENT -DTSTART:20190415T141500Z -DTEND:20190415T154500Z -DTSTAMP:20201006T124223Z -UID:12345678 -ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;CN=test@fullcalendar.test;X-NUM-GUESTS=0:mailto:test@fullcalendar.test -CREATED:20190412T223947Z -DESCRIPTION: -LAST-MODIFIED:20190412T223947Z -LOCATION: -SEQUENCE:0 -STATUS:CONFIRMED -SUMMARY:90 minute meeting -TRANSP:OPAQUE -END:VEVENT -END:VCALENDAR diff --git a/fullcalendar-main/tests/manual/importmap.html b/fullcalendar-main/tests/manual/importmap.html deleted file mode 100644 index 00ecf7f..0000000 --- a/fullcalendar-main/tests/manual/importmap.html +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/importmap.public.html b/fullcalendar-main/tests/manual/importmap.public.html deleted file mode 100644 index a4430e5..0000000 --- a/fullcalendar-main/tests/manual/importmap.public.html +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/jquery-connector.html b/fullcalendar-main/tests/manual/jquery-connector.html deleted file mode 100644 index 00eef61..0000000 --- a/fullcalendar-main/tests/manual/jquery-connector.html +++ /dev/null @@ -1,183 +0,0 @@ - - - - - - - - - - - - - - - -
- - - diff --git a/fullcalendar-main/tests/manual/js/theme-chooser.js b/fullcalendar-main/tests/manual/js/theme-chooser.js deleted file mode 100644 index c967c2e..0000000 --- a/fullcalendar-main/tests/manual/js/theme-chooser.js +++ /dev/null @@ -1,149 +0,0 @@ - -function initThemeChooser(settings) { - var isInitialized = false - var currentThemeSystem // don't set this directly. use setThemeSystem - var currentStylesheetEl - var loadingEl = document.getElementById('loading') - var systemSelectEl = document.querySelector('#theme-system-selector select') - var themeSelectWrapEls = Array.prototype.slice.call( // convert to real array - document.querySelectorAll('.selector[data-theme-system]'), - ) - - systemSelectEl.addEventListener('change', function() { - setThemeSystem(this.value) - }) - - setThemeSystem(systemSelectEl.value) - - themeSelectWrapEls.forEach(function(themeSelectWrapEl) { - var themeSelectEl = themeSelectWrapEl.querySelector('select') - - themeSelectWrapEl.addEventListener('change', function() { - setTheme( - currentThemeSystem, - themeSelectEl.options[themeSelectEl.selectedIndex].value, - ) - }) - }) - - - function setThemeSystem(themeSystem) { - var selectedTheme - - currentThemeSystem = themeSystem - - themeSelectWrapEls.forEach(function(themeSelectWrapEl) { - var themeSelectEl = themeSelectWrapEl.querySelector('select') - var themeSystems = (themeSelectWrapEl.getAttribute('data-theme-system') || '').split(',') - - if (themeSystems.includes(themeSystem)) { - selectedTheme = themeSelectEl.options[themeSelectEl.selectedIndex].value - themeSelectWrapEl.style.display = 'inline-block' - } else { - themeSelectWrapEl.style.display = 'none' - } - }) - - setTheme(themeSystem, selectedTheme) - } - - - function setTheme(themeSystem, themeName) { - var stylesheetUrl = generateStylesheetUrl(themeSystem, themeName) - var stylesheetEl - - function done() { - if (!isInitialized) { - isInitialized = true - settings.init(themeSystem) - } - else { - settings.change(themeSystem) - } - - showCredits(themeSystem, themeName) - } - - if (stylesheetUrl) { - stylesheetEl = document.createElement('link') - stylesheetEl.setAttribute('rel', 'stylesheet') - stylesheetEl.setAttribute('href', stylesheetUrl) - document.querySelector('head').appendChild(stylesheetEl) - - loadingEl.style.display = 'inline' - - whenStylesheetLoaded(stylesheetEl, function() { - if (currentStylesheetEl) { - currentStylesheetEl.parentNode.removeChild(currentStylesheetEl) - } - currentStylesheetEl = stylesheetEl - loadingEl.style.display = 'none' - done() - }) - } else { - if (currentStylesheetEl) { - currentStylesheetEl.parentNode.removeChild(currentStylesheetEl) - currentStylesheetEl = null - } - done() - } - } - - - function generateStylesheetUrl(themeSystem, themeName) { - if (themeSystem === 'bootstrap') { - if (themeName) { - return 'https://bootswatch.com/4/' + themeName + '/bootstrap.min.css' - } - else { // the default bootstrap theme - return 'https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css' - } - } else if (themeSystem === 'bootstrap5') { - if (themeName) { - return 'https://bootswatch.com/5/' + themeName + '/bootstrap.min.css' - } - else { // the default bootstrap theme - return 'https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css' - } - } - } - - - function showCredits(themeSystem, themeName) { - var creditId - - if (themeSystem.match('bootstrap')) { - if (themeName) { - creditId = 'bootstrap-custom' - } - else { - creditId = 'bootstrap-standard' - } - } - - Array.prototype.slice.call( // convert to real array - document.querySelectorAll('.credits'), - ).forEach(function(creditEl) { - if (creditEl.getAttribute('data-credit-id') === creditId) { - creditEl.style.display = 'block' - } else { - creditEl.style.display = 'none' - } - }) - } - - - function whenStylesheetLoaded(linkNode, callback) { - var isReady = false - - function ready() { - if (!isReady) { // avoid double-call - isReady = true - callback() - } - } - - linkNode.onload = ready // does not work cross-browser - setTimeout(ready, 2000) // max wait. also handles browsers that don't support onload - } -} diff --git a/fullcalendar-main/tests/manual/json.html b/fullcalendar-main/tests/manual/json.html deleted file mode 100644 index cbaa419..0000000 --- a/fullcalendar-main/tests/manual/json.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - -
- php/get-events.php must be running. -
- -
loading...
- -
- - - diff --git a/fullcalendar-main/tests/manual/json/events.json b/fullcalendar-main/tests/manual/json/events.json deleted file mode 100644 index 29da886..0000000 --- a/fullcalendar-main/tests/manual/json/events.json +++ /dev/null @@ -1,56 +0,0 @@ -[ - { - "title": "All Day Event", - "start": "2020-09-01" - }, - { - "title": "Long Event", - "start": "2020-09-07", - "end": "2020-09-10" - }, - { - "id": "999", - "title": "Repeating Event", - "start": "2020-09-09T16:00:00-05:00" - }, - { - "id": "999", - "title": "Repeating Event", - "start": "2020-09-16T16:00:00-05:00" - }, - { - "title": "Conference", - "start": "2020-09-11", - "end": "2020-09-13" - }, - { - "title": "Meeting", - "start": "2020-09-12T10:30:00-05:00", - "end": "2020-09-12T12:30:00-05:00" - }, - { - "title": "Lunch", - "start": "2020-09-12T12:00:00-05:00" - }, - { - "title": "Meeting", - "start": "2020-09-12T14:30:00-05:00" - }, - { - "title": "Happy Hour", - "start": "2020-09-12T17:30:00-05:00" - }, - { - "title": "Dinner", - "start": "2020-09-12T20:00:00" - }, - { - "title": "Birthday Party", - "start": "2020-09-13T07:00:00-05:00" - }, - { - "title": "Click for Google", - "url": "http://google.com/", - "start": "2020-09-28" - } -] diff --git a/fullcalendar-main/tests/manual/locales-es.html b/fullcalendar-main/tests/manual/locales-es.html deleted file mode 100644 index 1d0c3db..0000000 --- a/fullcalendar-main/tests/manual/locales-es.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - - - - - -
- - - diff --git a/fullcalendar-main/tests/manual/locales.html b/fullcalendar-main/tests/manual/locales.html deleted file mode 100644 index b0b9709..0000000 --- a/fullcalendar-main/tests/manual/locales.html +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - - - - - - - - - - -
- - Locales: - - -
- -
- - - diff --git a/fullcalendar-main/tests/manual/old/blank.html b/fullcalendar-main/tests/manual/old/blank.html deleted file mode 100644 index cfe2fa9..0000000 --- a/fullcalendar-main/tests/manual/old/blank.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - -
- - - diff --git a/fullcalendar-main/tests/manual/old/clipped-height-interactions.html b/fullcalendar-main/tests/manual/old/clipped-height-interactions.html deleted file mode 100644 index 75c51b3..0000000 --- a/fullcalendar-main/tests/manual/old/clipped-height-interactions.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - -
- - - diff --git a/fullcalendar-main/tests/manual/old/data_as_a_function.html b/fullcalendar-main/tests/manual/old/data_as_a_function.html deleted file mode 100644 index b7014cf..0000000 --- a/fullcalendar-main/tests/manual/old/data_as_a_function.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/date_util_test.html b/fullcalendar-main/tests/manual/old/date_util_test.html deleted file mode 100644 index 7180bbf..0000000 --- a/fullcalendar-main/tests/manual/old/date_util_test.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/fullcalendar-main/tests/manual/old/day_render.html b/fullcalendar-main/tests/manual/old/day_render.html deleted file mode 100644 index 90905a6..0000000 --- a/fullcalendar-main/tests/manual/old/day_render.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/dbclick.html b/fullcalendar-main/tests/manual/old/dbclick.html deleted file mode 100644 index 8118310..0000000 --- a/fullcalendar-main/tests/manual/old/dbclick.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/dnd.html b/fullcalendar-main/tests/manual/old/dnd.html deleted file mode 100644 index d032c52..0000000 --- a/fullcalendar-main/tests/manual/old/dnd.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - -
-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin semper pretium auctor. Sed condimentum scelerisque pellentesque. Sed blandit dui ut diam blandit faucibus. Mauris tincidunt ac leo quis semper. Integer condimentum neque ac feugiat imperdiet. Nullam eget lorem vel erat pulvinar elementum. Proin elit dolor, tincidunt auctor posuere eu, faucibus tempus eros. Cras at vestibulum augue, non tempus sapien. Donec neque lectus, commodo suscipit erat nec, rhoncus maximus felis. Etiam ut nisi interdum, malesuada erat ac, tempor lectus. Phasellus hendrerit orci vitae nisi finibus sodales. Vestibulum eleifend arcu vel semper fringilla. Ut tincidunt massa a aliquet tincidunt. Donec molestie vitae nulla quis pharetra. -

-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin semper pretium auctor. Sed condimentum scelerisque pellentesque. Sed blandit dui ut diam blandit faucibus. Mauris tincidunt ac leo quis semper. Integer condimentum neque ac feugiat imperdiet. Nullam eget lorem vel erat pulvinar elementum. Proin elit dolor, tincidunt auctor posuere eu, faucibus tempus eros. Cras at vestibulum augue, non tempus sapien. Donec neque lectus, commodo suscipit erat nec, rhoncus maximus felis. Etiam ut nisi interdum, malesuada erat ac, tempor lectus. Phasellus hendrerit orci vitae nisi finibus sodales. Vestibulum eleifend arcu vel semper fringilla. Ut tincidunt massa a aliquet tincidunt. Donec molestie vitae nulla quis pharetra. -

- -

- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin semper pretium auctor. Sed condimentum scelerisque pellentesque. Sed blandit dui ut diam blandit faucibus. Mauris tincidunt ac leo quis semper. Integer condimentum neque ac feugiat imperdiet. Nullam eget lorem vel erat pulvinar elementum. Proin elit dolor, tincidunt auctor posuere eu, faucibus tempus eros. Cras at vestibulum augue, non tempus sapien. Donec neque lectus, commodo suscipit erat nec, rhoncus maximus felis. Etiam ut nisi interdum, malesuada erat ac, tempor lectus. Phasellus hendrerit orci vitae nisi finibus sodales. Vestibulum eleifend arcu vel semper fringilla. Ut tincidunt massa a aliquet tincidunt. Donec molestie vitae nulla quis pharetra. -

-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin semper pretium auctor. Sed condimentum scelerisque pellentesque. Sed blandit dui ut diam blandit faucibus. Mauris tincidunt ac leo quis semper. Integer condimentum neque ac feugiat imperdiet. Nullam eget lorem vel erat pulvinar elementum. Proin elit dolor, tincidunt auctor posuere eu, faucibus tempus eros. Cras at vestibulum augue, non tempus sapien. Donec neque lectus, commodo suscipit erat nec, rhoncus maximus felis. Etiam ut nisi interdum, malesuada erat ac, tempor lectus. Phasellus hendrerit orci vitae nisi finibus sodales. Vestibulum eleifend arcu vel semper fringilla. Ut tincidunt massa a aliquet tincidunt. Donec molestie vitae nulla quis pharetra. -

-
- - - diff --git a/fullcalendar-main/tests/manual/old/droppable.html b/fullcalendar-main/tests/manual/old/droppable.html deleted file mode 100644 index 74b82e9..0000000 --- a/fullcalendar-main/tests/manual/old/droppable.html +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - - -
-
-
Draggable 1
-
Draggable 2
-
Draggable 3
-
-
-
Sortable 1
-
Sortable 2
-
Sortable 3
-
-
-
- - diff --git a/fullcalendar-main/tests/manual/old/dynamic-options.html b/fullcalendar-main/tests/manual/old/dynamic-options.html deleted file mode 100644 index bbe6440..0000000 --- a/fullcalendar-main/tests/manual/old/dynamic-options.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/event_data_transform.html b/fullcalendar-main/tests/manual/old/event_data_transform.html deleted file mode 100644 index 8a5364d..0000000 --- a/fullcalendar-main/tests/manual/old/event_data_transform.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/event_stress_test.html b/fullcalendar-main/tests/manual/old/event_stress_test.html deleted file mode 100644 index f75ae1e..0000000 --- a/fullcalendar-main/tests/manual/old/event_stress_test.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/external-dragging-touch-punch.html b/fullcalendar-main/tests/manual/old/external-dragging-touch-punch.html deleted file mode 100644 index 1862603..0000000 --- a/fullcalendar-main/tests/manual/old/external-dragging-touch-punch.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - - - - - - - - - -
- -
-

Draggable Events

-
My Event 1
-
My Event 2
-
My Event 3
-
My Event 4
-
My Event 5
-

- - -

-
- -
- -
- -
- - diff --git a/fullcalendar-main/tests/manual/old/fullheight.html b/fullcalendar-main/tests/manual/old/fullheight.html deleted file mode 100644 index 0d7858e..0000000 --- a/fullcalendar-main/tests/manual/old/fullheight.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - - - -
-
-
- - - diff --git a/fullcalendar-main/tests/manual/old/gcal.html b/fullcalendar-main/tests/manual/old/gcal.html deleted file mode 100644 index 88b107c..0000000 --- a/fullcalendar-main/tests/manual/old/gcal.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/hiddenDays.html b/fullcalendar-main/tests/manual/old/hiddenDays.html deleted file mode 100644 index b4872cf..0000000 --- a/fullcalendar-main/tests/manual/old/hiddenDays.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/icons.html b/fullcalendar-main/tests/manual/old/icons.html deleted file mode 100644 index 5e1dd7f..0000000 --- a/fullcalendar-main/tests/manual/old/icons.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - -
/ elements with colspans. - SOLUTION: making individual
- - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/issue_1035.html b/fullcalendar-main/tests/manual/old/issue_1035.html deleted file mode 100644 index 4addeff..0000000 --- a/fullcalendar-main/tests/manual/old/issue_1035.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - - - - -

The selection box for selecting timegrid slot cells should align to the grid.

-

(even though .fc-timeGrid-slots td div has been set to 10px tall)

-

(even though .fc-timeGrid-slots td div has been set to 10px tall)

- -
- - - diff --git a/fullcalendar-main/tests/manual/old/issue_2048.html b/fullcalendar-main/tests/manual/old/issue_2048.html deleted file mode 100644 index 352ec29..0000000 --- a/fullcalendar-main/tests/manual/old/issue_2048.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/issue_206_parseDate_dst.html b/fullcalendar-main/tests/manual/old/issue_206_parseDate_dst.html deleted file mode 100644 index 4c8fcdd..0000000 --- a/fullcalendar-main/tests/manual/old/issue_206_parseDate_dst.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/issue_2154.html b/fullcalendar-main/tests/manual/old/issue_2154.html deleted file mode 100644 index 3b77d76..0000000 --- a/fullcalendar-main/tests/manual/old/issue_2154.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - - - - - - - - - -
- - - diff --git a/fullcalendar-main/tests/manual/old/issue_220_buttons_ie6.html b/fullcalendar-main/tests/manual/old/issue_220_buttons_ie6.html deleted file mode 100644 index 6e974e7..0000000 --- a/fullcalendar-main/tests/manual/old/issue_220_buttons_ie6.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - -
-
-
- -
Nav
- -
- -

-this is a paragraph -

- -
- -
- -
-
- - diff --git a/fullcalendar-main/tests/manual/old/issue_221_quick_remove_source.html b/fullcalendar-main/tests/manual/old/issue_221_quick_remove_source.html deleted file mode 100644 index b6b0390..0000000 --- a/fullcalendar-main/tests/manual/old/issue_221_quick_remove_source.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/issue_230_height_json_events.html b/fullcalendar-main/tests/manual/old/issue_230_height_json_events.html deleted file mode 100644 index bbba02c..0000000 --- a/fullcalendar-main/tests/manual/old/issue_230_height_json_events.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/issue_2396_Sydney.html b/fullcalendar-main/tests/manual/old/issue_2396_Sydney.html deleted file mode 100644 index 17b0525..0000000 --- a/fullcalendar-main/tests/manual/old/issue_2396_Sydney.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - -

- To recreate, set computer's timezone to Australia/Sydney, open in Safari, and try to select any time after 3pm. -

- -
- - - diff --git a/fullcalendar-main/tests/manual/old/issue_244_aspectRatio_0.html b/fullcalendar-main/tests/manual/old/issue_244_aspectRatio_0.html deleted file mode 100644 index ea69a96..0000000 --- a/fullcalendar-main/tests/manual/old/issue_244_aspectRatio_0.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/issue_251_empty_end_date.html b/fullcalendar-main/tests/manual/old/issue_251_empty_end_date.html deleted file mode 100644 index 540f3a3..0000000 --- a/fullcalendar-main/tests/manual/old/issue_251_empty_end_date.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/issue_333_blinking.html b/fullcalendar-main/tests/manual/old/issue_333_blinking.html deleted file mode 100644 index 1949ff3..0000000 --- a/fullcalendar-main/tests/manual/old/issue_333_blinking.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/issue_417_refetchEvents.html b/fullcalendar-main/tests/manual/old/issue_417_refetchEvents.html deleted file mode 100644 index 9eb3aab..0000000 --- a/fullcalendar-main/tests/manual/old/issue_417_refetchEvents.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/issue_429_gotoDate.html b/fullcalendar-main/tests/manual/old/issue_429_gotoDate.html deleted file mode 100644 index 1a49538..0000000 --- a/fullcalendar-main/tests/manual/old/issue_429_gotoDate.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/issue_477_event_width.html b/fullcalendar-main/tests/manual/old/issue_477_event_width.html deleted file mode 100644 index 9e9397d..0000000 --- a/fullcalendar-main/tests/manual/old/issue_477_event_width.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/issue_517_js_error_ie.html b/fullcalendar-main/tests/manual/old/issue_517_js_error_ie.html deleted file mode 100644 index 00aa3e8..0000000 --- a/fullcalendar-main/tests/manual/old/issue_517_js_error_ie.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/issue_554.html b/fullcalendar-main/tests/manual/old/issue_554.html deleted file mode 100644 index a9a976a..0000000 --- a/fullcalendar-main/tests/manual/old/issue_554.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/issue_586_refetchEvents.html b/fullcalendar-main/tests/manual/old/issue_586_refetchEvents.html deleted file mode 100644 index 09de3e1..0000000 --- a/fullcalendar-main/tests/manual/old/issue_586_refetchEvents.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/issue_616.html b/fullcalendar-main/tests/manual/old/issue_616.html deleted file mode 100644 index 280bb37..0000000 --- a/fullcalendar-main/tests/manual/old/issue_616.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/issue_679.html b/fullcalendar-main/tests/manual/old/issue_679.html deleted file mode 100644 index 93bf8ea..0000000 --- a/fullcalendar-main/tests/manual/old/issue_679.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/issue_688_parseInt.html b/fullcalendar-main/tests/manual/old/issue_688_parseInt.html deleted file mode 100644 index 5c25ce0..0000000 --- a/fullcalendar-main/tests/manual/old/issue_688_parseInt.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/issue_740_event_resizing.html b/fullcalendar-main/tests/manual/old/issue_740_event_resizing.html deleted file mode 100644 index cfc0a5d..0000000 --- a/fullcalendar-main/tests/manual/old/issue_740_event_resizing.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/issue_750.html b/fullcalendar-main/tests/manual/old/issue_750.html deleted file mode 100644 index ae25929..0000000 --- a/fullcalendar-main/tests/manual/old/issue_750.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/issue_757_removeEvents.html b/fullcalendar-main/tests/manual/old/issue_757_removeEvents.html deleted file mode 100644 index 2a4a1af..0000000 --- a/fullcalendar-main/tests/manual/old/issue_757_removeEvents.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/liquidwidth.html b/fullcalendar-main/tests/manual/old/liquidwidth.html deleted file mode 100644 index fe4bdbd..0000000 --- a/fullcalendar-main/tests/manual/old/liquidwidth.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/list-view.html b/fullcalendar-main/tests/manual/old/list-view.html deleted file mode 100644 index 0815c48..0000000 --- a/fullcalendar-main/tests/manual/old/list-view.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/locale.html b/fullcalendar-main/tests/manual/old/locale.html deleted file mode 100644 index da47adc..0000000 --- a/fullcalendar-main/tests/manual/old/locale.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/long_event_titles.html b/fullcalendar-main/tests/manual/old/long_event_titles.html deleted file mode 100644 index f5e7501..0000000 --- a/fullcalendar-main/tests/manual/old/long_event_titles.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/manual_gh_3137_popover_scroll.html b/fullcalendar-main/tests/manual/old/manual_gh_3137_popover_scroll.html deleted file mode 100644 index 577a98b..0000000 --- a/fullcalendar-main/tests/manual/old/manual_gh_3137_popover_scroll.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - - - - - -

try a variety of window sizes. cut off the +more popover.

- -
- - - diff --git a/fullcalendar-main/tests/manual/old/manual_gh_3152.html b/fullcalendar-main/tests/manual/old/manual_gh_3152.html deleted file mode 100644 index 08d67d9..0000000 --- a/fullcalendar-main/tests/manual/old/manual_gh_3152.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - -

- On a touch device, begin to scroll on the timeslots.
- If dayClick pops up, the test has FAILED. -

- -
- - - diff --git a/fullcalendar-main/tests/manual/old/manual_gh_3160.html b/fullcalendar-main/tests/manual/old/manual_gh_3160.html deleted file mode 100644 index 278624c..0000000 --- a/fullcalendar-main/tests/manual/old/manual_gh_3160.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - -

- Make sure there is limited vertical space so the window scrolls.
- Then touch and hold on an event and begin scrolling. Hold down for 3+ seconds.
- If the event becomes selected and draggable, the test has FAILED. -

- -
- - - diff --git a/fullcalendar-main/tests/manual/old/many_events.html b/fullcalendar-main/tests/manual/old/many_events.html deleted file mode 100644 index 70b16e1..0000000 --- a/fullcalendar-main/tests/manual/old/many_events.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/many_events_json.txt b/fullcalendar-main/tests/manual/old/many_events_json.txt deleted file mode 100644 index cdb72c9..0000000 --- a/fullcalendar-main/tests/manual/old/many_events_json.txt +++ /dev/null @@ -1 +0,0 @@ -[{"id":830,"start":1262279460000,"end":1262281260000,"title":"this is a long event isnt that right?","body":"","multi":0,"allDay":false,"extension_id":2},{"id":831,"start":1262282052000,"end":1262283852000,"title":"830","body":"","multi":0,"allDay":false,"extension_id":2},{"id":832,"start":1262284644000,"end":1262286444000,"title":"831","body":"","multi":0,"allDay":false,"extension_id":2},{"id":833,"start":1262287236000,"end":1262289036000,"title":"832","body":"","multi":0,"allDay":false,"extension_id":2},{"id":834,"start":1262289828000,"end":1262291628000,"title":"833","body":"","multi":0,"allDay":false,"extension_id":2},{"id":835,"start":1262292420000,"end":1262294220000,"title":"834","body":"","multi":0,"allDay":false,"extension_id":2},{"id":836,"start":1262295012000,"end":1262296812000,"title":"835","body":"","multi":0,"allDay":false,"extension_id":2},{"id":837,"start":1262297604000,"end":1262299404000,"title":"836","body":"","multi":0,"allDay":false,"extension_id":2},{"id":838,"start":1262300196000,"end":1262301996000,"title":"837","body":"","multi":0,"allDay":false,"extension_id":2},{"id":839,"start":1262302788000,"end":1262304588000,"title":"838","body":"","multi":0,"allDay":false,"extension_id":2},{"id":840,"start":1262305380000,"end":1262307180000,"title":"839","body":"","multi":0,"allDay":false,"extension_id":2},{"id":841,"start":1262307972000,"end":1262309772000,"title":"840","body":"","multi":0,"allDay":false,"extension_id":2},{"id":842,"start":1262310564000,"end":1262312364000,"title":"841","body":"","multi":0,"allDay":false,"extension_id":2},{"id":843,"start":1262313156000,"end":1262314956000,"title":"842","body":"","multi":0,"allDay":false,"extension_id":2},{"id":844,"start":1262315748000,"end":1262317548000,"title":"843","body":"","multi":0,"allDay":false,"extension_id":2},{"id":845,"start":1262318340000,"end":1262320140000,"title":"844","body":"","multi":0,"allDay":false,"extension_id":2},{"id":846,"start":1262320932000,"end":1262322732000,"title":"845","body":"","multi":0,"allDay":false,"extension_id":2},{"id":847,"start":1262323524000,"end":1262325324000,"title":"846","body":"","multi":0,"allDay":false,"extension_id":2},{"id":848,"start":1262326116000,"end":1262327916000,"title":"847","body":"","multi":0,"allDay":false,"extension_id":2},{"id":849,"start":1262328708000,"end":1262330508000,"title":"848","body":"","multi":0,"allDay":false,"extension_id":2},{"id":850,"start":1262331300000,"end":1262333100000,"title":"849","body":"","multi":0,"allDay":false,"extension_id":2},{"id":851,"start":1262333892000,"end":1262335692000,"title":"850","body":"","multi":0,"allDay":false,"extension_id":2},{"id":852,"start":1262336484000,"end":1262338284000,"title":"851","body":"","multi":0,"allDay":false,"extension_id":2},{"id":853,"start":1262339076000,"end":1262340876000,"title":"852","body":"","multi":0,"allDay":false,"extension_id":2},{"id":854,"start":1262341668000,"end":1262343468000,"title":"853","body":"","multi":0,"allDay":false,"extension_id":2},{"id":855,"start":1262344260000,"end":1262346060000,"title":"854","body":"","multi":0,"allDay":false,"extension_id":2},{"id":856,"start":1262346852000,"end":1262348652000,"title":"855","body":"","multi":0,"allDay":false,"extension_id":2},{"id":857,"start":1262349444000,"end":1262351244000,"title":"856","body":"","multi":0,"allDay":false,"extension_id":2},{"id":858,"start":1262352036000,"end":1262353836000,"title":"857","body":"","multi":0,"allDay":false,"extension_id":2},{"id":859,"start":1262354628000,"end":1262356428000,"title":"858","body":"","multi":0,"allDay":false,"extension_id":2},{"id":860,"start":1262357220000,"end":1262359020000,"title":"859","body":"","multi":0,"allDay":false,"extension_id":2},{"id":861,"start":1262359812000,"end":1262361612000,"title":"860","body":"","multi":0,"allDay":false,"extension_id":2},{"id":862,"start":1262362404000,"end":1262364204000,"title":"861","body":"","multi":0,"allDay":false,"extension_id":2},{"id":863,"start":1262364996000,"end":1262366796000,"title":"862","body":"","multi":0,"allDay":false,"extension_id":2},{"id":864,"start":1262367588000,"end":1262369388000,"title":"863","body":"","multi":0,"allDay":false,"extension_id":2},{"id":865,"start":1262370180000,"end":1262371980000,"title":"864","body":"","multi":0,"allDay":false,"extension_id":2},{"id":866,"start":1262372772000,"end":1262374572000,"title":"865","body":"","multi":0,"allDay":false,"extension_id":2},{"id":867,"start":1262375364000,"end":1262377164000,"title":"866","body":"","multi":0,"allDay":false,"extension_id":2},{"id":868,"start":1262377956000,"end":1262379756000,"title":"867","body":"","multi":0,"allDay":false,"extension_id":2},{"id":869,"start":1262380548000,"end":1262382348000,"title":"868","body":"","multi":0,"allDay":false,"extension_id":2},{"id":870,"start":1262383140000,"end":1262384940000,"title":"869","body":"","multi":0,"allDay":false,"extension_id":2},{"id":871,"start":1262385732000,"end":1262387532000,"title":"870","body":"","multi":0,"allDay":false,"extension_id":2},{"id":872,"start":1262388324000,"end":1262390124000,"title":"871","body":"","multi":0,"allDay":false,"extension_id":2},{"id":873,"start":1262390916000,"end":1262392716000,"title":"872","body":"","multi":0,"allDay":false,"extension_id":2},{"id":874,"start":1262393508000,"end":1262395308000,"title":"873","body":"","multi":0,"allDay":false,"extension_id":2},{"id":875,"start":1262396100000,"end":1262397900000,"title":"874","body":"","multi":0,"allDay":false,"extension_id":2},{"id":876,"start":1262398692000,"end":1262400492000,"title":"875","body":"","multi":0,"allDay":false,"extension_id":2},{"id":877,"start":1262401284000,"end":1262403084000,"title":"876","body":"","multi":0,"allDay":false,"extension_id":2},{"id":878,"start":1262403876000,"end":1262405676000,"title":"877","body":"","multi":0,"allDay":false,"extension_id":2},{"id":879,"start":1262406468000,"end":1262408268000,"title":"878","body":"","multi":0,"allDay":false,"extension_id":2},{"id":880,"start":1262409060000,"end":1262410860000,"title":"879","body":"","multi":0,"allDay":false,"extension_id":2},{"id":881,"start":1262411652000,"end":1262413452000,"title":"880","body":"","multi":0,"allDay":false,"extension_id":2},{"id":882,"start":1262414244000,"end":1262416044000,"title":"881","body":"","multi":0,"allDay":false,"extension_id":2},{"id":883,"start":1262416836000,"end":1262418636000,"title":"882","body":"","multi":0,"allDay":false,"extension_id":2},{"id":884,"start":1262419428000,"end":1262421228000,"title":"883","body":"","multi":0,"allDay":false,"extension_id":2},{"id":885,"start":1262422020000,"end":1262423820000,"title":"884","body":"","multi":0,"allDay":false,"extension_id":2},{"id":886,"start":1262424612000,"end":1262426412000,"title":"885","body":"","multi":0,"allDay":false,"extension_id":2},{"id":887,"start":1262427204000,"end":1262429004000,"title":"886","body":"","multi":0,"allDay":false,"extension_id":2},{"id":888,"start":1262429796000,"end":1262431596000,"title":"887","body":"","multi":0,"allDay":false,"extension_id":2},{"id":889,"start":1262432388000,"end":1262434188000,"title":"888","body":"","multi":0,"allDay":false,"extension_id":2},{"id":890,"start":1262434980000,"end":1262436780000,"title":"889","body":"","multi":0,"allDay":false,"extension_id":2},{"id":891,"start":1262437572000,"end":1262439372000,"title":"890","body":"","multi":0,"allDay":false,"extension_id":2},{"id":892,"start":1262440164000,"end":1262441964000,"title":"891","body":"","multi":0,"allDay":false,"extension_id":2},{"id":893,"start":1262442756000,"end":1262444556000,"title":"892","body":"","multi":0,"allDay":false,"extension_id":2},{"id":894,"start":1262445348000,"end":1262447148000,"title":"893","body":"","multi":0,"allDay":false,"extension_id":2},{"id":895,"start":1262447940000,"end":1262449740000,"title":"894","body":"","multi":0,"allDay":false,"extension_id":2},{"id":896,"start":1262450532000,"end":1262452332000,"title":"895","body":"","multi":0,"allDay":false,"extension_id":2},{"id":897,"start":1262453124000,"end":1262454924000,"title":"896","body":"","multi":0,"allDay":false,"extension_id":2},{"id":898,"start":1262455716000,"end":1262457516000,"title":"897","body":"","multi":0,"allDay":false,"extension_id":2},{"id":899,"start":1262458308000,"end":1262460108000,"title":"898","body":"","multi":0,"allDay":false,"extension_id":2},{"id":900,"start":1262460900000,"end":1262462700000,"title":"899","body":"","multi":0,"allDay":false,"extension_id":2},{"id":901,"start":1262463492000,"end":1262465292000,"title":"900","body":"","multi":0,"allDay":false,"extension_id":2},{"id":902,"start":1262466084000,"end":1262467884000,"title":"901","body":"","multi":0,"allDay":false,"extension_id":2},{"id":903,"start":1262468676000,"end":1262470476000,"title":"902","body":"","multi":0,"allDay":false,"extension_id":2},{"id":904,"start":1262471268000,"end":1262473068000,"title":"903","body":"","multi":0,"allDay":false,"extension_id":2},{"id":905,"start":1262473860000,"end":1262475660000,"title":"904","body":"","multi":0,"allDay":false,"extension_id":2},{"id":906,"start":1262476452000,"end":1262478252000,"title":"905","body":"","multi":0,"allDay":false,"extension_id":2},{"id":907,"start":1262479044000,"end":1262480844000,"title":"906","body":"","multi":0,"allDay":false,"extension_id":2},{"id":908,"start":1262481636000,"end":1262483436000,"title":"907","body":"","multi":0,"allDay":false,"extension_id":2},{"id":909,"start":1262484228000,"end":1262486028000,"title":"908","body":"","multi":0,"allDay":false,"extension_id":2},{"id":910,"start":1262486820000,"end":1262488620000,"title":"909","body":"","multi":0,"allDay":false,"extension_id":2},{"id":911,"start":1262489412000,"end":1262491212000,"title":"910","body":"","multi":0,"allDay":false,"extension_id":2},{"id":912,"start":1262492004000,"end":1262493804000,"title":"911","body":"","multi":0,"allDay":false,"extension_id":2},{"id":913,"start":1262494596000,"end":1262496396000,"title":"912","body":"","multi":0,"allDay":false,"extension_id":2},{"id":914,"start":1262497188000,"end":1262498988000,"title":"913","body":"","multi":0,"allDay":false,"extension_id":2},{"id":915,"start":1262499780000,"end":1262501580000,"title":"914","body":"","multi":0,"allDay":false,"extension_id":2},{"id":916,"start":1262502372000,"end":1262504172000,"title":"915","body":"","multi":0,"allDay":false,"extension_id":2},{"id":917,"start":1262504964000,"end":1262506764000,"title":"916","body":"","multi":0,"allDay":false,"extension_id":2},{"id":918,"start":1262507556000,"end":1262509356000,"title":"917","body":"","multi":0,"allDay":false,"extension_id":2},{"id":919,"start":1262510148000,"end":1262511948000,"title":"918","body":"","multi":0,"allDay":false,"extension_id":2},{"id":920,"start":1262512740000,"end":1262514540000,"title":"919","body":"","multi":0,"allDay":false,"extension_id":2},{"id":921,"start":1262515332000,"end":1262517132000,"title":"920","body":"","multi":0,"allDay":false,"extension_id":2},{"id":922,"start":1262517924000,"end":1262519724000,"title":"921","body":"","multi":0,"allDay":false,"extension_id":2},{"id":923,"start":1262520516000,"end":1262522316000,"title":"922","body":"","multi":0,"allDay":false,"extension_id":2},{"id":924,"start":1262523108000,"end":1262524908000,"title":"923","body":"","multi":0,"allDay":false,"extension_id":2},{"id":925,"start":1262525700000,"end":1262527500000,"title":"924","body":"","multi":0,"allDay":false,"extension_id":2},{"id":926,"start":1262528292000,"end":1262530092000,"title":"925","body":"","multi":0,"allDay":false,"extension_id":2},{"id":927,"start":1262530884000,"end":1262532684000,"title":"926","body":"","multi":0,"allDay":false,"extension_id":2},{"id":928,"start":1262533476000,"end":1262535276000,"title":"927","body":"","multi":0,"allDay":false,"extension_id":2},{"id":929,"start":1262536068000,"end":1262537868000,"title":"928","body":"","multi":0,"allDay":false,"extension_id":2},{"id":930,"start":1262538660000,"end":1262540460000,"title":"929","body":"","multi":0,"allDay":false,"extension_id":2},{"id":931,"start":1262541252000,"end":1262543052000,"title":"930","body":"","multi":0,"allDay":false,"extension_id":2},{"id":932,"start":1262543844000,"end":1262545644000,"title":"931","body":"","multi":0,"allDay":false,"extension_id":2},{"id":933,"start":1262546436000,"end":1262548236000,"title":"932","body":"","multi":0,"allDay":false,"extension_id":2},{"id":934,"start":1262549028000,"end":1262550828000,"title":"933","body":"","multi":0,"allDay":false,"extension_id":2},{"id":935,"start":1262551620000,"end":1262553420000,"title":"934","body":"","multi":0,"allDay":false,"extension_id":2},{"id":936,"start":1262554212000,"end":1262556012000,"title":"935","body":"","multi":0,"allDay":false,"extension_id":2},{"id":937,"start":1262556804000,"end":1262558604000,"title":"936","body":"","multi":0,"allDay":false,"extension_id":2},{"id":938,"start":1262559396000,"end":1262561196000,"title":"937","body":"","multi":0,"allDay":false,"extension_id":2},{"id":939,"start":1262561988000,"end":1262563788000,"title":"938","body":"","multi":0,"allDay":false,"extension_id":2},{"id":940,"start":1262564580000,"end":1262566380000,"title":"939","body":"","multi":0,"allDay":false,"extension_id":2},{"id":941,"start":1262567172000,"end":1262568972000,"title":"940","body":"","multi":0,"allDay":false,"extension_id":2},{"id":942,"start":1262569764000,"end":1262571564000,"title":"941","body":"","multi":0,"allDay":false,"extension_id":2},{"id":943,"start":1262572356000,"end":1262574156000,"title":"942","body":"","multi":0,"allDay":false,"extension_id":2},{"id":944,"start":1262574948000,"end":1262576748000,"title":"943","body":"","multi":0,"allDay":false,"extension_id":2},{"id":945,"start":1262577540000,"end":1262579340000,"title":"944","body":"","multi":0,"allDay":false,"extension_id":2},{"id":946,"start":1262580132000,"end":1262581932000,"title":"945","body":"","multi":0,"allDay":false,"extension_id":2},{"id":947,"start":1262582724000,"end":1262584524000,"title":"946","body":"","multi":0,"allDay":false,"extension_id":2},{"id":948,"start":1262585316000,"end":1262587116000,"title":"947","body":"","multi":0,"allDay":false,"extension_id":2},{"id":949,"start":1262587908000,"end":1262589708000,"title":"948","body":"","multi":0,"allDay":false,"extension_id":2},{"id":950,"start":1262590500000,"end":1262592300000,"title":"949","body":"","multi":0,"allDay":false,"extension_id":2},{"id":951,"start":1262593092000,"end":1262594892000,"title":"950","body":"","multi":0,"allDay":false,"extension_id":2},{"id":952,"start":1262595684000,"end":1262597484000,"title":"951","body":"","multi":0,"allDay":false,"extension_id":2},{"id":953,"start":1262598276000,"end":1262600076000,"title":"952","body":"","multi":0,"allDay":false,"extension_id":2},{"id":954,"start":1262600868000,"end":1262602668000,"title":"953","body":"","multi":0,"allDay":false,"extension_id":2},{"id":955,"start":1262603460000,"end":1262605260000,"title":"954","body":"","multi":0,"allDay":false,"extension_id":2},{"id":956,"start":1262606052000,"end":1262607852000,"title":"955","body":"","multi":0,"allDay":false,"extension_id":2},{"id":957,"start":1262608644000,"end":1262610444000,"title":"956","body":"","multi":0,"allDay":false,"extension_id":2},{"id":958,"start":1262611236000,"end":1262613036000,"title":"957","body":"","multi":0,"allDay":false,"extension_id":2},{"id":959,"start":1262613828000,"end":1262615628000,"title":"958","body":"","multi":0,"allDay":false,"extension_id":2},{"id":960,"start":1262616420000,"end":1262618220000,"title":"959","body":"","multi":0,"allDay":false,"extension_id":2},{"id":961,"start":1262619012000,"end":1262620812000,"title":"960","body":"","multi":0,"allDay":false,"extension_id":2},{"id":962,"start":1262621604000,"end":1262623404000,"title":"961","body":"","multi":0,"allDay":false,"extension_id":2},{"id":963,"start":1262624196000,"end":1262625996000,"title":"962","body":"","multi":0,"allDay":false,"extension_id":2},{"id":964,"start":1262626788000,"end":1262628588000,"title":"963","body":"","multi":0,"allDay":false,"extension_id":2},{"id":965,"start":1262629380000,"end":1262631180000,"title":"964","body":"","multi":0,"allDay":false,"extension_id":2},{"id":966,"start":1262631972000,"end":1262633772000,"title":"965","body":"","multi":0,"allDay":false,"extension_id":2},{"id":967,"start":1262634564000,"end":1262636364000,"title":"966","body":"","multi":0,"allDay":false,"extension_id":2},{"id":968,"start":1262637156000,"end":1262638956000,"title":"967","body":"","multi":0,"allDay":false,"extension_id":2},{"id":969,"start":1262639748000,"end":1262641548000,"title":"968","body":"","multi":0,"allDay":false,"extension_id":2},{"id":970,"start":1262642340000,"end":1262644140000,"title":"969","body":"","multi":0,"allDay":false,"extension_id":2},{"id":971,"start":1262644932000,"end":1262646732000,"title":"970","body":"","multi":0,"allDay":false,"extension_id":2},{"id":972,"start":1262647524000,"end":1262649324000,"title":"971","body":"","multi":0,"allDay":false,"extension_id":2},{"id":973,"start":1262650116000,"end":1262651916000,"title":"972","body":"","multi":0,"allDay":false,"extension_id":2},{"id":974,"start":1262652708000,"end":1262654508000,"title":"973","body":"","multi":0,"allDay":false,"extension_id":2},{"id":975,"start":1262655300000,"end":1262657100000,"title":"974","body":"","multi":0,"allDay":false,"extension_id":2},{"id":976,"start":1262657892000,"end":1262659692000,"title":"975","body":"","multi":0,"allDay":false,"extension_id":2},{"id":977,"start":1262660484000,"end":1262662284000,"title":"976","body":"","multi":0,"allDay":false,"extension_id":2},{"id":978,"start":1262663076000,"end":1262664876000,"title":"977","body":"","multi":0,"allDay":false,"extension_id":2},{"id":979,"start":1262665668000,"end":1262667468000,"title":"978","body":"","multi":0,"allDay":false,"extension_id":2},{"id":980,"start":1262668260000,"end":1262670060000,"title":"979","body":"","multi":0,"allDay":false,"extension_id":2},{"id":981,"start":1262670852000,"end":1262672652000,"title":"980","body":"","multi":0,"allDay":false,"extension_id":2},{"id":982,"start":1262673444000,"end":1262675244000,"title":"981","body":"","multi":0,"allDay":false,"extension_id":2},{"id":983,"start":1262676036000,"end":1262677836000,"title":"982","body":"","multi":0,"allDay":false,"extension_id":2},{"id":984,"start":1262678628000,"end":1262680428000,"title":"983","body":"","multi":0,"allDay":false,"extension_id":2},{"id":985,"start":1262681220000,"end":1262683020000,"title":"984","body":"","multi":0,"allDay":false,"extension_id":2},{"id":986,"start":1262683812000,"end":1262685612000,"title":"985","body":"","multi":0,"allDay":false,"extension_id":2},{"id":987,"start":1262686404000,"end":1262688204000,"title":"986","body":"","multi":0,"allDay":false,"extension_id":2},{"id":988,"start":1262688996000,"end":1262690796000,"title":"987","body":"","multi":0,"allDay":false,"extension_id":2},{"id":989,"start":1262691588000,"end":1262693388000,"title":"988","body":"","multi":0,"allDay":false,"extension_id":2},{"id":990,"start":1262694180000,"end":1262695980000,"title":"989","body":"","multi":0,"allDay":false,"extension_id":2},{"id":991,"start":1262696772000,"end":1262698572000,"title":"990","body":"","multi":0,"allDay":false,"extension_id":2},{"id":992,"start":1262699364000,"end":1262701164000,"title":"991","body":"","multi":0,"allDay":false,"extension_id":2},{"id":993,"start":1262701956000,"end":1262703756000,"title":"992","body":"","multi":0,"allDay":false,"extension_id":2},{"id":994,"start":1262704548000,"end":1262706348000,"title":"993","body":"","multi":0,"allDay":false,"extension_id":2},{"id":995,"start":1262707140000,"end":1262708940000,"title":"994","body":"","multi":0,"allDay":false,"extension_id":2},{"id":996,"start":1262709732000,"end":1262711532000,"title":"995","body":"","multi":0,"allDay":false,"extension_id":2},{"id":997,"start":1262712324000,"end":1262714124000,"title":"996","body":"","multi":0,"allDay":false,"extension_id":2},{"id":998,"start":1262714916000,"end":1262716716000,"title":"997","body":"","multi":0,"allDay":false,"extension_id":2},{"id":999,"start":1262717508000,"end":1262719308000,"title":"998","body":"","multi":0,"allDay":false,"extension_id":2},{"id":1000,"start":1262720100000,"end":1262721900000,"title":"999","body":"","multi":0,"allDay":false,"extension_id":2},{"id":1,"start":1264425660000,"end":1264427460000,"title":"0","body":"","multi":0,"allDay":false,"extension_id":2},{"id":2,"start":1264428252000,"end":1264430052000,"title":"1","body":"","multi":0,"allDay":false,"extension_id":2},{"id":3,"start":1264430844000,"end":1264432644000,"title":"2","body":"","multi":0,"allDay":false,"extension_id":2},{"id":4,"start":1264433436000,"end":1264435236000,"title":"3","body":"","multi":0,"allDay":false,"extension_id":2},{"id":5,"start":1264436028000,"end":1264437828000,"title":"4","body":"","multi":0,"allDay":false,"extension_id":2},{"id":6,"start":1264438620000,"end":1264440420000,"title":"5","body":"","multi":0,"allDay":false,"extension_id":2},{"id":7,"start":1264441212000,"end":1264443012000,"title":"6","body":"","multi":0,"allDay":false,"extension_id":2},{"id":8,"start":1264443804000,"end":1264445604000,"title":"7","body":"","multi":0,"allDay":false,"extension_id":2},{"id":9,"start":1264446396000,"end":1264448196000,"title":"8","body":"","multi":0,"allDay":false,"extension_id":2},{"id":10,"start":1264448988000,"end":1264450788000,"title":"9","body":"","multi":0,"allDay":false,"extension_id":2},{"id":11,"start":1264451580000,"end":1264453380000,"title":"10","body":"","multi":0,"allDay":false,"extension_id":2},{"id":12,"start":1264454172000,"end":1264455972000,"title":"11","body":"","multi":0,"allDay":false,"extension_id":2},{"id":13,"start":1264456764000,"end":1264458564000,"title":"12","body":"","multi":0,"allDay":false,"extension_id":2},{"id":14,"start":1264459356000,"end":1264461156000,"title":"13","body":"","multi":0,"allDay":false,"extension_id":2},{"id":15,"start":1264461948000,"end":1264463748000,"title":"14","body":"","multi":0,"allDay":false,"extension_id":2},{"id":16,"start":1264464540000,"end":1264466340000,"title":"15","body":"","multi":0,"allDay":false,"extension_id":2},{"id":17,"start":1264467132000,"end":1264468932000,"title":"16","body":"","multi":0,"allDay":false,"extension_id":2},{"id":18,"start":1264469724000,"end":1264471524000,"title":"17","body":"","multi":0,"allDay":false,"extension_id":2},{"id":19,"start":1264472316000,"end":1264474116000,"title":"18","body":"","multi":0,"allDay":false,"extension_id":2},{"id":20,"start":1264474908000,"end":1264476708000,"title":"19","body":"","multi":0,"allDay":false,"extension_id":2},{"id":21,"start":1264477500000,"end":1264479300000,"title":"20","body":"","multi":0,"allDay":false,"extension_id":2},{"id":22,"start":1264480092000,"end":1264481892000,"title":"21","body":"","multi":0,"allDay":false,"extension_id":2},{"id":23,"start":1264482684000,"end":1264484484000,"title":"22","body":"","multi":0,"allDay":false,"extension_id":2},{"id":24,"start":1264485276000,"end":1264487076000,"title":"23","body":"","multi":0,"allDay":false,"extension_id":2},{"id":25,"start":1264487868000,"end":1264489668000,"title":"24","body":"","multi":0,"allDay":false,"extension_id":2},{"id":26,"start":1264490460000,"end":1264492260000,"title":"25","body":"","multi":0,"allDay":false,"extension_id":2},{"id":27,"start":1264493052000,"end":1264494852000,"title":"26","body":"","multi":0,"allDay":false,"extension_id":2},{"id":28,"start":1264495644000,"end":1264497444000,"title":"27","body":"","multi":0,"allDay":false,"extension_id":2},{"id":29,"start":1264498236000,"end":1264500036000,"title":"28","body":"","multi":0,"allDay":false,"extension_id":2},{"id":30,"start":1264500828000,"end":1264502628000,"title":"29","body":"","multi":0,"allDay":false,"extension_id":2},{"id":31,"start":1264503420000,"end":1264505220000,"title":"30","body":"","multi":0,"allDay":false,"extension_id":2},{"id":32,"start":1264506012000,"end":1264507812000,"title":"31","body":"","multi":0,"allDay":false,"extension_id":2},{"id":33,"start":1264508604000,"end":1264510404000,"title":"32","body":"","multi":0,"allDay":false,"extension_id":2},{"id":34,"start":1264511196000,"end":1264512996000,"title":"33","body":"","multi":0,"allDay":false,"extension_id":2},{"id":35,"start":1264513788000,"end":1264515588000,"title":"34","body":"","multi":0,"allDay":false,"extension_id":2},{"id":36,"start":1264516380000,"end":1264518180000,"title":"35","body":"","multi":0,"allDay":false,"extension_id":2},{"id":37,"start":1264518972000,"end":1264520772000,"title":"36","body":"","multi":0,"allDay":false,"extension_id":2},{"id":38,"start":1264521564000,"end":1264523364000,"title":"37","body":"","multi":0,"allDay":false,"extension_id":2},{"id":39,"start":1264524156000,"end":1264525956000,"title":"38","body":"","multi":0,"allDay":false,"extension_id":2},{"id":40,"start":1264526748000,"end":1264528548000,"title":"39","body":"","multi":0,"allDay":false,"extension_id":2},{"id":41,"start":1264529340000,"end":1264531140000,"title":"40","body":"","multi":0,"allDay":false,"extension_id":2},{"id":42,"start":1264531932000,"end":1264533732000,"title":"41","body":"","multi":0,"allDay":false,"extension_id":2},{"id":43,"start":1264534524000,"end":1264536324000,"title":"42","body":"","multi":0,"allDay":false,"extension_id":2},{"id":44,"start":1264537116000,"end":1264538916000,"title":"43","body":"","multi":0,"allDay":false,"extension_id":2},{"id":45,"start":1264539708000,"end":1264541508000,"title":"44","body":"","multi":0,"allDay":false,"extension_id":2},{"id":46,"start":1264542300000,"end":1264544100000,"title":"45","body":"","multi":0,"allDay":false,"extension_id":2},{"id":47,"start":1264544892000,"end":1264546692000,"title":"46","body":"","multi":0,"allDay":false,"extension_id":2},{"id":48,"start":1264547484000,"end":1264549284000,"title":"47","body":"","multi":0,"allDay":false,"extension_id":2},{"id":49,"start":1264550076000,"end":1264551876000,"title":"48","body":"","multi":0,"allDay":false,"extension_id":2},{"id":50,"start":1264552668000,"end":1264554468000,"title":"49","body":"","multi":0,"allDay":false,"extension_id":2},{"id":51,"start":1264555260000,"end":1264557060000,"title":"50","body":"","multi":0,"allDay":false,"extension_id":2},{"id":52,"start":1264557852000,"end":1264559652000,"title":"51","body":"","multi":0,"allDay":false,"extension_id":2},{"id":53,"start":1264560444000,"end":1264562244000,"title":"52","body":"","multi":0,"allDay":false,"extension_id":2},{"id":54,"start":1264563036000,"end":1264564836000,"title":"53","body":"","multi":0,"allDay":false,"extension_id":2},{"id":55,"start":1264565628000,"end":1264567428000,"title":"54","body":"","multi":0,"allDay":false,"extension_id":2},{"id":56,"start":1264568220000,"end":1264570020000,"title":"55","body":"","multi":0,"allDay":false,"extension_id":2},{"id":57,"start":1264570812000,"end":1264572612000,"title":"56","body":"","multi":0,"allDay":false,"extension_id":2},{"id":58,"start":1264573404000,"end":1264575204000,"title":"57","body":"","multi":0,"allDay":false,"extension_id":2},{"id":59,"start":1264575996000,"end":1264577796000,"title":"58","body":"","multi":0,"allDay":false,"extension_id":2},{"id":60,"start":1264578588000,"end":1264580388000,"title":"59","body":"","multi":0,"allDay":false,"extension_id":2},{"id":61,"start":1264581180000,"end":1264582980000,"title":"60","body":"","multi":0,"allDay":false,"extension_id":2},{"id":62,"start":1264583772000,"end":1264585572000,"title":"61","body":"","multi":0,"allDay":false,"extension_id":2},{"id":63,"start":1264586364000,"end":1264588164000,"title":"62","body":"","multi":0,"allDay":false,"extension_id":2},{"id":64,"start":1264588956000,"end":1264590756000,"title":"63","body":"","multi":0,"allDay":false,"extension_id":2},{"id":65,"start":1264591548000,"end":1264593348000,"title":"64","body":"","multi":0,"allDay":false,"extension_id":2},{"id":66,"start":1264594140000,"end":1264595940000,"title":"65","body":"","multi":0,"allDay":false,"extension_id":2},{"id":67,"start":1264596732000,"end":1264598532000,"title":"66","body":"","multi":0,"allDay":false,"extension_id":2},{"id":68,"start":1264599324000,"end":1264601124000,"title":"67","body":"","multi":0,"allDay":false,"extension_id":2},{"id":69,"start":1264601916000,"end":1264603716000,"title":"68","body":"","multi":0,"allDay":false,"extension_id":2},{"id":70,"start":1264604508000,"end":1264606308000,"title":"69","body":"","multi":0,"allDay":false,"extension_id":2},{"id":71,"start":1264607100000,"end":1264608900000,"title":"70","body":"","multi":0,"allDay":false,"extension_id":2},{"id":72,"start":1264609692000,"end":1264611492000,"title":"71","body":"","multi":0,"allDay":false,"extension_id":2},{"id":73,"start":1264612284000,"end":1264614084000,"title":"72","body":"","multi":0,"allDay":false,"extension_id":2},{"id":74,"start":1264614876000,"end":1264616676000,"title":"73","body":"","multi":0,"allDay":false,"extension_id":2},{"id":75,"start":1264617468000,"end":1264619268000,"title":"74","body":"","multi":0,"allDay":false,"extension_id":2},{"id":76,"start":1264620060000,"end":1264621860000,"title":"75","body":"","multi":0,"allDay":false,"extension_id":2},{"id":77,"start":1264622652000,"end":1264624452000,"title":"76","body":"","multi":0,"allDay":false,"extension_id":2},{"id":78,"start":1264625244000,"end":1264627044000,"title":"77","body":"","multi":0,"allDay":false,"extension_id":2},{"id":79,"start":1264627836000,"end":1264629636000,"title":"78","body":"","multi":0,"allDay":false,"extension_id":2},{"id":80,"start":1264630428000,"end":1264632228000,"title":"79","body":"","multi":0,"allDay":false,"extension_id":2},{"id":81,"start":1264633020000,"end":1264634820000,"title":"80","body":"","multi":0,"allDay":false,"extension_id":2},{"id":82,"start":1264635612000,"end":1264637412000,"title":"81","body":"","multi":0,"allDay":false,"extension_id":2},{"id":83,"start":1264638204000,"end":1264640004000,"title":"82","body":"","multi":0,"allDay":false,"extension_id":2},{"id":84,"start":1264640796000,"end":1264642596000,"title":"83","body":"","multi":0,"allDay":false,"extension_id":2},{"id":85,"start":1264643388000,"end":1264645188000,"title":"84","body":"","multi":0,"allDay":false,"extension_id":2},{"id":86,"start":1264645980000,"end":1264647780000,"title":"85","body":"","multi":0,"allDay":false,"extension_id":2},{"id":87,"start":1264648572000,"end":1264650372000,"title":"86","body":"","multi":0,"allDay":false,"extension_id":2},{"id":88,"start":1264651164000,"end":1264652964000,"title":"87","body":"","multi":0,"allDay":false,"extension_id":2},{"id":89,"start":1264653756000,"end":1264655556000,"title":"88","body":"","multi":0,"allDay":false,"extension_id":2},{"id":90,"start":1264656348000,"end":1264658148000,"title":"89","body":"","multi":0,"allDay":false,"extension_id":2},{"id":91,"start":1264658940000,"end":1264660740000,"title":"90","body":"","multi":0,"allDay":false,"extension_id":2},{"id":92,"start":1264661532000,"end":1264663332000,"title":"91","body":"","multi":0,"allDay":false,"extension_id":2},{"id":93,"start":1264664124000,"end":1264665924000,"title":"92","body":"","multi":0,"allDay":false,"extension_id":2},{"id":94,"start":1264666716000,"end":1264668516000,"title":"93","body":"","multi":0,"allDay":false,"extension_id":2},{"id":95,"start":1264669308000,"end":1264671108000,"title":"94","body":"","multi":0,"allDay":false,"extension_id":2},{"id":96,"start":1264671900000,"end":1264673700000,"title":"95","body":"","multi":0,"allDay":false,"extension_id":2},{"id":97,"start":1264674492000,"end":1264676292000,"title":"96","body":"","multi":0,"allDay":false,"extension_id":2},{"id":98,"start":1264677084000,"end":1264678884000,"title":"97","body":"","multi":0,"allDay":false,"extension_id":2},{"id":99,"start":1264679676000,"end":1264681476000,"title":"98","body":"","multi":0,"allDay":false,"extension_id":2},{"id":100,"start":1264682268000,"end":1264684068000,"title":"99","body":"","multi":0,"allDay":false,"extension_id":2},{"id":101,"start":1264684860000,"end":1264686660000,"title":"100","body":"","multi":0,"allDay":false,"extension_id":2},{"id":102,"start":1264687452000,"end":1264689252000,"title":"101","body":"","multi":0,"allDay":false,"extension_id":2},{"id":103,"start":1264690044000,"end":1264691844000,"title":"102","body":"","multi":0,"allDay":false,"extension_id":2},{"id":104,"start":1264692636000,"end":1264694436000,"title":"103","body":"","multi":0,"allDay":false,"extension_id":2},{"id":105,"start":1264695228000,"end":1264697028000,"title":"104","body":"","multi":0,"allDay":false,"extension_id":2},{"id":106,"start":1264697820000,"end":1264699620000,"title":"105","body":"","multi":0,"allDay":false,"extension_id":2},{"id":107,"start":1264700412000,"end":1264702212000,"title":"106","body":"","multi":0,"allDay":false,"extension_id":2},{"id":108,"start":1264703004000,"end":1264704804000,"title":"107","body":"","multi":0,"allDay":false,"extension_id":2},{"id":109,"start":1264705596000,"end":1264707396000,"title":"108","body":"","multi":0,"allDay":false,"extension_id":2},{"id":110,"start":1264708188000,"end":1264709988000,"title":"109","body":"","multi":0,"allDay":false,"extension_id":2},{"id":111,"start":1264710780000,"end":1264712580000,"title":"110","body":"","multi":0,"allDay":false,"extension_id":2},{"id":112,"start":1264713372000,"end":1264715172000,"title":"111","body":"","multi":0,"allDay":false,"extension_id":2},{"id":113,"start":1264715964000,"end":1264717764000,"title":"112","body":"","multi":0,"allDay":false,"extension_id":2},{"id":114,"start":1264718556000,"end":1264720356000,"title":"113","body":"","multi":0,"allDay":false,"extension_id":2},{"id":115,"start":1264721148000,"end":1264722948000,"title":"114","body":"","multi":0,"allDay":false,"extension_id":2},{"id":116,"start":1264723740000,"end":1264725540000,"title":"115","body":"","multi":0,"allDay":false,"extension_id":2},{"id":117,"start":1264726332000,"end":1264728132000,"title":"116","body":"","multi":0,"allDay":false,"extension_id":2},{"id":118,"start":1264728924000,"end":1264730724000,"title":"117","body":"","multi":0,"allDay":false,"extension_id":2},{"id":119,"start":1264731516000,"end":1264733316000,"title":"118","body":"","multi":0,"allDay":false,"extension_id":2},{"id":120,"start":1264734108000,"end":1264735908000,"title":"119","body":"","multi":0,"allDay":false,"extension_id":2},{"id":121,"start":1264736700000,"end":1264738500000,"title":"120","body":"","multi":0,"allDay":false,"extension_id":2},{"id":122,"start":1264739292000,"end":1264741092000,"title":"121","body":"","multi":0,"allDay":false,"extension_id":2},{"id":123,"start":1264741884000,"end":1264743684000,"title":"122","body":"","multi":0,"allDay":false,"extension_id":2},{"id":124,"start":1264744476000,"end":1264746276000,"title":"123","body":"","multi":0,"allDay":false,"extension_id":2},{"id":125,"start":1264747068000,"end":1264748868000,"title":"124","body":"","multi":0,"allDay":false,"extension_id":2},{"id":126,"start":1264749660000,"end":1264751460000,"title":"125","body":"","multi":0,"allDay":false,"extension_id":2},{"id":127,"start":1264752252000,"end":1264754052000,"title":"126","body":"","multi":0,"allDay":false,"extension_id":2},{"id":128,"start":1264754844000,"end":1264756644000,"title":"127","body":"","multi":0,"allDay":false,"extension_id":2},{"id":129,"start":1264757436000,"end":1264759236000,"title":"128","body":"","multi":0,"allDay":false,"extension_id":2},{"id":130,"start":1264760028000,"end":1264761828000,"title":"129","body":"","multi":0,"allDay":false,"extension_id":2},{"id":131,"start":1264762620000,"end":1264764420000,"title":"130","body":"","multi":0,"allDay":false,"extension_id":2},{"id":132,"start":1264765212000,"end":1264767012000,"title":"131","body":"","multi":0,"allDay":false,"extension_id":2},{"id":133,"start":1264767804000,"end":1264769604000,"title":"132","body":"","multi":0,"allDay":false,"extension_id":2},{"id":134,"start":1264770396000,"end":1264772196000,"title":"133","body":"","multi":0,"allDay":false,"extension_id":2},{"id":135,"start":1264772988000,"end":1264774788000,"title":"134","body":"","multi":0,"allDay":false,"extension_id":2},{"id":136,"start":1264775580000,"end":1264777380000,"title":"135","body":"","multi":0,"allDay":false,"extension_id":2},{"id":137,"start":1264778172000,"end":1264779972000,"title":"136","body":"","multi":0,"allDay":false,"extension_id":2},{"id":138,"start":1264780764000,"end":1264782564000,"title":"137","body":"","multi":0,"allDay":false,"extension_id":2},{"id":139,"start":1264783356000,"end":1264785156000,"title":"138","body":"","multi":0,"allDay":false,"extension_id":2},{"id":140,"start":1264785948000,"end":1264787748000,"title":"139","body":"","multi":0,"allDay":false,"extension_id":2},{"id":141,"start":1264788540000,"end":1264790340000,"title":"140","body":"","multi":0,"allDay":false,"extension_id":2},{"id":142,"start":1264791132000,"end":1264792932000,"title":"141","body":"","multi":0,"allDay":false,"extension_id":2},{"id":143,"start":1264793724000,"end":1264795524000,"title":"142","body":"","multi":0,"allDay":false,"extension_id":2},{"id":144,"start":1264796316000,"end":1264798116000,"title":"143","body":"","multi":0,"allDay":false,"extension_id":2},{"id":145,"start":1264798908000,"end":1264800708000,"title":"144","body":"","multi":0,"allDay":false,"extension_id":2},{"id":146,"start":1264801500000,"end":1264803300000,"title":"145","body":"","multi":0,"allDay":false,"extension_id":2},{"id":147,"start":1264804092000,"end":1264805892000,"title":"146","body":"","multi":0,"allDay":false,"extension_id":2},{"id":148,"start":1264806684000,"end":1264808484000,"title":"147","body":"","multi":0,"allDay":false,"extension_id":2},{"id":149,"start":1264809276000,"end":1264811076000,"title":"148","body":"","multi":0,"allDay":false,"extension_id":2},{"id":150,"start":1264811868000,"end":1264813668000,"title":"149","body":"","multi":0,"allDay":false,"extension_id":2},{"id":151,"start":1264814460000,"end":1264816260000,"title":"150","body":"","multi":0,"allDay":false,"extension_id":2},{"id":152,"start":1264817052000,"end":1264818852000,"title":"151","body":"","multi":0,"allDay":false,"extension_id":2},{"id":153,"start":1264819644000,"end":1264821444000,"title":"152","body":"","multi":0,"allDay":false,"extension_id":2},{"id":154,"start":1264822236000,"end":1264824036000,"title":"153","body":"","multi":0,"allDay":false,"extension_id":2},{"id":155,"start":1264824828000,"end":1264826628000,"title":"154","body":"","multi":0,"allDay":false,"extension_id":2},{"id":156,"start":1264827420000,"end":1264829220000,"title":"155","body":"","multi":0,"allDay":false,"extension_id":2},{"id":157,"start":1264830012000,"end":1264831812000,"title":"156","body":"","multi":0,"allDay":false,"extension_id":2},{"id":158,"start":1264832604000,"end":1264834404000,"title":"157","body":"","multi":0,"allDay":false,"extension_id":2},{"id":159,"start":1264835196000,"end":1264836996000,"title":"158","body":"","multi":0,"allDay":false,"extension_id":2},{"id":160,"start":1264837788000,"end":1264839588000,"title":"159","body":"","multi":0,"allDay":false,"extension_id":2},{"id":161,"start":1264840380000,"end":1264842180000,"title":"160","body":"","multi":0,"allDay":false,"extension_id":2},{"id":162,"start":1264842972000,"end":1264844772000,"title":"161","body":"","multi":0,"allDay":false,"extension_id":2},{"id":163,"start":1264845564000,"end":1264847364000,"title":"162","body":"","multi":0,"allDay":false,"extension_id":2},{"id":164,"start":1264848156000,"end":1264849956000,"title":"163","body":"","multi":0,"allDay":false,"extension_id":2},{"id":165,"start":1264850748000,"end":1264852548000,"title":"164","body":"","multi":0,"allDay":false,"extension_id":2},{"id":166,"start":1264853340000,"end":1264855140000,"title":"165","body":"","multi":0,"allDay":false,"extension_id":2},{"id":167,"start":1264855932000,"end":1264857732000,"title":"166","body":"","multi":0,"allDay":false,"extension_id":2},{"id":168,"start":1264858524000,"end":1264860324000,"title":"167","body":"","multi":0,"allDay":false,"extension_id":2},{"id":169,"start":1264861116000,"end":1264862916000,"title":"168","body":"","multi":0,"allDay":false,"extension_id":2},{"id":170,"start":1264863708000,"end":1264865508000,"title":"169","body":"","multi":0,"allDay":false,"extension_id":2},{"id":171,"start":1264866300000,"end":1264868100000,"title":"170","body":"","multi":0,"allDay":false,"extension_id":2},{"id":172,"start":1264868892000,"end":1264870692000,"title":"171","body":"","multi":0,"allDay":false,"extension_id":2},{"id":173,"start":1264871484000,"end":1264873284000,"title":"172","body":"","multi":0,"allDay":false,"extension_id":2},{"id":174,"start":1264874076000,"end":1264875876000,"title":"173","body":"","multi":0,"allDay":false,"extension_id":2},{"id":175,"start":1264876668000,"end":1264878468000,"title":"174","body":"","multi":0,"allDay":false,"extension_id":2},{"id":176,"start":1264879260000,"end":1264881060000,"title":"175","body":"","multi":0,"allDay":false,"extension_id":2},{"id":177,"start":1264881852000,"end":1264883652000,"title":"176","body":"","multi":0,"allDay":false,"extension_id":2},{"id":178,"start":1264884444000,"end":1264886244000,"title":"177","body":"","multi":0,"allDay":false,"extension_id":2},{"id":179,"start":1264887036000,"end":1264888836000,"title":"178","body":"","multi":0,"allDay":false,"extension_id":2},{"id":180,"start":1264889628000,"end":1264891428000,"title":"179","body":"","multi":0,"allDay":false,"extension_id":2},{"id":181,"start":1264892220000,"end":1264894020000,"title":"180","body":"","multi":0,"allDay":false,"extension_id":2},{"id":182,"start":1264894812000,"end":1264896612000,"title":"181","body":"","multi":0,"allDay":false,"extension_id":2},{"id":183,"start":1264897404000,"end":1264899204000,"title":"182","body":"","multi":0,"allDay":false,"extension_id":2},{"id":184,"start":1264899996000,"end":1264901796000,"title":"183","body":"","multi":0,"allDay":false,"extension_id":2},{"id":185,"start":1264902588000,"end":1264904388000,"title":"184","body":"","multi":0,"allDay":false,"extension_id":2},{"id":186,"start":1264905180000,"end":1264906980000,"title":"185","body":"","multi":0,"allDay":false,"extension_id":2},{"id":187,"start":1264907772000,"end":1264909572000,"title":"186","body":"","multi":0,"allDay":false,"extension_id":2},{"id":188,"start":1264910364000,"end":1264912164000,"title":"187","body":"","multi":0,"allDay":false,"extension_id":2},{"id":189,"start":1264912956000,"end":1264914756000,"title":"188","body":"","multi":0,"allDay":false,"extension_id":2},{"id":190,"start":1264915548000,"end":1264917348000,"title":"189","body":"","multi":0,"allDay":false,"extension_id":2},{"id":191,"start":1264918140000,"end":1264919940000,"title":"190","body":"","multi":0,"allDay":false,"extension_id":2},{"id":192,"start":1264920732000,"end":1264922532000,"title":"191","body":"","multi":0,"allDay":false,"extension_id":2},{"id":193,"start":1264923324000,"end":1264925124000,"title":"192","body":"","multi":0,"allDay":false,"extension_id":2},{"id":194,"start":1264925916000,"end":1264927716000,"title":"193","body":"","multi":0,"allDay":false,"extension_id":2},{"id":195,"start":1264928508000,"end":1264930308000,"title":"194","body":"","multi":0,"allDay":false,"extension_id":2},{"id":196,"start":1264931100000,"end":1264932900000,"title":"195","body":"","multi":0,"allDay":false,"extension_id":2},{"id":197,"start":1264933692000,"end":1264935492000,"title":"196","body":"","multi":0,"allDay":false,"extension_id":2},{"id":198,"start":1264936284000,"end":1264938084000,"title":"197","body":"","multi":0,"allDay":false,"extension_id":2},{"id":199,"start":1264938876000,"end":1264940676000,"title":"198","body":"","multi":0,"allDay":false,"extension_id":2},{"id":200,"start":1264941468000,"end":1264943268000,"title":"199","body":"","multi":0,"allDay":false,"extension_id":2},{"id":201,"start":1264944060000,"end":1264945860000,"title":"200","body":"","multi":0,"allDay":false,"extension_id":2},{"id":202,"start":1264946652000,"end":1264948452000,"title":"201","body":"","multi":0,"allDay":false,"extension_id":2},{"id":203,"start":1264949244000,"end":1264951044000,"title":"202","body":"","multi":0,"allDay":false,"extension_id":2},{"id":204,"start":1264951836000,"end":1264953636000,"title":"203","body":"","multi":0,"allDay":false,"extension_id":2},{"id":205,"start":1264954428000,"end":1264956228000,"title":"204","body":"","multi":0,"allDay":false,"extension_id":2},{"id":206,"start":1264957020000,"end":1264958820000,"title":"205","body":"","multi":0,"allDay":false,"extension_id":2},{"id":207,"start":1264959612000,"end":1264961412000,"title":"206","body":"","multi":0,"allDay":false,"extension_id":2},{"id":208,"start":1264962204000,"end":1264964004000,"title":"207","body":"","multi":0,"allDay":false,"extension_id":2},{"id":209,"start":1264964796000,"end":1264966596000,"title":"208","body":"","multi":0,"allDay":false,"extension_id":2},{"id":210,"start":1264967388000,"end":1264969188000,"title":"209","body":"","multi":0,"allDay":false,"extension_id":2},{"id":211,"start":1264969980000,"end":1264971780000,"title":"210","body":"","multi":0,"allDay":false,"extension_id":2},{"id":212,"start":1264972572000,"end":1264974372000,"title":"211","body":"","multi":0,"allDay":false,"extension_id":2},{"id":213,"start":1264975164000,"end":1264976964000,"title":"212","body":"","multi":0,"allDay":false,"extension_id":2},{"id":214,"start":1264977756000,"end":1264979556000,"title":"213","body":"","multi":0,"allDay":false,"extension_id":2},{"id":215,"start":1264980348000,"end":1264982148000,"title":"214","body":"","multi":0,"allDay":false,"extension_id":2},{"id":216,"start":1264982940000,"end":1264984740000,"title":"215","body":"","multi":0,"allDay":false,"extension_id":2},{"id":217,"start":1264985532000,"end":1264987332000,"title":"216","body":"","multi":0,"allDay":false,"extension_id":2},{"id":218,"start":1264988124000,"end":1264989924000,"title":"217","body":"","multi":0,"allDay":false,"extension_id":2},{"id":219,"start":1264990716000,"end":1264992516000,"title":"218","body":"","multi":0,"allDay":false,"extension_id":2},{"id":220,"start":1264993308000,"end":1264995108000,"title":"219","body":"","multi":0,"allDay":false,"extension_id":2},{"id":221,"start":1264995900000,"end":1264997700000,"title":"220","body":"","multi":0,"allDay":false,"extension_id":2},{"id":222,"start":1264998492000,"end":1265000292000,"title":"221","body":"","multi":0,"allDay":false,"extension_id":2},{"id":223,"start":1265001084000,"end":1265002884000,"title":"222","body":"","multi":0,"allDay":false,"extension_id":2},{"id":224,"start":1265003676000,"end":1265005476000,"title":"223","body":"","multi":0,"allDay":false,"extension_id":2},{"id":225,"start":1265006268000,"end":1265008068000,"title":"224","body":"","multi":0,"allDay":false,"extension_id":2},{"id":226,"start":1265008860000,"end":1265010660000,"title":"225","body":"","multi":0,"allDay":false,"extension_id":2},{"id":227,"start":1265011452000,"end":1265013252000,"title":"226","body":"","multi":0,"allDay":false,"extension_id":2},{"id":228,"start":1265014044000,"end":1265015844000,"title":"227","body":"","multi":0,"allDay":false,"extension_id":2},{"id":229,"start":1265016636000,"end":1265018436000,"title":"228","body":"","multi":0,"allDay":false,"extension_id":2},{"id":230,"start":1265019228000,"end":1265021028000,"title":"229","body":"","multi":0,"allDay":false,"extension_id":2},{"id":231,"start":1265021820000,"end":1265023620000,"title":"230","body":"","multi":0,"allDay":false,"extension_id":2},{"id":232,"start":1265024412000,"end":1265026212000,"title":"231","body":"","multi":0,"allDay":false,"extension_id":2},{"id":233,"start":1265027004000,"end":1265028804000,"title":"232","body":"","multi":0,"allDay":false,"extension_id":2},{"id":234,"start":1265029596000,"end":1265031396000,"title":"233","body":"","multi":0,"allDay":false,"extension_id":2},{"id":235,"start":1265032188000,"end":1265033988000,"title":"234","body":"","multi":0,"allDay":false,"extension_id":2},{"id":236,"start":1265034780000,"end":1265036580000,"title":"235","body":"","multi":0,"allDay":false,"extension_id":2},{"id":237,"start":1265037372000,"end":1265039172000,"title":"236","body":"","multi":0,"allDay":false,"extension_id":2},{"id":238,"start":1265039964000,"end":1265041764000,"title":"237","body":"","multi":0,"allDay":false,"extension_id":2},{"id":239,"start":1265042556000,"end":1265044356000,"title":"238","body":"","multi":0,"allDay":false,"extension_id":2},{"id":240,"start":1265045148000,"end":1265046948000,"title":"239","body":"","multi":0,"allDay":false,"extension_id":2},{"id":241,"start":1265047740000,"end":1265049540000,"title":"240","body":"","multi":0,"allDay":false,"extension_id":2},{"id":242,"start":1265050332000,"end":1265052132000,"title":"241","body":"","multi":0,"allDay":false,"extension_id":2},{"id":243,"start":1265052924000,"end":1265054724000,"title":"242","body":"","multi":0,"allDay":false,"extension_id":2},{"id":244,"start":1265055516000,"end":1265057316000,"title":"243","body":"","multi":0,"allDay":false,"extension_id":2},{"id":245,"start":1265058108000,"end":1265059908000,"title":"244","body":"","multi":0,"allDay":false,"extension_id":2},{"id":246,"start":1265060700000,"end":1265062500000,"title":"245","body":"","multi":0,"allDay":false,"extension_id":2},{"id":247,"start":1265063292000,"end":1265065092000,"title":"246","body":"","multi":0,"allDay":false,"extension_id":2},{"id":248,"start":1265065884000,"end":1265067684000,"title":"247","body":"","multi":0,"allDay":false,"extension_id":2},{"id":249,"start":1265068476000,"end":1265070276000,"title":"248","body":"","multi":0,"allDay":false,"extension_id":2},{"id":250,"start":1265071068000,"end":1265072868000,"title":"249","body":"","multi":0,"allDay":false,"extension_id":2},{"id":251,"start":1265073660000,"end":1265075460000,"title":"250","body":"","multi":0,"allDay":false,"extension_id":2},{"id":252,"start":1265076252000,"end":1265078052000,"title":"251","body":"","multi":0,"allDay":false,"extension_id":2},{"id":253,"start":1265078844000,"end":1265080644000,"title":"252","body":"","multi":0,"allDay":false,"extension_id":2},{"id":254,"start":1265081436000,"end":1265083236000,"title":"253","body":"","multi":0,"allDay":false,"extension_id":2},{"id":255,"start":1265084028000,"end":1265085828000,"title":"254","body":"","multi":0,"allDay":false,"extension_id":2},{"id":256,"start":1265086620000,"end":1265088420000,"title":"255","body":"","multi":0,"allDay":false,"extension_id":2},{"id":257,"start":1265089212000,"end":1265091012000,"title":"256","body":"","multi":0,"allDay":false,"extension_id":2},{"id":258,"start":1265091804000,"end":1265093604000,"title":"257","body":"","multi":0,"allDay":false,"extension_id":2},{"id":259,"start":1265094396000,"end":1265096196000,"title":"258","body":"","multi":0,"allDay":false,"extension_id":2},{"id":260,"start":1265096988000,"end":1265098788000,"title":"259","body":"","multi":0,"allDay":false,"extension_id":2},{"id":261,"start":1265099580000,"end":1265101380000,"title":"260","body":"","multi":0,"allDay":false,"extension_id":2},{"id":262,"start":1265102172000,"end":1265103972000,"title":"261","body":"","multi":0,"allDay":false,"extension_id":2},{"id":263,"start":1265104764000,"end":1265106564000,"title":"262","body":"","multi":0,"allDay":false,"extension_id":2},{"id":264,"start":1265107356000,"end":1265109156000,"title":"263","body":"","multi":0,"allDay":false,"extension_id":2},{"id":265,"start":1265109948000,"end":1265111748000,"title":"264","body":"","multi":0,"allDay":false,"extension_id":2},{"id":266,"start":1265112540000,"end":1265114340000,"title":"265","body":"","multi":0,"allDay":false,"extension_id":2},{"id":267,"start":1265115132000,"end":1265116932000,"title":"266","body":"","multi":0,"allDay":false,"extension_id":2},{"id":268,"start":1265117724000,"end":1265119524000,"title":"267","body":"","multi":0,"allDay":false,"extension_id":2},{"id":269,"start":1265120316000,"end":1265122116000,"title":"268","body":"","multi":0,"allDay":false,"extension_id":2},{"id":270,"start":1265122908000,"end":1265124708000,"title":"269","body":"","multi":0,"allDay":false,"extension_id":2},{"id":271,"start":1265125500000,"end":1265127300000,"title":"270","body":"","multi":0,"allDay":false,"extension_id":2},{"id":272,"start":1265128092000,"end":1265129892000,"title":"271","body":"","multi":0,"allDay":false,"extension_id":2},{"id":273,"start":1265130684000,"end":1265132484000,"title":"272","body":"","multi":0,"allDay":false,"extension_id":2},{"id":274,"start":1265133276000,"end":1265135076000,"title":"273","body":"","multi":0,"allDay":false,"extension_id":2},{"id":275,"start":1265135868000,"end":1265137668000,"title":"274","body":"","multi":0,"allDay":false,"extension_id":2},{"id":276,"start":1265138460000,"end":1265140260000,"title":"275","body":"","multi":0,"allDay":false,"extension_id":2},{"id":277,"start":1265141052000,"end":1265142852000,"title":"276","body":"","multi":0,"allDay":false,"extension_id":2},{"id":278,"start":1265143644000,"end":1265145444000,"title":"277","body":"","multi":0,"allDay":false,"extension_id":2},{"id":279,"start":1265146236000,"end":1265148036000,"title":"278","body":"","multi":0,"allDay":false,"extension_id":2},{"id":280,"start":1265148828000,"end":1265150628000,"title":"279","body":"","multi":0,"allDay":false,"extension_id":2},{"id":281,"start":1265151420000,"end":1265153220000,"title":"280","body":"","multi":0,"allDay":false,"extension_id":2},{"id":282,"start":1265154012000,"end":1265155812000,"title":"281","body":"","multi":0,"allDay":false,"extension_id":2},{"id":283,"start":1265156604000,"end":1265158404000,"title":"282","body":"","multi":0,"allDay":false,"extension_id":2},{"id":284,"start":1265159196000,"end":1265160996000,"title":"283","body":"","multi":0,"allDay":false,"extension_id":2},{"id":285,"start":1265161788000,"end":1265163588000,"title":"284","body":"","multi":0,"allDay":false,"extension_id":2},{"id":286,"start":1265164380000,"end":1265166180000,"title":"285","body":"","multi":0,"allDay":false,"extension_id":2},{"id":287,"start":1265166972000,"end":1265168772000,"title":"286","body":"","multi":0,"allDay":false,"extension_id":2},{"id":288,"start":1265169564000,"end":1265171364000,"title":"287","body":"","multi":0,"allDay":false,"extension_id":2},{"id":289,"start":1265172156000,"end":1265173956000,"title":"288","body":"","multi":0,"allDay":false,"extension_id":2},{"id":290,"start":1265174748000,"end":1265176548000,"title":"289","body":"","multi":0,"allDay":false,"extension_id":2},{"id":291,"start":1265177340000,"end":1265179140000,"title":"290","body":"","multi":0,"allDay":false,"extension_id":2},{"id":292,"start":1265179932000,"end":1265181732000,"title":"291","body":"","multi":0,"allDay":false,"extension_id":2},{"id":293,"start":1265182524000,"end":1265184324000,"title":"292","body":"","multi":0,"allDay":false,"extension_id":2},{"id":294,"start":1265185116000,"end":1265186916000,"title":"293","body":"","multi":0,"allDay":false,"extension_id":2},{"id":295,"start":1265187708000,"end":1265189508000,"title":"294","body":"","multi":0,"allDay":false,"extension_id":2},{"id":296,"start":1265190300000,"end":1265192100000,"title":"295","body":"","multi":0,"allDay":false,"extension_id":2},{"id":297,"start":1265192892000,"end":1265194692000,"title":"296","body":"","multi":0,"allDay":false,"extension_id":2},{"id":298,"start":1265195484000,"end":1265197284000,"title":"297","body":"","multi":0,"allDay":false,"extension_id":2},{"id":299,"start":1265198076000,"end":1265199876000,"title":"298","body":"","multi":0,"allDay":false,"extension_id":2},{"id":300,"start":1265200668000,"end":1265202468000,"title":"299","body":"","multi":0,"allDay":false,"extension_id":2},{"id":301,"start":1265203260000,"end":1265205060000,"title":"300","body":"","multi":0,"allDay":false,"extension_id":2},{"id":302,"start":1265205852000,"end":1265207652000,"title":"301","body":"","multi":0,"allDay":false,"extension_id":2},{"id":303,"start":1265208444000,"end":1265210244000,"title":"302","body":"","multi":0,"allDay":false,"extension_id":2},{"id":304,"start":1265211036000,"end":1265212836000,"title":"303","body":"","multi":0,"allDay":false,"extension_id":2},{"id":305,"start":1265213628000,"end":1265215428000,"title":"304","body":"","multi":0,"allDay":false,"extension_id":2},{"id":306,"start":1265216220000,"end":1265218020000,"title":"305","body":"","multi":0,"allDay":false,"extension_id":2},{"id":307,"start":1265218812000,"end":1265220612000,"title":"306","body":"","multi":0,"allDay":false,"extension_id":2},{"id":308,"start":1265221404000,"end":1265223204000,"title":"307","body":"","multi":0,"allDay":false,"extension_id":2},{"id":309,"start":1265223996000,"end":1265225796000,"title":"308","body":"","multi":0,"allDay":false,"extension_id":2},{"id":310,"start":1265226588000,"end":1265228388000,"title":"309","body":"","multi":0,"allDay":false,"extension_id":2},{"id":311,"start":1265229180000,"end":1265230980000,"title":"310","body":"","multi":0,"allDay":false,"extension_id":2},{"id":312,"start":1265231772000,"end":1265233572000,"title":"311","body":"","multi":0,"allDay":false,"extension_id":2},{"id":313,"start":1265234364000,"end":1265236164000,"title":"312","body":"","multi":0,"allDay":false,"extension_id":2},{"id":314,"start":1265236956000,"end":1265238756000,"title":"313","body":"","multi":0,"allDay":false,"extension_id":2},{"id":315,"start":1265239548000,"end":1265241348000,"title":"314","body":"","multi":0,"allDay":false,"extension_id":2},{"id":316,"start":1265242140000,"end":1265243940000,"title":"315","body":"","multi":0,"allDay":false,"extension_id":2},{"id":317,"start":1265244732000,"end":1265246532000,"title":"316","body":"","multi":0,"allDay":false,"extension_id":2},{"id":318,"start":1265247324000,"end":1265249124000,"title":"317","body":"","multi":0,"allDay":false,"extension_id":2},{"id":319,"start":1265249916000,"end":1265251716000,"title":"318","body":"","multi":0,"allDay":false,"extension_id":2},{"id":320,"start":1265252508000,"end":1265254308000,"title":"319","body":"","multi":0,"allDay":false,"extension_id":2},{"id":321,"start":1265255100000,"end":1265256900000,"title":"320","body":"","multi":0,"allDay":false,"extension_id":2},{"id":322,"start":1265257692000,"end":1265259492000,"title":"321","body":"","multi":0,"allDay":false,"extension_id":2},{"id":323,"start":1265260284000,"end":1265262084000,"title":"322","body":"","multi":0,"allDay":false,"extension_id":2},{"id":324,"start":1265262876000,"end":1265264676000,"title":"323","body":"","multi":0,"allDay":false,"extension_id":2},{"id":325,"start":1265265468000,"end":1265267268000,"title":"324","body":"","multi":0,"allDay":false,"extension_id":2},{"id":326,"start":1265268060000,"end":1265269860000,"title":"325","body":"","multi":0,"allDay":false,"extension_id":2},{"id":327,"start":1265270652000,"end":1265272452000,"title":"326","body":"","multi":0,"allDay":false,"extension_id":2},{"id":328,"start":1265273244000,"end":1265275044000,"title":"327","body":"","multi":0,"allDay":false,"extension_id":2},{"id":329,"start":1265275836000,"end":1265277636000,"title":"328","body":"","multi":0,"allDay":false,"extension_id":2},{"id":330,"start":1265278428000,"end":1265280228000,"title":"329","body":"","multi":0,"allDay":false,"extension_id":2},{"id":331,"start":1265281020000,"end":1265282820000,"title":"330","body":"","multi":0,"allDay":false,"extension_id":2},{"id":332,"start":1265283612000,"end":1265285412000,"title":"331","body":"","multi":0,"allDay":false,"extension_id":2},{"id":333,"start":1265286204000,"end":1265288004000,"title":"332","body":"","multi":0,"allDay":false,"extension_id":2},{"id":334,"start":1265288796000,"end":1265290596000,"title":"333","body":"","multi":0,"allDay":false,"extension_id":2},{"id":335,"start":1265291388000,"end":1265293188000,"title":"334","body":"","multi":0,"allDay":false,"extension_id":2},{"id":336,"start":1265293980000,"end":1265295780000,"title":"335","body":"","multi":0,"allDay":false,"extension_id":2},{"id":337,"start":1265296572000,"end":1265298372000,"title":"336","body":"","multi":0,"allDay":false,"extension_id":2},{"id":338,"start":1265299164000,"end":1265300964000,"title":"337","body":"","multi":0,"allDay":false,"extension_id":2},{"id":339,"start":1265301756000,"end":1265303556000,"title":"338","body":"","multi":0,"allDay":false,"extension_id":2},{"id":340,"start":1265304348000,"end":1265306148000,"title":"339","body":"","multi":0,"allDay":false,"extension_id":2},{"id":341,"start":1265306940000,"end":1265308740000,"title":"340","body":"","multi":0,"allDay":false,"extension_id":2},{"id":342,"start":1265309532000,"end":1265311332000,"title":"341","body":"","multi":0,"allDay":false,"extension_id":2},{"id":343,"start":1265312124000,"end":1265313924000,"title":"342","body":"","multi":0,"allDay":false,"extension_id":2},{"id":344,"start":1265314716000,"end":1265316516000,"title":"343","body":"","multi":0,"allDay":false,"extension_id":2},{"id":345,"start":1265317308000,"end":1265319108000,"title":"344","body":"","multi":0,"allDay":false,"extension_id":2},{"id":346,"start":1265319900000,"end":1265321700000,"title":"345","body":"","multi":0,"allDay":false,"extension_id":2},{"id":347,"start":1265322492000,"end":1265324292000,"title":"346","body":"","multi":0,"allDay":false,"extension_id":2},{"id":348,"start":1265325084000,"end":1265326884000,"title":"347","body":"","multi":0,"allDay":false,"extension_id":2},{"id":349,"start":1265327676000,"end":1265329476000,"title":"348","body":"","multi":0,"allDay":false,"extension_id":2},{"id":350,"start":1265330268000,"end":1265332068000,"title":"349","body":"","multi":0,"allDay":false,"extension_id":2},{"id":351,"start":1265332860000,"end":1265334660000,"title":"350","body":"","multi":0,"allDay":false,"extension_id":2},{"id":352,"start":1265335452000,"end":1265337252000,"title":"351","body":"","multi":0,"allDay":false,"extension_id":2},{"id":353,"start":1265338044000,"end":1265339844000,"title":"352","body":"","multi":0,"allDay":false,"extension_id":2},{"id":354,"start":1265340636000,"end":1265342436000,"title":"353","body":"","multi":0,"allDay":false,"extension_id":2},{"id":355,"start":1265343228000,"end":1265345028000,"title":"354","body":"","multi":0,"allDay":false,"extension_id":2},{"id":356,"start":1265345820000,"end":1265347620000,"title":"355","body":"","multi":0,"allDay":false,"extension_id":2},{"id":357,"start":1265348412000,"end":1265350212000,"title":"356","body":"","multi":0,"allDay":false,"extension_id":2},{"id":358,"start":1265351004000,"end":1265352804000,"title":"357","body":"","multi":0,"allDay":false,"extension_id":2},{"id":359,"start":1265353596000,"end":1265355396000,"title":"358","body":"","multi":0,"allDay":false,"extension_id":2},{"id":360,"start":1265356188000,"end":1265357988000,"title":"359","body":"","multi":0,"allDay":false,"extension_id":2},{"id":361,"start":1265358780000,"end":1265360580000,"title":"360","body":"","multi":0,"allDay":false,"extension_id":2},{"id":362,"start":1265361372000,"end":1265363172000,"title":"361","body":"","multi":0,"allDay":false,"extension_id":2},{"id":363,"start":1265363964000,"end":1265365764000,"title":"362","body":"","multi":0,"allDay":false,"extension_id":2},{"id":364,"start":1265366556000,"end":1265368356000,"title":"363","body":"","multi":0,"allDay":false,"extension_id":2},{"id":365,"start":1265369148000,"end":1265370948000,"title":"364","body":"","multi":0,"allDay":false,"extension_id":2},{"id":366,"start":1265371740000,"end":1265373540000,"title":"365","body":"","multi":0,"allDay":false,"extension_id":2},{"id":367,"start":1265374332000,"end":1265376132000,"title":"366","body":"","multi":0,"allDay":false,"extension_id":2},{"id":368,"start":1265376924000,"end":1265378724000,"title":"367","body":"","multi":0,"allDay":false,"extension_id":2},{"id":369,"start":1265379516000,"end":1265381316000,"title":"368","body":"","multi":0,"allDay":false,"extension_id":2},{"id":370,"start":1265382108000,"end":1265383908000,"title":"369","body":"","multi":0,"allDay":false,"extension_id":2},{"id":371,"start":1265384700000,"end":1265386500000,"title":"370","body":"","multi":0,"allDay":false,"extension_id":2},{"id":372,"start":1265387292000,"end":1265389092000,"title":"371","body":"","multi":0,"allDay":false,"extension_id":2},{"id":373,"start":1265389884000,"end":1265391684000,"title":"372","body":"","multi":0,"allDay":false,"extension_id":2},{"id":374,"start":1265392476000,"end":1265394276000,"title":"373","body":"","multi":0,"allDay":false,"extension_id":2},{"id":375,"start":1265395068000,"end":1265396868000,"title":"374","body":"","multi":0,"allDay":false,"extension_id":2},{"id":376,"start":1265397660000,"end":1265399460000,"title":"375","body":"","multi":0,"allDay":false,"extension_id":2},{"id":377,"start":1265400252000,"end":1265402052000,"title":"376","body":"","multi":0,"allDay":false,"extension_id":2},{"id":378,"start":1265402844000,"end":1265404644000,"title":"377","body":"","multi":0,"allDay":false,"extension_id":2},{"id":379,"start":1265405436000,"end":1265407236000,"title":"378","body":"","multi":0,"allDay":false,"extension_id":2},{"id":380,"start":1265408028000,"end":1265409828000,"title":"379","body":"","multi":0,"allDay":false,"extension_id":2},{"id":381,"start":1265410620000,"end":1265412420000,"title":"380","body":"","multi":0,"allDay":false,"extension_id":2},{"id":382,"start":1265413212000,"end":1265415012000,"title":"381","body":"","multi":0,"allDay":false,"extension_id":2},{"id":383,"start":1265415804000,"end":1265417604000,"title":"382","body":"","multi":0,"allDay":false,"extension_id":2},{"id":384,"start":1265418396000,"end":1265420196000,"title":"383","body":"","multi":0,"allDay":false,"extension_id":2},{"id":385,"start":1265420988000,"end":1265422788000,"title":"384","body":"","multi":0,"allDay":false,"extension_id":2},{"id":386,"start":1265423580000,"end":1265425380000,"title":"385","body":"","multi":0,"allDay":false,"extension_id":2},{"id":387,"start":1265426172000,"end":1265427972000,"title":"386","body":"","multi":0,"allDay":false,"extension_id":2},{"id":388,"start":1265428764000,"end":1265430564000,"title":"387","body":"","multi":0,"allDay":false,"extension_id":2},{"id":389,"start":1265431356000,"end":1265433156000,"title":"388","body":"","multi":0,"allDay":false,"extension_id":2},{"id":390,"start":1265433948000,"end":1265435748000,"title":"389","body":"","multi":0,"allDay":false,"extension_id":2},{"id":391,"start":1265436540000,"end":1265438340000,"title":"390","body":"","multi":0,"allDay":false,"extension_id":2},{"id":392,"start":1265439132000,"end":1265440932000,"title":"391","body":"","multi":0,"allDay":false,"extension_id":2},{"id":393,"start":1265441724000,"end":1265443524000,"title":"392","body":"","multi":0,"allDay":false,"extension_id":2},{"id":394,"start":1265444316000,"end":1265446116000,"title":"393","body":"","multi":0,"allDay":false,"extension_id":2},{"id":395,"start":1265446908000,"end":1265448708000,"title":"394","body":"","multi":0,"allDay":false,"extension_id":2},{"id":396,"start":1265449500000,"end":1265451300000,"title":"395","body":"","multi":0,"allDay":false,"extension_id":2},{"id":397,"start":1265452092000,"end":1265453892000,"title":"396","body":"","multi":0,"allDay":false,"extension_id":2},{"id":398,"start":1265454684000,"end":1265456484000,"title":"397","body":"","multi":0,"allDay":false,"extension_id":2},{"id":399,"start":1265457276000,"end":1265459076000,"title":"398","body":"","multi":0,"allDay":false,"extension_id":2},{"id":400,"start":1265459868000,"end":1265461668000,"title":"399","body":"","multi":0,"allDay":false,"extension_id":2},{"id":401,"start":1265462460000,"end":1265464260000,"title":"400","body":"","multi":0,"allDay":false,"extension_id":2},{"id":402,"start":1265465052000,"end":1265466852000,"title":"401","body":"","multi":0,"allDay":false,"extension_id":2},{"id":403,"start":1265467644000,"end":1265469444000,"title":"402","body":"","multi":0,"allDay":false,"extension_id":2},{"id":404,"start":1265470236000,"end":1265472036000,"title":"403","body":"","multi":0,"allDay":false,"extension_id":2},{"id":405,"start":1265472828000,"end":1265474628000,"title":"404","body":"","multi":0,"allDay":false,"extension_id":2},{"id":406,"start":1265475420000,"end":1265477220000,"title":"405","body":"","multi":0,"allDay":false,"extension_id":2},{"id":407,"start":1265478012000,"end":1265479812000,"title":"406","body":"","multi":0,"allDay":false,"extension_id":2},{"id":408,"start":1265480604000,"end":1265482404000,"title":"407","body":"","multi":0,"allDay":false,"extension_id":2},{"id":409,"start":1265483196000,"end":1265484996000,"title":"408","body":"","multi":0,"allDay":false,"extension_id":2},{"id":410,"start":1265485788000,"end":1265487588000,"title":"409","body":"","multi":0,"allDay":false,"extension_id":2},{"id":411,"start":1265488380000,"end":1265490180000,"title":"410","body":"","multi":0,"allDay":false,"extension_id":2},{"id":412,"start":1265490972000,"end":1265492772000,"title":"411","body":"","multi":0,"allDay":false,"extension_id":2},{"id":413,"start":1265493564000,"end":1265495364000,"title":"412","body":"","multi":0,"allDay":false,"extension_id":2},{"id":414,"start":1265496156000,"end":1265497956000,"title":"413","body":"","multi":0,"allDay":false,"extension_id":2}] diff --git a/fullcalendar-main/tests/manual/old/many_timegrid_events.html b/fullcalendar-main/tests/manual/old/many_timegrid_events.html deleted file mode 100644 index 6a78a86..0000000 --- a/fullcalendar-main/tests/manual/old/many_timegrid_events.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/many_timegrid_events_json.txt b/fullcalendar-main/tests/manual/old/many_timegrid_events_json.txt deleted file mode 100644 index f8deefe..0000000 --- a/fullcalendar-main/tests/manual/old/many_timegrid_events_json.txt +++ /dev/null @@ -1 +0,0 @@ -[{"title": "event", "start": "2009-12-13"}, {"title": "event", "start": "2009-12-13"}, {"title": "event", "start": "2009-12-13"}, {"title": "event", "start": "2009-12-13"}, {"title": "event", "start": "2009-12-13"}, {"title": "event", "start": "2009-12-13"}, {"title": "event", "start": "2009-12-13"}, {"title": "event", "start": "2009-12-13"}, {"title": "event", "start": "2009-12-13"}, {"title": "event", "start": "2009-12-13"}, {"title": "event", "start": "2009-12-13"}, {"title": "event", "start": "2009-12-13"}, {"title": "event", "start": "2009-12-13"}, {"title": "event", "start": "2009-12-13 00:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 01:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 02:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 03:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 04:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 05:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 06:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 07:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 08:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 09:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 10:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 11:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 12:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 13:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 14:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 15:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 16:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 17:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 18:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 19:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 20:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 21:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 22:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 23:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 00:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 01:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 02:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 03:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 04:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 05:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 06:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 07:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 08:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 09:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 10:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 11:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 12:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 13:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 14:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 15:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 16:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 17:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 18:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 19:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 20:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 21:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 22:00:00", "allDay": false}, {"title": "event", "start": "2009-12-13 23:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14"}, {"title": "event", "start": "2009-12-14"}, {"title": "event", "start": "2009-12-14"}, {"title": "event", "start": "2009-12-14"}, {"title": "event", "start": "2009-12-14"}, {"title": "event", "start": "2009-12-14"}, {"title": "event", "start": "2009-12-14"}, {"title": "event", "start": "2009-12-14"}, {"title": "event", "start": "2009-12-14"}, {"title": "event", "start": "2009-12-14"}, {"title": "event", "start": "2009-12-14"}, {"title": "event", "start": "2009-12-14"}, {"title": "event", "start": "2009-12-14"}, {"title": "event", "start": "2009-12-14 00:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 01:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 02:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 03:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 04:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 05:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 06:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 07:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 08:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 09:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 10:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 11:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 12:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 13:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 14:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 15:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 16:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 17:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 18:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 19:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 20:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 21:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 22:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 23:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 00:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 01:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 02:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 03:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 04:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 05:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 06:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 07:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 08:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 09:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 10:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 11:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 12:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 13:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 14:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 15:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 16:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 17:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 18:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 19:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 20:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 21:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 22:00:00", "allDay": false}, {"title": "event", "start": "2009-12-14 23:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15"}, {"title": "event", "start": "2009-12-15"}, {"title": "event", "start": "2009-12-15"}, {"title": "event", "start": "2009-12-15"}, {"title": "event", "start": "2009-12-15"}, {"title": "event", "start": "2009-12-15"}, {"title": "event", "start": "2009-12-15"}, {"title": "event", "start": "2009-12-15"}, {"title": "event", "start": "2009-12-15"}, {"title": "event", "start": "2009-12-15"}, {"title": "event", "start": "2009-12-15"}, {"title": "event", "start": "2009-12-15"}, {"title": "event", "start": "2009-12-15"}, {"title": "event", "start": "2009-12-15 00:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 01:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 02:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 03:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 04:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 05:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 06:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 07:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 08:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 09:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 10:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 11:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 12:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 13:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 14:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 15:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 16:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 17:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 18:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 19:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 20:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 21:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 22:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 23:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 00:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 01:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 02:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 03:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 04:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 05:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 06:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 07:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 08:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 09:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 10:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 11:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 12:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 13:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 14:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 15:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 16:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 17:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 18:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 19:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 20:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 21:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 22:00:00", "allDay": false}, {"title": "event", "start": "2009-12-15 23:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16"}, {"title": "event", "start": "2009-12-16"}, {"title": "event", "start": "2009-12-16"}, {"title": "event", "start": "2009-12-16"}, {"title": "event", "start": "2009-12-16"}, {"title": "event", "start": "2009-12-16"}, {"title": "event", "start": "2009-12-16"}, {"title": "event", "start": "2009-12-16"}, {"title": "event", "start": "2009-12-16"}, {"title": "event", "start": "2009-12-16"}, {"title": "event", "start": "2009-12-16"}, {"title": "event", "start": "2009-12-16"}, {"title": "event", "start": "2009-12-16"}, {"title": "event", "start": "2009-12-16 00:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 01:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 02:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 03:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 04:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 05:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 06:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 07:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 08:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 09:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 10:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 11:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 12:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 13:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 14:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 15:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 16:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 17:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 18:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 19:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 20:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 21:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 22:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 23:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 00:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 01:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 02:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 03:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 04:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 05:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 06:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 07:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 08:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 09:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 10:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 11:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 12:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 13:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 14:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 15:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 16:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 17:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 18:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 19:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 20:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 21:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 22:00:00", "allDay": false}, {"title": "event", "start": "2009-12-16 23:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17"}, {"title": "event", "start": "2009-12-17"}, {"title": "event", "start": "2009-12-17"}, {"title": "event", "start": "2009-12-17"}, {"title": "event", "start": "2009-12-17"}, {"title": "event", "start": "2009-12-17"}, {"title": "event", "start": "2009-12-17"}, {"title": "event", "start": "2009-12-17"}, {"title": "event", "start": "2009-12-17"}, {"title": "event", "start": "2009-12-17"}, {"title": "event", "start": "2009-12-17"}, {"title": "event", "start": "2009-12-17"}, {"title": "event", "start": "2009-12-17"}, {"title": "event", "start": "2009-12-17 00:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 01:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 02:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 03:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 04:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 05:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 06:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 07:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 08:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 09:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 10:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 11:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 12:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 13:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 14:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 15:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 16:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 17:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 18:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 19:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 20:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 21:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 22:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 23:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 00:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 01:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 02:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 03:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 04:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 05:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 06:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 07:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 08:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 09:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 10:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 11:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 12:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 13:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 14:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 15:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 16:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 17:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 18:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 19:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 20:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 21:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 22:00:00", "allDay": false}, {"title": "event", "start": "2009-12-17 23:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18"}, {"title": "event", "start": "2009-12-18"}, {"title": "event", "start": "2009-12-18"}, {"title": "event", "start": "2009-12-18"}, {"title": "event", "start": "2009-12-18"}, {"title": "event", "start": "2009-12-18"}, {"title": "event", "start": "2009-12-18"}, {"title": "event", "start": "2009-12-18"}, {"title": "event", "start": "2009-12-18"}, {"title": "event", "start": "2009-12-18"}, {"title": "event", "start": "2009-12-18"}, {"title": "event", "start": "2009-12-18"}, {"title": "event", "start": "2009-12-18"}, {"title": "event", "start": "2009-12-18 00:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 01:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 02:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 03:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 04:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 05:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 06:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 07:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 08:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 09:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 10:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 11:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 12:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 13:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 14:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 15:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 16:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 17:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 18:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 19:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 20:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 21:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 22:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 23:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 00:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 01:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 02:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 03:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 04:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 05:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 06:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 07:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 08:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 09:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 10:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 11:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 12:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 13:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 14:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 15:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 16:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 17:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 18:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 19:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 20:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 21:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 22:00:00", "allDay": false}, {"title": "event", "start": "2009-12-18 23:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19"}, {"title": "event", "start": "2009-12-19"}, {"title": "event", "start": "2009-12-19"}, {"title": "event", "start": "2009-12-19"}, {"title": "event", "start": "2009-12-19"}, {"title": "event", "start": "2009-12-19"}, {"title": "event", "start": "2009-12-19"}, {"title": "event", "start": "2009-12-19"}, {"title": "event", "start": "2009-12-19"}, {"title": "event", "start": "2009-12-19"}, {"title": "event", "start": "2009-12-19"}, {"title": "event", "start": "2009-12-19"}, {"title": "event", "start": "2009-12-19"}, {"title": "event", "start": "2009-12-19 00:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 01:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 02:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 03:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 04:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 05:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 06:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 07:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 08:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 09:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 10:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 11:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 12:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 13:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 14:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 15:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 16:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 17:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 18:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 19:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 20:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 21:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 22:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 23:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 00:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 01:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 02:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 03:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 04:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 05:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 06:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 07:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 08:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 09:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 10:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 11:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 12:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 13:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 14:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 15:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 16:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 17:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 18:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 19:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 20:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 21:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 22:00:00", "allDay": false}, {"title": "event", "start": "2009-12-19 23:00:00", "allDay": false}] diff --git a/fullcalendar-main/tests/manual/old/memory_leak.html b/fullcalendar-main/tests/manual/old/memory_leak.html deleted file mode 100644 index 1c5430c..0000000 --- a/fullcalendar-main/tests/manual/old/memory_leak.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - -
- - - diff --git a/fullcalendar-main/tests/manual/old/method_destroy.html b/fullcalendar-main/tests/manual/old/method_destroy.html deleted file mode 100644 index 5bd6130..0000000 --- a/fullcalendar-main/tests/manual/old/method_destroy.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - -
some text in here
- - diff --git a/fullcalendar-main/tests/manual/old/methods.html b/fullcalendar-main/tests/manual/old/methods.html deleted file mode 100644 index e14744b..0000000 --- a/fullcalendar-main/tests/manual/old/methods.html +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - - - - - - - - -

- - - - - - - - - - - - - -
- - - - - - - -
- - - - - - - - - - -
- - - - - - - - - - - -

- -
- - diff --git a/fullcalendar-main/tests/manual/old/nav-links.html b/fullcalendar-main/tests/manual/old/nav-links.html deleted file mode 100644 index b657e39..0000000 --- a/fullcalendar-main/tests/manual/old/nav-links.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/no_event_titles.html b/fullcalendar-main/tests/manual/old/no_event_titles.html deleted file mode 100644 index 5f7c683..0000000 --- a/fullcalendar-main/tests/manual/old/no_event_titles.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/options.html b/fullcalendar-main/tests/manual/old/options.html deleted file mode 100644 index 022dea3..0000000 --- a/fullcalendar-main/tests/manual/old/options.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/past_future_classNames.html b/fullcalendar-main/tests/manual/old/past_future_classNames.html deleted file mode 100644 index 9f0ee97..0000000 --- a/fullcalendar-main/tests/manual/old/past_future_classNames.html +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/plain.html b/fullcalendar-main/tests/manual/old/plain.html deleted file mode 100644 index 02075be..0000000 --- a/fullcalendar-main/tests/manual/old/plain.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - - -
- - - diff --git a/fullcalendar-main/tests/manual/old/profiling.html b/fullcalendar-main/tests/manual/old/profiling.html deleted file mode 100644 index 4a8ed8a..0000000 --- a/fullcalendar-main/tests/manual/old/profiling.html +++ /dev/null @@ -1,242 +0,0 @@ - - - - - - - - - - - - - - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- -
- -
- - - diff --git a/fullcalendar-main/tests/manual/old/profiling_results.txt b/fullcalendar-main/tests/manual/old/profiling_results.txt deleted file mode 100644 index f3817ed..0000000 --- a/fullcalendar-main/tests/manual/old/profiling_results.txt +++ /dev/null @@ -1,30 +0,0 @@ - -# v3.5.0 - -## Chrome - -27.71ms ave init calendar (4% improvement) -102.29ms ave render events for month (22% improvement) -112.77ms ave render events for timegrid (29% improvement) - -## IE11 - -72.79ms ave init calendar (10% improvement) -418.35ms ave render events for month (10% improvement) -393.8ms ave render events for timegrid (28% improvement) - - - -# v3.4.0 - -## Chrome - -28.9ms ave init calendar -131.7ms ave render events for month -157.91ms ave render events for timegrid - -## IE11 - -80.49ms ave init calendar -464.73ms ave render events for month -550.13ms ave render events for timegrid diff --git a/fullcalendar-main/tests/manual/old/selectable.html b/fullcalendar-main/tests/manual/old/selectable.html deleted file mode 100644 index 56c9c9f..0000000 --- a/fullcalendar-main/tests/manual/old/selectable.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/short_timegrid.html b/fullcalendar-main/tests/manual/old/short_timegrid.html deleted file mode 100644 index 28745f8..0000000 --- a/fullcalendar-main/tests/manual/old/short_timegrid.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/skip-redraw-test.html b/fullcalendar-main/tests/manual/old/skip-redraw-test.html deleted file mode 100644 index 2752045..0000000 --- a/fullcalendar-main/tests/manual/old/skip-redraw-test.html +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - - - - - - - -

gotoDate test page

-

- This page is to test refactoring of gotoDate to check whether or not to call render() based on view.visStart and view.visEnd. -

-
- - diff --git a/fullcalendar-main/tests/manual/old/slotEventOverlap-demo.html b/fullcalendar-main/tests/manual/old/slotEventOverlap-demo.html deleted file mode 100644 index 4042c88..0000000 --- a/fullcalendar-main/tests/manual/old/slotEventOverlap-demo.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/slot_event_overlap.html b/fullcalendar-main/tests/manual/old/slot_event_overlap.html deleted file mode 100644 index 57cfd74..0000000 --- a/fullcalendar-main/tests/manual/old/slot_event_overlap.html +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - - - - - - - - -

Default:

-
- -

No overlap:

-
- -

RTL:

-
- -

RTL, no overlap:

-
- - - diff --git a/fullcalendar-main/tests/manual/old/slot_event_overlap.json b/fullcalendar-main/tests/manual/old/slot_event_overlap.json deleted file mode 100644 index af99810..0000000 --- a/fullcalendar-main/tests/manual/old/slot_event_overlap.json +++ /dev/null @@ -1,102 +0,0 @@ -[ - { - "title": "1", - "start": "2013-07-31T00:30", - "end": "2013-07-31T02:30", - "allDay": false - }, - { - "title": "2", - "start": "2013-07-31T00:30", - "end": "2013-07-31T02:30", - "allDay": false - }, - { - "title": "3", - "start": "2013-07-31T02:30", - "end": "2013-07-31T04:30", - "allDay": false - }, - { - "title": "4", - "start": "2013-07-31T02:30", - "end": "2013-07-31T04:30", - "allDay": false - }, - { - "title": "5", - "start": "2013-07-31T02:30", - "end": "2013-07-31T04:30", - "allDay": false - }, - { - "title": "6", - "start": "2013-07-31T01:00", - "end": "2013-07-31T03:00", - "allDay": false - }, - { - "title": "7", - "start": "2013-07-31T01:30", - "end": "2013-07-31T03:30", - "allDay": false - }, - { - "title": "8", - "start": "2013-07-31T02:50", - "end": "2013-07-31T04:50", - "allDay": false - }, - { - "title": "9", - "start": "2013-07-31T04:30", - "end": "2013-07-31T09:00", - "allDay": false - }, - { - "title": "10", - "start": "2013-07-31T02:00", - "end": "2013-07-31T04:05", - "allDay": false - }, - { - "title": "11", - "start": "2013-07-31T02:50", - "end": "2013-07-31T04:50", - "allDay": false - }, - { - "title": "12", - "start": "2013-07-31T02:50", - "end": "2013-07-31T04:50", - "allDay": false - }, - { - "title": "13", - "start": "2013-07-31T04:00", - "end": "2013-07-31T06:00", - "allDay": false, - "className": "equalwidth1" - }, - { - "title": "14", - "start": "2013-07-31T04:10", - "end": "2013-07-31T06:09", - "allDay": false, - "className": "equalwidth1" - }, - { - "title": "15", - "start": "2013-07-31T06:30", - "end": "2013-07-31T08:30", - "allDay": false, - "className": "equalwidth2" - }, - { - "title": "16", - "start": "2013-07-31T06:30", - "end": "2013-07-31T08:30", - "allDay": false, - "className": "equalwidth2" - } -] \ No newline at end of file diff --git a/fullcalendar-main/tests/manual/old/snap.html b/fullcalendar-main/tests/manual/old/snap.html deleted file mode 100644 index 01194ba..0000000 --- a/fullcalendar-main/tests/manual/old/snap.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/sources.html b/fullcalendar-main/tests/manual/old/sources.html deleted file mode 100644 index 9b81f0b..0000000 --- a/fullcalendar-main/tests/manual/old/sources.html +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - - - -

- -

-
- - diff --git a/fullcalendar-main/tests/manual/old/sources_new.html b/fullcalendar-main/tests/manual/old/sources_new.html deleted file mode 100644 index 2a3fba7..0000000 --- a/fullcalendar-main/tests/manual/old/sources_new.html +++ /dev/null @@ -1,191 +0,0 @@ - - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/stacking.html b/fullcalendar-main/tests/manual/old/stacking.html deleted file mode 100644 index 2162429..0000000 --- a/fullcalendar-main/tests/manual/old/stacking.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/touch-firing.html b/fullcalendar-main/tests/manual/old/touch-firing.html deleted file mode 100644 index ea22ca5..0000000 --- a/fullcalendar-main/tests/manual/old/touch-firing.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - -
-
- test -
-
- - this is a link - - - diff --git a/fullcalendar-main/tests/manual/old/touch.html b/fullcalendar-main/tests/manual/old/touch.html deleted file mode 100644 index 0f9e687..0000000 --- a/fullcalendar-main/tests/manual/old/touch.html +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/triggers.html b/fullcalendar-main/tests/manual/old/triggers.html deleted file mode 100644 index cd69247..0000000 --- a/fullcalendar-main/tests/manual/old/triggers.html +++ /dev/null @@ -1,221 +0,0 @@ - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/triggers_view.html b/fullcalendar-main/tests/manual/old/triggers_view.html deleted file mode 100644 index 6d4b52d..0000000 --- a/fullcalendar-main/tests/manual/old/triggers_view.html +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/week_numbers.html b/fullcalendar-main/tests/manual/old/week_numbers.html deleted file mode 100644 index c30ce35..0000000 --- a/fullcalendar-main/tests/manual/old/week_numbers.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - - - -
- - diff --git a/fullcalendar-main/tests/manual/old/window-resize-dynamic-aspectRatio.html b/fullcalendar-main/tests/manual/old/window-resize-dynamic-aspectRatio.html deleted file mode 100644 index 08e854d..0000000 --- a/fullcalendar-main/tests/manual/old/window-resize-dynamic-aspectRatio.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - -
- - - diff --git a/fullcalendar-main/tests/manual/php/get-events.php b/fullcalendar-main/tests/manual/php/get-events.php deleted file mode 100644 index e4d7654..0000000 --- a/fullcalendar-main/tests/manual/php/get-events.php +++ /dev/null @@ -1,50 +0,0 @@ -isWithinDayRange($range_start, $range_end)) { - $output_arrays[] = $event->toArray(); - } -} - -// Send JSON to the client. -echo json_encode($output_arrays); diff --git a/fullcalendar-main/tests/manual/php/get-time-zones.php b/fullcalendar-main/tests/manual/php/get-time-zones.php deleted file mode 100644 index 241e1bd..0000000 --- a/fullcalendar-main/tests/manual/php/get-time-zones.php +++ /dev/null @@ -1,9 +0,0 @@ -values. - // You can optionally force the timeZone of the parsed dates. - public function __construct($array, $timeZone=null) { - - $this->title = $array['title']; - - if (isset($array['allDay'])) { - // allDay has been explicitly specified - $this->allDay = (bool)$array['allDay']; - } - else { - // Guess allDay based off of ISO8601 date strings - $this->allDay = preg_match(self::ALL_DAY_REGEX, $array['start']) && - (!isset($array['end']) || preg_match(self::ALL_DAY_REGEX, $array['end'])); - } - - if ($this->allDay) { - // If dates are allDay, we want to parse them in UTC to avoid DST issues. - $timeZone = null; - } - - // Parse dates - $this->start = parseDateTime($array['start'], $timeZone); - $this->end = isset($array['end']) ? parseDateTime($array['end'], $timeZone) : null; - - // Record misc properties - foreach ($array as $name => $value) { - if (!in_array($name, array('title', 'allDay', 'start', 'end'))) { - $this->properties[$name] = $value; - } - } - } - - - // Returns whether the date range of our event intersects with the given all-day range. - // $rangeStart and $rangeEnd are assumed to be dates in UTC with 00:00:00 time. - public function isWithinDayRange($rangeStart, $rangeEnd) { - - // Normalize our event's dates for comparison with the all-day range. - $eventStart = stripTime($this->start); - - if (isset($this->end)) { - $eventEnd = stripTime($this->end); // normalize - } - else { - $eventEnd = $eventStart; // consider this a zero-duration event - } - - // Check if the two whole-day ranges intersect. - return $eventStart < $rangeEnd && $eventEnd >= $rangeStart; - } - - - // Converts this Event object back to a plain data array, to be used for generating JSON - public function toArray() { - - // Start with the misc properties (don't worry, PHP won't affect the original array) - $array = $this->properties; - - $array['title'] = $this->title; - - // Figure out the date format. This essentially encodes allDay into the date string. - if ($this->allDay) { - $format = 'Y-m-d'; // output like "2013-12-29" - } - else { - $format = 'c'; // full ISO8601 output, like "2013-12-29T09:00:00+08:00" - } - - // Serialize dates into strings - $array['start'] = $this->start->format($format); - if (isset($this->end)) { - $array['end'] = $this->end->format($format); - } - - return $array; - } - -} - - -// Date Utilities -//---------------------------------------------------------------------------------------------- - - -// Parses a string into a DateTime object, optionally forced into the given timeZone. -function parseDateTime($string, $timeZone=null) { - $date = new DateTime( - $string, - $timeZone ? $timeZone : new DateTimeZone('UTC') - // Used only when the string is ambiguous. - // Ignored if string has a timeZone offset in it. - ); - if ($timeZone) { - // If our timeZone was ignored above, force it. - $date->setTimezone($timeZone); - } - return $date; -} - - -// Takes the year/month/date values of the given DateTime and converts them to a new DateTime, -// but in UTC. -function stripTime($datetime) { - return new DateTime($datetime->format('Y-m-d')); -} diff --git a/fullcalendar-main/tests/manual/rrule.html b/fullcalendar-main/tests/manual/rrule.html deleted file mode 100644 index 06e4d9c..0000000 --- a/fullcalendar-main/tests/manual/rrule.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - -
- - - diff --git a/fullcalendar-main/tests/manual/theming.html b/fullcalendar-main/tests/manual/theming.html deleted file mode 100644 index 710ecb3..0000000 --- a/fullcalendar-main/tests/manual/theming.html +++ /dev/null @@ -1,222 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- Theme System: - -
- - - - - -
- - - -
-
- -
- - - diff --git a/fullcalendar-main/tests/manual/time-zones.html b/fullcalendar-main/tests/manual/time-zones.html deleted file mode 100644 index b594c28..0000000 --- a/fullcalendar-main/tests/manual/time-zones.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - - - - -
- -
- Timezone: - -
- -
- loading... - php/get-events.php must be running. -
- -
- -
- -
- - - diff --git a/fullcalendar-main/tests/manual/timegrid-chrome91-bug.html b/fullcalendar-main/tests/manual/timegrid-chrome91-bug.html deleted file mode 100644 index b2942ce..0000000 --- a/fullcalendar-main/tests/manual/timegrid-chrome91-bug.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - -
- - - diff --git a/fullcalendar-main/tests/manual/timegrid.html b/fullcalendar-main/tests/manual/timegrid.html deleted file mode 100644 index 07d8f7d..0000000 --- a/fullcalendar-main/tests/manual/timegrid.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - - -
- - - diff --git a/fullcalendar-main/tests/manual/vue2.html b/fullcalendar-main/tests/manual/vue2.html deleted file mode 100644 index 852bd10..0000000 --- a/fullcalendar-main/tests/manual/vue2.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - -
- - - -
- - - diff --git a/fullcalendar-main/tests/manual/vue3.html b/fullcalendar-main/tests/manual/vue3.html deleted file mode 100644 index 46c17a5..0000000 --- a/fullcalendar-main/tests/manual/vue3.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - -
- - - -
- - - diff --git a/fullcalendar-main/tests/manual/web-component.html b/fullcalendar-main/tests/manual/web-component.html deleted file mode 100644 index 2655c05..0000000 --- a/fullcalendar-main/tests/manual/web-component.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - -
- -
- - - diff --git a/fullcalendar-main/tests/package.json b/fullcalendar-main/tests/package.json deleted file mode 100644 index 5a83759..0000000 --- a/fullcalendar-main/tests/package.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "private": true, - "name": "@fullcalendar-tests/standard", - "version": "0.0.0", - "dependencies": { - "@fullcalendar/bootstrap": "~6.1.10", - "@fullcalendar/core": "~6.1.10", - "@fullcalendar/daygrid": "~6.1.10", - "@fullcalendar/google-calendar": "~6.1.10", - "@fullcalendar/icalendar": "~6.1.10", - "@fullcalendar/interaction": "~6.1.10", - "@fullcalendar/list": "~6.1.10", - "@fullcalendar/luxon3": "~6.1.10", - "@fullcalendar/moment": "~6.1.10", - "@fullcalendar/moment-timezone": "~6.1.10", - "@fullcalendar/multimonth": "~6.1.10", - "@fullcalendar/rrule": "~6.1.10", - "@fullcalendar/timegrid": "~6.1.10", - "fullcalendar": "~6.1.10", - "luxon": "^2.0.0", - "moment": "^2.29.1", - "moment-timezone": "^0.5.40", - "xhr-mock": "^2.5.1" - }, - "devDependencies": { - "@fullcalendar-scripts/standard": "*", - "@types/jasmine": "^3.3.12", - "@types/jasmine-jquery": "^1.5.33", - "@types/jquery": "^3.3.29", - "fetch-mock": "^9.11.0", - "handlebars": "^4.7.7" - }, - "scripts": { - "build": "standard-scripts pkg:build", - "test": "standard-scripts pkg:test", - "test:dev": "standard-scripts pkg:test --dev", - "clean": "standard-scripts pkg:clean", - "lint": "eslint ." - }, - "type": "module", - "tsConfig": { - "extends": "@fullcalendar-scripts/standard/config/tsconfig.browser.json", - "compilerOptions": { - "types": [ - "jasmine", - "jasmine-jquery", - "jquery" - ], - "rootDir": "./src", - "outDir": "./dist/.tsout" - }, - "include": [ - "./src/**/*" - ] - }, - "buildConfig": { - "exports": { - ".": { - "iife": true, - "iifeGenerator": "./scripts/generate-index-iife.js" - } - }, - "iifeGlobals": { - "*": "" - } - }, - "karmaConfig": { - "suites": { - "default": { - "files": [ - "./dist/index.global.js" - ] - }, - "pkg:global:locale": { - "files": [ - "./node_modules/@fullcalendar/core/index.global.js", - "./node_modules/@fullcalendar/core/locales/ar.global.js", - "./node_modules/@fullcalendar/daygrid/index.global.js", - "./src/global-locale.js" - ] - }, - "pkg:global:locales-all": { - "files": [ - "./node_modules/@fullcalendar/core/index.global.js", - "./node_modules/@fullcalendar/core/locales-all.global.js", - "./node_modules/@fullcalendar/daygrid/index.global.js", - "./src/global-locales-all.js" - ] - }, - "bundle:global:locale": { - "files": [ - "./node_modules/fullcalendar/index.global.js", - "./node_modules/@fullcalendar/core/locales/ar.global.js", - "./src/global-locale.js" - ] - }, - "bundle:global:locales-all": { - "files": [ - "./node_modules/fullcalendar/index.global.js", - "./node_modules/@fullcalendar/core/locales-all.global.js", - "./src/global-locales-all.js" - ] - } - } - }, - "exports": { - "./package.json": "./package.json", - "./scripts/*": "./scripts/*.js", - "./lib/*": { - "types": "./dist/.tsout/lib/*.d.ts", - "default": "./dist/.tsout/lib/*.js" - }, - ".": { - "types": "./dist/.tsout/index.d.ts", - "default": "./dist/index.js" - } - } -} diff --git a/fullcalendar-main/tests/scripts/generate-index-iife.js b/fullcalendar-main/tests/scripts/generate-index-iife.js deleted file mode 100644 index c505e19..0000000 --- a/fullcalendar-main/tests/scripts/generate-index-iife.js +++ /dev/null @@ -1,79 +0,0 @@ -import { join as joinPaths } from 'path' -import { fileURLToPath } from 'url' -import { readFile } from 'fs/promises' -import handlebars from 'handlebars' -import { execCapture } from '@fullcalendar-scripts/standard/utils/exec' - -/* -TODO: don't always display prefix when doing config.log() -TODO: don't reinit rollup watcher on ANY change. Slow when not using fdescribe technique. -*/ - -const thisPkgDir = joinPaths(fileURLToPath(import.meta.url), '../..') -const templatePath = joinPaths(thisPkgDir, 'src/index.global.js.tpl') - -/* -HACK: watch the transpiled directory, so bundling waits until tsc completes -*/ -export function getWatchPaths(config) { - const transpileDir = joinPaths(config.pkgDir, 'dist/.tsout') - - return [transpileDir, templatePath] -} - -export default async function(config) { - const srcDir = joinPaths(config.pkgDir, 'src') - - // mindepth 2 means subdirectories - let testPaths = await execCapture( - 'find . -mindepth 2 -type f \\( -name \'*.ts\' -or -name \'*.tsx\' \\) -print0 | ' + - 'xargs -0 grep -E "(fdescribe|fit)\\("', - { cwd: srcDir }, - ).then( - (stdout) => strToLines(stdout).map((line) => line.trim().split(':')[0]), - () => { - return [] // TODO: somehow look at stderr string. if empty, simply no testPaths. if populated, real error - }, - ) - - // the `find` command reports multiple matches per file. consolidate duplicates - testPaths = uniqueStrs(testPaths) - - if (testPaths.length) { - config.log( - 'Only test files that have fdescribe/fit:\n' + - testPaths.join('\n'), - ) - } else { - // mindepth 2 means subdirectories - testPaths = strToLines((await execCapture( - 'find . -mindepth 2 -type f \\( -name \'*.ts\' -or -name \'*.tsx\' \\)', - { cwd: srcDir }, - ))) - - config.log(`Using all ${testPaths.length} test files`) - } - - const extensionlessTestPaths = testPaths.map((testPath) => testPath.replace(/\.tsx?$/, '')) - - const templateText = await readFile(templatePath, 'utf8') - const template = handlebars.compile(templateText) - const code = template({ extensionlessTestPaths }) - - return code -} - -function uniqueStrs(strs) { - const map = {} - - for (const str of strs) { - map[str] = true - } - - return Object.keys(map) -} - -function strToLines(str) { - str = str.trim() - return str ? str.split('\n') : [] -} diff --git a/fullcalendar-main/tests/src/date-render/dayNumbers.ts b/fullcalendar-main/tests/src/date-render/dayNumbers.ts deleted file mode 100644 index 3791628..0000000 --- a/fullcalendar-main/tests/src/date-render/dayNumbers.ts +++ /dev/null @@ -1,17 +0,0 @@ -import arLocale from '@fullcalendar/core/locales/ar' -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' - -describe('dayNumbers', () => { - pushOptions({ - initialDate: '2018-01-01', - }) - - it('respects locale in month view', () => { - let calendar = initCalendar({ - initialView: 'dayGridMonth', - locale: arLocale, - }) - let dayGridViewWrapper = new DayGridViewWrapper(calendar).dayGrid - expect(dayGridViewWrapper.getDayNumberText('2018-01-01')).toMatch(/1|١٤?/) // normal 1, or an Arabic 1 - }) -}) diff --git a/fullcalendar-main/tests/src/date-render/slotMinTime.ts b/fullcalendar-main/tests/src/date-render/slotMinTime.ts deleted file mode 100644 index 169c122..0000000 --- a/fullcalendar-main/tests/src/date-render/slotMinTime.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('slotMinTime', () => { - // root cause of https://github.com/fullcalendar/fullcalendar-vue/issues/88 - it('gets rerendered when changing via resetOptions', () => { - let calendar = initCalendar({ - initialView: 'timeGridDay', - slotMinTime: '01:00', - }) - let gridWrapper = new TimeGridViewWrapper(calendar).timeGrid - expect(gridWrapper.getAxisTexts()[0]).toBe('1am') - calendar.setOption('slotMinTime', '09:00') - expect(gridWrapper.getAxisTexts()[0]).toBe('9am') - }) -}) diff --git a/fullcalendar-main/tests/src/date-selection/implicit-unselect.ts b/fullcalendar-main/tests/src/date-selection/implicit-unselect.ts deleted file mode 100644 index 302bf19..0000000 --- a/fullcalendar-main/tests/src/date-selection/implicit-unselect.ts +++ /dev/null @@ -1,51 +0,0 @@ -describe('implicit unselection', () => { - pushOptions({ - initialView: 'dayGridMonth', - fixedWeekCount: true, - now: '2018-09-11', - }) - - it('happens when dates change', () => { - let selectFired = 0 - let unselectFired = 0 - - initCalendar({ - select() { - selectFired += 1 - }, - unselect() { - unselectFired += 1 - }, - }) - - currentCalendar.select('2018-09-24', '2018-10-03') // will still be visible after .next() - expect(selectFired).toBe(1) - expect(unselectFired).toBe(0) - - currentCalendar.next() - expect(selectFired).toBe(1) - expect(unselectFired).toBe(1) // unselected - }) - - it('happens when view changes', () => { - let selectFired = 0 - let unselectFired = 0 - - initCalendar({ - select() { - selectFired += 1 - }, - unselect() { - unselectFired += 1 - }, - }) - - currentCalendar.select('2018-09-09', '2018-09-14') // will still be visible after view switch - expect(selectFired).toBe(1) - expect(unselectFired).toBe(0) - - currentCalendar.changeView('dayGridWeek') - expect(selectFired).toBe(1) - expect(unselectFired).toBe(1) // unselected - }) -}) diff --git a/fullcalendar-main/tests/src/datelib/formatting-api.ts b/fullcalendar-main/tests/src/datelib/formatting-api.ts deleted file mode 100644 index 6434107..0000000 --- a/fullcalendar-main/tests/src/datelib/formatting-api.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { formatDate, formatRange } from '@fullcalendar/core' - -describe('formatDate', () => { - it('works with no timezone offset', () => { - let str = formatDate('2018-09-04', { - month: 'long', - day: 'numeric', - year: 'numeric', - }) - expect(str).toBe('September 4, 2018') - }) - - it('works with timezone offset', () => { - let str = formatDate('2018-09-04T00:00:00-05:00', { - month: 'long', - day: 'numeric', - year: 'numeric', - timeZoneName: 'short', - timeZone: 'America/New_York', // but with no named tz implementation - omitCommas: true, // for cross-browser - }) - expect(str.replace(' at ', ' ')) - .toBe('September 4 2018 12:00 AM GMT-5') - }) -}) - -describe('formatRange', () => { - it('works with no timezone offset', () => { - let str = formatRange('2018-09-04', '2018-10-04', { - month: 'long', - day: 'numeric', - year: 'numeric', - }) - expect(str).toBe('September 4 - October 4, 2018') - }) - - it('works with custom separator', () => { - let str = formatRange('2018-09-04', '2018-10-04', { - month: 'long', - day: 'numeric', - year: 'numeric', - separator: ' ... ', - }) - expect(str).toBe('September 4 ... October 4, 2018') - }) - - it('works with timezone offset', () => { - let str = formatRange('2018-09-04T00:00:00-05:00', '2018-10-04T00:00:00-05:00', { - month: 'long', - day: 'numeric', - year: 'numeric', - timeZoneName: 'short', - timeZone: 'America/New_York', // but with no named tz implementation - omitCommas: true, // for cross-browser - }) - expect(str.replace(' at ', ' ')) - .toBe('September 4 - October 4 2018 12:00 AM GMT-5') - }) -}) diff --git a/fullcalendar-main/tests/src/datelib/luxon.ts b/fullcalendar-main/tests/src/datelib/luxon.ts deleted file mode 100644 index ca81bb3..0000000 --- a/fullcalendar-main/tests/src/datelib/luxon.ts +++ /dev/null @@ -1,197 +0,0 @@ -import { Calendar } from '@fullcalendar/core' -import esLocale from '@fullcalendar/core/locales/es' -import luxonPlugin, { toLuxonDateTime, toLuxonDuration } from '@fullcalendar/luxon3' -import dayGridPlugin from '@fullcalendar/daygrid' -import { testTimeZoneImpl } from '../lib/timeZoneImpl.js' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('luxon plugin', () => { - const PLUGINS = [luxonPlugin, dayGridPlugin] // for `new Calendar` - - pushOptions({ // for initCalendar - plugins: PLUGINS, - }) - - testTimeZoneImpl(luxonPlugin) - - describe('toLuxonDateTime', () => { - describe('timezone transfering', () => { - it('transfers UTC', () => { - let calendar = new Calendar(document.createElement('div'), { - plugins: PLUGINS, - events: [{ start: '2018-09-05T12:00:00', end: '2018-09-05T18:00:00' }], - timeZone: 'UTC', - }) - let event = calendar.getEvents()[0] - let start = toLuxonDateTime(event.start, calendar) - let end = toLuxonDateTime(event.end, calendar) - expect(start.toISO()).toBe('2018-09-05T12:00:00.000Z') - expect(start.zoneName).toBe('UTC') - expect(end.toISO()).toBe('2018-09-05T18:00:00.000Z') - expect(end.zoneName).toBe('UTC') - }) - - it('transfers local timezone', () => { - let calendar = new Calendar(document.createElement('div'), { - plugins: PLUGINS, - events: [{ start: '2018-09-05T12:00:00', end: '2018-09-05T18:00:00' }], - timeZone: 'local', - }) - let event = calendar.getEvents()[0] - let start = toLuxonDateTime(event.start, calendar) - let end = toLuxonDateTime(event.end, calendar) - expect(start.toJSDate()).toEqualLocalDate('2018-09-05T12:00:00') - expect(start.zoneName).toMatch('/') // has a named timezone - expect(end.toJSDate()).toEqualLocalDate('2018-09-05T18:00:00') - expect(end.zoneName).toMatch('/') // has a named timezone - }) - - it('transfers named timezone', () => { - let calendar = new Calendar(document.createElement('div'), { - plugins: PLUGINS, - events: [{ start: '2018-09-05T12:00:00', end: '2018-09-05T18:00:00' }], - timeZone: 'Europe/Moscow', - }) - let event = calendar.getEvents()[0] - let start = toLuxonDateTime(event.start, calendar) - let end = toLuxonDateTime(event.end, calendar) - expect(start.toJSDate()).toEqualDate('2018-09-05T12:00:00+03:00') - expect(start.zoneName).toMatch('Europe/Moscow') - expect(end.toJSDate()).toEqualDate('2018-09-05T18:00:00+03:00') - expect(end.zoneName).toMatch('Europe/Moscow') - }) - }) - - it('transfers locale', () => { - let calendar = new Calendar(document.createElement('div'), { - plugins: PLUGINS, - events: [{ start: '2018-09-05T12:00:00', end: '2018-09-05T18:00:00' }], - locale: esLocale, - }) - let event = calendar.getEvents()[0] - let datetime = toLuxonDateTime(event.start, calendar) - expect(datetime.locale).toEqual('es') - }) - }) - - describe('toLuxonDuration', () => { - it('converts numeric values correctly', () => { - let calendar = new Calendar(document.createElement('div'), { - plugins: PLUGINS, - defaultTimedEventDuration: '05:00', - defaultAllDayEventDuration: { days: 3 }, - }) - - // hacky way to have a duration parsed - let timedDuration = toLuxonDuration(calendar.getCurrentData().options.defaultTimedEventDuration, calendar) - let allDayDuration = toLuxonDuration(calendar.getCurrentData().options.defaultAllDayEventDuration, calendar) - - expect(timedDuration.as('hours')).toBe(5) - expect(allDayDuration.as('days')).toBe(3) - }) - - it('transfers locale correctly', () => { - let calendar = new Calendar(document.createElement('div'), { - plugins: PLUGINS, - defaultTimedEventDuration: '05:00', - locale: esLocale, - }) - - // hacky way to have a duration parsed - let timedDuration = toLuxonDuration(calendar.getCurrentData().options.defaultTimedEventDuration, calendar) - - expect(timedDuration.locale).toBe('es') - }) - }) - - describe('date formatting', () => { - it('produces event time text', () => { - let calendar = initCalendar({ - initialView: 'dayGridMonth', - now: '2018-09-06', - displayEventEnd: false, - eventTimeFormat: 'HH:mm:ss\'abc\'', - events: [ - { title: 'my event', start: '2018-09-06T13:30:20' }, - ], - }) - - let calendarWrapper = new CalendarWrapper(calendar) - let eventEl = calendarWrapper.getFirstEventEl() - let eventInfo = calendarWrapper.getEventElInfo(eventEl) - - expect(eventInfo.timeText).toBe('13:30:20abc') - }) - }) - - describe('range formatting', () => { - it('renders with same month', () => { - let calendar = new Calendar(document.createElement('div'), { - plugins: PLUGINS, - }) - let s - - s = calendar.formatRange('2018-09-03', '2018-09-05', 'MMMM {d}, yyyy \'asdf\'') - expect(s).toEqual('September 3 - 5, 2018 asdf') - - s = calendar.formatRange('2018-09-03', '2018-09-05', '{d} MMMM, yyyy \'asdf\'') - expect(s).toEqual('3 - 5 September, 2018 asdf') - }) - - it('renders with same year but different month', () => { - let calendar = new Calendar(document.createElement('div'), { - plugins: PLUGINS, - }) - let s - - s = calendar.formatRange('2018-09-03', '2018-10-05', '{MMMM {d}}, yyyy \'asdf\'') - expect(s).toEqual('September 3 - October 5, 2018 asdf') - - s = calendar.formatRange('2018-09-03', '2018-10-05', '{{d} MMMM}, yyyy \'asdf\'') - expect(s).toEqual('3 September - 5 October, 2018 asdf') - }) - - it('renders with different years', () => { - let calendar = new Calendar(document.createElement('div'), { - plugins: PLUGINS, - }) - let s - - s = calendar.formatRange('2018-09-03', '2019-10-05', '{MMMM {d}}, yyyy \'asdf\'') - expect(s).toEqual('September 3, 2018 asdf - October 5, 2019 asdf') - - s = calendar.formatRange('2018-09-03', '2019-10-05', '{{d} MMMM}, yyyy \'asdf\'') - expect(s).toEqual('3 September, 2018 asdf - 5 October, 2019 asdf') - }) - - it('renders the same if same day', () => { - let calendar = new Calendar(document.createElement('div'), { - plugins: PLUGINS, - }) - let s - - s = calendar.formatRange('2018-09-03T00:00:00', '2018-09-03T23:59:59', 'MMMM d yyyy') - expect(s).toEqual('September 3 2018') - }) - - it('inherits defaultRangeSeparator', () => { - let calendar = new Calendar(document.createElement('div'), { - plugins: PLUGINS, - defaultRangeSeparator: ' to ', - }) - let s = calendar.formatRange('2018-09-03', '2018-09-05', 'MMMM d, yyyy \'asdf\'') - expect(s).toEqual('September 3, 2018 asdf to September 5, 2018 asdf') - }) - - it('produces title with titleRangeSeparator', () => { - initCalendar({ // need to render the calendar to get view.title :( - plugins: PLUGINS, - initialView: 'dayGridWeek', - now: '2018-09-06', - titleFormat: 'MMMM {d} yy \'yup\'', - titleRangeSeparator: ' to ', - }) - expect(currentCalendar.view.title).toBe('September 2 to 8 18 yup') - }) - }) -}) diff --git a/fullcalendar-main/tests/src/datelib/main.ts b/fullcalendar-main/tests/src/datelib/main.ts deleted file mode 100644 index b747c78..0000000 --- a/fullcalendar-main/tests/src/datelib/main.ts +++ /dev/null @@ -1,715 +0,0 @@ -import { Calendar } from '@fullcalendar/core' -import { - DateEnv, - createFormatter, - createDuration, - startOfDay, - diffWholeWeeks, - diffWholeDays, - diffDayAndTime, -} from '@fullcalendar/core/internal' -import dayGridPlugin from '@fullcalendar/daygrid' -import { getDSTDeadZone } from '../lib/dst-dead-zone.js' -import { formatPrettyTimeZoneOffset, formatIsoTimeZoneOffset, formatIsoWithoutTz } from '../lib/datelib-utils.js' - -describe('datelib', () => { - let enLocale - - beforeEach(() => { - enLocale = new Calendar(document.createElement('div'), { // HACK - plugins: [dayGridPlugin], - }).getCurrentData().dateEnv.locale - }) - - describe('computeWeekNumber', () => { - it('works with local', () => { - let env = new DateEnv({ - timeZone: 'UTC', - calendarSystem: 'gregory', - locale: enLocale, - }) - let m1 = env.createMarker('2018-04-07') - let m2 = env.createMarker('2018-04-08') - expect(env.computeWeekNumber(m1)).toBe(14) - expect(env.computeWeekNumber(m2)).toBe(15) - }) - - it('works with ISO', () => { - let env = new DateEnv({ - timeZone: 'UTC', - calendarSystem: 'gregory', - locale: enLocale, - weekNumberCalculation: 'ISO', - }) - let m1 = env.createMarker('2018-04-01') - let m2 = env.createMarker('2018-04-02') - expect(env.computeWeekNumber(m1)).toBe(13) - expect(env.computeWeekNumber(m2)).toBe(14) - }) - - it('works with custom function', () => { - let env = new DateEnv({ - timeZone: 'UTC', - calendarSystem: 'gregory', - locale: enLocale, - weekNumberCalculation(date) { - expect(date instanceof Date).toBe(true) - expect(date.valueOf()).toBe(Date.UTC(2018, 3, 1)) - return 99 - }, - }) - let m1 = env.createMarker('2018-04-01') - expect(env.computeWeekNumber(m1)).toBe(99) - }) - }) - - it('startOfWeek with different firstDay', () => { - let env = new DateEnv({ - timeZone: 'UTC', - calendarSystem: 'gregory', - locale: enLocale, - firstDay: 2, // tues - }) - let m = env.createMarker('2018-04-19') - let w = env.startOfWeek(m) - - expect(env.toDate(w)).toEqual( - new Date(Date.UTC(2018, 3, 17)), - ) - }) - - describe('when UTC', () => { - let env - - beforeEach(() => { - env = new DateEnv({ - timeZone: 'UTC', - calendarSystem: 'gregory', - locale: enLocale, - }) - }) - - describe('createMarker', () => { - it('with date', () => { - expect( - env.toDate( - env.createMarker( - new Date(2017, 5, 8), - ), - ), - ).toEqual( - new Date(2017, 5, 8), - ) - }) - - it('with timestamp', () => { - expect( - env.toDate( - env.createMarker( - new Date(2017, 5, 8).valueOf(), - ), - ), - ).toEqual( - new Date(2017, 5, 8), - ) - }) - - it('with array', () => { - expect( - env.toDate( - env.createMarker( - [2017, 5, 8], - ), - ), - ).toEqual( - new Date(Date.UTC(2017, 5, 8)), - ) - }) - }) - - describe('ISO8601 parsing', () => { - it('parses non-tz as UTC', () => { - let res = env.createMarkerMeta('2018-06-08') - let date = env.toDate(res.marker) - expect(date).toEqual(new Date(Date.UTC(2018, 5, 8))) - expect(res.forcedTzo).toBeNull() - }) - - it('parses a date already in UTC', () => { - let res = env.createMarkerMeta('2018-06-08T00:00:00Z') - let date = env.toDate(res.marker) - expect(date).toEqual(new Date(Date.UTC(2018, 5, 8))) - expect(res.forcedTzo).toBeNull() - }) - - it('parses timezones into UTC', () => { - let res = env.createMarkerMeta('2018-06-08T00:00:00+12:00') - let date = env.toDate(res.marker) - expect(date).toEqual(new Date(Date.UTC(2018, 5, 7, 12))) - expect(res.forcedTzo).toBeNull() - }) - - it('detects lack of time', () => { - let res = env.createMarkerMeta('2018-06-08') - expect(res.isTimeUnspecified).toBe(true) - }) - - it('detects presence of time', () => { - let res = env.createMarkerMeta('2018-06-08T00:00:00') - expect(res.isTimeUnspecified).toBe(false) - }) - - it('parses a time with no \'T\'', () => { - let res = env.createMarkerMeta('2018-06-08 01:00:00') - let date = env.toDate(res.marker) - expect(date).toEqual(new Date(Date.UTC(2018, 5, 8, 1, 0))) - }) - - it('parses just a month', () => { - let res = env.createMarkerMeta('2018-06') - let date = env.toDate(res.marker) - expect(date).toEqual(new Date(Date.UTC(2018, 5, 1))) - }) - - it('detects presence of time even if timezone', () => { - let res = env.createMarkerMeta('2018-06-08T00:00:00+12:00') - expect(res.isTimeUnspecified).toBe(false) - }) - }) - - it('outputs ISO8601 formatting', () => { - let marker = env.createMarker('2018-06-08T00:00:00') - let s = env.formatIso(marker) - expect(s).toBe('2018-06-08T00:00:00Z') - }) - - it('outputs pretty format with UTC timezone', () => { - let marker = env.createMarker('2018-06-08') - let formatter = createFormatter({ - weekday: 'long', - day: 'numeric', - month: 'long', - hour: '2-digit', - minute: '2-digit', - year: 'numeric', - timeZoneName: 'short', - omitCommas: true, // for cross-browser - }) - let s = env.format(marker, formatter) - expect(s.replace(' at ', ' ')) - .toBe('Friday June 8 2018 12:00 AM UTC') - }) - - describe('week number formatting', () => { - it('can output only number', () => { - let marker = env.createMarker('2018-06-08') - let formatter = createFormatter({ week: 'numeric' }) - let s = env.format(marker, formatter) - expect(s).toBe('23') - }) - - it('can output narrow', () => { - let marker = env.createMarker('2018-06-08') - let formatter = createFormatter({ week: 'narrow' }) - let s = env.format(marker, formatter) - expect(s).toBe('W23') - }) - - it('can output short', () => { - let marker = env.createMarker('2018-06-08') - let formatter = createFormatter({ week: 'short' }) - let s = env.format(marker, formatter) - expect(s).toBe('W 23') - }) - }) - - describe('range formatting', () => { - let formatter = createFormatter({ - day: 'numeric', - month: 'long', - year: 'numeric', - separator: ' - ', - }) - - it('works with different days of same month', () => { - let m0 = env.createMarker('2018-06-08') - let m1 = env.createMarker('2018-06-09') - let s = env.formatRange(m0, m1, formatter) - expect(s).toBe('June 8 - 9, 2018') - }) - - it('works with different days of same month, with inprecise formatter', () => { - let otherFormatter = createFormatter({ - month: 'long', - year: 'numeric', - }) - let m0 = env.createMarker('2018-06-08') - let m1 = env.createMarker('2018-06-09') - let s = env.formatRange(m0, m1, otherFormatter) - expect(s).toBe('June 2018') - }) - - it('works with different day/month of same year', () => { - let m0 = env.createMarker('2018-06-08') - let m1 = env.createMarker('2018-07-09') - let s = env.formatRange(m0, m1, formatter) - expect(s).toBe('June 8 - July 9, 2018') - }) - - it('works with completely different dates', () => { - let m0 = env.createMarker('2018-06-08') - let m1 = env.createMarker('2020-07-09') - let s = env.formatRange(m0, m1, formatter) - expect(s).toBe('June 8, 2018 - July 9, 2020') - }) - }) - - // date math - - describe('add', () => { - it('works with positives', () => { - let dur = createDuration({ - year: 1, - month: 2, - day: 3, - hour: 4, - minute: 5, - second: 6, - ms: 7, - }) - let d0 = env.createMarker(new Date(Date.UTC(2018, 5, 5, 12))) - let d1 = env.toDate(env.add(d0, dur)) - expect(d1).toEqual( - new Date(Date.UTC(2019, 7, 8, 16, 5, 6, 7)), - ) - }) - - it('works with negatives', () => { - let dur = createDuration({ - year: -1, - month: -2, - day: -3, - hour: -4, - minute: -5, - second: -6, - millisecond: -7, - }) - let d0 = env.createMarker(new Date(Date.UTC(2018, 5, 5, 12))) - let d1 = env.toDate(env.add(d0, dur)) - expect(d1).toEqual( - new Date(Date.UTC(2017, 3, 2, 7, 54, 53, 993)), - ) - }) - }) - - // test in Safari! - // https://github.com/fullcalendar/fullcalendar/issues/4363 - it('startOfYear', () => { - let d0 = env.createMarker(new Date(Date.UTC(2018, 5, 5, 12))) - let d1 = env.toDate(env.startOfYear(d0)) - expect(d1).toEqual( - new Date(Date.UTC(2018, 0, 1)), - ) - }) - - it('startOfMonth', () => { - let d0 = env.createMarker(new Date(Date.UTC(2018, 5, 5, 12))) - let d1 = env.toDate(env.startOfMonth(d0)) - expect(d1).toEqual( - new Date(Date.UTC(2018, 5, 1)), - ) - }) - - it('startOfWeek', () => { - let d0 = env.createMarker(new Date(Date.UTC(2018, 5, 5, 12))) - let d1 = env.toDate(env.startOfWeek(d0)) - expect(d1).toEqual( - new Date(Date.UTC(2018, 5, 3)), - ) - }) - - it('startOfDay', () => { - let d0 = env.createMarker(new Date(Date.UTC(2018, 5, 5, 12, 30))) - let d1 = env.toDate(startOfDay(d0)) - expect(d1).toEqual( - new Date(Date.UTC(2018, 5, 5)), - ) - }) - - describe('diffWholeYears', () => { - it('returns null if not whole', () => { - let d0 = new Date(Date.UTC(2018, 5, 5, 12, 0)) - let d1 = new Date(Date.UTC(2020, 5, 5, 12, 30)) - let diff = env.diffWholeYears( - env.createMarker(d0), - env.createMarker(d1), - ) - expect(diff).toBe(null) - }) - - it('returns negative', () => { - let d0 = new Date(Date.UTC(2020, 5, 5, 12, 0)) - let d1 = new Date(Date.UTC(2018, 5, 5, 12, 0)) - let diff = env.diffWholeYears( - env.createMarker(d0), - env.createMarker(d1), - ) - expect(diff).toBe(-2) - }) - - it('returns positive', () => { - let d0 = new Date(Date.UTC(2018, 5, 5, 12, 0)) - let d1 = new Date(Date.UTC(2020, 5, 5, 12, 0)) - let diff = env.diffWholeYears( - env.createMarker(d0), - env.createMarker(d1), - ) - expect(diff).toBe(2) - }) - }) - - describe('diffWholeMonths', () => { - it('returns null if not whole', () => { - let d0 = new Date(Date.UTC(2018, 5, 5)) - let d1 = new Date(Date.UTC(2020, 5, 6)) - let diff = env.diffWholeMonths( - env.createMarker(d0), - env.createMarker(d1), - ) - expect(diff).toBe(null) - }) - - it('returns negative', () => { - let d0 = new Date(Date.UTC(2020, 9, 5)) - let d1 = new Date(Date.UTC(2018, 5, 5)) - let diff = env.diffWholeMonths( - env.createMarker(d0), - env.createMarker(d1), - ) - expect(diff).toBe(-12 * 2 - 4) - }) - - it('returns positive', () => { - let d0 = new Date(Date.UTC(2018, 5, 5)) - let d1 = new Date(Date.UTC(2020, 9, 5)) - let diff = env.diffWholeMonths( - env.createMarker(d0), - env.createMarker(d1), - ) - expect(diff).toBe(12 * 2 + 4) - }) - }) - - describe('diffWholeWeeks', () => { - it('returns null if not whole', () => { - let d0 = new Date(Date.UTC(2018, 5, 5)) - let d1 = new Date(Date.UTC(2018, 5, 20)) - let diff = diffWholeWeeks( - env.createMarker(d0), - env.createMarker(d1), - ) - expect(diff).toBe(null) - }) - - it('returns negative', () => { - let d0 = new Date(Date.UTC(2018, 5, 19)) - let d1 = new Date(Date.UTC(2018, 5, 5)) - let diff = diffWholeWeeks( - env.createMarker(d0), - env.createMarker(d1), - ) - expect(diff).toBe(-2) - }) - - it('returns positive', () => { - let d0 = new Date(Date.UTC(2018, 5, 5)) - let d1 = new Date(Date.UTC(2018, 5, 19)) - let diff = diffWholeWeeks( - env.createMarker(d0), - env.createMarker(d1), - ) - expect(diff).toBe(2) - }) - }) - - describe('diffWholeDays', () => { - it('returns null if not whole', () => { - let d0 = new Date(Date.UTC(2018, 5, 5)) - let d1 = new Date(Date.UTC(2018, 5, 19, 12)) - let diff = diffWholeDays( - env.createMarker(d0), - env.createMarker(d1), - ) - expect(diff).toBe(null) - }) - - it('returns negative', () => { - let d0 = new Date(Date.UTC(2018, 5, 19)) - let d1 = new Date(Date.UTC(2018, 5, 5)) - let diff = diffWholeDays( - env.createMarker(d0), - env.createMarker(d1), - ) - expect(diff).toBe(-14) - }) - - it('returns positive', () => { - let d0 = new Date(Date.UTC(2018, 5, 5)) - let d1 = new Date(Date.UTC(2018, 5, 19)) - let diff = diffWholeDays( - env.createMarker(d0), - env.createMarker(d1), - ) - expect(diff).toBe(14) - }) - }) - - describe('diffDayAndTime', () => { - it('returns negative', () => { - let d0 = new Date(Date.UTC(2018, 5, 19, 12)) - let d1 = new Date(Date.UTC(2018, 5, 5)) - let diff = diffDayAndTime( - env.createMarker(d0), - env.createMarker(d1), - ) - expect(diff).toEqual({ - years: 0, - months: 0, - days: -14, - milliseconds: -12 * 60 * 60 * 1000, - }) - }) - - it('returns positive', () => { - let d0 = new Date(Date.UTC(2018, 5, 5)) - let d1 = new Date(Date.UTC(2018, 5, 19, 12)) - let diff = diffDayAndTime( - env.createMarker(d0), - env.createMarker(d1), - ) - expect(diff).toEqual({ - years: 0, - months: 0, - days: 14, - milliseconds: 12 * 60 * 60 * 1000, - }) - }) - }) - }) - - describe('when local', () => { - let env - - beforeEach(() => { - env = new DateEnv({ - timeZone: 'local', - calendarSystem: 'gregory', - locale: enLocale, - }) - }) - - describe('ISO8601 parsing', () => { - it('parses non-tz as local', () => { - let res = env.createMarkerMeta('2018-06-08') - let date = env.toDate(res.marker) - expect(date).toEqual(new Date(2018, 5, 8)) - expect(res.forcedTzo).toBeNull() - }) - - it('parses timezones into local', () => { - let res = env.createMarkerMeta('2018-06-08T00:00:00+12:00') - let date = env.toDate(res.marker) - expect(date).toEqual(new Date(Date.UTC(2018, 5, 7, 12))) - expect(res.forcedTzo).toBeNull() - }) - - it('does not lose info when parsing a dst-dead-zone date', () => { - let deadZone = getDSTDeadZone() - - if (!deadZone) { - console.log('could not determine DST dead zone') // eslint-disable-line no-console - } else { - // use a utc date to get a ISO8601 string representation of the start of the dead zone - let utcDate = new Date(Date.UTC( - deadZone[1].getFullYear(), - deadZone[1].getMonth(), - deadZone[1].getDate(), - deadZone[1].getHours() - 1, // back one hour. shouldn't exist in local time - deadZone[1].getMinutes(), - deadZone[1].getSeconds(), - deadZone[1].getMilliseconds(), - )) - let s = formatIsoWithoutTz(utcDate) - - // check that the local date falls out of the dead zone - let localDate = new Date(s) - expect(localDate.getHours()).not.toBe(deadZone[1].getHours() - 1) - - // check that is parsed and retained the original hour, - // even tho it falls into the dead zone for local time - let marker = env.createMarker(s) - expect(formatIsoWithoutTz(marker)).toBe(s) - - // TODO - // // when it uses the env to format to local time, - // // it should have jumped out of the dead zone. - // expect(env.formatIso(marker)).not.toMatch(s) - } - }) - }) - - it('outputs ISO8601 formatting', () => { - let marker = env.createMarker('2018-06-08T00:00:00') - let s = env.formatIso(marker) - let realTzo = formatIsoTimeZoneOffset(new Date(2018, 5, 8)) - expect(s).toBe('2018-06-08T00:00:00' + realTzo) - }) - - it('outputs pretty format with local timezone', () => { - let marker = env.createMarker('2018-06-08') - let formatter = createFormatter({ - weekday: 'long', - day: 'numeric', - month: 'long', - year: 'numeric', - hour: '2-digit', - minute: '2-digit', - timeZoneName: 'short', - omitCommas: true, // for cross-browser - }) - let s = env.format(marker, formatter) - expect(s.replace(' at ', ' ')) - .toBe('Friday June 8 2018 12:00 AM ' + formatPrettyTimeZoneOffset(new Date(2018, 5, 8))) - }) - - it('can output a timezone only', () => { - let marker = env.createMarker('2018-06-08') - let formatter = createFormatter({ timeZoneName: 'short' }) - let s = env.format(marker, formatter) - expect(s).toBe(formatPrettyTimeZoneOffset(new Date(2018, 5, 8))) - }) - - // because `new Date(year)` is error-prone - it('startOfYear', () => { - let d0 = env.createMarker(new Date(2018, 5, 5, 12)) - let d1 = env.toDate(env.startOfYear(d0)) - expect(d1).toEqual( - new Date(2018, 0, 1), - ) - }) - }) - - describe('when named timezone with coercion', () => { - let env - - beforeEach(() => { - env = new DateEnv({ - timeZone: 'America/Chicago', - calendarSystem: 'gregory', - locale: enLocale, - }) - }) - - describe('ISO8601 parsing', () => { - it('parses non-tz as UTC with no forcedTzo', () => { - let res = env.createMarkerMeta('2018-06-08') - let date = env.toDate(res.marker) - expect(date).toEqual(new Date(Date.UTC(2018, 5, 8))) - expect(res.forcedTzo).toBeNull() - }) - - it('parses as UTC after stripping and with a forcedTzo', () => { - let res = env.createMarkerMeta('2018-06-08T00:00:00+12:00') - let date = env.toDate(res.marker) - expect(date).toEqual(new Date(Date.UTC(2018, 5, 8))) - expect(res.forcedTzo).toBe(12 * 60) - }) - - it('parses as UTC after stripping and with a forcedTzo, alt format', () => { - let res = env.createMarkerMeta('2018-06-08T01:01:01.100+1200') - let date = env.toDate(res.marker) - expect(date).toEqual(new Date(Date.UTC(2018, 5, 8, 1, 1, 1, 100))) - expect(res.forcedTzo).toBe(12 * 60) - }) - }) - - it('outputs UTC timezone when no timezone specified', () => { - let marker = env.createMarker('2018-06-08') - let formatter = createFormatter({ - weekday: 'long', - day: 'numeric', - month: 'long', - year: 'numeric', - timeZoneName: 'short', - omitCommas: true, // for cross-browser - }) - let s = env.format(marker, formatter) - expect(s.replace(' at ', ' ')) - .toBe('Friday June 8 2018 12:00 AM UTC') - }) - - it('outputs UTC short timezone when no timezone specified, when requested as long', () => { - let marker = env.createMarker('2018-06-08') - let formatter = createFormatter({ - weekday: 'long', - day: 'numeric', - month: 'long', - year: 'numeric', - timeZoneName: 'long', - omitCommas: true, // for cross-browser - }) - let s = env.format(marker, formatter) - expect(s.replace(' at ', ' ')) - .toBe('Friday June 8 2018 12:00 AM UTC') - }) - - it('computes current date as local values', () => { - let marker = env.createNowMarker() - let localDate = new Date() - expect(marker.getUTCFullYear()).toBe(localDate.getFullYear()) - expect(marker.getUTCMonth()).toBe(localDate.getMonth()) - expect(marker.getUTCDate()).toBe(localDate.getDate()) - expect(marker.getUTCHours()).toBe(localDate.getHours()) - expect(marker.getUTCMinutes()).toBe(localDate.getMinutes()) - expect(marker.getUTCSeconds()).toBe(localDate.getSeconds()) - }) - }) - - describe('duration parsing', () => { - it('accepts whole day in string', () => { - let dur = createDuration('2.00:00:00') - expect(dur).toEqual({ - years: 0, - months: 0, - days: 2, - milliseconds: 0, - }) - }) - - it('accepts hours, minutes, seconds, and milliseconds', () => { - let dur = createDuration('01:02:03.500') - expect(dur).toEqual({ - years: 0, - months: 0, - days: 0, - milliseconds: - 1 * 60 * 60 * 1000 + - 2 * 60 * 1000 + - 3 * 1000 + - 500, - }) - }) - - it('accepts just hours and minutes', () => { - let dur = createDuration('01:02') - expect(dur).toEqual({ - years: 0, - months: 0, - days: 0, - milliseconds: - 1 * 60 * 60 * 1000 + - 2 * 60 * 1000, - }) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/datelib/moment-timezone.ts b/fullcalendar-main/tests/src/datelib/moment-timezone.ts deleted file mode 100644 index 03b6744..0000000 --- a/fullcalendar-main/tests/src/datelib/moment-timezone.ts +++ /dev/null @@ -1,6 +0,0 @@ -import momentTimeZonePlugin from '@fullcalendar/moment-timezone' -import { testTimeZoneImpl } from '../lib/timeZoneImpl.js' - -describe('moment-timezone', () => { - testTimeZoneImpl(momentTimeZonePlugin) -}) diff --git a/fullcalendar-main/tests/src/datelib/moment.ts b/fullcalendar-main/tests/src/datelib/moment.ts deleted file mode 100644 index b8924e1..0000000 --- a/fullcalendar-main/tests/src/datelib/moment.ts +++ /dev/null @@ -1,176 +0,0 @@ -import { Calendar } from '@fullcalendar/core' -import momentPlugin, { toMoment, toMomentDuration } from '@fullcalendar/moment' -import dayGridPlugin from '@fullcalendar/daygrid' -import timeGridPlugin from '@fullcalendar/timegrid' -import 'moment/locale/es' // only test spanish -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('moment plugin', () => { - const PLUGINS = [dayGridPlugin, timeGridPlugin, momentPlugin] - pushOptions({ plugins: PLUGINS }) - - describe('toMoment', () => { - describe('timezone handling', () => { - it('transfers UTC', () => { - let calendar = new Calendar(document.createElement('div'), { - plugins: [dayGridPlugin], - events: [{ start: '2018-09-05T12:00:00', end: '2018-09-05T18:00:00' }], - timeZone: 'UTC', - }) - let event = calendar.getEvents()[0] - let startMom = toMoment(event.start, calendar) - let endMom = toMoment(event.end, calendar) - expect(startMom.format()).toEqual('2018-09-05T12:00:00Z') - expect(endMom.format()).toEqual('2018-09-05T18:00:00Z') - }) - - it('transfers local', () => { - let calendar = new Calendar(document.createElement('div'), { - plugins: [dayGridPlugin], - events: [{ start: '2018-09-05T12:00:00', end: '2018-09-05T18:00:00' }], - timeZone: 'local', - }) - let event = calendar.getEvents()[0] - let startMom = toMoment(event.start, calendar) - let endMom = toMoment(event.end, calendar) - expect(startMom.toDate()).toEqualLocalDate('2018-09-05T12:00:00') - expect(endMom.toDate()).toEqualLocalDate('2018-09-05T18:00:00') - }) - }) - - it('transfers locale', () => { - let calendar = new Calendar(document.createElement('div'), { - plugins: [dayGridPlugin], - events: [{ start: '2018-09-05T12:00:00', end: '2018-09-05T18:00:00' }], - locale: 'es', - }) - let event = calendar.getEvents()[0] - let mom = toMoment(event.start, calendar) - expect(mom.locale()).toEqual('es') - }) - }) - - describe('toDuration', () => { - it('converts correctly', () => { - let calendar = new Calendar(document.createElement('div'), { - plugins: [dayGridPlugin], - defaultTimedEventDuration: '05:00', - defaultAllDayEventDuration: { days: 3 }, - }) - - // hacky way to have a duration parsed - let timedDuration = toMomentDuration(calendar.getCurrentData().options.defaultTimedEventDuration) - let allDayDuration = toMomentDuration(calendar.getCurrentData().options.defaultAllDayEventDuration) - - expect(timedDuration.asHours()).toBe(5) - expect(allDayDuration.asDays()).toBe(3) - }) - }) - - describe('date formatting', () => { - it('produces event time text', () => { - let calendar = initCalendar({ - initialView: 'dayGridMonth', - now: '2018-09-06', - displayEventEnd: false, - eventTimeFormat: 'HH:mm:ss[!]', - events: [ - { title: 'my event', start: '2018-09-06T13:30:20' }, - ], - }) - - let calendarWrapper = new CalendarWrapper(calendar) - let eventEl = calendarWrapper.getFirstEventEl() - let eventInfo = calendarWrapper.getEventElInfo(eventEl) - - expect(eventInfo.timeText).toBe('13:30:20!') - }) - }) - - describe('range formatting', () => { - it('renders with same month', () => { - let calendar = new Calendar(document.createElement('div'), { - plugins: PLUGINS, - }) - let s - - s = calendar.formatRange('2018-09-03', '2018-09-05', 'MMMM {D}, YYYY [nice]') - expect(s).toEqual('September 3 - 5, 2018 nice') - - s = calendar.formatRange('2018-09-03', '2018-09-05', '{D} MMMM, YYYY [nice]') - expect(s).toEqual('3 - 5 September, 2018 nice') - }) - - it('renders with same year but different month', () => { - let calendar = new Calendar(document.createElement('div'), { - plugins: PLUGINS, - }) - let s - - s = calendar.formatRange('2018-09-03', '2018-10-05', '{MMMM {D}}, YYYY [nice]') - expect(s).toEqual('September 3 - October 5, 2018 nice') - - s = calendar.formatRange('2018-09-03', '2018-10-05', '{{D} MMMM}, YYYY [nice]') - expect(s).toEqual('3 September - 5 October, 2018 nice') - }) - - it('renders with different years', () => { - let calendar = new Calendar(document.createElement('div'), { - plugins: PLUGINS, - }) - let s - - s = calendar.formatRange('2018-09-03', '2019-10-05', '{MMMM {D}}, YYYY [nice]') - expect(s).toEqual('September 3, 2018 nice - October 5, 2019 nice') - - s = calendar.formatRange('2018-09-03', '2019-10-05', '{{D} MMMM}, YYYY [nice]') - expect(s).toEqual('3 September, 2018 nice - 5 October, 2019 nice') - }) - - it('renders the same if same day', () => { - let calendar = new Calendar(document.createElement('div'), { - plugins: PLUGINS, - }) - let s - - s = calendar.formatRange('2018-09-03T00:00:00', '2018-09-03T23:59:59', 'MMM Do YY') - expect(s).toEqual('Sep 3rd 18') - }) - - it('inherits defaultRangeSeparator', () => { - let calendar = new Calendar(document.createElement('div'), { - plugins: PLUGINS, - defaultRangeSeparator: ' to ', - }) - let s = calendar.formatRange('2018-09-03', '2018-09-05', 'MMMM D, YYYY [nice]') - expect(s).toEqual('September 3, 2018 nice to September 5, 2018 nice') - }) - - it('produces title with titleRangeSeparator', () => { - initCalendar({ // need to render the calendar to get view.title :( - initialView: 'dayGridWeek', - now: '2018-09-06', - titleFormat: 'MMMM {D} YY [yup]', - titleRangeSeparator: ' to ', - }) - expect(currentCalendar.view.title).toBe('September 2 to 8 18 yup') - }) - - // https://github.com/fullcalendar/fullcalendar/issues/5493 - it('displays correct rangeSeparator on events', () => { - let calendar = initCalendar({ - initialView: 'timeGridDay', - initialDate: '2020-06-26', - scrollTime: '00:00', - eventTimeFormat: 'HH:mm:ss', - events: [ - { title: 'event', start: '2020-06-26T01:00:00', end: '2020-06-26T02:00:00' }, - ], - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let timeTexts = timeGridWrapper.getEventTimeTexts() - expect(timeTexts[0]).toBe('01:00:00 - 02:00:00') - }) - }) -}) diff --git a/fullcalendar-main/tests/src/datelib/rrule.ts b/fullcalendar-main/tests/src/datelib/rrule.ts deleted file mode 100644 index 807b81d..0000000 --- a/fullcalendar-main/tests/src/datelib/rrule.ts +++ /dev/null @@ -1,604 +0,0 @@ -import dayGridPlugin from '@fullcalendar/daygrid' -import rrulePlugin from '@fullcalendar/rrule' -import luxonPlugin from '@fullcalendar/luxon3' -import { parseUtcDate, parseLocalDate } from '../lib/date-parsing.js' -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' - -describe('rrule plugin', () => { - pushOptions({ - plugins: [rrulePlugin, dayGridPlugin], - initialView: 'dayGridMonth', - now: '2018-09-07', - timeZone: 'UTC', - }) - - it('expands events when given an rrule object', () => { - initCalendar({ - events: [ - { - rrule: { - dtstart: '2018-09-04T13:00:00', - freq: 'weekly', - }, - }, - ], - }) - let events = getSortedEvents() - expect(events.length).toBe(5) - expect(events[0].start).toEqualDate('2018-09-04T13:00:00Z') - expect(events[0].end).toBe(null) - expect(events[1].start).toEqualDate('2018-09-11T13:00:00Z') - expect(events[2].start).toEqualDate('2018-09-18T13:00:00Z') - expect(events[3].start).toEqualDate('2018-09-25T13:00:00Z') - expect(events[4].start).toEqualDate('2018-10-02T13:00:00Z') - }) - - it('can expand monthly recurrence when given an rrule object', () => { - initCalendar({ - initialView: 'dayGridMonth', - now: '2018-12-25T12:00:00', - events: [{ - rrule: { - dtstart: '2018-11-01', - freq: 'monthly', - count: 13, - bymonthday: [13], - }, - }], - }) - - let events = currentCalendar.getEvents() - expect(events.length).toBe(1) - expect(events[0].start).toEqualDate('2018-12-13') - }) - - // https://github.com/fullcalendar/fullcalendar/issues/6059 - it('can specify strings in byweekday', () => { - initCalendar({ - initialView: 'dayGridMonth', - initialDate: '2021-01-01', - events: [{ - allDay: true, - rrule: { - freq: 'weekly', - byweekday: ['mo', 'tu'], - dtstart: '2021-01-01', - }, - }], - }) - - let events = currentCalendar.getEvents() - expect(events.length).toBe(10) - expect(events[0].start).toEqualDate('2021-01-04') - }) - - it('can exclude a recurrence with exdate', () => { - let calendar = initCalendar({ - initialView: 'dayGridMonth', - now: '2020-12-01', - events: [{ - rrule: { - dtstart: '2020-12-01', - freq: 'weekly', - }, - exdate: '2020-12-08', - }], - }) - - let events = calendar.getEvents() - expect(events.length).toBe(5) - expect(events[0].start).toEqualDate('2020-12-01') - expect(events[1].start).toEqualDate('2020-12-15') - expect(events[2].start).toEqualDate('2020-12-22') - expect(events[3].start).toEqualDate('2020-12-29') - expect(events[4].start).toEqualDate('2021-01-05') - }) - - it('can exclude multiple recurrences with exdate', () => { - let calendar = initCalendar({ - initialView: 'dayGridMonth', - now: '2020-12-01', - events: [{ - rrule: { - dtstart: '2020-12-01', - freq: 'weekly', - }, - exdate: ['2020-12-08', '2020-12-15'], - }], - }) - - let events = calendar.getEvents() - expect(events.length).toBe(4) - expect(events[0].start).toEqualDate('2020-12-01') - expect(events[1].start).toEqualDate('2020-12-22') - expect(events[2].start).toEqualDate('2020-12-29') - expect(events[3].start).toEqualDate('2021-01-05') - }) - - it('can exclude recurrences with an exrule', () => { - let calendar = initCalendar({ - initialView: 'dayGridMonth', - now: '2020-12-01', - events: [{ - rrule: { - dtstart: '2020-12-01', - freq: 'weekly', - }, - exrule: { - dtstart: '2020-12-08', - until: '2020-12-15', // will include this date for exclusion - freq: 'weekly', - }, - }], - }) - - let events = calendar.getEvents() - expect(events.length).toBe(4) - expect(events[0].start).toEqualDate('2020-12-01') - expect(events[1].start).toEqualDate('2020-12-22') - expect(events[2].start).toEqualDate('2020-12-29') - expect(events[3].start).toEqualDate('2021-01-05') - }) - - it('can exclude recurrences with multiple exrules', () => { - let calendar = initCalendar({ - initialView: 'dayGridMonth', - now: '2020-12-01', - events: [{ - rrule: { - dtstart: '2020-12-01', - freq: 'weekly', - }, - exrule: [ - { - dtstart: '2020-12-08', - until: '2020-12-15', // will include this date for exclusion - freq: 'weekly', - }, - { - dtstart: '2020-12-22', - until: '2020-12-29', // will include this date for exclusion - freq: 'weekly', - }, - ], - }], - }) - - let events = calendar.getEvents() - expect(events.length).toBe(2) - expect(events[0].start).toEqualDate('2020-12-01') - expect(events[1].start).toEqualDate('2021-01-05') - }) - - it('expands events until a date', () => { - initCalendar({ - events: [ - { - rrule: { - dtstart: '2018-09-04T13:00:00', - until: '2018-10-01', - freq: 'weekly', - }, - }, - ], - }) - let events = getSortedEvents() - expect(events.length).toBe(4) - expect(events[0].start).toEqualDate('2018-09-04T13:00:00Z') - expect(events[0].end).toBe(null) - expect(events[1].start).toEqualDate('2018-09-11T13:00:00Z') - expect(events[2].start).toEqualDate('2018-09-18T13:00:00Z') - expect(events[3].start).toEqualDate('2018-09-25T13:00:00Z') - }) - - it('expands a range that starts exactly at the current view\'s start', () => { - initCalendar({ - initialDate: '2019-04-02', - initialView: 'dayGridDay', - events: [ - { - title: 'event with everyday with range', - allDay: true, - rrule: { - freq: 'daily', - dtstart: '2019-04-02', - until: '2019-04-09', - }, - }, - ], - }) - let events = getSortedEvents() - expect(events.length).toBeGreaterThanOrEqual(1) - expect(events[0].start).toEqualDate('2019-04-02') - }) - - it('expands events with a duration', () => { - initCalendar({ - events: [ - { - rrule: { - dtstart: '2018-09-04T13:00:00', - freq: 'weekly', - }, - duration: '03:00', - }, - ], - }) - let events = getSortedEvents() - expect(events.length).toBe(5) - expect(events[0].start).toEqualDate('2018-09-04T13:00:00Z') - expect(events[0].end).toEqualDate('2018-09-04T16:00:00Z') - }) - - it('expands events with guessed allDay', () => { - initCalendar({ - events: [ - { - rrule: { - dtstart: '2018-09-04', - freq: 'weekly', - }, - }, - ], - }) - let events = getSortedEvents() - expect(events.length).toBe(5) - expect(events[0].start).toEqualDate('2018-09-04') - expect(events[0].end).toBe(null) - expect(events[0].allDay).toBe(true) - }) - - it('inherits defaultAllDay from source', () => { - initCalendar({ - defaultAllDay: false, - events: [ - { - rrule: { - dtstart: parseUtcDate('2018-09-04'), // no allDay info - freq: 'weekly', - }, - }, - ], - }) - let events = getSortedEvents() - expect(events.length).toBe(5) - expect(events[0].start).toEqualDate('2018-09-04') - expect(events[0].end).toBe(null) - expect(events[0].allDay).toBe(false) - }) - - it('inherits defaultAllDay from source setting', () => { - initCalendar({ - eventSources: [{ - defaultAllDay: false, - events: [ - { - rrule: { - dtstart: parseUtcDate('2018-09-04'), // no allDay info - freq: 'weekly', - }, - }, - ], - }], - }) - let events = getSortedEvents() - expect(events.length).toBe(5) - expect(events[0].start).toEqualDate('2018-09-04') - expect(events[0].end).toBe(null) - expect(events[0].allDay).toBe(false) - }) - - it('can generate local dates when given an rrule object', () => { - initCalendar({ - timeZone: 'local', - events: [ - { - rrule: { - dtstart: parseLocalDate('2018-09-04T05:00:00').toISOString(), - freq: 'weekly', - }, - }, - ], - }) - let events = getSortedEvents() - expect(events.length).toBe(5) - expect(events[0].start).toEqualLocalDate('2018-09-04T05:00:00') - expect(events[0].end).toBe(null) - expect(events[0].allDay).toBe(false) - }) - - describe('when given an rrule string', () => { - it('expands', () => { - initCalendar({ - events: [ - { - rrule: - 'DTSTART:20180904T130000\n' + - 'RRULE:FREQ=WEEKLY', - }, - ], - }) - - let events = getSortedEvents() - expect(events.length).toBe(5) - expect(events[0].start).toEqualDate('2018-09-04T13:00:00Z') - expect(events[0].end).toBe(null) - expect(events[1].start).toEqualDate('2018-09-11T13:00:00Z') - expect(events[2].start).toEqualDate('2018-09-18T13:00:00Z') - expect(events[3].start).toEqualDate('2018-09-25T13:00:00Z') - expect(events[4].start).toEqualDate('2018-10-02T13:00:00Z') - }) - - // https://github.com/fullcalendar/fullcalendar/issues/6126 - it('expands correctly with UNTIL followed by newline', () => { - initCalendar({ - events: [ - { - rrule: - 'DTSTART:20180904T130000\n' + - 'RRULE:FREQ=WEEKLY;UNTIL=20180925T130000\n' + - 'RDATE:20180904T130000', - }, - ], - }) - - let events = getSortedEvents() - expect(events.length).toBe(4) - }) - - it('respects allDay', () => { - initCalendar({ - events: [ - { - allDay: true, - rrule: 'DTSTART:20180904T130000\nRRULE:FREQ=WEEKLY', - }, - ], - }) - - let events = getSortedEvents() - expect(events[0].start).toEqualDate('2018-09-04') // should round down - expect(events[0].allDay).toBe(true) - expect(events[0].extendedProps).toEqual({}) // didnt accumulate allDay or rrule props - }) - - it('can expand monthly recurrence in UTC', () => { - initCalendar({ - initialView: 'dayGridMonth', - now: '2018-12-25T12:00:00', - timeZone: 'UTC', - events: [{ - rrule: 'DTSTART:20181101\nRRULE:FREQ=MONTHLY;COUNT=13;BYMONTHDAY=13', - }], - }) - - let events = currentCalendar.getEvents() - expect(events.length).toBe(1) - expect(events[0].start).toEqualDate('2018-12-13') - }) - - it('can expand monthly recurrence in local timeZone', () => { - initCalendar({ - initialView: 'dayGridMonth', - now: '2018-12-25T12:00:00', - timeZone: 'local', - events: [{ - rrule: 'DTSTART:20181101\nRRULE:FREQ=MONTHLY;COUNT=13;BYMONTHDAY=13', - }], - }) - - let events = currentCalendar.getEvents() - expect(events.length).toBe(1) - expect(events[0].start).toEqualLocalDate('2018-12-13') - }) - - it('can expand weekly timed recurrence in local timeZone', () => { - initCalendar({ - initialView: 'dayGridMonth', - now: '2018-12-25T12:00:00', - timeZone: 'local', - events: [{ - rrule: 'DTSTART:20181201T000000\nRRULE:FREQ=WEEKLY', - }], - }) - - let events = currentCalendar.getEvents() - expect(events.length).toBe(6) - expect(events[0].start).toEqualLocalDate('2018-12-01') - }) - - it('can expand weekly UTC-timed recurrence in local timeZone', () => { - initCalendar({ - initialView: 'dayGridMonth', - now: '2018-12-25T12:00:00', - timeZone: 'local', - events: [{ - rrule: 'DTSTART:20181201T000000Z\nRRULE:FREQ=WEEKLY', - }], - }) - - let events = currentCalendar.getEvents() - expect(events.length).toBe(6) - expect(events[0].start).toEqualDate('2018-12-01') - }) - - it('can expand weekly UTC-timed recurrence in local timeZone, with exclusion', () => { - initCalendar({ - initialView: 'dayGridMonth', - now: '2018-12-25T12:00:00', - timeZone: 'local', - events: [{ - rrule: 'DTSTART:20181201T000000Z\nRRULE:FREQ=WEEKLY\nEXDATE:20181208T000000Z', - }], - }) - - let events = currentCalendar.getEvents() - expect(events.length).toBe(5) - expect(events[0].start).toEqualDate('2018-12-01') - }) - - it('can generate local dates', () => { - let localStart = buildLocalRRuleDateStr('2018-09-04T05:00:00') - - initCalendar({ - timeZone: 'local', - events: [ - { - rrule: `DTSTART:${localStart}\nRRULE:FREQ=WEEKLY`, - }, - ], - }) - - let events = getSortedEvents() - expect(events.length).toBe(5) - expect(events[0].start).toEqualLocalDate('2018-09-04T05:00:00') - expect(events[0].end).toBe(null) - expect(events[0].allDay).toBe(false) - }) - - it('can generate local dates, including EXDATE', () => { - let localStart = buildLocalRRuleDateStr('2018-09-04T05:00:00') - let localExdate = buildLocalRRuleDateStr('2018-09-05T05:00:00') - - initCalendar({ - timeZone: 'local', - events: [ - { - rrule: `DTSTART:${localStart}\nRRULE:FREQ=WEEKLY\nEXDATE:${localExdate}`, - }, - ], - }) - let events = getSortedEvents() - expect(events.length).toBe(5) - expect(events[0].start).toEqualLocalDate('2018-09-04T05:00:00') - expect(events[0].end).toBe(null) - expect(events[0].allDay).toBe(false) - }) - - // https://github.com/fullcalendar/fullcalendar/issues/5726 - it('can generate local dates, including EXDATE, when BYDAY and TZ shifting', () => { - initCalendar({ - timeZone: 'local', - initialDate: '2020-09-10', - events: [ - { - rrule: 'DTSTART:20200915T030000Z\nRRULE:FREQ=WEEKLY;BYDAY=SA\nEXDATE:20201003T030000Z', - }, - ], - }) - let events = getSortedEvents() - expect(events.length).toBe(3) - expect(events[0].start).toEqualDate('2020-09-19T03:00:00') - expect(events[1].start).toEqualDate('2020-09-26T03:00:00') - expect(events[2].start).toEqualDate('2020-10-10T03:00:00') - }) - - // https://github.com/fullcalendar/fullcalendar/issues/5993 - it('won\'t accidentally clip dates when calendar has non-UTC timezone', () => { - let calendar = initCalendar({ - plugins: [rrulePlugin, dayGridPlugin, luxonPlugin], - initialDate: '2020-11-01', - timeZone: 'Asia/Manila', - events: [ - { - duration: '01:00', - rrule: { - freq: 'daily', - dtstart: '2020-10-24T16:00:00Z', // will be 00:00 in Manila - }, - }, - ], - }) - - let events = calendar.getEvents() - expect(events[0].start).toEqualDate(calendar.view.activeStart) - }) - - // https://github.com/fullcalendar/fullcalendar/issues/7230 - it('updating the rrule dynamically renders correct number of events', () => { - const recurringEventDef = { - id: '4', - groupId: '4', - allDay: true, - rrule: { - freq: 'weekly', - dtstart: '2023-03-10', - }, - } - - let calendar = initCalendar({ - plugins: [rrulePlugin, dayGridPlugin], - initialDate: '2023-03-10', - initialView: 'dayGridMonth', - events: [recurringEventDef], - }) - - const dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - expect(dayGridWrapper.getEventEls().length).toBe(5) - - calendar.next() - expect(dayGridWrapper.getEventEls().length).toBe(6) - - calendar.resetOptions({ - events: [{ - ...recurringEventDef, - duration: { days: 2 }, - }], - }, ['events']) - expect(dayGridWrapper.getEventEls().length).toBe(6) - }) - }) - - // https://github.com/fullcalendar/fullcalendar/issues/5273 - it('updates rrule timed events when timeZone changes', () => { - const timeTexts = [] - - const calendar = initCalendar({ - plugins: [rrulePlugin, dayGridPlugin, luxonPlugin], - timeZone: 'America/New_York', - initialDate: '2023-02-10', - initialView: 'dayGridMonth', - events: [{ - id: '4', - groupId: '4', - allDay: false, - rrule: { - freq: 'weekly', - dtstart: '2023-02-10T12:00:00', // assumed to be Asia/Chicago - until: '2023-02-11', // only one instance - }, - }], - eventContent(arg) { - timeTexts.push(arg.timeText) - return true - }, - }) - - let events = calendar.getEvents() - expect(events[0].allDay).toBe(false) - expect(events[0].start).toEqualDate('2023-02-10T17:00:00Z') - expect(timeTexts.length).toBe(1) - expect(timeTexts[0]).toBe('12p') - - calendar.setOption('timeZone', 'America/Chicago') - events = calendar.getEvents() - expect(events[0].allDay).toBe(false) - expect(events[0].start).toEqualDate('2023-02-10T17:00:00Z') - expect(timeTexts.length).toBe(2) - expect(timeTexts[1]).toBe('11a') - }) - - // utils - - function buildLocalRRuleDateStr(inputStr) { // produces strings like '20200101123030' - return parseLocalDate(inputStr).toISOString().replace('.000', '').replace(/[-:]/g, '') - } - - function getSortedEvents() { - let events = currentCalendar.getEvents() - - events.sort((eventA, eventB) => eventA.start.valueOf() - eventB.start.valueOf()) - - return events - } -}) diff --git a/fullcalendar-main/tests/src/event-click-hover/eventClick.ts b/fullcalendar-main/tests/src/event-click-hover/eventClick.ts deleted file mode 100644 index d578e4a..0000000 --- a/fullcalendar-main/tests/src/event-click-hover/eventClick.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('eventClick', () => { - pushOptions({ - initialDate: '2018-08-31', - initialView: 'dayGridMonth', - }) - - it('receives correct args', (done) => { - let calendar = initCalendar({ - events: [ - { start: '2018-08-31' }, - ], - eventClick(arg) { - expect(arg.el instanceof HTMLElement).toBe(true) - expect(typeof arg.event).toBe('object') - expect(arg.event.start instanceof Date).toBe(true) - expect(arg.jsEvent instanceof UIEvent).toBe(true) - expect(typeof arg.view).toBe('object') - done() - }, - }) - - let eventEls = new CalendarWrapper(calendar).getEventEls() - - expect(eventEls.length).toBe(1) - $(eventEls[0]).simulate('click') - }) - - it('fires on a background event', (done) => { - let calendar = initCalendar({ - events: [ - { start: '2018-08-31', display: 'background' }, - ], - eventClick(arg) { - expect(arg.event.display).toBe('background') - done() - }, - }) - - let bgEventEls = new CalendarWrapper(calendar).getBgEventEls() - - expect(bgEventEls.length).toBe(1) - $(bgEventEls[0]).simulate('click') - }) - - it('works via touch', (done) => { - let calendar = initCalendar({ - events: [ - { start: '2018-08-31' }, - ], - eventClick() { - done() - }, - }) - - let eventEls = new CalendarWrapper(calendar).getEventEls() - - expect(eventEls.length).toBe(1) - $(eventEls[0]).simulate('click') - }) -}) diff --git a/fullcalendar-main/tests/src/event-data/Calendar.addEvent.ts b/fullcalendar-main/tests/src/event-data/Calendar.addEvent.ts deleted file mode 100644 index 347a634..0000000 --- a/fullcalendar-main/tests/src/event-data/Calendar.addEvent.ts +++ /dev/null @@ -1,87 +0,0 @@ -describe('addEvent', () => { - pushOptions({ - initialDate: '2018-09-07', - }) - - it('will re-add an event that was previously removed', () => { - initCalendar({ - events: [ - { id: 'a', start: '2018-09-07' }, - ], - }) - let event = currentCalendar.getEventById('a') - expect(currentCalendar.getEvents().length).toBe(1) - event.remove() - expect(currentCalendar.getEvents().length).toBe(0) - let newEvent = currentCalendar.addEvent(event) - expect(currentCalendar.getEvents().length).toBe(1) - expect(newEvent).toBe(event) - }) - - it('won\'t double-add an event that was previously added', () => { - initCalendar({ - events: [ - { id: 'a', start: '2018-09-07' }, - ], - }) - let event = currentCalendar.getEventById('a') - expect(currentCalendar.getEvents().length).toBe(1) - let newEvent = currentCalendar.addEvent(event) - expect(currentCalendar.getEvents().length).toBe(1) - expect(newEvent).toBe(event) - }) - - it('will accept a string source ID', () => { - initCalendar({ - eventSources: [ - { - id: '9', - color: 'purple', - events: [ - { id: 'a', start: '2018-09-07' }, - ], - }, - ], - }) - - let theSource = currentCalendar.getEventSourceById('9') - let newEvent = currentCalendar.addEvent({ id: 'b', start: '2018-09-10' }, '9') - expect(newEvent.source.id === theSource.id) - }) - - it('will accept a number source ID', () => { - initCalendar({ - eventSources: [ - { - id: '9', - color: 'purple', - events: [ - { id: 'a', start: '2018-09-07' }, - ], - }, - ], - }) - - let theSource = currentCalendar.getEventSourceById('9') - let newEvent = currentCalendar.addEvent({ id: 'b', start: '2018-09-10' }, '9') - expect(newEvent.source.id === theSource.id) - }) - - it('will accept an object source', () => { - initCalendar({ - eventSources: [ - { - id: '9', - color: 'purple', - events: [ - { id: 'a', start: '2018-09-07' }, - ], - }, - ], - }) - - let theSource = currentCalendar.getEventSourceById('9') - let newEvent = currentCalendar.addEvent({ id: 'b', start: '2018-09-10' }, theSource) - expect(newEvent.source.id === theSource.id) - }) -}) diff --git a/fullcalendar-main/tests/src/event-data/Event.formatRange.ts b/fullcalendar-main/tests/src/event-data/Event.formatRange.ts deleted file mode 100644 index 42d2d0a..0000000 --- a/fullcalendar-main/tests/src/event-data/Event.formatRange.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { FormatterInput } from '@fullcalendar/core' - -describe('Event::formatRange', () => { - pushOptions({ - timeZone: 'America/New_York', // for forced timezone offsets - locale: 'en', - }) - - const FORMAT_SETTINGS: FormatterInput = { - month: 'long', - day: 'numeric', - year: 'numeric', - timeZoneName: 'short', - separator: ' to ', - omitCommas: true, // for cross-browser - } - - describe('when event has an end', () => { - pushOptions({ - events: [ - { start: '2018-09-04T12:00:00-05:00', end: '2018-09-05T12:00:00-05:00' }, - ], - }) - - it('formats start and end', () => { - initCalendar() - let event = currentCalendar.getEvents()[0] - let str = event.formatRange(FORMAT_SETTINGS) - expect(str.replace(' at ', ' ')) - .toBe('September 4 to 5 2018 12:00 PM GMT-5') - }) - }) - - describe('when event has NO end', () => { - pushOptions({ - events: [ - { start: '2018-09-04T12:00:00-05:00' }, - ], - }) - - it('formats start', () => { - initCalendar() - let event = currentCalendar.getEvents()[0] - let str = event.formatRange(FORMAT_SETTINGS) - expect(str.replace(' at ', ' ')) - .toBe('September 4 2018 12:00 PM GMT-5') - }) - }) -}) diff --git a/fullcalendar-main/tests/src/event-data/Event.moveDates.ts b/fullcalendar-main/tests/src/event-data/Event.moveDates.ts deleted file mode 100644 index e8e401f..0000000 --- a/fullcalendar-main/tests/src/event-data/Event.moveDates.ts +++ /dev/null @@ -1,67 +0,0 @@ -describe('Event::moveDates', () => { - pushOptions({ - timeZone: 'UTC', - }) - - describe('when event doesn\'t have an end', () => { - it('moves start and keeps end null', () => { - initCalendar({ - events: [ - { id: '1', start: '2018-09-03T00:00:00' }, - ], - }) - let event = currentCalendar.getEventById('1') - event.moveDates({ days: 1, hours: 1 }) - expect(event.start).toEqualDate('2018-09-04T01:00:00Z') - expect(event.end).toBe(null) - }) - }) - - describe('when event does have an end', () => { - it('moves start and end by same delta', () => { - initCalendar({ - events: [ - { id: '1', start: '2018-09-03T00:00:00', end: '2018-09-04T12:00:00' }, - ], - }) - let event = currentCalendar.getEventById('1') - event.moveDates({ days: 1, hours: 1 }) - expect(event.start).toEqualDate('2018-09-04T01:00:00Z') - expect(event.end).toEqualDate('2018-09-05T13:00:00Z') - }) - }) - - it('moves related events of different duration by same delta', () => { - initCalendar({ - events: [ - { id: '1', groupId: 'a', start: '2018-09-03T00:00:00', end: '2018-09-04T12:00:00' }, - { id: '2', groupId: 'a', start: '2018-10-03T00:00:00', end: '2018-10-04T12:00:00' }, - ], - }) - let event1 = currentCalendar.getEventById('1') - event1.moveDates({ days: 1, hours: 1 }) - expect(event1.start).toEqualDate('2018-09-04T01:00:00Z') - expect(event1.end).toEqualDate('2018-09-05T13:00:00Z') - - let event2 = currentCalendar.getEventById('2') - expect(event2.start).toEqualDate('2018-10-04T01:00:00Z') - expect(event2.end).toEqualDate('2018-10-05T13:00:00Z') - }) - - it('does not move unrelated events', () => { - initCalendar({ - events: [ - { id: '1', groupId: 'a', start: '2018-09-03T00:00:00', end: '2018-09-04T12:00:00' }, - { id: '2', groupId: 'bbb', start: '2018-10-03T00:00:00', end: '2018-10-04T12:00:00' }, - ], - }) - let event1 = currentCalendar.getEventById('1') - event1.moveDates({ days: 1, hours: 1 }) - expect(event1.start).toEqualDate('2018-09-04T01:00:00Z') - expect(event1.end).toEqualDate('2018-09-05T13:00:00Z') - - let event2 = currentCalendar.getEventById('2') - expect(event2.start).toEqualDate('2018-10-03T00:00:00Z') // same - expect(event2.end).toEqualDate('2018-10-04T12:00:00Z') // same - }) -}) diff --git a/fullcalendar-main/tests/src/event-data/Event.moveEnd.ts b/fullcalendar-main/tests/src/event-data/Event.moveEnd.ts deleted file mode 100644 index 5908307..0000000 --- a/fullcalendar-main/tests/src/event-data/Event.moveEnd.ts +++ /dev/null @@ -1,38 +0,0 @@ -describe('Event::moveEnd', () => { - pushOptions({ - timeZone: 'UTC', - defaultTimedEventDuration: '01:00', - }) - - describe('when event doesn\'t have an end', () => { - pushOptions({ - events: [ - { id: '1', start: '2018-09-03T12:00:00' }, - ], - }) - - it('generates a new end', () => { - initCalendar() - let event = currentCalendar.getEventById('1') - event.moveEnd('01:00') - expect(event.start).toEqualDate('2018-09-03T12:00:00Z') - expect(event.end).toEqualDate('2018-09-03T14:00:00Z') - }) - }) - - describe('when event does have an end', () => { - pushOptions({ - events: [ - { id: '1', start: '2018-09-03T12:00:00', end: '2018-09-03T15:00:00' }, - ], - }) - - it('moves end', () => { - initCalendar() - let event = currentCalendar.getEventById('1') - event.moveEnd('01:00') - expect(event.start).toEqualDate('2018-09-03T12:00:00Z') - expect(event.end).toEqualDate('2018-09-03T16:00:00Z') - }) - }) -}) diff --git a/fullcalendar-main/tests/src/event-data/Event.moveStart.ts b/fullcalendar-main/tests/src/event-data/Event.moveStart.ts deleted file mode 100644 index 0d58d08..0000000 --- a/fullcalendar-main/tests/src/event-data/Event.moveStart.ts +++ /dev/null @@ -1,54 +0,0 @@ -describe('Event::moveStart', () => { - pushOptions({ - timeZone: 'UTC', - defaultTimedEventDuration: '01:00', - }) - - describe('when event doesn\'t have an end', () => { - pushOptions({ - events: [ - { id: '1', start: '2018-09-03T12:00:00' }, - ], - }) - - it('moves start and generates an end', () => { - initCalendar() - let event = currentCalendar.getEventById('1') - event.moveStart({ hours: -5 }) - expect(event.start).toEqualDate('2018-09-03T07:00:00Z') - expect(event.end).toEqualDate('2018-09-03T13:00:00Z') - }) - }) - - describe('when event does have an end', () => { - pushOptions({ - events: [ - { id: '1', start: '2018-09-03T12:00:00', end: '2018-09-03T15:00:00' }, - ], - }) - - it('moves start and keeps end', () => { - initCalendar() - let event = currentCalendar.getEventById('1') - event.moveStart({ hours: -5 }) - expect(event.start).toEqualDate('2018-09-03T07:00:00Z') - expect(event.end).toEqualDate('2018-09-03T15:00:00Z') - }) - }) - - describe('when moving start past end', () => { - pushOptions({ - events: [ - { id: '1', start: '2018-09-03T12:00:00', end: '2018-09-03T15:00:00' }, - ], - }) - - it('resets end to reflect default duration', () => { - initCalendar() - let event = currentCalendar.getEventById('1') - event.moveStart({ days: 1 }) - expect(event.start).toEqualDate('2018-09-04T12:00:00Z') - expect(event.end).toEqualDate('2018-09-04T13:00:00Z') - }) - }) -}) diff --git a/fullcalendar-main/tests/src/event-data/Event.mutation.ts b/fullcalendar-main/tests/src/event-data/Event.mutation.ts deleted file mode 100644 index b80af2e..0000000 --- a/fullcalendar-main/tests/src/event-data/Event.mutation.ts +++ /dev/null @@ -1,34 +0,0 @@ -describe('event mutations on non-instances', () => { - pushOptions({ - initialView: 'dayGridWeek', - now: '2018-09-03', - events: [ - { id: '1', start: '2018-09-04', display: 'inverse-background' }, // will make two segs - ], - }) - - describe('with date mutating', () => { - it('doesn\'t do anything', () => { - let renderCnt = 0 - let calendar = initCalendar({ - eventContent(arg) { - renderCnt += 1 - if (renderCnt === 2) { - arg.event.setStart('2018-08-04') - arg.event.setEnd('2018-10-04') - arg.event.setDates('2018-08-04', '2018-10-04') - } - }, - }) - - expect(renderCnt).toBe(2) - - let event = calendar.getEventById('1') - expect(event.start).toEqualDate('2018-09-04') - expect(event.end).toBe(null) - expect(event.allDay).toBe(true) - }) - }) - - // TODO: test for non-instances to have other props and extended props modified -}) diff --git a/fullcalendar-main/tests/src/event-data/Event.setAllDay.ts b/fullcalendar-main/tests/src/event-data/Event.setAllDay.ts deleted file mode 100644 index 9665bc8..0000000 --- a/fullcalendar-main/tests/src/event-data/Event.setAllDay.ts +++ /dev/null @@ -1,111 +0,0 @@ -describe('Event::setAllDay', () => { - describe('when setting from all-day to all-day', () => { - it('causes no change', () => { - initCalendar({ - events: [ - { id: '1', start: '2018-09-03', end: '2018-09-05', allDay: true }, - ], - }) - let event = currentCalendar.getEventById('1') - event.setAllDay(true) - expect(event.start).toEqualDate('2018-09-03') - expect(event.end).toEqualDate('2018-09-05') - expect(event.allDay).toBe(true) - }) - }) - - describe('when setting from timed to timed', () => { - it('causes no change', () => { - initCalendar({ - events: [ - { id: '1', start: '2018-09-03T09:00:00', end: '2018-09-05T09:00:00', allDay: false }, - ], - }) - let event = currentCalendar.getEventById('1') - event.setAllDay(false) - expect(event.start).toEqualDate('2018-09-03T09:00:00Z') - expect(event.end).toEqualDate('2018-09-05T09:00:00Z') - expect(event.allDay).toBe(false) - }) - }) - - describe('when setting from all-day to timed', () => { - describe('when not maintaining duration', () => { - it('removes the end', () => { - initCalendar({ - events: [ - { id: '1', start: '2018-09-03', end: '2018-09-05', allDay: true }, - ], - }) - let event = currentCalendar.getEventById('1') - event.setAllDay(false) - expect(event.start).toEqualDate('2018-09-03') - expect(event.end).toBe(null) - expect(event.allDay).toBe(false) - }) - }) - - describe('when maintaining duration', () => { - it('keeps exact duration', () => { - initCalendar({ - events: [ - { id: '1', start: '2018-09-03', end: '2018-09-05', allDay: true }, - ], - }) - let event = currentCalendar.getEventById('1') - event.setAllDay(false, { maintainDuration: true }) - expect(event.start).toEqualDate('2018-09-03') - expect(event.end).toEqualDate('2018-09-05') - expect(event.allDay).toBe(false) - }) - }) - }) - - describe('when setting from timed to all-day', () => { - describe('when not maintaining duration', () => { - it('removes the end', () => { - initCalendar({ - events: [ - { id: '1', start: '2018-09-03T09:00:00', end: '2018-09-05T09:00:00', allDay: false }, - ], - }) - let event = currentCalendar.getEventById('1') - event.setAllDay(true) - expect(event.start).toEqualDate('2018-09-03') - expect(event.end).toBe(null) - expect(event.allDay).toBe(true) - }) - }) - - describe('when maintaining duration', () => { - it('rounds the end down to the prev whole day', () => { - initCalendar({ - events: [ - { id: '1', start: '2018-09-03T09:00:00', end: '2018-09-05T10:00:00', allDay: false }, - ], - }) - let event = currentCalendar.getEventById('1') - event.setAllDay(true, { maintainDuration: true }) - expect(event.start).toEqualDate('2018-09-03') - expect(event.end).toEqualDate('2018-09-05') - expect(event.allDay).toBe(true) - }) - }) - - describe('when maintaining duration (from calendar setting)', () => { - it('rounds the end to the next whole day', () => { - initCalendar({ - allDayMaintainDuration: true, - events: [ - { id: '1', start: '2018-09-03T09:00:00', end: '2018-09-05T10:00:00', allDay: false }, - ], - }) - let event = currentCalendar.getEventById('1') - event.setAllDay(true) - expect(event.start).toEqualDate('2018-09-03') - expect(event.end).toEqualDate('2018-09-05') - expect(event.allDay).toBe(true) - }) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/event-data/Event.setDates.ts b/fullcalendar-main/tests/src/event-data/Event.setDates.ts deleted file mode 100644 index fd9f2c1..0000000 --- a/fullcalendar-main/tests/src/event-data/Event.setDates.ts +++ /dev/null @@ -1,109 +0,0 @@ -describe('Event::setDates', () => { - pushOptions({ - now: '2018-09-03', - timeZone: 'UTC', - defaultTimedEventDuration: '01:00', - events: [ - { id: '1', start: '2018-09-05T12:00:00' }, - ], - }) - - describe('when setting different start', () => { - it('changes start and gives it an end', () => { - initCalendar() - let event = currentCalendar.getEventById('1') - event.setDates('2018-09-05T14:00:00', '2018-09-05T16:00:00') - expect(event.start).toEqualDate('2018-09-05T14:00:00Z') - expect(event.end).toEqualDate('2018-09-05T16:00:00Z') - }) - }) - - describe('when setting same start and end', () => { - it('changes nothing and end remains null', () => { - initCalendar() - let event = currentCalendar.getEventById('1') - event.setDates('2018-09-05T12:00:00', '2018-09-05T13:00:00') - expect(event.start).toEqualDate('2018-09-05T12:00:00Z') - expect(event.end).toBe(null) - }) - }) - - describe('when setting different end', () => { - it('changes end and gives it an end', () => { - initCalendar() - let event = currentCalendar.getEventById('1') - event.setDates('2018-09-05T12:00:00', '2018-09-05T18:00:00') - expect(event.start).toEqualDate('2018-09-05T12:00:00Z') - expect(event.end).toEqualDate('2018-09-05T18:00:00Z') - }) - }) - - describe('when setting different start AND end', () => { - describe('if duration is effectively the same', () => { - it('changes start and leaves end null', () => { - initCalendar() - let event = currentCalendar.getEventById('1') - event.setDates('2018-09-06T01:00:00', '2018-09-06T02:00:00') - expect(event.start).toEqualDate('2018-09-06T01:00:00Z') - expect(event.end).toBe(null) - }) - }) - }) - - describe('when called with a null end', () => { - pushOptions({ - events: [ - { id: '1', start: '2018-09-05T12:00:00', end: '2018-09-05T14:00:00' }, - ], - }) - - it('clears the end', () => { - initCalendar() - let event = currentCalendar.getEventById('1') - event.setDates('2018-09-06T01:00:00', null) - expect(event.start).toEqualDate('2018-09-06T01:00:00Z') - expect(event.end).toBe(null) - }) - }) - - it('can set allDay to true', () => { - initCalendar() // { id: '1', start: '2018-09-05T12:00:00' } - let event = currentCalendar.getEventById('1') - event.setDates('2018-09-06', '2018-09-10', { allDay: true }) - expect(event.start).toEqualDate('2018-09-06') - expect(event.end).toEqualDate('2018-09-10') - expect(event.allDay).toBe(true) - }) - - it('can set allDay to false', () => { - initCalendar({ - events: [ - { id: '1', start: '2018-09-05', end: '2018-09-08' }, - ], - }) - - let event = currentCalendar.getEventById('1') - event.setDates('2018-09-06T10:00:00', '2018-09-10T02:00:00', { allDay: false }) - expect(event.start).toEqualDate('2018-09-06T10:00:00Z') - expect(event.end).toEqualDate('2018-09-10T02:00:00Z') - expect(event.allDay).toBe(false) - }) - - it('shortens related events of different duration by same delta', () => { - initCalendar({ - events: [ - { id: '1', groupId: 'a', start: '2018-09-03', end: '2018-09-05' }, - { id: '2', groupId: 'a', start: '2018-09-13', end: '2018-09-15' }, - ], - }) - - let event1 = currentCalendar.getEventById('1') - event1.setDates('2018-09-02', '2018-09-06') // start back by 1, end ahead by 1 - expect(event1.start).toEqualDate('2018-09-02') - expect(event1.end).toEqualDate('2018-09-06') - - let event2 = currentCalendar.getEventById('2') - expect(event2.start).toEqualDate('2018-09-12') - expect(event2.end).toEqualDate('2018-09-16') - }) -}) diff --git a/fullcalendar-main/tests/src/event-data/Event.setEnd.ts b/fullcalendar-main/tests/src/event-data/Event.setEnd.ts deleted file mode 100644 index d07f5b6..0000000 --- a/fullcalendar-main/tests/src/event-data/Event.setEnd.ts +++ /dev/null @@ -1,57 +0,0 @@ -describe('Event::setEnd', () => { - pushOptions({ - now: '2018-09-03', - timeZone: 'UTC', - defaultTimedEventDuration: '01:00', - }) - - describe('when event doesn\'t have an end', () => { - pushOptions({ - events: [ - { id: '1', start: '2018-09-10T00:00:00' }, - ], - }) - - it('sets end and keeps start', () => { - initCalendar() - let event = currentCalendar.getEventById('1') - event.setEnd('2018-09-12T02:00:00') - expect(event.start).toEqualDate('2018-09-10T00:00:00Z') - expect(event.end).toEqualDate('2018-09-12T02:00:00Z') - }) - }) - - describe('when event does have an end', () => { - pushOptions({ - events: [ - { id: '1', start: '2018-09-10T00:00:00', end: '2018-09-11T00:00:00' }, - ], - }) - - it('changes end and keeps start', () => { - initCalendar() - let event = currentCalendar.getEventById('1') - event.setEnd('2018-09-12T02:00:00') - expect(event.start).toEqualDate('2018-09-10T00:00:00Z') - expect(event.end).toEqualDate('2018-09-12T02:00:00Z') - }) - }) - - it('shortens related events of different duration by same delta', () => { - initCalendar({ - events: [ - { id: '1', groupId: 'a', start: '2018-09-10T00:00:00', end: '2018-09-11T00:00:00' }, - { id: '2', groupId: 'a', start: '2018-09-14T00:00:00', end: '2018-09-16T00:00:00' }, - ], - }) - - let event1 = currentCalendar.getEventById('1') - event1.setEnd('2018-09-12T02:00:00') // move end forward by 1 day, 2 hours - expect(event1.start).toEqualDate('2018-09-10T00:00:00Z') - expect(event1.end).toEqualDate('2018-09-12T02:00:00Z') - - let event2 = currentCalendar.getEventById('2') - expect(event2.start).toEqualDate('2018-09-14T00:00:00Z') - expect(event2.end).toEqualDate('2018-09-17T02:00:00Z') - }) -}) diff --git a/fullcalendar-main/tests/src/event-data/Event.setProp.ts b/fullcalendar-main/tests/src/event-data/Event.setProp.ts deleted file mode 100644 index 7a71ea6..0000000 --- a/fullcalendar-main/tests/src/event-data/Event.setProp.ts +++ /dev/null @@ -1,21 +0,0 @@ -describe('Event::setProps', () => { - it('allows setting id', () => { - const calendar = initCalendar({ - events: [ - { id: '123', start: '2021-01-01' }, - ], - }) - - let events = calendar.getEvents() - let event = events[0] - - expect(event.id).toBe('123') - - event.setProp('id', '456') - expect(event.id).toBe('456') - - events = calendar.getEvents() - event = events[0] - expect(event.id).toBe('456') - }) -}) diff --git a/fullcalendar-main/tests/src/event-data/Event.setStart.ts b/fullcalendar-main/tests/src/event-data/Event.setStart.ts deleted file mode 100644 index 678e8f5..0000000 --- a/fullcalendar-main/tests/src/event-data/Event.setStart.ts +++ /dev/null @@ -1,129 +0,0 @@ -describe('Event::setStart', () => { - pushOptions({ - now: '2018-09-03', - timeZone: 'UTC', - defaultTimedEventDuration: '01:00', - }) - - describe('when event doesn\'t have an end', () => { - pushOptions({ - events: [ - { id: '1', start: '2018-09-05T00:00:00' }, - ], - }) - - describe('when not maintaining duration', () => { - it('moves start and gives event an end', () => { - initCalendar() - let event = currentCalendar.getEventById('1') - event.setStart('2018-09-01') - expect(event.start).toEqualDate('2018-09-01T00:00:00Z') - expect(event.end).toEqualDate('2018-09-05T01:00:00Z') - }) - }) - - describe('when maintaining duration', () => { - it('moves start and keeps no end', () => { - initCalendar() - let event = currentCalendar.getEventById('1') - event.setStart('2018-09-01', { maintainDuration: true }) - expect(event.start).toEqualDate('2018-09-01') - expect(event.end).toBe(null) - }) - }) - - it('can revert', () => { - let revertCalled = false - let calendar = initCalendar({ - eventChange(info) { - revertCalled = true - info.revert() - }, - }) - - let event = calendar.getEventById('1') - event.setStart('2018-09-01') // will be immediately undone - expect(revertCalled).toBe(true) - - let events = calendar.getEvents() - expect(events.length).toBe(1) - expect(events[0].start).toEqualDate('2018-09-05T00:00:00') - }) - }) - - describe('when event does have an end', () => { - pushOptions({ - events: [ - { id: '1', start: '2018-09-05T00:00:00', end: '2018-09-07T00:00:00' }, - ], - }) - - describe('when not maintaining duration', () => { - it('moves start and keeps the same end', () => { - initCalendar() - let event = currentCalendar.getEventById('1') - event.setStart('2018-09-01') - expect(event.start).toEqualDate('2018-09-01') - expect(event.end).toEqualDate('2018-09-07') - }) - }) - - describe('when maintaining duration', () => { - it('move start and keeps the end', () => { - initCalendar() - let event = currentCalendar.getEventById('1') - event.setStart('2018-09-01', { maintainDuration: true }) - expect(event.start).toEqualDate('2018-09-01') - expect(event.end).toEqualDate('2018-09-03') - }) - }) - }) - - describe('when event is all-day', () => { - pushOptions({ - events: [ - { id: '1', start: '2018-09-05', end: '2018-09-07', allDay: true }, - ], - }) - - describe('when setting start to another all-day', () => { - it('moves start', () => { - initCalendar() - let event = currentCalendar.getEventById('1') - event.setStart('2018-09-01') - expect(event.start).toEqualDate('2018-09-01') - expect(event.end).toEqualDate('2018-09-07') - expect(event.allDay).toBe(true) - }) - }) - - describe('when setting start to timed', () => { - it('moves start to rounded-down start-of-day', () => { - initCalendar() - let event = currentCalendar.getEventById('1') - event.setStart('2018-09-01T23:00:00') - expect(event.start).toEqualDate('2018-09-01') - expect(event.end).toEqualDate('2018-09-07') - expect(event.allDay).toBe(true) - }) - }) - }) - - it('shortens related events of different duration by same delta', () => { - initCalendar({ - events: [ - { id: '1', groupId: 'a', start: '2018-09-05T00:00:00', end: '2018-09-10T00:00:00' }, - { id: '2', groupId: 'a', start: '2018-09-06T00:00:00', end: '2018-09-09T00:00:00' }, - ], - }) - - let event1 = currentCalendar.getEventById('1') - event1.setStart('2018-09-01') // move start back by 4 days - expect(event1.start).toEqualDate('2018-09-01') - expect(event1.end).toEqualDate('2018-09-10') - - let event2 = currentCalendar.getEventById('2') - expect(event2.start).toEqualDate('2018-09-02') - expect(event2.end).toEqualDate('2018-09-09') - }) -}) diff --git a/fullcalendar-main/tests/src/event-data/Event.source.ts b/fullcalendar-main/tests/src/event-data/Event.source.ts deleted file mode 100644 index 83d5ac8..0000000 --- a/fullcalendar-main/tests/src/event-data/Event.source.ts +++ /dev/null @@ -1,23 +0,0 @@ -describe('Event::source', () => { - it('returns the correct source', () => { - initCalendar({ - eventSources: [{ - id: 'sourceA', - events: [ - { id: 'eventA', start: '2018-09-07' }, - ], - }], - }) - let event = currentCalendar.getEventById('eventA') - let source = event.source - expect(source.id).toBe('sourceA') - }) - - it('returns null for events with no source', () => { - initCalendar() - currentCalendar.addEvent({ id: 'eventA', start: '2018-09-07' }) - let event = currentCalendar.getEventById('eventA') - let source = event.source - expect(source).toBe(null) - }) -}) diff --git a/fullcalendar-main/tests/src/event-data/EventObject-parsing.ts b/fullcalendar-main/tests/src/event-data/EventObject-parsing.ts deleted file mode 100644 index 3bf6c96..0000000 --- a/fullcalendar-main/tests/src/event-data/EventObject-parsing.ts +++ /dev/null @@ -1,50 +0,0 @@ -describe('Event Object parsing', () => { - it('records _id as an extended prop', () => { - initCalendar({ - initialDate: '2017-09-05', - initialView: 'dayGridMonth', - events: [ - { _id: 'a', start: '2017-09-05' }, - ], - }) - - let events = currentCalendar.getEvents() - expect(events[0].extendedProps._id).toBe('a') - }) - - it('parses an all-day event with timed same-day start/end', () => { - initCalendar({ - initialView: 'dayGridMonth', - initialDate: '2017-11-01', - timeZone: 'local', - events: [ - { - title: 'All Day with time', - allDay: true, - start: new Date(2017, 10, 1, 10, 0, 0), - end: new Date(2017, 10, 1, 18, 0, 0), // same-day. will result in null - }, - ], - }) - - let events = currentCalendar.getEvents() - expect(events.length).toBe(1) - expect(events[0].start).toEqualLocalDate('2017-11-01T00:00:00') - expect(events[0].end).toBe(null) - }) - - xit('won\'t accept two events with the same ID', () => { - initCalendar({ - initialView: 'dayGridDay', - initialDate: '2018-01-01', - events: [ - { id: '1', start: '2018-01-01', title: 'cool' }, - { id: '1', start: '2018-01-01' }, - ], - }) - - let events = currentCalendar.getEvents() - expect(events.length).toBe(1) - expect(events[0].title).toBe('cool') - }) -}) diff --git a/fullcalendar-main/tests/src/event-data/dynamic-options.ts b/fullcalendar-main/tests/src/event-data/dynamic-options.ts deleted file mode 100644 index 68e06f8..0000000 --- a/fullcalendar-main/tests/src/event-data/dynamic-options.ts +++ /dev/null @@ -1,22 +0,0 @@ -describe('setting option dynamically', () => { - it('does not cause refetch of events', (done) => { - let fetchCnt = 0 - - initCalendar({ - initialView: 'dayGridMonth', - events(arg, callback) { - fetchCnt += 1 - callback([]) - }, - }) - - expect(fetchCnt).toBe(1) - - currentCalendar.setOption('selectable', true) - - setTimeout(() => { // in case async - expect(fetchCnt).toBe(1) - done() - }, 0) - }) -}) diff --git a/fullcalendar-main/tests/src/event-data/eventDataTransform.ts b/fullcalendar-main/tests/src/event-data/eventDataTransform.ts deleted file mode 100644 index 604e308..0000000 --- a/fullcalendar-main/tests/src/event-data/eventDataTransform.ts +++ /dev/null @@ -1,30 +0,0 @@ -describe('eventDataTransform', () => { - let transform = (raw) => ( - $.extend({}, raw, { - was_processed: true, - }) - ) - - describeOptions({ - 'when on the calendar': { - events: [ - { start: '2017-10-23' }, - ], - eventDataTransform: transform, - }, - 'when on an event source': { - eventSources: [{ - events: [ - { start: '2017-10-23' }, - ], - eventDataTransform: transform, - }], - }, - }, () => { - it('affects parsing of the event', () => { - initCalendar() - let eventObj = currentCalendar.getEvents()[0] - expect(eventObj.extendedProps.was_processed).toBe(true) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/event-data/events-function.ts b/fullcalendar-main/tests/src/event-data/events-function.ts deleted file mode 100644 index 1f51f03..0000000 --- a/fullcalendar-main/tests/src/event-data/events-function.ts +++ /dev/null @@ -1,123 +0,0 @@ -describe('events as a function', () => { - pushOptions({ - timeZone: 'UTC', - }) - - it('requests the correct dates when days at the start/end of the month are hidden', (done) => { - initCalendar({ - initialView: 'dayGridMonth', - initialDate: '2013-06-01', // June 2013 has first day as Saturday, and last as Sunday! - weekends: false, - fixedWeekCount: false, - events(arg, callback) { - expect(arg.start).toEqualDate('2013-06-03T00:00:00Z') - expect(arg.end).toEqualDate('2013-06-29T00:00:00Z') - expect(arg.timeZone).toBe('UTC') - expect(typeof callback).toBe('function') - done() - }, - }) - }) - - it('does not request dates excluded by showNonCurrentDates:false', (done) => { - initCalendar({ - initialView: 'dayGridMonth', - initialDate: '2013-06-01', - showNonCurrentDates: false, - events(arg) { - expect(arg.start).toEqualDate('2013-06-01T00:00:00Z') - expect(arg.end).toEqualDate('2013-07-01T00:00:00Z') - done() - }, - }) - }) - - it('requests a timed range when slotMinTime is negative', (done) => { - initCalendar({ - initialView: 'timeGridWeek', - initialDate: '2017-06-08', - slotMinTime: { hours: -2 }, - events(arg) { - expect(arg.start).toEqualDate('2017-06-03T22:00:00Z') - expect(arg.end).toEqualDate('2017-06-11T00:00:00Z') - done() - }, - }) - }) - - it('requests a timed range when slotMaxTime exceeds 24 hours', (done) => { - initCalendar({ - initialView: 'timeGridWeek', - initialDate: '2017-06-08', - slotMaxTime: '26:00', - events(arg) { - expect(arg.start).toEqualDate('2017-06-04T00:00:00Z') - expect(arg.end).toEqualDate('2017-06-11T02:00:00Z') - done() - }, - }) - }) - - it('calls loading callback', (done) => { - let loadingCallArgs = [] - - initCalendar({ - loading(bool) { - loadingCallArgs.push(bool) - }, - events(arg, callback) { - setTimeout(() => { - expect(loadingCallArgs).toEqual([true]) - callback([]) - setTimeout(() => { - expect(loadingCallArgs).toEqual([true, false]) - done() - }, 0) - }, 0) - }, - }) - }) - - it('calls loading callback only once for multiple sources', (done) => { - let loadingCallArgs = [] - - initCalendar({ - loading(bool) { - loadingCallArgs.push(bool) - }, - eventSources: [ - (arg, callback) => { - setTimeout(() => { - callback([]) - }, 0) - }, - (arg, callback) => { - setTimeout(() => { - callback([]) - }, 10) - }, - ], - }) - - setTimeout(() => { - expect(loadingCallArgs).toEqual([true, false]) - done() - }, 20) - }) - - it('can call failure callback with error', () => { - let calledFailure = false - - initCalendar({ - events(arg, successCallback, failureCallback) { - failureCallback(new Error()) - }, - eventSourceFailure(error) { - calledFailure = true - expect(error instanceof Error).toBe(true) - }, - }) - - expect(calledFailure).toBe(true) - }) -}) diff --git a/fullcalendar-main/tests/src/event-data/lazyFetching.ts b/fullcalendar-main/tests/src/event-data/lazyFetching.ts deleted file mode 100644 index 46fe917..0000000 --- a/fullcalendar-main/tests/src/event-data/lazyFetching.ts +++ /dev/null @@ -1,77 +0,0 @@ -describe('lazyFetching', () => { - pushOptions({ - timeZone: 'UTC', - initialView: 'dayGridMonth', - initialDate: '2017-10-04', - }) - - describe('when on', () => { - pushOptions({ - lazyFetching: true, - }) - - it('won\'t fetch weeks already queried', () => { - let options = { - events(fetchInfo, callback) { - callback([]) - }, - } - spyOn(options, 'events').and.callThrough() - - initCalendar(options) - currentCalendar.changeView('timeGridWeek') - currentCalendar.next() - currentCalendar.next() - currentCalendar.next() - - expect(options.events.calls.count()).toBe(1) - - let arg = options.events.calls.argsFor(0)[0] - expect(arg.start).toEqualDate('2017-10-01T00:00:00Z') - expect(arg.end).toEqualDate('2017-11-12T00:00:00Z') - }) - }) - - describe('when off', () => { - pushOptions({ - lazyFetching: false, - }) - - it('will fetch each new week range', () => { - let options = { - events(fetchInfo, callback) { - callback([]) - }, - } - spyOn(options, 'events') - - initCalendar(options) - currentCalendar.changeView('timeGridWeek') - currentCalendar.next() - currentCalendar.next() - currentCalendar.next() - - expect(options.events.calls.count()).toBe(5) - - let arg = options.events.calls.argsFor(0)[0] - expect(arg.start).toEqualDate('2017-10-01T00:00:00Z') - expect(arg.end).toEqualDate('2017-11-12T00:00:00Z') - - arg = options.events.calls.argsFor(1)[0] - expect(arg.start).toEqualDate('2017-10-01T00:00:00Z') - expect(arg.end).toEqualDate('2017-10-08T00:00:00Z') - - arg = options.events.calls.argsFor(2)[0] - expect(arg.start).toEqualDate('2017-10-08T00:00:00Z') - expect(arg.end).toEqualDate('2017-10-15T00:00:00Z') - - arg = options.events.calls.argsFor(3)[0] - expect(arg.start).toEqualDate('2017-10-15T00:00:00Z') - expect(arg.end).toEqualDate('2017-10-22T00:00:00Z') - - arg = options.events.calls.argsFor(4)[0] - expect(arg.start).toEqualDate('2017-10-22T00:00:00Z') - expect(arg.end).toEqualDate('2017-10-29T00:00:00Z') - }) - }) -}) diff --git a/fullcalendar-main/tests/src/event-data/recurring.ts b/fullcalendar-main/tests/src/event-data/recurring.ts deleted file mode 100644 index d781ef7..0000000 --- a/fullcalendar-main/tests/src/event-data/recurring.ts +++ /dev/null @@ -1,107 +0,0 @@ -import timeGridPlugin from '@fullcalendar/timegrid' -import luxonPlugin from '@fullcalendar/luxon3' - -describe('recurring events', () => { - describe('when timed events in local timezone', () => { - pushOptions({ - initialView: 'timeGridWeek', - initialDate: '2017-07-03', - timeZone: 'local', - events: [ - { startTime: '09:00', endTime: '11:00', daysOfWeek: [2, 4] }, - ], - }) - - it('expands events with local time', () => { - initCalendar() - - let events = currentCalendar.getEvents() - - expect(events[0].start).toEqualLocalDate('2017-07-04T09:00:00') - expect(events[0].end).toEqualLocalDate('2017-07-04T11:00:00') - - expect(events[1].start).toEqualLocalDate('2017-07-06T09:00:00') - expect(events[1].end).toEqualLocalDate('2017-07-06T11:00:00') - }) - }) - - describe('when given recur range', () => { - pushOptions({ - initialView: 'dayGridMonth', - initialDate: '2017-07-03', - events: [ - { startTime: '09:00', endTime: '11:00', startRecur: '2017-07-05', endRecur: '2017-07-08' }, - ], - }) - - it('expands within given range', () => { - initCalendar() - - let events = currentCalendar.getEvents() - expect(events.length).toBe(3) - - expect(events[0].start).toEqualDate('2017-07-05T09:00:00Z') - expect(events[1].start).toEqualDate('2017-07-06T09:00:00Z') - expect(events[2].start).toEqualDate('2017-07-07T09:00:00Z') - }) - - describe('when current range is completely outside of recur-range', () => { - pushOptions({ - initialDate: '2017-02-02', - }) - - it('won\'t render any events', () => { - initCalendar() - let events = currentCalendar.getEvents() - expect(events.length).toBe(0) - }) - }) - }) - - describe('when event has a duration', () => { - pushOptions({ - initialView: 'dayGridWeek', - initialDate: '2019-06-02', - events: [ - { daysOfWeek: [6], duration: { days: 2 } }, - ], - }) - - it('will render from week before', () => { - initCalendar() - let events = currentCalendar.getEvents() - expect(events[0].start).toEqualDate('2019-06-01') - expect(events[0].end).toEqualDate('2019-06-03') - expect(events[1].start).toEqualDate('2019-06-08') - expect(events[1].end).toEqualDate('2019-06-10') - expect(events.length).toBe(2) - }) - }) - - it('when timeZone changes, events with unspecified timezone offsets move', () => { - const timeTexts = [] - const calendar = initCalendar({ - plugins: [timeGridPlugin, luxonPlugin], - timeZone: 'America/New_York', - initialView: 'timeGridWeek', - initialDate: '2023-02-07', - events: [ - { startTime: '12:00', daysOfWeek: [2] }, - ], - eventContent(arg) { - timeTexts.push(arg.timeText) - return true - }, - }) - - let events = calendar.getEvents() - expect(events[0].start).toEqualDate('2023-02-07T17:00:00Z') - expect(timeTexts.length).toBe(1) - expect(timeTexts[0]).toBe('12:00') - - calendar.setOption('timeZone', 'America/Chicago') - expect(events[0].start).toEqualDate('2023-02-07T17:00:00Z') - expect(timeTexts.length).toBe(2) - expect(timeTexts[1]).toBe('11:00') - }) -}) diff --git a/fullcalendar-main/tests/src/event-data/refetchEvents.ts b/fullcalendar-main/tests/src/event-data/refetchEvents.ts deleted file mode 100644 index 6faa4a1..0000000 --- a/fullcalendar-main/tests/src/event-data/refetchEvents.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('refetchEvents', () => { - it('retains scroll when in month view', () => { - let el = $('
').appendTo('body') - let scrollEl - let scrollTop - - let calendar = initCalendar({ - initialView: 'dayGridMonth', - initialDate: '2017-04-25', - events: [ - { start: '2017-04-04', title: 'event' }, - { start: '2017-04-04', title: 'event' }, - { start: '2017-04-04', title: 'event' }, - { start: '2017-04-04', title: 'event' }, - { start: '2017-04-04', title: 'event' }, - { start: '2017-04-04', title: 'event' }, - { start: '2017-04-04', title: 'event' }, - { start: '2017-04-04', title: 'event' }, - ], - }, el) - - let calendarWrapper = new CalendarWrapper(calendar) - - expect(calendarWrapper.getEventEls().length).toBe(8) - - let viewWrapper = new DayGridViewWrapper(calendar) - scrollEl = viewWrapper.getScrollerEl() - scrollEl.scrollTop = 1000 - scrollTop = scrollEl.scrollTop - - // verify that we queried the correct scroller el - expect(scrollTop).toBeGreaterThan(10) - - currentCalendar.refetchEvents() - expect(calendarWrapper.getEventEls().length).toBe(8) - expect(scrollEl.scrollTop).toBe(scrollTop) - }) -}) diff --git a/fullcalendar-main/tests/src/event-data/timeZoneChange.ts b/fullcalendar-main/tests/src/event-data/timeZoneChange.ts deleted file mode 100644 index c790083..0000000 --- a/fullcalendar-main/tests/src/event-data/timeZoneChange.ts +++ /dev/null @@ -1,33 +0,0 @@ -import timeGridPlugin from '@fullcalendar/timegrid' -import luxonPlugin from '@fullcalendar/luxon3' - -describe('timeZone change', () => { - describe('with non-recurring timed events and luxon plugin', () => { - it('adjusts timed event', () => { - const timeTexts = [] - const calendar = initCalendar({ - plugins: [timeGridPlugin, luxonPlugin], - timeZone: 'America/New_York', - initialView: 'timeGridWeek', - initialDate: '2023-02-07', - events: [ - { start: '2023-02-07T12:00:00' }, - ], - eventContent(arg) { - timeTexts.push(arg.timeText) - return true - }, - }) - - let events = calendar.getEvents() - expect(events[0].start).toEqualDate('2023-02-07T17:00:00Z') - expect(timeTexts.length).toBe(1) - expect(timeTexts[0]).toBe('12:00') - - calendar.setOption('timeZone', 'America/Chicago') - expect(events[0].start).toEqualDate('2023-02-07T17:00:00Z') - expect(timeTexts.length).toBe(2) - expect(timeTexts[1]).toBe('11:00') - }) - }) -}) diff --git a/fullcalendar-main/tests/src/event-drag/all-day-change.ts b/fullcalendar-main/tests/src/event-drag/all-day-change.ts deleted file mode 100644 index 4b1a873..0000000 --- a/fullcalendar-main/tests/src/event-drag/all-day-change.ts +++ /dev/null @@ -1,130 +0,0 @@ -import { parseMarker, addMs } from '@fullcalendar/core/internal' -import { drag } from '../lib/EventDragUtils.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' -import { intersectRects } from '../lib/geom.js' - -describe('allDay change', () => { - pushOptions({ - timeZone: 'UTC', - initialView: 'timeGridWeek', - now: '2018-09-03', - scrollTime: 0, - editable: true, - dragScroll: false, - }) - - describe('when dragged from all-day to timed', () => { - pushOptions({ - events: [ - { id: '1', start: '2018-09-03', end: '2018-09-05' }, - ], - }) - - function doDrag() { - let viewWrapper = new TimeGridViewWrapper(currentCalendar) - let dayGridWrapper = viewWrapper.dayGrid - let timeGridWrapper = viewWrapper.timeGrid - - let startRect = intersectRects( - dayGridWrapper.getDayEls('2018-09-03')[0].getBoundingClientRect(), - dayGridWrapper.getEventEls()[0].getBoundingClientRect(), - ) - let endDate = parseMarker('2018-09-03T02:00:00').marker - let endRect = timeGridWrapper.computeSpanRects( - endDate, - addMs(endDate, 1000 * 60 * 30), // hardcoded 30 minute slot :( - )[0] - - return drag(startRect, endRect, false) // debug=false - } - - it('discards duration when allDayMaintainDuration:false', (done) => { - initCalendar({ - allDayMaintainDuration: false, - }) - doDrag().then(() => { - let event = currentCalendar.getEventById('1') - expect(event.start).toEqualDate('2018-09-03T02:00:00Z') - expect(event.end).toBe(null) - }).then(() => done()) - }) - - it('keeps duration when allDayMaintainDuration:true', (done) => { - initCalendar({ - allDayMaintainDuration: true, - }) - doDrag().then(() => { - let event = currentCalendar.getEventById('1') - expect(event.start).toEqualDate('2018-09-03T02:00:00Z') - expect(event.end).toEqualDate('2018-09-05T02:00:00Z') - }).then(() => done()) - }) - - it('sets a default duration when forceEventDuration:true', (done) => { - initCalendar({ - forceEventDuration: true, - defaultTimedEventDuration: '04:00', - }) - doDrag().then(() => { - let event = currentCalendar.getEventById('1') - expect(event.start).toEqualDate('2018-09-03T02:00:00Z') - expect(event.end).toEqualDate('2018-09-03T06:00:00Z') - }).then(() => done()) - }) - }) - - describe('when dragging from timed to all-day', () => { - it('sets a default duration when forceEventDuration:true', (done) => { - initCalendar({ - forceEventDuration: true, - defaultAllDayEventDuration: { days: 2 }, - events: [ - { id: '1', start: '2018-09-03T01:00:00', end: '2018-09-03T02:00:00' }, - ], - }) - - let viewWrapper = new TimeGridViewWrapper(currentCalendar) - let dayGridWrapper = viewWrapper.dayGrid - let timeGridWrapper = viewWrapper.timeGrid - let startRect = timeGridWrapper.getEventEls()[0].getBoundingClientRect() - let endRect = dayGridWrapper.getDayEls('2018-09-03')[0].getBoundingClientRect() - - drag(startRect, endRect, false).then(() => { // debug=false - let event = currentCalendar.getEventById('1') - expect(event.start).toEqualDate('2018-09-03T00:00:00Z') - expect(event.end).toEqualDate('2018-09-05T00:00:00Z') - done() - }) - }) - - // https://github.com/fullcalendar/fullcalendar/issues/7222 - it('from more-popover', (done) => { - initCalendar({ - eventMaxStack: 1, - events: [ - { id: '1', start: '2018-09-03T01:00:00', end: '2018-09-03T02:00:00' }, - { id: '2', start: '2018-09-03T01:00:00', end: '2018-09-03T02:00:00' }, // in popover - ], - }) - - let viewWrapper = new TimeGridViewWrapper(currentCalendar) - let dayGridWrapper = viewWrapper.dayGrid - let timeGridWrapper = viewWrapper.timeGrid - - timeGridWrapper.openMorePopover() - setTimeout(() => { - let popoverEventEl = timeGridWrapper.getMorePopoverEventEls()[0] - let startRect = popoverEventEl.getBoundingClientRect() - let endRect = dayGridWrapper.getDayEls('2018-09-03')[0].getBoundingClientRect() - - drag(startRect, endRect, false, popoverEventEl).then(() => { // debug=false - let event = currentCalendar.getEventById('2') - expect(event.start).toEqualDate('2018-09-03T00:00:00Z') - expect(event.end).toBe(null) - expect(event.allDay).toBe(true) - done() - }) - }) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/event-drag/between-calendars.ts b/fullcalendar-main/tests/src/event-drag/between-calendars.ts deleted file mode 100644 index df89103..0000000 --- a/fullcalendar-main/tests/src/event-drag/between-calendars.ts +++ /dev/null @@ -1,148 +0,0 @@ -import { Calendar } from '@fullcalendar/core' -import interactionPlugin from '@fullcalendar/interaction' -import dayGridPlugin from '@fullcalendar/daygrid' -import timeGridPlugin from '@fullcalendar/timegrid' -import { getRectCenter } from '../lib/geom.js' -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('dragging events between calendars', () => { - let DEFAULT_DATE = '2019-01-01' - let el0 - let el1 - let calendar0 - let calendar1 - - beforeEach(() => { - el0 = document.createElement('div') - el1 = document.createElement('div') - - el0.style.width = el1.style.width = '50%' - el0.style.cssFloat = el1.style.cssFloat = 'left' - - document.body.appendChild(el0) - document.body.appendChild(el1) - }) - - afterEach(() => { - if (calendar0) { - calendar0.destroy() - } - - if (calendar1) { - calendar1.destroy() - } - - document.body.removeChild(el0) - document.body.removeChild(el1) - }) - - it('fires all triggers', (done) => { - let triggerNames = [] - let eventAllowCalled = false - let eventEl - - calendar0 = new Calendar(el0, { - plugins: [interactionPlugin, dayGridPlugin], - timeZone: 'UTC', - initialDate: DEFAULT_DATE, - initialView: 'dayGridMonth', - editable: true, - events: [ - { start: '2019-01-01', id: 'a' }, - ], - eventLeave(info) { - triggerNames.push('eventLeave') - expect(info.draggedEl).toBe(eventEl) - expect(info.event.id).toBe('a') - expect(typeof info.revert).toBe('function') - expect(Array.isArray(info.relatedEvents)).toBe(true) - }, - }) - - calendar1 = new Calendar(el1, { - plugins: [interactionPlugin, dayGridPlugin], - timeZone: 'UTC', - initialDate: DEFAULT_DATE, - initialView: 'dayGridMonth', - editable: true, - droppable: true, - drop(info) { - triggerNames.push('drop') - expect(info.draggedEl).toBe(eventEl) - expect(info.date).toEqualDate('2019-01-05') - expect(info.dateStr).toBe('2019-01-05') - expect(info.allDay).toBe(true) - }, - eventAllow() { - eventAllowCalled = true - return true - }, - eventReceive(info) { - triggerNames.push('eventReceive') - expect(info.draggedEl).toBe(eventEl) - expect(info.event.start).toEqualDate('2019-01-05') - expect(typeof info.revert).toBe('function') - expect(Array.isArray(info.relatedEvents)).toBe(true) - }, - }) - - calendar0.render() - calendar1.render() - - let dayGridWrapper0 = new DayGridViewWrapper(calendar0).dayGrid - let dayGridWrapper1 = new DayGridViewWrapper(calendar1).dayGrid - - eventEl = dayGridWrapper0.getEventEls()[0] - let dayEl = dayGridWrapper1.getDayEls('2019-01-05')[0] - let point1 = getRectCenter(dayEl.getBoundingClientRect()) - - $(eventEl).simulate('drag', { - end: point1, - callback() { - expect(triggerNames).toEqual(['eventLeave', 'drop', 'eventReceive']) - expect(eventAllowCalled).toBe(true) - done() - }, - }) - }) - - it('works between timeGrid views', (done) => { - calendar0 = new Calendar(el0, { - plugins: [interactionPlugin, timeGridPlugin], - scrollTime: '00:00', - timeZone: 'UTC', - initialDate: DEFAULT_DATE, - initialView: 'timeGridDay', - editable: true, - events: [ - { start: '2019-01-01T00:00:00', id: 'a' }, - ], - }) - - calendar1 = new Calendar(el1, { - plugins: [interactionPlugin, timeGridPlugin], - scrollTime: '00:00', - timeZone: 'UTC', - initialDate: DEFAULT_DATE, - initialView: 'timeGridDay', - editable: true, - droppable: true, - eventReceive(info) { - done() - }, - }) - - calendar0.render() - calendar1.render() - - let eventEl = new CalendarWrapper(calendar0).getEventEls()[0] // of the source calendar - let destViewWrapper = new TimeGridViewWrapper(calendar1) - let point1 = getRectCenter(destViewWrapper.getScrollerEl().getBoundingClientRect()) - - $(eventEl).simulate('drag', { - end: point1, - }) - }) -}) diff --git a/fullcalendar-main/tests/src/event-drag/fixedMirrorParent.ts b/fullcalendar-main/tests/src/event-drag/fixedMirrorParent.ts deleted file mode 100644 index ea36c46..0000000 --- a/fullcalendar-main/tests/src/event-drag/fixedMirrorParent.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('fixedMirrorParent', () => { - pushOptions({ - initialView: 'dayGridMonth', - initialDate: '2020-10-26', - }) - - it('changes the mirror\'s parent element', (done) => { - let calendar = initCalendar({ - editable: true, - fixedMirrorParent: document.body, - events: [ - { start: '2020-10-04' }, - ], - }) - - let wrapper = new DayGridViewWrapper(calendar).dayGrid - let eventEls = wrapper.getEventEls() - - $(eventEls[0]).simulate('drag', { - dx: -100, // out of the calendar, to create a fixed mirror el - onBeforeRelease() { - let $mirrorEl = $('body').find('> .' + CalendarWrapper.EVENT_CLASSNAME) // direct child - expect($mirrorEl.length).toBe(1) - }, - onRelease() { - done() - }, - }) - }) -}) diff --git a/fullcalendar-main/tests/src/event-drag/from-external.ts b/fullcalendar-main/tests/src/event-drag/from-external.ts deleted file mode 100644 index 477d835..0000000 --- a/fullcalendar-main/tests/src/event-drag/from-external.ts +++ /dev/null @@ -1,90 +0,0 @@ -import { Draggable } from '@fullcalendar/interaction' -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' - -describe('external event dragging', () => { - let $dragEl - let thirdPartyDraggable - - beforeEach(() => { - $dragEl = $('
yo
') - .css({ - width: 200, - background: 'blue', - color: 'white', - }) - .appendTo('body') - }) - - afterEach(() => { - if (thirdPartyDraggable) { - thirdPartyDraggable.destroy() - } - $dragEl.remove() - $dragEl = null - }) - - describe('with forceEventDuration', () => { - pushOptions({ - forceEventDuration: true, - defaultTimedEventDuration: '1:30', - }) - - // https://github.com/fullcalendar/fullcalendar/issues/4597 - it('should yield an event with an end', (done) => { - let calendar = initCalendar({ - initialView: 'dayGridMonth', - initialDate: '2019-04-01', - droppable: true, - defaultAllDayEventDuration: { days: 2 }, - eventReceive(arg) { - expect(arg.event.end).toEqualDate('2019-04-04') - done() - }, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - thirdPartyDraggable = new Draggable($dragEl[0], { - eventData: {}, - }) - - $dragEl.simulate('drag', { - end: dayGridWrapper.getDayEl('2019-04-02'), - }) - }) - }) - - // https://github.com/fullcalendar/fullcalendar/issues/4575 - it('provides eventAllow with a valid event with null start/end', (done) => { - let called = false - let calendar = initCalendar({ - initialView: 'dayGridMonth', - initialDate: '2019-04-01', - droppable: true, - defaultAllDayEventDuration: { days: 2 }, - eventAllow(dropInfo, draggedEvent) { - expect(draggedEvent.id).toBe('a') - expect(draggedEvent.title).toBe('hey') - expect(draggedEvent.start).toBe(null) - expect(draggedEvent.end).toBe(null) - called = true - return true - }, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - thirdPartyDraggable = new Draggable($dragEl[0], { - eventData: { - id: 'a', - title: 'hey', - }, - }) - - $dragEl.simulate('drag', { - end: dayGridWrapper.getDayEl('2019-04-02'), - callback() { - expect(called).toBe(true) - done() - }, - }) - }) -}) diff --git a/fullcalendar-main/tests/src/event-drag/repeating.ts b/fullcalendar-main/tests/src/event-drag/repeating.ts deleted file mode 100644 index 05bf1f6..0000000 --- a/fullcalendar-main/tests/src/event-drag/repeating.ts +++ /dev/null @@ -1,102 +0,0 @@ -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' -import { waitEventDrag } from '../lib/wrappers/interaction-util.js' -import { filterVisibleEls } from '../lib/dom-misc.js' -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' - -describe('event dragging on repeating events', () => { - pushOptions({ - initialView: 'dayGridMonth', - initialDate: '2017-02-12', - editable: true, - events: [ - { - groupId: '999', - title: 'Repeating Event', - start: '2017-02-09T16:00:00', - }, - { - groupId: '999', - title: 'Repeating Event', - start: '2017-02-16T16:00:00', - }, - ], - }) - - // bug where offscreen instance of a repeating event was being incorrectly dragged - it('drags correct instance of event', (done) => { - let calendar = initCalendar() - - // event range needs out large (month) then scope down (week) - // so that the new view receives out-of-range events. - currentCalendar.changeView('timeGridWeek') - - let eventEl = new CalendarWrapper(calendar).getFirstEventEl() - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let dragging = timeGridWrapper.dragEventToDate(eventEl, '2017-02-16T12:00:00') - - waitEventDrag(calendar, dragging).then((res) => { - expect(typeof res).toBe('object') - done() - }) - }) - - it('hides other repeating events when dragging', (done) => { - let dayGridWrapper - let calendar = initCalendar({ - eventDragStart() { - setTimeout(() => { // try go execute DURING the drag - let visibleEventEls = filterVisibleEls(dayGridWrapper.getEventEls()) - expect(visibleEventEls.length).toBe(0) - }, 0) - }, - eventDrop() { - setTimeout(() => { - done() - }, 10) - }, - }) - - dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - $(dayGridWrapper.getFirstEventEl()).simulate('drag', { - dx: 100, - duration: 100, // ample time for separate eventDragStart/eventDrop - }) - }) - - // inverse of above test - it('doesnt accidentally hide all non-id events when dragging', (done) => { - let dayGridWrapper - let calendar = initCalendar({ - events: [ - { - title: 'Regular Event', - start: '2017-02-09T16:00:00', - }, - { - title: 'Other Regular Event', - start: '2017-02-16T16:00:00', - }, - ], - - eventDragStart() { - setTimeout(() => { // try go execute DURING the drag - let visibleEventEls = filterVisibleEls(dayGridWrapper.getEventEls()) - expect(visibleEventEls.length).toBe(1) // the dragging event AND the other regular event - }, 0) - }, - - eventDrop() { - setTimeout(() => { - done() - }, 10) - }, - }) - - dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - $(dayGridWrapper.getFirstEventEl()).simulate('drag', { - dx: 100, - duration: 100, // ample time for separate eventDragStart/eventDrop - }) - }) -}) diff --git a/fullcalendar-main/tests/src/event-drag/showNonCurrentDates.ts b/fullcalendar-main/tests/src/event-drag/showNonCurrentDates.ts deleted file mode 100644 index e41703e..0000000 --- a/fullcalendar-main/tests/src/event-drag/showNonCurrentDates.ts +++ /dev/null @@ -1,49 +0,0 @@ -import * as EventDragUtils from '../lib/EventDragUtils.js' -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import { waitEventDrag } from '../lib/wrappers/interaction-util.js' - -describe('showNonCurrentDates event dragging', () => { - pushOptions({ - initialView: 'dayGridMonth', - initialDate: '2017-06-01', - showNonCurrentDates: false, - events: [ - { start: '2017-06-07', end: '2017-06-10' }, - ], - editable: true, - }) - - describe('when dragging pointer into disabled region', () => { - it('won\'t allow the drop', (done) => { - let calendar = initCalendar() - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - EventDragUtils.drag( - dayGridWrapper.getDayEl('2017-06-08').getBoundingClientRect(), - dayGridWrapper.getDisabledDayEls()[3].getBoundingClientRect(), // the cell before Jun 1 - ) - .then((res) => { - expect(res).toBe(false) - }) - .then(() => done()) - }) - }) - - describe('when dragging an event\'s start into a disabled region', () => { - it('allow the drop if the cursor stays over non-disabled cells', (done) => { - let calendar = initCalendar() - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - let dragging = dayGridWrapper.dragEventToDate( - dayGridWrapper.getEventEls()[0], - '2017-06-08', - '2017-06-01', - ) - - waitEventDrag(calendar, dragging).then((res) => { - expect(typeof res).toBe('object') - done() - }) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/event-drag/touch.ts b/fullcalendar-main/tests/src/event-drag/touch.ts deleted file mode 100644 index 4345fff..0000000 --- a/fullcalendar-main/tests/src/event-drag/touch.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import { waitEventDrag } from '../lib/wrappers/interaction-util.js' - -describe('event touch dragging', () => { - // https://github.com/fullcalendar/fullcalendar/issues/5706 - it('keeps event selected when initiated on custom element', (done) => { - let calendar = initCalendar({ - initialDate: '2020-08-12', - editable: true, - longPressDelay: 100, // dragEventToDate waits 200. TODO: no more hardcoding - events: [ - { title: 'event', start: '2020-08-12' }, - ], - eventContent: { html: 'the text' }, - }) - let gridWrapper = new DayGridViewWrapper(calendar).dayGrid - let eventEl = gridWrapper.getEventEls()[0] - - let dragging = gridWrapper.dragEventToDate( - eventEl.querySelector('i'), - null, // don't specify start date. start drag on center of given element - '2020-08-13', - true, - ) - - waitEventDrag(calendar, dragging).then((event) => { - expect(event.startStr).toBe('2020-08-13') - done() - }) - }) -}) diff --git a/fullcalendar-main/tests/src/event-drag/validRange.ts b/fullcalendar-main/tests/src/event-drag/validRange.ts deleted file mode 100644 index b3164c9..0000000 --- a/fullcalendar-main/tests/src/event-drag/validRange.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' - -describe('validRange event dragging', () => { - describe('when start constraint', () => { - describe('when in month view', () => { - pushOptions({ - initialView: 'dayGridMonth', - initialDate: '2017-06-01', - validRange: { start: '2017-06-06' }, - events: [ - { start: '2017-06-07', end: '2017-06-10' }, - ], - editable: true, - }) - - it('won\'t go before validRange', (done) => { - let modifiedEvent: any = false - - let calendar = initCalendar({ - eventDrop(arg) { - modifiedEvent = arg.event - }, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - $(dayGridWrapper.getEventEls()).simulate('drag', { - end: dayGridWrapper.getDayEl('2017-06-06').previousElementSibling, // the invalid day before - callback() { - expect(modifiedEvent).toBe(false) - done() - }, - }) - }) - }) - }) - - describe('when end constraint', () => { - describe('when in month view', () => { - pushOptions({ - initialView: 'dayGridMonth', - initialDate: '2017-06-01', - validRange: { end: '2017-06-09' }, - events: [ - { start: '2017-06-04', end: '2017-06-07' }, - ], - editable: true, - }) - - it('won\'t go after validRange', (done) => { - let modifiedEvent: any = false - - let calendar = initCalendar({ - eventDrop(arg) { - modifiedEvent = arg.event - }, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - $(dayGridWrapper.getEventEls()).simulate('drag', { - end: dayGridWrapper.getDayEl('2017-06-08').nextElementSibling, // the invalid day after - callback() { - expect(modifiedEvent).toBe(false) - done() - }, - }) - }) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/event-render/bg-events.ts b/fullcalendar-main/tests/src/event-render/bg-events.ts deleted file mode 100644 index 100e76e..0000000 --- a/fullcalendar-main/tests/src/event-render/bg-events.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' - -describe('background event', () => { - pushOptions({ - initialDate: '2020-06-23', - }) - - describe('that are timed', () => { - pushOptions({ - events: [ - { - start: '2020-06-23T12:00:00', - end: '2020-06-23T14:00:00', - display: 'background', - }, - ], - }) - - it('won\'t appear in daygrid', () => { - let calendar = initCalendar() - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let eventEls = dayGridWrapper.getBgEventEls() - expect(eventEls.length).toBe(0) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/event-render/dayGrid-events.ts b/fullcalendar-main/tests/src/event-render/dayGrid-events.ts deleted file mode 100644 index 03f7d75..0000000 --- a/fullcalendar-main/tests/src/event-render/dayGrid-events.ts +++ /dev/null @@ -1,701 +0,0 @@ -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import { anyElsIntersect } from '../lib/dom-geom.js' -import { filterVisibleEls } from '../lib/dom-misc.js' - -describe('dayGrid advanced event rendering', () => { - pushOptions({ - initialDate: '2020-05-01', - }) - - // https://github.com/fullcalendar/fullcalendar/issues/5408 - it('renders without intersecting', () => { - let calendar = initCalendar({ - initialView: 'dayGridMonth', - initialDate: '2020-05-01', - events: [ - { start: '2020-05-02', end: '2020-05-04', title: 'event a' }, - { start: '2020-05-02', end: '2020-05-04', title: 'event b' }, - { start: '2020-05-03', end: '2020-05-05', title: 'event c' }, - { start: '2020-05-04', title: 'event d' }, - { start: '2020-05-04', title: 'event e' }, - ], - }) - - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let eventEls = dayGridWrapper.getEventEls() - - expect(anyElsIntersect(eventEls)).toBe(false) - }) - - // https://github.com/fullcalendar/fullcalendar/issues/5771 - it('renders more-links correctly when first obscured event is longer than event before it', () => { - let calendar = initCalendar({ - initialView: 'dayGridMonth', - initialDate: '2020-08-01', - dayMaxEventRows: 3, - events: [ - { title: 'big1', start: '2020-07-23', end: '2020-07-28' }, - { title: 'small1', start: '2020-07-24', end: '2020-07-27' }, - { title: 'small2', start: '2020-07-24', end: '2020-07-27' }, - { title: 'big2', start: '2020-07-25', end: '2020-07-28' }, - ], - }) - - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let eventEls = dayGridWrapper.getEventEls() - let visibleEventEls = filterVisibleEls(eventEls) - let moreLinkEls = dayGridWrapper.getMoreEls() - - expect(visibleEventEls.length).toBe(3) - expect(moreLinkEls.length).toBe(1) - expect(anyElsIntersect(visibleEventEls.concat(moreLinkEls))).toBe(false) - }) - - // https://github.com/fullcalendar/fullcalendar/issues/5790 - it('positions more-links correctly in columns that have empty space', () => { - let calendar = initCalendar({ - initialView: 'dayGridMonth', - initialDate: '2020-09-01', - dayMaxEventRows: 4, - events: [ - { start: '2020-08-30', end: '2020-09-04' }, - { start: '2020-08-31', end: '2020-09-03' }, - { start: '2020-09-01', end: '2020-09-04' }, - { start: '2020-09-02', end: '2020-09-04' }, - { start: '2020-09-02', end: '2020-09-04' }, - ], - }) - - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let eventEls = dayGridWrapper.getEventEls() - let visibleEventEls = filterVisibleEls(eventEls) - let moreLinkEls = dayGridWrapper.getMoreEls() - - expect(visibleEventEls.length).toBe(3) - expect(moreLinkEls.length).toBe(2) - expect(anyElsIntersect(visibleEventEls.concat(moreLinkEls))).toBe(false) - - expect(Math.abs( - moreLinkEls[0].getBoundingClientRect().top - - moreLinkEls[1].getBoundingClientRect().top, - )).toBeLessThan(1) - }) - - // https://github.com/fullcalendar/fullcalendar/issues/5883 - it('it renders without gaps when ordered by title', () => { - let calendar = initCalendar({ - initialDate: '2020-10-01', - eventOrder: 'title', - dayMaxEventRows: 3, - events: [ - { - title: 'b1', - start: '2020-10-20', - end: '2020-10-22', - }, - { - title: 'b2', - start: '2020-10-21', - end: '2020-10-22', - }, - { - title: 'b3', - start: '2020-10-20', - end: '2020-10-23', - }, - { - title: 'b4', - start: '2020-10-20', - end: '2020-10-23', - }, - ], - }) - - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let eventEls = dayGridWrapper.getEventEls() - let visibleEventEls = filterVisibleEls(eventEls) - let moreLinkEls = dayGridWrapper.getMoreEls() - - expect(visibleEventEls.length).toBe(2) - expect(moreLinkEls.length).toBe(3) - expect(anyElsIntersect(visibleEventEls.concat(moreLinkEls))).toBe(false) - }) - - it('won\'t intersect when doing custom rendering', () => { - let calendar = initCalendar({ - initialView: 'dayGridMonth', - initialDate: '2020-06-01', - events: [ - { start: '2020-06-04', end: '2020-06-08', title: 'event a' }, - { start: '2020-06-05', end: '2020-06-09', title: 'event b' }, - { start: '2020-06-08T12:00:00', title: 'event c' }, - ], - eventContent(arg) { // creates varying-height events, which revealed the bug - return { - html: ` - ${arg.timeText} - ${arg.event.title} - `, - } - }, - }) - - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let eventEls = dayGridWrapper.getEventEls() - - expect(anyElsIntersect(eventEls)).toBe(false) - }) - - it('renders single-day timed event as list-item', () => { - let calendar = initCalendar({ - initialView: 'dayGridMonth', - initialDate: '2020-05-01', - eventDisplay: 'auto', - events: [ - { - title: 'event 1', - start: '2020-05-11T22:00:00', - }, - ], - }) - - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let eventEl = dayGridWrapper.getEventEls()[0] - - expect(dayGridWrapper.isEventListItem(eventEl)).toBe(true) - }) - - it('does not render multi-day event as list-item', () => { - let calendar = initCalendar({ - initialView: 'dayGridMonth', - initialDate: '2020-05-01', - eventDisplay: 'auto', - events: [ - { - title: 'event 1', - start: '2020-05-11T22:00:00', - end: '2020-05-12T06:00:00', - }, - ], - }) - - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let eventEl = dayGridWrapper.getEventEls()[0] - - expect(dayGridWrapper.isEventListItem(eventEl)).toBe(false) - }) - - // https://github.com/fullcalendar/fullcalendar/issues/5634 - it('does not render split multi-day event as list-item', () => { - let calendar = initCalendar({ - initialView: 'dayGridMonth', - initialDate: '2020-05-01', - eventDisplay: 'auto', - events: [ - { - title: 'event', - start: '2020-05-09T12:00:00', - end: '2020-05-10T12:00:00', - }, - ], - }) - - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let eventEls = dayGridWrapper.getEventEls() - - expect(eventEls.length).toBe(2) - expect(dayGridWrapper.isEventListItem(eventEls[0])).toBe(false) - expect(dayGridWrapper.isEventListItem(eventEls[0])).toBe(false) - }) - - it('render only block when eventDislay:block', () => { - let calendar = initCalendar({ - eventDisplay: 'block', - events: [ - { start: '2020-05-02T02:00:00', title: 'event a' }, - ], - }) - - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let eventEl = dayGridWrapper.getEventEls()[0] - - expect(dayGridWrapper.isEventListItem(eventEl)).toBe(false) - }) - - it('adjusts more link when getting bigger then smaller with liquid height', () => { - const LARGE_HEIGHT = 800 - const SMALL_HEIGHT = 500 - let $container = $( - `
`, - ).appendTo('body') - - let calendar = initCalendar({ - height: '100%', - dayMaxEvents: true, // will cause visible event count to vary - events: [ - { start: '2020-05-02', end: '2020-05-03', title: 'event a' }, - { start: '2020-05-02', end: '2020-05-03', title: 'event b' }, - { start: '2020-05-02', end: '2020-05-03', title: 'event c' }, - { start: '2020-05-02', end: '2020-05-03', title: 'event d' }, - { start: '2020-05-02', end: '2020-05-03', title: 'event e' }, - { start: '2020-05-02', end: '2020-05-03', title: 'event f' }, - ], - }, $container.find('div')) - - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let origEventCnt = filterVisibleEls(dayGridWrapper.getEventEls()).length - - $container.css('height', SMALL_HEIGHT) - calendar.updateSize() - let smallEventCnt = filterVisibleEls(dayGridWrapper.getEventEls()).length - expect(smallEventCnt).not.toBe(origEventCnt) - - $container.css('height', LARGE_HEIGHT) - calendar.updateSize() - let largeEventCnt = filterVisibleEls(dayGridWrapper.getEventEls()).length - expect(largeEventCnt).toBe(origEventCnt) - - $container.remove() - }) - - // https://github.com/fullcalendar/fullcalendar/issues/5850 - it('does not have JS error when dayMaxEventRows and almost no height', () => { - initCalendar({ - height: '100%', - eventDisplay: 'block', - dayMaxEventRows: true, - events: [ - { start: '2020-05-02T02:00:00', title: 'event a' }, - ], - }) - }) - - // https://github.com/fullcalendar/fullcalendar/issues/5863 - it('does not have JS error when dayMaxEventRows and almost no height', () => { - let $container = $('
').appendTo('body') - initCalendar({ - height: '100%', - eventDisplay: 'block', - dayMaxEventRows: true, - events: [ - { start: '2020-05-02T02:00:00', title: 'event a' }, - ], - }, $container[0]) - $container.remove() - }) - - it('doesn\'t create more-link while positioning events with temporary unknown dimensions', () => { - let renderedMoreLink = false - initCalendar({ - initialView: 'dayGridMonth', - moreLinkDidMount() { - renderedMoreLink = true - }, - events: [ - { id: '1', start: '2020-05-05' }, - ], - }) - expect(renderedMoreLink).toBe(false) - }) - - it('can render events with strict ordering', () => { - let calendar = initCalendar({ - initialView: 'dayGridMonth', - eventOrder: 'id', - eventOrderStrict: true, - events: [ - { id: '1', start: '2020-05-05' }, - { id: '2', start: '2020-05-03', end: '2020-05-08' }, - { id: '3', start: '2020-05-04' }, - ], - eventDidMount(arg) { - arg.el.setAttribute('data-event-id', arg.event.id) // TODO: more formal system for this - }, - }) - - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let eventEls = dayGridWrapper.getEventEls() - let visibleEventEls = filterVisibleEls(eventEls) - expect(anyElsIntersect(visibleEventEls)).toBe(false) - - let el1 = document.querySelector('[data-event-id="1"]') - let el2 = document.querySelector('[data-event-id="2"]') - let el3 = document.querySelector('[data-event-id="3"]') - let top1 = el1.getBoundingClientRect().top - let top2 = el2.getBoundingClientRect().top - let top3 = el3.getBoundingClientRect().top - expect(top1).toBeLessThan(top2) - expect(top2).toBeLessThan(top3) - }) - - // https://github.com/fullcalendar/fullcalendar/issues/5767 - it('consumes empty gaps in space when strict ordering', () => { - let calendar = initCalendar({ - initialDate: '2020-08-23', - initialView: 'dayGridWeek', - eventOrder: 'title', - eventOrderStrict: true, - dayMaxEventRows: 4, - eventDidMount(arg) { - arg.el.setAttribute('data-event-id', arg.event.id) // TODO: more formal system for this - }, - events: [ - { - title: 'a', - id: 'a', - start: '2020-08-24', - end: '2020-08-27', - }, - { - title: 'b', - id: 'b', - start: '2020-08-24', - end: '2020-08-27', - }, - { - title: 'c', - id: 'c', - start: '2020-08-28', - end: '2020-08-29', - }, - { - title: 'd', - id: 'd', - start: '2020-08-24', - end: '2020-08-29', - }, - { - title: 'e', - id: 'e', - start: '2020-08-27', - end: '2020-08-29', - }, - { // will cause 'e' to hide - title: 'f', - id: 'f', - start: '2020-08-24', - end: '2020-08-29', - }, - ], - }) - - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let eventEls = dayGridWrapper.getEventEls() - let visibleEventEls = filterVisibleEls(eventEls) - expect(anyElsIntersect(visibleEventEls)).toBe(false) - - let rect0 = document.querySelector('[data-event-id="d"]').getBoundingClientRect() - let rect1 = document.querySelector('[data-event-id="f"]').getBoundingClientRect() - expect(rect1.top - rect0.bottom).toBeLessThan(2) - }) - - // https://github.com/fullcalendar/fullcalendar/issues/6393 - it('doesn\'t overlap with eventOrderStrict', () => { - let calendar = initCalendar({ - initialDate: '2021-06-21', - initialView: 'dayGridWeek', - eventOrderStrict: true, - events: [ - { - title: 'Busy1', - start: '2021-06-21T10:00:00Z', - end: '2021-06-21T11:00:00Z', - }, - { - title: 'Busy2', - start: '2021-06-21T08:00:00Z', - end: '2021-06-21T10:00:00Z', - }, - { - title: 'Busy3', - start: '2021-06-22T11:00:00Z', - end: '2021-06-22T12:00:00Z', - }, - { - title: 'Busy4', - start: '2021-06-24T08:30:00Z', - end: '2021-06-24T11:00:00Z', - }, - { - title: 'Busy5', - start: '2021-06-24T16:00:00Z', - end: '2021-06-24T16:30:00Z', - }, - ], - }) - - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let eventEls = dayGridWrapper.getEventEls() - let visibleEventEls = filterVisibleEls(eventEls) - expect(anyElsIntersect(visibleEventEls)).toBe(false) - }) - - // https://github.com/fullcalendar/fullcalendar/issues/6397 - it('doesn\'t show duplicate events in popover when eventOrder by start date', (done) => { - let calendar = initCalendar({ - initialView: 'dayGridMonth', - initialDate: '2021-07-07', - eventOrder: 'start', - dayMaxEventRows: 4, - events: [ - { - title: 'Ariana Florescu', - start: '2021-07-02', - end: '2021-07-03', - }, - { - title: 'Alan Leaclaire', - start: '2021-07-02', - end: '2021-07-10', - }, - { - title: 'Divya Sundavaridevelu', - start: '2021-07-05', - end: '2021-07-06', - }, - { - title: 'Phyllis Benoussan', - start: '2021-07-05', - end: '2021-07-06', - }, - { - title: 'Allison Olsen', - start: '2021-07-05', - end: '2021-07-10', - }, - { - title: 'Justin Sinnaeve', - start: '2021-07-05', - end: '2021-07-10', - }, - { - title: 'Sylwia Pitel', - start: '2021-07-07', - end: '2021-07-08', - }, - { - title: 'Derrick Leach', - start: '2021-07-07', - end: '2021-07-10', - }, - { - title: 'Sebastien Pillon', - start: '2021-07-08', - end: '2021-07-13', - }, - { - title: 'Nishat Ayub', - start: '2021-07-08', - end: '2021-07-10', - }, - { - title: 'Ognjen Stoisavljevic', - start: '2021-07-09', - end: '2021-07-10', - }, - { - title: 'Slobodan Stojanovic', - start: '2021-07-09', - end: '2021-07-10', - }, - { - title: 'Phyllis Benoussan', - start: '2021-07-09', - end: '2021-07-10', - }, - ], - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - dayGridWrapper.openMorePopover(4) // on July 9th - setTimeout(() => { - let eventEls = dayGridWrapper.getMorePopoverEventEls() - expect(eventEls.length).toBe(9) - done() - }) - }) - - // https://github.com/fullcalendar/fullcalendar/issues/7447 - it('Doesn\'t error or overlap event positions when white-space:normal', () => { - let calendar = initCalendar({ - initialView: 'dayGridWeek', - initialDate: '2023-04-09', - dayMaxEvents: 4, - eventContent() { - return { - html: '
' + - 'AAAAAAAAAA BBBBBBBBB
', - } - }, - events: [ - { - id: 'a', - start: '2023-04-14', - end: '2023-04-21', - }, - { - id: 'b', - start: '2023-04-13', - end: '2023-04-22', - }, - { - id: 'c', - start: '2023-04-06', - end: '2023-04-15', - }, - { - id: 'd', - start: '2023-04-11', - end: '2023-04-14', - }, - { - id: 'e', - start: '2023-04-14', - end: '2023-04-19', - }, - { - id: 'f', - start: '2023-04-13', - end: '2023-04-19', - }, - { - id: 'g', - start: '2023-04-05', - end: '2023-04-14', - }, - { - id: 'h', - start: '2023-04-06', - end: '2023-04-15', - }, - { - id: 'i', - start: '2023-04-13', - end: '2023-04-15', - }, - { - id: 'j', - start: '2023-04-12', - end: '2023-04-15', - }, - ], - }) - - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let eventEls = dayGridWrapper.getEventEls() - let visibleEventEls = filterVisibleEls(eventEls) - expect(anyElsIntersect(visibleEventEls)).toBe(false) - }) - - // https://github.com/fullcalendar/fullcalendar/issues/6486 - it('renders events starting yesterday, ending at midnight, as "past"', () => { - let calendar = initCalendar({ - initialView: 'dayGridMonth', - initialDate: '2023-04-09', // "today" - now: '2023-04-09', // "today" - events: [{ - start: '2023-04-08', // yesterday - allDay: true, - }], - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let eventEls = dayGridWrapper.getEventEls() - - expect(eventEls[0]).toHaveClass('fc-event-past') - }) - - // https://github.com/fullcalendar/fullcalendar/issues/7462 - it('Cannot infinitely recurse with dayMaxEventRows and many hidden event rows', () => { - initCalendar({ - initialView: 'dayGridMonth', - initialDate: '2023-09-01', - dayMaxEventRows: 6, - events: [ - { - start: '2023-09-28T00:00:00', - end: '2023-10-01T00:00:00', - }, - { - start: '2023-09-26T00:00:00', - end: '2023-09-27T00:00:00', - }, - { - start: '2023-09-20T17:00:00', - end: '2023-09-27T17:00:00', - }, - { - start: '2023-09-21T16:00:00', - end: '2023-09-25T14:00:00', - }, - { - start: '2023-09-21T16:00:00', - end: '2023-09-25T11:00:00', - }, - { - start: '2023-09-28T10:00:00', - end: '2023-09-28T15:00:00', - }, - { - start: '2023-09-27T08:00:00', - end: '2023-10-04T18:00:00', - }, - { - start: '2023-09-20T13:00:00', - end: '2023-09-29T12:00:00', - }, - { - start: '2023-09-20T12:00:00', - end: '2023-09-29T12:00:00', - }, - { - start: '2023-09-27T11:00:00', - end: '2023-09-28T18:00:00', - }, - { - start: '2023-03-29T23:00:00', - end: '2024-03-29T22:00:00', - }, - { - start: '2023-09-25T02:00:00', - end: '2023-09-29T12:00:00', - }, - { - start: '2023-09-22T14:00:00', - end: '2023-09-29T12:00:00', - }, - { - start: '2023-09-22T14:00:00', - end: '2023-09-28T12:00:00', - }, - { - start: '2023-09-19T13:00:00', - end: '2023-09-30T13:00:00', - }, - ], - }) - }) - - it('will limit events to dayMaxEventRows:1', () => { - const calendar = initCalendar({ - initialDate: '2021-10-31', - dayMaxEventRows: 1, - events: [ - { title: 'A', start:'2021-10-31', end:'2021-11-02' }, - { title: 'B', start:'2021-10-29', end:'2021-11-02' }, - { title: 'C', start:'2021-10-28 12:00:00', end:'2021-10-31 12:00:00' }, - ], - }) - - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let visibleEventEls = filterVisibleEls(dayGridWrapper.getEventEls()) - let moreEls = dayGridWrapper.getMoreEls() - let allEls = [...visibleEventEls, ...moreEls] - let offsetTopHash = {} - - for (let el of allEls) { - offsetTopHash[Math.round(el.getBoundingClientRect().top)] = true - } - - // two weeks, two distinct lines of events (one per week) - expect(Object.keys(offsetTopHash).length).toBe(2) - }) -}) diff --git a/fullcalendar-main/tests/src/event-render/event-render-hooks.ts b/fullcalendar-main/tests/src/event-render/event-render-hooks.ts deleted file mode 100644 index e0669a1..0000000 --- a/fullcalendar-main/tests/src/event-render/event-render-hooks.ts +++ /dev/null @@ -1,147 +0,0 @@ -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' -import { RED_REGEX } from '../lib/dom-misc.js' - -describe('eventContent', () => { - pushOptions({ - initialView: 'dayGridMonth', - initialDate: '2020-06-01', - events: [ - { title: 'my event', start: '2020-06-01T01:00:00' }, - ], - }) - - it('can inject vdom nodes', () => { - let calendar = initCalendar({ - eventContent(info, createElement) { - return ( - createElement('span', {}, [ // TODO: document how to use Fragment - createElement('b', {}, info.timeText), - createElement('i', {}, info.event.title), - ]) - ) - }, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let eventEl = dayGridWrapper.getEventEls()[0] - expect(eventEl.querySelector('b').innerHTML).toBe('1a') - expect(eventEl.querySelector('i').innerHTML).toBe('my event') - }) - - it('can inject html content', () => { - let calendar = initCalendar({ - eventContent(info) { - return { - html: `${info.timeText}${info.event.title}`, - } - }, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let eventEl = dayGridWrapper.getEventEls()[0] - expect(eventEl.querySelector('b').innerHTML).toBe('1a') - expect(eventEl.querySelector('i').innerHTML).toBe('my event') - }) - - it('can inject text content', () => { - let calendar = initCalendar({ - eventContent(info) { - return info.timeText + ' - ' + info.event.title - }, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let eventEl = dayGridWrapper.getEventEls()[0] - expect(eventEl.innerHTML).toBe('1a - my event') - }) - - it('will render blank content if nothing returned', () => { - let calendar = initCalendar({ - eventContent() { - }, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let eventEl = dayGridWrapper.getEventEls()[0] - expect($(eventEl).text()).toBe('') - }) - - it('can return true to render default content', () => { - let calendar = initCalendar({ - eventContent() { - return true - }, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let eventEl = dayGridWrapper.getEventEls()[0] - expect($(eventEl).text()).toMatch('my event') - }) - - // https://github.com/fullcalendar/fullcalendar/issues/5916 - xit('can render multiple appearance changes in eventDidMount', () => { - let calendar = initCalendar({ - initialView: 'timeGridWeek', - initialDate: '2020-12-13', - eventDidMount(arg) { - arg.event.setProp('backgroundColor', 'red') - arg.event.setProp('title', 'name changed') - }, - events: [ - { - id: 'a', - title: 'a', - start: '2020-12-15T09:30:00', - }, - { - id: 'b', - title: 'b', - start: '2020-12-22T09:30:00', - }, - ], - }) - - function expectEventDataChanged(id) { - let event = calendar.getEventById(id) - expect(event.title).toBe('name changed') - expect(event.backgroundColor).toBe('red') - } - - let viewWrapper = new TimeGridViewWrapper(calendar).timeGrid - let eventEl = viewWrapper.getEventEls()[0] - expect($(eventEl).css('background-color')).toMatch(RED_REGEX) - expectEventDataChanged('a') - - calendar.next() - eventEl = viewWrapper.getEventEls()[0] - expect($(eventEl).css('background-color')).toMatch(RED_REGEX) - expectEventDataChanged('b') - }) - - // https://github.com/fullcalendar/fullcalendar/issues/6079 - it('can handle view-specific custom content generators', () => { - let calendar = initCalendar({ - initialView: 'dayGridWeek', - initialDate: '2021-01-07', - views: { - dayGridWeek: { - eventContent() { - let eventWrapper = document.createElement('div') - eventWrapper.innerText = 'test dayGridWeek' - let arrayOfDomNodes = [eventWrapper] - return { domNodes: arrayOfDomNodes } - }, - }, - }, - events: [ - { start: '2021-01-07', title: 'default title' }, - ], - }) - - let dayGrid = new DayGridViewWrapper(calendar).dayGrid - let eventEl = dayGrid.getEventEls()[0] - expect(eventEl.innerText.trim()).toBe('test dayGridWeek') - - calendar.changeView('dayGridMonth') - - dayGrid = new DayGridViewWrapper(calendar).dayGrid - eventEl = dayGrid.getEventEls()[0] - expect(eventEl.innerText.trim()).toBe('default title') - }) -}) diff --git a/fullcalendar-main/tests/src/event-render/eventMinHeight.ts b/fullcalendar-main/tests/src/event-render/eventMinHeight.ts deleted file mode 100644 index a6d3a16..0000000 --- a/fullcalendar-main/tests/src/event-render/eventMinHeight.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('eventMinHeight', () => { - pushOptions({ - initialView: 'timeGridWeek', - initialDate: '2017-08-10', - events: [ - { start: '2017-08-10T10:30:00', end: '2017-08-10T10:31:00' }, - ], - }) - - it('has a non-zero default', () => { - let calendar = initCalendar() - let eventEl = new CalendarWrapper(calendar).getFirstEventEl() - expect(eventEl.offsetHeight).toBeGreaterThan(5) - }) - - it('can be set and rendered', () => { - let calendar = initCalendar({ - eventMinHeight: 40, - }) - let eventEl = new CalendarWrapper(calendar).getFirstEventEl() - expect(eventEl.offsetHeight).toBeGreaterThanOrEqual(39) - }) - - it('will ignore temporal non-collision and render side-by-side', () => { - let calendar = initCalendar({ - eventMinHeight: 40, - events: [ - { start: '2017-08-10T10:30:00', end: '2017-08-10T10:31:00', title: 'event a' }, - { start: '2017-08-10T10:31:20', end: '2017-08-10T10:31:40', title: 'event b' }, - ], - }) - let eventEls = new CalendarWrapper(calendar).getEventEls() - expect(eventEls[0].getBoundingClientRect().left) - .toBeLessThan(eventEls[1].getBoundingClientRect().left) - }) -}) diff --git a/fullcalendar-main/tests/src/event-render/eventOrder.ts b/fullcalendar-main/tests/src/event-render/eventOrder.ts deleted file mode 100644 index eca16e0..0000000 --- a/fullcalendar-main/tests/src/event-render/eventOrder.ts +++ /dev/null @@ -1,126 +0,0 @@ -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' - -describe('eventOrder', () => { - pushOptions({ - initialDate: '2018-01-01', - initialView: 'dayGridMonth', - eventDidMount(arg) { - arg.el.setAttribute('data-event-id', arg.event.id) - }, - }) - - describe('when all different start times', () => { - pushOptions({ - events: [ - { id: 'z', title: 'a', start: '2018-01-01T10:00:00' }, - { id: 'y', title: 'b', start: '2018-01-01T09:00:00' }, - { id: 'x', title: 'c', start: '2018-01-01T08:00:00' }, - ], - }) - - it('will sort by start time by default', () => { - initCalendar() - expect(getEventOrder()).toEqual(['x', 'y', 'z']) - }) - }) - - describe('when all the same date', () => { - pushOptions({ - events: [ - { id: 'z', title: 'a', start: '2018-01-01T09:00:00', myOrder: 3 }, - { id: 'y', title: 'b', start: '2018-01-01T09:00:00', myOrder: 1 }, - { id: 'x', title: 'c', start: '2018-01-01T09:00:00', myOrder: 2 }, - ], - }) - - it('sorts by title by default', () => { - initCalendar() - expect(getEventOrder()).toEqual(['z', 'y', 'x']) - }) - - it('can sort by a standard prop', () => { - initCalendar({ - eventOrder: 'id', - }) - expect(getEventOrder()).toEqual(['x', 'y', 'z']) - }) - - it('can sort by a non-standard prop', () => { - initCalendar({ - eventOrder: 'myOrder', - }) - expect(getEventOrder()).toEqual(['y', 'x', 'z']) - }) - }) - - describe('when different dates', () => { - pushOptions({ - events: [ - { id: 'z', title: 'a', start: '2018-01-03T09:00:00', end: '2018-01-06T09:00:00', myOrder: 3 }, - { id: 'y', title: 'b', start: '2018-01-02T09:00:00', end: '2018-01-06T09:00:00', myOrder: 1 }, - { id: 'x', title: 'c', start: '2018-01-01T09:00:00', end: '2018-01-06T09:00:00', myOrder: 2 }, - ], - }) - - it('sorting by a prop will override date-determined order', () => { - initCalendar({ - eventOrder: 'myOrder', - }) - expect(getEventOrder()).toEqual(['y', 'x', 'z']) - }) - }) - - describe('when different durations', () => { - pushOptions({ - events: [ - { id: 'z', title: 'a', start: '2018-01-01T09:00:00', end: '2018-01-04T09:00:00', myOrder: 3 }, // 3 day - { id: 'y', title: 'b', start: '2018-01-01T09:00:00', end: '2018-01-02T09:00:00', myOrder: 1 }, // 1 day - { id: 'x', title: 'c', start: '2018-01-01T09:00:00', end: '2018-01-03T09:00:00', myOrder: 2 }, // 2 day - ], - }) - - it('sorting by a prop will override duration-determined order', () => { - initCalendar({ - eventOrder: 'myOrder', - }) - expect(getEventOrder()).toEqual(['y', 'x', 'z']) - }) - }) - - describe('when long event split across weeks', () => { - pushOptions({ - events: [ - { id: 'x', start: '2018-01-06', end: '2018-01-08' }, - { id: 'y', start: '2018-01-06', end: '2018-01-07' }, - { id: 'z', start: '2018-01-07', end: '2018-01-08' }, - ], - }) - - it('should prioritize eventOrder duration', () => { - let calendar = initCalendar({ - eventOrder: '-duration', - }) - let dayGrid = new DayGridViewWrapper(calendar).dayGrid - let rowEls = dayGrid.getRowEls() - let xEvent0 = rowEls[0].querySelector('[data-event-id="x"]') - let xEvent1 = rowEls[1].querySelector('[data-event-id="x"]') - let yEvent = rowEls[0].querySelector('[data-event-id="y"]') - let zEvent = rowEls[1].querySelector('[data-event-id="z"]') - - expect(xEvent0.getBoundingClientRect().top) - .toBeLessThan(yEvent.getBoundingClientRect().top) - expect(xEvent1.getBoundingClientRect().top) - .toBeLessThan(zEvent.getBoundingClientRect().top) - }) - }) - - function getEventOrder() { - let objs = new CalendarWrapper(currentCalendar).getEventEls().map((el) => ({ - id: el.getAttribute('data-event-id'), - top: el.getBoundingClientRect().top, - })) - objs.sort((a, b) => a.top - b.top) - return objs.map((obj) => obj.id) - } -}) diff --git a/fullcalendar-main/tests/src/event-render/list-events.ts b/fullcalendar-main/tests/src/event-render/list-events.ts deleted file mode 100644 index 7b6d933..0000000 --- a/fullcalendar-main/tests/src/event-render/list-events.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { ListViewWrapper } from '../lib/wrappers/ListViewWrapper.js' - -describe('list-view event rendering', () => { - // https://github.com/fullcalendar/fullcalendar/issues/6486 - it('renders events starting yesterday, ending at midnight, as "past"', () => { - let calendar = initCalendar({ - initialView: 'listMonth', - initialDate: '2023-04-09', // "today" - now: '2023-04-09', // "today" - events: [{ - start: '2023-04-08', // yesterday - allDay: true, - }], - }) - let wrapper = new ListViewWrapper(calendar) - let eventEls = wrapper.getEventEls() - - expect(eventEls[0]).toHaveClass('fc-event-past') - }) -}) diff --git a/fullcalendar-main/tests/src/event-render/maxTime.ts b/fullcalendar-main/tests/src/event-render/maxTime.ts deleted file mode 100644 index 8051e8c..0000000 --- a/fullcalendar-main/tests/src/event-render/maxTime.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { directionallyTestSeg } from '../lib/DayGridEventRenderUtils.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('event rendering with slotMaxTime', () => { // TODO: rename file - pushOptions({ - initialView: 'timeGridWeek', - initialDate: '2017-03-22', - scrollTime: '00:00', - }) - - describe('when event is within extended slotMaxTime', () => { - pushOptions({ - slotMaxTime: '26:00', - events: [ - { start: '2017-03-22T00:00:00', end: '2017-03-22T02:00:00' }, - ], - }) - - it('renders two event elements in the correct places', () => { - let calendar = initCalendar() - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let res = timeGridWrapper.checkEventRendering( - '2017-03-22T00:00:00Z', - '2017-03-22T02:00:00Z', - ) - expect(res.length).toBe(2) - expect(res.isMatch).toBe(true) - }) - }) - - // https://github.com/fullcalendar/fullcalendar/issues/4483 - it('displays events on the last day', () => { - initCalendar({ - initialView: 'dayGridWeek', - slotMaxTime: '20:00', - events: [ - { start: '2017-03-19', end: '2017-03-26' }, - ], - }) - - directionallyTestSeg({ - firstCol: 0, - lastCol: 6, - isStart: true, - isEnd: true, - }) - }) -}) diff --git a/fullcalendar-main/tests/src/event-render/minTime.ts b/fullcalendar-main/tests/src/event-render/minTime.ts deleted file mode 100644 index 557cfcd..0000000 --- a/fullcalendar-main/tests/src/event-render/minTime.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('slotMinTime', () => { // TODO: rename file - pushOptions({ - initialView: 'timeGridWeek', - initialDate: '2017-03-22', - scrollTime: '00:00', - }) - - describe('event rendering', () => { - describe('when event is within negative slotMinTime', () => { - pushOptions({ - slotMinTime: { hours: -2 }, - events: [ - { start: '2017-03-22T22:00:00', end: '2017-03-23T00:00:00' }, - ], - }) - - it('renders two event elements in the correct places', () => { - let calendar = initCalendar() - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let res = timeGridWrapper.checkEventRendering( - '2017-03-22T22:00:00Z', - '2017-03-23T00:00:00Z', - ) - expect(res.length).toBe(2) - expect(res.isMatch).toBe(true) - }) - }) - - describe('when event start cut off by positive slotMinTime', () => { - pushOptions({ - slotMinTime: { hours: 12 }, - events: [ - { start: '2017-03-22T10:00:00', end: '2017-03-22T14:00:00' }, - ], - }) - - it('shows time-text as original event start time', () => { - let calendar = initCalendar() - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let timeTexts = timeGridWrapper.getEventTimeTexts() - expect(timeTexts[0]).toBe('10:00 - 2:00') - }) - }) - }) - - it('can be changed dynamically', () => { - let calendar = initCalendar() - currentCalendar.setOption('slotMinTime', '09:00') - - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - expect(timeGridWrapper.getTimeAxisInfo()[0].text).toBe('9am') - }) -}) diff --git a/fullcalendar-main/tests/src/event-render/multiMonth-events.ts b/fullcalendar-main/tests/src/event-render/multiMonth-events.ts deleted file mode 100644 index d750bc9..0000000 --- a/fullcalendar-main/tests/src/event-render/multiMonth-events.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { filterVisibleEls } from '../lib/dom-misc.js' -import { MultiMonthViewWrapper } from '../lib/wrappers/MultiMonthViewWrapper.js' - -describe('multi-month-view event rendering', () => { - // https://github.com/fullcalendar/fullcalendar/issues/7573 - it('will not incorrectly put events under +more link', () => { - const calendarEl = document.createElement('div') - calendarEl.style.width = '1200px' - calendarEl.style.maxWidth = '1200px' - document.body.appendChild(calendarEl) - - const calendar = initCalendar({ - initialView: 'multiMonthYear', - initialDate: '2024-01-15', - multiMonthMaxColumns: 2, - events: [ - { - title: 'event 1', - start: '2024-01-15', - end: '2024-01-20', - }, - { - title: 'event 2', - start: '2024-01-15', - end: '2024-01-20', - }, - { - title: 'event 3', - start: '2024-01-15', - }, - ], - }, calendarEl) - - const viewWrapper = new MultiMonthViewWrapper(calendar) - const dayGridWrapper = viewWrapper.getDayGrid(0) - const visibleEventEls = filterVisibleEls(dayGridWrapper.getEventEls()) - const moreEls = dayGridWrapper.getMoreEls() - const moreTexts = moreEls.map((moreEl) => moreEl.innerText) - - expect(visibleEventEls.length).toBe(2) - expect(moreTexts).toEqual(['+2 more']) - - document.body.removeChild(calendarEl) - }) -}) diff --git a/fullcalendar-main/tests/src/event-render/print-preview.ts b/fullcalendar-main/tests/src/event-render/print-preview.ts deleted file mode 100644 index 12a9c5e..0000000 --- a/fullcalendar-main/tests/src/event-render/print-preview.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('print preview', () => { - pushOptions({ - initialDate: '2019-04-08', - scrollTime: '00:00', - events: [ - { id: '2', start: '2019-04-08T05:00:00' }, - { id: '1', start: '2019-04-08T01:00:00' }, - ], - eventDidMount(arg) { - arg.el.setAttribute('data-id', arg.event.id) - }, - }) - - describeOptions('initialView', { - 'with timeGrid view': 'timeGridDay', - 'with dayGrid view': 'dayGridDay', - }, () => { - it('orders events in DOM by start time', () => { - let calendar = initCalendar() - let calendarWrapper = new CalendarWrapper(calendar) - let eventEls = calendarWrapper.getEventEls() - - let ids = eventEls.map((el) => el.getAttribute('data-id')) - - expect(ids).toEqual(['1', '2']) - }) - }) - - describeOptions('initialView', { - 'with timeGrid view': 'timeGridWeek', - 'with dayGrid view': 'dayGridDay', - }, () => { - // https://github.com/fullcalendar/fullcalendar/issues/5709 - it('orders by start time when in actually printing', (done) => { - let calendar = initCalendar() - calendar.trigger('_beforeprint') - - setTimeout(() => { - let calendarWrapper = new CalendarWrapper(calendar) - let eventEls = calendarWrapper.getEventEls() - - let ids = eventEls.map((el) => el.getAttribute('data-id')) - - expect(ids).toEqual(['1', '2']) - done() - }) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/event-render/timeGrid-events-short.ts b/fullcalendar-main/tests/src/event-render/timeGrid-events-short.ts deleted file mode 100644 index 010d45c..0000000 --- a/fullcalendar-main/tests/src/event-render/timeGrid-events-short.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' -import { queryEventElInfo } from '../lib/wrappers/TimeGridWrapper.js' - -describe('short timegrid events', () => { - it('gets corrected className when short, by default', () => { - let calendar = initCalendar({ - initialView: 'timeGridWeek', - initialDate: '2017-08-10', - events: [ - { start: '2017-08-10T10:30:00', end: '2017-08-10T10:31:00', title: 'event a' }, - ], - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let eventEls = timeGridWrapper.getEventEls() - expect(queryEventElInfo(eventEls[0]).isShort).toBe(true) - }) - - it('can apply short className when customized to be larger', () => { - let calendar = initCalendar({ - initialView: 'timeGridWeek', - initialDate: '2017-08-10', - eventShortHeight: 200, - events: [ - { start: '2017-08-10T10:30:00', end: '2017-08-10T12:30:00', title: 'event a' }, - ], - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let eventEls = timeGridWrapper.getEventEls() - expect(queryEventElInfo(eventEls[0]).isShort).toBe(true) - }) -}) diff --git a/fullcalendar-main/tests/src/event-render/timeGrid-events.ts b/fullcalendar-main/tests/src/event-render/timeGrid-events.ts deleted file mode 100644 index 4a97acc..0000000 --- a/fullcalendar-main/tests/src/event-render/timeGrid-events.ts +++ /dev/null @@ -1,170 +0,0 @@ -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' -import { anyElsObscured } from '../lib/dom-geom.js' - -describe('timeGrid event rendering', () => { - // https://github.com/fullcalendar/fullcalendar/issues/6019 - it('renders without intersecting when sorted by title', () => { - let calendar = initCalendar({ - initialView: 'timeGridWeek', - initialDate: '2020-12-15', - scrollTime: '05:00', - eventOrder: 'title,-allDay,start,-duration', - slotEventOverlap: false, - events: [ - { - title: 'a', - start: '2020-12-15 15:00:00', - end: '2020-12-15 18:00:00', - }, - { - title: 'b', - start: '2020-12-15 05:00:00', - end: '2020-12-15 08:00:00', - }, - { - title: 'c', - start: '2020-12-15 09:00:00', - end: '2020-12-15 12:00:00', - }, - { - title: 'd', - start: '2020-12-15 05:00:00', - end: '2020-12-15 09:00:00', - }, - { - title: 'e', - start: '2020-12-15 05:00:00', - end: '2020-12-15 08:00:00', - }, - { - color: 'red', - title: 'f', - start: '2020-12-15 08:00:00', - end: '2020-12-15 12:00:00', - }, - { - title: 'g', - start: '2020-12-15 08:00:00', - end: '2020-12-15 17:30:00', - }, - ], - }) - - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let eventEls = timeGridWrapper.getEventEls() - let obscured = anyElsObscured(eventEls) - - expect(obscured).toBe(false) - }) - - // https://github.com/fullcalendar/fullcalendar/issues/2758 - it('renders without intersecting for certain arrangement', () => { - let calendar = initCalendar({ - initialDate: '2015-04-22', - initialView: 'timeGridDay', - scrollTime: '09:00', - slotEventOverlap: false, - editable: true, - events: [ - { - title: 'A', - start: '2015-04-22 10:00:00', - end: '2015-04-22 13:00:00', - }, - { - title: 'B', - start: '2015-04-22 13:00:00', - end: '2015-04-22 13:30:00', - }, - { - title: 'C', - start: '2015-04-22 10:00:00', - end: '2015-04-22 11:00:00', - }, - { - title: 'D', - start: '2015-04-22 22:00:00', - end: '2015-04-22 23:00:00', - }, - { - title: 'E', - start: '2015-04-22 10:00:00', - end: '2015-04-22 14:00:00', - }, - { - title: 'F', - start: '2015-04-22 14:00:00', - end: '2015-04-22 15:30:00', - }, - { - title: 'G', - start: '2015-04-22 22:00:00', - end: '2015-04-22 23:00:00', - }, - { - title: 'H', - start: '2015-04-22 22:00:00', - end: '2015-04-22 23:00:00', - }, - { - title: 'I', - start: '2015-04-22 15:00:00', - end: '2015-04-22 23:30:00', - }, - { - title: 'J', - start: '2015-04-22 10:00:00', - end: '2015-04-22 15:30:00', - }, - { - title: 'K', - start: '2015-04-22 22:00:00', - end: '2015-04-22 23:00:00', - }, - { - title: 'L', - start: '2015-04-22 12:00:00', - end: '2015-04-22 15:00:00', - }, - ], - }) - - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let eventEls = timeGridWrapper.getEventEls() - let obscured = anyElsObscured(eventEls) - - expect(obscured).toBe(false) - }) - - // https://github.com/fullcalendar/fullcalendar/issues/5004 - it('renders event widths somewhat equally', () => { - let calendar = initCalendar({ - initialView: 'timeGridDay', - initialDate: '2019-08-01', - slotDuration: '00:15:00', - slotEventOverlap: false, - events: [ - { start: '2019-08-01 08:00', end: '2019-08-01 09:00' }, - { start: '2019-08-01 08:00', end: '2019-08-01 09:00' }, - { start: '2019-08-01 08:30', end: '2019-08-01 09:30' }, - { start: '2019-08-01 09:00', end: '2019-08-01 10:00' }, - { start: '2019-08-01 09:00', end: '2019-08-01 10:00' }, - { start: '2019-08-01 09:30', end: '2019-08-01 10:30' }, - { start: '2019-08-01 09:30', end: '2019-08-01 10:30' }, - { start: '2019-08-01 10:00', end: '2019-08-01 11:00' }, - { start: '2019-08-01 10:00', end: '2019-08-01 11:00' }, - { start: '2019-08-01 10:00', end: '2019-08-01 11:00' }, - { start: '2019-08-01 10:00', end: '2019-08-01 11:00' }, - { start: '2019-08-01 10:00', end: '2019-08-01 11:00' }, - { start: '2019-08-01 10:00', end: '2019-08-01 11:00' }, - { start: '2019-08-01 10:00', end: '2019-08-01 11:00' }, - ], - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let eventEls = timeGridWrapper.getEventEls() - let eventWidths = eventEls.map((eventEl) => eventEl.getBoundingClientRect().width) - eventWidths.sort() // sorts highest to lowest - eventWidths.splice(0, 1) // remove first item, which is exceptionally wide event - expect(Math.abs(eventWidths[0] - eventWidths[eventWidths.length - 1])).toBeLessThan(1) - }) -}) diff --git a/fullcalendar-main/tests/src/event-render/timeText.ts b/fullcalendar-main/tests/src/event-render/timeText.ts deleted file mode 100644 index bee4182..0000000 --- a/fullcalendar-main/tests/src/event-render/timeText.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { FormatterInput } from '@fullcalendar/core' -import { parseLocalDate } from '../lib/date-parsing.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('the time text on events', () => { - describe('in week', () => { - pushOptions({ - initialView: 'timeGridWeek', - initialDate: '2017-07-03', - scrollTime: '00:00', - }) - - it('renders segs with correct local timezone', () => { - const FORMAT: FormatterInput = { - hour: 'numeric', - minute: '2-digit', - timeZoneName: 'short', - } - - let calendar = initCalendar({ - timeZone: 'local', - eventTimeFormat: FORMAT, - events: [ - { start: '2017-07-03T23:00:00', end: '2017-07-04T13:00:00' }, - ], - }) - - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let timeText = timeGridWrapper.getEventTimeTexts() - - expect(timeText).toEqual([ - currentCalendar.formatRange( - parseLocalDate('2017-07-03T23:00:00'), - parseLocalDate('2017-07-04T00:00:00'), - FORMAT, - ), - currentCalendar.formatRange( - parseLocalDate('2017-07-04T00:00:00'), - parseLocalDate('2017-07-04T13:00:00'), - FORMAT, - ), - ]) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/event-render/validRange.ts b/fullcalendar-main/tests/src/event-render/validRange.ts deleted file mode 100644 index 8cf5b15..0000000 --- a/fullcalendar-main/tests/src/event-render/validRange.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('validRange event rendering', () => { - describe('with start constraint', () => { - describe('when month view', () => { - pushOptions({ - initialView: 'dayGridMonth', - initialDate: '2017-06-01', - validRange: { start: '2017-06-07' }, - }) - - describe('when event is partially before', () => { - pushOptions({ - events: [ - { start: '2017-06-05', end: '2017-06-09' }, - ], - }) - - it('truncates the event\'s beginning', () => { - let calendar = initCalendar() - let calendarWrapper = new CalendarWrapper(calendar) - - let eventEl = calendarWrapper.getFirstEventEl() - let eventInfo = calendarWrapper.getEventElInfo(eventEl) - - expect(eventInfo.isStart).toBe(false) - expect(eventInfo.isEnd).toBe(true) - // TODO: more test about positioning - }) - }) - }) - }) - - describe('with end constraint', () => { - describe('when month view', () => { - pushOptions({ - initialView: 'dayGridMonth', - initialDate: '2017-06-01', - validRange: { end: '2017-06-07' }, - }) - - describe('when event is partially before', () => { - pushOptions({ - events: [ - { start: '2017-06-05', end: '2017-06-09' }, - ], - }) - - it('truncates the event\'s end', () => { - let calendar = initCalendar() - let calendarWrapper = new CalendarWrapper(calendar) - - let eventEl = calendarWrapper.getFirstEventEl() - let eventInfo = calendarWrapper.getEventElInfo(eventEl) - - expect(eventInfo.isStart).toBe(true) - expect(eventInfo.isEnd).toBe(false) - // TODO: more test about positioning - }) - }) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/event-resize/eventResizableFromStart.ts b/fullcalendar-main/tests/src/event-resize/eventResizableFromStart.ts deleted file mode 100644 index f70b7aa..0000000 --- a/fullcalendar-main/tests/src/event-resize/eventResizableFromStart.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import { waitEventResize } from '../lib/wrappers/interaction-util.js' - -describe('eventResizableFromStart', () => { - pushOptions({ - editable: true, - eventResizableFromStart: true, - }) - - describe('for DayGrid', () => { - pushOptions({ - initialDate: '2019-08-26', - initialView: 'dayGridMonth', - events: [ - { start: '2019-08-27', title: 'all day event' }, - ], - }) - - it('allows resizing from start', (done) => { - let calendar = initCalendar() - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - let resizing = dayGridWrapper.resizeEvent( - dayGridWrapper.getEventEls()[0], - '2019-08-27', - '2019-08-26', - true, // resize-from-start - ) - - waitEventResize(calendar, resizing).then(() => { - let event = calendar.getEvents()[0] - expect(event.start).toEqualDate('2019-08-26') - expect(event.end).toEqualDate('2019-08-28') - done() - }) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/event-resize/mirror-hooks.ts b/fullcalendar-main/tests/src/event-resize/mirror-hooks.ts deleted file mode 100644 index afb03ac..0000000 --- a/fullcalendar-main/tests/src/event-resize/mirror-hooks.ts +++ /dev/null @@ -1,110 +0,0 @@ -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' -import { waitEventResize } from '../lib/wrappers/interaction-util.js' -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' - -describe('event resize mirror', () => { - pushOptions({ - editable: true, - initialDate: '2018-12-25', - eventDragMinDistance: 0, // so mirror will render immediately upon mousedown - }) - - describe('in month view', () => { - pushOptions({ - initialView: 'dayGridMonth', - events: [ - { start: '2018-12-03', title: 'all day event' }, - ], - }) - - it('gets passed through render hooks', (done) => { - let mirrorMountCalls = 0 - let mirrorContentCalls = 0 - let mirrorUnmountCalls = 0 - - let calendar = initCalendar({ - eventDidMount(info) { - if (info.isMirror) { - mirrorMountCalls += 1 - } - }, - eventContent(info) { - if (info.isMirror) { - mirrorContentCalls += 1 - } - }, - eventWillUnmount(info) { - if (info.isMirror) { - mirrorUnmountCalls += 1 - } - }, - }) - - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let resizing = dayGridWrapper.resizeEvent( // drag TWO days - dayGridWrapper.getEventEls()[0], - '2018-12-03', - '2018-12-05', - ) - - waitEventResize(calendar, resizing).then(() => { - expect(mirrorMountCalls).toBe(1) - expect(mirrorContentCalls).toBe(3) - expect(mirrorUnmountCalls).toBe(1) - done() - }) - }) - }) - - describe('in timeGrid view', () => { - pushOptions({ - initialView: 'timeGridWeek', - scrollTime: '00:00', - slotDuration: '01:00', - snapDuration: '01:00', - events: [ - { start: '2018-12-25T01:00:00', end: '2018-12-25T02:00:00', title: 'timed event' }, - ], - }) - - it('gets passed through eventWillUnmount', (done) => { - let mirrorMountCalls = 0 - let mirrorContentCalls = 0 - let mirrorUnmountCalls = 0 - - let calendar = initCalendar({ - eventDidMount(info) { - if (info.isMirror) { - mirrorMountCalls += 1 - } - }, - eventContent(info) { - if (info.isMirror) { - mirrorContentCalls += 1 - } - }, - eventWillUnmount(info) { - if (info.isMirror) { - mirrorUnmountCalls += 1 - } - }, - }) - - let eventEl = new CalendarWrapper(calendar).getFirstEventEl() - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let resizing = timeGridWrapper.resizeEvent( - eventEl, - '2018-12-25T02:00:00', - '2018-12-25T04:00:00', // drag TWO snaps - ) - - waitEventResize(calendar, resizing).then(() => { - expect(mirrorMountCalls).toBe(1) - expect(mirrorContentCalls).toBe(3) - expect(mirrorUnmountCalls).toBe(1) - done() - }) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/event-resize/mirror-rendering.ts b/fullcalendar-main/tests/src/event-resize/mirror-rendering.ts deleted file mode 100644 index d247600..0000000 --- a/fullcalendar-main/tests/src/event-resize/mirror-rendering.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import { waitEventResize } from '../lib/wrappers/interaction-util.js' - -describe('event mirror rendering', () => { - pushOptions({ - editable: true, - }) - - it('maintains vertical position while dragging', (done) => { - let calendar = initCalendar({ - initialDate: '2019-08-26', - initialView: 'dayGridMonth', - eventOrder: 'title', - events: [ - { start: '2019-08-27', title: 'event0' }, - { start: '2019-08-27', title: 'event1' }, - ], - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let eventEls = dayGridWrapper.getEventEls() - - let resizing = dayGridWrapper.resizeEvent( - eventEls[1], - '2019-08-27', - '2019-08-28', - false, // resize-from-start - () => { // onBeforeRelease - let mirrorEls = dayGridWrapper.getMirrorEls() - expect(mirrorEls[0].getBoundingClientRect().top).toBe( - eventEls[1].getBoundingClientRect().top, - ) - }, - ) - - waitEventResize(calendar, resizing).then(() => done()) - }) -}) diff --git a/fullcalendar-main/tests/src/event-resize/validRange.ts b/fullcalendar-main/tests/src/event-resize/validRange.ts deleted file mode 100644 index e19cf71..0000000 --- a/fullcalendar-main/tests/src/event-resize/validRange.ts +++ /dev/null @@ -1,28 +0,0 @@ -import * as EventResizeUtils from '../lib/EventResizeUtils.js' -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' - -describe('validRange event resizing', () => { - describe('when in month view', () => { - pushOptions({ - initialView: 'dayGridMonth', - initialDate: '2017-06-01', - validRange: { end: '2017-06-09' }, - events: [ - { start: '2017-06-04', end: '2017-06-07' }, - ], - editable: true, - }) - - it('won\'t go after validRange', (done) => { - let calendar = initCalendar() - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - EventResizeUtils.resize( - dayGridWrapper.getDayEl('2017-06-06').getBoundingClientRect(), - dayGridWrapper.getDisabledDayEls()[0].getBoundingClientRect(), // where Jun 9th would be - ).then((res) => { - expect(res).toBe(false) - }).then(() => done()) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/event-source/Calendar.addEventSource.ts b/fullcalendar-main/tests/src/event-source/Calendar.addEventSource.ts deleted file mode 100644 index 70aa243..0000000 --- a/fullcalendar-main/tests/src/event-source/Calendar.addEventSource.ts +++ /dev/null @@ -1,29 +0,0 @@ -describe('addEventSource', () => { - it('will accept a processed api object after it was removed', () => { - initCalendar({ - eventSources: [ - { id: 'sourceA', events: [] }, - ], - }) - expect(currentCalendar.getEventSources().length).toBe(1) - let source = currentCalendar.getEventSourceById('sourceA') - source.remove() - expect(currentCalendar.getEventSources().length).toBe(0) - let newSource = currentCalendar.addEventSource(source) - expect(currentCalendar.getEventSources().length).toBe(1) - expect(newSource).toBe(source) - }) - - it('won\'t re-add a source that it already has', () => { - initCalendar({ - eventSources: [ - { id: 'sourceA', events: [] }, - ], - }) - expect(currentCalendar.getEventSources().length).toBe(1) - let source = currentCalendar.getEventSourceById('sourceA') - let newSource = currentCalendar.addEventSource(source) - expect(currentCalendar.getEventSources().length).toBe(1) - expect(newSource).toBe(source) - }) -}) diff --git a/fullcalendar-main/tests/src/event-source/eventSourceSuccess.ts b/fullcalendar-main/tests/src/event-source/eventSourceSuccess.ts deleted file mode 100644 index 53bb4b7..0000000 --- a/fullcalendar-main/tests/src/event-source/eventSourceSuccess.ts +++ /dev/null @@ -1,37 +0,0 @@ -describe('eventSourceSuccess', () => { - const FETCH_FUNC = (info, successCallback) => { - successCallback({ - something: [ - { title: 'hi', start: '2018-10-01' }, - ], - }) - } - - const TRANSFORM = (input) => input.something - - pushOptions({ - initialDate: '2018-10-01', - }) - - it('massages event data with calendar-wide setting', () => { - initCalendar({ - eventSources: [FETCH_FUNC], - eventSourceSuccess: TRANSFORM, - }) - - expect(currentCalendar.getEvents().length).toBe(1) - }) - - it('massages event data with source setting', () => { - initCalendar({ - eventSources: [ - { - events: FETCH_FUNC, - success: TRANSFORM, - }, - ], - }) - - expect(currentCalendar.getEvents().length).toBe(1) - }) -}) diff --git a/fullcalendar-main/tests/src/event-source/getEventSourceById.ts b/fullcalendar-main/tests/src/event-source/getEventSourceById.ts deleted file mode 100644 index 98f9e3c..0000000 --- a/fullcalendar-main/tests/src/event-source/getEventSourceById.ts +++ /dev/null @@ -1,10 +0,0 @@ -describe('getEventSourceById', () => { - xit('correctly retrieves an event source provided via `events` at initialization', () => { - }) - - xit('correctly retrieves an event source provided via `eventSources` at initialization', () => { - }) - - xit('correctly retrieves an event source provided via `addEventSource` method', () => { - }) -}) diff --git a/fullcalendar-main/tests/src/event-source/getEventSources.ts b/fullcalendar-main/tests/src/event-source/getEventSources.ts deleted file mode 100644 index 2b125cd..0000000 --- a/fullcalendar-main/tests/src/event-source/getEventSources.ts +++ /dev/null @@ -1,10 +0,0 @@ -describe('getEventSources', () => { - xit('correctly retrieves event sources provided via `events` at initialization', () => { - }) - - xit('correctly retrieves event sources provided via `eventSources` at initialization', () => { - }) - - xit('correctly retrieves event sources provided via `addEventSource` method', () => { - }) -}) diff --git a/fullcalendar-main/tests/src/event-source/navigation.ts b/fullcalendar-main/tests/src/event-source/navigation.ts deleted file mode 100644 index b7c3698..0000000 --- a/fullcalendar-main/tests/src/event-source/navigation.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('event fetching while date-navigating', () => { - // https://github.com/fullcalendar/fullcalendar/issues/4975 - it('renders events when doing next() and then prev()', (done) => { - let calendar = initCalendar({ - initialView: 'dayGridMonth', - initialDate: '2020-02-11', - events(arg, callback) { - if (arg.startStr.indexOf('2020-01-26') === 0) { // for Feb - setTimeout(() => { - callback([ - { start: '2020-02-15' }, // middle of month - ]) - }, 100) - } else if (arg.startStr.indexOf('2020-03-01') === 0) { // for March - setTimeout(() => { - callback([ - { start: '2020-03-15' }, // middle of month - ]) - }, 100) - } else { - throw new Error('bad range') - } - }, - }) - let calendarWrapper = new CalendarWrapper(calendar) - - setTimeout(() => { - currentCalendar.next() - setTimeout(() => { - currentCalendar.prev() - setTimeout(() => { - expect(calendarWrapper.getEventEls().length).toBe(1) - done() - }, 1000) // after everything - }, 50) // before second fetch finishes - }, 200) // let first fetch finish - }) -}) diff --git a/fullcalendar-main/tests/src/event-source/refetch.ts b/fullcalendar-main/tests/src/event-source/refetch.ts deleted file mode 100644 index 3c93627..0000000 --- a/fullcalendar-main/tests/src/event-source/refetch.ts +++ /dev/null @@ -1,132 +0,0 @@ -describe('event source refetch', () => { - const OPTIONS = { - now: '2015-08-07', - initialView: 'timeGridDay', - scrollTime: '00:00', - } - - describe('with a single event source', () => { // reword this stuff - it('will be refetched', () => { - let fetchConfig = { eventCount: 1, fetchId: 7 } - let calendar = initWithSources(fetchConfig) - - expect($('.source1-7').length).toEqual(1) - expect($('.source2-7').length).toEqual(1) - expect($('.source3-7').length).toEqual(1) - - fetchConfig.eventCount = 2 - fetchConfig.fetchId = 8 - calendar.getEventSourceById('blue').refetch() - - // events from unaffected sources remain - expect($('.source1-7').length).toEqual(1) - expect($('.source3-7').length).toEqual(1) - - // events from old fetch were cleared - expect($('.source2-7').length).toEqual(0) - - // events from new fetch were rendered - expect($('.source2-8').length).toEqual(2) - }) - }) - - describe('multiple event sources', () => { - it('will be refetched', () => { - let fetchConfig = { eventCount: 1, fetchId: 7 } - let calendar = initWithSources(fetchConfig) - - expect($('.source1-7').length).toEqual(1) - expect($('.source2-7').length).toEqual(1) - expect($('.source3-7').length).toEqual(1) - - fetchConfig.eventCount = 2 - fetchConfig.fetchId = 8 - calendar.getEventSourceById('green0').refetch() - calendar.getEventSourceById('green1').refetch() - - // events from unaffected sources remain - expect($('.source2-7').length).toEqual(1) - - // events from old fetch were cleared - expect($('.source1-7').length).toEqual(0) - expect($('.source3-7').length).toEqual(0) - - // events from new fetch were rendered - expect($('.source1-8').length).toEqual(2) - expect($('.source3-8').length).toEqual(2) - }) - }) - - describe('when called while initial fetch is still pending', () => { - it('keeps old events and rerenders new', (done) => { - let fetchConfig = { eventCount: 1, fetchId: 7, fetchDelay: 100 } - let calendar = initWithSources(fetchConfig) - - fetchConfig.eventCount = 2 - fetchConfig.fetchId = 8 - calendar.getEventSourceById('green0').refetch() - calendar.getEventSourceById('green1').refetch() - - setTimeout(() => { - // events from unaffected sources remain - expect($('.source2-7').length).toEqual(1) - - // events from old fetch were cleared - expect($('.source1-7').length).toEqual(0) - expect($('.source3-7').length).toEqual(0) - - // events from new fetch were rendered - expect($('.source1-8').length).toEqual(2) - expect($('.source3-8').length).toEqual(2) - - done() - }, fetchConfig.fetchDelay + 1) - }) - }) - - function initWithSources(fetchConfig) { - return initCalendar({ - ...OPTIONS, - eventSources: [ - { - id: 'green0', - events: createEventGenerator('source1-', fetchConfig), - color: 'green', - }, - { - id: 'blue', - events: createEventGenerator('source2-', fetchConfig), - color: 'blue', - }, - { - id: 'green1', - events: createEventGenerator('source3-', fetchConfig), - color: 'green', - }, - ], - }) - } - - function createEventGenerator(classNamePrefix, fetchConfig) { - return (arg, callback) => { - let events = [] - - for (let i = 0; i < fetchConfig.eventCount; i += 1) { - events.push({ - start: '2015-08-07T02:00:00', - end: '2015-08-07T03:00:00', - className: classNamePrefix + fetchConfig.fetchId, - title: classNamePrefix + fetchConfig.fetchId, // also make it the title - }) - } - - if (fetchConfig.fetchDelay) { - setTimeout(() => { - callback(events) - }, fetchConfig.fetchDelay) - } else { - callback(events) - } - } - } -}) diff --git a/fullcalendar-main/tests/src/event-source/remove.ts b/fullcalendar-main/tests/src/event-source/remove.ts deleted file mode 100644 index a221ff2..0000000 --- a/fullcalendar-main/tests/src/event-source/remove.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('event source remove', () => { - pushOptions({ - initialDate: '2014-08-01', - }) - - it('correctly removes events provided via `eventSources` at initialization', () => { - let calendar = initCalendar({ - eventSources: [{ - id: '5', - events: [ - { title: 'event1', start: '2014-08-01' }, - { title: 'event2', start: '2014-08-02' }, - ], - }], - }) - let calendarWrapper = new CalendarWrapper(calendar) - - expect(calendar.getEvents().length).toBe(2) - expect(calendarWrapper.getEventEls().length).toBe(2) - - calendar.getEventSourceById('5').remove() - - expect(calendar.getEvents().length).toBe(0) - expect(calendarWrapper.getEventEls().length).toBe(0) - }) - - it('won\'t render removed events when subsequent addEventSource', (done) => { - let source1 = { - id: '1', - events(arg, callback) { - setTimeout(() => { - callback([{ - title: 'event1', - className: 'event1', - start: '2014-08-01T02:00:00', - }]) - }, 100) - }, - } - - let source2 = { - id: '2', - events(arg, callback) { - setTimeout(() => { - callback([{ - title: 'event2', - className: 'event2', - start: '2014-08-01T02:00:00', - }]) - }, 100) - }, - } - - let calendar = initCalendar({ - eventSources: [source1], - }) - - calendar.getEventSourceById('1').remove() - calendar.addEventSource(source2) - - setTimeout(() => { - expect($('.event1').length).toBe(0) - expect($('.event2').length).toBe(1) - done() - }, 101) - }) -}) diff --git a/fullcalendar-main/tests/src/global-locale.js b/fullcalendar-main/tests/src/global-locale.js deleted file mode 100644 index 74a5728..0000000 --- a/fullcalendar-main/tests/src/global-locale.js +++ /dev/null @@ -1,15 +0,0 @@ - -describe('FullCalendar single locale', () => { - it('loads correctly', () => { - const el = document.createElement('div') - document.body.appendChild(el) - - const calendar = new FullCalendar.Calendar(el) - const availableLocales = calendar.getAvailableLocaleCodes() - - expect(availableLocales.indexOf('ar') !== -1).toBe(true) - - calendar.destroy() - document.body.removeChild(el) - }) -}) diff --git a/fullcalendar-main/tests/src/global-locales-all.js b/fullcalendar-main/tests/src/global-locales-all.js deleted file mode 100644 index e90428c..0000000 --- a/fullcalendar-main/tests/src/global-locales-all.js +++ /dev/null @@ -1,16 +0,0 @@ - -describe('FullCalendar locales-all', () => { - it('loads correctly', () => { - const el = document.createElement('div') - document.body.appendChild(el) - - const calendar = new FullCalendar.Calendar(el) - const availableLocales = calendar.getAvailableLocaleCodes() - - expect(availableLocales.indexOf('es') !== -1).toBe(true) - expect(availableLocales.indexOf('fr') !== -1).toBe(true) - - calendar.destroy() - document.body.removeChild(el) - }) -}) diff --git a/fullcalendar-main/tests/src/icalendar/data/alldayEvent.ts b/fullcalendar-main/tests/src/icalendar/data/alldayEvent.ts deleted file mode 100644 index e9c417b..0000000 --- a/fullcalendar-main/tests/src/icalendar/data/alldayEvent.ts +++ /dev/null @@ -1,21 +0,0 @@ -export default `BEGIN:VCALENDAR -VERSION:2.0 -CALSCALE:GREGORIAN -METHOD:PUBLISH -X-WR-CALNAME:events@fullcalendar.test -X-WR-TIMEZONE:Europe/Paris -BEGIN:VEVENT -DTSTART;VALUE=DATE:20190415 -DTSTAMP:20201006T124223Z -UID:1234578 -CREATED:20190408T110429Z -DESCRIPTION:this is the description -URL:https://fullcalendar.io/ -LAST-MODIFIED:20190409T110738Z -LOCATION:this is the location -SEQUENCE:0 -STATUS:CONFIRMED -SUMMARY:First conference -TRANSP:OPAQUE -END:VEVENT -END:VCALENDAR` diff --git a/fullcalendar-main/tests/src/icalendar/data/meetingWithMungedStart.ts b/fullcalendar-main/tests/src/icalendar/data/meetingWithMungedStart.ts deleted file mode 100644 index 9bf6237..0000000 --- a/fullcalendar-main/tests/src/icalendar/data/meetingWithMungedStart.ts +++ /dev/null @@ -1,22 +0,0 @@ -export default `BEGIN:VCALENDAR -VERSION:2.0 -CALSCALE:GREGORIAN -METHOD:PUBLISH -X-WR-CALNAME:events@fullcalendar.test -X-WR-TIMEZONE:Europe/Paris -BEGIN:VEVENT -DTSTART:20190415TRRRRRRZ -DTEND:20190415T109900Z -DTSTAMP:20201006T124223Z -UID:12345678 -ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;CN=test@fullcalendar.test;X-NUM-GUESTS=0:mailto:test@fullcalendar.test -CREATED:20190412T223947Z -DESCRIPTION: -LAST-MODIFIED:20190412T223947Z -LOCATION: -SEQUENCE:0 -STATUS:CONFIRMED -SUMMARY:Munged meeting (No DTSTART) -TRANSP:OPAQUE -END:VEVENT -END:VCALENDAR` diff --git a/fullcalendar-main/tests/src/icalendar/data/multidayEvent.ts b/fullcalendar-main/tests/src/icalendar/data/multidayEvent.ts deleted file mode 100644 index b04edbb..0000000 --- a/fullcalendar-main/tests/src/icalendar/data/multidayEvent.ts +++ /dev/null @@ -1,21 +0,0 @@ -export default `BEGIN:VCALENDAR -VERSION:2.0 -CALSCALE:GREGORIAN -METHOD:PUBLISH -X-WR-CALNAME:events@fullcalendar.test -X-WR-TIMEZONE:Europe/Paris -BEGIN:VEVENT -DTSTART;VALUE=DATE:20190410 -DTSTAMP:20201006T124223Z -DTEND;VALUE=DATE:20190413 -UID:1234578 -CREATED:20190408T110429Z -DESCRIPTION: -LAST-MODIFIED:20190409T110738Z -LOCATION: -SEQUENCE:0 -STATUS:CONFIRMED -SUMMARY:First conference -TRANSP:OPAQUE -END:VEVENT -END:VCALENDAR` diff --git a/fullcalendar-main/tests/src/icalendar/data/multipleEventsOneMunged.ts b/fullcalendar-main/tests/src/icalendar/data/multipleEventsOneMunged.ts deleted file mode 100644 index 31d2b87..0000000 --- a/fullcalendar-main/tests/src/icalendar/data/multipleEventsOneMunged.ts +++ /dev/null @@ -1,34 +0,0 @@ -export default `BEGIN:VCALENDAR -VERSION:2.0 -CALSCALE:GREGORIAN -METHOD:PUBLISH -X-WR-CALNAME:events@fullcalendar.test -X-WR-TIMEZONE:Europe/Paris -BEGIN:VEVENT -DTEND;VALUE=DATE:20190413 -DTSTAMP:20201006T124223Z -UID:1234578 -CREATED:20190408T110429Z -DESCRIPTION: -LAST-MODIFIED:20190409T110738Z -LOCATION: -SEQUENCE:0 -STATUS:CONFIRMED -SUMMARY:Munged conference (No DTSTART) -TRANSP:OPAQUE -END:VEVENT -BEGIN:VEVENT -DTSTART;VALUE=DATE:20190416 -DTEND;VALUE=DATE:20190417 -DTSTAMP:20201008T153019Z -UID:1234578 -DTSTAMP:20201008T153019Z -DESCRIPTION: -LAST-MODIFIED:20190409T110738Z -LOCATION: -SEQUENCE:0 -STATUS:CONFIRMED -SUMMARY:Valid conference -TRANSP:OPAQUE -END:VEVENT -END:VCALENDAR` diff --git a/fullcalendar-main/tests/src/icalendar/data/multipleMultidayEvents.ts b/fullcalendar-main/tests/src/icalendar/data/multipleMultidayEvents.ts deleted file mode 100644 index 7eb1bbd..0000000 --- a/fullcalendar-main/tests/src/icalendar/data/multipleMultidayEvents.ts +++ /dev/null @@ -1,35 +0,0 @@ -export default `BEGIN:VCALENDAR -VERSION:2.0 -CALSCALE:GREGORIAN -METHOD:PUBLISH -X-WR-CALNAME:events@fullcalendar.test -X-WR-TIMEZONE:Europe/Paris -BEGIN:VEVENT -DTSTART;VALUE=DATE:20190410 -DTEND;VALUE=DATE:20190413 -DTSTAMP:20201006T124223Z -UID:1234578 -CREATED:20190408T110429Z -DESCRIPTION: -LAST-MODIFIED:20190409T110738Z -LOCATION: -SEQUENCE:0 -STATUS:CONFIRMED -SUMMARY:First conference -TRANSP:OPAQUE -END:VEVENT -BEGIN:VEVENT -DTSTART;VALUE=DATE:20190416 -DTEND;VALUE=DATE:20190417 -DTSTAMP:20201008T153019Z -UID:1234578 -DTSTAMP:20201008T153019Z -DESCRIPTION: -LAST-MODIFIED:20190409T110738Z -LOCATION: -SEQUENCE:0 -STATUS:CONFIRMED -SUMMARY:Second conference -TRANSP:OPAQUE -END:VEVENT -END:VCALENDAR` diff --git a/fullcalendar-main/tests/src/icalendar/data/mungedOneHourMeeting.ts b/fullcalendar-main/tests/src/icalendar/data/mungedOneHourMeeting.ts deleted file mode 100644 index eebedef..0000000 --- a/fullcalendar-main/tests/src/icalendar/data/mungedOneHourMeeting.ts +++ /dev/null @@ -1,21 +0,0 @@ -export default `BEGIN:VCALENDAR -VERSION:2.0 -CALSCALE:GREGORIAN -METHOD:PUBLISH -X-WR-CALNAME:events@fullcalendar.test -X-WR-TIMEZONE:Europe/Paris -BEGIN:VEVENT -DTEND:20190415T109900Z -DTSTAMP:20201006T124223Z -UID:12345678 -ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;CN=test@fullcalendar.test;X-NUM-GUESTS=0:mailto:test@fullcalendar.test -CREATED:20190412T223947Z -DESCRIPTION: -LAST-MODIFIED:20190412T223947Z -LOCATION: -SEQUENCE:0 -STATUS:CONFIRMED -SUMMARY:Munged meeting (No DTSTART) -TRANSP:OPAQUE -END:VEVENT -END:VCALENDAR` diff --git a/fullcalendar-main/tests/src/icalendar/data/oneHourMeeting.ts b/fullcalendar-main/tests/src/icalendar/data/oneHourMeeting.ts deleted file mode 100644 index bde6ddb..0000000 --- a/fullcalendar-main/tests/src/icalendar/data/oneHourMeeting.ts +++ /dev/null @@ -1,22 +0,0 @@ -export default `BEGIN:VCALENDAR -VERSION:2.0 -CALSCALE:GREGORIAN -METHOD:PUBLISH -X-WR-CALNAME:events@fullcalendar.test -X-WR-TIMEZONE:Europe/Paris -BEGIN:VEVENT -DTSTART:20190415T093000Z -DTEND:20190415T103000Z -DTSTAMP:20201006T124223Z -UID:12345678 -ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;CN=test@fullcalendar.test;X-NUM-GUESTS=0:mailto:test@fullcalendar.test -CREATED:20190412T223947Z -DESCRIPTION: -LAST-MODIFIED:20190412T223947Z -LOCATION: -SEQUENCE:0 -STATUS:CONFIRMED -SUMMARY:Hour long meeting -TRANSP:OPAQUE -END:VEVENT -END:VCALENDAR` diff --git a/fullcalendar-main/tests/src/icalendar/data/recurrenceId.ts b/fullcalendar-main/tests/src/icalendar/data/recurrenceId.ts deleted file mode 100644 index 21d0fbf..0000000 --- a/fullcalendar-main/tests/src/icalendar/data/recurrenceId.ts +++ /dev/null @@ -1,60 +0,0 @@ -export default `BEGIN:VCALENDAR -VERSION:2.0 -PRODID:-//vereinify.com//NONSGML kigkonsult.se iCalcreator 2.39.1// -CALSCALE:GREGORIAN -METHOD:PUBLISH -UID:3ddaed11-9b03-4b3b-a90b-4aa1b8742fff -REFRESH-INTERVAL;VALUE=DURATION:PT15M -X-WR-CALNAME:Example -X-WR-CALDESC:Description -X-WR-RELCALID:3ddaed11-9b03-4b3b-a90b-4aa1b8742fff -X-WR-TIMEZONE:Europe/Berlin -X-LIC-LOCATION:Europe/Berlin -X-PUBLISHED-TTL:PT15M: -BEGIN:VTIMEZONE -TZID:Europe/Berlin -BEGIN:STANDARD -TZNAME:CET -DTSTART:20201025T030000 -TZOFFSETFROM:+0200 -TZOFFSETTO:+0100 -RDATE:20211031T030000 -RDATE:20221030T030000 -END:STANDARD -BEGIN:DAYLIGHT -TZNAME:CEST -DTSTART:20210328T020000 -TZOFFSETFROM:+0100 -TZOFFSETTO:+0200 -RDATE:20220327T020000 -END:DAYLIGHT -END:VTIMEZONE -BEGIN:VEVENT -UID:af80d1e9-2adb-4e06-8483-3130c18305b1 -DTSTAMP:20210713T065637Z -CLASS:PUBLIC -CREATED:20210712T150845Z -DTSTART;TZID=Europe/Berlin:20210705T140000 -DTEND;TZID=Europe/Berlin:20210705T143000 -EXDATE;TZID=Europe/Berlin:20210713T140000 -EXDATE;TZID=Europe/Berlin:20210715T140000 -LAST-MODIFIED:20210712T150845Z -RRULE:FREQ=DAILY -SEQUENCE:1 -SUMMARY:Daily Recurring -TRANSP:OPAQUE -END:VEVENT -BEGIN:VEVENT -UID:af80d1e9-2adb-4e06-8483-3130c18305b1 -DTSTAMP:20210713T065637Z -CLASS:PUBLIC -CREATED:20210712T150845Z -DTSTART;TZID=Europe/Berlin:20210708T141500 -DTEND;TZID=Europe/Berlin:20210708T144500 -LAST-MODIFIED:20210712T150845Z -RECURRENCE-ID;TZID=Europe/Berlin:20210708T140000 -SEQUENCE:0 -SUMMARY:Daily Recurring (Update-1) -TRANSP:OPAQUE -END:VEVENT -END:VCALENDAR` diff --git a/fullcalendar-main/tests/src/icalendar/data/recurringWeekly.ts b/fullcalendar-main/tests/src/icalendar/data/recurringWeekly.ts deleted file mode 100644 index 1ee808b..0000000 --- a/fullcalendar-main/tests/src/icalendar/data/recurringWeekly.ts +++ /dev/null @@ -1,24 +0,0 @@ -export default `BEGIN:VCALENDAR -VERSION:2.0 -CALSCALE:GREGORIAN -METHOD:PUBLISH -X-WR-CALNAME:events@fullcalendar.test -X-WR-TIMEZONE:Europe/Paris -BEGIN:VEVENT -DTSTART;TZID=Europe/Zurich:20190401T173000 -DTEND;TZID=Europe/Zurich:20190401T183000 -RRULE:FREQ=WEEKLY;WKST=MO;BYDAY=MO -DTSTAMP:20201006T124223Z -ORGANIZER;CN=Testy McTestface:mailto:test@fullcalendar.test -UID:12345678 -CREATED:20181210T150458Z -DESCRIPTION:this is the description -URL:https://fullcalendar.io/ -LAST-MODIFIED:20190508T170523Z -LOCATION:this is the location -SEQUENCE:0 -STATUS:CONFIRMED -SUMMARY:Weekly Monday meeting -TRANSP:OPAQUE -END:VEVENT -END:VCALENDAR` diff --git a/fullcalendar-main/tests/src/icalendar/data/recurringWeeklyWithCount.ts b/fullcalendar-main/tests/src/icalendar/data/recurringWeeklyWithCount.ts deleted file mode 100644 index ed29cba..0000000 --- a/fullcalendar-main/tests/src/icalendar/data/recurringWeeklyWithCount.ts +++ /dev/null @@ -1,23 +0,0 @@ -export default `BEGIN:VCALENDAR -VERSION:2.0 -CALSCALE:GREGORIAN -METHOD:PUBLISH -X-WR-CALNAME:events@fullcalendar.test -X-WR-TIMEZONE:Europe/Paris -BEGIN:VEVENT -DTSTART;TZID=Europe/Zurich:20190301T173000 -DTEND;TZID=Europe/Zurich:20190301T183000 -RRULE:FREQ=WEEKLY;WKST=MO;BYDAY=MO;COUNT=9 -DTSTAMP:20201006T124223Z -ORGANIZER;CN=Testy McTestface:mailto:test@fullcalendar.test -UID:12345678 -CREATED:20181210T150458Z -DESCRIPTION: -LAST-MODIFIED:20190508T170523Z -LOCATION: -SEQUENCE:0 -STATUS:CONFIRMED -SUMMARY:Weekly Monday meeting -TRANSP:OPAQUE -END:VEVENT -END:VCALENDAR` diff --git a/fullcalendar-main/tests/src/icalendar/data/recurringWeeklyWithoutEnd.ts b/fullcalendar-main/tests/src/icalendar/data/recurringWeeklyWithoutEnd.ts deleted file mode 100644 index 66892f2..0000000 --- a/fullcalendar-main/tests/src/icalendar/data/recurringWeeklyWithoutEnd.ts +++ /dev/null @@ -1,22 +0,0 @@ -export default `BEGIN:VCALENDAR -VERSION:2.0 -CALSCALE:GREGORIAN -METHOD:PUBLISH -X-WR-CALNAME:events@fullcalendar.test -X-WR-TIMEZONE:Europe/Paris -BEGIN:VEVENT -DTSTART;TZID=Europe/Zurich:20190401T173000 -RRULE:FREQ=WEEKLY;WKST=MO;BYDAY=MO -DTSTAMP:20201006T124223Z -ORGANIZER;CN=Testy McTestface:mailto:test@fullcalendar.test -UID:12345678 -CREATED:20181210T150458Z -DESCRIPTION: -LAST-MODIFIED:20190508T170523Z -LOCATION: -SEQUENCE:0 -STATUS:CONFIRMED -SUMMARY:Weekly Monday meeting -TRANSP:OPAQUE -END:VEVENT -END:VCALENDAR` diff --git a/fullcalendar-main/tests/src/icalendar/data/timedMeetingWithDuration.ts b/fullcalendar-main/tests/src/icalendar/data/timedMeetingWithDuration.ts deleted file mode 100644 index 0f653a4..0000000 --- a/fullcalendar-main/tests/src/icalendar/data/timedMeetingWithDuration.ts +++ /dev/null @@ -1,22 +0,0 @@ -export default `BEGIN:VCALENDAR -VERSION:2.0 -CALSCALE:GREGORIAN -METHOD:PUBLISH -X-WR-CALNAME:events@fullcalendar.test -X-WR-TIMEZONE:Europe/Paris -BEGIN:VEVENT -DTSTART:20190415T093000Z -DURATION:PT4H -DTSTAMP:20201006T124223Z -UID:12345678 -ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;CN=test@fullcalendar.test;X-NUM-GUESTS=0:mailto:test@fullcalendar.test -CREATED:20190412T223947Z -DESCRIPTION: -LAST-MODIFIED:20190412T223947Z -LOCATION: -SEQUENCE:0 -STATUS:CONFIRMED -SUMMARY:Hour long meeting -TRANSP:OPAQUE -END:VEVENT -END:VCALENDAR` diff --git a/fullcalendar-main/tests/src/icalendar/data/timedMeetingWithoutEnd.ts b/fullcalendar-main/tests/src/icalendar/data/timedMeetingWithoutEnd.ts deleted file mode 100644 index 1429479..0000000 --- a/fullcalendar-main/tests/src/icalendar/data/timedMeetingWithoutEnd.ts +++ /dev/null @@ -1,21 +0,0 @@ -export default `BEGIN:VCALENDAR -VERSION:2.0 -CALSCALE:GREGORIAN -METHOD:PUBLISH -X-WR-CALNAME:events@fullcalendar.test -X-WR-TIMEZONE:Europe/Paris -BEGIN:VEVENT -DTSTART:20190415T093000Z -DTSTAMP:20201006T124223Z -UID:12345678 -ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;CN=test@fullcalendar.test;X-NUM-GUESTS=0:mailto:test@fullcalendar.test -CREATED:20190412T223947Z -DESCRIPTION: -LAST-MODIFIED:20190412T223947Z -LOCATION: -SEQUENCE:0 -STATUS:CONFIRMED -SUMMARY:Hour long meeting -TRANSP:OPAQUE -END:VEVENT -END:VCALENDAR` diff --git a/fullcalendar-main/tests/src/icalendar/day-view.ts b/fullcalendar-main/tests/src/icalendar/day-view.ts deleted file mode 100644 index 9531dd7..0000000 --- a/fullcalendar-main/tests/src/icalendar/day-view.ts +++ /dev/null @@ -1,224 +0,0 @@ -import fetchMock from 'fetch-mock' -import timeGridPlugin from '@fullcalendar/timegrid' -import { EventSourceInput } from '@fullcalendar/core' -import iCalendarPlugin from '@fullcalendar/icalendar' -import oneHourMeeting from './data/oneHourMeeting.js' -import recurringWeekly from './data/recurringWeekly.js' -import mungedOneHourMeeting from './data/mungedOneHourMeeting.js' -import meetingWithMungedStart from './data/meetingWithMungedStart.js' -import alldayEvent from './data/alldayEvent.js' -import timedMeetingWithoutEnd from './data/timedMeetingWithoutEnd.js' -import timedMeetingWithDuration from './data/timedMeetingWithDuration.js' -import dataWithRecurrenceId from './data/recurrenceId.js' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('addICalEventSource with day view', () => { - const ICAL_MIME_TYPE = 'text/calendar' - - pushOptions({ - plugins: [iCalendarPlugin, timeGridPlugin], - initialDate: '2019-04-15', // The start of the week for oneHourMeeting - initialView: 'timeGridDay', - timeZone: 'Europe/Paris', - }) - - afterEach(() => { - fetchMock.restore() - }) - - it('adds a one-hour long meeting', (done) => { - loadICalendarWith(oneHourMeeting, () => { - setTimeout(() => { - assertEventCount(1) - done() - }, 100) - }) - }) - - it('adds a repeating weekly meeting', (done) => { - loadICalendarWith(recurringWeekly, () => { - setTimeout(() => { - assertEventCount(1) - const event = currentCalendar.getEvents()[0] - // test non-date props - expect(event.title).toBe('Weekly Monday meeting') - expect(event.url).toBe('https://fullcalendar.io/') - expect(event.extendedProps.description).toBe('this is the description') - expect(event.extendedProps.location).toBe('this is the location') - done() - }, 100) - }) - }) - - it('adds an all day event', (done) => { - loadICalendarWith(alldayEvent, () => { - setTimeout(() => { - assertEventCount(1) - const events = currentCalendar.getEvents() - events.forEach((event) => expect(event.allDay).toBeTruthy()) - // test non-date props - expect(events[0].title).toBe('First conference') - expect(events[0].url).toBe('https://fullcalendar.io/') - expect(events[0].extendedProps.description).toBe('this is the description') - expect(events[0].extendedProps.location).toBe('this is the location') - done() - }, 100) - }) - }) - - it('ignores a munged event', (done) => { - loadICalendarWith(mungedOneHourMeeting, () => { - setTimeout(() => { - assertEventCount(0) - done() - }, 100) - }) - }) - - it('ignores a meeting with a munged start', (done) => { - loadICalendarWith(meetingWithMungedStart, () => { - setTimeout(() => { - assertEventCount(0) - done() - }, 100) - }) - }) - - it('sets default duration when forceEventDuration is enabled and no end or duration included in the VEVENT', (done) => { - loadICalendarWith( - timedMeetingWithoutEnd, - () => { - setTimeout(() => { - assertEventCount(1) - const event = currentCalendar.getEvents()[0] - expect(event.end.getHours()).toEqual(event.start.getHours() + 3) - done() - }, 100) - }, - (source) => { - initCalendar({ - forceEventDuration: true, - defaultTimedEventDuration: '03:00', - }).addEventSource(source) - }, - ) - }) - - it('sets end to null when forceEventDuration is disabled and no end or duration included in the VEVENT', (done) => { - loadICalendarWith( - timedMeetingWithoutEnd, - () => { - setTimeout(() => { - assertEventCount(1) - const event = currentCalendar.getEvents()[0] - expect(event.end).toBe(null) - done() - }, 100) - }, - (source) => { - initCalendar({ - defaultTimedEventDuration: '03:00', - forceEventDuration: false, - }).addEventSource(source) - }, - ) - }) - - it('does not override iCal DURATION in VEVENT', (done) => { - loadICalendarWith( - timedMeetingWithDuration, - () => { - setTimeout(() => { - assertEventCount(1) - const event = currentCalendar.getEvents()[0] - expect(event.end.getHours()).toEqual(event.start.getHours() + 4) - done() - }, 100) - }, - (source) => { - initCalendar({ - forceEventDuration: true, - defaultTimedEventDuration: '03:00', - }).addEventSource(source) - }, - ) - }) - - // https://github.com/fullcalendar/fullcalendar/issues/6451 - it('respects RECURRENCE-ID and does not render double events', (done) => { - loadICalendarWith( - dataWithRecurrenceId, - () => { - setTimeout(() => { - let timeGridWrapper = new TimeGridViewWrapper(currentCalendar).timeGrid - let eventEls = timeGridWrapper.getEventEls() - expect(eventEls.length).toBe(1) - done() - }, 100) - }, - (source) => { - initCalendar({ - initialDate: '2021-07-08', - }).addEventSource(source) - }, - ) - }) - - it('does not reload data on next', (done) => { - let requestCnt = 0 - - const givenUrl = window.location.href + '/my-feed.php' - fetchMock.get(/my-feed\.php/, () => { - requestCnt++ - return { - headers: { 'content-type': ICAL_MIME_TYPE }, - body: timedMeetingWithDuration, - } - }) - - initCalendar().addEventSource({ url: givenUrl, format: 'ics' } as EventSourceInput) - - setTimeout(() => { - assertEventCount(1) - currentCalendar.next() - expect(requestCnt).toBe(1) - done() - }, 100) - }) - - function loadICalendarWith( - rawICal: string, - assertions: () => void, - calendarSetup?: (source: EventSourceInput) => void, - ) { - const givenUrl = window.location.href + '/my-feed.php' - fetchMock.get(/my-feed\.php/, { - headers: { 'content-type': ICAL_MIME_TYPE }, - body: rawICal, - }) - - const source = { url: givenUrl, format: 'ics' } as EventSourceInput - - if (calendarSetup) { - calendarSetup(source) - } else { - initCalendar().addEventSource(source) - } - - const [requestUrl] = fetchMock.lastCall() - const requestParamStr = new URL(requestUrl).searchParams.toString() - expect(requestParamStr).toBe('') - - assertions() - } - - // Checks to make sure all events have been rendered and that the calendar - // has internal info on all the events. - function assertEventCount(expectedCount: number) { - expect(currentCalendar.getEvents().length).toEqual(expectedCount) - - let calendarWrapper = new CalendarWrapper(currentCalendar) - expect(calendarWrapper.getEventEls().length).toEqual(expectedCount) - } -}) diff --git a/fullcalendar-main/tests/src/icalendar/month-view.ts b/fullcalendar-main/tests/src/icalendar/month-view.ts deleted file mode 100644 index 1ab5a4c..0000000 --- a/fullcalendar-main/tests/src/icalendar/month-view.ts +++ /dev/null @@ -1,211 +0,0 @@ -import fetchMock from 'fetch-mock' -import dayGridMonth from '@fullcalendar/daygrid' -import { EventSourceInput } from '@fullcalendar/core' -import iCalendarPlugin from '@fullcalendar/icalendar' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' -import alldayEvent from './data/alldayEvent.js' -import multidayEvent from './data/multidayEvent.js' -import multipleMultidayEvents from './data/multipleMultidayEvents.js' -import multipleEventsOneMunged from './data/multipleEventsOneMunged.js' -import oneHourMeeting from './data/oneHourMeeting.js' -import recurringWeekly from './data/recurringWeekly.js' -import recurringWeeklyWithoutEnd from './data/recurringWeeklyWithoutEnd.js' -import recurringWeeklyWithCount from './data/recurringWeeklyWithCount.js' -import mungedOneHourMeeting from './data/mungedOneHourMeeting.js' - -describe('addICalEventSource with month view', () => { - const ICAL_MIME_TYPE = 'text/calendar' - - pushOptions({ - plugins: [iCalendarPlugin, dayGridMonth], - initialDate: '2019-04-10', // the start of the three-day event in the feed - initialView: 'dayGridMonth', - }) - - afterEach(() => { - fetchMock.restore() - }) - - it('adds an all day event', (done) => { - loadICalendarWith(alldayEvent, () => { - setTimeout(() => { - let events = currentCalendar.getEvents() - expect(events[0].end).toBe(null) - events.forEach((event) => expect(event.allDay).toBeTruthy()) - assertEventCount(1) - done() - }, 100) - }) - }) - - it('adds a single multi-day event', (done) => { - loadICalendarWith(multidayEvent, () => { - setTimeout(() => { - assertEventCount(1) - currentCalendar.getEvents().forEach((event) => expect(event.allDay).toBeTruthy()) - done() - }, 100) - }) - }) - - it('adds multiple multi-day events', (done) => { - loadICalendarWith(multipleMultidayEvents, () => { - setTimeout(() => { - assertEventCount(2) - currentCalendar.getEvents().forEach((event) => expect(event.allDay).toBeTruthy()) - done() - }, 100) - }) - }) - - it('adds a one-hour long meeting', (done) => { - loadICalendarWith(oneHourMeeting, () => { - setTimeout(() => { - let events = currentCalendar.getEvents() - expect(events[0].start).toEqualDate('2019-04-15T09:30:00') - expect(events[0].end).toEqualDate('2019-04-15T10:30:00') - assertEventCount(1) - currentCalendar.getEvents().forEach((event) => expect(event.allDay).not.toBeTruthy()) - done() - }, 100) - }) - }) - - it('adds a repeating weekly meeting', (done) => { - loadICalendarWith(recurringWeekly, () => { - setTimeout(() => { - let events = currentCalendar.getEvents() - expect(events[0].start).toEqualDate('2019-04-01T17:30:00') - expect(events[0].end).toEqualDate('2019-04-01T18:30:00') - assertEventCount(6) - done() - }, 100) - }) - }) - - it('adds a repeating weekly meeting, with null end', (done) => { - loadICalendarWith(recurringWeeklyWithoutEnd, () => { - setTimeout(() => { - let events = currentCalendar.getEvents() - expect(events[0].start).toEqualDate('2019-04-01T17:30:00') - expect(events[0].end).toBe(null) - assertEventCount(6) - done() - }, 100) - }) - }) - - // https://github.com/fullcalendar/fullcalendar/issues/6190 - // this feed starts at beginning of previous month (March 2019) and has 9 total occurences, - // 5 of which will be visible in the current month (April 2019) - it('adds a repeating weekly meeting, limited by COUNT, but across months', (done) => { - loadICalendarWith(recurringWeeklyWithCount, () => { - setTimeout(() => { - assertEventCount(5) - done() - }, 100) - }) - }) - - it('ignores a munged event', (done) => { - loadICalendarWith(mungedOneHourMeeting, () => { - setTimeout(() => { - assertEventCount(0) - done() - }, 100) - }) - }) - - it('adds a valid event and ignores a munged event', (done) => { - loadICalendarWith(multipleEventsOneMunged, () => { - setTimeout(() => { - assertEventCount(1) - done() - }, 100) - }) - }) - - it('defaultAllDayEventDuration overrides ical default all day length of one day', (done) => { - loadICalendarWith( - alldayEvent, - () => { - setTimeout(() => { - assertEventCount(1) - const event = currentCalendar.getEvents()[0] - expect(event.end.getDate()).toEqual(event.start.getDate() + 2) - done() - }, 100) - }, - (source) => { - initCalendar({ - forceEventDuration: true, - defaultAllDayEventDuration: { days: 2 }, - }).addEventSource(source) - }, - ) - }) - - it('calling refetchEvents request ical feed again', (done) => { - let requestCnt = 0 - - const givenUrl = window.location.href + '/my-feed.php' - fetchMock.get(/my-feed\.php/, () => { - requestCnt++ - return { - headers: { 'content-type': ICAL_MIME_TYPE }, - body: oneHourMeeting, - } - }) - - const calendar = initCalendar({ - events: { - url: givenUrl, - format: 'ics', - }, - }) - - setTimeout(() => { - expect(requestCnt).toBe(1) - expect(calendar.getEvents().length).toBe(1) - calendar.refetchEvents() - - setTimeout(() => { - expect(requestCnt).toBe(2) - expect(calendar.getEvents().length).toBe(1) - done() - }, 100) - }, 100) - }) - - function loadICalendarWith(rawICal: string, assertions: () => void, calendarSetup?: (source: EventSourceInput) => void) { - const givenUrl = window.location.href + '/my-feed.php' - fetchMock.get(/my-feed\.php/, { - headers: { 'content-type': ICAL_MIME_TYPE }, - body: rawICal, - }) - - const source = { url: givenUrl, format: 'ics' } as EventSourceInput - - if (calendarSetup) { - calendarSetup(source) - } else { - initCalendar().addEventSource(source) - } - - const [requestUrl] = fetchMock.lastCall() - const requestParamStr = new URL(requestUrl).searchParams.toString() - expect(requestParamStr).toBe('') - - assertions() - } - - // Checks to make sure all events have been rendered and that the calendar - // has internal info on all the events. - // TODO: don't use currentCalendar - function assertEventCount(expectedCount: number) { - expect(currentCalendar.getEvents().length).toEqual(expectedCount) - - let calendarWrapper = new CalendarWrapper(currentCalendar) - expect(calendarWrapper.getEventEls().length).toEqual(expectedCount) - } -}) diff --git a/fullcalendar-main/tests/src/index.global.js.tpl b/fullcalendar-main/tests/src/index.global.js.tpl deleted file mode 100644 index f008d60..0000000 --- a/fullcalendar-main/tests/src/index.global.js.tpl +++ /dev/null @@ -1,5 +0,0 @@ -import './index.js' - -{{#each extensionlessTestPaths}} - import '{{this}}.js' -{{/each}} diff --git a/fullcalendar-main/tests/src/index.ts b/fullcalendar-main/tests/src/index.ts deleted file mode 100644 index 0b3d9d6..0000000 --- a/fullcalendar-main/tests/src/index.ts +++ /dev/null @@ -1,6 +0,0 @@ - -// NOTE: there are many jquery-related libs that our karma config implicitly includes -// They were being difficult with CJS/ESM - -import './lib/global.css' -import './lib/global.js' diff --git a/fullcalendar-main/tests/src/legacy/DayGrid-events.ts b/fullcalendar-main/tests/src/legacy/DayGrid-events.ts deleted file mode 100644 index 53fbc4a..0000000 --- a/fullcalendar-main/tests/src/legacy/DayGrid-events.ts +++ /dev/null @@ -1,251 +0,0 @@ -import { directionallyTestSeg } from '../lib/DayGridEventRenderUtils.js' -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('DayGrid event rendering', () => { - pushOptions({ - initialDate: '2014-08-01', // 2014-07-27 - 2014-10-07 (excl) - initialView: 'dayGridMonth', - }) - - describe('when LTR', () => { - initMonthTesting('ltr') - }) - describe('when RTL', () => { - initMonthTesting('rtl') - }) - - function initMonthTesting(direction) { - it('correctly renders an event starting before view\'s start', () => { - let options = { - events: [ - { start: '2014-07-26', end: '2014-07-30' }, - ], - } - let testSegOptions = { - firstCol: 0, - lastCol: 2, - isStart: false, - isEnd: true, - } - testSeg(options, testSegOptions) - }) - - it('correctly renders an event starting at view\'s start', () => { - let options = { - events: [ - { start: '2014-07-27', end: '2014-07-29' }, - ], - } - let testSegOptions = { - firstCol: 0, - lastCol: 1, - isStart: true, - isEnd: true, - } - testSeg(options, testSegOptions) - }) - - it('correctly renders an event starting after view\'s start', () => { - let options = { - events: [ - { start: '2014-08-01', end: '2014-08-02' }, - ], - } - let testSegOptions = { - firstCol: 5, - lastCol: 5, - isStart: true, - isEnd: true, - } - testSeg(options, testSegOptions) - }) - - it('correctly renders an event starting on a hidden day at week start', () => { - let options = { - weekends: false, - events: [ - { start: '2014-07-27', end: '2014-07-30' }, - ], - } - let testSegOptions = { - firstCol: 0, - lastCol: 1, - isStart: false, - isEnd: true, - } - testSeg(options, testSegOptions) - }) - - it('correctly renders an event starting on a hidden day in middle of week', () => { - let options = { - hiddenDays: [2], // hide Tues - events: [ - { start: '2014-07-29', end: '2014-08-01' }, - ], - } - let testSegOptions = { - firstCol: 2, - lastCol: 3, - isStart: false, - isEnd: true, - } - testSeg(options, testSegOptions) - }) - - it('correctly renders an event ending before view\'s end', () => { - let options = { - events: [ - { start: '2014-09-02', end: '2014-09-05' }, - ], - } - let testSegOptions = { - row: 5, - firstCol: 2, - lastCol: 4, - isStart: true, - isEnd: true, - } - testSeg(options, testSegOptions) - }) - - it('correctly renders an event ending at view\'s end', () => { - let options = { - events: [ - { start: '2014-09-04', end: '2014-09-07' }, - ], - } - let testSegOptions = { - row: 5, - firstCol: 4, - lastCol: 6, - isStart: true, - isEnd: true, - } - testSeg(options, testSegOptions) - }) - - it('correctly renders an event ending after view\'s end', () => { - let options = { - events: [ - { start: '2014-09-04', end: '2014-09-08' }, - ], - } - let testSegOptions = { - row: 5, - firstCol: 4, - lastCol: 6, - isStart: true, - isEnd: false, - } - testSeg(options, testSegOptions) - }) - - it('correctly renders an event ending at a week\'s end', () => { - let options = { - events: [ - { start: '2014-08-28', end: '2014-08-31' }, - ], - } - let testSegOptions = { - row: 4, - firstCol: 4, - lastCol: 6, - isStart: true, - isEnd: true, - } - testSeg(options, testSegOptions) - }) - - it('correctly renders an event ending on a hidden day at week end', () => { - let options = { - weekends: false, - events: [ - { start: '2014-07-30', end: '2014-08-03' }, - ], - } - let testSegOptions = { - firstCol: 2, - lastCol: 4, - isStart: true, - isEnd: false, - } - testSeg(options, testSegOptions) - }) - - it('correctly renders an event ending on a hidden day in middle of week', () => { - let options = { - hiddenDays: [4], // Thurs - events: [ - { start: '2014-07-28', end: '2014-08-01' }, - ], - } - let testSegOptions = { - firstCol: 1, - lastCol: 3, - isStart: true, - isEnd: false, - } - testSeg(options, testSegOptions) - }) - - function testSeg(calendarOptions, testSegOptions) { - calendarOptions.direction = direction - initCalendar(calendarOptions) - directionallyTestSeg(testSegOptions) - } - } - - it('rendering of events across weeks stays consistent', () => { - let calendar = initCalendar({ - events: [ - { - title: 'event1', - start: '2014-08-01', - end: '2014-08-04', - className: 'event1', - }, - { - title: 'event2', - start: '2014-08-02', - end: '2014-08-05', - className: 'event2', - }, - ], - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - let row0 = dayGridWrapper.getRowEl(0) - let row0event1 = row0.querySelector('.event1') - let row0event2 = row0.querySelector('.event2') - let row1 = dayGridWrapper.getRowEl(1) - let row1event1 = row1.querySelector('.event1') - let row1event2 = row1.querySelector('.event2') - - expect($(row0event1).offset().top).toBeLessThan($(row0event2).offset().top) - expect($(row1event1).offset().top).toBeLessThan($(row1event2).offset().top) - }) - - it('renders an event with no url with no href', () => { - let calendar = initCalendar({ - events: [{ - title: 'event1', - start: '2014-08-01', - }], - }) - let eventEl = new CalendarWrapper(calendar).getFirstEventEl() - expect(eventEl).not.toHaveAttr('href') - }) - - it('renders an event with a url with an href', () => { - let calendar = initCalendar({ - events: [{ - title: 'event1', - start: '2014-08-01', - url: 'http://google.com/', - }], - }) - let eventEl = new CalendarWrapper(calendar).getFirstEventEl() - expect(eventEl).toHaveAttr('href') - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/ListView.ts b/fullcalendar-main/tests/src/legacy/ListView.ts deleted file mode 100644 index de5a20f..0000000 --- a/fullcalendar-main/tests/src/legacy/ListView.ts +++ /dev/null @@ -1,489 +0,0 @@ -import frLocale from '@fullcalendar/core/locales/fr' -import { ListViewWrapper } from '../lib/wrappers/ListViewWrapper.js' - -describe('ListView rendering', () => { - pushOptions({ - initialView: 'listWeek', - now: '2016-08-20', - }) - - describe('with all-day events', () => { - describe('when single-day', () => { - pushOptions({ - events: [ - { - title: 'event 1', - start: '2016-08-15', - }, - { - title: 'event 2', - start: '2016-08-17', - }, - ], - }) - - it('renders only days with events', () => { - let calendar = initCalendar() - - let viewWrapper = new ListViewWrapper(calendar) - let days = viewWrapper.getDayInfo() - let events = viewWrapper.getEventInfo() - - expect(days.length).toBe(2) - expect(days[0].date).toEqualDate('2016-08-15') - expect(days[1].date).toEqualDate('2016-08-17') - - expect(events.length).toBe(2) - expect(events[0].title).toBe('event 1') - expect(events[0].timeText).toBe('all-day') - expect(events[1].title).toBe('event 2') - expect(events[1].timeText).toBe('all-day') - }) - - it('filters events through event hook', () => { - let eventMountCnt = 0 - - initCalendar({ - eventDidMount() { - eventMountCnt += 1 - }, - }) - - expect(eventMountCnt).toBe(2) - }) - - it('filters events through eventWillUnmount', () => { - let callCnt = 0 - - initCalendar({ - eventWillUnmount() { - callCnt += 1 - }, - }) - - currentCalendar.destroy() - expect(callCnt).toBe(2) - }) - }) - - describe('when multi-day', () => { - pushOptions({ - events: [ - { - title: 'event 1', - start: '2016-08-15', - end: '2016-08-18', // 3 days - }, - ], - }) - - it('renders all-day for every day', () => { - let calendar = initCalendar() - let viewWrapper = new ListViewWrapper(calendar) - let events = viewWrapper.getEventInfo() - - expect(events.length).toBe(3) - expect(events[0].title).toBe('event 1') - expect(events[0].timeText).toBe('all-day') - expect(events[1].title).toBe('event 1') - expect(events[1].timeText).toBe('all-day') - expect(events[2].title).toBe('event 1') - expect(events[2].timeText).toBe('all-day') - }) - }) - }) - - describe('with timed events', () => { - describe('when single-day', () => { - pushOptions({ - events: [ - { - title: 'event 1', - start: '2016-08-15T07:00', - }, - { - title: 'event 2', - start: '2016-08-17T09:00', - end: '2016-08-17T11:00', - }, - ], - }) - - it('renders times', () => { - let calendar = initCalendar() - let viewWrapper = new ListViewWrapper(calendar) - let events = viewWrapper.getEventInfo() - - expect(events.length).toBe(2) - expect(events[0].title).toBe('event 1') - expect(events[0].timeText).toBe('7:00am') - expect(events[1].title).toBe('event 2') - expect(events[1].timeText).toBe('9:00am - 11:00am') - }) - - it('doesn\'t render times when displayEventTime is false', () => { - let calendar = initCalendar({ - displayEventTime: false, - }) - let viewWrapper = new ListViewWrapper(calendar) - let events = viewWrapper.getEventInfo() - - expect(events.length).toBe(2) - expect(events[0].title).toBe('event 1') - expect(events[0].timeText).toBe('') - expect(events[1].title).toBe('event 2') - expect(events[1].timeText).toBe('') - }) - - it('doesn\'t render end times when displayEventEnd is false', () => { - let calendar = initCalendar({ - displayEventEnd: false, - }) - let viewWrapper = new ListViewWrapper(calendar) - let events = viewWrapper.getEventInfo() - - expect(events.length).toBe(2) - expect(events[0].title).toBe('event 1') - expect(events[0].timeText).toBe('7:00am') - expect(events[1].title).toBe('event 2') - expect(events[1].timeText).toBe('9:00am') - }) - - // regression test for when localized event dates get unlocalized and leak into view rendering - it('renders dates and times in locale', () => { - let calendar = initCalendar({ - locale: frLocale, - }) - let viewWrapper = new ListViewWrapper(calendar) - let days = viewWrapper.getDayInfo() - let events = viewWrapper.getEventInfo() - - expect(days.length).toBe(2) - expect(days[0].date).toEqualDate('2016-08-15') - expect(days[0].mainText).toEqual('lundi') - expect(days[0].altText).toEqual('15 août 2016') - expect(days[1].date).toEqualDate('2016-08-17') - expect(days[1].mainText).toEqual('mercredi') - expect(days[1].altText).toEqual('17 août 2016') - - expect(events.length).toBe(2) - expect(events[0].title).toBe('event 1') - expect(events[0].timeText).toMatch(/^0?7:00$/) - expect(events[1].title).toBe('event 2') - expect(events[1].timeText).toMatch(/^0?9:00 - 11:00$/) - }) - }) - - describe('when multi-day', () => { - pushOptions({ - nextDayThreshold: '00:00', - }) - - it('renders partial and full days', () => { - let calendar = initCalendar({ - events: [ - { - title: 'event 1', - start: '2016-08-15T07:00', - end: '2016-08-17T11:00', - }, - ], - }) - let viewWrapper = new ListViewWrapper(calendar) - let events = viewWrapper.getEventInfo() - - expect(events.length).toBe(3) - expect(events[0].title).toBe('event 1') - expect(events[0].timeText).toBe('7:00am - 12:00am') - expect(events[1].title).toBe('event 1') - expect(events[1].timeText).toBe('all-day') - expect(events[2].title).toBe('event 1') - expect(events[2].timeText).toBe('12:00am - 11:00am') - }) - - it('truncates an out-of-range start', () => { - let calendar = initCalendar({ - events: [ - { - title: 'event 1', - start: '2016-08-13T07:00', - end: '2016-08-16T11:00', - }, - ], - }) - let viewWrapper = new ListViewWrapper(calendar) - let events = viewWrapper.getEventInfo() - - expect(events.length).toBe(3) - expect(events[0].title).toBe('event 1') - expect(events[0].timeText).toBe('all-day') - expect(events[1].title).toBe('event 1') - expect(events[1].timeText).toBe('all-day') - expect(events[2].title).toBe('event 1') - expect(events[2].timeText).toBe('12:00am - 11:00am') - }) - - it('truncates an out-of-range start', () => { - let calendar = initCalendar({ - events: [ - { - title: 'event 1', - start: '2016-08-18T07:00', - end: '2016-08-21T11:00', - }, - ], - }) - let viewWrapper = new ListViewWrapper(calendar) - let events = viewWrapper.getEventInfo() - - expect(events.length).toBe(3) - expect(events[0].title).toBe('event 1') - expect(events[0].timeText).toBe('7:00am - 12:00am') - expect(events[1].title).toBe('event 1') - expect(events[1].timeText).toBe('all-day') - expect(events[2].title).toBe('event 1') - expect(events[2].timeText).toBe('all-day') - }) - }) - - it('renders same days when equal to nextDayThreshold', () => { - let calendar = initCalendar({ - nextDayThreshold: '09:00', - events: [ - { - title: 'event 1', - start: '2016-08-15T07:00', - end: '2016-08-17T09:00', - }, - ], - }) - let viewWrapper = new ListViewWrapper(calendar) - let events = viewWrapper.getEventInfo() - - expect(events.length).toBe(3) - expect(events[0].title).toBe('event 1') - expect(events[0].timeText).toBe('7:00am - 12:00am') - expect(events[1].title).toBe('event 1') - expect(events[1].timeText).toBe('all-day') - expect(events[2].title).toBe('event 1') - expect(events[2].timeText).toBe('12:00am - 9:00am') - }) - - it('renders fewer days when before nextDayThreshold', () => { - let calendar = initCalendar({ - nextDayThreshold: '09:00', - events: [ - { - title: 'event 1', - start: '2016-08-15T07:00', - end: '2016-08-17T08:00', - }, - ], - }) - let viewWrapper = new ListViewWrapper(calendar) - let events = viewWrapper.getEventInfo() - - expect(events.length).toBe(2) - expect(events[0].title).toBe('event 1') - expect(events[0].timeText).toBe('7:00am - 12:00am') - expect(events[1].title).toBe('event 1') - expect(events[1].timeText).toBe('12:00am - 8:00am') - }) - }) - - describe('when an event has no title', () => { - it('renders no text for its title', () => { - let calendar = initCalendar({ - events: [ - { - start: '2016-08-15', - }, - ], - }) - let viewWrapper = new ListViewWrapper(calendar) - let events = viewWrapper.getEventInfo() - - expect(events.length).toBe(1) - expect(events[0].title).toBe('') - expect(events[0].timeText).toBe('all-day') - }) - }) - - describe('when no events', () => { - it('renders an empty message', () => { - let calendar = initCalendar() - let viewWrapper = new ListViewWrapper(calendar) - expect(viewWrapper.hasEmptyMessage()).toBe(true) - }) - }) - - describe('with lots of events', () => { - pushOptions({ - now: '2016-08-29', - events: [ - { - title: 'All Day Event', - start: '2016-08-29', - }, - { - title: 'Long Event', - start: '2016-08-28', - end: '2016-09-04', - }, - { - title: 'Meeting', - start: '2016-08-29T10:30:00', - }, - { - title: 'Lunch', - start: '2016-08-30T12:00:00', - }, - { - title: 'Meeting', - start: '2016-08-30T14:30:00', - }, - { - title: 'Happy Hour', - start: '2014-11-12T17:30:00', - }, - { - title: 'Dinner', - start: '2014-11-12T20:00:00', - }, - { - title: 'Birthday Party', - start: '2016-08-29T07:00:00', - }, - { - title: 'Click for Google', - url: 'http://google.com/', - start: '2016-08-31', - }, - ], - }) - - it('sorts events correctly', () => { - let calendar = initCalendar() - let viewWrapper = new ListViewWrapper(calendar) - let days = viewWrapper.getDayInfo() - let events = viewWrapper.getEventInfo() - - expect(days.length).toBe(7) - expect(days[0].date).toEqualDate('2016-08-28') - expect(days[1].date).toEqualDate('2016-08-29') - expect(days[2].date).toEqualDate('2016-08-30') - expect(days[3].date).toEqualDate('2016-08-31') - expect(days[4].date).toEqualDate('2016-09-01') - expect(days[5].date).toEqualDate('2016-09-02') - expect(days[6].date).toEqualDate('2016-09-03') - - expect(events.length).toBe(13) - expect(events[0].title).toBe('Long Event') - expect(events[0].timeText).toBe('all-day') - expect(events[1].title).toBe('Long Event') - expect(events[1].timeText).toBe('all-day') - expect(events[2].title).toBe('All Day Event') - expect(events[2].timeText).toBe('all-day') - expect(events[3].title).toBe('Birthday Party') - expect(events[3].timeText).toBe('7:00am') - expect(events[4].title).toBe('Meeting') - expect(events[4].timeText).toBe('10:30am') - expect(events[5].title).toBe('Long Event') - expect(events[5].timeText).toBe('all-day') - expect(events[6].title).toBe('Lunch') - expect(events[6].timeText).toBe('12:00pm') - expect(events[7].title).toBe('Meeting') - expect(events[7].timeText).toBe('2:30pm') - expect(events[8].title).toBe('Long Event') - expect(events[8].timeText).toBe('all-day') - expect(events[9].title).toBe('Click for Google') - expect(events[9].timeText).toBe('all-day') - expect(events[10].title).toBe('Long Event') - expect(events[10].timeText).toBe('all-day') - expect(events[11].title).toBe('Long Event') - expect(events[11].timeText).toBe('all-day') - expect(events[12].title).toBe('Long Event') - expect(events[12].timeText).toBe('all-day') - }) - - it('can sort events with non-date property first', () => { - let calendar = initCalendar({ - now: '2016-08-29', - eventOrder: 'title', - events: [ - { - title: 'Sup', - start: '2016-08-29T00:00:00', - }, - { - title: 'Dude', - start: '2016-08-29T10:30:00', - }, - { - title: 'Hello', - start: '2016-08-30', - }, - ], - }) - let viewWrapper = new ListViewWrapper(calendar) - let days = viewWrapper.getDayInfo() - let events = viewWrapper.getEventInfo() - - expect(days.length).toBe(2) - expect(days[0].date).toEqualDate('2016-08-29') - expect(days[1].date).toEqualDate('2016-08-30') - - expect(events.length).toBe(3) - expect(events[0].title).toBe('Dude') - expect(events[1].title).toBe('Sup') - expect(events[2].title).toBe('Hello') - }) - - it('makes scrollbars', () => { - let $el = $('
').appendTo('body') - let calendar = initCalendar({ headerToolbar: false }, $el) - let viewWrapper = new ListViewWrapper(calendar) - let scrollEl = viewWrapper.getScrollerEl() - - expect( - scrollEl.scrollHeight, - ).toBeGreaterThan( - scrollEl.clientHeight + 100, - ) - - $el.remove() - }) - - it('doesn\'t have scrollbars when height is \'auto\'', () => { - let $el = $('
').appendTo('body') - let calendar = initCalendar({ - headerToolbar: false, - height: 'auto', - }, $el) - let viewWrapper = new ListViewWrapper(calendar) - let scrollEl = viewWrapper.getScrollerEl() - - expect( - Math.abs(scrollEl.scrollHeight - scrollEl.clientHeight), - ).toBeLessThan(2) - $el.remove() - }) - }) - - it('updates rendered events despite fetch range being lazy', () => { - let calendar = initCalendar({ - now: '2016-09-12', - initialView: 'dayGridMonth', - events: [ - { title: 'event1', start: '2016-09-12' }, - ], - }) - - calendar.changeView('listWeek') - - let viewWrapper = new ListViewWrapper(calendar) - expect(viewWrapper.getEventEls().length).toBe(1) - calendar.prev() - expect(viewWrapper.getEventEls().length).toBe(0) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/TimeGrid-events.ts b/fullcalendar-main/tests/src/legacy/TimeGrid-events.ts deleted file mode 100644 index 04f44c3..0000000 --- a/fullcalendar-main/tests/src/legacy/TimeGrid-events.ts +++ /dev/null @@ -1,88 +0,0 @@ -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('TimeGrid event rendering', () => { - pushOptions({ - initialDate: '2014-08-23', - initialView: 'timeGridWeek', - scrollTime: '00:00:00', - }) - - it('renders the start and end time of an event that spans only 1 day', () => { - let calendar = initCalendar({ - events: [{ - title: 'event1', - start: '2014-08-18T02:00:00', - end: '2014-08-18T22:00:00', - }], - }) - - let calendarWrapper = new CalendarWrapper(calendar) - let eventEl = calendarWrapper.getFirstEventEl() - let eventText = calendarWrapper.getEventElInfo(eventEl).timeText - - expect(eventText).toBe('2:00 - 10:00') - }) - - it('renders time to/from midnight for an event that spans two days', () => { - let calendar = initCalendar({ - events: [{ - title: 'event1', - start: '2014-08-18T02:00:00', - end: '2014-08-19T22:00:00', - }], - }) - - let calendarWrapper = new CalendarWrapper(calendar) - let eventEls = calendarWrapper.getEventEls() - let eventText0 = calendarWrapper.getEventElInfo(eventEls[0]).timeText - let eventText1 = calendarWrapper.getEventElInfo(eventEls[1]).timeText - - expect(eventText0).toBe('2:00 - 12:00') - expect(eventText1).toBe('12:00 - 10:00') - }) - - it('renders no time on an event segment that spans through an entire day', () => { - let calendar = initCalendar({ - events: [{ - title: 'event1', - start: '2014-08-18T02:00:00', - end: '2014-08-20T22:00:00', - }], - }) - - let calendarWrapper = new CalendarWrapper(calendar) - let eventEls = calendarWrapper.getEventEls() - let eventText1 = calendarWrapper.getEventElInfo(eventEls[1]).timeText - - expect(eventText1).toBe('') - }) - - it('renders an event with no url with no href', () => { - let calendar = initCalendar({ - events: [{ - title: 'event1', - start: '2014-08-18T02:00:00', - }], - }) - - let calendarWrapper = new CalendarWrapper(calendar) - let eventEl = calendarWrapper.getFirstEventEl() - - expect(eventEl).not.toHaveAttr('href') - }) - - it('renders an event with a url with an href', () => { - let calendar = initCalendar({ - events: [{ - title: 'event1', - start: '2014-08-18T02:00:00', - url: 'http://google.com/', - }], - }) - - let calendarWrapper = new CalendarWrapper(calendar) - let eventEl = calendarWrapper.getFirstEventEl() - - expect(eventEl).toHaveAttr('href') - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/TimeGrid-render.ts b/fullcalendar-main/tests/src/legacy/TimeGrid-render.ts deleted file mode 100644 index 0e5b9d3..0000000 --- a/fullcalendar-main/tests/src/legacy/TimeGrid-render.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('Agenda view rendering', () => { - pushOptions({ - initialView: 'timeGridWeek', - }) - - describe('when LTR', () => { - pushOptions({ - direction: 'ltr', - }) - - it('renders the axis on the left', () => { - let calendar = initCalendar() - let viewWrapper = new TimeGridViewWrapper(calendar) - let headerWrapper = viewWrapper.header - let dayGridWrapper = viewWrapper.dayGrid - let timeGridWrapper = viewWrapper.timeGrid - - expect(viewWrapper.getHeaderAxisEl()) - .toBeLeftOf(headerWrapper.getCellEls()[0]) - - expect(viewWrapper.getAllDayAxisEl()) - .toBeLeftOf(dayGridWrapper.getAllDayEls()[0]) - - expect(timeGridWrapper.getSlotAxisEls()[0]) - .toBeLeftOf(timeGridWrapper.getSlotLaneEls()[0]) - }) - }) - - describe('when RTL', () => { - pushOptions({ - direction: 'rtl', - }) - - it('renders the axis on the right', () => { - let calendar = initCalendar() - let viewWrapper = new TimeGridViewWrapper(calendar) - let headerWrapper = viewWrapper.header - let dayGridWrapper = viewWrapper.dayGrid - let timeGridWrapper = viewWrapper.timeGrid - - expect(viewWrapper.getHeaderAxisEl()) - .toBeRightOf(headerWrapper.getCellEls()[0]) - - expect(viewWrapper.getAllDayAxisEl()) - .toBeRightOf(dayGridWrapper.getAllDayEls()[0]) - - expect(timeGridWrapper.getSlotAxisEls()[0]) - .toBeRightOf(timeGridWrapper.getSlotLaneEls()[0]) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/View.ts b/fullcalendar-main/tests/src/legacy/View.ts deleted file mode 100644 index e1836fb..0000000 --- a/fullcalendar-main/tests/src/legacy/View.ts +++ /dev/null @@ -1,25 +0,0 @@ -describe('View object', () => { - /* - TODO: move tests from eventLimitClick.js about view.name/type into here - */ - - pushOptions({ - initialDate: '2015-01-01', - }) - - describe('title', () => { - it('is a correctly defined string', () => { - initCalendar() - let view = currentCalendar.view - expect(view.title).toBe('January 2015') - }) - - it('is available in the viewDidMount callback', () => { - let viewDidMountSpy = spyOnCalendarCallback('viewDidMount', (arg) => { - expect(arg.view.title).toBe('January 2015') - }) - initCalendar() - expect(viewDidMountSpy).toHaveBeenCalled() - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/addEventSource.ts b/fullcalendar-main/tests/src/legacy/addEventSource.ts deleted file mode 100644 index 53e151c..0000000 --- a/fullcalendar-main/tests/src/legacy/addEventSource.ts +++ /dev/null @@ -1,101 +0,0 @@ -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('addEventSource', () => { - let eventArray = [ - { id: '0', title: 'event zero', start: '2014-06-24', classNames: 'event-zero' }, - { id: '1', title: 'event one', start: '2014-06-24', classNames: 'event-non-zero event-one' }, - { id: '2', title: 'event two', start: '2014-06-24', classNames: 'event-non-zero event-two' }, - ] - - pushOptions({ - initialDate: '2014-06-24', - initialView: 'dayGridMonth', - }) - - it('correctly adds an array source', (done) => { - go( - () => { - currentCalendar.addEventSource(eventArray) - }, - null, - done, - ) - }) - - it('correctly adds a function source', (done) => { - go( - () => { - currentCalendar.addEventSource((arg, callback) => { - callback(eventArray) - }) - }, - null, - done, - ) - }) - - it('correctly adds an extended array source', (done) => { - go( - () => { - currentCalendar.addEventSource({ - classNames: 'arraysource', - events: eventArray, - }) - }, - () => { - expect($('.arraysource').length).toEqual(3) - }, - done, - ) - }) - - it('correctly adds an extended func source', (done) => { - go( - () => { - currentCalendar.addEventSource({ - classNames: 'funcsource', - events(arg, callback) { - callback(eventArray) - }, - }) - }, - () => { - expect($('.funcsource').length).toEqual(3) - }, - done, - ) - }) - - function go(addFunc, extraTestFunc, doneFunc) { - initCalendar() - addFunc() - - checkAllEvents() - if (extraTestFunc) { - extraTestFunc() - } - - // move the calendar back out of view, then back in (for issue 2191) - currentCalendar.next() - currentCalendar.prev() - - // otherwise, prev/next would be cancelled out by doneFunc's calendar destroy - setTimeout(() => { - checkAllEvents() - if (extraTestFunc) { - extraTestFunc() - } - - doneFunc() - }, 0) - } - - // Checks to make sure all events have been rendered and that the calendar - // has internal info on all the events. - function checkAllEvents() { - expect(currentCalendar.getEvents().length).toEqual(3) - - let calendarWrapper = new CalendarWrapper(currentCalendar) - expect(calendarWrapper.getEventEls().length).toEqual(3) - } -}) diff --git a/fullcalendar-main/tests/src/legacy/allDayDefault.ts b/fullcalendar-main/tests/src/legacy/allDayDefault.ts deleted file mode 100644 index 58e9195..0000000 --- a/fullcalendar-main/tests/src/legacy/allDayDefault.ts +++ /dev/null @@ -1,194 +0,0 @@ -describe('defaultAllDay', () => { // TODO: rename file - describe('when undefined', () => { - it('guesses false if T in ISO8601 start date', () => { - initCalendar({ - events: [ - { - id: '1', - start: '2014-05-01T06:00:00', - }, - ], - }) - let eventObj = currentCalendar.getEventById('1') - expect(eventObj.allDay).toEqual(false) - }) - - it('guesses false if T in ISO8601 end date', () => { - initCalendar({ - events: [ - { - id: '1', - start: '2014-05-01', - end: '2014-05-01T08:00:00', - }, - ], - }) - let eventObj = currentCalendar.getEventById('1') - expect(eventObj.allDay).toEqual(false) - }) - - it('guesses true if ISO8601 start date with no time and unspecified end date', () => { - initCalendar({ - events: [ - { - id: '1', - start: '2014-05-01', - }, - ], - }) - let eventObj = currentCalendar.getEventById('1') - expect(eventObj.allDay).toEqual(true) - }) - - it('guesses true if ISO8601 start and end date with no times', () => { - initCalendar({ - events: [ - { - id: '1', - start: '2014-05-01', - end: '2014-05-03', - }, - ], - }) - let eventObj = currentCalendar.getEventById('1') - expect(eventObj.allDay).toEqual(true) - }) - - it('guesses false if start is a unix timestamp (which implies it has a time)', () => { - initCalendar({ - events: [ - { - id: '1', - start: 1398902400000, - end: '2014-05-03', - }, - ], - }) - - let eventObj = currentCalendar.getEventById('1') - expect(eventObj.allDay).toEqual(false) - }) - - it('guesses false if end is a unix timestamp (which implies it has a time)', () => { - initCalendar({ - events: [ - { - id: '1', - start: '2014-05-01', - end: 1399075200000, - }, - ], - }) - let eventObj = currentCalendar.getEventById('1') - expect(eventObj.allDay).toEqual(false) - }) - }) - - describe('when specified', () => { - it('has an effect when an event\'s allDay is not specified', () => { - initCalendar({ - defaultAllDay: false, - events: [ - { - id: '1', - start: '2014-05-01', - }, - ], - }) - let eventObj = currentCalendar.getEventById('1') - expect(eventObj.allDay).toEqual(false) - }) - - it('has no effect when an event\'s allDay is specified', () => { - initCalendar({ - defaultAllDay: false, - events: [ - { - id: '1', - start: '2014-05-01T00:00:00', - allDay: true, - }, - ], - }) - let eventObj = currentCalendar.getEventById('1') - expect(eventObj.allDay).toEqual(true) - }) - }) -}) - -describe('source.defaultAllDay', () => { - it('has an effect when an event\'s allDay is not specified', () => { - initCalendar({ - eventSources: [ - { - defaultAllDay: false, - events: [ - { - id: '1', - start: '2014-05-01', - }, - ], - }, - ], - }) - let eventObj = currentCalendar.getEventById('1') - expect(eventObj.allDay).toEqual(false) - }) - - it('a true value can override the global defaultAllDay', () => { - initCalendar({ - defaultAllDay: false, - eventSources: [ - { - defaultAllDay: true, - events: [ - { - id: '1', - start: '2014-05-01T06:00:00', - }, - ], - }, - ], - }) - let eventObj = currentCalendar.getEventById('1') - expect(eventObj.allDay).toEqual(true) - }) - - it('a false value can override the global defaultAllDay', () => { - initCalendar({ - defaultAllDay: true, - eventSources: [ - { - defaultAllDay: false, - events: [ - { - id: '1', - start: '2014-05-01', - }, - ], - }, - ], - }) - let eventObj = currentCalendar.getEventById('1') - expect(eventObj.allDay).toEqual(false) - }) - - it('has no effect when an event\'s allDay is specified', () => { - initCalendar({ - eventSources: [ - { - defaultAllDay: true, - events: [ - { - id: '1', - start: '2014-05-01', - allDay: false, - }, - ], - }, - ], - }) - let eventObj = currentCalendar.getEventById('1') - expect(eventObj.allDay).toEqual(false) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/allDaySlot.ts b/fullcalendar-main/tests/src/legacy/allDaySlot.ts deleted file mode 100644 index 14a255a..0000000 --- a/fullcalendar-main/tests/src/legacy/allDaySlot.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('allDaySlots', () => { - describe('when allDaySlots is not set', () => { - describe('in week', () => { - it('should default to having an allDaySlots table', () => { - let calendar = initCalendar({ - initialView: 'timeGridWeek', - }) - let dayGrid = new TimeGridViewWrapper(calendar).dayGrid - expect(dayGrid).toBeTruthy() - }) - }) - describe('in day', () => { - it('should default to having an allDaySlots table', () => { - let calendar = initCalendar({ - initialView: 'timeGridDay', - }) - let dayGrid = new TimeGridViewWrapper(calendar).dayGrid - expect(dayGrid).toBeTruthy() - }) - }) - }) - - describe('when allDaySlots is set true', () => { - describe('in week', () => { - it('should default to having an allDaySlots table', () => { - let calendar = initCalendar({ - initialView: 'timeGridWeek', - allDaySlot: true, - }) - let dayGrid = new TimeGridViewWrapper(calendar).dayGrid - expect(dayGrid).toBeTruthy() - }) - }) - describe('in day', () => { - it('should default to having an allDaySlots table', () => { - let calendar = initCalendar({ - initialView: 'timeGridDay', - allDaySlot: true, - }) - let dayGrid = new TimeGridViewWrapper(calendar).dayGrid - expect(dayGrid).toBeTruthy() - }) - }) - }) - - describe('when allDaySlots is set false', () => { - describe('in week', () => { - it('should default to having an allDaySlots table', () => { - let calendar = initCalendar({ - initialView: 'timeGridWeek', - allDaySlot: false, - }) - let dayGrid = new TimeGridViewWrapper(calendar).dayGrid - expect(dayGrid).toBeFalsy() - }) - }) - describe('in day', () => { - it('should default to having an allDaySlots table', () => { - let calendar = initCalendar({ - initialView: 'timeGridDay', - allDaySlot: false, - }) - let dayGrid = new TimeGridViewWrapper(calendar).dayGrid - expect(dayGrid).toBeFalsy() - }) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/allDayText.ts b/fullcalendar-main/tests/src/legacy/allDayText.ts deleted file mode 100644 index 916b3c8..0000000 --- a/fullcalendar-main/tests/src/legacy/allDayText.ts +++ /dev/null @@ -1,95 +0,0 @@ -import ptBrLocale from '@fullcalendar/core/locales/pt-br' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('allDayText', () => { - describe('when allDaySlots is not set', () => { - describe('in week', () => { - it('should default allDayText to using \'all-day\'', () => { - let calendar = initCalendar({ - initialView: 'timeGridWeek', - }) - expectAllDayTextToBe(calendar, 'all-day') - }) - }) - describe('in day', () => { - it('should default allDayText to using \'all-day\'', () => { - let calendar = initCalendar({ - initialView: 'timeGridDay', - }) - expectAllDayTextToBe(calendar, 'all-day') - }) - }) - }) - - describe('when allDaySlots is set true', () => { - describe('in week', () => { - it('should default allDayText to using \'all-day\'', () => { - let calendar = initCalendar({ - initialView: 'timeGridWeek', - allDaySlot: true, - }) - expectAllDayTextToBe(calendar, 'all-day') - }) - }) - describe('in day', () => { - it('should default allDayText to using \'all-day\'', () => { - let calendar = initCalendar({ - initialView: 'timeGridDay', - allDaySlot: true, - }) - expectAllDayTextToBe(calendar, 'all-day') - }) - }) - }) - - describe('when allDaySlots is set true and locale is not default', () => { - describe('in week', () => { - it('should use the locale\'s all-day value', () => { - let calendar = initCalendar({ - initialView: 'timeGridWeek', - allDaySlot: true, - locale: ptBrLocale, - }) - expectAllDayTextToBe(calendar, 'dia inteiro') - }) - }) - describe('in day', () => { - it('should use the locale\'s all-day value', () => { - let calendar = initCalendar({ - initialView: 'timeGridDay', - allDaySlot: true, - locale: ptBrLocale, - }) - expectAllDayTextToBe(calendar, 'dia inteiro') - }) - }) - }) - - describe('when allDaySlots is set true and allDayText is specified', () => { - describe('in week', () => { - it('should show specified all day text', () => { - let calendar = initCalendar({ - initialView: 'timeGridWeek', - allDaySlot: true, - allDayText: 'axis-phosy', - }) - expectAllDayTextToBe(calendar, 'axis-phosy') - }) - }) - describe('in day', () => { - it('should show specified all day text', () => { - let calendar = initCalendar({ - initialView: 'timeGridDay', - allDayText: 'axis-phosy', - }) - expectAllDayTextToBe(calendar, 'axis-phosy') - }) - }) - }) - - function expectAllDayTextToBe(calendar, text) { - let viewWrapper = new TimeGridViewWrapper(calendar) - let allDayText = viewWrapper.getAllDayAxisElText() - expect(allDayText).toBe(text) - } -}) diff --git a/fullcalendar-main/tests/src/legacy/aspectRatio.ts b/fullcalendar-main/tests/src/legacy/aspectRatio.ts deleted file mode 100644 index 48b58a6..0000000 --- a/fullcalendar-main/tests/src/legacy/aspectRatio.ts +++ /dev/null @@ -1,169 +0,0 @@ -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('aspectRatio', () => { - function getCalendarElement(width) { - return $('
').appendTo('body').width(width)[0] - } - - describe('when default settings are used', () => { - const elementWidth = 675 - - it('view div should use the ratio 1:35 to set height', () => { - let calendar = initCalendar({}, getCalendarElement(elementWidth)) - let viewContainerEl = new CalendarWrapper(calendar).getViewContainerEl() - - let rect = viewContainerEl.getBoundingClientRect() - expect(Math.round(rect.height)).toEqual(500) - }) - - it('view div should have width of div', () => { - let calendar = initCalendar({}, getCalendarElement(elementWidth)) - let viewContainerEl = new CalendarWrapper(calendar).getViewContainerEl() - - let rect = viewContainerEl.getBoundingClientRect() - expect(Math.round(rect.width)).toEqual(elementWidth) - }) - }) - - describe('when initializing the aspectRatio', () => { - const elementWidth = 1000 - - describe('to 2', () => { - pushOptions({ - aspectRatio: 2, - }) - - it('should not change the width', () => { - let calendar = initCalendar({}, getCalendarElement(elementWidth)) - let viewContainerEl = new CalendarWrapper(calendar).getViewContainerEl() - - let rect = viewContainerEl.getBoundingClientRect() - expect(Math.round(rect.width)).toEqual(elementWidth) - }) - - it('should set the height to width sizes very close to ratio of 2', () => { - let calendar = initCalendar({}, getCalendarElement(elementWidth)) - let viewContainerEl = new CalendarWrapper(calendar).getViewContainerEl() - - let rect = viewContainerEl.getBoundingClientRect() - let ratio = Math.round((rect.width / rect.height) * 100) - expect(Math.round(ratio)).toEqual(200) - }) - }) - - describe('to 1', () => { - pushOptions({ - aspectRatio: 1, - }) - - it('should not change the width', () => { - let calendar = initCalendar({}, getCalendarElement(elementWidth)) - let viewContainerEl = new CalendarWrapper(calendar).getViewContainerEl() - - let rect = viewContainerEl.getBoundingClientRect() - expect(Math.round(rect.width)).toEqual(elementWidth) - }) - - it('should set the height to width sizes very close to ratio of 2', () => { - let calendar = initCalendar({}, getCalendarElement(elementWidth)) - let viewContainerEl = new CalendarWrapper(calendar).getViewContainerEl() - - let rect = viewContainerEl.getBoundingClientRect() - let ratio = Math.round((rect.width / rect.height) * 100) - expect(Math.round(ratio)).toEqual(100) - }) - }) - - describe('to less than 0.5', () => { - pushOptions({ - aspectRatio: 0.4, - }) - - it('should not change the width', () => { - let calendar = initCalendar({}, getCalendarElement(elementWidth)) - let viewContainerEl = new CalendarWrapper(calendar).getViewContainerEl() - - let rect = viewContainerEl.getBoundingClientRect() - expect(Math.round(rect.width)).toEqual(elementWidth) - }) - - it('should set the height to width ratio to 0.5', () => { - let calendar = initCalendar({}, getCalendarElement(elementWidth)) - let viewContainerEl = new CalendarWrapper(calendar).getViewContainerEl() - - let rect = viewContainerEl.getBoundingClientRect() - let ratio = Math.round((rect.width / rect.height) * 100) - expect(Math.round(ratio)).toEqual(50) - }) - }) - - describe('to negative', () => { - pushOptions({ - aspectRatio: -2, - }) - - it('should not change the width', () => { - let calendar = initCalendar({}, getCalendarElement(elementWidth)) - let viewContainerEl = new CalendarWrapper(calendar).getViewContainerEl() - - let rect = viewContainerEl.getBoundingClientRect() - expect(Math.round(rect.width)).toEqual(elementWidth) - }) - - it('should set the height to width ratio to 0.5', () => { - let calendar = initCalendar({}, getCalendarElement(elementWidth)) - let viewContainerEl = new CalendarWrapper(calendar).getViewContainerEl() - - let rect = viewContainerEl.getBoundingClientRect() - let ratio = Math.round((rect.width / rect.height) * 100) - expect(Math.round(ratio)).toEqual(50) - }) - }) - - describe('to zero', () => { - pushOptions({ - aspectRatio: 0, - }) - - it('should not change the width', () => { - let calendar = initCalendar({}, getCalendarElement(elementWidth)) - let viewContainerEl = new CalendarWrapper(calendar).getViewContainerEl() - - let rect = viewContainerEl.getBoundingClientRect() - expect(Math.round(rect.width)).toEqual(elementWidth) - }) - - it('should set the height to width ratio to 0.5', () => { - let calendar = initCalendar({}, getCalendarElement(elementWidth)) - let viewContainerEl = new CalendarWrapper(calendar).getViewContainerEl() - - let rect = viewContainerEl.getBoundingClientRect() - let ratio = Math.round((rect.width / rect.height) * 100) - expect(Math.round(ratio)).toEqual(50) - }) - }) - - describe('to very large', () => { - pushOptions({ - aspectRatio: 4000, - }) - - it('should not change the width', () => { - let calendar = initCalendar({}, getCalendarElement(elementWidth)) - let viewContainerEl = new CalendarWrapper(calendar).getViewContainerEl() - - let rect = viewContainerEl.getBoundingClientRect() - expect(Math.round(rect.width)).toEqual(elementWidth) - }) - - it('should cause rows to be natural height', () => { - let calendar = initCalendar({}, getCalendarElement(elementWidth)) - let viewContainerEl = new CalendarWrapper(calendar).getViewContainerEl() - - let actualHeight = viewContainerEl.getBoundingClientRect().height - let naturalHeight = viewContainerEl.getBoundingClientRect().height - expect(Math.round(actualHeight)).toEqual(Math.round(naturalHeight)) - }) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/background-events.ts b/fullcalendar-main/tests/src/legacy/background-events.ts deleted file mode 100644 index 05e8112..0000000 --- a/fullcalendar-main/tests/src/legacy/background-events.ts +++ /dev/null @@ -1,777 +0,0 @@ -import { RED_REGEX } from '../lib/dom-misc.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' - -// SEE ALSO: event-color.js - -describe('background events', () => { - pushOptions({ - initialDate: '2014-11-04', - scrollTime: '00:00', - }) - - describe('when in month view', () => { - pushOptions({ initialView: 'dayGridMonth' }) - - describe('when LTR', () => { - it('render correctly on a single day', () => { - let calendar = initCalendar({ - events: [{ - title: 'hi', - start: '2014-11-04', - display: 'background', - }], - }) - - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let allBgEls = dayGridWrapper.getBgEventEls() - - expect(allBgEls.length).toBe(1) - expect(dayGridWrapper.getBgEventEls(1).length).toBe(1) - expect(allBgEls[0]).toBeLeftOf(dayGridWrapper.getDayEl('2014-11-05')) - expect(dayGridWrapper.getEventEls().length).toBe(0) - }) - - it('render correctly spanning multiple weeks', () => { - let calendar = initCalendar({ - events: [{ - title: 'hi', - start: '2014-11-04', - end: '2014-11-11', - display: 'background', - }], - }) - - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let allBgEls = dayGridWrapper.getBgEventEls() - - expect(allBgEls.length).toBe(2) - expect(dayGridWrapper.getBgEventEls(1).length).toBe(1) - expect(dayGridWrapper.getBgEventEls(2).length).toBe(1) - expect(allBgEls[0]).toBeRightOf(dayGridWrapper.getDayEl('2014-11-03')) - expect(allBgEls[1]).toBeLeftOf(dayGridWrapper.getDayEl('2014-11-12')) - expect(dayGridWrapper.getEventEls().length).toBe(0) - }) - - it('render correctly when two span on top of each other', () => { - let calendar = initCalendar({ - events: [ - { - start: '2014-11-04', - end: '2014-11-07', - display: 'background', - }, - { - start: '2014-11-05', - end: '2014-11-08', - display: 'background', - }, - ], - }) - - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let allBgEls = dayGridWrapper.getBgEventEls() - - expect(allBgEls.length).toBe(2) - expect(dayGridWrapper.getBgEventEls(1).length).toBe(2) - expect(allBgEls[0]).toBeRightOf(dayGridWrapper.getDayEl('2014-11-02')) - expect(allBgEls[1]).toBeLeftOf(dayGridWrapper.getDayEl('2014-11-08')) - expect(dayGridWrapper.getEventEls().length).toBe(0) - }) - - it('renders "business hours" on whole days', () => { - let calendar = initCalendar({ - businessHours: true, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - expect(dayGridWrapper.getNonBusinessDayEls().length).toBe(12) // there are 6 weeks. 2 weekend days each - }) - }) - - describe('when RTL', () => { - pushOptions({ direction: 'rtl' }) - - it('render correctly on a single day', () => { - let calendar = initCalendar({ - events: [{ - title: 'hi', - start: '2014-11-04', - display: 'background', - }], - }) - - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let allBgEls = dayGridWrapper.getBgEventEls() - - expect(allBgEls.length).toBe(1) - expect(dayGridWrapper.getBgEventEls(1).length).toBe(1) - expect(allBgEls[0]).toBeRightOf(dayGridWrapper.getDayEl('2014-11-06')) - expect(dayGridWrapper.getEventEls().length).toBe(0) - }) - - it('render correctly spanning multiple weeks', () => { - let calendar = initCalendar({ - events: [{ - title: 'hi', - start: '2014-11-04', - end: '2014-11-11', - display: 'background', - }], - }) - - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let allBgEls = dayGridWrapper.getBgEventEls() - - expect(allBgEls.length).toBe(2) - expect(dayGridWrapper.getBgEventEls(1).length).toBe(1) - expect(dayGridWrapper.getBgEventEls(2).length).toBe(1) - expect(allBgEls[0]).toBeLeftOf(dayGridWrapper.getDayEl('2014-11-02')) - expect(allBgEls[1]).toBeRightOf(dayGridWrapper.getDayEl('2014-11-12')) - expect(dayGridWrapper.getEventEls().length).toBe(0) - }) - }) - - describe('when inverse', () => { - describe('when LTR', () => { - it('render correctly on a single day', () => { - let calendar = initCalendar({ - events: [{ - title: 'hi', - start: '2014-11-04', - display: 'inverse-background', - }], - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - expect(dayGridWrapper.getBgEventEls().length).toBe(7) - expect(dayGridWrapper.getBgEventEls(0).length).toBe(1) - expect(dayGridWrapper.getBgEventEls(1).length).toBe(2) - expect(dayGridWrapper.getBgEventEls(2).length).toBe(1) - expect(dayGridWrapper.getBgEventEls(3).length).toBe(1) - expect(dayGridWrapper.getBgEventEls(4).length).toBe(1) - expect(dayGridWrapper.getBgEventEls(5).length).toBe(1) - - let secondRowBgEls = dayGridWrapper.getBgEventEls(1) - - expect(secondRowBgEls[0]) - .toBeLeftOf(dayGridWrapper.getDayEl('2014-11-05')) - - expect(secondRowBgEls[1]) - .toBeRightOf(dayGridWrapper.getDayEl('2014-11-03')) - - expect(dayGridWrapper.getEventEls().length).toBe(0) - }) - - it('render correctly spanning multiple weeks', () => { - let calendar = initCalendar({ - events: [{ - title: 'hi', - start: '2014-11-04', - end: '2014-11-11', - display: 'inverse-background', - }], - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - expect(dayGridWrapper.getBgEventEls().length).toBe(6) - expect(dayGridWrapper.getBgEventEls(0).length).toBe(1) - expect(dayGridWrapper.getBgEventEls(1).length).toBe(1) - expect(dayGridWrapper.getBgEventEls(2).length).toBe(1) - expect(dayGridWrapper.getBgEventEls(3).length).toBe(1) - expect(dayGridWrapper.getBgEventEls(4).length).toBe(1) - expect(dayGridWrapper.getBgEventEls(5).length).toBe(1) - - expect(dayGridWrapper.getBgEventEls(1)[0]) - .toBeLeftOf(dayGridWrapper.getDayEl('2014-11-05')) - - expect(dayGridWrapper.getBgEventEls(2)[0]) - .toBeRightOf(dayGridWrapper.getDayEl('2014-11-09')) - - expect(dayGridWrapper.getEventEls().length).toBe(0) - }) - - it('render correctly when starts before start of month', () => { - let calendar = initCalendar({ - events: [{ - start: '2014-10-24', - end: '2014-11-06', - display: 'inverse-background', - }], - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - expect(dayGridWrapper.getBgEventEls().length).toBe(5) - expect(dayGridWrapper.getBgEventEls(0).length).toBe(0) - expect(dayGridWrapper.getBgEventEls(1).length).toBe(1) - expect(dayGridWrapper.getBgEventEls(2).length).toBe(1) - expect(dayGridWrapper.getBgEventEls(3).length).toBe(1) - expect(dayGridWrapper.getBgEventEls(4).length).toBe(1) - expect(dayGridWrapper.getBgEventEls(5).length).toBe(1) - - expect(dayGridWrapper.getBgEventEls(1)) - .toBeRightOf(dayGridWrapper.getDayEl('2014-11-04')) - }) - - it('render correctly when ends after end of month', () => { - let calendar = initCalendar({ - events: [{ - start: '2014-11-27', - end: '2014-12-08', - display: 'inverse-background', - }], - }) - - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - expect(dayGridWrapper.getBgEventEls().length).toBe(5) - expect(dayGridWrapper.getBgEventEls(0).length).toBe(1) - expect(dayGridWrapper.getBgEventEls(1).length).toBe(1) - expect(dayGridWrapper.getBgEventEls(2).length).toBe(1) - expect(dayGridWrapper.getBgEventEls(3).length).toBe(1) - expect(dayGridWrapper.getBgEventEls(4).length).toBe(1) - expect(dayGridWrapper.getBgEventEls(5).length).toBe(0) - - expect(dayGridWrapper.getBgEventEls(4)) - .toBeLeftOf(dayGridWrapper.getDayEl('2014-11-28')) - }) - - it('render correctly with two related events, in reverse order', () => { - let calendar = initCalendar({ - events: [ - { - groupId: 'hi', - start: '2014-11-06', - display: 'inverse-background', - }, - { - groupId: 'hi', - start: '2014-11-04', - display: 'inverse-background', - }, - ], - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - expect(dayGridWrapper.getBgEventEls().length).toBe(8) - expect(dayGridWrapper.getBgEventEls(0).length).toBe(1) - expect(dayGridWrapper.getBgEventEls(1).length).toBe(3) - expect(dayGridWrapper.getBgEventEls(2).length).toBe(1) - expect(dayGridWrapper.getBgEventEls(3).length).toBe(1) - expect(dayGridWrapper.getBgEventEls(4).length).toBe(1) - expect(dayGridWrapper.getBgEventEls(5).length).toBe(1) - }) - }) - - describe('when RTL', () => { - pushOptions({ direction: 'rtl' }) - - it('render correctly on a single day', () => { - let calendar = initCalendar({ - events: [{ - title: 'hi', - start: '2014-11-04', - display: 'inverse-background', - }], - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - expect(dayGridWrapper.getBgEventEls().length).toBe(7) - expect(dayGridWrapper.getBgEventEls(0).length).toBe(1) - expect(dayGridWrapper.getBgEventEls(1).length).toBe(2) - expect(dayGridWrapper.getBgEventEls(2).length).toBe(1) - expect(dayGridWrapper.getBgEventEls(3).length).toBe(1) - expect(dayGridWrapper.getBgEventEls(4).length).toBe(1) - expect(dayGridWrapper.getBgEventEls(5).length).toBe(1) - }) - }) - }) - - describe('when in month view', () => { - it('can be activated when rendering set on the source', () => { - let calendar = initCalendar({ - initialView: 'dayGridMonth', - eventSources: [{ - display: 'background', - events: [{ - start: '2014-11-04', - }], - }], - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - expect(dayGridWrapper.getBgEventEls().length).toBe(1) - expect(dayGridWrapper.getEventEls().length).toBe(0) - }) - }) - - describe('when in timeGrid view and timed event', () => { - it('can be activated when rendering set on the source', () => { - let calendar = initCalendar({ - initialView: 'timeGridWeek', - eventSources: [{ - display: 'background', - events: [{ - start: '2014-11-04T01:00:00', - }], - }], - }) - let viewWrapper = new TimeGridViewWrapper(calendar) - - expect(viewWrapper.dayGrid.getEventEls().length).toBe(0) - expect(viewWrapper.timeGrid.getBgEventEls().length).toBe(1) - }) - }) - }) - - describe('when in week view', () => { - pushOptions({ initialView: 'timeGridWeek' }) - - describe('when LTR', () => { - it('render correctly on one day', () => { - let calendar = initCalendar({ - events: [{ - start: '2014-11-04T01:00:00', - end: '2014-11-04T05:00:00', - display: 'background', - }], - }) - - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let allBgEvents = timeGridWrapper.getBgEventEls() - - expect(allBgEvents.length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(2).length).toBe(1) // column - expect(timeGridWrapper.getEventEls().length).toBe(0) // no fg events - - let rect = allBgEvents[0].getBoundingClientRect() - let topDiff = Math.abs(rect.top - timeGridWrapper.getTimeTop('01:00:00')) // TODO: make more exact - let bottomDiff = Math.abs(rect.bottom - timeGridWrapper.getTimeTop('05:00:00')) - - expect(topDiff).toBeLessThanOrEqual(1) - expect(bottomDiff).toBeLessThanOrEqual(1) - }) - - it('render correctly spanning multiple days', () => { - let calendar = initCalendar({ - events: [{ - start: '2014-11-04T01:00:00', - end: '2014-11-05T05:00:00', - display: 'background', - }], - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - - expect(timeGridWrapper.getBgEventEls().length).toBe(2) - expect(timeGridWrapper.queryBgEventsInCol(2).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(3).length).toBe(1) - }) - - it('render correctly when two span on top of each other', () => { - let calendar = initCalendar({ - events: [ - { - start: '2014-11-04T01:00:00', - end: '2014-11-05T05:00:00', - display: 'background', - }, - { - start: '2014-11-04T03:00:00', - end: '2014-11-05T08:00:00', - display: 'background', - }, - ], - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - - expect(timeGridWrapper.getBgEventEls().length).toBe(4) - expect(timeGridWrapper.queryBgEventsInCol(2).length).toBe(2) - expect(timeGridWrapper.queryBgEventsInCol(3).length).toBe(2) - // TODO: maybe check y coords - }) - - describe('when businessHours', () => { - it('renders correctly if assumed default', () => { - let calendar = initCalendar({ - businessHours: true, - }) - let viewWrapper = new TimeGridViewWrapper(calendar) - expect(viewWrapper.dayGrid.getNonBusinessDayEls().length).toBe(2) // whole days in the day area - expect(viewWrapper.timeGrid.getNonBusinessDayEls().length).toBe(12) // strips of gray on the timed area - }) - - it('renders correctly if custom', () => { - let calendar = initCalendar({ - businessHours: { - startTime: '02:00', - endTime: '06:00', - daysOfWeek: [1, 2, 3, 4], // Mon-Thu - }, - }) - let viewWrapper = new TimeGridViewWrapper(calendar) - - // whole days - expect(viewWrapper.dayGrid.getNonBusinessDayEls().length).toBe(2) // each multi-day stretch is one element - - // time area - let timeGridWrapper = viewWrapper.timeGrid - expect(timeGridWrapper.getNonBusinessDayEls().length).toBe(11) - expect(timeGridWrapper.queryNonBusinessSegsInCol(0).length).toBe(1) - expect(timeGridWrapper.queryNonBusinessSegsInCol(1).length).toBe(2) - expect(timeGridWrapper.queryNonBusinessSegsInCol(2).length).toBe(2) - expect(timeGridWrapper.queryNonBusinessSegsInCol(3).length).toBe(2) - expect(timeGridWrapper.queryNonBusinessSegsInCol(4).length).toBe(2) - expect(timeGridWrapper.queryNonBusinessSegsInCol(5).length).toBe(1) - expect(timeGridWrapper.queryNonBusinessSegsInCol(6).length).toBe(1) - }) - }) - }) - - describe('when RTL', () => { - pushOptions({ - direction: 'rtl', - }) - - it('render correctly on one day', () => { - let calendar = initCalendar({ - events: [{ - start: '2014-11-04T01:00:00', - end: '2014-11-04T05:00:00', - display: 'background', - }], - }) - - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let allBgEls = timeGridWrapper.getBgEventEls() - - expect(allBgEls.length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(2).length).toBe(1) - - let rect = allBgEls[0].getBoundingClientRect() - let topDiff = Math.abs(rect.top - timeGridWrapper.getTimeTop('01:00:00')) - let bottomDiff = Math.abs(rect.bottom - timeGridWrapper.getTimeTop('05:00:00')) - - expect(topDiff).toBeLessThanOrEqual(1) // TODO: tighten up - expect(bottomDiff).toBeLessThanOrEqual(1) - }) - - it('render correctly spanning multiple days', () => { - let calendar = initCalendar({ - events: [{ - start: '2014-11-04T01:00:00', - end: '2014-11-05T05:00:00', - display: 'background', - }], - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - - expect(timeGridWrapper.getBgEventEls().length).toBe(2) - expect(timeGridWrapper.queryBgEventsInCol(3).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(2).length).toBe(1) - }) - - describe('when businessHours', () => { - it('renders correctly if custom', () => { - let calendar = initCalendar({ - businessHours: { - startTime: '02:00', - endTime: '06:00', - daysOfWeek: [1, 2, 3, 4], // Mon-Thu - }, - }) - let viewWrapper = new TimeGridViewWrapper(calendar) - - // whole days - let dayGridWrapper = viewWrapper.dayGrid - expect(dayGridWrapper.getNonBusinessDayEls().length).toBe(2) // each stretch of days is one element - - // time area - let timeGridWrapper = viewWrapper.timeGrid - expect(timeGridWrapper.getNonBusinessDayEls().length).toBe(11) - expect(timeGridWrapper.queryNonBusinessSegsInCol(0).length).toBe(1) - expect(timeGridWrapper.queryNonBusinessSegsInCol(1).length).toBe(2) - expect(timeGridWrapper.queryNonBusinessSegsInCol(2).length).toBe(2) - expect(timeGridWrapper.queryNonBusinessSegsInCol(3).length).toBe(2) - expect(timeGridWrapper.queryNonBusinessSegsInCol(4).length).toBe(2) - expect(timeGridWrapper.queryNonBusinessSegsInCol(5).length).toBe(1) - expect(timeGridWrapper.queryNonBusinessSegsInCol(6).length).toBe(1) - }) - }) - }) - - describe('when inverse', () => { - describe('when LTR', () => { - it('render correctly on one day', () => { - let calendar = initCalendar({ - events: [{ - start: '2014-11-04T01:00:00', - end: '2014-11-04T05:00:00', - display: 'inverse-background', - }], - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - - expect(timeGridWrapper.getBgEventEls().length).toBe(8) - expect(timeGridWrapper.queryBgEventsInCol(0).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(1).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(2).length).toBe(2) - expect(timeGridWrapper.queryBgEventsInCol(3).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(4).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(5).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(6).length).toBe(1) - // TODO: maybe check y coords - }) - - it('render correctly spanning multiple days', () => { - let calendar = initCalendar({ - events: [{ - start: '2014-11-04T01:00:00', - end: '2014-11-05T05:00:00', - display: 'inverse-background', - }], - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - - expect(timeGridWrapper.getBgEventEls().length).toBe(7) - expect(timeGridWrapper.queryBgEventsInCol(0).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(1).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(2).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(3).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(4).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(5).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(6).length).toBe(1) - // TODO: maybe check y coords - }) - - it('render correctly when starts before start of week', () => { - let calendar = initCalendar({ - events: [{ - start: '2014-10-30T01:00:00', - end: '2014-11-04T05:00:00', - display: 'inverse-background', - }], - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - - expect(timeGridWrapper.getBgEventEls().length).toBe(5) - expect(timeGridWrapper.queryBgEventsInCol(0).length).toBe(0) - expect(timeGridWrapper.queryBgEventsInCol(1).length).toBe(0) - expect(timeGridWrapper.queryBgEventsInCol(2).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(3).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(4).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(5).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(6).length).toBe(1) - // TODO: maybe check y coords - }) - - it('render correctly when ends after end of week', () => { - let calendar = initCalendar({ - events: [{ - start: '2014-11-04T01:00:00', - end: '2014-11-12T05:00:00', - display: 'inverse-background', - }], - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - - expect(timeGridWrapper.getBgEventEls().length).toBe(3) - expect(timeGridWrapper.queryBgEventsInCol(0).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(1).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(2).length).toBe(1) - // TODO: maybe check y coords - }) - - it('render correctly with two related events, in reverse order', () => { - let calendar = initCalendar({ - events: [ - { - groupId: 'hello', - start: '2014-11-05T01:00:00', - end: '2014-11-05T05:00:00', - display: 'inverse-background', - }, - { - groupId: 'hello', - start: '2014-11-03T01:00:00', - end: '2014-11-03T05:00:00', - display: 'inverse-background', - }, - ], - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - - expect(timeGridWrapper.getBgEventEls().length).toBe(9) - expect(timeGridWrapper.queryBgEventsInCol(0).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(1).length).toBe(2) - expect(timeGridWrapper.queryBgEventsInCol(2).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(3).length).toBe(2) - expect(timeGridWrapper.queryBgEventsInCol(4).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(5).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(6).length).toBe(1) - // TODO: maybe check y coords - }) - - it('render correctly with two related events, nested', () => { - let calendar = initCalendar({ - events: [ - { - groupId: 'hello', - start: '2014-11-05T01:00:00', - end: '2014-11-05T05:00:00', - display: 'inverse-background', - }, - { - groupId: 'hello', - start: '2014-11-05T02:00:00', - end: '2014-11-05T04:00:00', - display: 'inverse-background', - }, - ], - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let allBgEls = timeGridWrapper.getBgEventEls() - - expect(allBgEls.length).toBe(8) - expect(timeGridWrapper.queryBgEventsInCol(0).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(1).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(2).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(3).length).toBe(2) - expect(timeGridWrapper.queryBgEventsInCol(4).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(5).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(6).length).toBe(1) - - expect(allBgEls[3].getBoundingClientRect().top) - .toBeLessThan(timeGridWrapper.getTimeTop('01:00:00')) - expect(allBgEls[4].getBoundingClientRect().bottom) - .toBeGreaterThan(timeGridWrapper.getTimeTop('05:00:00')) - }) - }) - - describe('when RTL', () => { - pushOptions({ - direction: 'rtl', - }) - - it('render correctly on one day', () => { - let calendar = initCalendar({ - events: [{ - start: '2014-11-04T01:00:00', - end: '2014-11-04T05:00:00', - display: 'inverse-background', - }], - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - - expect(timeGridWrapper.getBgEventEls().length).toBe(8) - expect(timeGridWrapper.queryBgEventsInCol(0).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(1).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(2).length).toBe(2) - expect(timeGridWrapper.queryBgEventsInCol(3).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(4).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(5).length).toBe(1) - expect(timeGridWrapper.queryBgEventsInCol(6).length).toBe(1) - // TODO: maybe check y coords - }) - }) - - describe('when out of view range', () => { - it('should still render', () => { - let calendar = initCalendar({ - events: [{ - start: '2014-01-01T01:00:00', - end: '2014-01-01T05:00:00', - display: 'inverse-background', - }], - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - expect(timeGridWrapper.getBgEventEls().length).toBe(7) - }) - }) - }) - - it('can have custom Event Object color', () => { - let calendar = initCalendar({ - events: [{ - start: '2014-11-04T01:00:00', - display: 'background', - color: 'red', - }], - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let bgEl = timeGridWrapper.getBgEventEls()[0] - expect($(bgEl).css('background-color')).toMatch(RED_REGEX) - }) - - it('can have custom Event Object backgroundColor', () => { - let calendar = initCalendar({ - events: [{ - start: '2014-11-04T01:00:00', - display: 'background', - backgroundColor: 'red', - }], - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let bgEl = timeGridWrapper.getBgEventEls()[0] - expect($(bgEl).css('background-color')).toMatch(RED_REGEX) - }) - - it('can have custom Event Source color', () => { - let calendar = initCalendar({ - eventSources: [{ - color: 'red', - events: [{ - start: '2014-11-04T01:00:00', - display: 'background', - }], - }], - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let bgEl = timeGridWrapper.getBgEventEls()[0] - expect($(bgEl).css('background-color')).toMatch(RED_REGEX) - }) - - it('can have custom Event Source backgroundColor', () => { - let calendar = initCalendar({ - eventSources: [{ - backgroundColor: 'red', - events: [{ - start: '2014-11-04T01:00:00', - display: 'background', - }], - }], - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let bgEl = timeGridWrapper.getBgEventEls()[0] - expect($(bgEl).css('background-color')).toMatch(RED_REGEX) - }) - - it('is affected by global eventColor', () => { - let calendar = initCalendar({ - eventColor: 'red', - eventSources: [{ - events: [{ - start: '2014-11-04T01:00:00', - display: 'background', - }], - }], - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let bgEl = timeGridWrapper.getBgEventEls()[0] - expect($(bgEl).css('background-color')).toMatch(RED_REGEX) - }) - - it('is affected by global eventBackgroundColor', () => { - let calendar = initCalendar({ - eventBackgroundColor: 'red', - eventSources: [{ - events: [{ - start: '2014-11-04T01:00:00', - display: 'background', - }], - }], - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let bgEl = timeGridWrapper.getBgEventEls()[0] - expect($(bgEl).css('background-color')).toMatch(RED_REGEX) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/businessHours.ts b/fullcalendar-main/tests/src/legacy/businessHours.ts deleted file mode 100644 index 2bb388b..0000000 --- a/fullcalendar-main/tests/src/legacy/businessHours.ts +++ /dev/null @@ -1,182 +0,0 @@ -// most other businessHours tests are in background-events.js - -import { doElsMatchSegs } from '../lib/segs.js' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('businessHours', () => { - pushOptions({ - timeZone: 'UTC', - initialDate: '2014-11-25', - initialView: 'dayGridMonth', - businessHours: true, - }) - - it('doesn\'t break when starting out in a larger month time range', () => { - let calendar = initCalendar() // start out in the month range - - currentCalendar.changeView('timeGridWeek') - currentCalendar.next() // move out of the original month range... - currentCalendar.next() // ... out. should render correctly. - - // whole days - let dayGridWrapper = new TimeGridViewWrapper(calendar).dayGrid - expect(dayGridWrapper.getNonBusinessDayEls().length).toBe(2) // each multi-day stretch is one element - - // timed area - expect(isTimeGridNonBusinessSegsRendered(calendar, [ - // sun - { start: '2014-12-07T00:00', end: '2014-12-08T00:00' }, - // mon - { start: '2014-12-08T00:00', end: '2014-12-08T09:00' }, - { start: '2014-12-08T17:00', end: '2014-12-09T00:00' }, - // tue - { start: '2014-12-09T00:00', end: '2014-12-09T09:00' }, - { start: '2014-12-09T17:00', end: '2014-12-10T00:00' }, - // wed - { start: '2014-12-10T00:00', end: '2014-12-10T09:00' }, - { start: '2014-12-10T17:00', end: '2014-12-11T00:00' }, - // thu - { start: '2014-12-11T00:00', end: '2014-12-11T09:00' }, - { start: '2014-12-11T17:00', end: '2014-12-12T00:00' }, - // fri - { start: '2014-12-12T00:00', end: '2014-12-12T09:00' }, - { start: '2014-12-12T17:00', end: '2014-12-13T00:00' }, - // sat - { start: '2014-12-13T00:00', end: '2014-12-14T00:00' }, - ])).toBe(true) - }) - - describe('when used as a dynamic option', () => { - ['timeGridWeek', 'dayGridMonth'].forEach((viewName) => { - it('allows dynamic turning on', () => { - let calendar = initCalendar({ - initialView: viewName, - businessHours: false, - }) - let calendarWrapper = new CalendarWrapper(calendar) - - expect(calendarWrapper.getNonBusinessDayEls().length).toBe(0) - currentCalendar.setOption('businessHours', true) - expect(calendarWrapper.getNonBusinessDayEls().length).toBeGreaterThan(0) - }) - - it('allows dynamic turning off', () => { - let calendar = initCalendar({ - initialView: viewName, - businessHours: true, - }) - let calendarWrapper = new CalendarWrapper(calendar) - - expect(calendarWrapper.getNonBusinessDayEls().length).toBeGreaterThan(0) - currentCalendar.setOption('businessHours', false) - expect(calendarWrapper.getNonBusinessDayEls().length).toBe(0) - }) - }) - }) - - describe('for multiple day-of-week definitions', () => { - it('rendes two day-of-week groups', () => { - let calendar = initCalendar({ - initialDate: '2014-12-07', - initialView: 'timeGridWeek', - businessHours: [ - { - daysOfWeek: [1, 2, 3], // mon, tue, wed - startTime: '08:00', - endTime: '18:00', - }, - { - daysOfWeek: [4, 5], // thu, fri - startTime: '10:00', - endTime: '16:00', - }, - ], - }) - - // timed area - expect(isTimeGridNonBusinessSegsRendered(calendar, [ - // sun - { start: '2014-12-07T00:00', end: '2014-12-08T00:00' }, - // mon - { start: '2014-12-08T00:00', end: '2014-12-08T08:00' }, - { start: '2014-12-08T18:00', end: '2014-12-09T00:00' }, - // tue - { start: '2014-12-09T00:00', end: '2014-12-09T08:00' }, - { start: '2014-12-09T18:00', end: '2014-12-10T00:00' }, - // wed - { start: '2014-12-10T00:00', end: '2014-12-10T08:00' }, - { start: '2014-12-10T18:00', end: '2014-12-11T00:00' }, - // thu - { start: '2014-12-11T00:00', end: '2014-12-11T10:00' }, - { start: '2014-12-11T16:00', end: '2014-12-12T00:00' }, - // fri - { start: '2014-12-12T00:00', end: '2014-12-12T10:00' }, - { start: '2014-12-12T16:00', end: '2014-12-13T00:00' }, - // sat - { start: '2014-12-13T00:00', end: '2014-12-14T00:00' }, - ])).toBe(true) - }) - - it('wont\'t process businessHour items that omit dow', () => { - let calendar = initCalendar({ - initialDate: '2014-12-07', - initialView: 'timeGridWeek', - businessHours: [ - { - // invalid - startTime: '08:00', - endTime: '18:00', - }, - { - daysOfWeek: [4, 5], // thu, fri - startTime: '10:00', - endTime: '16:00', - }, - ], - }) - - // timed area - expect(isTimeGridNonBusinessSegsRendered(calendar, [ - // sun - { start: '2014-12-07T00:00', end: '2014-12-08T00:00' }, - // mon - { start: '2014-12-08T00:00', end: '2014-12-09T00:00' }, - // tue - { start: '2014-12-09T00:00', end: '2014-12-10T00:00' }, - // wed - { start: '2014-12-10T00:00', end: '2014-12-11T00:00' }, - // thu - { start: '2014-12-11T00:00', end: '2014-12-11T10:00' }, - { start: '2014-12-11T16:00', end: '2014-12-12T00:00' }, - // fri - { start: '2014-12-12T00:00', end: '2014-12-12T10:00' }, - { start: '2014-12-12T16:00', end: '2014-12-13T00:00' }, - // sat - { start: '2014-12-13T00:00', end: '2014-12-14T00:00' }, - ])).toBe(true) - }) - }) - - it('will grey-out a totally non-business-hour view', () => { - let calendar = initCalendar({ - initialDate: '2016-07-23', // sat - initialView: 'timeGridDay', - businessHours: true, - }) - - // timed area - expect(isTimeGridNonBusinessSegsRendered(calendar, [ - { start: '2016-07-23T00:00', end: '2016-07-24T00:00' }, - ])).toBe(true) - }) - - function isTimeGridNonBusinessSegsRendered(calendar, segs) { - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - return doElsMatchSegs( - timeGridWrapper.getNonBusinessDayEls(), - segs, - timeGridWrapper.getRect.bind(timeGridWrapper), - ) - } -}) diff --git a/fullcalendar-main/tests/src/legacy/buttonIcons.ts b/fullcalendar-main/tests/src/legacy/buttonIcons.ts deleted file mode 100644 index facffb6..0000000 --- a/fullcalendar-main/tests/src/legacy/buttonIcons.ts +++ /dev/null @@ -1,70 +0,0 @@ -import bootstrapPlugin from '@fullcalendar/bootstrap' -import dayGridPlugin from '@fullcalendar/daygrid' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('buttonIcons', () => { - pushOptions({ - plugins: [dayGridPlugin, bootstrapPlugin], - headerToolbar: { - left: 'prev,next today', - center: 'title', - right: 'prevYear, nextYear', - }, - }) - - describe('when buttonIcons is not set', () => { - it('should have default values', () => { - let calendar = initCalendar() - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - - let prevBtn = toolbarWrapper.getButtonInfo('prev') - let nextBtn = toolbarWrapper.getButtonInfo('next') - let nextYearBtn = toolbarWrapper.getButtonInfo('nextYear') - let prevYearBtn = toolbarWrapper.getButtonInfo('prevYear') - - expect(prevBtn.iconName).toBe('chevron-left') - expect(nextBtn.iconName).toBe('chevron-right') - expect(nextYearBtn.iconName).toBe('chevrons-right') - expect(prevYearBtn.iconName).toBe('chevrons-left') - }) - }) - - describe('when buttonIcons is set and theme is falsy', () => { - pushOptions({ - buttonIcons: { - prev: 'some-icon-left', - next: 'some-icon-right', - prevYear: 'some-icon-leftYear', - nextYear: 'some-icon-rightYear', - }, - }) - - it('should have the set values', () => { - let calendar = initCalendar() - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - - let prevBtn = toolbarWrapper.getButtonInfo('prev') - let nextYearBtn = toolbarWrapper.getButtonInfo('nextYear') - let prevYearBtn = toolbarWrapper.getButtonInfo('prevYear') - - expect(prevBtn.iconName).toBe('some-icon-left') - expect(prevBtn.iconName).toBe('some-icon-left') - expect(prevYearBtn.iconName).toBe('some-icon-leftYear') - expect(nextYearBtn.iconName).toBe('some-icon-rightYear') - }) - }) - - describe('when theme is set', () => { - pushOptions({ - themeSystem: 'bootstrap', - }) - - it('buttonIcons is ignored', () => { - let calendar = initCalendar() - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - let prevButtonInfo = toolbarWrapper.getButtonInfo('prev') // NOT called with 'fa' - - expect(prevButtonInfo.iconName).toBeFalsy() - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/buttonText.ts b/fullcalendar-main/tests/src/legacy/buttonText.ts deleted file mode 100644 index 394161b..0000000 --- a/fullcalendar-main/tests/src/legacy/buttonText.ts +++ /dev/null @@ -1,214 +0,0 @@ -import frLocale from '@fullcalendar/core/locales/fr' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('button text', () => { - pushOptions({ - headerToolbar: { - left: 'prevYear,prev,today,next,nextYear', - center: '', - right: 'dayGridMonth,dayGridWeek,dayGridDay,timeGridWeek,timeGridDay', - }, - }) - - describe('with default locale', () => { - describe('with default buttonIcons', () => { - it('should contain default text values', () => { - let calendar = initCalendar() - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - - // will have button icons, to text will be empty - expect(toolbarWrapper.getButtonInfo('next').text).toBe('') - expect(toolbarWrapper.getButtonInfo('nextYear').text).toBe('') - expect(toolbarWrapper.getButtonInfo('prev').text).toBe('') - expect(toolbarWrapper.getButtonInfo('prevYear').text).toBe('') - - expect(toolbarWrapper.getButtonInfo('today').text).toBe('today') - expect(toolbarWrapper.getButtonInfo('dayGridMonth').text).toBe('month') - expect(toolbarWrapper.getButtonInfo('dayGridWeek').text).toBe('week') - expect(toolbarWrapper.getButtonInfo('timeGridWeek').text).toBe('week') - expect(toolbarWrapper.getButtonInfo('dayGridDay').text).toBe('day') - }) - - it('should contain specified text values', () => { - let calendar = initCalendar({ - buttonText: { - prev: '<-', - next: '->', - prevYear: '<--', - nextYear: '-->', - today: 'tidei', - month: 'mun', - week: 'wiki', - day: 'dei', - }, - }) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - - expect(toolbarWrapper.getButtonInfo('next').text).toBe('->') - expect(toolbarWrapper.getButtonInfo('nextYear').text).toBe('-->') - expect(toolbarWrapper.getButtonInfo('prev').text).toBe('<-') - expect(toolbarWrapper.getButtonInfo('prevYear').text).toBe('<--') - - expect(toolbarWrapper.getButtonInfo('today').text).toBe('tidei') - expect(toolbarWrapper.getButtonInfo('dayGridMonth').text).toBe('mun') - expect(toolbarWrapper.getButtonInfo('dayGridWeek').text).toBe('wiki') - expect(toolbarWrapper.getButtonInfo('dayGridDay').text).toBe('dei') - expect(toolbarWrapper.getButtonInfo('timeGridWeek').text).toBe('wiki') - }) - }) - - describe('with buttonIcons turned off', () => { - pushOptions({ - buttonIcons: false, - }) - - it('should contain default text values', () => { - let calendar = initCalendar() - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - - // will have actual text now - expect(toolbarWrapper.getButtonInfo('next').text).toBe('next') - expect(toolbarWrapper.getButtonInfo('nextYear').text).toBe('next year') - expect(toolbarWrapper.getButtonInfo('prev').text).toBe('prev') - expect(toolbarWrapper.getButtonInfo('prevYear').text).toBe('prev year') - - expect(toolbarWrapper.getButtonInfo('today').text).toBe('today') - expect(toolbarWrapper.getButtonInfo('dayGridMonth').text).toBe('month') - expect(toolbarWrapper.getButtonInfo('dayGridWeek').text).toBe('week') - expect(toolbarWrapper.getButtonInfo('dayGridDay').text).toBe('day') - expect(toolbarWrapper.getButtonInfo('timeGridWeek').text).toBe('week') - }) - - it('should contain specified text values', () => { - let calendar = initCalendar({ - buttonText: { - prev: '<-', - next: '->', - prevYear: '<--', - nextYear: '-->', - today: 'tidei', - month: 'mun', - week: 'wiki', - day: 'dei', - }, - }) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - - expect(toolbarWrapper.getButtonInfo('next').text).toBe('->') - expect(toolbarWrapper.getButtonInfo('nextYear').text).toBe('-->') - expect(toolbarWrapper.getButtonInfo('prev').text).toBe('<-') - expect(toolbarWrapper.getButtonInfo('prevYear').text).toBe('<--') - - expect(toolbarWrapper.getButtonInfo('today').text).toBe('tidei') - expect(toolbarWrapper.getButtonInfo('dayGridMonth').text).toBe('mun') - expect(toolbarWrapper.getButtonInfo('dayGridWeek').text).toBe('wiki') - expect(toolbarWrapper.getButtonInfo('dayGridDay').text).toBe('dei') - expect(toolbarWrapper.getButtonInfo('timeGridWeek').text).toBe('wiki') - }) - }) - }) - - describe('when locale is not default', () => { - pushOptions({ - locale: frLocale, - }) - - describe('with default buttonIcons', () => { - it('should contain default text values', () => { - let calendar = initCalendar() - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - - // will contain icons, so will contain no text - expect(toolbarWrapper.getButtonInfo('next').text).toBe('') - expect(toolbarWrapper.getButtonInfo('nextYear').text).toBe('') - expect(toolbarWrapper.getButtonInfo('prev').text).toBe('') - expect(toolbarWrapper.getButtonInfo('prevYear').text).toBe('') - - expect(toolbarWrapper.getButtonInfo('today').text).toBe('Aujourd\'hui') - expect(toolbarWrapper.getButtonInfo('dayGridMonth').text).toBe('Mois') - expect(toolbarWrapper.getButtonInfo('dayGridWeek').text).toBe('Semaine') - expect(toolbarWrapper.getButtonInfo('dayGridDay').text).toBe('Jour') - expect(toolbarWrapper.getButtonInfo('timeGridWeek').text).toBe('Semaine') - }) - - it('should contain specified text values', () => { - let calendar = initCalendar({ - buttonText: { - prev: '<-', - next: '->', - prevYear: '<--', - nextYear: '-->', - today: 'tidei', - month: 'mun', - week: 'wiki', - day: 'dei', - }, - }) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - - expect(toolbarWrapper.getButtonInfo('next').text).toBe('->') - expect(toolbarWrapper.getButtonInfo('nextYear').text).toBe('-->') - expect(toolbarWrapper.getButtonInfo('prev').text).toBe('<-') - expect(toolbarWrapper.getButtonInfo('prevYear').text).toBe('<--') - - expect(toolbarWrapper.getButtonInfo('today').text).toBe('tidei') - expect(toolbarWrapper.getButtonInfo('dayGridMonth').text).toBe('mun') - expect(toolbarWrapper.getButtonInfo('dayGridWeek').text).toBe('wiki') - expect(toolbarWrapper.getButtonInfo('dayGridDay').text).toBe('dei') - expect(toolbarWrapper.getButtonInfo('timeGridWeek').text).toBe('wiki') - }) - }) - - describe('with buttonIcons turned off', () => { - pushOptions({ - buttonIcons: false, - }) - - it('should contain default text values', () => { - let calendar = initCalendar() - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - - // will have the locale's actual text now - expect(toolbarWrapper.getButtonInfo('next').text).toBe('Suivant') - expect(toolbarWrapper.getButtonInfo('prev').text).toBe('Précédent') - /// / locales files don't have data for prev/next *year* - // expect(toolbarWrapper.getButtonInfo('nextYear').text).toBe('Suivant'); - // expect(toolbarWrapper.getButtonInfo('prevYear').text).toBe('Précédent'); - - expect(toolbarWrapper.getButtonInfo('today').text).toBe('Aujourd\'hui') - expect(toolbarWrapper.getButtonInfo('dayGridMonth').text).toBe('Mois') - expect(toolbarWrapper.getButtonInfo('dayGridWeek').text).toBe('Semaine') - expect(toolbarWrapper.getButtonInfo('timeGridWeek').text).toBe('Semaine') - expect(toolbarWrapper.getButtonInfo('dayGridDay').text).toBe('Jour') - expect(toolbarWrapper.getButtonInfo('dayGridDay').text).toBe('Jour') - }) - - it('should contain specified text values', () => { - let calendar = initCalendar({ - buttonText: { - prev: '<-', - next: '->', - prevYear: '<--', - nextYear: '-->', - today: 'tidei', - month: 'mun', - week: 'wiki', - day: 'dei', - }, - }) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - - expect(toolbarWrapper.getButtonInfo('next').text).toBe('->') - expect(toolbarWrapper.getButtonInfo('nextYear').text).toBe('-->') - expect(toolbarWrapper.getButtonInfo('prev').text).toBe('<-') - expect(toolbarWrapper.getButtonInfo('prevYear').text).toBe('<--') - - expect(toolbarWrapper.getButtonInfo('today').text).toBe('tidei') - expect(toolbarWrapper.getButtonInfo('dayGridMonth').text).toBe('mun') - expect(toolbarWrapper.getButtonInfo('dayGridWeek').text).toBe('wiki') - expect(toolbarWrapper.getButtonInfo('dayGridDay').text).toBe('dei') - expect(toolbarWrapper.getButtonInfo('timeGridWeek').text).toBe('wiki') - }) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/columnHeaderFormat.ts b/fullcalendar-main/tests/src/legacy/columnHeaderFormat.ts deleted file mode 100644 index ed64373..0000000 --- a/fullcalendar-main/tests/src/legacy/columnHeaderFormat.ts +++ /dev/null @@ -1,195 +0,0 @@ -import frLocale from '@fullcalendar/core/locales/fr' -import enGbLocale from '@fullcalendar/core/locales/en-gb' -import koLocale from '@fullcalendar/core/locales/ko' -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('dayHeaderFormat', () => { // TODO: rename file - describe('when not set', () => { - pushOptions({ - initialDate: '2014-05-11', - }) - - const VIEWS_WITH_FORMAT = [ - { view: 'dayGridMonth', expected: /^Sun$/ }, - { view: 'dayGridWeek', expected: /^Sun 5[/ ]11$/ }, - { view: 'timeGridWeek', expected: /^Sun 5[/ ]11$/ }, - { view: 'dayGridDay', expected: /^Sunday$/ }, - { view: 'timeGridDay', expected: /^Sunday$/ }, - ] - - it('should have default values', () => { - let calendar = initCalendar() - - for (let viewWithFormat of VIEWS_WITH_FORMAT) { - calendar.changeView(viewWithFormat.view) - let header = new (viewWithFormat.view.match(/^dayGrid/) ? DayGridViewWrapper : TimeGridViewWrapper)(calendar).header - expect(header.getCellText(0)).toMatch(viewWithFormat.expected) - } - }) - }) - - describe('when dayHeaderFormat is set on a per-view basis', () => { - pushOptions({ - initialDate: '2014-05-11', - views: { - month: { dayHeaderFormat: { weekday: 'long' } }, - day: { dayHeaderFormat: { weekday: 'long', month: 'long', day: 'numeric' } }, - dayGridWeek: { dayHeaderFormat: { weekday: 'long', month: 'numeric', day: 'numeric' } }, - }, - }) - - const VIEWS_WITH_FORMAT = [ - { view: 'dayGridMonth', expected: /^Sunday$/ }, - { view: 'timeGridDay', expected: /^Sunday, May 11$/ }, - { view: 'dayGridWeek', expected: /^Sunday, 5[/ ]11$/ }, - ] - - it('should have the correct values', () => { - let calendar = initCalendar() - - for (let viewWithFormat of VIEWS_WITH_FORMAT) { - calendar.changeView(viewWithFormat.view) - let header = new (viewWithFormat.view.match(/^dayGrid/) ? DayGridViewWrapper : TimeGridViewWrapper)(calendar).header - expect(header.getCellText(0)).toMatch(viewWithFormat.expected) - } - }) - }) - - describe('when locale is French', () => { - pushOptions({ - initialDate: '2014-05-11', - locale: frLocale, - }) - - const VIEWS_WITH_FORMAT = [ - { view: 'dayGridMonth', expected: /^dim\.$/ }, - { view: 'dayGridWeek', expected: /^dim\. 11[/ ]0?5$/ }, - { view: 'timeGridWeek', expected: /^dim\. 11[/ ]0?5$/ }, - { view: 'dayGridDay', expected: /^dimanche$/ }, - { view: 'timeGridDay', expected: /^dimanche$/ }, - ] - - it('should have the translated dates', () => { - let calendar = initCalendar() - - for (let viewWithFormat of VIEWS_WITH_FORMAT) { - calendar.changeView(viewWithFormat.view) - let header = new (viewWithFormat.view.match(/^dayGrid/) ? DayGridViewWrapper : TimeGridViewWrapper)(calendar).header - expect(header.getCellText(0)).toMatch(viewWithFormat.expected) - } - }) - }) - - describe('when locale is en-gb', () => { - pushOptions({ - initialDate: '2014-05-11', - locale: enGbLocale, - }) - - const VIEWS_WITH_FORMAT = [ - { view: 'dayGridMonth', expected: /^Sun$/ }, - { view: 'dayGridWeek', expected: /^Sun 11[/ ]0?5$/ }, - { view: 'timeGridWeek', expected: /^Sun 11[/ ]0?5$/ }, - { view: 'dayGridDay', expected: /^Sunday$/ }, - { view: 'timeGridDay', expected: /^Sunday$/ }, - ] - - it('should have the translated dates', () => { - let calendar = initCalendar() - - for (let viewWithFormat of VIEWS_WITH_FORMAT) { - calendar.changeView(viewWithFormat.view) - let header = new (viewWithFormat.view.match(/^dayGrid/) ? DayGridViewWrapper : TimeGridViewWrapper)(calendar).header - expect(header.getCellText(0)).toMatch(viewWithFormat.expected) - } - }) - }) - - describe('when locale is Korean', () => { - pushOptions({ - initialDate: '2014-05-11', - locale: koLocale, - }) - - const VIEWS_WITH_FORMAT = [ - { view: 'dayGridMonth', expected: /^일$/ }, - { view: 'dayGridWeek', expected: /^5[.월] 11[.일] \(?일\)?$/ }, - { view: 'timeGridWeek', expected: /^5[.월] 11[.일] \(?일\)?$/ }, - { view: 'dayGridDay', expected: /^일요일$/ }, - { view: 'timeGridDay', expected: /^일요일$/ }, - ] - - it('should have the translated dates and dayHeaderFormat should be computed differently', () => { - let calendar = initCalendar() - - for (let viewWithFormat of VIEWS_WITH_FORMAT) { - calendar.changeView(viewWithFormat.view) - let header = new (viewWithFormat.view.match(/^dayGrid/) ? DayGridViewWrapper : TimeGridViewWrapper)(calendar).header - expect(header.getCellText(0)).toMatch(viewWithFormat.expected) - } - }) - }) - - describe('using custom views', () => { - it('multi-year default only displays day-of-week', () => { - let calendar = initCalendar({ - views: { - dayGridTwoYear: { - type: 'dayGrid', - duration: { years: 2 }, - }, - }, - initialView: 'dayGridTwoYear', - initialDate: '2014-12-25', - }) - let header = new DayGridViewWrapper(calendar).header - expect(header.getCellText(0)).toBe('Sun') - }) - - it('multi-month default only displays day-of-week', () => { - let calendar = initCalendar({ - views: { - dayGridTwoMonth: { - type: 'dayGrid', - duration: { months: 2 }, - }, - }, - initialView: 'dayGridTwoMonth', - initialDate: '2014-12-25', - }) - let header = new DayGridViewWrapper(calendar).header - expect(header.getCellText(0)).toBe('Sun') - }) - - it('multi-week default only displays day-of-week', () => { - let calendar = initCalendar({ - views: { - dayGridTwoWeek: { - type: 'dayGrid', - duration: { weeks: 2 }, - }, - }, - initialView: 'dayGridTwoWeek', - initialDate: '2014-12-25', - }) - let header = new DayGridViewWrapper(calendar).header - expect(header.getCellText(0)).toBe('Sun') - }) - - it('multi-day default displays short full date', () => { - let calendar = initCalendar({ - views: { - multiDay: { - type: 'dayGrid', - duration: { days: 2 }, - }, - }, - initialView: 'multiDay', - initialDate: '2014-12-25', - }) - let header = new DayGridViewWrapper(calendar).header - expect(header.getCellText('2014-12-25')).toMatch(/^Thu 12[/ ]25$/) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/computeEdges.ts b/fullcalendar-main/tests/src/legacy/computeEdges.ts deleted file mode 100644 index b73ebbd..0000000 --- a/fullcalendar-main/tests/src/legacy/computeEdges.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { computeEdges } from '@fullcalendar/core/internal' -import { getStockScrollbarWidths } from '../lib/dom-misc.js' - -describe('computeEdges', () => { - defineTests( - 'when margin', - { margin: '5px 10px' }, - ) - defineTests( - 'when padding', - { padding: '5px 10px' }, - ) - - defineTests( - 'when border', - { border: '5px solid red' }, - ) - defineTests( - 'when border and padding', - { border: '5px solid red', padding: '5px 10px' }, - ) - - function defineTests(description, cssProps) { - describe(description, () => { - describe('when no scrolling', () => { - describe('when LTR', () => { - defineTest(false, 'ltr', cssProps) - }) - describe('when RTL', () => { - defineTest(false, 'rtl', cssProps) - }) - }) - describe('when scrolling', () => { - describe('when LTR', () => { - defineTest(true, 'ltr', cssProps) - }) - describe('when RTL', () => { - defineTest(true, 'rtl', cssProps) - }) - }) - }) - } - - function defineTest(isScrolling, direction, cssProps) { - it('computes correct widths', () => { - let el = $( - '
', - ) - .css('overflow', isScrolling ? 'scroll' : 'hidden') - .css('direction', direction) - .css(cssProps) - .append('
') - .appendTo('body') - - let edges = computeEdges(el[0]) - let correctWidths - - if (isScrolling) { - correctWidths = getStockScrollbarWidths(direction) - } else { - correctWidths = { left: 0, right: 0, bottom: 0 } - } - - expect(edges.scrollbarLeft).toBe(correctWidths.left) - expect(edges.scrollbarRight).toBe(correctWidths.right) - expect(edges.scrollbarBottom).toBe(correctWidths.bottom) - - el.remove() - }) - } -}) diff --git a/fullcalendar-main/tests/src/legacy/computerInnerRect.ts b/fullcalendar-main/tests/src/legacy/computerInnerRect.ts deleted file mode 100644 index f88bdd9..0000000 --- a/fullcalendar-main/tests/src/legacy/computerInnerRect.ts +++ /dev/null @@ -1,103 +0,0 @@ -import { computeInnerRect } from '@fullcalendar/core/internal' -import { getStockScrollbarWidths } from '../lib/dom-misc.js' - -describe('computeInnerRect', () => { - let INNER_WIDTH = 150 - let INNER_HEIGHT = 100 - let BORDER_LEFT = 1 - let BORDER_RIGHT = 2 - let BORDER_TOP = 3 - let BORDER_BOTTOM = 4 - let PADDING_LEFT = 5 - let PADDING_RIGHT = 6 - let PADDING_TOP = 7 - let PADDING_BOTTOM = 8 - - describeValues({ - 'when LTR': 'ltr', - 'when RTL': 'rtl', - }, (direction) => { - let el - - beforeEach(() => { - el = $('
') - .css({ - direction, - position: 'absolute', - top: 0, - left: 0, - borderStyle: 'solid', - borderColor: 'black', - borderLeftWidth: BORDER_LEFT, - borderRightWidth: BORDER_RIGHT, - borderTopWidth: BORDER_TOP, - borderBottomWidth: BORDER_BOTTOM, - paddingLeft: PADDING_LEFT, - paddingRight: PADDING_RIGHT, - paddingTop: PADDING_TOP, - paddingBottom: PADDING_BOTTOM, - }) - .append( - $('
').css({ - width: INNER_WIDTH, - height: INNER_HEIGHT, - }), - ) - .appendTo('body') - }) - - afterEach(() => { - el.remove() - }) - - describe('when no scrolling', () => { - beforeEach(() => { - el.css('overflow', 'hidden') - }) - - it('goes within border', () => { - expect(computeInnerRect(el[0])).toEqual({ - left: BORDER_LEFT, - right: BORDER_LEFT + PADDING_LEFT + INNER_WIDTH + PADDING_RIGHT, - top: BORDER_TOP, - bottom: BORDER_TOP + PADDING_TOP + INNER_HEIGHT + PADDING_BOTTOM, - }) - }) - - it('can go within padding', () => { - expect(computeInnerRect(el[0], true)).toEqual({ - left: BORDER_LEFT + PADDING_LEFT, - right: BORDER_LEFT + PADDING_LEFT + INNER_WIDTH, - top: BORDER_TOP + PADDING_TOP, - bottom: BORDER_TOP + PADDING_TOP + INNER_HEIGHT, - }) - }) - }) - - describe('when scrolling', () => { - beforeEach(() => { - el.css('overflow', 'scroll') - }) - - let stockScrollbars = getStockScrollbarWidths(direction) - - it('goes within border and scrollbars', () => { - expect(computeInnerRect(el[0])).toEqual({ - left: BORDER_LEFT + stockScrollbars.left, - right: BORDER_LEFT + stockScrollbars.left + PADDING_LEFT + INNER_WIDTH + PADDING_RIGHT, - top: BORDER_TOP, - bottom: BORDER_TOP + PADDING_TOP + INNER_HEIGHT + PADDING_BOTTOM, - }) - }) - - it('can go within padding', () => { - expect(computeInnerRect(el[0], true)).toEqual({ - left: BORDER_LEFT + stockScrollbars.left + PADDING_LEFT, - right: BORDER_LEFT + stockScrollbars.left + PADDING_LEFT + INNER_WIDTH, - top: BORDER_TOP + PADDING_TOP, - bottom: BORDER_TOP + PADDING_TOP + INNER_HEIGHT, - }) - }) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/constraint.ts b/fullcalendar-main/tests/src/legacy/constraint.ts deleted file mode 100644 index 290ec25..0000000 --- a/fullcalendar-main/tests/src/legacy/constraint.ts +++ /dev/null @@ -1,885 +0,0 @@ -import { testEventDrag, testEventResize, testSelection } from '../lib/dnd-resize-utils.js' - -describe('event constraint', () => { - pushOptions({ - initialDate: '2014-11-10', - initialView: 'timeGridWeek', - scrollTime: '00:00', - }) - describe('when used with a specific date range', () => { - describe('when an event is being dragged', () => { - describe('to the middle of the constraint range', () => { - it('allows a drag', (done) => { - let options = { - events: [{ - start: '2014-11-10T01:00:00', - end: '2014-11-10T02:00:00', - constraint: { - start: '2014-11-10T03:00:00', - end: '2014-11-10T06:00:00', - }, - }], - } - testEventDrag(options, '2014-11-10T04:00:00', true, done) - }) - - describe('when in month view with timed event', () => { - it('allows a drag, respects time of day', (done) => { - let options = { - initialView: 'dayGridMonth', - events: [{ - start: '2014-11-10T05:00:00', - end: '2014-11-10T07:00:00', - constraint: { - start: '04:00', - end: '20:00', - }, - }], - } - testEventDrag(options, '2014-11-14', true, () => { - let event = currentCalendar.getEvents()[0] - expect(event.start).toEqualDate('2014-11-14T05:00:00Z') - expect(event.end).toEqualDate('2014-11-14T07:00:00Z') - done() - }) - }) - }) - }) - - describe('to the start of the constraint range', () => { - it('allows a drag', (done) => { - let options = { - events: [{ - start: '2014-11-10T01:00:00', - end: '2014-11-10T02:00:00', - constraint: { - start: '2014-11-10T03:00:00', - end: '2014-11-10T06:00:00', - }, - }], - } - testEventDrag(options, '2014-11-10T03:00:00', true, done) - }) - }) - - describe('to the end of the constraint range', () => { - describe('when the event has an explicit end', () => { - it('allows a drag', (done) => { - let options = { - events: [{ - start: '2014-11-10T01:00:00', - end: '2014-11-10T02:00:00', - constraint: { - start: '2014-11-10T03:00:00', - end: '2014-11-10T06:00:00', - }, - }], - } - testEventDrag(options, '2014-11-10T05:00:00', true, done) - }) - }) - describe('when the event has an implied end', () => { - it('allows a drag', (done) => { - let options = { - defaultTimedEventDuration: '01:30:00', - events: [{ - start: '2014-11-10T01:00:00', - constraint: { - start: '2014-11-10T03:00:00', - end: '2014-11-10T06:00:00', - }, - }], - } - testEventDrag(options, '2014-11-10T04:30:00', true, done) - }) - }) - }) - - describe('before a constraint range', () => { - it('does not allow a drag', (done) => { - let options = { - events: [{ - start: '2014-11-10T01:00:00', - end: '2014-11-10T02:00:00', - constraint: { - start: '2014-11-10T03:00:00', - end: '2014-11-10T06:00:00', - }, - }], - } - testEventDrag(options, '2014-11-10T02:00:00', false, done) - }) - }) - - describe('after a constraint range', () => { - describe('using an event object\'s constraint', () => { - describe('when in week view with timed events', () => { - it('does not allow a drag', (done) => { - let options = { - events: [{ - start: '2014-11-10T01:00:00', - end: '2014-11-10T02:00:00', - constraint: { - start: '2014-11-10T03:00:00', - end: '2014-11-10T06:00:00', - }, - }], - } - testEventDrag(options, '2014-11-10T06:00:00', false, done) - }) - }) - describe('when in month view', () => { - pushOptions({ initialView: 'dayGridMonth' }) - describe('with timed event and all-day constraint', () => { - it('does not allow a drag', (done) => { - let options = { - events: [{ - start: '2014-11-10T01:00:00', - end: '2014-11-10T02:00:00', - constraint: { - start: '2014-11-10', - end: '2014-11-11', - }, - }], - } - testEventDrag(options, '2014-11-12', false, done) - }) - }) - describe('with timed event and timed constraint', () => { - it('does not allow a drag', (done) => { - let options = { - events: [{ - start: '2014-11-10T01:00:00', - end: '2014-11-10T02:00:00', - constraint: { - start: '2014-11-10T00:00:00', - end: '2014-11-11T12:00:00', - }, - }], - } - testEventDrag(options, '2014-11-12', false, done) - }) - }) - describe('with all-day event and all-day constraint', () => { - it('does not allow a drag', (done) => { - let options = { - events: [{ - start: '2014-11-10', - end: '2014-11-12', - constraint: { - start: '2014-11-09', - end: '2014-11-13', - }, - }], - } - testEventDrag(options, '2014-11-13', false, done) - }) - }) - describe('with all-day event and timed constraint', () => { - it('does not allow a drag', (done) => { - let options = { - events: [{ - start: '2014-11-10', - end: '2014-11-12', - constraint: { - start: '2014-11-09T01:00:00', - end: '2014-11-12T23:00:00', - }, - }], - } - testEventDrag(options, '2014-11-13', false, done) - }) - }) - }) - }) - describe('using an event source\'s constraint', () => { - it('does not allow a drag', (done) => { - let options = { - eventSources: [{ - events: [{ - start: '2014-11-10T01:00:00', - end: '2014-11-10T02:00:00', - }], - constraint: { - start: '2014-11-10T03:00:00', - end: '2014-11-10T06:00:00', - }, - }], - } - testEventDrag(options, '2014-11-10T06:00:00', false, done) - }) - }) - describe('using eventConstraint', () => { - it('does not allow a drag and doesnt call eventDataTransform', (done) => { - let options = { - events: [{ - start: '2014-11-10T01:00:00', - end: '2014-11-10T02:00:00', - }], - eventConstraint: { - start: '2014-11-10T03:00:00', - end: '2014-11-10T06:00:00', - }, - eventDataTransform(inData) { - return inData - }, - } - - spyOn(options, 'eventDataTransform').and.callThrough() - - testEventDrag(options, '2014-11-10T06:00:00', false, () => { - expect(options.eventDataTransform.calls.count()).toBe(1) // only initial parse - done() - }) - }) - }) - }) - - describe('intersecting the constraint start', () => { - describe('with no timezone', () => { - it('does not allow a drag', (done) => { - let options = { - events: [{ - start: '2014-11-10T03:00:00', - end: '2014-11-10T05:00:00', - constraint: { - start: '2014-11-10T03:00:00', - end: '2014-11-10T06:00:00', - }, - }], - } - testEventDrag(options, '2014-11-10T02:00:00', false, done) - }) - }) - describe('with UTC timezone', () => { - it('does not allow a drag', (done) => { - let options = { - timeZone: 'UTC', - events: [{ - start: '2014-11-10T03:00:00+00:00', - end: '2014-11-10T05:00:00+00:00', - constraint: { - start: '2014-11-10T03:00:00+00:00', - end: '2014-11-10T06:00:00+00:00', - }, - }], - } - testEventDrag(options, '2014-11-10T02:00:00+00:00', false, done) - }) - }) - }) - - describe('intersecting the constraint end', () => { - describe('when the event has an explicit end', () => { - it('does not allow a drag', (done) => { - let options = { - events: [{ - start: '2014-11-10T03:00:00', - end: '2014-11-10T05:00:00', - constraint: { - start: '2014-11-10T03:00:00', - end: '2014-11-10T06:00:00', - }, - }], - } - testEventDrag(options, '2014-11-10T05:00:00', false, done) - }) - }) - describe('when the event has an implied end', () => { - it('does not allow a drag', (done) => { - let options = { - defaultTimedEventDuration: '02:30', - events: [{ - start: '2014-11-10T03:00:00', - constraint: { - start: '2014-11-10T03:00:00', - end: '2014-11-10T12:00:00', - }, - }], - } - testEventDrag(options, '2014-11-10T10:00:00', false, done) - }) - }) - describe('with UTC timezone', () => { - it('does not allow a drag', (done) => { - let options = { - timeZone: 'UTC', - events: [{ - start: '2014-11-10T03:00:00+00:00', - end: '2014-11-10T05:00:00+00:00', - constraint: { - start: '2014-11-10T03:00:00+00:00', - end: '2014-11-10T06:00:00+00:00', - }, - }], - } - testEventDrag(options, '2014-11-10T05:00:00+00:00', false, done) - }) - }) - }) - - describe('into a constraint it encompasses', () => { - it('does not allow a drag', (done) => { - let options = { - events: [{ - start: '2014-11-10T01:00:00', - end: '2014-11-10T05:00:00', - constraint: { - start: '2014-11-10T12:00:00', - end: '2014-11-10T14:00:00', - }, - }], - } - testEventDrag(options, '2014-11-10T10:00:00', false, done) - }) - }) - }) - - describe('when an event is being resized', () => { - describe('when the start is already outside the constraint', () => { - it('does not allow a resize', (done) => { - let options = { - events: [{ - start: '2014-11-12T01:00:00', - end: '2014-11-12T03:00:00', - constraint: { - start: '2014-11-12T02:00:00', - end: '2014-11-12T22:00:00', - }, - }], - } - testEventResize(options, '2014-11-12T10:00:00', false, done) - }) - }) - - describe('when resized well within the constraint', () => { - it('allows a resize', (done) => { - let options = { - events: [{ - start: '2014-11-12T02:00:00', - end: '2014-11-12T04:00:00', - constraint: { - start: '2014-11-12T01:00:00', - end: '2014-11-12T22:00:00', - }, - }], - } - testEventResize(options, '2014-11-12T10:00:00', true, done) - }) - }) - - describe('when resized to the end of the constraint', () => { - it('allows a resize', (done) => { - let options = { - events: [{ - start: '2014-11-12T02:00:00', - end: '2014-11-12T04:00:00', - constraint: { - start: '2014-11-12T01:00:00', - end: '2014-11-12T06:00:00', - }, - }], - } - testEventResize(options, '2014-11-12T06:00:00', true, done) - }) - }) - - describe('when resized past the end of the constraint', () => { - it('does not allow a resize', (done) => { - let options = { - events: [{ - start: '2014-11-12T02:00:00', - end: '2014-11-12T04:00:00', - constraint: { - start: '2014-11-12T01:00:00', - end: '2014-11-12T06:00:00', - }, - }], - } - testEventResize(options, '2014-11-12T07:00:00', false, done) - }) - }) - }) - }) - - describe('when used with a recurring date range', () => { - describe('when an event is being dragged', () => { - describe('to the middle of the constraint range', () => { - it('allows a drag', (done) => { - let options = { - events: [{ - start: '2014-11-12T01:00:00', - end: '2014-11-12T03:00:00', - constraint: { - startTime: '04:00:00', - endTime: '08:00:00', - }, - }], - } - testEventDrag(options, '2014-11-12T05:00:00', true, done) - }) - }) - - describe('outside of a constraint range', () => { - it('does not allow a drag', (done) => { - let options = { - events: [{ - start: '2014-11-12T01:00:00', - end: '2014-11-12T03:00:00', - constraint: { - startTime: '04:00:00', - endTime: '08:00:00', - }, - }], - } - testEventDrag(options, '2014-11-12T07:00:00', false, done) - }) - }) - - describe('on an off-day of a constraint range', () => { - it('does not allow a drag', (done) => { - let options = { - events: [{ - start: '2014-11-12T01:00:00', - end: '2014-11-12T03:00:00', - constraint: { - startTime: '04:00:00', - endTime: '08:00:00', - daysOfWeek: [0, 1, 2, 3, 5, 6], // except Thursday - }, - }], - } - testEventDrag(options, '2014-11-13T05:00:00', false, done) // drag to Thursday - }) - }) - }) - }) - - describe('when used with businessHours', () => { - describe('when an event is being dragged', () => { - describe('to the middle of the constraint range', () => { - it('allows a drag', (done) => { - let options = { - businessHours: { - startTime: '02:00', - endTime: '06:00', - }, - events: [{ - start: '2014-11-12T01:00:00', - end: '2014-11-12T02:00:00', - constraint: 'businessHours', - }], - } - testEventDrag(options, '2014-11-12T03:00:00', true, done) - }) - }) - - describe('outside of a constraint range', () => { - it('does not allow a drag', (done) => { - let options = { - businessHours: { - startTime: '02:00', - endTime: '06:00', - }, - events: [{ - start: '2014-11-12T01:00:00', - end: '2014-11-12T02:30:00', - constraint: 'businessHours', - }], - } - testEventDrag(options, '2014-11-12T05:00:00', false, done) - }) - }) - - describe('on an off-day of a constraint range', () => { - it('does not allow a drag', (done) => { - let options = { - businessHours: { - startTime: '02:00', - endTime: '06:00', - daysOfWeek: [1, 2, 3, 4], // Mon - Thurs - }, - events: [{ - start: '2014-11-12T01:00:00', - end: '2014-11-12T02:30:00', - constraint: 'businessHours', - }], - } - testEventDrag(options, '2014-11-14T03:00:00', false, done) // Friday - }) - }) - }) - }) - - describe('when used with an event group ID', () => { - describe('when an event is being dragged', () => { - describe('to the middle of the constraint range', () => { - it('allows a drag', (done) => { - let options = { - events: [ - { - start: '2014-11-12T01:00:00', - end: '2014-11-12T03:00:00', - className: 'dragging-event', - constraint: 'yo', - }, - { - groupId: 'yo', - start: '2014-11-13T01:00:00', - end: '2014-11-13T05:00:00', - }, - ], - } - testEventDrag(options, '2014-11-13T02:00:00', true, done, 'dragging-event') - }) - }) - - describe('outside of a foreground event constraint', () => { - describe('with an explicit end time', () => { - it('does not allow a drag', (done) => { - let options = { - events: [ - { - start: '2014-11-12T01:00:00', - end: '2014-11-12T03:00:00', - constraint: 'yo', - className: 'dragging-event', - }, - { - id: 'yo', - start: '2014-11-13T01:00:00', - end: '2014-11-13T04:00:00', - }, - ], - } - testEventDrag(options, '2014-11-13T04:00:00', false, done, 'dragging-event') - }) - }) - describe('when an implied end time', () => { - it('does not allow a drag', (done) => { - let options = { - defaultTimedEventDuration: '01:00:00', - events: [ - { - start: '2014-11-12T01:00:00', - end: '2014-11-12T03:00:00', - constraint: 'yo', - className: 'dragging-event', - }, - { - id: 'yo', - start: '2014-11-13T01:00:00', - }, - ], - } - testEventDrag(options, '2014-11-13T01:00:00', false, done, 'dragging-event') - }) - }) - }) - - describe('outside of a background-event constraint', () => { - it('does not allow a drag', (done) => { - let options = { - events: [ - { - start: '2014-11-12T01:00:00', - end: '2014-11-12T03:00:00', - constraint: 'yo', - className: 'dragging-event', - }, - { - id: 'yo', - start: '2014-11-13T01:00:00', - end: '2014-11-13T04:00:00', - display: 'background', - }, - ], - } - testEventDrag(options, '2014-11-13T04:00:00', false, done, 'dragging-event') - }) - }) - - describe('when the event ID constraint matches no events', () => { - it('does not allow a drag', (done) => { - let options = { - events: [ - { - start: '2014-11-12T01:00:00', - end: '2014-11-12T03:00:00', - constraint: 'yo', - }, - ], - } - testEventDrag(options, '2014-11-13T04:00:00', false, done) - }) - }) - - describe('when in month view', () => { - pushOptions({ initialView: 'dayGridMonth' }) - describe('when the event ID constraint matches no events', () => { - it('does not allow a drag', (done) => { - let options = { - events: [ - { - start: '2014-11-12', - end: '2014-11-12', - constraint: 'yo', - }, - ], - } - testEventDrag(options, '2014-11-13', false, done) - }) - }) - }) - }) - }) -}) - -describe('selectConstraint', () => { - pushOptions({ - initialDate: '2014-11-10', - initialView: 'timeGridWeek', - scrollTime: '00:00', - }) - - describe('when used with a specific date range', () => { - describe('when dragged clearly within', () => { - it('allows a selection', (done) => { - let options = { - selectConstraint: { - start: '2014-11-12T01:00:00', - end: '2014-11-12T20:00:00', - }, - } - testSelection(options, '2014-11-12T03:00:00Z', '2014-11-12T10:00:00Z', true, done) - }) - }) - - describe('when dragged within, starting with the constraint start', () => { - it('allows a selection', (done) => { - let options = { - selectConstraint: { - start: '2014-11-12T01:00:00', - end: '2014-11-12T20:00:00', - }, - } - testSelection(options, '2014-11-12T01:00:00Z', '2014-11-12T05:00:00Z', true, done) - }) - }) - - describe('when dragged within, ending with the constraint end', () => { - it('allows a selection', (done) => { - let options = { - selectConstraint: { - start: '2014-11-12T01:00:00', - end: '2014-11-12T05:00:00', - }, - } - testSelection(options, '2014-11-12T03:00:00Z', '2014-11-12T05:00:00Z', true, done) - }) - }) - - describe('when dragged intersecting the constraint start', () => { - it('does not allow a selection', (done) => { - let options = { - selectConstraint: { - start: '2014-11-12T03:00:00', - end: '2014-11-12T20:00:00', - }, - } - testSelection(options, '2014-11-12T02:00:00Z', '2014-11-12T04:00:00Z', false, done) - }) - }) - - describe('when dragged intersecting the constraint end', () => { - it('does not allow a selection', (done) => { - let options = { - selectConstraint: { - start: '2014-11-12T03:00:00', - end: '2014-11-12T07:00:00', - }, - } - testSelection(options, '2014-11-12T04:00:00Z', '2014-11-12T08:00:00Z', false, done) - }) - }) - - describe('when dragged after the constraint', () => { - describe('when in week view with timed events', () => { - it('does not allow a selection', (done) => { - let options = { - selectConstraint: { - start: '2014-11-12T03:00:00', - end: '2014-11-12T05:00:00', - }, - } - testSelection(options, '2014-11-12T05:00:00Z', '2014-11-12T07:00:00Z', false, done) - }) - }) - describe('when in month view', () => { - pushOptions({ initialView: 'dayGridMonth' }) - describe('when an all-day constraint', () => { - it('does not allow a selection', (done) => { - let options = { - selectConstraint: { - start: '2014-11-13', - end: '2014-11-14', - }, - } - testSelection(options, '2014-11-12', '2014-11-14', false, done) - }) - }) - describe('when a timed constraint, out of bounds', () => { - it('does not allow a selection', (done) => { - let options = { - selectConstraint: { - start: '2014-11-12T01:00:00', - end: '2014-11-14T00:00:00', - }, - } - testSelection(options, '2014-11-12', '2014-11-14', false, done) - }) - }) - describe('when a timed constraint, in bounds', () => { - it('allows a selection', (done) => { - let options = { - selectConstraint: { - start: '2014-11-12T00:00:00', - end: '2014-11-14T00:00:00', - }, - } - testSelection(options, '2014-11-12', '2014-11-14', true, done) - }) - }) - }) - }) - }) - - describe('when used with a recurring date range', () => { - describe('to the middle of the constraint range', () => { - it('allows a selection when in bounds', (done) => { - let options = { - selectConstraint: { - startTime: '01:00:00', - endTime: '05:00:00', - }, - } - testSelection(options, '2014-11-12T02:00:00Z', '2014-11-12T04:00:00Z', true, done) - }) - }) - - describe('outside of a constraint range', () => { - it('does not allow a selection when single day', (done) => { - let options = { - selectConstraint: { - startTime: '01:00:00', - endTime: '05:00:00', - }, - } - testSelection(options, '2014-11-12T02:00:00Z', '2014-11-12T06:00:00Z', false, done) - }) - it('does not allow a selection when multiday', (done) => { - let options = { - selectConstraint: { - startTime: '01:00:00', - endTime: '05:00:00', - }, - } - testSelection(options, '2014-11-12T02:00:00Z', '2014-11-14T04:00:00Z', false, done) - }) - }) - }) - - describe('when used with businessHours', () => { - describe('to the middle of the constraint range', () => { - it('allows a selection', (done) => { - let options = { - businessHours: { - startTime: '01:00:00', - endTime: '05:00:00', - }, - selectConstraint: 'businessHours', - } - testSelection(options, '2014-11-12T02:00:00Z', '2014-11-12T04:00:00Z', true, done) - }) - }) - - describe('outside of a constraint range', () => { - it('does not allow a selection', (done) => { - let options = { - businessHours: { - startTime: '01:00:00', - endTime: '05:00:00', - }, - selectConstraint: 'businessHours', - } - testSelection(options, '2014-11-12T02:00:00Z', '2014-11-12T06:00:00Z', false, done) - }) - }) - - describe('with a custom dow when dragged to a dead day', () => { - it('does not allow a selection', (done) => { - let options = { - businessHours: { - startTime: '01:00:00', - endTime: '05:00:00', - daysOfWeek: [1, 2, 4, 5], // Mon,Tue,Thu,Fri - }, - selectConstraint: 'businessHours', - } - testSelection(options, '2014-11-12T02:00:00Z', '2014-11-12T04:00:00Z', false, done) // Wed - }) - }) - }) - - describe('when used with an event group ID', () => { - describe('to the middle of the constraint range', () => { - it('allows a selection', (done) => { - let options = { - events: [{ - groupId: 'yo', - start: '2014-11-12T02:00:00', - end: '2014-11-12T05:00:00', - display: 'background', - }], - selectConstraint: 'yo', - } - testSelection(options, '2014-11-12T03:00:00Z', '2014-11-12T04:00:00Z', true, done) - }) - }) - - describe('outside of a constraint range', () => { - it('does not allow a selection', (done) => { - let options = { - events: [{ - groupId: 'yo', - start: '2014-11-12T02:00:00', - end: '2014-11-12T05:00:00', - display: 'background', - }], - selectConstraint: 'yo', - } - testSelection(options, '2014-11-12T03:00:00Z', '2014-11-12T06:00:00Z', false, done) - }) - }) - - describe('when event ID does not match any events', () => { - describe('when in week view', () => { - it('does not allow a selection', (done) => { - let options = { - selectConstraint: 'yooo', - } - testSelection(options, '2014-11-12T03:00:00Z', '2014-11-12T06:00:00Z', false, done) - }) - }) - describe('when in month view', () => { - it('does not allow a selection', (done) => { - let options = { - initialView: 'dayGridMonth', - selectConstraint: 'yooo', - } - testSelection(options, '2014-11-12', '2014-11-15', false, done) - }) - }) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/constructor.ts b/fullcalendar-main/tests/src/legacy/constructor.ts deleted file mode 100644 index a34fc05..0000000 --- a/fullcalendar-main/tests/src/legacy/constructor.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('constructor', () => { - it('should not modify the options object', () => { - let options = { - initialView: 'timeGridWeek', - scrollTime: '09:00:00', - slotDuration: { minutes: 45 }, - } - let optionsCopy = $.extend({}, options, true) - initCalendar(options) - expect(options).toEqual(optionsCopy) - }) - - it('should not modify the events array', () => { - let options = { - initialView: 'dayGridMonth', - initialDate: '2014-05-27', - events: [ - { - title: 'mytitle', - start: '2014-05-27', - }, - ], - } - let optionsCopy = $.extend(true, {}, options) // recursive copy - initCalendar(options) - expect(options).toEqual(optionsCopy) - }) - - it('should not modify the eventSources array', () => { - let options = { - initialView: 'dayGridMonth', - initialDate: '2014-05-27', - eventSources: [ - { events: [ - { - title: 'mytitle', - start: '2014-05-27', - }, - ] }, - ], - } - let optionsCopy = $.extend(true, {}, options) // recursive copy - initCalendar(options) - expect(options).toEqual(optionsCopy) - }) - - describe('when called on a div', () => { - it('should contain a toolbar', () => { - let calendar = initCalendar() - let calendarWrapper = new CalendarWrapper(calendar) - expect(calendarWrapper.toolbar).toBeTruthy() - }) - - it('should contain a view-container el', () => { - let calendar = initCalendar() - let calendarWrapper = new CalendarWrapper(calendar) - expect(calendarWrapper.getViewContainerEl()).toBeTruthy() - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/current-date.ts b/fullcalendar-main/tests/src/legacy/current-date.ts deleted file mode 100644 index cf6cdb9..0000000 --- a/fullcalendar-main/tests/src/legacy/current-date.ts +++ /dev/null @@ -1,298 +0,0 @@ -import { FormatRangeOptions } from '@fullcalendar/core' -import { addDays } from '@fullcalendar/core/internal' -import { parseUtcDate } from '../lib/date-parsing.js' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('current date', () => { - const TITLE_FORMAT: FormatRangeOptions = { - month: 'long', - day: 'numeric', - year: 'numeric', - separator: ' - ', - isEndExclusive: true, - } - - pushOptions({ - titleFormat: TITLE_FORMAT, - titleRangeSeparator: ' - ', - initialDate: '2014-06-01', - timeZone: 'UTC', - }) - - describe('initialDate & getDate', () => { // keep getDate - describeWhenInMonth(() => { - it('should initialize at the date', () => { - let calendar = initCalendar({ - initialDate: '2011-03-10', - }) - expectViewDates(calendar, '2011-02-27', '2011-04-10', '2011-03-01', '2011-04-01') - let currentDate = calendar.getDate() - expect(currentDate instanceof Date).toEqual(true) // test the type, but only here - expect(currentDate).toEqualDate('2011-03-10') - }) - }) - describeWhenInWeek(() => { - it('should initialize at the date, given a date string', () => { - let calendar = initCalendar({ - initialDate: '2011-03-10', - }) - expectViewDates(calendar, '2011-03-06', '2011-03-13') - expect(calendar.getDate()).toEqualDate('2011-03-10') - }) - it('should initialize at the date, given a Date object', () => { - let calendar = initCalendar({ - initialDate: parseUtcDate('2011-03-10'), - }) - expectViewDates(calendar, '2011-03-06', '2011-03-13') - expect(calendar.getDate()).toEqualDate('2011-03-10') - }) - }) - describeWhenInDay(() => { - it('should initialize at the date', () => { - let calendar = initCalendar({ - initialDate: '2011-03-10', - }) - expectViewDates(calendar, '2011-03-10') - expect(calendar.getDate()).toEqualDate('2011-03-10') - }) - }) - }) - - describe('gotoDate', () => { - describeWhenInMonth(() => { - it('should go to a date when given a date string', () => { - let calendar = initCalendar() - calendar.gotoDate('2015-04-01') - expectViewDates(calendar, '2015-03-29', '2015-05-10', '2015-04-01', '2015-05-01') - }) - }) - describeWhenInWeek(() => { - it('should go to a date when given a date string', () => { - let calendar = initCalendar() - calendar.gotoDate('2015-04-01') - expectViewDates(calendar, '2015-03-29', '2015-04-05') - }) - it('should go to a date when given a date string with a time', () => { - let calendar = initCalendar() - calendar.gotoDate('2015-04-01T12:00:00') - expectViewDates(calendar, '2015-03-29', '2015-04-05') - }) - it('should go to a date when given a Date object', () => { - let calendar = initCalendar() - calendar.gotoDate(parseUtcDate('2015-04-01')) - expectViewDates(calendar, '2015-03-29', '2015-04-05') - }) - }) - describeWhenInDay(() => { - it('should go to a date when given a date string', () => { - let calendar = initCalendar() - calendar.gotoDate('2015-04-01') - expectViewDates(calendar, '2015-04-01') - }) - }) - }) - - describe('incrementDate', () => { - describeWhenInMonth(() => { - it('should increment the date when given a Duration object', () => { - let calendar = initCalendar() - calendar.incrementDate({ months: -1 }) - expectViewDates(calendar, '2014-04-27', '2014-06-08', '2014-05-01', '2014-06-01') - }) - }) - describeWhenInWeek(() => { - it('should increment the date when given a Duration object', () => { - let calendar = initCalendar() - calendar.incrementDate({ weeks: -2 }) - expectViewDates(calendar, '2014-05-18', '2014-05-25') - }) - }) - describeWhenInDay(() => { - it('should increment the date when given a Duration object', () => { - let calendar = initCalendar() - calendar.incrementDate({ days: 2 }) - expectViewDates(calendar, '2014-06-03') - }) - it('should increment the date when given a Duration string', () => { - let calendar = initCalendar() - calendar.incrementDate('2.00:00:00') - expectViewDates(calendar, '2014-06-03') - }) - it('should increment the date when given a Duration string with a time', () => { - let calendar = initCalendar() - calendar.incrementDate('2.05:30:00') - expectViewDates(calendar, '2014-06-03') - }) - }) - }) - - describe('prevYear', () => { - describeWhenInMonth(() => { - it('should move the calendar back a year', () => { - let calendar = initCalendar() - calendar.prevYear() - expectViewDates(calendar, '2013-05-26', '2013-07-07', '2013-06-01', '2013-07-01') - }) - }) - describeWhenInWeek(() => { - it('should move the calendar back a year', () => { - let calendar = initCalendar() - calendar.prevYear() - expectViewDates(calendar, '2013-05-26', '2013-06-02') - }) - }) - describeWhenInDay(() => { - it('should move the calendar back a year', () => { - let calendar = initCalendar() - calendar.prevYear() - expectViewDates(calendar, '2013-06-01') - }) - }) - }) - - describe('nextYear', () => { - describeWhenInMonth(() => { - it('should move the calendar forward a year', () => { - let calendar = initCalendar() - calendar.nextYear() - expectViewDates(calendar, '2015-05-31', '2015-07-12', '2015-06-01', '2015-07-01') - }) - }) - describeWhenInWeek(() => { - it('should move the calendar forward a year', () => { - let calendar = initCalendar() - calendar.nextYear() - expectViewDates(calendar, '2015-05-31', '2015-06-07') - }) - }) - describeWhenInDay(() => { - it('should move the calendar forward a year', () => { - let calendar = initCalendar() - calendar.nextYear() - expectViewDates(calendar, '2015-06-01') - }) - }) - }) - - describe('when current date is a hidden day', () => { - describeWhenInMonth(() => { - it('should display the current month even if first day of month', () => { - let calendar = initCalendar({ - now: '2014-06-01', // a Sunday - initialDate: '2014-06-01', // a Sunday - weekends: false, - }) - let view = calendar.view - expect(view.activeStart).toEqualDate('2014-06-02') - expect(view.activeEnd).toEqualDate('2014-07-12') - expect(view.currentStart).toEqualDate('2014-06-01') - expect(view.currentEnd).toEqualDate('2014-07-01') - }) - it('should display the current month', () => { - let calendar = initCalendar({ - now: '2014-05-04', // a Sunday - initialDate: '2014-05-04', // a Sunday - weekends: false, - }) - let view = calendar.view - expect(view.activeStart).toEqualDate('2014-04-28') - expect(view.activeEnd).toEqualDate('2014-06-07') - expect(view.currentStart).toEqualDate('2014-05-01') - expect(view.currentEnd).toEqualDate('2014-06-01') - }) - describe('when navigating back a month', () => { - it('should not skip months', () => { - let calendar = initCalendar({ - initialDate: '2014-07-07', - weekends: false, - }) - let view = calendar.view - expect(view.currentStart).toEqualDate('2014-07-01') - expect(view.currentEnd).toEqualDate('2014-08-01') - calendar.prev() // will move to Jun 1, which is a Sunday - view = calendar.view - expect(view.currentStart).toEqualDate('2014-06-01') - expect(view.currentEnd).toEqualDate('2014-07-01') - }) - }) - }) - describeWhenInDay(() => { - it('should display the next visible day', () => { - let calendar = initCalendar({ - now: '2014-06-01', // a Sunday - initialDate: '2014-06-01', // a Sunday - weekends: false, - }) - let view = calendar.view - expect(view.activeStart).toEqualDate('2014-06-02') - expect(view.activeEnd).toEqualDate('2014-06-03') - expect(view.currentStart).toEqualDate('2014-06-02') - expect(view.currentEnd).toEqualDate('2014-06-03') - }) - }) - }) - - // UTILS - // ----- - - function describeWhenInMonth(func) { - describeWhenIn('dayGridMonth', func) - } - - function describeWhenInWeek(func) { - describeWhenIn('dayGridWeek', func) - describeWhenIn('timeGridWeek', func) - } - - function describeWhenInDay(func) { - describeWhenIn('dayGridDay', func) - describeWhenIn('timeGridDay', func) - } - - function describeWhenIn(viewName, func) { - describe('when in ' + viewName, () => { - pushOptions({ initialView: viewName }) - func() - }) - } - - function expectViewDates(calendar, start, end?, titleStart?, titleEnd?) { - let view = calendar.view - let calculatedEnd - let title - - if (typeof start === 'string') { - start = new Date(start) - } - if (typeof end === 'string') { - end = new Date(end) - } - if (typeof titleStart === 'string') { - titleStart = new Date(titleStart) - } - if (typeof titleEnd === 'string') { - titleEnd = new Date(titleEnd) - } - - calculatedEnd = end || addDays(start, 1) - - expect(start).toEqualDate(view.activeStart) - expect(calculatedEnd).toEqualDate(view.activeEnd) - - titleStart = titleStart || start - titleEnd = titleEnd || calculatedEnd - - if (titleEnd) { - title = calendar.formatRange( - titleStart, - titleEnd, - TITLE_FORMAT, - ) - } else { - title = calendar.formatDate(titleStart, TITLE_FORMAT) - } - - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - expect(toolbarWrapper.getTitleText()).toBe(title) - } -}) diff --git a/fullcalendar-main/tests/src/legacy/custom-view-class.ts b/fullcalendar-main/tests/src/legacy/custom-view-class.ts deleted file mode 100644 index f88140a..0000000 --- a/fullcalendar-main/tests/src/legacy/custom-view-class.ts +++ /dev/null @@ -1,98 +0,0 @@ -import { createPlugin } from '@fullcalendar/core' -import { sliceEvents } from '@fullcalendar/core' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('custom view class', () => { // TODO: rename file - it('calls all standard methods with correct parameters', () => { - const CustomViewConfig = { - classNames: 'awesome-view', - didMount() {}, - willUnmount() {}, - - content(props) { - expect(props.dateProfile.activeRange.start instanceof Date).toBe(true) - expect(props.dateProfile.activeRange.end instanceof Date).toBe(true) - - let eventRanges = sliceEvents(props, true) // allDay=true - expect(Array.isArray(eventRanges)).toBe(true) - expect(eventRanges.length).toBe(1) - expect(typeof eventRanges[0].def).toBe('object') - expect(typeof eventRanges[0].ui).toBe('object') - expect(typeof eventRanges[0].instance).toBe('object') - expect(eventRanges[0].isStart).toBe(true) - expect(eventRanges[0].isEnd).toBe(true) - expect(eventRanges[0].range.start instanceof Date).toBe(true) - expect(eventRanges[0].range.end instanceof Date).toBe(true) - - let dateSelection = props.dateSelection - if (!dateSelection) { - expect(dateSelection).toBe(null) - } else { - expect(typeof dateSelection).toBe('object') - expect(dateSelection.allDay).toBe(true) - expect(dateSelection.range.start instanceof Date).toBe(true) - expect(dateSelection.range.end instanceof Date).toBe(true) - } - - return { html: '
hello world
' } - }, - } - - spyOn(CustomViewConfig, 'didMount').and.callThrough() - spyOn(CustomViewConfig, 'content').and.callThrough() - spyOn(CustomViewConfig, 'willUnmount').and.callThrough() - - function resetCounts() { - CustomViewConfig.didMount.calls.reset() - CustomViewConfig.content.calls.reset() - CustomViewConfig.willUnmount.calls.reset() - } - - let calendar = initCalendar({ - plugins: [ - createPlugin({ - name: 'test-plugin', - views: { - custom: CustomViewConfig, - }, - }), - ], - initialView: 'custom', - initialDate: '2014-12-25', // will end up being a single-day view - events: [ - { - title: 'Holidays', - start: '2014-12-25T09:00:00', - end: '2014-12-25T11:00:00', - }, - ], - }) - let calendarWrapper = new CalendarWrapper(calendar) - - let viewEl = calendarWrapper.getViewEl() - expect(viewEl).toHaveClass('awesome-view') - expect($(viewEl).find('.hello-world').length).toBe(1) - - expect(CustomViewConfig.didMount.calls.count()).toBe(1) - expect(CustomViewConfig.content.calls.count()).toBe(1) - expect(CustomViewConfig.willUnmount.calls.count()).toBe(0) - - resetCounts() - calendar.select('2014-12-25', '2014-01-01') - expect(CustomViewConfig.didMount.calls.count()).toBe(0) - expect(CustomViewConfig.content.calls.count()).toBe(1) - expect(CustomViewConfig.willUnmount.calls.count()).toBe(0) - - resetCounts() - calendar.unselect() - expect(CustomViewConfig.didMount.calls.count()).toBe(0) - expect(CustomViewConfig.content.calls.count()).toBe(1) - expect(CustomViewConfig.willUnmount.calls.count()).toBe(0) - - resetCounts() - calendar.destroy() - expect(CustomViewConfig.didMount.calls.count()).toBe(0) - expect(CustomViewConfig.content.calls.count()).toBe(0) - expect(CustomViewConfig.willUnmount.calls.count()).toBe(1) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/custom-view-duration.ts b/fullcalendar-main/tests/src/legacy/custom-view-duration.ts deleted file mode 100644 index df8d1cf..0000000 --- a/fullcalendar-main/tests/src/legacy/custom-view-duration.ts +++ /dev/null @@ -1,454 +0,0 @@ -import frLocale from '@fullcalendar/core/locales/fr' -import { createPlugin } from '@fullcalendar/core' -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('custom view', () => { - it('renders a 4 day dayGrid view', () => { - let calendar = initCalendar({ - views: { - dayGridFourDay: { - type: 'dayGrid', - duration: { days: 4 }, - }, - }, - initialView: 'dayGridFourDay', - initialDate: '2014-12-25', - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let dayEls = dayGridWrapper.getAllDayEls() - - expect(dayGridWrapper.getRowEls().length).toBe(1) - expect(dayEls.length).toBe(4) - expect(dayEls[0].getAttribute('data-date')).toBe('2014-12-25') // starts on initialDate - }) - - it('renders a 2 week dayGrid view', () => { - let calendar = initCalendar({ - views: { - dayGridTwoWeek: { - type: 'dayGrid', - duration: { weeks: 2 }, - }, - }, - initialView: 'dayGridTwoWeek', - initialDate: '2014-12-25', - firstDay: 2, // Tues - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let dayEls = dayGridWrapper.getAllDayEls() - - expect(dayGridWrapper.getRowEls().length).toBe(2) - expect(dayEls.length).toBe(14) - expect(dayEls[0]).toHaveClass(CalendarWrapper.DOW_CLASSNAMES[2]) // respects start-of-week - expect(dayEls[0].getAttribute('data-date')).toBe('2014-12-23') // week start. tues - }) - - it('will use the provided options', () => { - let calendar = initCalendar({ - views: { - dayGridFourDay: { - type: 'dayGrid', - duration: { days: 4 }, - titleFormat() { return 'special' }, - }, - }, - initialView: 'dayGridFourDay', - }) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - expect(toolbarWrapper.getTitleText()).toBe('special') - }) - - it('will inherit options from the parent view type', () => { - let calendar = initCalendar({ - views: { - dayGrid: { - titleFormat() { return 'dayGridtitle' }, - }, - dayGridFourDay: { - type: 'dayGrid', - duration: { days: 4 }, - }, - }, - initialView: 'dayGridFourDay', - }) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - expect(toolbarWrapper.getTitleText()).toBe('dayGridtitle') - }) - - it('will override an option from the parent view type', () => { - let calendar = initCalendar({ - views: { - dayGrid: { - titleFormat() { return 'dayGridtitle' }, - }, - dayGridFourDay: { - type: 'dayGrid', - duration: { days: 4 }, - titleFormat() { return 'dayGridfourweekttitle' }, - }, - }, - initialView: 'dayGridFourDay', - }) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - expect(toolbarWrapper.getTitleText()).toBe('dayGridfourweekttitle') - }) - - it('will inherit options from generic "week" type', () => { - let calendar = initCalendar({ - views: { - week: { - titleFormat() { return 'weektitle' }, - }, - dayGridOneWeek: { - type: 'dayGrid', - duration: { weeks: 1 }, - }, - }, - initialView: 'dayGridOneWeek', - }) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - expect(toolbarWrapper.getTitleText()).toBe('weektitle') - }) - - it('generic type options for "dayGrid" will override generic "week" options', () => { - let calendar = initCalendar({ - views: { - week: { - titleFormat() { return 'weektitle' }, - }, - dayGrid: { - titleFormat() { return 'dayGridtitle' }, - }, - dayGridOneWeek: { - type: 'dayGrid', - duration: { weeks: 1 }, - }, - }, - initialView: 'dayGridOneWeek', - }) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - expect(toolbarWrapper.getTitleText()).toBe('dayGridtitle') - }) - - it('will not inherit "week" options if more than a single week', () => { - let calendar = initCalendar({ - titleFormat() { return 'defaultitle' }, - initialView: 'dayGridTwoWeek', - views: { - week: { - titleFormat() { return 'weektitle' }, - }, - dayGridTwoWeek: { - type: 'dayGrid', - duration: { weeks: 2 }, - }, - }, - }) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - expect(toolbarWrapper.getTitleText()).toBe('defaultitle') - }) - - it('renders a 4 day timeGrid view', () => { - let calendar = initCalendar({ - initialView: 'timeGridFourDay', - initialDate: '2014-12-25', - views: { - timeGridFourDay: { - type: 'timeGrid', - duration: { days: 4 }, - }, - }, - }) - let viewWrapper = new TimeGridViewWrapper(calendar) - let timeGridDayEls = viewWrapper.timeGrid.getAllDayEls() - - expect(viewWrapper.dayGrid.getRowEls().length).toBe(1) - expect(viewWrapper.dayGrid.getAllDayEls().length).toBe(4) - expect(timeGridDayEls.length).toBe(4) - expect(timeGridDayEls[0].getAttribute('data-date')).toBe('2014-12-25') // starts on initialDate - }) - - it('renders a two week timeGrid view', () => { - let calendar = initCalendar({ - initialView: 'timeGridTwoWeek', - initialDate: '2014-12-25', - views: { - timeGridTwoWeek: { - type: 'timeGrid', - duration: { weeks: 2 }, - }, - }, - }) - let viewWrapper = new TimeGridViewWrapper(calendar) - let timeGridDayEls = viewWrapper.timeGrid.getAllDayEls() - - expect(viewWrapper.dayGrid.getRowEls().length).toBe(1) - expect(viewWrapper.dayGrid.getAllDayEls().length).toBe(14) - expect(timeGridDayEls.length).toBe(14) - expect(timeGridDayEls[0].getAttribute('data-date')).toBe('2014-12-21') // week start - }) - - it('renders a two month timeGrid view', () => { - let calendar = initCalendar({ - initialView: 'timeGridTwoWeek', - initialDate: '2014-11-27', - views: { - timeGridTwoWeek: { - type: 'timeGrid', - duration: { months: 2 }, - }, - }, - }) - let viewWrapper = new TimeGridViewWrapper(calendar) - let timeGridDayEls = viewWrapper.timeGrid.getAllDayEls() - - expect(viewWrapper.dayGrid.getRowEls().length).toBe(1) - expect(viewWrapper.dayGrid.getAllDayEls().length).toBe(61) - expect(timeGridDayEls.length).toBe(61) - expect(timeGridDayEls[0].getAttribute('data-date')).toBe('2014-11-01') - expect(timeGridDayEls[timeGridDayEls.length - 1].getAttribute('data-date')).toBe('2014-12-31') // last - }) - - it('renders a two month dayGrid view', () => { - let calendar = initCalendar({ - initialView: 'dayGridTwoWeek', - initialDate: '2014-11-27', - views: { - dayGridTwoWeek: { - type: 'dayGrid', - duration: { months: 2 }, - }, - }, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let dayEls = dayGridWrapper.getAllDayEls() - - expect(dayGridWrapper.getRowEls().length).toBe(10) - expect(dayGridWrapper.getDayElsInRow(0).length).toBe(7) - expect(dayEls[0].getAttribute('data-date')).toBe('2014-10-26') - expect(dayEls[dayEls.length - 1].getAttribute('data-date')).toBe('2015-01-03') - }) - - it('renders a one year dayGrid view', () => { - let options = { - initialView: 'dayGridYear', - initialDate: '2014-11-27', - views: { - dayGridYear: { - type: 'dayGrid', - duration: { years: 1 }, - }, - }, - } - let calendar = initCalendar(options) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let dayEls = dayGridWrapper.getAllDayEls() - - expect(dayEls[0]).toBeMatchedBy('[data-date="2013-12-29"]') - expect(dayEls[dayEls.length - 1]).toBeMatchedBy('[data-date="2015-01-03"]') - }) - - describe('buttonText', () => { - it('accepts buttonText exact-match override', () => { - let options = { - buttonText: { - custom: 'over-ridden', - }, - headerToolbar: { - center: 'custom,dayGridMonth', - }, - initialView: 'custom', - views: { - custom: { - type: 'dayGrid', - duration: { days: 4 }, - buttonText: 'awesome', - }, - }, - } - let calendar = initCalendar(options) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - let buttonInfo = toolbarWrapper.getButtonInfo('custom') - - expect(buttonInfo.text).toBe('over-ridden') - }) - - it('accepts buttonText single-unit-match override', () => { - let options = { - buttonText: { - day: '1day-over-ridden', - }, - headerToolbar: { - center: 'custom,dayGridMonth', - }, - initialView: 'custom', - views: { - custom: { - type: 'dayGrid', - duration: { days: 1 }, - buttonText: 'awesome', - }, - }, - } - let calendar = initCalendar(options) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - let buttonInfo = toolbarWrapper.getButtonInfo('custom') - - expect(buttonInfo.text).toBe('1day-over-ridden') - }) - - it('does not accept buttonText unit-match override when unit is more than one', () => { - let options = { - buttonText: { - day: '1day!!!???', - }, - headerToolbar: { - center: 'custom,dayGridMonth', - }, - initialView: 'custom', - views: { - custom: { - type: 'dayGrid', - duration: { days: 2 }, - buttonText: 'awesome', - }, - }, - } - let calendar = initCalendar(options) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - let buttonInfo = toolbarWrapper.getButtonInfo('custom') - - expect(buttonInfo.text).toBe('awesome') - }) - - it('accepts locale\'s single-unit-match override', () => { - let calendar = initCalendar({ - locale: frLocale, - headerToolbar: { - center: 'custom,dayGridMonth', - }, - initialView: 'custom', - views: { - custom: { - type: 'dayGrid', - duration: { days: 1 }, - }, - }, - }) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - let buttonInfo = toolbarWrapper.getButtonInfo('custom') - - expect(buttonInfo.text).toBe('Jour') - }) - - it('accepts explicit View-Specific buttonText, overriding locale\'s single-unit-match override', () => { - let calendar = initCalendar({ - locale: frLocale, - headerToolbar: { - center: 'custom,dayGridMonth', - }, - initialView: 'custom', - views: { - custom: { - type: 'dayGrid', - duration: { days: 1 }, - buttonText: 'awesome', - }, - }, - }) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - let buttonInfo = toolbarWrapper.getButtonInfo('custom') - - expect(buttonInfo.text).toBe('awesome') - }) - - it('respects custom view\'s value', () => { - let options = { - headerToolbar: { - center: 'custom,dayGridMonth', - }, - initialView: 'custom', - views: { - custom: { - type: 'dayGrid', - duration: { days: 4 }, - buttonText: 'awesome', - }, - }, - } - let calendar = initCalendar(options) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - let buttonInfo = toolbarWrapper.getButtonInfo('custom') - - expect(buttonInfo.text).toBe('awesome') - }) - - it('respects custom view\'s value, even when a "smart" property name', () => { - let options = { - headerToolbar: { - center: 'dayGridFourDay,dayGridMonth', - }, - initialView: 'dayGridFourDay', - views: { - dayGridFourDay: { // "dayGridFourDay" is a pitfall for smartProperty - type: 'dayGrid', - duration: { days: 4 }, - buttonText: 'awesome', - }, - }, - } - let calendar = initCalendar(options) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - let buttonInfo = toolbarWrapper.getButtonInfo('dayGridFourDay') - - expect(buttonInfo.text).toBe('awesome') - }) - - it('falls back to view name when view lacks metadata', () => { - // also sorta tests plugin system - - let calendar = initCalendar({ - plugins: [ - createPlugin({ - name: 'test-plugin', - views: { - crazy: { - content: 'hello world', - }, - }, - }), - ], - headerToolbar: { - center: 'crazy,dayGridMonth', - }, - initialView: 'crazy', - }) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - let buttonInfo = toolbarWrapper.getButtonInfo('crazy') - - expect(buttonInfo.text).toBe('crazy') - }) - }) - - it('throws an error when type is self', () => { - let error = null - - try { - initCalendar({ - initialView: 'month', - views: { - month: { - type: 'month', - }, - }, - }) - } catch (_error) { - error = _error - } - - expect(error).toBeTruthy() - expect(error.message).toBe('Can\'t have a custom view type that references itself') - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/dateClick.ts b/fullcalendar-main/tests/src/legacy/dateClick.ts deleted file mode 100644 index 0592006..0000000 --- a/fullcalendar-main/tests/src/legacy/dateClick.ts +++ /dev/null @@ -1,193 +0,0 @@ -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('dateClick', () => { - pushOptions({ - initialDate: '2014-05-27', - selectable: false, - timeZone: 'UTC', - }) - - describeOptions('direction', { - 'when LTR': 'ltr', - 'when RTL': 'rtl', - }, () => { - describeOptions('selectable', { - 'when NOT selectable': false, - 'when selectable': true, - }, () => { - describe('when in month view', () => { - pushOptions({ - initialView: 'dayGridMonth', - }) - - it('fires correctly when clicking on a cell', (done) => { - let calendar = initCalendar({ - dateClick(arg) { - expect(arg.date instanceof Date).toEqual(true) - expect(typeof arg.jsEvent).toEqual('object') // TODO: more discrimination - expect(typeof arg.view).toEqual('object') // " - expect(arg.allDay).toEqual(true) - expect(arg.date).toEqualDate('2014-05-07') - expect(arg.dateStr).toEqual('2014-05-07') - done() - }, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - dayGridWrapper.clickDate('2014-05-07') - }) - }) - - describe('when in week view', () => { - pushOptions({ - initialView: 'timeGridWeek', - }) - - it('fires correctly when clicking on an all-day slot', (done) => { - let calendar = initCalendar({ - dateClick(arg) { - expect(arg.date instanceof Date).toEqual(true) - expect(typeof arg.jsEvent).toEqual('object') // TODO: more discrimination - expect(typeof arg.view).toEqual('object') // " - expect(arg.allDay).toEqual(true) - expect(arg.date).toEqualDate('2014-05-28') - expect(arg.dateStr).toEqual('2014-05-28') - done() - }, - }) - let dayGridWrapper = new TimeGridViewWrapper(calendar).dayGrid - dayGridWrapper.clickDate('2014-05-28') - }) - - it('fires correctly when clicking on a timed slot', (done) => { - let calendar = initCalendar({ - contentHeight: 500, // make sure the click slot will be in scroll view - scrollTime: '07:00:00', - dateClick(arg) { - expect(arg.date instanceof Date).toEqual(true) - expect(typeof arg.jsEvent).toEqual('object') // TODO: more discrimination - expect(typeof arg.view).toEqual('object') // " - expect(arg.allDay).toEqual(false) - expect(arg.date).toEqualDate('2014-05-28T09:00:00Z') - expect(arg.dateStr).toEqual('2014-05-28T09:00:00Z') - done() - }, - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - timeGridWrapper.clickDate('2014-05-28T09:00:00') - }) - - // issue 2217 - it('fires correctly when clicking on a timed slot, with slotMinTime set', (done) => { - let calendar = initCalendar({ - contentHeight: 500, // make sure the click slot will be in scroll view - scrollTime: '07:00:00', - slotMinTime: '02:00:00', - dateClick(arg) { - expect(arg.date instanceof Date).toEqual(true) - expect(typeof arg.jsEvent).toEqual('object') // TODO: more discrimination - expect(typeof arg.view).toEqual('object') // " - expect(arg.allDay).toEqual(false) - expect(arg.date).toEqualDate('2014-05-28T11:00:00Z') - expect(arg.dateStr).toEqual('2014-05-28T11:00:00Z') - done() - }, - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - timeGridWrapper.clickDate('2014-05-28T11:00:00') - }) - - // https://github.com/fullcalendar/fullcalendar/issues/4539 - it('fires correctly when clicking on a timed slot NEAR END', (done) => { - let calendar = initCalendar({ - contentHeight: 500, // make sure the click slot will be in scroll view - scrollTime: '23:00:00', - dateClick(arg) { - expect(arg.date instanceof Date).toEqual(true) - expect(typeof arg.jsEvent).toEqual('object') // TODO: more discrimination - expect(typeof arg.view).toEqual('object') // " - expect(arg.allDay).toEqual(false) - expect(arg.date).toEqualDate('2014-05-28T23:30:00Z') - expect(arg.dateStr).toEqual('2014-05-28T23:30:00Z') - done() - }, - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - timeGridWrapper.clickDate('2014-05-28T23:30:00') - }) - }) - }) - }) - - it('will still fire if clicked on background event', (done) => { - let calendar = initCalendar({ - initialView: 'dayGridMonth', - events: [{ - start: '2014-05-06', - display: 'background', - }], - dateClick(info) { - expect(info.dateStr).toBe('2014-05-06') - done() - }, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - $.simulateMouseClick(dayGridWrapper.getBgEventEls()[0]) - }) - - describe('when touch', () => { - it('fires correctly when simulated short drag on a cell', (done) => { - let calendar = initCalendar({ - dateClick(arg) { - expect(arg.date instanceof Date).toEqual(true) - expect(typeof arg.jsEvent).toEqual('object') // TODO: more discrimination - expect(typeof arg.view).toEqual('object') // " - expect(arg.allDay).toEqual(true) - expect(arg.date).toEqualDate('2014-05-07') - expect(arg.dateStr).toEqual('2014-05-07') - done() - }, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - $.simulateTouchClick(dayGridWrapper.getDayEl('2014-05-07')) - }) - - it('won\'t fire if touch moves outside of date cell', (done) => { - let dateClickSpy = spyOnCalendarCallback('dateClick') - let calendar = initCalendar() - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - let startCell = dayGridWrapper.getDayEl('2014-05-07') - let endCell = dayGridWrapper.getDayEl('2014-05-08') - - $(startCell).simulate('drag', { - // FYI, when debug:true, not a good representation because the minimal delay is required - // to recreate bug #3332 - isTouch: true, - end: endCell, - callback() { - expect(dateClickSpy).not.toHaveBeenCalled() - done() - }, - }) - }) - - it('fires correctly when simulated click on a cell', (done) => { - let calendar = initCalendar({ - dateClick(arg) { - expect(arg.date instanceof Date).toEqual(true) - expect(typeof arg.jsEvent).toEqual('object') // TODO: more discrimination - expect(typeof arg.view).toEqual('object') // " - expect(arg.allDay).toEqual(true) - expect(arg.date).toEqualDate('2014-05-07') - expect(arg.dateStr).toEqual('2014-05-07') - done() - }, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - let dayCell = dayGridWrapper.getDayEl('2014-05-07') - $.simulateTouchClick(dayCell) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/dayNames.ts b/fullcalendar-main/tests/src/legacy/dayNames.ts deleted file mode 100644 index 64d9a2e..0000000 --- a/fullcalendar-main/tests/src/legacy/dayNames.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { addDays } from '@fullcalendar/core/internal' -import { removeLtrCharCodes } from '../lib/string.js' -import { parseUtcDate } from '../lib/date-parsing.js' -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('day names', () => { - let sundayDate = parseUtcDate('2019-03-17') - let locales = ['es', 'fr', 'de', 'zh-cn', 'nl'] - - pushOptions({ - now: sundayDate, - }) - - describe('when view is dayGridDay', () => { - pushOptions({ - initialView: 'dayGridDay', - }) - - describe('when locale is default', () => { - pushOptions({ - locale: 'en', - }) - - CalendarWrapper.DOW_CLASSNAMES.forEach((dowClassName, index) => { - let dayDate = addDays(sundayDate, index) - let dayText = removeLtrCharCodes( - dayDate.toLocaleString('en', { weekday: 'long', timeZone: 'UTC' }), - ) - - it('should be ' + dayText, () => { - let calendar = initCalendar({ - now: dayDate, - }) - let headerWrapper = new DayGridViewWrapper(calendar).header - expect(headerWrapper.el.querySelector(`.${dowClassName}`)).toHaveText(dayText) - }) - }) - }) - - $.each(locales, (localeIndex, locale) => { - describe('when locale is ' + locale, () => { - CalendarWrapper.DOW_CLASSNAMES.forEach((dowClassName, index) => { - let dayDate = addDays(sundayDate, index) - let dayText = removeLtrCharCodes( - dayDate.toLocaleString(locale, { weekday: 'long', timeZone: 'UTC' }), - ) - - it('should be the translation for ' + dayText, () => { - let calendar = initCalendar({ - locale, - now: dayDate, - }) - let headerWrapper = new DayGridViewWrapper(calendar).header - expect(headerWrapper.el.querySelector(`.${dowClassName}`)).toHaveText(dayText) - }) - }) - }) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/dayPopoverFormat.ts b/fullcalendar-main/tests/src/legacy/dayPopoverFormat.ts deleted file mode 100644 index b7d2e4e..0000000 --- a/fullcalendar-main/tests/src/legacy/dayPopoverFormat.ts +++ /dev/null @@ -1,55 +0,0 @@ -import frLocale from '@fullcalendar/core/locales/fr' -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' - -describe('dayPopoverFormat', () => { - pushOptions({ - initialDate: '2014-08-01', - dayMaxEventRows: 3, - events: [ - { title: 'event1', start: '2014-07-28', end: '2014-07-30', className: 'event1' }, - { title: 'event2', start: '2014-07-29', end: '2014-07-31', className: 'event2' }, - { title: 'event3', start: '2014-07-29', className: 'event3' }, - { title: 'event4', start: '2014-07-29', className: 'event4' }, - ], - }) - - it('can be set to a custom value', (done) => { - let calendar = initCalendar({ - dayPopoverFormat: { month: 'long', day: 'numeric' }, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - $(dayGridWrapper.getMoreEl()).simulate('click') - setTimeout(() => { - expect(dayGridWrapper.getMorePopoverTitle()).toBe('July 29') - done() - }) - }) - - it('is affected by the current locale when the value is default', (done) => { - let calendar = initCalendar({ - locale: frLocale, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - $(dayGridWrapper.getMoreEl()).simulate('click') - setTimeout(() => { - expect(dayGridWrapper.getMorePopoverTitle()).toBe('29 juillet 2014') - done() - }) - }) - - it('still maintains the same format when explicitly set, and there is a locale', (done) => { - let calendar = initCalendar({ - locale: frLocale, - dayPopoverFormat: { year: 'numeric' }, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - $(dayGridWrapper.getMoreEl()).simulate('click') - setTimeout(() => { - expect(dayGridWrapper.getMorePopoverTitle()).toBe('2014') - done() - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/dayRender.ts b/fullcalendar-main/tests/src/legacy/dayRender.ts deleted file mode 100644 index a9f1136..0000000 --- a/fullcalendar-main/tests/src/legacy/dayRender.ts +++ /dev/null @@ -1,85 +0,0 @@ -import { formatIsoDay } from '../lib/datelib-utils.js' -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' - -describe('dayCellDidMount', () => { // TODO: rename file - it('is triggered upon initialization of a view, with correct parameters', () => { - let options = { - initialView: 'dayGridMonth', - fixedWeekCount: true, - initialDate: '2014-05-01', - dayCellDidMount(arg) { - expect(arg.date instanceof Date).toEqual(true) - expect(formatIsoDay(arg.date)).toEqual(arg.el.getAttribute('data-date')) - expect(arg.el instanceof HTMLElement).toBe(true) - }, - } - - spyOn(options, 'dayCellDidMount').and.callThrough() - initCalendar(options) - expect(options.dayCellDidMount.calls.count()).toEqual(42) - }) - - it('is called when date range is changed', () => { - let options = { - initialView: 'dayGridWeek', - initialDate: '2014-05-01', - dayCellDidMount(arg) { }, - } - - spyOn(options, 'dayCellDidMount').and.callThrough() - initCalendar(options) - options.dayCellDidMount.calls.reset() - currentCalendar.gotoDate('2014-05-04') // a day in the next week - expect(options.dayCellDidMount.calls.count()).toEqual(7) - }) - - it('won\'t be called when date is navigated but remains in the current visible range', () => { - let options = { - initialView: 'dayGridWeek', - initialDate: '2014-05-01', - dayCellDidMount(arg) { }, - } - - spyOn(options, 'dayCellDidMount').and.callThrough() - initCalendar(options) - options.dayCellDidMount.calls.reset() - currentCalendar.gotoDate('2014-05-02') // a day in the same week - expect(options.dayCellDidMount.calls.count()).toEqual(0) - }) - - it('allows you to modify the element', () => { - let options = { - initialView: 'dayGridMonth', - fixedWeekCount: true, - initialDate: '2014-05-01', - dayCellDidMount(arg) { - if (formatIsoDay(arg.date) === '2014-05-01') { - arg.el.classList.add('mycustomclass') - } - }, - } - - let calendar = initCalendar(options) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let dayEl = dayGridWrapper.getDayEl('2014-05-01') - expect(dayEl).toHaveClass('mycustomclass') - }) - - it('gets called for TimeGrid views', () => { - let callCnt = 0 - let options = { - initialView: 'timeGridWeek', - initialDate: '2014-05-01', - allDaySlot: false, // turn off. fires its own dayCellDidMount - dayCellDidMount(arg) { - expect(arg.date instanceof Date).toBe(true) - expect(arg.el instanceof HTMLElement).toBe(true) - expect(typeof arg.view).toBe('object') - callCnt += 1 - }, - } - - initCalendar(options) - expect(callCnt).toBe(7) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/defaultAllDayEventDuration.ts b/fullcalendar-main/tests/src/legacy/defaultAllDayEventDuration.ts deleted file mode 100644 index 0f73ceb..0000000 --- a/fullcalendar-main/tests/src/legacy/defaultAllDayEventDuration.ts +++ /dev/null @@ -1,85 +0,0 @@ -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('defaultAllDayEventDuration', () => { - pushOptions({ - initialDate: '2014-05-01', - initialView: 'dayGridMonth', - timeZone: 'UTC', - }) - - describe('when forceEventDuration is on', () => { - pushOptions({ - forceEventDuration: true, - }) - - it('correctly calculates an unspecified end when using a Duration object input', () => { - initCalendar({ - defaultAllDayEventDuration: { days: 2 }, - events: [ - { - allDay: true, - start: '2014-05-05', - }, - ], - }) - - let event = currentCalendar.getEvents()[0] - expect(event.end).toEqualDate('2014-05-07') - }) - - it('correctly calculates an unspecified end when using a string Duration input', () => { - initCalendar({ - defaultAllDayEventDuration: '3.00:00:00', - events: [ - { - allDay: true, - start: '2014-05-05', - }, - ], - }) - - let event = currentCalendar.getEvents()[0] - expect(event.end).toEqualDate('2014-05-08') - }) - }) - - describe('when forceEventDuration is off', () => { - pushOptions({ - forceEventDuration: false, - }) - - describeOptions('initialView', { - 'with dayGridWeek view': 'dayGridWeek', - 'with week view': 'timeGridWeek', - }, () => { - it('renders an all-day event with no `end` to appear to have the default duration', () => { - let calendar = initCalendar({ - defaultAllDayEventDuration: { days: 2 }, - events: [ - { - // a control. so we know how wide it should be - title: 'control event', - allDay: true, - start: '2014-04-28', - end: '2014-04-30', - }, - { - // one day after the control. no specified end - title: 'test event', - allDay: true, - start: '2014-04-28', - }, - ], - }) - - let calendarWrapper = new CalendarWrapper(calendar) - let eventElms = calendarWrapper.getEventEls() - - let width0 = eventElms[0].offsetWidth - let width1 = eventElms[1].offsetWidth - expect(width0).toBeGreaterThan(0) - expect(width0).toEqual(width1) - }) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/defaultTimedEventDuration.ts b/fullcalendar-main/tests/src/legacy/defaultTimedEventDuration.ts deleted file mode 100644 index 70af495..0000000 --- a/fullcalendar-main/tests/src/legacy/defaultTimedEventDuration.ts +++ /dev/null @@ -1,119 +0,0 @@ -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('defaultTimedEventDuration', () => { - pushOptions({ - initialDate: '2014-05-01', - initialView: 'dayGridMonth', - timeZone: 'UTC', - }) - - describe('when forceEventDuration is on', () => { - pushOptions({ - forceEventDuration: true, - }) - - it('correctly calculates an unspecified end when using a Duration object input', () => { - initCalendar({ - defaultTimedEventDuration: { hours: 2, minutes: 30 }, - events: [ - { - allDay: false, - start: '2014-05-05T04:00:00', - }, - ], - }) - let event = currentCalendar.getEvents()[0] - expect(event.end).toEqualDate('2014-05-05T06:30:00Z') - }) - - it('correctly calculates an unspecified end when using a string Duration input', () => { - initCalendar({ - defaultTimedEventDuration: '03:15:00', - events: [ - { - allDay: false, - start: '2014-05-05T04:00:00', - }, - ], - }) - let event = currentCalendar.getEvents()[0] - expect(event.end).toEqualDate('2014-05-05T07:15:00Z') - }) - }) - - describe('when forceEventDuration is off', () => { - pushOptions({ - forceEventDuration: false, - }) - - describe('with week view', () => { - pushOptions({ - initialView: 'timeGridWeek', - }) - - it('renders a timed event with no `end` to appear to have the default duration', () => { - let calendar = initCalendar({ - defaultTimedEventDuration: '01:15:00', - events: [ - { - // a control. so we know how tall it should be - title: 'control event', - allDay: false, - start: '2014-05-01T04:00:00', - end: '2014-05-01T05:15:00', - }, - { - // one day after the control. no specified end - title: 'test event', - allDay: false, - start: '2014-05-02T04:00:00', - }, - ], - }) - - let calendarWrapper = new CalendarWrapper(calendar) - let eventElms = calendarWrapper.getEventEls() - - let height0 = eventElms[0].offsetHeight - let height1 = eventElms[1].offsetHeight - expect(height0).toBeGreaterThan(0) - expect(height0).toEqual(height1) - }) - }) - - describe('with dayGridWeek view', () => { - pushOptions({ - initialView: 'dayGridWeek', - }) - - it('renders a timed event with no `end` to appear to have the default duration', () => { - let calendar = initCalendar({ - defaultTimedEventDuration: { days: 2 }, - events: [ - { - // a control. so we know how wide it should be - title: 'control event', - allDay: false, - start: '2014-04-28T04:00:00', - end: '2014-04-30T04:00:00', - }, - { - // one day after the control. no specified end - title: 'test event', - allDay: false, - start: '2014-04-28T04:00:00', - }, - ], - }) - - let calendarWrapper = new CalendarWrapper(calendar) - let eventElms = calendarWrapper.getEventEls() - - let width0 = eventElms[0].offsetWidth - let width1 = eventElms[1].offsetWidth - expect(width0).toBeGreaterThan(0) - expect(width0).toEqual(width1) - }) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/destroy.ts b/fullcalendar-main/tests/src/legacy/destroy.ts deleted file mode 100644 index 97634f5..0000000 --- a/fullcalendar-main/tests/src/legacy/destroy.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { ListenerCounter } from '../lib/ListenerCounter.js' -import { prepareStandardListeners } from '../lib/vdom-misc.js' - -describe('destroy', () => { - describe('when calendar is LTR', () => { - it('cleans up all classNames on the root element', () => { - initCalendar({ - direction: 'ltr', - }) - currentCalendar.destroy() - expect(currentCalendar.el.className).toBe('') - }) - }) - - describe('when calendar is RTL', () => { - it('cleans up all classNames on the root element', () => { - initCalendar({ - direction: 'rtl', - }) - currentCalendar.destroy() - expect(currentCalendar.el.className).toBe('') - }) - }) - - describeOptions('themeSystem', { - 'when bootstrap theme': 'bootstrap', - }, () => { - it('cleans up all classNames on the root element', () => { - initCalendar() - currentCalendar.destroy() - expect(currentCalendar.el.className).toBe('') - }) - }) - - pushOptions({ - initialDate: '2014-12-01', - droppable: true, // likely to attach document handler - editable: true, // same - events: [ - { title: 'event1', start: '2014-12-01' }, - ], - }) - - describeOptions('initialView', { - 'when in dayGridWeek view': 'dayGridWeek', - 'when in week view': 'timeGridWeek', - 'when in listWeek view': 'listWeek', - 'when in month view': 'dayGridMonth', - }, (viewName) => { - it('leaves no handlers attached to DOM', () => { - const standardElListenerCount = prepareStandardListeners() - let $el = $('
').appendTo('body') - - let elHandlerCounter = new ListenerCounter($el[0]) - let docHandlerCounter = new ListenerCounter(document) - - elHandlerCounter.startWatching() - docHandlerCounter.startWatching() - - initCalendar({}, $el) - currentCalendar.destroy() - - if (viewName !== 'timeGridDay') { // hack for skipping 3rd one - expect(elHandlerCounter.stopWatching()).toBe(standardElListenerCount) - expect(docHandlerCounter.stopWatching()).toBe(0) - } - - $el.remove() - }) - - // Issue 2432 - it('preserves existing window handlers when handleWindowResize is off', () => { - let resizeHandler = () => {} - let windowListenerCounter = new ListenerCounter(window) - windowListenerCounter.startWatching() - - window.addEventListener('resize', resizeHandler) - expect(windowListenerCounter.computeDelta()).toBe(1) - - initCalendar({ - handleWindowResize: false, - }) - currentCalendar.destroy() - - expect(windowListenerCounter.stopWatching()).toBe(1) - window.removeEventListener('resize', resizeHandler) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/dir.ts b/fullcalendar-main/tests/src/legacy/dir.ts deleted file mode 100644 index 7d4c61d..0000000 --- a/fullcalendar-main/tests/src/legacy/dir.ts +++ /dev/null @@ -1,29 +0,0 @@ -import arLocale from '@fullcalendar/core/locales/ar' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('direction', () => { - it('has it\'s default value computed differently based off of the locale', () => { - initCalendar({ - locale: arLocale, // Arabic is RTL - }) - expect(currentCalendar.getOption('direction')).toEqual('rtl') - }) - - // NOTE: don't put tests related to other options in here! - // Put them in the test file for the individual option! - - it('adapts to dynamic option change', () => { - initCalendar({ - direction: 'ltr', - }) - let $el = $(currentCalendar.el) - - expect($el).toHaveClass(CalendarWrapper.LTR_CLASSNAME) - expect($el).not.toHaveClass(CalendarWrapper.RTL_CLASSNAME) - - currentCalendar.setOption('direction', 'rtl') - - expect($el).toHaveClass(CalendarWrapper.RTL_CLASSNAME) - expect($el).not.toHaveClass(CalendarWrapper.LTR_CLASSNAME) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/displayEventEnd.ts b/fullcalendar-main/tests/src/legacy/displayEventEnd.ts deleted file mode 100644 index 76e7405..0000000 --- a/fullcalendar-main/tests/src/legacy/displayEventEnd.ts +++ /dev/null @@ -1,130 +0,0 @@ -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('displayEventEnd', () => { - pushOptions({ - initialDate: '2014-06-13', - timeZone: 'UTC', - eventTimeFormat: { hour: 'numeric', minute: '2-digit' }, - }) - - describeOptions('initialView', { - 'when in month view': 'dayGridMonth', - 'when in week view': 'timeGridWeek', - }, () => { - describe('when off', () => { - pushOptions({ - displayEventEnd: false, - }) - - describe('with an all-day event', () => { - it('displays no time text', () => { - let calendar = initCalendar({ - events: [{ - title: 'timed event', - start: '2014-06-13', - end: '2014-06-13', - allDay: true, - }], - }) - expectEventTimeText(calendar, '') - }) - }) - - describe('with a timed event with no end time', () => { - it('displays only the start time text', () => { - let calendar = initCalendar({ - events: [{ - title: 'timed event', - start: '2014-06-13T01:00:00', - allDay: false, - }], - }) - expectEventTimeText(calendar, '1:00 AM') - }) - }) - - describe('with a timed event with an end time', () => { - it('displays only the start time text', () => { - let calendar = initCalendar({ - events: [{ - title: 'timed event', - start: '2014-06-13T01:00:00', - end: '2014-06-13T02:00:00', - allDay: false, - }], - }) - expectEventTimeText(calendar, '1:00 AM') - }) - }) - }) - - describe('when on', () => { - pushOptions({ - displayEventEnd: true, - }) - - describe('with an all-day event', () => { - it('displays no time text', () => { - let calendar = initCalendar({ - events: [{ - title: 'timed event', - start: '2014-06-13', - end: '2014-06-13', - allDay: true, - }], - }) - expectEventTimeText(calendar, '') - }) - }) - - describe('with a timed event with no end time', () => { - it('displays only the start time text', () => { - let calendar = initCalendar({ - events: [{ - title: 'timed event', - start: '2014-06-13T01:00:00', - allDay: false, - }], - }) - expectEventTimeText(calendar, '1:00 AM') - }) - }) - - describe('with a timed event given an invalid end time', () => { - it('displays only the start time text', () => { - let calendar = initCalendar({ - events: [{ - title: 'timed event', - start: '2014-06-13T01:00:00', - end: '2014-06-13T01:00:00', - allDay: false, - }], - }) - expectEventTimeText(calendar, '1:00 AM') - }) - }) - - describe('with a timed event with an end time', () => { - it('displays both the start and end time text', () => { - let calendar = initCalendar({ - events: [{ - title: 'timed event', - start: '2014-06-13T01:00:00', - end: '2014-06-13T02:00:00', - allDay: false, - }], - }) - expectEventTimeText(calendar, '1:00 AM - 2:00 AM') - }) - }) - }) - }) - - function expectEventTimeText(calendar, timeText) { - let calendarWrapper = new CalendarWrapper(calendar) - let eventEl = calendarWrapper.getFirstEventEl() - let eventInfo = calendarWrapper.getEventElInfo(eventEl) - - expect(eventInfo.timeText).toBe(timeText) - } -}) diff --git a/fullcalendar-main/tests/src/legacy/emitter.ts b/fullcalendar-main/tests/src/legacy/emitter.ts deleted file mode 100644 index 7405fbc..0000000 --- a/fullcalendar-main/tests/src/legacy/emitter.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { Emitter } from '@fullcalendar/core/internal' - -describe('emitter', () => { - it('calls a handler', () => { - let o = new Emitter() - let handlers = { - something(arg1, arg2) { - expect(arg1).toBe(7) - expect(arg2).toBe(8) - }, - } - spyOn(handlers, 'something').and.callThrough() - - o.on('something', handlers.something) - o.trigger('something', 7, 8) - expect(handlers.something).toHaveBeenCalled() - }) - - it('unbinds with an exact reference', () => { - let o = new Emitter() - let handlers = { - something() {}, - } - spyOn(handlers, 'something') - - o.on('something', handlers.something) - o.trigger('something') - expect(handlers.something).toHaveBeenCalled() - - o.off('something', handlers.something) - o.trigger('something') - expect(handlers.something.calls.count()).toBe(1) - }) - - it('unbinds all when no reference', () => { - let o = new Emitter() - let handlers = { - something1() {}, - something2() {}, - } - spyOn(handlers, 'something1') - spyOn(handlers, 'something2') - - o.on('something', handlers.something1) - o.on('something', handlers.something2) - - o.trigger('something') - expect(handlers.something1).toHaveBeenCalled() - expect(handlers.something2).toHaveBeenCalled() - - o.off('something') - o.trigger('something') - expect(handlers.something1.calls.count()).toBe(1) - expect(handlers.something2.calls.count()).toBe(1) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/event-coloring.ts b/fullcalendar-main/tests/src/legacy/event-coloring.ts deleted file mode 100644 index fbd401e..0000000 --- a/fullcalendar-main/tests/src/legacy/event-coloring.ts +++ /dev/null @@ -1,245 +0,0 @@ -import { EventInput } from '@fullcalendar/core' -import { RED_REGEX } from '../lib/dom-misc.js' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('event coloring', () => { - pushOptions({ - initialDate: '2014-11-04', - allDaySlot: false, - }) - - describe('when in month view', () => { - pushOptions({ - initialView: 'dayGridMonth', - }) - - defineViewTests(false) - }) - - describe('when in week view', () => { - pushOptions({ - initialView: 'timeGridWeek', - }) - - defineViewTests(true) - }) - - function defineViewTests(eventHasTime) { - describe('for foreground events', () => { - testTextColor(eventHasTime) - testBorderColor(eventHasTime) - testBackgroundColor(eventHasTime) - }) - - describe('for background events', () => { - testBackgroundColor(eventHasTime, 'background') - }) - } - - function testTextColor(eventHasTime) { - let eventOptions = getEventOptions(eventHasTime) - - it('should accept the global eventTextColor', () => { - initCalendar({ - eventTextColor: 'red', - events: [getTestEvent(eventOptions)], - }) - expect(getEventCss('color')).toMatch(RED_REGEX) - }) - - it('should accept an event source\'s textColor', () => { - initCalendar({ - eventTextColor: 'blue', // even when there's a more general setting - eventSources: [{ - textColor: 'red', - events: [getTestEvent(eventOptions)], - }], - }) - expect(getEventCss('color')).toMatch(RED_REGEX) - }) - - it('should accept an event object\'s textColor', () => { - let eventInput = getTestEvent(eventOptions, { - textColor: 'red', - }) - initCalendar({ - eventTextColor: 'blue', // even when there's a more general setting - events: [eventInput], - }) - expect(getEventCss('color')).toMatch(RED_REGEX) - }) - } - - function testBorderColor(eventHasTime) { - let eventOptions = getEventOptions(eventHasTime) - - it('should accept the global eventColor for border color', () => { - initCalendar({ - eventColor: 'red', - events: [getTestEvent(eventOptions)], - }) - expect(getEventCss('border-top-color')).toMatch(RED_REGEX) - }) - - it('should accept the global eventBorderColor', () => { - initCalendar({ - eventColor: 'blue', - eventBorderColor: 'red', - events: [getTestEvent(eventOptions)], - }) - expect(getEventCss('border-top-color')).toMatch(RED_REGEX) - }) - - it('should accept an event source\'s color for the border', () => { - initCalendar({ - eventBorderColor: 'blue', // even when there's a more general setting - eventSources: [{ - color: 'red', - events: [getTestEvent(eventOptions)], - }], - }) - expect(getEventCss('border-top-color')).toMatch(RED_REGEX) - }) - - it('should accept an event source\'s borderColor', () => { - initCalendar({ - eventBorderColor: 'blue', // even when there's a more general setting - eventSources: [{ - color: 'blue', - borderColor: 'red', - events: [getTestEvent(eventOptions)], - }], - }) - expect(getEventCss('border-top-color')).toMatch(RED_REGEX) - }) - - it('should accept an event object\'s color for the border', () => { - let eventInput = getTestEvent(eventOptions, { - color: 'red', - }) - initCalendar({ - eventSources: [{ - borderColor: 'blue', // even when there's a more general setting - events: [eventInput], - }], - }) - expect(getEventCss('border-top-color')).toMatch(RED_REGEX) - }) - - it('should accept an event object\'s borderColor', () => { - let eventInput = getTestEvent(eventOptions, { - color: 'blue', // even when there's a more general setting - borderColor: 'red', - }) - initCalendar({ - eventSources: [{ - events: [eventInput], - }], - }) - expect(getEventCss('border-top-color')).toMatch(RED_REGEX) - }) - } - - function testBackgroundColor(eventHasTime, display?) { - let eventOptions = getEventOptions(eventHasTime) - - if (typeof display !== 'undefined') { - eventOptions.display = display - } - - it('should accept the global eventColor for background color', () => { - initCalendar({ - eventColor: 'red', - events: [getTestEvent(eventOptions)], - }) - expect(getEventCss('background-color', display)).toMatch(RED_REGEX) - }) - - it('should accept the global eventBackgroundColor', () => { - initCalendar({ - eventColor: 'blue', // even when there's a more general setting - eventBackgroundColor: 'red', - events: [getTestEvent(eventOptions)], - }) - expect(getEventCss('background-color', display)).toMatch(RED_REGEX) - }) - - it('should accept an event source\'s color for the background', () => { - initCalendar({ - eventBackgroundColor: 'blue', // even when there's a more general setting - eventSources: [{ - color: 'red', - events: [getTestEvent(eventOptions)], - }], - }) - expect(getEventCss('background-color', display)).toMatch(RED_REGEX) - }) - - it('should accept an event source\'s backgroundColor', () => { - initCalendar({ - eventSources: [{ - color: 'blue', // even when there's a more general setting - backgroundColor: 'red', - events: [getTestEvent(eventOptions)], - }], - }) - expect(getEventCss('background-color', display)).toMatch(RED_REGEX) - }) - - it('should accept an event object\'s color for the background', () => { - let eventInput = getTestEvent(eventOptions) - eventInput.color = 'red' - initCalendar({ - eventSources: [{ - backgroundColor: 'blue', // even when there's a more general setting - events: [eventInput], - }], - }) - expect(getEventCss('background-color', display)).toMatch(RED_REGEX) - }) - - it('should accept an event object\'s backgroundColor', () => { - let eventInput = getTestEvent(eventOptions) - eventInput.color = 'blue' // even when there's a more general setting - eventInput.backgroundColor = 'red' - initCalendar({ - eventSources: [{ - events: [eventInput], - }], - }) - expect(getEventCss('background-color', display)).toMatch(RED_REGEX) - }) - } - - function getEventCss(prop, display?) { - let calendarWrapper = new CalendarWrapper(currentCalendar) - let eventEl = display === 'background' - ? calendarWrapper.getBgEventEls()[0] - : calendarWrapper.getEventEls()[0] - - if (prop === 'color') { - return $(eventEl).find('.fc-event-title').css(prop) - } - - return $(eventEl).css(prop) - } - - function getTestEvent(defaultOptions, extraOptions = {}): EventInput { - let event = {} as EventInput - $.extend(event, defaultOptions) - if (extraOptions) { - $.extend(event, extraOptions) - } - return event - } - - function getEventOptions(eventHasTime): EventInput { - let options = { - start: '2014-11-04', - } - if (eventHasTime) { - options.start += 'T01:00:00' - } - return options - } -}) diff --git a/fullcalendar-main/tests/src/legacy/event-dnd.ts b/fullcalendar-main/tests/src/legacy/event-dnd.ts deleted file mode 100644 index 5dc0520..0000000 --- a/fullcalendar-main/tests/src/legacy/event-dnd.ts +++ /dev/null @@ -1,458 +0,0 @@ -import { createDuration } from '@fullcalendar/core/internal' -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import { waitEventDrag2 } from '../lib/wrappers/interaction-util.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' -import { queryEventElInfo } from '../lib/wrappers/TimeGridWrapper.js' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('eventDrop', () => { - pushOptions({ - timeZone: 'UTC', - initialDate: '2014-06-11', - editable: true, - dragScroll: false, - longPressDelay: 100, - }) - - describe('when in month view', () => { - pushOptions({ - initialView: 'dayGridMonth', - }); - - // TODO: test that event's dragged via touch that don't wait long enough for longPressDelay - // SHOULD NOT drag - - [false, true].forEach((isTouch) => { - describe('with ' + (isTouch ? 'touch' : 'mouse'), () => { - describe('when dragging an all-day event to another day', () => { - it('should be given correct arguments, with whole-day delta', (done) => { - let calendar = initCalendarWithSpies({ - events: [{ - title: 'all-day event', - start: '2014-06-11', - allDay: true, - }], - }) - - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let dragging = dayGridWrapper.dragEventToDate( - dayGridWrapper.getFirstEventEl(), - '2014-06-11', - '2014-06-20', - isTouch, - ) - - waitEventDrag2(calendar, dragging).then((arg) => { - let delta = createDuration({ day: 9 }) - expect(arg.delta).toEqual(delta) - - expect(arg.event.start).toEqualDate('2014-06-20') - expect(arg.event.end).toBeNull() - - arg.revert() - let event = currentCalendar.getEvents()[0] - - expect(event.start).toEqualDate('2014-06-11') - expect(event.end).toBeNull() - - done() - }) - }) - }) - }) - }) - - describe('when gragging a timed event to another day', () => { - it('should be given correct arguments, with whole-day delta', (done) => { - let calendar = initCalendarWithSpies({ - events: [{ - title: 'timed event', - start: '2014-06-11T06:00:00', - allDay: false, - }], - }) - - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let dragging = dayGridWrapper.dragEventToDate( - dayGridWrapper.getFirstEventEl(), - '2014-06-11', - '2014-06-16', - ) - - waitEventDrag2(calendar, dragging).then((arg) => { - let delta = createDuration({ day: 5 }) - expect(arg.delta).toEqual(delta) - - expect(arg.event.start).toEqualDate('2014-06-16T06:00:00Z') - expect(arg.event.end).toBeNull() - - arg.revert() - let event = currentCalendar.getEvents()[0] - - expect(event.start).toEqualDate('2014-06-11T06:00:00Z') - expect(event.end).toBeNull() - - done() - }) - }) - }) - - // https://github.com/fullcalendar/fullcalendar/issues/4458 - describe('when dragging an event back in time when duration not editable', () => { - it('should work', (done) => { - let calendar = initCalendarWithSpies({ - initialDate: '2019-01-16', - eventDurationEditable: false, - events: [{ - title: 'event', - start: '2019-01-16T10:30:00+00:00', - end: '2019-01-16T12:30:00+00:00', - }], - }) - - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let dragging = dayGridWrapper.dragEventToDate( - dayGridWrapper.getFirstEventEl(), - '2019-01-16', - '2019-01-14', - ) - - waitEventDrag2(calendar, dragging).then((arg) => { - expect(arg.delta).toEqual(createDuration({ day: -2 })) - expect(arg.event.start).toEqualDate('2019-01-14T10:30:00+00:00') - expect(arg.event.end).toEqualDate('2019-01-14T12:30:00+00:00') - done() - }) - }) - }) - - // TODO: tests for eventMouseEnter/eventMouseLeave firing correctly when no dragging - it('should not fire any eventMouseEnter/eventMouseLeave events while dragging', (done) => { // issue 1297 - let eventMouseEnterSpy = spyOnCalendarCallback('eventMouseEnter') - let eventMouseLeaveSpy = spyOnCalendarCallback('eventMouseLeave') - let calendar = initCalendar({ - events: [ - { - title: 'all-day event', - start: '2014-06-11', - allDay: true, - className: 'event1', - }, - { - title: 'event2', - start: '2014-06-10', - allDay: true, - className: 'event2', - }, - ], - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - $('.event1').simulate('drag', { - end: dayGridWrapper.getDayEl('2014-06-20'), - moves: 10, - duration: 1000, - onRelease() { - done() - }, - }) - - setTimeout(() => { // wait until half way through drag - $('.event2') - .simulate('mouseover') - .simulate('mouseenter') - .simulate('mouseout') - .simulate('mouseleave') - - setTimeout(() => { - expect(eventMouseEnterSpy).not.toHaveBeenCalled() - expect(eventMouseLeaveSpy).not.toHaveBeenCalled() - }, 0) - }, 500) - }) - }) - - describe('when in timeGrid view', () => { - pushOptions({ - initialView: 'timeGridWeek', - }); - - [false, true].forEach((isTouch) => { - describe('with ' + (isTouch ? 'touch' : 'mouse'), () => { - describe('when dragging a timed event to another time on a different day', () => { - it('should be given correct arguments and delta with days/time', (done) => { - let calendar = initCalendarWithSpies({ - events: [{ - title: 'timed event', - start: '2014-06-11T06:00:00', - allDay: false, - }], - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let dragging = timeGridWrapper.dragEventToDate( - timeGridWrapper.getFirstEventEl(), - '2014-06-12T07:30:00', - ) - - waitEventDrag2(calendar, dragging).then((arg) => { - let delta = createDuration({ day: 1, hour: 1, minute: 30 }) - expect(arg.delta).toEqual(delta) - - expect(arg.event.start).toEqualDate('2014-06-12T07:30:00Z') - expect(arg.event.end).toBeNull() - - arg.revert() - let event = currentCalendar.getEvents()[0] - - expect(event.start).toEqualDate('2014-06-11T06:00:00Z') - expect(event.end).toBeNull() - - done() - }) - }) - }) - }) - }) - - describe('when dragging an all-day event to another all-day', () => { - it('should be given correct arguments, with whole-day delta', (done) => { - let calendar = initCalendarWithSpies({ - events: [{ - title: 'all-day event', - start: '2014-06-11', - allDay: true, - }], - }) - let dayGridWrapper = new TimeGridViewWrapper(calendar).dayGrid - let dragging = dayGridWrapper.dragEventToDate( - dayGridWrapper.getFirstEventEl(), - '2014-06-11', - '2014-06-13', - ) - - waitEventDrag2(calendar, dragging).then((arg) => { - let delta = createDuration({ day: 2 }) - expect(arg.delta).toEqual(delta) - - expect(arg.event.start).toEqualDate('2014-06-13') - expect(arg.event.end).toBeNull() - - arg.revert() - let event = currentCalendar.getEvents()[0] - - expect(event.start).toEqualDate('2014-06-11') - expect(event.end).toBeNull() - - done() - }) - }) - }) - - describe('when dragging an all-day event to a time slot on a different day', () => { - it('should be given correct arguments and delta with days/time', (done) => { - let calendar = initCalendarWithSpies({ - scrollTime: '01:00:00', - height: 400, // short enough to make scrolling happen - events: [{ - title: 'all-day event', - start: '2014-06-11', - allDay: true, - }], - }) - let viewWrapper = new TimeGridViewWrapper(calendar) - let dragging = viewWrapper.timeGrid.dragEventToDate( - viewWrapper.dayGrid.getFirstEventEl(), - '2014-06-10T01:00:00', - ) - - waitEventDrag2(calendar, dragging).then((arg) => { - let delta = createDuration({ day: -1, hour: 1 }) - expect(arg.delta).toEqual(delta) - - expect(arg.event.start).toEqualDate('2014-06-10T01:00:00Z') - expect(arg.event.end).toBeNull() - expect(arg.event.allDay).toBe(false) - - arg.revert() - let event = currentCalendar.getEvents()[0] - - expect(event.start).toEqualDate('2014-06-11') - expect(event.end).toBeNull() - expect(event.allDay).toBe(true) - - done() - }) - }) - }) - - describe('when dragging a timed event to an all-day slot on a different day', () => { - it('should be given correct arguments, with whole-day delta', (done) => { - let calendar = initCalendarWithSpies({ - scrollTime: '01:00:00', - height: 400, // short enough to make scrolling happen - events: [{ - title: 'timed event', - start: '2014-06-11T01:00:00', - allDay: false, - }], - }) - let viewWrapper = new TimeGridViewWrapper(calendar) - let dragging = viewWrapper.dayGrid.dragEventToDate( - viewWrapper.timeGrid.getFirstEventEl(), - null, - '2014-06-10', - ) - - waitEventDrag2(calendar, dragging).then((arg) => { - let delta = createDuration({ day: -1 }) - expect(arg.delta).toEqual(delta) - - expect(arg.event.start).toEqualDate('2014-06-10') - expect(arg.event.end).toBeNull() - expect(arg.event.allDay).toBe(true) - - arg.revert() - let event = currentCalendar.getEvents()[0] - - expect(event.start).toEqualDate('2014-06-11T01:00:00Z') - expect(event.end).toBeNull() - expect(event.allDay).toBe(false) - - done() - }) - }) - }) - - describe('when dragging a timed event with no end time', () => { - it('should continue to only show the updated start time', (done) => { - let dragged = false - let calendar = initCalendarWithSpies({ - scrollTime: '01:00:00', - height: 400, // short enough to make scrolling happen - events: [{ - title: 'timed event', - start: '2014-06-11T01:00:00', - allDay: false, - }], - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - - let dragging = timeGridWrapper.dragEventToDate( - timeGridWrapper.getFirstEventEl(), - '2014-06-11T02:30:00', - () => { // onBeforeRelease - dragged = true - let mirrorEls = timeGridWrapper.getMirrorEls() - expect(mirrorEls.length).toBe(1) - expect(queryEventElInfo(mirrorEls[0]).timeText).toBe('2:30') - }, - ) - - waitEventDrag2(calendar, dragging).then(() => { - expect(dragged).toBe(true) - done() - }) - }) - }) - - describe('when dragging a timed event with an end time', () => { - it('should continue to show the updated start and end time', (done) => { - let dragged = false - let calendar = initCalendarWithSpies({ - scrollTime: '01:00:00', - height: 400, // short enough to make scrolling happen - events: [{ - title: 'timed event', - start: '2014-06-11T01:00:00', - end: '2014-06-11T02:00:00', - allDay: false, - }], - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - - let dragging = timeGridWrapper.dragEventToDate( - timeGridWrapper.getFirstEventEl(), - '2014-06-11T02:30:00', - () => { // onBeforeRelease - dragged = true - let mirrorEls = timeGridWrapper.getMirrorEls() - expect(mirrorEls.length).toBe(1) - expect(queryEventElInfo(mirrorEls[0]).timeText).toBe('2:30 - 3:30') - }, - ) - - waitEventDrag2(calendar, dragging).then(() => { - expect(dragged).toBe(true) - done() - }) - }) - }) - - // https://github.com/fullcalendar/fullcalendar/issues/4503 - describe('when dragging to one of the last slots', () => { - it('should work', (done) => { - let calendar = initCalendarWithSpies({ - scrollTime: '23:00:00', - height: 400, // short enough to make scrolling happen - events: [{ - title: 'timed event', - start: '2014-06-11T18:00:00', // should be in view without scrolling - allDay: false, - }], - }) - - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let dragging = timeGridWrapper.dragEventToDate( - timeGridWrapper.getFirstEventEl(), - '2014-06-11T23:30:00', - ) - - waitEventDrag2(calendar, dragging).then(() => { - let event = currentCalendar.getEvents()[0] - - expect(event.start).toEqualDate('2014-06-11T23:30:00Z') - expect(event.end).toBeNull() - expect(event.allDay).toBe(false) - - done() - }) - }) - }) - }) - - // Initialize a calendar, run a drag, and do type-checking of all arguments for all handlers. - // TODO: more discrimination instead of just checking for 'object' - function initCalendarWithSpies(options) { - options.eventDragStart = (arg) => { - expect(arg.el instanceof Element).toBe(true) - expect(arg.el).toHaveClass(CalendarWrapper.EVENT_CLASSNAME) - expect(typeof arg.event).toBe('object') - expect(typeof arg.jsEvent).toBe('object') - expect(typeof arg.view).toBe('object') - } - - options.eventDragStop = (arg) => { - expect(options.eventDragStart).toHaveBeenCalled() - expect(arg.el instanceof Element).toBe(true) - expect(arg.el).toHaveClass(CalendarWrapper.EVENT_CLASSNAME) - expect(typeof arg.event).toBe('object') - expect(typeof arg.jsEvent).toBe('object') - expect(typeof arg.view).toBe('object') - } - - options.eventDrop = (arg) => { - expect(options.eventDragStop).toHaveBeenCalled() - expect(arg.el instanceof Element).toBe(true) - expect(arg.el).toHaveClass(CalendarWrapper.EVENT_CLASSNAME) - expect(typeof arg.delta).toBe('object') - expect(typeof arg.revert).toBe('function') - expect(typeof arg.jsEvent).toBe('object') - expect(typeof arg.view).toBe('object') - } - - spyOn(options, 'eventDragStart').and.callThrough() - spyOn(options, 'eventDragStop').and.callThrough() - - return initCalendar(options) - } -}) diff --git a/fullcalendar-main/tests/src/legacy/event-feed-param.ts b/fullcalendar-main/tests/src/legacy/event-feed-param.ts deleted file mode 100644 index 8cd3c66..0000000 --- a/fullcalendar-main/tests/src/legacy/event-feed-param.ts +++ /dev/null @@ -1,57 +0,0 @@ -import fetchMock from 'fetch-mock' - -describe('event feed params', () => { - pushOptions({ - initialDate: '2014-05-01', - initialView: 'dayGridMonth', - }) - - afterEach(() => { - fetchMock.restore() - }) - - it('utilizes custom startParam, endParam, and timeZoneParam names', () => { - const givenUrl = window.location.href + '/my-feed.php' - fetchMock.get(/my-feed\.php/, { body: [] }) - - initCalendar({ - events: givenUrl, - timeZone: 'America/Los_Angeles', - startParam: 'mystart', - endParam: 'myend', - timeZoneParam: 'currtz', - }) - - const [requestUrl] = fetchMock.lastCall() - const requestParams = new URL(requestUrl).searchParams - expect(requestParams.get('mystart')).toBe('2014-04-27T00:00:00') - expect(requestParams.get('myend')).toBe('2014-06-08T00:00:00') - expect(requestParams.get('currtz')).toBe('America/Los_Angeles') - }) - - it('utilizes event-source-specific startParam, endParam, and timeZoneParam names', () => { - const givenUrl = window.location.href + '/my-feed.php' - fetchMock.get(/my-feed\.php/, { body: [] }) - - initCalendar({ - timeZone: 'America/Los_Angeles', - startParam: 'mystart', - endParam: 'myend', - timeZoneParam: 'currtz', - eventSources: [ - { - url: givenUrl, - startParam: 'feedstart', - endParam: 'feedend', - timeZoneParam: 'feedctz', - }, - ], - }) - - const [requestUrl] = fetchMock.lastCall() - const requestParams = new URL(requestUrl).searchParams - expect(requestParams.get('feedstart')).toBe('2014-04-27T00:00:00') - expect(requestParams.get('feedend')).toBe('2014-06-08T00:00:00') - expect(requestParams.get('feedctz')).toBe('America/Los_Angeles') - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/event-obj.ts b/fullcalendar-main/tests/src/legacy/event-obj.ts deleted file mode 100644 index 34e45b4..0000000 --- a/fullcalendar-main/tests/src/legacy/event-obj.ts +++ /dev/null @@ -1,145 +0,0 @@ -describe('event object creation', () => { - /* - - NOTE: Where possible, if there is a specific option that affects event object creation - behavior, write your tests in the individual file for that option, instead of here. - Examples of this: - defaultAllDay (tests allDay guessing behavior too) - eventDataTransform - forceEventDuration - - */ - - function init(singleEventData) { - initCalendar({ - events: [singleEventData], - }) - return currentCalendar.getEvents()[0] - } - - it('accepts `date` property as alias for `start`', () => { - let event = init({ - date: '2014-05-05', - }) - expect(event.start instanceof Date).toEqual(true) - expect(event.start).toEqualDate('2014-05-05') - }) - - it('doesn\'t produce an event when an invalid start Date object', () => { - let event = init({ - start: new Date('asdf'), - }) - expect(event).toBeUndefined() - }) - - it('doesn\'t produce an event when an invalid start string', () => { - let event = init({ - start: 'asdfasdfasdf', - }) - expect(event).toBeUndefined() - }) - - it('produces null end when given an invalid Date object', () => { - let event = init({ - start: '2014-05-01', - end: new Date('asdf'), - }) - expect(event.start).toEqualDate('2014-05-01') - expect(event.end).toBe(null) - }) - - it('produces null end when given an invalid string', () => { - let event = init({ - start: '2014-05-01', - end: 'asdfasdfasdf', - }) - expect(event.start).toEqualDate('2014-05-01') - expect(event.end).toBe(null) - }) - - it('produces null end when given a timed end before the start', () => { - let event = init({ - start: '2014-05-02T00:00:00', - end: '2014-05-01T23:00:00', - }) - expect(event.start).toEqualDate('2014-05-02T00:00:00Z') - expect(event.end).toBe(null) - }) - - it('produces null end when given a timed end equal to the start', () => { - let event = init({ - start: '2014-05-02T00:00:00', - end: '2014-05-01T00:00:00', - }) - expect(event.start).toEqualDate('2014-05-02T00:00:00Z') - expect(event.end).toBe(null) - }) - - it('produces null end when given an all-day end before the start', () => { - let event = init({ - start: '2014-05-02', - end: '2014-05-02', - }) - expect(event.start).toEqualDate('2014-05-02') - expect(event.end).toBe(null) - }) - - it('produces null end when given an all-day end equal to the start', () => { - let event = init({ - start: '2014-05-02T00:00:00', - end: '2014-05-02T00:00:00', - }) - expect(event.start).toEqualDate('2014-05-02T00:00:00Z') - expect(event.end).toBe(null) - }) - - it('strips times of dates when event is all-day', () => { - let event = init({ - start: '2014-05-01T01:00:00-12:00', - end: '2014-05-02T01:00:00-12:00', - allDay: true, - }) - expect(event.allDay).toEqual(true) - expect(event.start).toEqualDate('2014-05-01') - expect(event.end).toEqualDate('2014-05-02') - }) - - it('gives 00:00 times to ambiguously-timed dates when event is timed', () => { - let event = init({ - start: '2014-05-01', - end: '2014-05-03', - allDay: false, - }) - expect(event.allDay).toEqual(false) - expect(event.start).toEqualDate('2014-05-01T00:00:00Z') - expect(event.end).toEqualDate('2014-05-03T00:00:00Z') - }) - - it('accepts an array `className`', () => { - let event = init({ - start: '2014-05-01', - className: ['class1', 'class2'], - }) - expect($.isArray(event.classNames)).toEqual(true) - expect(event.classNames).toEqual(['class1', 'class2']) - }) - - it('accepts a string `className`', () => { - let event = init({ - start: '2014-05-01', - className: 'class1 class2', - }) - expect($.isArray(event.classNames)).toEqual(true) - expect(event.classNames).toEqual(['class1', 'class2']) - }) - - it('accepts extended properties', () => { - let event = init({ - start: '2014-05-01', - prop1: 'prop1val', - prop2: ['a', 'b'], - }) - expect(event.extendedProps.prop1).toEqual('prop1val') - expect(event.extendedProps.prop2).toEqual(['a', 'b']) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/event-resize.ts b/fullcalendar-main/tests/src/legacy/event-resize.ts deleted file mode 100644 index 3bf7c10..0000000 --- a/fullcalendar-main/tests/src/legacy/event-resize.ts +++ /dev/null @@ -1,442 +0,0 @@ -import { createDuration } from '@fullcalendar/core/internal' -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import { waitEventResize2 } from '../lib/wrappers/interaction-util.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('eventResize', () => { - pushOptions({ - initialDate: '2014-06-11', - editable: true, - longPressDelay: 100, - scrollTime: 0, - }) - - describe('when in month view', () => { - pushOptions({ - initialView: 'dayGridMonth', - }) - - describe('when resizing an all-day event with mouse', () => { - it('should have correct arguments with a whole-day delta', (done) => { - let calendar = initCalendar({ - events: [{ - title: 'all-day event', - start: '2014-06-11', - allDay: true, - }], - }) - checkCalendarTriggers(calendar) - - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let resizing = dayGridWrapper.resizeEvent( - dayGridWrapper.getFirstEventEl(), '2014-06-11', '2014-06-16', - ) - - waitEventResize2(calendar, resizing).then((arg) => { - expect(arg.endDelta).toEqual(createDuration({ day: 5 })) - - expect(arg.event.start).toEqualDate('2014-06-11') - expect(arg.event.end).toEqualDate('2014-06-17') - - arg.revert() - let event = calendar.getEvents()[0] - - expect(event.start).toEqualDate('2014-06-11') - expect(event.end).toBeNull() - - done() - }) - }) - }) - - describe('when resizing an all-day event via touch', () => { - // for https://github.com/fullcalendar/fullcalendar/issues/3118 - [true, false].forEach((eventStartEditable) => { - describe('when eventStartEditable is ' + eventStartEditable, () => { - pushOptions({ eventStartEditable }) - - it('should have correct arguments with a whole-day delta', (done) => { - let calendar = initCalendar({ - dragRevertDuration: 0, // so that eventDragStop happens immediately after touchend - events: [{ - title: 'all-day event', - start: '2014-06-11', - allDay: true, - }], - }) - - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let resizing = dayGridWrapper.resizeEventTouch( - dayGridWrapper.getFirstEventEl(), '2014-06-11', '2014-06-16', - ) - - waitEventResize2(calendar, resizing).then((arg) => { - expect(arg.endDelta).toEqual(createDuration({ day: 5 })) - - expect(arg.event.start).toEqualDate('2014-06-11') - expect(arg.event.end).toEqualDate('2014-06-17') - - arg.revert() - let event = calendar.getEvents()[0] - - expect(event.start).toEqualDate('2014-06-11') - expect(event.end).toBeNull() - - done() - }) - }) - }) - }) - }) - - describe('when rendering a timed event', () => { - it('should not have resize capabilities', () => { - initCalendar({ - events: [{ - title: 'timed event', - start: '2014-06-11T08:00:00', - allDay: false, - }], - }) - expect( - $(`.${CalendarWrapper.EVENT_CLASSNAME} .${CalendarWrapper.EVENT_RESIZER_CLASSNAME}`), - ).not.toBeInDOM() - }) - }) - }) - - describe('when in timeGrid view', () => { - pushOptions({ - initialView: 'timeGridWeek', - }) - - describe('when resizing an all-day event', () => { - it('should have correct arguments with a whole-day delta', (done) => { - let calendar = initCalendar({ - events: [{ - title: 'all-day event', - start: '2014-06-11', - allDay: true, - }], - }) - - let dayGridWrapper = new TimeGridViewWrapper(calendar).dayGrid - let resizing = dayGridWrapper.resizeEvent( - dayGridWrapper.getFirstEventEl(), '2014-06-11', '2014-06-13', - ) - - waitEventResize2(calendar, resizing).then((arg) => { - expect(arg.endDelta).toEqual(createDuration({ day: 2 })) - - expect(arg.event.start).toEqualDate('2014-06-11') - expect(arg.event.end).toEqualDate('2014-06-14') - - arg.revert() - let event = calendar.getEvents()[0] - - expect(event.start).toEqualDate('2014-06-11') - expect(event.end).toBeNull() - - done() - }) - }) - }) - - describe('when resizing a timed event with an end', () => { - pushOptions({ - events: [{ - title: 'timed event event', - start: '2014-06-11T05:00:00', - end: '2014-06-11T07:00:00', - allDay: false, - }], - }) - - it('should have correct arguments with a timed delta', (done) => { - let calendar = initCalendar() - - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let resizing = timeGridWrapper.resizeEvent( - timeGridWrapper.getFirstEventEl(), '2014-06-11T07:00:00', '2014-06-11T09:30:00', - ) - - waitEventResize2(calendar, resizing).then((arg) => { - expect(arg.endDelta).toEqual(createDuration({ hour: 2, minute: 30 })) - - expect(arg.event.start).toEqualDate('2014-06-11T05:00:00Z') - expect(arg.event.end).toEqualDate('2014-06-11T09:30:00Z') - - arg.revert() - let event = calendar.getEvents()[0] - - expect(event.start).toEqualDate('2014-06-11T05:00:00Z') - expect(event.end).toEqualDate('2014-06-11T07:00:00Z') - - done() - }) - }) - - it('should have correct arguments with a timed delta via touch', (done) => { - let calendar = initCalendar({ - dragRevertDuration: 0, // so that eventDragStop happens immediately after touchend - }) - - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let resizing = timeGridWrapper.resizeEventTouch( - timeGridWrapper.getFirstEventEl(), '2014-06-11T07:00:00Z', '2014-06-11T09:30:00Z', - ) - - waitEventResize2(calendar, resizing).then((arg) => { - expect(arg.endDelta).toEqual(createDuration({ hour: 2, minute: 30 })) - - expect(arg.event.start).toEqualDate('2014-06-11T05:00:00Z') - expect(arg.event.end).toEqualDate('2014-06-11T09:30:00Z') - - arg.revert() - let event = calendar.getEvents()[0] - - expect(event.start).toEqualDate('2014-06-11T05:00:00Z') - expect(event.end).toEqualDate('2014-06-11T07:00:00Z') - - done() - }) - }) - - // TODO: test RTL - it('should have correct arguments with a timed delta when resized to a different day', (done) => { - let calendar = initCalendar() - - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let resizing = timeGridWrapper.resizeEventTouch( - timeGridWrapper.getFirstEventEl(), '2014-06-11T07:00:00Z', '2014-06-12T09:30:00Z', - ) - - waitEventResize2(calendar, resizing).then((arg) => { - expect(arg.endDelta).toEqual(createDuration({ day: 1, hour: 2, minute: 30 })) - - expect(arg.event.start).toEqualDate('2014-06-11T05:00:00Z') - expect(arg.event.end).toEqualDate('2014-06-12T09:30:00Z') - - arg.revert() - let event = calendar.getEvents()[0] - - expect(event.start).toEqualDate('2014-06-11T05:00:00Z') - expect(event.end).toEqualDate('2014-06-11T07:00:00Z') - - done() - }) - }) - - it('should have correct arguments with a timed delta, when timezone is local', (done) => { - let calendar = initCalendar({ - timeZone: 'local', - }) - - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let resizing = timeGridWrapper.resizeEventTouch( - timeGridWrapper.getFirstEventEl(), '2014-06-11T07:00:00', '2014-06-11T09:30:00', - ) - - waitEventResize2(calendar, resizing).then((arg) => { - expect(arg.endDelta).toEqual(createDuration({ hour: 2, minute: 30 })) - - expect(arg.event.start).toEqualLocalDate('2014-06-11T05:00:00') - expect(arg.event.end).toEqualLocalDate('2014-06-11T09:30:00') - - arg.revert() - let event = calendar.getEvents()[0] - - expect(event.start).toEqualLocalDate('2014-06-11T05:00:00') - expect(event.end).toEqualLocalDate('2014-06-11T07:00:00') - - done() - }) - }) - - it('should have correct arguments with a timed delta, when timezone is UTC', (done) => { - let calendar = initCalendar({ - timeZone: 'UTC', - }) - - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let resizing = timeGridWrapper.resizeEventTouch( - timeGridWrapper.getFirstEventEl(), '2014-06-11T07:00:00', '2014-06-11T09:30:00', - ) - - waitEventResize2(calendar, resizing).then((arg) => { - expect(arg.endDelta).toEqual(createDuration({ hour: 2, minute: 30 })) - - expect(arg.event.start).toEqualDate('2014-06-11T05:00:00+00:00') - expect(arg.event.end).toEqualDate('2014-06-11T09:30:00+00:00') - - arg.revert() - let event = calendar.getEvents()[0] - - expect(event.start).toEqualDate('2014-06-11T05:00:00') - expect(event.end).toEqualDate('2014-06-11T07:00:00+00:00') - - done() - }) - }) - - it('should display the correct time text while resizing', (done) => { - let calendar = initCalendar() - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let onBeforeReleaseCalled = false // don't trust ourselves :( - - timeGridWrapper.resizeEvent( - timeGridWrapper.getFirstEventEl(), - '2014-06-11T07:00:00Z', - '2014-06-11T09:30:00Z', - () => { // onBeforeRelease - let $mirrorEls = $(timeGridWrapper.getMirrorEls()) - expect($mirrorEls.length).toBe(1) - expect($mirrorEls.find('.' + CalendarWrapper.EVENT_TIME_CLASSNAME)).toHaveText('5:00 - 9:30') - onBeforeReleaseCalled = true - }, - ).then(() => { - expect(onBeforeReleaseCalled).toBe(true) - done() - }) - }) - - it('should run the temporarily rendered event through eventDidMount', (done) => { - let calendar = initCalendar({ - eventDidMount(arg) { - $(arg.el).addClass('eventDidRender') - }, - }) - - let onBeforeReleaseCalled = false // don't trust ourselves :( - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - timeGridWrapper.resizeEvent( - timeGridWrapper.getFirstEventEl(), - '2014-06-11T07:00:00Z', - '2014-06-11T09:30:00Z', - () => { // onBeforeRelease - let $mirrorEls = $(timeGridWrapper.getMirrorEls()) - expect($mirrorEls.length).toBe(1) - expect($mirrorEls).toHaveClass('eventDidRender') - onBeforeReleaseCalled = true - }, - ).then(() => { - expect(onBeforeReleaseCalled).toBe(true) - done() - }) - }) - - it('should not fire the windowResize handler', (done) => { // bug 1116 - // has to do this crap because PhantomJS was trigger false window resizes unrelated to the event resize - let isDragging = false - let calledWhileDragging = false - - let calendar = initCalendar({ - windowResizeDelay: 0, - windowResize(ev) { - if (isDragging) { - calledWhileDragging = true - } - }, - }) - - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - timeGridWrapper.resizeEvent( - timeGridWrapper.getFirstEventEl(), - '2014-06-11T07:00:00Z', - '2014-06-11T09:30:00Z', - () => { // onBeforeRelease - isDragging = false - }, - ).then(() => { - expect(calledWhileDragging).toBe(false) - done() - }) - }) - - // https://github.com/fullcalendar/fullcalendar/issues/7099 - it('should handle two consecutive resizes', (done) => { - let calendar = initCalendar() - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - - timeGridWrapper.resizeEvent( - timeGridWrapper.getFirstEventEl(), - '2014-06-11T07:00:00Z', - '2014-06-11T12:00:00Z', - ).then(() => { - let event = calendar.getEvents()[0] - expect(event.end).toEqualDate('2014-06-11T12:00:00Z') - - timeGridWrapper.resizeEvent( - timeGridWrapper.getFirstEventEl(), - '2014-06-11T12:00:00Z', - '2014-06-11T09:00:00Z', - ).then(() => { - event = calendar.getEvents()[0] - expect(event.end).toEqualDate('2014-06-11T09:00:00Z') - done() - }) - }) - }) - }) - - describe('when resizing a timed event without an end', () => { - pushOptions({ - defaultTimedEventDuration: '02:00', - events: [{ - title: 'timed event event', - start: '2014-06-11T05:00:00', - allDay: false, - }], - }) - - // copied and pasted from other test :( - it('should display the correct time text while resizing', (done) => { - let calendar = initCalendar() - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let onBeforeReleaseCalled = false // don't trust ourselves :( - - timeGridWrapper.resizeEvent( - timeGridWrapper.getFirstEventEl(), - '2014-06-11T07:00:00Z', - '2014-06-11T09:30:00Z', - () => { // onBeforeRelease - let $mirrorEls = $(timeGridWrapper.getMirrorEls()) - expect($mirrorEls.length).toBe(1) - expect($mirrorEls.find('.' + CalendarWrapper.EVENT_TIME_CLASSNAME)).toHaveText('5:00 - 9:30') - onBeforeReleaseCalled = true - }, - ).then(() => { - expect(onBeforeReleaseCalled).toBe(true) - done() - }) - }) - }) - }) - - function checkCalendarTriggers(calendar) { - calendar.on('eventResizeStart', (arg) => { - expect(arg.el instanceof Element).toBe(true) - expect(typeof arg.event).toBe('object') - expect(typeof arg.jsEvent).toBe('object') - expect(typeof arg.view).toBe('object') - }) - - calendar.on('eventResizeStop', (arg) => { - expect(arg.el instanceof Element).toBe(true) - expect(typeof arg.event).toBe('object') - expect(typeof arg.jsEvent).toBe('object') - expect(typeof arg.view).toBe('object') - }) - - calendar.on('eventResize', (arg) => { - expect(arg.el instanceof Element).toBe(true) - expect(typeof arg.event).toBe('object') - expect(typeof arg.startDelta).toBe('object') - expect(typeof arg.endDelta).toBe('object') - expect(typeof arg.revert).toBe('function') - expect(typeof arg.jsEvent).toBe('object') - expect(typeof arg.view).toBe('object') - }) - } -}) diff --git a/fullcalendar-main/tests/src/legacy/eventAllow.ts b/fullcalendar-main/tests/src/legacy/eventAllow.ts deleted file mode 100644 index 7ad6dba..0000000 --- a/fullcalendar-main/tests/src/legacy/eventAllow.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' -import { waitEventDrag } from '../lib/wrappers/interaction-util.js' - -describe('eventAllow', () => { - pushOptions({ - now: '2016-09-04', - initialView: 'timeGridWeek', - scrollTime: '00:00', - editable: true, - events: [ - { - title: 'event 1', - start: '2016-09-04T01:00', - }, - ], - }) - - it('disallows dragging when returning false', (done) => { // and given correct params - let options = { - eventAllow(dropInfo, event) { - expect(typeof dropInfo).toBe('object') - expect(dropInfo.start instanceof Date).toBe(true) - expect(dropInfo.end instanceof Date).toBe(true) - expect(typeof event).toBe('object') - expect(event.title).toBe('event 1') - return false - }, - } - spyOn(options, 'eventAllow').and.callThrough() - - let calendar = initCalendar(options) - let calendarWrapper = new CalendarWrapper(calendar) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - - let dragging = timeGridWrapper.dragEventToDate( - calendarWrapper.getFirstEventEl(), - '2016-09-04T03:00:00', - ) - - waitEventDrag(calendar, dragging).then((modifiedEvent) => { - expect(modifiedEvent).toBeFalsy() // drop failure? - expect(options.eventAllow).toHaveBeenCalled() - done() - }) - }) - - it('allows dragging when returning true', (done) => { - let options = { - eventAllow() { - return true - }, - } - spyOn(options, 'eventAllow').and.callThrough() - - let calendar = initCalendar(options) - let calendarWrapper = new CalendarWrapper(calendar) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - - let dragging = timeGridWrapper.dragEventToDate( - calendarWrapper.getFirstEventEl(), - '2016-09-04T03:00:00Z', - ) - - waitEventDrag(calendar, dragging).then((modifiedEvent) => { - expect(modifiedEvent.start).toEqualDate('2016-09-04T03:00:00Z') - expect(options.eventAllow).toHaveBeenCalled() - done() - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/eventDestroy.ts b/fullcalendar-main/tests/src/legacy/eventDestroy.ts deleted file mode 100644 index 5201d0e..0000000 --- a/fullcalendar-main/tests/src/legacy/eventDestroy.ts +++ /dev/null @@ -1,57 +0,0 @@ -describe('eventWillUnmount', () => { // TODO: rename file - pushOptions({ - initialDate: '2014-08-01', - }) - - function testSingleEvent(singleEventData, done) { - let callCnt = 0 - - expect(singleEventData.id).toBeTruthy() - - let calendar = initCalendar({ - events: [singleEventData], - eventWillUnmount(arg) { - callCnt += 1 - if (callCnt === 1) { // only care about the first call. gets called again when calendar is destroyed - expect(arg.event.id).toBe(singleEventData.id) - done() - } - }, - }) - - calendar.getEventById(singleEventData.id).remove() - } - - describe('when in month view', () => { // for issue 2017 - pushOptions({ - initialView: 'dayGridMonth', - }) - - it('gets called with removeEvents method', (done) => { - setTimeout(() => { // needs this or else doesn't work when run all tests together - testSingleEvent({ - id: '1', - title: 'event1', - date: '2014-08-02', - }, done) - }, 0) - }) - }) - - describe('when in week view', () => { // for issue 2017 - pushOptions({ - initialView: 'timeGridWeek', - scrollTime: '00:00:00', - }) - - it('gets called with removeEvents method', (done) => { - setTimeout(() => { // needs this or else doesn't work when run all tests together - testSingleEvent({ - id: '1', - title: 'event1', - date: '2014-08-02T02:00:00', - }, done) - }, 0) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/eventMouseEnter.ts b/fullcalendar-main/tests/src/legacy/eventMouseEnter.ts deleted file mode 100644 index 75e78fc..0000000 --- a/fullcalendar-main/tests/src/legacy/eventMouseEnter.ts +++ /dev/null @@ -1,67 +0,0 @@ -describe('eventMouseEnter', () => { - pushOptions({ - initialDate: '2014-08-01', - scrollTime: '00:00:00', - }); - - ['dayGridMonth', 'timeGridWeek'].forEach((viewName) => { - describe('for ' + viewName + ' view', () => { - pushOptions({ - initialView: viewName, - }) - - it('doesn\'t trigger a eventMouseLeave when updating an event', (done) => { - let options = { - events: [{ - title: 'event', - start: '2014-08-02T01:00:00', - className: 'event', - }], - eventMouseEnter(arg) { - expect(typeof arg.event).toBe('object') - expect(typeof arg.jsEvent).toBe('object') - arg.event.setProp('title', 'YO') - }, - eventMouseLeave(arg) {}, - } - - spyOn(options, 'eventMouseEnter') - spyOn(options, 'eventMouseLeave') - - initCalendar(options) - $('.event').simulate('mouseover') - - setTimeout(() => { - expect(options.eventMouseEnter).toHaveBeenCalled() - expect(options.eventMouseLeave).not.toHaveBeenCalled() - done() - }, 100) - }) - }) - }) - - it('gets fired for background events', (done) => { - let mouseoverCalled = false - - initCalendar({ - events: [{ - start: '2014-08-02', - display: 'background', - className: 'event', - }], - eventMouseEnter(arg) { - expect(arg.event.display).toBe('background') - mouseoverCalled = true - }, - eventMouseLeave() { - expect(mouseoverCalled).toBe(true) - done() - }, - }) - - $('.event') - .simulate('mouseover') - .simulate('mouseout') - .simulate('mouseleave') // helps out listenBySelector - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/eventRender.ts b/fullcalendar-main/tests/src/legacy/eventRender.ts deleted file mode 100644 index c16ccc1..0000000 --- a/fullcalendar-main/tests/src/legacy/eventRender.ts +++ /dev/null @@ -1,109 +0,0 @@ -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' - -describe('eventDidMount+eventContent', () => { // TODO: rename file - pushOptions({ - initialDate: '2014-11-12', - scrollTime: '00:00:00', - events: [{ - title: 'my event', - start: '2014-11-12T09:00:00', - }], - }) - - describeOptions('initialView', { - 'when in day-grid': 'dayGridMonth', - 'when in time-grid': 'timeGridWeek', - }, () => { - describe('with foreground event', () => { - it('receives correct args AND can modify the element', () => { - let options = { - eventContent(arg) { - expect(typeof arg.event).toBe('object') - expect(arg.event.display).toBe('auto') - expect(arg.event.start).toBeDefined() - expect(typeof arg.view).toBe('object') - expect(arg.isMirror).toBe(false) - }, - eventDidMount(arg) { - $(arg.el).css('font-size', '20px') - }, - } - spyOn(options, 'eventContent').and.callThrough() - spyOn(options, 'eventDidMount').and.callThrough() - - let calendar = initCalendar(options) - let calendarWrapper = new CalendarWrapper(calendar) - let eventEl = calendarWrapper.getFirstEventEl() - - expect(options.eventContent).toHaveBeenCalled() - expect(options.eventDidMount).toHaveBeenCalled() - expect($(eventEl).css('font-size')).toBe('20px') - }) - }) - }) - - describe('when in month view', () => { - pushOptions({ - initialView: 'dayGridMonth', - events: [{ - title: 'my event', - start: '2014-11-12', - }], - }) - - describe('with a foreground event', () => { - it('can return a new element', () => { - let options = { - eventContent() { - let domNodes = $('
sup g
').get() - return { domNodes } - }, - } - spyOn(options, 'eventContent').and.callThrough() - - let calendar = initCalendar(options) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let eventEl = dayGridWrapper.getFirstEventEl() - - expect(eventEl.querySelector('.sup')).toBeTruthy() - expect(options.eventContent).toHaveBeenCalled() - }) - }) - - describe('with an all-day background event', () => { - pushOptions({ - events: [{ - title: 'my event', - start: '2014-11-12', - display: 'background', - }], - }) - - it('receives correct args AND can modify the element', () => { - let options = { - eventContent(arg) { - expect(typeof arg.event).toBe('object') - expect(arg.event.display).toBe('background') - expect(arg.event.start).toBeDefined() - expect(typeof arg.view).toBe('object') - }, - eventDidMount(arg) { - $(arg.el).css('font-size', '20px') - }, - } - spyOn(options, 'eventContent').and.callThrough() - spyOn(options, 'eventDidMount').and.callThrough() - - let calendar = initCalendar(options) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let bgEventEls = dayGridWrapper.getBgEventEls() - - expect(bgEventEls.length).toBe(1) - expect(options.eventContent).toHaveBeenCalled() - expect(options.eventDidMount).toHaveBeenCalled() - expect($(bgEventEls).css('font-size')).toBe('20px') - }) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/eventTimeFormat.ts b/fullcalendar-main/tests/src/legacy/eventTimeFormat.ts deleted file mode 100644 index 40b27dd..0000000 --- a/fullcalendar-main/tests/src/legacy/eventTimeFormat.ts +++ /dev/null @@ -1,98 +0,0 @@ -import enGbLocale from '@fullcalendar/core/locales/en-gb' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('eventTimeFormat', () => { - pushOptions({ - initialDate: '2014-06-04', - events: [{ - title: 'my event', - start: '2014-06-04T15:00:00', - end: '2014-06-04T17:00:00', - }], - }) - - describe('when in month view', () => { - pushOptions({ - initialView: 'dayGridMonth', - }) - - it('renders correctly when default', () => { - let calendar = initCalendar() - expectEventTimeText(calendar, '3p') - }) - - it('renders correctly when default and the locale is customized', () => { - let calendar = initCalendar({ - locale: enGbLocale, - }) - expectEventTimeText(calendar, '15') - }) - - it('renders correctly when customized', () => { - let calendar = initCalendar({ - eventTimeFormat: { hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false }, - }) - expectEventTimeText(calendar, '15:00:00') - }) - }) - - describe('when in week view', () => { - pushOptions({ - initialView: 'timeGridWeek', - }) - - it('renders correctly when default', () => { - let calendar = initCalendar() - expectEventTimeText(calendar, '3:00 - 5:00') - }) - - it('renders correctly when default and the locale is customized', () => { - let calendar = initCalendar({ - locale: enGbLocale, - }) - expectEventTimeText(calendar, '15:00 - 17:00') - }) - - it('renders correctly when customized', () => { - let calendar = initCalendar({ - eventTimeFormat: { hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false }, - }) - expectEventTimeText(calendar, '15:00:00 - 17:00:00') - }) - }) - - describe('when in multi-day custom dayGrid view', () => { - pushOptions({ - views: { - dayGridTwoDay: { - type: 'dayGrid', - duration: { days: 2 }, - }, - }, - initialView: 'dayGridTwoDay', - }) - - it('defaults to no end time', () => { - let calendar = initCalendar() - expectEventTimeText(calendar, '3p') - }) - }) - - describe('when in dayGridDay view', () => { - pushOptions({ - initialView: 'dayGridDay', - }) - - it('defaults to showing the end time', () => { - let calendar = initCalendar() - expectEventTimeText(calendar, '3p - 5p') - }) - }) - - function expectEventTimeText(calendar, expected) { - let calendarWrapper = new CalendarWrapper(calendar) - let firstEventEl = calendarWrapper.getFirstEventEl() - let eventInfo = calendarWrapper.getEventElInfo(firstEventEl) - expect(eventInfo.timeText).toBe(expected) - } -}) diff --git a/fullcalendar-main/tests/src/legacy/events-array.ts b/fullcalendar-main/tests/src/legacy/events-array.ts deleted file mode 100644 index 7636106..0000000 --- a/fullcalendar-main/tests/src/legacy/events-array.ts +++ /dev/null @@ -1,55 +0,0 @@ -describe('events as an array', () => { - pushOptions({ - initialView: 'dayGridMonth', - initialDate: '2014-05-01', - }) - - function getEventArray() { - return [ - { - title: 'my event', - start: '2014-05-21', - }, - ] - } - - it('accepts an event using dayGrid form', (done) => { - initCalendar({ - events: getEventArray(), - eventDidMount(arg) { - expect(arg.event.title).toEqual('my event') - done() - }, - }) - }) - - it('accepts an event using extended form', (done) => { - initCalendar({ - eventSources: [ - { - classNames: 'customeventclass', - events: getEventArray(), - }, - ], - eventDidMount(arg) { - expect(arg.event.title).toEqual('my event') - expect(arg.el).toHaveClass('customeventclass') - done() - }, - }) - }) - - it('doesn\'t mutate the original array', (done) => { - let eventArray = getEventArray() - let origArray = eventArray - let origEvent = eventArray[0] - initCalendar({ - events: eventArray, - eventDidMount() { - expect(origArray).toEqual(eventArray) - expect(origEvent).toEqual(eventArray[0]) - done() - }, - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/events-function.ts b/fullcalendar-main/tests/src/legacy/events-function.ts deleted file mode 100644 index 5e31794..0000000 --- a/fullcalendar-main/tests/src/legacy/events-function.ts +++ /dev/null @@ -1,134 +0,0 @@ -describe('events as a function', () => { - pushOptions({ - initialView: 'dayGridMonth', - initialDate: '2014-05-01', - }) - - function testEventFunctionParams(arg, callback) { - expect(arg.start instanceof Date).toEqual(true) - expect(arg.end instanceof Date).toEqual(true) - expect(typeof callback).toEqual('function') - } - - it('requests correctly when local timezone', (done) => { - initCalendar({ - timeZone: 'local', - events(arg, callback) { - testEventFunctionParams(arg, callback) - expect(arg.timeZone).toEqual('local') - expect(arg.start).toEqualLocalDate('2014-04-27T00:00:00') - expect(arg.startStr).toMatch(/^2014-04-27T00:00:00[-+]/) - expect(arg.end).toEqualLocalDate('2014-06-08T00:00:00') - expect(arg.endStr).toMatch(/^2014-06-08T00:00:00[-+]/) - callback([]) - setTimeout(done) // :( - }, - }) - }) - - it('requests correctly when UTC timezone', (done) => { - initCalendar({ - timeZone: 'UTC', - events(arg, callback) { - testEventFunctionParams(arg, callback) - expect(arg.timeZone).toEqual('UTC') - expect(arg.start).toEqualDate('2014-04-27T00:00:00Z') - expect(arg.startStr).toEqual('2014-04-27T00:00:00Z') - expect(arg.end).toEqualDate('2014-06-08T00:00:00Z') - expect(arg.endStr).toEqual('2014-06-08T00:00:00Z') - callback([]) - setTimeout(done) // :( - }, - }) - }) - - it('requests correctly when custom timezone', (done) => { - initCalendar({ - timeZone: 'America/Chicago', - events(arg, callback) { - testEventFunctionParams(arg, callback) - expect(arg.timeZone).toEqual('America/Chicago') - expect(arg.start).toEqualDate('2014-04-27T00:00:00Z') - expect(arg.startStr).toEqual('2014-04-27T00:00:00') // no Z - expect(arg.end).toEqualDate('2014-06-08T00:00:00Z') - expect(arg.endStr).toEqual('2014-06-08T00:00:00') // no Z - callback([]) - setTimeout(done) // :( - }, - }) - }) - - it('requests correctly when timezone changed dynamically', (done) => { - let callCnt = 0 - let options = { - timeZone: 'America/Chicago', - events(arg, callback) { - testEventFunctionParams(arg, callback) - callCnt += 1 - if (callCnt === 1) { - expect(arg.timeZone).toEqual('America/Chicago') - expect(arg.start).toEqualDate('2014-04-27') - expect(arg.end).toEqualDate('2014-06-08') - setTimeout(() => { - currentCalendar.setOption('timeZone', 'UTC') - }, 0) - } else if (callCnt === 2) { - expect(arg.timeZone).toEqual('UTC') - expect(arg.start).toEqualDate('2014-04-27') - expect(arg.end).toEqualDate('2014-06-08') - setTimeout(done) // :( - } - }, - } - - initCalendar(options) - }) - - it('requests correctly with event source extended form', (done) => { - let eventSource = { - className: 'customeventclass', - events(arg, callback) { - testEventFunctionParams(arg, callback) - expect(arg.timeZone).toEqual('UTC') - expect(arg.start).toEqualDate('2014-04-27') - expect(arg.end).toEqualDate('2014-06-08') - callback([ - { - title: 'event1', - start: '2014-05-10', - }, - ]) - }, - } - spyOn(eventSource, 'events').and.callThrough() - - initCalendar({ - timeZone: 'UTC', - eventSources: [eventSource], - eventDidMount(arg) { - expect(eventSource.events.calls.count()).toEqual(1) - expect(arg.el).toHaveClass('customeventclass') - setTimeout(done) // :( - }, - }) - }) - - it('can return a promise-like object', (done) => { - let calendar = initCalendar({ - events() { - let deferred = $.Deferred() // we want tests to run in IE11, which doesn't have native promises - setTimeout(() => { - deferred.resolve([ - { start: '2018-09-04' }, - ]) - }, 100) - return deferred.promise() - }, - }) - - setTimeout(() => { - expect(calendar.getEvents().length).toBe(1) - setTimeout(done) // :( - }, 101) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/events-gcal.ts b/fullcalendar-main/tests/src/legacy/events-gcal.ts deleted file mode 100644 index 7df23e1..0000000 --- a/fullcalendar-main/tests/src/legacy/events-gcal.ts +++ /dev/null @@ -1,262 +0,0 @@ -import googleCalendarPlugin from '@fullcalendar/google-calendar' -import dayGridPlugin from '@fullcalendar/daygrid' -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -// In our CI setup, requests to the google-calendar api were failing for some reason -// (requests to other services were working however) -const noGCal = (window as any).__karma__.config.cliArgs.includes('--no-gcal') -if (noGCal) { - console.log('skipping google-calendar') // eslint-disable-line no-console -} - -// eslint-disable-next-line -noGCal || -describe('Google Calendar plugin', () => { - const API_KEY = 'AIzaSyDcnW6WejpTOCffshGDDb4neIrXVUA1EAE' - const HOLIDAY_CALENDAR_ID = 'en.usa#holiday@group.v.calendar.google.com' - - // Google sometimes stops returning old events. Will need to update this sometimes. - const DEFAULT_MONTH = '2023-05' - const NUM_EVENTS = 5 // number of holidays - - pushOptions({ - plugins: [googleCalendarPlugin, dayGridPlugin], - initialView: 'dayGridMonth', - initialDate: DEFAULT_MONTH + '-01', - }) - - it('request/receives correctly when local timezone', (done) => { - let calendar = initCalendar({ - googleCalendarApiKey: API_KEY, - events: { googleCalendarId: HOLIDAY_CALENDAR_ID }, - timeZone: 'local', - }) - - afterEventsLoaded(calendar, () => { - let events = calendar.getEvents() - let i - - expect(events.length).toBe(NUM_EVENTS) - for (i = 0; i < events.length; i += 1) { - expect(events[i].url).not.toMatch('ctz=') - } - - done() - }) - }) - - it('request/receives correctly when UTC timezone', (done) => { - let calendar = initCalendar({ - googleCalendarApiKey: API_KEY, - events: { googleCalendarId: HOLIDAY_CALENDAR_ID }, - timeZone: 'UTC', - }) - - afterEventsLoaded(calendar, () => { - let events = calendar.getEvents() - let i - - expect(events.length).toBe(NUM_EVENTS) - for (i = 0; i < events.length; i += 1) { - expect(events[i].url).toMatch('ctz=UTC') - } - - done() - }) - }) - - it('request/receives correctly when named timezone, defaults to not editable', (done) => { - let calendar = initCalendar({ - googleCalendarApiKey: API_KEY, - events: { googleCalendarId: HOLIDAY_CALENDAR_ID }, - timeZone: 'America/New_York', - }) - - afterEventsLoaded(calendar, () => { - let events = calendar.getEvents() - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let eventEls = dayGridWrapper.getEventEls() - let i - - expect(events.length).toBe(NUM_EVENTS) - for (i = 0; i < events.length; i += 1) { - expect(events[i].url).toMatch('ctz=America/New_York') - } - - expect(eventEls.length).toBe(NUM_EVENTS) - expect($('.' + CalendarWrapper.EVENT_RESIZER_CLASSNAME, eventEls[0]).length).toBe(0) // not editable - - done() - }) - }) - - it('allows editable to explicitly be set to true', (done) => { - let calendar = initCalendar({ - googleCalendarApiKey: API_KEY, - events: { - googleCalendarId: HOLIDAY_CALENDAR_ID, - editable: true, - }, - }) - - afterEventsLoaded(calendar, () => { - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let eventEls = dayGridWrapper.getEventEls() - - expect(eventEls.length).toBe(NUM_EVENTS) - - for (let eventEl of eventEls) { - expect($('.' + CalendarWrapper.EVENT_RESIZER_CLASSNAME, eventEl).length).toBeGreaterThan(0) // editable! - } - - done() - }) - }) - - it('fetches events correctly when API key is in the event source', (done) => { - let calendar = initCalendar({ - events: { - googleCalendarId: HOLIDAY_CALENDAR_ID, - googleCalendarApiKey: API_KEY, - }, - }) - - afterEventsLoaded(calendar, () => { - let events = calendar.getEvents() - expect(events.length).toBe(NUM_EVENTS) // 5 holidays in November 2016 (and end of Oct) - done() - }) - }) - - describe('when not given an API key', () => { - it('calls error handlers, raises warning, and receives no events', (done) => { - let options = { - events: { - failure(err) { - expect(typeof err).toBe('object') - }, - googleCalendarId: HOLIDAY_CALENDAR_ID, - }, - eventSourceFailure(err) { - expect(typeof err).toBe('object') - - setTimeout(() => { // wait for potential render - let events = this.getEvents() - expect(events.length).toBe(0) - expect(options.events.failure).toHaveBeenCalled() - done() - }, 0) - }, - } - - spyOn(options.events, 'failure').and.callThrough() - initCalendar(options) - }) - }) - - describe('when given a bad API key', () => { - it('calls error handlers, raises warning, and receives no event', (done) => { - let options = { - googleCalendarApiKey: 'asdfasdfasdf', - events: { - failure(err) { - expect(typeof err).toBe('object') - }, - googleCalendarId: HOLIDAY_CALENDAR_ID, - }, - eventSourceFailure(err) { - expect(typeof err).toBe('object') - - setTimeout(() => { // wait for potential render - let events = this.getEvents() - expect(events.length).toBe(0) - expect(options.events.failure).toHaveBeenCalled() - done() - }, 0) - }, - } - - spyOn(options.events, 'failure').and.callThrough() - initCalendar(options) - }) - }) - - it('calls loading with true then false', (done) => { - let cmds = [] - - initCalendar({ - googleCalendarApiKey: API_KEY, - events: { googleCalendarId: HOLIDAY_CALENDAR_ID }, - loading(bool) { - cmds.push(bool) - - if (cmds.length === 1) { - expect(cmds).toEqual([true]) - } else if (cmds.length === 2) { - expect(cmds).toEqual([true, false]) - done() - } - }, - }) - }) - - describe('EventSource::remove', () => { - it('works when specifying only the Google Calendar ID', (done) => { - let called = false - let calendar = initCalendar({ - googleCalendarApiKey: API_KEY, - eventSources: [{ googleCalendarId: HOLIDAY_CALENDAR_ID }], - }) - - afterEventsLoaded(calendar, () => { - let events - - if (called) { return } // only the first time - called = true - - events = calendar.getEvents() - expect(events.length).toBe(NUM_EVENTS) // 5 holidays in November 2016 (and end of Oct) - - setTimeout(() => { - calendar.getEventSources()[0].remove() - events = calendar.getEvents() - expect(events.length).toBe(0) - done() - }, 0) - }) - }) - - it('works when specifying a raw Google Calendar source object', (done) => { - let googleSource = { googleCalendarId: HOLIDAY_CALENDAR_ID } - let called = false - let calendar = initCalendar({ - googleCalendarApiKey: API_KEY, - eventSources: [googleSource], - }) - - afterEventsLoaded(calendar, () => { - let events - - if (called) { return } // only the first time - called = true - - events = calendar.getEvents() - expect(events.length).toBe(NUM_EVENTS) // 5 holidays in November 2016 (and end of Oct) - - setTimeout(() => { - calendar.getEventSources()[0].remove() - events = calendar.getEvents() - expect(events.length).toBe(0) - done() - }, 0) - }) - }) - }) - - function afterEventsLoaded(calendar, callback: () => void) { - calendar.on('eventsSet', () => { - setTimeout(callback) // because nothing is rendered yet when eventSourceSuccess fires - }) - } -}) diff --git a/fullcalendar-main/tests/src/legacy/events-json-feed.ts b/fullcalendar-main/tests/src/legacy/events-json-feed.ts deleted file mode 100644 index 6cbb4ab..0000000 --- a/fullcalendar-main/tests/src/legacy/events-json-feed.ts +++ /dev/null @@ -1,244 +0,0 @@ -import fetchMock from 'fetch-mock' -import { JsonRequestError } from '@fullcalendar/core' -import { formatIsoTimeZoneOffset } from '../lib/datelib-utils.js' - -describe('events as a json feed', () => { - pushOptions({ - initialDate: '2014-05-01', - initialView: 'dayGridMonth', - }) - - afterEach(() => { - fetchMock.restore() - }) - - it('requests correctly when local timezone', () => { - const START = '2014-04-27T00:00:00' - const END = '2014-06-08T00:00:00' - - const givenUrl = window.location.href + '/my-feed.php' - fetchMock.get(/my-feed\.php/, { body: [] }) - - initCalendar({ - events: givenUrl, - timeZone: 'local', - }) - - const [requestUrl] = fetchMock.lastCall() - const requestParams = new URL(requestUrl).searchParams - expect(requestParams.get('start')).toBe(START + formatIsoTimeZoneOffset(new Date(START))) - expect(requestParams.get('end')).toBe(END + formatIsoTimeZoneOffset(new Date(END))) - }) - - it('requests correctly when UTC timezone', () => { - const givenUrl = window.location.href + '/my-feed.php' - fetchMock.get(/my-feed\.php/, { body: [] }) - - initCalendar({ - events: givenUrl, - timeZone: 'UTC', - }) - - const [requestUrl] = fetchMock.lastCall() - const requestParams = new URL(requestUrl).searchParams - expect(requestParams.get('start')).toBe('2014-04-27T00:00:00Z') - expect(requestParams.get('end')).toBe('2014-06-08T00:00:00Z') - expect(requestParams.get('timeZone')).toBe('UTC') - }) - - it('requests correctly when named timezone', () => { - const givenUrl = window.location.href + '/my-feed.php' - fetchMock.get(/my-feed\.php/, { body: [] }) - - initCalendar({ - events: givenUrl, - timeZone: 'America/Chicago', - }) - - const [requestUrl] = fetchMock.lastCall() - const requestParams = new URL(requestUrl).searchParams - expect(requestParams.get('start')).toBe('2014-04-27T00:00:00') - expect(requestParams.get('end')).toBe('2014-06-08T00:00:00') - expect(requestParams.get('timeZone')).toBe('America/Chicago') - }) - - // https://github.com/fullcalendar/fullcalendar/issues/5485 - it('processes new events under updated time zone', (done) => { - const givenUrl = window.location.href + '/my-feed.php' - fetchMock.get(/my-feed\.php/, (requestUrl) => { - const requestParams = new URL(requestUrl).searchParams - let reqTimeZone = requestParams.get('timeZone') - return { - body: [ - reqTimeZone === 'America/Chicago' - ? { start: '2014-06-08T01:00:00' } - : { start: '2014-06-08T03:00:00' }, - ], - } - }) - - let calendar = initCalendar({ - events: givenUrl, - timeZone: 'America/Chicago', - }) - - setTimeout(() => { - let eventStartStr = calendar.getEvents()[0].startStr - expect(eventStartStr).toBe('2014-06-08T01:00:00') - - calendar.setOption('timeZone', 'America/New_York') - setTimeout(() => { - eventStartStr = calendar.getEvents()[0].startStr - expect(eventStartStr).toBe('2014-06-08T03:00:00') - done() - }, 100) - }, 100) - }) - - it('requests correctly with event source extended form', (done) => { - const givenUrl = window.location.href + '/my-feed.php' - fetchMock.get(/my-feed\.php/, { - body: [ - { - title: 'my event', - start: '2014-05-21', - }, - ], - }) - - initCalendar({ - eventSources: [{ - url: givenUrl, - classNames: 'customeventclass', - }], - timeZone: 'America/Chicago', - eventDidMount(arg) { - expect(arg.el).toHaveClass('customeventclass') - done() - }, - }) - - const [requestUrl] = fetchMock.lastCall() - const requestParams = new URL(requestUrl).searchParams - expect(requestParams.get('start')).toBe('2014-04-27T00:00:00') - expect(requestParams.get('end')).toBe('2014-06-08T00:00:00') - expect(requestParams.get('timeZone')).toBe('America/Chicago') - }) - - it('requests POST correctly', (done) => { - const givenUrl = window.location.href + '/my-feed.php' - fetchMock.post(/my-feed\.php/, (url, options) => { - const paramStrGet = new URL(url).searchParams.toString() - const paramStrPost = options.body.toString() - expect(paramStrGet).toBe('') - expect(paramStrPost).toBe('start=2014-04-27T00%3A00%3A00Z&end=2014-06-08T00%3A00%3A00Z&timeZone=UTC') - done() - return { body: [] } - }) - - initCalendar({ - events: { - url: givenUrl, - method: 'POST', - }, - timeZone: 'UTC', - }) - }) - - it('accepts a extraParams object', () => { - const givenUrl = window.location.href + '/my-feed.php' - fetchMock.get(/my-feed\.php/, { body: [] }) - - initCalendar({ - eventSources: [{ - url: givenUrl, - extraParams: { - customParam: 'yes', - }, - }], - }) - - const [requestUrl] = fetchMock.lastCall() - const requestParams = new URL(requestUrl).searchParams - expect(requestParams.get('start')).toBe('2014-04-27T00:00:00Z') - expect(requestParams.get('end')).toBe('2014-06-08T00:00:00Z') - expect(requestParams.get('timeZone')).toBe('UTC') - expect(requestParams.get('customParam')).toBe('yes') - }) - - it('accepts a dynamic extraParams function', () => { - const givenUrl = window.location.href + '/my-feed.php' - fetchMock.get(/my-feed\.php/, { body: [] }) - - initCalendar({ - eventSources: [{ - url: givenUrl, - extraParams() { - return { - customParam: 'heckyeah', - } - }, - }], - }) - - const [requestUrl] = fetchMock.lastCall() - const requestParams = new URL(requestUrl).searchParams - expect(requestParams.get('start')).toBe('2014-04-27T00:00:00Z') - expect(requestParams.get('end')).toBe('2014-06-08T00:00:00Z') - expect(requestParams.get('timeZone')).toBe('UTC') - expect(requestParams.get('customParam')).toBe('heckyeah') - }) - - it('calls loading callback', (done) => { - const loadingCallArgs = [] - - const givenUrl = window.location.href + '/my-feed.php' - fetchMock.get(/my-feed\.php/, { body: [] }) - - initCalendar({ - events: { url: givenUrl }, - loading(bool) { - loadingCallArgs.push(bool) - }, - }) - - setTimeout(() => { - expect(loadingCallArgs).toEqual([true, false]) - done() - }, 100) - }) - - it('has and Event Source object with certain props', () => { - const givenUrl = window.location.href + '/my-feed.php' - fetchMock.get(/my-feed\.php/, { body: [] }) - - initCalendar({ - events: { url: givenUrl }, - }) - expect(currentCalendar.getEventSources()[0].url).toBe(givenUrl) - }) - - it('throws JsonRequestError if mangled JSON', (done) => { - const givenUrl = window.location.href + '/my-feed.php' - fetchMock.get(/my-feed\.php/, { body: '[{title:' }) - - let eventSourceFailureCalled = false - - initCalendar({ - events: { url: givenUrl }, - eventSourceFailure(error) { - let isJsonRequestFailure = error instanceof JsonRequestError - if (isJsonRequestFailure) { - expect(typeof error.response.url).toBe('string') // NOTE: fetchMock mangles exact url - } - expect(isJsonRequestFailure).toBe(true) - eventSourceFailureCalled = true - }, - }) - - setTimeout(() => { - expect(eventSourceFailureCalled).toBe(true) - done() - }, 100) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/external-dnd-advanced.ts b/fullcalendar-main/tests/src/legacy/external-dnd-advanced.ts deleted file mode 100644 index 2cd924b..0000000 --- a/fullcalendar-main/tests/src/legacy/external-dnd-advanced.ts +++ /dev/null @@ -1,386 +0,0 @@ -import { ThirdPartyDraggable } from '@fullcalendar/interaction' -import { testEventDrag } from '../lib/dnd-resize-utils.js' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -// TODO: Use the built-in Draggable for some of these tests - -describe('advanced external dnd', () => { - let dragEl - let thirdPartyDraggable - - beforeEach(() => { - dragEl = $('
yo
') - .css({ - width: 200, - background: 'blue', - color: 'white', - }) - .appendTo('body') - .draggable() - - thirdPartyDraggable = new ThirdPartyDraggable({ - itemSelector: '.drag', - }) - }) - - afterEach(() => { - thirdPartyDraggable.destroy() - dragEl.remove() - dragEl = null - }) - - pushOptions({ - initialDate: '2014-11-13', - scrollTime: '00:00:00', - droppable: true, - }) - - describe('in timeGrid slots', () => { - pushOptions({ - initialView: 'timeGridWeek', - }) - - describe('when no element event data', () => { - describe('when given duration through defaultTimedEventDuration', () => { - pushOptions({ - defaultTimedEventDuration: '2:30', - }) - defineTests() - }) - - describe('when given duration through data attribute', () => { - beforeEach(() => { - dragEl.attr('data-event', JSON.stringify({ - duration: '2:30', - create: false, // only an external element, won't create or render as an event - })) - }) - defineTests() - }) - - function defineTests() { - it('fires correctly', (done) => { - testExternalElDrag({}, '2014-11-13T03:00:00Z', '2014-11-13T03:00:00Z', true, done) - }) - - it('is not affected by eventOverlap:false', (done) => { - let options = { - eventOverlap: false, - events: [{ - start: '2014-11-13T01:00:00', - end: '2014-11-13T05:00:00', - }], - } - testExternalElDrag(options, '2014-11-13T03:00:00Z', '2014-11-13T03:00:00Z', true, done) - }) - - it('is not affected by an event object\'s overlap:false', (done) => { - let options = { - events: [{ - start: '2014-11-13T01:00:00', - end: '2014-11-13T05:00:00', - overlap: false, - }], - } - testExternalElDrag(options, '2014-11-13T03:00:00Z', '2014-11-13T03:00:00Z', true, done) - }) - - it('is not affected by eventConstraint', (done) => { - let options = { - eventConstraint: { - start: '03:00', - end: '10:00', - }, - } - testExternalElDrag(options, '2014-11-13T02:00:00Z', '2014-11-13T02:00:00Z', true, done) - }) - - describe('with selectOverlap:false', () => { - pushOptions({ - selectOverlap: false, - events: [{ - start: '2014-11-13T04:00:00', - end: '2014-11-13T08:00:00', - }], - }) - - it('is not allowed to overlap an event', (done) => { - testExternalElDrag({}, '2014-11-13T02:00:00Z', '2014-11-13T02:00:00Z', false, done) - }) - }) - - describe('with a selectConstraint', () => { - pushOptions({ - selectConstraint: { - startTime: '04:00', - endTime: '08:00', - }, - }) - - it('can be dropped within', (done) => { - testExternalElDrag({}, '2014-11-13T05:30:00Z', '2014-11-13T05:30:00Z', true, done) - }) - - it('cannot be dropped when not fully contained', (done) => { - testExternalElDrag({}, '2014-11-13T06:00:00Z', '2014-11-13T06:00:00Z', false, done) - }) - }) - } - }) - - describe('when event data is given', () => { - it('fires correctly', (done) => { - dragEl.attr('data-event', JSON.stringify({ - title: 'hey', - })) - testExternalEventDrag({}, '2014-11-13T02:00:00Z', '2014-11-13T02:00:00Z', true, done) - }) - - describe('when given a start time', () => { - describe('through the event object\'s time property', () => { - beforeEach(() => { - dragEl.attr('data-event', JSON.stringify({ - startTime: '05:00', - })) - }) - - it('voids the given time when dropped on a timed slot', (done) => { - testExternalEventDrag({}, '2014-11-13T02:00:00Z', '2014-11-13T02:00:00Z', true, done) - // will test the resulting event object's start - }) - }) - }) - - describe('when given a duration', () => { - describe('through the event object\'s duration property', () => { - beforeEach(() => { - dragEl.attr('data-event', JSON.stringify({ - duration: '05:00', - })) - }) - - it('accepts the given duration when dropped on a timed slot', (done) => { - testExternalEventDrag({}, '2014-11-13T02:00:00Z', '2014-11-13T02:00:00Z', true, () => { - let event = currentCalendar.getEvents()[0] - expect(event.start).toEqualDate('2014-11-13T02:00:00Z') - expect(event.end).toEqualDate('2014-11-13T07:00:00Z') - done() - }) - }) - }) - }) - - describe('when given stick:true', () => { - describe('through the event object', () => { - beforeEach(() => { - dragEl.attr('data-event', JSON.stringify({ - stick: true, - })) - }) - - it('keeps the event when navigating away and back', (done) => { - testExternalEventDrag({}, '2014-11-13T02:00:00Z', '2014-11-13T02:00:00Z', true, () => { - setTimeout(() => { // make sure to escape handlers - let calendarWrapper = new CalendarWrapper(currentCalendar) - expect(calendarWrapper.getEventEls().length).toBe(1) - currentCalendar.next() - expect(calendarWrapper.getEventEls().length).toBe(0) - currentCalendar.prev() - expect(calendarWrapper.getEventEls().length).toBe(1) - done() - }, 0) - }) - }) - }) - }) - - describe('when an overlap is specified', () => { - describe('via eventOverlap', () => { - pushOptions({ - eventOverlap: false, - events: [{ - start: '2014-11-13T05:00:00', - end: '2014-11-13T08:00:00', - }], - }) - - beforeEach(() => { - dragEl.attr('data-event', '{}') - }) - - defineTests() - }) - - describe('via an overlap on this event', () => { - pushOptions({ - events: [{ - start: '2014-11-13T05:00:00', - end: '2014-11-13T08:00:00', - }], - }) - - beforeEach(() => { - dragEl.attr('data-event', JSON.stringify({ - overlap: false, - })) - }) - - defineTests() - }) - - describe('via an overlap on the other event', () => { - pushOptions({ - events: [{ - start: '2014-11-13T05:00:00', - end: '2014-11-13T08:00:00', - overlap: false, - }], - }) - - beforeEach(() => { - dragEl.attr('data-event', '{}') - }) - - defineTests() - }) - - function defineTests() { - it('allows a drop when not colliding with the other event', (done) => { - testExternalEventDrag({}, '2014-11-13T08:00:00Z', '2014-11-13T08:00:00Z', true, done) - }) - it('prevents a drop when colliding with the other event', (done) => { - testExternalEventDrag({}, '2014-11-13T06:00:00Z', '2014-11-13T06:00:00Z', false, done) - }) - } - }) - - describe('when a constraint is specified', () => { - describe('via eventConstraint', () => { - pushOptions({ - eventConstraint: { - startTime: '04:00', - endTime: '08:00', - }, - }) - - beforeEach(() => { - dragEl.attr('data-event', JSON.stringify({ - duration: '02:00', - })) - }) - - defineTests() - }) - - describe('via the event object\'s constraint property', () => { - beforeEach(() => { - dragEl.attr('data-event', JSON.stringify({ - duration: '02:00', - constraint: { - startTime: '04:00', - endTime: '08:00', - }, - })) - }) - - defineTests() - }) - - function defineTests() { - it('allows a drop when inside the constraint', (done) => { - testExternalEventDrag({}, '2014-11-13T05:00:00Z', '2014-11-13T05:00:00Z', true, done) - }) - it('disallows a drop when partially outside of the constraint', (done) => { - testExternalEventDrag({}, '2014-11-13T07:00:00Z', '2014-11-13T07:00:00Z', false, done) - }) - } - }) - }) - }) - - // TODO: write more tests for DayGrid! - - describe('in month whole-days', () => { - pushOptions({ - initialView: 'dayGridMonth', - }) - - describe('when event data is given', () => { - it('fires correctly', (done) => { - dragEl.attr('data-event', JSON.stringify({ - title: 'hey', - })) - testExternalEventDrag({}, '2014-11-13', '2014-11-13', true, done) - }) - - describe('when given a start time', () => { - describe('through the event object\'s time property', () => { - beforeEach(() => { - dragEl.attr('data-event', JSON.stringify({ - startTime: '05:00', - })) - }) - - it('accepts the given start time for the dropped day', (done) => { - testExternalEventDrag({}, '2014-11-13', '2014-11-13T05:00:00Z', true, () => { - // the whole-day start was already checked. we still need to check the exact time - let event = currentCalendar.getEvents()[0] - expect(event.start).toEqualDate('2014-11-13T05:00:00Z') - done() - }) - }) - }) - }) - }) - }) - - function testExternalElDrag(options, dragToDate, expectedDate, expectSuccess, callback) { // with NO event creation - options.droppable = true - options.drop = (arg) => { - expect(arg.date instanceof Date).toBe(true) - expect(arg.date).toEqualDate(expectedDate) - expect(typeof arg.jsEvent).toBe('object') - } - options.eventReceive = () => {} - spyOn(options, 'drop').and.callThrough() - spyOn(options, 'eventReceive').and.callThrough() - - testEventDrag(options, dragToDate, expectSuccess, () => { - if (expectSuccess) { - expect(options.drop).toHaveBeenCalled() - } else { - expect(options.drop).not.toHaveBeenCalled() - } - expect(options.eventReceive).not.toHaveBeenCalled() - callback() - }, 'drag') // .drag className - } - - function testExternalEventDrag(options, dragToDate, expectedDate, expectSuccess, callback) { - let expectedAllDay = dragToDate.indexOf('T') === -1 // for the drop callback only! - - options.droppable = true - options.drop = (arg) => { - expect(arg.date instanceof Date).toBe(true) - expect(arg.date).toEqualDate(dragToDate) - expect(arg.allDay).toBe(expectedAllDay) - expect(typeof arg.jsEvent).toBe('object') - } - options.eventReceive = (arg) => { - expect(arg.event.start).toEqualDate(expectedDate) - } - spyOn(options, 'drop').and.callThrough() - spyOn(options, 'eventReceive').and.callThrough() - - testEventDrag(options, dragToDate, expectSuccess, () => { - if (expectSuccess) { - expect(options.drop).toHaveBeenCalled() - expect(options.eventReceive).toHaveBeenCalled() - } else { - expect(options.drop).not.toHaveBeenCalled() - expect(options.eventReceive).not.toHaveBeenCalled() - } - callback() - }, 'drag') // .drag className - } -}) diff --git a/fullcalendar-main/tests/src/legacy/external-dnd.ts b/fullcalendar-main/tests/src/legacy/external-dnd.ts deleted file mode 100644 index 5668591..0000000 --- a/fullcalendar-main/tests/src/legacy/external-dnd.ts +++ /dev/null @@ -1,405 +0,0 @@ -import { Calendar } from '@fullcalendar/core' -import interactionPlugin, { ThirdPartyDraggable } from '@fullcalendar/interaction' -import dayGridPlugin from '@fullcalendar/daygrid' -import timeGridPlugin from '@fullcalendar/timegrid' -import { ListenerCounter } from '../lib/ListenerCounter.js' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('external drag and drop with jquery UI', () => { - pushOptions({ - plugins: [interactionPlugin, timeGridPlugin, dayGridPlugin], - initialDate: '2014-08-23', - initialView: 'dayGridMonth', - droppable: true, - }) - - // TODO: fill out tests for droppable/drop, with RTL - - let thirdPartyDraggable - - beforeEach(() => { - $('body').append( - '
' + - '
', - ) - - thirdPartyDraggable = new ThirdPartyDraggable({ - itemSelector: `#sidebar .${CalendarWrapper.EVENT_CLASSNAME}`, - }) - }) - - afterEach(() => { - $('#sidebar').remove() - $('#cal').remove() - thirdPartyDraggable.destroy() - }) - - function initCalendarInContainer(options = {}) { - return initCalendar(options, $('#cal')[0]) - } - - describeValues({ - 'with draggable': () => $('#sidebar a').draggable(), - 'with sortable': () => $('#sidebar').sortable(), - }, (initDnd) => { - describe('in month view', () => { - pushOptions({ - initialView: 'dayGridMonth', - }) - - it('works after the view is changed', (done) => { // issue 2240 - let callCnt = 0 - let dayGridWrapper - let calendar = initCalendarInContainer({ - drop(arg) { - if (callCnt === 0) { - expect(arg.date).toEqualDate('2014-08-06') - - calendar.next() - calendar.prev() - - setTimeout(() => { // weird - $('#sidebar .event1').remove() - $('#sidebar .event2').simulate('drag', { - end: dayGridWrapper.getDayEl('2014-08-06'), - }) - }, 0) - } else if (callCnt === 1) { - expect(arg.date).toEqualDate('2014-08-06') - setTimeout(done) // weird - } - - callCnt += 1 - }, - }) - dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - initDnd() - setTimeout(() => { // weird - $('#sidebar .event1').simulate('drag', { - end: dayGridWrapper.getDayEl('2014-08-06'), - }) - }) - }) - - describe('dropAccept', () => { - it('works with a className that does match', (done) => { - let options = { - dropAccept: '.event1', - drop() { }, - } - spyOn(options, 'drop').and.callThrough() - - let calendar = initCalendarInContainer(options) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - initDnd() - setTimeout(() => { // weird - $('#sidebar .event1').simulate('drag', { - end: dayGridWrapper.getDayEl('2014-08-06'), - callback() { - expect(options.drop).toHaveBeenCalled() - done() - }, - }) - }) - }) - - it('prevents a classNames that doesn\'t match', (done) => { - let options = { - dropAccept: '.event2', - drop() { }, - } - spyOn(options, 'drop').and.callThrough() - - let calendar = initCalendarInContainer(options) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - initDnd() - setTimeout(() => { // weird - $('#sidebar .event1').simulate('drag', { - end: dayGridWrapper.getDayEl('2014-08-06'), - callback() { - expect(options.drop).not.toHaveBeenCalled() - done() - }, - }) - }) - }) - - it('works with a filter function that returns true', (done) => { - let options = { - dropAccept(el) { - expect(el instanceof HTMLElement).toBe(true) - return true - }, - drop() { }, - } - spyOn(options, 'drop').and.callThrough() - - let calendar = initCalendarInContainer(options) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - initDnd() - setTimeout(() => { // weird - $('#sidebar .event1').simulate('drag', { - end: dayGridWrapper.getDayEl('2014-08-06'), - callback() { - expect(options.drop).toHaveBeenCalled() - done() - }, - }) - }) - }) - - it('prevents a drop with a filter function that returns false', (done) => { - let options = { - dropAccept(el) { - expect(el instanceof HTMLElement).toBe(true) - return false - }, - drop() { }, - } - spyOn(options, 'drop').and.callThrough() - - let calendar = initCalendarInContainer(options) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - initDnd() - setTimeout(() => { // weird - $('#sidebar .event1').simulate('drag', { - end: dayGridWrapper.getDayEl('2014-08-06'), - callback() { - expect(options.drop).not.toHaveBeenCalled() - done() - }, - }) - }) - }) - }) - }) - - describe('in timeGrid view', () => { - pushOptions({ - initialView: 'timeGridWeek', - dragScroll: false, - scrollTime: '00:00:00', - }) - - it('works after the view is changed', (done) => { - let callCnt = 0 - let timeGridWrapper - let calendar = initCalendarInContainer({ - drop(arg) { - if (callCnt === 0) { - expect(arg.date).toEqualDate('2014-08-20T01:00:00Z') - - currentCalendar.next() - currentCalendar.prev() - - setTimeout(() => { // weird - $('#sidebar .event1').remove() - $('#sidebar .event2').simulate('drag', { - end: timeGridWrapper.getPoint('2014-08-20T01:00:00'), - }) - }, 0) - } else if (callCnt === 1) { - expect(arg.date).toEqualDate('2014-08-20T01:00:00Z') - setTimeout(done) // weird - } - - callCnt += 1 - }, - }) - timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - - initDnd() - setTimeout(() => { // weird - $('#sidebar .event1').simulate('drag', { - end: timeGridWrapper.getPoint('2014-08-20T01:00:00'), - }) - }) - }) - - it('works with timezone as "local"', (done) => { // for issue 2225 - let calendar = initCalendarInContainer({ - timeZone: 'local', - drop(arg) { - expect(arg.date).toEqualLocalDate('2014-08-20T01:00:00') - done() - }, - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - - initDnd() - setTimeout(() => { - $('#sidebar .event1').simulate('drag', { - end: timeGridWrapper.getPoint('2014-08-20T01:00:00'), - }) - }) - }) - - it('works with timezone as "UTC"', (done) => { // for issue 2225 - let calendar = initCalendarInContainer({ - timeZone: 'UTC', - drop(arg) { - expect(arg.date).toEqualDate('2014-08-20T01:00:00Z') - done() - }, - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - - initDnd() - setTimeout(() => { // weird - $('#sidebar .event1').simulate('drag', { - end: timeGridWrapper.getPoint('2014-08-20T01:00:00'), - }) - }) - }) - - describe('dropAccept', () => { - it('works with a className that does match', (done) => { - let options = { - dropAccept: '.event1', - drop() { }, - } - spyOn(options, 'drop').and.callThrough() - - let calendar = initCalendarInContainer(options) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - - initDnd() - setTimeout(() => { // weird - $('#sidebar .event1').simulate('drag', { - end: timeGridWrapper.getPoint('2014-08-20T01:00:00'), - callback() { - expect(options.drop).toHaveBeenCalled() - done() - }, - }) - }) - }) - - it('prevents a classNames that doesn\'t match', (done) => { - let options = { - dropAccept: '.event2', - drop() { }, - } - spyOn(options, 'drop').and.callThrough() - - let calendar = initCalendarInContainer(options) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - - initDnd() - setTimeout(() => { // weird - $('#sidebar .event1').simulate('drag', { - end: timeGridWrapper.getPoint('2014-08-20T01:00:00'), - callback() { - expect(options.drop).not.toHaveBeenCalled() - done() - }, - }) - }) - }) - - it('works with a filter function that returns true', (done) => { - let options = { - dropAccept(el) { - expect(el instanceof HTMLElement).toBe(true) - return true - }, - drop() { }, - } - spyOn(options, 'drop').and.callThrough() - - let calendar = initCalendarInContainer(options) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - - initDnd() - setTimeout(() => { // weird - $('#sidebar .event1').simulate('drag', { - end: timeGridWrapper.getPoint('2014-08-20T01:00:00'), - callback() { - expect(options.drop).toHaveBeenCalled() - done() - }, - }) - }) - }) - - it('prevents a drop with a filter function that returns false', (done) => { - let options = { - dropAccept(el) { - expect(el instanceof HTMLElement).toBe(true) - return false - }, - drop() { }, - } - spyOn(options, 'drop').and.callThrough() - - let calendar = initCalendarInContainer(options) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - - initDnd() - setTimeout(() => { // weird - $('#sidebar .event1').simulate('drag', { - end: timeGridWrapper.getPoint('2014-08-20T01:00:00'), - callback() { - expect(options.drop).not.toHaveBeenCalled() - done() - }, - }) - }) - }) - }) - }) - - // Issue 2433 - it('should not have drag handlers cleared when other calendar navigates', () => { - let calendar0 = initCalendarInContainer() - initDnd() - - let el0 = calendar0.el - let $el1 = $('
').insertAfter(el0) - let calendar1 = new Calendar($el1[0], getCurrentOptions()) - calendar1.render() - - let docListenerCounter = new ListenerCounter(document) - docListenerCounter.startWatching() - - calendar0.next() - expect(docListenerCounter.stopWatching()).toBe(0) - - calendar1.destroy() - $el1.remove() - }) - }) - - // https://github.com/fullcalendar/fullcalendar/issues/2926 - it('gives a mouseup event to the drop handler', (done) => { - let options = { - drop(info) { - expect(info.jsEvent.type).toBe('mouseup') - }, - } - spyOn(options, 'drop').and.callThrough() - - let calendar = initCalendarInContainer(options) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - setTimeout(() => { // weird - $('#sidebar .event1').draggable().simulate('drag', { - end: dayGridWrapper.getDayEl('2014-08-06'), - callback() { - expect(options.drop).toHaveBeenCalled() - done() - }, - }) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/firstDay.ts b/fullcalendar-main/tests/src/legacy/firstDay.ts deleted file mode 100644 index ea83a24..0000000 --- a/fullcalendar-main/tests/src/legacy/firstDay.ts +++ /dev/null @@ -1,101 +0,0 @@ -import enGbLocale from '@fullcalendar/core/locales/en-gb' -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('firstDay', () => { - describe('when using default settings', () => { - it('should make Sunday the first day of the week', () => { - let calendar = initCalendar() - expectDowStartAt(calendar, 0) - }) - }) - - describe('when setting firstDay to 0', () => { - pushOptions({ - firstDay: 0, - }) - - it('should make Sunday the first day of the week', () => { - let calendar = initCalendar() - expectDowStartAt(calendar, 0) - }) - }) - - describe('when setting firstDay to 1', () => { - pushOptions({ - firstDay: 1, - }) - - it('should make Monday the first day of the week', () => { - let calendar = initCalendar() - expectDowStartAt(calendar, 1) - }) - }) - - describe('when setting weekNumberCalculation to ISO', () => { - pushOptions({ - weekNumberCalculation: 'ISO', - }) - - it('should make Monday the first day of the week', () => { - let calendar = initCalendar() - expectDowStartAt(calendar, 1) - }) - }) - - describeOptions('direction', { - 'when LTR': 'ltr', - 'when RTL': 'rtl', - }, () => { - pushOptions({ - firstDay: 2, - }) - - it('should make Tuesday the first day of the week', () => { - let calendar = initCalendar() - expectDowStartAt(calendar, 2) - }) - }) - - describe('when setting firstDay to 2 and weekNumberCalculation to ISO', () => { - pushOptions({ - firstDay: 2, - weekNumberCalculation: 'ISO', - }) - - it('should make Tuesday the first day of the week', () => { - let calendar = initCalendar() - expectDowStartAt(calendar, 2) - }) - }) - - describe('when setting firstDay to 3', () => { - pushOptions({ - firstDay: 3, - }) - - it('should make Wednesday the first day of the week', () => { - let calendar = initCalendar() - expectDowStartAt(calendar, 3) - }) - }) - - it('should have a different default value based on the locale', () => { - let calendar = initCalendar({ - locale: enGbLocale, - }) - // firstDay will be 1 (Monday) in Great Britain - expectDowStartAt(calendar, 1) - }) - - const DOW_CLASSNAMES = CalendarWrapper.DOW_CLASSNAMES - - function expectDowStartAt(calendar, dowNum) { - let headerWrapper = new DayGridViewWrapper(calendar).header - let cellEls = headerWrapper.getCellEls() - - for (let i = 0; i < 7; i += 1) { - expect(cellEls[i]).toHaveClass(DOW_CLASSNAMES[(i + dowNum) % 7]) - } - } -}) diff --git a/fullcalendar-main/tests/src/legacy/fixedWeekCount.ts b/fullcalendar-main/tests/src/legacy/fixedWeekCount.ts deleted file mode 100644 index df29b51..0000000 --- a/fullcalendar-main/tests/src/legacy/fixedWeekCount.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' - -describe('fixedWeekCount', () => { - pushOptions({ - initialView: 'dayGridMonth', - initialDate: '2014-07-01', // has 5 weeks - }) - - describe('when true', () => { - pushOptions({ - fixedWeekCount: true, - }) - - it('renders a 5-week month with 6 rows', () => { - let calendar = initCalendar() - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - expect(dayGridWrapper.getRowEls().length).toBe(6) - }) - }) - - describe('when false', () => { - pushOptions({ - fixedWeekCount: false, - }) - - it('renders a 5-week month with 5 rows', () => { - let calendar = initCalendar() - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - expect(dayGridWrapper.getRowEls().length).toBe(5) - }) - }); - - [true, false].forEach((bool) => { - describe('regardless of value (' + bool + ')', () => { - pushOptions({ - fixedWeekCount: bool, - initialDate: '2014-08-01', // has 6 weeks - }) - - it('should render a 6-week month consistently', () => { - let calendar = initCalendar() - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - expect(dayGridWrapper.getRowEls().length).toBe(6) - }) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/footer-navigation.ts b/fullcalendar-main/tests/src/legacy/footer-navigation.ts deleted file mode 100644 index 5309a12..0000000 --- a/fullcalendar-main/tests/src/legacy/footer-navigation.ts +++ /dev/null @@ -1,85 +0,0 @@ -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('footerToolbar navigation', () => { // TODO: rename file - pushOptions({ - now: '2010-02-01', - headerToolbar: false, - footerToolbar: { - left: 'next,prev,prevYear,nextYear today', - center: '', - right: 'title', - }, - }) - - describe('and click next', () => { - it('should change view to next month', (done) => { - let calendar = initCalendar() - let toolbarWrapper = new CalendarWrapper(calendar).footerToolbar - - $(toolbarWrapper.getButtonEl('next')).simulate('click') - setTimeout(() => { - let newDate = currentCalendar.getDate() - expect(newDate).toEqualDate('2010-03-01') - done() - }) - }) - }) - - describe('and click prev', () => { - it('should change view to prev month', (done) => { - let calendar = initCalendar() - let toolbarWrapper = new CalendarWrapper(calendar).footerToolbar - - $(toolbarWrapper.getButtonEl('prev')).simulate('click') - setTimeout(() => { - let newDate = currentCalendar.getDate() - expect(newDate).toEqualDate('2010-01-01') - done() - }) - }) - }) - - describe('and click prevYear', () => { - it('should change view to prev month', (done) => { - let calendar = initCalendar() - let toolbarWrapper = new CalendarWrapper(calendar).footerToolbar - - $(toolbarWrapper.getButtonEl('prevYear')).simulate('click') - setTimeout(() => { - let newDate = currentCalendar.getDate() - expect(newDate).toEqualDate('2009-02-01') - done() - }) - }) - }) - - describe('and click nextYear', () => { - it('should change view to prev month', (done) => { - let calendar = initCalendar() - let toolbarWrapper = new CalendarWrapper(calendar).footerToolbar - - $(toolbarWrapper.getButtonEl('nextYear')).simulate('click') - setTimeout(() => { - let newDate = currentCalendar.getDate() - expect(newDate).toEqualDate('2011-02-01') - done() - }) - }) - }) - - describe('and click today', () => { - it('should change view to prev month', (done) => { - let calendar = initCalendar({ - initialDate: '2010-03-15', // something other than the `now` date - }) - let toolbarWrapper = new CalendarWrapper(calendar).footerToolbar - - $(toolbarWrapper.getButtonEl('today')).simulate('click') - setTimeout(() => { - let newDate = currentCalendar.getDate() // will be ambig zone - expect(newDate).toEqualDate('2010-02-01') - done() - }) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/footer-rendering.ts b/fullcalendar-main/tests/src/legacy/footer-rendering.ts deleted file mode 100644 index a8880f6..0000000 --- a/fullcalendar-main/tests/src/legacy/footer-rendering.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('footerToolbar rendering', () => { // TODO: rename file - pushOptions({ - initialDate: '2014-06-04', - initialView: 'timeGridWeek', - }) - - describe('when supplying footerToolbar options', () => { - it('should append a footerToolbar element to the DOM', () => { - let calendar = initCalendar({ - footerToolbar: { - left: 'next,prev', - center: 'prevYear today nextYear timeGridDay,timeGridWeek', - right: 'title', - }, - }) - let calendarWrapper = new CalendarWrapper(calendar) - expect(calendarWrapper.footerToolbar).toBeTruthy() - }) - }) - - describe('when setting footerToolbar to false', () => { - it('should not have footerToolbar table', () => { - let calendar = initCalendar({ - footerToolbar: false, - }) - let calendarWrapper = new CalendarWrapper(calendar) - expect(calendarWrapper.footerToolbar).toBeFalsy() - }) - }) - - it('allow for dynamically changing', () => { - let calendar = initCalendar({ - footerToolbar: { - left: 'next,prev', - center: 'prevYear today nextYear timeGridDay,timeGridWeek', - right: 'title', - }, - }) - let calendarWrapper = new CalendarWrapper(calendar) - expect(calendarWrapper.footerToolbar).toBeTruthy() - currentCalendar.setOption('footerToolbar', false) - expect(calendarWrapper.footerToolbar).toBeFalsy() - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/forceEventDuration.ts b/fullcalendar-main/tests/src/legacy/forceEventDuration.ts deleted file mode 100644 index 9eeea10..0000000 --- a/fullcalendar-main/tests/src/legacy/forceEventDuration.ts +++ /dev/null @@ -1,58 +0,0 @@ -describe('forceEventDuration', () => { - pushOptions({ - initialDate: '2014-05-01', - initialView: 'dayGridMonth', - }) - - describe('when turned off', () => { - pushOptions({ - forceEventDuration: false, - }) - it('allows a null end date for all-day and timed events', () => { - initCalendar({ - events: [ - { - id: '1', - start: '2014-05-10', - }, - { - id: '2', - start: '2014-05-10T14:00:00', - }, - ], - }) - let events = currentCalendar.getEvents() - expect(events[0].end).toBeNull() - expect(events[1].end).toBeNull() - }) - }) - - describe('when turned on', () => { - pushOptions({ - forceEventDuration: true, - }) - it('allows a null end date for all-day and timed events', () => { - initCalendar({ - events: [ - { - id: '1', - start: '2014-05-10', - }, - { - id: '2', - start: '2014-05-10T14:00:00', - }, - ], - }) - let events = currentCalendar.getEvents() - expect(events[0].id).toEqual('1') - expect(events[0].end instanceof Date).toEqual(true) - expect(events[1].id).toEqual('2') - expect(events[1].end instanceof Date).toEqual(true) - }) - }) - - // NOTE: the actual verification of the correct calculation of the end - // (using defaultTimedEventDuration and defaultAllDayEventDuration) - // is done in those test files. -}) diff --git a/fullcalendar-main/tests/src/legacy/getEventSourceById.ts b/fullcalendar-main/tests/src/legacy/getEventSourceById.ts deleted file mode 100644 index dd9a172..0000000 --- a/fullcalendar-main/tests/src/legacy/getEventSourceById.ts +++ /dev/null @@ -1,38 +0,0 @@ -describe('getEventSource', () => { - pushOptions({ - now: '2015-08-07', - initialView: 'timeGridWeek', - eventSources: [ - { - events: [ - { id: '1', start: '2015-08-07T02:00:00', end: '2015-08-07T03:00:00', title: 'event A' }, - ], - id: 'source1', - }, - { - events: [ - { id: '2', start: '2015-08-07T03:00:00', end: '2015-08-07T04:00:00', title: 'event B' }, - ], - id: 'source2', - }, - { - events: [ - { id: '3', start: '2015-08-07T04:00:00', end: '2015-08-07T05:00:00', title: 'event C' }, - ], - id: 'source3', - }, - ], - }) - - it('retreives the queried event source', (done) => { - initCalendar() - - let eventSource1 = currentCalendar.getEventSourceById('source1') - let eventSource2 = currentCalendar.getEventSourceById('source2') - - expect(eventSource1.id).toBe('source1') - expect(eventSource2.id).toBe('source2') - - done() - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/getEventSources.ts b/fullcalendar-main/tests/src/legacy/getEventSources.ts deleted file mode 100644 index 0303d52..0000000 --- a/fullcalendar-main/tests/src/legacy/getEventSources.ts +++ /dev/null @@ -1,35 +0,0 @@ -describe('getEventSources', () => { - pushOptions({ - now: '2015-08-07', - initialView: 'timeGridWeek', - eventSources: [ - { - events: [ - { id: '1', start: '2015-08-07T02:00:00', end: '2015-08-07T03:00:00', title: 'event A' }, - ], - }, - { - events: [ - { id: '2', start: '2015-08-07T03:00:00', end: '2015-08-07T04:00:00', title: 'event B' }, - ], - }, - { - events: [ - { id: '3', start: '2015-08-07T04:00:00', end: '2015-08-07T05:00:00', title: 'event C' }, - ], - }, - ], - }) - - it('does not mutate when removeEventSource is called', (done) => { - initCalendar() - let eventSources = currentCalendar.getEventSources() - expect(eventSources.length).toBe(3) - - // prove that eventSources is a copy, and wasn't mutated - eventSources[0].remove() - expect(eventSources.length).toBe(3) - - done() - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/header-navigation.ts b/fullcalendar-main/tests/src/legacy/header-navigation.ts deleted file mode 100644 index d006cbb..0000000 --- a/fullcalendar-main/tests/src/legacy/header-navigation.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('header navigation', () => { - pushOptions({ - headerToolbar: { - left: 'next,prev,prevYear,nextYear today', - center: '', - right: 'title', - }, - }) - - describe('and click next', () => { - it('should change view to next month', (done) => { - let calendar = initCalendar() - calendar.gotoDate('2010-02-01') - - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - $(toolbarWrapper.getButtonEl('next')).simulate('click') - setTimeout(() => { - let newDate = calendar.getDate() - expect(newDate).toEqualDate('2010-03-01') - done() - }) - }) - }) - - describe('and click prev', () => { - it('should change view to prev month', (done) => { - let calendar = initCalendar() - calendar.gotoDate('2010-02-01') - - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - $(toolbarWrapper.getButtonEl('prev')).simulate('click') - setTimeout(() => { - let newDate = calendar.getDate() - expect(newDate).toEqualDate('2010-01-01') - done() - }) - }) - }) - - describe('and click prevYear', () => { - it('should change view to prev month', (done) => { - let calendar = initCalendar() - calendar.gotoDate('2010-02-01') - - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - $(toolbarWrapper.getButtonEl('prevYear')).simulate('click') - setTimeout(() => { - let newDate = calendar.getDate() - expect(newDate).toEqualDate('2009-02-01') - done() - }) - }) - }) - - describe('and click nextYear', () => { - it('should change view to prev month', (done) => { - let calendar = initCalendar() - calendar.gotoDate('2010-02-01') - - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - $(toolbarWrapper.getButtonEl('nextYear')).simulate('click') - setTimeout(() => { - let newDate = calendar.getDate() - expect(newDate).toEqualDate('2011-02-01') - done() - }) - }) - }) - - describe('and click today', () => { - it('should change view to prev month', (done) => { - let calendar = initCalendar() - calendar.gotoDate('2010-02-01') - - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - $(toolbarWrapper.getButtonEl('today')).simulate('click') - setTimeout(() => { - let newDate = calendar.getDate() // will be ambig zone - expect(newDate).toEqualNow() - done() - }) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/header-rendering.ts b/fullcalendar-main/tests/src/legacy/header-rendering.ts deleted file mode 100644 index 39e54cb..0000000 --- a/fullcalendar-main/tests/src/legacy/header-rendering.ts +++ /dev/null @@ -1,151 +0,0 @@ -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('headerToolbar rendering', () => { // TODO: rename file - it('renders the default headerToolbar option', () => { - let calendar = initCalendar() - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - - expect(toolbarWrapper.getSectionContent(0)).toEqual( - [{ type: 'title' }], - ) - - expect(toolbarWrapper.getSectionContent(1)).toEqual([]) - - expect(toolbarWrapper.getSectionContent(2)).toEqual([ - { type: 'button', name: 'today' }, - { - type: 'button-group', - children: [ - { type: 'button', name: 'prev' }, - { type: 'button', name: 'next' }, - ], - }, - ]) - }) - - it('renders a given headerToolbar option', () => { - let calendar = initCalendar({ - headerToolbar: { - left: 'next,prev', - center: 'prevYear today nextYear timeGridDay,timeGridWeek', - right: 'title', - }, - }) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - - expect(toolbarWrapper.getSectionContent(0)).toEqual([ - { - type: 'button-group', - children: [ - { type: 'button', name: 'next' }, - { type: 'button', name: 'prev' }, - ], - }, - ]) - - expect(toolbarWrapper.getSectionContent(1)).toEqual([ - { type: 'button', name: 'prevYear' }, - { type: 'button', name: 'today' }, - { type: 'button', name: 'nextYear' }, - { - type: 'button-group', - children: [ - { type: 'button', name: 'timeGridDay' }, - { type: 'button', name: 'timeGridWeek' }, - ], - }, - ]) - - expect(toolbarWrapper.getSectionContent(2)).toEqual([ - { type: 'title' }, - ]) - }) - - describe('when setting headerToolbar to false', () => { - pushOptions({ - headerToolbar: false, - }) - - it('should not have headerToolbar', () => { - let calendar = initCalendar() - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - - expect(toolbarWrapper).toBeFalsy() - }) - }) - - it('allow for dynamically changing', () => { - let calendar = initCalendar() - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - expect(toolbarWrapper).toBeTruthy() - - calendar.setOption('headerToolbar', false) - toolbarWrapper = new CalendarWrapper(calendar).toolbar - expect(toolbarWrapper).toBeFalsy() - }) - - describeOptions('direction', { - 'when direction is LTR': 'ltr', - 'when direction is RTL': 'rtl', - }, () => { - it('renders left and right literally', () => { - let calendar = initCalendar({ - headerToolbar: { - left: 'prev', - center: 'today', - right: 'next', - }, - }) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - - expect(toolbarWrapper.getSectionContent(0)).toEqual([ - { type: 'button', name: 'prev' }, - ]) - - expect(toolbarWrapper.getSectionContent(1)).toEqual([ - { type: 'button', name: 'today' }, - ]) - - expect(toolbarWrapper.getSectionContent(2)).toEqual([ - { type: 'button', name: 'next' }, - ]) - }) - }) - - describe('when calendar is within a form', () => { - it('should not submit the form when clicking the button', (done) => { - let unloadCalled = false - let el = $('
') - .wrap('
') - .appendTo('body') - - function beforeUnloadHandler() { - console.log('when calendar is within a form, it submits!!!') // eslint-disable-line no-console - unloadCalled = true - cleanup() - return 'click stay on this page' - } - $(window).on('beforeunload', beforeUnloadHandler) - - function cleanup() { - el.remove() - $(window).off('beforeunload', beforeUnloadHandler) - } - - let calendar = initCalendar({ - headerToolbar: { - left: 'prev,next', - right: 'title', - }, - }, el) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - - $(toolbarWrapper.getButtonEl('next')).simulate('click') - setTimeout(() => { // wait to see if handler was called - expect(unloadCalled).toBe(false) - cleanup() - done() - }, 100) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/height-and-contentHeight.ts b/fullcalendar-main/tests/src/legacy/height-and-contentHeight.ts deleted file mode 100644 index d186625..0000000 --- a/fullcalendar-main/tests/src/legacy/height-and-contentHeight.ts +++ /dev/null @@ -1,329 +0,0 @@ -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' -import '../lib/dom-misc' - -['height', 'contentHeight'].forEach((heightProp) => { - describe(heightProp, () => { - let $calendarEl - let heightEl // HTMLElement - let asAMethod - let heightPropDescriptions: { description: string, height: string | number, heightWrapper?: boolean }[] = [ - { description: 'as a number', height: 600 }, - ] - - if (heightProp === 'height') { - heightPropDescriptions.push({ description: 'as "100%"', height: '100%', heightWrapper: true }) - } - - pushOptions({ - initialDate: '2014-08-01', - }) - - beforeEach(() => { - $calendarEl = $('
').appendTo('body').width(900) - }) - - afterEach(() => { - $calendarEl.remove() - }) - - // relies on asAMethod (boolean) - // otherOptions: other calendar options to dynamically set (assumes asAMethod) - function init(heightVal) { - let calendar - - if (asAMethod) { - calendar = initCalendar({}, $calendarEl[0]) - let calendarWrapper = new CalendarWrapper(calendar) - let dateEl = calendarWrapper.getFirstDateEl() - - calendar.setOption(heightProp, heightVal) - expect(calendarWrapper.getFirstDateEl()).toBe(dateEl) - } else { - calendar = initCalendar({ [heightProp]: heightVal }, $calendarEl[0]) - } - - if (heightProp === 'height') { - heightEl = calendar.el - } else { - heightEl = new CalendarWrapper(calendar).getViewEl() - } - - return calendar - } - - function expectHeight(heightVal) { - let diff = Math.abs(heightEl.offsetHeight - heightVal) - expect(diff).toBeLessThan(2) // off-by-one or exactly the same. for zoom, and firefox - } - - $.each({ - 'as an init option': false, - 'as a method': true, - }, (desc, bool) => { - describe(desc, () => { - beforeEach(() => { - asAMethod = bool - }) - - describe('for ' + heightProp, () => { - describe('when in month view', () => { - pushOptions({ - initialView: 'dayGridMonth', - }) - - heightPropDescriptions.forEach((testInfo) => { - describe(testInfo.description, () => { - if (testInfo.heightWrapper) { - beforeEach(() => { - $calendarEl.wrap('
') - }) - afterEach(() => { - $('#calendar-container').remove() - }) - } - - describe('when there are no events', () => { - it('should be the specified height, with no scrollbars', () => { - let calendar = init(testInfo.height) - let viewWrapper = new DayGridViewWrapper(calendar) - let diff = Math.abs(heightEl.offsetHeight - 600) - - expect(diff).toBeLessThan(2) - expect(viewWrapper.getScrollerEl()).not.toHaveScrollbars() - }) - }) - - describe('when there is one tall row of events', () => { - pushOptions({ - events: repeatClone({ title: 'event', start: '2014-08-04' }, 9), - }) - - it('should take away height from other rows, but not do scrollbars', () => { - let calendar = init(testInfo.height) - let viewWrapper = new DayGridViewWrapper(calendar) - let $rows = $(viewWrapper.dayGrid.getRowEls()) - let $tallRow = $rows.eq(1) - let $shortRows = $rows.not($tallRow) // 0, 2, 3, 4, 5 - let shortHeight = $shortRows.eq(0).outerHeight() - - expectHeight(600) - - $shortRows.each((i, node) => { - let rowHeight = $(node).outerHeight() - let diff = Math.abs(rowHeight - shortHeight) - expect(diff).toBeLessThan(10) // all roughly the same - }) - - expect($tallRow.outerHeight()).toBeGreaterThan(shortHeight * 2) // much taller - expect(viewWrapper.getScrollerEl()).not.toHaveScrollbars() - }) - }) - - describe('when there are many tall rows of events', () => { - pushOptions({ - events: [].concat( - repeatClone({ title: 'event0', start: '2014-07-28' }, 9), - repeatClone({ title: 'event1', start: '2014-08-04' }, 9), - repeatClone({ title: 'event2', start: '2014-08-11' }, 9), - repeatClone({ title: 'event3', start: '2014-08-18' }, 9), - repeatClone({ title: 'event4', start: '2014-08-25' }, 9), - repeatClone({ title: 'event5', start: '2014-09-01' }, 9), - ), - }) - - it('height is correct and scrollbars show up', () => { - let calendar = init(testInfo.height) - let viewWrapper = new DayGridViewWrapper(calendar) - - expectHeight(600) - expect(viewWrapper.getScrollerEl()).toHaveScrollbars() - }) - }) - }) - }) - - describe('as "auto", when there are many tall rows of events', () => { - pushOptions({ - events: [].concat( - repeatClone({ title: 'event0', start: '2014-07-28' }, 9), - repeatClone({ title: 'event1', start: '2014-08-04' }, 9), - repeatClone({ title: 'event2', start: '2014-08-11' }, 9), - repeatClone({ title: 'event3', start: '2014-08-18' }, 9), - repeatClone({ title: 'event4', start: '2014-08-25' }, 9), - repeatClone({ title: 'event5', start: '2014-09-01' }, 9), - ), - }) - - it('height is really tall and there are no scrollbars', () => { - let calendar = init('auto') - let viewWrapper = new DayGridViewWrapper(calendar) - - expect(heightEl.offsetHeight).toBeGreaterThan(1000) // pretty tall - expect(viewWrapper.getScrollerEl()).not.toHaveScrollbars() - }) - }) - }); - - ['dayGridWeek', 'dayGridDay'].forEach((viewName) => { - describe('in ' + viewName + ' view', () => { - pushOptions({ - initialView: viewName, - }) - - heightPropDescriptions.forEach((testInfo) => { - describe(testInfo.description, () => { - if (testInfo.heightWrapper) { - beforeEach(() => { - $calendarEl.wrap('
') - }) - afterEach(() => { - $('#calendar-container').remove() - }) - } - - describe('when there are no events', () => { - it('should be the specified height, with no scrollbars', () => { - let calendar = init(testInfo.height) - let viewWrapper = new DayGridViewWrapper(calendar) - - expectHeight(600) - expect(viewWrapper.getScrollerEl()).not.toHaveScrollbars() - }) - }) - - describe('when there are many events', () => { - pushOptions({ - events: repeatClone({ title: 'event', start: '2014-08-01' }, 100), - }) - - it('should have the correct height, with scrollbars', () => { - let calendar = init(testInfo.height) - let viewWrapper = new DayGridViewWrapper(calendar) - - expectHeight(600) - expect(viewWrapper.getScrollerEl()).toHaveScrollbars() - }) - }) - }) - }) - - describe('as "auto", when there are many events', () => { - pushOptions({ - events: repeatClone({ title: 'event', start: '2014-08-01' }, 100), - }) - it('should be really tall with no scrollbars', () => { - let calendar = init('auto') - let viewWrapper = new DayGridViewWrapper(calendar) - - expect(heightEl.offsetHeight).toBeGreaterThan(1000) // pretty tall - expect(viewWrapper.getScrollerEl()).not.toHaveScrollbars() - }) - }) - }) - }); - - ['timeGridWeek', 'timeGridDay'].forEach((viewName) => { - describe('in ' + viewName + ' view', () => { - pushOptions({ - initialView: viewName, - }) - - describeOptions({ - 'with no all-day section': { allDaySlot: false }, - 'with no all-day events': { }, - 'with some all-day events': { events: repeatClone({ title: 'event', start: '2014-08-01' }, 6) }, - }, () => { - heightPropDescriptions.forEach((testInfo) => { - describe(testInfo.description, () => { - if (testInfo.heightWrapper) { - beforeEach(() => { - $calendarEl.wrap('
') - }) - afterEach(() => { - $('#calendar-container').remove() - }) - } - - describe('with many slots', () => { - pushOptions({ - slotMinTime: '00:00:00', - slotMaxTime: '24:00:00', - }) - it('should be the correct height, with scrollbars', () => { - let calendar = init(testInfo.height) - let viewWrapper = new TimeGridViewWrapper(calendar) - - expectHeight(600) - expect(viewWrapper.getScrollerEl()).toHaveScrollbars() - }) - }) - }) - }) - - describe('as "auto", with only a few slots', () => { - pushOptions({ - slotMinTime: '06:00:00', - slotMaxTime: '10:00:00', - }) - it('should be really short with no scrollbars nor horizontal rule', () => { - let calendar = init('auto') - let viewWrapper = new TimeGridViewWrapper(calendar) - - expect(heightEl.offsetHeight).toBeLessThan(500) // pretty short - expect(viewWrapper.getScrollerEl()).not.toHaveScrollbars() - }) - }) - - describe('as a "auto", with many slots', () => { - pushOptions({ - slotMinTime: '00:00:00', - slotMaxTime: '24:00:00', - }) - - it('should be really tall with no scrollbars nor horizontal rule', () => { - let calendar = init('auto') - let viewWrapper = new TimeGridViewWrapper(calendar) - - expect(heightEl.offsetHeight).toBeGreaterThan(900) // pretty tall - expect(viewWrapper.getScrollerEl()).not.toHaveScrollbars() - }) - }) - }) - }) - }) - }) - }) - }) - }) -}) - -it('no height oscillation happens', () => { - let $container = $( - '
' + - '
' + - '
', - ).appendTo('body') - - // will freeze browser if bug exists :) - let calendar = initCalendar({ - headerToolbar: false, - initialView: 'dayGridMonth', - aspectRatio: 1, - }, $container.find('div')[0]) - - calendar.destroy() - $container.remove() -}) - -function repeatClone(srcObj, times) { - let a = [] - let i - - for (i = 0; i < times; i += 1) { - a.push($.extend({}, srcObj)) - } - - return a -} diff --git a/fullcalendar-main/tests/src/legacy/hiddenDays.ts b/fullcalendar-main/tests/src/legacy/hiddenDays.ts deleted file mode 100644 index 3aacea0..0000000 --- a/fullcalendar-main/tests/src/legacy/hiddenDays.ts +++ /dev/null @@ -1,94 +0,0 @@ -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('hiddenDays', () => { - const DOW_CLASSNAMES = CalendarWrapper.DOW_CLASSNAMES - - describe('when using default', () => { - it('should show 7 days of the week', () => { - let calendar = initCalendar() - let headerWrapper = new DayGridViewWrapper(calendar).header - let daysCount = headerWrapper.getCellEls().length - expect(daysCount).toEqual(7) - }) - }) - - describe('when setting an empty hiddenDays', () => { - pushOptions({ - hiddenDays: [], - }) - - it('should return 7 days of the week', () => { - let calendar = initCalendar() - let headerWrapper = new DayGridViewWrapper(calendar).header - let daysCount = headerWrapper.getCellEls().length - expect(daysCount).toEqual(7) - }) - }) - - describe('when setting hiddenDays with 1', () => { - pushOptions({ - hiddenDays: [1], - }) - - it('should return 6 days', () => { - let calendar = initCalendar() - let headerWrapper = new DayGridViewWrapper(calendar).header - let daysCount = headerWrapper.getCellEls().length - expect(daysCount).toEqual(6) - }) - - it('should return sun,tue,wed,thu,fri,sat days', () => { - let calendar = initCalendar() - let headerWrapper = new DayGridViewWrapper(calendar).header - let dowEls = headerWrapper.getCellEls() - expect(dowEls[0]).toHaveClass(DOW_CLASSNAMES[0]) - expect(dowEls[1]).toHaveClass(DOW_CLASSNAMES[2]) - expect(dowEls[2]).toHaveClass(DOW_CLASSNAMES[3]) - expect(dowEls[3]).toHaveClass(DOW_CLASSNAMES[4]) - expect(dowEls[4]).toHaveClass(DOW_CLASSNAMES[5]) - expect(dowEls[5]).toHaveClass(DOW_CLASSNAMES[6]) - }) - - it('should expect 7th day to be undefined', () => { - let calendar = initCalendar() - let headerWrapper = new DayGridViewWrapper(calendar).header - let dowEls = headerWrapper.getCellEls() - expect(dowEls[6]).toBeUndefined() - }) - }) - - describe('when setting hiddenDays with 3,5', () => { - pushOptions({ - hiddenDays: [3, 5], - }) - - it('should return 6 days', () => { - let calendar = initCalendar() - let headerWrapper = new DayGridViewWrapper(calendar).header - let daysCount = headerWrapper.getCellEls().length - expect(daysCount).toEqual(5) - }) - - it('should return s,m,t,t,s ', () => { - let calendar = initCalendar() - let headerWrapper = new DayGridViewWrapper(calendar).header - let dowEls = headerWrapper.getCellEls() - expect(dowEls[0]).toHaveClass(DOW_CLASSNAMES[0]) - expect(dowEls[1]).toHaveClass(DOW_CLASSNAMES[1]) - expect(dowEls[2]).toHaveClass(DOW_CLASSNAMES[2]) - expect(dowEls[3]).toHaveClass(DOW_CLASSNAMES[4]) - expect(dowEls[4]).toHaveClass(DOW_CLASSNAMES[6]) - }) - }) - - describe('when setting all hiddenDays', () => { - it('should expect to throw an exception', () => { - expect(() => { - initCalendar({ - hiddenDays: [0, 1, 2, 3, 4, 5, 6], - }) - }).toThrow(new Error('invalid hiddenDays')) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/locale.ts b/fullcalendar-main/tests/src/legacy/locale.ts deleted file mode 100644 index 0021b34..0000000 --- a/fullcalendar-main/tests/src/legacy/locale.ts +++ /dev/null @@ -1,49 +0,0 @@ -import esLocale from '@fullcalendar/core/locales/es' -import frLocale from '@fullcalendar/core/locales/fr' -import arLocale from '@fullcalendar/core/locales/ar' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('locale', () => { - pushOptions({ - locales: [esLocale, frLocale, arLocale], - }) - - it('works when certain locale has no FC settings defined', () => { - let calendar = initCalendar({ - locale: 'en-asdf', - initialView: 'timeGridWeek', - initialDate: '2014-12-25', - events: [ - { title: 'Christmas', start: '2014-12-25T10:00:00' }, - ], - }) - let headerWrapper = new TimeGridViewWrapper(calendar).header - - expect(headerWrapper.getCellText(0)).toMatch(/^Sun\.? 12[-/ ]21$/) - - let calendarWrapper = new CalendarWrapper(calendar) - let eventEl = calendarWrapper.getFirstEventEl() - let eventInfo = calendarWrapper.getEventElInfo(eventEl) - - expect(eventInfo.timeText).toBe('10:00') - }) - - it('allows dynamic setting', () => { - let calendar = initCalendar({ - locale: 'es', - initialDate: '2016-07-10', - initialView: 'dayGridMonth', - }) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - - expect(toolbarWrapper.getTitleText()).toBe('julio de 2016') - expect(calendar.getOption('direction')).toBe('ltr') - - currentCalendar.setOption('locale', 'fr') - expect(toolbarWrapper.getTitleText()).toBe('juillet 2016') - - currentCalendar.setOption('locale', 'ar') // NOTE: we had problems testing for RTL title text - expect(calendar.getOption('direction')).toBe('rtl') - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/maxTime.ts b/fullcalendar-main/tests/src/legacy/maxTime.ts deleted file mode 100644 index 0f82cfa..0000000 --- a/fullcalendar-main/tests/src/legacy/maxTime.ts +++ /dev/null @@ -1,98 +0,0 @@ -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('slotMaxTime', () => { // TODO: rename file - describe('when using the default settings', () => { - describeOptions('initialView', { - 'in week': 'timeGridWeek', - 'in day': 'timeGridDay', - }, () => { - it('should start at 12am', () => { - let calendar = initCalendar({ - initialView: 'timeGridWeek', - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let lastMajor = timeGridWrapper.getLastMajorAxisInfo() - expect(lastMajor.text).toEqual('11pm') - }) - }) - }) - - describe('when using a whole number', () => { - let hourNumbers = [12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24] - - describe('in week', () => { - hourNumbers.forEach((hourNumber) => { - it('should end at ' + hourNumber, () => { - let calendar = initCalendar({ - initialView: 'timeGridWeek', - slotMaxTime: { hours: hourNumber }, - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let lastMajor = timeGridWrapper.getLastMajorAxisInfo() - let expected = numToStringConverter(hourNumber - 1) - expect(lastMajor.text).toEqual(expected) - }) - }) - }) - - describe('in day', () => { - hourNumbers.forEach((hourNumber) => { - it('should end at ' + hourNumber, () => { - let calendar = initCalendar({ - initialView: 'timeGridDay', - slotMaxTime: hourNumber + ':00', // in addition, test string duration input - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let lastMajor = timeGridWrapper.getLastMajorAxisInfo() - let expected = numToStringConverter(hourNumber - 1) - expect(lastMajor.text).toEqual(expected) - }) - }) - }) - }) - - describe('when using default slotInterval and \'uneven\' slotMaxTime', () => { - let hourNumbers = [12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24] - - describe('in week', () => { - hourNumbers.forEach((hourNumber) => { - it('should end at ' + hourNumber + ':20', () => { - let calendar = initCalendar({ - initialView: 'timeGridWeek', - slotMaxTime: { hours: hourNumber, minutes: 20 }, - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let lastMajor = timeGridWrapper.getLastMajorAxisInfo() - // since exclusive end is :20, last slot will be on the current hour's 00:00 - let expected = numToStringConverter(hourNumber) - expect(lastMajor.text).toEqual(expected) - }) - }) - }) - - describe('in day', () => { - hourNumbers.forEach((hourNumber) => { - it('should end at ' + hourNumber + ':20', () => { - let calendar = initCalendar({ - initialView: 'timeGridDay', - slotMaxTime: { hours: hourNumber, minutes: 20 }, - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let lastMajor = timeGridWrapper.getLastMajorAxisInfo() - // since exclusive end is :20, last slot will be on the current hour's 00:00 - let expected = numToStringConverter(hourNumber) - expect(lastMajor.text).toEqual(expected) - }) - }) - }) - }) - - function numToStringConverter(timeIn) { - let time = (timeIn % 12) || 12 - let amPm = 'am' - if ((timeIn % 24) > 11) { - amPm = 'pm' - } - return time + amPm - } -}) diff --git a/fullcalendar-main/tests/src/legacy/more-link-click.ts b/fullcalendar-main/tests/src/legacy/more-link-click.ts deleted file mode 100644 index 786e9ae..0000000 --- a/fullcalendar-main/tests/src/legacy/more-link-click.ts +++ /dev/null @@ -1,169 +0,0 @@ -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' - -describe('moreLinkClick', () => { - pushOptions({ - initialDate: '2014-08-01', // important that it is the first week, so works w/ month + week views - initialView: 'dayGridMonth', - dayMaxEventRows: 3, - events: [ - { title: 'event1', start: '2014-07-29' }, - { title: 'event2', start: '2014-07-29' }, - { title: 'event2', start: '2014-07-29' }, - { title: 'event2', start: '2014-07-29' }, - ], - }) - - describe('when set to "popover"', () => { - pushOptions({ - moreLinkClick: 'popover', - }) - - it('renders a popover upon click', (done) => { - let calendar = initCalendar() - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - dayGridWrapper.openMorePopover() - setTimeout(() => { - expect(dayGridWrapper.getMorePopoverEl()).toBeVisible() - done() - }) - }) - - // more popover tests are done in *-popover.js - }) - - describe('when set to "week"', () => { - pushOptions({ - moreLinkClick: 'week', - }) - - it('should go to dayGridWeek if it is one of the available views', (done) => { - let calendar = initCalendar({ - headerToolbar: { - left: 'prev,next today', - center: 'title', - right: 'dayGridMonth,dayGridWeek,dayGridDay', - }, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - dayGridWrapper.openMorePopover() - setTimeout(() => { - let view = currentCalendar.view - expect(view.type).toBe('dayGridWeek') - done() - }) - }) - - it('should go to week if it is one of the available views', (done) => { - let calendar = initCalendar({ - headerToolbar: { - left: 'prev,next today', - center: 'title', - right: 'dayGridMonth,timeGridWeek,timeGridDay', - }, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - dayGridWrapper.openMorePopover() - setTimeout(() => { - let view = currentCalendar.view - expect(view.type).toBe('timeGridWeek') - done() - }) - }) - }) - - describe('when set to "day"', () => { - pushOptions({ - moreLinkClick: 'day', - }) - - it('should go to dayGridDay if it is one of the available views', (done) => { - let calendar = initCalendar({ - headerToolbar: { - left: 'prev,next today', - center: 'title', - right: 'dayGridMonth,dayGridWeek,dayGridDay', - }, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - dayGridWrapper.openMorePopover() - setTimeout(() => { - let view = currentCalendar.view - expect(view.type).toBe('dayGridDay') - done() - }) - }) - - it('should go to day if it is one of the available views', (done) => { - let calendar = initCalendar({ - headerToolbar: { - left: 'prev,next today', - center: 'title', - right: 'dayGridMonth,timeGridWeek,timeGridDay', - }, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - dayGridWrapper.openMorePopover() - setTimeout(() => { - let view = currentCalendar.view - expect(view.type).toBe('timeGridDay') - done() - }) - }) - }) - - it('works with an explicit view name', (done) => { - let calendar = initCalendar({ - moreLinkClick: 'timeGridWeek', - headerToolbar: { - left: 'prev,next today', - center: 'title', - right: 'dayGridMonth,dayGridWeek,dayGridDay', - }, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - dayGridWrapper.openMorePopover() - setTimeout(() => { - let view = currentCalendar.view - expect(view.type).toBe('timeGridWeek') - done() - }) - }) - - it('works with custom function and all the arguments are correct', (done) => { - let calendar = initCalendar({ - moreLinkClick(arg) { - expect(typeof arg).toBe('object') - expect(arg.date).toEqualDate('2014-07-29') - expect(arg.hiddenSegs.length).toBe(2) - expect(arg.allSegs.length).toBe(4) - expect(typeof arg.jsEvent).toBe('object') - }, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - dayGridWrapper.openMorePopover() - setTimeout(done) - }) - - it('works with custom function, and can return a view name', (done) => { - let calendar = initCalendar({ - moreLinkClick() { - return 'timeGridDay' - }, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - dayGridWrapper.openMorePopover() - setTimeout(() => { - let view = currentCalendar.view - expect(view.type).toBe('timeGridDay') - done() - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/more-link-popover-destroy.ts b/fullcalendar-main/tests/src/legacy/more-link-popover-destroy.ts deleted file mode 100644 index 1598fe9..0000000 --- a/fullcalendar-main/tests/src/legacy/more-link-popover-destroy.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' - -describe('more-link popover', () => { - pushOptions({ - initialView: 'dayGridMonth', - initialDate: '2014-08-01', - dayMaxEventRows: 3, - events: [ - { title: 'event1', start: '2014-07-28', end: '2014-07-30', className: 'event1' }, - { title: 'event2', start: '2014-07-29', end: '2014-07-31', className: 'event2' }, - { title: 'event3', start: '2014-07-29', className: 'event3' }, - { title: 'event4', start: '2014-07-29', className: 'event4' }, - ], - handleWindowResize: false, // because showing the popover causes scrollbars and fires resize - }) - - it('closes when user clicks the X and trigger eventWillUnmount for every render', (done) => { - let eventsRendered = {} - let renderCount = 0 - let activated = false - - let calendar = initCalendar({ - eventDidMount(arg) { - if (activated) { - eventsRendered[arg.event.title] = true - renderCount += 1 - } - }, - eventWillUnmount(arg) { - delete eventsRendered[arg.event.title] - renderCount -= 1 - }, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - // Activate flags and pop event limit popover - activated = true - dayGridWrapper.openMorePopover() - setTimeout(() => { - expect(dayGridWrapper.getMorePopoverEl()).toBeVisible() - - dayGridWrapper.closeMorePopover() - setTimeout(() => { - expect(dayGridWrapper.getMorePopoverEl()).not.toBeVisible() - expect(Object.keys(eventsRendered).length).toEqual(0) - expect(renderCount).toEqual(0) - done() - }) - }) - }) - - it('closes when user clicks outside of the popover and trigger eventWillUnmount for every render', (done) => { - let eventsRendered = {} - let renderCount = 0 - let activated = false - - let calendar = initCalendar({ - eventDidMount(arg) { - if (activated) { - eventsRendered[arg.event.title] = true - renderCount += 1 - } - }, - eventWillUnmount(arg) { - delete eventsRendered[arg.event.title] - renderCount -= 1 - }, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - // Activate flags and pop event limit popover - activated = true - dayGridWrapper.openMorePopover() - setTimeout(() => { - expect(dayGridWrapper.getMorePopoverEl()).toBeVisible() - - $('body').simulate('mousedown').simulate('click') - setTimeout(() => { - expect(dayGridWrapper.getMorePopoverEl()).not.toBeVisible() - expect(Object.keys(eventsRendered).length).toEqual(0) - expect(renderCount).toEqual(0) - done() - }) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/more-link-popover.ts b/fullcalendar-main/tests/src/legacy/more-link-popover.ts deleted file mode 100644 index 95fcf0d..0000000 --- a/fullcalendar-main/tests/src/legacy/more-link-popover.ts +++ /dev/null @@ -1,568 +0,0 @@ -import { EventInput } from '@fullcalendar/core' -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' -import { DayGridWrapper } from '../lib/wrappers/DayGridWrapper.js' - -describe('more-link popover', () => { - let testEvents: EventInput[] = [ - { title: 'event1', start: '2014-07-28', end: '2014-07-30', className: 'event1' }, - { title: 'event2', start: '2014-07-29', end: '2014-07-31', className: 'event2' }, - { title: 'event3', start: '2014-07-29', className: 'event3' }, - { title: 'event4', start: '2014-07-29', className: 'event4' }, - ] - - pushOptions({ - initialView: 'dayGridMonth', - initialDate: '2014-08-01', - dayMaxEventRows: 3, - events: testEvents, - dragScroll: false, // don't do autoscrolling while dragging. close quarters in PhantomJS - handleWindowResize: false, // because showing the popover causes scrollbars and fires resize - }) - - describeOptions('initialView', { - 'when in month view': 'dayGridMonth', - 'when in dayGridWeek view': 'dayGridWeek', - 'when in week view': 'timeGridWeek', - }, (viewName) => { - let ViewWrapper = viewName.match(/^dayGrid/) ? DayGridViewWrapper : TimeGridViewWrapper - - it('aligns horizontally with left edge of cell if LTR', (done) => { - let calendar = initCalendar({ - direction: 'ltr', - }) - setTimeout(() => { - let dayGridWrapper = new ViewWrapper(calendar).dayGrid - - dayGridWrapper.openMorePopover() - setTimeout(() => { - let cellLeft = dayGridWrapper.getDayEl('2014-07-29').getBoundingClientRect().left - let popoverLeft = dayGridWrapper.getMorePopoverEl().getBoundingClientRect().left - let diff = Math.abs(cellLeft - popoverLeft) - expect(diff).toBeLessThan(2) - done() - }) - }) - }) - - it('aligns horizontally with left edge of cell if RTL', (done) => { - let calendar = initCalendar({ - direction: 'rtl', - }) - setTimeout(() => { - let dayGridWrapper = new ViewWrapper(calendar).dayGrid - - dayGridWrapper.openMorePopover() - setTimeout(() => { - let cellRight = dayGridWrapper.getDayEl('2014-07-29').getBoundingClientRect().right - let popoverRight = dayGridWrapper.getMorePopoverEl().getBoundingClientRect().right - let diff = Math.abs(cellRight - popoverRight) - expect(diff).toBeLessThan(2) - done() - }) - }) - }) - }) - - describe('when in month view', () => { - pushOptions({ - initialView: 'dayGridMonth', - }) - - it('aligns with top of cell', (done) => { - let calendar = initCalendar() - setTimeout(() => { - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - dayGridWrapper.openMorePopover() - setTimeout(() => { - let cellTop = dayGridWrapper.getDayEl('2014-07-29').getBoundingClientRect().top - let popoverTop = dayGridWrapper.getMorePopoverEl().getBoundingClientRect().top - let diff = Math.abs(cellTop - popoverTop) - expect(diff).toBeLessThan(2) - done() - }) - }) - }) - - it('works with background events', (done) => { - let calendar = initCalendar({ - events: testEvents.concat([ - { - start: '2014-07-29', - display: 'background', - }, - ]), - }) - setTimeout(() => { - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - dayGridWrapper.openMorePopover() - setTimeout(() => { - expect(dayGridWrapper.getMorePopoverEventCnt()).toBeGreaterThan(1) - expect(dayGridWrapper.getMorePopoverBgEventCnt()).toBe(0) - done() - }) - }) - }) - - it('works with events that have invalid end times', (done) => { - let calendar = initCalendar({ - events: [ - { title: 'event1', start: '2014-07-29', end: '2014-07-29' }, - { title: 'event2', start: '2014-07-29', end: '2014-07-28' }, - { title: 'event3', start: '2014-07-29T00:00:00', end: '2014-07-29T00:00:00' }, - { title: 'event4', start: '2014-07-29T00:00:00', end: '2014-07-28T23:00:00' }, - ], - }) - setTimeout(() => { - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - dayGridWrapper.openMorePopover() - setTimeout(() => { - expect(dayGridWrapper.getMorePopoverEventCnt()).toBe(4) - done() - }) - }) - }) - - // issue 2385 - it('orders events correctly regardless of ID', (done) => { - let calendar = initCalendar({ - initialDate: '2012-03-22', - dayMaxEventRows: 3, - events: [ - { - id: '39957', - title: 'event01', - start: '2012-03-22T11:00:00', - end: '2012-03-22T11:30:00', - allDay: false, - }, - { - id: '40607', - title: 'event02', - start: '2012-03-22T16:15:00', - end: '2012-03-22T16:30:00', - allDay: false, - }, - { - id: '40760', - title: 'event03', - start: '2012-03-22T16:00:00', - end: '2012-03-22T16:15:00', - allDay: false, - }, - { - id: '41284', - title: 'event04', - start: '2012-03-22T19:00:00', - end: '2012-03-22T19:15:00', - allDay: false, - }, - { - id: '41645', - title: 'event05', - start: '2012-03-22T11:30:00', - end: '2012-03-22T12:00:00', - allDay: false, - }, - { - id: '41679', - title: 'event07', - start: '2012-03-22T12:00:00', - end: '2012-03-22T12:15:00', - allDay: false, - }, - { - id: '42246', - title: 'event08', - start: '2012-03-22T16:45:00', - end: '2012-03-22T17:00:00', - allDay: false, - }, - ], - }) - setTimeout(() => { - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - dayGridWrapper.openMorePopover() - setTimeout(() => { - let titles = dayGridWrapper.getMorePopoverEventTitles() - expect(titles).toEqual([ - 'event01', 'event05', 'event07', 'event03', 'event02', 'event08', 'event04', - ]) - done() - }) - }) - }) - - // https://github.com/fullcalendar/fullcalendar/issues/3856 - it('displays multi-day events only once', (done) => { - let calendar = initCalendar({ - initialDate: '2017-10-04', - events: [ - { - title: 'Long event', - className: 'long-event', - start: '2017-10-03', - end: '2017-10-20', - }, - { - title: 'Meeting', - className: 'meeting-event', - start: '2017-10-04T10:00:00', - end: '2017-10-04T12:00:00', - }, - { - title: 'Lunch 1', - className: 'lunch1-event', - start: '2017-10-04T12:00:00', - }, - { - title: 'Lunch 2', - className: 'lunch2-event', - start: '2017-10-04T14:00:00', - }, - ], - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - dayGridWrapper.openMorePopover() - setTimeout(() => { - let popoverEl = dayGridWrapper.getMorePopoverEl() - let eventEls = dayGridWrapper.getMorePopoverEventEls() - - expect(eventEls.length).toBe(4) - - let $longEventEl = $('.long-event', popoverEl) - let $meetingEventEl = $('.meeting-event', popoverEl) - let $lunch1EventEl = $('.lunch1-event', popoverEl) - let $lunch2EventEl = $('.lunch2-event', popoverEl) - - expect($longEventEl).not.toHaveClass(CalendarWrapper.EVENT_IS_START_CLASSNAME) - expect($longEventEl).not.toHaveClass(CalendarWrapper.EVENT_IS_END_CLASSNAME); - - [$meetingEventEl, $lunch1EventEl, $lunch2EventEl].forEach(($el) => { - expect($el).toHaveClass(CalendarWrapper.EVENT_IS_START_CLASSNAME) - expect($el).toHaveClass(CalendarWrapper.EVENT_IS_END_CLASSNAME) - }) - - done() - }) - }) - - // https://github.com/fullcalendar/fullcalendar/issues/4331 - it('displays events that were collapsed in previous days', (done) => { - let calendar = initCalendar({ - initialDate: '2018-10-01', - events: [ - { - title: 'e1', - start: '2018-10-18', - }, - { - title: 'e2', - start: '2018-10-18', - }, - { - title: 'e3', - start: '2018-10-18T11:00:00', - }, - { - title: 'e4', - start: '2018-10-18T12:00:00', - end: '2018-10-19T12:00:00', - }, - { - title: 'e5', - start: '2018-10-19', - className: 'event-e5', - }, - ], - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - dayGridWrapper.openMorePopover(1) // click the second +more link - setTimeout(done) - }) - }) - - describeOptions('initialView', { - 'when in dayGridWeek view': 'dayGridWeek', - 'when in week view': 'timeGridWeek', - }, (viewName) => { - let ViewWrapper = viewName.match(/^dayGrid/) ? DayGridViewWrapper : TimeGridViewWrapper - - it('aligns with top of header', (done) => { - let calendar = initCalendar() - let viewWrapper = new ViewWrapper(calendar) - let dayGridWrapper = viewWrapper.dayGrid - - dayGridWrapper.openMorePopover() - setTimeout(() => { - let popoverTop = dayGridWrapper.getMorePopoverEl().getBoundingClientRect().top - let headTop = viewWrapper.header.el.getBoundingClientRect().top - let diff = Math.abs(popoverTop - headTop) - expect(diff).toBeLessThan(2) - done() - }) - }) - }) - - // TODO: somehow test how the popover does to the edge of any scroll container - - it('closes when user clicks the X', (done) => { - let calendar = initCalendar() - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - dayGridWrapper.openMorePopover() - setTimeout(() => { - expect(dayGridWrapper.getMorePopoverEl()).toBeVisible() - - dayGridWrapper.closeMorePopover() - setTimeout(() => { - expect(dayGridWrapper.getMorePopoverEl()).not.toBeVisible() - done() - }) - }) - }) - - // https://github.com/fullcalendar/fullcalendar/issues/4584 - it('doesn\'t fire a dateClick', (done) => { - let dateClickCalled = false - - spyOnCalendarCallback('dateClick', () => { - dateClickCalled = true - }) - - let calendar = initCalendar() - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - dayGridWrapper.openMorePopover() - setTimeout(() => { - $.simulateMouseClick(dayGridWrapper.getMorePopoverHeaderEl()) - setTimeout(() => { // because click would take some time to register - expect(dateClickCalled).toBe(false) - done() - }, 500) - }) - }) - - it('doesn\'t close when user clicks somewhere inside of the popover', (done) => { - let calendar = initCalendar() - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - dayGridWrapper.openMorePopover() - setTimeout(() => { - let popoverEl = dayGridWrapper.getMorePopoverEl() - let popoverHeaderEl = dayGridWrapper.getMorePopoverHeaderEl() - - expect(popoverEl).toBeVisible() - expect(popoverHeaderEl).toBeInDOM() - - $(popoverHeaderEl).simulate('mousedown').simulate('click') - setTimeout(() => { - expect(popoverEl).toBeVisible() - done() - }) - }) - }) - - it('closes when user clicks outside of the popover', (done) => { - let calendar = initCalendar() - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - dayGridWrapper.openMorePopover() - setTimeout(() => { - let popoverEl = dayGridWrapper.getMorePopoverEl() - expect(popoverEl).toBeVisible() - - $('body').simulate('mousedown').simulate('click') - setTimeout(() => { - expect(popoverEl).not.toBeVisible() - done() - }) - }) - }) - - describe('when dragging events out', () => { - pushOptions({ - editable: true, - }) - - describe('when dragging an all-day event to a different day', () => { - it('should have the new day and remain all-day', (done) => { - let calendar = initCalendar({ - eventDrop(arg) { - expect(arg.event.start).toEqualDate('2014-07-28') - expect(arg.event.allDay).toBe(true) - done() - }, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - dayGridWrapper.openMorePopover() - setTimeout(() => { // simulate was getting confused about which thing was being clicked :( - $('.event4', dayGridWrapper.getMorePopoverEl()).simulate('drag', { - end: dayGridWrapper.getDayEl('2014-07-28'), - }) - }, 0) - }) - }) - - describe('when dragging a timed event to a whole day', () => { - it('should move to new day but maintain its time', (done) => { - let calendar = initCalendar({ - events: testEvents.concat([ - { - title: 'event5', - start: '2014-07-29T13:00:00', - className: 'event5', - }, - ]), - eventDrop(arg) { - expect(arg.event.start).toEqualDate('2014-07-28T13:00:00Z') - expect(arg.event.allDay).toBe(false) - done() - }, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - dayGridWrapper.openMorePopover() - setTimeout(() => { // simulate was getting confused about which thing was being clicked :( - $('.event5', dayGridWrapper.getMorePopoverEl()).simulate('drag', { - end: dayGridWrapper.getDayEl('2014-07-28T13:00:00'), - }) - }, 0) - }) - }) - - describe('when dragging a whole day event to a timed slot', () => { - it('should assume the new time, with a cleared end', (done) => { - let calendar = initCalendar({ - initialView: 'timeGridWeek', - scrollTime: '00:00:00', - eventDrop(arg) { - expect(arg.event.start).toEqualDate('2014-07-30T03:00:00Z') - expect(arg.event.allDay).toBe(false) - done() - }, - }) - let viewWrapper = new TimeGridViewWrapper(calendar) - let dayGridWrapper = viewWrapper.dayGrid - - dayGridWrapper.openMorePopover() - setTimeout(() => { // simulate was getting confused about which thing was being clicked :( - $('.event4', dayGridWrapper.getMorePopoverEl()).simulate('drag', { - localPoint: { left: '0%', top: '50%' }, // leftmost is guaranteed to be over the 30th - end: viewWrapper.timeGrid.getPoint('2014-07-30T03:00:00'), - }) - }, 0) - }) - }) - - describe('when a single-day event isn\'t dragged out all the way', () => { - it('shouldn\'t do anything', (done) => { - let dayGridWrapper - let calendar = initCalendar({ - eventDragStop() { - setTimeout(() => { // try to wait until drag is over. eventMutation won't fire BTW - expect(dayGridWrapper.getMorePopoverEl()).toBeInDOM() - done() - }, 0) - }, - }) - let viewWrapper = new DayGridViewWrapper(calendar) - dayGridWrapper = viewWrapper.dayGrid - dayGridWrapper.openMorePopover() - - setTimeout(() => { // simulate was getting confused about which thing was being clicked :( - $('.event1', dayGridWrapper.getMorePopoverEl()).simulate('drag', { - localPoint: { left: '0%', top: '50%' }, // leftmost is guaranteed to be over the 30th - dx: 20, - }) - }, 0) - }) - }) - }) - - it('calls event render handlers', (done) => { - let options = { - events: [ - { title: 'event1', start: '2014-07-28', end: '2014-07-30', className: 'event1' }, - { title: 'event2', start: '2014-07-29', end: '2014-07-31', className: 'event2' }, - { title: 'event3', start: '2014-07-29', className: 'event3' }, - { title: 'event4', start: '2014-07-29', className: 'event4' }, - ], - eventDidMount() {}, - eventContent() {}, - eventWillUnmount() {}, - } - - spyOn(options, 'eventDidMount') - spyOn(options, 'eventContent') - spyOn(options, 'eventWillUnmount') - - function resetCounts() { - options.eventDidMount.calls.reset() - options.eventContent.calls.reset() - options.eventWillUnmount.calls.reset() - } - - let calendar = initCalendar(options) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - expect(options.eventDidMount.calls.count()).toBe(4) - expect(options.eventContent.calls.count()).toBe(4) - expect(options.eventWillUnmount.calls.count()).toBe(0) - - resetCounts() - dayGridWrapper.openMorePopover() - setTimeout(() => { - expect(options.eventDidMount.calls.count()).toBe(4) - expect(options.eventContent.calls.count()).toBe(4) - expect(options.eventWillUnmount.calls.count()).toBe(0) - - resetCounts() - dayGridWrapper.closeMorePopover() - setTimeout(() => { - expect(options.eventDidMount.calls.count()).toBe(0) - expect(options.eventContent.calls.count()).toBe(0) - expect(options.eventWillUnmount.calls.count()).toBe(4) - - done() - }) - }) - }) - - it('displays latest events after refetch', (done) => { - let fetchCnt = 0 - let newTitle = 'cool' - let calendar = initCalendar({ - events(info, callback) { - fetchCnt += 1 - if (fetchCnt === 1) { - callback(testEvents) - } else { - callback(testEvents.slice(0, -1).concat([ - { - ...testEvents[testEvents.length - 1], - title: newTitle, - }, - ])) - } - }, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - dayGridWrapper.openMorePopover() - setTimeout(() => { - calendar.refetchEvents() - let eventEls = dayGridWrapper.getMorePopoverEventEls() - let eventInfo = DayGridWrapper.getEventElInfo(eventEls[2]) - expect(eventInfo.title).toBe(newTitle) - done() - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/more-link-text.ts b/fullcalendar-main/tests/src/legacy/more-link-text.ts deleted file mode 100644 index 62a7b4d..0000000 --- a/fullcalendar-main/tests/src/legacy/more-link-text.ts +++ /dev/null @@ -1,52 +0,0 @@ -import frLocale from '@fullcalendar/core/locales/fr' -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' - -describe('moreLinkText', () => { - pushOptions({ - initialDate: '2014-08-01', // important that it is the first week, so works w/ month + week views - initialView: 'dayGridMonth', - dayMaxEventRows: 3, - events: [ - { title: 'event1', start: '2014-07-29' }, - { title: 'event2', start: '2014-07-29' }, - { title: 'event2', start: '2014-07-29' }, - { title: 'event2', start: '2014-07-29' }, - ], - }) - - it('allows a string', () => { - let calendar = initCalendar({ - moreLinkText: 'extra', - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - expect(dayGridWrapper.getMoreEl()).toHaveText('+2 extra') - }) - - it('allows a function', () => { - let calendar = initCalendar({ - moreLinkText(n) { - expect(typeof n).toBe('number') - return 'there are ' + n + ' more events!' - }, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - expect(dayGridWrapper.getMoreEl()).toHaveText('there are 2 more events!') - }) - - it('has a default value that is affected by the custom locale', () => { - let calendar = initCalendar({ - locale: frLocale, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - expect(dayGridWrapper.getMoreEl()).toHaveText('+2 en plus') - }) - - it('is not affected by a custom locale when the value is explicitly specified', () => { - let calendar = initCalendar({ - locale: frLocale, - moreLinkText: 'extra', - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - expect(dayGridWrapper.getMoreEl()).toHaveText('+2 extra') - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/more-link-timegrid.ts b/fullcalendar-main/tests/src/legacy/more-link-timegrid.ts deleted file mode 100644 index 7b77fbf..0000000 --- a/fullcalendar-main/tests/src/legacy/more-link-timegrid.ts +++ /dev/null @@ -1,101 +0,0 @@ -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' -import { TimeGridWrapper } from '../lib/wrappers/TimeGridWrapper.js' - -describe('eventMaxStack', () => { - pushOptions({ - initialView: 'timeGridDay', - initialDate: '2021-05-07', - scrollTime: 0, - eventMaxStack: 2, - }) - - it('puts hidden events in a popover', (done) => { - let calendar = initCalendar({ - events: [ - { start: '2021-05-07T00:00:00', end: '2021-05-07T01:00:00' }, - { start: '2021-05-07T00:00:00', end: '2021-05-07T01:00:00' }, - { start: '2021-05-07T00:00:00', end: '2021-05-07T01:00:00' }, // hidden - ], - }) - let timeGrid = new TimeGridViewWrapper(calendar).timeGrid - let moreLinkEls = timeGrid.getMoreEls() - expect(moreLinkEls.length).toBe(1) - - timeGrid.openMorePopover() - setTimeout(() => { - let moreEventEls = timeGrid.getMorePopoverEventEls() - expect(moreEventEls.length).toBe(1) - done() - }) - }) - - it('can drag events out of popover', (done) => { - let calendar = initCalendar({ - editable: true, - events: [ - { id: '1', start: '2021-05-07T00:00:00', end: '2021-05-07T01:00:00' }, - { id: '2', start: '2021-05-07T00:00:00', end: '2021-05-07T01:00:00' }, - { id: '3', start: '2021-05-07T00:00:00', end: '2021-05-07T01:00:00' }, // hidden - ], - }) - let timeGrid = new TimeGridViewWrapper(calendar).timeGrid - timeGrid.openMorePopover() - setTimeout(() => { - let moreEventEls = timeGrid.getMorePopoverEventEls() - let newStart = '2021-05-07T02:00:00' - $(moreEventEls).simulate('drag', { - end: timeGrid.getPoint(newStart), - onRelease() { - let event = calendar.getEventById('3') - expect(event.start).toEqualDate(newStart) - done() - }, - }) - }) - }) - - it('causes separate adjacent more links', () => { - let calendar = initCalendar({ - events: [ - { start: '2021-05-07T00:00:00', end: '2021-05-07T01:00:00' }, - { start: '2021-05-07T00:00:00', end: '2021-05-07T01:00:00' }, - { start: '2021-05-07T00:00:00', end: '2021-05-07T01:00:00' }, // hidden - { start: '2021-05-07T01:00:00', end: '2021-05-07T02:00:00' }, - { start: '2021-05-07T01:00:00', end: '2021-05-07T02:00:00' }, - { start: '2021-05-07T01:00:00', end: '2021-05-07T02:00:00' }, // hidden - ], - }) - let timeGrid = new TimeGridViewWrapper(calendar).timeGrid - let moreLinkEls = timeGrid.getMoreEls() - expect(moreLinkEls.length).toBe(2) - }) - - it('puts overlapping hidden events in same popover, respecting eventOrder', (done) => { - let calendar = initCalendar({ - eventOrder: 'title', - events: [ - { title: '1', start: '2021-05-07T00:00:00', end: '2021-05-07T02:00:00' }, - { title: '2', start: '2021-05-07T00:00:00', end: '2021-05-07T02:00:00' }, - { title: '3', start: '2021-05-07T01:00:00', end: '2021-05-07T03:00:00' }, // hidden - { title: '4', start: '2021-05-07T00:30:00', end: '2021-05-07T02:30:00' }, // hidden - ], - }) - let timeGrid = new TimeGridViewWrapper(calendar).timeGrid - let moreLinkEls = timeGrid.getMoreEls() - expect(moreLinkEls.length).toBe(1) - - const canvasCoords = timeGrid.el.getBoundingClientRect() - const moreLinkCoords = moreLinkEls[0].getBoundingClientRect() - const moreLinkTop = moreLinkCoords.top - canvasCoords.top - // TODO: more precise coord matching - expect(moreLinkTop).toBeGreaterThan(10) - - timeGrid.openMorePopover() - setTimeout(() => { - let moreEventEls = timeGrid.getMorePopoverEventEls() - expect(moreEventEls.length).toBe(2) - expect(TimeGridWrapper.getEventElInfo(moreEventEls[0]).title).toBe('3') - done() - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/more-link.ts b/fullcalendar-main/tests/src/legacy/more-link.ts deleted file mode 100644 index 86d8502..0000000 --- a/fullcalendar-main/tests/src/legacy/more-link.ts +++ /dev/null @@ -1,247 +0,0 @@ -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' -import { filterVisibleEls } from '../lib/dom-misc.js' - -describe('dayMaxEventRows', () => { - pushOptions({ - initialDate: '2014-08-01', // important that it is the first week, so works w/ month + week views - dayMaxEventRows: 3, - }) - - describe('as a number', () => { - describeOptions('initialView', { - 'when in month view': 'dayGridMonth', - 'when in dayGridWeek view': 'dayGridWeek', - 'when in week view': 'timeGridWeek', - }, (viewName) => { - let ViewWrapper = viewName.match(/^dayGrid/) ? DayGridViewWrapper : TimeGridViewWrapper - - it('doesn\'t display a more link when limit is more than the # of events', () => { - let calendar = initCalendar({ - events: [ - { title: 'event1', start: '2014-07-29' }, - { title: 'event2', start: '2014-07-29' }, - ], - }) - let dayGridWrapper = new ViewWrapper(calendar).dayGrid - expect(dayGridWrapper.getMoreEls().length).toBe(0) - }) - - it('doesn\'t display a more link when limit equal to the # of events', () => { - let calendar = initCalendar({ - events: [ - { title: 'event1', start: '2014-07-29' }, - { title: 'event2', start: '2014-07-29' }, - { title: 'event2', start: '2014-07-29' }, - ], - }) - let dayGridWrapper = new ViewWrapper(calendar).dayGrid - expect(dayGridWrapper.getMoreEls().length).toBe(0) - }) - - it('displays a more link when limit is less than the # of events', () => { - let calendar = initCalendar({ - events: [ - { title: 'event1', start: '2014-07-29' }, - { title: 'event2', start: '2014-07-29' }, - { title: 'event2', start: '2014-07-29' }, - { title: 'event2', start: '2014-07-29' }, - ], - }) - let dayGridWrapper = new ViewWrapper(calendar).dayGrid - let moreEls = dayGridWrapper.getMoreEls() - expect(moreEls.length).toBe(1) - expect(moreEls[0]).toHaveText('+2 more') - }) - - it('displays one more per day, when a multi-day event is above', () => { - let calendar = initCalendar({ - events: [ - { title: 'event1', start: '2014-07-29', end: '2014-07-31' }, - { title: 'event2', start: '2014-07-29', end: '2014-07-31' }, - { title: 'event2', start: '2014-07-29', end: '2014-07-31' }, - { title: 'event2', start: '2014-07-29', end: '2014-07-31' }, - ], - }) - let dayGridWrapper = new ViewWrapper(calendar).dayGrid - let moreEls = dayGridWrapper.getMoreEls() - let cells = dayGridWrapper.getDayElsInRow(0) - expect(moreEls.length).toBe(2) - expect(moreEls[0]).toHaveText('+2 more') - expect(moreEls[0]).toBeBoundedBy(cells[2]) - expect(moreEls[1]).toHaveText('+2 more') - expect(moreEls[1]).toBeBoundedBy(cells[3]) - }) - - it('will render a pertially hidden single-day event', () => { - let calendar = initCalendar({ - events: [ - { title: 'event1', start: '2014-07-29', end: '2014-07-31' }, - { title: 'event2', start: '2014-07-29', end: '2014-07-31' }, - { title: 'event3', start: '2014-07-29', end: '2014-07-31' }, - { title: 'event4', start: '2014-07-29' }, - ], - }) - let dayGridWrapper = new ViewWrapper(calendar).dayGrid - let eventEls = dayGridWrapper.getEventEls() - let visibleEventEls = filterVisibleEls(eventEls) - let moreEls = dayGridWrapper.getMoreEls() - let cells = dayGridWrapper.getAllDayEls() - expect(visibleEventEls.length).toBe(3) - expect(moreEls.length).toBe(1) - expect(moreEls[0]).toHaveText('+2 more') - expect(moreEls[0]).toBeBoundedBy(cells[2]) - }) - - // https://github.com/fullcalendar/fullcalendar/issues/6187 - it('will render a partially multi-day hidden event', () => { - let calendar = initCalendar({ - events: [ - { title: 'event1', start: '2014-07-28', end: '2014-07-30' }, - { title: 'event2', start: '2014-07-28', end: '2014-07-30' }, - { title: 'event3', start: '2014-07-28', end: '2014-07-30' }, - { title: 'event4', start: '2014-07-29', end: '2014-07-31' }, - ], - }) - let dayGridWrapper = new ViewWrapper(calendar).dayGrid - let eventEls = dayGridWrapper.getEventEls() - let visibleEventEls = filterVisibleEls(eventEls) - let moreEls = dayGridWrapper.getMoreEls() - let cells = dayGridWrapper.getDayElsInRow(0) - expect(visibleEventEls.length).toBe(4) - expect(moreEls.length).toBe(1) - expect(moreEls[0]).toHaveText('+2 more') - expect(moreEls[0]).toBeBoundedBy(cells[2]) - }) - - it('will render a link in place of a hidden single day event, if covered by a multi-day', () => { - let calendar = initCalendar({ - events: [ - { title: 'event1', start: '2014-07-28', end: '2014-07-30' }, - { title: 'event2', start: '2014-07-28', end: '2014-07-30' }, - { title: 'event3', start: '2014-07-28' }, - { title: 'event4', start: '2014-07-28' }, - ], - }) - let dayGridWrapper = new ViewWrapper(calendar).dayGrid - let cells = dayGridWrapper.getDayElsInRow(0) - let moreEls = dayGridWrapper.getMoreEls() - expect(moreEls.length).toBe(1) - expect(moreEls[0]).toHaveText('+2 more') - expect(moreEls[0]).toBeBoundedBy(cells[1]) - }) - - it('will render a link in place of a hidden single day event, if covered by a multi-day ' + - 'and in its second column', - () => { - let calendar = initCalendar({ - events: [ - { title: 'event1', start: '2014-07-28', end: '2014-07-30' }, - { title: 'event2', start: '2014-07-28', end: '2014-07-30' }, - { title: 'event3', start: '2014-07-29' }, - { title: 'event4', start: '2014-07-29' }, - ], - }) - let dayGridWrapper = new ViewWrapper(calendar).dayGrid - let cells = dayGridWrapper.getDayElsInRow(0) - let moreEls = dayGridWrapper.getMoreEls() - expect(moreEls.length).toBe(1) - expect(moreEls[0]).toHaveText('+2 more') - expect(moreEls[0]).toBeBoundedBy(cells[2]) - }) - }) - }) - - describe('when auto', () => { - pushOptions({ - dayMaxEvents: true, - }) - - describe('in month view', () => { - pushOptions({ - initialView: 'dayGridMonth', - events: [ - { title: 'event1', start: '2014-07-28', end: '2014-07-30' }, - { title: 'event2', start: '2014-07-28', end: '2014-07-30' }, - { title: 'event2', start: '2014-07-29' }, - { title: 'event2', start: '2014-07-29' }, - { title: 'event2', start: '2014-07-29' }, - { title: 'event2', start: '2014-07-29' }, - { title: 'event2', start: '2014-07-29' }, - { title: 'event2', start: '2014-07-29' }, - { title: 'event2', start: '2014-07-29' }, - { title: 'event2', start: '2014-07-29' }, - { title: 'event2', start: '2014-07-29' }, - { title: 'event2', start: '2014-07-29' }, - { title: 'event2', start: '2014-07-29' }, - ], - }) - - it('renders the heights of all the rows the same, regardless of # of events', () => { - let calendar = initCalendar() - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let rowEls = dayGridWrapper.getRowEls() - expect(rowEls.length).toBeGreaterThan(0) - - let rowHeights = rowEls.map((rowEl) => rowEl.getBoundingClientRect().height) - let totalHeight = rowHeights.reduce((prev, current) => prev + current, 0) - let aveHeight = totalHeight / rowHeights.length - - rowHeights.forEach((rowHeight) => { - let diff = Math.abs(rowHeight - aveHeight) - expect(diff).toBeLessThan(2) - }) - }) - - it('renders a more link when there are obviously too many events', () => { - let $el = $('
').appendTo('body').width(800) - let calendar = initCalendar({}, $el) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - let moreEls = dayGridWrapper.getMoreEls() - expect(moreEls.length).toBe(1) - }) - }) - - describeOptions('initialView', { - 'when in month view': 'dayGridMonth', - 'when in dayGridWeek view': 'dayGridWeek', - }, () => { - it('doesn\'t render a more link where there should obviously not be a limit', () => { - let calendar = initCalendar({ - events: [ - { title: 'event1', start: '2014-07-28', end: '2014-07-30' }, - ], - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - expect(dayGridWrapper.getMoreEls().length).toBe(0) - }) - }) - - describe('in week view', () => { - pushOptions({ - initialView: 'timeGridWeek', - }) - - it('behaves as if limit is 5', () => { - let calendar = initCalendar({ - events: [ - { title: 'event1', start: '2014-07-29' }, - { title: 'event2', start: '2014-07-29' }, - { title: 'event2', start: '2014-07-29' }, - { title: 'event2', start: '2014-07-29' }, - { title: 'event2', start: '2014-07-29' }, - { title: 'event2', start: '2014-07-29' }, - { title: 'event2', start: '2014-07-29' }, - ], - }) - let dayGridWrapper = new TimeGridViewWrapper(calendar).dayGrid - let eventEls = filterVisibleEls(dayGridWrapper.getEventEls()) - let moreEls = dayGridWrapper.getMoreEls() - - expect(eventEls.length).toBe(4) - expect(moreEls.length).toBe(1) - expect(moreEls[0]).toHaveText('+3 more') - }) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/navLinks.ts b/fullcalendar-main/tests/src/legacy/navLinks.ts deleted file mode 100644 index a1a2829..0000000 --- a/fullcalendar-main/tests/src/legacy/navLinks.ts +++ /dev/null @@ -1,208 +0,0 @@ -import { addDays } from '@fullcalendar/core/internal' -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' -import { ListViewWrapper } from '../lib/wrappers/ListViewWrapper.js' - -describe('navLinks', () => { - pushOptions({ - now: '2016-08-20', - navLinks: true, - headerToolbar: { - left: 'prev,next today', - center: 'title', - right: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek', // affects which view is jumped to by default - }, - }) - - describeTimeZones((tz) => { - describe('in month view', () => { - pushOptions({ - initialView: 'dayGridMonth', - }) - - it('moves to day', () => { - let dateClickSpy = spyOnCalendarCallback('dateClick') - let calendar = initCalendar() - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - dayGridWrapper.clickNavLink('2016-08-09') - expectDayView(calendar, 'timeGridDay', tz.parseDate('2016-08-09')) - expect(dateClickSpy).not.toHaveBeenCalled() - }) - - // https://github.com/fullcalendar/fullcalendar/issues/4619 - it('moves to day when no toolbars', () => { - let dateClickSpy = spyOnCalendarCallback('dateClick') - let calendar = initCalendar({ - headerToolbar: null, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - dayGridWrapper.clickNavLink('2016-08-09') - expectDayView(calendar, 'dayGridDay', tz.parseDate('2016-08-09')) // is hash-key order-dependent I think :( - expect(dateClickSpy).not.toHaveBeenCalled() - }) - - // https://github.com/fullcalendar/fullcalendar/issues/3869 - it('moves to two different days', () => { - let dateClickSpy = spyOnCalendarCallback('dateClick') - let calendar = initCalendar() - - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - dayGridWrapper.clickNavLink('2016-08-09') - expectDayView(calendar, 'timeGridDay', tz.parseDate('2016-08-09')) - expect(dateClickSpy).not.toHaveBeenCalled() - - calendar.changeView('dayGridMonth') - let dayGridWrapper2 = new DayGridViewWrapper(calendar).dayGrid - dayGridWrapper2.clickNavLink('2016-08-10') - expectDayView(calendar, 'timeGridDay', tz.parseDate('2016-08-10')) - }) - - it('moves to day specifically', () => { - let dateClickSpy = spyOnCalendarCallback('dateClick') - let calendar = initCalendar({ - navLinkDayClick: 'day', - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - dayGridWrapper.clickNavLink('2016-08-09') - expectDayView(calendar, 'timeGridDay', tz.parseDate('2016-08-09')) - expect(dateClickSpy).not.toHaveBeenCalled() - }) - - it('moves to dayGridDay specifically', () => { - let dateClickSpy = spyOnCalendarCallback('dateClick') - let calendar = initCalendar({ - navLinkDayClick: 'dayGridDay', - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - dayGridWrapper.clickNavLink('2016-08-09') - expectDayView(calendar, 'dayGridDay', tz.parseDate('2016-08-09')) - expect(dateClickSpy).not.toHaveBeenCalled() - }) - - it('executes a custom handler', () => { - let dateClickSpy = spyOnCalendarCallback('dateClick') - let navLinkDayClickSpy = spyOnCalendarCallback('navLinkDayClick', (date, ev) => { - expect(date).toEqualDate(tz.parseDate('2016-08-09')) - expect(typeof ev).toBe('object') - }) - let calendar = initCalendar() - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - dayGridWrapper.clickNavLink('2016-08-09') - expect(dateClickSpy).not.toHaveBeenCalled() - expect(navLinkDayClickSpy).toHaveBeenCalled() - }) - - describe('with weekNumbers', () => { - pushOptions({ - weekNumbers: true, - }) - - it('moves to week', () => { - let dateClickSpy = spyOnCalendarCallback('dateClick') - let calendar = initCalendar() - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - $.simulateMouseClick(dayGridWrapper.getWeekNavLinkEls()[1]) - expectWeekView(calendar, 'timeGridWeek', tz.parseDate('2016-08-07')) - expect(dateClickSpy).not.toHaveBeenCalled() - }) - }) - - it('does not have clickable day header', () => { - let calendar = initCalendar() - let headerWrapper = new DayGridViewWrapper(calendar).header - - expect(headerWrapper.getNavLinkEls().length).toBe(0) - }) - }) - }) - - describe('in week view', () => { - pushOptions({ - initialView: 'timeGridWeek', - }) - - it('moves to day view', () => { - let dateClickSpy = spyOnCalendarCallback('dateClick') - let calendar = initCalendar() - let headerWrapper = new TimeGridViewWrapper(calendar).header - - headerWrapper.clickNavLink('2016-08-15') - expectDayView(calendar, 'timeGridDay', '2016-08-15') - expect(dateClickSpy).not.toHaveBeenCalled() - }) - }) - - describe('in listWeek', () => { - pushOptions({ - initialView: 'listWeek', - events: [ - { - title: 'event 1', - start: '2016-08-20', - }, - ], - }) - - it('moves to day view', () => { - let dateClickSpy = spyOnCalendarCallback('dateClick') - let calendar = initCalendar() - let listWrapper = new ListViewWrapper(calendar) - - listWrapper.clickNavLink('2016-08-20') - expectDayView(calendar, 'timeGridDay', '2016-08-20') - expect(dateClickSpy).not.toHaveBeenCalled() - }) - }) - - describe('in day view', () => { - pushOptions({ - initialView: 'timeGridDay', - }) - - it('moves to week view', () => { - let dateClickSpy = spyOnCalendarCallback('dateClick') - let calendar = initCalendar({ - weekNumbers: true, - }) - let viewWrapper = new TimeGridViewWrapper(calendar) - - $.simulateMouseClick(viewWrapper.getHeaderWeekNumberLink()) - expectWeekView(calendar, 'timeGridWeek', '2016-08-14') - expect(dateClickSpy).not.toHaveBeenCalled() - }) - - it('does not have a clickable day header', () => { - let calendar = initCalendar() - let headerWrapper = new TimeGridViewWrapper(calendar).header - - expect(headerWrapper.getNavLinkEls().length).toBe(0) - }) - }) - - function expectDayView(calendar, viewName, dayDate) { - let calendarWrapper = new CalendarWrapper(calendar) - let start = calendar.view.activeStart - let end = calendar.view.activeEnd - - expect(calendarWrapper.getViewName()).toBe(viewName) - expect(start).toEqualDate(dayDate) - expect(addDays(end, -1)).toEqualDate(dayDate) - } - - function expectWeekView(calendar, viewName, firstDayDate) { - let calendarWrapper = new CalendarWrapper(calendar) - let start = calendar.view.activeStart - let end = calendar.view.activeEnd - - expect(calendarWrapper.getViewName()).toBe(viewName) - expect(start).toEqualDate(firstDayDate) - expect(addDays(end, -7)).toEqualDate(firstDayDate) - } -}) diff --git a/fullcalendar-main/tests/src/legacy/nextDayThreshold.ts b/fullcalendar-main/tests/src/legacy/nextDayThreshold.ts deleted file mode 100644 index 5afaee1..0000000 --- a/fullcalendar-main/tests/src/legacy/nextDayThreshold.ts +++ /dev/null @@ -1,85 +0,0 @@ -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' - -describe('nextDayThreshold', () => { - // when a view object exposes its nextDayThreshold value (after some refactoring)... - // TODO: detect the default of 9am - // TODO: detect 2 or more different types of Duration-ish parsing - - it('renders an event before the threshold', () => { - let calendar = initCalendar({ - nextDayThreshold: '10:00:00', - initialDate: '2014-06', - initialView: 'dayGridMonth', - events: [ - { - title: 'event1', - start: '2014-06-08T22:00:00', - end: '2014-06-10T09:00:00', - }, - ], - }) - expect(renderedDayCount(calendar)).toBe(2) - }) - - it('renders an event equal to the threshold', () => { - let calendar = initCalendar({ - nextDayThreshold: '10:00:00', - initialDate: '2014-06', - initialView: 'dayGridMonth', - events: [ - { - title: 'event1', - start: '2014-06-08T22:00:00', - end: '2014-06-10T10:00:00', - }, - ], - }) - expect(renderedDayCount(calendar)).toBe(3) - }) - - it('renders an event after the threshold', () => { - let calendar = initCalendar({ - nextDayThreshold: '10:00:00', - initialDate: '2014-06', - initialView: 'dayGridMonth', - events: [ - { - title: 'event1', - start: '2014-06-08T22:00:00', - end: '2014-06-10T11:00:00', - }, - ], - }) - expect(renderedDayCount(calendar)).toBe(3) - }) - - it('won\'t render an event that ends before the first day\'s threshold', () => { - let calendar = initCalendar({ - initialView: 'dayGridMonth', - initialDate: '2017-10-01', - nextDayThreshold: '09:00:00', - events: [{ - start: '2017-09-30T08:00:00', - end: '2017-10-01T08:00:00', - }], - }) - let calendarWrapper = new CalendarWrapper(calendar) - - expect(calendarWrapper.getEventEls().length).toBe(0) - }) - - function renderedDayCount(calendar) { // assumes only one event on the calendar - let headerWrapper = new DayGridViewWrapper(calendar).header - let dayEl = headerWrapper.getCellEl(0) - let cellWidth = $(dayEl).outerWidth() // works with dayGrid and timeGrid - let totalWidth = 0 - - let eventEls = new CalendarWrapper(calendar).getEventEls() - $(eventEls).each((i, eventEl) => { - totalWidth += $(eventEl).outerWidth() - }) - - return Math.round(totalWidth / cellWidth) - } -}) diff --git a/fullcalendar-main/tests/src/legacy/now.ts b/fullcalendar-main/tests/src/legacy/now.ts deleted file mode 100644 index 78c8fe2..0000000 --- a/fullcalendar-main/tests/src/legacy/now.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { parseUtcDate } from '../lib/date-parsing.js' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('now', () => { - pushOptions({ - initialDate: '2014-05-01', - }) - - describe('when month view', () => { - pushOptions({ - initialView: 'dayGridMonth', - }) - - it('changes the highlighted day when customized', () => { - let calendar = initCalendar({ - now: '2014-05-06', - }) - expectRenderedTodayDate(calendar, '2014-05-06') - }) - }) - - describe('when week view', () => { - pushOptions({ - initialView: 'timeGridWeek', - }) - - it('changes the highlighted day when customized', () => { - let calendar = initCalendar({ - now: '2014-04-29T12:00:00', - }) - expectRenderedTodayDate(calendar, '2014-04-29') - }) - }) - - it('accepts a function that returns a Date', () => { - let calendar = initCalendar({ - initialView: 'dayGridMonth', - now() { - return parseUtcDate('2014-05-01') - }, - }) - expectRenderedTodayDate(calendar, '2014-05-01') - }) - - it('accepts a function that returns a date string', () => { - let calendar = initCalendar({ - initialView: 'dayGridMonth', - now() { - return '2014-05-01' - }, - }) - expectRenderedTodayDate(calendar, '2014-05-01') - }) - - function expectRenderedTodayDate(calendar, expectedDate) { - let calendarWrapper = new CalendarWrapper(calendar) - let todayCell = calendarWrapper.getTodayEls()[0] - let todayDate = todayCell.getAttribute('data-date') - expect(todayDate).toEqual(expectedDate) - } -}) diff --git a/fullcalendar-main/tests/src/legacy/nowIndicator.ts b/fullcalendar-main/tests/src/legacy/nowIndicator.ts deleted file mode 100644 index 522dc0c..0000000 --- a/fullcalendar-main/tests/src/legacy/nowIndicator.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { getBoundingRect } from '../lib/dom-geom.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('now indicator', () => { - pushOptions({ - now: '2015-12-26T06:00:00', - scrollTime: '00:00', - initialView: 'timeGridWeek', - }) - - it('doesn\'t render by default', () => { - let calendar = initCalendar() - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - expect(timeGridWrapper.hasNowIndicator()).toBe(false) - }) - - describe('when activated', () => { - pushOptions({ - nowIndicator: true, - }) - - describeOptions('direction', { - 'when LTR': 'ltr', - 'when RTL': 'rtl', - }, () => { - it('doesn\'t render when out of view', () => { - let calendar = initCalendar({ - initialDate: '2015-12-27', // sun of next week - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - expect(timeGridWrapper.hasNowIndicator()).toBe(false) - }) - - it('renders on correct time', () => { - let calendar = initCalendar() - isNowIndicatorRenderedAt(calendar, '2015-12-26T06:00:00Z') - }) - - it('renders on correct time2', () => { - let calendar = initCalendar({ - now: '2015-12-20T02:30:00', - }) - isNowIndicatorRenderedAt(calendar, '2015-12-20T02:30:00Z') - }) - }) - }) - - function isNowIndicatorRenderedAt(calendar, date) { - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let line = timeGridWrapper.getLine(date) - let lineEl = timeGridWrapper.getNowIndicatorLineEl() - let arrowEl = timeGridWrapper.getNowIndicatorArrowEl() - - expect(lineEl).toBeTruthy() - expect(arrowEl).toBeTruthy() - - let lineElRect = getBoundingRect(lineEl) - let arrowElRect = getBoundingRect(arrowEl) - - expect(Math.abs( - (lineElRect.top + lineElRect.bottom) / 2 - - line.top, - )).toBeLessThan(2) - expect(Math.abs( - (arrowElRect.top + arrowElRect.bottom) / 2 - - line.top, - )).toBeLessThan(2) - - let timeGridRect = getBoundingRect(timeGridWrapper.el) - - if (calendar.getOption('direction') === 'rtl') { - expect(Math.abs( - arrowElRect.right - timeGridRect.right, - )).toBeLessThan(2) - } else { - expect(Math.abs( - arrowElRect.left - timeGridRect.left, - )).toBeLessThan(2) - } - } -}) diff --git a/fullcalendar-main/tests/src/legacy/overlap.ts b/fullcalendar-main/tests/src/legacy/overlap.ts deleted file mode 100644 index 74f20d1..0000000 --- a/fullcalendar-main/tests/src/legacy/overlap.ts +++ /dev/null @@ -1,804 +0,0 @@ -import { testEventDrag, testEventResize, testSelection } from '../lib/dnd-resize-utils.js' - -describe('event overlap', () => { - let options - - beforeEach(() => { - options = { - initialDate: '2014-11-04', - initialView: 'timeGridWeek', - scrollTime: '00:00', - } - }) - - describe('when other event overlap is false', () => { - describe('when dragged adjacently before the other event', () => { - describe('when subject event\'s end is explicit', () => { - it('allows dragging', (done) => { - options.events = [ - { - title: 'Event A', - className: 'event-a', - start: '2014-11-04T01:00:00', - end: '2014-11-04T03:00:00', - }, - { - title: 'Event B', - className: 'event-b', - start: '2014-11-04T05:00:00', - end: '2014-11-04T09:00:00', - overlap: false, - }, - ] - testEventDrag(options, '2014-11-04T03:00:00', true, done, 'event-a') - }) - }) - describe('when subject event\'s end is implied', () => { - it('allows dragging', (done) => { - options.defaultTimedEventDuration = '01:30' - options.events = [ - { - title: 'Event A', - className: 'event-a', - start: '2014-11-04T01:00:00', - }, - { - title: 'Event B', - className: 'event-b', - start: '2014-11-04T05:00:00', - end: '2014-11-04T09:00:00', - overlap: false, - }, - ] - testEventDrag(options, '2014-11-04T03:30:00', true, done, 'event-a') - }) - }) - }) - - describe('when dragged adjacently after the other event', () => { - it('allows dragging', (done) => { - options.events = [ - { - title: 'Event A', - className: 'event-a', - start: '2014-11-04T01:00:00', - end: '2014-11-04T03:00:00', - }, - { - title: 'Event B', - className: 'event-b', - start: '2014-11-04T05:00:00', - end: '2014-11-04T09:00:00', - overlap: false, - }, - ] - testEventDrag(options, '2014-11-04T09:00:00', true, done, 'event-a') - }) - }) - - describe('when dragged intersecting the other event\'s start', () => { - describe('when no timezone', () => { - describe('when subject event\'s end is explicit', () => { - it('does not allow dragging', (done) => { - options.events = [ - { - title: 'Event A', - className: 'event-a', - start: '2014-11-04T01:00:00', - end: '2014-11-04T03:00:00', - }, - { - title: 'Event B', - className: 'event-b', - start: '2014-11-04T05:00:00', - end: '2014-11-04T09:00:00', - overlap: false, - }, - ] - testEventDrag(options, '2014-11-04T04:00:00', false, done, 'event-a') - }) - }) - describe('when subject event\'s end is implied', () => { - it('does not allow dragging', (done) => { - options.defaultTimedEventDuration = '03:00' - options.events = [ - { - title: 'Event A', - className: 'event-a', - start: '2014-11-04T01:00:00', - }, - { - title: 'Event B', - className: 'event-b', - start: '2014-11-04T05:00:00', - end: '2014-11-04T09:00:00', - overlap: false, - }, - ] - testEventDrag(options, '2014-11-04T03:00:00', false, done, 'event-a') - }) - }) - }) - describe('when UTC timezone', () => { - it('does not allow dragging', (done) => { - options.timeZone = 'UTC' - options.events = [ - { - title: 'Event A', - className: 'event-a', - start: '2014-11-04T01:00:00+00:00', - end: '2014-11-04T03:00:00+00:00', - }, - { - title: 'Event B', - className: 'event-b', - start: '2014-11-04T05:00:00+00:00', - end: '2014-11-04T09:00:00+00:00', - overlap: false, - }, - ] - testEventDrag(options, '2014-11-04T04:00:00+00:00', false, done, 'event-a') - }) - }) - }) - - describe('when dragged intersecting the other event\'s end', () => { - describe('when in week view with timed events', () => { - describe('when no timezone', () => { - it('does not allow dragging', (done) => { - options.events = [ - { - title: 'Event A', - className: 'event-a', - start: '2014-11-04T01:00:00', - end: '2014-11-04T03:00:00', - }, - { - title: 'Event B', - className: 'event-b', - start: '2014-11-04T05:00:00', - end: '2014-11-04T09:00:00', - overlap: false, - }, - ] - testEventDrag(options, '2014-11-04T08:00:00', false, done, 'event-a') - }) - }) - describe('when UTC timezone', () => { - it('does not allow dragging', (done) => { - options.timeZone = 'UTC' - options.events = [ - { - title: 'Event A', - className: 'event-a', - start: '2014-11-04T01:00:00+00:00', - end: '2014-11-04T03:00:00+00:00', - }, - { - title: 'Event B', - className: 'event-b', - start: '2014-11-04T05:00:00+00:00', - end: '2014-11-04T09:00:00+00:00', - overlap: false, - }, - ] - testEventDrag(options, '2014-11-04T08:00:00+00:00', false, done, 'event-a') - }) - }) - }) - describe('when in month view', () => { - beforeEach(() => { - options.initialView = 'dayGridMonth' - }) - describe('with all-day subject and all-day other', () => { - it('does not allow dragging', (done) => { - options.events = [ - { - title: 'Event A', - className: 'event-a', - start: '2014-11-04', - end: '2014-11-05', - }, - { - title: 'Event B', - className: 'event-b', - start: '2014-11-07', - end: '2014-11-09', - overlap: false, - }, - ] - testEventDrag(options, '2014-11-08', false, done, 'event-a') - }) - }) - describe('with all-day subject and timed other', () => { - it('does not allow dragging', (done) => { - options.events = [ - { - title: 'Event A', - className: 'event-a', - start: '2014-11-04', - end: '2014-11-05', - }, - { - title: 'Event B', - className: 'event-b', - start: '2014-11-07T05:00:00', - end: '2014-11-09T12:00:00', - overlap: false, - }, - ] - testEventDrag(options, '2014-11-08', false, done, 'event-a') - }) - }) - describe('with timed subject and all-day other', () => { - it('does not allow dragging', (done) => { - options.events = [ - { - title: 'Event A', - className: 'event-a', - start: '2014-11-04', - }, - { - title: 'Event B', - className: 'event-b', - start: '2014-11-07T05:00:00', - overlap: false, - }, - ] - testEventDrag(options, '2014-11-04', false, done, 'event-b') - }) - }) - }) - }) - - describe('when dragged to be encompassed by the other event', () => { - it('does not allow dragging', (done) => { - options.events = [ - { - title: 'Event A', - className: 'event-a', - start: '2014-11-04T01:00:00', - end: '2014-11-04T03:00:00', - }, - { - title: 'Event B', - className: 'event-b', - start: '2014-11-04T05:00:00', - end: '2014-11-04T09:00:00', - overlap: false, - }, - ] - testEventDrag(options, '2014-11-04T06:00:00', false, done, 'event-a') - }) - describe('when both events have the same group ID', () => { - it('allows the drag', (done) => { - options.events = [ - { - groupId: 'myid', - title: 'Event A', - className: 'event-a', - start: '2014-11-04T01:00:00', - end: '2014-11-04T03:00:00', - }, - { - groupId: 'myid', - title: 'Event B', - className: 'event-b', - start: '2014-11-04T05:00:00', - end: '2014-11-04T09:00:00', - overlap: false, - }, - ] - testEventDrag(options, '2014-11-04T06:00:00', true, done, 'event-a') - }) - }) - }) - - describe('when resized to be adjacently before the other event', () => { - it('allows resizing', (done) => { - options.events = [ - { - title: 'Event A', - className: 'event-a', - start: '2014-11-04T01:00:00', - end: '2014-11-04T03:00:00', - }, - { - title: 'Event B', - className: 'event-b', - start: '2014-11-04T05:00:00', - end: '2014-11-04T09:00:00', - overlap: false, - }, - ] - testEventResize(options, '2014-11-04T05:00:00', true, done, 'event-a') - }) - }) - - describe('when resized to intersect the other event\'s start', () => { - it('does not allow resizing', (done) => { - options.events = [ - { - title: 'Event A', - className: 'event-a', - start: '2014-11-04T01:00:00', - end: '2014-11-04T03:00:00', - }, - { - title: 'Event B', - className: 'event-b', - start: '2014-11-04T05:00:00', - end: '2014-11-04T09:00:00', - overlap: false, - }, - ] - testEventResize(options, '2014-11-04T06:00:00', false, done, 'event-a') - }) - }) - }) - - describe('when both events\' overlap is true AND they intersect', () => { - it('allows dragging', (done) => { - options.events = [ - { - title: 'Event A', - className: 'event-a', - start: '2014-11-04T01:00:00', - end: '2014-11-04T03:00:00', - overlap: true, - }, - { - title: 'Event B', - className: 'event-b', - start: '2014-11-04T05:00:00', - end: '2014-11-04T09:00:00', - overlap: true, - }, - ] - testEventDrag(options, '2014-11-04T04:00:00', true, done, 'event-a') - }) - }) - - describe('when other eventSource overlap is false', () => { - describe('when dragged over the other event', () => { - it('does not allow dragging', (done) => { - options.eventSources = [ - { - events: [{ - title: 'Event A', - className: 'event-a', - start: '2014-11-04T01:00:00', - end: '2014-11-04T03:00:00', - }], - }, - { - overlap: false, - events: [{ - title: 'Event B', - className: 'event-b', - start: '2014-11-04T05:00:00', - end: '2014-11-04T09:00:00', - }], - }, - ] - testEventDrag(options, '2014-11-04T06:00:00', false, done, 'event-a') - }) - }) - }) - - describe('when subject event is false', () => { - describe('when dragged adjacently after the other event', () => { - it('allows dragging', (done) => { - options.events = [ - { - title: 'Event A', - className: 'event-a', - start: '2014-11-04T01:00:00', - end: '2014-11-04T03:00:00', - overlap: false, - }, - { - title: 'Event B', - className: 'event-b', - start: '2014-11-04T05:00:00', - end: '2014-11-04T09:00:00', - }, - ] - testEventDrag(options, '2014-11-04T09:00:00', true, done, 'event-a') - }) - }) - describe('when dragged intersecting the other event\'s end', () => { - it('does not allow dragging', (done) => { - options.events = [ - { - title: 'Event A', - className: 'event-a', - start: '2014-11-04T01:00:00', - end: '2014-11-04T03:00:00', - overlap: false, - }, - { - title: 'Event B', - className: 'event-b', - start: '2014-11-04T05:00:00', - end: '2014-11-04T09:00:00', - }, - ] - testEventDrag(options, '2014-11-04T04:00:00', false, done, 'event-a') - }) - }) - }) - - describe('when subject eventSource is false', () => { - describe('when dragged after the other event', () => { - it('allows dragging', (done) => { - options.eventSources = [ - { - overlap: false, - events: [{ - title: 'Event A', - className: 'event-a', - start: '2014-11-04T01:00:00', - end: '2014-11-04T03:00:00', - }], - }, - { - events: [{ - title: 'Event B', - className: 'event-b', - start: '2014-11-04T05:00:00', - end: '2014-11-04T09:00:00', - }], - }, - ] - testEventDrag(options, '2014-11-04T09:00:00', true, done, 'event-a') - }) - }) - describe('when dragged over the other event', () => { - it('does not allow dragging', (done) => { - options.eventSources = [ - { - overlap: false, - events: [{ - title: 'Event A', - className: 'event-a', - start: '2014-11-04T01:00:00', - end: '2014-11-04T03:00:00', - }], - }, - { - events: [{ - title: 'Event B', - className: 'event-b', - start: '2014-11-04T05:00:00', - end: '2014-11-04T09:00:00', - }], - }, - ] - testEventDrag(options, '2014-11-04T06:00:00', false, done, 'event-a') - }) - }) - }) - - describe('when eventOverlap is false', () => { - describe('when dragged adjacently after another event', () => { - it('allows dragging', (done) => { - options.eventOverlap = false - options.events = [ - { - title: 'Event A', - className: 'event-a', - start: '2014-11-04T01:00:00', - end: '2014-11-04T03:00:00', - }, - { - title: 'Event B', - className: 'event-b', - start: '2014-11-04T05:00:00', - end: '2014-11-04T09:00:00', - }, - ] - testEventDrag(options, '2014-11-04T09:00:00', true, done, 'event-a') - }) - }) - describe('when dragged intersecting another event', () => { - it('does not allow dragging', (done) => { - options.eventOverlap = false - options.events = [ - { - title: 'Event A', - className: 'event-a', - start: '2014-11-04T01:00:00', - end: '2014-11-04T03:00:00', - }, - { - title: 'Event B', - className: 'event-b', - start: '2014-11-04T05:00:00', - end: '2014-11-04T09:00:00', - }, - ] - testEventDrag(options, '2014-11-04T06:00:00', false, done, 'event-a') - }) - }) - }) - - describe('when eventOverlap is a function', () => { - describe('when no intersecting events upon drag', () => { - it('does not get called, allows dragging', (done) => { - options.eventOverlap = () => {} - options.events = [ - { - title: 'Event A', - className: 'event-a', - start: '2014-11-04T01:00:00', - end: '2014-11-04T03:00:00', - }, - { - title: 'Event B', - className: 'event-b', - start: '2014-11-04T03:00:00', - end: '2014-11-04T07:00:00', - }, - ] - spyOn(options, 'eventOverlap').and.callThrough() - testEventDrag(options, '2014-11-04T06:00:00', true, () => { - expect(options.eventOverlap).not.toHaveBeenCalled() - done() - }, 'event-b') - }) - }) - describe('when an intersection and returning true', () => { - it('allows dragging AND gets called', (done) => { - options.eventOverlap = (stillEvent, movingEvent) => { - // checks arguments here - expect(stillEvent.title).toBe('Event B') - expect(movingEvent.title).toBe('Event A') - return true - } - options.events = [ - { - title: 'Event A', - className: 'event-a', - start: '2014-11-04T01:00:00', - end: '2014-11-04T03:00:00', - }, - { - title: 'Event B', - className: 'event-b', - start: '2014-11-04T05:00:00', - end: '2014-11-04T09:00:00', - }, - ] - spyOn(options, 'eventOverlap').and.callThrough() - testEventDrag(options, '2014-11-04T06:00:00', true, () => { - expect(options.eventOverlap).toHaveBeenCalled() - done() - }, 'event-a') - }) - }) - describe('when an intersection and returning false', () => { - it('disallows dragging AND gets called', (done) => { - options.eventOverlap = () => false - options.events = [ - { - title: 'Event A', - className: 'event-a', - start: '2014-11-04T01:00:00', - end: '2014-11-04T03:00:00', - }, - { - title: 'Event B', - className: 'event-b', - start: '2014-11-04T05:00:00', - end: '2014-11-04T09:00:00', - }, - ] - spyOn(options, 'eventOverlap').and.callThrough() - testEventDrag(options, '2014-11-04T06:00:00', false, () => { - expect(options.eventOverlap).toHaveBeenCalled() - done() - }, 'event-a') - }) - }) - }) -}) - -describe('selectOverlap', () => { - let options - - beforeEach(() => { - options = { - initialDate: '2014-11-12', - initialView: 'timeGridWeek', - scrollTime: '00:00', - } - }) - - describe('as false', () => { - beforeEach(() => { - options.selectOverlap = false - }) - describe('when dragged adjacently before an event', () => { - it('allows selection', (done) => { - options.events = [{ - title: 'Event A', - start: '2014-11-12T04:00:00', - end: '2014-11-12T06:00:00', - }] - testSelection(options, '2014-11-12T01:00:00Z', '2014-11-12T04:00:00Z', true, done) - }) - }) - describe('when dragged adjacently after an event', () => { - it('allows selection', (done) => { - options.events = [{ - title: 'Event A', - start: '2014-11-12T04:00:00', - end: '2014-11-12T06:00:00', - }] - testSelection(options, '2014-11-12T06:00:00Z', '2014-11-12T12:00:00Z', true, done) - }) - }) - describe('when dragged intersecting an event\'s start', () => { - describe('when UTC timezone', () => { - it('does not allow selection', (done) => { - options.timeZone = 'UTC' - options.events = [{ - title: 'Event A', - start: '2014-11-12T04:00:00+00:00', - end: '2014-11-12T06:00:00+00:00', - }] - testSelection(options, '2014-11-12T01:00:00Z', '2014-11-12T05:00:00Z', false, done) - }) - }) - describe('when local timezone', () => { - it('does not allow selection', (done) => { - options.timeZone = 'local' - options.events = [{ - title: 'Event A', - start: '2014-11-12T04:00:00', - end: '2014-11-12T06:00:00', - }] - testSelection(options, '2014-11-12T01:00:00', '2014-11-12T05:00:00', false, done) - }) - }) - }) - describe('when dragged intersecting an event\'s end', () => { - describe('when in week view with timed events', () => { - describe('when no timezone', () => { - it('does not allow selection', (done) => { - options.events = [{ - title: 'Event A', - start: '2014-11-12T04:00:00', - end: '2014-11-12T06:00:00', - }] - testSelection(options, '2014-11-12T05:00:00Z', '2014-11-12T08:00:00Z', false, done) - }) - }) - describe('when UTC timezone', () => { - it('does not allow selection', (done) => { - options.timeZone = 'UTC' - options.events = [{ - title: 'Event A', - start: '2014-11-12T04:00:00+00:00', - end: '2014-11-12T06:00:00+00:00', - }] - testSelection(options, '2014-11-12T05:00:00Z', '2014-11-12T08:00:00Z', false, done) - }) - }) - describe('when local timezone', () => { - it('does not allow selection', (done) => { - options.timeZone = 'local' - options.events = [{ - title: 'Event A', - start: '2014-11-12T04:00:00', - end: '2014-11-12T06:00:00', - }] - testSelection(options, '2014-11-12T05:00:00', '2014-11-12T08:00:00', false, done) - }) - }) - }) - describe('when in month view', () => { - beforeEach(() => { - options.initialView = 'dayGridMonth' - }) - describe('with all-day event', () => { - it('does not allow selection', (done) => { - options.events = [{ - title: 'Event A', - start: '2014-11-12', - end: '2014-11-14', - }] - testSelection(options, '2014-11-12', '2014-11-13', false, done) - }) - }) - describe('with timed event', () => { - it('does not allow selection', (done) => { - options.events = [{ - title: 'Event A', - start: '2014-11-12T05:00:00', - end: '2014-11-14T20:00:00', - }] - testSelection(options, '2014-11-12', '2014-11-13', false, done) - }) - }) - }) - }) - describe('when dragged to be encompassed by an event', () => { - it('does not allow selection', (done) => { - options.events = [{ - title: 'Event A', - start: '2014-11-12T04:00:00', - end: '2014-11-12T10:00:00', - }] - testSelection(options, '2014-11-12T05:00:00Z', '2014-11-12T08:00:00Z', false, done) - }) - }) - }) - - describe('as a function', () => { - describe('when no intersecting events when selecting', () => { - it('does not get called, allows selection', (done) => { - options.selectOverlap = () => {} - options.events = [{ - title: 'Event A', - start: '2014-11-12T04:00:00', - end: '2014-11-12T06:00:00', - }] - spyOn(options, 'selectOverlap').and.callThrough() - testSelection(options, '2014-11-12T08:00:00Z', '2014-11-12T10:00:00Z', true, () => { - expect(options.selectOverlap).not.toHaveBeenCalled() - done() - }) - }) - }) - describe('when an intersection and returning true', () => { - it('allows selection', (done) => { - options.selectOverlap = (arg0, arg1) => { - // checks arguments here - expect(arg0.title).toBe('Event A') - expect(arg1).toBeFalsy() - return true - } - options.events = [{ - title: 'Event A', - start: '2014-11-12T04:00:00', - end: '2014-11-12T06:00:00', - }] - spyOn(options, 'selectOverlap').and.callThrough() - testSelection(options, '2014-11-12T05:00:00Z', '2014-11-12T07:00:00Z', true, () => { - expect(options.selectOverlap).toHaveBeenCalled() - done() - }) - }) - }) - describe('when an intersection and returning false', () => { - it('does not allow selection', (done) => { - options.selectOverlap = () => false - options.events = [{ - title: 'Event A', - start: '2014-11-12T04:00:00', - end: '2014-11-12T06:00:00', - }] - spyOn(options, 'selectOverlap').and.callThrough() - testSelection(options, '2014-11-12T05:00:00Z', '2014-11-12T07:00:00Z', false, () => { - expect(options.selectOverlap).toHaveBeenCalled() - done() - }) - }) - }) - }) - - describe('as true and an event object\'s overlap is false', () => { - it('is not affected AND allows the selection', (done) => { - options.selectOverlap = true - options.events = [{ - title: 'Event A', - start: '2014-11-12T04:00:00', - end: '2014-11-12T06:00:00', - overlap: false, - }] - testSelection(options, '2014-11-12T05:00:00Z', '2014-11-12T07:00:00', true, done) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/refetchEvents.ts b/fullcalendar-main/tests/src/legacy/refetchEvents.ts deleted file mode 100644 index a3546e9..0000000 --- a/fullcalendar-main/tests/src/legacy/refetchEvents.ts +++ /dev/null @@ -1,134 +0,0 @@ -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('refetchEvents', () => { - // there IS a similar test in automated-better, but does month view - describe('when timeGrid events are rerendered', () => { - it('keeps scroll after refetchEvents', (done) => { - let calendar = initCalendar({ - now: '2015-08-07', - scrollTime: '00:00', - height: 400, // makes this test more consistent across viewports - initialView: 'timeGridDay', - events(arg, callback) { - setTimeout(() => { - callback([ - { id: '1', resourceId: 'b', start: '2015-08-07T02:00:00', end: '2015-08-07T07:00:00', title: 'event 1' }, - { id: '2', resourceId: 'c', start: '2015-08-07T05:00:00', end: '2015-08-07T22:00:00', title: 'event 2' }, - { id: '3', resourceId: 'd', start: '2015-08-06', end: '2015-08-08', title: 'event 3' }, - { id: '4', resourceId: 'e', start: '2015-08-07T03:00:00', end: '2015-08-07T08:00:00', title: 'event 4' }, - { id: '5', resourceId: 'f', start: '2015-08-07T00:30:00', end: '2015-08-07T02:30:00', title: 'event 5' }, - ]) - }, 100) - }, - }) - - setTimeout(() => { - let viewWrapper = new TimeGridViewWrapper(calendar) - let scrollEl = viewWrapper.getScrollerEl() - - scrollEl.scrollTop = 100 - setTimeout(() => { - currentCalendar.refetchEvents() - - setTimeout(() => { - expect(scrollEl.scrollTop).toBe(100) - done() - }, 100) - }, 100) - }, 101) // after the fetch - }) - }) - - describe('when there are multiple event sources', () => { - let fetchCount // affects events created in createEventGenerator - let eventSources - - pushOptions({ - now: '2015-08-07', - initialView: 'timeGridWeek', - }) - - beforeEach(() => { - fetchCount = 0 - eventSources = [ - { - events: createEventGenerator(), - color: 'green', - id: 'source1', - }, - { - events: createEventGenerator(), - color: 'blue', - id: 'source2', - }, - { - events: createEventGenerator(), - color: 'red', - id: 'source3', - }, - ] - }) - - describe('and all events are fetched synchronously', () => { - it('all events are immediately updated', (done) => { - initCalendar({ eventSources }) - fetchCount += 1 - currentCalendar.refetchEvents() - expect($('.fetch0').length).toEqual(0) - expect($('.fetch1').length).toEqual(3) - done() - }) - }) - - describe('and one event source is asynchronous', () => { - it('original events remain on the calendar until all events have been refetched', (done) => { - // set a 100ms timeout on this event source - eventSources[0].events = (arg, callback) => { - let events = [ - { id: '1', - start: '2015-08-07T02:00:00', - end: '2015-08-07T03:00:00', - title: 'event A', - className: 'fetch' + fetchCount }, - ] - setTimeout(() => { - callback(events) - }, 100) - } - - initCalendar({ - eventSources, - }) - - setTimeout(() => { - fetchCount += 1 - currentCalendar.refetchEvents() - expect($('.fetch0').length).toEqual(3) // original events still on the calendar - expect($('.fetch1').length).toEqual(0) // new events not yet refetched - - setTimeout(() => { - expect($('.fetch0').length).toEqual(0) - expect($('.fetch1').length).toEqual(3) - done() - }, 101) - }, 101) - }) - }) - - // relies on fetchCount - function createEventGenerator() { - return (arg, callback) => { - let events = [ - { - id: 1, - start: '2015-08-07T02:00:00', - end: '2015-08-07T03:00:00', - title: 'event A', - className: 'fetch' + fetchCount, - }, - ] - callback(events) - } - } - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/removeEventSources.ts b/fullcalendar-main/tests/src/legacy/removeEventSources.ts deleted file mode 100644 index bd08582..0000000 --- a/fullcalendar-main/tests/src/legacy/removeEventSources.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('removeEventSources', () => { - pushOptions({ - initialDate: '2014-08-01', - initialView: 'timeGridDay', - eventSources: [ - buildEventSource(1), - buildEventSource(2), - buildEventSource(3), - ], - }) - - describe('when called with no arguments', () => { - it('removes all sources', () => { - let calendar = initCalendar() - let calendarWrapper = new CalendarWrapper(calendar) - - expect(calendarWrapper.getEventEls().length).toBe(3) - - calendar.removeAllEventSources() - - expect(calendarWrapper.getEventEls().length).toBe(0) - }) - }) - - describe('when called with specific IDs', () => { - it('removes only events with matching sources', () => { - let calendar = initCalendar() - let calendarWrapper = new CalendarWrapper(calendar) - - expect(calendarWrapper.getEventEls().length).toBe(3) - - calendar.getEventSourceById('1').remove() - calendar.getEventSourceById('3').remove() - - expect(calendarWrapper.getEventEls().length).toBe(1) - expect($('.event2').length).toBe(1) - }) - }) - - function buildEventSource(id) { - return { - id, - events(arg, callback) { - callback([{ - title: 'event' + id, - className: 'event' + id, - start: '2014-08-01T02:00:00', - }]) - }, - } - } -}) diff --git a/fullcalendar-main/tests/src/legacy/removeEvents.ts b/fullcalendar-main/tests/src/legacy/removeEvents.ts deleted file mode 100644 index c66de16..0000000 --- a/fullcalendar-main/tests/src/legacy/removeEvents.ts +++ /dev/null @@ -1,157 +0,0 @@ -import { EventInput } from '@fullcalendar/core' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('removeEvents', () => { - pushOptions({ - initialDate: '2014-06-24', - initialView: 'dayGridMonth', - }) - - function buildEventsWithoutIds(): EventInput[] { - return [ - { title: 'event zero', start: '2014-06-24', className: 'event-zero' }, - { title: 'event one', start: '2014-06-24', className: 'event-non-zero event-one' }, - { title: 'event two', start: '2014-06-24', className: 'event-non-zero event-two' }, - ] - } - - function buildEventsWithIds() { - let events = buildEventsWithoutIds() - let i - - for (i = 0; i < events.length; i += 1) { - events[i].id = i - } - - return events - } - - $.each({ - 'when events without IDs': buildEventsWithoutIds, - 'when events with IDs': buildEventsWithIds, - }, (desc, eventGenerator) => { - describe(desc, () => { - it('can remove all events if no args specified', (done) => { - go( - eventGenerator(), - () => { - currentCalendar.removeAllEvents() - }, - () => { - expect(currentCalendar.getEvents().length).toEqual(0) - let calendarWrapper = new CalendarWrapper(currentCalendar) - expect(calendarWrapper.getEventEls().length).toEqual(0) - }, - done, - ) - }) - - it('can remove events individually', (done) => { - go( - eventGenerator(), - () => { - currentCalendar.getEvents().forEach((event) => { - if ($.inArray('event-one', event.classNames) !== -1) { - event.remove() - } - }) - }, - () => { - expect(currentCalendar.getEvents().length).toEqual(2) - let calendarWrapper = new CalendarWrapper(currentCalendar) - expect(calendarWrapper.getEventEls().length).toEqual(2) - expect($('.event-zero').length).toEqual(1) - expect($('.event-two').length).toEqual(1) - }, - done, - ) - }) - }) - }) - - it('can remove events with a numeric ID', (done) => { - go( - buildEventsWithIds(), - () => { - currentCalendar.getEventById(1 as any).remove() - }, - () => { - expect(currentCalendar.getEvents().length).toEqual(2) - let calendarWrapper = new CalendarWrapper(currentCalendar) - expect(calendarWrapper.getEventEls().length).toEqual(2) - expect($('.event-zero').length).toEqual(1) - expect($('.event-two').length).toEqual(1) - }, - done, - ) - }) - - it('can remove events with a string ID', (done) => { - go( - buildEventsWithIds(), - () => { - currentCalendar.getEventById('1').remove() - }, - () => { - expect(currentCalendar.getEvents().length).toEqual(2) - let calendarWrapper = new CalendarWrapper(currentCalendar) - expect(calendarWrapper.getEventEls().length).toEqual(2) - expect($('.event-zero').length).toEqual(1) - expect($('.event-two').length).toEqual(1) - }, - done, - ) - }) - - it('can remove an event with ID 0', (done) => { // for issue 2082 - go( - buildEventsWithIds(), - () => { - currentCalendar.getEventById(0 as any).remove() - }, - () => { - expect(currentCalendar.getEvents().length).toEqual(2) - let calendarWrapper = new CalendarWrapper(currentCalendar) - expect(calendarWrapper.getEventEls().length).toEqual(2) - expect($('.event-zero').length).toEqual(0) - expect($('.event-non-zero').length).toEqual(2) - }, - done, - ) - }) - - // Verifies the actions in removeFunc executed correctly by calling checkFunc. - function go(events, removeFunc, checkFunc, doneFunc) { - initCalendar({ - events, - }) - - checkAllEvents() // make sure all events initially rendered correctly - removeFunc() // remove the events - setTimeout(() => { // because the event rerender will be queued because we're a level deep - checkFunc() // check correctness - - // move the calendar back out of view, then back in - currentCalendar.next() - currentCalendar.prev() - - // array event sources should maintain the same state - // whereas "dynamic" event sources should refetch and reset the state - if ($.isArray(events)) { - checkFunc() // for issue 2187 - } else { - checkAllEvents() - } - - doneFunc() - }, 0) - } - - // Checks to make sure all events have been rendered and that the calendar - // has internal info on all the events. - function checkAllEvents() { - expect(currentCalendar.getEvents().length).toEqual(3) - let calendarWrapper = new CalendarWrapper(currentCalendar) - expect(calendarWrapper.getEventEls().length).toEqual(3) - } -}) diff --git a/fullcalendar-main/tests/src/legacy/rerenderDelay.ts b/fullcalendar-main/tests/src/legacy/rerenderDelay.ts deleted file mode 100644 index 0fe834d..0000000 --- a/fullcalendar-main/tests/src/legacy/rerenderDelay.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('rerenderDelay', () => { - it('batches together many event renders', (done) => { - let eventSource1 = [ - { title: 'event1', start: '2016-12-04T01:00:00', className: 'event1' }, - { title: 'event2', start: '2016-12-04T02:00:00', className: 'event2' }, - ] - let eventSource2 = [ - { title: 'event3', start: '2016-12-04T03:00:00', className: 'event3' }, - { title: 'event4', start: '2016-12-04T04:00:00', className: 'event4' }, - ] - let extraEvent1 = { title: 'event5', start: '2016-12-04T05:00:00', className: 'event5', id: '5' } - let extraEvent2 = { title: 'event6', start: '2016-12-04T06:00:00', className: 'event6', id: '6' } - - let calendar = initCalendar({ - initialDate: '2016-12-04', - initialView: 'timeGridDay', - events: eventSource1, - rerenderDelay: 0, // will still debounce despite being zero - }) - let calendarWrapper = new CalendarWrapper(calendar) - - expect(calendarWrapper.getEventEls().length).toBe(2) - - currentCalendar.addEventSource(eventSource2) - expect(calendarWrapper.getEventEls().length).toBe(2) - - currentCalendar.addEvent(extraEvent1) - expect(calendarWrapper.getEventEls().length).toBe(2) - - let refined2 = currentCalendar.addEvent(extraEvent2) - expect(calendarWrapper.getEventEls().length).toBe(2) - - refined2.remove() - expect(calendarWrapper.getEventEls().length).toBe(2) - - setTimeout(() => { // after rendered - expect($('.event1').length).toBe(1) - expect($('.event2').length).toBe(1) - expect($('.event3').length).toBe(1) - expect($('.event4').length).toBe(1) - expect($('.event5').length).toBe(1) - expect($('.event6').length).toBe(0) // got removed - done() - }, 1) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/scroll-state.ts b/fullcalendar-main/tests/src/legacy/scroll-state.ts deleted file mode 100644 index ba9cd33..0000000 --- a/fullcalendar-main/tests/src/legacy/scroll-state.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('scroll state', () => { - let calendarEl - - beforeEach(() => { - calendarEl = $('
').width(800).appendTo('body') - }) - afterEach(() => { - calendarEl.remove() - calendarEl = null - }) - - pushOptions({ - initialDate: '2015-02-20', - contentHeight: 200, - scrollTime: '00:00', // for timeGrid - }) - - describeOptions('initialView', { - 'when in month view': 'dayGridMonth', - 'when in week view': 'timeGridWeek', - }, (viewName) => { - let ViewWrapper = viewName.match(/^dayGrid/) ? DayGridViewWrapper : TimeGridViewWrapper - - it('should be maintained when resizing window', (done) => { - let scrollEl - let scroll0 - let calendar = initCalendar({ - windowResize() { - setTimeout(() => { // wait until all other tasks are finished - expect(scrollEl.scrollTop).toBe(scroll0) - done() - }, 0) - }, - }, calendarEl) - - scrollEl = new ViewWrapper(calendar).getScrollerEl() - - setTimeout(() => { // wait until after browser's scroll state is applied - scrollEl.scrollTop = 9999 // all the way - scroll0 = scrollEl.scrollTop - $(window).simulate('resize') - }, 0) - }) - - it('should be maintained when after rerendering events', () => { - let calendar = initCalendar({ - events: [{ - start: '2015-02-20', - }], - }, calendarEl) - - let scrollEl = new ViewWrapper(calendar).getScrollerEl() - let eventEl0 = new CalendarWrapper(calendar).getEventEls() - expect(eventEl0.length).toBe(1) - - scrollEl.scrollTop = 9999 // all the way - let scroll0 = scrollEl.scrollTop - currentCalendar.render() - - let eventEl1 = new CalendarWrapper(calendar).getEventEls() - expect(eventEl1.length).toBe(1) - expect(scrollEl.scrollTop).toBe(scroll0) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/scrollTime.ts b/fullcalendar-main/tests/src/legacy/scrollTime.ts deleted file mode 100644 index 7c401bd..0000000 --- a/fullcalendar-main/tests/src/legacy/scrollTime.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('scrollTime', () => { - pushOptions({ - initialView: 'timeGridWeek', - }) - - it('accepts a string Duration', () => { - let calendar = initCalendar({ - scrollTime: '02:00:00', - height: 400, // short enough to make scrolling happen - }) - let viewWrapper = new TimeGridViewWrapper(calendar) - let timeGridWrapper = viewWrapper.timeGrid - let slotTop = viewWrapper.timeGrid.getTimeTop('02:00:00') - $(timeGridWrapper.el).offset().top - let scrollTop = viewWrapper.getScrollerEl().scrollTop - let diff = Math.abs(slotTop - scrollTop) - - expect(slotTop).toBeGreaterThan(0) - expect(scrollTop).toBeGreaterThan(0) - expect(diff).toBeLessThan(3) - }) - - it('accepts a Duration object', () => { - let calendar = initCalendar({ - scrollTime: { hours: 2 }, - height: 400, // short enough to make scrolling happen - }) - let viewWrapper = new TimeGridViewWrapper(calendar) - let timeGridWrapper = viewWrapper.timeGrid - let slotTop = timeGridWrapper.getTimeTop('02:00:00') - $(timeGridWrapper.el).offset().top - let scrollTop = viewWrapper.getScrollerEl().scrollTop - let diff = Math.abs(slotTop - scrollTop) - - expect(slotTop).toBeGreaterThan(0) - expect(scrollTop).toBeGreaterThan(0) - expect(diff).toBeLessThan(3) - }) - - it('doesn\'t get applied on navigation when scrollTimeReset is false', () => { - let calendar = initCalendar({ - scrollTime: '02:00:00', - scrollTimeReset: false, - height: 400, // short enough to make scrolling happen - }) - let viewWrapper = new TimeGridViewWrapper(calendar) - let scrollEl = viewWrapper.getScrollerEl() - - scrollEl.scrollTop = 99999 - let scrollTop = scrollEl.scrollTop - - calendar.next() - expect(scrollEl.scrollTop).toBe(scrollTop) // stays the same - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/select-callback.ts b/fullcalendar-main/tests/src/legacy/select-callback.ts deleted file mode 100644 index 929760f..0000000 --- a/fullcalendar-main/tests/src/legacy/select-callback.ts +++ /dev/null @@ -1,352 +0,0 @@ -import { Calendar } from '@fullcalendar/core' -import dayGridPlugin from '@fullcalendar/daygrid' -import interactionPlugin from '@fullcalendar/interaction' -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -// UNFORTUNATELY, these tests are affected by the window height b/c of autoscrolling - -describe('select callback', () => { - pushOptions({ - initialDate: '2014-05-25', - selectable: true, - longPressDelay: 100, - }) - - describeOptions('direction', { - 'when LTR': 'ltr', - 'when RTL': 'rtl', - }, () => { - describe('when in month view', () => { - pushOptions({ - initialView: 'dayGridMonth', - }) - - it('gets fired correctly when the user selects cells', (done) => { - let options = { - select(arg) { - expect(arg.start instanceof Date).toEqual(true) - expect(arg.end instanceof Date).toEqual(true) - expect(typeof arg.jsEvent).toEqual('object') // TODO: more discrimination - expect(typeof arg.view).toEqual('object') // " - expect(arg.allDay).toEqual(true) - expect(arg.start).toEqualDate('2014-04-28') - expect(arg.startStr).toEqual('2014-04-28') - expect(arg.end).toEqualDate('2014-05-07') - expect(arg.endStr).toEqual('2014-05-07') - }, - } - spyOn(options, 'select').and.callThrough() - - let calendar = initCalendar(options) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - dayGridWrapper.selectDates('2014-04-28', '2014-05-06').then(() => { - expect(options.select).toHaveBeenCalled() - done() - }) - }) - - it('gets fired correctly when the user selects cells via touch', (done) => { - let options = { - select(arg) { - expect(arg.start instanceof Date).toEqual(true) - expect(arg.end instanceof Date).toEqual(true) - expect(typeof arg.jsEvent).toEqual('object') // TODO: more discrimination - expect(typeof arg.view).toEqual('object') // " - expect(arg.allDay).toEqual(true) - expect(arg.start).toEqualDate('2014-04-28') - expect(arg.startStr).toEqual('2014-04-28') - expect(arg.end).toEqualDate('2014-05-07') - expect(arg.endStr).toEqual('2014-05-07') - }, - } - spyOn(options, 'select').and.callThrough() - - let calendar = initCalendar(options) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - dayGridWrapper.selectDatesTouch( - '2014-04-28', - '2014-05-06', - true, // debug. HACK - ).then(() => { - expect(options.select).toHaveBeenCalled() - done() - }) - }) - - it('gets fired correctly when the user selects just one cell', (done) => { - let options = { - select(arg) { - expect(arg.start instanceof Date).toEqual(true) - expect(arg.end instanceof Date).toEqual(true) - expect(typeof arg.jsEvent).toEqual('object') // TODO: more discrimination - expect(typeof arg.view).toEqual('object') // " - expect(arg.allDay).toEqual(true) - expect(arg.start).toEqualDate('2014-04-28') - expect(arg.startStr).toEqual('2014-04-28') - expect(arg.end).toEqualDate('2014-04-29') - expect(arg.endStr).toEqual('2014-04-29') - }, - } - spyOn(options, 'select').and.callThrough() - - let calendar = initCalendar(options) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - dayGridWrapper.selectDates('2014-04-28', '2014-04-28').then(() => { - expect(options.select).toHaveBeenCalled() - done() - }) - }) - }) - - describe('when in week view', () => { - pushOptions({ - initialView: 'timeGridWeek', - }) - - describe('when selecting all-day slots', () => { - it('gets fired correctly when the user selects cells', (done) => { - let options = { - select(arg) { - expect(arg.start instanceof Date).toEqual(true) - expect(arg.end instanceof Date).toEqual(true) - expect(typeof arg.jsEvent).toEqual('object') // TODO: more discrimination - expect(typeof arg.view).toEqual('object') // " - expect(arg.allDay).toEqual(true) - expect(arg.start).toEqualDate('2014-05-28') - expect(arg.startStr).toEqual('2014-05-28') - expect(arg.end).toEqualDate('2014-05-30') - expect(arg.endStr).toEqual('2014-05-30') - }, - } - spyOn(options, 'select').and.callThrough() - - let calendar = initCalendar(options) - let dayGridWrapper = new TimeGridViewWrapper(calendar).dayGrid - - dayGridWrapper.selectDates('2014-05-28', '2014-05-29').then(() => { - expect(options.select).toHaveBeenCalled() - done() - }) - }) - - it('gets fired correctly when the user selects a single cell', (done) => { - let options = { - select(arg) { - expect(arg.start instanceof Date).toEqual(true) - expect(arg.end instanceof Date).toEqual(true) - expect(typeof arg.jsEvent).toEqual('object') // TODO: more discrimination - expect(typeof arg.view).toEqual('object') // " - expect(arg.allDay).toEqual(true) - expect(arg.start).toEqualDate('2014-05-28') - expect(arg.startStr).toEqual('2014-05-28') - expect(arg.end).toEqualDate('2014-05-29') - expect(arg.endStr).toEqual('2014-05-29') - }, - } - spyOn(options, 'select').and.callThrough() - - let calendar = initCalendar(options) - let dayGridWrapper = new TimeGridViewWrapper(calendar).dayGrid - - dayGridWrapper.selectDates('2014-05-28', '2014-05-28').then(() => { - expect(options.select).toHaveBeenCalled() - done() - }) - }) - }) - - describe('when selecting timed slots', () => { - it('gets fired correctly when the user selects slots', (done) => { - let options = { - select(arg) { - expect(arg.start instanceof Date).toEqual(true) - expect(arg.end instanceof Date).toEqual(true) - expect(typeof arg.jsEvent).toEqual('object') // TODO: more discrimination - expect(typeof arg.view).toEqual('object') // " - expect(arg.allDay).toEqual(false) - expect(arg.start).toEqualDate('2014-05-28T09:00:00Z') - expect(arg.startStr).toEqual('2014-05-28T09:00:00Z') - expect(arg.end).toEqualDate('2014-05-28T10:30:00Z') - expect(arg.endStr).toEqual('2014-05-28T10:30:00Z') - }, - } - spyOn(options, 'select').and.callThrough() - - let calendar = initCalendar(options) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - - timeGridWrapper.selectDates('2014-05-28T09:00:00', '2014-05-28T10:30:00').then(() => { - expect(options.select).toHaveBeenCalled() - done() - }) - }) - - // https://github.com/fullcalendar/fullcalendar/issues/4505 - it('gets fired correctly when the user selects slots NEAR THE END', (done) => { - let options = { - scrollTime: '24:00', - select(arg) { - expect(arg.start).toEqualDate('2014-05-28T16:00:00Z') - expect(arg.end).toEqualDate('2014-05-29T00:00:00Z') - }, - } - spyOn(options, 'select').and.callThrough() - - let calendar = initCalendar(options) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - - timeGridWrapper.selectDates('2014-05-28T16:00:00', '2014-05-29T00:00:00').then(() => { - expect(options.select).toHaveBeenCalled() - done() - }) - }) - - it('gets fired correctly when the user selects slots via touch', (done) => { - let options = { - select(arg) { - expect(arg.start instanceof Date).toEqual(true) - expect(arg.end instanceof Date).toEqual(true) - expect(typeof arg.jsEvent).toEqual('object') // TODO: more discrimination - expect(typeof arg.view).toEqual('object') // " - expect(arg.allDay).toEqual(false) - expect(arg.start).toEqualDate('2014-05-28T09:00:00Z') - expect(arg.startStr).toEqual('2014-05-28T09:00:00Z') - expect(arg.end).toEqualDate('2014-05-28T10:30:00Z') - expect(arg.endStr).toEqual('2014-05-28T10:30:00Z') - }, - } - spyOn(options, 'select').and.callThrough() - - let calendar = initCalendar(options) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - - setTimeout(() => { // HACK: sometimes touch dragging wouldn't grab onto anything - timeGridWrapper.selectDatesTouch( - '2014-05-28T09:00:00', - '2014-05-28T10:30:00', - true, // debug. HACK - ).then(() => { - expect(options.select).toHaveBeenCalled() - done() - }) - }, 100) - }) - - it('gets fired correctly when the user selects slots in a different day', (done) => { - let options = { - select(arg) { - expect(arg.start instanceof Date).toEqual(true) - expect(arg.end instanceof Date).toEqual(true) - expect(typeof arg.jsEvent).toEqual('object') // TODO: more discrimination - expect(typeof arg.view).toEqual('object') // " - expect(arg.allDay).toEqual(false) - expect(arg.start).toEqualDate('2014-05-28T09:00:00Z') - expect(arg.startStr).toEqual('2014-05-28T09:00:00Z') - expect(arg.end).toEqualDate('2014-05-29T10:30:00Z') - expect(arg.endStr).toEqual('2014-05-29T10:30:00Z') - }, - } - spyOn(options, 'select').and.callThrough() - - let calendar = initCalendar(options) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - - timeGridWrapper.selectDates('2014-05-28T09:00:00', '2014-05-29T10:30:00').then(() => { - expect(options.select).toHaveBeenCalled() - done() - }) - }) - - it('gets fired correctly when the user selects a single slot', (done) => { - let options = { - select(arg) { - expect(arg.start instanceof Date).toEqual(true) - expect(arg.end instanceof Date).toEqual(true) - expect(typeof arg.jsEvent).toEqual('object') // TODO: more discrimination - expect(typeof arg.view).toEqual('object') // " - expect(arg.allDay).toEqual(false) - expect(arg.start).toEqualDate('2014-05-28T09:00:00Z') - expect(arg.startStr).toEqual('2014-05-28T09:00:00Z') - expect(arg.end).toEqualDate('2014-05-28T09:30:00Z') - expect(arg.endStr).toEqual('2014-05-28T09:30:00Z') - }, - } - spyOn(options, 'select').and.callThrough() - - let calendar = initCalendar(options) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - - timeGridWrapper.selectDates('2014-05-28T09:00:00', '2014-05-28T09:30:00').then(() => { - expect(options.select).toHaveBeenCalled() - done() - }) - }) - }) - }) - }) - - describe('when selectMinDistance', () => { - pushOptions({ - selectMinDistance: 10, - }) - - it('will fire when dragged beyond distance', (done) => { - let options = { - select() {}, - } - spyOn(options, 'select').and.callThrough() - - let calendar = initCalendar(options) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - $(dayGridWrapper.getDayEl('2014-04-28')).simulate('drag', { - dx: 12, - dy: 0, - callback() { - expect(options.select).toHaveBeenCalled() - done() - }, - }) - }) - - it('will not fire when not dragged beyond distance', (done) => { - let options = { - select() {}, - } - spyOn(options, 'select').and.callThrough() - - let calendar = initCalendar(options) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - $(dayGridWrapper.getDayEl('2014-04-28')).simulate('drag', { - dx: 8, - dy: 0, - callback() { - expect(options.select).not.toHaveBeenCalled() - done() - }, - }) - }) - }) - - it('will fire on a calendar that hasn\'t been rendered yet', (done) => { - let calendar = new Calendar( - document.createElement('div'), - { - plugins: [interactionPlugin, dayGridPlugin], - now: '2018-12-25', - select(info) { - expect(info.startStr).toBe('2018-12-20') - expect(info.endStr).toBe('2018-12-23') - done() - }, - }, - ) - - calendar.select('2018-12-20', '2018-12-23') - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/select-method.ts b/fullcalendar-main/tests/src/legacy/select-method.ts deleted file mode 100644 index a8584a0..0000000 --- a/fullcalendar-main/tests/src/legacy/select-method.ts +++ /dev/null @@ -1,211 +0,0 @@ -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('select method', () => { - pushOptions({ - initialDate: '2014-05-25', - selectable: true, - }) - - /* - THINGS TO IMPLEMENT IN SRC (in addition to notes further down): - - better date normalization (for both render and reporting to select callback) - - if second date is the same or before the first - - if given a mixture of timed/all-day - - for dayGrid/month views, when given timed dates, should really be all-day - */ - - describeOptions('direction', { - 'when LTR': 'ltr', - 'when RTL': 'rtl', - }, () => { - describe('when in month view', () => { - pushOptions({ - initialView: 'dayGridMonth', - }) - - describe('when called with all-day date strings', () => { - describe('when in bounds', () => { - it('renders a selection', () => { - let calendar = initCalendar() - calendar.select('2014-05-07', '2014-05-09') - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - expect(dayGridWrapper.getHighlightEls()).toBeVisible() - }) - - it('renders a selection when called with one argument', () => { - let calendar = initCalendar() - calendar.select('2014-05-07') - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - expect(dayGridWrapper.getHighlightEls()).toBeVisible() - }) - - it('fires a selection event', () => { - let selectSpy = spyOnCalendarCallback('select', (arg) => { - expect(arg.allDay).toEqual(true) - expect(arg.start).toEqualDate('2014-05-07') - expect(arg.end).toEqualDate('2014-05-09') - }) - let calendar = initCalendar() - calendar.select('2014-05-07', '2014-05-09') - expect(selectSpy).toHaveBeenCalled() - }) - }) - - describe('when out of bounds', () => { - it('doesn\'t render a selection', () => { - let calendar = initCalendar() - calendar.select('2015-05-07', '2015-05-09') - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - expect(dayGridWrapper.getHighlightEls()).not.toBeVisible() - }) - - /* - TODO: implement this behavior - it('doesn\'t fire a selection event', function() { - options.select = function(arg) { - expect(arg.start).toEqualDate('2014-05-07'); - expect(arg.end).toEqualDate('2014-05-09'); - }; - spyOn(options, 'select').and.callThrough(); - let calendar = initCalendar(options); - calendar.select('2015-05-07', '2015-05-09'); - expect(options.select).not.toHaveBeenCalled(); - }); - */ - }) - }) - - describe('when called with timed date strings', () => { - it('renders a selection', () => { - let calendar = initCalendar() - calendar.select('2014-05-07T06:00:00', '2014-05-09T07:00:00') - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - expect(dayGridWrapper.getHighlightEls()).toBeVisible() - }) - - it('fires a selection event', () => { - let selectSpy = spyOnCalendarCallback('select', (arg) => { - expect(arg.allDay).toEqual(false) - expect(arg.start).toEqualDate('2014-05-07T06:00:00Z') - expect(arg.end).toEqualDate('2014-05-09T06:00:00Z') - }) - let calendar = initCalendar() - calendar.select('2014-05-07T06:00:00', '2014-05-09T06:00:00') - expect(selectSpy).toHaveBeenCalled() - }) - }) - }) - - describe('when in week view', () => { // May 25 - 31 - pushOptions({ - initialView: 'timeGridWeek', - scrollTime: '01:00:00', // so that most events will be below the divider - height: 400, // short enought to make scrolling happen - }) - - describe('when called with timed date strings', () => { - describe('when in bounds', () => { - it('renders a selection when called with one argument', () => { - let calendar = initCalendar() - calendar.select('2014-05-26T06:00:00') - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - expect(timeGridWrapper.getHighlightEls()).toBeVisible() - }) - - it('renders a selection over the slot area', () => { - let calendar = initCalendar() - calendar.select('2014-05-26T06:00:00', '2014-05-26T08:00:00') - let viewWrapper = new TimeGridViewWrapper(calendar) - let highlightEls = viewWrapper.timeGrid.getHighlightEls() - expect(highlightEls).toBeVisible() - let slotAreaTop = $(viewWrapper.getScrollerEl()).offset().top - let overlayTop = $(highlightEls[0]).offset().top - expect(overlayTop).toBeGreaterThan(slotAreaTop) - }) - }) - - describe('when out of bounds', () => { - it('doesn\'t render a selection', () => { - let calendar = initCalendar() - calendar.select('2015-05-26T06:00:00', '2015-05-26T07:00:00') - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - expect(timeGridWrapper.getHighlightEls()).not.toBeVisible() - }) - - /* - TODO: implement this behavior - it('doesn\'t fire a selection event', function() { - options.select = function(arg) { - expect(arg.start).toEqualDate('2015-05-07T06:00:00Z'); - expect(arg.end).toEqualDate('2015-05-09T07:00:00Z'); - }; - spyOn(options, 'select').and.callThrough(); - let calendar = initCalendar(options); - calendar.select('2015-05-07T06:00:00', '2015-05-09T07:00:00'); - expect(options.select).not.toHaveBeenCalled(); - }); - */ - }) - }) - - describe('when called with all-day date strings', () => { // forget about in/out bounds for this :) - describe('when allDaySlot is on', () => { - pushOptions({ - allDaySlot: true, - }) - - it('renders a selection over the day area', () => { - let calendar = initCalendar() - calendar.select('2014-05-26', '2014-05-28') - let viewWrapper = new TimeGridViewWrapper(calendar) - let highlightEls = viewWrapper.dayGrid.getHighlightEls() - expect(highlightEls).toBeVisible() - let slotAreaTop = $(viewWrapper.getScrollerEl()).offset().top - let overlayTop = $(highlightEls[0]).offset().top - expect(overlayTop).toBeLessThan(slotAreaTop) - }) - - it('fires a selection event', () => { - let selectSpy = spyOnCalendarCallback('select', (arg) => { - expect(arg.allDay).toEqual(true) - expect(arg.start).toEqualDate('2014-05-26') - expect(arg.end).toEqualDate('2014-05-28') - }) - let calendar = initCalendar() - calendar.select('2014-05-26', '2014-05-28') - expect(selectSpy).toHaveBeenCalled() - }) - }) - - describe('when allDaySlot is off', () => { - pushOptions({ - allDaySlot: false, - }) - - it('doesn\'t render the all-day selection over time area', () => { - let calendar = initCalendar() - calendar.select('2014-05-26', '2014-05-28') - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - expect(timeGridWrapper.getHighlightEls()).not.toBeVisible() - }) - - /* - TODO: implement - it('doesn\'t fire a selection event', function() { - options.select = function(arg) { - expect(arg.allDay).toEqual(true); - expect(arg.start).toEqualDate('2014-05-26'); - expect(arg.end).toEqualDate('2014-05-28'); - }; - spyOn(options, 'select').and.callThrough(); - let calendar = initCalendar(options); - calendar.select('2014-05-26', '2014-05-28'); - expect(options.select).not.toHaveBeenCalled(); - }); - */ - }) - }) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/selectAllow.ts b/fullcalendar-main/tests/src/legacy/selectAllow.ts deleted file mode 100644 index 0226985..0000000 --- a/fullcalendar-main/tests/src/legacy/selectAllow.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' -import { waitDateSelect } from '../lib/wrappers/interaction-util.js' - -describe('selectAllow', () => { - pushOptions({ - now: '2016-09-04', - initialView: 'timeGridWeek', - scrollTime: '00:00', - selectable: true, - }) - - it('disallows selecting when returning false', (done) => { // and given correct params - let options = { - selectAllow(selectInfo) { - expect(typeof selectInfo).toBe('object') - expect(selectInfo.start instanceof Date).toBe(true) - expect(selectInfo.end instanceof Date).toBe(true) - return false - }, - } - spyOn(options, 'selectAllow').and.callThrough() - - let calendar = initCalendar(options) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let selecting = timeGridWrapper.selectDates('2016-09-04T01:00:00Z', '2016-09-04T05:00:00Z') - - waitDateSelect(calendar, selecting).then((selectInfo) => { - expect(selectInfo).toBeFalsy() - expect(options.selectAllow).toHaveBeenCalled() - done() - }) - }) - - it('allows selecting when returning true', (done) => { - let options = { - selectAllow(selectInfo) { - return true - }, - } - spyOn(options, 'selectAllow').and.callThrough() - - let calendar = initCalendar(options) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let selecting = timeGridWrapper.selectDates('2016-09-04T01:00:00Z', '2016-09-04T05:00:00Z') - - waitDateSelect(calendar, selecting).then((selectInfo) => { - expect(typeof selectInfo).toBe('object') - expect(selectInfo.start).toEqualDate('2016-09-04T01:00:00Z') - expect(selectInfo.end).toEqualDate('2016-09-04T05:00:00Z') - expect(options.selectAllow).toHaveBeenCalled() - done() - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/selectMirror.ts b/fullcalendar-main/tests/src/legacy/selectMirror.ts deleted file mode 100644 index 9788a39..0000000 --- a/fullcalendar-main/tests/src/legacy/selectMirror.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('selectMirror', () => { - pushOptions({ - initialDate: '2014-08-03', - initialView: 'timeGridWeek', - scrollTime: '00:00:00', - selectMirror: true, - }) - - it('goes through eventDidMount', () => { - let options = { - eventDidMount(arg) { - expect(arg.isMirror).toBe(true) - }, - } - - spyOn(options, 'eventDidMount').and.callThrough() - - let calendar = initCalendar(options) - - calendar.select('2014-08-04T01:00:00Z', '2014-08-04T04:00:00Z') - - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let mirrorEls = timeGridWrapper.getMirrorEls() - - expect(mirrorEls.length).toBe(1) - expect(options.eventDidMount).toHaveBeenCalled() - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/slotDuration.ts b/fullcalendar-main/tests/src/legacy/slotDuration.ts deleted file mode 100644 index 24bbb4e..0000000 --- a/fullcalendar-main/tests/src/legacy/slotDuration.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('slotDuration', () => { - const minutesInADay = 1440 - - describe('when using the default settings', () => { - describe('in week', () => { - it('should have slots 1440/30 slots', () => { - let calendar = initCalendar({ - initialView: 'timeGridWeek', - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let slotCount = timeGridWrapper.getSlotEls().length - expect(slotCount).toEqual(Math.ceil(minutesInADay / 30)) - }) - }) - - describe('in day', () => { - it('should have slots 1440/30 slots', () => { - let calendar = initCalendar({ - initialView: 'timeGridDay', - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let slotCount = timeGridWrapper.getSlotEls().length - expect(slotCount).toEqual(Math.ceil(minutesInADay / 30)) - }) - }) - }) - - describe('when slotMinutes is set to 30', () => { - describe('in week', () => { - it('should have slots 1440/30 slots', () => { - let calendar = initCalendar({ - initialView: 'timeGridWeek', - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let slotCount = timeGridWrapper.getSlotEls().length - expect(slotCount).toEqual(Math.ceil(minutesInADay / 30)) - }) - }) - - describe('in day', () => { - it('should have slots 1440/30 slots', () => { - let calendar = initCalendar({ - initialView: 'timeGridDay', - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let slotCount = timeGridWrapper.getSlotEls().length - expect(slotCount).toEqual(Math.ceil(minutesInADay / 30)) - }) - }) - }) - - describe('when slotMinutes is set to a series of times', () => { - const slotMinutesList = [10, 12, 15, 17, 20, 30, 35, 45, 60, 62, 120, 300] - - describe('in week', () => { - slotMinutesList.forEach((slotMinutes) => { - it('should have slots 1440/x slots', () => { - let calendar = initCalendar({ - initialView: 'timeGridWeek', - slotDuration: { minutes: slotMinutes }, - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let slotCount = timeGridWrapper.getSlotEls().length - let expected = Math.ceil(minutesInADay / slotMinutes) - expect(slotCount).toEqual(expected) - }) - }) - }) - - describe('in day', () => { - slotMinutesList.forEach((slotMinutes) => { - it('should have slots 1440/x slots', () => { - let calendar = initCalendar({ - initialView: 'timeGridDay', - slotDuration: { minutes: slotMinutes }, - }) - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let slotCount = timeGridWrapper.getSlotEls().length - let expected = Math.ceil(minutesInADay / slotMinutes) - expect(slotCount).toEqual(expected) - }) - }) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/slotLabelFormat.ts b/fullcalendar-main/tests/src/legacy/slotLabelFormat.ts deleted file mode 100644 index e655529..0000000 --- a/fullcalendar-main/tests/src/legacy/slotLabelFormat.ts +++ /dev/null @@ -1,35 +0,0 @@ -import enGbLocale from '@fullcalendar/core/locales/en-gb' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('slotLabelFormat', () => { - pushOptions({ - initialDate: '2014-06-04', - initialView: 'timeGridWeek', - }) - - it('renders correctly when default', () => { - let calendar = initCalendar() - expectAxisText(calendar, '12am') - }) - - it('renders correctly when default and the locale is customized', () => { - let calendar = initCalendar({ - locale: enGbLocale, - }) - expectAxisText(calendar, '00') - }) - - it('renders correctly when customized', () => { - let calendar = initCalendar({ - slotLabelFormat: { hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false }, - locale: 'en-GB', // for 00:00 instead of 24:00 - }) - expectAxisText(calendar, '00:00:00') - }) - - function expectAxisText(calendar, expectedText) { - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - let axisTexts = timeGridWrapper.getAxisTexts() - expect(axisTexts[0]).toBe(expectedText) - } -}) diff --git a/fullcalendar-main/tests/src/legacy/themeSystem.ts b/fullcalendar-main/tests/src/legacy/themeSystem.ts deleted file mode 100644 index 60fec8e..0000000 --- a/fullcalendar-main/tests/src/legacy/themeSystem.ts +++ /dev/null @@ -1,67 +0,0 @@ -import bootstrapPlugin from '@fullcalendar/bootstrap' -import timeGridPlugin from '@fullcalendar/timegrid' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('themeSystem', () => { - pushOptions({ - plugins: [bootstrapPlugin, timeGridPlugin], - initialView: 'timeGridWeek', - headerToolbar: { - left: 'title', - center: '', - right: 'next', - }, - }) - - it('can be changed dynamically', () => { - let calendar = initCalendar() - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - let buttonInfo = toolbarWrapper.getButtonInfo('next') - - expect(calendar.el).toHaveClass(CalendarWrapper.ROOT_CLASSNAME) - expect(calendar.el).toHaveClass(CalendarWrapper.UNTHEMED_CLASSNAME) - expect(calendar.el).not.toHaveClass(CalendarWrapper.BOOTSTRAP_CLASSNAME) - expect(buttonInfo.iconName).toBeTruthy() - expect($('.table-bordered').length).toBe(0) - - let viewWrapper = new TimeGridViewWrapper(calendar) - let scrollEl = viewWrapper.getScrollerEl() - - scrollEl.scrollTop = 99999 // scroll all the way down - - // change option! - calendar.setOption('themeSystem', 'bootstrap') - - buttonInfo = toolbarWrapper.getButtonInfo('next', 'fa') - expect(calendar.el).toHaveClass(CalendarWrapper.ROOT_CLASSNAME) - expect(calendar.el).toHaveClass(CalendarWrapper.BOOTSTRAP_CLASSNAME) - expect(calendar.el).not.toHaveClass(CalendarWrapper.UNTHEMED_CLASSNAME) - expect(buttonInfo.iconName).toBeTruthy() - expect($('.table-bordered').length).toBeGreaterThan(0) - - // make sure scrolled down at least just a little bit - // since we don't have the bootstrap stylesheet loaded, this will be janky - expect(scrollEl.scrollTop).toBeGreaterThan(10) - }) - - // this tests the options setter with a single hash argument. - // TODO: not best place for this. - it('can be change with other options', () => { - let calendar = initCalendar() - - expect(calendar.el).toHaveClass(CalendarWrapper.ROOT_CLASSNAME) - expect(calendar.el).toHaveClass(CalendarWrapper.UNTHEMED_CLASSNAME) - expect(calendar.el).not.toHaveClass(CalendarWrapper.BOOTSTRAP_CLASSNAME) - - // change option! - calendar.batchRendering(() => { - calendar.setOption('themeSystem', 'bootstrap') - calendar.setOption('businessHours', true) - }) - - expect(calendar.el).toHaveClass(CalendarWrapper.ROOT_CLASSNAME) - expect(calendar.el).toHaveClass(CalendarWrapper.BOOTSTRAP_CLASSNAME) - expect(calendar.el).not.toHaveClass(CalendarWrapper.UNTHEMED_CLASSNAME) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/timeZone.ts b/fullcalendar-main/tests/src/legacy/timeZone.ts deleted file mode 100644 index a3c791d..0000000 --- a/fullcalendar-main/tests/src/legacy/timeZone.ts +++ /dev/null @@ -1,102 +0,0 @@ -describe('timeZone', () => { - // NOTE: Only deals with the processing of *received* events. - // Verification of a correct AJAX *request* is done in events-json-feed.js - - pushOptions({ - initialView: 'dayGridMonth', - initialDate: '2014-05-01', - events: [ - { - id: '1', - title: 'all day event', - start: '2014-05-02', - }, - { - id: '2', - title: 'timed event', - start: '2014-05-10T12:00:00', - }, - { - id: '3', - title: 'timed and zoned event', - start: '2014-05-10T14:00:00+11:00', - }, - ], - }) - - it('receives events correctly when local timezone', () => { - initCalendar({ - timeZone: 'local', - }) - expectLocalTimezone() - }) - - function expectLocalTimezone() { - let allDayEvent = currentCalendar.getEventById('1') - let timedEvent = currentCalendar.getEventById('2') - let zonedEvent = currentCalendar.getEventById('3') - expect(allDayEvent.allDay).toEqual(true) - expect(allDayEvent.start).toEqualLocalDate('2014-05-02T00:00:00') - expect(timedEvent.allDay).toEqual(false) - expect(timedEvent.start).toEqualLocalDate('2014-05-10T12:00:00') - expect(zonedEvent.allDay).toEqual(false) - expect(zonedEvent.start).toEqualDate('2014-05-10T14:00:00+11:00') - } - - it('receives events correctly when UTC timezone', () => { - initCalendar({ - timeZone: 'UTC', - }) - expectUtcTimezone() - }) - - function expectUtcTimezone() { - let allDayEvent = currentCalendar.getEventById('1') - let timedEvent = currentCalendar.getEventById('2') - let zonedEvent = currentCalendar.getEventById('3') - expect(allDayEvent.allDay).toEqual(true) - expect(allDayEvent.start).toEqualDate('2014-05-02') - expect(timedEvent.allDay).toEqual(false) - expect(timedEvent.start).toEqualDate('2014-05-10T12:00:00Z') - expect(zonedEvent.allDay).toEqual(false) - expect(zonedEvent.start).toEqualDate('2014-05-10T14:00:00+11:00') - } - - it('receives events correctly when custom timezone', () => { - initCalendar({ - timeZone: 'America/Chicago', - }) - expectCustomTimezone() - }) - - function expectCustomTimezone() { - let allDayEvent = currentCalendar.getEventById('1') - let timedEvent = currentCalendar.getEventById('2') - let zonedEvent = currentCalendar.getEventById('3') - expect(allDayEvent.allDay).toEqual(true) - expect(allDayEvent.start).toEqualDate('2014-05-02') - expect(timedEvent.allDay).toEqual(false) - expect(timedEvent.start).toEqualDate('2014-05-10T12:00:00Z') - expect(zonedEvent.allDay).toEqual(false) - expect(zonedEvent.start).toEqualDate('2014-05-10T14:00:00Z') // coerced to UTC - } - - it('can be set dynamically', () => { - initCalendar({ - timeZone: 'local', - }) - - expectLocalTimezone() - - currentCalendar.setOption('timeZone', 'UTC') - let allDayEvent = currentCalendar.getEventById('1') - let timedEvent = currentCalendar.getEventById('2') - let zonedEvent = currentCalendar.getEventById('3') - expect(allDayEvent.allDay).toEqual(true) - expect(allDayEvent.start).toEqualDate('2014-05-02') - expect(timedEvent.allDay).toEqual(false) - expect(timedEvent.start).toEqualLocalDate('2014-05-10T12:00:00') // was parsed as LOCAL originally - expect(zonedEvent.allDay).toEqual(false) - expect(zonedEvent.start).toEqualDate('2014-05-10T14:00:00+11:00') - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/timegrid-view.ts b/fullcalendar-main/tests/src/legacy/timegrid-view.ts deleted file mode 100644 index f43bc25..0000000 --- a/fullcalendar-main/tests/src/legacy/timegrid-view.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('timeGrid view rendering', () => { - pushOptions({ - initialView: 'timeGridWeek', - }) - - it('should have have days ordered sun to sat', () => { - let calendar = initCalendar() - let viewWrapper = new TimeGridViewWrapper(calendar) - let axisEl = viewWrapper.getHeaderAxisEl() - let thEls = viewWrapper.header.getCellEls() - - expect(axisEl).toBeTruthy() - - let dowClassNames = CalendarWrapper.DOW_CLASSNAMES - - for (let i = 0; i < dowClassNames.length; i += 1) { - expect(thEls[i]).toHaveClass(dowClassNames[i]) - } - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/titleFormat.ts b/fullcalendar-main/tests/src/legacy/titleFormat.ts deleted file mode 100644 index c7d7c8c..0000000 --- a/fullcalendar-main/tests/src/legacy/titleFormat.ts +++ /dev/null @@ -1,164 +0,0 @@ -import frLocale from '@fullcalendar/core/locales/fr' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('titleFormat', () => { - describe('when default', () => { - pushOptions({ - initialDate: '2014-06-12', - titleRangeSeparator: ' - ', - }) - - const VIEWS_WITH_FORMATS = [ - { view: 'dayGridMonth', expected: 'June 2014' }, - { view: 'dayGridWeek', expected: /Jun 8 - 14,? 2014/ }, - { view: 'timeGridWeek', expected: /Jun 8 - 14,? 2014/ }, - { view: 'dayGridDay', expected: /June 12,? 2014/ }, - { view: 'timeGridDay', expected: /June 12,? 2014/ }, - ] - - it('should have default values', () => { - let calendar = initCalendar() - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - - for (let viewWithFormat of VIEWS_WITH_FORMATS) { - calendar.changeView(viewWithFormat.view) - expect(toolbarWrapper.getTitleText()).toMatch(viewWithFormat.expected) - } - }) - }) - - describe('when set on a per-view basis', () => { - pushOptions({ - initialDate: '2014-06-12', - titleRangeSeparator: ' - ', - views: { - month: { titleFormat: { year: 'numeric', month: 'long' } }, - dayGridWeek: { titleFormat: { day: 'numeric', month: 'short', year: 'numeric' } }, - week: { titleFormat: { day: 'numeric', month: 'long', year: 'numeric' } }, - dayGridDay: { titleFormat: { weekday: 'long', day: 'numeric', month: 'long', year: 'numeric' } }, - }, - }) - - const VIEWS_WITH_FORMATS = [ - { view: 'dayGridMonth', expected: 'June 2014' }, - { view: 'dayGridWeek', expected: 'Jun 8 - 14, 2014' }, - { view: 'timeGridWeek', expected: 'June 8 - 14, 2014' }, - { view: 'dayGridDay', expected: 'Thursday, June 12, 2014' }, - ] - - it('should have the correct values', () => { - let calendar = initCalendar() - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - - for (let viewWithFormat of VIEWS_WITH_FORMATS) { - calendar.changeView(viewWithFormat.view) - expect(toolbarWrapper.getTitleText()).toMatch(viewWithFormat.expected) - } - }) - }) - - describe('when default and locale is French', () => { - pushOptions({ - initialDate: '2014-06-12', - titleRangeSeparator: ' - ', - locale: frLocale, - }) - - const VIEWS_WITH_FORMATS = [ - { view: 'dayGridMonth', expected: 'juin 2014' }, - { view: 'dayGridWeek', expected: '9 - 15 juin 2014' }, - { view: 'timeGridWeek', expected: '9 - 15 juin 2014' }, - { view: 'dayGridDay', expected: '12 juin 2014' }, - { view: 'timeGridDay', expected: '12 juin 2014' }, - ] - - it('should have the translated dates', () => { - let calendar = initCalendar() - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - - for (let viewWithFormat of VIEWS_WITH_FORMATS) { - calendar.changeView(viewWithFormat.view) - expect(toolbarWrapper.getTitleText()).toMatch(viewWithFormat.expected) - } - }) - }) - - describe('using custom views', () => { - it('multi-year default only displays year', () => { - let calendar = initCalendar({ - views: { - multiYear: { - type: 'dayGrid', - duration: { years: 2 }, - }, - }, - initialView: 'multiYear', - initialDate: '2014-12-25', - titleRangeSeparator: ' - ', - }) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - expect(toolbarWrapper.getTitleText()).toBe('2014 - 2015') - }) - - it('multi-month default only displays month/year', () => { - let calendar = initCalendar({ - views: { - multiMonth: { - type: 'dayGrid', - duration: { months: 2 }, - }, - }, - initialView: 'multiMonth', - initialDate: '2014-12-25', - titleRangeSeparator: ' - ', - }) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - expect(toolbarWrapper.getTitleText()).toBe('December 2014 - January 2015') - }) - - it('multi-week default displays short full date', () => { - let calendar = initCalendar({ - views: { - multiWeek: { - type: 'dayGrid', - duration: { weeks: 2 }, - }, - }, - initialView: 'multiWeek', - initialDate: '2014-12-25', - titleRangeSeparator: ' - ', - }) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - expect(toolbarWrapper.getTitleText()).toMatch(/Dec 21,? 2014 - Jan 3,? 2015/) - }) - - it('multi-day default displays short full date', () => { - let calendar = initCalendar({ - views: { - multiDay: { - type: 'dayGrid', - duration: { days: 2 }, - }, - }, - initialView: 'multiDay', - initialDate: '2014-12-25', - titleRangeSeparator: ' - ', - }) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - expect(toolbarWrapper.getTitleText()).toMatch(/Dec 25 - 26,? 2014/) - }) - }) - - describe('when not all days are shown', () => { - it('doesn\'t include hidden days in the title', () => { - let calendar = initCalendar({ - initialView: 'timeGridWeek', - initialDate: '2017-02-13', - weekends: false, - titleRangeSeparator: ' - ', - }) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - expect(toolbarWrapper.getTitleText()).toBe('Feb 13 - 17, 2017') // does not include Sunday - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/unselectAuto.ts b/fullcalendar-main/tests/src/legacy/unselectAuto.ts deleted file mode 100644 index 77128b0..0000000 --- a/fullcalendar-main/tests/src/legacy/unselectAuto.ts +++ /dev/null @@ -1,95 +0,0 @@ -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' - -describe('unselectAuto', () => { - pushOptions({ - selectable: true, - initialDate: '2014-12-25', - initialView: 'dayGridMonth', - }) - - beforeEach(() => { - $('
').appendTo('body') - }) - - afterEach(() => { - $('#otherthing').remove() - }) - - describe('when enabled', () => { - pushOptions({ - unselectAuto: true, - }) - - describe('when clicking away', () => { - it('unselects the current selection when clicking elsewhere in DOM', (done) => { - let isDone = false // hack against dragging continuing after destroy - let dayGridWrapper - let calendar = initCalendar({ - unselect(arg) { - if (!isDone) { - expect(dayGridWrapper.getHighlightEls().length).toBe(0) - expect('currentTarget' in arg.jsEvent).toBe(true) // a JS event - expect(typeof arg.view).toBe('object') - isDone = true - done() - } - }, - }) - dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - calendar.select('2014-12-01', '2014-12-03') - expect(dayGridWrapper.getHighlightEls().length).toBeGreaterThan(0) - - $('#otherthing') - .simulate('mousedown') - .simulate('mouseup') - .simulate('click') - }) - }) - - describe('when clicking another date', () => { - it('unselects the current selection when clicking elsewhere in DOM', (done) => { - let isDone = false // hack against dragging continuing after destroy - let dayGridWrapper - let calendar = initCalendar({ - unselect(arg) { - if (!isDone) { - expect(dayGridWrapper.getHighlightEls().length).toBe(0) - expect('currentTarget' in arg.jsEvent).toBe(true) // a JS event - expect(typeof arg.view).toBe('object') - isDone = true - done() - } - }, - }) - dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - calendar.select('2014-12-01', '2014-12-03') - expect(dayGridWrapper.getHighlightEls().length).toBeGreaterThan(0) - $(dayGridWrapper.getDayEl('2014-12-04')).simulate('drag') - }) - }) - }) - - describe('when disabled', () => { - pushOptions({ - unselectAuto: false, - }) - - it('keeps current selection when clicking elsewhere in DOM', (done) => { - let calendar = initCalendar() - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - calendar.select('2014-12-01', '2014-12-03') - expect(dayGridWrapper.getHighlightEls().length).toBeGreaterThan(0) - - $('#otherthing') - .simulate('mousedown') - .simulate('mouseup') - .simulate('click') - - setTimeout(() => { - expect(dayGridWrapper.getHighlightEls().length).toBeGreaterThan(0) - done() - }) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/views-specific-options.ts b/fullcalendar-main/tests/src/legacy/views-specific-options.ts deleted file mode 100644 index 6f6da99..0000000 --- a/fullcalendar-main/tests/src/legacy/views-specific-options.ts +++ /dev/null @@ -1,152 +0,0 @@ -import { createPlugin } from '@fullcalendar/core' -import dayGridPlugin from '@fullcalendar/daygrid' - -describe('view-specific options', () => { - pushOptions({ - headerToolbar: { - left: 'prev,next', - center: 'title', - right: 'dayGridMonth,dayGridWeek,dayGridDay,timeGridWeek,timeGridDay', - }, - initialView: 'dayGridMonth', - titleFormat() { return 'default' }, - views: { }, - }) - - function testEachView(viewsAndVals) { - $.each(viewsAndVals, (view: string, val) => { - currentCalendar.changeView(view) - expect($('h2')).toHaveText(val) - }) - } - - it('can target a specific view (dayGridMonth)', () => { - initCalendar({ - views: { - dayGridMonth: { - titleFormat() { return 'special!!!' }, - }, - }, - }) - testEachView({ - dayGridMonth: 'special!!!', - dayGridWeek: 'default', - dayGridDay: 'default', - timeGridWeek: 'default', - timeGridDay: 'default', - }) - }) - - it('can target a specific view (timeGridWeek)', () => { - initCalendar({ - views: { - timeGridWeek: { - titleFormat() { return 'special!!!' }, - }, - }, - }) - testEachView({ - dayGridMonth: 'default', - dayGridWeek: 'default', - dayGridDay: 'default', - timeGridWeek: 'special!!!', - timeGridDay: 'default', - }) - }) - - it('can target dayGrid views', () => { - initCalendar({ - views: { - dayGrid: { - titleFormat() { return 'special!!!' }, - }, - }, - }) - testEachView({ - dayGridMonth: 'special!!!', - dayGridWeek: 'special!!!', - dayGridDay: 'special!!!', - timeGridWeek: 'default', - timeGridDay: 'default', - }) - }) - - it('can target timeGrid views', () => { - initCalendar({ - views: { - timeGrid: { - titleFormat() { return 'special!!!' }, - }, - }, - }) - testEachView({ - dayGridMonth: 'default', - dayGridWeek: 'default', - dayGridDay: 'default', - timeGridWeek: 'special!!!', - timeGridDay: 'special!!!', - }) - }) - - it('can target week views', () => { - initCalendar({ - views: { - week: { - titleFormat() { return 'special!!!' }, - }, - }, - }) - testEachView({ - dayGridMonth: 'default', - dayGridWeek: 'special!!!', - dayGridDay: 'default', - timeGridWeek: 'special!!!', - timeGridDay: 'default', - }) - }) - - it('can target day views', () => { - initCalendar({ - views: { - day: { - titleFormat() { return 'special!!!' }, - }, - }, - }) - testEachView({ - dayGridMonth: 'default', - dayGridWeek: 'default', - dayGridDay: 'special!!!', - timeGridWeek: 'default', - timeGridDay: 'special!!!', - }) - }) - - it('views that explicitly extend others inherit options', () => { - initCalendar({ - plugins: [ - dayGridPlugin, - createPlugin({ - name: 'test-plugin', - views: { - superBasic: { - type: 'dayGrid', // explicitly extend - content: 'hello world', - }, - }, - }), - ], - views: { - dayGrid: { - titleFormat() { return 'special!!!' }, - }, - }, - }) - - testEachView({ - superBasic: 'special!!!', - dayGridMonth: 'special!!!', - dayGridDay: 'special!!!', - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/weekLabel.ts b/fullcalendar-main/tests/src/legacy/weekLabel.ts deleted file mode 100644 index 93c3fb5..0000000 --- a/fullcalendar-main/tests/src/legacy/weekLabel.ts +++ /dev/null @@ -1,52 +0,0 @@ -import esLocale from '@fullcalendar/core/locales/es' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('weekText', () => { // TODO: rename file - pushOptions({ - weekNumbers: true, - }); - - ['timeGridWeek'].forEach((viewName) => { - describe('when views is ' + viewName, () => { - pushOptions({ - initialView: viewName, - }) - - it('renders correctly by default', () => { - let calendar = initCalendar() - expectWeekNumberTitle(calendar, 'W') - }) - - it('renders correctly when unspecified and when locale is customized', () => { - let calendar = initCalendar({ - locale: esLocale, - }) - expectWeekNumberTitle(calendar, 'Sm') - }) - - it('renders correctly when customized and LTR', () => { - let calendar = initCalendar({ - direction: 'ltr', - weekText: 'YO', - }) - expectWeekNumberTitle(calendar, 'YO') - }) - - it('renders correctly when customized and RTL', () => { - let calendar = initCalendar({ - direction: 'rtl', - weekText: 'YO', - }) - expectWeekNumberTitle(calendar, 'YO') - }) - }) - - function expectWeekNumberTitle(calendar, title) { - let viewWrapper = new TimeGridViewWrapper(calendar) - let text = viewWrapper.getHeaderWeekText() - .replace(/\d/g, '').trim() // remove the number - - expect(text).toBe(title) - } - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/weekNumberCalculation.ts b/fullcalendar-main/tests/src/legacy/weekNumberCalculation.ts deleted file mode 100644 index 56b6d5f..0000000 --- a/fullcalendar-main/tests/src/legacy/weekNumberCalculation.ts +++ /dev/null @@ -1,66 +0,0 @@ -import arLocale from '@fullcalendar/core/locales/ar' -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('weekNumberCalculation', () => { - pushOptions({ - weekNumbers: true, - }) - - describeOptions('initialView', { - 'when in day-grid': 'dayGridDay', - 'when in time-grid': 'timeGridDay', - }, (viewName) => { - let getWeekNumberText = viewName.match(/^dayGrid/) - ? (calendar) => new DayGridViewWrapper(calendar).dayGrid.getWeekNumberText(0) - : (calendar) => new TimeGridViewWrapper(calendar).getHeaderWeekText() - - it('should display the American standard when using \'local\'', () => { - let calendar = initCalendar({ - initialDate: '2013-11-23', // a Saturday - weekNumberCalculation: 'local', - }) - expect(getWeekNumber(calendar)).toBe(47) - }) - - it('should display a locale-specific local week number', () => { - let calendar = initCalendar({ - initialDate: '2013-11-23', // a Saturday - locale: arLocale, - weekNumberCalculation: 'local', - }) - expect(getWeekNumberText(calendar)).toMatch(/٤٨|48/) - }) - - // another local test, but to make sure it is different from ISO - it('should display the American standard when using \'local\'', () => { - let calendar = initCalendar({ - initialDate: '2013-11-17', // a Sunday - weekNumberCalculation: 'local', - }) - expect(getWeekNumber(calendar)).toBe(47) - }) - - it('should display ISO standard when using \'ISO\'', () => { - let calendar = initCalendar({ - initialDate: '2013-11-17', // a Sunday - weekNumberCalculation: 'ISO', - }) - expect(getWeekNumber(calendar)).toBe(46) - }) - - it('should display the calculated number when a custom function', () => { - let calendar = initCalendar({ - weekNumberCalculation() { - return 4 - }, - }) - expect(getWeekNumber(calendar)).toBe(4) - }) - - function getWeekNumber(calendar) { - let text = getWeekNumberText(calendar) || '' - return parseInt(text.replace(/\D/g, ''), 10) - } - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/weekNumbers.ts b/fullcalendar-main/tests/src/legacy/weekNumbers.ts deleted file mode 100644 index 6edec94..0000000 --- a/fullcalendar-main/tests/src/legacy/weekNumbers.ts +++ /dev/null @@ -1,108 +0,0 @@ -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('weekNumbers', () => { - describe('when using month view', () => { - pushOptions({ - initialView: 'dayGridMonth', - fixedWeekCount: true, // will make 6 rows - }) - - describe('with default weekNumbers', () => { // which is false! - it('should not display week numbers at all', () => { - let calendar = initCalendar() - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - expect(dayGridWrapper.getWeekNumberEls().length).toEqual(0) - }) - }) - - describe('with weekNumbers to false', () => { - pushOptions({ - weekNumbers: false, - }) - - it('should not display week numbers at all', () => { - let calendar = initCalendar() - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - expect(dayGridWrapper.getWeekNumberEls().length).toEqual(0) - }) - }) - - describe('with weekNumbers to true', () => { - pushOptions({ - weekNumbers: true, - }) - - it('should display week numbers in the day cells only', () => { - let calendar = initCalendar() - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - expect(dayGridWrapper.getWeekNumberEls().length).toBeGreaterThan(0) - }) - }) - }) - - describe('when using an timeGrid view', () => { - pushOptions({ - initialView: 'timeGridWeek', - }) - - describe('with default weekNumbers', () => { - it('should not display week numbers at all', () => { - let calendar = initCalendar() - let viewWrapper = new TimeGridViewWrapper(calendar) - expect(viewWrapper.getHeaderWeekNumberLink()).toBeFalsy() - }) - }) - - describe('with weekNumbers to false', () => { - pushOptions({ - weekNumbers: false, - }) - - it('should not display week numbers at all', () => { - let calendar = initCalendar() - let viewWrapper = new TimeGridViewWrapper(calendar) - expect(viewWrapper.getHeaderWeekNumberLink()).toBeFalsy() - }) - }) - - describe('with weekNumbers to true', () => { - pushOptions({ - weekNumbers: true, - }) - - it('should display week numbers in the top left corner only', () => { - let calendar = initCalendar() - let viewWrapper = new TimeGridViewWrapper(calendar) - expect(viewWrapper.getHeaderWeekNumberLink()).toBeTruthy() - }) - }) - }) - - describe('when using in dayGrid view', () => { - pushOptions({ - initialView: 'dayGridWeek', - }) - - // https://github.com/fullcalendar/fullcalendar/issues/5708 - it('displays events evenly', () => { - let calendar = initCalendar({ - weekNumbers: true, - initialDate: '2020-08-07', - events: [ - { title: 'Event 1', start: '2020-08-02' }, - { title: 'Event 2', start: '2020-08-03' }, - ], - }) - let gridWrapper = new DayGridViewWrapper(calendar).dayGrid - let eventEls = gridWrapper.getEventEls() - - expect( - Math.abs( - eventEls[0].getBoundingClientRect().top - - eventEls[1].getBoundingClientRect().top, - ), - ).toBeLessThan(1) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/weekViewRender.ts b/fullcalendar-main/tests/src/legacy/weekViewRender.ts deleted file mode 100644 index 1903759..0000000 --- a/fullcalendar-main/tests/src/legacy/weekViewRender.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('weekViewRender', () => { - const nowStr = '2018-05-28' // is a Monday - - pushOptions({ - now: nowStr, - initialView: 'timeGridWeek', - }) - - describe('verify th class for today', () => { - it('should have today class only on "today"', () => { - let calendar = initCalendar() - let headerWrapper = new TimeGridViewWrapper(calendar).header - let cellInfo = headerWrapper.getCellInfo() - - expect(cellInfo[1].date).toEqualDate(nowStr) - expect(cellInfo[1].isToday).toBe(true) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/legacy/weekends.ts b/fullcalendar-main/tests/src/legacy/weekends.ts deleted file mode 100644 index 3f5154c..0000000 --- a/fullcalendar-main/tests/src/legacy/weekends.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' - -describe('when weekends option is set', () => { - it('should show sat and sun if true', () => { - let calendar = initCalendar({ - weekends: true, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - expect(dayGridWrapper.getDayEls(0).length).toBeGreaterThan(0) // 0=sunday - expect(dayGridWrapper.getDayEls(6).length).toBeGreaterThan(0) // 6=saturday - }) - - it('should not show sat and sun if false', () => { - let calendar = initCalendar({ - weekends: false, - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - expect(dayGridWrapper.getDayEls(0).length).toBe(0) // 0=sunday - expect(dayGridWrapper.getDayEls(6).length).toBe(0) // 6=saturday - }) -}) diff --git a/fullcalendar-main/tests/src/lib/DayGridEventRenderUtils.ts b/fullcalendar-main/tests/src/lib/DayGridEventRenderUtils.ts deleted file mode 100644 index c8ea472..0000000 --- a/fullcalendar-main/tests/src/lib/DayGridEventRenderUtils.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { DayGridViewWrapper } from './wrappers/DayGridViewWrapper.js' -import { DayGridWrapper } from './wrappers/DayGridWrapper.js' - -/* -opts: - - el (optional) - - row (optional) - - firstCol - - lastCol - - isStart - - isEnd -*/ -export function directionallyTestSeg(opts) { - let dayGridWrapper = new DayGridViewWrapper(currentCalendar).dayGrid - let el = opts.el ? $(opts.el) : dayGridWrapper.getEventEls()[0] - - let row = opts.row || 0 - let rowTds = dayGridWrapper.getDayElsInRow(row) - - expect(rowTds.length).toBeGreaterThan(1) - - let leftCol = opts.firstCol - let rightCol = opts.lastCol - let col - let td - - for (col = leftCol; col <= rightCol; col += 1) { - td = rowTds[col] - expect(el).toIntersectWith(td) - } - - for (col = 0; col < rowTds.length; col += 1) { - if (col < leftCol || col > rightCol) { - td = rowTds[col] - expect(el).not.toIntersectWith(td) - } - } - - if (opts.isStart) { - expect(el).toHaveClass(DayGridWrapper.EVENT_IS_START_CLASSNAME) - } else { - expect(el).not.toHaveClass(DayGridWrapper.EVENT_IS_START_CLASSNAME) - } - - if (opts.isEnd) { - expect(el).toHaveClass(DayGridWrapper.EVENT_IS_END_CLASSNAME) - } else { - expect(el).not.toHaveClass(DayGridWrapper.EVENT_IS_END_CLASSNAME) - } -} diff --git a/fullcalendar-main/tests/src/lib/EventDragUtils.ts b/fullcalendar-main/tests/src/lib/EventDragUtils.ts deleted file mode 100644 index 5e0e745..0000000 --- a/fullcalendar-main/tests/src/lib/EventDragUtils.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { getRectCenter, intersectRects } from './geom.js' -import { CalendarWrapper } from './wrappers/CalendarWrapper.js' - -/* -TODO: Don't rely on legacy simulateDrag -Given the rectangles of the origin and destination -slot or day area. -*/ -export function drag(rect0, rect1, debug?, eventEl?) { - if (!eventEl) { - eventEl = new CalendarWrapper(currentCalendar).getFirstEventEl() - } - - let eventRect = eventEl.getBoundingClientRect() - let point0 = getRectCenter( - intersectRects(eventRect, rect0), - ) - let point1 = getRectCenter(rect1) - let deferred = $.Deferred() - - $(eventEl).simulate('drag', { - point: point0, - end: point1, - debug, - }) - - currentCalendar.on('eventDrop', (arg) => { - deferred.resolve(arg) - }) - - currentCalendar.on('_noEventDrop', () => { - deferred.resolve(false) - }) - - return deferred.promise() -} - -// makes the setTimeout's work. -// also makes the tests faster. -pushOptions({ - dragRevertDuration: 0, -}) diff --git a/fullcalendar-main/tests/src/lib/EventResizeUtils.ts b/fullcalendar-main/tests/src/lib/EventResizeUtils.ts deleted file mode 100644 index 77ffbbf..0000000 --- a/fullcalendar-main/tests/src/lib/EventResizeUtils.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { getRectCenter, subtractPoints, addPoints } from './geom.js' -import { CalendarWrapper } from './wrappers/CalendarWrapper.js' - -export function resize(point0, point1, fromStart?, debug?) { - let eventEl = new CalendarWrapper(currentCalendar).getFirstEventEl() - - let $resizerEl = $(eventEl).find( - '.' + (fromStart ? CalendarWrapper.EVENT_START_RESIZER_CLASSNAME : CalendarWrapper.EVENT_END_RESIZER_CLASSNAME), - ).css('display', 'block') // usually only displays on hover. force display - - let resizerRect = $resizerEl[0].getBoundingClientRect() - let resizerCenter = getRectCenter(resizerRect) - - let vector = subtractPoints( - resizerCenter, - point0, - ) - let endPoint = addPoints( - point1, - vector, - ) - let deferred = $.Deferred() - - $resizerEl.simulate('drag', { - point: resizerCenter, - end: endPoint, - debug, - }) - - currentCalendar.on('eventResize', (arg) => { - deferred.resolve(arg) - }) - - currentCalendar.on('_noEventResize', () => { - deferred.resolve(false) - }) - - return deferred.promise() -} diff --git a/fullcalendar-main/tests/src/lib/ListenerCounter.ts b/fullcalendar-main/tests/src/lib/ListenerCounter.ts deleted file mode 100644 index cbfe9e0..0000000 --- a/fullcalendar-main/tests/src/lib/ListenerCounter.ts +++ /dev/null @@ -1,63 +0,0 @@ -const IGNORED_EVENTS = { - load: true, // ignore when jQuery detaches the load event from the window -} - -export class ListenerCounter { - el: HTMLElement - delta = 0 - jQueryStartCount = 0 - - constructor(el) { - this.el = el - } - - startWatching() { - // eslint-disable-next-line @typescript-eslint/no-this-alias - let t = this - let el = t.el - let origAddEventListened = el.addEventListener - let origRemoveEventListener = el.removeEventListener - - el.addEventListener = (eventName, ...otherArgs) => { - if (!IGNORED_EVENTS[eventName]) { - t.delta += 1 - } - return origAddEventListened.call(el, eventName, ...otherArgs) - } - - el.removeEventListener = (eventName, ...otherArgs) => { - if (!IGNORED_EVENTS[eventName]) { - t.delta -= 1 - } - return origRemoveEventListener.call(el, eventName, ...otherArgs) - } - - this.jQueryStartCount = countJqueryListeners(el) - } - - stopWatching() { - delete this.el.addEventListener - delete this.el.removeEventListener - - return this.computeDelta() - } - - computeDelta() { - return this.delta + (countJqueryListeners(this.el) - this.jQueryStartCount) - } -} - -function countJqueryListeners(el) { - let hash = getJqueryHandlerHash(el) - let cnt = 0 - - $.each(hash, (name, handlers) => { - cnt += handlers.length - }) - - return cnt -} - -function getJqueryHandlerHash(el) { - return $._data($(el)[0], 'events') || {} -} diff --git a/fullcalendar-main/tests/src/lib/ViewDateUtils.ts b/fullcalendar-main/tests/src/lib/ViewDateUtils.ts deleted file mode 100644 index 2fb562b..0000000 --- a/fullcalendar-main/tests/src/lib/ViewDateUtils.ts +++ /dev/null @@ -1,13 +0,0 @@ -export function expectRenderRange(start, end) { - let { dateProfile } = currentCalendar.getCurrentData() // not a great way to get this info - - expect(dateProfile.renderRange.start).toEqualDate(start) - expect(dateProfile.renderRange.end).toEqualDate(end) -} - -export function expectActiveRange(start, end) { - let currentView = currentCalendar.view - - expect(currentView.activeStart).toEqualDate(start) - expect(currentView.activeEnd).toEqualDate(end) -} diff --git a/fullcalendar-main/tests/src/lib/ViewRenderUtils.ts b/fullcalendar-main/tests/src/lib/ViewRenderUtils.ts deleted file mode 100644 index 00bd695..0000000 --- a/fullcalendar-main/tests/src/lib/ViewRenderUtils.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { addDays } from '@fullcalendar/core/internal' -import { formatIsoDay } from './datelib-utils.js' -import { CalendarWrapper } from './wrappers/CalendarWrapper.js' - -export function expectDayRange(start, end) { - if (typeof start === 'string') { - expect(start.indexOf('T')).toBe(-1) - start = new Date(start) - } - - if (typeof end === 'string') { - expect(end.indexOf('T')).toBe(-1) - end = new Date(end) - } - - let dayBefore = addDays(start, -1) - expectDay(dayBefore, false) - - let date = start - while (date < end) { // eslint-disable-line - expectDay(date, true) - date = addDays(date, 1) - } - - // `date` is now the first day after the range - expectDay(date, false) -} - -export function expectDay(date, bool) { - if (typeof date === 'string') { - expect(date.indexOf('T')).toBe(-1) - date = new Date(date) - } - - let calendarWrapper = new CalendarWrapper(currentCalendar) - let dayEl = calendarWrapper.getDateCellEl(formatIsoDay(date)) - - if (bool) { - expect(dayEl).toBeTruthy() - } else { - expect(dayEl).toBeFalsy() - } -} diff --git a/fullcalendar-main/tests/src/lib/date-matchers.ts b/fullcalendar-main/tests/src/lib/date-matchers.ts deleted file mode 100644 index 69a3796..0000000 --- a/fullcalendar-main/tests/src/lib/date-matchers.ts +++ /dev/null @@ -1,97 +0,0 @@ -import { parseUtcDate, parseLocalDate } from './date-parsing.js' - -beforeEach(() => { - jasmine.addMatchers({ - - toEqualDate() { - return { - compare(actual, expected) { - let result - - if (typeof expected === 'string') { - expected = parseUtcDate(expected) - } - - if (!(actual instanceof Date)) { - result = { - pass: false, - message: 'Actual value ' + actual + ' needs to be an instance of a Date', - } - } else if (!(expected instanceof Date)) { - result = { - pass: false, - message: 'Expected value ' + expected + ' needs to be an instance of a Date', - } - } else if (actual.valueOf() !== expected.valueOf()) { - result = { - pass: false, - message: 'Date ' + actual.toUTCString() + ' does not equal ' + expected.toUTCString(), - } - } else { - result = { pass: true } - } - - return result - }, - } - }, - - toEqualLocalDate() { - return { - compare(actual, expected) { - let result - - if (typeof expected === 'string') { - expected = parseLocalDate(expected) - } - - if (!(actual instanceof Date)) { - result = { - pass: false, - message: 'Actual value ' + actual + ' needs to be an instance of a Date', - } - } else if (!(expected instanceof Date)) { - result = { - pass: false, - message: 'Expected value ' + expected + ' needs to be an instance of a Date', - } - } else if (actual.valueOf() !== expected.valueOf()) { - result = { - pass: false, - message: 'Date ' + actual.toString() + ' does not equal ' + expected.toString(), - } - } else { - result = { pass: true } - } - - return result - }, - } - }, - - toEqualNow() { - return { - compare(actual) { - let result - - if (!(actual instanceof Date)) { - result = { - pass: false, - message: 'Actual value ' + actual + ' needs to be an instance of a Date', - } - } else if (Math.abs(actual.valueOf() - new Date().valueOf()) > 1000) { - result = { - pass: false, - message: 'Date ' + actual.toUTCString() + ' is not close enough to now', - } - } else { - result = { pass: true } - } - - return result - }, - } - }, - - }) -}) diff --git a/fullcalendar-main/tests/src/lib/date-math.ts b/fullcalendar-main/tests/src/lib/date-math.ts deleted file mode 100644 index 782c07a..0000000 --- a/fullcalendar-main/tests/src/lib/date-math.ts +++ /dev/null @@ -1,27 +0,0 @@ -export function startOfLocalDay(date) { - return new Date( - date.getFullYear(), - date.getMonth(), - date.getDate(), - ) -} - -export function addLocalDays(date, n) { - let newDate = new Date(date.valueOf()) - newDate.setDate(newDate.getDate() + n) - return newDate -} - -export function startOfUtcDay(date) { - return new Date(Date.UTC( - date.getUTCFullYear(), - date.getUTCMonth(), - date.getUTCDate(), - )) -} - -export function addUtcDays(date, n) { - let newDate = new Date(date.valueOf()) - newDate.setUTCDate(newDate.getUTCDate() + n) - return newDate -} diff --git a/fullcalendar-main/tests/src/lib/date-parsing.ts b/fullcalendar-main/tests/src/lib/date-parsing.ts deleted file mode 100644 index f2f9aec..0000000 --- a/fullcalendar-main/tests/src/lib/date-parsing.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* -NOTE: can't use Date.parse or new Date(str) to parse strings without timezones: -https://stackoverflow.com/a/33909265/96342 -*/ - -/* -Given an ISO8601 string with no timezone part, parses as UTC -*/ -export function parseUtcDate(str) { - let parts = str.split(/\D/) - - if (parts.length > 6) { // has timezone info. will correctly parse - return new Date(str) - } - - return new Date(Date.UTC( - parseInt(parts[0], 10), - parseInt(parts[1], 10) - 1, - parts[2] ? parseInt(parts[2], 10) : 0, - parts[3] ? parseInt(parts[3], 10) : 0, - parts[4] ? parseInt(parts[4], 10) : 0, - parts[5] ? parseInt(parts[5], 10) : 0, - )) -} - -/* -Given an ISO8601 string with no timezone part, parses as local -*/ -export function parseLocalDate(str) { - let parts = str.split(/\D/) - - if (parts.length > 6) { // has timezone info - throw new Error('Don\'t pass timezone info to parseLocalDate. Use parseUtcDate instead.') - } else { - return new Date( - parseInt(parts[0], 10), - parseInt(parts[1], 10) - 1, - parts[2] ? parseInt(parts[2], 10) : 0, - parts[3] ? parseInt(parts[3], 10) : 0, - parts[4] ? parseInt(parts[4], 10) : 0, - parts[5] ? parseInt(parts[5], 10) : 0, - ) - } -} diff --git a/fullcalendar-main/tests/src/lib/datelib-utils.ts b/fullcalendar-main/tests/src/lib/datelib-utils.ts deleted file mode 100644 index 9a329b6..0000000 --- a/fullcalendar-main/tests/src/lib/datelib-utils.ts +++ /dev/null @@ -1,66 +0,0 @@ -export function formatIsoTimeZoneOffset(date) { - let minutes = date.getTimezoneOffset() - let sign = minutes < 0 ? '+' : '-' // whaaa - let abs = Math.abs(minutes) - let hours = Math.floor(abs / 60) - let mins = Math.round(abs % 60) - - return sign + pad(hours) + ':' + pad(mins) -} - -export function formatPrettyTimeZoneOffset(date) { - let minutes = date.getTimezoneOffset() - let sign = minutes < 0 ? '+' : '-' // whaaa - let abs = Math.abs(minutes) - let hours = Math.floor(abs / 60) - let mins = Math.round(abs % 60) - - return 'GMT' + sign + hours + (mins ? ':' + pad(mins) : '') -} - -function pad(n) { // always pads for 2 digits - return n < 10 ? '0' + n : '' + n -} - -export function formatIsoDay(date) { - return date.toISOString().replace(/T.*/, '') -} - -export function formatIsoTime(date) { - return pad(date.getUTCHours()) + ':' + - pad(date.getUTCMinutes()) + ':' + - pad(date.getUTCSeconds()) -} - -export function formatIsoWithoutTz(date) { - return date.toISOString().replace(/(Z|[-+]\d\d:\d\d)$/, '').replace('.000', '') -} - -export function parseIsoAsUtc(s) { - if (s.length <= 10) { - s += 'T00:00:00Z' - } else if (s.indexOf('Z') === -1) { - s += 'Z' - } - - let d = new Date(s) - - if (isNaN(d.valueOf())) { - throw new Error(s + ' is not valid date input') - } - - return d -} - -export function ensureDate(input) { - if (input instanceof Date) { - return input - } - if (typeof input === 'string') { - return parseIsoAsUtc(input) - } - if (typeof input === 'number') { - return new Date(input) - } - throw new Error(input + ' is invalid date input') -} diff --git a/fullcalendar-main/tests/src/lib/dnd-resize-utils.ts b/fullcalendar-main/tests/src/lib/dnd-resize-utils.ts deleted file mode 100644 index a2a2e9a..0000000 --- a/fullcalendar-main/tests/src/lib/dnd-resize-utils.ts +++ /dev/null @@ -1,255 +0,0 @@ -import { parseMarker, addDays } from '@fullcalendar/core/internal' -import { formatIsoDay } from './datelib-utils.js' -import { TimeGridViewWrapper } from './wrappers/TimeGridViewWrapper.js' -import { DayGridViewWrapper } from './wrappers/DayGridViewWrapper.js' -import { CalendarWrapper } from './wrappers/CalendarWrapper.js' - -export function testEventDrag(options, dropDate, expectSuccess, callback, eventClassName?) { - options.editable = true - options.viewDidMount = () => { - setTimeout(() => { - let calendar = currentCalendar - let isDraggingExternal = false - let $dayEl - let $eventEl - let $dragEl - let slatIndex - let $slatEl - let dx - let dy - let allowed - let dropDateMeta - let dropDateHasTime - - if (typeof dropDate === 'string') { - dropDateMeta = parseMarker(dropDate) - dropDateHasTime = !dropDateMeta.isTimeUnspecified - dropDate = dropDateMeta.marker - } else { - dropDateHasTime = true - } - - let calendarWrapper = new CalendarWrapper(calendar) - $eventEl = eventClassName ? $(`.${eventClassName}:first`) : $(calendarWrapper.getFirstEventEl()) - expect($eventEl.length).toBe(1) - - if (dropDateHasTime) { - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - $dragEl = $eventEl.find('.' + CalendarWrapper.EVENT_TIME_CLASSNAME) - $dayEl = $(timeGridWrapper.getDayEls(dropDate)) - slatIndex = dropDate.getUTCHours() * 2 + (dropDate.getUTCMinutes() / 30) // assumes slotDuration:'30:00' - $slatEl = $(timeGridWrapper.getSlotElByIndex(slatIndex)) - expect($slatEl.length).toBe(1) - dy = $slatEl.offset().top - $eventEl.offset().top - } else { - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - $dragEl = $eventEl.find('.' + CalendarWrapper.EVENT_TITLE_CLASSNAME) - $dayEl = $(dayGridWrapper.getDayEl(dropDate)) - dy = $dayEl.offset().top - $eventEl.offset().top - } - - if (!$dragEl.length) { - isDraggingExternal = true - $dragEl = $eventEl // well, not really an "event" element anymore - } - - expect($dragEl.length).toBe(1) - expect($dayEl.length).toBe(1) - dx = $dayEl.offset().left - $eventEl.offset().left - - $dragEl.simulate('drag', { - dx, - dy, - onBeforeRelease() { - allowed = calendarWrapper.isAllowingDragging() - expect(allowed).toBe(expectSuccess) - }, - onRelease() { - let eventObj - let successfulDrop - - if (!isDraggingExternal) { // if dragging an event within the calendar, check dates - if (eventClassName) { - eventObj = calendar.getEvents().filter((o) => o.classNames.join(' ') === eventClassName)[0] - } else { - eventObj = calendar.getEvents()[0] - } - - if (dropDateHasTime) { // dropped on a slot - successfulDrop = eventObj.start.valueOf() === dropDate.valueOf() // compare exact times - } else { // dropped on a whole day - // only compare days - successfulDrop = formatIsoDay(eventObj.start) === formatIsoDay(dropDate) - } - - expect(successfulDrop).toBe(allowed) - expect(successfulDrop).toBe(expectSuccess) - } - - callback() - }, - }) - }, 0) - } - initCalendar(options) -} - -export function testEventResize(options, resizeDate, expectSuccess, callback, eventClassName?) { - options.editable = true - options.viewDidMount = () => { - setTimeout(() => { - let calendar = currentCalendar - let $lastDayEl - let lastSlatIndex - let $lastSlatEl - let $eventEl - let $dragEl - let dx - let dy - let allowed - let resizeDateMeta - let resizeDateHasTime - - if (typeof resizeDate === 'string') { - resizeDateMeta = parseMarker(resizeDate) - resizeDateHasTime = !resizeDateMeta.isTimeUnspecified - resizeDate = resizeDateMeta.marker - } else { - resizeDateHasTime = true - } - - let calendarWrapper = new CalendarWrapper(calendar) - $eventEl = eventClassName ? $(`.${eventClassName}:first`) : (() => { - let eventEls = calendarWrapper.getEventEls() - return $(eventEls[eventEls.length - 1]) // the last one - })() - - $dragEl = $eventEl.find('.' + CalendarWrapper.EVENT_RESIZER_CLASSNAME) - .css('display', 'block') // resizer usually only shows on hover. force-show it - - if (resizeDateHasTime) { - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - $lastDayEl = $(timeGridWrapper.getDayEls(resizeDate)) - lastSlatIndex = resizeDate.getUTCHours() * 2 + (resizeDate.getUTCMinutes() / 30) // assumes slotDuration:'30:00' - $lastSlatEl = $(timeGridWrapper.getSlotElByIndex(lastSlatIndex - 1)) - expect($lastSlatEl.length).toBe(1) - dy = $lastSlatEl.offset().top + $lastSlatEl.outerHeight() - ($eventEl.offset().top + $eventEl.outerHeight()) - } else { - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - $lastDayEl = $(dayGridWrapper.getDayEl(addDays(resizeDate, -1))) - dy = $lastDayEl.offset().top - $eventEl.offset().top - } - - expect($lastDayEl.length).toBe(1) - expect($eventEl.length).toBe(1) - expect($dragEl.length).toBe(1) - dx = $lastDayEl.offset().left + $lastDayEl.outerWidth() - 2 - ($eventEl.offset().left + $eventEl.outerWidth()) - - $dragEl.simulate('drag', { - dx, - dy, - onBeforeRelease() { - allowed = calendarWrapper.isAllowingDragging() - }, - onRelease() { - let eventObj - let successfulDrop - - if (eventClassName) { - eventObj = calendar.getEvents().filter((o) => o.classNames.join(' ') === eventClassName)[0] - } else { - eventObj = calendar.getEvents()[0] - } - - successfulDrop = eventObj.end && eventObj.end.valueOf() === resizeDate.valueOf() - - expect(allowed).toBe(successfulDrop) - expect(allowed).toBe(expectSuccess) - expect(successfulDrop).toBe(expectSuccess) - callback() - }, - }) - }, 0) - } - initCalendar(options) -} - -export function testSelection(options, start, end, expectSuccess, callback) { - let successfulSelection = false - let $firstDayEl - let $lastDayEl - let firstSlatIndex - let lastSlatIndex - let $firstSlatEl - let $lastSlatEl - let dx - let dy - let $dragEl - let allowed - let allDay = false - let meta - - if (typeof start === 'string') { - meta = parseMarker(start) - allDay = allDay || meta.isTimeUnspecified - start = meta.marker - } - if (typeof end === 'string') { - meta = parseMarker(end) - allDay = allDay || meta.isTimeUnspecified - end = meta.marker - } - - options.selectable = true - options.select = (arg) => { - successfulSelection = - arg.allDay === allDay && - arg.start.valueOf() === start.valueOf() && - arg.end.valueOf() === end.valueOf() - } - spyOn(options, 'select').and.callThrough() - - let calendar = initCalendar(options) - let calendarWrapper = new CalendarWrapper(calendar) - - if (!allDay) { - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - $firstDayEl = $(timeGridWrapper.getDayEls(start)) - $lastDayEl = $(timeGridWrapper.getDayEls(end)) - firstSlatIndex = start.getUTCHours() * 2 + (start.getUTCMinutes() / 30) // assumes slotDuration:'30:00' - lastSlatIndex = end.getUTCHours() * 2 + (end.getUTCMinutes() / 30) - 1 // assumes slotDuration:'30:00' - $firstSlatEl = $(timeGridWrapper.getSlotElByIndex(firstSlatIndex)) - $lastSlatEl = $(timeGridWrapper.getSlotElByIndex(lastSlatIndex)) - expect($firstSlatEl.length).toBe(1) - expect($lastSlatEl.length).toBe(1) - dy = $lastSlatEl.offset().top - $firstSlatEl.offset().top - $dragEl = $firstSlatEl - } else { - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - $firstDayEl = $(dayGridWrapper.getDayEl(start)) - $lastDayEl = $(dayGridWrapper.getDayEl(new Date(end.valueOf() - 1))) // inclusive - dy = $lastDayEl.offset().top - $firstDayEl.offset().top - $dragEl = $firstDayEl - } - - expect($firstDayEl.length).toBe(1) - expect($lastDayEl.length).toBe(1) - dx = $lastDayEl.offset().left - $firstDayEl.offset().left - - $dragEl.simulate('drag', { - dx, - dy, - onBeforeRelease() { - allowed = calendarWrapper.isAllowingDragging() - }, - onRelease() { - if (expectSuccess) { - expect(options.select).toHaveBeenCalled() - } - expect(expectSuccess).toBe(allowed) - expect(expectSuccess).toBe(successfulSelection) - expect(allowed).toBe(successfulSelection) - callback() - }, - }) -} diff --git a/fullcalendar-main/tests/src/lib/dom-geom.ts b/fullcalendar-main/tests/src/lib/dom-geom.ts deleted file mode 100644 index 15092cd..0000000 --- a/fullcalendar-main/tests/src/lib/dom-geom.ts +++ /dev/null @@ -1,325 +0,0 @@ -import { - isRect, isRectMostlyAbove, isRectMostlyLeft, isRectMostlyBounded, - isRectMostlyHBounded, isRectMostlyVBounded, rectsIntersect, rectContainersOther, -} from './geom.js' - -// fix bug with jQuery 3 returning 0 height for elements in the IE's -['height', 'outerHeight'].forEach((methodName) => { - let orig = $.fn[methodName] - - $.fn[methodName] = function () { // eslint-disable-line func-names - if (!arguments.length && this.is('td')) { // eslint-disable-line prefer-rest-params - return this[0].getBoundingClientRect().height - } - return orig.apply(this, arguments) // eslint-disable-line prefer-rest-params - } -}) - -export function getBoundingRects(els) { - return $(els).map((i, node) => getBoundingRect(node)).get() -} - -export function getBoundingRect(el) { - el = $(el) - return $.extend({}, el[0].getBoundingClientRect(), { - node: el, // very useful for debugging - }) -} - -export function anyElsIntersect(els) { - let rects = els.map((el) => el.getBoundingClientRect()) - - for (let i = 0; i < rects.length; i += 1) { - for (let j = i + 1; j < rects.length; j += 1) { - if (rectsIntersect(rects[i], rects[j])) { - return [els[i], els[j]] - } - } - } - - return false -} - -export function anyElsObscured(els) { - let rects = els.map((el) => el.getBoundingClientRect()) - - for (let i = 0; i < rects.length; i += 1) { - for (let j = 0; j < rects.length; j += 1) { - if (i !== j && rectContainersOther(rects[i], rects[j])) { - return [els[i], els[j]] - } - } - } - - return false -} - -export function getLeadingBoundingRect(els, direction = 'ltr') { - els = $(els) - expect(els.length).toBeGreaterThan(0) - let best = null - els.each((i, node) => { - const rect = getBoundingRect(node) - if (!best) { - best = rect - } else if (direction === 'rtl') { - if (rect.right > best.right) { - best = rect - } - } else if (rect.left < best.left) { - best = rect - } - }) - return best -} - -export function getTrailingBoundingRect(els, direction = 'ltr') { - els = $(els) - expect(els.length).toBeGreaterThan(0) - let best = null - els.each((i, node) => { - const rect = getBoundingRect(node) - if (!best) { - best = rect - } else if (direction === 'rtl') { - if (rect.left < best.left) { - best = rect - } - } else if (rect.right > best.right) { - best = rect - } - }) - return best -} - -export function sortBoundingRects(els, direction = 'ltr') { - els = $(els) // TODO: un-jquery-ify - const rects = els.map((i, node) => getBoundingRect(node)).get() - rects.sort((a, b) => { - if (direction === 'rtl') { - return b.right - a.right - } - return a.left - b.left - }) - return rects -} - -// given an element, returns its bounding box. given a rect, returns the rect. -function massageRect(input) { - if (isRect(input)) { - return input - } - return getBoundingRect(input) -} - -// Jasmine Adapters -// -------------------------------------------------------------------------------------------------- - -beforeEach(() => { - jasmine.addMatchers({ - - toBeMostlyAbove() { - return { - compare(subject, other) { - const result = { pass: isRectMostlyAbove(massageRect(subject), massageRect(other)), message: '' } - if (!result.pass) { - result.message = 'first rect is not mostly above the second' - } - return result - }, - } - }, - - toBeMostlyBelow() { - return { - compare(subject, other) { - const result = { pass: !isRectMostlyAbove(massageRect(subject), massageRect(other)), message: '' } - if (!result.pass) { - result.message = 'first rect is not mostly below the second' - } - return result - }, - } - }, - - toBeMostlyLeftOf() { - return { - compare(subject, other) { - const result = { pass: isRectMostlyLeft(massageRect(subject), massageRect(other)), message: '' } - if (!result.pass) { - result.message = 'first rect is not mostly left of the second' - } - return result - }, - } - }, - - toBeMostlyRightOf() { - return { - compare(subject, other) { - const result = { pass: !isRectMostlyLeft(massageRect(subject), massageRect(other)), message: '' } - if (!result.pass) { - result.message = 'first rect is not mostly right of the second' - } - return result - }, - } - }, - - toBeMostlyBoundedBy() { - return { - compare(subject, other) { - const result = { pass: isRectMostlyBounded(massageRect(subject), massageRect(other)), message: '' } - if (!result.pass) { - result.message = 'first rect is not mostly bounded by the second' - } - return result - }, - } - }, - - toBeMostlyHBoundedBy() { - return { - compare(subject, other) { - const result = { pass: isRectMostlyHBounded(massageRect(subject), massageRect(other)), message: '' } - if (!result.pass) { - result.message = 'first rect does not mostly horizontally bound the second' - } - return result - }, - } - }, - - toBeMostlyVBoundedBy() { - return { - compare(subject, other) { - const result = { pass: isRectMostlyVBounded(massageRect(subject), massageRect(other)), message: '' } - if (!result.pass) { - result.message = 'first rect does not mostly vertically bound the second' - } - return result - }, - } - }, - - toBeBoundedBy() { - return { - compare(actual, expected) { - let outer = massageRect(expected) - let inner = massageRect(actual) - let result = { - message: '', - pass: outer && inner && - inner.left >= outer.left && - inner.right <= outer.right && - inner.top >= outer.top && - inner.bottom <= outer.bottom, - } - if (!result.pass) { - result.message = 'Element does not bound other element' - } - return result - }, - } - }, - - toBeLeftOf() { - return { - compare(actual, expected) { - let subjectBounds = massageRect(actual) - let otherBounds = massageRect(expected) - let result = { - message: '', - pass: subjectBounds && otherBounds && - Math.round(subjectBounds.right) <= Math.round(otherBounds.left) + 2, - // need to round because IE was giving weird fractions - } - if (!result.pass) { - result.message = 'Element is not to the left of the other element' - } - return result - }, - } - }, - - toBeRightOf() { - return { - compare(actual, expected) { - let subjectBounds = massageRect(actual) - let otherBounds = massageRect(expected) - let result = { - message: '', - pass: subjectBounds && otherBounds && - Math.round(subjectBounds.left) >= Math.round(otherBounds.right) - 2, - // need to round because IE was giving weird fractions - } - if (!result.pass) { - result.message = 'Element is not to the right of the other element' - } - return result - }, - } - }, - - toBeAbove() { - return { - compare(actual, expected) { - let subjectBounds = massageRect(actual) - let otherBounds = massageRect(expected) - let result = { - message: '', - pass: subjectBounds && otherBounds && - Math.round(subjectBounds.bottom) <= Math.round(otherBounds.top) + 2, - // need to round because IE was giving weird fractions - } - if (!result.pass) { - result.message = 'Element is not above the other element' - } - return result - }, - } - }, - - toBeBelow() { - return { - compare(actual, expected) { - let subjectBounds = massageRect(actual) - let otherBounds = massageRect(expected) - let result = { - message: '', - pass: subjectBounds && otherBounds && - Math.round(subjectBounds.top) >= Math.round(otherBounds.bottom) - 2, - // need to round because IE was giving weird fractions - } - if (!result.pass) { - result.message = 'Element is not below the other element' - } - return result - }, - } - }, - - toIntersectWith() { - return { - compare(actual, expected) { - let subjectBounds = massageRect(actual) - let otherBounds = massageRect(expected) - let result = { - message: '', - pass: subjectBounds && otherBounds && - subjectBounds.right - 1 > otherBounds.left && - subjectBounds.left + 1 < otherBounds.right && - subjectBounds.bottom - 1 > otherBounds.top && - subjectBounds.top + 1 < otherBounds.bottom, - // +/-1 because of zoom - } - if (!result.pass) { - result.message = 'Element does not intersect with other element' - } - return result - }, - } - }, - - }) -}) diff --git a/fullcalendar-main/tests/src/lib/dom-misc.ts b/fullcalendar-main/tests/src/lib/dom-misc.ts deleted file mode 100644 index 85a48f3..0000000 --- a/fullcalendar-main/tests/src/lib/dom-misc.ts +++ /dev/null @@ -1,61 +0,0 @@ -export const RED_REGEX = /red|rgb\(255,\s*0,\s*0\)/ -export const GREEN_REGEX = /green|rgb\(0,\s*255,\s*0\)/ -export const BLUE_REGEX = /blue|rgb\(0,\s*0,\s*255\)/ - -export function getStockScrollbarWidths(direction) { - let el = $('
') - .css({ - position: 'absolute', - top: -1000, - left: 0, - border: 0, - padding: 0, - overflow: 'scroll', - direction: direction || 'ltr', - }) - .appendTo('body') - - let elRect = el[0].getBoundingClientRect() - let innerEl = el.children() - let innerElRect = innerEl[0].getBoundingClientRect() - - let girths = { - left: innerElRect.left - elRect.left, - right: elRect.left + elRect.width - innerElRect.left, - top: innerElRect.top - elRect.top, - bottom: elRect.top + elRect.height - innerElRect.top, - } - - el.remove() - - return girths -} - -export function filterVisibleEls(els) { - return els.filter((el) => { - let $el = $(el) - return $el.is(':visible') && $el.css('visibility') !== 'hidden' - }) -} - -// TODO: make sure these matchers are loaded globally first - -beforeEach(() => { - jasmine.addMatchers({ - - toHaveScrollbars() { - return { - compare(actual) { - let elm = $(actual) - let result = { - pass: elm[0].scrollWidth - 1 > elm[0].clientWidth || // -1 !!! - elm[0].scrollHeight - 1 > elm[0].clientHeight, // -1 !!! - } - // !!! - IE was reporting a scrollWidth/scrollHeight 1 pixel taller than what it was :( - return result - }, - } - }, - - }) -}) diff --git a/fullcalendar-main/tests/src/lib/dst-dead-zone.ts b/fullcalendar-main/tests/src/lib/dst-dead-zone.ts deleted file mode 100644 index b2041b4..0000000 --- a/fullcalendar-main/tests/src/lib/dst-dead-zone.ts +++ /dev/null @@ -1,71 +0,0 @@ -/* -Some hours don't exist in local time when a daylight-savings shift happpens. -This time is called a "dead zone". -If possible, this function returns an array of two dates, -the date just before the dead zone (with a 999 millisecond time) -and the date just after the dead zone. - -I apologize for the unreadability of this code. It was written a long time ago: -https://github.com/arshaw/xdate/blob/master/test/old.js -*/ -export function getDSTDeadZone() { - let dstDates = getDSTDates() - - if (dstDates) { - let prior = new Date(dstDates[0].valueOf() - 1) - - if (Math.abs(dstDates[0].getHours() - prior.getHours()) > 1) { - return [prior, dstDates[0]] - } - - prior = new Date(dstDates[1].valueOf() - 1) - - if (Math.abs(dstDates[1].getHours() - prior.getHours()) > 1) { - return [prior, dstDates[1]] - } - } - - return null -} - -function getDSTDates() { - let MS_DAY = 86400000 - let res = [] - let d0 = new Date() - let overAYear = new Date(+d0) - - overAYear.setFullYear(overAYear.getFullYear() + 1) - overAYear = new Date(overAYear.valueOf() + MS_DAY) - - while (d0 < overAYear) { - let d1 = new Date(d0.valueOf() + MS_DAY) - if (d0.getTimezoneOffset() !== d1.getTimezoneOffset()) { - res.push(new Date(narrowDSTDate(+d0, +d1))) - if (res.length === 2) { - break - } - } - d0 = d1 - } - - return res.length === 2 ? res : null -} - -function narrowDSTDate(start, end) { - if (end <= start + 1) { - return end - } - - let mid = start + Math.floor((end - start) / 2) - let midTZO = new Date(mid).getTimezoneOffset() - let startTZO = new Date(start).getTimezoneOffset() - let endTZO = new Date(end).getTimezoneOffset() - - if (midTZO === startTZO) { - return narrowDSTDate(mid, end) - } if (midTZO === endTZO) { - return narrowDSTDate(start, mid) - } - - return null -} diff --git a/fullcalendar-main/tests/src/lib/geom.ts b/fullcalendar-main/tests/src/lib/geom.ts deleted file mode 100644 index 17db1b4..0000000 --- a/fullcalendar-main/tests/src/lib/geom.ts +++ /dev/null @@ -1,112 +0,0 @@ -export function getRectCenter(rect) { - return buildPoint( - rect.left + rect.width / 2, - rect.top + rect.height / 2, - ) -} - -export function intersectRects(rect0, rect1) { - return buildRectViaEdges( - Math.max(rect0.left, rect1.left), - Math.max(rect0.top, rect1.top), - Math.min(rect0.right, rect1.right), - Math.min(rect0.bottom, rect1.bottom), - ) -} - -export function rectsIntersect(rect0, rect1) { - return rect0.left < rect1.right && rect0.right > rect1.left && rect0.top < rect1.bottom && rect0.bottom > rect1.top -} - -export function rectContainersOther(rect0, rect1) { // rect0 contains rect1? - return rect1.left >= rect0.left && rect1.right <= rect0.right && rect1.top >= rect0.top && rect1.bottom <= rect0.bottom -} - -export function joinRects(rect1, rect2) { - return { - left: Math.min(rect1.left, rect2.left), - right: Math.max(rect1.right, rect2.right), - top: Math.min(rect1.top, rect2.top), - bottom: Math.max(rect1.bottom, rect2.bottom), - } -} - -function buildRectViaEdges(left, top, right, bottom) { - return { - left, - top, - width: right - left, - height: bottom - top, - right, - bottom, - } -} - -function buildPoint(left, top) { - return { - left, - top, - } -} - -export function subtractPoints(point1, point0) { - return buildPoint( - point1.left - point0.left, - point1.top - point0.top, - ) -} - -export function addPoints(point0, point1) { - return buildPoint( - point0.left + point1.left, - point0.top + point1.top, - ) -} - -// in most situations you can just use the rect directly, since the interface is a superset -export function getRectTopLeft(rect) { - return buildPoint(rect.left, rect.top) -} - -export function isRect(input) { - return typeof input === 'object' && 'left' in input && 'right' in input && 'top' in input && 'bottom' in input -} - -export function isRectMostlyAbove(subjectRect, otherRect) { - return (subjectRect.bottom - otherRect.top) < // overlap is less than - ((subjectRect.bottom - subjectRect.top) / 2) // half the height -} - -export function isRectMostlyLeft(subjectRect, otherRect) { - return (subjectRect.right - otherRect.left) < // overlap is less then - ((subjectRect.right - subjectRect.left) / 2) // half the width -} - -export function isRectMostlyBounded(subjectRect, boundRect) { - return isRectMostlyHBounded(subjectRect, boundRect) && - isRectMostlyVBounded(subjectRect, boundRect) -} - -export function isRectMostlyHBounded(subjectRect, boundRect) { - return (Math.min(subjectRect.right, boundRect.right) - - Math.max(subjectRect.left, boundRect.left)) > // overlap area is greater than - ((subjectRect.right - subjectRect.left) / 2) // half the width -} - -export function isRectMostlyVBounded(subjectRect, boundRect) { - return (Math.min(subjectRect.bottom, boundRect.bottom) - - Math.max(subjectRect.top, boundRect.top)) > // overlap area is greater than - ((subjectRect.bottom - subjectRect.top) / 2) // half the height -} - -export function isRectsSimilar(rect1, rect2) { - return isRectsHSimilar(rect1, rect2) && isRectsVSimilar(rect1, rect2) -} - -function isRectsHSimilar(rect1, rect2) { - return (Math.abs(rect1.left - rect2.left) <= 2) && (Math.abs(rect1.right - rect2.right) <= 3) // :( -} - -function isRectsVSimilar(rect1, rect2) { - return (Math.abs(rect1.top - rect2.top) <= 2) && (Math.abs(rect1.bottom - rect2.bottom) <= 3) // :( -} diff --git a/fullcalendar-main/tests/src/lib/global-plugins.ts b/fullcalendar-main/tests/src/lib/global-plugins.ts deleted file mode 100644 index f998947..0000000 --- a/fullcalendar-main/tests/src/lib/global-plugins.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { PluginDef } from '@fullcalendar/core' -import interactionPlugin from '@fullcalendar/interaction' -import dayGridPlugin from '@fullcalendar/daygrid' -import timeGridPlugin from '@fullcalendar/timegrid' -import listPlugin from '@fullcalendar/list' -import multiMonthPlugin from '@fullcalendar/multimonth' - -export const DEFAULT_PLUGINS: PluginDef[] = [ - interactionPlugin, - dayGridPlugin, - timeGridPlugin, - listPlugin, - multiMonthPlugin, -] - -pushOptions({ - plugins: DEFAULT_PLUGINS, -}) diff --git a/fullcalendar-main/tests/src/lib/global-utils.ts b/fullcalendar-main/tests/src/lib/global-utils.ts deleted file mode 100644 index 6214e15..0000000 --- a/fullcalendar-main/tests/src/lib/global-utils.ts +++ /dev/null @@ -1,320 +0,0 @@ -import { Calendar, CalendarOptions } from '@fullcalendar/core' -import { createPlugin } from '@fullcalendar/core' -import { parseLocalDate, parseUtcDate } from './date-parsing.js' - -// Other Important Global Stuff -// --------------------------------------------------------------------------------------------------------------------- - -import './hacks.js' -import './simulate.js' -import './date-matchers.js' - -// Setup / Teardown -// --------------------------------------------------------------------------------------------------------------------- - -let optionsStack = null - -beforeEach(() => { - optionsStack = [] -}) - -afterEach(() => { - optionsStack = null - - if (window.currentCalendar) { - window.currentCalendar.destroy() - window.currentCalendar = null - } - - $('#calendar').remove() -}) - -// Calendar Options and Initialization -// --------------------------------------------------------------------------------------------------------------------- - -function pushOptions(options: CalendarOptions) { - beforeEach(() => { - optionsStack.push(options) - }) -} - -// called within an `it` -// needs to be called *before* initCalendar -function spyOnCalendarCallback(name, func?) { - let options = {} as any - - options[name] = func || (() => {}) - spyOn(options, name).and.callThrough() - - optionsStack.push(options) - - return options[name] -} - -function initCalendar(moreOptions?: CalendarOptions, el?) { - let $el - - if (moreOptions) { - optionsStack.push(moreOptions) - } - - if (el) { - $el = $(el) - } else { - $el = $('
').appendTo('body') - } - - if (window.currentCalendar) { - window.currentCalendar.destroy() - } - - let options = getCurrentOptions() - let newCalendar = null - - options.plugins = options.plugins.concat([ - createPlugin({ - name: 'current-calendar-' + Date.now(), // ugh, might be called twice per calendar - contextInit(context) { - newCalendar = window.currentCalendar = context.calendarApi as Calendar - }, - }), - ]) - - let cool = new Calendar($el[0], options) - - if (newCalendar === window.currentCalendar) { - newCalendar.render() - } else { - newCalendar.destroy() - } - - return cool -} - -function getCurrentOptions() { - let args = [{}].concat(optionsStack) as any - return $.extend.apply($, args) // eslint-disable-line prefer-spread -} - -// Categorizing Tests -// --------------------------------------------------------------------------------------------------------------------- - -/* -describeOptions(optionName, descriptionAndValueHash, callback) -describeOptions(descriptionAndOptionsHash, callback) - */ -function describeOptions(optName, hash?, callback?) { - if ($.type(optName) === 'object') { - callback = hash - hash = optName - optName = null - } - - $.each( - hash, - (desc, val) => { - let opts - - if (optName) { - opts = {} - opts[optName] = val - } else { - opts = val - } - opts = $.extend(true, {}, opts) - - describe(desc as string, () => { - pushOptions(opts) - callback(val) - }) - }, - ) -} - -function describeValues(hash, callback) { - $.each( - hash, - /** - * @param desc {string} - */ - (desc, val) => { - describe(desc as string, () => { - callback(val) - }) - }, - ) -} - -// Timezone Tests (needed?) -// --------------------------------------------------------------------------------------------------------------------- - -const timeZoneScenarios = { - local: { - description: 'when local timezone', - value: 'local', - parseDate: parseLocalDate, - }, - UTC: { - description: 'when UTC timezone', - value: 'UTC', - parseDate: parseUtcDate, - }, -} - -function describeTimeZones(callback) { - $.each(timeZoneScenarios, (name, scenario) => { - describe(scenario.description, () => { - pushOptions({ - timeZone: name, - }) - callback(scenario) - }) - }) -} - -function describeTimeZone(name, callback) { - let scenario = timeZoneScenarios[name] - - describe(scenario.description, () => { - pushOptions({ - timeZone: name, - }) - callback(scenario) - }) -} - -// Misc -// --------------------------------------------------------------------------------------------------------------------- - -function oneCall(func) { - let called - called = false - return function () { // eslint-disable-line func-names - if (!called) { - called = true - return func.apply(this, arguments) // eslint-disable-line prefer-rest-params - } - return null - } -} - -function spyOnMethod(Class, methodName, dontCallThrough) { - let origMethod = Class.prototype.hasOwnProperty(methodName) // eslint-disable-line no-prototype-builtins - ? Class.prototype[methodName] - : null - - let spy = spyOn(Class.prototype, methodName) - - if (!dontCallThrough) { - spy = spy.and.callThrough() - } - - (spy as any).restore = () => { - if (origMethod) { - Class.prototype[methodName] = origMethod - } else { - delete Class.prototype[methodName] - } - } - - return spy -} - -// wraps an existing function in a spy, calling through to the function -function spyCall(func?) { - func = func || (() => {}) - const obj = { func } - spyOn(obj, 'func').and.callThrough() - return obj.func -} - -type spyOnCalendarCallbackType = typeof spyOnCalendarCallback -type pushOptionsType = typeof pushOptions -type initCalendarType = typeof initCalendar -type getCurrentOptionsType = typeof getCurrentOptions -type describeOptionsType = typeof describeOptions -type describeValuesType = typeof describeValues -type describeTimeZonesType = typeof describeTimeZones -type describeTimeZoneType = typeof describeTimeZone -type oneCallType = typeof oneCall -type spyOnMethodType = typeof spyOnMethod -type spyCallType = typeof spyCall - -declare global { - - let currentCalendar: Calendar - let spyOnCalendarCallback: spyOnCalendarCallbackType - let pushOptions: pushOptionsType - let initCalendar: initCalendarType - let getCurrentOptions: getCurrentOptionsType - let describeOptions: describeOptionsType - let describeValues: describeValuesType - let describeTimeZones: describeTimeZonesType - let describeTimeZone: describeTimeZoneType - let oneCall: oneCallType - let spyOnMethod: spyOnMethodType - let spyCall: spyCallType - - interface Window { // how to unify this with the above let statements? - currentCalendar: Calendar - karmaConfig: any - } - - interface Function { - calls: any // for jasmine spies - } - - interface JQueryStatic { - simulate: any - simulateMouseClick: any - simulateTouchClick: any - simulateByPoint: any - _data: any - } - - interface JQuery { - simulate: any - draggable: any - sortable: any - } - - // eslint-disable-next-line @typescript-eslint/no-namespace - namespace jasmine { - interface Matchers { - toEqualDate: any - toEqualLocalDate: any - toEqualNow: any - toBeBoundedBy: any - toIntersectWith: any - toBeAbove: any - toBeBelow: any - toBeRightOf: any - toBeLeftOf: any - toHaveScrollbars: any - toBeMostlyHBoundedBy: any - toBeMostlyAbove: any - toBeMostlyLeftOf: any - toBeMostlyRightOf: any - } - } - -} - -Object.assign(window, { - spyOnCalendarCallback, - pushOptions, - initCalendar, - getCurrentOptions, - describeOptions, - describeValues, - describeTimeZones, - describeTimeZone, - oneCall, - spyOnMethod, - spyCall, -}) - -pushOptions({ - timeZone: 'UTC', - eventDisplay: 'auto', -}) diff --git a/fullcalendar-main/tests/src/lib/global.css b/fullcalendar-main/tests/src/lib/global.css deleted file mode 100644 index dbb888b..0000000 --- a/fullcalendar-main/tests/src/lib/global.css +++ /dev/null @@ -1,12 +0,0 @@ -/* BAD: premium's css copies this css */ - -body { - margin-top: 40px; - font-size: 13px; - font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif; -} - -.fc { - max-width: 900px; - margin: 20px auto; -} diff --git a/fullcalendar-main/tests/src/lib/global.ts b/fullcalendar-main/tests/src/lib/global.ts deleted file mode 100644 index 7cdc67a..0000000 --- a/fullcalendar-main/tests/src/lib/global.ts +++ /dev/null @@ -1,2 +0,0 @@ -import './global-utils.js' -import './global-plugins.js' diff --git a/fullcalendar-main/tests/src/lib/hacks.ts b/fullcalendar-main/tests/src/lib/hacks.ts deleted file mode 100644 index c5f57c4..0000000 --- a/fullcalendar-main/tests/src/lib/hacks.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { config } from '@fullcalendar/core/internal' - -beforeEach(() => { - // On real devices, when a click-like touch interaction happens, there is a preiod of time where mouse events - // are ignores. Since ignore peroid is global, and might span across tests, disable it. - // The simulates touch events do not fire these mouse events anyway. - config.touchMouseIgnoreWait = 0 - - // increase the default timeout - jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000 -}) diff --git a/fullcalendar-main/tests/src/lib/segs.ts b/fullcalendar-main/tests/src/lib/segs.ts deleted file mode 100644 index 11a851b..0000000 --- a/fullcalendar-main/tests/src/lib/segs.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { isRectsSimilar } from './geom.js' -import { getBoundingRects } from './dom-geom.js' - -export function doElsMatchSegs(els, segs, segToRectFunc) { - let elRect - let found - let i - let j - let k - let len - let len1 - let seg - let segRect - let unmatchedRects = getBoundingRects(els) - - if (unmatchedRects.length !== segs.length) { - return false - } - - for (j = 0, len = segs.length; j < len; j += 1) { - seg = segs[j] - segRect = segToRectFunc(seg) - found = false - for (i = k = 0, len1 = unmatchedRects.length; k < len1; i = (k += 1)) { - elRect = unmatchedRects[i] - if (isRectsSimilar(elRect, segRect)) { - unmatchedRects.splice(i, 1) // remove - found = true - break - } - } - if (!found) { - return false - } - } - - return !unmatchedRects.length -} diff --git a/fullcalendar-main/tests/src/lib/simulate.ts b/fullcalendar-main/tests/src/lib/simulate.ts deleted file mode 100644 index ed2c8ba..0000000 --- a/fullcalendar-main/tests/src/lib/simulate.ts +++ /dev/null @@ -1,326 +0,0 @@ -/* General Utils ----------------------------------------------------------------------------------------------------------------------- */ - -$.simulateByPoint = (type, options) => { - let docEl = $(document) - let point = options.point - let clientX - let clientY - let node - - if (point) { - clientX = point.left - docEl.scrollLeft() - clientY = point.top - docEl.scrollTop() - node = document.elementFromPoint(clientX, clientY) - $(node).simulate(type, options) - } -} - -/* Touch ----------------------------------------------------------------------------------------------------------------------- */ - -let origSimulateEvent = $.simulate.prototype.simulateEvent -let touchUID = Date.now() - -$.simulate.prototype.simulateEvent = function (elem, type, options) { // eslint-disable-line func-names - if (elem === window && type === 'resize') { - return this.simulateWindowResize() - } if (/^touch/.test(type)) { - return this.simulateTouchEvent(elem, type, options) - } - return origSimulateEvent.apply(this, arguments) // eslint-disable-line prefer-rest-params -} - -$.simulate.prototype.simulateWindowResize = function () { // eslint-disable-line func-names - // from https://stackoverflow.com/a/1818513/96342 - let event - - if (typeof Event !== 'undefined') { - try { - event = new Event('resize') - } catch (ex) { - // why would fail? - } - } - - if (!event) { - event = document.createEvent('UIEvents') - event.initUIEvent('resize', true, false, window, 0) - } - - this.dispatchEvent(window, 'resize', event) -} - -$.simulate.prototype.simulateTouchEvent = function (elem, type, options) { // eslint-disable-line func-names - // http://stackoverflow.com/a/29019278/96342 - let event = document.createEvent('Event') - - event.initEvent(type, true, true); // cancelable, bubbleable - (event as any).touches = [{ - target: elem, - identifier: touchUID, - pageX: options.clientX, - pageY: options.clientY, - screenX: options.clientX, - screenY: options.clientY, - clientX: options.clientX, - clientY: options.clientY, - }] - touchUID += 1 - - this.dispatchEvent(elem, type, event, options) -} - -$.simulateMouseClick = function (elem) { // eslint-disable-line func-names - let $elem = $(elem) - let clientCoords = { - clientX: $elem.offset().left + $elem.outerWidth() / 2, - clientY: $elem.offset().top + $elem.outerHeight() / 2, - } - $elem.simulate('mousemove', clientCoords) - $elem.simulate('mousedown', clientCoords) - $elem.simulate('mouseup', clientCoords) - $elem.simulate('click', clientCoords) -} - -$.simulateTouchClick = function (elem) { // eslint-disable-line func-names - let $elem = $(elem) - let clientCoords = { - clientX: $elem.offset().left + $elem.outerWidth() / 2, - clientY: $elem.offset().top + $elem.outerHeight() / 2, - } - $elem.simulate('touchstart', clientCoords) - $elem.simulate('touchend', clientCoords) - $elem.simulate('mousemove', clientCoords) - $elem.simulate('mousedown', clientCoords) - $elem.simulate('mouseup', clientCoords) - $elem.simulate('click', clientCoords) -} - -/* Drag-n-drop ----------------------------------------------------------------------------------------------------------------------- */ - -let DEBUG_DELAY = 500 -let DEBUG_MIN_DURATION = 2000 -let DEBUG_MIN_MOVES = 100 -let DRAG_DEFAULTS = { - point: null, // the start point - localPoint: { left: '50%', top: '50%' }, - end: null, // can be a point or an el - localEndPoint: { left: '50%', top: '50%' }, - dx: 0, - dy: 0, - moves: 5, - duration: 100, // ms -} - -let dragStackCnt = 0 - -$.simulate.prototype.simulateDrag = function () { // eslint-disable-line func-names - let options = $.extend({}, DRAG_DEFAULTS, this.options) - let targetNode = this.target // raw DOM node - let targetEl = $(targetNode) // jq object - let dx = options.dx - let dy = options.dy - let duration = options.duration - let moves = options.moves - let startPoint - let endEl - let endPoint - let localPoint - let offset - - // compute start point - if (options.point) { - startPoint = options.point - } else { - localPoint = normalizeElPoint(options.localPoint, targetEl) - offset = targetEl.offset() - startPoint = { - left: offset.left + localPoint.left, - top: offset.top + localPoint.top, - } - } - - // compute end point - if (options.end) { - if (isPoint(options.end)) { - endPoint = options.end - } else { // assume options.end is an element - endEl = $(options.end) - localPoint = normalizeElPoint(options.localEndPoint, endEl) - offset = endEl.offset() - endPoint = { - left: offset.left + localPoint.left, - top: offset.top + localPoint.top, - } - } - } - - if (endPoint) { - dx = endPoint.left - startPoint.left - dy = endPoint.top - startPoint.top - } - - moves = Math.max(moves, options.debug ? DEBUG_MIN_MOVES : 1) - duration = Math.max(duration, options.debug ? DEBUG_MIN_DURATION : 10) - - simulateDrag( - this, - targetNode, - startPoint, - dx, - dy, - moves, - duration, - options, - ) -} - -function simulateDrag(self, targetNode, startPoint, dx, dy, moveCnt, duration, options) { - let debug = options.debug - let isTouch = options.isTouch - let docNode = targetNode.ownerDocument - let docEl = $(docNode) - let waitTime = duration / moveCnt - let moveIndex = 0 - let clientCoords - let intervalId - let dotEl - let dragId - - if (debug) { - dotEl = $('
') - .css({ - position: 'absolute', - zIndex: 99999, - border: '5px solid red', - borderRadius: '5px', - margin: '-5px 0 0 -5px', - }) - .appendTo('body') - } - - function updateCoords() { - let progress = moveIndex / moveCnt - let left = startPoint.left + dx * progress - let top = startPoint.top + dy * progress - - clientCoords = { - clientX: left - docEl.scrollLeft(), - clientY: top - docEl.scrollTop(), - } - - if (debug) { - dotEl.css({ left, top }) - } - } - - function startDrag() { - updateCoords() - dragStackCnt += 1 - dragId = dragStackCnt - - // simulate a drag-start only if another drag isn't already happening - if (dragStackCnt === 1) { - self.simulateEvent( - targetNode, // can have an inner drag-start el. targetNode will still be source of emitted events - isTouch ? 'touchstart' : 'mousedown', - clientCoords, - ) - } - - let delay = options.delay || 0 - if (debug) { - delay = Math.max(delay, DEBUG_DELAY) - } - - if (delay) { - setTimeout(() => { - startMoving() - }, delay) - } else { - startMoving() - } - } - - function startMoving() { - intervalId = setInterval(tick, waitTime) - } - - function tick() { // called one interval after start - moveIndex += 1 - updateCoords() // update clientCoords before mousemove - - if (isTouch) { - // touchmove happens on the originating element - self.simulateEvent(targetNode, 'touchmove', clientCoords) - } else { - self.simulateEvent(docNode, 'mousemove', clientCoords) - } - - if (moveIndex >= moveCnt) { - stopMoving() - } - } - - function stopMoving() { - clearInterval(intervalId) - if (debug) { - setTimeout(() => { - dotEl.remove() // do this before calling stopDrag/callback. don't want dot picked up by elementFromPoint - stopDrag() - }, DEBUG_DELAY) - } else { - stopDrag() - } - } - - function stopDrag() { // progress at 1, coords already up to date at this point - (options.onBeforeRelease || (() => {}))() - - // only simulate a drop if the current drag is still the active one. - // otherwise, this means another drag has begun via onBeforeRelease. - if (dragId === dragStackCnt) { - if ( - $.contains(docNode, targetNode) || - isTouch // touch will always first touchend on original node, even if removed from DOM - // https://stackoverflow.com/a/45760014 - ) { - self.simulateEvent(targetNode, isTouch ? 'touchend' : 'mouseup', clientCoords) - self.simulateEvent(targetNode, 'click', clientCoords) - } else { - self.simulateEvent(docNode, isTouch ? 'touchend' : 'mouseup', clientCoords) - } - } - - dragStackCnt -= 1 - - let callback: (() => void) = options.onRelease || options.callback || (() => {}) - - // we wait because the there might be a FullCalendar drag interaction that finishes asynchronously - // after the mouseend/touchend happens, and it's really convenient if our callback fires after that. - setTimeout(callback, 0) - } - - startDrag() -} - -function normalizeElPoint(point, el) { - let left = point.left - let top = point.top - - if (/%$/.test(left)) { - left = (parseInt(left, 10) / 100) * el.outerWidth() - } - if (/%$/.test(top)) { - top = (parseInt(top, 10) / 100) * el.outerHeight() - } - - return { left, top } -} - -function isPoint(input) { - return typeof input === 'object' && // `in` operator only works on objects - 'left' in input && 'top' in input -} diff --git a/fullcalendar-main/tests/src/lib/string.ts b/fullcalendar-main/tests/src/lib/string.ts deleted file mode 100644 index c92eb0e..0000000 --- a/fullcalendar-main/tests/src/lib/string.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function removeLtrCharCodes(s) { - return s.replace(/\u200e/g, '') -} diff --git a/fullcalendar-main/tests/src/lib/timeZoneImpl.ts b/fullcalendar-main/tests/src/lib/timeZoneImpl.ts deleted file mode 100644 index 67d0626..0000000 --- a/fullcalendar-main/tests/src/lib/timeZoneImpl.ts +++ /dev/null @@ -1,27 +0,0 @@ -import dayGridPlugin from '@fullcalendar/daygrid' - -export function testTimeZoneImpl(timeZoneImplPlugin) { - describe('named tz implementation', () => { - pushOptions({ - plugins: [timeZoneImplPlugin, dayGridPlugin], - }) - - it('computes correct offset for named timezone for View dates', () => { - initCalendar({ - initialView: 'dayGridMonth', - now: '2018-09-01', - timeZone: 'Europe/Moscow', - events: [ - { start: '2018-09-05' }, - ], - }) - - let view = currentCalendar.view - expect(view.currentStart).toEqualDate('2018-09-01T00:00:00+03:00') - - // interprets the ambug iso date string correctly - let event = currentCalendar.getEvents()[0] - expect(event.start).toEqualDate('2018-09-05T00:00:00+03:00') - }) - }) -} diff --git a/fullcalendar-main/tests/src/lib/vdom-misc.ts b/fullcalendar-main/tests/src/lib/vdom-misc.ts deleted file mode 100644 index e270bdb..0000000 --- a/fullcalendar-main/tests/src/lib/vdom-misc.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { render, createElement, flushSync } from '@fullcalendar/core/preact' -import { ListenerCounter } from './ListenerCounter.js' - -let standardElListenerCount - -export function prepareStandardListeners() { - if (standardElListenerCount === undefined) { - standardElListenerCount = _prepareStandardListeners() - } - return standardElListenerCount -} - -export function _prepareStandardListeners() { - let el = document.createElement('div') - document.body.appendChild(el) - - const elListenerCounter = new ListenerCounter(el) - elListenerCounter.startWatching() - - flushSync(() => { - render(createElement('div', {}), el) - }) - - return elListenerCounter.stopWatching() -} diff --git a/fullcalendar-main/tests/src/lib/wrappers/CalendarWrapper.ts b/fullcalendar-main/tests/src/lib/wrappers/CalendarWrapper.ts deleted file mode 100644 index 1dc8256..0000000 --- a/fullcalendar-main/tests/src/lib/wrappers/CalendarWrapper.ts +++ /dev/null @@ -1,102 +0,0 @@ -import { Calendar } from '@fullcalendar/core' -import { findElements } from '@fullcalendar/core/internal' -import { ToolbarWrapper } from './ToolbarWrapper.js' - -export class CalendarWrapper { - static EVENT_CLASSNAME = 'fc-event' // TODO: put this everywhere? - static EVENT_IS_START_CLASSNAME = 'fc-event-start' - static EVENT_IS_END_CLASSNAME = 'fc-event-end' - static EVENT_TIME_CLASSNAME = 'fc-event-time' - static EVENT_TITLE_CLASSNAME = 'fc-event-title' - static EVENT_RESIZER_CLASSNAME = 'fc-event-resizer' - static EVENT_START_RESIZER_CLASSNAME = 'fc-event-resizer-start' - static EVENT_END_RESIZER_CLASSNAME = 'fc-event-resizer-end' - static BG_EVENT_CLASSNAME = 'fc-bg-event' - static DAY_PAST_CLASSNAME = 'fc-day-past' - static DAY_FUTURE_CLASSNAME = 'fc-day-future' - static SLOT_PAST_CLASSNAME = 'fc-slot-past' - static SLOT_FUTURE_CLASSNAME = 'fc-slot-future' - static TODAY_CLASSNAME = 'fc-day-today' - static SLOT_TODAY_CLASSNAME = 'fc-slot-today' - static DOW_CLASSNAMES = ['fc-day-sun', 'fc-day-mon', 'fc-day-tue', 'fc-day-wed', 'fc-day-thu', 'fc-day-fri', 'fc-day-sat'] - static DOW_SLOT_CLASSNAMES = ['fc-slot-sun', 'fc-slot-mon', 'fc-slot-tue', 'fc-slot-wed', 'fc-slot-thu', 'fc-slot-fri', 'fc-slot-sat'] - static LTR_CLASSNAME = 'fc-direction-ltr' - static RTL_CLASSNAME = 'fc-direction-rtl' - static BOOTSTRAP_CLASSNAME = 'fc-theme-bootstrap' - static UNTHEMED_CLASSNAME = 'fc-theme-standard' - static ROOT_CLASSNAME = 'fc' - - constructor(private calendar: Calendar) { - } - - // TODO: distinguish between header/footerToolbar - get toolbar() { - let toolbarEl = this.calendar.el.querySelector('.fc-toolbar') as HTMLElement - return toolbarEl ? new ToolbarWrapper(toolbarEl) : null - } - - get footerToolbar() { - let toolbarEl = this.calendar.el.querySelector('.fc-footer-toolbar') as HTMLElement - return toolbarEl ? new ToolbarWrapper(toolbarEl) : null - } - - getViewContainerEl() { - return this.calendar.el.querySelector('.fc-view-harness') as HTMLElement - } - - getViewEl() { - return this.calendar.el.querySelector('.fc-view') as HTMLElement - } - - getViewName() { - return this.getViewEl().getAttribute('class').match(/fc-(\w+)-view/)[1] - } - - // DISCOURAGE use of the following... - - getNonBusinessDayEls() { - return findElements(this.calendar.el, '.fc-non-business') - } - - getEventEls() { // FG only - return findElements(this.calendar.el, '.fc-event:not(.fc-bg-event)') - } - - getFirstEventEl() { - return this.calendar.el.querySelector('.fc-event:not(.fc-bg-event)') as HTMLElement - } - - getTodayEls() { - return findElements(this.calendar.el, '.fc-day-today') - } - - getEventElInfo(eventEl: HTMLElement) { - return { - isStart: eventEl.classList.contains(CalendarWrapper.EVENT_IS_START_CLASSNAME), - isEnd: eventEl.classList.contains(CalendarWrapper.EVENT_IS_END_CLASSNAME), - timeText: $(eventEl).find('.' + CalendarWrapper.EVENT_TIME_CLASSNAME).text() || '', - titleEl: eventEl.querySelector('.' + CalendarWrapper.EVENT_TITLE_CLASSNAME), - resizerEl: eventEl.querySelector('.' + CalendarWrapper.EVENT_RESIZER_CLASSNAME), - } - } - - getBgEventEls() { - return findElements(this.calendar.el, '.' + CalendarWrapper.BG_EVENT_CLASSNAME) - } - - getFirstDateEl() { - return this.calendar.el.querySelector('.fc [data-date]') - } - - getDateCellEl(dateStr: string) { - return this.calendar.el.querySelector('td.fc-day[data-date="' + dateStr + '"]') - } - - getLicenseMessage() { - return $('.fc-license-message', this.calendar.el).text() - } - - isAllowingDragging() { - return !$('body').hasClass('fc-not-allowed') - } -} diff --git a/fullcalendar-main/tests/src/lib/wrappers/DayGridViewWrapper.ts b/fullcalendar-main/tests/src/lib/wrappers/DayGridViewWrapper.ts deleted file mode 100644 index 0c4a3d5..0000000 --- a/fullcalendar-main/tests/src/lib/wrappers/DayGridViewWrapper.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Calendar } from '@fullcalendar/core' -import { ViewWrapper } from './ViewWrapper.js' -import { DayGridWrapper } from './DayGridWrapper.js' -import { DayHeaderWrapper } from './DayHeaderWrapper.js' - -export class DayGridViewWrapper extends ViewWrapper { - constructor(calendar: Calendar) { - super(calendar, 'fc-daygrid') - } - - get header() { - let headerEl = this.el.querySelector('.fc-col-header') as HTMLElement - return headerEl ? new DayHeaderWrapper(headerEl) : null - } - - get dayGrid() { - return new DayGridWrapper(this.el.querySelector('.fc-daygrid-body')) - } - - getScrollerEl() { - return this.el.querySelector('.fc-daygrid-body').parentElement // TODO: use closest - } -} diff --git a/fullcalendar-main/tests/src/lib/wrappers/DayGridWrapper.ts b/fullcalendar-main/tests/src/lib/wrappers/DayGridWrapper.ts deleted file mode 100644 index aef06ab..0000000 --- a/fullcalendar-main/tests/src/lib/wrappers/DayGridWrapper.ts +++ /dev/null @@ -1,295 +0,0 @@ -import { findElements } from '@fullcalendar/core/internal' -import { formatIsoDay } from '../datelib-utils.js' -import { getRectCenter, intersectRects, addPoints, subtractPoints } from '../geom.js' -import { CalendarWrapper } from './CalendarWrapper.js' - -export class DayGridWrapper { - static EVENT_IS_START_CLASSNAME = 'fc-event-start' - static EVENT_IS_END_CLASSNAME = 'fc-event-end' - - constructor(private el: HTMLElement) { - } - - getRootTableEl() { - return $(this.el).find('> table')[0] as HTMLElement - } - - getAllDayEls() { - return findElements(this.el, '.fc-day[data-date]') - } - - getMirrorEls() { - return findElements(this.el, '.fc-event.fc-event-mirror') - } - - getDayEl(date) { - if (typeof date === 'string') { - date = new Date(date) - } - return this.el.querySelector('.fc-day[data-date="' + formatIsoDay(date) + '"]') - } - - getDayEls(date) { // TODO: return single el??? accept 'tues' - if (typeof date === 'number') { - return findElements(this.el, `.fc-day.${CalendarWrapper.DOW_CLASSNAMES[date]}`) - } - if (typeof date === 'string') { - date = new Date(date) - } - return findElements(this.el, '.fc-day[data-date="' + formatIsoDay(date) + '"]') - } - - getDayNumberText(date) { - return $(this.getDayEl(date).querySelector('.fc-daygrid-day-top')).text() - } - - getDayElsInRow(row) { - return findElements(this.getRowEl(row), '.fc-day') - } - - // TODO: discourage use - getNonBusinessDayEls() { - return findElements(this.el, '.fc-non-business') - } - - // example: gets all the Mondays in the first row of days - // TODO: discourage use - getDowEls(dayAbbrev) { - return findElements(this.el, `tr:first-child > td.fc-day-${dayAbbrev}`) - } - - getMonthStartEls() { - return findElements(this.el, '.fc-daygrid-month-start') - } - - getDisabledDayEls() { - return findElements(this.el, '.fc-day-disabled') - } - - getMoreEl() { - return this.el.querySelector('.fc-daygrid-more-link') - } - - getMoreEls() { - return findElements(this.el, '.fc-daygrid-more-link') - } - - getWeekNavLinkEls() { - return findElements(this.el, '.fc-daygrid-week-number[data-navlink]') - } - - getWeekNumberEls() { - return findElements(this.el, '.fc-daygrid-week-number') - } - - getWeekNumberEl(rowIndex) { - return this.getRowEl(rowIndex).querySelector('.fc-daygrid-week-number') - } - - getWeekNumberText(rowIndex) { - return $(this.getWeekNumberEl(rowIndex)).text() - } - - getNavLinkEl(date) { - return this.getDayEl(date).querySelector('.fc-daygrid-day-number[data-navlink]') - } - - clickNavLink(date) { - $.simulateMouseClick(this.getNavLinkEl(date)) - } - - openMorePopover(index?) { - if (index == null) { - $(this.getMoreEl()).simulate('click') - } else { - $(this.el.querySelectorAll('.fc-daygrid-more-link')[index]).simulate('click') - } - } - - getMorePopoverEl() { - let viewWrapperEl = this.el.closest('.fc-view-harness') - return viewWrapperEl.querySelector('.fc-more-popover') as HTMLElement - } - - getMorePopoverHeaderEl() { - return this.getMorePopoverEl().querySelector('.fc-popover-header') as HTMLElement - } - - getMorePopoverEventEls() { - return findElements(this.getMorePopoverEl(), '.fc-event') - } - - getMorePopoverEventCnt() { // fg - return this.getMorePopoverEventEls().length - } - - getMorePopoverEventTitles() { - return this.getMorePopoverEventEls().map((el) => $(el.querySelector('.fc-event-title')).text()) - } - - getMorePopoverBgEventCnt() { - return this.getMorePopoverEl().querySelectorAll('.fc-bg-event').length - } - - closeMorePopover() { - $(this.getMorePopoverEl().querySelector('.fc-popover-close')).simulate('click') - } - - getMorePopoverTitle() { - return $(this.getMorePopoverEl().querySelector('.fc-popover-title')).text() - } - - getRowEl(i) { - return this.el.querySelector(`tr:nth-child(${i + 1})`) as HTMLElement // nth-child is 1-indexed! - } - - getRowEls() { - return findElements(this.el, 'tr') - } - - getBgEventEls(row?) { - let parentEl = row == null ? this.el : this.getRowEl(row) - return findElements(parentEl, '.fc-bg-event') - } - - getEventEls() { // FG events - return findElements(this.el, '.fc-daygrid-event') - } - - isEventListItem(el: HTMLElement) { - return el.classList.contains('fc-daygrid-dot-event') - } - - getFirstEventEl() { - return this.el.querySelector('.fc-daygrid-event') as HTMLElement - } - - getHighlightEls() { // FG events - return findElements(this.el, '.fc-highlight') - } - - static getEventElInfo(eventEl) { - return { - title: $(eventEl).find('.fc-event-title').text(), - timeText: $(eventEl).find('.fc-event-time').text(), - } - } - - clickDate(date) { - $.simulateMouseClick(this.getDayEl(date)) - } - - selectDates(start, inclusiveEnd) { - return new Promise((resolve) => { - $(this.getDayEls(start)).simulate('drag', { - point: getRectCenter(this.getDayEl(start).getBoundingClientRect()), - end: getRectCenter(this.getDayEl(inclusiveEnd).getBoundingClientRect()), - onRelease: () => resolve(), - }) - }) - } - - selectDatesTouch(start, inclusiveEnd, debug = false) { - return new Promise((resolve) => { - let startEl = this.getDayEl(start) - - setTimeout(() => { // wait for calendar to accept touch :( - // QUESTION: why do we not need to do press-down first? - $(startEl).simulate('drag', { - debug, - isTouch: true, - end: getRectCenter(this.getDayEl(inclusiveEnd).getBoundingClientRect()), - onRelease: () => resolve(), - }) - }, 0) - }) - } - - dragEventToDate(eventEl: HTMLElement, startDate, endDate, isTouch?, onBeforeRelease?) { - return new Promise((resolve) => { - if (!startDate) { - let rect1 = this.getDayEl(endDate).getBoundingClientRect() - let point1 = getRectCenter(rect1) - - $(eventEl).simulate('drag', { - isTouch: isTouch || false, - delay: isTouch ? 200 : 0, // bad to hardcode ms - end: point1, - onBeforeRelease, - onRelease: () => resolve(), - }) - } else { - let rect0 = this.getDayEl(startDate).getBoundingClientRect() - let rect1 = this.getDayEl(endDate).getBoundingClientRect() - - let eventRect = eventEl.getBoundingClientRect() - let point0 = getRectCenter(intersectRects(eventRect, rect0)) - let point1 = getRectCenter(rect1) - - $(eventEl).simulate('drag', { - isTouch: isTouch || false, - delay: isTouch ? 200 : 0, // bad to hardcode ms - point: point0, - end: point1, - onBeforeRelease, - onRelease: () => resolve(), - }) - } - }) - } - - resizeEvent(eventEl: HTMLElement, origEndDate, newEndDate, fromStart?, onBeforeRelease?) { - return new Promise((resolve) => { - let rect0 = this.getDayEl(origEndDate).getBoundingClientRect() - let rect1 = this.getDayEl(newEndDate).getBoundingClientRect() - - let resizerEl = $(eventEl).find( - '.' + (fromStart ? CalendarWrapper.EVENT_START_RESIZER_CLASSNAME : CalendarWrapper.EVENT_END_RESIZER_CLASSNAME), - ).css('display', 'block')[0] // usually only displays on hover. force display - - let resizerRect = resizerEl.getBoundingClientRect() - let resizerCenter = getRectCenter(resizerRect) - - let vector = subtractPoints(resizerCenter, rect0) - let endPoint = addPoints(rect1, vector) - - $(resizerEl).simulate('drag', { - point: resizerCenter, - end: endPoint, - onBeforeRelease, - onRelease: () => resolve(), - }) - }) - } - - resizeEventTouch(eventEl: HTMLElement, origEndDate, newEndDate, fromStart?) { - return new Promise((resolve) => { - let rect0 = this.getDayEl(origEndDate).getBoundingClientRect() - let rect1 = this.getDayEl(newEndDate).getBoundingClientRect() - - setTimeout(() => { // wait for calendar to accept touch :( - $(eventEl).simulate('drag', { - isTouch: true, - delay: 200, - onRelease: () => { - let resizerEl = eventEl.querySelector( - '.' + (fromStart ? CalendarWrapper.EVENT_START_RESIZER_CLASSNAME : CalendarWrapper.EVENT_END_RESIZER_CLASSNAME), - ) - let resizerRect = resizerEl.getBoundingClientRect() - let resizerCenter = getRectCenter(resizerRect) - - let vector = subtractPoints(resizerCenter, rect0) - let endPoint = addPoints(rect1, vector) - - $(resizerEl).simulate('drag', { - isTouch: true, - point: resizerCenter, - end: endPoint, - onRelease: () => resolve(), - }) - }, - }) - }, 0) - }) - } -} diff --git a/fullcalendar-main/tests/src/lib/wrappers/DayHeaderWrapper.ts b/fullcalendar-main/tests/src/lib/wrappers/DayHeaderWrapper.ts deleted file mode 100644 index a18faf6..0000000 --- a/fullcalendar-main/tests/src/lib/wrappers/DayHeaderWrapper.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { findElements } from '@fullcalendar/core/internal' -import { parseIsoAsUtc, formatIsoDay } from '../datelib-utils.js' -import { parseUtcDate } from '../date-parsing.js' -import { CalendarWrapper } from './CalendarWrapper.js' - -export class DayHeaderWrapper { - constructor(public el: HTMLElement) { - } - - getDates() { - return this.getCellEls().map((cellEl) => parseIsoAsUtc(cellEl.getAttribute('data-date'))) - } - - getCellEls() { - return findElements(this.el, '.fc-col-header-cell') - } - - getCellEl(dateOrDow) { - if (typeof dateOrDow === 'number') { - return this.el.querySelector(`.fc-col-header-cell.${CalendarWrapper.DOW_CLASSNAMES[dateOrDow]}`) - } - if (typeof dateOrDow === 'string') { - dateOrDow = parseUtcDate(dateOrDow) - } - return this.el.querySelector(`.fc-col-header-cell[data-date="${formatIsoDay(dateOrDow)}"]`) - } - - getCellText(dateOrDow) { - return $(this.getCellEl(dateOrDow)).text() - } - - getCellInfo() { // all - return this.getCellEls().map((cellEl) => ({ - text: $(cellEl).text(), - date: parseIsoAsUtc(cellEl.getAttribute('data-date')), - isToday: cellEl.classList.contains('fc-day-today'), - })) - } - - getNavLinkEls() { - return findElements(this.el, '.fc-col-header-cell[data-date] a[data-navlink]') - } - - getNavLinkEl(dayDate) { - if (typeof dayDate === 'string') { - dayDate = new Date(dayDate) - } - return this.el.querySelector('.fc-col-header-cell[data-date="' + formatIsoDay(dayDate) + '"] a') - } - - clickNavLink(date) { - $.simulateMouseClick(this.getNavLinkEl(date)) - } -} diff --git a/fullcalendar-main/tests/src/lib/wrappers/ListViewWrapper.ts b/fullcalendar-main/tests/src/lib/wrappers/ListViewWrapper.ts deleted file mode 100644 index a758bd8..0000000 --- a/fullcalendar-main/tests/src/lib/wrappers/ListViewWrapper.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { Calendar } from '@fullcalendar/core' -import { findElements } from '@fullcalendar/core/internal' -import { ViewWrapper } from './ViewWrapper.js' -import { formatIsoDay } from '../datelib-utils.js' - -export class ListViewWrapper extends ViewWrapper { - static EVENT_DOT_CLASSNAME = 'fc-list-event-dot' - - constructor(calendar: Calendar) { - super(calendar, 'fc-list') - } - - getEventEls() { - return findElements(this.el, '.fc-list-event') - } - - getEventInfo() { - return this.getEventEls().map((eventEl) => ({ - title: $(eventEl).find('.fc-list-event-title').text(), - timeText: $(eventEl).find('.fc-list-event-time').text(), - })) - } - - getDayInfo() { - return this.getHeadingEls().map((el) => { - let $el = $(el) - return { - mainText: $el.find('.fc-list-day-text').text() || '', - altText: $el.find('.fc-list-day-side-text').text() || '', - date: new Date(el.getAttribute('data-date')), - } - }) - } - - getHeadingEls() { - return findElements(this.el, '.fc-list-day') - } - - getScrollerEl() { - return this.el.querySelector('.fc-scroller') - } - - hasEmptyMessage() { - return Boolean(this.el.querySelector('.fc-list-empty')) - } - - getNavLinkEl(dayDate) { - if (typeof dayDate === 'string') { - dayDate = new Date(dayDate) - } - return this.el.querySelector('.fc-list-day[data-date="' + formatIsoDay(dayDate) + '"] a.fc-list-day-text') - } - - clickNavLink(dayDate) { - $.simulateMouseClick(this.getNavLinkEl(dayDate)) - } -} diff --git a/fullcalendar-main/tests/src/lib/wrappers/MultiMonthViewWrapper.ts b/fullcalendar-main/tests/src/lib/wrappers/MultiMonthViewWrapper.ts deleted file mode 100644 index 821dcbc..0000000 --- a/fullcalendar-main/tests/src/lib/wrappers/MultiMonthViewWrapper.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { Calendar } from '@fullcalendar/core' -import { findElements } from '@fullcalendar/core/internal' -import { ViewWrapper } from './ViewWrapper.js' -import { DayGridWrapper } from './DayGridWrapper.js' - -export class MultiMonthViewWrapper extends ViewWrapper { - constructor(calendar: Calendar) { - super(calendar, 'fc-multimonth') - } - - getMonths() { - const monthEls = findElements(this.el, '.fc-multimonth-month') - - return monthEls.map((monthEl) => ({ - el: monthEl, - title: (monthEl.querySelector('.fc-multimonth-title') as HTMLElement).innerText, - columnCnt: monthEl.querySelectorAll('th').length, - })) - } - - getDayGrid(i) { - const dayGridEls = findElements(this.el, '.fc-multimonth-daygrid') - return new DayGridWrapper(dayGridEls[i]) - } - - getEventEls() { // FG events - return findElements(this.el, '.fc-daygrid-event') - } - - getScrollerEl() { - return this.el // the view itself - } -} diff --git a/fullcalendar-main/tests/src/lib/wrappers/TimeGridViewWrapper.ts b/fullcalendar-main/tests/src/lib/wrappers/TimeGridViewWrapper.ts deleted file mode 100644 index 6f83969..0000000 --- a/fullcalendar-main/tests/src/lib/wrappers/TimeGridViewWrapper.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { ViewWrapper } from './ViewWrapper.js' -import { TimeGridWrapper } from './TimeGridWrapper.js' -import { DayGridWrapper } from './DayGridWrapper.js' -import { DayHeaderWrapper } from './DayHeaderWrapper.js' - -export class TimeGridViewWrapper extends ViewWrapper { - constructor(calendar) { - super(calendar, 'fc-timegrid') - } - - get header() { - let headerEl = this.el.querySelector('.fc-col-header') as HTMLElement - return headerEl ? new DayHeaderWrapper(headerEl) : null - } - - get timeGrid() { - return new TimeGridWrapper(this.el.querySelector('.fc-timegrid-body')) - } - - get dayGrid() { // the all-day area - let dayGridEl = this.el.querySelector('.fc-daygrid-body') as HTMLElement - return dayGridEl ? new DayGridWrapper(dayGridEl) : null - } - - getScrollerEl() { - return this.el.querySelector('.fc-timegrid-body').parentElement // TODO: use closest - } - - getHeaderAxisEl() { - return this.el.querySelector('.fc-col-header .fc-timegrid-axis') - } - - getHeaderWeekNumberLink() { - return this.getHeaderAxisEl().querySelector('a') - } - - getHeaderWeekText() { // the title - return $(this.getHeaderWeekNumberLink()).text() - } - - getAllDayAxisEl() { - return this.el.querySelector('.fc-daygrid-body .fc-timegrid-axis') - } - - getAllDayAxisElText() { - return $(this.getAllDayAxisEl()).text() - } -} diff --git a/fullcalendar-main/tests/src/lib/wrappers/TimeGridWrapper.ts b/fullcalendar-main/tests/src/lib/wrappers/TimeGridWrapper.ts deleted file mode 100644 index 28b3011..0000000 --- a/fullcalendar-main/tests/src/lib/wrappers/TimeGridWrapper.ts +++ /dev/null @@ -1,627 +0,0 @@ -import { findElements, startOfDay, createDuration, parseMarker, addDays, addMs, getRectCenter, asRoughMs } from '@fullcalendar/core/internal' -import { formatIsoDay, formatIsoTime, ensureDate } from '../datelib-utils.js' -import { parseUtcDate } from '../date-parsing.js' -import { getBoundingRect } from '../dom-geom.js' -import { addPoints } from '../geom.js' -import { CalendarWrapper } from './CalendarWrapper.js' - -export class TimeGridWrapper { - constructor(public el: HTMLElement) { - } - - getAllDayEls() { - return findElements(this.el, '.fc-day[data-date]') - } - - getMirrorEls() { - return findElements(this.el, '.fc-event.fc-event-mirror') - } - - getDayEls(date) { // TODO: rename. make singular name - date = ensureDate(date) - return findElements(this.el, '.fc-day[data-date="' + formatIsoDay(date) + '"]') - } - - getSlotEls() { - return findElements(this.el, '.fc-timegrid-slot-label[data-time]') - } - - getAxisTexts() { - return this.getSlotAxisEls().map((el) => $(el).text()) - } - - getSlotAxisEls() { // TODO: rename to label - return findElements(this.el, '.fc-timegrid-slot-label[data-time]') - } - - getSlotLaneEls() { - return findElements(this.el, '.fc-timegrid-slot-lane[data-time]') - } - - getSlotElByIndex(index) { // TODO: rename "slat" - return $(`.fc-timegrid-slots tr:eq(${index})`, this.el).get() - } - - getMainSlotTable() { - return $('.fc-timegrid-slots > table')[0] - } - - getSeparateSlotAxisTable() { - return $('.fc-timegrid-axis-chunk > table')[0] - } - - getSlotElByTime(timeMs) { - let date = parseUtcDate('2016-01-01') - date = new Date(date.valueOf() + timeMs) - - if (date.getUTCDate() === 1) { // ensure no time overflow/underflow - return this.el.querySelector('.fc-timegrid-slot-label[data-time="' + formatIsoTime(date) + '"]') - } - - return null - } - - getNonBusinessDayEls() { - return findElements(this.el, '.fc-non-business') - } - - getColEl(col) { - return this.el.querySelectorAll('.fc-timegrid-col:not(.fc-timegrid-axis)')[col] as HTMLElement - } - - queryBgEventsInCol(col) { - return findElements(this.getColEl(col), '.fc-bg-event') - } - - queryNonBusinessSegsInCol(col) { - return findElements(this.getColEl(col), '.fc-non-business') - } - - getHighlightEls() { // FG events - return findElements(this.el, '.fc-highlight') - } - - // TODO: discourage use - getDowEls(dayAbbrev) { - return findElements(this.el, `.fc-day-${dayAbbrev}`) - } - - // for https://github.com/fullcalendar/fullcalendar-scheduler/issues/363 - isStructureValid() { - return Boolean(this.el.querySelector('.fc-timegrid-slots')) - } - - getMoreEls() { - return findElements(this.el, '.fc-timegrid-more-link') - } - - openMorePopover(index?) { - $(this.getMoreEls()[index || 0]).simulate('click') - } - - getMorePopoverEl() { - let viewWrapperEl = this.el.closest('.fc-view-harness') - return viewWrapperEl.querySelector('.fc-more-popover') as HTMLElement - } - - getMorePopoverEventEls() { - return findElements(this.getMorePopoverEl(), '.fc-event') - } - - hasNowIndicator() { - let hasArrow = Boolean(this.getNowIndicatorArrowEl()) - let hasLine = Boolean(this.getNowIndicatorLineEl()) - - if (hasArrow !== hasLine) { - throw new Error('Inconsistent now-indicator rendering state') - } else { - return hasArrow - } - } - - getNowIndicatorArrowEl() { - return this.el.querySelector('.fc-timegrid-now-indicator-arrow') - } - - getNowIndicatorLineEl() { - return this.el.querySelector('.fc-timegrid-now-indicator-line') - } - - getTimeAxisInfo() { - return $('.fc-timegrid-slot-label[data-time]', this.el).map((i, td) => ({ - text: $(td).text(), - isMajor: !$(td).hasClass('fc-timegrid-slot-minor'), - })).get() - } - - getLastMajorAxisInfo() { - let cells = this.getTimeAxisInfo() - - for (let i = cells.length - 1; i >= 0; i -= 1) { - if (cells[i].isMajor) { - return cells[i] - } - } - - return null - } - - dragEventToDate(eventEl: HTMLElement, dropDate, onBeforeRelease?) { - return new Promise((resolve) => { - $(eventEl).simulate('drag', { - localPoint: { left: '50%', top: 5 }, // ahhh 5. overcome divider sometimes - end: this.getPoint(dropDate), - onBeforeRelease, - onRelease: () => resolve(), - }) - }) - } - - resizeEvent(eventEl: HTMLElement, origEndDate, newEndDate, onBeforeRelease?) { - return new Promise((resolve) => { - let resizerEl = $(eventEl).find('.' + CalendarWrapper.EVENT_RESIZER_CLASSNAME) - .css('display', 'block')[0] // usually only displays on hover. force display - - let resizerPoint = getRectCenter(resizerEl.getBoundingClientRect()) - let origPoint = this.getPoint(origEndDate) - let yCorrect = resizerPoint.top - origPoint.top - let destPoint = this.getPoint(newEndDate) - destPoint = addPoints(destPoint, { left: 0, top: yCorrect }) - - $(resizerEl).simulate('drag', { - end: destPoint, - onBeforeRelease, - onRelease: () => resolve(), - }) - }) - } - - resizeEventTouch(eventEl: HTMLElement, origEndDate, newEndDate) { - return new Promise((resolve) => { - setTimeout(() => { // wait for calendar to accept touch :( - $(eventEl).simulate('drag', { - isTouch: true, - localPoint: { left: '50%', top: '90%' }, - delay: 200, - onRelease: () => { - let resizerEl = eventEl.querySelector('.' + CalendarWrapper.EVENT_RESIZER_CLASSNAME) - let resizerPoint = getRectCenter(resizerEl.getBoundingClientRect()) - let origPoint = this.getPoint(origEndDate) - let yCorrect = resizerPoint.top - origPoint.top - let destPoint = this.getPoint(newEndDate) - destPoint = addPoints(destPoint, { left: 0, top: yCorrect }) - - $(resizerEl).simulate('drag', { - isTouch: true, - end: destPoint, - onRelease: () => resolve(), - }) - }, - }) - }, 0) - }) - } - - selectDates(start, end) { - let startPoint = this.getPoint(start) - let endPoint = this.getPoint(end, true) - - startPoint.top += 2 - endPoint.top -= 2 - - return new Promise((resolve) => { - $(this.getDayEls(start)).simulate('drag', { - point: startPoint, - end: endPoint, - onRelease: () => resolve(), - }) - }) - } - - selectDatesTouch(start, end, debug = false) { - let dayEls = this.getDayEls(start) - let startPoint = this.getPoint(start) - let endPoint = this.getPoint(end, true) - - startPoint.top += 2 - endPoint.top -= 2 - - return new Promise((resolve) => { - setTimeout(() => { // wait for calendar to accept touch :( - // QUESTION: why do we not need to do press-down first? - $(dayEls).simulate('drag', { - debug, - isTouch: true, - point: startPoint, - end: endPoint, - onRelease: () => resolve(), - }) - }, 0) - }) - } - - clickDate(date) { - return new Promise((resolve) => { - $(this.getDayEls(date)).simulate('drag', { - point: this.getPoint(date), - onRelease: () => resolve(), - }) - }) - } - - getRect(start, end) { - let obj - if (typeof start === 'object') { - obj = start - start = obj.start - end = obj.end - } - - start = ensureDate(start) - end = ensureDate(end) - - let startDay = startOfDay(start) - let endDay = startOfDay(end) - let startTimeMs = start.valueOf() - startDay.valueOf() - let endTimeMs = end.valueOf() - endDay.valueOf() - - if (startDay.valueOf() === endDay.valueOf()) { - endTimeMs = end.valueOf() - endDay.valueOf() - } else if (end < start) { - endTimeMs = startTimeMs - } else { - endTimeMs = 1000 * 60 * 60 * 24 // whole day - } - - let dayEls = this.getDayEls(start) - let dayRect = getBoundingRect(dayEls) - return { - left: dayRect.left, - right: dayRect.right, - top: this.getTimeTop(startTimeMs), - bottom: this.getTimeTop(endTimeMs), - } - } - - getPoint(date, isEnd?) { // gives offset to window topleft, like getBoundingClientRect - date = ensureDate(date) - - let day = startOfDay(date) - let timeMs = date.valueOf() - day.valueOf() - - if (isEnd && !timeMs) { - day = addDays(day, -1) - timeMs = date.valueOf() - day.valueOf() - } - - let top = this.getTimeTop(timeMs) - let dayEls = this.getDayEls(day) - let dayRect - - expect(dayEls.length).toBe(1) - dayRect = getBoundingRect(dayEls[0]) - - return { - left: (dayRect.left + dayRect.right) / 2, - top, - } - } - - getLine(date) { - date = ensureDate(date) - - let day = startOfDay(date) - let timeMs = date.valueOf() - day.valueOf() - let top = this.getTimeTop(timeMs) - let dayEls = this.getDayEls(date) - let dayRect - - expect(dayEls.length).toBe(1) - dayRect = getBoundingRect(dayEls[0]) - - return { - left: dayRect.left, - right: dayRect.right, - top, - bottom: top, - } - } - - getTimeTop(targetTimeMs) { - if (typeof targetTimeMs !== 'number') { - targetTimeMs = asRoughMs(createDuration(targetTimeMs)) - } - - const topBorderWidth = 1 // TODO: kill - - let singleSlotEl = this.getSlotElByTime(targetTimeMs) - if (singleSlotEl) { // exact slot match - return $(singleSlotEl).offset().top + topBorderWidth - } - - let $slotEl // used within loop, but we access last val - let slotEls = this.getSlotEls() // all slots - let slotTimeMs = null - let prevSlotTimeMs = null - - for (let i = 0; i < slotEls.length; i += 1) { // traverse earlier to later - let slotEl = slotEls[i] - $slotEl = $(slotEl) - - prevSlotTimeMs = slotTimeMs - slotTimeMs = createDuration(slotEl.getAttribute('data-time')).milliseconds - - // is target time between start of previous slot but before this one? - if (targetTimeMs < slotTimeMs) { - // before first slot - if (!prevSlotTimeMs) { - return $slotEl.offset().top + topBorderWidth - } - - let $prevSlotEl = $(slotEls[i - 1]) - return $prevSlotEl.offset().top + // previous slot top - topBorderWidth + - ($prevSlotEl.outerHeight() * - ((targetTimeMs - prevSlotTimeMs) / (slotTimeMs - prevSlotTimeMs))) - } - } - - // target time must be after the start time of the last slot. - // `slotTimeMs` is set to the start time of the last slot. - - // guess the duration of the last slot, based on previous duration - const slotMsDuration = slotTimeMs - prevSlotTimeMs - - return $slotEl.offset().top + // last slot's top - topBorderWidth + - ($slotEl.outerHeight() * - Math.min(1, (targetTimeMs - slotTimeMs) / slotMsDuration)) // don't go past end of last slot - } - - computeSpanRects(start, end) { - start = ensureDate(start) - end = ensureDate(end) - - let dayStructs = this.computeDayInfo() - let slotStructs = this.computeSlotInfo() - let dayI - let dayStruct - let slotI - let slotStruct - let slotDayStart - let slotStart - let slotEnd - let coverage - let startTop = null - let endTop = null - let rects = [] - - for (dayI = 0; dayI < dayStructs.length; dayI += 1) { - dayStruct = dayStructs[dayI] - - for (slotI = 0; slotI < slotStructs.length; slotI += 1) { - slotStruct = slotStructs[slotI] - - slotDayStart = addDays( - dayStruct.date, - slotStruct.dayOffset, - ) - - slotStart = addMs( - slotDayStart, - slotStruct.startTimeMs, - ) - - slotEnd = addMs( - slotDayStart, - slotStruct.endTimeMs, - ) - - if (startTop === null) { // looking for the start - coverage = (start - slotStart.valueOf()) / (slotEnd.valueOf() - slotStart.valueOf()) - startTop = (coverage > 0 && coverage <= 1) - ? (slotStruct.top + slotStruct.height * coverage) - : null - } else { // looking for the end - coverage = (end - slotStart.valueOf()) / (slotEnd.valueOf() - slotStart.valueOf()) - endTop = (coverage >= 0 && coverage < 1) // exclusive - ? (slotStruct.top + slotStruct.height * coverage) - : null - - if (endTop !== null) { // found end - rects.push({ - left: dayStruct.left, - right: dayStruct.right, - top: startTop, - bottom: endTop, - width: dayStruct.right - dayStruct.left, - height: endTop - startTop, - }) - startTop = null - } - } - } - - if (startTop !== null) { // could not find the start in this day - rects.push({ - left: dayStruct.left, - right: dayStruct.right, - top: startTop, - bottom: slotStruct.bottom, - width: dayStruct.right - dayStruct.left, - height: slotStruct.bottom - startTop, - }) - startTop = slotStructs[0].top // top of next column - } - } - - return rects - } - - private computeDayInfo() { - let dayEls = this.getAllDayEls() - - let days = dayEls.map((node) => { - let rect = node.getBoundingClientRect() - return $.extend({}, rect, { - date: parseMarker( - node.getAttribute('data-date'), - ).marker, - }) - }) - - return days - } - - private computeSlotInfo() { - let slotEls = this.getSlotEls() - let slots = slotEls.map((node) => { - let rect = node.getBoundingClientRect() - return $.extend({}, rect, { - startTimeMs: createDuration( - node.getAttribute('data-time'), - ).milliseconds, - }) as any - }) - - let len = slots.length - if (len < 3) { - console.log('need at least 3 slots') // eslint-disable-line no-console - return [] - } - - let mid = Math.floor(len / 2) - let i = mid - 1 - let standardMs = slots[mid + 1].startTimeMs - slots[mid].startTimeMs - let ms - let dayOffset = 0 - - // iterate from one-before middle to beginning - for (i = mid - 1; i >= 0; i -= 1) { - ms = slots[i + 1].startTimeMs - slots[i].startTimeMs - - // big deviation? assume moved to previous day (b/c of special slotMinTime) - if (Math.abs(ms - standardMs) > standardMs * 2) { - dayOffset -= 1 - slots[i].endTimeMs = slots[i].startTimeMs + standardMs - } else { // otherwise, current slot's end is next slot's beginning - slots[i].endTimeMs = slots[i + 1].startTimeMs - } - - slots[i].dayOffset = dayOffset - } - - dayOffset = 0 - - // iterate from middle to one-before last - for (i = mid; i < len - 1; i += 1) { - ms = slots[i + 1].startTimeMs - slots[i].startTimeMs - - slots[i].dayOffset = dayOffset - - // big deviation? assume moved to next day (b/c of special slotMaxTime) - if (Math.abs(ms - standardMs) > standardMs * 2) { - dayOffset += 1 // will apply to the next slotStruct - slots[i].endTimeMs = slots[i].startTimeMs + standardMs - } else { // otherwise, current slot's end is next slot's beginning - slots[i].endTimeMs = slots[i + 1].startTimeMs - } - } - - // assume last slot has the standard duration - slots[i].endTimeMs = slots[i].startTimeMs + standardMs - slots[i].dayOffset = dayOffset - - // if last slot went over the day threshold - if (slots[i].endTimeMs > 1000 * 60 * 60 * 24) { - slots[i].endTimeMs -= 1000 * 60 * 60 * 24 - slots[i].dayOffset += 1 - } - - return slots - } - - getEventEls() { // FG events - return findElements(this.el, '.fc-timegrid-event') - } - - getFirstEventEl() { - return this.el.querySelector('.fc-timegrid-event') as HTMLElement - } - - getBgEventEls() { - return findElements(this.el, '.fc-bg-event') - } - - getEventTimeTexts() { - return this.getEventEls().map((eventEl) => $(eventEl.querySelector('.fc-event-time')).text()) - } - - static getEventElInfo(eventEl) { - return { - title: $(eventEl).find('.fc-event-title').text(), - timeText: $(eventEl).find('.fc-event-time').text(), - } - } - - /* - Returns a boolean. - TODO: check isStart/isEnd. - */ - checkEventRendering(start, end) { - if (typeof start === 'string') { - start = new Date(start) - } - if (typeof end === 'string') { - end = new Date(end) - } - - let expectedRects = this.computeSpanRects(start, end) - let eventEls = this.getEventEls() // sorted by DOM order. not good for RTL - let isMatch = checkEventRenderingMatch(expectedRects, eventEls) - - return { - rects: expectedRects, - els: eventEls, - length: eventEls.length, - isMatch, - } - } -} - -function checkEventRenderingMatch(expectedRects, eventEls) { - let expectedLength = expectedRects.length - let i - let expectedRect - let elRect - - if (eventEls.length !== expectedLength) { - console.log('does not match element count') // eslint-disable-line no-console - return false - } - - for (i = 0; i < expectedLength; i += 1) { - expectedRect = expectedRects[i] - elRect = eventEls[i].getBoundingClientRect() - - // horizontally contained AND vertically really similar? - if (!( - elRect.left >= expectedRect.left && - elRect.right <= expectedRect.right && - Math.abs(elRect.top - expectedRect.top) < 1 && - Math.abs(elRect.bottom + 1 - expectedRect.bottom) < 1 // add 1 because of bottom margin! - )) { - console.log('rects do not match') // eslint-disable-line no-console - return false - } - } - - return true -} - -export function queryEventElInfo(eventEl: HTMLElement) { - return { - timeText: $(eventEl.querySelector('.fc-event-time')).text(), - isShort: eventEl.classList.contains('fc-timegrid-event-short'), - } -} diff --git a/fullcalendar-main/tests/src/lib/wrappers/ToolbarWrapper.ts b/fullcalendar-main/tests/src/lib/wrappers/ToolbarWrapper.ts deleted file mode 100644 index a3b2cf5..0000000 --- a/fullcalendar-main/tests/src/lib/wrappers/ToolbarWrapper.ts +++ /dev/null @@ -1,65 +0,0 @@ -export class ToolbarWrapper { - constructor(private el: HTMLElement) { - } - - getButtonEnabled(name) { - let buttonEl = this.el.querySelector('.fc-' + name + '-button') as HTMLButtonElement - return buttonEl && !buttonEl.disabled - } - - getButtonInfo(name, iconPrefix = 'fc-icon') { // prefix doesnt have dash - let el = this.getButtonEl(name) - - if (el) { - let iconEl = el.querySelector(`.${iconPrefix}`) - let iconNameMatch = iconEl && iconEl.className.match(new RegExp(`${iconPrefix}-([^ ]+)`)) - - return { - text: $(el).text(), - iconEl, - iconName: iconNameMatch ? iconNameMatch[1] : '', - } - } - - return null - } - - getButtonEl(name) { // for custom or standard buttons - return this.el.querySelector(`.fc-${name}-button`) - } - - getTitleText() { - return (this.el.querySelector('.fc-toolbar-title') as HTMLElement).innerText.trim() - } - - getSectionContent(index) { // 0=start, 1=center, 2=end - return processSectionItems( - this.el.querySelectorAll('.fc-toolbar-chunk')[index] as HTMLElement, - ) - } -} - -function processSectionItems(sectionEl: HTMLElement) { - let children = Array.prototype.slice.call(sectionEl.children) as HTMLElement[] - - return children.map((childEl) => { - if (childEl.classList.contains('fc-button')) { - return { - type: 'button', - name: childEl.className.match(/fc-(\w+)-button/)[1], - } - } - if (childEl.classList.contains('fc-button-group')) { - return { - type: 'button-group', - children: processSectionItems(childEl), - } - } - if (childEl.nodeName === 'H2') { - return { - type: 'title', - } - } - throw new Error('Unknown type of content in toolbar') - }) -} diff --git a/fullcalendar-main/tests/src/lib/wrappers/ViewWrapper.ts b/fullcalendar-main/tests/src/lib/wrappers/ViewWrapper.ts deleted file mode 100644 index e073bcb..0000000 --- a/fullcalendar-main/tests/src/lib/wrappers/ViewWrapper.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Calendar } from '@fullcalendar/core' - -export class ViewWrapper { - el: HTMLElement // TODO: make protected? - - constructor(calendar: Calendar, className: string) { - let viewEl = calendar.el.querySelector('.fc-view') as HTMLElement - if (!viewEl || !viewEl.classList.contains(className)) { - throw new Error(`Can't find view with className '${className}' in test model`) - } - this.el = viewEl - } -} diff --git a/fullcalendar-main/tests/src/lib/wrappers/interaction-util.ts b/fullcalendar-main/tests/src/lib/wrappers/interaction-util.ts deleted file mode 100644 index 95b0913..0000000 --- a/fullcalendar-main/tests/src/lib/wrappers/interaction-util.ts +++ /dev/null @@ -1,105 +0,0 @@ -import { Calendar } from '@fullcalendar/core' - -export function waitEventDrag(calendar: Calendar, dragging: Promise) { - return new Promise((resolve) => { - let modifiedEvent: any = false - - calendar.on('eventDrop', (arg) => { - modifiedEvent = arg.event - }) - - calendar.on('_noEventDrop', () => { - resolve(false) - }) - - dragging.then(() => { - setTimeout(() => { // wait for eventDrop to fire - resolve(modifiedEvent) - }) - }) - }) -} - -export function waitEventDrag2(calendar: Calendar, dragging: Promise) { - return new Promise((resolve) => { - let theArg: any = false - - calendar.on('eventDrop', (arg) => { - theArg = arg - }) - - calendar.on('_noEventDrop', () => { - resolve(false) - }) - - dragging.then(() => { - setTimeout(() => { // wait for eventDrop to fire - resolve(theArg) - }) - }) - }) -} - -export function waitEventResize(calendar: Calendar, dragging: Promise) { - return new Promise((resolve) => { - let modifiedEvent: any = false - - calendar.on('eventResize', (arg) => { - modifiedEvent = arg.event - }) - - dragging.then(() => { - setTimeout(() => { // wait for eventResize to fire - resolve(modifiedEvent) - }) - }) - }) -} - -export function waitEventResize2(calendar: Calendar, dragging: Promise) { - return new Promise((resolve) => { - let theArg: any = false - - calendar.on('eventResize', (arg) => { - theArg = arg - }) - - dragging.then(() => { - setTimeout(() => { // wait for eventResize to fire - resolve(theArg) - }) - }) - }) -} - -export function waitDateSelect(calendar: Calendar, dragging: Promise) { - return new Promise((resolve) => { - let selectInfo = null - - calendar.on('select', (arg) => { - selectInfo = arg - }) - - dragging.then(() => { - setTimeout(() => { // wait for select to fire - resolve(selectInfo) - }) - }) - }) -} - -export function waitDateClick(calendar: Calendar, dragging: Promise) { - return new Promise((resolve) => { - let dateClickArg = null - - calendar.on('dateClick', (arg) => { - dateClickArg = arg - }) - - dragging.then(() => { - setTimeout(() => { // wait for dateClick to fire - resolve(dateClickArg) - }) - }) - }) -} diff --git a/fullcalendar-main/tests/src/performance/daygrid-rerenders.ts b/fullcalendar-main/tests/src/performance/daygrid-rerenders.ts deleted file mode 100644 index 69a8afd..0000000 --- a/fullcalendar-main/tests/src/performance/daygrid-rerenders.ts +++ /dev/null @@ -1,57 +0,0 @@ -it('daygrid view rerenders well', (done) => { - let dayHeaderRenderCnt = 0 - let dayCellRenderCnt = 0 - let eventRenderCnt = 0 - - let calendar = initCalendar({ - initialView: 'dayGridMonth', - initialDate: '2017-10-04', - windowResizeDelay: 0, - events: [ - { title: 'event 0', start: '2017-10-04' }, - ], - dayHeaderContent() { - dayHeaderRenderCnt += 1 - }, - dayCellContent() { - dayCellRenderCnt += 1 - }, - eventContent() { - eventRenderCnt += 1 - }, - }) - - function resetCounts() { - dayHeaderRenderCnt = 0 - dayCellRenderCnt = 0 - eventRenderCnt = 0 - } - - expect(dayHeaderRenderCnt).toBe(7) - expect(dayCellRenderCnt).toBe(42) - expect(eventRenderCnt).toBe(1) - - resetCounts() - calendar.next() - - expect(dayHeaderRenderCnt).toBe(0) // same day-of-week headers - expect(dayCellRenderCnt).toBe(42) - expect(eventRenderCnt).toBe(0) // event will be out of view - - calendar.changeView('listWeek') // switch away - resetCounts() - calendar.changeView('dayGridMonth') // return to view - expect(dayHeaderRenderCnt).toBe(7) - expect(dayCellRenderCnt).toBe(42) - expect(eventRenderCnt).toBe(0) // event still out of view - - resetCounts() - $(window).simulate('resize') - setTimeout(() => { - expect(dayHeaderRenderCnt).toBe(0) - expect(dayCellRenderCnt).toBe(0) - expect(eventRenderCnt).toBe(0) - - done() - }, 1) // more than windowResizeDelay -}) diff --git a/fullcalendar-main/tests/src/performance/list-rerenders.ts b/fullcalendar-main/tests/src/performance/list-rerenders.ts deleted file mode 100644 index ae0af6e..0000000 --- a/fullcalendar-main/tests/src/performance/list-rerenders.ts +++ /dev/null @@ -1,56 +0,0 @@ -it('list view rerenders well', (done) => { - let dayRenderCnt = 0 - let eventRenderCnt = 0 - let noEventsRenderCnt = 0 - - let calendar = initCalendar({ - initialView: 'listWeek', - initialDate: '2017-10-04', - windowResizeDelay: 0, - events: [ - { title: 'event 0', start: '2017-10-04' }, - ], - dayHeaderContent() { - dayRenderCnt += 1 - }, - eventContent() { - eventRenderCnt += 1 - }, - noEventsContent() { - noEventsRenderCnt += 1 - }, - }) - - function resetCounts() { - dayRenderCnt = 0 - eventRenderCnt = 0 - noEventsRenderCnt = 0 - } - - expect(dayRenderCnt).toBe(1) - expect(eventRenderCnt).toBe(1) - expect(noEventsRenderCnt).toBe(0) - - resetCounts() - calendar.next() - expect(dayRenderCnt).toBe(0) // no days - expect(eventRenderCnt).toBe(0) // event will be out of view - expect(noEventsRenderCnt).toBe(1) - - calendar.changeView('dayGridWeek') // switch away - resetCounts() - calendar.changeView('listWeek') // return to view - expect(dayRenderCnt).toBe(0) - expect(eventRenderCnt).toBe(0) - expect(noEventsRenderCnt).toBe(1) - - resetCounts() - $(window).simulate('resize') - setTimeout(() => { - expect(dayRenderCnt).toBe(0) - expect(eventRenderCnt).toBe(0) - expect(noEventsRenderCnt).toBe(0) - - done() - }, 1) // more than windowResizeDelay -}) diff --git a/fullcalendar-main/tests/src/performance/mutateOptions.ts b/fullcalendar-main/tests/src/performance/mutateOptions.ts deleted file mode 100644 index 3921a53..0000000 --- a/fullcalendar-main/tests/src/performance/mutateOptions.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { Calendar } from '@fullcalendar/core' -import timeGridPlugin from '@fullcalendar/timegrid' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -function buildOptions() { - return { - plugins: [timeGridPlugin], - initialView: 'timeGridWeek', - initialDate: '2019-04-01', - scrollTime: '00:00', - allDaySlot: true, - events: [ - { start: '2019-04-01T00:00:00' }, - { start: '2019-04-01T02:00:00' }, - ], - } -} - -describe('mutateOptions', () => { // TODO: rename file - let $calendarEl - let calendar - - beforeEach(() => { - $calendarEl = $('
').appendTo('body') - }) - - afterEach(() => { - if (calendar) { calendar.destroy() } - $calendarEl.remove() - }) - - it('will react to a single option and keep scroll', () => { - calendar = new Calendar($calendarEl[0], buildOptions()) - calendar.render() - - let viewWrapper = new TimeGridViewWrapper(calendar) - let scrollEl = viewWrapper.getScrollerEl() - - scrollEl.scrollTop = 100 - let scrollTop = scrollEl.scrollTop - expect(scrollTop).toBeGreaterThan(0) - - calendar.setOption('allDaySlot', false) - - expect(calendar.getOption('allDaySlot')).toBe(false) - expect(viewWrapper.dayGrid).toBeFalsy() - expect(scrollEl.scrollTop).toBe(scrollTop) - }) - - it('rerenders events without rerendering view', () => { - calendar = new Calendar($calendarEl[0], buildOptions()) - calendar.render() - - let calendarWrapper = new CalendarWrapper(calendar) - let dateEl = calendarWrapper.getFirstDateEl() - - calendar.setOption('events', [ - { start: '2019-04-01T00:00:00' }, - ]) - - expect(calendarWrapper.getEventEls().length).toBe(1) - expect(calendarWrapper.getFirstDateEl()).toBe(dateEl) - }) - - it('doesn\'t rerender anything for a initialView change', () => { - calendar = new Calendar($calendarEl[0], buildOptions()) - calendar.render() - - let calendarWrapper = new CalendarWrapper(calendar) - let dateEl = calendarWrapper.getFirstDateEl() - - calendar.setOption('initialView', 'timeGridDay') - - expect(calendar.view.type).toBe('timeGridWeek') - expect(calendarWrapper.getFirstDateEl()).toBe(dateEl) - }) -}) diff --git a/fullcalendar-main/tests/src/performance/timegrid-rerenders.ts b/fullcalendar-main/tests/src/performance/timegrid-rerenders.ts deleted file mode 100644 index ef90306..0000000 --- a/fullcalendar-main/tests/src/performance/timegrid-rerenders.ts +++ /dev/null @@ -1,74 +0,0 @@ -it('timegrid view rerenders well', (done) => { - let dayHeaderRenderCnt = 0 - let dayCellRenderCnt = 0 - let slotLabelRenderCnt = 0 - let slotLaneRenderCnt = 0 - let eventRenderCnt = 0 - - let calendar = initCalendar({ - initialView: 'timeGridWeek', - initialDate: '2017-10-04', - windowResizeDelay: 0, - events: [ - { title: 'event 0', start: '2017-10-04T00:00:00' }, - ], - dayHeaderContent() { - dayHeaderRenderCnt += 1 - }, - dayCellContent() { - dayCellRenderCnt += 1 - }, - slotLabelContent() { - slotLabelRenderCnt += 1 - }, - slotLaneContent() { - slotLaneRenderCnt += 1 - }, - eventContent() { - eventRenderCnt += 1 - }, - }) - - function resetCounts() { - dayHeaderRenderCnt = 0 - dayCellRenderCnt = 0 - slotLabelRenderCnt = 0 - slotLaneRenderCnt = 0 - eventRenderCnt = 0 - } - - expect(dayHeaderRenderCnt).toBe(7) - expect(dayCellRenderCnt).toBe(14) // all-day row AND time cols - expect(slotLabelRenderCnt).toBe(24) // one slot per every 2 lanes - expect(slotLaneRenderCnt).toBe(48) - expect(eventRenderCnt).toBe(1) - - resetCounts() - calendar.next() - expect(dayHeaderRenderCnt).toBe(7) - expect(dayCellRenderCnt).toBe(14) - expect(slotLabelRenderCnt).toBe(0) - expect(slotLaneRenderCnt).toBe(0) - expect(eventRenderCnt).toBe(0) // event will be out of view - - calendar.changeView('listWeek') // switch away - resetCounts() - calendar.changeView('timeGridWeek') // return to view - expect(dayHeaderRenderCnt).toBe(7) - expect(dayCellRenderCnt).toBe(14) - expect(slotLabelRenderCnt).toBe(24) - expect(slotLaneRenderCnt).toBe(48) - expect(eventRenderCnt).toBe(0) // event still out of view - - resetCounts() - $(window).simulate('resize') - setTimeout(() => { - expect(dayHeaderRenderCnt).toBe(0) - expect(dayCellRenderCnt).toBe(0) - expect(slotLabelRenderCnt).toBe(0) - expect(slotLaneRenderCnt).toBe(0) - expect(eventRenderCnt).toBe(0) - - done() - }, 1) // more than windowResizeDelay -}) diff --git a/fullcalendar-main/tests/src/theme/bootstrap4.ts b/fullcalendar-main/tests/src/theme/bootstrap4.ts deleted file mode 100644 index b670ed4..0000000 --- a/fullcalendar-main/tests/src/theme/bootstrap4.ts +++ /dev/null @@ -1,45 +0,0 @@ -import bootstrapPlugin from '@fullcalendar/bootstrap' -import dayGridPlugin from '@fullcalendar/daygrid' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('bootstrap theme', () => { - pushOptions({ - plugins: [bootstrapPlugin, dayGridPlugin], - themeSystem: 'bootstrap', - }) - - describe('fa', () => { - pushOptions({ - headerToolbar: { left: '', center: '', right: 'next' }, - }) - - it('renders default', () => { - let calendar = initCalendar() - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - let buttonInfo = toolbarWrapper.getButtonInfo('next', 'fa') - - expect(buttonInfo.iconName).toBe('chevron-right') - }) - - it('renders a customized icon', () => { - let calendar = initCalendar({ - bootstrapFontAwesome: { - next: 'asdf', - }, - }) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - let buttonInfo = toolbarWrapper.getButtonInfo('next', 'fa') - - expect(buttonInfo.iconName).toBe('asdf') - }) - - it('renders text when specified as false', () => { - let calendar = initCalendar({ - bootstrapFontAwesome: false, - }) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - - expect(toolbarWrapper.getButtonInfo('next', 'fa').iconName).toBeFalsy() - }) - }) -}) diff --git a/fullcalendar-main/tests/src/theme/switching.ts b/fullcalendar-main/tests/src/theme/switching.ts deleted file mode 100644 index 0ae4359..0000000 --- a/fullcalendar-main/tests/src/theme/switching.ts +++ /dev/null @@ -1,31 +0,0 @@ -import bootstrapPlugin from '@fullcalendar/bootstrap' -import dayGridPlugin from '@fullcalendar/daygrid' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('theme switching', () => { - pushOptions({ - plugins: [bootstrapPlugin, dayGridPlugin], - }) - - it('can switch from standard to bootstrap', () => { - let calendar = initCalendar() - verifyStandardTheme(calendar) - currentCalendar.setOption('themeSystem', 'bootstrap') - verifyBootstrapTheme(calendar) - }) - - it('can switch from bootstrap to standard', () => { - let calendar = initCalendar({ themeSystem: 'bootstrap' }) - verifyBootstrapTheme(calendar) - currentCalendar.setOption('themeSystem', 'standard') - verifyStandardTheme(calendar) - }) - - function verifyStandardTheme(calendar) { - expect(calendar.el).toHaveClass(CalendarWrapper.UNTHEMED_CLASSNAME) - } - - function verifyBootstrapTheme(calendar) { - expect(calendar.el).toHaveClass(CalendarWrapper.BOOTSTRAP_CLASSNAME) - } -}) diff --git a/fullcalendar-main/tests/src/toolbar/customButtons.ts b/fullcalendar-main/tests/src/toolbar/customButtons.ts deleted file mode 100644 index 9d3852a..0000000 --- a/fullcalendar-main/tests/src/toolbar/customButtons.ts +++ /dev/null @@ -1,46 +0,0 @@ -import bootstrapPlugin from '@fullcalendar/bootstrap' -import dayGridPlugin from '@fullcalendar/daygrid' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('customButtons', () => { - pushOptions({ - plugins: [bootstrapPlugin, dayGridPlugin], - }) - - it('can specify text', () => { - let calendar = initCalendar({ - customButtons: { - mybutton: { text: 'asdf' }, - }, - headerToolbar: { left: 'mybutton', center: '', right: '' }, - }) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - let buttonInfo = toolbarWrapper.getButtonInfo('mybutton') - expect(buttonInfo.text).toBe('asdf') - }) - - it('can specify an icon', () => { - let calendar = initCalendar({ - customButtons: { - mybutton: { icon: 'asdf' }, - }, - headerToolbar: { left: 'mybutton', center: '', right: '' }, - }) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - let buttonInfo = toolbarWrapper.getButtonInfo('mybutton') - expect(buttonInfo.iconName).toBe('asdf') - }) - - it('can specify a bootstrap font-awesome icon', () => { - let calendar = initCalendar({ - themeSystem: 'bootstrap', - customButtons: { - mybutton: { bootstrapFontAwesome: 'asdf' }, - }, - headerToolbar: { left: 'mybutton', center: '', right: '' }, - }) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - let buttonInfo = toolbarWrapper.getButtonInfo('mybutton', 'fa') - expect(buttonInfo.iconName).toBe('asdf') - }) -}) diff --git a/fullcalendar-main/tests/src/toolbar/next-button.ts b/fullcalendar-main/tests/src/toolbar/next-button.ts deleted file mode 100644 index 83297a2..0000000 --- a/fullcalendar-main/tests/src/toolbar/next-button.ts +++ /dev/null @@ -1,80 +0,0 @@ -/* -TODO: -- quick test for when button is clicked - -SEE ALSO: -- visibleRange, dateAlignment, dateIncrement -*/ - -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('next button', () => { - pushOptions({ - initialView: 'timeGridWeek', - initialDate: '2017-06-08', - }) - - describe('when there is no validRange', () => { - it('is enabled', () => { - expectEnabled(initCalendar(), true) - }) - }) - - describe('when next date range is completely within validRange', () => { - pushOptions({ - validRange: { end: '2018-06-10' }, - dateIncrement: { years: 1 }, // next range is 2018-06-03 - 2018-06-10 - }) - it('is enabled', () => { - expectEnabled(initCalendar(), true) - }) - }) - - describe('when next date range is partially outside validRange', () => { - pushOptions({ - validRange: { end: '2018-06-05' }, - dateIncrement: { years: 1 }, // next range is 2018-06-03 - 2018-06-10 - }) - it('is enabled', () => { - expectEnabled(initCalendar(), true) - }) - }) - - describe('when next date range is completely beyond validRange', () => { - pushOptions({ - validRange: { end: '2018-06-03' }, - dateIncrement: { years: 1 }, // next range is 2018-06-03 - 2018-06-10 - }) - it('is disabled', () => { - expectEnabled(initCalendar(), false) - }) - }) - - describe('when day after current day is a hidden day', () => { - pushOptions({ - initialDate: '2017-03-31', - initialView: 'dayGridDay', - weekends: false, - dateIncrement: { years: 1 }, // next range is 2018-06-03 - 2018-06-10 - }) - it('is enabled', () => { - expectEnabled(initCalendar(), true) - }) - }) - - describe('when initialDate is constrained forward to validRange and next week is valid', () => { - pushOptions({ - initialDate: '2017-07-17', - initialView: 'timeGridWeek', - validRange: { start: '2036-05-03', end: '2036-06-01' }, - }) - it('is enabled', () => { - expectEnabled(initCalendar(), true) - }) - }) - - function expectEnabled(calendar, bool) { - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - expect(toolbarWrapper.getButtonEnabled('next')).toBe(bool) - } -}) diff --git a/fullcalendar-main/tests/src/toolbar/prev-button.ts b/fullcalendar-main/tests/src/toolbar/prev-button.ts deleted file mode 100644 index 41aaf96..0000000 --- a/fullcalendar-main/tests/src/toolbar/prev-button.ts +++ /dev/null @@ -1,73 +0,0 @@ -/* -TODO: -- quick test for when button is clicked - -SEE ALSO: -- other range intersection tests handled by next-button -*/ - -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('prev button', () => { - pushOptions({ - initialView: 'timeGridWeek', - initialDate: '2017-06-08', - }) - - describe('when there is no specified validRange', () => { - it('is enabled', () => { - expectEnabled(initCalendar(), true) - }) - }) - - describe('when prev date range is completely before validRange', () => { - pushOptions({ - validRange: { start: '2018-06-12' }, - dateIncrement: { years: 1 }, // prev range is 2016-06-05 - 2016-06-12 - }) - it('is disabled', () => { - expectEnabled(initCalendar(), false) - }) - }) - - describe('when month view', () => { - pushOptions({ - initialView: 'dayGridMonth', - initialDate: '2017-03-01', - validRange: { start: '2017-02-07' }, - dateIncrement: { years: 1 }, // prev range is 2016-06-05 - 2016-06-12 - }) - - it('when prev date range is partially before validRange', () => { - expectEnabled(initCalendar(), false) - }) - }) - - describe('when day before current day is a hidden day', () => { - pushOptions({ - initialDate: '2017-03-27', - initialView: 'dayGridDay', - weekends: false, - dateIncrement: { years: 1 }, // prev range is 2016-06-05 - 2016-06-12 - }) - it('is enabled', () => { - expectEnabled(initCalendar(), true) - }) - }) - - describe('when initialDate is constrained backward to validRange and prev week is valid', () => { - pushOptions({ - initialDate: '2017-07-17', - initialView: 'timeGridWeek', - validRange: { start: '2017-03-20', end: '2017-03-30' }, - }) - it('is enabled', () => { - expectEnabled(initCalendar(), true) - }) - }) - - function expectEnabled(calendar, bool) { - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - expect(toolbarWrapper.getButtonEnabled('prev')).toBe(bool) - } -}) diff --git a/fullcalendar-main/tests/src/toolbar/title.ts b/fullcalendar-main/tests/src/toolbar/title.ts deleted file mode 100644 index 105afcd..0000000 --- a/fullcalendar-main/tests/src/toolbar/title.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('calendar title', () => { - pushOptions({ - now: '2017-03-29', - }) - - describe('when switching to and from a view', () => { - it('updates the title at each switch', () => { - let calendar = initCalendar({ - initialView: 'dayGridMonth', - }) - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - - expect(toolbarWrapper.getTitleText()).toBe('March 2017') - currentCalendar.changeView('timeGridWeek') - expect(toolbarWrapper.getTitleText()).toBe('Mar 26 – Apr 1, 2017') - currentCalendar.changeView('dayGridMonth') - expect(toolbarWrapper.getTitleText()).toBe('March 2017') - }) - }) -}) diff --git a/fullcalendar-main/tests/src/toolbar/today-button.ts b/fullcalendar-main/tests/src/toolbar/today-button.ts deleted file mode 100644 index 5b38c84..0000000 --- a/fullcalendar-main/tests/src/toolbar/today-button.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* -TODO: -- quick test for when button is clicked - -SEE ALSO: -- other range intersection tests handled by next-button -*/ - -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('today button', () => { - pushOptions({ - initialView: 'dayGridMonth', - now: '2017-06-30', - }) - - describe('when now is in current month', () => { - pushOptions({ - initialDate: '2017-06-01', - }) - it('is disabled', () => { - expectEnabled(initCalendar(), false) - }) - }) - - describe('when now is not current month, but still visible', () => { - pushOptions({ - initialDate: '2017-07-01', - }) - it('is enabled', () => { - expectEnabled(initCalendar(), true) - }) - }) - - describe('when now is out of view', () => { - pushOptions({ - initialDate: '2017-08-01', - }) - - describe('when no specified validRange', () => { - it('is enabled', () => { - expectEnabled(initCalendar(), true) - }) - }) - - describe('when now\'s month is entirely before validRange', () => { - pushOptions({ - validRange: { start: '2017-07-02' }, // previous day is visible in the June - }) - it('is disabled', () => { - expectEnabled(initCalendar(), false) - }) - }) - }) - - function expectEnabled(calendar, bool) { - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - expect(toolbarWrapper.getButtonEnabled('today')).toBe(bool) - } -}) diff --git a/fullcalendar-main/tests/src/toolbar/toolbar-misc.ts b/fullcalendar-main/tests/src/toolbar/toolbar-misc.ts deleted file mode 100644 index f0f4f15..0000000 --- a/fullcalendar-main/tests/src/toolbar/toolbar-misc.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('toolbar rendering', () => { - it('produces type="button" attributes', () => { - let calendar = initCalendar({ - headerToolbar: { - left: 'today', - center: 'title', - right: 'prev,next', - }, - }) - - let toolbarWrapper = new CalendarWrapper(calendar).toolbar - let todayButtonEl = toolbarWrapper.getButtonEl('today') - let prevButtonEl = toolbarWrapper.getButtonEl('prev') - - expect(todayButtonEl.getAttribute('type')).toBe('button') - expect(prevButtonEl.getAttribute('type')).toBe('button') - }) - - it('if disabled, won\'t put aria-labelledby on view container', () => { - let calendar = initCalendar({ - headerToolbar: false, - }) - - const calendarWrapper = new CalendarWrapper(calendar) - const viewContainerEl = calendarWrapper.getViewContainerEl() - - expect(viewContainerEl).not.toHaveAttr('aria-labelledby') - }) -}) diff --git a/fullcalendar-main/tests/src/view-dates/dateAlignment.ts b/fullcalendar-main/tests/src/view-dates/dateAlignment.ts deleted file mode 100644 index d807a62..0000000 --- a/fullcalendar-main/tests/src/view-dates/dateAlignment.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { expectActiveRange } from '../lib/ViewDateUtils.js' - -/* -SEE ALSO: next/prev -*/ -describe('dateAlignment', () => { - describe('when week alignment', () => { - pushOptions({ - initialView: 'timeGrid', - dateAlignment: 'week', - initialDate: '2017-06-15', - }) - - describe('when 3 day duration', () => { - pushOptions({ - duration: { days: 3 }, - }) - - it('aligns with the week', () => { - initCalendar() - expectActiveRange('2017-06-11', '2017-06-14') - }) - }) - - describe('when 5 day count', () => { - pushOptions({ - dayCount: 5, - weekends: false, - }) - - it('aligns with first visible day of the week', () => { - initCalendar() - expectActiveRange('2017-06-12', '2017-06-17') - }) - }) - }) - - // test in Safari! - // https://github.com/fullcalendar/fullcalendar/issues/4363 - describe('when year alignment', () => { - pushOptions({ - initialView: 'dayGrid', - duration: { months: 1 }, - dateAlignment: 'year', - initialDate: '2017-06-15', - }) - - it('aligns with first day of year', () => { - initCalendar() - expectActiveRange('2017-01-01', '2017-02-05') - }) - }) -}) diff --git a/fullcalendar-main/tests/src/view-dates/dateIncrement.ts b/fullcalendar-main/tests/src/view-dates/dateIncrement.ts deleted file mode 100644 index de8e604..0000000 --- a/fullcalendar-main/tests/src/view-dates/dateIncrement.ts +++ /dev/null @@ -1,4 +0,0 @@ -/* -SEE: prev/next -SEE: dateIncrement tests in fullcalendar-scheduler -*/ diff --git a/fullcalendar-main/tests/src/view-dates/datesSet.ts b/fullcalendar-main/tests/src/view-dates/datesSet.ts deleted file mode 100644 index 1c19235..0000000 --- a/fullcalendar-main/tests/src/view-dates/datesSet.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { Calendar } from '@fullcalendar/core' -import dayGridPlugin from '@fullcalendar/daygrid' - -describe('datesSet', () => { - pushOptions({ - initialView: 'dayGridMonth', - now: '2020-06-21', - }) - - it('won\'t fire when a non-dateprofile-related option is reset', () => { - let fireCnt = 0 - let options = { - ...getCurrentOptions(), - weekNumbers: false, - datesSet() { - fireCnt += 1 - }, - } - let $calendarEl = $('
').appendTo('body') - let calendar = new Calendar($calendarEl[0], options) - calendar.render() - expect(fireCnt).toBe(1) - calendar.resetOptions({ - ...options, - weekNumbers: true, - }) - expect(fireCnt).toBe(1) - calendar.destroy() - $calendarEl.remove() - }) - - it('won\'t fire when a complex object-like option is reset', () => { - function buildHeaderToolbar() { - return { - left: 'today', - } - } - let fireCnt = 0 - let options = { - ...getCurrentOptions(), - headerToolbar: buildHeaderToolbar(), - datesSet() { - fireCnt += 1 - }, - } - let $calendarEl = $('
').appendTo('body') - let calendar = new Calendar($calendarEl[0], options) - calendar.render() - expect(fireCnt).toBe(1) - calendar.resetOptions({ - ...options, - headerToolbar: buildHeaderToolbar(), - }) - expect(fireCnt).toBe(1) - calendar.destroy() - $calendarEl.remove() - }) - - it('won\'t fire when plugins option is reset', () => { - let fireCnt = 0 - let options = { - ...getCurrentOptions(), - plugins: [dayGridPlugin], - datesSet() { - fireCnt += 1 - }, - } - let $calendarEl = $('
').appendTo('body') - let calendar = new Calendar($calendarEl[0], options) - calendar.render() - expect(fireCnt).toBe(1) - calendar.resetOptions({ - ...options, - plugins: [dayGridPlugin], - }) - expect(fireCnt).toBe(1) - calendar.destroy() - $calendarEl.remove() - }) -}) diff --git a/fullcalendar-main/tests/src/view-dates/dayCount.ts b/fullcalendar-main/tests/src/view-dates/dayCount.ts deleted file mode 100644 index ca519bb..0000000 --- a/fullcalendar-main/tests/src/view-dates/dayCount.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { expectActiveRange } from '../lib/ViewDateUtils.js' -import { expectDay } from '../lib/ViewRenderUtils.js' - -describe('dayCount', () => { - pushOptions({ - initialDate: '2017-03-15', // wed - weekends: false, - }) - - describeOptions({ - 'when specified as top-level options': { - initialView: 'dayGrid', - dayCount: 5, - }, - 'when specified as custom view': { - views: { - myCustomView: { - type: 'dayGrid', - dayCount: 5, - }, - }, - initialView: 'myCustomView', - }, - }, () => { - it('renders the exact day count', () => { - initCalendar() - expectActiveRange('2017-03-15', '2017-03-22') - expectDay('2017-03-15', true) - expectDay('2017-03-16', true) - expectDay('2017-03-17', true) - expectDay('2017-03-18', false) // sat - expectDay('2017-03-19', false) // sun - expectDay('2017-03-20', true) - expectDay('2017-03-21', true) - }) - }) - - it('can span multiple weeks', () => { - initCalendar({ - initialView: 'timeGrid', - dayCount: 9, - }) - expectActiveRange('2017-03-15', '2017-03-28') - expectDay('2017-03-15', true) - expectDay('2017-03-16', true) - expectDay('2017-03-17', true) - expectDay('2017-03-18', false) // sat - expectDay('2017-03-19', false) // sun - expectDay('2017-03-20', true) - expectDay('2017-03-21', true) - expectDay('2017-03-22', true) - expectDay('2017-03-23', true) - expectDay('2017-03-24', true) - expectDay('2017-03-25', false) // sat - expectDay('2017-03-26', false) // sun - expectDay('2017-03-27', true) - }) - - it('can navigate in reverse with a small dateIncrement split by hidden days', () => { - initCalendar({ - initialDate: '2018-06-11', - initialView: 'timeGridTwoDay', - headerToolbar: { - left: 'prev,next', - center: 'title', - right: 'dayGridMonth,timeGridWeek,timeGridDay,timeGridTwoDay', - }, - hiddenDays: [0, 6], // sunday, saturday - views: { - timeGridTwoDay: { - type: 'timeGrid', - dayCount: 2, - dateIncrement: { days: 1 }, - buttonText: '2 days', - }, - }, - }) - currentCalendar.prev() - expectActiveRange('2018-06-08', '2018-06-12') - }) -}) diff --git a/fullcalendar-main/tests/src/view-dates/gotoDate.ts b/fullcalendar-main/tests/src/view-dates/gotoDate.ts deleted file mode 100644 index 4129d6f..0000000 --- a/fullcalendar-main/tests/src/view-dates/gotoDate.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { expectActiveRange } from '../lib/ViewDateUtils.js' - -describe('gotoDate', () => { - it('will update calendar\'s date even if no navigation', () => { - initCalendar({ - initialDate: '2018-12-25', - initialView: 'dayGridMonth', - }) - - expect(currentCalendar.getDate()).toEqualDate('2018-12-25') - currentCalendar.gotoDate('2018-12-30') - expect(currentCalendar.getDate()).toEqualDate('2018-12-30') - }) - - describe('when asynchronicity', () => { - pushOptions({ - events(arg, callback) { - setTimeout(() => { - callback([]) - }, 0) - }, - }) - - it('works when called right after initialization', () => { - initCalendar({ - initialView: 'dayGridMonth', - initialDate: '2017-03-30', - }) - currentCalendar.gotoDate('2017-06-01') - }) - - it('works when called right after initialization when date already in range', () => { - initCalendar({ - initialView: 'dayGridMonth', - initialDate: '2017-03-30', - }) - currentCalendar.gotoDate('2017-03-01') - }) - }) - - // https://github.com/fullcalendar/fullcalendar/issues/4929 - it('moves view\'s date range when small dateAlignment', () => { - let calendar = initCalendar({ - initialDate: '2019-04-09', - initialView: 'dayGridFourDays', - views: { - dayGridFourDays: { - type: 'dayGrid', - duration: { days: 4 }, - dateAlignment: 'day', - }, - }, - }) - calendar.gotoDate('2019-04-10') - expectActiveRange('2019-04-10', '2019-04-14') - }) -}) diff --git a/fullcalendar-main/tests/src/view-dates/next.ts b/fullcalendar-main/tests/src/view-dates/next.ts deleted file mode 100644 index 0203416..0000000 --- a/fullcalendar-main/tests/src/view-dates/next.ts +++ /dev/null @@ -1,145 +0,0 @@ -import { expectActiveRange } from '../lib/ViewDateUtils.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('next', () => { - pushOptions({ - initialDate: '2017-06-08', - }) - - describe('when in week view', () => { - pushOptions({ - initialView: 'timeGridWeek', - }) - - describe('when dateIncrement not specified', () => { - it('moves forward by one week', () => { - initCalendar() - currentCalendar.next() - expectActiveRange('2017-06-11', '2017-06-18') - }) - }) - - describeOptions('dateIncrement', { - 'when two week dateIncrement specified as a plain object': { weeks: 2 }, - 'when two week dateIncrement specified as a string': '14.00:00:00', - }, () => { - it('moves forward by two weeks', () => { - initCalendar() - currentCalendar.next() - expectActiveRange('2017-06-18', '2017-06-25') - }) - }) - - it('does not duplicate-render skeleton', () => { - let calendar = initCalendar() - calendar.next() - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - expect(timeGridWrapper.isStructureValid()).toBe(true) - }) - }) - - describe('when in a month view', () => { - pushOptions({ - initialView: 'dayGridMonth', - }) - - describe('when dateIncrement not specified', () => { - it('moves forward by one month', () => { - initCalendar() - currentCalendar.next() - expectActiveRange('2017-06-25', '2017-08-06') - }) - }) - - describe('when two month dateIncrement is specified', () => { - pushOptions({ - dateIncrement: { months: 2 }, - }) - - it('moves forward by two months', () => { - initCalendar() - currentCalendar.next() - expectActiveRange('2017-07-30', '2017-09-10') - }) - }) - }) - - describe('when in custom three day view', () => { - pushOptions({ - initialView: 'dayGrid', - duration: { days: 3 }, - }) - - describe('when no dateAlignment is specified', () => { - describe('when dateIncrement not specified', () => { - it('moves forward three days', () => { - initCalendar() - currentCalendar.next() - expectActiveRange('2017-06-11', '2017-06-14') - }) - }) - - describe('when two day dateIncrement is specified', () => { - pushOptions({ - dateIncrement: { days: 2 }, - }) - it('moves forward two days', () => { - initCalendar() - currentCalendar.next() - expectActiveRange('2017-06-10', '2017-06-13') - }) - }) - }) - - describe('when week dateAlignment is specified', () => { - pushOptions({ - dateAlignment: 'week', - }) - - describe('when dateIncrement not specified', () => { - it('moves forward one week', () => { - initCalendar() - currentCalendar.next() - expectActiveRange('2017-06-11', '2017-06-14') - }) - }) - - describe('when two day dateIncrement is specified', () => { - pushOptions({ - dateIncrement: { days: 2 }, - }) - - it('does not navigate nor rerender', () => { - let called - - initCalendar({ - dayCellDidMount() { - called = true - }, - }) - - called = false - currentCalendar.next() - - expectActiveRange('2017-06-04', '2017-06-07') // the same as how it started - expect(called).toBe(false) - }) - }) - }) - }) - - describe('when in a custom two day view and weekends:false', () => { - pushOptions({ - weekends: false, - initialView: 'timeGrid', - duration: { days: 2 }, - }) - - it('skips over weekends if there would be alignment with weekend', () => { - initCalendar({ - initialDate: '2017-11-09', - }) - currentCalendar.next() - }) - }) -}) diff --git a/fullcalendar-main/tests/src/view-dates/prev.ts b/fullcalendar-main/tests/src/view-dates/prev.ts deleted file mode 100644 index 7eaf5ff..0000000 --- a/fullcalendar-main/tests/src/view-dates/prev.ts +++ /dev/null @@ -1,79 +0,0 @@ -/* -SEE ALSO: -- next (does core of date switching) -*/ - -import { expectActiveRange } from '../lib/ViewDateUtils.js' - -describe('prev', () => { - pushOptions({ - initialDate: '2017-06-08', - }) - - describe('when in a week view', () => { - pushOptions({ - initialView: 'timeGridWeek', - }) - - it('moves back by one week', () => { - initCalendar() - currentCalendar.prev() - expectActiveRange('2017-05-28', '2017-06-04') - }) - - describe('when two week dateIncrement', () => { - pushOptions({ - dateIncrement: { weeks: 2 }, - }) - - it('moves back by two weeks', () => { - initCalendar() - currentCalendar.prev() - expectActiveRange('2017-05-21', '2017-05-28') - }) - }) - }) - - // https://github.com/fullcalendar/fullcalendar/issues/4595 - it('can navigate back when starting late in month', () => { - initCalendar({ - initialDate: '2019-03-31T12:00', - initialView: 'dayGridMonth', - }) - expectActiveRange('2019-02-24', '2019-04-07') - currentCalendar.prev() - expectActiveRange('2019-01-27', '2019-03-10') - }) - - // related to #4595 - it('can navigate forward when starting late in month', () => { - initCalendar({ - initialDate: '2019-03-31T12:00', - initialView: 'dayGridMonth', - }) - expectActiveRange('2019-02-24', '2019-04-07') - currentCalendar.next() - expectActiveRange('2019-03-31', '2019-05-12') - }) - - // https://github.com/fullcalendar/fullcalendar/issues/5319 - it('can navigate back twice when duration greater than dateIncrement', () => { - let calendar = initCalendar({ - firstDay: 1, // monday - initialDate: '2021-06-14', - initialView: 'dayGridFourWeeks', - views: { - dayGridFourWeeks: { - type: 'dayGrid', - duration: { weeks: 4 }, - dateIncrement: { weeks: 1 }, - }, - }, - }) - expectActiveRange('2021-06-14', '2021-07-12') - calendar.prev() // back a week - expectActiveRange('2021-06-07', '2021-07-05') - calendar.prev() // back a week - expectActiveRange('2021-05-31', '2021-06-28') - }) -}) diff --git a/fullcalendar-main/tests/src/view-dates/validRange.ts b/fullcalendar-main/tests/src/view-dates/validRange.ts deleted file mode 100644 index 0e0d15a..0000000 --- a/fullcalendar-main/tests/src/view-dates/validRange.ts +++ /dev/null @@ -1,147 +0,0 @@ -import { expectActiveRange, expectRenderRange } from '../lib/ViewDateUtils.js' -import { parseUtcDate } from '../lib/date-parsing.js' - -describe('validRange', () => { - pushOptions({ - timeZone: 'UTC', - initialDate: '2017-06-08', - }) - - describe('when one week view', () => { // a view that has date-alignment by default - pushOptions({ - initialView: 'timeGridWeek', // default range = 2017-06-04 - 2017-06-11 - }) - - describe('when default range is partially before validRange', () => { - pushOptions({ - validRange: { start: '2017-06-06' }, - }) - - it('allows full renderRange but restricts activeRange', () => { - initCalendar() - expectRenderRange('2017-06-04', '2017-06-11') - expectActiveRange('2017-06-06', '2017-06-11') - }) - }) - - describe('when default range is partially after validRange', () => { - pushOptions({ - validRange: { end: '2017-06-05' }, - }) - - it('allows full renderRange but restricts activeRange', () => { - initCalendar() - expectRenderRange('2017-06-04', '2017-06-11') - expectActiveRange('2017-06-04', '2017-06-05') - }) - }) - - describe('when default range is completely before validRange', () => { - pushOptions({ - validRange: { start: '2017-06-14' }, // a Wednesday - }) - - it('initializes at earliest partially visible week', () => { - initCalendar() - expectRenderRange('2017-06-11', '2017-06-18') - expectActiveRange('2017-06-14', '2017-06-18') - }) - }) - - describe('when default range is completely before validRange', () => { - pushOptions({ - validRange: { end: '2017-05-24' }, // a Wednesday - }) - - it('initializes at latest partially visible week', () => { - initCalendar() - expectRenderRange('2017-05-21', '2017-05-28') - expectActiveRange('2017-05-21', '2017-05-24') - }) - }) - - describe('when validRange is a function', () => { - let nowInput = '2017-06-09T06:00:00' - - it('receives the nowDate, timezoneless', () => { - let validRangeSpy = spyOnCalendarCallback('validRange', (date) => { - expect(date instanceof Date).toBe(true) - expect(date).toEqualDate(nowInput + 'Z') - }) - - initCalendar({ - now: nowInput, - }) - - expect(validRangeSpy).toHaveBeenCalled() - }) - - it('can return a range object with strings', () => { - let validRangeSpy = spyOnCalendarCallback('validRange', () => ({ start: '2017-06-06' })) - - initCalendar() - - expect(validRangeSpy).toHaveBeenCalled() - expectRenderRange('2017-06-04', '2017-06-11') - expectActiveRange('2017-06-06', '2017-06-11') - }) - - it('can return a range object with Date objects', () => { - let validRangeSpy = spyOnCalendarCallback('validRange', () => ({ start: parseUtcDate('2017-06-06') })) - - initCalendar() - - expect(validRangeSpy).toHaveBeenCalled() - expectRenderRange('2017-06-04', '2017-06-11') - expectActiveRange('2017-06-06', '2017-06-11') - }) - }) - }) - - describe('when a three-day view', () => { // a view with no alignment - pushOptions({ - initialView: 'timeGrid', - duration: { days: 3 }, - }) - - describe('when default range is completely before of validRange', () => { - pushOptions({ - validRange: { start: '2017-06-14' }, - }) - it('renders earliest three valid days', () => { - initCalendar() - expectRenderRange('2017-06-14', '2017-06-17') - expectActiveRange('2017-06-14', '2017-06-17') - }) - }) - - describe('when default range is completely after validRange', () => { - pushOptions({ - validRange: { end: '2017-05-31' }, - }) - it('renders latest possible valid day and two invalid days', () => { - initCalendar() - expectRenderRange('2017-05-30', '2017-06-02') - expectActiveRange('2017-05-30', '2017-05-31') - }) - }) - }) - - describe('when hiddenDays causes no days to be active', () => { - pushOptions({ - initialView: 'timeGridWeek', - initialDate: '2017-10-04', - hiddenDays: [6], // Sunday, last day within natural week range - validRange: { - start: '2036-05-03', - end: '2036-06-01', - }, - }) - - it('pushes view to nearest valid range', () => { - initCalendar() - expectRenderRange('2036-05-04', '2036-05-10') - expectActiveRange('2036-05-04', '2036-05-10') - }) - }) -}) diff --git a/fullcalendar-main/tests/src/view-dates/view-duration.ts b/fullcalendar-main/tests/src/view-dates/view-duration.ts deleted file mode 100644 index 0cfe33c..0000000 --- a/fullcalendar-main/tests/src/view-dates/view-duration.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { expectActiveRange } from '../lib/ViewDateUtils.js' - -describe('view duration', () => { - pushOptions({ - initialView: 'timeGrid', - initialDate: '2017-03-15', - }) - - describe('when specified as a week integer', () => { - pushOptions({ - duration: { weeks: 1 }, - }) - it('aligns with start of week', () => { - initCalendar() - expectActiveRange('2017-03-12', '2017-03-19') - }) - }) - - describe('when specified as 7 days', () => { - pushOptions({ - duration: { days: 7 }, - }) - it('aligns with start of week', () => { - initCalendar() - expectActiveRange('2017-03-15', '2017-03-22') - }) - }) -}) diff --git a/fullcalendar-main/tests/src/view-dates/visibleRange.ts b/fullcalendar-main/tests/src/view-dates/visibleRange.ts deleted file mode 100644 index e1fbd92..0000000 --- a/fullcalendar-main/tests/src/view-dates/visibleRange.ts +++ /dev/null @@ -1,251 +0,0 @@ -import { addLocalDays, startOfLocalDay, startOfUtcDay, addUtcDays } from '../lib/date-math.js' -import { expectActiveRange } from '../lib/ViewDateUtils.js' -import { parseUtcDate, parseLocalDate } from '../lib/date-parsing.js' - -describe('visibleRange', () => { - describe('when custom view with a flexible range', () => { - pushOptions({ - initialView: 'timeGrid', - }) - - describe('when given a valid date range', () => { - let startInput = '2017-06-26' - let endInput = '2017-06-29' - - describeOptions('visibleRange', { - 'of Date objects': { - start: new Date(startInput), - end: new Date(endInput), - }, - 'of strings': { - start: startInput, - end: endInput, - }, - 'of a function that returns date objects': () => ({ - start: new Date(startInput), - end: new Date(endInput), - }), - 'of a function that returns strings': () => ({ - start: startInput, - end: endInput, - }), - }, () => { - it('gets set to the given range', () => { - initCalendar() - expectActiveRange(startInput, endInput) - }) - }) - - it('works as a custom view', () => { - initCalendar({ - views: { - myCustomView: { - type: 'timeGrid', - visibleRange: { - start: startInput, - end: endInput, - }, - }, - }, - initialView: 'myCustomView', - }) - expectActiveRange(startInput, endInput) - }) - - it('ignores dateAlignment', () => { - initCalendar({ - dateAlignment: 'dayGridMonth', - visibleRange: { - start: startInput, - end: endInput, - }, - }) - expectActiveRange(startInput, endInput) - }) - - it('works as a dynamic option', () => { - initCalendar({ - initialView: 'dayGrid', - }) - currentCalendar.setOption('visibleRange', { - start: startInput, - end: endInput, - }) - expectActiveRange(startInput, endInput) - }) - }) - - describe('when a function', () => { - let initialDateInput = '2017-06-08T12:30:00' - - it('receives the calendar\'s initialDate, with local timezone, and emits local range', () => { - let matched = false - - initCalendar({ - timeZone: 'local', - initialDate: initialDateInput, - visibleRange(date) { - // this function will receive the date for prev/next, - // which should be ignored. make sure just one call matches. - if (date.valueOf() === parseLocalDate(initialDateInput).valueOf()) { - matched = true - } - - let dayStart = startOfLocalDay(date) - return { - start: addLocalDays(dayStart, -1), - end: addLocalDays(dayStart, 2), - } - }, - }) - - expect(matched).toBe(true) - expectActiveRange(parseLocalDate('2017-06-07'), parseLocalDate('2017-06-10')) - }) - - it('receives the calendar\'s initialDate, with UTC timezone, and emits UTC range', () => { - let matched = false - - initCalendar({ - timeZone: 'UTC', - initialDate: initialDateInput, - visibleRange(date) { - // this function will receive the date for prev/next, - // which should be ignored. make sure just one call matches. - if (date.valueOf() === parseUtcDate(initialDateInput).valueOf()) { - matched = true - } - - let dayStart = startOfUtcDay(date) - return { - start: addUtcDays(dayStart, -1), - end: addUtcDays(dayStart, 2), - } - }, - }) - - expect(matched).toBe(true) - expectActiveRange('2017-06-07', '2017-06-10') - }) - - // https://github.com/fullcalendar/fullcalendar/issues/4517 - it('can emit and timed UTC range that will be rounded', () => { - initCalendar({ - dateIncrement: { days: 3 }, - timeZone: 'UTC', - initialDate: initialDateInput, - visibleRange(date) { - return { - start: addUtcDays(date, -1), // 2017-06-07T12:30:00 -> 2017-06-07 - end: addUtcDays(date, 2), // 2017-06-10T12:30:00 -> 2017-06-11 - } - }, - }) - expectActiveRange('2017-06-07', '2017-06-11') - currentCalendar.prev() - expectActiveRange('2017-06-04', '2017-06-07') // second computation will round down the end - }) - }) - - describe('when given an invalid range', () => { - describeOptions('visibleRange', { - 'with end before start': { - start: '2017-06-18', - end: '2017-06-15', - }, - 'with no end': { - start: '2017-06-18', - }, - 'with no start': { - end: '2017-06-15', - }, - }, () => { - it('defaults to the initialDate', () => { // TODO: have it report an warning - initCalendar({ - initialDate: '2017-08-01', - }) - expectActiveRange('2017-08-01', '2017-08-02') - }) - }) - }) - - describe('when later switching to a one-day view', () => { - it('constrains an earlier current date to the start of visibleRange', () => { - initCalendar({ - initialDate: '2017-06-25', - visibleRange: { - start: '2017-06-26', - end: '2017-06-29', - }, - }) - currentCalendar.changeView('timeGridDay') - expectActiveRange('2017-06-26', '2017-06-27') - }) - - it('constrains a later current date to the start of visibleRange', () => { - initCalendar({ - initialDate: '2017-07-01', - visibleRange: { - start: '2017-06-26', - end: '2017-06-29', - }, - }) - currentCalendar.changeView('timeGridDay') - expectActiveRange('2017-06-26', '2017-06-27') - }) - }) - }) - - describe('when a list view', () => { - pushOptions({ - initialView: 'list', - visibleRange: { - start: '2017-06-07', - end: '2017-06-10', - }, - events: [ - { start: '2017-06-08' }, - ], - }) - - it('respects the given range', () => { - initCalendar() - expectActiveRange('2017-06-07', '2017-06-10') - }) - }) - - describe('when custom view with fixed duration', () => { - pushOptions({ - initialDate: '2015-06-08', - initialView: 'timeGrid', - duration: { days: 3 }, - }) - - it('ignores the given visibleRange', () => { - initCalendar({ - visibleRange: { - start: '2017-06-29', - end: '2017-07-04', - }, - }) - expectActiveRange('2015-06-08', '2015-06-11') - }) - }) - - describe('when standard view', () => { - pushOptions({ - initialDate: '2015-06-08', - initialView: 'timeGridWeek', - }) - - it('ignores the given visibleRange', () => { - initCalendar({ - visibleRange: { - start: '2017-06-29', - end: '2017-07-04', - }, - }) - expectActiveRange('2015-06-07', '2015-06-14') - }) - }) -}) diff --git a/fullcalendar-main/tests/src/view-render/columnHeader.ts b/fullcalendar-main/tests/src/view-render/columnHeader.ts deleted file mode 100644 index f7d01ac..0000000 --- a/fullcalendar-main/tests/src/view-render/columnHeader.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('dayHeaders', () => { // TODO: rename file - pushOptions({ - initialDate: '2014-05-11', - }) - - describeOptions('initialView', { - 'when month view': 'dayGridMonth', - 'when timeGrid view': 'timeGridDay', - 'when dayGrid view': 'dayGridDay', - }, (viewName) => { - let ViewWrapper = viewName.match(/^dayGrid/) ? DayGridViewWrapper : TimeGridViewWrapper - - describe('when on', () => { - pushOptions({ - dayHeaders: true, - }) - - it('should show header', () => { - let calendar = initCalendar() - let viewWrapper = new ViewWrapper(calendar) - expect(viewWrapper.header).toBeTruthy() - }) - }) - - describe('when off', () => { - pushOptions({ - dayHeaders: false, - }) - - it('should not show header', () => { - let calendar = initCalendar() - let viewWrapper = new ViewWrapper(calendar) - expect(viewWrapper.header).toBeFalsy() - }) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/view-render/columnHeaderHtml.ts b/fullcalendar-main/tests/src/view-render/columnHeaderHtml.ts deleted file mode 100644 index 1f6d2b9..0000000 --- a/fullcalendar-main/tests/src/view-render/columnHeaderHtml.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('dayHeaderContent as html', () => { // TODO: rename file - pushOptions({ - initialDate: '2014-05-11', - }) - - describeOptions('initialView', { - 'when month view': 'dayGridMonth', - 'when timeGrid view': 'timeGridDay', - 'when dayGrid view': 'dayGridDay', - }, (viewName) => { - let ViewWrapper = viewName.match(/^dayGrid/) ? DayGridViewWrapper : TimeGridViewWrapper - - it('should contain custom HTML', () => { - let calendar = initCalendar({ - dayHeaderContent(arg) { - return { html: '
' + currentCalendar.formatDate(arg.date, { weekday: 'long' }) + '
' } - }, - }) - let headerWrapper = new ViewWrapper(calendar).header - - let $firstCellEl = $(headerWrapper.getCellEls()[0]) - expect($firstCellEl.find('.test').length).toBe(1) - expect($firstCellEl.text()).toBe('Sunday') - }) - }) - - describeTimeZones((tz) => { - it('receives correct date', () => { - let dates = [] - - initCalendar({ - initialView: 'timeGridDay', - dayHeaderContent(arg) { - dates.push(arg.date) - }, - }) - - expect(dates.length).toBe(1) - expect(dates[0]).toEqualDate(tz.parseDate('2014-05-11')) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/view-render/columnHeaderText.ts b/fullcalendar-main/tests/src/view-render/columnHeaderText.ts deleted file mode 100644 index e6456ec..0000000 --- a/fullcalendar-main/tests/src/view-render/columnHeaderText.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('dayHeaderContent as text', () => { // TODO: rename file - pushOptions({ - initialDate: '2014-05-11', - }) - - describeOptions('initialView', { - 'when month view': 'dayGridMonth', - 'when timeGrid view': 'timeGridDay', - 'when dayGrid view': 'dayGridDay', - }, (viewName) => { - let ViewWrapper = viewName.match(/^dayGrid/) ? DayGridViewWrapper : TimeGridViewWrapper - - it('should contain custom HTML escaped text', () => { - let calendar = initCalendar({ - dayHeaderContent(arg) { - return '
Custom ' + currentCalendar.formatDate(arg.date, { weekday: 'long' }) + '
' - }, - }) - let headerWrapper = new ViewWrapper(calendar).header - let $firstCell = $(headerWrapper.getCellEls()[0]) - expect($firstCell.text()).toBe('
Custom Sunday
') - }) - }) - - describeTimeZones((tz) => { - it('receives correct date', () => { - let dates = [] - - initCalendar({ - initialView: 'timeGridDay', - dayHeaderContent(arg) { - dates.push(arg.date) - }, - }) - - expect(dates.length).toBe(1) - expect(dates[0]).toEqualDate(tz.parseDate('2014-05-11')) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/view-render/daygrid-dirty-hit.ts b/fullcalendar-main/tests/src/view-render/daygrid-dirty-hit.ts deleted file mode 100644 index bcff590..0000000 --- a/fullcalendar-main/tests/src/view-render/daygrid-dirty-hit.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' - -describe('daygrid view with updated dimensions', () => { - it('reports correct dateClick after resize', (done) => { - let $wrapper = $( - '
', // reset width b/c test css hardcodes it - ).appendTo('body') - $wrapper.width(200) - - let calendar = initCalendar({ - initialDate: '2019-04-01', - initialView: 'dayGridMonth', - dateClick(arg) { - expect(arg.date).toEqualDate('2019-04-02') // a Tues - $wrapper.remove() - done() - }, - }, $wrapper.children().get(0)) - - $wrapper.width(400) - calendar.updateSize() - - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - $(dayGridWrapper.getDayEl('2019-04-02')).simulate('drag') // a click - }) -}) diff --git a/fullcalendar-main/tests/src/view-render/daygrid-multi.ts b/fullcalendar-main/tests/src/view-render/daygrid-multi.ts deleted file mode 100644 index 28944d0..0000000 --- a/fullcalendar-main/tests/src/view-render/daygrid-multi.ts +++ /dev/null @@ -1,103 +0,0 @@ -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' -import '../lib/dom-misc.js' - -describe('DayGrid w/ multiple weeks/days', () => { - it('dayGridYear has correct start/end dates', () => { - const calendar = initCalendar({ - initialDate: '2023-06-25', - initialView: 'dayGridYear', - }) - - expect(calendar.view.currentStart).toEqualDate('2023-01-01') - expect(calendar.view.currentEnd).toEqualDate('2024-01-01') - }) - - it('renders scrollbars when 7 weeks', () => { - const calendar = initCalendar({ - initialDate: '2023-01-25', - initialView: 'dayGrid', - duration: { weeks: 7 }, - }) - - const dayGridView = new DayGridViewWrapper(calendar) - expect(dayGridView.getScrollerEl()).toHaveScrollbars() - }) - - it('does NOT render scrollbars when 6 weeks', () => { - const calendar = initCalendar({ - initialDate: '2023-01-25', - initialView: 'dayGrid', - duration: { weeks: 6 }, - }) - - const dayGridView = new DayGridViewWrapper(calendar) - expect(dayGridView.getScrollerEl()).not.toHaveScrollbars() - }) - - it('displays month-start text at two points when month break', () => { - const calendar = initCalendar({ - initialDate: '2023-01-30', - initialView: 'dayGrid', - duration: { weeks: 2 }, - }) - - const dayGrid = new DayGridViewWrapper(calendar).dayGrid - const monthStartEls = dayGrid.getMonthStartEls() - - expect(monthStartEls.length).toBe(2) - expect(monthStartEls[0].innerText).toBe('January 29') - expect(monthStartEls[1].innerText).toBe('February 1') - }) - - it('scrolls to initialDate', () => { - const calendar = initCalendar({ - initialDate: '2023-06-25', - initialView: 'dayGridYear', - }) - - const viewWrapper = new DayGridViewWrapper(calendar) - const scrollerEl = viewWrapper.getScrollerEl() - const dayGridWrapper = viewWrapper.dayGrid - const initialDayEl = dayGridWrapper.getDayEl('2023-06-25') - - expect( - Math.abs( - initialDayEl.getBoundingClientRect().top - - scrollerEl.getBoundingClientRect().top, - ) < 1, - ) - }) - - it('has customizable monthStartFormat', () => { - const calendar = initCalendar({ - initialDate: '2023-01-30', - initialView: 'dayGrid', - duration: { weeks: 2 }, - monthStartFormat: { year: 'numeric', month: 'short', day: '2-digit' }, - }) - - const dayGrid = new DayGridViewWrapper(calendar).dayGrid - const monthStartEls = dayGrid.getMonthStartEls() - - expect(monthStartEls.length).toBe(2) - expect(monthStartEls[0].innerText).toBe('Jan 29, 2023') - expect(monthStartEls[1].innerText).toBe('Feb 01, 2023') - }) - - // https://github.com/fullcalendar/fullcalendar/issues/7197 - it('has month-titles for each month in custom 6-month calendar', () => { - const calendar = initCalendar({ - initialDate: '2023-01-30', - initialView: 'dayGrid', - duration: { months: 6 }, - monthStartFormat: { year: 'numeric', month: 'short', day: '2-digit' }, - }) - - const dayGrid = new DayGridViewWrapper(calendar).dayGrid - const monthStartEls = dayGrid.getMonthStartEls() - - expect(monthStartEls.length).toBe(6) - expect(monthStartEls[0].innerText).toBe('Jan 01, 2023') - expect(monthStartEls[1].innerText).toBe('Feb 01, 2023') - }) -}) diff --git a/fullcalendar-main/tests/src/view-render/height.ts b/fullcalendar-main/tests/src/view-render/height.ts deleted file mode 100644 index 4c0e937..0000000 --- a/fullcalendar-main/tests/src/view-render/height.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('view height', () => { - // https://github.com/fullcalendar/fullcalendar/issues/6034 - xit('does not squish view-specific height:auto in timegrid view', () => { - let calendar = initCalendar({ - initialView: 'timeGridWeek', - aspectRatio: 1.8, - views: { - timeGrid: { - height: 'auto', - }, - }, - }) - let viewWrapper = new TimeGridViewWrapper(calendar) - let scrollerEl = viewWrapper.getScrollerEl() - - expect(scrollerEl.getBoundingClientRect().height).toBeGreaterThan(10) - }) -}) diff --git a/fullcalendar-main/tests/src/view-render/multimonth.ts b/fullcalendar-main/tests/src/view-render/multimonth.ts deleted file mode 100644 index 0d2f9ca..0000000 --- a/fullcalendar-main/tests/src/view-render/multimonth.ts +++ /dev/null @@ -1,129 +0,0 @@ -import { MultiMonthViewWrapper } from '../lib/wrappers/MultiMonthViewWrapper.js' -import '../lib/dom-geom.js' - -describe('multimonth view', () => { - it('computes start/end for multiMonthYear', () => { - const calendar = initCalendar({ - initialDate: '2023-06-01', - initialView: 'multiMonthYear', - }) - - expect(calendar.view.currentStart).toEqualDate('2023-01-01') - expect(calendar.view.currentEnd).toEqualDate('2024-01-01') - }) - - it('can have custom duration', () => { - const calendar = initCalendar({ - initialDate: '2023-06-01', - initialView: 'multiMonth', - duration: { months: 2 }, - }) - - expect(calendar.view.currentStart).toEqualDate('2023-06-01') - expect(calendar.view.currentEnd).toEqualDate('2023-08-01') - }) - - it('having small multiMonthMinWidth results in side-by-side months', () => { - const calendar = initCalendar({ - initialDate: '2023-06-01', - initialView: 'multiMonthYear', - multiMonthMinWidth: 100, - }) - - const monthWrappers = new MultiMonthViewWrapper(calendar).getMonths() - expect(monthWrappers.length).toBe(12) - expect(monthWrappers[0].el).toBeLeftOf(monthWrappers[1].el) - }) - - it('having large multiMonthMinWidth results in stacking months', () => { - const calendar = initCalendar({ - initialDate: '2023-06-01', - initialView: 'multiMonthYear', - multiMonthMinWidth: 600, - }) - - const monthWrappers = new MultiMonthViewWrapper(calendar).getMonths() - expect(monthWrappers.length).toBe(12) - expect(monthWrappers[0].el).not.toBeLeftOf(monthWrappers[1].el) - expect(monthWrappers[0].el).toBeAbove(monthWrappers[1].el) - }) - - it('can have forced single column with multiMonthMaxColumns', () => { - const calendar = initCalendar({ - initialDate: '2023-06-01', - initialView: 'multiMonthYear', - multiMonthMaxColumns: 1, - }) - - const monthWrappers = new MultiMonthViewWrapper(calendar).getMonths() - expect(monthWrappers[0].el).not.toBeLeftOf(monthWrappers[1].el) - expect(monthWrappers[0].el).toBeAbove(monthWrappers[1].el) - }) - - it('is scrolled to current date initially', () => { - const calendar = initCalendar({ - initialDate: '2023-06-01', - initialView: 'multiMonthYear', - multiMonthMaxColumns: 1, - }) - - const viewWrapper = new MultiMonthViewWrapper(calendar) - const monthWrappers = viewWrapper.getMonths() - const scrollerEl = viewWrapper.getScrollerEl() - - expect( - Math.abs( - scrollerEl.getBoundingClientRect().top - - monthWrappers[5].el.getBoundingClientRect().top, - ), - ).toBeLessThan(2) - - expect(scrollerEl.scrollTop).not.toBe(0) - calendar.next() - calendar.prev() - expect(scrollerEl.scrollTop).toBe(0) - }) - - it('renders events when weekends: false', () => { - const calendar = initCalendar({ - initialDate: '2023-01-25', - initialView: 'multiMonthYear', - weekends: false, - events: [ - { - title: 'Conference', - start: '2023-01-11', - end: '2023-01-13', - }, - ], - }) - - const viewWrapper = new MultiMonthViewWrapper(calendar) - const monthWrappers = viewWrapper.getMonths() - expect(monthWrappers.length).toBe(12) - expect(monthWrappers[0].columnCnt).toBe(5) - expect(viewWrapper.getEventEls().length).toBe(1) - }) - - it('has customizable multiMonthTitleFormat', () => { - const calendar = initCalendar({ - initialDate: '2023-06-01', - initialView: 'multiMonthYear', - multiMonthTitleFormat: { month: 'short', year: 'numeric' }, - }) - - const monthWrappers = new MultiMonthViewWrapper(calendar).getMonths() - expect(monthWrappers[0].title).toBe('Jan 2023') - }) - - it('does not accidentally render month-start within cells', () => { - const calendar = initCalendar({ - initialDate: '2023-06-01', - initialView: 'multiMonthYear', - multiMonthTitleFormat: { month: 'short', year: 'numeric' }, - }) - - const viewWrapper = new MultiMonthViewWrapper(calendar) - expect(viewWrapper.el.querySelectorAll('.fc-daygrid-month-start').length).toBe(0) - }) -}) diff --git a/fullcalendar-main/tests/src/view-render/rerender.ts b/fullcalendar-main/tests/src/view-render/rerender.ts deleted file mode 100644 index 63bb622..0000000 --- a/fullcalendar-main/tests/src/view-render/rerender.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { DayGridViewWrapper } from '../lib/wrappers/DayGridViewWrapper.js' - -describe('rerendering a calendar', () => { - it('keeps sizing', () => { - let calendar = initCalendar({ - initialView: 'dayGridMonth', - initialDate: '2019-08-08', - dayMaxEventRows: 3, - events: [ - { date: '2019-08-08', title: 'event' }, - { date: '2019-08-08', title: 'event' }, - { date: '2019-08-08', title: 'event' }, - { date: '2019-08-08', title: 'event' }, - ], - }) - let dayGridWrapper = new DayGridViewWrapper(calendar).dayGrid - - expect(dayGridWrapper.getMoreEls().length).toBe(1) - - calendar.render() - expect(dayGridWrapper.getMoreEls().length).toBe(1) // good way to test that sizing is maintained - }) -}) diff --git a/fullcalendar-main/tests/src/view-render/scrollToTime.ts b/fullcalendar-main/tests/src/view-render/scrollToTime.ts deleted file mode 100644 index e6fc63e..0000000 --- a/fullcalendar-main/tests/src/view-render/scrollToTime.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('scrollToTime method', () => { - it('accepts a object duration input', () => { - let calendar = initCalendar({ - scrollTime: 0, - initialView: 'timeGridWeek', - }) - let viewWrapper = new TimeGridViewWrapper(calendar) - - calendar.scrollToTime({ hours: 2 }) - - // NOTE: c&p'd from scrollTime tests - let slotTop = viewWrapper.timeGrid.getTimeTop('02:00:00') - viewWrapper.timeGrid.el.getBoundingClientRect().top - let scrollEl = viewWrapper.getScrollerEl() - let scrollTop = scrollEl.scrollTop - let diff = Math.abs(slotTop - scrollTop) - - expect(slotTop).toBeGreaterThan(0) - expect(scrollTop).toBeGreaterThan(0) - expect(diff).toBeLessThan(3) - }) -}) diff --git a/fullcalendar-main/tests/src/view-render/showNonCurrentDates.ts b/fullcalendar-main/tests/src/view-render/showNonCurrentDates.ts deleted file mode 100644 index beaf72a..0000000 --- a/fullcalendar-main/tests/src/view-render/showNonCurrentDates.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { expectDayRange } from '../lib/ViewRenderUtils.js' - -describe('showNonCurrentDates', () => { - pushOptions({ - showNonCurrentDates: false, - }) - - describe('when in month view', () => { - pushOptions({ - initialView: 'dayGridMonth', - initialDate: '2017-06-01', - }) - - it('does not render other months\' dates', () => { - initCalendar() - expectDayRange('2017-06-01', '2017-07-01') - }) - }) - - describe('when in week view', () => { - pushOptions({ - initialView: 'timeGridWeek', - initialDate: '2017-06-01', - }) - - it('has no effect', () => { - initCalendar() - expectDayRange('2017-05-28', '2017-06-04') - }) - }) - - it('works when disabling weekends and switching views', () => { - initCalendar({ - weekends: false, - initialView: 'dayGridMonth', - initialDate: '2019-06-07', // only shows problem when start date is a weekend! - }) - currentCalendar.next() - currentCalendar.setOption('weekends', true) - // no errors thrown, yay - }) - - it('works when switching views with same formal duration but different rendered duration', () => { - initCalendar({ - initialView: 'listMonth', // something other than than dayGridMonth - initialDate: '2019-01-01', - }) - currentCalendar.changeView('dayGridMonth') - expectDayRange('2019-01-01', '2019-02-01') - }) -}) diff --git a/fullcalendar-main/tests/src/view-render/slotDuration.ts b/fullcalendar-main/tests/src/view-render/slotDuration.ts deleted file mode 100644 index 1c8ab7e..0000000 --- a/fullcalendar-main/tests/src/view-render/slotDuration.ts +++ /dev/null @@ -1,99 +0,0 @@ -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('slotDuration', () => { - pushOptions({ - initialDate: '2017-07-17', - initialView: 'timeGridDay', - scrollTime: 0, - locale: 'en-GB', // for 00:00 instead of 24:00 - slotLabelFormat: { hour: '2-digit', minute: '2-digit', hour12: false }, - }) - - describe('when only major slots', () => { - pushOptions({ - slotDuration: '01:00', - slotLabelInterval: '01:00', - }) - - describe('when in alignment with slotMinTime', () => { - pushOptions({ - slotMinTime: '00:00', - slotMaxTime: '03:00', - }) - it('render slots correctly', () => { - let calendar = initCalendar() - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - - expect(timeGridWrapper.getTimeAxisInfo()).toEqual([ - { text: '00:00', isMajor: true }, - { text: '01:00', isMajor: true }, - { text: '02:00', isMajor: true }, - ]) - }) - }) - - describe('when out of alignment with slotMinTime', () => { - pushOptions({ - slotMinTime: '00:20', - slotMaxTime: '03:20', - }) - it('render slots correctly', () => { - let calendar = initCalendar() - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - - expect(timeGridWrapper.getTimeAxisInfo()).toEqual([ - { text: '00:20', isMajor: true }, - { text: '01:20', isMajor: true }, - { text: '02:20', isMajor: true }, - ]) - }) - }) - }) - - describe('when major and minor slots', () => { - pushOptions({ - slotDuration: '00:30', - slotLabelInterval: '01:00', - }) - - describe('when in alignment with slotMinTime', () => { - pushOptions({ - slotMinTime: '00:00', - slotMaxTime: '03:00', - }) - it('render slots correctly', () => { - let calendar = initCalendar() - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - - expect(timeGridWrapper.getTimeAxisInfo()).toEqual([ - { text: '00:00', isMajor: true }, - { text: '', isMajor: false }, - { text: '01:00', isMajor: true }, - { text: '', isMajor: false }, - { text: '02:00', isMajor: true }, - { text: '', isMajor: false }, - ]) - }) - }) - - describe('when out of alignment with slotMinTime', () => { - pushOptions({ - slotMinTime: '00:20', - slotMaxTime: '03:20', - }) - it('render slots correctly', () => { - let calendar = initCalendar() - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - - expect(timeGridWrapper.getTimeAxisInfo()).toEqual([ - { text: '00:20', isMajor: true }, - { text: '', isMajor: false }, - { text: '01:20', isMajor: true }, - { text: '', isMajor: false }, - { text: '02:20', isMajor: true }, - { text: '', isMajor: false }, - ]) - }) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/view-render/timegrid-allday-slot.ts b/fullcalendar-main/tests/src/view-render/timegrid-allday-slot.ts deleted file mode 100644 index 9c51655..0000000 --- a/fullcalendar-main/tests/src/view-render/timegrid-allday-slot.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' - -describe('timegrid all-day slot', () => { - pushOptions({ - initialDate: '2019-04-23', - initialView: 'timeGridWeek', - editable: true, - }) - - // https://github.com/fullcalendar/fullcalendar/issues/4616 - it('allows dragging after dynamic event adding', (done) => { - let calendar = initCalendar({ - eventDrop(arg) { - expect(arg.event.start).toEqualDate('2019-04-24') - done() - }, - }) - - calendar.batchRendering(() => { - calendar.addEvent({ start: '2019-04-23' }) - calendar.addEvent({ start: '2019-04-23' }) - calendar.addEvent({ start: '2019-04-23' }) - }) - - let dayGridWrapper = new TimeGridViewWrapper(calendar).dayGrid - let dayWidth = $(dayGridWrapper.getDayEls('2019-04-23')).width() - let lastEventEl = dayGridWrapper.getEventEls()[2] - - $(lastEventEl).simulate('drag', { - localPoint: { left: '50%', top: '99%' }, - dx: dayWidth, - }) - }) -}) diff --git a/fullcalendar-main/tests/src/view-render/timegrid-slots.ts b/fullcalendar-main/tests/src/view-render/timegrid-slots.ts deleted file mode 100644 index aeaba98..0000000 --- a/fullcalendar-main/tests/src/view-render/timegrid-slots.ts +++ /dev/null @@ -1,9 +0,0 @@ -describe('timegrid slots', () => { - // https://github.com/fullcalendar/fullcalendar/issues/5952 - it('can render a single big slot without error', () => { - initCalendar({ - initialView: 'timeGridDay', - slotDuration: '24:00', - }) - }) -}) diff --git a/fullcalendar-main/tests/src/view-render/updateSize.ts b/fullcalendar-main/tests/src/view-render/updateSize.ts deleted file mode 100644 index 91f6c57..0000000 --- a/fullcalendar-main/tests/src/view-render/updateSize.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('updateSize method', () => { - it('updates size of a previously hidden element', () => { - let $el = $('
').appendTo('body') - let calendar = initCalendar({ - initialView: 'dayGridMonth', - contentHeight: 600, - }, $el) - let calendarWrapper = new CalendarWrapper(calendar) - - $el.show() - calendar.updateSize() - expect(calendarWrapper.getViewContainerEl().offsetHeight).toBeCloseTo(600, 0) - - $el.remove() - }) -}) diff --git a/fullcalendar-main/tests/src/view-render/validRange.ts b/fullcalendar-main/tests/src/view-render/validRange.ts deleted file mode 100644 index 9a421f9..0000000 --- a/fullcalendar-main/tests/src/view-render/validRange.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { expectDayRange } from '../lib/ViewRenderUtils.js' - -describe('validRange rendering', () => { - describe('with hardcoded start constraint', () => { - describe('when month view', () => { - pushOptions({ - initialView: 'dayGridMonth', - initialDate: '2017-06-01', - validRange: { start: '2017-06-07' }, - }) - - it('does not render days before', () => { - initCalendar() - expectDayRange('2017-06-07', '2017-07-09') - }) - }) - - describe('when in week view', () => { - pushOptions({ - initialView: 'timeGridWeek', - initialDate: '2017-06-08', - validRange: { start: '2017-06-06' }, - }) - - it('does not render days before', () => { - initCalendar() - expectDayRange('2017-06-06', '2017-06-11') - }) - }) - }) - - describe('with hardcoded end constraint', () => { - describe('when month view', () => { - pushOptions({ - initialView: 'dayGridMonth', - initialDate: '2017-06-01', - validRange: { end: '2017-06-07' }, - }) - - it('does not render days on or after', () => { - initCalendar() - expectDayRange('2017-05-28', '2017-06-07') - }) - }) - - describe('when in week view', () => { - pushOptions({ - initialView: 'timeGridWeek', - initialDate: '2017-06-08', - validRange: { end: '2017-06-06' }, - }) - - it('does not render days on or after', () => { - initCalendar() - expectDayRange('2017-06-04', '2017-06-06') - }) - }) - }) -}) diff --git a/fullcalendar-main/tests/src/view-type/changeView.ts b/fullcalendar-main/tests/src/view-type/changeView.ts deleted file mode 100644 index 023dca1..0000000 --- a/fullcalendar-main/tests/src/view-type/changeView.ts +++ /dev/null @@ -1,99 +0,0 @@ -import { expectActiveRange } from '../lib/ViewDateUtils.js' -import { TimeGridViewWrapper } from '../lib/wrappers/TimeGridViewWrapper.js' -import { CalendarWrapper } from '../lib/wrappers/CalendarWrapper.js' - -describe('changeView', () => { - pushOptions({ - initialDate: '2017-06-08', - initialView: 'dayGridMonth', - }) - - it('can change views', () => { - let calendar = initCalendar() - calendar.changeView('timeGridWeek') - expectActiveRange('2017-06-04', '2017-06-11') - }) - - it('can change views and navigate date', () => { - let calendar = initCalendar() - calendar.changeView('timeGridDay', '2017-06-26') - expectActiveRange('2017-06-26', '2017-06-27') - }) - - it('can change views and change activeRange', () => { - let calendar = initCalendar() - calendar.changeView('timeGrid', { - start: '2017-07-04', - end: '2017-07-08', - }) - expectActiveRange('2017-07-04', '2017-07-08') - }) - - describe('when switching away from view, then back', () => { - // serves as a smoke test too - it('correctly renders original view again', () => { - let calendar = initCalendar({ - initialView: 'dayGridMonth', - }) - - expect(calendar.view.type).toBe('dayGridMonth') - checkViewIntegrity(calendar) - calendar.changeView('timeGridWeek') - - expect(calendar.view.type).toBe('timeGridWeek') - checkViewIntegrity(calendar) - - let timeGridWrapper = new TimeGridViewWrapper(calendar).timeGrid - expect(timeGridWrapper.isStructureValid()).toBe(true) - - calendar.changeView('dayGridWeek') - - expect(calendar.view.type).toBe('dayGridWeek') - checkViewIntegrity(calendar) - calendar.changeView('listWeek') - - expect(calendar.view.type).toBe('listWeek') - checkViewIntegrity(calendar) - calendar.changeView('dayGridMonth') - - expect(calendar.view.type).toBe('dayGridMonth') - checkViewIntegrity(calendar) - }) - }) - - // https://github.com/fullcalendar/fullcalendar/issues/3689 - it('can when switching to/from view while loading events', (done) => { - let calendar = initCalendar({ - headerToolbar: { - left: 'title dayGridDay timeGridDay', - }, - initialView: 'timeGridDay', - now: '2017-06-08T01:00:00', - events(fetchInfo, successCallback) { - setTimeout(() => { - successCallback([ // will run after the first view switch but before the second - { start: '2017-06-08T01:00:00' }, // needs to be timed to cause the JS error - ]) - }, 100) - }, - }) - - calendar.changeView('dayGridDay') - checkViewIntegrity(calendar) - expect(calendar.view.type).toBe('dayGridDay') - - setTimeout(() => { - calendar.changeView('timeGridDay') - checkViewIntegrity(calendar) - expect(calendar.view.type).toBe('timeGridDay') - done() - }, 200) - }) - - function checkViewIntegrity(calendar) { - let $el = $(new CalendarWrapper(calendar).getViewEl()) - expect($el).toBeInDOM() - expect($el.children().length).toBeGreaterThan(0) - expect($el.text()).toBeTruthy() - } -}) diff --git a/fullcalendar-main/tests/src/view-type/exposed-classes.ts b/fullcalendar-main/tests/src/view-type/exposed-classes.ts deleted file mode 100644 index 6983e82..0000000 --- a/fullcalendar-main/tests/src/view-type/exposed-classes.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { DayGridView, DayTable } from '@fullcalendar/daygrid/internal' -import { ListView } from '@fullcalendar/list/internal' -import { DayTimeColsView, DayTimeCols } from '@fullcalendar/timegrid/internal' - -describe('internal View/Grid classes', () => { - it('are exposed', () => { - expect(typeof DayTimeColsView).toBe('function') - expect(typeof DayGridView).toBe('function') - expect(typeof ListView).toBe('function') - - expect(typeof DayTable).toBe('function') - expect(typeof DayTimeCols).toBe('function') - }) -}) diff --git a/fullcalendar-main/turbo.json b/fullcalendar-main/turbo.json deleted file mode 100644 index a21d72d..0000000 --- a/fullcalendar-main/turbo.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "$schema": "https://turborepo.org/schema.json", - "pipeline": { - "lint": { - "inputs": [ - "./*.{ts,js,cjs}", - "./{src,scripts,config,tests}/**" - ] - }, - "build": { - "dependsOn": ["^build"], - "inputs": [ - "./*.{ts,js,cjs,json}", - "./{src,scripts,config}/**" - ], - "outputs": [ - "./dist/**", - "!./dist/.tsout", - "!./dist/tsconfig.tsbuildinfo", - "./tests/dist/**" - ] - }, - "test": { - "dependsOn": ["build"] - }, - "clean": { - "cache": false - } - } -} diff --git a/hleda-se-fotograf-ka/index.html b/hleda-se-fotograf-ka/index.html index 1467f34..9341ef9 100644 --- a/hleda-se-fotograf-ka/index.html +++ b/hleda-se-fotograf-ka/index.html @@ -4,7 +4,7 @@ "> - - - - - -
- - - diff --git a/kalendar-novy/examples/daygrid-views.html b/kalendar-novy/examples/daygrid-views.html deleted file mode 100644 index 9dafe43..0000000 --- a/kalendar-novy/examples/daygrid-views.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - -
- - - diff --git a/kalendar-novy/examples/external-dragging-2cals.html b/kalendar-novy/examples/external-dragging-2cals.html deleted file mode 100644 index 066685d..0000000 --- a/kalendar-novy/examples/external-dragging-2cals.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - -
-
- - - diff --git a/kalendar-novy/examples/external-dragging-builtin.html b/kalendar-novy/examples/external-dragging-builtin.html deleted file mode 100644 index 78fcd89..0000000 --- a/kalendar-novy/examples/external-dragging-builtin.html +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - - - - -
- -
-

Draggable Events

- -
-
-
My Event 1
-
-
-
My Event 2
-
-
-
My Event 3
-
-
-
My Event 4
-
-
-
My Event 5
-
-
- -

- - -

-
- -
-
-
- -
- - diff --git a/kalendar-novy/examples/full-height.html b/kalendar-novy/examples/full-height.html deleted file mode 100644 index 18b55f8..0000000 --- a/kalendar-novy/examples/full-height.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - - - - -
-
-
- - - diff --git a/kalendar-novy/examples/list-sticky-header.html b/kalendar-novy/examples/list-sticky-header.html deleted file mode 100644 index 487af31..0000000 --- a/kalendar-novy/examples/list-sticky-header.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - -
- - - diff --git a/kalendar-novy/examples/list-views.html b/kalendar-novy/examples/list-views.html deleted file mode 100644 index cb219d0..0000000 --- a/kalendar-novy/examples/list-views.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - -
- - - diff --git a/kalendar-novy/examples/month-view.html b/kalendar-novy/examples/month-view.html deleted file mode 100644 index dbd8861..0000000 --- a/kalendar-novy/examples/month-view.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - -
- - - diff --git a/kalendar-novy/examples/multimonth-view.html b/kalendar-novy/examples/multimonth-view.html deleted file mode 100644 index feb9d23..0000000 --- a/kalendar-novy/examples/multimonth-view.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - -
- - - diff --git a/kalendar-novy/examples/multiweek-view.html b/kalendar-novy/examples/multiweek-view.html deleted file mode 100644 index 5a175fb..0000000 --- a/kalendar-novy/examples/multiweek-view.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - -
- - - diff --git a/kalendar-novy/examples/natural-height.html b/kalendar-novy/examples/natural-height.html deleted file mode 100644 index b62c41d..0000000 --- a/kalendar-novy/examples/natural-height.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - -
- - - diff --git a/kalendar-novy/examples/selectable.html b/kalendar-novy/examples/selectable.html deleted file mode 100644 index 785e90e..0000000 --- a/kalendar-novy/examples/selectable.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - -
- - - diff --git a/kalendar-novy/examples/timegrid-views.html b/kalendar-novy/examples/timegrid-views.html deleted file mode 100644 index 9cd2527..0000000 --- a/kalendar-novy/examples/timegrid-views.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - -
- - - diff --git a/fullcalendar-main/LICENSE.md b/kalendar/LICENSE.md similarity index 100% rename from fullcalendar-main/LICENSE.md rename to kalendar/LICENSE.md diff --git a/kalendar-novy/README.md b/kalendar/README.md similarity index 100% rename from kalendar-novy/README.md rename to kalendar/README.md diff --git a/kalendar-novy/dist/index.global.js b/kalendar/dist/index.global.js similarity index 100% rename from kalendar-novy/dist/index.global.js rename to kalendar/dist/index.global.js diff --git a/kalendar-novy/dist/index.global.min.js b/kalendar/dist/index.global.min.js similarity index 100% rename from kalendar-novy/dist/index.global.min.js rename to kalendar/dist/index.global.min.js diff --git a/fullcalendar-main/bundle/examples/background-events.html b/kalendar/examples/background-events.html similarity index 100% rename from fullcalendar-main/bundle/examples/background-events.html rename to kalendar/examples/background-events.html diff --git a/fullcalendar-main/bundle/examples/daygrid-views.html b/kalendar/examples/daygrid-views.html similarity index 100% rename from fullcalendar-main/bundle/examples/daygrid-views.html rename to kalendar/examples/daygrid-views.html diff --git a/fullcalendar-main/bundle/examples/external-dragging-2cals.html b/kalendar/examples/external-dragging-2cals.html similarity index 100% rename from fullcalendar-main/bundle/examples/external-dragging-2cals.html rename to kalendar/examples/external-dragging-2cals.html diff --git a/fullcalendar-main/bundle/examples/external-dragging-builtin.html b/kalendar/examples/external-dragging-builtin.html similarity index 100% rename from fullcalendar-main/bundle/examples/external-dragging-builtin.html rename to kalendar/examples/external-dragging-builtin.html diff --git a/fullcalendar-main/bundle/examples/full-height.html b/kalendar/examples/full-height.html similarity index 100% rename from fullcalendar-main/bundle/examples/full-height.html rename to kalendar/examples/full-height.html diff --git a/fullcalendar-main/bundle/examples/list-sticky-header.html b/kalendar/examples/list-sticky-header.html similarity index 100% rename from fullcalendar-main/bundle/examples/list-sticky-header.html rename to kalendar/examples/list-sticky-header.html diff --git a/fullcalendar-main/bundle/examples/list-views.html b/kalendar/examples/list-views.html similarity index 100% rename from fullcalendar-main/bundle/examples/list-views.html rename to kalendar/examples/list-views.html diff --git a/fullcalendar-main/bundle/examples/month-view.html b/kalendar/examples/month-view.html similarity index 100% rename from fullcalendar-main/bundle/examples/month-view.html rename to kalendar/examples/month-view.html diff --git a/fullcalendar-main/bundle/examples/multimonth-view.html b/kalendar/examples/multimonth-view.html similarity index 100% rename from fullcalendar-main/bundle/examples/multimonth-view.html rename to kalendar/examples/multimonth-view.html diff --git a/fullcalendar-main/bundle/examples/multiweek-view.html b/kalendar/examples/multiweek-view.html similarity index 100% rename from fullcalendar-main/bundle/examples/multiweek-view.html rename to kalendar/examples/multiweek-view.html diff --git a/fullcalendar-main/bundle/examples/natural-height.html b/kalendar/examples/natural-height.html similarity index 100% rename from fullcalendar-main/bundle/examples/natural-height.html rename to kalendar/examples/natural-height.html diff --git a/fullcalendar-main/bundle/examples/selectable.html b/kalendar/examples/selectable.html similarity index 100% rename from fullcalendar-main/bundle/examples/selectable.html rename to kalendar/examples/selectable.html diff --git a/fullcalendar-main/bundle/examples/timegrid-views.html b/kalendar/examples/timegrid-views.html similarity index 100% rename from fullcalendar-main/bundle/examples/timegrid-views.html rename to kalendar/examples/timegrid-views.html diff --git a/kalendar-novy/packages/bootstrap4/index.global.js b/kalendar/packages/bootstrap4/index.global.js similarity index 100% rename from kalendar-novy/packages/bootstrap4/index.global.js rename to kalendar/packages/bootstrap4/index.global.js diff --git a/kalendar-novy/packages/bootstrap4/index.global.min.js b/kalendar/packages/bootstrap4/index.global.min.js similarity index 100% rename from kalendar-novy/packages/bootstrap4/index.global.min.js rename to kalendar/packages/bootstrap4/index.global.min.js diff --git a/kalendar-novy/packages/bootstrap5/index.global.js b/kalendar/packages/bootstrap5/index.global.js similarity index 100% rename from kalendar-novy/packages/bootstrap5/index.global.js rename to kalendar/packages/bootstrap5/index.global.js diff --git a/kalendar-novy/packages/bootstrap5/index.global.min.js b/kalendar/packages/bootstrap5/index.global.min.js similarity index 100% rename from kalendar-novy/packages/bootstrap5/index.global.min.js rename to kalendar/packages/bootstrap5/index.global.min.js diff --git a/kalendar-novy/packages/core/index.global.js b/kalendar/packages/core/index.global.js similarity index 100% rename from kalendar-novy/packages/core/index.global.js rename to kalendar/packages/core/index.global.js diff --git a/kalendar-novy/packages/core/index.global.min.js b/kalendar/packages/core/index.global.min.js similarity index 100% rename from kalendar-novy/packages/core/index.global.min.js rename to kalendar/packages/core/index.global.min.js diff --git a/kalendar-novy/packages/core/locales-all.global.js b/kalendar/packages/core/locales-all.global.js similarity index 100% rename from kalendar-novy/packages/core/locales-all.global.js rename to kalendar/packages/core/locales-all.global.js diff --git a/kalendar-novy/packages/core/locales-all.global.min.js b/kalendar/packages/core/locales-all.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales-all.global.min.js rename to kalendar/packages/core/locales-all.global.min.js diff --git a/kalendar-novy/packages/core/locales/af.global.js b/kalendar/packages/core/locales/af.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/af.global.js rename to kalendar/packages/core/locales/af.global.js diff --git a/kalendar-novy/packages/core/locales/af.global.min.js b/kalendar/packages/core/locales/af.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/af.global.min.js rename to kalendar/packages/core/locales/af.global.min.js diff --git a/kalendar-novy/packages/core/locales/ar-dz.global.js b/kalendar/packages/core/locales/ar-dz.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/ar-dz.global.js rename to kalendar/packages/core/locales/ar-dz.global.js diff --git a/kalendar-novy/packages/core/locales/ar-dz.global.min.js b/kalendar/packages/core/locales/ar-dz.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/ar-dz.global.min.js rename to kalendar/packages/core/locales/ar-dz.global.min.js diff --git a/kalendar-novy/packages/core/locales/ar-kw.global.js b/kalendar/packages/core/locales/ar-kw.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/ar-kw.global.js rename to kalendar/packages/core/locales/ar-kw.global.js diff --git a/kalendar-novy/packages/core/locales/ar-kw.global.min.js b/kalendar/packages/core/locales/ar-kw.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/ar-kw.global.min.js rename to kalendar/packages/core/locales/ar-kw.global.min.js diff --git a/kalendar-novy/packages/core/locales/ar-ly.global.js b/kalendar/packages/core/locales/ar-ly.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/ar-ly.global.js rename to kalendar/packages/core/locales/ar-ly.global.js diff --git a/kalendar-novy/packages/core/locales/ar-ly.global.min.js b/kalendar/packages/core/locales/ar-ly.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/ar-ly.global.min.js rename to kalendar/packages/core/locales/ar-ly.global.min.js diff --git a/kalendar-novy/packages/core/locales/ar-ma.global.js b/kalendar/packages/core/locales/ar-ma.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/ar-ma.global.js rename to kalendar/packages/core/locales/ar-ma.global.js diff --git a/kalendar-novy/packages/core/locales/ar-ma.global.min.js b/kalendar/packages/core/locales/ar-ma.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/ar-ma.global.min.js rename to kalendar/packages/core/locales/ar-ma.global.min.js diff --git a/kalendar-novy/packages/core/locales/ar-sa.global.js b/kalendar/packages/core/locales/ar-sa.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/ar-sa.global.js rename to kalendar/packages/core/locales/ar-sa.global.js diff --git a/kalendar-novy/packages/core/locales/ar-sa.global.min.js b/kalendar/packages/core/locales/ar-sa.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/ar-sa.global.min.js rename to kalendar/packages/core/locales/ar-sa.global.min.js diff --git a/kalendar-novy/packages/core/locales/ar-tn.global.js b/kalendar/packages/core/locales/ar-tn.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/ar-tn.global.js rename to kalendar/packages/core/locales/ar-tn.global.js diff --git a/kalendar-novy/packages/core/locales/ar-tn.global.min.js b/kalendar/packages/core/locales/ar-tn.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/ar-tn.global.min.js rename to kalendar/packages/core/locales/ar-tn.global.min.js diff --git a/kalendar-novy/packages/core/locales/ar.global.js b/kalendar/packages/core/locales/ar.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/ar.global.js rename to kalendar/packages/core/locales/ar.global.js diff --git a/kalendar-novy/packages/core/locales/ar.global.min.js b/kalendar/packages/core/locales/ar.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/ar.global.min.js rename to kalendar/packages/core/locales/ar.global.min.js diff --git a/kalendar-novy/packages/core/locales/az.global.js b/kalendar/packages/core/locales/az.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/az.global.js rename to kalendar/packages/core/locales/az.global.js diff --git a/kalendar-novy/packages/core/locales/az.global.min.js b/kalendar/packages/core/locales/az.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/az.global.min.js rename to kalendar/packages/core/locales/az.global.min.js diff --git a/kalendar-novy/packages/core/locales/bg.global.js b/kalendar/packages/core/locales/bg.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/bg.global.js rename to kalendar/packages/core/locales/bg.global.js diff --git a/kalendar-novy/packages/core/locales/bg.global.min.js b/kalendar/packages/core/locales/bg.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/bg.global.min.js rename to kalendar/packages/core/locales/bg.global.min.js diff --git a/kalendar-novy/packages/core/locales/bn.global.js b/kalendar/packages/core/locales/bn.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/bn.global.js rename to kalendar/packages/core/locales/bn.global.js diff --git a/kalendar-novy/packages/core/locales/bn.global.min.js b/kalendar/packages/core/locales/bn.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/bn.global.min.js rename to kalendar/packages/core/locales/bn.global.min.js diff --git a/kalendar-novy/packages/core/locales/bs.global.js b/kalendar/packages/core/locales/bs.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/bs.global.js rename to kalendar/packages/core/locales/bs.global.js diff --git a/kalendar-novy/packages/core/locales/bs.global.min.js b/kalendar/packages/core/locales/bs.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/bs.global.min.js rename to kalendar/packages/core/locales/bs.global.min.js diff --git a/kalendar-novy/packages/core/locales/ca.global.js b/kalendar/packages/core/locales/ca.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/ca.global.js rename to kalendar/packages/core/locales/ca.global.js diff --git a/kalendar-novy/packages/core/locales/ca.global.min.js b/kalendar/packages/core/locales/ca.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/ca.global.min.js rename to kalendar/packages/core/locales/ca.global.min.js diff --git a/kalendar-novy/packages/core/locales/cs.global.js b/kalendar/packages/core/locales/cs.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/cs.global.js rename to kalendar/packages/core/locales/cs.global.js diff --git a/kalendar-novy/packages/core/locales/cs.global.min.js b/kalendar/packages/core/locales/cs.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/cs.global.min.js rename to kalendar/packages/core/locales/cs.global.min.js diff --git a/kalendar-novy/packages/core/locales/cy.global.js b/kalendar/packages/core/locales/cy.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/cy.global.js rename to kalendar/packages/core/locales/cy.global.js diff --git a/kalendar-novy/packages/core/locales/cy.global.min.js b/kalendar/packages/core/locales/cy.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/cy.global.min.js rename to kalendar/packages/core/locales/cy.global.min.js diff --git a/kalendar-novy/packages/core/locales/da.global.js b/kalendar/packages/core/locales/da.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/da.global.js rename to kalendar/packages/core/locales/da.global.js diff --git a/kalendar-novy/packages/core/locales/da.global.min.js b/kalendar/packages/core/locales/da.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/da.global.min.js rename to kalendar/packages/core/locales/da.global.min.js diff --git a/kalendar-novy/packages/core/locales/de-at.global.js b/kalendar/packages/core/locales/de-at.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/de-at.global.js rename to kalendar/packages/core/locales/de-at.global.js diff --git a/kalendar-novy/packages/core/locales/de-at.global.min.js b/kalendar/packages/core/locales/de-at.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/de-at.global.min.js rename to kalendar/packages/core/locales/de-at.global.min.js diff --git a/kalendar-novy/packages/core/locales/de.global.js b/kalendar/packages/core/locales/de.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/de.global.js rename to kalendar/packages/core/locales/de.global.js diff --git a/kalendar-novy/packages/core/locales/de.global.min.js b/kalendar/packages/core/locales/de.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/de.global.min.js rename to kalendar/packages/core/locales/de.global.min.js diff --git a/kalendar-novy/packages/core/locales/el.global.js b/kalendar/packages/core/locales/el.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/el.global.js rename to kalendar/packages/core/locales/el.global.js diff --git a/kalendar-novy/packages/core/locales/el.global.min.js b/kalendar/packages/core/locales/el.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/el.global.min.js rename to kalendar/packages/core/locales/el.global.min.js diff --git a/kalendar-novy/packages/core/locales/en-au.global.js b/kalendar/packages/core/locales/en-au.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/en-au.global.js rename to kalendar/packages/core/locales/en-au.global.js diff --git a/kalendar-novy/packages/core/locales/en-au.global.min.js b/kalendar/packages/core/locales/en-au.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/en-au.global.min.js rename to kalendar/packages/core/locales/en-au.global.min.js diff --git a/kalendar-novy/packages/core/locales/en-gb.global.js b/kalendar/packages/core/locales/en-gb.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/en-gb.global.js rename to kalendar/packages/core/locales/en-gb.global.js diff --git a/kalendar-novy/packages/core/locales/en-gb.global.min.js b/kalendar/packages/core/locales/en-gb.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/en-gb.global.min.js rename to kalendar/packages/core/locales/en-gb.global.min.js diff --git a/kalendar-novy/packages/core/locales/en-nz.global.js b/kalendar/packages/core/locales/en-nz.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/en-nz.global.js rename to kalendar/packages/core/locales/en-nz.global.js diff --git a/kalendar-novy/packages/core/locales/en-nz.global.min.js b/kalendar/packages/core/locales/en-nz.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/en-nz.global.min.js rename to kalendar/packages/core/locales/en-nz.global.min.js diff --git a/kalendar-novy/packages/core/locales/eo.global.js b/kalendar/packages/core/locales/eo.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/eo.global.js rename to kalendar/packages/core/locales/eo.global.js diff --git a/kalendar-novy/packages/core/locales/eo.global.min.js b/kalendar/packages/core/locales/eo.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/eo.global.min.js rename to kalendar/packages/core/locales/eo.global.min.js diff --git a/kalendar-novy/packages/core/locales/es-us.global.js b/kalendar/packages/core/locales/es-us.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/es-us.global.js rename to kalendar/packages/core/locales/es-us.global.js diff --git a/kalendar-novy/packages/core/locales/es-us.global.min.js b/kalendar/packages/core/locales/es-us.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/es-us.global.min.js rename to kalendar/packages/core/locales/es-us.global.min.js diff --git a/kalendar-novy/packages/core/locales/es.global.js b/kalendar/packages/core/locales/es.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/es.global.js rename to kalendar/packages/core/locales/es.global.js diff --git a/kalendar-novy/packages/core/locales/es.global.min.js b/kalendar/packages/core/locales/es.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/es.global.min.js rename to kalendar/packages/core/locales/es.global.min.js diff --git a/kalendar-novy/packages/core/locales/et.global.js b/kalendar/packages/core/locales/et.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/et.global.js rename to kalendar/packages/core/locales/et.global.js diff --git a/kalendar-novy/packages/core/locales/et.global.min.js b/kalendar/packages/core/locales/et.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/et.global.min.js rename to kalendar/packages/core/locales/et.global.min.js diff --git a/kalendar-novy/packages/core/locales/eu.global.js b/kalendar/packages/core/locales/eu.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/eu.global.js rename to kalendar/packages/core/locales/eu.global.js diff --git a/kalendar-novy/packages/core/locales/eu.global.min.js b/kalendar/packages/core/locales/eu.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/eu.global.min.js rename to kalendar/packages/core/locales/eu.global.min.js diff --git a/kalendar-novy/packages/core/locales/fa.global.js b/kalendar/packages/core/locales/fa.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/fa.global.js rename to kalendar/packages/core/locales/fa.global.js diff --git a/kalendar-novy/packages/core/locales/fa.global.min.js b/kalendar/packages/core/locales/fa.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/fa.global.min.js rename to kalendar/packages/core/locales/fa.global.min.js diff --git a/kalendar-novy/packages/core/locales/fi.global.js b/kalendar/packages/core/locales/fi.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/fi.global.js rename to kalendar/packages/core/locales/fi.global.js diff --git a/kalendar-novy/packages/core/locales/fi.global.min.js b/kalendar/packages/core/locales/fi.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/fi.global.min.js rename to kalendar/packages/core/locales/fi.global.min.js diff --git a/kalendar-novy/packages/core/locales/fr-ca.global.js b/kalendar/packages/core/locales/fr-ca.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/fr-ca.global.js rename to kalendar/packages/core/locales/fr-ca.global.js diff --git a/kalendar-novy/packages/core/locales/fr-ca.global.min.js b/kalendar/packages/core/locales/fr-ca.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/fr-ca.global.min.js rename to kalendar/packages/core/locales/fr-ca.global.min.js diff --git a/kalendar-novy/packages/core/locales/fr-ch.global.js b/kalendar/packages/core/locales/fr-ch.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/fr-ch.global.js rename to kalendar/packages/core/locales/fr-ch.global.js diff --git a/kalendar-novy/packages/core/locales/fr-ch.global.min.js b/kalendar/packages/core/locales/fr-ch.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/fr-ch.global.min.js rename to kalendar/packages/core/locales/fr-ch.global.min.js diff --git a/kalendar-novy/packages/core/locales/fr.global.js b/kalendar/packages/core/locales/fr.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/fr.global.js rename to kalendar/packages/core/locales/fr.global.js diff --git a/kalendar-novy/packages/core/locales/fr.global.min.js b/kalendar/packages/core/locales/fr.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/fr.global.min.js rename to kalendar/packages/core/locales/fr.global.min.js diff --git a/kalendar-novy/packages/core/locales/gl.global.js b/kalendar/packages/core/locales/gl.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/gl.global.js rename to kalendar/packages/core/locales/gl.global.js diff --git a/kalendar-novy/packages/core/locales/gl.global.min.js b/kalendar/packages/core/locales/gl.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/gl.global.min.js rename to kalendar/packages/core/locales/gl.global.min.js diff --git a/kalendar-novy/packages/core/locales/he.global.js b/kalendar/packages/core/locales/he.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/he.global.js rename to kalendar/packages/core/locales/he.global.js diff --git a/kalendar-novy/packages/core/locales/he.global.min.js b/kalendar/packages/core/locales/he.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/he.global.min.js rename to kalendar/packages/core/locales/he.global.min.js diff --git a/kalendar-novy/packages/core/locales/hi.global.js b/kalendar/packages/core/locales/hi.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/hi.global.js rename to kalendar/packages/core/locales/hi.global.js diff --git a/kalendar-novy/packages/core/locales/hi.global.min.js b/kalendar/packages/core/locales/hi.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/hi.global.min.js rename to kalendar/packages/core/locales/hi.global.min.js diff --git a/kalendar-novy/packages/core/locales/hr.global.js b/kalendar/packages/core/locales/hr.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/hr.global.js rename to kalendar/packages/core/locales/hr.global.js diff --git a/kalendar-novy/packages/core/locales/hr.global.min.js b/kalendar/packages/core/locales/hr.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/hr.global.min.js rename to kalendar/packages/core/locales/hr.global.min.js diff --git a/kalendar-novy/packages/core/locales/hu.global.js b/kalendar/packages/core/locales/hu.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/hu.global.js rename to kalendar/packages/core/locales/hu.global.js diff --git a/kalendar-novy/packages/core/locales/hu.global.min.js b/kalendar/packages/core/locales/hu.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/hu.global.min.js rename to kalendar/packages/core/locales/hu.global.min.js diff --git a/kalendar-novy/packages/core/locales/hy-am.global.js b/kalendar/packages/core/locales/hy-am.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/hy-am.global.js rename to kalendar/packages/core/locales/hy-am.global.js diff --git a/kalendar-novy/packages/core/locales/hy-am.global.min.js b/kalendar/packages/core/locales/hy-am.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/hy-am.global.min.js rename to kalendar/packages/core/locales/hy-am.global.min.js diff --git a/kalendar-novy/packages/core/locales/id.global.js b/kalendar/packages/core/locales/id.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/id.global.js rename to kalendar/packages/core/locales/id.global.js diff --git a/kalendar-novy/packages/core/locales/id.global.min.js b/kalendar/packages/core/locales/id.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/id.global.min.js rename to kalendar/packages/core/locales/id.global.min.js diff --git a/kalendar-novy/packages/core/locales/is.global.js b/kalendar/packages/core/locales/is.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/is.global.js rename to kalendar/packages/core/locales/is.global.js diff --git a/kalendar-novy/packages/core/locales/is.global.min.js b/kalendar/packages/core/locales/is.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/is.global.min.js rename to kalendar/packages/core/locales/is.global.min.js diff --git a/kalendar-novy/packages/core/locales/it.global.js b/kalendar/packages/core/locales/it.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/it.global.js rename to kalendar/packages/core/locales/it.global.js diff --git a/kalendar-novy/packages/core/locales/it.global.min.js b/kalendar/packages/core/locales/it.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/it.global.min.js rename to kalendar/packages/core/locales/it.global.min.js diff --git a/kalendar-novy/packages/core/locales/ja.global.js b/kalendar/packages/core/locales/ja.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/ja.global.js rename to kalendar/packages/core/locales/ja.global.js diff --git a/kalendar-novy/packages/core/locales/ja.global.min.js b/kalendar/packages/core/locales/ja.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/ja.global.min.js rename to kalendar/packages/core/locales/ja.global.min.js diff --git a/kalendar-novy/packages/core/locales/ka.global.js b/kalendar/packages/core/locales/ka.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/ka.global.js rename to kalendar/packages/core/locales/ka.global.js diff --git a/kalendar-novy/packages/core/locales/ka.global.min.js b/kalendar/packages/core/locales/ka.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/ka.global.min.js rename to kalendar/packages/core/locales/ka.global.min.js diff --git a/kalendar-novy/packages/core/locales/kk.global.js b/kalendar/packages/core/locales/kk.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/kk.global.js rename to kalendar/packages/core/locales/kk.global.js diff --git a/kalendar-novy/packages/core/locales/kk.global.min.js b/kalendar/packages/core/locales/kk.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/kk.global.min.js rename to kalendar/packages/core/locales/kk.global.min.js diff --git a/kalendar-novy/packages/core/locales/km.global.js b/kalendar/packages/core/locales/km.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/km.global.js rename to kalendar/packages/core/locales/km.global.js diff --git a/kalendar-novy/packages/core/locales/km.global.min.js b/kalendar/packages/core/locales/km.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/km.global.min.js rename to kalendar/packages/core/locales/km.global.min.js diff --git a/kalendar-novy/packages/core/locales/ko.global.js b/kalendar/packages/core/locales/ko.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/ko.global.js rename to kalendar/packages/core/locales/ko.global.js diff --git a/kalendar-novy/packages/core/locales/ko.global.min.js b/kalendar/packages/core/locales/ko.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/ko.global.min.js rename to kalendar/packages/core/locales/ko.global.min.js diff --git a/kalendar-novy/packages/core/locales/ku.global.js b/kalendar/packages/core/locales/ku.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/ku.global.js rename to kalendar/packages/core/locales/ku.global.js diff --git a/kalendar-novy/packages/core/locales/ku.global.min.js b/kalendar/packages/core/locales/ku.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/ku.global.min.js rename to kalendar/packages/core/locales/ku.global.min.js diff --git a/kalendar-novy/packages/core/locales/lb.global.js b/kalendar/packages/core/locales/lb.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/lb.global.js rename to kalendar/packages/core/locales/lb.global.js diff --git a/kalendar-novy/packages/core/locales/lb.global.min.js b/kalendar/packages/core/locales/lb.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/lb.global.min.js rename to kalendar/packages/core/locales/lb.global.min.js diff --git a/kalendar-novy/packages/core/locales/lt.global.js b/kalendar/packages/core/locales/lt.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/lt.global.js rename to kalendar/packages/core/locales/lt.global.js diff --git a/kalendar-novy/packages/core/locales/lt.global.min.js b/kalendar/packages/core/locales/lt.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/lt.global.min.js rename to kalendar/packages/core/locales/lt.global.min.js diff --git a/kalendar-novy/packages/core/locales/lv.global.js b/kalendar/packages/core/locales/lv.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/lv.global.js rename to kalendar/packages/core/locales/lv.global.js diff --git a/kalendar-novy/packages/core/locales/lv.global.min.js b/kalendar/packages/core/locales/lv.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/lv.global.min.js rename to kalendar/packages/core/locales/lv.global.min.js diff --git a/kalendar-novy/packages/core/locales/mk.global.js b/kalendar/packages/core/locales/mk.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/mk.global.js rename to kalendar/packages/core/locales/mk.global.js diff --git a/kalendar-novy/packages/core/locales/mk.global.min.js b/kalendar/packages/core/locales/mk.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/mk.global.min.js rename to kalendar/packages/core/locales/mk.global.min.js diff --git a/kalendar-novy/packages/core/locales/ms.global.js b/kalendar/packages/core/locales/ms.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/ms.global.js rename to kalendar/packages/core/locales/ms.global.js diff --git a/kalendar-novy/packages/core/locales/ms.global.min.js b/kalendar/packages/core/locales/ms.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/ms.global.min.js rename to kalendar/packages/core/locales/ms.global.min.js diff --git a/kalendar-novy/packages/core/locales/nb.global.js b/kalendar/packages/core/locales/nb.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/nb.global.js rename to kalendar/packages/core/locales/nb.global.js diff --git a/kalendar-novy/packages/core/locales/nb.global.min.js b/kalendar/packages/core/locales/nb.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/nb.global.min.js rename to kalendar/packages/core/locales/nb.global.min.js diff --git a/kalendar-novy/packages/core/locales/ne.global.js b/kalendar/packages/core/locales/ne.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/ne.global.js rename to kalendar/packages/core/locales/ne.global.js diff --git a/kalendar-novy/packages/core/locales/ne.global.min.js b/kalendar/packages/core/locales/ne.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/ne.global.min.js rename to kalendar/packages/core/locales/ne.global.min.js diff --git a/kalendar-novy/packages/core/locales/nl.global.js b/kalendar/packages/core/locales/nl.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/nl.global.js rename to kalendar/packages/core/locales/nl.global.js diff --git a/kalendar-novy/packages/core/locales/nl.global.min.js b/kalendar/packages/core/locales/nl.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/nl.global.min.js rename to kalendar/packages/core/locales/nl.global.min.js diff --git a/kalendar-novy/packages/core/locales/nn.global.js b/kalendar/packages/core/locales/nn.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/nn.global.js rename to kalendar/packages/core/locales/nn.global.js diff --git a/kalendar-novy/packages/core/locales/nn.global.min.js b/kalendar/packages/core/locales/nn.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/nn.global.min.js rename to kalendar/packages/core/locales/nn.global.min.js diff --git a/kalendar-novy/packages/core/locales/pl.global.js b/kalendar/packages/core/locales/pl.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/pl.global.js rename to kalendar/packages/core/locales/pl.global.js diff --git a/kalendar-novy/packages/core/locales/pl.global.min.js b/kalendar/packages/core/locales/pl.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/pl.global.min.js rename to kalendar/packages/core/locales/pl.global.min.js diff --git a/kalendar-novy/packages/core/locales/pt-br.global.js b/kalendar/packages/core/locales/pt-br.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/pt-br.global.js rename to kalendar/packages/core/locales/pt-br.global.js diff --git a/kalendar-novy/packages/core/locales/pt-br.global.min.js b/kalendar/packages/core/locales/pt-br.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/pt-br.global.min.js rename to kalendar/packages/core/locales/pt-br.global.min.js diff --git a/kalendar-novy/packages/core/locales/pt.global.js b/kalendar/packages/core/locales/pt.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/pt.global.js rename to kalendar/packages/core/locales/pt.global.js diff --git a/kalendar-novy/packages/core/locales/pt.global.min.js b/kalendar/packages/core/locales/pt.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/pt.global.min.js rename to kalendar/packages/core/locales/pt.global.min.js diff --git a/kalendar-novy/packages/core/locales/ro.global.js b/kalendar/packages/core/locales/ro.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/ro.global.js rename to kalendar/packages/core/locales/ro.global.js diff --git a/kalendar-novy/packages/core/locales/ro.global.min.js b/kalendar/packages/core/locales/ro.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/ro.global.min.js rename to kalendar/packages/core/locales/ro.global.min.js diff --git a/kalendar-novy/packages/core/locales/ru.global.js b/kalendar/packages/core/locales/ru.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/ru.global.js rename to kalendar/packages/core/locales/ru.global.js diff --git a/kalendar-novy/packages/core/locales/ru.global.min.js b/kalendar/packages/core/locales/ru.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/ru.global.min.js rename to kalendar/packages/core/locales/ru.global.min.js diff --git a/kalendar-novy/packages/core/locales/si-lk.global.js b/kalendar/packages/core/locales/si-lk.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/si-lk.global.js rename to kalendar/packages/core/locales/si-lk.global.js diff --git a/kalendar-novy/packages/core/locales/si-lk.global.min.js b/kalendar/packages/core/locales/si-lk.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/si-lk.global.min.js rename to kalendar/packages/core/locales/si-lk.global.min.js diff --git a/kalendar-novy/packages/core/locales/sk.global.js b/kalendar/packages/core/locales/sk.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/sk.global.js rename to kalendar/packages/core/locales/sk.global.js diff --git a/kalendar-novy/packages/core/locales/sk.global.min.js b/kalendar/packages/core/locales/sk.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/sk.global.min.js rename to kalendar/packages/core/locales/sk.global.min.js diff --git a/kalendar-novy/packages/core/locales/sl.global.js b/kalendar/packages/core/locales/sl.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/sl.global.js rename to kalendar/packages/core/locales/sl.global.js diff --git a/kalendar-novy/packages/core/locales/sl.global.min.js b/kalendar/packages/core/locales/sl.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/sl.global.min.js rename to kalendar/packages/core/locales/sl.global.min.js diff --git a/kalendar-novy/packages/core/locales/sm.global.js b/kalendar/packages/core/locales/sm.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/sm.global.js rename to kalendar/packages/core/locales/sm.global.js diff --git a/kalendar-novy/packages/core/locales/sm.global.min.js b/kalendar/packages/core/locales/sm.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/sm.global.min.js rename to kalendar/packages/core/locales/sm.global.min.js diff --git a/kalendar-novy/packages/core/locales/sq.global.js b/kalendar/packages/core/locales/sq.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/sq.global.js rename to kalendar/packages/core/locales/sq.global.js diff --git a/kalendar-novy/packages/core/locales/sq.global.min.js b/kalendar/packages/core/locales/sq.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/sq.global.min.js rename to kalendar/packages/core/locales/sq.global.min.js diff --git a/kalendar-novy/packages/core/locales/sr-cyrl.global.js b/kalendar/packages/core/locales/sr-cyrl.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/sr-cyrl.global.js rename to kalendar/packages/core/locales/sr-cyrl.global.js diff --git a/kalendar-novy/packages/core/locales/sr-cyrl.global.min.js b/kalendar/packages/core/locales/sr-cyrl.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/sr-cyrl.global.min.js rename to kalendar/packages/core/locales/sr-cyrl.global.min.js diff --git a/kalendar-novy/packages/core/locales/sr.global.js b/kalendar/packages/core/locales/sr.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/sr.global.js rename to kalendar/packages/core/locales/sr.global.js diff --git a/kalendar-novy/packages/core/locales/sr.global.min.js b/kalendar/packages/core/locales/sr.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/sr.global.min.js rename to kalendar/packages/core/locales/sr.global.min.js diff --git a/kalendar-novy/packages/core/locales/sv.global.js b/kalendar/packages/core/locales/sv.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/sv.global.js rename to kalendar/packages/core/locales/sv.global.js diff --git a/kalendar-novy/packages/core/locales/sv.global.min.js b/kalendar/packages/core/locales/sv.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/sv.global.min.js rename to kalendar/packages/core/locales/sv.global.min.js diff --git a/kalendar-novy/packages/core/locales/ta-in.global.js b/kalendar/packages/core/locales/ta-in.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/ta-in.global.js rename to kalendar/packages/core/locales/ta-in.global.js diff --git a/kalendar-novy/packages/core/locales/ta-in.global.min.js b/kalendar/packages/core/locales/ta-in.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/ta-in.global.min.js rename to kalendar/packages/core/locales/ta-in.global.min.js diff --git a/kalendar-novy/packages/core/locales/th.global.js b/kalendar/packages/core/locales/th.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/th.global.js rename to kalendar/packages/core/locales/th.global.js diff --git a/kalendar-novy/packages/core/locales/th.global.min.js b/kalendar/packages/core/locales/th.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/th.global.min.js rename to kalendar/packages/core/locales/th.global.min.js diff --git a/kalendar-novy/packages/core/locales/tr.global.js b/kalendar/packages/core/locales/tr.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/tr.global.js rename to kalendar/packages/core/locales/tr.global.js diff --git a/kalendar-novy/packages/core/locales/tr.global.min.js b/kalendar/packages/core/locales/tr.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/tr.global.min.js rename to kalendar/packages/core/locales/tr.global.min.js diff --git a/kalendar-novy/packages/core/locales/ug.global.js b/kalendar/packages/core/locales/ug.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/ug.global.js rename to kalendar/packages/core/locales/ug.global.js diff --git a/kalendar-novy/packages/core/locales/ug.global.min.js b/kalendar/packages/core/locales/ug.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/ug.global.min.js rename to kalendar/packages/core/locales/ug.global.min.js diff --git a/kalendar-novy/packages/core/locales/uk.global.js b/kalendar/packages/core/locales/uk.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/uk.global.js rename to kalendar/packages/core/locales/uk.global.js diff --git a/kalendar-novy/packages/core/locales/uk.global.min.js b/kalendar/packages/core/locales/uk.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/uk.global.min.js rename to kalendar/packages/core/locales/uk.global.min.js diff --git a/kalendar-novy/packages/core/locales/uz-cy.global.js b/kalendar/packages/core/locales/uz-cy.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/uz-cy.global.js rename to kalendar/packages/core/locales/uz-cy.global.js diff --git a/kalendar-novy/packages/core/locales/uz-cy.global.min.js b/kalendar/packages/core/locales/uz-cy.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/uz-cy.global.min.js rename to kalendar/packages/core/locales/uz-cy.global.min.js diff --git a/kalendar-novy/packages/core/locales/uz.global.js b/kalendar/packages/core/locales/uz.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/uz.global.js rename to kalendar/packages/core/locales/uz.global.js diff --git a/kalendar-novy/packages/core/locales/uz.global.min.js b/kalendar/packages/core/locales/uz.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/uz.global.min.js rename to kalendar/packages/core/locales/uz.global.min.js diff --git a/kalendar-novy/packages/core/locales/vi.global.js b/kalendar/packages/core/locales/vi.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/vi.global.js rename to kalendar/packages/core/locales/vi.global.js diff --git a/kalendar-novy/packages/core/locales/vi.global.min.js b/kalendar/packages/core/locales/vi.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/vi.global.min.js rename to kalendar/packages/core/locales/vi.global.min.js diff --git a/kalendar-novy/packages/core/locales/zh-cn.global.js b/kalendar/packages/core/locales/zh-cn.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/zh-cn.global.js rename to kalendar/packages/core/locales/zh-cn.global.js diff --git a/kalendar-novy/packages/core/locales/zh-cn.global.min.js b/kalendar/packages/core/locales/zh-cn.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/zh-cn.global.min.js rename to kalendar/packages/core/locales/zh-cn.global.min.js diff --git a/kalendar-novy/packages/core/locales/zh-tw.global.js b/kalendar/packages/core/locales/zh-tw.global.js similarity index 100% rename from kalendar-novy/packages/core/locales/zh-tw.global.js rename to kalendar/packages/core/locales/zh-tw.global.js diff --git a/kalendar-novy/packages/core/locales/zh-tw.global.min.js b/kalendar/packages/core/locales/zh-tw.global.min.js similarity index 100% rename from kalendar-novy/packages/core/locales/zh-tw.global.min.js rename to kalendar/packages/core/locales/zh-tw.global.min.js diff --git a/kalendar-novy/packages/daygrid/index.global.js b/kalendar/packages/daygrid/index.global.js similarity index 100% rename from kalendar-novy/packages/daygrid/index.global.js rename to kalendar/packages/daygrid/index.global.js diff --git a/kalendar-novy/packages/daygrid/index.global.min.js b/kalendar/packages/daygrid/index.global.min.js similarity index 100% rename from kalendar-novy/packages/daygrid/index.global.min.js rename to kalendar/packages/daygrid/index.global.min.js diff --git a/kalendar-novy/packages/google-calendar/index.global.js b/kalendar/packages/google-calendar/index.global.js similarity index 100% rename from kalendar-novy/packages/google-calendar/index.global.js rename to kalendar/packages/google-calendar/index.global.js diff --git a/kalendar-novy/packages/google-calendar/index.global.min.js b/kalendar/packages/google-calendar/index.global.min.js similarity index 100% rename from kalendar-novy/packages/google-calendar/index.global.min.js rename to kalendar/packages/google-calendar/index.global.min.js diff --git a/kalendar-novy/packages/icalendar/index.global.js b/kalendar/packages/icalendar/index.global.js similarity index 100% rename from kalendar-novy/packages/icalendar/index.global.js rename to kalendar/packages/icalendar/index.global.js diff --git a/kalendar-novy/packages/icalendar/index.global.min.js b/kalendar/packages/icalendar/index.global.min.js similarity index 100% rename from kalendar-novy/packages/icalendar/index.global.min.js rename to kalendar/packages/icalendar/index.global.min.js diff --git a/kalendar-novy/packages/interaction/index.global.js b/kalendar/packages/interaction/index.global.js similarity index 100% rename from kalendar-novy/packages/interaction/index.global.js rename to kalendar/packages/interaction/index.global.js diff --git a/kalendar-novy/packages/interaction/index.global.min.js b/kalendar/packages/interaction/index.global.min.js similarity index 100% rename from kalendar-novy/packages/interaction/index.global.min.js rename to kalendar/packages/interaction/index.global.min.js diff --git a/kalendar-novy/packages/list/index.global.js b/kalendar/packages/list/index.global.js similarity index 100% rename from kalendar-novy/packages/list/index.global.js rename to kalendar/packages/list/index.global.js diff --git a/kalendar-novy/packages/list/index.global.min.js b/kalendar/packages/list/index.global.min.js similarity index 100% rename from kalendar-novy/packages/list/index.global.min.js rename to kalendar/packages/list/index.global.min.js diff --git a/kalendar-novy/packages/luxon1/index.global.js b/kalendar/packages/luxon1/index.global.js similarity index 100% rename from kalendar-novy/packages/luxon1/index.global.js rename to kalendar/packages/luxon1/index.global.js diff --git a/kalendar-novy/packages/luxon1/index.global.min.js b/kalendar/packages/luxon1/index.global.min.js similarity index 100% rename from kalendar-novy/packages/luxon1/index.global.min.js rename to kalendar/packages/luxon1/index.global.min.js diff --git a/kalendar-novy/packages/luxon2/index.global.js b/kalendar/packages/luxon2/index.global.js similarity index 100% rename from kalendar-novy/packages/luxon2/index.global.js rename to kalendar/packages/luxon2/index.global.js diff --git a/kalendar-novy/packages/luxon2/index.global.min.js b/kalendar/packages/luxon2/index.global.min.js similarity index 100% rename from kalendar-novy/packages/luxon2/index.global.min.js rename to kalendar/packages/luxon2/index.global.min.js diff --git a/kalendar-novy/packages/luxon3/index.global.js b/kalendar/packages/luxon3/index.global.js similarity index 100% rename from kalendar-novy/packages/luxon3/index.global.js rename to kalendar/packages/luxon3/index.global.js diff --git a/kalendar-novy/packages/luxon3/index.global.min.js b/kalendar/packages/luxon3/index.global.min.js similarity index 100% rename from kalendar-novy/packages/luxon3/index.global.min.js rename to kalendar/packages/luxon3/index.global.min.js diff --git a/kalendar-novy/packages/moment-timezone/index.global.js b/kalendar/packages/moment-timezone/index.global.js similarity index 100% rename from kalendar-novy/packages/moment-timezone/index.global.js rename to kalendar/packages/moment-timezone/index.global.js diff --git a/kalendar-novy/packages/moment-timezone/index.global.min.js b/kalendar/packages/moment-timezone/index.global.min.js similarity index 100% rename from kalendar-novy/packages/moment-timezone/index.global.min.js rename to kalendar/packages/moment-timezone/index.global.min.js diff --git a/kalendar-novy/packages/moment/index.global.js b/kalendar/packages/moment/index.global.js similarity index 100% rename from kalendar-novy/packages/moment/index.global.js rename to kalendar/packages/moment/index.global.js diff --git a/kalendar-novy/packages/moment/index.global.min.js b/kalendar/packages/moment/index.global.min.js similarity index 100% rename from kalendar-novy/packages/moment/index.global.min.js rename to kalendar/packages/moment/index.global.min.js diff --git a/kalendar-novy/packages/multimonth/index.global.js b/kalendar/packages/multimonth/index.global.js similarity index 100% rename from kalendar-novy/packages/multimonth/index.global.js rename to kalendar/packages/multimonth/index.global.js diff --git a/kalendar-novy/packages/multimonth/index.global.min.js b/kalendar/packages/multimonth/index.global.min.js similarity index 100% rename from kalendar-novy/packages/multimonth/index.global.min.js rename to kalendar/packages/multimonth/index.global.min.js diff --git a/kalendar-novy/packages/rrule/index.global.js b/kalendar/packages/rrule/index.global.js similarity index 100% rename from kalendar-novy/packages/rrule/index.global.js rename to kalendar/packages/rrule/index.global.js diff --git a/kalendar-novy/packages/rrule/index.global.min.js b/kalendar/packages/rrule/index.global.min.js similarity index 100% rename from kalendar-novy/packages/rrule/index.global.min.js rename to kalendar/packages/rrule/index.global.min.js diff --git a/kalendar-novy/packages/timegrid/index.global.js b/kalendar/packages/timegrid/index.global.js similarity index 100% rename from kalendar-novy/packages/timegrid/index.global.js rename to kalendar/packages/timegrid/index.global.js diff --git a/kalendar-novy/packages/timegrid/index.global.min.js b/kalendar/packages/timegrid/index.global.min.js similarity index 100% rename from kalendar-novy/packages/timegrid/index.global.min.js rename to kalendar/packages/timegrid/index.global.min.js diff --git a/kalendar-novy/packages/web-component/index.global.js b/kalendar/packages/web-component/index.global.js similarity index 100% rename from kalendar-novy/packages/web-component/index.global.js rename to kalendar/packages/web-component/index.global.js diff --git a/kalendar-novy/packages/web-component/index.global.min.js b/kalendar/packages/web-component/index.global.min.js similarity index 100% rename from kalendar-novy/packages/web-component/index.global.min.js rename to kalendar/packages/web-component/index.global.min.js diff --git a/kategorie/agenda/index.html b/kategorie/agenda/index.html index 1e56fee..4a62cea 100644 --- a/kategorie/agenda/index.html +++ b/kategorie/agenda/index.html @@ -1,6 +1,6 @@ Tag: 📋 Agenda - NoLogWeb