fix scrolling
This commit is contained in:
parent
0b3112f81b
commit
1b6a71060a
5 changed files with 85 additions and 25 deletions
19
node_modules/.package-lock.json
generated
vendored
19
node_modules/.package-lock.json
generated
vendored
|
|
@ -15,6 +15,25 @@
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@fullcalendar/core": {
|
||||||
|
"version": "6.1.20",
|
||||||
|
"resolved": "https://registry.npmjs.org/@fullcalendar/core/-/core-6.1.20.tgz",
|
||||||
|
"integrity": "sha512-1cukXLlePFiJ8YKXn/4tMKsy0etxYLCkXk8nUCFi11nRONF2Ba2CD5b21/ovtOO2tL6afTJfwmc1ed3HG7eB1g==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"preact": "~10.12.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@fullcalendar/core/node_modules/preact": {
|
||||||
|
"version": "10.12.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/preact/-/preact-10.12.1.tgz",
|
||||||
|
"integrity": "sha512-l8386ixSsBdbreOAkqtrwqHwdvR35ID8c3rKPa8lCWuO86dBi32QWHV4vfsZK1utLLFMvw+Z5Ad4XLkZzchscg==",
|
||||||
|
"dev": true,
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/preact"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@jridgewell/gen-mapping": {
|
"node_modules/@jridgewell/gen-mapping": {
|
||||||
"version": "0.3.13",
|
"version": "0.3.13",
|
||||||
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
|
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
|
||||||
|
|
|
||||||
20
package-lock.json
generated
20
package-lock.json
generated
|
|
@ -6,6 +6,7 @@
|
||||||
"": {
|
"": {
|
||||||
"name": "riverside-therapeutics",
|
"name": "riverside-therapeutics",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@fullcalendar/core": "^6.1.20",
|
||||||
"htm": "^3.1.1",
|
"htm": "^3.1.1",
|
||||||
"preact": "^10.29.2",
|
"preact": "^10.29.2",
|
||||||
"tailwindcss": "^3.4.17",
|
"tailwindcss": "^3.4.17",
|
||||||
|
|
@ -24,6 +25,25 @@
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@fullcalendar/core": {
|
||||||
|
"version": "6.1.20",
|
||||||
|
"resolved": "https://registry.npmjs.org/@fullcalendar/core/-/core-6.1.20.tgz",
|
||||||
|
"integrity": "sha512-1cukXLlePFiJ8YKXn/4tMKsy0etxYLCkXk8nUCFi11nRONF2Ba2CD5b21/ovtOO2tL6afTJfwmc1ed3HG7eB1g==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"preact": "~10.12.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@fullcalendar/core/node_modules/preact": {
|
||||||
|
"version": "10.12.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/preact/-/preact-10.12.1.tgz",
|
||||||
|
"integrity": "sha512-l8386ixSsBdbreOAkqtrwqHwdvR35ID8c3rKPa8lCWuO86dBi32QWHV4vfsZK1utLLFMvw+Z5Ad4XLkZzchscg==",
|
||||||
|
"dev": true,
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/preact"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@jridgewell/gen-mapping": {
|
"node_modules/@jridgewell/gen-mapping": {
|
||||||
"version": "0.3.13",
|
"version": "0.3.13",
|
||||||
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
|
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,11 @@
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"watch": "tailwindcss -i ./web/modules/custom/riverside_pt/css/tailwind.css -o ./web/modules/custom/riverside_pt/css/app.css --watch",
|
"watch": "tailwindcss -i ./web/modules/custom/riverside_pt/css/tailwind.css -o ./web/modules/custom/riverside_pt/css/app.css --watch",
|
||||||
"build": "tailwindcss -i ./web/modules/custom/riverside_pt/css/tailwind.css -o ./web/modules/custom/riverside_pt/css/app.css --minify"
|
"build": "tailwindcss -i ./web/modules/custom/riverside_pt/css/tailwind.css -o ./web/modules/custom/riverside_pt/css/app.css --minify",
|
||||||
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@fullcalendar/core": "^6.1.20",
|
||||||
"htm": "^3.1.1",
|
"htm": "^3.1.1",
|
||||||
"preact": "^10.29.2",
|
"preact": "^10.29.2",
|
||||||
"tailwindcss": "^3.4.17",
|
"tailwindcss": "^3.4.17",
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,7 @@ function BookingPanel({ service, settings }) {
|
||||||
|
|
||||||
dayCellClassNames: function (/** @type {any} */ arg) {
|
dayCellClassNames: function (/** @type {any} */ arg) {
|
||||||
var date = arg.date.toISOString().substring(0, 10);
|
var date = arg.date.toISOString().substring(0, 10);
|
||||||
if (settings.holidays[date]) return ["is-holiday"];
|
return settings.holidays[date] ? ["is-holiday"] : [];
|
||||||
},
|
},
|
||||||
|
|
||||||
dateClick: function (/** @type {any} */ arg) {
|
dateClick: function (/** @type {any} */ arg) {
|
||||||
|
|
@ -221,7 +221,9 @@ function BookingPanel({ service, settings }) {
|
||||||
cal.render();
|
cal.render();
|
||||||
calRef.current = cal;
|
calRef.current = cal;
|
||||||
|
|
||||||
window.rptScrollTo(cal, true);
|
requestAnimationFrame(() => {
|
||||||
|
window.rptScrollTo(rootEl, true);
|
||||||
|
})
|
||||||
|
|
||||||
return function () { cal.destroy(); };
|
return function () { cal.destroy(); };
|
||||||
}, []);
|
}, []);
|
||||||
|
|
|
||||||
23
web/modules/custom/riverside_pt/js/globals.d.ts
vendored
23
web/modules/custom/riverside_pt/js/globals.d.ts
vendored
|
|
@ -1,3 +1,6 @@
|
||||||
|
import type { Calendar } from "@fullcalendar/core";
|
||||||
|
|
||||||
|
declare global {
|
||||||
interface RiversidePtSettings {
|
interface RiversidePtSettings {
|
||||||
eventsUrl: string;
|
eventsUrl: string;
|
||||||
storeSlotUrl: string;
|
storeSlotUrl: string;
|
||||||
|
|
@ -14,12 +17,26 @@ interface RiversidePtEvent {
|
||||||
startStr?: string;
|
startStr?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface ConfirmedAppointment {
|
||||||
|
start: string;
|
||||||
|
service: string;
|
||||||
|
firstName: string;
|
||||||
|
lastName: string;
|
||||||
|
email: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
// FullCalendar is loaded as a UMD global. The Calendar constructor accepts
|
||||||
|
// any options object because plugin-specific options (e.g. dateClick from
|
||||||
|
// @fullcalendar/interaction) are not reflected in @fullcalendar/core types.
|
||||||
|
namespace FullCalendar {
|
||||||
|
const Calendar: new (el: HTMLElement, options?: Record<string, any>) => Calendar;
|
||||||
|
}
|
||||||
|
|
||||||
interface Window {
|
interface Window {
|
||||||
FullCalendar?: any;
|
FullCalendar?: typeof FullCalendar;
|
||||||
rptScrollTo: (el: Element, animate?: boolean) => void;
|
rptScrollTo: (el: Element, animate?: boolean) => void;
|
||||||
drupalSettings?: {
|
drupalSettings?: {
|
||||||
riversidePt?: RiversidePtSettings;
|
riversidePt?: RiversidePtSettings;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
declare const FullCalendar: any;
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue