@astryx-vue/core 0.1.0 → 0.1.1
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/README.md +1 -1
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/Banner/index.d.ts +1 -1
- package/dist/Button/index.d.ts +1 -1
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/Calendar/index.js +1 -1
- package/dist/{Calendar-DpYFXwgb.js → Calendar-BEyrkUtr.js} +2 -1
- package/dist/Chat/index.js +1 -1
- package/dist/{Chat-Bfd-YPAK.js → Chat-CO3mCs9A.js} +2 -2
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxList/index.d.ts +2 -0
- package/dist/CheckboxList/index.js +2 -0
- package/dist/CheckboxList-BL2sDOWK.js +174 -0
- package/dist/Citation/index.js +1 -1
- package/dist/{Citation-DaDd1teb.js → Citation-BqwJvw7o.js} +2 -2
- package/dist/Code/index.js +1 -1
- package/dist/{CodeBlock-CK-NWM_1.js → CodeBlock-BQdooQy2.js} +1 -1
- package/dist/Collapsible/index.js +1 -1
- package/dist/{Collapsible-ByXCGhT8.js → Collapsible-BYg9soTk.js} +1 -1
- package/dist/ContextMenu/index.d.ts +1 -1
- package/dist/ContextMenu/index.js +1 -1
- package/dist/{ContextMenu-BJh99Exj.js → ContextMenu-dA-ppaRQ.js} +284 -12
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.js +1 -1
- package/dist/{DateInput-zJAdXByM.js → DateInput-BOIb0zAp.js} +18 -10
- package/dist/DateRangeInput/index.d.ts +2 -0
- package/dist/DateRangeInput/index.js +2 -0
- package/dist/DateRangeInput-DLcbgUBi.js +385 -0
- package/dist/DateTimeInput/index.d.ts +2 -0
- package/dist/DateTimeInput/index.js +2 -0
- package/dist/DateTimeInput-RitYX_Yx.js +196 -0
- package/dist/Divider/index.d.ts +1 -1
- package/dist/DropdownMenu/index.d.ts +1 -1
- package/dist/DropdownMenu/index.js +1 -1
- package/dist/{DropdownMenu-C3j2zaEn.js → DropdownMenu-B0gogrvG.js} +2 -2
- package/dist/Field/index.d.ts +2 -2
- package/dist/Field/index.js +1 -2
- package/dist/FieldStatus/index.d.ts +2 -0
- package/dist/FieldStatus/index.js +2 -0
- package/dist/FileInput/index.d.ts +2 -0
- package/dist/FileInput/index.js +2 -0
- package/dist/FileInput-CYvEV503.js +238 -0
- package/dist/{Icon-B6qNgBP9.js → Icon-5MdZQ18k.js} +10 -2
- package/dist/List/index.d.ts +1 -1
- package/dist/Markdown/index.d.ts +1 -1
- package/dist/Markdown/index.js +1 -1
- package/dist/{Markdown-DyKIwAL_.js → Markdown-Dnlp8cVx.js} +2 -2
- package/dist/MetadataList/index.d.ts +2 -0
- package/dist/MetadataList/index.js +2 -0
- package/dist/MetadataList-DIsqS1Qb.js +124 -0
- package/dist/MobileNav/index.js +1 -1
- package/dist/{MobileNavToggle-BK2iRJF-.js → MobileNavToggle-aUZiDwHm.js} +1 -1
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MoreMenu/index.js +1 -1
- package/dist/{MoreMenu-BjUsVWWk.js → MoreMenu-BXL6Dqsu.js} +2 -2
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/MultiSelector/index.js +1 -1
- package/dist/{MultiSelector-CKTbTj1A.js → MultiSelector-Bh8or2S6.js} +2 -2
- package/dist/NavItem/index.d.ts +1 -1
- package/dist/NavMenu/index.d.ts +1 -1
- package/dist/NumberInput/index.d.ts +1 -1
- package/dist/NumberInput/index.js +1 -1
- package/dist/{NumberInput-DU3_rw7z.js → NumberInput-C3S-4dIu.js} +1 -1
- package/dist/OverflowList/index.d.ts +1 -1
- package/dist/OverflowList/index.js +1 -1
- package/dist/{OverflowList-B2T5UtiQ.js → OverflowList-Kr4iJrNV.js} +1 -1
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-qCgNwwhr.js → Pagination-BRStpeSB.js} +2 -2
- package/dist/Popover/index.d.ts +1 -1
- package/dist/Radio/index.d.ts +2 -2
- package/dist/Radio/index.js +2 -2
- package/dist/{Radio-BioQfwHQ.js → RadioGroup-DS6oTV_j.js} +21 -88
- package/dist/RadioList/index.d.ts +2 -0
- package/dist/RadioList/index.js +2 -0
- package/dist/RadioList-pwr93I-z.js +122 -0
- package/dist/SegmentedControl/index.d.ts +1 -1
- package/dist/Selector/index.d.ts +1 -1
- package/dist/Selector/index.js +1 -1
- package/dist/{Selector-C6sPJMtH.js → Selector-DvEUIVEC.js} +1 -1
- package/dist/SideNav/index.d.ts +1 -1
- package/dist/SideNav/index.js +1 -1
- package/dist/{SideNav-D9lnn-sM.js → SideNav-B7LX4RcP.js} +2 -2
- package/dist/Stack/index.d.ts +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/Table/index.d.ts +2 -0
- package/dist/Table/index.js +2 -0
- package/dist/Table-D5zWaITo.js +967 -0
- package/dist/Text/index.d.ts +1 -1
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/Thumbnail/index.d.ts +2 -0
- package/dist/Thumbnail/index.js +2 -0
- package/dist/Thumbnail-DMOgWncm.js +163 -0
- package/dist/TimeField-DeQ1ukHl.js +214 -0
- package/dist/TimeInput/index.d.ts +2 -0
- package/dist/TimeInput/index.js +2 -0
- package/dist/TimeInput-jb1nLqZk.js +121 -0
- package/dist/Timestamp/index.d.ts +2 -0
- package/dist/Timestamp/index.js +2 -0
- package/dist/Timestamp-DrWwVQBL.js +465 -0
- package/dist/ToggleButton/index.d.ts +1 -1
- package/dist/Token/index.d.ts +1 -1
- package/dist/Token/index.js +1 -1
- package/dist/{Token-Ctf9jekS.js → Token-CV2J94bn.js} +1 -1
- package/dist/Tokenizer/index.d.ts +1 -1
- package/dist/Tokenizer/index.js +1 -1
- package/dist/{Tokenizer-D5MPgau0.js → Tokenizer-DF9r4hTW.js} +2 -2
- package/dist/Toolbar/index.d.ts +1 -1
- package/dist/TopNav/index.d.ts +1 -1
- package/dist/TopNav/index.js +1 -1
- package/dist/{TopNav-CjbMCbkC.js → TopNav-BH_s3uap.js} +3 -3
- package/dist/TreeList/index.d.ts +2 -0
- package/dist/TreeList/index.js +2 -0
- package/dist/TreeList-D9cR-w7r.js +506 -0
- package/dist/Typeahead/index.d.ts +1 -1
- package/dist/Typeahead/index.js +1 -1
- package/dist/{Typeahead-BMoU3hfx.js → Typeahead-s4DC1Qem.js} +2 -2
- package/dist/composables/index.d.ts +2 -2
- package/dist/composables/index.js +4 -1
- package/dist/{locale-56lkR7OK.js → context-BshXcNYX.js} +183 -18
- package/dist/{index-DjOdQv5B.d.ts → index--dh0s8Li.d.ts} +1 -1
- package/dist/{index-Cdi82rTW.d.ts → index-12ObcW99.d.ts} +6 -2
- package/dist/{index-JeZ0YTyd.d.ts → index-5R_pi3eT.d.ts} +2 -2
- package/dist/{index-Cc2HGODZ.d.ts → index-AkMWQ97a.d.ts} +3 -3
- package/dist/{index-CvLlWLIZ.d.ts → index-B4OOtNP8.d.ts} +4 -4
- package/dist/{index-_1-uvr27.d.ts → index-B8MbfMwV.d.ts} +1 -1
- package/dist/{index-MPcg1Pm4.d.ts → index-BKr7yvVv.d.ts} +1 -1
- package/dist/{index-CxspvLBl.d.ts → index-Bc0dgVM5.d.ts} +5 -5
- package/dist/{index-4FM5lQdV.d.ts → index-BlWLperN.d.ts} +1 -1
- package/dist/{index-DBcbfStA.d.ts → index-BnNh5Iml.d.ts} +84 -1
- package/dist/{index-Cp0NlzQv.d.ts → index-Bovw9_8d.d.ts} +1 -1
- package/dist/{index-CnVbMebA.d.ts → index-Bqb_Fyju.d.ts} +3 -3
- package/dist/{index-HV6W3xCx.d.ts → index-Byar3h1e.d.ts} +1 -1
- package/dist/{index-BQuN_dWR.d.ts → index-BzqRns96.d.ts} +1 -1
- package/dist/{index-C0S2Xzoi.d.ts → index-CNcQmDrK.d.ts} +93 -0
- package/dist/{index-CaHXYQ_E.d.ts → index-CQ9F1f_F.d.ts} +535 -137
- package/dist/index-CR6sUmRT.d.ts +356 -0
- package/dist/index-C_2Z65Rp.d.ts +67 -0
- package/dist/{index-Dw21t7Uf.d.ts → index-CsJpQElv.d.ts} +1 -1
- package/dist/index-CtlkhQ55.d.ts +36 -0
- package/dist/{index-C8NW9xre.d.ts → index-D3V7yRUP.d.ts} +7 -7
- package/dist/index-Da7Jm8Ht.d.ts +10 -0
- package/dist/{index-CPhDtlv-.d.ts → index-FEy8qFSD.d.ts} +3 -3
- package/dist/{index-BeJqhW4l.d.ts → index-Q4gqBSIZ.d.ts} +2 -2
- package/dist/{index-Cz9ZHVf6.d.ts → index-g03bmR4K.d.ts} +3 -3
- package/dist/{index-COxy6LEW.d.ts → index-gW0HW02U.d.ts} +1 -1
- package/dist/{index-BQa836Vz.d.ts → index-iBLzInje.d.ts} +6 -14
- package/dist/index-utZGF4GR.d.ts +79 -0
- package/dist/index.d.ts +54 -49
- package/dist/index.js +86 -64
- package/dist/locale/index.d.ts +1 -1
- package/dist/locale/index.js +2 -1
- package/dist/locale-Cpk_nrLA.js +18 -0
- package/dist/useFileSelection-BPtaegqK.js +58 -0
- package/dist/useMonthGrid-CmJsZTcB.js +139 -0
- package/dist/useTimeValue-DWk6oTAZ.js +113 -0
- package/package.json +49 -1
- package/styles/bordered-control.css +87 -0
- package/styles/calendar.css +8 -2
- package/styles/checkbox-list.css +15 -0
- package/styles/date-range-input.css +163 -0
- package/styles/date-time-input.css +40 -0
- package/styles/field.css +2 -3
- package/styles/file-input.css +87 -0
- package/styles/icon.css +32 -0
- package/styles/metadata-list.css +107 -0
- package/styles/number-input.css +6 -0
- package/styles/radio.css +32 -0
- package/styles/selector.css +10 -0
- package/styles/table.css +256 -0
- package/styles/text-area.css +6 -1
- package/styles/text-input.css +6 -0
- package/styles/thumbnail.css +151 -0
- package/styles/time-input.css +51 -0
- package/styles/timestamp.css +93 -0
- package/styles/tree-list.css +229 -0
- package/styles.css +11 -0
|
@@ -1,13 +1,22 @@
|
|
|
1
|
+
import { t as useMediaQuery } from "./useMediaQuery-GMmgp28-.js";
|
|
1
2
|
import { t as useDismiss } from "./useDismiss-CAiHU6QD.js";
|
|
2
3
|
import { t as useLongPress } from "./useLongPress-Cyxwa73s.js";
|
|
3
4
|
import { n as useOverflow } from "./useOverflow-VrwF5oek.js";
|
|
4
|
-
import { t as _sfc_main$6 } from "./Icon-
|
|
5
|
+
import { t as _sfc_main$6 } from "./Icon-5MdZQ18k.js";
|
|
5
6
|
import { t as _sfc_main$7 } from "./Divider-BtwnL18I.js";
|
|
6
7
|
import { t as usePositionedLayer } from "./usePositionedLayer-C1NBOsVT.js";
|
|
7
|
-
import { Fragment, Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, inject, mergeModels, mergeProps, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, openBlock, provide, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, toDisplayString, unref, useAttrs, useId, useModel, useTemplateRef, vShow, watch, withCtx, withDirectives, withModifiers } from "vue";
|
|
8
|
+
import { Fragment, Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, inject, mergeModels, mergeProps, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, onScopeDispose, openBlock, provide, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, toDisplayString, unref, useAttrs, useId, useModel, useTemplateRef, vShow, watch, withCtx, withDirectives, withModifiers } from "vue";
|
|
8
9
|
import "../styles/context-menu.css";
|
|
9
10
|
//#region src/ContextMenu/context.ts
|
|
10
11
|
const contextMenuContextKey = Symbol("astryx-context-menu");
|
|
12
|
+
/**
|
|
13
|
+
* Whether the submenu flyout that contains this one is showing.
|
|
14
|
+
*
|
|
15
|
+
* Nested flyouts are teleported to `body`, so hiding an ancestor's DOM does
|
|
16
|
+
* not hide them. Each submenu provides its own `showsFlyout` for the next
|
|
17
|
+
* level; a row with no ancestor submenu reads as open.
|
|
18
|
+
*/
|
|
19
|
+
const submenuAncestorOpenKey = Symbol("astryx-submenu-ancestor-open");
|
|
11
20
|
/** The surrounding menu, or `undefined` when the row stands alone. */
|
|
12
21
|
function useContextMenu() {
|
|
13
22
|
return inject(contextMenuContextKey, void 0);
|
|
@@ -385,6 +394,229 @@ const _sfc_main$3 = /*@__PURE__*/ defineComponent({
|
|
|
385
394
|
};
|
|
386
395
|
}
|
|
387
396
|
});
|
|
397
|
+
function sign(p1, p2, p3) {
|
|
398
|
+
return (p1.x - p3.x) * (p2.y - p3.y) - (p2.x - p3.x) * (p1.y - p3.y);
|
|
399
|
+
}
|
|
400
|
+
function isPointInTriangle(p, a, b, c) {
|
|
401
|
+
const d1 = sign(p, a, b);
|
|
402
|
+
const d2 = sign(p, b, c);
|
|
403
|
+
const d3 = sign(p, c, a);
|
|
404
|
+
return !((d1 < 0 || d2 < 0 || d3 < 0) && (d1 > 0 || d2 > 0 || d3 > 0));
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Whether `point` lies inside the triangle from `origin` (where the pointer
|
|
408
|
+
* left the row) to the flyout's near edge — the edge facing the origin.
|
|
409
|
+
*/
|
|
410
|
+
function isPointInSafeTriangle(point, origin, flyout) {
|
|
411
|
+
const pad = 8;
|
|
412
|
+
let edgeStart;
|
|
413
|
+
let edgeEnd;
|
|
414
|
+
if (origin.x <= flyout.left) {
|
|
415
|
+
edgeStart = {
|
|
416
|
+
x: flyout.left,
|
|
417
|
+
y: flyout.top - pad
|
|
418
|
+
};
|
|
419
|
+
edgeEnd = {
|
|
420
|
+
x: flyout.left,
|
|
421
|
+
y: flyout.bottom + pad
|
|
422
|
+
};
|
|
423
|
+
} else if (origin.x >= flyout.right) {
|
|
424
|
+
edgeStart = {
|
|
425
|
+
x: flyout.right,
|
|
426
|
+
y: flyout.top - pad
|
|
427
|
+
};
|
|
428
|
+
edgeEnd = {
|
|
429
|
+
x: flyout.right,
|
|
430
|
+
y: flyout.bottom + pad
|
|
431
|
+
};
|
|
432
|
+
} else if (origin.y <= flyout.top) {
|
|
433
|
+
edgeStart = {
|
|
434
|
+
x: flyout.left - pad,
|
|
435
|
+
y: flyout.top
|
|
436
|
+
};
|
|
437
|
+
edgeEnd = {
|
|
438
|
+
x: flyout.right + pad,
|
|
439
|
+
y: flyout.top
|
|
440
|
+
};
|
|
441
|
+
} else if (origin.y >= flyout.bottom) {
|
|
442
|
+
edgeStart = {
|
|
443
|
+
x: flyout.left - pad,
|
|
444
|
+
y: flyout.bottom
|
|
445
|
+
};
|
|
446
|
+
edgeEnd = {
|
|
447
|
+
x: flyout.right + pad,
|
|
448
|
+
y: flyout.bottom
|
|
449
|
+
};
|
|
450
|
+
} else return false;
|
|
451
|
+
return isPointInTriangle(point, origin, edgeStart, edgeEnd);
|
|
452
|
+
}
|
|
453
|
+
function useSubmenuHover(options) {
|
|
454
|
+
const hasHover = useMediaQuery("(hover: hover)");
|
|
455
|
+
let showTimer;
|
|
456
|
+
let hideTimer;
|
|
457
|
+
let stopTriangle = null;
|
|
458
|
+
/** Hover opened this flyout, so leaving may close it. */
|
|
459
|
+
let provenance = null;
|
|
460
|
+
let hoverOpenedAt = 0;
|
|
461
|
+
/** When the flyout last closed. A pointer enter inside the suppress window is ignored. */
|
|
462
|
+
let closedAt = 0;
|
|
463
|
+
/** While true, a point inside `isInsideTriangle` is still heading for the flyout. */
|
|
464
|
+
let isTracking = false;
|
|
465
|
+
let isInsideTriangle = () => false;
|
|
466
|
+
function clearShowTimer() {
|
|
467
|
+
if (showTimer != null) clearTimeout(showTimer);
|
|
468
|
+
showTimer = void 0;
|
|
469
|
+
}
|
|
470
|
+
function clearHideTimer() {
|
|
471
|
+
if (hideTimer != null) clearTimeout(hideTimer);
|
|
472
|
+
hideTimer = void 0;
|
|
473
|
+
}
|
|
474
|
+
function clearTriangle() {
|
|
475
|
+
stopTriangle?.();
|
|
476
|
+
stopTriangle = null;
|
|
477
|
+
isTracking = false;
|
|
478
|
+
isInsideTriangle = () => false;
|
|
479
|
+
}
|
|
480
|
+
function cancelTimers() {
|
|
481
|
+
clearShowTimer();
|
|
482
|
+
clearHideTimer();
|
|
483
|
+
clearTriangle();
|
|
484
|
+
}
|
|
485
|
+
function markClosed() {
|
|
486
|
+
const shouldStamp = options.isOpen() || provenance != null;
|
|
487
|
+
cancelTimers();
|
|
488
|
+
provenance = null;
|
|
489
|
+
hoverOpenedAt = 0;
|
|
490
|
+
if (shouldStamp) closedAt = Date.now();
|
|
491
|
+
}
|
|
492
|
+
function closeNow() {
|
|
493
|
+
cancelTimers();
|
|
494
|
+
provenance = null;
|
|
495
|
+
hoverOpenedAt = 0;
|
|
496
|
+
if (options.isOpen()) options.closeFromPointer();
|
|
497
|
+
}
|
|
498
|
+
function notePinned() {
|
|
499
|
+
cancelTimers();
|
|
500
|
+
provenance = "pinned";
|
|
501
|
+
hoverOpenedAt = 0;
|
|
502
|
+
closedAt = 0;
|
|
503
|
+
}
|
|
504
|
+
function noteHoverOpened() {
|
|
505
|
+
provenance = "hover";
|
|
506
|
+
hoverOpenedAt = Date.now();
|
|
507
|
+
closedAt = 0;
|
|
508
|
+
}
|
|
509
|
+
function scheduleHide(event) {
|
|
510
|
+
if (provenance !== "hover") return;
|
|
511
|
+
clearHideTimer();
|
|
512
|
+
clearTriangle();
|
|
513
|
+
let lastPoint = null;
|
|
514
|
+
const arm = () => {
|
|
515
|
+
clearHideTimer();
|
|
516
|
+
hideTimer = setTimeout(() => {
|
|
517
|
+
if (isTracking && lastPoint != null && isInsideTriangle(lastPoint)) {
|
|
518
|
+
arm();
|
|
519
|
+
return;
|
|
520
|
+
}
|
|
521
|
+
closeNow();
|
|
522
|
+
}, 200);
|
|
523
|
+
};
|
|
524
|
+
arm();
|
|
525
|
+
const menu = unref(options.flyout);
|
|
526
|
+
const apex = event != null ? {
|
|
527
|
+
x: event.clientX,
|
|
528
|
+
y: event.clientY
|
|
529
|
+
} : null;
|
|
530
|
+
if (menu == null || apex == null || !options.isOpen()) return;
|
|
531
|
+
const rect = menu.getBoundingClientRect();
|
|
532
|
+
if (rect.width <= 0 || rect.height <= 0) return;
|
|
533
|
+
const doc = menu.ownerDocument;
|
|
534
|
+
isInsideTriangle = (point) => isPointInSafeTriangle(point, apex, rect);
|
|
535
|
+
isTracking = true;
|
|
536
|
+
lastPoint = apex;
|
|
537
|
+
const onPointerMove = (move) => {
|
|
538
|
+
const point = {
|
|
539
|
+
x: move.clientX,
|
|
540
|
+
y: move.clientY
|
|
541
|
+
};
|
|
542
|
+
lastPoint = point;
|
|
543
|
+
if (isInsideTriangle(point)) {
|
|
544
|
+
arm();
|
|
545
|
+
return;
|
|
546
|
+
}
|
|
547
|
+
isTracking = false;
|
|
548
|
+
clearTriangle();
|
|
549
|
+
};
|
|
550
|
+
doc.addEventListener("pointermove", onPointerMove, true);
|
|
551
|
+
stopTriangle = () => {
|
|
552
|
+
doc.removeEventListener("pointermove", onPointerMove, true);
|
|
553
|
+
};
|
|
554
|
+
}
|
|
555
|
+
function onTriggerPointerEnter(event) {
|
|
556
|
+
if (event.pointerType !== "mouse" || !hasHover.value) return;
|
|
557
|
+
if (options.isOpen()) {
|
|
558
|
+
clearHideTimer();
|
|
559
|
+
clearTriangle();
|
|
560
|
+
return;
|
|
561
|
+
}
|
|
562
|
+
if (closedAt > 0 && Date.now() - closedAt < 300) return;
|
|
563
|
+
clearShowTimer();
|
|
564
|
+
if (!options.isEnabled()) return;
|
|
565
|
+
showTimer = setTimeout(() => {
|
|
566
|
+
showTimer = void 0;
|
|
567
|
+
if (!options.isEnabled() || options.isOpen()) return;
|
|
568
|
+
options.openFromHover();
|
|
569
|
+
}, 150);
|
|
570
|
+
}
|
|
571
|
+
function onTriggerPointerLeave(event) {
|
|
572
|
+
if (event.pointerType !== "mouse") return;
|
|
573
|
+
closedAt = 0;
|
|
574
|
+
clearShowTimer();
|
|
575
|
+
scheduleHide(event);
|
|
576
|
+
}
|
|
577
|
+
function onFlyoutPointerEnter(event) {
|
|
578
|
+
if (event.pointerType !== "mouse") return;
|
|
579
|
+
clearShowTimer();
|
|
580
|
+
clearHideTimer();
|
|
581
|
+
clearTriangle();
|
|
582
|
+
}
|
|
583
|
+
function onFlyoutPointerLeave(event) {
|
|
584
|
+
if (event.pointerType !== "mouse") return;
|
|
585
|
+
closedAt = 0;
|
|
586
|
+
scheduleHide(event);
|
|
587
|
+
}
|
|
588
|
+
function onTriggerClick(event) {
|
|
589
|
+
if (!options.isEnabled()) return;
|
|
590
|
+
if (event.detail === 0) {
|
|
591
|
+
if (!options.isOpen()) options.openPinned();
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
594
|
+
cancelTimers();
|
|
595
|
+
if (!options.isOpen()) {
|
|
596
|
+
options.openPinned();
|
|
597
|
+
return;
|
|
598
|
+
}
|
|
599
|
+
if (provenance === "hover" && hoverOpenedAt > 0 && Date.now() - hoverOpenedAt < 500) {
|
|
600
|
+
provenance = "pinned";
|
|
601
|
+
hoverOpenedAt = 0;
|
|
602
|
+
return;
|
|
603
|
+
}
|
|
604
|
+
options.closeFromPointer();
|
|
605
|
+
}
|
|
606
|
+
onScopeDispose(cancelTimers);
|
|
607
|
+
return {
|
|
608
|
+
cancel: cancelTimers,
|
|
609
|
+
isHoverDriven: () => provenance === "hover",
|
|
610
|
+
markClosed,
|
|
611
|
+
noteHoverOpened,
|
|
612
|
+
notePinned,
|
|
613
|
+
onFlyoutPointerEnter,
|
|
614
|
+
onFlyoutPointerLeave,
|
|
615
|
+
onTriggerClick,
|
|
616
|
+
onTriggerPointerEnter,
|
|
617
|
+
onTriggerPointerLeave
|
|
618
|
+
};
|
|
619
|
+
}
|
|
388
620
|
//#endregion
|
|
389
621
|
//#region src/ContextMenu/ContextMenuSubMenu.vue
|
|
390
622
|
const _hoisted_1$1 = [
|
|
@@ -441,7 +673,9 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
|
441
673
|
const isOpen = ref(false);
|
|
442
674
|
const flyoutId = `astryx-context-menu-submenu-${useId()}`;
|
|
443
675
|
const flyoutLabel = computed(() => typeof props.label === "string" ? props.label : menu?.menuLabel.value ?? "Submenu");
|
|
444
|
-
const
|
|
676
|
+
const ancestorOpen = inject(submenuAncestorOpenKey, computed(() => true));
|
|
677
|
+
const showsFlyout = computed(() => isOpen.value && (menu?.isOpen.value ?? true) && ancestorOpen.value);
|
|
678
|
+
provide(submenuAncestorOpenKey, showsFlyout);
|
|
445
679
|
const { position } = usePositionedLayer({
|
|
446
680
|
anchor: row,
|
|
447
681
|
layer: flyout,
|
|
@@ -469,6 +703,14 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
|
469
703
|
enableEscape: computed(() => true),
|
|
470
704
|
onDismiss: () => close(true)
|
|
471
705
|
});
|
|
706
|
+
const hover = useSubmenuHover({
|
|
707
|
+
isEnabled: () => !props.isDisabled,
|
|
708
|
+
isOpen: () => isOpen.value,
|
|
709
|
+
flyout,
|
|
710
|
+
openFromHover,
|
|
711
|
+
openPinned: () => open(false),
|
|
712
|
+
closeFromPointer: () => close(false)
|
|
713
|
+
});
|
|
472
714
|
function open(focusFirstRow) {
|
|
473
715
|
if (props.isDisabled) return;
|
|
474
716
|
if (isOpen.value) {
|
|
@@ -477,10 +719,19 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
|
477
719
|
}
|
|
478
720
|
isOpen.value = true;
|
|
479
721
|
emit("openChange", true);
|
|
722
|
+
hover.notePinned();
|
|
480
723
|
if (focusFirstRow) nextTick(() => nav.focusFirst());
|
|
481
724
|
}
|
|
725
|
+
function openFromHover() {
|
|
726
|
+
if (props.isDisabled || isOpen.value) return;
|
|
727
|
+
isOpen.value = true;
|
|
728
|
+
emit("openChange", true);
|
|
729
|
+
hover.noteHoverOpened();
|
|
730
|
+
}
|
|
482
731
|
function close(focusRow) {
|
|
483
|
-
|
|
732
|
+
const wasOpen = isOpen.value;
|
|
733
|
+
hover.markClosed();
|
|
734
|
+
if (!wasOpen) return;
|
|
484
735
|
isOpen.value = false;
|
|
485
736
|
nav.resetTypeahead();
|
|
486
737
|
emit("openChange", false);
|
|
@@ -496,12 +747,22 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
|
496
747
|
close(false);
|
|
497
748
|
}
|
|
498
749
|
function onRowFocusOut() {
|
|
499
|
-
if (!isOpen.value) return;
|
|
750
|
+
if (!isOpen.value || hover.isHoverDriven()) return;
|
|
500
751
|
nextTick(() => {
|
|
752
|
+
if (!isOpen.value || hover.isHoverDriven()) return;
|
|
501
753
|
const active = row.value?.ownerDocument.activeElement;
|
|
502
754
|
if (!(active instanceof Node && (row.value?.contains(active) === true || flyout.value?.contains(active) === true))) close(false);
|
|
503
755
|
});
|
|
504
756
|
}
|
|
757
|
+
function onRowClick(event) {
|
|
758
|
+
hover.onTriggerClick(event);
|
|
759
|
+
}
|
|
760
|
+
function onRowPointerMove(event) {
|
|
761
|
+
if (props.isDisabled || event.pointerType !== "mouse") return;
|
|
762
|
+
const element = row.value;
|
|
763
|
+
if (element == null || element === element.ownerDocument.activeElement) return;
|
|
764
|
+
element.focus({ preventScroll: true });
|
|
765
|
+
}
|
|
505
766
|
function onFlyoutKeyDown(event) {
|
|
506
767
|
if (event.isComposing) return;
|
|
507
768
|
if (event.key === "ArrowLeft") {
|
|
@@ -515,11 +776,18 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
|
515
776
|
emit("select", item, event);
|
|
516
777
|
}
|
|
517
778
|
function onRowPointerEnter(event) {
|
|
518
|
-
|
|
519
|
-
open(false);
|
|
779
|
+
hover.onTriggerPointerEnter(event);
|
|
520
780
|
}
|
|
521
|
-
watch(() => menu?.isOpen.value, (
|
|
522
|
-
if (
|
|
781
|
+
watch(() => menu?.isOpen.value, (menuOpen) => {
|
|
782
|
+
if (menuOpen === false) {
|
|
783
|
+
hover.cancel();
|
|
784
|
+
close(false);
|
|
785
|
+
}
|
|
786
|
+
});
|
|
787
|
+
watch(ancestorOpen, (visible) => {
|
|
788
|
+
if (visible) return;
|
|
789
|
+
hover.cancel();
|
|
790
|
+
close(false);
|
|
523
791
|
});
|
|
524
792
|
return (_ctx, _cache) => {
|
|
525
793
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
@@ -538,10 +806,12 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
|
538
806
|
role: "menuitem",
|
|
539
807
|
style: unref(attrs).style,
|
|
540
808
|
tabindex: __props.isDisabled ? void 0 : -1,
|
|
541
|
-
onClick:
|
|
809
|
+
onClick: onRowClick,
|
|
542
810
|
onFocusout: onRowFocusOut,
|
|
543
811
|
onKeydown: onRowKeyDown,
|
|
544
|
-
onPointerenter: onRowPointerEnter
|
|
812
|
+
onPointerenter: onRowPointerEnter,
|
|
813
|
+
onPointerleave: _cache[0] || (_cache[0] = (...args) => unref(hover).onTriggerPointerLeave && unref(hover).onTriggerPointerLeave(...args)),
|
|
814
|
+
onPointermove: onRowPointerMove
|
|
545
815
|
}), [
|
|
546
816
|
__props.icon != null || _ctx.$slots.icon ? (openBlock(), createElementBlock("span", _hoisted_2, [renderSlot(_ctx.$slots, "icon", {}, () => [createVNode(_sfc_main$6, {
|
|
547
817
|
icon: __props.icon,
|
|
@@ -573,7 +843,9 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
|
573
843
|
style: normalizeStyle(flyoutStyle.value),
|
|
574
844
|
tabindex: "-1",
|
|
575
845
|
onContextmenu: _cache[1] || (_cache[1] = withModifiers(() => {}, ["prevent"])),
|
|
576
|
-
onKeydown: onFlyoutKeyDown
|
|
846
|
+
onKeydown: onFlyoutKeyDown,
|
|
847
|
+
onPointerenter: _cache[2] || (_cache[2] = (...args) => unref(hover).onFlyoutPointerEnter && unref(hover).onFlyoutPointerEnter(...args)),
|
|
848
|
+
onPointerleave: _cache[3] || (_cache[3] = (...args) => unref(hover).onFlyoutPointerLeave && unref(hover).onFlyoutPointerLeave(...args))
|
|
577
849
|
}, [renderSlot(_ctx.$slots, "default", {}, () => [createVNode(_sfc_main$1, {
|
|
578
850
|
items: __props.items ?? [],
|
|
579
851
|
onSelect: onNestedSelect
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as DateInputSlots, n as DateInputEmits, r as DateInputProps, t as _default } from "../index-
|
|
1
|
+
import { i as DateInputSlots, n as DateInputEmits, r as DateInputProps, t as _default } from "../index-12ObcW99.js";
|
|
2
2
|
export { _default as DateInput, type DateInputEmits, type DateInputProps, type DateInputSlots };
|
package/dist/DateInput/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _sfc_main } from "../DateInput-
|
|
1
|
+
import { t as _sfc_main } from "../DateInput-BOIb0zAp.js";
|
|
2
2
|
export { _sfc_main as DateInput };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as _sfc_main$1 } from "./Calendar-
|
|
2
|
-
import { a as useAstryxMessages } from "./
|
|
1
|
+
import { t as _sfc_main$1 } from "./Calendar-BEyrkUtr.js";
|
|
2
|
+
import { a as useAstryxMessages } from "./context-BshXcNYX.js";
|
|
3
3
|
import { t as _sfc_main$2 } from "./Popover-Crhk9PNP.js";
|
|
4
4
|
import { computed, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, ref, renderSlot, useId, useTemplateRef, watch, withCtx } from "vue";
|
|
5
5
|
import "../styles/date-input.css";
|
|
@@ -11,10 +11,13 @@ const _hoisted_2 = {
|
|
|
11
11
|
};
|
|
12
12
|
const _hoisted_3 = ["disabled", "aria-label"];
|
|
13
13
|
const _hoisted_4 = [
|
|
14
|
+
"id",
|
|
14
15
|
"value",
|
|
15
16
|
"placeholder",
|
|
16
17
|
"disabled",
|
|
17
18
|
"aria-label",
|
|
19
|
+
"aria-describedby",
|
|
20
|
+
"aria-controls",
|
|
18
21
|
"aria-expanded",
|
|
19
22
|
"title"
|
|
20
23
|
];
|
|
@@ -23,11 +26,14 @@ const _hoisted_6 = {
|
|
|
23
26
|
key: 2,
|
|
24
27
|
class: "astryx-date-input-suffix"
|
|
25
28
|
};
|
|
26
|
-
const _hoisted_7 = ["
|
|
29
|
+
const _hoisted_7 = ["id"];
|
|
30
|
+
const _hoisted_8 = ["name", "value"];
|
|
27
31
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
28
32
|
name: "AstryxDateInput",
|
|
29
33
|
__name: "DateInput",
|
|
30
34
|
props: {
|
|
35
|
+
id: {},
|
|
36
|
+
describedBy: {},
|
|
31
37
|
modelValue: { default: null },
|
|
32
38
|
placeholder: {},
|
|
33
39
|
min: {},
|
|
@@ -52,8 +58,9 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
52
58
|
setup(__props, { emit: __emit }) {
|
|
53
59
|
const props = __props;
|
|
54
60
|
const emit = __emit;
|
|
55
|
-
const
|
|
56
|
-
const
|
|
61
|
+
const generatedId = `astryx-date-input-${useId()}`;
|
|
62
|
+
const inputId = computed(() => props.id ?? generatedId);
|
|
63
|
+
const popupId = computed(() => `${inputId.value}-popup`);
|
|
57
64
|
const messages = useAstryxMessages();
|
|
58
65
|
const resolvedPlaceholder = computed(() => props.placeholder ?? messages.value.dateInput.placeholder);
|
|
59
66
|
const resolvedClearLabel = computed(() => props.clearLabel ?? messages.value.dateInput.clear(props.label));
|
|
@@ -133,7 +140,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
133
140
|
label: dialogLabel.value,
|
|
134
141
|
onOpenChange
|
|
135
142
|
}, {
|
|
136
|
-
content: withCtx(() => [createElementVNode("div", { id: popupId }, [createVNode(_sfc_main$1, {
|
|
143
|
+
content: withCtx(() => [createElementVNode("div", { id: popupId.value }, [createVNode(_sfc_main$1, {
|
|
137
144
|
"model-value": props.modelValue,
|
|
138
145
|
min: props.min,
|
|
139
146
|
max: props.max,
|
|
@@ -144,7 +151,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
144
151
|
"min",
|
|
145
152
|
"max",
|
|
146
153
|
"is-date-disabled"
|
|
147
|
-
])])]),
|
|
154
|
+
])], 8, _hoisted_7)]),
|
|
148
155
|
default: withCtx(() => [createElementVNode("div", {
|
|
149
156
|
class: "astryx-date-input-wrapper",
|
|
150
157
|
"data-disabled": props.disabled ? "true" : void 0,
|
|
@@ -185,7 +192,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
185
192
|
})
|
|
186
193
|
], -1)])], 8, _hoisted_3),
|
|
187
194
|
createElementVNode("input", {
|
|
188
|
-
id: inputId,
|
|
195
|
+
id: inputId.value,
|
|
189
196
|
ref_key: "inputRef",
|
|
190
197
|
ref: inputRef,
|
|
191
198
|
type: "text",
|
|
@@ -195,7 +202,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
195
202
|
placeholder: resolvedPlaceholder.value,
|
|
196
203
|
disabled: props.disabled,
|
|
197
204
|
"aria-label": props.label,
|
|
198
|
-
"aria-
|
|
205
|
+
"aria-describedby": props.describedBy,
|
|
206
|
+
"aria-controls": popupId.value,
|
|
199
207
|
"aria-expanded": isOpen.value,
|
|
200
208
|
"aria-haspopup": "dialog",
|
|
201
209
|
title: props.disabledReason,
|
|
@@ -234,7 +242,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
234
242
|
type: "hidden",
|
|
235
243
|
name: props.name,
|
|
236
244
|
value: formatDate(props.modelValue)
|
|
237
|
-
}, null, 8,
|
|
245
|
+
}, null, 8, _hoisted_8)) : createCommentVNode("v-if", true)], 2);
|
|
238
246
|
};
|
|
239
247
|
}
|
|
240
248
|
});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Gn as DateRange, Jn as DateRangePreset, Kn as DateRangeInputEmits, Wn as _default, qn as DateRangeInputProps } from "../index-CQ9F1f_F.js";
|
|
2
|
+
export { type DateRange, _default as DateRangeInput, type DateRangeInputEmits, type DateRangeInputProps, type DateRangePreset };
|