@mintplayer/web-components 2.16.0 → 2.17.0
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/accordion/index.mjs +5 -5
- package/calendar/index.mjs +1 -1
- package/carousel/index.mjs +57 -143
- package/charts/core/index.mjs +30 -20
- package/charts/core/src/attributes.d.ts +18 -0
- package/charts/core/src/index.d.ts +2 -0
- package/charts/core/src/view-window.d.ts +46 -0
- package/charts/hierarchy/index.mjs +245 -256
- package/charts/hierarchy/src/components/mp-hierarchy-chart.d.ts +1 -3
- package/charts/sparkline/index.mjs +27 -26
- package/charts/trend/index.mjs +21 -20
- package/checkbox/index.mjs +1 -1
- package/checkbox/src/components/mp-checkbox.d.ts +1 -0
- package/chunks/attributes-L3eKsbdy.mjs +16 -0
- package/chunks/color-mode-warning-71FmlzWX.mjs +13 -0
- package/chunks/{form-check.styles-B0pxJ6YC.mjs → form-check.styles-DqvBnspm.mjs} +24 -3
- package/chunks/{mp-calendar.element-CJ8-t-Zn.mjs → mp-calendar.element-BIHS9SZZ.mjs} +11 -6
- package/chunks/{mp-checkbox-CzwS7Y_t.mjs → mp-checkbox-zV83gILn.mjs} +44 -36
- package/chunks/{mp-datatable-B7st6G-I.mjs → mp-datatable-eRpl7-2V.mjs} +173 -173
- package/chunks/{mp-datetime-picker.element-DsWA1AFs.mjs → mp-datetime-picker.element-Cxu5-qRE.mjs} +29 -32
- package/chunks/{mp-pagination-Dea75mD4.mjs → mp-pagination-hGy4dL7p.mjs} +9 -4
- package/chunks/{mp-radio-cL46sUA0.mjs → mp-radio-BhRVNdKp.mjs} +32 -28
- package/chunks/{mp-select-BNrbPwN4.mjs → mp-select-CgqYFvUj.mjs} +41 -26
- package/chunks/{mp-splitter-Ckn1kN4v.mjs → mp-splitter-DLehrw3Y.mjs} +144 -120
- package/chunks/{mp-timepicker.element-CwaAAOcm.mjs → mp-timepicker.element-BiB9lkgc.mjs} +58 -45
- package/chunks/{mp-toggle-button-eo_aTQtu.mjs → mp-toggle-button-CaS9uYLE.mjs} +26 -24
- package/chunks/{mp-treeview-C8iltDbq.mjs → mp-treeview-CaMTDrvY.mjs} +51 -50
- package/chunks/{overlay-controller-DifgO6jT.mjs → overlay-controller-BHDagokg.mjs} +96 -92
- package/chunks/{id-DNZVAnGC.mjs → resource.service--lqLwEqk.mjs} +144 -206
- package/chunks/view-window-DGvFiDnW.mjs +263 -0
- package/code-snippet/index.mjs +70 -66
- package/code-snippet/src/hljs-loaders.generated.d.ts +1 -1
- package/custom-elements.json +65750 -0
- package/datatable/index.mjs +1 -1
- package/datatable/src/components/column-resize.d.ts +11 -0
- package/datatable/src/components/mp-datatable.d.ts +5 -0
- package/datepicker/index.mjs +10 -9
- package/datetime-picker/index.mjs +1 -1
- package/datetime-picker/src/mp-datetime-picker.element.d.ts +3 -0
- package/dock/index.mjs +430 -463
- package/dock/src/components/mint-dock-manager.element.d.ts +25 -2
- package/dock/src/core/resize.d.ts +60 -0
- package/dropdown-menu/index.mjs +4 -2
- package/dropdown-menu/src/components/mp-dropdown-menu.d.ts +6 -1
- package/dropdown-menu/src/index.d.ts +1 -1
- package/dropdown-menu/src/types/dropdown.d.ts +14 -1
- package/dropdown-menu/src/types/index.d.ts +1 -1
- package/file-manager/index.mjs +63 -61
- package/file-manager/src/components/mp-file-manager.d.ts +4 -3
- package/multi-range/index.mjs +56 -50
- package/multi-range/src/mint-multi-range.element.d.ts +4 -10
- package/multi-range/src/pointer-geometry.d.ts +31 -0
- package/navbar/index.mjs +89 -439
- package/overlay/index.mjs +1 -1
- package/overlay/src/overlay-controller.d.ts +0 -14
- package/overlay/src/placement.d.ts +48 -0
- package/package.json +7 -1
- package/pagination/index.mjs +1 -1
- package/phone-input/index.mjs +44 -40
- package/phone-input/src/components/stack.d.ts +8 -0
- package/query-builder/index.mjs +418 -466
- package/query-builder/src/dnd/drag-controller.d.ts +12 -8
- package/query-builder/src/mp-query-builder.element.d.ts +5 -1
- package/query-builder/src/mp-query-condition.element.d.ts +1 -0
- package/radio/index.mjs +1 -1
- package/radio-group/index.mjs +1 -1
- package/ribbon/index.mjs +477 -498
- package/ribbon/src/core/band-text-color.d.ts +10 -0
- package/ribbon/src/core/key-tip-allocator.d.ts +10 -0
- package/ribbon/src/core/plan-reduce-steps.d.ts +62 -0
- package/ribbon/src/mp-ribbon.element.d.ts +0 -27
- package/scheduler/index.mjs +726 -711
- package/scheduler/src/components/mp-scheduler.d.ts +19 -3
- package/scheduler/src/drag/drag-manager.d.ts +1 -9
- package/scheduler/src/input/input-handler.d.ts +12 -2
- package/scheduler/src/utils/geometry.d.ts +39 -0
- package/scheduler/src/views/timeline-view.d.ts +0 -1
- package/scheduler-core/index.mjs +84 -71
- package/scheduler-core/src/services/resource.service.d.ts +0 -12
- package/scheduler-core/src/services/timeline.service.d.ts +0 -9
- package/select/index.mjs +1 -1
- package/select/src/components/mp-select.d.ts +1 -0
- package/signature-pad/index.mjs +21 -23
- package/signature-pad/src/canvas-point.d.ts +26 -0
- package/signature-pad/src/mp-signature-pad.element.d.ts +1 -7
- package/splitter/index.mjs +1 -1
- package/splitter/src/components/mp-splitter.d.ts +16 -0
- package/splitter/src/managers/index.d.ts +1 -0
- package/splitter/src/managers/rescale-panel-sizes.d.ts +14 -0
- package/swiper-core/index.mjs +2 -2
- package/theming/bs-theme-preboot.js +1 -0
- package/theming/color-mode.css +36 -0
- package/theming/index.d.ts +1 -0
- package/theming/index.mjs +327 -0
- package/theming/src/components/mp-theme-toggle.d.ts +71 -0
- package/theming/src/cookie.d.ts +31 -0
- package/theming/src/index.d.ts +5 -0
- package/theming/src/preboot.d.ts +1 -0
- package/theming/src/resolve.d.ts +36 -0
- package/theming/src/store.d.ts +27 -0
- package/theming/src/styles/theme-toggle.styles.d.ts +2 -0
- package/theming/src/testing/fake-broadcast-channel.d.ts +35 -0
- package/theming/src/toggle-modes.d.ts +23 -0
- package/tile-manager/index.mjs +252 -211
- package/tile-manager/src/components/mint-tile-manager.element.d.ts +8 -0
- package/tile-manager/src/utils/grid-geometry.d.ts +49 -0
- package/timeline/index.mjs +156 -164
- package/timeline/src/components/mp-timeline.d.ts +41 -7
- package/timepicker/index.mjs +7 -4
- package/timepicker/src/mp-time-list.element.d.ts +26 -0
- package/timepicker/src/mp-timepicker.element.d.ts +3 -0
- package/toggle-button/index.mjs +1 -1
- package/tree-select/index.mjs +21 -9
- package/treeview/index.mjs +1 -1
- package/treeview/src/components/mp-treeview.d.ts +6 -4
- package/chunks/color-DIeST-IS.mjs +0 -224
- package/query-builder/src/mp-query-condition.element.template.d.ts +0 -2
|
@@ -178,8 +178,8 @@ export declare class MintDockManagerElement extends LitElement {
|
|
|
178
178
|
*/
|
|
179
179
|
private getSplitterPanels;
|
|
180
180
|
/**
|
|
181
|
-
* Locate the rendered `<mp-splitter>`
|
|
182
|
-
*
|
|
181
|
+
* Locate the rendered `<mp-splitter>` for a split path — layer included,
|
|
182
|
+
* so a floating window's splitter never answers for a docked one.
|
|
183
183
|
*/
|
|
184
184
|
private findSplitterByPath;
|
|
185
185
|
private onPointerMove;
|
|
@@ -225,6 +225,20 @@ export declare class MintDockManagerElement extends LitElement {
|
|
|
225
225
|
private updatePaneDragDropTargetFromPoint;
|
|
226
226
|
private isPointerOverSourceHeader;
|
|
227
227
|
private ensureHeaderDragPlaceholder;
|
|
228
|
+
/**
|
|
229
|
+
* The slotted children of a stack — the header spans, pane hosts and drag
|
|
230
|
+
* placeholders the dock owns. Every lookup among them walks this list and
|
|
231
|
+
* matches on the dataset instead of building a `:scope > [data-…="…"]`
|
|
232
|
+
* selector: an arbitrary pane name then never has to survive CSS escaping,
|
|
233
|
+
* and nothing depends on `CSS.escape` or `:scope`, neither of which every
|
|
234
|
+
* DOM implementation provides (jsdom has no `CSS.escape`, and matches
|
|
235
|
+
* nothing for `:scope >` here). Same reasoning as verifyProjectionSlots.
|
|
236
|
+
*/
|
|
237
|
+
private stackChildren;
|
|
238
|
+
/** The direct child of `stack` carrying `className` for `pane`. */
|
|
239
|
+
private stackChildForPane;
|
|
240
|
+
/** The drag placeholder of `className` (header span or pane host) in `stack`. */
|
|
241
|
+
private stackPlaceholder;
|
|
228
242
|
private updateHeaderDragPlaceholderPosition;
|
|
229
243
|
private clearHeaderDragPlaceholder;
|
|
230
244
|
private startDragPointerTracking;
|
|
@@ -251,6 +265,15 @@ export declare class MintDockManagerElement extends LitElement {
|
|
|
251
265
|
private isDropZone;
|
|
252
266
|
private showDropIndicator;
|
|
253
267
|
private hideDropIndicator;
|
|
268
|
+
/**
|
|
269
|
+
* The dock's single hit-test: which of its own shadow elements lie under a
|
|
270
|
+
* client point, topmost first. Every "what is the pointer over" question —
|
|
271
|
+
* the target stack, the joystick button, the empty docked surface — is
|
|
272
|
+
* answered from this list, so the answers can never disagree with each
|
|
273
|
+
* other, and a test can say what is under the pointer in one place without
|
|
274
|
+
* inventing any geometry.
|
|
275
|
+
*/
|
|
276
|
+
private elementsAt;
|
|
254
277
|
private findStackAtPoint;
|
|
255
278
|
private findStackInTargets;
|
|
256
279
|
private activatePane;
|
|
@@ -69,6 +69,66 @@ export declare function resizePair(beforeSize: number, afterSize: number, delta:
|
|
|
69
69
|
before: number;
|
|
70
70
|
after: number;
|
|
71
71
|
};
|
|
72
|
+
/**
|
|
73
|
+
* One splitter track after the divider at `index` moves by `delta`: the pixel
|
|
74
|
+
* sizes to push into the splitter and the weights they normalize to.
|
|
75
|
+
*
|
|
76
|
+
* This is the pair rule applied to a whole track, which is what a corner
|
|
77
|
+
* (intersection) drag needs — it moves one divider in each of several
|
|
78
|
+
* splitters at once, and each must keep the panels it does not touch exactly
|
|
79
|
+
* as they were.
|
|
80
|
+
*
|
|
81
|
+
* `null` means there is nothing to move: no divider at `index`, or a track
|
|
82
|
+
* with no measured size (every panel reads zero, as in a frame before layout). There is nothing to redistribute then, and writing
|
|
83
|
+
* anything would be worse than writing nothing: normalizing a zero total used
|
|
84
|
+
* to wipe the stored weights to `[]`, and the pair rule on a zero track yields
|
|
85
|
+
* negative pixel sizes.
|
|
86
|
+
*/
|
|
87
|
+
export declare function resizeTrackPair(initialSizes: readonly number[], index: number, delta: number, minSize: number, snap?: boolean): {
|
|
88
|
+
pixels: number[];
|
|
89
|
+
weights: number[];
|
|
90
|
+
} | null;
|
|
91
|
+
/** The numbers of a measured rect that the corner-snap rule reads. */
|
|
92
|
+
export interface SnapRect {
|
|
93
|
+
left: number;
|
|
94
|
+
top: number;
|
|
95
|
+
right: number;
|
|
96
|
+
bottom: number;
|
|
97
|
+
width: number;
|
|
98
|
+
height: number;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* A splitter divider as the snap rule sees it. `direction` is the SPLITTER's
|
|
102
|
+
* flow: a `horizontal` split lays its children left to right, so its dividers
|
|
103
|
+
* are vertical bars, and vice versa.
|
|
104
|
+
*/
|
|
105
|
+
export interface SnapDivider {
|
|
106
|
+
direction: 'horizontal' | 'vertical' | undefined;
|
|
107
|
+
rect: SnapRect;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* The lines a corner drag should snap to, relative to `origin`.
|
|
111
|
+
*
|
|
112
|
+
* A corner sits where a vertical and a horizontal divider cross, at
|
|
113
|
+
* (`center.x`, `center.y`). Any OTHER vertical bar that the corner's horizontal
|
|
114
|
+
* line passes through is somewhere the corner could line up with, so its
|
|
115
|
+
* centre becomes an x target; symmetrically for y. Bars the line misses belong
|
|
116
|
+
* to an unrelated region of the layout and are ignored — snapping to them would
|
|
117
|
+
* pull the corner towards something the user cannot see it aligning with.
|
|
118
|
+
*
|
|
119
|
+
* A missing coordinate (the corner has no divider on that axis) contributes no
|
|
120
|
+
* targets on the other axis.
|
|
121
|
+
*/
|
|
122
|
+
export declare function collectCornerSnapTargets(center: {
|
|
123
|
+
x: number | null;
|
|
124
|
+
y: number | null;
|
|
125
|
+
}, dividers: readonly SnapDivider[], origin: {
|
|
126
|
+
left: number;
|
|
127
|
+
top: number;
|
|
128
|
+
}): {
|
|
129
|
+
x: number[];
|
|
130
|
+
y: number[];
|
|
131
|
+
};
|
|
72
132
|
/**
|
|
73
133
|
* Where a dragged tab would land in a header, given the horizontal midpoint of
|
|
74
134
|
* each tab that is a candidate target.
|
package/dropdown-menu/index.mjs
CHANGED
|
@@ -545,8 +545,10 @@ class u extends m {
|
|
|
545
545
|
return o.classList.contains("disabled") || o.getAttribute("aria-disabled") === "true";
|
|
546
546
|
}
|
|
547
547
|
#b(o) {
|
|
548
|
-
const r = o.
|
|
549
|
-
|
|
548
|
+
const r = o.dropdownValue;
|
|
549
|
+
if (r !== void 0) return r;
|
|
550
|
+
const e = o.value;
|
|
551
|
+
return o instanceof HTMLLIElement && !o.hasAttribute("value") ? o.dataset.value ?? (e !== 0 ? e : void 0) : e !== void 0 ? e : o.dataset.value;
|
|
550
552
|
}
|
|
551
553
|
#p;
|
|
552
554
|
/** Assign roles, aria, and the roving tabindex across the current items. */
|
|
@@ -29,7 +29,12 @@ import { DropdownMode } from '../types';
|
|
|
29
29
|
* it copied an IDREF into the shadow root, where it resolved to nothing.
|
|
30
30
|
*
|
|
31
31
|
* An item is disabled via the `.disabled` class (or `aria-disabled="true"`), and
|
|
32
|
-
* carries an opaque
|
|
32
|
+
* carries an opaque value, read in this order: a `dropdownValue` JS property (any
|
|
33
|
+
* value, passed through unchanged; see `DropdownItemElement`), a `data-value`
|
|
34
|
+
* attribute (a string), then the element's own `value` (an authored `value`
|
|
35
|
+
* attribute on an `<li>` is its native number; a non-`<li>` item's `value`
|
|
36
|
+
* property). Never assign an object or a string to an `<li>`'s `value`
|
|
37
|
+
* property: `HTMLLIElement.value` is a native long and coerces it to 0.
|
|
33
38
|
* Events: `select` (`detail: { item, value }`) when an enabled item is activated.
|
|
34
39
|
*/
|
|
35
40
|
export declare class MpDropdownMenu extends MpDropdownElement {
|
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
/** How the menu exposes itself to assistive tech (and how items are roled). */
|
|
2
2
|
export type DropdownMode = 'menu' | 'listbox';
|
|
3
|
+
/**
|
|
4
|
+
* A `.dropdown-item` carrying an opaque value for the menu's `select` event.
|
|
5
|
+
* Assign any value (object, string, number) to `dropdownValue`; the menu reports
|
|
6
|
+
* it unchanged. This is the channel the framework wrappers use. `value` cannot
|
|
7
|
+
* serve on an `<li>`: `HTMLLIElement.value` is a native long, so an object or a
|
|
8
|
+
* string assigned to it becomes 0.
|
|
9
|
+
*/
|
|
10
|
+
export type DropdownItemElement = HTMLElement & {
|
|
11
|
+
dropdownValue?: unknown;
|
|
12
|
+
};
|
|
3
13
|
/** `detail` of the `select` event the menu dispatches when an item is activated. */
|
|
4
14
|
export interface DropdownSelectEventDetail {
|
|
5
15
|
/** The activated `.dropdown-item` element. */
|
|
6
16
|
item: HTMLElement;
|
|
7
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* The item's opaque value, if set: its `dropdownValue` property, else its
|
|
19
|
+
* `data-value` attribute, else its own `value`.
|
|
20
|
+
*/
|
|
8
21
|
value?: unknown;
|
|
9
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { DropdownMode, DropdownSelectEventDetail } from './dropdown';
|
|
1
|
+
export type { DropdownItemElement, DropdownMode, DropdownSelectEventDetail } from './dropdown';
|
package/file-manager/index.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { unsafeCSS as
|
|
2
|
-
import { a as
|
|
1
|
+
import { unsafeCSS as _, LitElement as v, html as d, nothing as c } from "lit";
|
|
2
|
+
import { a as w } from "../chunks/install-light-styles-DbCAGFOC.mjs";
|
|
3
3
|
import { L as m } from "../chunks/live-announcer-Bi0orG4n.mjs";
|
|
4
|
-
import { d as
|
|
5
|
-
import { R as
|
|
6
|
-
import { repeat as
|
|
4
|
+
import { d as y } from "../chunks/focus-restore-DxuP1Oe2.mjs";
|
|
5
|
+
import { R as $ } from "../chunks/roving-focus-CrL9982a.mjs";
|
|
6
|
+
import { repeat as x } from "lit/directives/repeat.js";
|
|
7
7
|
import { unsafeHTML as u } from "lit/directives/unsafe-html.js";
|
|
8
|
-
import { createRef as
|
|
9
|
-
import { styleMap as
|
|
10
|
-
import "../chunks/mp-splitter-
|
|
11
|
-
import "../chunks/mp-treeview-
|
|
12
|
-
import "../chunks/mp-datatable-
|
|
13
|
-
const
|
|
8
|
+
import { createRef as C, ref as k } from "lit/directives/ref.js";
|
|
9
|
+
import { styleMap as E } from "lit/directives/style-map.js";
|
|
10
|
+
import "../chunks/mp-splitter-DLehrw3Y.mjs";
|
|
11
|
+
import "../chunks/mp-treeview-CaMTDrvY.mjs";
|
|
12
|
+
import "../chunks/mp-datatable-eRpl7-2V.mjs";
|
|
13
|
+
const M = _(`:host {
|
|
14
14
|
display: flex;
|
|
15
15
|
flex-direction: column;
|
|
16
16
|
width: 100%;
|
|
@@ -372,36 +372,33 @@ mp-datatable {
|
|
|
372
372
|
ariaFileList: "Files and folders",
|
|
373
373
|
ariaFileManager: "File manager"
|
|
374
374
|
};
|
|
375
|
-
function
|
|
375
|
+
function F(a) {
|
|
376
376
|
return a ? { ...p, ...a } : p;
|
|
377
377
|
}
|
|
378
|
-
let
|
|
379
|
-
const f = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M.54 3.87.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3h3.982a2 2 0 0 1 1.992 2.181L15.546 8H2.454l-.913-3.13a.5.5 0 0 1 .013-.087.5.5 0 0 1-.014-.913zM13.81 4H2.19l-.572 6 1.193 4 11.078-2.5L15.81 5.66A1 1 0 0 0 14.81 4z"/></svg>',
|
|
380
|
-
class
|
|
378
|
+
let I = 0;
|
|
379
|
+
const f = "[data-node-id], tr[data-row-key]", b = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M.54 3.87.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3h3.982a2 2 0 0 1 1.992 2.181L15.546 8H2.454l-.913-3.13a.5.5 0 0 1 .013-.087.5.5 0 0 1-.014-.913zM13.81 4H2.19l-.572 6 1.193 4 11.078-2.5L15.81 5.66A1 1 0 0 0 14.81 4z"/></svg>', T = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5L14 4.5zm-3 0A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5h-2z"/></svg>', S = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M2.5 12a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5z"/></svg>', R = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M1 2.5A1.5 1.5 0 0 1 2.5 1h3A1.5 1.5 0 0 1 7 2.5v3A1.5 1.5 0 0 1 5.5 7h-3A1.5 1.5 0 0 1 1 5.5v-3zm8 0A1.5 1.5 0 0 1 10.5 1h3A1.5 1.5 0 0 1 15 2.5v3A1.5 1.5 0 0 1 13.5 7h-3A1.5 1.5 0 0 1 9 5.5v-3zm-8 8A1.5 1.5 0 0 1 2.5 9h3A1.5 1.5 0 0 1 7 10.5v3A1.5 1.5 0 0 1 5.5 15h-3A1.5 1.5 0 0 1 1 13.5v-3zm8 0A1.5 1.5 0 0 1 10.5 9h3a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-3A1.5 1.5 0 0 1 9 13.5v-3z"/></svg>';
|
|
380
|
+
class A extends v {
|
|
381
381
|
constructor() {
|
|
382
|
-
super(...arguments), this.instanceId = `mp-file-manager-${++
|
|
383
|
-
if (e.touches.length !== 1) return;
|
|
384
|
-
const t = e.touches[0],
|
|
385
|
-
(s) => s instanceof HTMLElement && s.
|
|
386
|
-
) ?? this.
|
|
382
|
+
super(...arguments), this.instanceId = `mp-file-manager-${++I}`, this._nodes = [], this._rootFolderId = null, this._currentFolderId = null, this._allowUpload = !1, this._allowOperations = !0, this._viewMode = "list", this._selectionMode = "multiple", this._searchPlaceholder = "", this._messages = p, this._selection = /* @__PURE__ */ new Set(), this._expandedTreeIds = /* @__PURE__ */ new Set(), this._clipboard = null, this._searchQuery = "", this._searchAnnounceTimer = null, this._iconFocusId = null, this.liveAnnouncer = new m(this), this.alertAnnouncer = new m(this, { politeness: "assertive" }), this._renameTarget = null, this._renameInputRef = C(), this._dragDepth = 0, this._contextMenu = null, this._isTouchMode = !1, this._touchHoldTimer = null, this._pendingOps = /* @__PURE__ */ new Map(), this._uploads = [], this._loadedFolders = /* @__PURE__ */ new Set(), this.onTouchStart = (e) => {
|
|
383
|
+
if (this.cancelTouchHold(), e.touches.length !== 1) return;
|
|
384
|
+
const t = e.touches[0], i = e.composedPath().find(
|
|
385
|
+
(s) => s instanceof HTMLElement && s.matches(f)
|
|
386
|
+
) ?? this.elementAt(t.clientX, t.clientY)?.closest(f), n = i?.getAttribute("data-node-id") ?? i?.getAttribute("data-row-key");
|
|
387
387
|
if (!n) return;
|
|
388
|
-
this._touchHoldTarget = n;
|
|
389
388
|
const o = t.clientX, r = t.clientY;
|
|
390
389
|
this._touchHoldTimer = setTimeout(() => {
|
|
391
|
-
this.
|
|
390
|
+
this._touchHoldTimer = null, this._selectionMode !== "none" && !this._selection.has(n) && (this._selection = /* @__PURE__ */ new Set([n]), this.emitSelectionChange()), this.openContextMenu(n, o, r);
|
|
392
391
|
}, 600);
|
|
393
|
-
}, this.
|
|
394
|
-
this._touchHoldTimer && (clearTimeout(this._touchHoldTimer), this._touchHoldTimer = null)
|
|
395
|
-
}, this.onTouchEnd = () => {
|
|
396
|
-
this._touchHoldTimer && (clearTimeout(this._touchHoldTimer), this._touchHoldTimer = null), this._touchHoldTarget = null;
|
|
392
|
+
}, this.cancelTouchHold = () => {
|
|
393
|
+
this._touchHoldTimer && (clearTimeout(this._touchHoldTimer), this._touchHoldTimer = null);
|
|
397
394
|
}, this.openUploadPicker = () => {
|
|
398
395
|
if (!this._allowUpload) return;
|
|
399
396
|
const e = document.createElement("input");
|
|
400
|
-
e.type = "file", e.multiple = !0, e.
|
|
397
|
+
e.type = "file", e.multiple = !0, e.hidden = !0, e.addEventListener("change", () => {
|
|
401
398
|
const t = Array.from(e.files ?? []);
|
|
402
399
|
t.length > 0 && this.handleFiles(t), e.remove();
|
|
403
|
-
}), document.body.appendChild(e), e.click();
|
|
404
|
-
}, this._contextMenuReturnTarget = null, this.contextMenuRoving = new
|
|
400
|
+
}), e.addEventListener("cancel", () => e.remove()), document.body.appendChild(e), e.click();
|
|
401
|
+
}, this._contextMenuReturnTarget = null, this.contextMenuRoving = new $({
|
|
405
402
|
items: () => Array.from(this.renderRoot?.querySelectorAll(".context-menu .menu-item:not([disabled])") ?? []),
|
|
406
403
|
orientation: "vertical",
|
|
407
404
|
wrap: !0
|
|
@@ -419,8 +416,8 @@ class R extends _ {
|
|
|
419
416
|
}, this.onDatatableSelection = (e) => {
|
|
420
417
|
const t = e.detail;
|
|
421
418
|
this._selection = new Set(t.selectedIds), this.emitSelectionChange(), this.requestUpdate();
|
|
422
|
-
}, this.onRowClick = (
|
|
423
|
-
|
|
419
|
+
}, this.onRowClick = () => {
|
|
420
|
+
this.emitSelectionChange();
|
|
424
421
|
}, this.onRowDblClick = (e) => {
|
|
425
422
|
const t = e.detail;
|
|
426
423
|
this.activateNode(t.row);
|
|
@@ -542,7 +539,7 @@ class R extends _ {
|
|
|
542
539
|
};
|
|
543
540
|
}
|
|
544
541
|
static {
|
|
545
|
-
this.styles = [
|
|
542
|
+
this.styles = [M];
|
|
546
543
|
}
|
|
547
544
|
static get observedAttributes() {
|
|
548
545
|
return [
|
|
@@ -602,7 +599,7 @@ class R extends _ {
|
|
|
602
599
|
return this._searchPlaceholder;
|
|
603
600
|
}
|
|
604
601
|
set searchPlaceholder(e) {
|
|
605
|
-
this._searchPlaceholder = e || "
|
|
602
|
+
this._searchPlaceholder = e || "", this.requestUpdate();
|
|
606
603
|
}
|
|
607
604
|
get iconResolver() {
|
|
608
605
|
return this._iconResolver;
|
|
@@ -618,7 +615,7 @@ class R extends _ {
|
|
|
618
615
|
return this._messages;
|
|
619
616
|
}
|
|
620
617
|
set messages(e) {
|
|
621
|
-
this._messages =
|
|
618
|
+
this._messages = F(e), this.hasAttribute("aria-label") && this.setAttribute("aria-label", this._messages.ariaFileManager), this.requestUpdate();
|
|
622
619
|
}
|
|
623
620
|
/**
|
|
624
621
|
* Replacement for `window.confirm` / `window.prompt`. When unset, falls
|
|
@@ -712,28 +709,36 @@ class R extends _ {
|
|
|
712
709
|
case "allow-upload":
|
|
713
710
|
this._allowUpload = i !== null, this.requestUpdate();
|
|
714
711
|
break;
|
|
715
|
-
case "view-mode":
|
|
716
|
-
|
|
712
|
+
case "view-mode": {
|
|
713
|
+
const n = i ?? "list";
|
|
714
|
+
(n === "list" || n === "icons") && (this._viewMode = n, this.requestUpdate());
|
|
717
715
|
break;
|
|
718
|
-
|
|
719
|
-
|
|
716
|
+
}
|
|
717
|
+
case "selection-mode": {
|
|
718
|
+
const n = i ?? "multiple";
|
|
719
|
+
(n === "none" || n === "single" || n === "multiple") && (this._selectionMode = n, n === "none" && this._selection.clear(), this.requestUpdate());
|
|
720
720
|
break;
|
|
721
|
+
}
|
|
721
722
|
case "search-placeholder":
|
|
722
|
-
this._searchPlaceholder = i ?? "
|
|
723
|
+
this._searchPlaceholder = i ?? "", this.requestUpdate();
|
|
723
724
|
break;
|
|
724
725
|
}
|
|
725
726
|
}
|
|
726
727
|
connectedCallback() {
|
|
727
|
-
if (super.connectedCallback(), this.renderRoot instanceof ShadowRoot && (this._releaseLightStyles?.(), this._releaseLightStyles =
|
|
728
|
+
if (super.connectedCallback(), this.renderRoot instanceof ShadowRoot && (this._releaseLightStyles?.(), this._releaseLightStyles = w(this.renderRoot)), this.hasAttribute("role") || this.setAttribute("role", "region"), this.hasAttribute("aria-label") || this.setAttribute("aria-label", this._messages.ariaFileManager), typeof window < "u" && typeof window.matchMedia == "function")
|
|
728
729
|
try {
|
|
729
730
|
this._isTouchMode = window.matchMedia("(pointer: coarse)").matches;
|
|
730
731
|
} catch {
|
|
731
732
|
this._isTouchMode = !1;
|
|
732
733
|
}
|
|
733
|
-
this.addEventListener("touchstart", this.onTouchStart, { passive: !1 }), this.addEventListener("touchend", this.
|
|
734
|
+
this.addEventListener("touchstart", this.onTouchStart, { passive: !1 }), this.addEventListener("touchend", this.cancelTouchHold), this.addEventListener("touchcancel", this.cancelTouchHold), this.addEventListener("touchmove", this.cancelTouchHold);
|
|
734
735
|
}
|
|
735
736
|
disconnectedCallback() {
|
|
736
|
-
super.disconnectedCallback(), this._releaseLightStyles?.(), this._releaseLightStyles = void 0, this.removeEventListener("touchstart", this.onTouchStart), this.removeEventListener("touchend", this.
|
|
737
|
+
super.disconnectedCallback(), this._releaseLightStyles?.(), this._releaseLightStyles = void 0, this.removeEventListener("touchstart", this.onTouchStart), this.removeEventListener("touchend", this.cancelTouchHold), this.removeEventListener("touchcancel", this.cancelTouchHold), this.removeEventListener("touchmove", this.cancelTouchHold), this.cancelTouchHold();
|
|
738
|
+
}
|
|
739
|
+
/** The one hit-test seam: which element of this component is under a viewport point. */
|
|
740
|
+
elementAt(e, t) {
|
|
741
|
+
return this.shadowRoot?.elementFromPoint?.(e, t) ?? null;
|
|
737
742
|
}
|
|
738
743
|
// ─── Operation flags helper ─────────────────────────────────────────────
|
|
739
744
|
/**
|
|
@@ -766,13 +771,13 @@ class R extends _ {
|
|
|
766
771
|
const i = !!this._loadChildren, n = (r) => {
|
|
767
772
|
const s = t.get(r);
|
|
768
773
|
return s ? s.map((l) => {
|
|
769
|
-
const h = n(l.id),
|
|
774
|
+
const h = n(l.id), g = i && h.length === 0 && !this._loadedFolders.has(l.id);
|
|
770
775
|
return {
|
|
771
776
|
id: l.id,
|
|
772
777
|
label: l.name,
|
|
773
778
|
iconKey: l.iconKey ?? "folder",
|
|
774
779
|
children: h,
|
|
775
|
-
lazy:
|
|
780
|
+
lazy: g || void 0
|
|
776
781
|
};
|
|
777
782
|
}) : [];
|
|
778
783
|
}, o = this._rootFolderId;
|
|
@@ -869,7 +874,7 @@ class R extends _ {
|
|
|
869
874
|
class="context-menu"
|
|
870
875
|
role="menu"
|
|
871
876
|
aria-label=${this._messages.ariaFileOperations}
|
|
872
|
-
style=${
|
|
877
|
+
style=${E({ left: `${e.x}px`, top: `${e.y}px` })}
|
|
873
878
|
@click=${(o) => o.stopPropagation()}
|
|
874
879
|
@keydown=${this.onContextMenuKeydown}
|
|
875
880
|
>
|
|
@@ -898,7 +903,7 @@ class R extends _ {
|
|
|
898
903
|
}
|
|
899
904
|
openContextMenu(e, t, i) {
|
|
900
905
|
if (this._allowOperations === !1) return;
|
|
901
|
-
const n =
|
|
906
|
+
const n = y();
|
|
902
907
|
this._contextMenuReturnTarget = n instanceof HTMLElement && n !== n.ownerDocument.body ? n : null, this._contextMenu = { x: t, y: i, targetId: e }, this.requestUpdate(), this.updateComplete.then(() => {
|
|
903
908
|
this.contextMenuRoving.sync(), this.contextMenuRoving.moveTo(0);
|
|
904
909
|
const o = (r) => {
|
|
@@ -966,14 +971,14 @@ class R extends _ {
|
|
|
966
971
|
@click=${() => this.setViewMode("list")}
|
|
967
972
|
aria-label=${e.listView}
|
|
968
973
|
aria-pressed=${this._viewMode === "list"}
|
|
969
|
-
>${u(
|
|
974
|
+
>${u(S)}</button>
|
|
970
975
|
<button
|
|
971
976
|
type="button"
|
|
972
977
|
data-active=${this._viewMode === "icons" ? "true" : "false"}
|
|
973
978
|
@click=${() => this.setViewMode("icons")}
|
|
974
979
|
aria-label=${e.iconsView}
|
|
975
980
|
aria-pressed=${this._viewMode === "icons"}
|
|
976
|
-
>${u(
|
|
981
|
+
>${u(R)}</button>
|
|
977
982
|
</div>
|
|
978
983
|
</div>
|
|
979
984
|
`;
|
|
@@ -1060,7 +1065,7 @@ class R extends _ {
|
|
|
1060
1065
|
<span class="row-cell">
|
|
1061
1066
|
<span class="row-icon" aria-hidden="true">${t ? u(t) : c}</span>
|
|
1062
1067
|
<input
|
|
1063
|
-
${
|
|
1068
|
+
${k(this._renameInputRef)}
|
|
1064
1069
|
type="text"
|
|
1065
1070
|
class="rename-input"
|
|
1066
1071
|
.value=${e.name}
|
|
@@ -1085,7 +1090,7 @@ class R extends _ {
|
|
|
1085
1090
|
renderIconGridView(e) {
|
|
1086
1091
|
return d`
|
|
1087
1092
|
<div class="icon-grid" role="listbox" aria-multiselectable="true" aria-label=${this._messages.ariaFileList} @keydown=${this.onContentKeydown}>
|
|
1088
|
-
${
|
|
1093
|
+
${x(
|
|
1089
1094
|
e,
|
|
1090
1095
|
(t) => t.id,
|
|
1091
1096
|
(t, i) => this.renderIconCard(t, i, e)
|
|
@@ -1124,7 +1129,7 @@ class R extends _ {
|
|
|
1124
1129
|
const i = this._iconResolver(t, e);
|
|
1125
1130
|
if (i) return i;
|
|
1126
1131
|
}
|
|
1127
|
-
return e.type === "folder" ?
|
|
1132
|
+
return e.type === "folder" ? b : T;
|
|
1128
1133
|
}
|
|
1129
1134
|
resolveIconForTree(e, t) {
|
|
1130
1135
|
const i = this._nodes.find((n) => n.id === t.id);
|
|
@@ -1132,7 +1137,7 @@ class R extends _ {
|
|
|
1132
1137
|
const n = this._iconResolver(e, i);
|
|
1133
1138
|
if (n) return n;
|
|
1134
1139
|
}
|
|
1135
|
-
return
|
|
1140
|
+
return b;
|
|
1136
1141
|
}
|
|
1137
1142
|
onIconCardContextMenu(e, t) {
|
|
1138
1143
|
t.preventDefault(), this._selectionMode !== "none" && !this._selection.has(e.id) && (this._selection = /* @__PURE__ */ new Set([e.id]), this.emitSelectionChange()), this.openContextMenu(e.id, t.clientX, t.clientY);
|
|
@@ -1314,17 +1319,14 @@ class R extends _ {
|
|
|
1314
1319
|
}
|
|
1315
1320
|
formatDate(e) {
|
|
1316
1321
|
if (!e.modifiedAt) return "—";
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
} catch {
|
|
1320
|
-
return e.modifiedAt;
|
|
1321
|
-
}
|
|
1322
|
+
const t = new Date(e.modifiedAt);
|
|
1323
|
+
return Number.isNaN(t.getTime()) ? e.modifiedAt : t.toLocaleDateString();
|
|
1322
1324
|
}
|
|
1323
1325
|
}
|
|
1324
|
-
typeof customElements < "u" && !customElements.get("mp-file-manager") && customElements.define("mp-file-manager",
|
|
1326
|
+
typeof customElements < "u" && !customElements.get("mp-file-manager") && customElements.define("mp-file-manager", A);
|
|
1325
1327
|
export {
|
|
1326
1328
|
p as DEFAULT_FILE_MANAGER_MESSAGES,
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1329
|
+
A as MpFileManager,
|
|
1330
|
+
M as fileManagerStyles,
|
|
1331
|
+
F as mergeMessages
|
|
1330
1332
|
};
|
|
@@ -155,7 +155,6 @@ export declare class MpFileManager extends LitElement {
|
|
|
155
155
|
private _contextMenu;
|
|
156
156
|
private _isTouchMode;
|
|
157
157
|
private _touchHoldTimer;
|
|
158
|
-
private _touchHoldTarget;
|
|
159
158
|
private _pendingOps;
|
|
160
159
|
private _uploads;
|
|
161
160
|
private _dialogResolver;
|
|
@@ -241,8 +240,10 @@ export declare class MpFileManager extends LitElement {
|
|
|
241
240
|
* the context menu on the touched row. Movement aborts the long-press.
|
|
242
241
|
*/
|
|
243
242
|
private onTouchStart;
|
|
244
|
-
|
|
245
|
-
private
|
|
243
|
+
/** The one hit-test seam: which element of this component is under a viewport point. */
|
|
244
|
+
private elementAt;
|
|
245
|
+
/** Movement (a scroll), lifting (a tap) and touchcancel all abandon the hold. */
|
|
246
|
+
private cancelTouchHold;
|
|
246
247
|
/**
|
|
247
248
|
* Opens an `<input type="file" multiple>` picker for touch consumers
|
|
248
249
|
* (replaces OS file-drop on phones/tablets). Emits `mp-upload-request`
|