@astryx-vue/core 0.17.0 → 0.19.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/AvatarGroup/index.d.ts +1 -1
- package/dist/Banner/index.d.ts +1 -1
- package/dist/BottomSheet/index.d.ts +1 -1
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/Calendar/index.d.ts +1 -1
- package/dist/Calendar/index.js +1 -1
- package/dist/{Calendar-Bk2nGoT-.js → Calendar-DSRNuw3y.js} +37 -13
- package/dist/Carousel/index.d.ts +1 -1
- package/dist/Center/index.d.ts +1 -1
- package/dist/Chat/index.js +1 -1
- package/dist/{Chat-Wq7e98zS.js → Chat-CXwXzlZ0.js} +1 -1
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxList/index.d.ts +1 -1
- package/dist/ClickableCard/index.d.ts +1 -1
- package/dist/Collapsible/index.d.ts +1 -1
- package/dist/Collapsible/index.js +1 -1
- package/dist/{Collapsible-Dk9BQQbT.js → Collapsible-ExzU7vC0.js} +104 -40
- package/dist/ContextMenu/index.d.ts +1 -1
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.js +1 -1
- package/dist/{DateInput-BitZfGEY.js → DateInput-s2H0orUW.js} +3 -3
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateRangeInput/index.js +1 -1
- package/dist/{DateRangeInput-kxXBsUTU.js → DateRangeInput-Dn9I2PMM.js} +7 -7
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.js +1 -1
- package/dist/{DateTimeInput-Cfkuec_h.js → DateTimeInput-BR_tdURg.js} +47 -17
- package/dist/Dialog/index.d.ts +1 -1
- package/dist/Drawer/index.d.ts +1 -1
- package/dist/FileInput/index.d.ts +1 -1
- package/dist/HoverCard/index.d.ts +1 -1
- package/dist/HoverCard/index.js +1 -1
- package/dist/{HoverCard-DVPLeccv.js → HoverCard-FHYH3VXg.js} +50 -2
- package/dist/InfoTip/index.d.ts +1 -1
- package/dist/InternationalizationProvider/index.d.ts +1 -1
- package/dist/InternationalizationProvider/index.js +1 -1
- package/dist/{InternationalizationProvider-Dr5GE6f0.js → InternationalizationProvider-Ddo_-tLK.js} +1 -1
- package/dist/Link/index.d.ts +1 -1
- package/dist/{MediaTheme-Bkj-_DFN.js → MediaTheme-DfcdEWx-.js} +2 -36
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/NumberInput/index.d.ts +1 -1
- package/dist/NumberInput/index.js +1 -1
- package/dist/{NumberInput-BPeesTRv.js → NumberInput-BsWTXomE.js} +2 -23
- package/dist/OverflowList/index.d.ts +1 -1
- package/dist/PowerSearch/index.d.ts +1 -1
- package/dist/PowerSearch/index.js +1 -1
- package/dist/{PowerSearch-BAOqpQag.js → PowerSearch-CDEn08Pe.js} +6 -6
- package/dist/Radio/index.d.ts +1 -1
- package/dist/RadioList/index.d.ts +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/Switch/index.d.ts +1 -1
- package/dist/Table/index.d.ts +1 -1
- package/dist/Table/index.js +1 -1
- package/dist/{Table-CRKljXg4.js → Table-WukSceMV.js} +376 -5
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/Theme/index.js +3 -2
- package/dist/{Theme-iqi6AvU_.js → Theme-1RJVaRgz.js} +3 -38
- package/dist/{TimeField-CBWgdA1Y.js → TimeField-BM-rVFhC.js} +419 -140
- package/dist/TimeInput/index.d.ts +2 -2
- package/dist/TimeInput/index.js +1 -1
- package/dist/{TimeInput-8ASOMV3B.js → TimeInput-CkZfhhAr.js} +28 -8
- package/dist/Timer/index.d.ts +1 -1
- package/dist/Timer/index.js +1 -1
- package/dist/{Timer-C8evnsTE.js → Timer-DiIs5GLA.js} +24 -15
- package/dist/Timestamp/index.d.ts +1 -1
- package/dist/Timestamp/index.js +1 -1
- package/dist/{Timestamp-CgvZe6vH.js → Timestamp-D9Jyk9sD.js} +152 -96
- package/dist/Toast/index.js +1 -1
- package/dist/{Toast-CzbqvHDN.js → Toast-D4Q6wvYu.js} +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-CNj4KnHH.js → TreeList-ugSF9DWj.js} +117 -2
- package/dist/composables/index.d.ts +3 -2
- package/dist/composables/index.js +3 -3
- package/dist/{composables-BKHcPgN0.js → composables-BgfubKnk.js} +39 -332
- package/dist/{format-CMHyAMn3.js → format-mffyPc-L.js} +34 -4
- package/dist/handle-BPXdHbkr.js +458 -0
- package/dist/{index-9eluGe3a.d.ts → index-BA8exXNP.d.ts} +2 -1
- package/dist/{index-tuNsmJxw.d.ts → index-BLnvQ4Oj.d.ts} +9 -2
- package/dist/{index-B0iRA00v.d.ts → index-BapQGST1.d.ts} +2 -2
- package/dist/{index-D31bgBoy.d.ts → index-BdZCLUgY.d.ts} +1 -1
- package/dist/{index-DK0Wdo9N.d.ts → index-C9OzEvE_.d.ts} +3 -3
- package/dist/{index-CbA8rR_b.d.ts → index-CBOv5j3c.d.ts} +1 -1
- package/dist/{index-CMLnSg3T.d.ts → index-CKnr0JlT.d.ts} +7 -0
- package/dist/{index-C1qJlC65.d.ts → index-CQ-sq76o.d.ts} +1 -1
- package/dist/{index-85RFPeV0.d.ts → index-CULdl3Dg.d.ts} +3 -3
- package/dist/{index-BxWCX2pJ.d.ts → index-DFLPv9io.d.ts} +3 -3
- package/dist/{index-DofC9Rll.d.ts → index-Otl047R1.d.ts} +1 -1
- package/dist/{index-BKnyTWPM.d.ts → index-ZbNwGVkS.d.ts} +1 -1
- package/dist/{index-DYabo8TI.d.ts → index-eCp-ElSp.d.ts} +1 -1
- package/dist/{index-B95VIgRl.d.ts → index-t27MvEzT.d.ts} +70 -23
- package/dist/{index-wY6dKz6c.d.ts → index-yQc-te9a.d.ts} +7 -0
- package/dist/index.d.ts +19 -18
- package/dist/index.js +25 -24
- package/dist/landing-Bs0aMIsR.js +2049 -0
- package/dist/{loadCatalog-BJwcyX8i.d.ts → loadCatalog-C4h9SmJs.d.ts} +2 -0
- package/dist/{loadCatalog-C1kms5sO.js → loadCatalog-DsEKSY3U.js} +5 -1
- package/dist/locale/index.d.ts +2 -2
- package/dist/locale/index.js +4 -4
- package/dist/{locale-CHhsd9Mq.js → locale-C-Y-13BP.js} +1 -1
- package/dist/motionTokenDefaults-EFzpiAF5.js +38 -0
- package/dist/timeFormat-CqrwFE42.js +203 -0
- package/dist/{timestamp-BMYQsFDj.js → timestamp-saJUedIU.js} +4 -2
- package/dist/tokenName-0U-WEH09.js +36 -0
- package/dist/unicodeDigits-_BYIJcAu.js +46 -0
- package/dist/useAnimatedLayout-C0koWm4a.d.ts +56 -0
- package/dist/{useTimeValue-_XW9g2V1.js → useTimeValue-CcKrnO8z.js} +13 -6
- package/package.json +1 -1
- package/styles/calendar.css +5 -1
- package/styles/table.css +19 -0
- package/styles/timestamp.css +22 -10
- package/dist/{index-D8lv2BiD.d.ts → index-J6YRJ7Ul.d.ts} +1 -1
|
@@ -4,6 +4,7 @@ import { n as useLayerTeleportTarget } from "./useLayerMountTarget-BmZyeKWE.js";
|
|
|
4
4
|
import { t as _sfc_main$19 } from "./VisuallyHidden-cpmsV-0M.js";
|
|
5
5
|
import { n as firstCharacter } from "./characters-wTnzjkkR.js";
|
|
6
6
|
import { t as devWarn } from "./useDevWarning-B2fsk2B-.js";
|
|
7
|
+
import { a as playLayoutChange, n as reportLayoutChange, o as glideOf, t as applyLayoutChangeTransition } from "./landing-Bs0aMIsR.js";
|
|
7
8
|
import { n as isFocusDetached } from "./focusReturn-D7Y7Pwwb.js";
|
|
8
9
|
import { o as useComponentMessages } from "./context-B8IEFCDR.js";
|
|
9
10
|
import { t as useScrollableArea } from "./useScrollableArea-BaHkGWbX.js";
|
|
@@ -13,11 +14,11 @@ import { t as useScrollbars } from "./useScrollbars-Ch0xqJWO.js";
|
|
|
13
14
|
import { t as _sfc_main$21 } from "./CheckboxInput-3ONBl1AY.js";
|
|
14
15
|
import { t as _sfc_main$22 } from "./ComponentIcon-BRXBBKeG.js";
|
|
15
16
|
import { t as _sfc_main$23 } from "./Popover-CmAEizH-.js";
|
|
16
|
-
import { t as _sfc_main$24 } from "./DateInput-
|
|
17
|
-
import { s as tableMessages } from "./loadCatalog-
|
|
18
|
-
import { r as useCollator } from "./locale-
|
|
17
|
+
import { t as _sfc_main$24 } from "./DateInput-s2H0orUW.js";
|
|
18
|
+
import { s as tableMessages } from "./loadCatalog-DsEKSY3U.js";
|
|
19
|
+
import { r as useCollator } from "./locale-C-Y-13BP.js";
|
|
19
20
|
import { t as _sfc_main$25 } from "./MultiSelector-BK6nZweN.js";
|
|
20
|
-
import { t as _sfc_main$26 } from "./NumberInput-
|
|
21
|
+
import { t as _sfc_main$26 } from "./NumberInput-BsWTXomE.js";
|
|
21
22
|
import { t as _sfc_main$27 } from "./Pagination-DFQNX_Mb.js";
|
|
22
23
|
import { t as _sfc_main$28 } from "./Selector-Bo7qkt1P.js";
|
|
23
24
|
import { t as _sfc_main$29 } from "./TextInput-_SIiqVOY.js";
|
|
@@ -911,12 +912,379 @@ const _sfc_main$14 = /*@__PURE__*/ defineComponent({
|
|
|
911
912
|
}
|
|
912
913
|
});
|
|
913
914
|
//#endregion
|
|
915
|
+
//#region src/Table/rowDivider.ts
|
|
916
|
+
/**
|
|
917
|
+
* @file rowDivider.ts
|
|
918
|
+
* @position Table 内部:在表格自己画的位置之外画分隔线时(例如行滑动时跟着行走的替身线),
|
|
919
|
+
* 先在这里按合并边框的规则算出表格本来会在格子下面画哪条边,主题和应用设的边框就能照搬。
|
|
920
|
+
*/
|
|
921
|
+
/** 合并边框里各种线型的优先级,从弱到强(CSS 2.1)。 */
|
|
922
|
+
const STYLE_RANK = [
|
|
923
|
+
"inset",
|
|
924
|
+
"groove",
|
|
925
|
+
"outset",
|
|
926
|
+
"ridge",
|
|
927
|
+
"dotted",
|
|
928
|
+
"dashed",
|
|
929
|
+
"solid",
|
|
930
|
+
"double"
|
|
931
|
+
];
|
|
932
|
+
function edgeOf(element, side) {
|
|
933
|
+
if (element == null) return {
|
|
934
|
+
width: 0,
|
|
935
|
+
style: "none",
|
|
936
|
+
color: ""
|
|
937
|
+
};
|
|
938
|
+
const style = getComputedStyle(element);
|
|
939
|
+
return {
|
|
940
|
+
width: Number.parseFloat(style.getPropertyValue(`border-${side}-width`)) || 0,
|
|
941
|
+
style: style.getPropertyValue(`border-${side}-style`),
|
|
942
|
+
color: style.getPropertyValue(`border-${side}-color`)
|
|
943
|
+
};
|
|
944
|
+
}
|
|
945
|
+
/** `row` 下面的一行,跨过分组边界(thead 到 tbody)也算。 */
|
|
946
|
+
function rowBelow(row) {
|
|
947
|
+
if (row == null) return null;
|
|
948
|
+
return row.nextElementSibling ?? row.parentElement?.nextElementSibling?.firstElementChild ?? null;
|
|
949
|
+
}
|
|
950
|
+
/**
|
|
951
|
+
* 表格在一个格子下面画的那条边,按合并边框的规则(CSS 2.1 17.6.2.1):在格子自己的下边、
|
|
952
|
+
* 下面格子的上边、所在行的下边、下一行的上边,以及分组边界上两个行组的边里,`hidden` 最优先,
|
|
953
|
+
* 然后宽的胜,再然后线型强的胜;打平时格子胜过行、行胜过行组,上面的胜过下面的。
|
|
954
|
+
* `isOwn` 表示格子自己的边胜出;`isRow` 表示行或行组的边胜出,表格会沿整行画它。
|
|
955
|
+
*/
|
|
956
|
+
function collapsedBottom(cell) {
|
|
957
|
+
const row = cell.parentElement;
|
|
958
|
+
const nextRow = rowBelow(row);
|
|
959
|
+
const nextCell = nextRow?.children[cell.cellIndex] ?? null;
|
|
960
|
+
const isSectionEdge = row != null && row.nextElementSibling == null;
|
|
961
|
+
const candidates = [
|
|
962
|
+
edgeOf(cell, "bottom"),
|
|
963
|
+
edgeOf(nextCell, "top"),
|
|
964
|
+
edgeOf(row, "bottom"),
|
|
965
|
+
edgeOf(nextRow, "top"),
|
|
966
|
+
edgeOf(isSectionEdge ? row?.parentElement ?? null : null, "bottom"),
|
|
967
|
+
edgeOf(isSectionEdge ? nextRow?.parentElement ?? null : null, "top")
|
|
968
|
+
];
|
|
969
|
+
const own = candidates[0];
|
|
970
|
+
if (candidates.some((edge) => edge.style === "hidden")) return {
|
|
971
|
+
width: 0,
|
|
972
|
+
style: "none",
|
|
973
|
+
color: own.color,
|
|
974
|
+
isOwn: own.style === "hidden",
|
|
975
|
+
isRow: false
|
|
976
|
+
};
|
|
977
|
+
const strength = (edge) => edge.style === "none" || edge.width === 0 ? [-1, -1] : [edge.width, STYLE_RANK.indexOf(edge.style)];
|
|
978
|
+
let winner = own;
|
|
979
|
+
for (const edge of candidates.slice(1)) {
|
|
980
|
+
const [width, rank] = strength(edge);
|
|
981
|
+
const [bestWidth, bestRank] = strength(winner);
|
|
982
|
+
if (width > bestWidth || width === bestWidth && rank > bestRank) winner = edge;
|
|
983
|
+
}
|
|
984
|
+
return {
|
|
985
|
+
...winner,
|
|
986
|
+
isOwn: winner === own,
|
|
987
|
+
isRow: candidates.indexOf(winner) >= 2
|
|
988
|
+
};
|
|
989
|
+
}
|
|
990
|
+
//#endregion
|
|
991
|
+
//#region src/Table/glidingDivider.ts
|
|
992
|
+
/** 行在滑动期间带的标记。 */
|
|
993
|
+
const GLIDING_ATTRIBUTE = "data-astryx-row-gliding";
|
|
994
|
+
/** 移动行的每个格子带的标记;画分隔线的那个格子值是 `line`。 */
|
|
995
|
+
const CELL_ATTRIBUTE = "data-astryx-cell-gliding";
|
|
996
|
+
/** 固定列的格子不画整行的线:它有自己的背景,会盖住线。 */
|
|
997
|
+
const PINNED_CLASS = "astryx-table__sticky";
|
|
998
|
+
/** 行滑动期间带上的分隔线参数,替身线读它们。 */
|
|
999
|
+
const GLIDE_DIVIDER_WIDTH = "--_table-row-glide-width";
|
|
1000
|
+
const GLIDE_DIVIDER_STYLE = "--_table-row-glide-style";
|
|
1001
|
+
const GLIDE_DIVIDER_COLOR = "--_table-row-glide-color";
|
|
1002
|
+
const GLIDE_DIVIDER_OFFSET = "--_table-row-glide-offset";
|
|
1003
|
+
/** 最后标记一行的那一批:只有它能撤掉标记。 */
|
|
1004
|
+
const markedBy = /* @__PURE__ */ new WeakMap();
|
|
1005
|
+
/** 被标记元素自己的行内上边框颜色(下一行和它的格子),撤标记时还回去。 */
|
|
1006
|
+
const inlineTopOf = /* @__PURE__ */ new WeakMap();
|
|
1007
|
+
/** 一行被标记时藏起来的边框来源,撤标记时还回去。 */
|
|
1008
|
+
const sourcesOf = /* @__PURE__ */ new WeakMap();
|
|
1009
|
+
/** 被标记元素自己的行内下边框颜色,撤标记时还回去。 */
|
|
1010
|
+
const inlineColorOf = /* @__PURE__ */ new WeakMap();
|
|
1011
|
+
/**
|
|
1012
|
+
* 合并边框里可能画出这一行下边那条线的元素:行自己;下一行和它的格子(上边);
|
|
1013
|
+
* 行是分组里最后一行时,还有分组和下一个分组。
|
|
1014
|
+
*/
|
|
1015
|
+
function edgeSourcesOf(row) {
|
|
1016
|
+
const bottoms = [row];
|
|
1017
|
+
const tops = [];
|
|
1018
|
+
const group = row.parentElement;
|
|
1019
|
+
const next = row.nextElementSibling ?? group?.nextElementSibling?.firstElementChild ?? null;
|
|
1020
|
+
if (next instanceof HTMLElement) {
|
|
1021
|
+
tops.push(next);
|
|
1022
|
+
for (const cell of next.children) if (cell instanceof HTMLElement) tops.push(cell);
|
|
1023
|
+
}
|
|
1024
|
+
if (row.nextElementSibling == null && group instanceof HTMLElement) {
|
|
1025
|
+
bottoms.push(group);
|
|
1026
|
+
const nextGroup = group.nextElementSibling;
|
|
1027
|
+
if (nextGroup instanceof HTMLElement) tops.push(nextGroup);
|
|
1028
|
+
}
|
|
1029
|
+
return {
|
|
1030
|
+
bottoms,
|
|
1031
|
+
tops
|
|
1032
|
+
};
|
|
1033
|
+
}
|
|
1034
|
+
/**
|
|
1035
|
+
* 一行自己的下边框,给它移动时的替身线用;已经带着替身线的行返回 null。
|
|
1036
|
+
* 在滑动读取布局的地方(`animate` 的 `beforeMove`)读,赶在任何东西开始移动之前。
|
|
1037
|
+
*/
|
|
1038
|
+
function rowEdge(row) {
|
|
1039
|
+
if (row.hasAttribute("data-astryx-row-gliding") || !(row.lastElementChild instanceof HTMLTableCellElement)) return null;
|
|
1040
|
+
return collapsedBottom(row.lastElementChild);
|
|
1041
|
+
}
|
|
1042
|
+
/** 合并后的下边框在行的内边距盒下面多远(边框比行自己的宽时不是 0)。 */
|
|
1043
|
+
function dividerOffset(row, edge) {
|
|
1044
|
+
const cell = row.lastElementChild;
|
|
1045
|
+
if (!(cell instanceof HTMLElement)) return null;
|
|
1046
|
+
const cellEdge = cell.getBoundingClientRect().top + cell.clientTop + cell.clientHeight;
|
|
1047
|
+
const rowPaddingEdge = row.getBoundingClientRect().top + row.clientTop + row.clientHeight;
|
|
1048
|
+
return Math.floor(cellEdge) + edge.width - rowPaddingEdge;
|
|
1049
|
+
}
|
|
1050
|
+
function markRow(row, edge, offset) {
|
|
1051
|
+
row.style.setProperty(GLIDE_DIVIDER_WIDTH, `${edge.width}px`);
|
|
1052
|
+
row.style.setProperty(GLIDE_DIVIDER_STYLE, edge.style);
|
|
1053
|
+
row.style.setProperty(GLIDE_DIVIDER_COLOR, edge.color);
|
|
1054
|
+
row.setAttribute(GLIDING_ATTRIBUTE, "");
|
|
1055
|
+
const sources = edgeSourcesOf(row);
|
|
1056
|
+
sourcesOf.set(row, sources);
|
|
1057
|
+
for (const element of sources.bottoms) if (!inlineColorOf.has(element)) {
|
|
1058
|
+
inlineColorOf.set(element, element.style.borderBottomColor);
|
|
1059
|
+
element.style.borderBottomColor = "transparent";
|
|
1060
|
+
}
|
|
1061
|
+
for (const element of sources.tops) if (!inlineTopOf.has(element)) {
|
|
1062
|
+
inlineTopOf.set(element, element.style.borderTopColor);
|
|
1063
|
+
element.style.borderTopColor = "transparent";
|
|
1064
|
+
}
|
|
1065
|
+
row.style.setProperty(GLIDE_DIVIDER_OFFSET, `${offset}px`);
|
|
1066
|
+
row.style.zIndex = row.nextElementSibling == null ? "0" : "1";
|
|
1067
|
+
let hasLine = false;
|
|
1068
|
+
for (const cell of row.children) {
|
|
1069
|
+
const isLine = !hasLine && !cell.classList.contains(PINNED_CLASS);
|
|
1070
|
+
cell.setAttribute(CELL_ATTRIBUTE, isLine ? "line" : "");
|
|
1071
|
+
hasLine ||= isLine;
|
|
1072
|
+
if (cell instanceof HTMLElement) {
|
|
1073
|
+
inlineColorOf.set(cell, cell.style.borderBottomColor);
|
|
1074
|
+
cell.style.borderBottomColor = "transparent";
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
function restore(element, store, side) {
|
|
1079
|
+
if (store.has(element)) {
|
|
1080
|
+
element.style[side] = store.get(element) ?? "";
|
|
1081
|
+
store.delete(element);
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
function unmarkRow(row) {
|
|
1085
|
+
row.removeAttribute(GLIDING_ATTRIBUTE);
|
|
1086
|
+
row.style.removeProperty("z-index");
|
|
1087
|
+
const { bottoms, tops } = sourcesOf.get(row) ?? {
|
|
1088
|
+
bottoms: [],
|
|
1089
|
+
tops: []
|
|
1090
|
+
};
|
|
1091
|
+
sourcesOf.delete(row);
|
|
1092
|
+
bottoms.forEach((element) => restore(element, inlineColorOf, "borderBottomColor"));
|
|
1093
|
+
tops.forEach((element) => restore(element, inlineTopOf, "borderTopColor"));
|
|
1094
|
+
row.style.removeProperty(GLIDE_DIVIDER_OFFSET);
|
|
1095
|
+
for (const cell of row.children) {
|
|
1096
|
+
cell.removeAttribute(CELL_ATTRIBUTE);
|
|
1097
|
+
if (cell instanceof HTMLElement) restore(cell, inlineColorOf, "borderBottomColor");
|
|
1098
|
+
}
|
|
1099
|
+
row.style.removeProperty(GLIDE_DIVIDER_WIDTH);
|
|
1100
|
+
row.style.removeProperty(GLIDE_DIVIDER_STYLE);
|
|
1101
|
+
row.style.removeProperty(GLIDE_DIVIDER_COLOR);
|
|
1102
|
+
}
|
|
1103
|
+
/**
|
|
1104
|
+
* 给变化的行和这次滑动移动的行做标记,滑动结束后撤掉。从变化的行往上、往下找,
|
|
1105
|
+
* 连着两行没在滑就停。`entering` 是播放入场的展开面板:它不移动,但边缘在动。
|
|
1106
|
+
*/
|
|
1107
|
+
async function markGlidingRows(changed, edges, entering, glideOf) {
|
|
1108
|
+
const rows = /* @__PURE__ */ new Map();
|
|
1109
|
+
const glide = glideOf(changed);
|
|
1110
|
+
if (glide != null) rows.set(changed, glide);
|
|
1111
|
+
for (const step of ["nextElementSibling", "previousElementSibling"]) {
|
|
1112
|
+
let row = changed[step];
|
|
1113
|
+
let stillInARow = 0;
|
|
1114
|
+
while (row instanceof HTMLElement && stillInARow < 2) {
|
|
1115
|
+
const animation = glideOf(row);
|
|
1116
|
+
if (animation != null) {
|
|
1117
|
+
rows.set(row, animation);
|
|
1118
|
+
stillInARow = 0;
|
|
1119
|
+
} else stillInARow += 1;
|
|
1120
|
+
row = row[step];
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
if (entering != null) rows.set(entering.row, entering.animation);
|
|
1124
|
+
if (rows.size === 0) return;
|
|
1125
|
+
const batch = Symbol("glide");
|
|
1126
|
+
const offsets = /* @__PURE__ */ new Map();
|
|
1127
|
+
for (const row of rows.keys()) {
|
|
1128
|
+
const edge = edges.get(row);
|
|
1129
|
+
if (edge == null) continue;
|
|
1130
|
+
const offset = row === entering?.row && entering.offset != null ? entering.offset : dividerOffset(row, edge);
|
|
1131
|
+
if (offset != null) offsets.set(row, offset);
|
|
1132
|
+
}
|
|
1133
|
+
for (const row of rows.keys()) {
|
|
1134
|
+
const edge = edges.get(row);
|
|
1135
|
+
if (edge != null && !row.hasAttribute("data-astryx-row-gliding")) markRow(row, edge, offsets.get(row) ?? 0);
|
|
1136
|
+
markedBy.set(row, batch);
|
|
1137
|
+
}
|
|
1138
|
+
await Promise.all([...rows.values()].map(async (animation) => {
|
|
1139
|
+
await animation?.finished.catch(() => void 0);
|
|
1140
|
+
}));
|
|
1141
|
+
for (const row of rows.keys()) {
|
|
1142
|
+
if (markedBy.get(row) !== batch) continue;
|
|
1143
|
+
markedBy.delete(row);
|
|
1144
|
+
unmarkRow(row);
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
//#endregion
|
|
1148
|
+
//#region src/Table/plugins/rowExpansionGlide.ts
|
|
1149
|
+
const CHEVRON = ".astryx-table__chevron-icon";
|
|
1150
|
+
const EXPANSION_KEY_ATTRIBUTE = "data-expansion-key";
|
|
1151
|
+
function useRowExpansionGlide(options) {
|
|
1152
|
+
let wrapper = null;
|
|
1153
|
+
let pending = [];
|
|
1154
|
+
/** 这次收起的面板让出的高度(和位置一起量)。 */
|
|
1155
|
+
let closedHeight = 0;
|
|
1156
|
+
/** 滑动期间滚动容器留住的高度。 */
|
|
1157
|
+
let heldHeight = 0;
|
|
1158
|
+
/** 容器自己的底部内边距和外边距(容器的出血),留高度时在它们上面加。 */
|
|
1159
|
+
let holdBase = null;
|
|
1160
|
+
/** 只找这张表自己 tbody 里的行:面板里嵌套的表格可能用同样的行 key。 */
|
|
1161
|
+
function rowFor(key) {
|
|
1162
|
+
const row = [...[...(wrapper?.querySelector("table"))?.children ?? []].find((child) => child.tagName === "TBODY")?.children ?? []].find((child) => child.getAttribute(EXPANSION_KEY_ATTRIBUTE) === key);
|
|
1163
|
+
return row instanceof HTMLElement ? row : null;
|
|
1164
|
+
}
|
|
1165
|
+
/** 箭头回到主题自己的转动:句柄设的过渡只在传着句柄时保留。只管这张表自己的箭头。 */
|
|
1166
|
+
function resetChevrons() {
|
|
1167
|
+
const table = wrapper?.querySelector("table");
|
|
1168
|
+
for (const glyph of table?.querySelectorAll(CHEVRON) ?? []) if (glyph.closest("table") === table) applyLayoutChangeTransition(null, glyph);
|
|
1169
|
+
}
|
|
1170
|
+
function measure(handle, key, isExpanding) {
|
|
1171
|
+
const row = rowFor(key);
|
|
1172
|
+
if (row == null) return;
|
|
1173
|
+
const change = reportLayoutChange(handle, () => row);
|
|
1174
|
+
change.measureBefore();
|
|
1175
|
+
const panel = row.nextElementSibling;
|
|
1176
|
+
if (!isExpanding && panel?.hasAttribute("data-expansion-panel") === true) {
|
|
1177
|
+
closedHeight += panel.getBoundingClientRect().height;
|
|
1178
|
+
if (wrapper != null && holdBase == null) {
|
|
1179
|
+
const style = getComputedStyle(wrapper);
|
|
1180
|
+
holdBase = {
|
|
1181
|
+
padding: Number.parseFloat(style.getPropertyValue("padding-block-end")) || 0,
|
|
1182
|
+
margin: Number.parseFloat(style.getPropertyValue("margin-block-end")) || 0
|
|
1183
|
+
};
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
applyLayoutChangeTransition(handle, row.querySelector(CHEVRON));
|
|
1187
|
+
pending.push({
|
|
1188
|
+
change,
|
|
1189
|
+
key,
|
|
1190
|
+
isExpanding
|
|
1191
|
+
});
|
|
1192
|
+
}
|
|
1193
|
+
watch(() => [...options.expandedKeys()], (current, previous) => {
|
|
1194
|
+
const handle = options.animatedLayout();
|
|
1195
|
+
if (handle == null) return;
|
|
1196
|
+
const now = new Set(current);
|
|
1197
|
+
const before = new Set(previous);
|
|
1198
|
+
for (const key of before) if (!now.has(key)) measure(handle, key, false);
|
|
1199
|
+
for (const key of now) if (!before.has(key)) measure(handle, key, true);
|
|
1200
|
+
}, { flush: "pre" });
|
|
1201
|
+
function play(item, handle) {
|
|
1202
|
+
const row = rowFor(item.key);
|
|
1203
|
+
if (row == null) {
|
|
1204
|
+
item.change.animate();
|
|
1205
|
+
return null;
|
|
1206
|
+
}
|
|
1207
|
+
const next = row.nextElementSibling;
|
|
1208
|
+
const record = {
|
|
1209
|
+
row,
|
|
1210
|
+
panel: item.isExpanding && next instanceof HTMLElement && next.hasAttribute("data-expansion-panel") ? next : null,
|
|
1211
|
+
entrance: null,
|
|
1212
|
+
panelOffset: null,
|
|
1213
|
+
edges: /* @__PURE__ */ new Map()
|
|
1214
|
+
};
|
|
1215
|
+
return item.change.animate((candidates) => {
|
|
1216
|
+
for (const candidate of candidates) if (candidate instanceof HTMLTableRowElement && candidate.parentElement === row.parentElement) {
|
|
1217
|
+
const edge = rowEdge(candidate);
|
|
1218
|
+
if (edge != null) record.edges.set(candidate, edge);
|
|
1219
|
+
}
|
|
1220
|
+
if (record.panel != null) {
|
|
1221
|
+
const edge = rowEdge(record.panel);
|
|
1222
|
+
if (edge != null) {
|
|
1223
|
+
record.edges.set(record.panel, edge);
|
|
1224
|
+
record.panelOffset = dividerOffset(record.panel, edge);
|
|
1225
|
+
}
|
|
1226
|
+
record.entrance = playLayoutChange(handle, record.panel);
|
|
1227
|
+
}
|
|
1228
|
+
}) ? record : null;
|
|
1229
|
+
}
|
|
1230
|
+
function hold(height) {
|
|
1231
|
+
if (wrapper == null) return;
|
|
1232
|
+
const base = holdBase ?? {
|
|
1233
|
+
padding: 0,
|
|
1234
|
+
margin: 0
|
|
1235
|
+
};
|
|
1236
|
+
if (height > 0) {
|
|
1237
|
+
wrapper.style.setProperty("padding-block-end", `${base.padding + height}px`);
|
|
1238
|
+
wrapper.style.setProperty("margin-block-end", `${base.margin - height}px`);
|
|
1239
|
+
return;
|
|
1240
|
+
}
|
|
1241
|
+
wrapper.style.removeProperty("padding-block-end");
|
|
1242
|
+
wrapper.style.removeProperty("margin-block-end");
|
|
1243
|
+
holdBase = null;
|
|
1244
|
+
}
|
|
1245
|
+
watch(() => [...options.expandedKeys()], () => {
|
|
1246
|
+
const changes = pending;
|
|
1247
|
+
pending = [];
|
|
1248
|
+
const handle = options.animatedLayout();
|
|
1249
|
+
const moved = changes.map((item) => play(item, handle)).filter((record) => record != null);
|
|
1250
|
+
const held = moved.length > 0 ? closedHeight : 0;
|
|
1251
|
+
closedHeight = 0;
|
|
1252
|
+
if (heldHeight === 0 && held <= .5) holdBase = null;
|
|
1253
|
+
if (moved.length === 0) return;
|
|
1254
|
+
queueMicrotask(() => {
|
|
1255
|
+
const stopped = Promise.all(moved.map(async ({ row, panel, entrance, panelOffset, edges }) => markGlidingRows(row, edges, panel != null && entrance != null ? {
|
|
1256
|
+
row: panel,
|
|
1257
|
+
animation: entrance,
|
|
1258
|
+
offset: panelOffset
|
|
1259
|
+
} : null, glideOf)));
|
|
1260
|
+
if (held <= .5 || wrapper == null) return;
|
|
1261
|
+
heldHeight += held;
|
|
1262
|
+
hold(heldHeight);
|
|
1263
|
+
stopped.then(() => {
|
|
1264
|
+
heldHeight = Math.max(0, heldHeight - held);
|
|
1265
|
+
hold(heldHeight);
|
|
1266
|
+
});
|
|
1267
|
+
});
|
|
1268
|
+
}, { flush: "post" });
|
|
1269
|
+
watch(options.animatedLayout, (handle) => {
|
|
1270
|
+
if (handle == null) resetChevrons();
|
|
1271
|
+
}, { flush: "post" });
|
|
1272
|
+
return { bindScrollRoot(element) {
|
|
1273
|
+
wrapper = element;
|
|
1274
|
+
if (element != null && options.animatedLayout() == null) resetChevrons();
|
|
1275
|
+
} };
|
|
1276
|
+
}
|
|
1277
|
+
//#endregion
|
|
914
1278
|
//#region src/Table/plugins/rowExpansion.ts
|
|
915
1279
|
const EXPANSION_COLUMN_KEY = "__expansion";
|
|
916
1280
|
function useTableRowExpansion(config) {
|
|
917
1281
|
const messages = useComponentMessages({ table: tableMessages });
|
|
918
1282
|
return {
|
|
919
1283
|
rowModel: "detail",
|
|
1284
|
+
bindScrollRoot: useRowExpansionGlide({
|
|
1285
|
+
animatedLayout: () => toValue(config).animatedLayout,
|
|
1286
|
+
expandedKeys: () => toValue(config).expandedKeys
|
|
1287
|
+
}).bindScrollRoot,
|
|
920
1288
|
transformColumns(columns) {
|
|
921
1289
|
return [{
|
|
922
1290
|
key: EXPANSION_COLUMN_KEY,
|
|
@@ -943,7 +1311,10 @@ function useTableRowExpansion(config) {
|
|
|
943
1311
|
const expanded = current.expandedKeys.has(key);
|
|
944
1312
|
const variant = current.panelVariant ?? "transparent";
|
|
945
1313
|
return {
|
|
946
|
-
attrs: expanded ? {
|
|
1314
|
+
attrs: expanded ? {
|
|
1315
|
+
[EXPANSION_KEY_ATTRIBUTE]: key,
|
|
1316
|
+
"data-expanded": ""
|
|
1317
|
+
} : { [EXPANSION_KEY_ATTRIBUTE]: key },
|
|
947
1318
|
class: current.hasRowClickExpansion ? "astryx-table__clickable" : void 0,
|
|
948
1319
|
onClick: current.hasRowClickExpansion ? (event) => {
|
|
949
1320
|
if (!isInteractiveRowClick(event)) current.onToggle(key);
|
package/dist/TextArea/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Ct as
|
|
1
|
+
import { Ct as TextAreaSize, Dt as TextAreaWrap, Et as TextAreaStatusType, St as TextAreaResize, Tt as TextAreaStatus, _t as _default, bt as TextAreaEmits, vt as TextAreaChangeAction, wt as TextAreaSlots, xt as TextAreaProps, yt as TextAreaChangeEvent } from "../index-t27MvEzT.js";
|
|
2
2
|
export { _default as TextArea, type TextAreaChangeAction, type TextAreaChangeEvent, type TextAreaEmits, type TextAreaProps, type TextAreaResize, type TextAreaSize, type TextAreaSlots, type TextAreaStatus, type TextAreaStatusType, type TextAreaWrap };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ct as
|
|
1
|
+
import { ct as TextInputChangeAction, dt as TextInputProps, ft as TextInputSize, gt as TextInputType, ht as TextInputStatusType, lt as TextInputChangeEvent, mt as TextInputStatus, pt as TextInputSlots, st as _default, ut as TextInputEmits } from "../index-t27MvEzT.js";
|
|
2
2
|
export { _default as TextInput, type TextInputChangeAction, type TextInputChangeEvent, type TextInputEmits, type TextInputProps, type TextInputSize, type TextInputSlots, type TextInputStatus, type TextInputStatusType, type TextInputType };
|
package/dist/Theme/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
1
|
+
import { n as normalizeTokenName } from "../tokenName-0U-WEH09.js";
|
|
2
|
+
import { a as neutralTheme, c as expandMotionScale, d as DEFAULT_WIDTH_BREAKPOINTS, f as WIDTH_BREAKPOINT_NAMES, i as isDefinedTheme, l as expandRadiusScale, n as _sfc_main$1, o as STATUS_COLOR_DEFAULTS, r as defineTheme, s as expandTypeScale, t as useMediaTheme, u as expandColorScale } from "../Theme-1RJVaRgz.js";
|
|
3
|
+
import { c as DATA_TOKEN_DEFAULTS, n as useTheme, t as _sfc_main } from "../MediaTheme-DfcdEWx-.js";
|
|
3
4
|
export { DATA_TOKEN_DEFAULTS, DEFAULT_WIDTH_BREAKPOINTS, _sfc_main as MediaTheme, STATUS_COLOR_DEFAULTS, _sfc_main$1 as Theme, WIDTH_BREAKPOINT_NAMES, defineTheme, expandColorScale, expandMotionScale, expandRadiusScale, expandTypeScale, isDefinedTheme, neutralTheme, normalizeTokenName, useMediaTheme, useTheme };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { c as themeNestingKey, n as resolveIconEntryVariants, o as mediaThemeKey, s as themeContextKey, t as readThemeIconIds } from "./themeIcons-CqGF0fwW.js";
|
|
2
|
+
import { n as easeDefaults, t as durationDefaults } from "./motionTokenDefaults-EFzpiAF5.js";
|
|
3
|
+
import { n as normalizeTokenName, r as prefixTokenReferences, t as isPortableTokenName } from "./tokenName-0U-WEH09.js";
|
|
2
4
|
import { n as observeResize } from "./sharedResizeObserver-BekhnB3E.js";
|
|
3
5
|
import { r as staticComponentIcons, t as mergeComponentIcons } from "./componentIcons-CFr2L6o3.js";
|
|
4
6
|
import { a as syntaxThemeStyle } from "./syntaxTheme-R7xnu5x5.js";
|
|
5
7
|
import { t as syntaxThemeKey } from "./syntaxContext-DmIfNNtb.js";
|
|
6
|
-
import { a as
|
|
8
|
+
import { a as contrastRatio, i as compositeOver, o as parseColor, r as bridgeComponentTokens, s as relativeLuminance } from "./MediaTheme-DfcdEWx-.js";
|
|
7
9
|
import { computed, createBlock, createCommentVNode, createElementBlock, defineComponent, h, inject, markRaw, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, openBlock, provide, renderSlot, unref, useAttrs, useTemplateRef, watch } from "vue";
|
|
8
10
|
import "../styles/theme.css";
|
|
9
11
|
//#region src/Theme/adaptationTypes.ts
|
|
@@ -544,43 +546,6 @@ function expandRadiusScale(config) {
|
|
|
544
546
|
};
|
|
545
547
|
}
|
|
546
548
|
//#endregion
|
|
547
|
-
//#region src/Theme/motionTokenDefaults.ts
|
|
548
|
-
/**
|
|
549
|
-
* @file motionTokenDefaults.ts
|
|
550
|
-
* @input Nothing: the values `@astryx-vue/themes` declares on `:root`
|
|
551
|
-
* @output durationDefaults and easeDefaults, keyed by the theme vocabulary's
|
|
552
|
-
* unprefixed names, and their name types
|
|
553
|
-
* @position Theme utility with no imports. The neutral theme stylesheet
|
|
554
|
-
* (`packages/themes/neutral/base.css`) declares these values as
|
|
555
|
-
* `--astryx-duration-*` and `--astryx-ease-*`; motionTokenDefaults.test.ts
|
|
556
|
-
* keeps the two equal. Motion tokens a theme generates (`tempo`,
|
|
557
|
-
* `character`) start from these values, and the motion foundation falls
|
|
558
|
-
* back to them where no stylesheet applies. Pure; safe on the server.
|
|
559
|
-
*/
|
|
560
|
-
const durationDefaults = {
|
|
561
|
-
"--duration-fast-min": "95ms",
|
|
562
|
-
"--duration-fast": "125ms",
|
|
563
|
-
"--duration-fast-max": "165ms",
|
|
564
|
-
"--duration-medium-min": "225ms",
|
|
565
|
-
"--duration-medium": "300ms",
|
|
566
|
-
"--duration-medium-max": "400ms",
|
|
567
|
-
"--duration-slow-min": "525ms",
|
|
568
|
-
"--duration-slow": "700ms",
|
|
569
|
-
"--duration-slow-max": "935ms",
|
|
570
|
-
/** The standard dismissal duration. */
|
|
571
|
-
"--duration-exit": "var(--duration-fast)"
|
|
572
|
-
};
|
|
573
|
-
const easeDefaults = {
|
|
574
|
-
/** Decelerates: state changes. */
|
|
575
|
-
"--ease-standard": "cubic-bezier(0.24, 1, 0.4, 1)",
|
|
576
|
-
/** Entrances. A theme's `character` sets it; at `'standard'` it equals `--ease-standard`. */
|
|
577
|
-
"--ease-entrance": "cubic-bezier(0.24, 1, 0.4, 1)",
|
|
578
|
-
/** Moves on screen. A theme's `character` sets it; at `'standard'` it equals `--ease-standard`. */
|
|
579
|
-
"--ease-move": "cubic-bezier(0.24, 1, 0.4, 1)",
|
|
580
|
-
/** Accelerates: things leaving. */
|
|
581
|
-
"--ease-exit": "cubic-bezier(0.3, 0, 0.6, 0.6)"
|
|
582
|
-
};
|
|
583
|
-
//#endregion
|
|
584
549
|
//#region src/Theme/expandMotionScale.ts
|
|
585
550
|
function assertMotion(config) {
|
|
586
551
|
for (const [label, value] of [
|