@astryx-vue/core 0.32.1 → 0.33.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/dist/AppShell/index.js +1 -1
- package/dist/{AppShell-mWlY4pE3.js → AppShell-CPQDndnd.js} +4 -3
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/Banner/index.d.ts +1 -1
- package/dist/BottomSheet/index.d.ts +1 -1
- package/dist/Breadcrumbs/index.d.ts +2 -2
- package/dist/Breadcrumbs/index.js +2 -2
- package/dist/{Breadcrumbs-D05OmNfd.js → Breadcrumbs-BrxMrKHO.js} +1 -1
- package/dist/Button/index.d.ts +1 -1
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/Calendar/index.d.ts +1 -1
- package/dist/Carousel/index.d.ts +1 -1
- package/dist/Chat/index.d.ts +1 -1
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxList/index.d.ts +1 -1
- package/dist/CheckboxList/index.js +1 -1
- package/dist/{CheckboxListItem-DJrx97cA.js → CheckboxListItem-C75nzKE8.js} +2 -2
- package/dist/ClickableCard/index.d.ts +1 -1
- package/dist/Collapsible/index.js +1 -1
- package/dist/{Collapsible-Cf5zttC-.js → Collapsible-Cf9evVsQ.js} +2 -1
- package/dist/ContextMenu/index.d.ts +2 -2
- package/dist/ContextMenu/index.js +2 -2
- package/dist/{ContextMenu-CLCgJG0C.js → ContextMenu-Bp7G_Ys2.js} +1 -1
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/Dialog/index.d.ts +1 -1
- package/dist/Divider/index.d.ts +1 -1
- package/dist/Drawer/index.d.ts +1 -1
- package/dist/DropdownMenu/index.d.ts +2 -2
- package/dist/DropdownMenu/index.js +2 -2
- package/dist/{DropdownMenu-BWgt12MZ.js → DropdownMenu-DrJpONZH.js} +2 -2
- package/dist/{DropdownMenuRadioItem.vue-B4iwMWWD.d.ts → DropdownMenuRadioItem.vue-BDDI4EZK.d.ts} +1 -1
- package/dist/Heading/index.d.ts +1 -1
- package/dist/HoverCard/index.d.ts +1 -1
- package/dist/InfoTip/index.d.ts +1 -1
- package/dist/{Item-C9Cs0Jqr.js → Item-tVHjgQDe.js} +1 -0
- package/dist/Layout/index.js +2 -2
- package/dist/{Layout-tU7e1J1I.js → Layout-DJ6CQLw2.js} +1 -1
- package/dist/{LayoutPanel-D8t8F-sl.js → LayoutPanel-Bqh82ULc.js} +1 -1
- package/dist/Link/index.d.ts +1 -1
- package/dist/List/index.d.ts +2 -2
- package/dist/List/index.js +2 -2
- package/dist/ListItem-B60jTcXy.js +530 -0
- package/dist/MetadataList/index.d.ts +1 -1
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MoreMenu/index.js +1 -1
- package/dist/{MoreMenu-COSDjYyl.js → MoreMenu-DIx487BZ.js} +1 -1
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/NavItem/index.d.ts +1 -1
- package/dist/NumberInput/index.d.ts +1 -1
- package/dist/OverflowList/index.d.ts +1 -1
- package/dist/Overlay/index.d.ts +1 -1
- package/dist/Pagination/index.d.ts +1 -1
- package/dist/Popover/index.d.ts +1 -1
- package/dist/PowerSearch/index.d.ts +1 -1
- package/dist/PowerSearch/index.js +1 -1
- package/dist/{PowerSearch-CDwASKYp.js → PowerSearch-BV5n_nig.js} +2 -2
- package/dist/ProgressBar/index.d.ts +1 -1
- package/dist/Radio/index.d.ts +1 -1
- package/dist/RadioList/index.d.ts +1 -1
- package/dist/Resizable/index.js +1 -1
- package/dist/{ResizeHandle-CcS-NP4r.js → ResizeHandle-ezvpdXTS.js} +1 -1
- package/dist/ScrollableArea/index.d.ts +1 -1
- package/dist/SelectableCard/index.d.ts +1 -1
- package/dist/Selector/index.d.ts +1 -1
- package/dist/SideNav/index.d.ts +1 -1
- package/dist/SideNav/index.js +2 -2
- package/dist/{SideNav-DnoR_4ml.js → SideNav-FEpgj5dB.js} +4 -4
- package/dist/Stack/index.d.ts +1 -1
- package/dist/Stepper/index.d.ts +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/TabList/index.d.ts +1 -1
- package/dist/Table/index.d.ts +1 -1
- package/dist/Table/index.js +1 -1
- package/dist/{Table-CoWGEhzQ.js → Table-BOcDJ2a_.js} +2 -1
- 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/TimeInput/index.d.ts +1 -1
- package/dist/Timer/index.d.ts +1 -1
- package/dist/Timestamp/index.d.ts +1 -1
- package/dist/ToggleButton/index.d.ts +1 -1
- package/dist/Token/index.d.ts +1 -1
- package/dist/Toolbar/index.d.ts +1 -1
- package/dist/Tooltip/index.d.ts +1 -1
- package/dist/TopNav/index.d.ts +1 -1
- package/dist/TreeList/index.d.ts +1 -1
- package/dist/TreeList/index.js +1 -1
- package/dist/{TreeList-CqJ3xfhB.js → TreeList-BGHHEcg1.js} +3 -2
- package/dist/{accessibleName-CINO01Ek.js → accessibleName-Bjt5L8jX.js} +1 -1
- package/dist/composables/index.d.ts +2 -2
- package/dist/composables/index.js +2 -2
- package/dist/{context-C_rX8KGX.js → context-BcJmSPj1.js} +1 -1
- package/dist/{index-ZXrvTM3A.d.ts → index-0RIgvtdm.d.ts} +2 -2
- package/dist/{index-D7ShT2c-.d.ts → index-BB9acgK8.d.ts} +2 -2
- package/dist/{index-BuubzuE8.d.ts → index-BDZCJ9ri.d.ts} +2 -2
- package/dist/{index-DLE-sASO.d.ts → index-BU1HdDER.d.ts} +1 -1
- package/dist/{index-B-Z4GL8g.d.ts → index-BtPaMbkN.d.ts} +3 -3
- package/dist/{index-Rz4jwv4Q.d.ts → index-BvdhRgke.d.ts} +59 -59
- package/dist/{index-waTkqxTz.d.ts → index-C89cIh4E.d.ts} +1 -1
- package/dist/{index-CbA8rR_b.d.ts → index-CBOv5j3c.d.ts} +1 -1
- package/dist/{index-DoYrlaEI.d.ts → index-CG6dbyeb.d.ts} +3 -3
- package/dist/{index-C4S65SAW.d.ts → index-CKnr0JlT.d.ts} +1 -1
- package/dist/{index-DPklTi3o.d.ts → index-CO9GW-ik.d.ts} +1 -1
- package/dist/{index-CdvmnNMH.d.ts → index-COgrQZIL.d.ts} +1 -1
- package/dist/{index-CilCxEvD.d.ts → index-C_iTVOHQ.d.ts} +1 -1
- package/dist/{index-DIkdln91.d.ts → index-Casdfb9N.d.ts} +3 -3
- package/dist/{index-rdwI-mcm.d.ts → index-CtYlR9Cu.d.ts} +1 -1
- package/dist/{index-In41wHf3.d.ts → index-CuW4AQ7M.d.ts} +2 -2
- package/dist/{index-C8wfe0Mr.d.ts → index-D05JGsT3.d.ts} +1 -1
- package/dist/{index-B44fLswd.d.ts → index-DYabo8TI.d.ts} +2 -2
- package/dist/{index-o3JHyrk8.d.ts → index-DjSQLT53.d.ts} +1 -1
- package/dist/{index-Dk50Zh3F.d.ts → index-DofC9Rll.d.ts} +2 -2
- package/dist/{index-CUuUoX3h.d.ts → index-DsWEyz1N.d.ts} +3 -3
- package/dist/{index-C943VIzi.d.ts → index-DvCLTiDV.d.ts} +1 -1
- package/dist/{index-BA8exXNP.d.ts → index-X4S7_dmq.d.ts} +1 -1
- package/dist/{index-D8l_CmL-.d.ts → index-ZKBj_1nu.d.ts} +1 -1
- package/dist/{index-C3JmGujU.d.ts → index-mK1ICsVg.d.ts} +1 -1
- package/dist/{index-NOXYEdOI.d.ts → index-utZGF4GR.d.ts} +1 -1
- package/dist/index.d.ts +30 -30
- package/dist/index.js +20 -20
- package/dist/landing-Dx9vPF0t.js +51 -0
- package/dist/{landing-DrnLUanQ.js → reportChange-BkOEttEP.js} +1 -50
- package/dist/{resizableChannel-BeoqCSou.js → resizableChannel-DS0idC-X.js} +2 -1
- package/dist/{types-ClOMFbqC.d.ts → types-BHHT6Bho.d.ts} +17 -0
- package/dist/{useAnimatedLayout-B_mZd526.js → useAnimatedLayout-BC1mJaxA.js} +1 -1
- package/dist/{useResizable-BIaZZDJ2.js → useResizable-BL7wxH1p.js} +1 -1
- package/package.json +1 -1
- package/styles/list.css +45 -0
- package/styles/pressable.css +13 -0
- package/styles/tree-list.css +21 -0
- package/dist/ListItem-DOFfdRA_.js +0 -202
- package/dist/{index-D8lv2BiD.d.ts → index-BqhgeAT4.d.ts} +1 -1
|
@@ -1820,53 +1820,4 @@ function reportLayoutChange(handle, target) {
|
|
|
1820
1820
|
};
|
|
1821
1821
|
}
|
|
1822
1822
|
//#endregion
|
|
1823
|
-
|
|
1824
|
-
/**
|
|
1825
|
-
* A disclosure's indicator (its chevron) turns on the same motion as the
|
|
1826
|
-
* glide. Its CSS transition takes the theme's move curve and duration as the
|
|
1827
|
-
* glide reads them where the area is, and is immediate under Reduce Motion.
|
|
1828
|
-
* Without a handle the inline values are cleared, so the component's own
|
|
1829
|
-
* transition applies.
|
|
1830
|
-
*/
|
|
1831
|
-
function applyLayoutChangeTransition(handle, element) {
|
|
1832
|
-
if (element == null) return;
|
|
1833
|
-
const area = handle == null ? null : areaOf(handle, element);
|
|
1834
|
-
if (area == null) {
|
|
1835
|
-
transitionSettles.get(element)?.();
|
|
1836
|
-
element.style.removeProperty("transition-duration");
|
|
1837
|
-
element.style.removeProperty("transition-timing-function");
|
|
1838
|
-
return;
|
|
1839
|
-
}
|
|
1840
|
-
const motion = layoutMotion(area);
|
|
1841
|
-
if (motion.kind !== "glide") {
|
|
1842
|
-
transitionSettles.get(element)?.();
|
|
1843
|
-
element.style.setProperty("transition-duration", "0s");
|
|
1844
|
-
element.style.removeProperty("transition-timing-function");
|
|
1845
|
-
return;
|
|
1846
|
-
}
|
|
1847
|
-
const ms = Math.round(motion.progress.durationMs * 1e3) / 1e3;
|
|
1848
|
-
element.style.setProperty("transition-duration", `${ms}ms`);
|
|
1849
|
-
element.style.setProperty("transition-timing-function", motion.progress.easing);
|
|
1850
|
-
settleTransition(element, motion.progress);
|
|
1851
|
-
}
|
|
1852
|
-
/**
|
|
1853
|
-
* Lands `element`'s running glide at once: it takes its layout place, and a
|
|
1854
|
-
* later change starts from there (a change its caller lands rather than
|
|
1855
|
-
* animates, such as a rail that snaps).
|
|
1856
|
-
*/
|
|
1857
|
-
function landLayoutGlide(element) {
|
|
1858
|
-
const glide = glides.get(element);
|
|
1859
|
-
if (glide != null) {
|
|
1860
|
-
glides.delete(element);
|
|
1861
|
-
glide.animation.cancel();
|
|
1862
|
-
}
|
|
1863
|
-
}
|
|
1864
|
-
/**
|
|
1865
|
-
* The motion a change in `area` plays, for tests and for SideNav's rail
|
|
1866
|
-
* motion, which plays on the same clock (`component:SideNav` FR6).
|
|
1867
|
-
*/
|
|
1868
|
-
function layoutMotionFor(area) {
|
|
1869
|
-
return layoutMotion(area);
|
|
1870
|
-
}
|
|
1871
|
-
//#endregion
|
|
1872
|
-
export { glideOf as A, springGlide as C, intersects as D, safeAnimate as E, shownBoxAt as M, scaleOf as O, sampleOver as S, layoutStartFor as T, pxClip as _, rideNeighbour as a, layoutMotion as b, placeOf as c, areaOf as d, createAnimatedLayout as f, previousInFlow as g, isRtl as h, reportLayoutChange as i, glides as j, visibleRect as k, releaseLayoutExit as l, extentOf as m, landLayoutGlide as n, holdLayoutExit as o, readArea as p, layoutMotionFor as r, nextInFlow as s, applyLayoutChangeTransition as t, playLayoutChange as u, changeStartIn as v, beginChange as w, sampleKeyframes as x, glideNextChange as y };
|
|
1823
|
+
export { glides as A, safeAnimate as C, scaleOf as D, intersects as E, visibleRect as O, layoutStartFor as S, transitionSettles as T, layoutMotion as _, placeOf as a, springGlide as b, areaOf as c, extentOf as d, isRtl as f, glideNextChange as g, changeStartIn as h, nextInFlow as i, shownBoxAt as j, glideOf as k, createAnimatedLayout as l, pxClip as m, rideNeighbour as n, releaseLayoutExit as o, previousInFlow as p, holdLayoutExit as r, playLayoutChange as s, reportLayoutChange as t, readArea as u, sampleKeyframes as v, settleTransition as w, beginChange as x, sampleOver as y };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { a as sharedWeakMap } from "./sharedRealm-H1OrlP0V.js";
|
|
2
2
|
import { t as resolveMotion } from "./resolveMotion-BLdMNTpf.js";
|
|
3
3
|
import { n as springs } from "./springs-BR66JuIm.js";
|
|
4
|
-
import {
|
|
4
|
+
import { C as safeAnimate, D as scaleOf, E as intersects, O as visibleRect, _ as layoutMotion, a as placeOf, b as springGlide, c as areaOf, d as extentOf, f as isRtl, g as glideNextChange, h as changeStartIn, i as nextInFlow, k as glideOf, l as createAnimatedLayout, m as pxClip, n as rideNeighbour, p as previousInFlow, t as reportLayoutChange, x as beginChange, y as sampleOver } from "./reportChange-BkOEttEP.js";
|
|
5
|
+
import { n as landLayoutGlide } from "./landing-Dx9vPF0t.js";
|
|
5
6
|
//#region src/motion/layout/edgeReport.ts
|
|
6
7
|
const resizeReveals = sharedWeakMap("motion/animated-layout/resize-reveals", 1);
|
|
7
8
|
/** The inline properties a size hold sets, by axis. */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { r as AnimatedLayout } from "./useAnimatedLayout-C0koWm4a.js";
|
|
1
2
|
import { Component, MaybeRefOrGetter, VNodeChild } from "vue";
|
|
2
3
|
//#region src/List/types.d.ts
|
|
3
4
|
/** 滑动露出的一侧。`leading` 是往行内末尾拖,`trailing` 是往行内开头拖。 */
|
|
@@ -61,6 +62,16 @@ type ItemText = string | number;
|
|
|
61
62
|
/** Primary text of a row. */
|
|
62
63
|
type ItemLabel = ItemText;
|
|
63
64
|
interface ListProps {
|
|
65
|
+
/**
|
|
66
|
+
* The handle from `useAnimatedLayout({ containerRef })`. With it, the list
|
|
67
|
+
* animates its row changes on one shared motion, under every pointer. An
|
|
68
|
+
* inserted row enters, and a removed row collapses in place. A row that
|
|
69
|
+
* crosses rows moving the other way rides above them. The rows after a
|
|
70
|
+
* change, and the content after the list up to that container, glide to
|
|
71
|
+
* their new places. A row's identity is its `itemKey`, so a row without one
|
|
72
|
+
* changes at once. Without a handle the list changes at once.
|
|
73
|
+
*/
|
|
74
|
+
animatedLayout?: AnimatedLayout;
|
|
64
75
|
/**
|
|
65
76
|
* Spacing density for the rows. Each `ListItem` inherits it unless the item
|
|
66
77
|
* sets its own.
|
|
@@ -181,6 +192,12 @@ interface ListItemProps {
|
|
|
181
192
|
* @default false
|
|
182
193
|
*/
|
|
183
194
|
isSelected?: boolean;
|
|
195
|
+
/**
|
|
196
|
+
* The row's item key, a string or a number from the data. It is the row's
|
|
197
|
+
* identity for the list's `animatedLayout`, so a row without one changes at
|
|
198
|
+
* once. It is separate from Vue's `key`, which stays Vue's own.
|
|
199
|
+
*/
|
|
200
|
+
itemKey?: string | number;
|
|
184
201
|
/**
|
|
185
202
|
* 触摸横滑露出的操作。鼠标不会开始这次拖动。
|
|
186
203
|
* 每个操作还要在行自己的内容里能点到,否则键盘和鼠标够不着。
|
|
@@ -4,7 +4,7 @@ import { t as resolveMotion } from "./resolveMotion-BLdMNTpf.js";
|
|
|
4
4
|
import { n as springs } from "./springs-BR66JuIm.js";
|
|
5
5
|
import { t as isApplePlatform } from "./isApplePlatform-B1ju6F5B.js";
|
|
6
6
|
import { i as project, n as rubberBandInverse, r as rubberBandSlope, t as rubberBand } from "./rubberBand-DecgmtDj.js";
|
|
7
|
-
import { c as createRegionPaneSlot, f as registerPropsRegion, h as slideNextOnRelease, i as registerResizableChannel, l as edgeAxis, m as slideMotionsOf, o as resizeHandleBeside, p as shownSizeReader, s as createPaneReveal, u as isScriptMotion } from "./resizableChannel-
|
|
7
|
+
import { c as createRegionPaneSlot, f as registerPropsRegion, h as slideNextOnRelease, i as registerResizableChannel, l as edgeAxis, m as slideMotionsOf, o as resizeHandleBeside, p as shownSizeReader, s as createPaneReveal, u as isScriptMotion } from "./resizableChannel-DS0idC-X.js";
|
|
8
8
|
import { computed, onBeforeUnmount, onMounted, onScopeDispose, reactive, ref, toValue, watch } from "vue";
|
|
9
9
|
//#region src/composables/useHotkeys.ts
|
|
10
10
|
const KEY_ALIASES = {
|
package/package.json
CHANGED
package/styles/list.css
CHANGED
|
@@ -82,6 +82,19 @@
|
|
|
82
82
|
border-block-end-width: 0;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
/*
|
|
86
|
+
* `animatedLayout` 下从反向移动的行上方滑过的行:滑动期间抬到上面,背后垫一层表面色,
|
|
87
|
+
* 像 UIKit 不透明的 cell 从邻居上方经过。表面是铺满内边距盒的内阴影,在按压层和内容下面,
|
|
88
|
+
* 分隔线和按压都还看得见。选中的行保留自己的底色。z-index 2 高过粗指针下热区的 1。
|
|
89
|
+
*/
|
|
90
|
+
.astryx-list > .astryx-list-item[data-astryx-travelling] {
|
|
91
|
+
z-index: 2;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.astryx-list > .astryx-list-item[data-astryx-travelling]:not([data-selected='true']) {
|
|
95
|
+
box-shadow: inset 0 0 0 100vmax var(--astryx-color-background-surface, light-dark(#fff, #262626));
|
|
96
|
+
}
|
|
97
|
+
|
|
85
98
|
/*
|
|
86
99
|
* Row edge treatment. `outset` and `bleed` rows reach into the padding of
|
|
87
100
|
* the container around the list. The list reaches that padding's edge
|
|
@@ -299,6 +312,38 @@
|
|
|
299
312
|
background-image: var(--_press-paint-image);
|
|
300
313
|
}
|
|
301
314
|
|
|
315
|
+
/*
|
|
316
|
+
* 手指按下时,按压色画在行自己的 `::before` 上(底色之上、内容之下),
|
|
317
|
+
* 抬手淡出的是这一层的 opacity,浏览器在合成线程上播。颜色、时长和曲线和按压强度一样。
|
|
318
|
+
* 这一层只在按压期间存在,平时行的 `::before` 原样不动;鼠标不受影响。
|
|
319
|
+
*/
|
|
320
|
+
@media (pointer: coarse) {
|
|
321
|
+
.astryx-item[data-astryx-press]:not([data-disabled='true']) {
|
|
322
|
+
isolation: isolate;
|
|
323
|
+
background-image: none;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.astryx-item[data-astryx-press]:not([data-disabled='true'])::before {
|
|
327
|
+
content: '';
|
|
328
|
+
position: absolute;
|
|
329
|
+
inset: 0;
|
|
330
|
+
z-index: -1;
|
|
331
|
+
border-radius: inherit;
|
|
332
|
+
background-color: var(--astryx-list-item-pressed-background, light-dark(#05365919, #ffffff19));
|
|
333
|
+
pointer-events: none;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.astryx-item[data-astryx-press='fading']:not([data-disabled='true'])::before {
|
|
337
|
+
animation: astryx-press-layer-release var(--astryx-duration-exit, 175ms) var(--astryx-ease-exit, cubic-bezier(0.3, 0, 0.6, 0.6)) both;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
@media (prefers-reduced-motion: reduce) {
|
|
341
|
+
.astryx-item[data-astryx-press='fading']:not([data-disabled='true'])::before {
|
|
342
|
+
animation-duration: min(var(--astryx-duration-exit, 175ms), 200ms);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
302
347
|
/*
|
|
303
348
|
* 选中行保留自己的底色,悬停和按下的色调作为图片层叠在上面。
|
|
304
349
|
* 高亮行的底色本来就是悬停色,只表现按下。
|
package/styles/pressable.css
CHANGED
|
@@ -36,6 +36,19 @@
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
/*
|
|
40
|
+
* 列表行的触屏按压层抬手淡出:只动这一层的 opacity,浏览器放在合成线程上播,
|
|
41
|
+
* 页面脚本再忙,淡出也照常走完,不重绘。时长和曲线和上面的强度淡出一样。
|
|
42
|
+
*/
|
|
43
|
+
@keyframes astryx-press-layer-release {
|
|
44
|
+
from {
|
|
45
|
+
opacity: 1;
|
|
46
|
+
}
|
|
47
|
+
to {
|
|
48
|
+
opacity: 0;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
39
52
|
@layer astryx.components {
|
|
40
53
|
[data-astryx-pressable] {
|
|
41
54
|
--_press-paint: color-mix(
|
package/styles/tree-list.css
CHANGED
|
@@ -87,6 +87,27 @@
|
|
|
87
87
|
cursor: pointer;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
+
/*
|
|
91
|
+
* 手指按下时,按压画在行的按压层(`.astryx-pressable::after`)上,抬手淡出的是这一层的 opacity,
|
|
92
|
+
* 浏览器在合成线程上播。颜色、时长和曲线和按压强度一样;鼠标不受影响。
|
|
93
|
+
*/
|
|
94
|
+
@media (pointer: coarse) {
|
|
95
|
+
.astryx-tree-list__content.astryx-pressable:not([data-disabled='true'])[data-astryx-press]::after {
|
|
96
|
+
background-color: var(--astryx-color-overlay-pressed, light-dark(#05365919, #ffffff19));
|
|
97
|
+
background-image: none;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.astryx-tree-list__content.astryx-pressable:not([data-disabled='true'])[data-astryx-press='fading']::after {
|
|
101
|
+
animation: astryx-press-layer-release var(--astryx-duration-exit, 175ms) var(--astryx-ease-exit, cubic-bezier(0.3, 0, 0.6, 0.6)) both;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@media (prefers-reduced-motion: reduce) {
|
|
105
|
+
.astryx-tree-list__content.astryx-pressable:not([data-disabled='true'])[data-astryx-press='fading']::after {
|
|
106
|
+
animation-duration: min(var(--astryx-duration-exit, 175ms), 200ms);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
90
111
|
@media (hover: hover) {
|
|
91
112
|
.astryx-tree-list__content[data-interactive='true']:not([data-disabled='true']):hover::before {
|
|
92
113
|
background-color: var(--astryx-color-overlay-hover, light-dark(#0000000d, #ffffff0d));
|
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
import { n as useTouchHitArea } from "./useTouchHitArea-Dsz80HzY.js";
|
|
2
|
-
import { n as useDevWarning } from "./useDevWarning-B2fsk2B-.js";
|
|
3
|
-
import { a as useListContext, n as itemListRowKey, r as listContextKey, t as _sfc_main$2 } from "./Item-C9Cs0Jqr.js";
|
|
4
|
-
import { computed, createBlock, createElementBlock, createElementVNode, createSlots, createTextVNode, defineComponent, mergeProps, normalizeClass, openBlock, provide, renderSlot, resolveDynamicComponent, toDisplayString, unref, useAttrs, useId, useSlots, useTemplateRef, withCtx } from "vue";
|
|
5
|
-
import "../styles/list.css";
|
|
6
|
-
//#region src/List/List.vue
|
|
7
|
-
const _hoisted_1$1 = {
|
|
8
|
-
key: 0,
|
|
9
|
-
class: "astryx-list-root"
|
|
10
|
-
};
|
|
11
|
-
const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
12
|
-
name: "AstryxList",
|
|
13
|
-
inheritAttrs: false,
|
|
14
|
-
__name: "List",
|
|
15
|
-
props: {
|
|
16
|
-
density: { default: "balanced" },
|
|
17
|
-
hasDividers: {
|
|
18
|
-
type: Boolean,
|
|
19
|
-
default: false
|
|
20
|
-
},
|
|
21
|
-
edge: {},
|
|
22
|
-
edgeCompensation: {},
|
|
23
|
-
listStyle: { default: "none" },
|
|
24
|
-
start: { default: 1 },
|
|
25
|
-
header: {}
|
|
26
|
-
},
|
|
27
|
-
setup(__props, { expose: __expose }) {
|
|
28
|
-
const props = __props;
|
|
29
|
-
const CONTROLLED_ATTRS = /* @__PURE__ */ new Set([
|
|
30
|
-
"class",
|
|
31
|
-
"style",
|
|
32
|
-
"role",
|
|
33
|
-
"start"
|
|
34
|
-
]);
|
|
35
|
-
const attrs = useAttrs();
|
|
36
|
-
const slots = useSlots();
|
|
37
|
-
const listElement = useTemplateRef("list");
|
|
38
|
-
const headerId = `astryx-list-header-${useId()}`;
|
|
39
|
-
const hasHeader = computed(() => slots.header != null || props.header != null);
|
|
40
|
-
const tag = computed(() => props.listStyle === "decimal" ? "ol" : "ul");
|
|
41
|
-
const hasStartAttribute = computed(() => props.listStyle === "decimal" && props.start !== 1);
|
|
42
|
-
const counterStart = computed(() => hasStartAttribute.value ? `astryx-list ${props.start - 1}` : void 0);
|
|
43
|
-
/** The deprecated prop is an alias of `outset`; an explicit `edge` wins over it. */
|
|
44
|
-
const edge = computed(() => props.edge ?? (props.edgeCompensation === "inline" ? "outset" : "padded"));
|
|
45
|
-
useDevWarning("List", "`edge` and the deprecated `edgeCompensation` are both set; `edge` wins. Remove `edgeCompensation`.", () => props.edge != null && props.edgeCompensation != null);
|
|
46
|
-
provide(listContextKey, {
|
|
47
|
-
density: computed(() => props.density),
|
|
48
|
-
edge,
|
|
49
|
-
edgeCompensation: computed(() => props.edgeCompensation),
|
|
50
|
-
hasDividers: computed(() => props.hasDividers),
|
|
51
|
-
listStyle: computed(() => props.listStyle)
|
|
52
|
-
});
|
|
53
|
-
const listStyleValue = computed(() => [attrs.style, counterStart.value == null ? void 0 : { counterReset: counterStart.value }]);
|
|
54
|
-
const listAttrs = computed(() => {
|
|
55
|
-
return {
|
|
56
|
-
...Object.fromEntries(Object.entries(attrs).filter(([key]) => !CONTROLLED_ATTRS.has(key))),
|
|
57
|
-
"role": "list",
|
|
58
|
-
"start": hasStartAttribute.value ? props.start : void 0,
|
|
59
|
-
"data-density": props.density,
|
|
60
|
-
"data-dividers": props.hasDividers || void 0,
|
|
61
|
-
"data-edge": edge.value,
|
|
62
|
-
"data-edge-compensation": props.edgeCompensation,
|
|
63
|
-
"data-list-style": props.listStyle,
|
|
64
|
-
...hasHeader.value ? { "aria-labelledby": headerId } : void 0
|
|
65
|
-
};
|
|
66
|
-
});
|
|
67
|
-
__expose({ element: computed(() => listElement.value) });
|
|
68
|
-
return (_ctx, _cache) => {
|
|
69
|
-
return hasHeader.value ? (openBlock(), createElementBlock("div", _hoisted_1$1, [createElementVNode("div", {
|
|
70
|
-
id: headerId,
|
|
71
|
-
class: "astryx-list-header"
|
|
72
|
-
}, [renderSlot(_ctx.$slots, "header", {}, () => [createTextVNode(toDisplayString(__props.header), 1)])]), (openBlock(), createBlock(resolveDynamicComponent(tag.value), mergeProps({ ref: "list" }, listAttrs.value, {
|
|
73
|
-
class: ["astryx-list", unref(attrs).class],
|
|
74
|
-
style: listStyleValue.value
|
|
75
|
-
}), {
|
|
76
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
77
|
-
_: 3
|
|
78
|
-
}, 16, ["class", "style"]))])) : (openBlock(), createBlock(resolveDynamicComponent(tag.value), mergeProps({
|
|
79
|
-
key: 1,
|
|
80
|
-
ref: "list"
|
|
81
|
-
}, listAttrs.value, {
|
|
82
|
-
class: ["astryx-list", unref(attrs).class],
|
|
83
|
-
style: listStyleValue.value
|
|
84
|
-
}), {
|
|
85
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
86
|
-
_: 3
|
|
87
|
-
}, 16, ["class", "style"]));
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
//#endregion
|
|
92
|
-
//#region src/List/ListItem.vue
|
|
93
|
-
const _hoisted_1 = {
|
|
94
|
-
key: 0,
|
|
95
|
-
class: "astryx-list-marker"
|
|
96
|
-
};
|
|
97
|
-
const _hoisted_2 = ["data-shape"];
|
|
98
|
-
const _hoisted_3 = ["data-style"];
|
|
99
|
-
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
100
|
-
name: "AstryxListItem",
|
|
101
|
-
__name: "ListItem",
|
|
102
|
-
props: {
|
|
103
|
-
align: {},
|
|
104
|
-
label: {},
|
|
105
|
-
description: {},
|
|
106
|
-
density: {},
|
|
107
|
-
onClick: { type: Function },
|
|
108
|
-
interactiveRef: {},
|
|
109
|
-
href: {},
|
|
110
|
-
target: {},
|
|
111
|
-
rel: {},
|
|
112
|
-
isDisabled: { type: Boolean },
|
|
113
|
-
isSelected: { type: Boolean },
|
|
114
|
-
swipeActions: {},
|
|
115
|
-
swipeBehavior: {}
|
|
116
|
-
},
|
|
117
|
-
setup(__props) {
|
|
118
|
-
const props = __props;
|
|
119
|
-
const list = useListContext();
|
|
120
|
-
const item = useTemplateRef("item");
|
|
121
|
-
const isTouchTarget = computed(() => (props.onClick != null || props.href != null || props.interactiveRef != null) && props.isDisabled !== true);
|
|
122
|
-
useTouchHitArea(() => item.value?.element, isTouchTarget);
|
|
123
|
-
const density = computed(() => props.density ?? list?.density.value ?? "balanced");
|
|
124
|
-
const marker = computed(() => {
|
|
125
|
-
const listStyle = list?.listStyle.value ?? "none";
|
|
126
|
-
return listStyle === "none" ? null : listStyle;
|
|
127
|
-
});
|
|
128
|
-
provide(itemListRowKey, { isNumbered: computed(() => marker.value === "decimal") });
|
|
129
|
-
const isBullet = computed(() => marker.value === "disc" || marker.value === "circle");
|
|
130
|
-
return (_ctx, _cache) => {
|
|
131
|
-
return openBlock(), createBlock(_sfc_main$2, {
|
|
132
|
-
ref_key: "item",
|
|
133
|
-
ref: item,
|
|
134
|
-
as: "li",
|
|
135
|
-
class: normalizeClass(["astryx-list-item", { "astryx-touch-hit-area-band": isTouchTarget.value }]),
|
|
136
|
-
align: __props.align,
|
|
137
|
-
description: __props.description,
|
|
138
|
-
density: density.value,
|
|
139
|
-
href: __props.href,
|
|
140
|
-
"interactive-ref": __props.interactiveRef,
|
|
141
|
-
"is-disabled": __props.isDisabled,
|
|
142
|
-
"is-selected": __props.isSelected,
|
|
143
|
-
label: __props.label,
|
|
144
|
-
"on-click": __props.onClick,
|
|
145
|
-
"swipe-actions": __props.swipeActions,
|
|
146
|
-
"swipe-behavior": __props.swipeBehavior,
|
|
147
|
-
rel: __props.rel,
|
|
148
|
-
target: __props.target
|
|
149
|
-
}, createSlots({ _: 2 }, [
|
|
150
|
-
marker.value ? {
|
|
151
|
-
name: "marker",
|
|
152
|
-
fn: withCtx(() => [isBullet.value ? (openBlock(), createElementBlock("span", _hoisted_1, [createElementVNode("span", {
|
|
153
|
-
class: "astryx-list-marker__glyph",
|
|
154
|
-
"data-shape": marker.value
|
|
155
|
-
}, null, 8, _hoisted_2)])) : (openBlock(), createElementBlock("span", {
|
|
156
|
-
key: 1,
|
|
157
|
-
class: "astryx-list-marker__number",
|
|
158
|
-
"data-style": marker.value
|
|
159
|
-
}, null, 8, _hoisted_3))]),
|
|
160
|
-
key: "0"
|
|
161
|
-
} : void 0,
|
|
162
|
-
_ctx.$slots.startContent ? {
|
|
163
|
-
name: "startContent",
|
|
164
|
-
fn: withCtx(() => [renderSlot(_ctx.$slots, "startContent")]),
|
|
165
|
-
key: "1"
|
|
166
|
-
} : void 0,
|
|
167
|
-
_ctx.$slots.label ? {
|
|
168
|
-
name: "label",
|
|
169
|
-
fn: withCtx(() => [renderSlot(_ctx.$slots, "label")]),
|
|
170
|
-
key: "2"
|
|
171
|
-
} : void 0,
|
|
172
|
-
_ctx.$slots.description ? {
|
|
173
|
-
name: "description",
|
|
174
|
-
fn: withCtx(() => [renderSlot(_ctx.$slots, "description")]),
|
|
175
|
-
key: "3"
|
|
176
|
-
} : void 0,
|
|
177
|
-
_ctx.$slots.endContent ? {
|
|
178
|
-
name: "endContent",
|
|
179
|
-
fn: withCtx(() => [renderSlot(_ctx.$slots, "endContent")]),
|
|
180
|
-
key: "4"
|
|
181
|
-
} : void 0
|
|
182
|
-
]), 1032, [
|
|
183
|
-
"class",
|
|
184
|
-
"align",
|
|
185
|
-
"description",
|
|
186
|
-
"density",
|
|
187
|
-
"href",
|
|
188
|
-
"interactive-ref",
|
|
189
|
-
"is-disabled",
|
|
190
|
-
"is-selected",
|
|
191
|
-
"label",
|
|
192
|
-
"on-click",
|
|
193
|
-
"swipe-actions",
|
|
194
|
-
"swipe-behavior",
|
|
195
|
-
"rel",
|
|
196
|
-
"target"
|
|
197
|
-
]);
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
});
|
|
201
|
-
//#endregion
|
|
202
|
-
export { _sfc_main$1 as n, _sfc_main as t };
|
|
@@ -43,9 +43,9 @@ declare const __VLS_base: import("vue").DefineComponent<TokenProps, {}, {}, {},
|
|
|
43
43
|
onRemove?: ((event: Event) => any) | undefined;
|
|
44
44
|
}>, {
|
|
45
45
|
size: TokenSize;
|
|
46
|
-
color: "default" | "blue" | "cyan" | "gray" | "green" | "orange" | "pink" | "purple" | "red" | "teal" | "yellow";
|
|
47
46
|
labelHidden: boolean;
|
|
48
47
|
disabled: boolean;
|
|
48
|
+
color: "default" | "blue" | "cyan" | "gray" | "green" | "orange" | "pink" | "purple" | "red" | "teal" | "yellow";
|
|
49
49
|
removable: boolean;
|
|
50
50
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
51
51
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|