index.ts 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834
  1. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  2. import { formats } from "dayjs/locale/*";
  3. import Ressource from "../src/Ressource";
  4. import TimeLine from "../src/Timeline";
  5. import "../src/Ressource";
  6. import { IEvent } from "../src/Event";
  7. import dayjs from "dayjs";
  8. const container = document.createElement("div");
  9. document.body.appendChild(container);
  10. // TimeLine.extendStyle.push(new_css)
  11. const emptyTimeline: TimeLine = document.createElement("jc-timeline") as TimeLine;
  12. let title = document.createElement("h2");
  13. title.innerText = "Empty Timeline";
  14. container.appendChild(title);
  15. container.appendChild(emptyTimeline);
  16. emptyTimeline.setLegendUnitFormat("d", "dddd D MMMM");
  17. emptyTimeline.setAttribute("legendSpan", "2");
  18. emptyTimeline.setAttribute("slotduration", "30");
  19. emptyTimeline.setAttribute("slotWidth", "30");
  20. emptyTimeline.end = "2021-09-12T15:59:59.999Z";
  21. emptyTimeline.start = "2021-09-10T13:00:00.000Z";
  22. const timeline: TimeLine = document.createElement("jc-timeline") as TimeLine;
  23. timeline.customStyle = `.bubble{
  24. height: 20px;
  25. width: 20px;
  26. display: flex;
  27. justify-content: center;
  28. align-items: center;
  29. position: absolute;
  30. right: -4px;
  31. bottom: -4px;
  32. border-radius: 50%;
  33. font-size: 12px;
  34. font-weight: bold;
  35. background: green;
  36. }
  37. bubble.red{
  38. background: red;
  39. }
  40. bubble.orange{
  41. background: orange;
  42. }`;
  43. // timeline.defaultBackground = "maroon";
  44. const rows: Array<Ressource> = [
  45. { id: "1", title: "Ressource 1 DarkSlate", eventBgColor: "DarkSlateBlue" },
  46. { id: "3", title: "Ressource 3" },
  47. { id: "4", title: "Ressource 4" },
  48. { id: "5", title: "Ressource 5" },
  49. ].map((i) => new Ressource(i));
  50. rows[2].parent = rows[1];
  51. rows[0].parent = rows[1];
  52. const data = dayjs().startOf("hour").hour(9);
  53. const timeslots: Array<IEvent> = [
  54. {
  55. id: "1",
  56. title: "Fixed ressource",
  57. ressourceId: "3",
  58. start: data.subtract(3, "h").toDate(),
  59. end: data.toDate(),
  60. ressourceEditable: false,
  61. bgColor: "darkgreen",
  62. },
  63. {
  64. id: "2",
  65. title: "Fixed time",
  66. ressourceId: "3",
  67. start: data.toDate(),
  68. end: data.endOf("hour").add(1, "h").toDate(),
  69. editable: false,
  70. bgColor: "FireBrick",
  71. },
  72. {
  73. id: "3",
  74. ressourceId: "4",
  75. start: data.add(1, "h").toDate(),
  76. end: data.endOf("hour").add(2, "h").toDate(),
  77. content: '<div class="bubble">0</div>',
  78. },
  79. {
  80. id: "4",
  81. ressourceId: "3",
  82. start: data.startOf("day").subtract(1, "h").toDate(),
  83. end: dayjs().endOf("hour").add(1, "h").toDate(),
  84. },
  85. ];
  86. for (let i = 5; i < 10; i++) {
  87. timeslots.push({
  88. id: i.toFixed(0),
  89. title: "event " + i,
  90. ressourceId: "1",
  91. start: data.add(i, "h").toDate(),
  92. end: data.add(i, "h").endOf("hour").add(1, "h").toDate(),
  93. });
  94. }
  95. timeline.addRessource(rows[1]);
  96. timeline.addRessource(rows[0]);
  97. timeline.addRessource(rows[2]);
  98. timeline.addRessource(rows[3]);
  99. timeline.addEvents(timeslots);
  100. timeline.addEventListener("item-selected", (e) => {
  101. console.log((e as CustomEvent).detail);
  102. });
  103. timeline.addEventListener("change-event", (e) => {
  104. console.log((e as CustomEvent).detail);
  105. });
  106. timeline.addEventListener("reorder-ressource", (e) => {
  107. console.log((e as CustomEvent).detail);
  108. });
  109. title = document.createElement("h2");
  110. title.innerText = "Generic Timeline";
  111. container.appendChild(title);
  112. container.appendChild(timeline);
  113. const nestedTimeline: TimeLine = document.createElement("jc-timeline") as TimeLine;
  114. title = document.createElement("h2");
  115. title.innerText = "Multiple level Timeline";
  116. container.appendChild(title);
  117. container.appendChild(nestedTimeline);
  118. const ressources = Array(8)
  119. .fill(0)
  120. .map((_, i) => new Ressource({ id: "" + i, title: "level " + i }));
  121. for (let i = 0; i < ressources.length - 1; i++) {
  122. ressources[i + 1].parent = ressources[i];
  123. }
  124. ressources.forEach((r, idx) => nestedTimeline.addRessource(r, idx));
  125. ressources[0].collapseChildren = true;
  126. const nItem = 32;
  127. const timeslots2 = Array(nItem)
  128. .fill(0)
  129. .map((_, i) => {
  130. return {
  131. id: "" + i,
  132. ressourceId: "" + (i % 8),
  133. title: "Item " + i,
  134. start: data.add(i / 2 - 5, "h").toDate(),
  135. end: data.add(i / 2 - 4, "h").toDate(),
  136. bgColor: "hsl(" + Math.round((i / (nItem - 1)) * 360) + ", 100%, 50%)",
  137. };
  138. });
  139. nestedTimeline.addEvents(timeslots2);
  140. nestedTimeline.style.display = "flex";
  141. nestedTimeline.style.flexDirection = "column";
  142. nestedTimeline.style.height = "200px";
  143. const nestedInsertionTest: TimeLine = document.createElement("jc-timeline") as TimeLine;
  144. title = document.createElement("h2");
  145. title.innerText = "Insertion Test Timeline";
  146. container.appendChild(title);
  147. container.appendChild(nestedInsertionTest);
  148. for (let i = 0; i < 2; i++) {
  149. const parentRessource = new Ressource({ id: "Parent-" + i });
  150. nestedInsertionTest.addRessource(new Ressource({ id: "child " + i, parent: parentRessource }));
  151. nestedInsertionTest.addRessource(
  152. new Ressource({ id: "above " + i, parent: parentRessource }),
  153. nestedInsertionTest.getRessources().findIndex((o) => o.id == "child " + i)
  154. );
  155. nestedInsertionTest.addRessource(
  156. new Ressource({ id: "below " + i, parent: parentRessource }),
  157. nestedInsertionTest.getRessources().findIndex((o) => o.id == "child " + i) + 2
  158. );
  159. }
  160. const p = document.createElement("p");
  161. p.innerHTML = nestedInsertionTest
  162. .getRessources()
  163. .map((o) => o.id)
  164. .join(", ");
  165. container.appendChild(p);
  166. const BDLGRessourcesJSON = [
  167. {
  168. id: "e75a6a93-2e42-4eda-a27a-9a7656520374",
  169. title: "Jeudi",
  170. collapseChildren: true,
  171. parentId: "",
  172. height: 37,
  173. eventEditable: true,
  174. eventRessourceEditable: true,
  175. },
  176. {
  177. id: "c430b166-26d7-47c6-88c1-00b2576ef596",
  178. title: "Cuisine",
  179. collapseChildren: false,
  180. parentId: "e75a6a93-2e42-4eda-a27a-9a7656520374",
  181. height: 64,
  182. eventEditable: true,
  183. eventRessourceEditable: true,
  184. },
  185. {
  186. id: "41ac89c8-b276-4f07-a007-e49eff43d4ec",
  187. title: "Courses",
  188. collapseChildren: false,
  189. parentId: "e75a6a93-2e42-4eda-a27a-9a7656520374",
  190. height: 64,
  191. eventEditable: true,
  192. eventRessourceEditable: true,
  193. },
  194. {
  195. id: "e620b785-3b8c-40b1-a12e-9c81ad1d83a7",
  196. title: "Vendredi matin",
  197. collapseChildren: true,
  198. parentId: "",
  199. height: 37,
  200. eventEditable: true,
  201. eventRessourceEditable: true,
  202. },
  203. {
  204. id: "aaf82af8-e5bd-4eda-ad11-11325d8bfff3",
  205. title: "Camion",
  206. collapseChildren: false,
  207. parentId: "e620b785-3b8c-40b1-a12e-9c81ad1d83a7",
  208. height: 64,
  209. eventEditable: true,
  210. eventRessourceEditable: true,
  211. },
  212. {
  213. id: "a8242094-ca7b-430e-bfe2-d0992ec0ec5f",
  214. title: "Bouffe",
  215. collapseChildren: false,
  216. parentId: "e620b785-3b8c-40b1-a12e-9c81ad1d83a7",
  217. height: 64,
  218. eventEditable: true,
  219. eventRessourceEditable: true,
  220. },
  221. {
  222. id: "392c0e7a-4212-4302-a0c7-75edddfbe70f",
  223. title: "Vendredi aprem",
  224. collapseChildren: true,
  225. parentId: "",
  226. height: 37,
  227. eventEditable: true,
  228. eventRessourceEditable: true,
  229. },
  230. {
  231. id: "625615c3-c867-4e24-b42d-3a416cfa1f11",
  232. title: "Ailleurs",
  233. collapseChildren: false,
  234. parentId: "392c0e7a-4212-4302-a0c7-75edddfbe70f",
  235. height: 64,
  236. eventEditable: true,
  237. eventRessourceEditable: true,
  238. },
  239. {
  240. id: "c078ef3d-1750-4b95-9762-383231494d19",
  241. title: "Durante",
  242. collapseChildren: false,
  243. parentId: "392c0e7a-4212-4302-a0c7-75edddfbe70f",
  244. height: 32,
  245. eventEditable: true,
  246. eventRessourceEditable: true,
  247. },
  248. {
  249. id: "2bb9657a-931c-419c-8d4d-7a8bb46306d5",
  250. title: "B&B",
  251. collapseChildren: false,
  252. parentId: "c078ef3d-1750-4b95-9762-383231494d19",
  253. height: 96,
  254. eventEditable: true,
  255. eventRessourceEditable: true,
  256. },
  257. {
  258. id: "c6ec3e95-0500-458d-9685-161aee41661a",
  259. title: "Vendredi soir",
  260. collapseChildren: true,
  261. parentId: "",
  262. height: 37,
  263. eventEditable: true,
  264. eventRessourceEditable: true,
  265. },
  266. {
  267. id: "1f8cf338-0e0c-4208-ae6a-12fc6d55ae87",
  268. title: "Logistique",
  269. collapseChildren: false,
  270. parentId: "c6ec3e95-0500-458d-9685-161aee41661a",
  271. height: 32,
  272. eventEditable: true,
  273. eventRessourceEditable: true,
  274. },
  275. {
  276. id: "0294990b-a5e9-492e-a8d7-01fb957ec6d6",
  277. title: "Nettoyage",
  278. collapseChildren: false,
  279. parentId: "c6ec3e95-0500-458d-9685-161aee41661a",
  280. height: 32,
  281. eventEditable: true,
  282. eventRessourceEditable: true,
  283. },
  284. {
  285. id: "534f5589-89b6-45d5-bfc1-b6746aedfdb4",
  286. title: "Bar/Bouffe",
  287. collapseChildren: false,
  288. parentId: "c6ec3e95-0500-458d-9685-161aee41661a",
  289. height: 32,
  290. eventEditable: true,
  291. eventRessourceEditable: true,
  292. },
  293. {
  294. id: "45dc9ce5-0ba2-4812-a8f7-56f3d0d44f24",
  295. title: "Service et rangement",
  296. collapseChildren: false,
  297. parentId: "534f5589-89b6-45d5-bfc1-b6746aedfdb4",
  298. height: 64,
  299. eventEditable: true,
  300. eventRessourceEditable: true,
  301. },
  302. {
  303. id: "03e22851-16f4-4628-a836-802ab4b1900e",
  304. title: "Bar",
  305. collapseChildren: false,
  306. parentId: "534f5589-89b6-45d5-bfc1-b6746aedfdb4",
  307. height: 32,
  308. eventEditable: true,
  309. eventRessourceEditable: true,
  310. },
  311. {
  312. id: "37b2875c-206b-462b-87d8-df4fc79e6b7b",
  313. title: "Autowash",
  314. collapseChildren: false,
  315. parentId: "534f5589-89b6-45d5-bfc1-b6746aedfdb4",
  316. height: 32,
  317. eventEditable: true,
  318. eventRessourceEditable: true,
  319. },
  320. {
  321. id: "999ff318-e777-4632-908e-4085c53b166e",
  322. title: "Samedi - matin et aprem",
  323. collapseChildren: true,
  324. parentId: "",
  325. height: 37,
  326. eventEditable: true,
  327. eventRessourceEditable: true,
  328. },
  329. {
  330. id: "e612d448-9b49-4e2e-8821-0d97d63346b6",
  331. title: "Bénévolant",
  332. collapseChildren: false,
  333. parentId: "999ff318-e777-4632-908e-4085c53b166e",
  334. height: 32,
  335. eventEditable: true,
  336. eventRessourceEditable: true,
  337. },
  338. {
  339. id: "f76b3e55-3515-45e4-8f59-c2d5238ffc2a",
  340. title: "Bouffe midi",
  341. collapseChildren: false,
  342. parentId: "999ff318-e777-4632-908e-4085c53b166e",
  343. height: 64,
  344. eventEditable: true,
  345. eventRessourceEditable: true,
  346. },
  347. {
  348. id: "cd8e781e-0ef0-4b93-89dd-4d161065c006",
  349. title: "Bouffe soir",
  350. collapseChildren: false,
  351. parentId: "999ff318-e777-4632-908e-4085c53b166e",
  352. height: 32,
  353. eventEditable: true,
  354. eventRessourceEditable: true,
  355. },
  356. {
  357. id: "98136594-1181-4b2b-8e43-b94393ee720a",
  358. title: "Anim pour enfants",
  359. collapseChildren: false,
  360. parentId: "999ff318-e777-4632-908e-4085c53b166e",
  361. height: 64,
  362. eventEditable: true,
  363. eventRessourceEditable: true,
  364. },
  365. {
  366. id: "a4cf3f1d-331b-4db8-bd53-8c101dc3a5fa",
  367. title: "Camions",
  368. collapseChildren: false,
  369. parentId: "999ff318-e777-4632-908e-4085c53b166e",
  370. height: 64,
  371. eventEditable: true,
  372. eventRessourceEditable: true,
  373. },
  374. {
  375. id: "db450e53-1b10-41f7-8fe1-a9551491af1d",
  376. title: "Durante",
  377. collapseChildren: false,
  378. parentId: "999ff318-e777-4632-908e-4085c53b166e",
  379. height: 64,
  380. eventEditable: true,
  381. eventRessourceEditable: true,
  382. },
  383. {
  384. id: "12aad644-7629-4042-84c6-2553b11ac31c",
  385. title: "Jouages",
  386. collapseChildren: false,
  387. parentId: "999ff318-e777-4632-908e-4085c53b166e",
  388. height: 64,
  389. eventEditable: true,
  390. eventRessourceEditable: true,
  391. },
  392. {
  393. id: "c9cdd3ca-ddb4-4b35-9258-135b761f8ad2",
  394. title: "Install JdP",
  395. collapseChildren: true,
  396. parentId: "999ff318-e777-4632-908e-4085c53b166e",
  397. height: 37,
  398. eventEditable: true,
  399. eventRessourceEditable: true,
  400. },
  401. {
  402. id: "00c17d2f-b501-4c14-b640-fecc368aeee8",
  403. title: "Déco",
  404. collapseChildren: false,
  405. parentId: "c9cdd3ca-ddb4-4b35-9258-135b761f8ad2",
  406. height: 64,
  407. eventEditable: true,
  408. eventRessourceEditable: true,
  409. },
  410. {
  411. id: "364e07ab-324c-4f8e-94b2-ecb055e20dcc",
  412. title: "Tout sauf déco",
  413. collapseChildren: false,
  414. parentId: "c9cdd3ca-ddb4-4b35-9258-135b761f8ad2",
  415. height: 32,
  416. eventEditable: true,
  417. eventRessourceEditable: true,
  418. },
  419. {
  420. id: "20448469-9e4e-4f47-9cae-b97399322ce9",
  421. title: "Samedi - Bar",
  422. collapseChildren: true,
  423. parentId: "",
  424. height: 37,
  425. eventEditable: true,
  426. eventRessourceEditable: true,
  427. },
  428. {
  429. id: "a3fad595-141a-42a4-9dcc-a4c10c092862",
  430. title: "Créneaux",
  431. collapseChildren: false,
  432. parentId: "20448469-9e4e-4f47-9cae-b97399322ce9",
  433. height: 32,
  434. eventEditable: true,
  435. eventRessourceEditable: true,
  436. },
  437. {
  438. id: "16b9d771-b992-4a3a-ad56-a664088c5b81",
  439. title: "Respo",
  440. collapseChildren: false,
  441. parentId: "20448469-9e4e-4f47-9cae-b97399322ce9",
  442. height: 32,
  443. eventEditable: true,
  444. eventRessourceEditable: true,
  445. },
  446. {
  447. id: "4555a9a2-6474-4777-ba34-cef75392a72f",
  448. title: "Equipe 2 - Trous",
  449. collapseChildren: false,
  450. parentId: "a3fad595-141a-42a4-9dcc-a4c10c092862",
  451. height: 32,
  452. eventEditable: true,
  453. eventRessourceEditable: true,
  454. },
  455. {
  456. id: "791c6e07-abf7-44c8-9cd2-4c8169ee72ad",
  457. title: "Equipe 3 - MC",
  458. collapseChildren: false,
  459. parentId: "a3fad595-141a-42a4-9dcc-a4c10c092862",
  460. height: 32,
  461. eventEditable: true,
  462. eventRessourceEditable: true,
  463. },
  464. {
  465. id: "ab1b6704-4860-4edf-812b-7fd46764d523",
  466. title: "Equipe 4 - MC",
  467. collapseChildren: false,
  468. parentId: "a3fad595-141a-42a4-9dcc-a4c10c092862",
  469. height: 32,
  470. eventEditable: true,
  471. eventRessourceEditable: true,
  472. },
  473. {
  474. id: "976d059e-0b05-4966-9191-7c5ab88d3cc9",
  475. title: "Equipe 5",
  476. collapseChildren: false,
  477. parentId: "a3fad595-141a-42a4-9dcc-a4c10c092862",
  478. height: 32,
  479. eventEditable: true,
  480. eventRessourceEditable: true,
  481. },
  482. {
  483. id: "b153bb3d-94c7-4663-b26c-f8ca5881f933",
  484. title: "Equipe 6",
  485. collapseChildren: false,
  486. parentId: "a3fad595-141a-42a4-9dcc-a4c10c092862",
  487. height: 32,
  488. eventEditable: true,
  489. eventRessourceEditable: true,
  490. },
  491. {
  492. id: "6133f048-f22e-469c-a2f9-77fa3b7a9ef6",
  493. title: "Equipe 7 - DP",
  494. collapseChildren: false,
  495. parentId: "a3fad595-141a-42a4-9dcc-a4c10c092862",
  496. height: 32,
  497. eventEditable: true,
  498. eventRessourceEditable: true,
  499. },
  500. {
  501. id: "b8e7c9ae-904d-4b46-8258-053494581cc5",
  502. title: "Equipe 1 - Trous",
  503. collapseChildren: false,
  504. parentId: "a3fad595-141a-42a4-9dcc-a4c10c092862",
  505. height: 32,
  506. eventEditable: true,
  507. eventRessourceEditable: true,
  508. },
  509. {
  510. id: "95453fcb-adf5-479c-9216-6eb92fe7890f",
  511. title: "Samedi soirée",
  512. collapseChildren: true,
  513. parentId: "",
  514. height: 37,
  515. eventEditable: true,
  516. eventRessourceEditable: true,
  517. },
  518. {
  519. id: "6d0201b2-cf07-4127-9c8b-c3caf668bf43",
  520. title: "Animation du concert",
  521. collapseChildren: false,
  522. parentId: "95453fcb-adf5-479c-9216-6eb92fe7890f",
  523. height: 32,
  524. eventEditable: true,
  525. eventRessourceEditable: true,
  526. },
  527. {
  528. id: "b11414b8-da91-461f-b0f6-6de7c13191b8",
  529. title: "Contrôle/sécu",
  530. collapseChildren: false,
  531. parentId: "95453fcb-adf5-479c-9216-6eb92fe7890f",
  532. height: 32,
  533. eventEditable: true,
  534. eventRessourceEditable: true,
  535. },
  536. {
  537. id: "65503723-42e5-4786-abc2-03169dd05861",
  538. title: "Bénévolant",
  539. collapseChildren: false,
  540. parentId: "95453fcb-adf5-479c-9216-6eb92fe7890f",
  541. height: 32,
  542. eventEditable: true,
  543. eventRessourceEditable: true,
  544. },
  545. {
  546. id: "3404db13-a3bb-48b7-9e52-3aeeca1cd683",
  547. title: "Chiottes",
  548. collapseChildren: false,
  549. parentId: "95453fcb-adf5-479c-9216-6eb92fe7890f",
  550. height: 32,
  551. eventEditable: true,
  552. eventRessourceEditable: true,
  553. },
  554. {
  555. id: "c38f5666-009e-44ce-9827-eb2ed8350cda",
  556. title: "Bouffe/Catering",
  557. collapseChildren: false,
  558. parentId: "95453fcb-adf5-479c-9216-6eb92fe7890f",
  559. height: 32,
  560. eventEditable: true,
  561. eventRessourceEditable: true,
  562. },
  563. {
  564. id: "c626d516-128e-4321-a842-6bd6311b228a",
  565. title: "Stands",
  566. collapseChildren: false,
  567. parentId: "95453fcb-adf5-479c-9216-6eb92fe7890f",
  568. height: 64,
  569. eventEditable: true,
  570. eventRessourceEditable: true,
  571. },
  572. {
  573. id: "78d6cdba-379b-4d87-8a48-764f05124eb4",
  574. title: "Animation Battle",
  575. collapseChildren: false,
  576. parentId: "95453fcb-adf5-479c-9216-6eb92fe7890f",
  577. height: 64,
  578. eventEditable: true,
  579. eventRessourceEditable: true,
  580. },
  581. {
  582. id: "db2358d2-9064-4c03-9410-a3be72930850",
  583. title: "Rangement",
  584. collapseChildren: false,
  585. parentId: "95453fcb-adf5-479c-9216-6eb92fe7890f",
  586. height: 32,
  587. eventEditable: true,
  588. eventRessourceEditable: true,
  589. },
  590. {
  591. id: "e5a524a5-3a2e-4b8a-91cc-2903ff5bf813",
  592. title: "Retour camions",
  593. collapseChildren: false,
  594. parentId: "db2358d2-9064-4c03-9410-a3be72930850",
  595. height: 128,
  596. eventEditable: true,
  597. eventRessourceEditable: true,
  598. },
  599. {
  600. id: "c3558135-73ec-421b-b258-e0fafdeda5ca",
  601. title: "Rangement jardin",
  602. collapseChildren: false,
  603. parentId: "db2358d2-9064-4c03-9410-a3be72930850",
  604. height: 32,
  605. eventEditable: true,
  606. eventRessourceEditable: true,
  607. },
  608. {
  609. id: "91a3a408-3c11-4d88-a19f-6f4db4f7b4fd",
  610. title: "Déco",
  611. collapseChildren: false,
  612. parentId: "db2358d2-9064-4c03-9410-a3be72930850",
  613. height: 96,
  614. eventEditable: true,
  615. eventRessourceEditable: true,
  616. },
  617. {
  618. id: "2d5a42e6-c8ba-4f92-851c-99b8c6a2569f",
  619. title: "Catering",
  620. collapseChildren: false,
  621. parentId: "db2358d2-9064-4c03-9410-a3be72930850",
  622. height: 32,
  623. eventEditable: true,
  624. eventRessourceEditable: true,
  625. },
  626. {
  627. id: "490be86c-af6e-496c-bb88-eaa391ba9c41",
  628. title: "Bon appétit",
  629. collapseChildren: false,
  630. parentId: "c38f5666-009e-44ce-9827-eb2ed8350cda",
  631. height: 32,
  632. eventEditable: true,
  633. eventRessourceEditable: true,
  634. },
  635. {
  636. id: "c190615f-7876-4076-8d92-cbfb429bc300",
  637. title: "Service",
  638. collapseChildren: false,
  639. parentId: "c38f5666-009e-44ce-9827-eb2ed8350cda",
  640. height: 32,
  641. eventEditable: true,
  642. eventRessourceEditable: true,
  643. },
  644. {
  645. id: "cf9a242e-3c7e-465d-912a-2f9621a813b5",
  646. title: "Auto wash",
  647. collapseChildren: false,
  648. parentId: "c38f5666-009e-44ce-9827-eb2ed8350cda",
  649. height: 32,
  650. eventEditable: true,
  651. eventRessourceEditable: true,
  652. },
  653. {
  654. id: "cfc7c988-9053-4180-9926-aaa1f7619593",
  655. title: "Entrée",
  656. collapseChildren: false,
  657. parentId: "b11414b8-da91-461f-b0f6-6de7c13191b8",
  658. height: 32,
  659. eventEditable: true,
  660. eventRessourceEditable: true,
  661. },
  662. {
  663. id: "e0a7e95f-14b3-404c-9ebf-01771078a86c",
  664. title: "Catering",
  665. collapseChildren: false,
  666. parentId: "b11414b8-da91-461f-b0f6-6de7c13191b8",
  667. height: 32,
  668. eventEditable: true,
  669. eventRessourceEditable: true,
  670. },
  671. {
  672. id: "38473bdf-ae41-4f12-b1ab-104923641aa3",
  673. title: "Ronde jardin",
  674. collapseChildren: false,
  675. parentId: "b11414b8-da91-461f-b0f6-6de7c13191b8",
  676. height: 32,
  677. eventEditable: true,
  678. eventRessourceEditable: true,
  679. },
  680. {
  681. id: "af780520-2c1c-411c-b56b-76490bd25640",
  682. title: "Dimanche",
  683. collapseChildren: true,
  684. parentId: "",
  685. height: 37,
  686. eventEditable: true,
  687. eventRessourceEditable: true,
  688. },
  689. {
  690. id: "17ec3478-dfba-48a7-ae39-1c5b36ffa350",
  691. title: "Rangement final",
  692. collapseChildren: false,
  693. parentId: "af780520-2c1c-411c-b56b-76490bd25640",
  694. height: 32,
  695. eventEditable: true,
  696. eventRessourceEditable: true,
  697. },
  698. {
  699. id: "b0c6994f-2228-4e7d-9726-bdf16ce4d233",
  700. title: "Camions",
  701. collapseChildren: false,
  702. parentId: "af780520-2c1c-411c-b56b-76490bd25640",
  703. height: 96,
  704. eventEditable: true,
  705. eventRessourceEditable: true,
  706. },
  707. {
  708. id: "75da5b10-96a9-4e50-b030-e10bc66142e1",
  709. title: "Catering",
  710. collapseChildren: false,
  711. parentId: "af780520-2c1c-411c-b56b-76490bd25640",
  712. height: 32,
  713. eventEditable: true,
  714. eventRessourceEditable: true,
  715. },
  716. {
  717. id: "1f193a0d-54ef-4dea-8c1c-2866bb1a9274",
  718. title: "Bar",
  719. collapseChildren: false,
  720. parentId: "af780520-2c1c-411c-b56b-76490bd25640",
  721. height: 32,
  722. eventEditable: true,
  723. eventRessourceEditable: true,
  724. },
  725. {
  726. id: "3d1226fd-5d43-487b-a263-28d052e9fe6e",
  727. title: "Réinstall JdP",
  728. collapseChildren: false,
  729. parentId: "af780520-2c1c-411c-b56b-76490bd25640",
  730. height: 64,
  731. eventEditable: true,
  732. eventRessourceEditable: true,
  733. },
  734. {
  735. id: "8ddf2165-01a6-4c85-b678-05ef616f7163",
  736. title: "Respo",
  737. collapseChildren: false,
  738. parentId: "1f193a0d-54ef-4dea-8c1c-2866bb1a9274",
  739. height: 32,
  740. eventEditable: true,
  741. eventRessourceEditable: true,
  742. },
  743. {
  744. id: "c7f7b41a-b517-450f-8a28-c3a4af63e5b5",
  745. title: "Créneaux",
  746. collapseChildren: false,
  747. parentId: "1f193a0d-54ef-4dea-8c1c-2866bb1a9274",
  748. height: 64,
  749. eventEditable: true,
  750. eventRessourceEditable: true,
  751. },
  752. {
  753. id: "42a69ade-8395-4004-a183-5b98afa468b5",
  754. title: "Rangement",
  755. collapseChildren: false,
  756. parentId: "75da5b10-96a9-4e50-b030-e10bc66142e1",
  757. height: 32,
  758. eventEditable: true,
  759. eventRessourceEditable: true,
  760. },
  761. {
  762. id: "c1f2ce10-420a-4a66-b58e-8aba22b9981c",
  763. title: "Service",
  764. collapseChildren: false,
  765. parentId: "75da5b10-96a9-4e50-b030-e10bc66142e1",
  766. height: 32,
  767. eventEditable: true,
  768. eventRessourceEditable: true,
  769. },
  770. {
  771. id: "6462acc0-26e9-419c-ba25-67417e4de4f4",
  772. title: "Autowash",
  773. collapseChildren: false,
  774. parentId: "75da5b10-96a9-4e50-b030-e10bc66142e1",
  775. height: 32,
  776. eventEditable: true,
  777. eventRessourceEditable: true,
  778. },
  779. {
  780. id: "88a81bea-aaf7-4bca-8cab-7067e7621e7b",
  781. title: "Catering",
  782. collapseChildren: false,
  783. parentId: "17ec3478-dfba-48a7-ae39-1c5b36ffa350",
  784. height: 32,
  785. eventEditable: true,
  786. eventRessourceEditable: true,
  787. },
  788. {
  789. id: "76688bef-6cd3-46c0-bc36-668d69398c95",
  790. title: "Bar / jardin",
  791. collapseChildren: false,
  792. parentId: "17ec3478-dfba-48a7-ae39-1c5b36ffa350",
  793. height: 32,
  794. eventEditable: true,
  795. eventRessourceEditable: true,
  796. },
  797. {
  798. id: "d6910dcd-44cf-42ea-a7d2-fa274d68092a",
  799. title: "Durante",
  800. collapseChildren: false,
  801. parentId: "17ec3478-dfba-48a7-ae39-1c5b36ffa350",
  802. height: 32,
  803. eventEditable: true,
  804. eventRessourceEditable: true,
  805. },
  806. ];
  807. const BDLGRessources = BDLGRessourcesJSON.map((o) => new Ressource(o));
  808. BDLGRessourcesJSON.forEach((r, idx) => {
  809. if (r.parentId) {
  810. BDLGRessources[idx].parent = BDLGRessources.find((o) => o.id == r.parentId);
  811. }
  812. });
  813. const bdlgTimeline: TimeLine = document.createElement("jc-timeline") as TimeLine;
  814. title = document.createElement("h2");
  815. title.innerText = "Bdlg Test Timeline";
  816. container.appendChild(title);
  817. container.appendChild(bdlgTimeline);
  818. bdlgTimeline.addRessources(BDLGRessources);