@astryx-vue/core 0.18.0 → 0.19.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/dist/AppShell/index.d.ts +1 -1
- 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/Button/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-ydp0vJdO.js} +38 -14
- package/dist/Card/index.d.ts +1 -1
- package/dist/Carousel/index.d.ts +1 -1
- package/dist/Chat/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/Code/index.d.ts +1 -1
- package/dist/Collapsible/index.d.ts +1 -1
- 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-CiIWOWXM.js} +3 -3
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateRangeInput/index.js +1 -1
- package/dist/{DateRangeInput-kxXBsUTU.js → DateRangeInput-CLVQ8E0Y.js} +25 -17
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.js +1 -1
- package/dist/{DateTimeInput-Cfkuec_h.js → DateTimeInput-jHSN-Dzu.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/Heading/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/List/index.d.ts +1 -1
- package/dist/MoreMenu/index.d.ts +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/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/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-BAOqpQag.js → PowerSearch-C2x4uuAM.js} +6 -6
- 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.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/TabList/index.d.ts +1 -1
- package/dist/Table/index.d.ts +1 -1
- package/dist/Table/index.js +1 -1
- package/dist/{Table-iemur_3E.js → Table-o3aGMDT1.js} +4 -4
- 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/{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/ToggleButton/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/composables/index.d.ts +1 -1
- package/dist/composables/index.js +3 -3
- package/dist/{format-CMHyAMn3.js → format-mffyPc-L.js} +34 -4
- package/dist/{index-BhxqUt3y.d.ts → index--kbwaSXW.d.ts} +1 -1
- package/dist/{index-KcCNhdAw.d.ts → index-B3yTdknp.d.ts} +1 -1
- package/dist/{index-DMcf0QeR.d.ts → index-B449gOMC.d.ts} +1 -1
- package/dist/{index-DMN_JVEt.d.ts → index-BL4mH8aK.d.ts} +1 -1
- package/dist/{index-DFLPv9io.d.ts → index-BO9TY87G.d.ts} +1 -1
- package/dist/{index-D31bgBoy.d.ts → index-BdZCLUgY.d.ts} +1 -1
- package/dist/{index-BDZCJ9ri.d.ts → index-BuubzuE8.d.ts} +2 -2
- package/dist/{index-C1qJlC65.d.ts → index-CQ-sq76o.d.ts} +1 -1
- package/dist/{index-Bgk1Rj2A.d.ts → index-CTjkJP4x.d.ts} +1 -1
- package/dist/{index-BKpnfdq1.d.ts → index-CUCgbqBB.d.ts} +3 -3
- package/dist/{index-FeZXsFO-.d.ts → index-CbA8rR_b.d.ts} +2 -2
- package/dist/{index-YKCx03zD.d.ts → index-CdvmnNMH.d.ts} +1 -1
- package/dist/{index-Bzi3A980.d.ts → index-ChqMaV6N.d.ts} +1 -1
- package/dist/{index-B_PKY-Wn.d.ts → index-D-giO0SA.d.ts} +2 -2
- package/dist/{index-gu5EvbE0.d.ts → index-DBu-H-vB.d.ts} +13 -3
- package/dist/{index-BzmcDJau.d.ts → index-DdT2wE_N.d.ts} +3 -3
- package/dist/{index-o00Upzjp.d.ts → index-Dg0JsBpI.d.ts} +1 -1
- package/dist/{index-PffxihMx.d.ts → index-Djf0M7PH.d.ts} +1 -1
- package/dist/{index-BtqvPjAf.d.ts → index-Otl047R1.d.ts} +2 -2
- package/dist/{index-B1eCxBCY.d.ts → index-TXcNH86P.d.ts} +1 -1
- package/dist/{index-BBTU-TKb.d.ts → index-X4S7_dmq.d.ts} +2 -1
- package/dist/{index-DmAEpn5E.d.ts → index-aE810PYg.d.ts} +1 -1
- package/dist/{index-C5e2rZML.d.ts → index-dWlCpnua.d.ts} +2 -2
- package/dist/{index-DPhQZXYw.d.ts → index-eCp-ElSp.d.ts} +2 -2
- package/dist/{index-Y4H4X6Vy.d.ts → index-ohw86wfM.d.ts} +87 -46
- package/dist/{index-CtYlR9Cu.d.ts → index-rdwI-mcm.d.ts} +1 -1
- package/dist/{index-C89cIh4E.d.ts → index-waTkqxTz.d.ts} +1 -1
- package/dist/{index-ql9ApSTF.d.ts → index-yQc-te9a.d.ts} +2 -2
- package/dist/index.d.ts +30 -30
- package/dist/index.js +19 -19
- 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/timeFormat-CqrwFE42.js +203 -0
- package/dist/{timestamp-BMYQsFDj.js → timestamp-saJUedIU.js} +4 -2
- package/dist/unicodeDigits-_BYIJcAu.js +46 -0
- package/dist/{useDateRange-CIXoE_8k.js → useDateRange-D1Szw54e.js} +7 -3
- package/dist/{useMonthGrid-fGHSSrFc.js → useMonthGrid-Bzvlstgc.js} +1 -1
- package/dist/{useTimeValue-_XW9g2V1.js → useTimeValue-CcKrnO8z.js} +13 -6
- package/package.json +1 -1
- package/styles/calendar.css +5 -1
- package/styles/date-range-input.css +19 -2
- package/styles/timestamp.css +22 -10
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { at as TimeInputSize, it as TimeInputProps, nt as _default, rt as TimeInputEmits } from "../index-
|
|
2
|
-
export { _default as TimeInput, type TimeInputEmits, type TimeInputProps, type TimeInputSize };
|
|
1
|
+
import { at as TimeInputSize, it as TimeInputProps, nt as _default, ot as TimeInputEntryError, rt as TimeInputEmits } from "../index-ohw86wfM.js";
|
|
2
|
+
export { _default as TimeInput, type TimeInputEmits, type TimeInputEntryError, type TimeInputProps, type TimeInputSize };
|
package/dist/TimeInput/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _sfc_main } from "../TimeInput-
|
|
1
|
+
import { t as _sfc_main } from "../TimeInput-CkZfhhAr.js";
|
|
2
2
|
export { _sfc_main as TimeInput };
|
|
@@ -3,8 +3,8 @@ import { i as useSize } from "./SizeContext-BbaF-SEx.js";
|
|
|
3
3
|
import { t as useResolvedLabelHidden } from "./useResolvedLabelHidden-B2rlWiaI.js";
|
|
4
4
|
import { t as _sfc_main$1 } from "./Field-BXkGR8H0.js";
|
|
5
5
|
import { t as useFieldPartStyling } from "./fieldParts-CbWvZLhH.js";
|
|
6
|
-
import { t as _sfc_main$2 } from "./TimeField-
|
|
7
|
-
import { computed, createBlock, createVNode, defineComponent, mergeModels, mergeProps, normalizeClass, normalizeStyle, openBlock, unref, useAttrs, useId, useModel, withCtx } from "vue";
|
|
6
|
+
import { t as _sfc_main$2 } from "./TimeField-BM-rVFhC.js";
|
|
7
|
+
import { computed, createBlock, createVNode, defineComponent, mergeModels, mergeProps, normalizeClass, normalizeStyle, openBlock, shallowRef, unref, useAttrs, useId, useModel, withCtx } from "vue";
|
|
8
8
|
//#region src/TimeInput/TimeInput.vue
|
|
9
9
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
10
10
|
name: "AstryxTimeInput",
|
|
@@ -15,7 +15,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
15
15
|
id: {},
|
|
16
16
|
description: {},
|
|
17
17
|
placeholder: {},
|
|
18
|
-
hourFormat: {
|
|
18
|
+
hourFormat: {},
|
|
19
19
|
hasSeconds: {
|
|
20
20
|
type: Boolean,
|
|
21
21
|
default: false
|
|
@@ -44,6 +44,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
44
44
|
status: {},
|
|
45
45
|
statusVariant: { default: "attached" },
|
|
46
46
|
width: {},
|
|
47
|
+
entryErrorBehavior: {},
|
|
47
48
|
containerClass: { type: [
|
|
48
49
|
Boolean,
|
|
49
50
|
null,
|
|
@@ -76,9 +77,14 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
76
77
|
"modelValue": { default: null },
|
|
77
78
|
"modelModifiers": {}
|
|
78
79
|
}),
|
|
79
|
-
emits: /*@__PURE__*/ mergeModels([
|
|
80
|
-
|
|
80
|
+
emits: /*@__PURE__*/ mergeModels([
|
|
81
|
+
"update:modelValue",
|
|
82
|
+
"change",
|
|
83
|
+
"entryErrorChange"
|
|
84
|
+
], ["update:modelValue"]),
|
|
85
|
+
setup(__props, { emit: __emit }) {
|
|
81
86
|
const props = __props;
|
|
87
|
+
const emit = __emit;
|
|
82
88
|
const size = useSize(() => props.size, "md");
|
|
83
89
|
const disabled = useInputGroupDisabled(() => props.isDisabled);
|
|
84
90
|
const model = useModel(__props, "modelValue");
|
|
@@ -109,6 +115,16 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
109
115
|
const hideLabel = useResolvedLabelHidden(() => props.isLabelHidden, () => props.labelHidden);
|
|
110
116
|
const generatedId = `astryx-time-input-${useId()}`;
|
|
111
117
|
const inputId = computed(() => props.id ?? generatedId);
|
|
118
|
+
/** 字段亮着的拒绝那句话。调用方的 error 说明优先;警告和成功的状态从不挡住拒绝。 */
|
|
119
|
+
const rejection = shallowRef(null);
|
|
120
|
+
const fieldStatus = computed(() => {
|
|
121
|
+
const own = props.status;
|
|
122
|
+
if (rejection.value == null || own?.type === "error" && own.message) return own;
|
|
123
|
+
return {
|
|
124
|
+
type: "error",
|
|
125
|
+
message: rejection.value
|
|
126
|
+
};
|
|
127
|
+
});
|
|
112
128
|
function inputAttrs() {
|
|
113
129
|
return parts.forwardedAttrs();
|
|
114
130
|
}
|
|
@@ -125,7 +141,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
125
141
|
"is-optional": __props.isOptional,
|
|
126
142
|
"is-required": __props.isRequired,
|
|
127
143
|
"label-tooltip": __props.labelTooltip,
|
|
128
|
-
status:
|
|
144
|
+
status: fieldStatus.value,
|
|
129
145
|
"status-variant": __props.statusVariant
|
|
130
146
|
}, {
|
|
131
147
|
default: withCtx((field) => [createVNode(_sfc_main$2, mergeProps({
|
|
@@ -155,7 +171,10 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
155
171
|
"is-loading": __props.isLoading,
|
|
156
172
|
"loading-label": __props.loadingLabel,
|
|
157
173
|
"disabled-message": __props.disabledMessage,
|
|
158
|
-
status: __props.status
|
|
174
|
+
status: __props.status,
|
|
175
|
+
"entry-error-behavior": __props.entryErrorBehavior,
|
|
176
|
+
onEntryErrorChange: _cache[1] || (_cache[1] = ($event) => emit("entryErrorChange", $event)),
|
|
177
|
+
onMessageChange: _cache[2] || (_cache[2] = ($event) => rejection.value = $event)
|
|
159
178
|
}), null, 16, [
|
|
160
179
|
"modelValue",
|
|
161
180
|
"control-class",
|
|
@@ -181,7 +200,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
181
200
|
"is-loading",
|
|
182
201
|
"loading-label",
|
|
183
202
|
"disabled-message",
|
|
184
|
-
"status"
|
|
203
|
+
"status",
|
|
204
|
+
"entry-error-behavior"
|
|
185
205
|
])]),
|
|
186
206
|
_: 1
|
|
187
207
|
}, 8, [
|
package/dist/Timer/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as TimerFormat, i as TimerType, n as TimerColor, o as TimerPresentation, r as TimerProps, s as getPresentation, t as _default } from "../index-
|
|
1
|
+
import { a as TimerFormat, i as TimerType, n as TimerColor, o as TimerPresentation, r as TimerProps, s as getPresentation, t as _default } from "../index-X4S7_dmq.js";
|
|
2
2
|
export { _default as Timer, type TimerColor, type TimerFormat, type TimerPresentation, type TimerProps, type TimerType, getPresentation };
|
package/dist/Timer/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as getPresentation, t as _sfc_main } from "../Timer-
|
|
1
|
+
import { n as getPresentation, t as _sfc_main } from "../Timer-DiIs5GLA.js";
|
|
2
2
|
export { _sfc_main as Timer, getPresentation };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { a as useAstryxLocale } from "./context-B8IEFCDR.js";
|
|
2
|
+
import { t as formatElapsedDuration } from "./timeFormat-CqrwFE42.js";
|
|
1
3
|
import { t as _sfc_main$1 } from "./Text-CiSw2pOi.js";
|
|
2
|
-
import { computed, createBlock, createElementBlock, createElementVNode, defineComponent, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, openBlock, useTemplateRef, watch, withCtx } from "vue";
|
|
4
|
+
import { computed, createBlock, createElementBlock, createElementVNode, defineComponent, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, openBlock, toDisplayString, unref, useTemplateRef, watch, withCtx } from "vue";
|
|
3
5
|
import "../styles/timer.css";
|
|
4
6
|
//#region src/Timer/format.ts
|
|
5
7
|
const ONE_SECOND_MS = 1e3;
|
|
@@ -15,7 +17,8 @@ function resolveTimerFormat(format) {
|
|
|
15
17
|
function getElapsedMilliseconds(now, startTime) {
|
|
16
18
|
return Math.max(0, now - startTime);
|
|
17
19
|
}
|
|
18
|
-
|
|
20
|
+
/** `locale` 决定 elapsed 格式里单位的写法、数字和连接方式(英文是「2m 08s」)。 */
|
|
21
|
+
function getPresentation(elapsedMilliseconds, format, locale = "en") {
|
|
19
22
|
const elapsedSeconds = Math.floor(elapsedMilliseconds / ONE_SECOND_MS);
|
|
20
23
|
if (format === "clock") {
|
|
21
24
|
const hours = Math.floor(elapsedSeconds / ONE_HOUR_SECONDS);
|
|
@@ -28,16 +31,16 @@ function getPresentation(elapsedMilliseconds, format) {
|
|
|
28
31
|
}
|
|
29
32
|
if (elapsedSeconds < 60) return {
|
|
30
33
|
dateTime: `PT${elapsedSeconds}S`,
|
|
31
|
-
text:
|
|
34
|
+
text: formatElapsedDuration(locale, [["second", elapsedSeconds]])
|
|
32
35
|
};
|
|
33
36
|
const totalMinutes = Math.floor(elapsedSeconds / 60);
|
|
34
37
|
if (totalMinutes < 60) return {
|
|
35
38
|
dateTime: `PT${elapsedSeconds}S`,
|
|
36
|
-
text:
|
|
39
|
+
text: formatElapsedDuration(locale, [["minute", totalMinutes], ["second", elapsedSeconds % 60]])
|
|
37
40
|
};
|
|
38
41
|
return {
|
|
39
42
|
dateTime: `PT${totalMinutes * 60}S`,
|
|
40
|
-
text:
|
|
43
|
+
text: formatElapsedDuration(locale, [["hour", Math.floor(totalMinutes / 60)], ["minute", totalMinutes % 60]])
|
|
41
44
|
};
|
|
42
45
|
}
|
|
43
46
|
function getMillisecondsUntilNextChange(now, startTime, elapsedMilliseconds, format) {
|
|
@@ -47,12 +50,7 @@ function getMillisecondsUntilNextChange(now, startTime, elapsedMilliseconds, for
|
|
|
47
50
|
}
|
|
48
51
|
//#endregion
|
|
49
52
|
//#region src/Timer/Timer.vue
|
|
50
|
-
const _hoisted_1 =
|
|
51
|
-
ref: "time",
|
|
52
|
-
class: "astryx-timer__time",
|
|
53
|
-
datetime: "PT0S"
|
|
54
|
-
};
|
|
55
|
-
const _hoisted_2 = ["data-color"];
|
|
53
|
+
const _hoisted_1 = ["data-color"];
|
|
56
54
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
57
55
|
name: "AstryxTimer",
|
|
58
56
|
inheritAttrs: false,
|
|
@@ -67,9 +65,12 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
67
65
|
},
|
|
68
66
|
setup(__props) {
|
|
69
67
|
const props = __props;
|
|
68
|
+
const locale = useAstryxLocale();
|
|
70
69
|
const timeEl = useTemplateRef("time");
|
|
71
70
|
const mountTime = Date.now();
|
|
72
71
|
let timeoutId;
|
|
72
|
+
/** 第一次计时之前显示的文字,只在创建时取一次:之后文字由计时直接写进元素,渲染不再碰它。 */
|
|
73
|
+
const initialText = getPresentation(0, resolveTimerFormat(props.format), locale.value).text;
|
|
73
74
|
const inheritsType = computed(() => props.type === "inherit");
|
|
74
75
|
const textColor = computed(() => props.color === "disabled" ? "inherit" : props.color);
|
|
75
76
|
const textType = computed(() => props.type === "inherit" ? "supporting" : props.type);
|
|
@@ -81,7 +82,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
81
82
|
const start = props.startTime !== void 0 && Number.isFinite(props.startTime) ? props.startTime : mountTime;
|
|
82
83
|
const now = Date.now();
|
|
83
84
|
const elapsed = getElapsedMilliseconds(now, start);
|
|
84
|
-
const presentation = getPresentation(elapsed, resolveTimerFormat(props.format));
|
|
85
|
+
const presentation = getPresentation(elapsed, resolveTimerFormat(props.format), locale.value);
|
|
85
86
|
const node = timeEl.value;
|
|
86
87
|
if (node != null) {
|
|
87
88
|
if (node.textContent !== presentation.text) node.textContent = presentation.text;
|
|
@@ -94,7 +95,11 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
94
95
|
tick();
|
|
95
96
|
}
|
|
96
97
|
onMounted(start);
|
|
97
|
-
watch(() => [
|
|
98
|
+
watch(() => [
|
|
99
|
+
props.startTime,
|
|
100
|
+
props.format,
|
|
101
|
+
locale.value
|
|
102
|
+
], start);
|
|
98
103
|
onBeforeUnmount(stop);
|
|
99
104
|
return (_ctx, _cache) => {
|
|
100
105
|
return !inheritsType.value ? (openBlock(), createBlock(_sfc_main$1, {
|
|
@@ -108,7 +113,11 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
108
113
|
"data-color": __props.color,
|
|
109
114
|
"data-component": "timer"
|
|
110
115
|
}, {
|
|
111
|
-
default: withCtx(() => [createElementVNode("time",
|
|
116
|
+
default: withCtx(() => [createElementVNode("time", {
|
|
117
|
+
ref: "time",
|
|
118
|
+
class: "astryx-timer__time",
|
|
119
|
+
datetime: "PT0S"
|
|
120
|
+
}, toDisplayString(unref(initialText)), 513)]),
|
|
112
121
|
_: 1
|
|
113
122
|
}, 8, [
|
|
114
123
|
"class",
|
|
@@ -126,7 +135,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
126
135
|
"data-color": __props.color,
|
|
127
136
|
"data-component": "timer",
|
|
128
137
|
datetime: "PT0S"
|
|
129
|
-
},
|
|
138
|
+
}, toDisplayString(unref(initialText)), 15, _hoisted_1));
|
|
130
139
|
};
|
|
131
140
|
}
|
|
132
141
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as FormatInstantOptions, G as TimestampColor, J as TimestampTooltipEntry, K as TimestampFormat, Q as formatRelativeTime, W as _default, X as TimestampTooltipLine, Y as TimestampTooltipFormat, Z as formatTooltipLines, et as InstantFormat, q as TimestampProps, tt as formatInstant } from "../index-
|
|
1
|
+
import { $ as FormatInstantOptions, G as TimestampColor, J as TimestampTooltipEntry, K as TimestampFormat, Q as formatRelativeTime, W as _default, X as TimestampTooltipLine, Y as TimestampTooltipFormat, Z as formatTooltipLines, et as InstantFormat, q as TimestampProps, tt as formatInstant } from "../index-ohw86wfM.js";
|
|
2
2
|
export { type FormatInstantOptions, type InstantFormat, _default as Timestamp, type TimestampColor, type TimestampFormat, type TimestampProps, type TimestampTooltipEntry, type TimestampTooltipFormat, type TimestampTooltipLine, formatInstant, formatRelativeTime, formatTooltipLines };
|
package/dist/Timestamp/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { t as formatInstant } from "../formatInstant-BDWUIxS7.js";
|
|
2
|
-
import { n as formatTooltipLines, r as formatRelativeTime, t as _sfc_main } from "../Timestamp-
|
|
2
|
+
import { n as formatTooltipLines, r as formatRelativeTime, t as _sfc_main } from "../Timestamp-D9Jyk9sD.js";
|
|
3
3
|
export { _sfc_main as Timestamp, formatInstant, formatRelativeTime, formatTooltipLines };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import { t as devWarn } from "./useDevWarning-B2fsk2B-.js";
|
|
1
2
|
import { t as useAnnounce } from "./announce-GU01Oix2.js";
|
|
2
3
|
import { t as writeClipboardText } from "./clipboardWrite-Ds6fxmZc.js";
|
|
3
4
|
import { t as _sfc_main$2 } from "./IconButton-Du2XBBAX.js";
|
|
4
5
|
import { a as useAstryxLocale, o as useComponentMessages } from "./context-B8IEFCDR.js";
|
|
5
6
|
import { t as _sfc_main$3 } from "./Text-CiSw2pOi.js";
|
|
6
|
-
import { t as _sfc_main$4 } from "./HoverCard-
|
|
7
|
+
import { t as _sfc_main$4 } from "./HoverCard-FHYH3VXg.js";
|
|
7
8
|
import { t as _sfc_main$5 } from "./ComponentIcon-BRXBBKeG.js";
|
|
8
9
|
import { t as formatInstant } from "./formatInstant-BDWUIxS7.js";
|
|
9
|
-
import { t as timestampMessages } from "./timestamp-
|
|
10
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, openBlock, ref, renderList, renderSlot, toDisplayString, unref, watch, withCtx } from "vue";
|
|
10
|
+
import { t as timestampMessages } from "./timestamp-saJUedIU.js";
|
|
11
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, mergeProps, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, openBlock, ref, renderList, renderSlot, toDisplayString, unref, useAttrs, useTemplateRef, watch, withCtx } from "vue";
|
|
11
12
|
import "../styles/timestamp.css";
|
|
12
13
|
//#region src/Timestamp/formatRelativeTime.ts
|
|
13
14
|
const MINUTE = 60;
|
|
@@ -63,16 +64,14 @@ function formatRelativeTime(date, now, locale, style) {
|
|
|
63
64
|
}
|
|
64
65
|
//#endregion
|
|
65
66
|
//#region src/Timestamp/TimestampHoverCard.vue
|
|
66
|
-
const _hoisted_1
|
|
67
|
-
const _hoisted_2
|
|
67
|
+
const _hoisted_1 = ["data-columns", "aria-label"];
|
|
68
|
+
const _hoisted_2 = {
|
|
68
69
|
key: 0,
|
|
69
70
|
class: "astryx-timestamp__label"
|
|
70
71
|
};
|
|
71
|
-
const _hoisted_3 = { class: "astryx-
|
|
72
|
-
const _hoisted_4 = {
|
|
73
|
-
|
|
74
|
-
class: "astryx-timestamp__action"
|
|
75
|
-
};
|
|
72
|
+
const _hoisted_3 = { class: "astryx-timestamp__zone-name" };
|
|
73
|
+
const _hoisted_4 = { class: "astryx-timestamp__value" };
|
|
74
|
+
const _hoisted_5 = { class: "astryx-timestamp__text" };
|
|
76
75
|
const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
77
76
|
__name: "TimestampHoverCard",
|
|
78
77
|
props: {
|
|
@@ -136,28 +135,25 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
136
135
|
return openBlock(), createElementBlock("div", {
|
|
137
136
|
key: index,
|
|
138
137
|
class: "astryx-timestamp__row"
|
|
139
|
-
}, [
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}, 1032, ["label", "onClick"])) : createCommentVNode("v-if", true)])) : createCommentVNode("v-if", true)
|
|
159
|
-
]);
|
|
160
|
-
}), 128))], 8, _hoisted_1$1)]),
|
|
138
|
+
}, [hasLabel.value ? (openBlock(), createElementBlock("dt", _hoisted_2, toDisplayString(line.label ?? ""), 1)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" 没有标签的行靠时区全名在描述列表里有名字:它不显示出来,卡片看起来不变。 "), createElementVNode("dt", _hoisted_3, toDisplayString(line.zoneName), 1)], 2112)), createElementVNode("dd", _hoisted_4, [createElementVNode("span", _hoisted_5, toDisplayString(line.value), 1), line.isCopyable ? (openBlock(), createBlock(_sfc_main$2, {
|
|
139
|
+
key: 0,
|
|
140
|
+
class: "astryx-timestamp__action",
|
|
141
|
+
variant: "ghost",
|
|
142
|
+
size: "sm",
|
|
143
|
+
label: copyLabel(line, String(index)),
|
|
144
|
+
onClick: ($event) => copy(line.value, String(index))
|
|
145
|
+
}, {
|
|
146
|
+
default: withCtx(() => [createVNode(_sfc_main$5, {
|
|
147
|
+
"icon-slot": "timestamp-copy",
|
|
148
|
+
state: { copied: copiedKey.value === String(index) },
|
|
149
|
+
fallback: {
|
|
150
|
+
icon: copyIcon(String(index)),
|
|
151
|
+
size: "sm"
|
|
152
|
+
}
|
|
153
|
+
}, null, 8, ["state", "fallback"])]),
|
|
154
|
+
_: 2
|
|
155
|
+
}, 1032, ["label", "onClick"])) : createCommentVNode("v-if", true)])]);
|
|
156
|
+
}), 128))], 8, _hoisted_1)]),
|
|
161
157
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
162
158
|
_: 3
|
|
163
159
|
}, 8, ["label"]);
|
|
@@ -168,19 +164,31 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
168
164
|
//#region src/Timestamp/tooltipEntries.ts
|
|
169
165
|
const LOCAL_ZONE = "local";
|
|
170
166
|
const warned = /* @__PURE__ */ new Set();
|
|
171
|
-
|
|
167
|
+
/**
|
|
168
|
+
* 把时区交给 `Intl` 之前先确认它存在。`undefined` 和 `'local'` 是观看者自己的时区,
|
|
169
|
+
* 不认识的标识在开发期警告一次,回到观看者的时区。`context` 说明是哪个属性写错了。
|
|
170
|
+
*/
|
|
171
|
+
function resolveTimezoneID(timezoneID, context = "tooltipEntries") {
|
|
172
172
|
if (timezoneID == null || timezoneID.toLowerCase() === LOCAL_ZONE) return void 0;
|
|
173
173
|
try {
|
|
174
174
|
new Intl.DateTimeFormat("en-US", { timeZone: timezoneID }).format();
|
|
175
175
|
} catch {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
176
|
+
const report = `${context}:${timezoneID}`;
|
|
177
|
+
if (!warned.has(report)) {
|
|
178
|
+
warned.add(report);
|
|
179
|
+
devWarn("Timestamp", `unknown time zone ${JSON.stringify(timezoneID)} in ${context}. Falling back to the viewer's time zone.`);
|
|
179
180
|
}
|
|
180
181
|
return;
|
|
181
182
|
}
|
|
182
183
|
return timezoneID;
|
|
183
184
|
}
|
|
185
|
+
/** 一个时区在这一刻的完整名字(`Pacific Standard Time`)。`timeZone` 缺省是观看者的时区。 */
|
|
186
|
+
function longZoneName(date, locale, timeZone) {
|
|
187
|
+
return new Intl.DateTimeFormat(locale, {
|
|
188
|
+
timeZoneName: "long",
|
|
189
|
+
...timeZone == null ? {} : { timeZone }
|
|
190
|
+
}).formatToParts(date).find((part) => part.type === "timeZoneName")?.value ?? "";
|
|
191
|
+
}
|
|
184
192
|
function zoneKey(resolved) {
|
|
185
193
|
return resolved == null ? LOCAL_ZONE : resolved.toLowerCase();
|
|
186
194
|
}
|
|
@@ -189,15 +197,23 @@ function shouldShowZoneName(format, hasMultipleZones, isNamedZone) {
|
|
|
189
197
|
if (format === "date_time" || format === "time") return hasMultipleZones || isNamedZone;
|
|
190
198
|
return false;
|
|
191
199
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
200
|
+
/**
|
|
201
|
+
* 没写 `timezoneID` 的行跟随 `defaultTimezoneID`(已经解析过的,Timestamp 自己的 `timezoneID`),
|
|
202
|
+
* 写了 `'local'` 的行仍然是观看者的时区。固定下来的时区算一个时区,
|
|
203
|
+
* 所以挨着它的观看者时区那一行会带上缩写。
|
|
204
|
+
*/
|
|
205
|
+
function formatTooltipLines(date, entries, locale, defaultTimezoneID) {
|
|
206
|
+
const resolved = entries.map((entry) => entry.timezoneID === void 0 ? defaultTimezoneID : resolveTimezoneID(entry.timezoneID));
|
|
207
|
+
const zoneKeys = new Set(resolved.map(zoneKey));
|
|
208
|
+
if (defaultTimezoneID !== void 0) zoneKeys.add(zoneKey(defaultTimezoneID));
|
|
209
|
+
const hasMultipleZones = zoneKeys.size > 1;
|
|
195
210
|
return entries.map((entry, index) => {
|
|
196
211
|
const format = entry.format ?? "full";
|
|
197
212
|
const timeZone = resolved[index];
|
|
198
213
|
return {
|
|
199
214
|
...entry.label == null ? {} : { label: entry.label },
|
|
200
215
|
isCopyable: entry.isCopyable ?? false,
|
|
216
|
+
zoneName: longZoneName(date, locale, timeZone),
|
|
201
217
|
value: formatInstant(date, format, locale, {
|
|
202
218
|
timeZone,
|
|
203
219
|
isTimezoneShown: shouldShowZoneName(format, hasMultipleZones, timeZone != null)
|
|
@@ -206,13 +222,59 @@ function formatTooltipLines(date, entries, locale) {
|
|
|
206
222
|
});
|
|
207
223
|
}
|
|
208
224
|
//#endregion
|
|
225
|
+
//#region src/Timestamp/useRefreshHold.ts
|
|
226
|
+
/** 名字来自内容的控件。 */
|
|
227
|
+
const NAMED_FROM_CONTENT = "button,summary,a[href],[role=button],[role=link],[role=tab],[role^=menuitem],[role=option],[role=radio],[role=checkbox],[role=switch],[role=treeitem]";
|
|
228
|
+
/**
|
|
229
|
+
* `focused` 是不是时间本身,或者是名字有这段时间参与的控件:
|
|
230
|
+
* 没有自己名字、名字来自内容的控件,或者包着这段时间的 label 所指的控件。
|
|
231
|
+
* 只是装着这段时间的日志、滚动区域不算。
|
|
232
|
+
*/
|
|
233
|
+
function focusIsNamedBy(time, focused) {
|
|
234
|
+
if (focused == null) return false;
|
|
235
|
+
if (focused === time) return true;
|
|
236
|
+
if (focused.contains(time) && focused.matches(NAMED_FROM_CONTENT) && !focused.matches("[aria-label],[aria-labelledby]")) return true;
|
|
237
|
+
return time.closest("label")?.control === focused;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* 实时刷新的相对时间:时间本身,或者名字有它参与的控件拿着焦点时,刷新先等着,
|
|
241
|
+
* 免得控件名字里的字在读屏眼皮底下一直变,名字也不再包含它看得见的字。
|
|
242
|
+
* 焦点离开时补一次刷新。返回的函数在每次刷新前问一句现在能不能刷。
|
|
243
|
+
*/
|
|
244
|
+
function useRefreshHold(time, isActive, onRelease) {
|
|
245
|
+
let isHeld = false;
|
|
246
|
+
let stop = null;
|
|
247
|
+
function release() {
|
|
248
|
+
stop?.();
|
|
249
|
+
stop = null;
|
|
250
|
+
isHeld = false;
|
|
251
|
+
}
|
|
252
|
+
watch([time, isActive], ([element, active]) => {
|
|
253
|
+
release();
|
|
254
|
+
const doc = element?.ownerDocument;
|
|
255
|
+
if (!active || element == null || doc == null) return;
|
|
256
|
+
const sync = () => {
|
|
257
|
+
const holds = focusIsNamedBy(element, doc.activeElement);
|
|
258
|
+
const wasHeld = isHeld;
|
|
259
|
+
isHeld = holds;
|
|
260
|
+
if (wasHeld && !holds) onRelease();
|
|
261
|
+
};
|
|
262
|
+
sync();
|
|
263
|
+
doc.addEventListener("focusin", sync);
|
|
264
|
+
doc.addEventListener("focusout", sync);
|
|
265
|
+
stop = () => {
|
|
266
|
+
doc.removeEventListener("focusin", sync);
|
|
267
|
+
doc.removeEventListener("focusout", sync);
|
|
268
|
+
};
|
|
269
|
+
}, {
|
|
270
|
+
immediate: true,
|
|
271
|
+
flush: "post"
|
|
272
|
+
});
|
|
273
|
+
onBeforeUnmount(release);
|
|
274
|
+
return () => isHeld;
|
|
275
|
+
}
|
|
276
|
+
//#endregion
|
|
209
277
|
//#region src/Timestamp/Timestamp.vue
|
|
210
|
-
const _hoisted_1 = [
|
|
211
|
-
"datetime",
|
|
212
|
-
"aria-label",
|
|
213
|
-
"tabindex"
|
|
214
|
-
];
|
|
215
|
-
const _hoisted_2 = ["datetime", "aria-label"];
|
|
216
278
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
217
279
|
name: "AstryxTimestamp",
|
|
218
280
|
inheritAttrs: false,
|
|
@@ -220,6 +282,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
220
282
|
props: {
|
|
221
283
|
value: {},
|
|
222
284
|
format: { default: "auto" },
|
|
285
|
+
timezoneID: {},
|
|
223
286
|
autoThreshold: { default: 604800 },
|
|
224
287
|
hasTooltip: {
|
|
225
288
|
type: Boolean,
|
|
@@ -241,9 +304,11 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
241
304
|
},
|
|
242
305
|
setup(__props) {
|
|
243
306
|
const props = __props;
|
|
307
|
+
const attrs = useAttrs();
|
|
244
308
|
const locale = useAstryxLocale();
|
|
245
309
|
const messages = useComponentMessages({ timestamp: timestampMessages });
|
|
246
310
|
const now = ref(null);
|
|
311
|
+
const timeEl = useTemplateRef("time");
|
|
247
312
|
let timer;
|
|
248
313
|
function parseValue(value) {
|
|
249
314
|
if (typeof value === "number") return new Date(value < 0xe8d4a51000 ? value * 1e3 : value);
|
|
@@ -251,6 +316,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
251
316
|
}
|
|
252
317
|
const date = computed(() => parseValue(props.value));
|
|
253
318
|
const valid = computed(() => !Number.isNaN(date.value.getTime()));
|
|
319
|
+
/** 绝对文字所用的时区;不写或不认识就是观看者自己的时区。 */
|
|
320
|
+
const zone = computed(() => resolveTimezoneID(props.timezoneID, "timezoneID"));
|
|
254
321
|
const iso = computed(() => valid.value ? date.value.toISOString() : "");
|
|
255
322
|
function isRelative(format) {
|
|
256
323
|
return format === "relative" || format === "relative_short";
|
|
@@ -282,18 +349,23 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
282
349
|
return formatInstant(date.value, format, locale.value, isClockPending.value ? {
|
|
283
350
|
timeZone: "UTC",
|
|
284
351
|
isTimezoneShown: true
|
|
285
|
-
} : {
|
|
352
|
+
} : {
|
|
353
|
+
timeZone: zone.value,
|
|
354
|
+
isTimezoneShown: props.isTimezoneShown
|
|
355
|
+
});
|
|
286
356
|
});
|
|
287
|
-
|
|
357
|
+
/** 相对读数的名字:先是屏幕上显示的词,再是完整日期和时区全名,语音控制才找得到这段词。 */
|
|
358
|
+
const ariaLabel = computed(() => valid.value && isRelative(effectiveFormat.value) ? messages.value.timestamp.relativeLabel(displayText.value, formatInstant(date.value, "full", locale.value, { timeZoneNameStyle: "long" })) : void 0);
|
|
288
359
|
const entries = computed(() => props.tooltipEntries != null && props.tooltipEntries.length > 0 ? props.tooltipEntries : void 0);
|
|
289
360
|
const showTooltip = computed(() => props.hasTooltip && valid.value && (isRelative(effectiveFormat.value) || entries.value != null));
|
|
290
361
|
const lines = computed(() => {
|
|
291
362
|
if (!valid.value) return [];
|
|
292
363
|
if (entries.value == null) return [{
|
|
293
364
|
value: formatInstant(date.value, "full", locale.value),
|
|
294
|
-
isCopyable: true
|
|
365
|
+
isCopyable: true,
|
|
366
|
+
zoneName: longZoneName(date.value, locale.value)
|
|
295
367
|
}];
|
|
296
|
-
return formatTooltipLines(date.value, entries.value, locale.value);
|
|
368
|
+
return formatTooltipLines(date.value, entries.value, locale.value, zone.value);
|
|
297
369
|
});
|
|
298
370
|
const textColor = computed(() => props.color === "disabled" ? "inherit" : props.color);
|
|
299
371
|
function liveInterval(seconds) {
|
|
@@ -307,55 +379,33 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
307
379
|
clearInterval(timer);
|
|
308
380
|
timer = void 0;
|
|
309
381
|
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
], () => {
|
|
382
|
+
const isLiveRelative = computed(() => props.isLive && valid.value && isRelative(effectiveFormat.value));
|
|
383
|
+
const isRefreshHeld = useRefreshHold(timeEl, () => isLiveRelative.value, () => {
|
|
384
|
+
now.value = /* @__PURE__ */ new Date();
|
|
385
|
+
});
|
|
386
|
+
watch([isLiveRelative, diffSeconds], () => {
|
|
316
387
|
stop();
|
|
317
|
-
if (!
|
|
388
|
+
if (!isLiveRelative.value) return;
|
|
318
389
|
timer = setInterval(() => {
|
|
319
|
-
now.value = /* @__PURE__ */ new Date();
|
|
390
|
+
if (!isRefreshHeld()) now.value = /* @__PURE__ */ new Date();
|
|
320
391
|
}, liveInterval(diffSeconds.value));
|
|
321
392
|
}, { immediate: true });
|
|
322
393
|
onBeforeUnmount(stop);
|
|
394
|
+
/** 调用方写在组件上的属性落在 `<time>` 上;`aria-label` 和 `tabindex` 以调用方的为准。 */
|
|
395
|
+
function timeProps() {
|
|
396
|
+
const { class: _class, style: _style, ...rest } = attrs;
|
|
397
|
+
const callerTabindex = rest.tabindex ?? rest.tabIndex;
|
|
398
|
+
return {
|
|
399
|
+
...rest,
|
|
400
|
+
"class": "astryx-timestamp__time",
|
|
401
|
+
"datetime": iso.value,
|
|
402
|
+
"aria-label": rest["aria-label"] ?? ariaLabel.value,
|
|
403
|
+
"tabindex": callerTabindex ?? (showTooltip.value ? 0 : void 0)
|
|
404
|
+
};
|
|
405
|
+
}
|
|
323
406
|
return (_ctx, _cache) => {
|
|
324
|
-
return valid.value
|
|
407
|
+
return valid.value ? (openBlock(), createBlock(_sfc_main$3, {
|
|
325
408
|
key: 0,
|
|
326
|
-
lines: lines.value,
|
|
327
|
-
label: unref(messages).timestamp.detailsLabel
|
|
328
|
-
}, {
|
|
329
|
-
default: withCtx(() => [createVNode(_sfc_main$3, {
|
|
330
|
-
class: normalizeClass(["astryx-timestamp", _ctx.$attrs.class]),
|
|
331
|
-
style: normalizeStyle(_ctx.$attrs.style),
|
|
332
|
-
type: __props.type,
|
|
333
|
-
size: __props.size,
|
|
334
|
-
color: textColor.value,
|
|
335
|
-
weight: __props.weight,
|
|
336
|
-
"data-color": __props.color,
|
|
337
|
-
"data-format": effectiveFormat.value
|
|
338
|
-
}, {
|
|
339
|
-
default: withCtx(() => [createElementVNode("time", {
|
|
340
|
-
class: "astryx-timestamp__time",
|
|
341
|
-
datetime: iso.value,
|
|
342
|
-
"aria-label": ariaLabel.value,
|
|
343
|
-
tabindex: showTooltip.value ? 0 : void 0
|
|
344
|
-
}, toDisplayString(displayText.value), 9, _hoisted_1)]),
|
|
345
|
-
_: 1
|
|
346
|
-
}, 8, [
|
|
347
|
-
"class",
|
|
348
|
-
"style",
|
|
349
|
-
"type",
|
|
350
|
-
"size",
|
|
351
|
-
"color",
|
|
352
|
-
"weight",
|
|
353
|
-
"data-color",
|
|
354
|
-
"data-format"
|
|
355
|
-
])]),
|
|
356
|
-
_: 1
|
|
357
|
-
}, 8, ["lines", "label"])) : valid.value ? (openBlock(), createBlock(_sfc_main$3, {
|
|
358
|
-
key: 1,
|
|
359
409
|
class: normalizeClass(["astryx-timestamp", _ctx.$attrs.class]),
|
|
360
410
|
style: normalizeStyle(_ctx.$attrs.style),
|
|
361
411
|
type: __props.type,
|
|
@@ -365,11 +415,17 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
365
415
|
"data-color": __props.color,
|
|
366
416
|
"data-format": effectiveFormat.value
|
|
367
417
|
}, {
|
|
368
|
-
default: withCtx(() => [
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
},
|
|
418
|
+
default: withCtx(() => [showTooltip.value ? (openBlock(), createBlock(_sfc_main$1, {
|
|
419
|
+
key: 0,
|
|
420
|
+
lines: lines.value,
|
|
421
|
+
label: unref(messages).timestamp.detailsLabel
|
|
422
|
+
}, {
|
|
423
|
+
default: withCtx(() => [createElementVNode("time", mergeProps({ ref: "time" }, timeProps()), toDisplayString(displayText.value), 17)]),
|
|
424
|
+
_: 1
|
|
425
|
+
}, 8, ["lines", "label"])) : (openBlock(), createElementBlock("time", mergeProps({
|
|
426
|
+
key: 1,
|
|
427
|
+
ref: "time"
|
|
428
|
+
}, timeProps()), toDisplayString(displayText.value), 17))]),
|
|
373
429
|
_: 1
|
|
374
430
|
}, 8, [
|
|
375
431
|
"class",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as ToggleButtonEmits, B as ToggleButtonPressedChangeHandler, D as _default, E as _default$1, F as ToggleButtonGroupProps, H as ToggleButtonSize, I as ToggleButtonGroupSingleProps, L as ToggleButtonGroupSlots, M as ToggleButtonGroupEmits, N as ToggleButtonGroupMultipleProps, O as ToggleButtonChangeAction, P as ToggleButtonGroupOrientation, R as ToggleButtonGroupType, U as ToggleButtonSlots, V as ToggleButtonProps, j as ToggleButtonGroupBaseProps, k as ToggleButtonElevation, z as ToggleButtonGroupValue } from "../index-
|
|
1
|
+
import { A as ToggleButtonEmits, B as ToggleButtonPressedChangeHandler, D as _default, E as _default$1, F as ToggleButtonGroupProps, H as ToggleButtonSize, I as ToggleButtonGroupSingleProps, L as ToggleButtonGroupSlots, M as ToggleButtonGroupEmits, N as ToggleButtonGroupMultipleProps, O as ToggleButtonChangeAction, P as ToggleButtonGroupOrientation, R as ToggleButtonGroupType, U as ToggleButtonSlots, V as ToggleButtonProps, j as ToggleButtonGroupBaseProps, k as ToggleButtonElevation, z as ToggleButtonGroupValue } from "../index-ohw86wfM.js";
|
|
2
2
|
export { _default as ToggleButton, _default as default, type ToggleButtonChangeAction, type ToggleButtonElevation, type ToggleButtonEmits, _default$1 as ToggleButtonGroup, type ToggleButtonGroupBaseProps, type ToggleButtonGroupEmits, type ToggleButtonGroupMultipleProps, type ToggleButtonGroupOrientation, type ToggleButtonGroupProps, type ToggleButtonGroupSingleProps, type ToggleButtonGroupSlots, type ToggleButtonGroupType, type ToggleButtonGroupValue, type ToggleButtonPressedChangeHandler, type ToggleButtonProps, type ToggleButtonSize, type ToggleButtonSlots };
|
package/dist/Toolbar/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { T as _default } from "../index-
|
|
1
|
+
import { T as _default } from "../index-ohw86wfM.js";
|
|
2
2
|
import { et as ToolbarOrientation, nt as ToolbarSize, tt as ToolbarProps } from "../useResizable-CJd4JkbJ.js";
|
|
3
3
|
export { _default as Toolbar, type ToolbarOrientation, type ToolbarProps, type ToolbarSize };
|
package/dist/Tooltip/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as TooltipAlignment, c as TooltipProps, i as _default, l as TooltipTouchTrigger, n as UseTooltipReturn, o as TooltipFocusTrigger, r as useTooltip, s as TooltipPlacement, t as UseTooltipOptions } from "../index-
|
|
1
|
+
import { a as TooltipAlignment, c as TooltipProps, i as _default, l as TooltipTouchTrigger, n as UseTooltipReturn, o as TooltipFocusTrigger, r as useTooltip, s as TooltipPlacement, t as UseTooltipOptions } from "../index-eCp-ElSp.js";
|
|
2
2
|
export { _default as Tooltip, type TooltipAlignment, type TooltipFocusTrigger, type TooltipPlacement, type TooltipProps, type TooltipTouchTrigger, type UseTooltipOptions, type UseTooltipReturn, useTooltip };
|
package/dist/TopNav/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as TopNavMenuProps, S as TopNavMenuItem, _ as TopNavMegaMenuEmits, b as TopNavMegaMenuProps, c as _default$5, d as _default$2, f as _default$1, g as TopNavItemProps, h as TopNavItemEmits, l as _default$4, m as TopNavHeadingProps, p as _default, s as _default$6, u as _default$3, v as TopNavMegaMenuFeaturedCardProps, w as TopNavProps, x as TopNavMenuEmits, y as TopNavMegaMenuItemProps } from "../index-
|
|
1
|
+
import { C as TopNavMenuProps, S as TopNavMenuItem, _ as TopNavMegaMenuEmits, b as TopNavMegaMenuProps, c as _default$5, d as _default$2, f as _default$1, g as TopNavItemProps, h as TopNavItemEmits, l as _default$4, m as TopNavHeadingProps, p as _default, s as _default$6, u as _default$3, v as TopNavMegaMenuFeaturedCardProps, w as TopNavProps, x as TopNavMenuEmits, y as TopNavMegaMenuItemProps } from "../index-ohw86wfM.js";
|
|
2
2
|
export { _default as TopNav, _default$1 as TopNavHeading, type TopNavHeadingProps, _default$2 as TopNavItem, type TopNavItemEmits, type TopNavItemProps, _default$3 as TopNavMegaMenu, type TopNavMegaMenuEmits, _default$4 as TopNavMegaMenuFeaturedCard, type TopNavMegaMenuFeaturedCardProps, _default$5 as TopNavMegaMenuItem, type TopNavMegaMenuItemProps, type TopNavMegaMenuProps, _default$6 as TopNavMenu, type TopNavMenuEmits, type TopNavMenuItem, type TopNavMenuProps, type TopNavProps };
|