@astryx-vue/core 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/Banner/index.d.ts +1 -1
- package/dist/Button/index.d.ts +1 -1
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/Calendar/index.js +1 -1
- package/dist/{Calendar-DpYFXwgb.js → Calendar-BEyrkUtr.js} +2 -1
- package/dist/Chat/index.js +1 -1
- package/dist/{Chat-Bfd-YPAK.js → Chat-CO3mCs9A.js} +2 -2
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxList/index.d.ts +2 -0
- package/dist/CheckboxList/index.js +2 -0
- package/dist/CheckboxList-BL2sDOWK.js +174 -0
- package/dist/Citation/index.js +1 -1
- package/dist/{Citation-DaDd1teb.js → Citation-BqwJvw7o.js} +2 -2
- package/dist/Code/index.js +1 -1
- package/dist/{CodeBlock-CK-NWM_1.js → CodeBlock-BQdooQy2.js} +1 -1
- package/dist/Collapsible/index.js +1 -1
- package/dist/{Collapsible-ByXCGhT8.js → Collapsible-BYg9soTk.js} +1 -1
- package/dist/ContextMenu/index.d.ts +1 -1
- package/dist/ContextMenu/index.js +1 -1
- package/dist/{ContextMenu-BJh99Exj.js → ContextMenu-dA-ppaRQ.js} +284 -12
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.js +1 -1
- package/dist/{DateInput-zJAdXByM.js → DateInput-BOIb0zAp.js} +18 -10
- package/dist/DateRangeInput/index.d.ts +2 -0
- package/dist/DateRangeInput/index.js +2 -0
- package/dist/DateRangeInput-DLcbgUBi.js +385 -0
- package/dist/DateTimeInput/index.d.ts +2 -0
- package/dist/DateTimeInput/index.js +2 -0
- package/dist/DateTimeInput-RitYX_Yx.js +196 -0
- package/dist/Divider/index.d.ts +1 -1
- package/dist/DropdownMenu/index.d.ts +1 -1
- package/dist/DropdownMenu/index.js +1 -1
- package/dist/{DropdownMenu-C3j2zaEn.js → DropdownMenu-B0gogrvG.js} +2 -2
- package/dist/Field/index.d.ts +2 -2
- package/dist/Field/index.js +1 -2
- package/dist/FieldStatus/index.d.ts +2 -0
- package/dist/FieldStatus/index.js +2 -0
- package/dist/FileInput/index.d.ts +2 -0
- package/dist/FileInput/index.js +2 -0
- package/dist/FileInput-CYvEV503.js +238 -0
- package/dist/{Icon-B6qNgBP9.js → Icon-5MdZQ18k.js} +10 -2
- package/dist/List/index.d.ts +1 -1
- package/dist/Markdown/index.d.ts +1 -1
- package/dist/Markdown/index.js +1 -1
- package/dist/{Markdown-DyKIwAL_.js → Markdown-Dnlp8cVx.js} +2 -2
- package/dist/MetadataList/index.d.ts +2 -0
- package/dist/MetadataList/index.js +2 -0
- package/dist/MetadataList-DIsqS1Qb.js +124 -0
- package/dist/MobileNav/index.js +1 -1
- package/dist/{MobileNavToggle-BK2iRJF-.js → MobileNavToggle-aUZiDwHm.js} +1 -1
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MoreMenu/index.js +1 -1
- package/dist/{MoreMenu-BjUsVWWk.js → MoreMenu-BXL6Dqsu.js} +2 -2
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/MultiSelector/index.js +1 -1
- package/dist/{MultiSelector-CKTbTj1A.js → MultiSelector-Bh8or2S6.js} +2 -2
- package/dist/NavItem/index.d.ts +1 -1
- package/dist/NavMenu/index.d.ts +1 -1
- package/dist/NumberInput/index.d.ts +1 -1
- package/dist/NumberInput/index.js +1 -1
- package/dist/{NumberInput-DU3_rw7z.js → NumberInput-C3S-4dIu.js} +1 -1
- package/dist/OverflowList/index.d.ts +1 -1
- package/dist/OverflowList/index.js +1 -1
- package/dist/{OverflowList-B2T5UtiQ.js → OverflowList-Kr4iJrNV.js} +1 -1
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-qCgNwwhr.js → Pagination-BRStpeSB.js} +2 -2
- package/dist/Popover/index.d.ts +1 -1
- package/dist/Radio/index.d.ts +2 -2
- package/dist/Radio/index.js +2 -2
- package/dist/{Radio-BioQfwHQ.js → RadioGroup-DS6oTV_j.js} +21 -88
- package/dist/RadioList/index.d.ts +2 -0
- package/dist/RadioList/index.js +2 -0
- package/dist/RadioList-pwr93I-z.js +122 -0
- package/dist/SegmentedControl/index.d.ts +1 -1
- package/dist/Selector/index.d.ts +1 -1
- package/dist/Selector/index.js +1 -1
- package/dist/{Selector-C6sPJMtH.js → Selector-DvEUIVEC.js} +1 -1
- package/dist/SideNav/index.d.ts +1 -1
- package/dist/SideNav/index.js +1 -1
- package/dist/{SideNav-D9lnn-sM.js → SideNav-B7LX4RcP.js} +2 -2
- package/dist/Stack/index.d.ts +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/Table/index.d.ts +2 -0
- package/dist/Table/index.js +2 -0
- package/dist/Table-D5zWaITo.js +967 -0
- package/dist/Text/index.d.ts +1 -1
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/Thumbnail/index.d.ts +2 -0
- package/dist/Thumbnail/index.js +2 -0
- package/dist/Thumbnail-DMOgWncm.js +163 -0
- package/dist/TimeField-DeQ1ukHl.js +214 -0
- package/dist/TimeInput/index.d.ts +2 -0
- package/dist/TimeInput/index.js +2 -0
- package/dist/TimeInput-jb1nLqZk.js +121 -0
- package/dist/Timestamp/index.d.ts +2 -0
- package/dist/Timestamp/index.js +2 -0
- package/dist/Timestamp-DrWwVQBL.js +465 -0
- package/dist/ToggleButton/index.d.ts +1 -1
- package/dist/Token/index.d.ts +1 -1
- package/dist/Token/index.js +1 -1
- package/dist/{Token-Ctf9jekS.js → Token-CV2J94bn.js} +1 -1
- package/dist/Tokenizer/index.d.ts +1 -1
- package/dist/Tokenizer/index.js +1 -1
- package/dist/{Tokenizer-D5MPgau0.js → Tokenizer-DF9r4hTW.js} +2 -2
- package/dist/Toolbar/index.d.ts +1 -1
- package/dist/TopNav/index.d.ts +1 -1
- package/dist/TopNav/index.js +1 -1
- package/dist/{TopNav-CjbMCbkC.js → TopNav-BH_s3uap.js} +3 -3
- package/dist/TreeList/index.d.ts +2 -0
- package/dist/TreeList/index.js +2 -0
- package/dist/TreeList-D9cR-w7r.js +506 -0
- package/dist/Typeahead/index.d.ts +1 -1
- package/dist/Typeahead/index.js +1 -1
- package/dist/{Typeahead-BMoU3hfx.js → Typeahead-s4DC1Qem.js} +2 -2
- package/dist/composables/index.d.ts +2 -2
- package/dist/composables/index.js +4 -1
- package/dist/{locale-56lkR7OK.js → context-BshXcNYX.js} +183 -18
- package/dist/{index-DjOdQv5B.d.ts → index--dh0s8Li.d.ts} +1 -1
- package/dist/{index-Cdi82rTW.d.ts → index-12ObcW99.d.ts} +6 -2
- package/dist/{index-JeZ0YTyd.d.ts → index-5R_pi3eT.d.ts} +2 -2
- package/dist/{index-Cc2HGODZ.d.ts → index-AkMWQ97a.d.ts} +3 -3
- package/dist/{index-CvLlWLIZ.d.ts → index-B4OOtNP8.d.ts} +4 -4
- package/dist/{index-_1-uvr27.d.ts → index-B8MbfMwV.d.ts} +1 -1
- package/dist/{index-MPcg1Pm4.d.ts → index-BKr7yvVv.d.ts} +1 -1
- package/dist/{index-CxspvLBl.d.ts → index-Bc0dgVM5.d.ts} +5 -5
- package/dist/{index-4FM5lQdV.d.ts → index-BlWLperN.d.ts} +1 -1
- package/dist/{index-DBcbfStA.d.ts → index-BnNh5Iml.d.ts} +84 -1
- package/dist/{index-Cp0NlzQv.d.ts → index-Bovw9_8d.d.ts} +1 -1
- package/dist/{index-CnVbMebA.d.ts → index-Bqb_Fyju.d.ts} +3 -3
- package/dist/{index-HV6W3xCx.d.ts → index-Byar3h1e.d.ts} +1 -1
- package/dist/{index-BQuN_dWR.d.ts → index-BzqRns96.d.ts} +1 -1
- package/dist/{index-C0S2Xzoi.d.ts → index-CNcQmDrK.d.ts} +93 -0
- package/dist/{index-CaHXYQ_E.d.ts → index-CQ9F1f_F.d.ts} +535 -137
- package/dist/index-CR6sUmRT.d.ts +356 -0
- package/dist/index-C_2Z65Rp.d.ts +67 -0
- package/dist/{index-Dw21t7Uf.d.ts → index-CsJpQElv.d.ts} +1 -1
- package/dist/index-CtlkhQ55.d.ts +36 -0
- package/dist/{index-C8NW9xre.d.ts → index-D3V7yRUP.d.ts} +7 -7
- package/dist/index-Da7Jm8Ht.d.ts +10 -0
- package/dist/{index-CPhDtlv-.d.ts → index-FEy8qFSD.d.ts} +3 -3
- package/dist/{index-BeJqhW4l.d.ts → index-Q4gqBSIZ.d.ts} +2 -2
- package/dist/{index-Cz9ZHVf6.d.ts → index-g03bmR4K.d.ts} +3 -3
- package/dist/{index-COxy6LEW.d.ts → index-gW0HW02U.d.ts} +1 -1
- package/dist/{index-BQa836Vz.d.ts → index-iBLzInje.d.ts} +6 -14
- package/dist/index-utZGF4GR.d.ts +79 -0
- package/dist/index.d.ts +54 -49
- package/dist/index.js +86 -64
- package/dist/locale/index.d.ts +1 -1
- package/dist/locale/index.js +2 -1
- package/dist/locale-Cpk_nrLA.js +18 -0
- package/dist/useFileSelection-BPtaegqK.js +58 -0
- package/dist/useMonthGrid-CmJsZTcB.js +139 -0
- package/dist/useTimeValue-DWk6oTAZ.js +113 -0
- package/package.json +49 -1
- package/styles/bordered-control.css +87 -0
- package/styles/calendar.css +8 -2
- package/styles/checkbox-list.css +15 -0
- package/styles/date-range-input.css +163 -0
- package/styles/date-time-input.css +40 -0
- package/styles/field.css +2 -3
- package/styles/file-input.css +87 -0
- package/styles/icon.css +32 -0
- package/styles/metadata-list.css +107 -0
- package/styles/number-input.css +6 -0
- package/styles/radio.css +32 -0
- package/styles/selector.css +10 -0
- package/styles/table.css +256 -0
- package/styles/text-area.css +6 -1
- package/styles/text-input.css +6 -0
- package/styles/thumbnail.css +151 -0
- package/styles/time-input.css +51 -0
- package/styles/timestamp.css +93 -0
- package/styles/tree-list.css +229 -0
- package/styles.css +11 -0
package/dist/Text/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as TextProps, c as TextWeight, i as TextDisplay, n as TextAs, o as TextSize, r as TextColor, s as TextType, t as _default } from "../index-
|
|
1
|
+
import { a as TextProps, c as TextWeight, i as TextDisplay, n as TextAs, o as TextSize, r as TextColor, s as TextType, t as _default } from "../index-BzqRns96.js";
|
|
2
2
|
export { _default as Text, type TextAs, type TextColor, type TextDisplay, type TextProps, type TextSize, type TextType, type TextWeight };
|
package/dist/TextArea/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
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-CQ9F1f_F.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 {
|
|
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-CQ9F1f_F.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 };
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { t as _sfc_main$1 } from "./IconButton-BNQuz9W_.js";
|
|
2
|
+
import { a as useAstryxMessages } from "./context-BshXcNYX.js";
|
|
3
|
+
import { t as _sfc_main$2 } from "./Icon-5MdZQ18k.js";
|
|
4
|
+
import { t as _sfc_main$3 } from "./Spinner-9cYUCnDy.js";
|
|
5
|
+
import { t as _sfc_main$4 } from "./Tooltip-mp0NMh_Y.js";
|
|
6
|
+
import { t as _sfc_main$5 } from "./Skeleton-CrgWxJgr.js";
|
|
7
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, getCurrentInstance, normalizeClass, normalizeStyle, openBlock, ref, unref, watch, withCtx } from "vue";
|
|
8
|
+
import "../styles/thumbnail.css";
|
|
9
|
+
//#region src/Thumbnail/Thumbnail.vue
|
|
10
|
+
const _hoisted_1 = ["data-disabled", "aria-label"];
|
|
11
|
+
const _hoisted_2 = { class: "astryx-thumbnail__frame" };
|
|
12
|
+
const _hoisted_3 = ["aria-label"];
|
|
13
|
+
const _hoisted_4 = [
|
|
14
|
+
"src",
|
|
15
|
+
"alt",
|
|
16
|
+
"role",
|
|
17
|
+
"aria-hidden"
|
|
18
|
+
];
|
|
19
|
+
const _hoisted_5 = {
|
|
20
|
+
key: 2,
|
|
21
|
+
class: "astryx-thumbnail__placeholder"
|
|
22
|
+
};
|
|
23
|
+
const _hoisted_6 = [
|
|
24
|
+
"src",
|
|
25
|
+
"alt",
|
|
26
|
+
"role",
|
|
27
|
+
"aria-hidden"
|
|
28
|
+
];
|
|
29
|
+
const _hoisted_7 = {
|
|
30
|
+
key: 2,
|
|
31
|
+
class: "astryx-thumbnail__placeholder"
|
|
32
|
+
};
|
|
33
|
+
const _hoisted_8 = {
|
|
34
|
+
key: 2,
|
|
35
|
+
class: "astryx-thumbnail__border"
|
|
36
|
+
};
|
|
37
|
+
const _hoisted_9 = {
|
|
38
|
+
key: 3,
|
|
39
|
+
class: "astryx-thumbnail__loading"
|
|
40
|
+
};
|
|
41
|
+
const _hoisted_10 = ["data-reveal"];
|
|
42
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
43
|
+
name: "AstryxThumbnail",
|
|
44
|
+
inheritAttrs: false,
|
|
45
|
+
__name: "Thumbnail",
|
|
46
|
+
props: {
|
|
47
|
+
src: {},
|
|
48
|
+
alt: {},
|
|
49
|
+
label: {},
|
|
50
|
+
isLoading: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: false
|
|
53
|
+
},
|
|
54
|
+
isDisabled: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: false
|
|
57
|
+
},
|
|
58
|
+
showRemoveOn: { default: "hover" }
|
|
59
|
+
},
|
|
60
|
+
emits: ["remove", "click"],
|
|
61
|
+
setup(__props, { emit: __emit }) {
|
|
62
|
+
const props = __props;
|
|
63
|
+
const emit = __emit;
|
|
64
|
+
const messages = useAstryxMessages();
|
|
65
|
+
const failedSrc = ref();
|
|
66
|
+
const instance = getCurrentInstance();
|
|
67
|
+
watch(() => props.src, () => {
|
|
68
|
+
failedSrc.value = void 0;
|
|
69
|
+
});
|
|
70
|
+
function hasListener(name) {
|
|
71
|
+
return instance?.vnode.props?.[name] != null;
|
|
72
|
+
}
|
|
73
|
+
const hasSrc = computed(() => props.src != null && props.src !== "");
|
|
74
|
+
const hasError = computed(() => hasSrc.value && failedSrc.value === props.src);
|
|
75
|
+
const showSkeleton = computed(() => props.isLoading && !hasSrc.value);
|
|
76
|
+
const showImage = computed(() => hasSrc.value && !showSkeleton.value && !hasError.value);
|
|
77
|
+
const showUpload = computed(() => props.isLoading && hasSrc.value);
|
|
78
|
+
const showPlaceholder = computed(() => !props.isLoading && !hasSrc.value || Boolean(hasError.value));
|
|
79
|
+
const accessibleName = computed(() => {
|
|
80
|
+
if (props.label && props.alt) return `${props.label} — ${props.alt}`;
|
|
81
|
+
return props.label ?? props.alt ?? messages.value.thumbnail.fallbackName;
|
|
82
|
+
});
|
|
83
|
+
function onImageError() {
|
|
84
|
+
failedSrc.value = props.src;
|
|
85
|
+
}
|
|
86
|
+
function onOpen(event) {
|
|
87
|
+
emit("click", event);
|
|
88
|
+
}
|
|
89
|
+
function onRemove(event) {
|
|
90
|
+
event.stopPropagation();
|
|
91
|
+
emit("remove", event);
|
|
92
|
+
}
|
|
93
|
+
return (_ctx, _cache) => {
|
|
94
|
+
return openBlock(), createBlock(_sfc_main$4, {
|
|
95
|
+
content: __props.label ?? "",
|
|
96
|
+
"is-enabled": __props.label != null,
|
|
97
|
+
"has-hover-indication": false
|
|
98
|
+
}, {
|
|
99
|
+
default: withCtx(() => [createElementVNode("div", {
|
|
100
|
+
class: normalizeClass(["astryx-thumbnail", _ctx.$attrs.class]),
|
|
101
|
+
style: normalizeStyle(_ctx.$attrs.style),
|
|
102
|
+
"data-disabled": __props.isDisabled || void 0,
|
|
103
|
+
role: "group",
|
|
104
|
+
"aria-label": accessibleName.value
|
|
105
|
+
}, [createElementVNode("div", _hoisted_2, [
|
|
106
|
+
hasListener("onClick") && !__props.isDisabled && !__props.isLoading ? (openBlock(), createElementBlock("button", {
|
|
107
|
+
key: 0,
|
|
108
|
+
type: "button",
|
|
109
|
+
class: "astryx-thumbnail__open",
|
|
110
|
+
"aria-label": unref(messages).thumbnail.open(accessibleName.value),
|
|
111
|
+
onClick: onOpen
|
|
112
|
+
}, [showImage.value ? (openBlock(), createElementBlock("img", {
|
|
113
|
+
key: 0,
|
|
114
|
+
class: "astryx-thumbnail__image",
|
|
115
|
+
src: __props.src,
|
|
116
|
+
alt: __props.alt ?? "",
|
|
117
|
+
role: __props.alt ? void 0 : "presentation",
|
|
118
|
+
"aria-hidden": __props.alt ? void 0 : "true",
|
|
119
|
+
onError: onImageError
|
|
120
|
+
}, null, 40, _hoisted_4)) : showSkeleton.value ? (openBlock(), createBlock(_sfc_main$5, {
|
|
121
|
+
key: 1,
|
|
122
|
+
radius: 2
|
|
123
|
+
})) : showPlaceholder.value ? (openBlock(), createElementBlock("span", _hoisted_5, [createVNode(_sfc_main$2, { icon: "image" })])) : createCommentVNode("v-if", true)], 8, _hoisted_3)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [showImage.value ? (openBlock(), createElementBlock("img", {
|
|
124
|
+
key: 0,
|
|
125
|
+
class: "astryx-thumbnail__image",
|
|
126
|
+
src: __props.src,
|
|
127
|
+
alt: __props.alt ?? "",
|
|
128
|
+
role: __props.alt ? void 0 : "presentation",
|
|
129
|
+
"aria-hidden": __props.alt ? void 0 : "true",
|
|
130
|
+
onError: onImageError
|
|
131
|
+
}, null, 40, _hoisted_6)) : showSkeleton.value ? (openBlock(), createBlock(_sfc_main$5, {
|
|
132
|
+
key: 1,
|
|
133
|
+
radius: 2
|
|
134
|
+
})) : showPlaceholder.value ? (openBlock(), createElementBlock("span", _hoisted_7, [createVNode(_sfc_main$2, { icon: "image" })])) : createCommentVNode("v-if", true)], 64)),
|
|
135
|
+
showImage.value ? (openBlock(), createElementBlock("span", _hoisted_8)) : createCommentVNode("v-if", true),
|
|
136
|
+
showUpload.value ? (openBlock(), createElementBlock("span", _hoisted_9, [createVNode(_sfc_main$3, {
|
|
137
|
+
size: "sm",
|
|
138
|
+
shade: "onMedia"
|
|
139
|
+
})])) : createCommentVNode("v-if", true),
|
|
140
|
+
hasListener("onRemove") && !__props.isDisabled ? (openBlock(), createElementBlock("span", {
|
|
141
|
+
key: 4,
|
|
142
|
+
class: "astryx-thumbnail__remove",
|
|
143
|
+
"data-reveal": __props.showRemoveOn
|
|
144
|
+
}, [createVNode(_sfc_main$1, {
|
|
145
|
+
variant: "secondary",
|
|
146
|
+
size: "sm",
|
|
147
|
+
label: unref(messages).thumbnail.remove(accessibleName.value),
|
|
148
|
+
onClick: onRemove
|
|
149
|
+
}, {
|
|
150
|
+
default: withCtx(() => [createVNode(_sfc_main$2, {
|
|
151
|
+
icon: "close",
|
|
152
|
+
size: "sm"
|
|
153
|
+
})]),
|
|
154
|
+
_: 1
|
|
155
|
+
}, 8, ["label"])], 8, _hoisted_10)) : createCommentVNode("v-if", true)
|
|
156
|
+
])], 14, _hoisted_1)]),
|
|
157
|
+
_: 1
|
|
158
|
+
}, 8, ["content", "is-enabled"]);
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
//#endregion
|
|
163
|
+
export { _sfc_main as t };
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { c as useCoarsePointer, i as parseDisplayTime, o as resolveTimeSurface, r as isTimeInRange, s as shiftTime, t as formatDisplayTime } from "./useTimeValue-DWk6oTAZ.js";
|
|
2
|
+
import { t as _sfc_main$1 } from "./FieldIcon--NTgW5IU.js";
|
|
3
|
+
import { t as _sfc_main$2 } from "./IconButton-BNQuz9W_.js";
|
|
4
|
+
import { a as useAstryxMessages } from "./context-BshXcNYX.js";
|
|
5
|
+
import { t as _sfc_main$3 } from "./Icon-5MdZQ18k.js";
|
|
6
|
+
import { computed, createBlock, createCommentVNode, createElementBlock, createVNode, defineComponent, mergeModels, openBlock, shallowRef, useModel, watch, withCtx } from "vue";
|
|
7
|
+
import "../styles/bordered-control.css";
|
|
8
|
+
import "../styles/time-input.css";
|
|
9
|
+
//#region src/TimeInput/TimeField.vue
|
|
10
|
+
const _hoisted_1 = [
|
|
11
|
+
"data-size",
|
|
12
|
+
"data-status",
|
|
13
|
+
"data-disabled"
|
|
14
|
+
];
|
|
15
|
+
const _hoisted_2 = [
|
|
16
|
+
"id",
|
|
17
|
+
"value",
|
|
18
|
+
"min",
|
|
19
|
+
"max",
|
|
20
|
+
"step",
|
|
21
|
+
"disabled",
|
|
22
|
+
"readonly",
|
|
23
|
+
"aria-label",
|
|
24
|
+
"aria-labelledby",
|
|
25
|
+
"aria-describedby",
|
|
26
|
+
"aria-required",
|
|
27
|
+
"aria-invalid"
|
|
28
|
+
];
|
|
29
|
+
const _hoisted_3 = [
|
|
30
|
+
"id",
|
|
31
|
+
"value",
|
|
32
|
+
"placeholder",
|
|
33
|
+
"disabled",
|
|
34
|
+
"readonly",
|
|
35
|
+
"aria-label",
|
|
36
|
+
"aria-labelledby",
|
|
37
|
+
"aria-describedby",
|
|
38
|
+
"aria-required",
|
|
39
|
+
"aria-invalid"
|
|
40
|
+
];
|
|
41
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
42
|
+
name: "AstryxTimeField",
|
|
43
|
+
inheritAttrs: false,
|
|
44
|
+
__name: "TimeField",
|
|
45
|
+
props: /*@__PURE__*/ mergeModels({
|
|
46
|
+
label: {},
|
|
47
|
+
inputId: {},
|
|
48
|
+
describedBy: {},
|
|
49
|
+
labelledBy: {},
|
|
50
|
+
placeholder: {},
|
|
51
|
+
hourFormat: { default: "12h" },
|
|
52
|
+
hasSeconds: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: false
|
|
55
|
+
},
|
|
56
|
+
increment: { default: 1 },
|
|
57
|
+
min: {},
|
|
58
|
+
max: {},
|
|
59
|
+
presentation: {},
|
|
60
|
+
nativePicker: {},
|
|
61
|
+
hasClear: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: false
|
|
64
|
+
},
|
|
65
|
+
clearLabel: {},
|
|
66
|
+
size: { default: "md" },
|
|
67
|
+
isDisabled: { type: Boolean },
|
|
68
|
+
isReadOnly: { type: Boolean },
|
|
69
|
+
isRequired: { type: Boolean },
|
|
70
|
+
status: {}
|
|
71
|
+
}, {
|
|
72
|
+
"modelValue": { default: null },
|
|
73
|
+
"modelModifiers": {}
|
|
74
|
+
}),
|
|
75
|
+
emits: ["update:modelValue"],
|
|
76
|
+
setup(__props) {
|
|
77
|
+
const props = __props;
|
|
78
|
+
const model = useModel(__props, "modelValue");
|
|
79
|
+
const messages = useAstryxMessages();
|
|
80
|
+
const coarse = useCoarsePointer();
|
|
81
|
+
const focused = shallowRef(false);
|
|
82
|
+
const draft = shallowRef("");
|
|
83
|
+
const surface = computed(() => resolveTimeSurface({
|
|
84
|
+
presentation: props.presentation,
|
|
85
|
+
nativePicker: props.nativePicker,
|
|
86
|
+
coarse: coarse.value,
|
|
87
|
+
hasSeconds: props.hasSeconds,
|
|
88
|
+
increment: props.increment
|
|
89
|
+
}));
|
|
90
|
+
const clearLabel = computed(() => props.clearLabel ?? messages.value.timeInput.clear(props.label));
|
|
91
|
+
const formatHint = computed(() => props.hourFormat === "24h" || props.hasSeconds ? messages.value.timeInput.formatHint24 : messages.value.timeInput.formatHint12);
|
|
92
|
+
watch(() => model.value, (value) => {
|
|
93
|
+
if (!focused.value) draft.value = value ? formatDisplayTime(value, props.hourFormat, props.hasSeconds) : "";
|
|
94
|
+
}, { immediate: true });
|
|
95
|
+
const shownPlaceholder = computed(() => {
|
|
96
|
+
if (focused.value && !draft.value) return formatHint.value;
|
|
97
|
+
return props.placeholder ?? messages.value.timeInput.placeholder;
|
|
98
|
+
});
|
|
99
|
+
function commit(value) {
|
|
100
|
+
model.value = value;
|
|
101
|
+
draft.value = value ? formatDisplayTime(value, props.hourFormat, props.hasSeconds) : "";
|
|
102
|
+
}
|
|
103
|
+
function commitText(text) {
|
|
104
|
+
if (!text.trim()) {
|
|
105
|
+
commit(null);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const parsed = parseDisplayTime(text, props.hasSeconds);
|
|
109
|
+
if (parsed == null || !isTimeInRange(parsed, props.min, props.max)) {
|
|
110
|
+
draft.value = model.value ? formatDisplayTime(model.value, props.hourFormat, props.hasSeconds) : "";
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
commit(parsed);
|
|
114
|
+
}
|
|
115
|
+
function onInput(event) {
|
|
116
|
+
draft.value = event.target.value;
|
|
117
|
+
}
|
|
118
|
+
function onNativeInput(event) {
|
|
119
|
+
const value = event.target.value;
|
|
120
|
+
if (!value) {
|
|
121
|
+
commit(null);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
const parsed = parseDisplayTime(value, props.hasSeconds);
|
|
125
|
+
if (parsed == null || !isTimeInRange(parsed, props.min, props.max)) return;
|
|
126
|
+
commit(parsed);
|
|
127
|
+
}
|
|
128
|
+
function onKeydown(event) {
|
|
129
|
+
if (props.isDisabled || props.isReadOnly) return;
|
|
130
|
+
if (event.key !== "ArrowUp" && event.key !== "ArrowDown") return;
|
|
131
|
+
event.preventDefault();
|
|
132
|
+
const delta = event.key === "ArrowUp" ? props.increment : -props.increment;
|
|
133
|
+
const next = shiftTime(model.value || "00:00", delta, props.hasSeconds);
|
|
134
|
+
if (isTimeInRange(next, props.min, props.max)) commit(next);
|
|
135
|
+
}
|
|
136
|
+
function onBlur() {
|
|
137
|
+
focused.value = false;
|
|
138
|
+
if (surface.value === "text") commitText(draft.value);
|
|
139
|
+
}
|
|
140
|
+
function clear() {
|
|
141
|
+
if (props.isDisabled || props.isReadOnly) return;
|
|
142
|
+
commit(null);
|
|
143
|
+
}
|
|
144
|
+
return (_ctx, _cache) => {
|
|
145
|
+
return openBlock(), createElementBlock("div", {
|
|
146
|
+
class: "astryx-time-input astryx-bordered-control",
|
|
147
|
+
"data-size": __props.size,
|
|
148
|
+
"data-status": __props.status?.type,
|
|
149
|
+
"data-disabled": __props.isDisabled || void 0
|
|
150
|
+
}, [
|
|
151
|
+
createVNode(_sfc_main$3, {
|
|
152
|
+
class: "astryx-time-input-icon",
|
|
153
|
+
icon: "clock",
|
|
154
|
+
size: "sm"
|
|
155
|
+
}),
|
|
156
|
+
surface.value === "native" ? (openBlock(), createElementBlock("input", {
|
|
157
|
+
key: 0,
|
|
158
|
+
id: __props.inputId,
|
|
159
|
+
class: "astryx-time-input-control",
|
|
160
|
+
type: "time",
|
|
161
|
+
value: model.value ?? "",
|
|
162
|
+
min: __props.min,
|
|
163
|
+
max: __props.max,
|
|
164
|
+
step: __props.hasSeconds ? 1 : __props.increment * 60,
|
|
165
|
+
disabled: __props.isDisabled,
|
|
166
|
+
readonly: __props.isReadOnly,
|
|
167
|
+
"aria-label": __props.labelledBy ? void 0 : __props.label,
|
|
168
|
+
"aria-labelledby": __props.labelledBy,
|
|
169
|
+
"aria-describedby": __props.describedBy,
|
|
170
|
+
"aria-required": __props.isRequired || void 0,
|
|
171
|
+
"aria-invalid": __props.status?.type === "error" || void 0,
|
|
172
|
+
onInput: onNativeInput
|
|
173
|
+
}, null, 40, _hoisted_2)) : (openBlock(), createElementBlock("input", {
|
|
174
|
+
key: 1,
|
|
175
|
+
id: __props.inputId,
|
|
176
|
+
class: "astryx-time-input-control",
|
|
177
|
+
type: "text",
|
|
178
|
+
inputmode: "text",
|
|
179
|
+
autocomplete: "off",
|
|
180
|
+
value: draft.value,
|
|
181
|
+
placeholder: shownPlaceholder.value,
|
|
182
|
+
disabled: __props.isDisabled,
|
|
183
|
+
readonly: __props.isReadOnly,
|
|
184
|
+
"aria-label": __props.labelledBy ? void 0 : __props.label,
|
|
185
|
+
"aria-labelledby": __props.labelledBy,
|
|
186
|
+
"aria-describedby": __props.describedBy,
|
|
187
|
+
"aria-required": __props.isRequired || void 0,
|
|
188
|
+
"aria-invalid": __props.status?.type === "error" || void 0,
|
|
189
|
+
onInput,
|
|
190
|
+
onFocus: _cache[0] || (_cache[0] = ($event) => focused.value = true),
|
|
191
|
+
onBlur,
|
|
192
|
+
onKeydown
|
|
193
|
+
}, null, 40, _hoisted_3)),
|
|
194
|
+
__props.hasClear && model.value && !__props.isDisabled && !__props.isReadOnly ? (openBlock(), createBlock(_sfc_main$2, {
|
|
195
|
+
key: 2,
|
|
196
|
+
class: "astryx-input-clear-button",
|
|
197
|
+
variant: "ghost",
|
|
198
|
+
size: "sm",
|
|
199
|
+
label: clearLabel.value,
|
|
200
|
+
onClick: clear
|
|
201
|
+
}, {
|
|
202
|
+
default: withCtx(() => [createVNode(_sfc_main$1, { type: "clear" })]),
|
|
203
|
+
_: 1
|
|
204
|
+
}, 8, ["label"])) : createCommentVNode("v-if", true),
|
|
205
|
+
__props.status ? (openBlock(), createBlock(_sfc_main$1, {
|
|
206
|
+
key: 3,
|
|
207
|
+
type: __props.status.type
|
|
208
|
+
}, null, 8, ["type"])) : createCommentVNode("v-if", true)
|
|
209
|
+
], 8, _hoisted_1);
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
//#endregion
|
|
214
|
+
export { _sfc_main as t };
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { t as _sfc_main$1 } from "./Field-VlTBsIEo.js";
|
|
2
|
+
import { t as _sfc_main$2 } from "./TimeField-DeQ1ukHl.js";
|
|
3
|
+
import { computed, createBlock, createVNode, defineComponent, mergeModels, openBlock, useId, useModel, withCtx } from "vue";
|
|
4
|
+
//#region src/TimeInput/TimeInput.vue
|
|
5
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
6
|
+
name: "AstryxTimeInput",
|
|
7
|
+
__name: "TimeInput",
|
|
8
|
+
props: /*@__PURE__*/ mergeModels({
|
|
9
|
+
label: {},
|
|
10
|
+
id: {},
|
|
11
|
+
description: {},
|
|
12
|
+
placeholder: {},
|
|
13
|
+
hourFormat: { default: "12h" },
|
|
14
|
+
hasSeconds: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: false
|
|
17
|
+
},
|
|
18
|
+
increment: { default: 1 },
|
|
19
|
+
min: {},
|
|
20
|
+
max: {},
|
|
21
|
+
presentation: {},
|
|
22
|
+
nativePicker: {},
|
|
23
|
+
hasClear: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: false
|
|
26
|
+
},
|
|
27
|
+
clearLabel: {},
|
|
28
|
+
size: { default: "md" },
|
|
29
|
+
isDisabled: { type: Boolean },
|
|
30
|
+
isReadOnly: { type: Boolean },
|
|
31
|
+
isRequired: { type: Boolean },
|
|
32
|
+
isOptional: { type: Boolean },
|
|
33
|
+
isLabelHidden: { type: Boolean },
|
|
34
|
+
status: {},
|
|
35
|
+
statusVariant: { default: "attached" },
|
|
36
|
+
width: {}
|
|
37
|
+
}, {
|
|
38
|
+
"modelValue": { default: null },
|
|
39
|
+
"modelModifiers": {}
|
|
40
|
+
}),
|
|
41
|
+
emits: /*@__PURE__*/ mergeModels(["update:modelValue", "change"], ["update:modelValue"]),
|
|
42
|
+
setup(__props) {
|
|
43
|
+
const props = __props;
|
|
44
|
+
const model = useModel(__props, "modelValue");
|
|
45
|
+
const generatedId = `astryx-time-input-${useId()}`;
|
|
46
|
+
const inputId = computed(() => props.id ?? generatedId);
|
|
47
|
+
return (_ctx, _cache) => {
|
|
48
|
+
return openBlock(), createBlock(_sfc_main$1, {
|
|
49
|
+
label: __props.label,
|
|
50
|
+
"input-id": inputId.value,
|
|
51
|
+
description: __props.description,
|
|
52
|
+
width: __props.width,
|
|
53
|
+
"is-label-hidden": __props.isLabelHidden,
|
|
54
|
+
"is-disabled": __props.isDisabled,
|
|
55
|
+
"is-optional": __props.isOptional,
|
|
56
|
+
"is-required": __props.isRequired,
|
|
57
|
+
status: __props.status,
|
|
58
|
+
"status-variant": __props.statusVariant
|
|
59
|
+
}, {
|
|
60
|
+
default: withCtx((field) => [createVNode(_sfc_main$2, {
|
|
61
|
+
modelValue: model.value,
|
|
62
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => model.value = $event),
|
|
63
|
+
label: __props.label,
|
|
64
|
+
"input-id": inputId.value,
|
|
65
|
+
"described-by": field.describedBy,
|
|
66
|
+
"labelled-by": field.labelId,
|
|
67
|
+
placeholder: __props.placeholder,
|
|
68
|
+
"hour-format": __props.hourFormat,
|
|
69
|
+
"has-seconds": __props.hasSeconds,
|
|
70
|
+
increment: __props.increment,
|
|
71
|
+
min: __props.min,
|
|
72
|
+
max: __props.max,
|
|
73
|
+
presentation: __props.presentation,
|
|
74
|
+
"native-picker": __props.nativePicker,
|
|
75
|
+
"has-clear": __props.hasClear,
|
|
76
|
+
"clear-label": __props.clearLabel,
|
|
77
|
+
size: __props.size,
|
|
78
|
+
"is-disabled": __props.isDisabled,
|
|
79
|
+
"is-read-only": __props.isReadOnly,
|
|
80
|
+
"is-required": __props.isRequired && !__props.isOptional,
|
|
81
|
+
status: __props.status
|
|
82
|
+
}, null, 8, [
|
|
83
|
+
"modelValue",
|
|
84
|
+
"label",
|
|
85
|
+
"input-id",
|
|
86
|
+
"described-by",
|
|
87
|
+
"labelled-by",
|
|
88
|
+
"placeholder",
|
|
89
|
+
"hour-format",
|
|
90
|
+
"has-seconds",
|
|
91
|
+
"increment",
|
|
92
|
+
"min",
|
|
93
|
+
"max",
|
|
94
|
+
"presentation",
|
|
95
|
+
"native-picker",
|
|
96
|
+
"has-clear",
|
|
97
|
+
"clear-label",
|
|
98
|
+
"size",
|
|
99
|
+
"is-disabled",
|
|
100
|
+
"is-read-only",
|
|
101
|
+
"is-required",
|
|
102
|
+
"status"
|
|
103
|
+
])]),
|
|
104
|
+
_: 1
|
|
105
|
+
}, 8, [
|
|
106
|
+
"label",
|
|
107
|
+
"input-id",
|
|
108
|
+
"description",
|
|
109
|
+
"width",
|
|
110
|
+
"is-label-hidden",
|
|
111
|
+
"is-disabled",
|
|
112
|
+
"is-optional",
|
|
113
|
+
"is-required",
|
|
114
|
+
"status",
|
|
115
|
+
"status-variant"
|
|
116
|
+
]);
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
//#endregion
|
|
121
|
+
export { _sfc_main as t };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { $ as formatRelativeTime, G as _default, J as TimestampProps, K as TimestampColor, Q as formatTooltipLines, X as TimestampTooltipFormat, Y as TimestampTooltipEntry, Z as TimestampTooltipLine, et as FormatInstantOptions, nt as formatInstant, q as TimestampFormat, tt as InstantFormat } from "../index-CQ9F1f_F.js";
|
|
2
|
+
export { type FormatInstantOptions, type InstantFormat, _default as Timestamp, type TimestampColor, type TimestampFormat, type TimestampProps, type TimestampTooltipEntry, type TimestampTooltipFormat, type TimestampTooltipLine, formatInstant, formatRelativeTime, formatTooltipLines };
|