capibara 1.2.0 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app.js +1 -1
- package/config.js +188 -1
- package/data.js +88 -2
- package/dist/index.js +321 -229
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/capibara.js +19 -2
- package/src/scss/base/_utils.scss +12 -1
- package/src/scss/components/_buttons.scss +20 -11
- package/src/scss/components/_floatbox.scss +83 -17
- package/src/scss/components/_input_nav.scss +22 -1
- package/src/scss/layout/_detail_day.scss +14 -0
- package/src/scss/themes/_color_themes.scss +3 -0
- package/src/util/dateUtils.js +76 -80
- package/src/util/domUtils.js +1 -1
- package/src/util/icons.js +75 -5
- package/src/util/tableElements.js +548 -534
|
@@ -2,6 +2,7 @@ import dom from "../util/domUtils";
|
|
|
2
2
|
import utils from "../util/utils";
|
|
3
3
|
import dateUtils from "../util/dateUtils";
|
|
4
4
|
import icons from "../util/icons";
|
|
5
|
+
import domUtils from "../util/domUtils";
|
|
5
6
|
|
|
6
7
|
export default {
|
|
7
8
|
/**
|
|
@@ -80,14 +81,14 @@ export default {
|
|
|
80
81
|
*/
|
|
81
82
|
createPlotVerticalContainer(config) {
|
|
82
83
|
let $elem = dom.createElement("div", {
|
|
83
|
-
className: "plot-vertical-container"
|
|
84
|
+
className: "plot-vertical-container"
|
|
84
85
|
});
|
|
85
86
|
return this.redrawPlotVerticalContainer(config, $elem);
|
|
86
87
|
},
|
|
87
88
|
|
|
88
89
|
createPlotHorizontalContainer(config) {
|
|
89
90
|
let $elem = dom.createElement("div", {
|
|
90
|
-
className: "plot-horizontal-container"
|
|
91
|
+
className: "plot-horizontal-container"
|
|
91
92
|
});
|
|
92
93
|
return this.redrawPlotHorizontalContainer(config, $elem);
|
|
93
94
|
},
|
|
@@ -117,8 +118,8 @@ export default {
|
|
|
117
118
|
classNames: ["plot-vertical", p.className || ""],
|
|
118
119
|
style: {
|
|
119
120
|
"margin-left": left + "px",
|
|
120
|
-
height: height + "px"
|
|
121
|
-
}
|
|
121
|
+
height: height + "px"
|
|
122
|
+
}
|
|
122
123
|
});
|
|
123
124
|
$elem.appendChild(plot);
|
|
124
125
|
});
|
|
@@ -137,8 +138,8 @@ export default {
|
|
|
137
138
|
classNames: ["plot-horizontal", p.className || ""],
|
|
138
139
|
style: {
|
|
139
140
|
"margin-top": topPosition * itemHeight + "px",
|
|
140
|
-
width: width + "px"
|
|
141
|
-
}
|
|
141
|
+
width: width + "px"
|
|
142
|
+
}
|
|
142
143
|
});
|
|
143
144
|
$elem.appendChild(plot);
|
|
144
145
|
});
|
|
@@ -218,14 +219,10 @@ export default {
|
|
|
218
219
|
|
|
219
220
|
let toggleSidebarBtnString = `
|
|
220
221
|
<button toggle-sidebar class="cap-btn-icon cap-btn-icon-raised cap-btn-toggle-sidebar ">
|
|
221
|
-
|
|
222
|
-
<svg style="width:24px;height:24px" viewBox="0 0 24 24">
|
|
223
|
-
<path fill="currentColor" d="M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z" />
|
|
224
|
-
</svg>
|
|
225
|
-
</span>
|
|
222
|
+
${icons.chevronRight}
|
|
226
223
|
</button> `;
|
|
227
224
|
|
|
228
|
-
if(config.timeline.nav.left.hideToggleSidebarButton){
|
|
225
|
+
if (config.timeline.nav.left.hideToggleSidebarButton) {
|
|
229
226
|
toggleSidebarBtnString = "";
|
|
230
227
|
}
|
|
231
228
|
|
|
@@ -282,12 +279,12 @@ export default {
|
|
|
282
279
|
$elem.append(r);
|
|
283
280
|
|
|
284
281
|
let toggleSidebar = $elem.querySelector("[toggle-sidebar]");
|
|
285
|
-
if(toggleSidebar){
|
|
282
|
+
if (toggleSidebar) {
|
|
286
283
|
toggleSidebar.addEventListener("click", (e) => {
|
|
287
284
|
r.dispatchEvent(
|
|
288
285
|
new CustomEvent("toggleSidebar", {
|
|
289
286
|
bubbles: true,
|
|
290
|
-
cancelable: false
|
|
287
|
+
cancelable: false
|
|
291
288
|
})
|
|
292
289
|
);
|
|
293
290
|
});
|
|
@@ -305,7 +302,7 @@ export default {
|
|
|
305
302
|
* @return {Object} Elemento Dom corner
|
|
306
303
|
*/
|
|
307
304
|
createCornerRight(config, tab = null) {
|
|
308
|
-
let $elem = dom.createElement("div", { classNames: ["corner","right"] });
|
|
305
|
+
let $elem = dom.createElement("div", { classNames: ["corner", "right"] });
|
|
309
306
|
return this.redrawCornerRight($elem, config, tab);
|
|
310
307
|
},
|
|
311
308
|
|
|
@@ -331,7 +328,7 @@ export default {
|
|
|
331
328
|
if (config.timeline.corner.right.buttons) {
|
|
332
329
|
config.timeline.corner.right.buttons.forEach((btn) => {
|
|
333
330
|
let isEnabled = btn.getIsEnabled ? btn.getIsEnabled() : true;
|
|
334
|
-
if(isEnabled){
|
|
331
|
+
if (isEnabled) {
|
|
335
332
|
let $btn = dom.createElementFromHTML(`
|
|
336
333
|
<button class="corner-btn cap-btn-raised">
|
|
337
334
|
${btn.label || ""}
|
|
@@ -345,26 +342,34 @@ export default {
|
|
|
345
342
|
}
|
|
346
343
|
});
|
|
347
344
|
}
|
|
348
|
-
if(config.timeline.corner.right.inputs){
|
|
349
|
-
config.timeline.corner.right.inputs.forEach(input => {
|
|
350
|
-
let $input = this.createCornerRightInput({inputConfig:input});
|
|
345
|
+
if (config.timeline.corner.right.inputs) {
|
|
346
|
+
config.timeline.corner.right.inputs.forEach((input) => {
|
|
347
|
+
let $input = this.createCornerRightInput({ inputConfig: input });
|
|
351
348
|
$btnContainer.appendChild($btn);
|
|
352
349
|
});
|
|
353
350
|
}
|
|
354
351
|
return $el;
|
|
355
352
|
},
|
|
356
353
|
|
|
357
|
-
createCornerRightInput({inputConfig, dataDay = null, daySelected = null }){
|
|
354
|
+
createCornerRightInput({ inputConfig, dataDay = null, daySelected = null }) {
|
|
358
355
|
let r = null;
|
|
359
|
-
switch(inputConfig.type){
|
|
360
|
-
case
|
|
361
|
-
r = this.createCornerRightInputAutocompleteCrud({
|
|
356
|
+
switch (inputConfig.type) {
|
|
357
|
+
case "autocomplete-crud":
|
|
358
|
+
r = this.createCornerRightInputAutocompleteCrud({
|
|
359
|
+
inputConfig,
|
|
360
|
+
dataDay,
|
|
361
|
+
daySelected
|
|
362
|
+
});
|
|
362
363
|
break;
|
|
363
364
|
}
|
|
364
365
|
return r;
|
|
365
366
|
},
|
|
366
367
|
|
|
367
|
-
createCornerRightInputAutocompleteCrud({
|
|
368
|
+
createCornerRightInputAutocompleteCrud({
|
|
369
|
+
inputConfig,
|
|
370
|
+
dataDay,
|
|
371
|
+
daySelected
|
|
372
|
+
}) {
|
|
368
373
|
let elem = "test";
|
|
369
374
|
return elem;
|
|
370
375
|
},
|
|
@@ -416,8 +421,8 @@ export default {
|
|
|
416
421
|
if (!tab.isHidden) {
|
|
417
422
|
str += ` <button
|
|
418
423
|
class="tab ${tab.disabled ? "disabled" : ""} ${
|
|
419
|
-
|
|
420
|
-
|
|
424
|
+
tab == tabSelected ? "active" : ""
|
|
425
|
+
} ${tab.color}"
|
|
421
426
|
color="${tab.color}"
|
|
422
427
|
input-key="${tab.id}"
|
|
423
428
|
${
|
|
@@ -436,7 +441,6 @@ export default {
|
|
|
436
441
|
|
|
437
442
|
if (tabSelected) {
|
|
438
443
|
if (tabSelected.legends) {
|
|
439
|
-
|
|
440
444
|
str += `
|
|
441
445
|
<button toggle-legends class="cap-btn-icon cap-btn-icon-raised ">
|
|
442
446
|
${icons.toggleLegends}
|
|
@@ -461,8 +465,8 @@ export default {
|
|
|
461
465
|
legend.tooltip ? `cap-tooltip="${legend.tooltip}"` : ""
|
|
462
466
|
} >
|
|
463
467
|
<div class="icon-legend ${colorClass} ${
|
|
464
|
-
|
|
465
|
-
|
|
468
|
+
legend.shape
|
|
469
|
+
}" style="${colorBg}"></div>
|
|
466
470
|
<span>${legend.label}</span>
|
|
467
471
|
</div>`;
|
|
468
472
|
});
|
|
@@ -478,83 +482,19 @@ export default {
|
|
|
478
482
|
|
|
479
483
|
|
|
480
484
|
<button cap-btn-prev class="cap-btn-icon cap-btn-icon-raised">
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
<path fill="currentColor" d="M20,10V14H11L14.5,17.5L12.08,19.92L4.16,12L12.08,4.08L14.5,6.5L11,10H20Z" />
|
|
484
|
-
</svg>
|
|
485
|
-
</span>
|
|
486
|
-
|
|
487
|
-
<span class="loading-icon">
|
|
488
|
-
<svg version="1.1" id="loader-1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
489
|
-
width="32px" height="32px" viewBox="0 0 40 40" enable-background="new 0 0 40 40" xml:space="preserve">
|
|
490
|
-
<path opacity="0.2" fill="#000" d="M20.201,5.169c-8.254,0-14.946,6.692-14.946,14.946c0,8.255,6.692,14.946,14.946,14.946
|
|
491
|
-
s14.946-6.691,14.946-14.946C35.146,11.861,28.455,5.169,20.201,5.169z M20.201,31.749c-6.425,0-11.634-5.208-11.634-11.634
|
|
492
|
-
c0-6.425,5.209-11.634,11.634-11.634c6.425,0,11.633,5.209,11.633,11.634C31.834,26.541,26.626,31.749,20.201,31.749z"/>
|
|
493
|
-
<path fill="#000" d="M26.013,10.047l1.654-2.866c-2.198-1.272-4.743-2.012-7.466-2.012h0v3.312h0
|
|
494
|
-
C22.32,8.481,24.301,9.057,26.013,10.047z">
|
|
495
|
-
<animateTransform attributeType="xml"
|
|
496
|
-
attributeName="transform"
|
|
497
|
-
type="rotate"
|
|
498
|
-
from="0 20 20"
|
|
499
|
-
to="360 20 20"
|
|
500
|
-
dur="1.5s"
|
|
501
|
-
repeatCount="indefinite"/>
|
|
502
|
-
</path>
|
|
503
|
-
</svg>
|
|
504
|
-
</span>
|
|
485
|
+
${icons.arrowLeft}
|
|
486
|
+
${icons.loadingIcon}
|
|
505
487
|
</button>
|
|
506
488
|
|
|
507
489
|
|
|
508
490
|
<button cap-btn-calendar class="cap-btn-icon cap-btn-icon-raised">
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
<path fill="currentColor" d="M19,19H5V8H19M16,1V3H8V1H6V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3H18V1M17,12H12V17H17V12Z" />
|
|
512
|
-
</svg>
|
|
513
|
-
</span>
|
|
514
|
-
<span class="loading-icon">
|
|
515
|
-
<svg version="1.1" id="loader-1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
516
|
-
width="32px" height="32px" viewBox="0 0 40 40" enable-background="new 0 0 40 40" xml:space="preserve">
|
|
517
|
-
<path opacity="0.2" fill="#000" d="M20.201,5.169c-8.254,0-14.946,6.692-14.946,14.946c0,8.255,6.692,14.946,14.946,14.946
|
|
518
|
-
s14.946-6.691,14.946-14.946C35.146,11.861,28.455,5.169,20.201,5.169z M20.201,31.749c-6.425,0-11.634-5.208-11.634-11.634
|
|
519
|
-
c0-6.425,5.209-11.634,11.634-11.634c6.425,0,11.633,5.209,11.633,11.634C31.834,26.541,26.626,31.749,20.201,31.749z"/>
|
|
520
|
-
<path fill="#000" d="M26.013,10.047l1.654-2.866c-2.198-1.272-4.743-2.012-7.466-2.012h0v3.312h0
|
|
521
|
-
C22.32,8.481,24.301,9.057,26.013,10.047z">
|
|
522
|
-
<animateTransform attributeType="xml"
|
|
523
|
-
attributeName="transform"
|
|
524
|
-
type="rotate"
|
|
525
|
-
from="0 20 20"
|
|
526
|
-
to="360 20 20"
|
|
527
|
-
dur="1.5s"
|
|
528
|
-
repeatCount="indefinite"/>
|
|
529
|
-
</path>
|
|
530
|
-
</svg>
|
|
531
|
-
</span>
|
|
491
|
+
${icons.calendar}
|
|
492
|
+
${icons.loadingIcon}
|
|
532
493
|
</button>
|
|
533
494
|
|
|
534
495
|
<button cap-btn-next class="cap-btn-icon cap-btn-icon-raised">
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
<path fill="currentColor" d="M4,10V14H13L9.5,17.5L11.92,19.92L19.84,12L11.92,4.08L9.5,6.5L13,10H4Z" />
|
|
538
|
-
</svg>
|
|
539
|
-
</span>
|
|
540
|
-
<span class="loading-icon">
|
|
541
|
-
<svg version="1.1" id="loader-1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
542
|
-
width="32px" height="32px" viewBox="0 0 40 40" enable-background="new 0 0 40 40" xml:space="preserve">
|
|
543
|
-
<path opacity="0.2" fill="#000" d="M20.201,5.169c-8.254,0-14.946,6.692-14.946,14.946c0,8.255,6.692,14.946,14.946,14.946
|
|
544
|
-
s14.946-6.691,14.946-14.946C35.146,11.861,28.455,5.169,20.201,5.169z M20.201,31.749c-6.425,0-11.634-5.208-11.634-11.634
|
|
545
|
-
c0-6.425,5.209-11.634,11.634-11.634c6.425,0,11.633,5.209,11.633,11.634C31.834,26.541,26.626,31.749,20.201,31.749z"/>
|
|
546
|
-
<path fill="#000" d="M26.013,10.047l1.654-2.866c-2.198-1.272-4.743-2.012-7.466-2.012h0v3.312h0
|
|
547
|
-
C22.32,8.481,24.301,9.057,26.013,10.047z">
|
|
548
|
-
<animateTransform attributeType="xml"
|
|
549
|
-
attributeName="transform"
|
|
550
|
-
type="rotate"
|
|
551
|
-
from="0 20 20"
|
|
552
|
-
to="360 20 20"
|
|
553
|
-
dur="1.5s"
|
|
554
|
-
repeatCount="indefinite"/>
|
|
555
|
-
</path>
|
|
556
|
-
</svg>
|
|
557
|
-
</span>
|
|
496
|
+
${icons.arrowRight}
|
|
497
|
+
${icons.loadingIcon}
|
|
558
498
|
</button>
|
|
559
499
|
|
|
560
500
|
<div class="spacer"></div>
|
|
@@ -562,25 +502,13 @@ export default {
|
|
|
562
502
|
<button toggle-dark class="cap-btn-icon cap-btn-header c-d-mobile-none ${
|
|
563
503
|
config.timeline.withDarkToggle == false ? "hide" : ""
|
|
564
504
|
}">
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
<path fill="currentColor" d="M13,4.8C9,4.8 9,19.2 13,19.2C17,19.2 22,16.5 22,12C22,7.5 17,4.8 13,4.8M13.1,17.2C12.7,16.8 12,15 12,12C12,9 12.7,7.2 13.1,6.8C16,6.9 20,8.7 20,12C20,15.3 15.9,17.1 13.1,17.2M8,10.5C8,11 7.9,11.5 7.9,12C7.9,12.2 7.9,12.4 7.9,12.6L2.4,14L1.9,12.1L8,10.5M2,7L9.4,5.1C9.2,5.4 9,5.8 8.9,6.3C8.8,6.6 8.7,7 8.6,7.4L2.5,8.9L2,7M8.2,15.5C8.3,16.2 8.5,16.9 8.7,17.4L2.4,19L1.9,17.1L8.2,15.5Z" />
|
|
568
|
-
</svg>
|
|
569
|
-
</span>
|
|
570
|
-
<span class="hide-dark">
|
|
571
|
-
<svg width="24" height="24" viewBox="0 0 24 24">
|
|
572
|
-
<path fill="currentColor" d="M13,4.8C9,4.8 9,19.2 13,19.2C17,19.2 22,16.5 22,12C22,7.5 17,4.8 13,4.8M13.1,17.2C12.7,16.8 12,15 12,12C12,9 12.7,7.2 13.1,6.8C16,6.9 20,8.7 20,12C20,15.3 16,17.1 13.1,17.2M2,5H9.5C9.3,5.4 9,5.8 8.9,6.4C8.8,6.6 8.8,6.8 8.7,7H2V5M8,11H2V9H8.2C8.1,9.6 8.1,10.3 8,11M8.7,17C8.9,17.8 9.2,18.4 9.6,19H2.1V17H8.7M8.2,15H2V13H8C8.1,13.7 8.1,14.4 8.2,15Z" />
|
|
573
|
-
</svg>
|
|
574
|
-
</span>
|
|
505
|
+
${icons.dark}
|
|
506
|
+
${icons.light}
|
|
575
507
|
</button>`;
|
|
576
508
|
|
|
577
509
|
if (config.timeline.header.extend.enabled !== false) {
|
|
578
510
|
str += `<button toggle-header class="cap-btn-icon cap-btn-icon-raised">
|
|
579
|
-
|
|
580
|
-
<svg style="width:24px;height:24px" viewBox="0 0 24 24">
|
|
581
|
-
<path fill="currentColor" d="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z" />
|
|
582
|
-
</svg>
|
|
583
|
-
</span>
|
|
511
|
+
${icons.chevronDown}
|
|
584
512
|
</button>`;
|
|
585
513
|
}
|
|
586
514
|
|
|
@@ -631,7 +559,7 @@ export default {
|
|
|
631
559
|
$r.dispatchEvent(
|
|
632
560
|
new CustomEvent("toggleDark", {
|
|
633
561
|
bubbles: true,
|
|
634
|
-
cancelable: false
|
|
562
|
+
cancelable: false
|
|
635
563
|
})
|
|
636
564
|
);
|
|
637
565
|
});
|
|
@@ -646,7 +574,7 @@ export default {
|
|
|
646
574
|
new CustomEvent("clickCalendarIcon", {
|
|
647
575
|
bubbles: true,
|
|
648
576
|
cancelable: false,
|
|
649
|
-
detail: { x, y }
|
|
577
|
+
detail: { x, y }
|
|
650
578
|
})
|
|
651
579
|
);
|
|
652
580
|
});
|
|
@@ -658,7 +586,7 @@ export default {
|
|
|
658
586
|
$r.dispatchEvent(
|
|
659
587
|
new CustomEvent("toggleHeader", {
|
|
660
588
|
bubbles: true,
|
|
661
|
-
cancelable: false
|
|
589
|
+
cancelable: false
|
|
662
590
|
})
|
|
663
591
|
);
|
|
664
592
|
});
|
|
@@ -679,8 +607,8 @@ export default {
|
|
|
679
607
|
bubbles: true,
|
|
680
608
|
cancelable: false,
|
|
681
609
|
detail: {
|
|
682
|
-
originalEvt: e
|
|
683
|
-
}
|
|
610
|
+
originalEvt: e
|
|
611
|
+
}
|
|
684
612
|
})
|
|
685
613
|
);
|
|
686
614
|
});
|
|
@@ -691,8 +619,8 @@ export default {
|
|
|
691
619
|
bubbles: true,
|
|
692
620
|
cancelable: false,
|
|
693
621
|
detail: {
|
|
694
|
-
originalEvt: e
|
|
695
|
-
}
|
|
622
|
+
originalEvt: e
|
|
623
|
+
}
|
|
696
624
|
})
|
|
697
625
|
);
|
|
698
626
|
});
|
|
@@ -703,8 +631,8 @@ export default {
|
|
|
703
631
|
bubbles: true,
|
|
704
632
|
cancelable: false,
|
|
705
633
|
detail: {
|
|
706
|
-
originalEvt: e
|
|
707
|
-
}
|
|
634
|
+
originalEvt: e
|
|
635
|
+
}
|
|
708
636
|
})
|
|
709
637
|
);
|
|
710
638
|
});
|
|
@@ -734,8 +662,8 @@ export default {
|
|
|
734
662
|
cancelable: false,
|
|
735
663
|
detail: {
|
|
736
664
|
legend: legendSelected,
|
|
737
|
-
$legend
|
|
738
|
-
}
|
|
665
|
+
$legend
|
|
666
|
+
}
|
|
739
667
|
})
|
|
740
668
|
);
|
|
741
669
|
}
|
|
@@ -755,8 +683,8 @@ export default {
|
|
|
755
683
|
bubbles: true,
|
|
756
684
|
cancelable: false,
|
|
757
685
|
detail: {
|
|
758
|
-
tab: tabSelected
|
|
759
|
-
}
|
|
686
|
+
tab: tabSelected
|
|
687
|
+
}
|
|
760
688
|
})
|
|
761
689
|
);
|
|
762
690
|
}
|
|
@@ -776,8 +704,8 @@ export default {
|
|
|
776
704
|
bubbles: true,
|
|
777
705
|
cancelable: false,
|
|
778
706
|
detail: {
|
|
779
|
-
tab: tabSelected
|
|
780
|
-
}
|
|
707
|
+
tab: tabSelected
|
|
708
|
+
}
|
|
781
709
|
})
|
|
782
710
|
);
|
|
783
711
|
}
|
|
@@ -867,8 +795,8 @@ export default {
|
|
|
867
795
|
$elem: $dia,
|
|
868
796
|
date: $dia.getAttribute("date"),
|
|
869
797
|
clientX: evt.clientX,
|
|
870
|
-
clientY: evt.clientY
|
|
871
|
-
}
|
|
798
|
+
clientY: evt.clientY
|
|
799
|
+
}
|
|
872
800
|
})
|
|
873
801
|
);
|
|
874
802
|
});
|
|
@@ -880,8 +808,8 @@ export default {
|
|
|
880
808
|
cancelable: false,
|
|
881
809
|
detail: {
|
|
882
810
|
$elem: $dia,
|
|
883
|
-
date: $dia.getAttribute("date")
|
|
884
|
-
}
|
|
811
|
+
date: $dia.getAttribute("date")
|
|
812
|
+
}
|
|
885
813
|
})
|
|
886
814
|
);
|
|
887
815
|
});
|
|
@@ -937,8 +865,8 @@ export default {
|
|
|
937
865
|
<span date="${date}"
|
|
938
866
|
index="${d_index}"
|
|
939
867
|
class="${date.varName} ${
|
|
940
|
-
|
|
941
|
-
|
|
868
|
+
d.color ? "c-" + d.color + "--text" : ""
|
|
869
|
+
}" >
|
|
942
870
|
${value}
|
|
943
871
|
</span>
|
|
944
872
|
</div>`;
|
|
@@ -988,8 +916,8 @@ export default {
|
|
|
988
916
|
detail: {
|
|
989
917
|
date: date,
|
|
990
918
|
typeData: typeData,
|
|
991
|
-
value: value
|
|
992
|
-
}
|
|
919
|
+
value: value
|
|
920
|
+
}
|
|
993
921
|
})
|
|
994
922
|
);
|
|
995
923
|
});
|
|
@@ -1050,15 +978,17 @@ export default {
|
|
|
1050
978
|
navList += `<button class="tree-icon ${
|
|
1051
979
|
d.isClosed ? "" : "cap-rotate"
|
|
1052
980
|
}" item-id="${d.id || -1}" type-node="${d.type || ""}" >
|
|
1053
|
-
${icons.
|
|
981
|
+
${icons.chevronDown}
|
|
1054
982
|
</button>`;
|
|
1055
983
|
}
|
|
1056
984
|
|
|
1057
985
|
navList += `
|
|
1058
986
|
<div class="item-title truncate full-width ${
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
987
|
+
d.clickeable ? "clickeable" : ""
|
|
988
|
+
}
|
|
989
|
+
${d.navOver ? "hoverable" : ""} " item-id="${
|
|
990
|
+
d.id || -1
|
|
991
|
+
}" type-node="${d.type || ""}" >
|
|
1062
992
|
${d.label}
|
|
1063
993
|
</div>
|
|
1064
994
|
</div>`;
|
|
@@ -1094,10 +1024,10 @@ export default {
|
|
|
1094
1024
|
: ""
|
|
1095
1025
|
}
|
|
1096
1026
|
|
|
1097
|
-
<div class="item-title ${
|
|
1098
|
-
c.
|
|
1099
|
-
|
|
1100
|
-
|
|
1027
|
+
<div class="item-title ${c.clickeable ? "clickeable" : ""}
|
|
1028
|
+
${c.navOver ? "hoverable" : ""}" item-id="${
|
|
1029
|
+
c.id || -1
|
|
1030
|
+
}" type-node="${c.type || ""}">
|
|
1101
1031
|
<div class="truncate">
|
|
1102
1032
|
${c.label}
|
|
1103
1033
|
</div>
|
|
@@ -1116,7 +1046,7 @@ export default {
|
|
|
1116
1046
|
initialNavList += `<div class="initial-nav-item parent">`;
|
|
1117
1047
|
if (d.withNav) {
|
|
1118
1048
|
config.timeline.nav.left.initial.vars.forEach((v) => {
|
|
1119
|
-
let value = utils.getVarByPath(d.values, v.varName)
|
|
1049
|
+
let value = utils.getVarByPath(d.values, v.varName);
|
|
1120
1050
|
|
|
1121
1051
|
if (v.round && !isNaN(value)) {
|
|
1122
1052
|
value = utils.round(value, v.round);
|
|
@@ -1188,11 +1118,11 @@ export default {
|
|
|
1188
1118
|
d.isClosed ? "hide" : ""
|
|
1189
1119
|
}" child="${d.id || -1}">`;
|
|
1190
1120
|
|
|
1191
|
-
if(c.withNav !== false){
|
|
1121
|
+
if (c.withNav !== false) {
|
|
1192
1122
|
config.timeline.nav.left.initial.vars.forEach((v) => {
|
|
1193
1123
|
if (v.onlyTab && tab && v.onlyTab !== tab.key) return;
|
|
1194
1124
|
|
|
1195
|
-
let value = utils.getVarByPath(c.values, v.varName)
|
|
1125
|
+
let value = utils.getVarByPath(c.values, v.varName);
|
|
1196
1126
|
if (v.round && !isNaN(value)) {
|
|
1197
1127
|
value = utils.round(value, v.round);
|
|
1198
1128
|
}
|
|
@@ -1251,7 +1181,7 @@ export default {
|
|
|
1251
1181
|
</div>`;
|
|
1252
1182
|
}
|
|
1253
1183
|
});
|
|
1254
|
-
|
|
1184
|
+
}
|
|
1255
1185
|
initialNavList += `
|
|
1256
1186
|
</div>`;
|
|
1257
1187
|
});
|
|
@@ -1261,7 +1191,7 @@ export default {
|
|
|
1261
1191
|
exNavList += `<div class="ex-nav-item parent">`;
|
|
1262
1192
|
if (d.withExNav) {
|
|
1263
1193
|
config.timeline.nav.left.extend.vars.forEach((v) => {
|
|
1264
|
-
let value = utils.getVarByPath(d.values, v.varName)
|
|
1194
|
+
let value = utils.getVarByPath(d.values, v.varName);
|
|
1265
1195
|
if (v.round && !isNaN(value)) {
|
|
1266
1196
|
value = utils.round(value, v.round);
|
|
1267
1197
|
}
|
|
@@ -1332,11 +1262,11 @@ export default {
|
|
|
1332
1262
|
d.isClosed ? "hide" : ""
|
|
1333
1263
|
}" child="${d.id || -1}">`;
|
|
1334
1264
|
|
|
1335
|
-
if(c.withNav !== false){
|
|
1265
|
+
if (c.withNav !== false) {
|
|
1336
1266
|
config.timeline.nav.left.extend.vars.forEach((v) => {
|
|
1337
1267
|
if (v.onlyTab && tab && v.onlyTab !== tab.key) return;
|
|
1338
1268
|
|
|
1339
|
-
let value = utils.getVarByPath(c.values, v.varName)
|
|
1269
|
+
let value = utils.getVarByPath(c.values, v.varName);
|
|
1340
1270
|
if (v.round && !isNaN(value)) {
|
|
1341
1271
|
value = utils.round(value, v.round);
|
|
1342
1272
|
}
|
|
@@ -1465,7 +1395,7 @@ export default {
|
|
|
1465
1395
|
config.timeline.nav.left.buttons.vars
|
|
1466
1396
|
) {
|
|
1467
1397
|
config.timeline.nav.left.buttons.vars.forEach((btn) => {
|
|
1468
|
-
if(c.withNav !== false){
|
|
1398
|
+
if (c.withNav !== false) {
|
|
1469
1399
|
let btnContent = "";
|
|
1470
1400
|
let className = btn.className || "";
|
|
1471
1401
|
|
|
@@ -1474,7 +1404,9 @@ export default {
|
|
|
1474
1404
|
}
|
|
1475
1405
|
|
|
1476
1406
|
if (btn.iconFormatter) {
|
|
1477
|
-
btnContent = btn.iconFormatter
|
|
1407
|
+
btnContent = btn.iconFormatter
|
|
1408
|
+
? btn.iconFormatter(c, btn)
|
|
1409
|
+
: "";
|
|
1478
1410
|
}
|
|
1479
1411
|
|
|
1480
1412
|
if (btn.shape) {
|
|
@@ -1498,7 +1430,6 @@ export default {
|
|
|
1498
1430
|
type-node="${c.type || ""}">
|
|
1499
1431
|
${btnContent}
|
|
1500
1432
|
</button>`;
|
|
1501
|
-
|
|
1502
1433
|
}
|
|
1503
1434
|
});
|
|
1504
1435
|
}
|
|
@@ -1549,8 +1480,8 @@ export default {
|
|
|
1549
1480
|
originalEvt: e,
|
|
1550
1481
|
item: item,
|
|
1551
1482
|
type: typeNode,
|
|
1552
|
-
pos: pos
|
|
1553
|
-
}
|
|
1483
|
+
pos: pos
|
|
1484
|
+
}
|
|
1554
1485
|
})
|
|
1555
1486
|
);
|
|
1556
1487
|
});
|
|
@@ -1562,7 +1493,7 @@ export default {
|
|
|
1562
1493
|
i.dispatchEvent(
|
|
1563
1494
|
new CustomEvent("leaveNavItem", {
|
|
1564
1495
|
bubbles: true,
|
|
1565
|
-
cancelable: false
|
|
1496
|
+
cancelable: false
|
|
1566
1497
|
})
|
|
1567
1498
|
);
|
|
1568
1499
|
});
|
|
@@ -1574,7 +1505,7 @@ export default {
|
|
|
1574
1505
|
i.dispatchEvent(
|
|
1575
1506
|
new CustomEvent("leaveNavItem", {
|
|
1576
1507
|
bubbles: true,
|
|
1577
|
-
cancelable: false
|
|
1508
|
+
cancelable: false
|
|
1578
1509
|
})
|
|
1579
1510
|
);
|
|
1580
1511
|
});
|
|
@@ -1592,8 +1523,8 @@ export default {
|
|
|
1592
1523
|
detail: {
|
|
1593
1524
|
itemId: itemId,
|
|
1594
1525
|
type: typeNode,
|
|
1595
|
-
value: value
|
|
1596
|
-
}
|
|
1526
|
+
value: value
|
|
1527
|
+
}
|
|
1597
1528
|
})
|
|
1598
1529
|
);
|
|
1599
1530
|
});
|
|
@@ -1624,8 +1555,8 @@ export default {
|
|
|
1624
1555
|
item: item,
|
|
1625
1556
|
type: typeNode,
|
|
1626
1557
|
value: value,
|
|
1627
|
-
tabSelected: tab
|
|
1628
|
-
}
|
|
1558
|
+
tabSelected: tab
|
|
1559
|
+
}
|
|
1629
1560
|
})
|
|
1630
1561
|
);
|
|
1631
1562
|
});
|
|
@@ -1643,8 +1574,8 @@ export default {
|
|
|
1643
1574
|
detail: {
|
|
1644
1575
|
key: key,
|
|
1645
1576
|
itemId: itemId,
|
|
1646
|
-
type: typeNode
|
|
1647
|
-
}
|
|
1577
|
+
type: typeNode
|
|
1578
|
+
}
|
|
1648
1579
|
})
|
|
1649
1580
|
);
|
|
1650
1581
|
});
|
|
@@ -1682,8 +1613,8 @@ export default {
|
|
|
1682
1613
|
cancelable: false,
|
|
1683
1614
|
detail: {
|
|
1684
1615
|
itemId: itemId,
|
|
1685
|
-
type: typeNode
|
|
1686
|
-
}
|
|
1616
|
+
type: typeNode
|
|
1617
|
+
}
|
|
1687
1618
|
})
|
|
1688
1619
|
);
|
|
1689
1620
|
|
|
@@ -1763,7 +1694,7 @@ export default {
|
|
|
1763
1694
|
) {
|
|
1764
1695
|
let $navRight = $elem; //dom.createElement("nav",{className:"right"});
|
|
1765
1696
|
let $divContainer = dom.createElement("div", {
|
|
1766
|
-
className: "nav-input-container"
|
|
1697
|
+
className: "nav-input-container"
|
|
1767
1698
|
});
|
|
1768
1699
|
let $inputs = [];
|
|
1769
1700
|
let checkboxInputs = [];
|
|
@@ -1967,7 +1898,7 @@ export default {
|
|
|
1967
1898
|
diff += dayWidth / 2 - 2; // para centrar linea
|
|
1968
1899
|
Object.assign($elem.style, {
|
|
1969
1900
|
"margin-left": diff + "px",
|
|
1970
|
-
height: height + "px"
|
|
1901
|
+
height: height + "px"
|
|
1971
1902
|
});
|
|
1972
1903
|
return $elem;
|
|
1973
1904
|
},
|
|
@@ -1981,7 +1912,7 @@ export default {
|
|
|
1981
1912
|
*/
|
|
1982
1913
|
createFloatBox(config, tab) {
|
|
1983
1914
|
let $container = dom.createElement("div", {
|
|
1984
|
-
className: "float-box-container"
|
|
1915
|
+
className: "float-box-container"
|
|
1985
1916
|
});
|
|
1986
1917
|
return this.redrawFloatBox(config, tab, $container);
|
|
1987
1918
|
},
|
|
@@ -2012,19 +1943,18 @@ export default {
|
|
|
2012
1943
|
ds.data.forEach((data) => {
|
|
2013
1944
|
if (
|
|
2014
1945
|
(!data.message || data.message.value == null) &&
|
|
2015
|
-
(data.values == null ||
|
|
2016
|
-
|
|
2017
|
-
|
|
1946
|
+
(data.values == null ||
|
|
1947
|
+
data.values == undefined ||
|
|
1948
|
+
Object.entries(data.values).length === 0)
|
|
1949
|
+
) {
|
|
2018
1950
|
return null;
|
|
2019
1951
|
}
|
|
2020
1952
|
|
|
2021
|
-
|
|
2022
1953
|
//children Data
|
|
2023
1954
|
let position = this.getPositionFloatBox(config, data, ds);
|
|
2024
1955
|
|
|
2025
1956
|
let className = "";
|
|
2026
1957
|
|
|
2027
|
-
|
|
2028
1958
|
if (data.errors && data.errors.length > 0) {
|
|
2029
1959
|
className += "has-errors ";
|
|
2030
1960
|
}
|
|
@@ -2034,7 +1964,7 @@ export default {
|
|
|
2034
1964
|
}
|
|
2035
1965
|
|
|
2036
1966
|
let msg = null;
|
|
2037
|
-
if(tab.floatBox.messagePath){
|
|
1967
|
+
if (tab.floaBox && tab.floatBox.messagePath) {
|
|
2038
1968
|
msg = utils.getVarByPath(data, tab.floatBox.messagePath);
|
|
2039
1969
|
}
|
|
2040
1970
|
|
|
@@ -2042,14 +1972,12 @@ export default {
|
|
|
2042
1972
|
className += "has-message ";
|
|
2043
1973
|
}
|
|
2044
1974
|
|
|
2045
|
-
|
|
2046
1975
|
let str = `
|
|
2047
1976
|
<div class="float-box ${className} ${de.isClosed ? "hide" : ""}"
|
|
2048
1977
|
style="${position ? position : ""}"
|
|
2049
1978
|
item-id="${ds.id || -1}"
|
|
2050
1979
|
type-node="${ds.type || ""}"> `;
|
|
2051
1980
|
|
|
2052
|
-
|
|
2053
1981
|
let strExt = `
|
|
2054
1982
|
<div class="float-box-ext ${de.isClosed ? "hide" : ""}"
|
|
2055
1983
|
style="${position ? position : ""}"
|
|
@@ -2057,16 +1985,30 @@ export default {
|
|
|
2057
1985
|
type-node="${ds.type || ""}">
|
|
2058
1986
|
<div class="long-bar-container">`;
|
|
2059
1987
|
|
|
2060
|
-
|
|
2061
1988
|
if (tab && tab.floatBox) {
|
|
1989
|
+
if (tab.floatBox.plots) {
|
|
1990
|
+
str += `<div class="plot-floatbox-container">`;
|
|
1991
|
+
tab.floatBox.plots.forEach((n) => {
|
|
1992
|
+
let cssVars = "";
|
|
1993
|
+
if (utils.getVarByPath(data.values, n.varName) !== null) {
|
|
1994
|
+
if (n.color) {
|
|
1995
|
+
cssVars = `--local-color:${n.color};`;
|
|
1996
|
+
}
|
|
1997
|
+
|
|
1998
|
+
str += `<div class="plot-floatbox ${
|
|
1999
|
+
n.style || ""
|
|
2000
|
+
}" style="${cssVars} "></div>`;
|
|
2001
|
+
}
|
|
2002
|
+
});
|
|
2003
|
+
str += `
|
|
2004
|
+
</div>`;
|
|
2005
|
+
}
|
|
2006
|
+
|
|
2062
2007
|
//numeros en el floatBox
|
|
2063
2008
|
if (tab.floatBox.nums) {
|
|
2064
2009
|
tab.floatBox.nums.forEach((n) => {
|
|
2065
|
-
|
|
2066
2010
|
if (tab.legends && n.tabKey) {
|
|
2067
|
-
let legend =tab.legends.find(
|
|
2068
|
-
(l) => l.key == n.tabKey
|
|
2069
|
-
);
|
|
2011
|
+
let legend = tab.legends.find((l) => l.key == n.tabKey);
|
|
2070
2012
|
if (legend && !legend.active) return;
|
|
2071
2013
|
}
|
|
2072
2014
|
|
|
@@ -2080,7 +2022,6 @@ export default {
|
|
|
2080
2022
|
let colorStyleExt = "";
|
|
2081
2023
|
let cssVars = "";
|
|
2082
2024
|
|
|
2083
|
-
|
|
2084
2025
|
if (n.varName) {
|
|
2085
2026
|
dataFloatBox = utils.getVarByPath(data.values, n.varName);
|
|
2086
2027
|
}
|
|
@@ -2111,13 +2052,15 @@ export default {
|
|
|
2111
2052
|
data.values,
|
|
2112
2053
|
n.longBarColor
|
|
2113
2054
|
);
|
|
2114
|
-
let longBarOpacity =
|
|
2115
|
-
data.values,
|
|
2116
|
-
n.longBarOpacity
|
|
2117
|
-
) || null;
|
|
2055
|
+
let longBarOpacity =
|
|
2056
|
+
utils.getVarByPath(data.values, n.longBarOpacity) || null;
|
|
2118
2057
|
if (longBarColor) {
|
|
2119
2058
|
if (utils.isHexColor(longBarColor)) {
|
|
2120
|
-
colorStyleExt = `--local-color: ${longBarColor}; ${
|
|
2059
|
+
colorStyleExt = `--local-color: ${longBarColor}; ${
|
|
2060
|
+
longBarOpacity
|
|
2061
|
+
? "--local-opacity: " + longBarOpacity
|
|
2062
|
+
: ""
|
|
2063
|
+
}; `;
|
|
2121
2064
|
} else {
|
|
2122
2065
|
colorClassExt = longBarColor;
|
|
2123
2066
|
}
|
|
@@ -2128,63 +2071,74 @@ export default {
|
|
|
2128
2071
|
}
|
|
2129
2072
|
}
|
|
2130
2073
|
|
|
2131
|
-
if(n.longBar){
|
|
2132
|
-
let longBar = utils.getVarByPath(data.values,n.longBar);
|
|
2133
|
-
if(longBar){
|
|
2074
|
+
if (n.longBar) {
|
|
2075
|
+
let longBar = utils.getVarByPath(data.values, n.longBar);
|
|
2076
|
+
if (longBar) {
|
|
2134
2077
|
cssVars = `--long:${longBar};`;
|
|
2135
2078
|
}
|
|
2136
2079
|
}
|
|
2137
2080
|
|
|
2138
2081
|
if (dataFloatBox !== null && showIf && !hideIf) {
|
|
2139
2082
|
str += `<span class="data ${colorClass} ${className}" style="${colorStyle}">
|
|
2140
|
-
${
|
|
2141
|
-
|
|
2083
|
+
${
|
|
2084
|
+
typeof dataFloatBox == "string"
|
|
2085
|
+
? dataFloatBox
|
|
2086
|
+
: ""
|
|
2087
|
+
}
|
|
2088
|
+
${
|
|
2089
|
+
typeof dataFloatBox == "number"
|
|
2090
|
+
? utils.round(dataFloatBox, n.round)
|
|
2091
|
+
: ""
|
|
2092
|
+
}
|
|
2142
2093
|
</span>`;
|
|
2143
|
-
|
|
2144
|
-
if(n.longBar && cssVars){
|
|
2094
|
+
|
|
2095
|
+
if (n.longBar && cssVars) {
|
|
2145
2096
|
strExt += `<div class="long-bar ${colorClassExt}" style="${colorStyleExt} ${cssVars} "></div> `;
|
|
2146
2097
|
}
|
|
2147
|
-
|
|
2148
2098
|
}
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
2099
|
});
|
|
2152
2100
|
}
|
|
2153
2101
|
|
|
2102
|
+
//puntos en el floatBox
|
|
2103
|
+
if (tab.floatBox.dots) {
|
|
2104
|
+
str += `<div class="dot-container-middle">`;
|
|
2105
|
+
tab.floatBox.dots.forEach((dot) => {
|
|
2106
|
+
if (utils.getVarByPath(data.values, dot.varName) !== null) {
|
|
2154
2107
|
|
|
2108
|
+
let className = "";
|
|
2109
|
+
let colorClass = "";
|
|
2110
|
+
let colorStyle = "";
|
|
2155
2111
|
|
|
2112
|
+
if (dot.shape) {
|
|
2113
|
+
className += dot.shape;
|
|
2114
|
+
}
|
|
2115
|
+
|
|
2116
|
+
if (dot.color) {
|
|
2117
|
+
if (utils.isHexColor(dot.color)) {
|
|
2118
|
+
colorStyle = `--local-color: ${dot.color}`;
|
|
2119
|
+
} else {
|
|
2120
|
+
colorClass = dot.color;
|
|
2121
|
+
}
|
|
2122
|
+
}
|
|
2156
2123
|
|
|
2157
|
-
//puntos en el floatBox
|
|
2158
|
-
if (tab.floatBox.dots) {
|
|
2159
|
-
str += `
|
|
2160
|
-
<div class="dot-container-middle">`;
|
|
2161
|
-
tab.floatBox.dots.forEach((n) => {
|
|
2162
|
-
if (utils.getVarByPath(data.values, n.varName) !== null) {
|
|
2163
2124
|
str += `
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
}"></div>`;
|
|
2125
|
+
<div class="dot ${colorClass} ${className}" style="${colorStyle}" ></div>`;
|
|
2126
|
+
|
|
2167
2127
|
}
|
|
2168
2128
|
});
|
|
2169
2129
|
str += `
|
|
2170
2130
|
</div>`;
|
|
2171
2131
|
}
|
|
2172
2132
|
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
2133
|
//fila de puntos en floatBox
|
|
2177
2134
|
if (tab.floatBox.rowDots) {
|
|
2178
2135
|
tab.floatBox.rowDots.forEach((row) => {
|
|
2179
|
-
|
|
2180
2136
|
let freeColumns = 4;
|
|
2181
2137
|
str += `<span class="rowdot--row ">`;
|
|
2182
2138
|
|
|
2183
|
-
row.forEach(dot => {
|
|
2139
|
+
row.forEach((dot) => {
|
|
2184
2140
|
if (tab.legends && dot.tabKey) {
|
|
2185
|
-
let legend =tab.legends.find(
|
|
2186
|
-
(l) => l.key == dot.tabKey
|
|
2187
|
-
);
|
|
2141
|
+
let legend = tab.legends.find((l) => l.key == dot.tabKey);
|
|
2188
2142
|
if (legend && !legend.active) return;
|
|
2189
2143
|
}
|
|
2190
2144
|
|
|
@@ -2195,60 +2149,64 @@ export default {
|
|
|
2195
2149
|
let colorClass = "";
|
|
2196
2150
|
let colorStyle = "";
|
|
2197
2151
|
|
|
2198
|
-
|
|
2199
|
-
if ( dot.varName) {
|
|
2152
|
+
if (dot.varName) {
|
|
2200
2153
|
dataFloatBox = utils.getVarByPath(data.values, dot.varName);
|
|
2201
2154
|
dataFloatBox = parseInt(dataFloatBox);
|
|
2202
2155
|
}
|
|
2203
2156
|
|
|
2204
|
-
if (
|
|
2205
|
-
showIf = Boolean(
|
|
2157
|
+
if (dot.varShow) {
|
|
2158
|
+
showIf = Boolean(
|
|
2159
|
+
utils.getVarByPath(data.values, dot.varShow)
|
|
2160
|
+
);
|
|
2206
2161
|
dataFloatBox = dataFloatBox || "";
|
|
2207
2162
|
}
|
|
2208
2163
|
|
|
2209
|
-
if (
|
|
2210
|
-
hideIf = Boolean(
|
|
2164
|
+
if (dot.varHide) {
|
|
2165
|
+
hideIf = Boolean(
|
|
2166
|
+
utils.getVarByPath(data.values, dot.varHide)
|
|
2167
|
+
);
|
|
2211
2168
|
}
|
|
2212
2169
|
|
|
2213
|
-
if (
|
|
2170
|
+
if (dot.shape) {
|
|
2214
2171
|
className += " shape-" + dot.shape;
|
|
2215
2172
|
}
|
|
2216
2173
|
|
|
2217
|
-
if (
|
|
2218
|
-
if (utils.isHexColor(
|
|
2219
|
-
colorStyle = `--local-color: ${
|
|
2174
|
+
if (dot.color) {
|
|
2175
|
+
if (utils.isHexColor(dot.color)) {
|
|
2176
|
+
colorStyle = `--local-color: ${dot.color}`;
|
|
2220
2177
|
} else {
|
|
2221
2178
|
colorClass = dot.color;
|
|
2222
2179
|
}
|
|
2223
2180
|
}
|
|
2224
2181
|
|
|
2225
|
-
if (
|
|
2226
|
-
|
|
2182
|
+
if (
|
|
2183
|
+
dataFloatBox !== null &&
|
|
2184
|
+
dataFloatBox > 0 &&
|
|
2185
|
+
showIf &&
|
|
2186
|
+
!hideIf &&
|
|
2187
|
+
freeColumns > 0
|
|
2188
|
+
) {
|
|
2189
|
+
let n =
|
|
2190
|
+
dataFloatBox > freeColumns ? freeColumns : dataFloatBox;
|
|
2227
2191
|
freeColumns -= n;
|
|
2228
|
-
for (let index = 0; index < n
|
|
2192
|
+
for (let index = 0; index < n; index++) {
|
|
2229
2193
|
str += `<div class="rowdot--dot ${colorClass} ${className}" style="${colorStyle}"></div>`;
|
|
2230
2194
|
}
|
|
2231
2195
|
}
|
|
2232
|
-
|
|
2233
2196
|
});
|
|
2234
2197
|
|
|
2235
2198
|
str += `</span>`;
|
|
2236
|
-
|
|
2237
|
-
});
|
|
2199
|
+
});
|
|
2238
2200
|
}
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
2201
|
}
|
|
2243
2202
|
|
|
2244
2203
|
str += `
|
|
2245
2204
|
</div>`;
|
|
2246
2205
|
strExt += `
|
|
2247
2206
|
</div>
|
|
2248
|
-
</div
|
|
2207
|
+
</div>`;
|
|
2249
2208
|
|
|
2250
2209
|
let $elem = dom.createElementFromHTML(str);
|
|
2251
|
-
|
|
2252
2210
|
|
|
2253
2211
|
let $elemExt = dom.createElementFromHTML(strExt);
|
|
2254
2212
|
|
|
@@ -2260,8 +2218,8 @@ export default {
|
|
|
2260
2218
|
detail: {
|
|
2261
2219
|
item: ds,
|
|
2262
2220
|
data: data,
|
|
2263
|
-
originalEvt: e
|
|
2264
|
-
}
|
|
2221
|
+
originalEvt: e
|
|
2222
|
+
}
|
|
2265
2223
|
})
|
|
2266
2224
|
);
|
|
2267
2225
|
});
|
|
@@ -2274,8 +2232,8 @@ export default {
|
|
|
2274
2232
|
detail: {
|
|
2275
2233
|
item: ds,
|
|
2276
2234
|
data: data,
|
|
2277
|
-
originalEvt: e
|
|
2278
|
-
}
|
|
2235
|
+
originalEvt: e
|
|
2236
|
+
}
|
|
2279
2237
|
})
|
|
2280
2238
|
);
|
|
2281
2239
|
});
|
|
@@ -2304,7 +2262,13 @@ export default {
|
|
|
2304
2262
|
* @param {Boolean} [onlyStringContent = false] - para escoger si devuelve String o DomElement
|
|
2305
2263
|
* @return {String|Object} Elemento como String o DomElement
|
|
2306
2264
|
*/
|
|
2307
|
-
createDetailDay(
|
|
2265
|
+
createDetailDay(
|
|
2266
|
+
config,
|
|
2267
|
+
item = {},
|
|
2268
|
+
dataDay,
|
|
2269
|
+
tabSelected,
|
|
2270
|
+
onlyStringContent = false
|
|
2271
|
+
) {
|
|
2308
2272
|
let str = `
|
|
2309
2273
|
<div class="header-detail">
|
|
2310
2274
|
<div class="title truncate">
|
|
@@ -2323,8 +2287,8 @@ export default {
|
|
|
2323
2287
|
//para comprobar si tiene datos, se obtiene el primer valor
|
|
2324
2288
|
//de la lista de values de una capsula
|
|
2325
2289
|
let hasValues =
|
|
2326
|
-
cap.values.filter(
|
|
2327
|
-
utils.getVarByPath(dataDay.values, v.varName) !== null
|
|
2290
|
+
cap.values.filter(
|
|
2291
|
+
(v) => utils.getVarByPath(dataDay.values, v.varName) !== null
|
|
2328
2292
|
).length > 0;
|
|
2329
2293
|
let hideIf = false;
|
|
2330
2294
|
|
|
@@ -2359,8 +2323,9 @@ export default {
|
|
|
2359
2323
|
<div class="item-description"> `;
|
|
2360
2324
|
|
|
2361
2325
|
cap.values.forEach((v) => {
|
|
2362
|
-
|
|
2363
|
-
|
|
2326
|
+
let value = v.varName
|
|
2327
|
+
? utils.getVarByPath(dataDay.values, v.varName)
|
|
2328
|
+
: null;
|
|
2364
2329
|
|
|
2365
2330
|
if (cap.isLabeledArray) {
|
|
2366
2331
|
value.forEach((valueLabeled) => {
|
|
@@ -2370,14 +2335,16 @@ export default {
|
|
|
2370
2335
|
let tempValue = utils.getVarByPath(valueLabeled, valueName);
|
|
2371
2336
|
|
|
2372
2337
|
if (tempValue) {
|
|
2373
|
-
outputValue = v.round
|
|
2338
|
+
outputValue = v.round
|
|
2339
|
+
? utils.round(tempValue, v.round)
|
|
2340
|
+
: tempValue;
|
|
2374
2341
|
}
|
|
2375
2342
|
|
|
2376
2343
|
if (v.formatter) {
|
|
2377
2344
|
outputValue = v.formatter(valueLabeled);
|
|
2378
2345
|
}
|
|
2379
2346
|
|
|
2380
|
-
if(typeof outputValue == "number"){
|
|
2347
|
+
if (typeof outputValue == "number") {
|
|
2381
2348
|
outputValue = utils.formatNumber(outputValue);
|
|
2382
2349
|
}
|
|
2383
2350
|
|
|
@@ -2385,9 +2352,9 @@ export default {
|
|
|
2385
2352
|
outputValue == null
|
|
2386
2353
|
? ""
|
|
2387
2354
|
: `
|
|
2388
|
-
<div class="desc ${v.showColumn ?
|
|
2355
|
+
<div class="desc ${v.showColumn ? "desc-column" : ""}">
|
|
2389
2356
|
<div class="label">
|
|
2390
|
-
${
|
|
2357
|
+
${v.hideLabel ? "" : valueLabeled.label}
|
|
2391
2358
|
</div >
|
|
2392
2359
|
<div class="val">
|
|
2393
2360
|
<span class="prefix">
|
|
@@ -2406,14 +2373,13 @@ export default {
|
|
|
2406
2373
|
let outputValue = v.round ? utils.round(value, v.round) : value;
|
|
2407
2374
|
|
|
2408
2375
|
if (v.formatter) {
|
|
2409
|
-
outputValue = v.formatter({options:v,dataDay, outputValue});
|
|
2376
|
+
outputValue = v.formatter({ options: v, dataDay, outputValue });
|
|
2410
2377
|
}
|
|
2411
2378
|
|
|
2412
|
-
if(typeof outputValue == "number"){
|
|
2379
|
+
if (typeof outputValue == "number") {
|
|
2413
2380
|
outputValue = utils.formatNumber(outputValue);
|
|
2414
2381
|
}
|
|
2415
2382
|
|
|
2416
|
-
|
|
2417
2383
|
str +=
|
|
2418
2384
|
outputValue == null
|
|
2419
2385
|
? ""
|
|
@@ -2458,7 +2424,7 @@ export default {
|
|
|
2458
2424
|
dataDay.values[config.timeline.detailDay.pillsVarName].forEach((e) => {
|
|
2459
2425
|
let value = e.value;
|
|
2460
2426
|
|
|
2461
|
-
if(typeof outputValue == "number"){
|
|
2427
|
+
if (typeof outputValue == "number") {
|
|
2462
2428
|
value = utils.formatNumber(value);
|
|
2463
2429
|
}
|
|
2464
2430
|
|
|
@@ -2478,14 +2444,9 @@ export default {
|
|
|
2478
2444
|
|
|
2479
2445
|
if (dataDay && dataDay.errors && dataDay.errors.length > 0) {
|
|
2480
2446
|
dataDay.errors.forEach((err) => {
|
|
2481
|
-
let alertIcon = `<span class="alert-icon">
|
|
2482
|
-
<svg style="width:24px;height:24px" viewBox="0 0 24 24">
|
|
2483
|
-
<path fill="currentColor" d="M13 14H11V9H13M13 18H11V16H13M1 21H23L12 2L1 21Z" />
|
|
2484
|
-
</svg>
|
|
2485
|
-
</span>`;
|
|
2486
2447
|
str += `
|
|
2487
2448
|
<div class="alert">
|
|
2488
|
-
${
|
|
2449
|
+
${icons.alert}
|
|
2489
2450
|
${err.label}
|
|
2490
2451
|
</div>`;
|
|
2491
2452
|
});
|
|
@@ -2494,16 +2455,16 @@ export default {
|
|
|
2494
2455
|
let msg = null;
|
|
2495
2456
|
let author = null;
|
|
2496
2457
|
let dateMsg = null;
|
|
2497
|
-
if (dataDay ) {
|
|
2458
|
+
if (dataDay && tabSelected.floatBox && tabSelected.floatBox.messagePath) {
|
|
2498
2459
|
msg = utils.getVarByPath(dataDay, tabSelected.floatBox.messagePath);
|
|
2499
2460
|
|
|
2500
|
-
if(!msg && dataDay.message && dataDay.message.value){
|
|
2461
|
+
if (!msg && dataDay.message && dataDay.message.value) {
|
|
2501
2462
|
msg = dataDay.message.value;
|
|
2502
2463
|
author = dataDay.message.author;
|
|
2503
|
-
dateMsg = dateUtils.formatDateReadeable(
|
|
2464
|
+
dateMsg = dateUtils.formatDateReadeable(new Date(dataDay.message.date));
|
|
2504
2465
|
}
|
|
2505
2466
|
}
|
|
2506
|
-
if(msg){
|
|
2467
|
+
if (msg) {
|
|
2507
2468
|
//msg = msg.replace(/(\r\n|\r|\n)/g, '<br>');
|
|
2508
2469
|
str += `
|
|
2509
2470
|
<div class="msj-container">
|
|
@@ -2533,7 +2494,7 @@ export default {
|
|
|
2533
2494
|
* @return {String} Elemento como String, de detailDay
|
|
2534
2495
|
*/
|
|
2535
2496
|
redrawDetailDay(config, item, dataDay, tabSelected) {
|
|
2536
|
-
return this.createDetailDay(config, item, dataDay, tabSelected,true);
|
|
2497
|
+
return this.createDetailDay(config, item, dataDay, tabSelected, true);
|
|
2537
2498
|
},
|
|
2538
2499
|
|
|
2539
2500
|
/**
|
|
@@ -2588,7 +2549,7 @@ export default {
|
|
|
2588
2549
|
}
|
|
2589
2550
|
let $s = dom.createElement("div", {
|
|
2590
2551
|
className: "selected-day",
|
|
2591
|
-
attributes
|
|
2552
|
+
attributes
|
|
2592
2553
|
});
|
|
2593
2554
|
$s.style.left = s.pos.left + "px";
|
|
2594
2555
|
$s.style.top = s.pos.top + "px";
|
|
@@ -2629,8 +2590,8 @@ export default {
|
|
|
2629
2590
|
createButton(props) {
|
|
2630
2591
|
return dom.createElementFromHTML(`
|
|
2631
2592
|
<button class="${props.className || ""}" input-key="${
|
|
2632
|
-
|
|
2633
|
-
|
|
2593
|
+
props.key || ""
|
|
2594
|
+
}">
|
|
2634
2595
|
${props.label || ""}
|
|
2635
2596
|
</button>`);
|
|
2636
2597
|
},
|
|
@@ -2643,11 +2604,11 @@ export default {
|
|
|
2643
2604
|
createNavRightbuttons() {
|
|
2644
2605
|
let saveBtn = this.createButton({
|
|
2645
2606
|
label: "Guardar",
|
|
2646
|
-
className: "cap-btn-raised"
|
|
2607
|
+
className: "cap-btn-raised"
|
|
2647
2608
|
});
|
|
2648
2609
|
let cancelBtn = this.createButton({
|
|
2649
2610
|
label: "Cancelar",
|
|
2650
|
-
className: "cap-btn-outline"
|
|
2611
|
+
className: "cap-btn-outline"
|
|
2651
2612
|
});
|
|
2652
2613
|
let btnSection = dom.createElementFromHTML(
|
|
2653
2614
|
`<div class="button-section"></div>`
|
|
@@ -2659,7 +2620,7 @@ export default {
|
|
|
2659
2620
|
saveBtn.dispatchEvent(
|
|
2660
2621
|
new CustomEvent("saveMultiInput", {
|
|
2661
2622
|
bubbles: true,
|
|
2662
|
-
cancelable: false
|
|
2623
|
+
cancelable: false
|
|
2663
2624
|
})
|
|
2664
2625
|
);
|
|
2665
2626
|
});
|
|
@@ -2668,7 +2629,7 @@ export default {
|
|
|
2668
2629
|
cancelBtn.dispatchEvent(
|
|
2669
2630
|
new CustomEvent("cancelMultiInput", {
|
|
2670
2631
|
bubbles: true,
|
|
2671
|
-
cancelable: false
|
|
2632
|
+
cancelable: false
|
|
2672
2633
|
})
|
|
2673
2634
|
);
|
|
2674
2635
|
});
|
|
@@ -2687,11 +2648,12 @@ export default {
|
|
|
2687
2648
|
createInput(props, dataDay = null, daySelected = null, selected = []) {
|
|
2688
2649
|
let r = null;
|
|
2689
2650
|
|
|
2690
|
-
if (props.
|
|
2651
|
+
if (props.ignoreRender == true) return r;
|
|
2691
2652
|
|
|
2692
2653
|
switch (props.type) {
|
|
2693
|
-
case "
|
|
2694
|
-
r =
|
|
2654
|
+
case "custom":
|
|
2655
|
+
r = props.render ? props.render({props, dataDay, daySelected, selected}) : null;
|
|
2656
|
+
r.setAttribute("input-key", props.key);
|
|
2695
2657
|
break;
|
|
2696
2658
|
case "select":
|
|
2697
2659
|
r = this.createInputSelect(props, dataDay, daySelected);
|
|
@@ -2705,7 +2667,7 @@ export default {
|
|
|
2705
2667
|
case "text":
|
|
2706
2668
|
r = this.createText(props, selected);
|
|
2707
2669
|
break;
|
|
2708
|
-
case "title":
|
|
2670
|
+
case "title":
|
|
2709
2671
|
r = this.createTitle(props);
|
|
2710
2672
|
break;
|
|
2711
2673
|
case "number":
|
|
@@ -2723,6 +2685,9 @@ export default {
|
|
|
2723
2685
|
case "checkbox":
|
|
2724
2686
|
r = this.createInputCheckbox(props, dataDay);
|
|
2725
2687
|
break;
|
|
2688
|
+
case "inputList":
|
|
2689
|
+
r = this.createInputList(props, dataDay, daySelected);
|
|
2690
|
+
break;
|
|
2726
2691
|
case "input-box":
|
|
2727
2692
|
r = this.createInputBox(props, dataDay);
|
|
2728
2693
|
break;
|
|
@@ -2735,6 +2700,9 @@ export default {
|
|
|
2735
2700
|
case "button":
|
|
2736
2701
|
r = this.createInputButton(props, dataDay);
|
|
2737
2702
|
break;
|
|
2703
|
+
case "buttons-group":
|
|
2704
|
+
r = this.createInputButtonsGroup(props, dataDay);
|
|
2705
|
+
break;
|
|
2738
2706
|
case "time":
|
|
2739
2707
|
r = this.createInputTime(props, dataDay);
|
|
2740
2708
|
break;
|
|
@@ -2771,62 +2739,67 @@ export default {
|
|
|
2771
2739
|
}
|
|
2772
2740
|
}
|
|
2773
2741
|
|
|
2774
|
-
let
|
|
2775
|
-
<div class="input-section" input-key="${props.key || ""}">
|
|
2742
|
+
let $elem = dom.createElementFromHTML(`
|
|
2743
|
+
<div class="input-section ${props.isHidden ? 'hide':''} " input-key="${props.key || ""}">
|
|
2776
2744
|
<span class="text-subtitle d-block">
|
|
2777
2745
|
${props.label || ""}
|
|
2778
2746
|
</span>
|
|
2779
|
-
<div class="
|
|
2780
|
-
<
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2747
|
+
<div class="d-flex">
|
|
2748
|
+
<div class="time">
|
|
2749
|
+
<input type="number"
|
|
2750
|
+
class="hour"
|
|
2751
|
+
id="test"
|
|
2752
|
+
placeholder="00"
|
|
2753
|
+
min="0"
|
|
2754
|
+
max="24"
|
|
2755
|
+
value="${hhValue}">
|
|
2756
|
+
<span class="symbol">:</span>
|
|
2757
|
+
<input type="number"
|
|
2758
|
+
class="minutes"
|
|
2759
|
+
placeholder="00"
|
|
2760
|
+
min="0"
|
|
2761
|
+
max="59"
|
|
2762
|
+
value="${mmValue}">
|
|
2763
|
+
</div>
|
|
2764
|
+
<span class="text-hint">
|
|
2765
|
+
${props.textHint || ""}
|
|
2766
|
+
</span>
|
|
2794
2767
|
</div>
|
|
2795
2768
|
</div>`);
|
|
2796
2769
|
|
|
2797
|
-
let
|
|
2798
|
-
let
|
|
2770
|
+
let $hhInput = $elem.querySelector(".hour");
|
|
2771
|
+
let $mmInput = $elem.querySelector(".minutes");
|
|
2799
2772
|
|
|
2800
|
-
|
|
2801
|
-
|
|
2773
|
+
$hhInput.addEventListener("input", (e) => {
|
|
2774
|
+
$hhInput.dispatchEvent(
|
|
2802
2775
|
new CustomEvent("changeTimeInputHH", {
|
|
2803
2776
|
bubbles: true,
|
|
2804
2777
|
cancelable: false,
|
|
2805
2778
|
detail: {
|
|
2806
2779
|
key: props.key,
|
|
2807
|
-
value: e.srcElement.value
|
|
2808
|
-
}
|
|
2780
|
+
value: e.srcElement.value
|
|
2781
|
+
}
|
|
2809
2782
|
})
|
|
2810
2783
|
);
|
|
2811
2784
|
});
|
|
2812
2785
|
|
|
2813
|
-
|
|
2814
|
-
|
|
2786
|
+
$mmInput.addEventListener("input", (e) => {
|
|
2787
|
+
$mmInput.dispatchEvent(
|
|
2815
2788
|
new CustomEvent("changeTimeInputMM", {
|
|
2816
2789
|
bubbles: true,
|
|
2817
2790
|
cancelable: false,
|
|
2818
2791
|
detail: {
|
|
2819
2792
|
key: props.key,
|
|
2820
|
-
value: e.srcElement.value
|
|
2821
|
-
}
|
|
2793
|
+
value: e.srcElement.value
|
|
2794
|
+
}
|
|
2822
2795
|
})
|
|
2823
2796
|
);
|
|
2824
2797
|
});
|
|
2825
2798
|
|
|
2826
|
-
this.addKeyDownInputEvents(
|
|
2827
|
-
this.addKeyDownInputEvents(
|
|
2799
|
+
this.addKeyDownInputEvents($hhInput, $elem, props);
|
|
2800
|
+
this.addKeyDownInputEvents($mmInput, $elem, props);
|
|
2828
2801
|
|
|
2829
|
-
return
|
|
2802
|
+
return $elem;
|
|
2830
2803
|
},
|
|
2831
2804
|
|
|
2832
2805
|
/**
|
|
@@ -2842,7 +2815,7 @@ export default {
|
|
|
2842
2815
|
label = props.formatter({ selected });
|
|
2843
2816
|
}
|
|
2844
2817
|
let $elem = dom.createElementFromHTML(`
|
|
2845
|
-
<div class="input-section" input-key="${props.key || ""}">
|
|
2818
|
+
<div class="input-section ${props.isHidden ? 'hide':''} " input-key="${props.key || ""}">
|
|
2846
2819
|
<span class="${props.classNames || ""}">
|
|
2847
2820
|
${label}
|
|
2848
2821
|
</span>
|
|
@@ -2863,7 +2836,7 @@ export default {
|
|
|
2863
2836
|
classNames = "text-subtitle";
|
|
2864
2837
|
}
|
|
2865
2838
|
return dom.createElementFromHTML(`
|
|
2866
|
-
<div class="input-section" input-key="${props.key || ""}">
|
|
2839
|
+
<div class="input-section ${props.isHidden ? 'hide': ''} " input-key="${props.key || ""}">
|
|
2867
2840
|
<span class="${classNames}">
|
|
2868
2841
|
${props.label}
|
|
2869
2842
|
</span>
|
|
@@ -2885,9 +2858,9 @@ export default {
|
|
|
2885
2858
|
value = value || "";
|
|
2886
2859
|
|
|
2887
2860
|
let elem = dom.createElementFromHTML(`
|
|
2888
|
-
<div class="input-section ${props.classNames || ""}" input-key="${
|
|
2889
|
-
|
|
2890
|
-
|
|
2861
|
+
<div class="input-section ${props.classNames || ""} ${props.isHidden ? 'hide':''} " input-key="${
|
|
2862
|
+
props.key || ""
|
|
2863
|
+
}">
|
|
2891
2864
|
<div class="input-section-title">
|
|
2892
2865
|
<span class="text-subtitle">
|
|
2893
2866
|
${props.label}
|
|
@@ -2896,13 +2869,20 @@ export default {
|
|
|
2896
2869
|
${props.suffix ? "(" + props.suffix + ")" : ""}
|
|
2897
2870
|
</span>
|
|
2898
2871
|
</div>
|
|
2899
|
-
<
|
|
2900
|
-
|
|
2901
|
-
|
|
2872
|
+
<div class="d-flex">
|
|
2873
|
+
<input type="number"
|
|
2874
|
+
class="nav-input"
|
|
2875
|
+
value="${value}">
|
|
2876
|
+
|
|
2877
|
+
<span class="text-hint">
|
|
2878
|
+
${props.textHint || ""}
|
|
2879
|
+
</span>
|
|
2880
|
+
</div>
|
|
2902
2881
|
</div>`);
|
|
2903
2882
|
|
|
2904
2883
|
let inputElem = elem.querySelector("input");
|
|
2905
|
-
|
|
2884
|
+
|
|
2885
|
+
this.addKeyDownInputEvents(inputElem, elem, props);
|
|
2906
2886
|
|
|
2907
2887
|
return elem;
|
|
2908
2888
|
},
|
|
@@ -2930,9 +2910,9 @@ export default {
|
|
|
2930
2910
|
filePath = filePath || "";
|
|
2931
2911
|
|
|
2932
2912
|
let elem = dom.createElementFromHTML(`
|
|
2933
|
-
<div class="input-section ${props.classNames || ""}" input-key="${
|
|
2934
|
-
|
|
2935
|
-
|
|
2913
|
+
<div class="input-section ${props.classNames || ""} ${props.isHidden ? 'hide':''} " input-key="${
|
|
2914
|
+
props.key || ""
|
|
2915
|
+
}">
|
|
2936
2916
|
|
|
2937
2917
|
<div class="input-section-title">
|
|
2938
2918
|
<span class="text-subtitle">
|
|
@@ -2976,7 +2956,6 @@ export default {
|
|
|
2976
2956
|
return elem;
|
|
2977
2957
|
},
|
|
2978
2958
|
|
|
2979
|
-
|
|
2980
2959
|
createFileLink(props, dataDay) {
|
|
2981
2960
|
let fileName = "";
|
|
2982
2961
|
let filePath = "";
|
|
@@ -2987,15 +2966,15 @@ export default {
|
|
|
2987
2966
|
filePath = utils.getVarByPath(dataDay, props.filePathValue);
|
|
2988
2967
|
}
|
|
2989
2968
|
|
|
2990
|
-
if(fileName == "") return null;
|
|
2969
|
+
if (fileName == "") return null;
|
|
2991
2970
|
|
|
2992
2971
|
fileName = fileName || "";
|
|
2993
2972
|
filePath = filePath || "";
|
|
2994
2973
|
|
|
2995
2974
|
let elem = dom.createElementFromHTML(`
|
|
2996
|
-
<div class="input-section ${props.classNames || ""}" input-key="${
|
|
2997
|
-
|
|
2998
|
-
|
|
2975
|
+
<div class="input-section ${props.classNames || ""} ${props.isHidden ? 'hide':''} " input-key="${
|
|
2976
|
+
props.key || ""
|
|
2977
|
+
}">
|
|
2999
2978
|
|
|
3000
2979
|
<div class="input-section-title">
|
|
3001
2980
|
<span class="text-subtitle">
|
|
@@ -3023,7 +3002,6 @@ export default {
|
|
|
3023
3002
|
* @return {Object} Elemento Dom del input creado
|
|
3024
3003
|
*/
|
|
3025
3004
|
createInputList(props, dataDay, daySelected = null) {
|
|
3026
|
-
let value = null;
|
|
3027
3005
|
let inputList = [];
|
|
3028
3006
|
|
|
3029
3007
|
//obtiene inputs default, para crearlos, sin valores
|
|
@@ -3055,7 +3033,7 @@ export default {
|
|
|
3055
3033
|
});
|
|
3056
3034
|
}
|
|
3057
3035
|
|
|
3058
|
-
let str = `<div input-key="${props.key || ""}" class="input-section-list">
|
|
3036
|
+
let str = `<div input-key="${props.key || ""}" class="input-section-list ${props.isHidden ? 'hide': ''} ">
|
|
3059
3037
|
<div class="input-section-title">
|
|
3060
3038
|
<span class="text-title">
|
|
3061
3039
|
${props.label}
|
|
@@ -3063,7 +3041,9 @@ export default {
|
|
|
3063
3041
|
</div>`;
|
|
3064
3042
|
inputList.forEach((inputRow) => {
|
|
3065
3043
|
str += `
|
|
3066
|
-
<div class="input-section ${
|
|
3044
|
+
<div class="input-section ${
|
|
3045
|
+
props.toRight ? "to-right" : ""
|
|
3046
|
+
}" >
|
|
3067
3047
|
<span class="text-subtitle">
|
|
3068
3048
|
${inputRow.label}
|
|
3069
3049
|
</span>`;
|
|
@@ -3089,11 +3069,10 @@ export default {
|
|
|
3089
3069
|
let elem = dom.createElementFromHTML(str);
|
|
3090
3070
|
|
|
3091
3071
|
let inputsElem = elem.querySelectorAll("input");
|
|
3092
|
-
inputsElem.forEach((inputElem) => this.addKeyDownInputEvents(inputElem));
|
|
3072
|
+
inputsElem.forEach((inputElem) => this.addKeyDownInputEvents(inputElem, elem, props));
|
|
3093
3073
|
return elem;
|
|
3094
3074
|
},
|
|
3095
3075
|
|
|
3096
|
-
|
|
3097
3076
|
createInputSelect(props, dataDay, daySelected = null) {
|
|
3098
3077
|
let value = null;
|
|
3099
3078
|
let options = props.options;
|
|
@@ -3103,7 +3082,7 @@ export default {
|
|
|
3103
3082
|
value = val ? val.value : null;
|
|
3104
3083
|
}
|
|
3105
3084
|
|
|
3106
|
-
let str = `<div input-key="${props.key || ""}" >
|
|
3085
|
+
let str = `<div input-key="${props.key || ""}" class="${props.isHidden ? 'hide': ''}" >
|
|
3107
3086
|
<div class="input-section " >
|
|
3108
3087
|
<span class="text-subtitle">
|
|
3109
3088
|
${props.label}
|
|
@@ -3111,21 +3090,22 @@ export default {
|
|
|
3111
3090
|
|
|
3112
3091
|
<select class="input-select">
|
|
3113
3092
|
|
|
3114
|
-
<option value="" ${value == null ?
|
|
3093
|
+
<option value="" ${value == null ? "selected" : ""}>
|
|
3115
3094
|
${props.noDataLabel || "-- sin asignar --"}
|
|
3116
3095
|
</option>
|
|
3117
3096
|
|
|
3118
3097
|
`;
|
|
3119
3098
|
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3099
|
+
options.forEach((option) => {
|
|
3100
|
+
str += `
|
|
3101
|
+
<option value="${option.id}" ${
|
|
3102
|
+
option.id == value ? "selected" : ""
|
|
3103
|
+
}>
|
|
3124
3104
|
${option.label}
|
|
3125
3105
|
</option>
|
|
3126
3106
|
`;
|
|
3127
|
-
|
|
3128
|
-
|
|
3107
|
+
});
|
|
3108
|
+
str += `
|
|
3129
3109
|
|
|
3130
3110
|
</select>
|
|
3131
3111
|
</div>
|
|
@@ -3150,7 +3130,7 @@ export default {
|
|
|
3150
3130
|
value = utils.getVarByPath(dataDay, props.varName);
|
|
3151
3131
|
}
|
|
3152
3132
|
let elem = dom.createElementFromHTML(`
|
|
3153
|
-
<div class="input-section" input-key="${props.key || ""}">
|
|
3133
|
+
<div class="input-section ${props.isHidden ? 'hide':''} " input-key="${props.key || ""}">
|
|
3154
3134
|
<span class="text-subtitle d-block">
|
|
3155
3135
|
${props.label}
|
|
3156
3136
|
</span>
|
|
@@ -3158,7 +3138,7 @@ export default {
|
|
|
3158
3138
|
</div>`);
|
|
3159
3139
|
|
|
3160
3140
|
let inputElem = elem.querySelector("textarea");
|
|
3161
|
-
this.addKeyDownInputEvents(inputElem);
|
|
3141
|
+
this.addKeyDownInputEvents(inputElem, elem, props);
|
|
3162
3142
|
return elem;
|
|
3163
3143
|
},
|
|
3164
3144
|
|
|
@@ -3173,7 +3153,7 @@ export default {
|
|
|
3173
3153
|
createInputMessage(props, dataDay) {
|
|
3174
3154
|
let value = dataDay ? utils.getVarByPath(dataDay, props.varName) : null;
|
|
3175
3155
|
let elem = dom.createElementFromHTML(`
|
|
3176
|
-
<div class="input-section msj-input-container"
|
|
3156
|
+
<div class="input-section msj-input-container ${props.isHidden ? 'hide':''} "
|
|
3177
3157
|
input-key="${props.key || ""}">
|
|
3178
3158
|
<span class="text-subtitle d-block">
|
|
3179
3159
|
Mensaje
|
|
@@ -3199,7 +3179,7 @@ export default {
|
|
|
3199
3179
|
value = utils.getVarByPath(dataDay, props.varName);
|
|
3200
3180
|
}
|
|
3201
3181
|
let elem = dom.createElementFromHTML(`
|
|
3202
|
-
<div class="input-section" input-key="${props.key || ""}">
|
|
3182
|
+
<div class="input-section ${props.isHidden ? 'hide':''} " input-key="${props.key || ""}">
|
|
3203
3183
|
<span class="text-subtitle d-block">
|
|
3204
3184
|
${props.label}
|
|
3205
3185
|
</span>
|
|
@@ -3207,7 +3187,7 @@ export default {
|
|
|
3207
3187
|
</div>`);
|
|
3208
3188
|
|
|
3209
3189
|
let inputElem = elem.querySelector("input");
|
|
3210
|
-
this.addKeyDownInputEvents(inputElem);
|
|
3190
|
+
this.addKeyDownInputEvents(inputElem, elem, props);
|
|
3211
3191
|
return elem;
|
|
3212
3192
|
},
|
|
3213
3193
|
|
|
@@ -3224,7 +3204,7 @@ export default {
|
|
|
3224
3204
|
value = utils.getVarByPath(dataDay, props.varName);
|
|
3225
3205
|
}
|
|
3226
3206
|
let elem = dom.createElementFromHTML(`
|
|
3227
|
-
<div class="input-section" input-key="${props.key || ""}">
|
|
3207
|
+
<div class="input-section ${props.isHidden ? 'hide':''} " input-key="${props.key || ""}">
|
|
3228
3208
|
<span class="text-subtitle d-block">
|
|
3229
3209
|
${props.label}
|
|
3230
3210
|
</span>
|
|
@@ -3232,12 +3212,10 @@ export default {
|
|
|
3232
3212
|
</div>`);
|
|
3233
3213
|
|
|
3234
3214
|
let inputElem = elem.querySelector("input");
|
|
3235
|
-
this.addKeyDownInputEvents(inputElem);
|
|
3215
|
+
this.addKeyDownInputEvents(inputElem, elem, props);
|
|
3236
3216
|
return elem;
|
|
3237
3217
|
},
|
|
3238
3218
|
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
3219
|
createDataList(props, dataDay) {
|
|
3242
3220
|
let list = [];
|
|
3243
3221
|
if (dataDay && dataDay.values) {
|
|
@@ -3251,16 +3229,16 @@ export default {
|
|
|
3251
3229
|
</button>
|
|
3252
3230
|
</div>`;
|
|
3253
3231
|
|
|
3254
|
-
let editBtn =
|
|
3232
|
+
let editBtn = "";
|
|
3255
3233
|
|
|
3256
|
-
if(props.editButton){
|
|
3257
|
-
editBtn =
|
|
3234
|
+
if (props.editButton) {
|
|
3235
|
+
editBtn = `<button class="cap-btn-outline cap-btn-sm edit-btn" input-key="${props.editButton.key}">
|
|
3258
3236
|
${props.editButton.label}
|
|
3259
|
-
</button>
|
|
3237
|
+
</button> `;
|
|
3260
3238
|
}
|
|
3261
|
-
|
|
3239
|
+
|
|
3262
3240
|
let str = `
|
|
3263
|
-
<div class="input-section" input-key="${props.key || ""}">
|
|
3241
|
+
<div class="input-section ${props.isHidden ? 'hide':''} " input-key="${props.key || ""}">
|
|
3264
3242
|
<div class="input-section-title">
|
|
3265
3243
|
<span class="text-subtitle d-block">
|
|
3266
3244
|
${props.label}
|
|
@@ -3272,63 +3250,66 @@ export default {
|
|
|
3272
3250
|
</div>
|
|
3273
3251
|
</div> `;
|
|
3274
3252
|
|
|
3275
|
-
|
|
3276
3253
|
let $el = dom.createElementFromHTML(str);
|
|
3277
3254
|
let $searchInput = $el.querySelector(".search-input");
|
|
3278
3255
|
let $searchInputClear = $el.querySelector(".search-input-clear");
|
|
3279
3256
|
let $inputBox = $el.querySelector(".input-box");
|
|
3280
3257
|
|
|
3281
3258
|
list.map((item, j) => {
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3259
|
+
let label =
|
|
3260
|
+
utils.getVarByPath(item, props.varNameLabel) || dataDay.label || "__";
|
|
3261
|
+
|
|
3262
|
+
let $elItem = this.createDataListItem({
|
|
3263
|
+
label,
|
|
3264
|
+
valueText: utils.getVarByPath(item, props.varNameValueText) || "",
|
|
3265
|
+
subText: utils.getVarByPath(item, props.varNameSubText) || "",
|
|
3266
|
+
id: "list-item-" + (dataDay.id || j),
|
|
3267
|
+
key: "list-item-" + (dataDay.id || j),
|
|
3268
|
+
tooltip: utils.getVarByPath(item, props.varNameTooltip) || label,
|
|
3269
|
+
//colorIcon: "c-red",
|
|
3270
|
+
link: utils.getVarByPath(item, props.varNameLink) || null,
|
|
3271
|
+
suffix: utils.getVarByPath(item, props.varNameSuffix) || null,
|
|
3272
|
+
//value: JSON.stringify(utils.getVarByPath(item, props.varNameInput)) || {}
|
|
3273
|
+
});
|
|
3274
|
+
$inputBox.appendChild($elItem);
|
|
3275
|
+
});
|
|
3297
3276
|
|
|
3298
|
-
$searchInputClear.addEventListener("click", e => {
|
|
3277
|
+
$searchInputClear.addEventListener("click", (e) => {
|
|
3299
3278
|
$searchInput.value = "";
|
|
3300
|
-
$searchInput.dispatchEvent(new Event(
|
|
3279
|
+
$searchInput.dispatchEvent(new Event("input", { bubbles: true }));
|
|
3301
3280
|
});
|
|
3302
3281
|
|
|
3303
|
-
$searchInput.addEventListener(
|
|
3304
|
-
if(e.key === "Escape"){
|
|
3282
|
+
$searchInput.addEventListener("keydown", (e) => {
|
|
3283
|
+
if (e.key === "Escape") {
|
|
3305
3284
|
$searchInput.value = "";
|
|
3306
|
-
$searchInput.dispatchEvent(new Event(
|
|
3285
|
+
$searchInput.dispatchEvent(new Event("input", { bubbles: true }));
|
|
3307
3286
|
}
|
|
3308
|
-
});
|
|
3287
|
+
});
|
|
3309
3288
|
|
|
3310
|
-
$searchInput.addEventListener("input", e => {
|
|
3289
|
+
$searchInput.addEventListener("input", (e) => {
|
|
3311
3290
|
let $inputs = [];
|
|
3312
3291
|
$inputs = $el.querySelectorAll(".mini-input-section") || [];
|
|
3313
|
-
$inputs.forEach($i => {
|
|
3292
|
+
$inputs.forEach(($i) => {
|
|
3314
3293
|
let label = $i.getAttribute("label");
|
|
3315
3294
|
let search = $searchInput.value;
|
|
3316
|
-
if(label.toLowerCase().includes(search.toLowerCase())){
|
|
3295
|
+
if (label.toLowerCase().includes(search.toLowerCase())) {
|
|
3317
3296
|
$i.classList.remove("hide");
|
|
3318
|
-
}else{
|
|
3297
|
+
} else {
|
|
3319
3298
|
$i.classList.add("hide");
|
|
3320
3299
|
}
|
|
3321
3300
|
});
|
|
3322
3301
|
});
|
|
3323
3302
|
|
|
3324
3303
|
let button = $el.querySelector("button.edit-btn");
|
|
3325
|
-
if(button && props.editButton && props.editButton.onClick){
|
|
3326
|
-
button.addEventListener("click", (e) =>
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3304
|
+
if (button && props.editButton && props.editButton.onClick) {
|
|
3305
|
+
button.addEventListener("click", (e) =>
|
|
3306
|
+
props.editButton.onClick({
|
|
3307
|
+
event: e,
|
|
3308
|
+
props,
|
|
3309
|
+
dataDay,
|
|
3310
|
+
$element: $el
|
|
3311
|
+
})
|
|
3312
|
+
);
|
|
3332
3313
|
}
|
|
3333
3314
|
|
|
3334
3315
|
return $el;
|
|
@@ -3336,6 +3317,7 @@ export default {
|
|
|
3336
3317
|
|
|
3337
3318
|
createDataListItem({
|
|
3338
3319
|
label = "",
|
|
3320
|
+
valueText = "",
|
|
3339
3321
|
subText = "",
|
|
3340
3322
|
id = "",
|
|
3341
3323
|
key = "",
|
|
@@ -3343,37 +3325,38 @@ export default {
|
|
|
3343
3325
|
colorIcon = "",
|
|
3344
3326
|
link = null,
|
|
3345
3327
|
suffix = null,
|
|
3346
|
-
value = ""
|
|
3347
|
-
}){
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
let str = "";
|
|
3328
|
+
value = ""
|
|
3329
|
+
}) {
|
|
3330
|
+
let tooltipStr = "";
|
|
3331
|
+
let iconStr = null;
|
|
3332
|
+
let linkStr = "";
|
|
3333
|
+
let str = "";
|
|
3353
3334
|
|
|
3354
|
-
|
|
3355
|
-
|
|
3335
|
+
if (tooltip) {
|
|
3336
|
+
tooltipStr = `
|
|
3356
3337
|
<div class="mini-input-section--tooltip">
|
|
3357
3338
|
${tooltip}
|
|
3358
3339
|
</div>`;
|
|
3359
|
-
|
|
3340
|
+
}
|
|
3360
3341
|
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3342
|
+
if (colorIcon) {
|
|
3343
|
+
if (utils.isHexColor(itemFormated.colorIcon)) {
|
|
3344
|
+
iconStr = `<div class="mini-input-section--icon" style="background:${colorIcon}"> </div>`;
|
|
3345
|
+
} else {
|
|
3346
|
+
iconStr = `<div class="mini-input-section--icon ${colorIcon}"> </div>`;
|
|
3347
|
+
}
|
|
3348
|
+
}
|
|
3368
3349
|
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3350
|
+
if (link) {
|
|
3351
|
+
linkStr = `<a class="mini-input-section--link" target="_blank" href="${link}">${icons.linkIcon}</a> `;
|
|
3352
|
+
}
|
|
3372
3353
|
|
|
3373
|
-
|
|
3374
|
-
<div class="mini-input-section ${
|
|
3354
|
+
str += `
|
|
3355
|
+
<div class="mini-input-section ${
|
|
3356
|
+
iconStr ? "has-icon" : ""
|
|
3357
|
+
} " label="${label}" data-id="${id}" data-key="${key}" data-value="${value || ''}">
|
|
3375
3358
|
<label>
|
|
3376
|
-
${iconStr ||
|
|
3359
|
+
${iconStr || ""}
|
|
3377
3360
|
|
|
3378
3361
|
<div class="mini-input-section--titles">
|
|
3379
3362
|
<div class="mini-input-section--title truncate">
|
|
@@ -3385,10 +3368,10 @@ export default {
|
|
|
3385
3368
|
</div>
|
|
3386
3369
|
|
|
3387
3370
|
<div class="mini-input-section--content" >
|
|
3388
|
-
${
|
|
3371
|
+
${valueText}
|
|
3389
3372
|
</div>
|
|
3390
3373
|
<div class="mini-input-section--suffix" >
|
|
3391
|
-
${suffix
|
|
3374
|
+
${suffix}
|
|
3392
3375
|
</div>
|
|
3393
3376
|
|
|
3394
3377
|
${linkStr}
|
|
@@ -3396,17 +3379,10 @@ export default {
|
|
|
3396
3379
|
</label>
|
|
3397
3380
|
${tooltipStr}
|
|
3398
3381
|
</div>`;
|
|
3399
|
-
|
|
3382
|
+
return dom.createElementFromHTML(str);
|
|
3400
3383
|
},
|
|
3401
3384
|
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
3385
|
createList(props, dataDay) {
|
|
3405
|
-
let value = [];
|
|
3406
|
-
if (dataDay && dataDay.values) {
|
|
3407
|
-
value = utils.getVarByPath(dataDay, props.varName);
|
|
3408
|
-
}
|
|
3409
|
-
|
|
3410
3386
|
let tabsContainer = "";
|
|
3411
3387
|
|
|
3412
3388
|
if (props.tabs) {
|
|
@@ -3425,7 +3401,6 @@ export default {
|
|
|
3425
3401
|
`;
|
|
3426
3402
|
}
|
|
3427
3403
|
|
|
3428
|
-
|
|
3429
3404
|
let searchInput = `
|
|
3430
3405
|
<div class="search-input-container">
|
|
3431
3406
|
<input id="" type="text" name="" class="search-input" placeholder="buscar">
|
|
@@ -3435,10 +3410,8 @@ export default {
|
|
|
3435
3410
|
</div>
|
|
3436
3411
|
`;
|
|
3437
3412
|
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
3413
|
let str = `
|
|
3441
|
-
<div class="input-section" input-key="${props.key || ""}">
|
|
3414
|
+
<div class="input-section ${props.isHidden ? 'hide':''} " input-key="${props.key || ""}">
|
|
3442
3415
|
<span class="text-subtitle d-block">
|
|
3443
3416
|
${props.label}
|
|
3444
3417
|
</span>
|
|
@@ -3452,8 +3425,7 @@ export default {
|
|
|
3452
3425
|
//TODO obtener input segun fila
|
|
3453
3426
|
if (props.inputs) {
|
|
3454
3427
|
props.inputs.forEach((i) => {
|
|
3455
|
-
if(i.isTitle){
|
|
3456
|
-
|
|
3428
|
+
if (i.isTitle) {
|
|
3457
3429
|
let tooltip = "";
|
|
3458
3430
|
let icon = null;
|
|
3459
3431
|
|
|
@@ -3473,24 +3445,19 @@ export default {
|
|
|
3473
3445
|
}
|
|
3474
3446
|
}
|
|
3475
3447
|
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3448
|
+
str += `
|
|
3449
|
+
<div class="mini-input-section is-title ${
|
|
3450
|
+
icon ? "has-icon" : ""
|
|
3451
|
+
}" input-tab-key="${i.tabKey || ""}" label="${i.label}">
|
|
3479
3452
|
<label>
|
|
3480
|
-
${icon ||
|
|
3453
|
+
${icon || ""}
|
|
3481
3454
|
<div class="mini-input-section--title truncate">
|
|
3482
3455
|
${i.label}
|
|
3483
3456
|
</div>
|
|
3484
3457
|
</label>
|
|
3485
3458
|
${tooltip}
|
|
3486
3459
|
</div>`;
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
}else{
|
|
3491
|
-
let value_found = value ? value.find((val) => val.id == i.id) : null;
|
|
3492
|
-
let v = value_found || "";
|
|
3493
|
-
let inputValue =props.varNameInput && v[props.varNameInput ] ? v[props.varNameInput ] : v.value;
|
|
3460
|
+
} else {
|
|
3494
3461
|
let tooltip = "";
|
|
3495
3462
|
let icon = null;
|
|
3496
3463
|
let link = "";
|
|
@@ -3510,14 +3477,16 @@ export default {
|
|
|
3510
3477
|
}
|
|
3511
3478
|
}
|
|
3512
3479
|
|
|
3513
|
-
if(i.link){
|
|
3480
|
+
if (i.link) {
|
|
3514
3481
|
link = `<a class="mini-input-section--link" target="_blank" href="${i.link}">
|
|
3515
3482
|
${icons.linkIcon}
|
|
3516
|
-
</a>
|
|
3483
|
+
</a> `;
|
|
3517
3484
|
}
|
|
3518
3485
|
|
|
3519
3486
|
str += `
|
|
3520
|
-
<div class="mini-input-section ${
|
|
3487
|
+
<div class="mini-input-section ${
|
|
3488
|
+
icon ? "has-icon" : ""
|
|
3489
|
+
}" input-tab-key="${i.tabKey || ""}" label="${i.label}">
|
|
3521
3490
|
<label>
|
|
3522
3491
|
|
|
3523
3492
|
${icon}
|
|
@@ -3534,8 +3503,8 @@ export default {
|
|
|
3534
3503
|
|
|
3535
3504
|
</label>
|
|
3536
3505
|
<div class="mini-input-section--footer">
|
|
3537
|
-
<span class="start">
|
|
3538
|
-
<span class="end">
|
|
3506
|
+
<span class="start"> start</span>
|
|
3507
|
+
<span class="end"> end </span>
|
|
3539
3508
|
</div>
|
|
3540
3509
|
${tooltip}
|
|
3541
3510
|
</div>`;
|
|
@@ -3556,40 +3525,44 @@ export default {
|
|
|
3556
3525
|
t.addEventListener("click", (e) => {
|
|
3557
3526
|
this.selectInputBoxTab(t, $el);
|
|
3558
3527
|
$searchInput.value = "";
|
|
3559
|
-
$searchInput.dispatchEvent(new Event(
|
|
3528
|
+
$searchInput.dispatchEvent(new Event("input", { bubbles: true }));
|
|
3560
3529
|
});
|
|
3561
3530
|
});
|
|
3562
3531
|
|
|
3563
|
-
if($searchInputClear){
|
|
3564
|
-
$searchInputClear.addEventListener("click", e => {
|
|
3532
|
+
if ($searchInputClear) {
|
|
3533
|
+
$searchInputClear.addEventListener("click", (e) => {
|
|
3565
3534
|
$searchInput.value = "";
|
|
3566
|
-
$searchInput.dispatchEvent(new Event(
|
|
3535
|
+
$searchInput.dispatchEvent(new Event("input", { bubbles: true }));
|
|
3567
3536
|
});
|
|
3568
3537
|
}
|
|
3569
3538
|
|
|
3570
|
-
if($searchInput){
|
|
3571
|
-
$searchInput.addEventListener(
|
|
3572
|
-
if(e.key === "Escape"){
|
|
3539
|
+
if ($searchInput) {
|
|
3540
|
+
$searchInput.addEventListener("keydown", (e) => {
|
|
3541
|
+
if (e.key === "Escape") {
|
|
3573
3542
|
$searchInput.value = "";
|
|
3574
|
-
$searchInput.dispatchEvent(new Event(
|
|
3543
|
+
$searchInput.dispatchEvent(new Event("input", { bubbles: true }));
|
|
3575
3544
|
}
|
|
3576
|
-
});
|
|
3545
|
+
});
|
|
3577
3546
|
|
|
3578
|
-
$searchInput.addEventListener("input", e => {
|
|
3579
|
-
let $tabSelected =
|
|
3547
|
+
$searchInput.addEventListener("input", (e) => {
|
|
3548
|
+
let $tabSelected =
|
|
3549
|
+
$el.querySelector(".input-box-tab[tab-key].active") || null;
|
|
3580
3550
|
let $inputs = [];
|
|
3581
|
-
if($tabSelected){
|
|
3551
|
+
if ($tabSelected) {
|
|
3582
3552
|
let tabKey = $tabSelected.getAttribute("tab-key");
|
|
3583
|
-
$inputs =
|
|
3584
|
-
|
|
3553
|
+
$inputs =
|
|
3554
|
+
$el.querySelectorAll(
|
|
3555
|
+
".mini-input-section[input-tab-key='" + tabKey + "']"
|
|
3556
|
+
) || [];
|
|
3557
|
+
} else {
|
|
3585
3558
|
$inputs = $el.querySelectorAll(".mini-input-section") || [];
|
|
3586
3559
|
}
|
|
3587
|
-
$inputs.forEach($i => {
|
|
3560
|
+
$inputs.forEach(($i) => {
|
|
3588
3561
|
let label = $i.getAttribute("label");
|
|
3589
3562
|
let search = $searchInput.value;
|
|
3590
|
-
if(label.toLowerCase().includes(search.toLowerCase())){
|
|
3563
|
+
if (label.toLowerCase().includes(search.toLowerCase())) {
|
|
3591
3564
|
$i.classList.remove("hide");
|
|
3592
|
-
}else{
|
|
3565
|
+
} else {
|
|
3593
3566
|
$i.classList.add("hide");
|
|
3594
3567
|
}
|
|
3595
3568
|
});
|
|
@@ -3601,10 +3574,6 @@ export default {
|
|
|
3601
3574
|
return $el;
|
|
3602
3575
|
},
|
|
3603
3576
|
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
3577
|
/**
|
|
3609
3578
|
* Crea InputBox, como elemento Dom
|
|
3610
3579
|
* un InputBox es un contenedor con una lista de inputs
|
|
@@ -3637,8 +3606,7 @@ export default {
|
|
|
3637
3606
|
`;
|
|
3638
3607
|
}
|
|
3639
3608
|
|
|
3640
|
-
|
|
3641
|
-
let searchInput= `
|
|
3609
|
+
let searchInput = `
|
|
3642
3610
|
<div class="search-input-container">
|
|
3643
3611
|
<input id="" type="text" name="" class="search-input" placeholder="buscar">
|
|
3644
3612
|
<button class="search-input-clear">
|
|
@@ -3647,10 +3615,8 @@ export default {
|
|
|
3647
3615
|
</div>
|
|
3648
3616
|
`;
|
|
3649
3617
|
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
3618
|
let str = `
|
|
3653
|
-
<div class="input-section" input-key="${props.key || ""}">
|
|
3619
|
+
<div class="input-section ${props.isHidden ? 'hide':''} " input-key="${props.key || ""}">
|
|
3654
3620
|
<span class="text-subtitle d-block">
|
|
3655
3621
|
${props.label}
|
|
3656
3622
|
</span>
|
|
@@ -3664,8 +3630,7 @@ export default {
|
|
|
3664
3630
|
|
|
3665
3631
|
if (props.inputs) {
|
|
3666
3632
|
props.inputs.forEach((i) => {
|
|
3667
|
-
if(i.isTitle){
|
|
3668
|
-
|
|
3633
|
+
if (i.isTitle) {
|
|
3669
3634
|
let tooltip = "";
|
|
3670
3635
|
let icon = "";
|
|
3671
3636
|
|
|
@@ -3685,9 +3650,10 @@ export default {
|
|
|
3685
3650
|
}
|
|
3686
3651
|
}
|
|
3687
3652
|
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3653
|
+
str += `
|
|
3654
|
+
<div class="mini-input-section is-title" input-tab-key="${
|
|
3655
|
+
i.tabKey || ""
|
|
3656
|
+
}" label="${i.label}">
|
|
3691
3657
|
<label>
|
|
3692
3658
|
${icon}
|
|
3693
3659
|
<div class="mini-input-section--title truncate">
|
|
@@ -3696,13 +3662,13 @@ export default {
|
|
|
3696
3662
|
</label>
|
|
3697
3663
|
${tooltip}
|
|
3698
3664
|
</div>`;
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
}else{
|
|
3665
|
+
} else {
|
|
3703
3666
|
let value_found = value ? value.find((val) => val.id == i.id) : null;
|
|
3704
3667
|
let v = value_found || "";
|
|
3705
|
-
let inputValue =
|
|
3668
|
+
let inputValue =
|
|
3669
|
+
props.varNameInput && v[props.varNameInput]
|
|
3670
|
+
? v[props.varNameInput]
|
|
3671
|
+
: v.value;
|
|
3706
3672
|
let tooltip = "";
|
|
3707
3673
|
let icon = "";
|
|
3708
3674
|
let link = "";
|
|
@@ -3722,14 +3688,16 @@ export default {
|
|
|
3722
3688
|
}
|
|
3723
3689
|
}
|
|
3724
3690
|
|
|
3725
|
-
if(i.link){
|
|
3691
|
+
if (i.link) {
|
|
3726
3692
|
link = `<a class="mini-input-section--link" target="_blank" href="${i.link}">
|
|
3727
3693
|
${icons.linkIcon}
|
|
3728
|
-
</a>
|
|
3694
|
+
</a> `;
|
|
3729
3695
|
}
|
|
3730
3696
|
|
|
3731
3697
|
str += `
|
|
3732
|
-
<div class="mini-input-section ${
|
|
3698
|
+
<div class="mini-input-section ${
|
|
3699
|
+
icon ? "has-icon" : ""
|
|
3700
|
+
}" input-tab-key="${i.tabKey || ""}" label="${i.label}">
|
|
3733
3701
|
<label>
|
|
3734
3702
|
<input type="number"
|
|
3735
3703
|
class="mini-input"
|
|
@@ -3737,7 +3705,7 @@ export default {
|
|
|
3737
3705
|
input-key="${i.key || i.label}"
|
|
3738
3706
|
value="${inputValue || ""}">
|
|
3739
3707
|
|
|
3740
|
-
${icon ||
|
|
3708
|
+
${icon || ""}
|
|
3741
3709
|
|
|
3742
3710
|
<div class="mini-input-section--title truncate">
|
|
3743
3711
|
${i.label}
|
|
@@ -3770,40 +3738,44 @@ export default {
|
|
|
3770
3738
|
t.addEventListener("click", (e) => {
|
|
3771
3739
|
this.selectInputBoxTab(t, $el);
|
|
3772
3740
|
$searchInput.value = "";
|
|
3773
|
-
$searchInput.dispatchEvent(new Event(
|
|
3741
|
+
$searchInput.dispatchEvent(new Event("input", { bubbles: true }));
|
|
3774
3742
|
});
|
|
3775
3743
|
});
|
|
3776
3744
|
|
|
3777
|
-
if($searchInputClear){
|
|
3778
|
-
$searchInputClear.addEventListener("click", e => {
|
|
3745
|
+
if ($searchInputClear) {
|
|
3746
|
+
$searchInputClear.addEventListener("click", (e) => {
|
|
3779
3747
|
$searchInput.value = "";
|
|
3780
|
-
$searchInput.dispatchEvent(new Event(
|
|
3748
|
+
$searchInput.dispatchEvent(new Event("input", { bubbles: true }));
|
|
3781
3749
|
});
|
|
3782
3750
|
}
|
|
3783
3751
|
|
|
3784
|
-
if($searchInput){
|
|
3785
|
-
$searchInput.addEventListener(
|
|
3786
|
-
if(e.key === "Escape"){
|
|
3752
|
+
if ($searchInput) {
|
|
3753
|
+
$searchInput.addEventListener("keydown", (e) => {
|
|
3754
|
+
if (e.key === "Escape") {
|
|
3787
3755
|
$searchInput.value = "";
|
|
3788
|
-
$searchInput.dispatchEvent(new Event(
|
|
3756
|
+
$searchInput.dispatchEvent(new Event("input", { bubbles: true }));
|
|
3789
3757
|
}
|
|
3790
|
-
});
|
|
3758
|
+
});
|
|
3791
3759
|
|
|
3792
|
-
$searchInput.addEventListener("input", e => {
|
|
3793
|
-
let $tabSelected =
|
|
3760
|
+
$searchInput.addEventListener("input", (e) => {
|
|
3761
|
+
let $tabSelected =
|
|
3762
|
+
$el.querySelector(".input-box-tab[tab-key].active") || null;
|
|
3794
3763
|
let $inputs = [];
|
|
3795
|
-
if($tabSelected){
|
|
3764
|
+
if ($tabSelected) {
|
|
3796
3765
|
let tabKey = $tabSelected.getAttribute("tab-key");
|
|
3797
|
-
$inputs =
|
|
3798
|
-
|
|
3766
|
+
$inputs =
|
|
3767
|
+
$el.querySelectorAll(
|
|
3768
|
+
".mini-input-section[input-tab-key='" + tabKey + "']"
|
|
3769
|
+
) || [];
|
|
3770
|
+
} else {
|
|
3799
3771
|
$inputs = $el.querySelectorAll(".mini-input-section") || [];
|
|
3800
3772
|
}
|
|
3801
|
-
$inputs.forEach($i => {
|
|
3773
|
+
$inputs.forEach(($i) => {
|
|
3802
3774
|
let label = $i.getAttribute("label");
|
|
3803
3775
|
let search = $searchInput.value;
|
|
3804
|
-
if(label.toLowerCase().includes(search.toLowerCase())){
|
|
3776
|
+
if (label.toLowerCase().includes(search.toLowerCase())) {
|
|
3805
3777
|
$i.classList.remove("hide");
|
|
3806
|
-
}else{
|
|
3778
|
+
} else {
|
|
3807
3779
|
$i.classList.add("hide");
|
|
3808
3780
|
}
|
|
3809
3781
|
});
|
|
@@ -3812,7 +3784,7 @@ export default {
|
|
|
3812
3784
|
|
|
3813
3785
|
this.selectInputBoxTab(_.first($tabs), $el);
|
|
3814
3786
|
|
|
3815
|
-
$inputs.forEach((i) => this.addKeyDownInputEvents(i));
|
|
3787
|
+
$inputs.forEach((i) => this.addKeyDownInputEvents(i, $el, props));
|
|
3816
3788
|
|
|
3817
3789
|
return $el;
|
|
3818
3790
|
},
|
|
@@ -3852,11 +3824,11 @@ export default {
|
|
|
3852
3824
|
value = utils.getVarByPath(dataDay, props.varName);
|
|
3853
3825
|
}
|
|
3854
3826
|
let r = dom.createElementFromHTML(`
|
|
3855
|
-
<div class="input-section" input-key="${props.key || ""}">
|
|
3827
|
+
<div class="input-section ${props.isHidden ? 'hide':''} " input-key="${props.key || ""}">
|
|
3856
3828
|
<label>
|
|
3857
3829
|
<input type="checkbox" name="${props.key || ""}" input-key="${
|
|
3858
|
-
|
|
3859
|
-
|
|
3830
|
+
props.key || ""
|
|
3831
|
+
}" ${value ? "checked" : ""}>
|
|
3860
3832
|
${props.label}
|
|
3861
3833
|
</label>
|
|
3862
3834
|
</div>`);
|
|
@@ -3864,41 +3836,88 @@ export default {
|
|
|
3864
3836
|
return r;
|
|
3865
3837
|
},
|
|
3866
3838
|
|
|
3839
|
+
createInputButtonsGroup(props) {
|
|
3840
|
+
let $container = dom.createElementFromHTML(`
|
|
3841
|
+
<div class="input-section ${props.isHidden ? 'hide':''} " input-key="${props.key || ""}">
|
|
3842
|
+
<div class="buttons-group"> </div>
|
|
3843
|
+
</div>`);
|
|
3844
|
+
|
|
3845
|
+
let $containerButtonGroup = $container.querySelector(".buttons-group");
|
|
3846
|
+
|
|
3847
|
+
let $buttons = [];
|
|
3848
|
+
$buttons = props.buttons.map((buttonProp) => {
|
|
3849
|
+
let buttonStr = `
|
|
3850
|
+
<button
|
|
3851
|
+
name="${buttonProp.key || ""}"
|
|
3852
|
+
input-key="${buttonProp.key || ""}"
|
|
3853
|
+
class="cap-btn-outline cap-btn-sm ${buttonProp.isSelected ? 'selected' : ''} ">
|
|
3854
|
+
${buttonProp.label}
|
|
3855
|
+
</button>`;
|
|
3856
|
+
|
|
3857
|
+
let $button = domUtils.createElementFromHTML(buttonStr);
|
|
3858
|
+
$containerButtonGroup.append($button);
|
|
3859
|
+
|
|
3860
|
+
$button.addEventListener("click", (e) => {
|
|
3861
|
+
if (props.isSelectable) {
|
|
3862
|
+
$buttons.forEach(($b) => $b.classList.remove("selected"));
|
|
3863
|
+
$button.classList.add("selected");
|
|
3864
|
+
}
|
|
3865
|
+
buttonProp.onClick({ props, event: e, buttonsElements: $buttons });
|
|
3866
|
+
});
|
|
3867
|
+
return $button;
|
|
3868
|
+
});
|
|
3869
|
+
|
|
3870
|
+
return $container;
|
|
3871
|
+
},
|
|
3872
|
+
|
|
3867
3873
|
createInputButton(props) {
|
|
3868
3874
|
let r = dom.createElementFromHTML(`
|
|
3869
|
-
<div class="input-section" input-key="${props.key || ""}">
|
|
3870
|
-
<button
|
|
3875
|
+
<div class="input-section ${props.isHidden ? 'hide':''} " input-key="${props.key || ""}">
|
|
3876
|
+
<button
|
|
3877
|
+
name="${props.key || ""}"
|
|
3878
|
+
input-key="${props.key || ""}"
|
|
3879
|
+
class="cap-btn-outline">
|
|
3871
3880
|
${props.label}
|
|
3872
3881
|
</button>
|
|
3873
3882
|
</div>`);
|
|
3874
3883
|
|
|
3875
3884
|
let button = r.querySelector("button");
|
|
3876
|
-
button.addEventListener("click", e => props.onClick({props, event:e}))
|
|
3885
|
+
button.addEventListener("click", (e) => props.onClick({ props, event: e }));
|
|
3877
3886
|
|
|
3878
3887
|
return r;
|
|
3879
3888
|
},
|
|
3880
3889
|
|
|
3881
|
-
addKeyDownInputEvents(input) {
|
|
3882
|
-
input.addEventListener("keydown", function (event) {
|
|
3890
|
+
addKeyDownInputEvents($input, $inputContainer, props) {
|
|
3891
|
+
$input.addEventListener("keydown", function (event) {
|
|
3883
3892
|
if (event.keyCode === 13) {
|
|
3884
3893
|
//ENTER
|
|
3885
|
-
input.dispatchEvent(
|
|
3894
|
+
$input.dispatchEvent(
|
|
3886
3895
|
new CustomEvent("saveMultiInput", {
|
|
3887
3896
|
bubbles: true,
|
|
3888
|
-
cancelable: false
|
|
3897
|
+
cancelable: false
|
|
3889
3898
|
})
|
|
3890
3899
|
);
|
|
3891
3900
|
}
|
|
3892
3901
|
if (event.keyCode === 27) {
|
|
3893
3902
|
//ESC
|
|
3894
|
-
input.dispatchEvent(
|
|
3903
|
+
$input.dispatchEvent(
|
|
3895
3904
|
new CustomEvent("cancelMultiInput", {
|
|
3896
3905
|
bubbles: true,
|
|
3897
|
-
cancelable: false
|
|
3906
|
+
cancelable: false
|
|
3898
3907
|
})
|
|
3899
3908
|
);
|
|
3900
3909
|
}
|
|
3901
3910
|
});
|
|
3911
|
+
$input.addEventListener("input", (e) => {
|
|
3912
|
+
if(props.onInput){
|
|
3913
|
+
props.onInput({
|
|
3914
|
+
event:e,
|
|
3915
|
+
value: e.srcElement.value,
|
|
3916
|
+
props,
|
|
3917
|
+
$element: $inputContainer
|
|
3918
|
+
});
|
|
3919
|
+
}
|
|
3920
|
+
});
|
|
3902
3921
|
},
|
|
3903
3922
|
|
|
3904
3923
|
createContextMenu({
|
|
@@ -3911,7 +3930,7 @@ export default {
|
|
|
3911
3930
|
tabSelected = null,
|
|
3912
3931
|
left = null,
|
|
3913
3932
|
top = null,
|
|
3914
|
-
name = ""
|
|
3933
|
+
name = ""
|
|
3915
3934
|
}) {
|
|
3916
3935
|
if (config.timeline.contextMenu === undefined)
|
|
3917
3936
|
return { elem: null, isVisible: false };
|
|
@@ -3925,7 +3944,7 @@ export default {
|
|
|
3925
3944
|
let boundRectCapibara = null;
|
|
3926
3945
|
let gap = 15; //px
|
|
3927
3946
|
|
|
3928
|
-
if($capibaraElem){
|
|
3947
|
+
if ($capibaraElem) {
|
|
3929
3948
|
boundRectCapibara = $capibaraElem.getBoundingClientRect();
|
|
3930
3949
|
}
|
|
3931
3950
|
|
|
@@ -3942,34 +3961,31 @@ export default {
|
|
|
3942
3961
|
topPosition = top;
|
|
3943
3962
|
}
|
|
3944
3963
|
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
3964
|
if ((leftPosition !== null) & (topPosition !== null)) {
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
if(boundRectCapibara){
|
|
3965
|
+
if (boundRectCapibara) {
|
|
3951
3966
|
let transformStyle = "";
|
|
3952
|
-
if(
|
|
3953
|
-
|
|
3967
|
+
if (
|
|
3968
|
+
topPosition > (boundRectCapibara.height * 2) / 6 &&
|
|
3969
|
+
topPosition <= (boundRectCapibara.height * 4) / 6
|
|
3970
|
+
) {
|
|
3971
|
+
transformStyle += `translateY(-50%)`;
|
|
3954
3972
|
}
|
|
3955
|
-
if(topPosition > boundRectCapibara.height*4/6){
|
|
3956
|
-
transformStyle+= `translateY(-100%)`;
|
|
3973
|
+
if (topPosition > (boundRectCapibara.height * 4) / 6) {
|
|
3974
|
+
transformStyle += `translateY(-100%)`;
|
|
3957
3975
|
}
|
|
3958
3976
|
|
|
3959
|
-
if(leftPosition> boundRectCapibara.width*4/6){
|
|
3960
|
-
transformStyle+= `translateX(-100%)`;
|
|
3977
|
+
if (leftPosition > (boundRectCapibara.width * 4) / 6) {
|
|
3978
|
+
transformStyle += `translateX(-100%)`;
|
|
3961
3979
|
leftPosition -= gap;
|
|
3962
|
-
}else{
|
|
3980
|
+
} else {
|
|
3963
3981
|
leftPosition += gap;
|
|
3964
3982
|
}
|
|
3965
|
-
if(transformStyle !=""){
|
|
3966
|
-
|
|
3983
|
+
if (transformStyle != "") {
|
|
3984
|
+
style += ` transform: ${transformStyle};`;
|
|
3967
3985
|
}
|
|
3968
3986
|
}
|
|
3969
3987
|
|
|
3970
|
-
|
|
3971
3988
|
style += `top: ${topPosition}px; left: ${leftPosition}px;`;
|
|
3972
|
-
|
|
3973
3989
|
} else {
|
|
3974
3990
|
className += "cm-hide";
|
|
3975
3991
|
isVisible = false;
|
|
@@ -3984,7 +4000,6 @@ export default {
|
|
|
3984
4000
|
let $contextMenu = $contextMenuContainer.querySelector(".cap-context-menu");
|
|
3985
4001
|
|
|
3986
4002
|
config.timeline.contextMenu.options.forEach((option) => {
|
|
3987
|
-
|
|
3988
4003
|
if (option.showIf) {
|
|
3989
4004
|
let show = option.showIf({ item, date, selected, name, tabSelected });
|
|
3990
4005
|
if (!show) return;
|
|
@@ -3998,7 +4013,7 @@ export default {
|
|
|
3998
4013
|
date,
|
|
3999
4014
|
selected,
|
|
4000
4015
|
name,
|
|
4001
|
-
tabSelected
|
|
4016
|
+
tabSelected
|
|
4002
4017
|
});
|
|
4003
4018
|
}
|
|
4004
4019
|
|
|
@@ -4015,11 +4030,10 @@ export default {
|
|
|
4015
4030
|
optionClassName += "is-divider ";
|
|
4016
4031
|
}
|
|
4017
4032
|
|
|
4018
|
-
if(option.label){
|
|
4033
|
+
if (option.label) {
|
|
4019
4034
|
label = `<span>${option.label}</span>`;
|
|
4020
4035
|
}
|
|
4021
4036
|
|
|
4022
|
-
|
|
4023
4037
|
if (option.icon) {
|
|
4024
4038
|
strIcon = `<div class="cap-context-menu_item_icon">
|
|
4025
4039
|
<svg viewBox="0 0 24 24">
|
|
@@ -4044,7 +4058,7 @@ export default {
|
|
|
4044
4058
|
date,
|
|
4045
4059
|
item,
|
|
4046
4060
|
selected,
|
|
4047
|
-
tabSelected
|
|
4061
|
+
tabSelected
|
|
4048
4062
|
})
|
|
4049
4063
|
);
|
|
4050
4064
|
} else {
|
|
@@ -4059,7 +4073,7 @@ export default {
|
|
|
4059
4073
|
|
|
4060
4074
|
return {
|
|
4061
4075
|
elem: $contextMenuContainer,
|
|
4062
|
-
isVisible
|
|
4076
|
+
isVisible
|
|
4063
4077
|
};
|
|
4064
|
-
}
|
|
4078
|
+
}
|
|
4065
4079
|
};
|