kmaterialize 2.3.3-1.0.32 → 2.3.3-1.0.33
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/components/gantt/_gantt.scss +1 -1
- package/components/gantt/gantt.ts +8 -2
- package/components/gantt/ganttSpec.js +21 -0
- package/dist/css/materialize.colors.min.css +1 -1
- package/dist/css/materialize.css +2 -2
- package/dist/css/materialize.min.css +2 -2
- package/dist/js/materialize.cjs.js +12 -4
- package/dist/js/materialize.d.ts +1 -1
- package/dist/js/materialize.js +12 -4
- package/dist/js/materialize.min.js +3 -3
- package/dist/js/materialize.mjs +12 -4
- package/package.json +1 -1
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
}
|
|
68
68
|
.gantt-task-name { font-weight: 600; overflow-wrap: anywhere; line-height: 1.4; }
|
|
69
69
|
.gantt-task-detail { color: var(--md-sys-color-on-surface-variant); font-size: 12px; overflow-wrap: anywhere; }
|
|
70
|
-
.gantt-label.gantt-selectable-label { padding-left: calc(
|
|
70
|
+
.gantt-label.gantt-selectable-label { padding-left: calc(30px + var(--checkbox-size)); }
|
|
71
71
|
input.gantt-select { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); }
|
|
72
72
|
.gantt-row.is-selected .gantt-label { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }
|
|
73
73
|
.gantt-row.is-selected .gantt-bar { box-shadow: 0 0 0 2px var(--md-sys-color-primary); }
|
|
@@ -390,8 +390,14 @@ export class Gantt extends Component<GanttOptions> {
|
|
|
390
390
|
const selector = event.target instanceof Element ? event.target.closest<HTMLElement>('[data-gantt-select]') : null;
|
|
391
391
|
if (selector) {
|
|
392
392
|
const id = selector.dataset.ganttSelect;
|
|
393
|
-
|
|
394
|
-
|
|
393
|
+
if (event.shiftKey && this._selectionAnchor) {
|
|
394
|
+
this._selectForInteraction(id, event);
|
|
395
|
+
} else {
|
|
396
|
+
this.setSelectedTaskIds(this._selected.has(id) ? this.getSelectedTaskIds().filter(item => item !== id) : [...this.getSelectedTaskIds(), id]);
|
|
397
|
+
this._selectionAnchor = id;
|
|
398
|
+
}
|
|
399
|
+
// A repeated range may not re-render; undo the native toggle in that case.
|
|
400
|
+
if (selector instanceof HTMLInputElement) selector.checked = this._selected.has(id);
|
|
395
401
|
return;
|
|
396
402
|
}
|
|
397
403
|
const target = event.target instanceof Element ? event.target.closest<HTMLElement>('[data-gantt-task]') : null;
|
|
@@ -484,6 +484,27 @@ describe('Gantt multi-task selection', function () {
|
|
|
484
484
|
expect(host.querySelectorAll('.gantt-row.is-selected').length).toBe(0);
|
|
485
485
|
});
|
|
486
486
|
|
|
487
|
+
it('selects inclusive checkbox ranges in either direction and retains the anchor', function () {
|
|
488
|
+
const checkbox = id => host.querySelector(`[data-gantt-select="${id}"]`);
|
|
489
|
+
const shiftClick = id => checkbox(id).dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true, shiftKey: true }));
|
|
490
|
+
const selection = jasmine.createSpy('selection');
|
|
491
|
+
chart.options.onSelectionChange = selection;
|
|
492
|
+
checkbox('m').click();
|
|
493
|
+
shiftClick('a');
|
|
494
|
+
expect(chart.getSelectedTaskIds()).toEqual(['a', 'b', 'c', 'm']);
|
|
495
|
+
expect(host.querySelectorAll('.gantt-select:checked').length).toBe(4);
|
|
496
|
+
shiftClick('a');
|
|
497
|
+
expect(checkbox('a').checked).toBeTrue();
|
|
498
|
+
expect(selection).toHaveBeenCalledTimes(2);
|
|
499
|
+
shiftClick('c');
|
|
500
|
+
expect(chart.getSelectedTaskIds()).toEqual(['c', 'm']);
|
|
501
|
+
chart.setSelectedTaskIds([]);
|
|
502
|
+
checkbox('a').click();
|
|
503
|
+
shiftClick('m');
|
|
504
|
+
expect(chart.getSelectedTaskIds()).toEqual(['a', 'b', 'c', 'm']);
|
|
505
|
+
expect(chart.getTasks()).toEqual(original);
|
|
506
|
+
});
|
|
507
|
+
|
|
487
508
|
it('cancels all previewed dates together and retains selection through zoom and views', function () {
|
|
488
509
|
chart.setSelectedTaskIds(['a', 'b']);
|
|
489
510
|
pointer('pointerdown', 400, button('b')); pointer('pointermove', 496); key('Escape');
|
package/dist/css/materialize.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Materialize v2.3.3-1.0.
|
|
2
|
+
* Materialize v2.3.3-1.0.33 (https://materializeweb.com)
|
|
3
3
|
* Copyright 2014-2026 Materialize
|
|
4
4
|
* MIT License (https://raw.githubusercontent.com/materializecss/materialize/master/LICENSE)
|
|
5
5
|
*/
|
|
@@ -14404,7 +14404,7 @@ button.btn-floating {
|
|
|
14404
14404
|
overflow-wrap: anywhere;
|
|
14405
14405
|
}
|
|
14406
14406
|
.gantt .gantt-label.gantt-selectable-label {
|
|
14407
|
-
padding-left: calc(
|
|
14407
|
+
padding-left: calc(30px + var(--checkbox-size));
|
|
14408
14408
|
}
|
|
14409
14409
|
.gantt input.gantt-select {
|
|
14410
14410
|
position: absolute;
|