@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.
Files changed (177) hide show
  1. package/README.md +1 -1
  2. package/dist/AvatarGroup/index.d.ts +1 -1
  3. package/dist/Banner/index.d.ts +1 -1
  4. package/dist/Button/index.d.ts +1 -1
  5. package/dist/ButtonGroup/index.d.ts +1 -1
  6. package/dist/Calendar/index.js +1 -1
  7. package/dist/{Calendar-DpYFXwgb.js → Calendar-BEyrkUtr.js} +2 -1
  8. package/dist/Chat/index.js +1 -1
  9. package/dist/{Chat-Bfd-YPAK.js → Chat-CO3mCs9A.js} +2 -2
  10. package/dist/CheckboxInput/index.d.ts +1 -1
  11. package/dist/CheckboxList/index.d.ts +2 -0
  12. package/dist/CheckboxList/index.js +2 -0
  13. package/dist/CheckboxList-BL2sDOWK.js +174 -0
  14. package/dist/Citation/index.js +1 -1
  15. package/dist/{Citation-DaDd1teb.js → Citation-BqwJvw7o.js} +2 -2
  16. package/dist/Code/index.js +1 -1
  17. package/dist/{CodeBlock-CK-NWM_1.js → CodeBlock-BQdooQy2.js} +1 -1
  18. package/dist/Collapsible/index.js +1 -1
  19. package/dist/{Collapsible-ByXCGhT8.js → Collapsible-BYg9soTk.js} +1 -1
  20. package/dist/ContextMenu/index.d.ts +1 -1
  21. package/dist/ContextMenu/index.js +1 -1
  22. package/dist/{ContextMenu-BJh99Exj.js → ContextMenu-dA-ppaRQ.js} +284 -12
  23. package/dist/DateInput/index.d.ts +1 -1
  24. package/dist/DateInput/index.js +1 -1
  25. package/dist/{DateInput-zJAdXByM.js → DateInput-BOIb0zAp.js} +18 -10
  26. package/dist/DateRangeInput/index.d.ts +2 -0
  27. package/dist/DateRangeInput/index.js +2 -0
  28. package/dist/DateRangeInput-DLcbgUBi.js +385 -0
  29. package/dist/DateTimeInput/index.d.ts +2 -0
  30. package/dist/DateTimeInput/index.js +2 -0
  31. package/dist/DateTimeInput-RitYX_Yx.js +196 -0
  32. package/dist/Divider/index.d.ts +1 -1
  33. package/dist/DropdownMenu/index.d.ts +1 -1
  34. package/dist/DropdownMenu/index.js +1 -1
  35. package/dist/{DropdownMenu-C3j2zaEn.js → DropdownMenu-B0gogrvG.js} +2 -2
  36. package/dist/Field/index.d.ts +2 -2
  37. package/dist/Field/index.js +1 -2
  38. package/dist/FieldStatus/index.d.ts +2 -0
  39. package/dist/FieldStatus/index.js +2 -0
  40. package/dist/FileInput/index.d.ts +2 -0
  41. package/dist/FileInput/index.js +2 -0
  42. package/dist/FileInput-CYvEV503.js +238 -0
  43. package/dist/{Icon-B6qNgBP9.js → Icon-5MdZQ18k.js} +10 -2
  44. package/dist/List/index.d.ts +1 -1
  45. package/dist/Markdown/index.d.ts +1 -1
  46. package/dist/Markdown/index.js +1 -1
  47. package/dist/{Markdown-DyKIwAL_.js → Markdown-Dnlp8cVx.js} +2 -2
  48. package/dist/MetadataList/index.d.ts +2 -0
  49. package/dist/MetadataList/index.js +2 -0
  50. package/dist/MetadataList-DIsqS1Qb.js +124 -0
  51. package/dist/MobileNav/index.js +1 -1
  52. package/dist/{MobileNavToggle-BK2iRJF-.js → MobileNavToggle-aUZiDwHm.js} +1 -1
  53. package/dist/MoreMenu/index.d.ts +1 -1
  54. package/dist/MoreMenu/index.js +1 -1
  55. package/dist/{MoreMenu-BjUsVWWk.js → MoreMenu-BXL6Dqsu.js} +2 -2
  56. package/dist/MultiSelector/index.d.ts +1 -1
  57. package/dist/MultiSelector/index.js +1 -1
  58. package/dist/{MultiSelector-CKTbTj1A.js → MultiSelector-Bh8or2S6.js} +2 -2
  59. package/dist/NavItem/index.d.ts +1 -1
  60. package/dist/NavMenu/index.d.ts +1 -1
  61. package/dist/NumberInput/index.d.ts +1 -1
  62. package/dist/NumberInput/index.js +1 -1
  63. package/dist/{NumberInput-DU3_rw7z.js → NumberInput-C3S-4dIu.js} +1 -1
  64. package/dist/OverflowList/index.d.ts +1 -1
  65. package/dist/OverflowList/index.js +1 -1
  66. package/dist/{OverflowList-B2T5UtiQ.js → OverflowList-Kr4iJrNV.js} +1 -1
  67. package/dist/Pagination/index.js +1 -1
  68. package/dist/{Pagination-qCgNwwhr.js → Pagination-BRStpeSB.js} +2 -2
  69. package/dist/Popover/index.d.ts +1 -1
  70. package/dist/Radio/index.d.ts +2 -2
  71. package/dist/Radio/index.js +2 -2
  72. package/dist/{Radio-BioQfwHQ.js → RadioGroup-DS6oTV_j.js} +21 -88
  73. package/dist/RadioList/index.d.ts +2 -0
  74. package/dist/RadioList/index.js +2 -0
  75. package/dist/RadioList-pwr93I-z.js +122 -0
  76. package/dist/SegmentedControl/index.d.ts +1 -1
  77. package/dist/Selector/index.d.ts +1 -1
  78. package/dist/Selector/index.js +1 -1
  79. package/dist/{Selector-C6sPJMtH.js → Selector-DvEUIVEC.js} +1 -1
  80. package/dist/SideNav/index.d.ts +1 -1
  81. package/dist/SideNav/index.js +1 -1
  82. package/dist/{SideNav-D9lnn-sM.js → SideNav-B7LX4RcP.js} +2 -2
  83. package/dist/Stack/index.d.ts +1 -1
  84. package/dist/Switch/index.d.ts +1 -1
  85. package/dist/Table/index.d.ts +2 -0
  86. package/dist/Table/index.js +2 -0
  87. package/dist/Table-D5zWaITo.js +967 -0
  88. package/dist/Text/index.d.ts +1 -1
  89. package/dist/TextArea/index.d.ts +1 -1
  90. package/dist/TextInput/index.d.ts +1 -1
  91. package/dist/Thumbnail/index.d.ts +2 -0
  92. package/dist/Thumbnail/index.js +2 -0
  93. package/dist/Thumbnail-DMOgWncm.js +163 -0
  94. package/dist/TimeField-DeQ1ukHl.js +214 -0
  95. package/dist/TimeInput/index.d.ts +2 -0
  96. package/dist/TimeInput/index.js +2 -0
  97. package/dist/TimeInput-jb1nLqZk.js +121 -0
  98. package/dist/Timestamp/index.d.ts +2 -0
  99. package/dist/Timestamp/index.js +2 -0
  100. package/dist/Timestamp-DrWwVQBL.js +465 -0
  101. package/dist/ToggleButton/index.d.ts +1 -1
  102. package/dist/Token/index.d.ts +1 -1
  103. package/dist/Token/index.js +1 -1
  104. package/dist/{Token-Ctf9jekS.js → Token-CV2J94bn.js} +1 -1
  105. package/dist/Tokenizer/index.d.ts +1 -1
  106. package/dist/Tokenizer/index.js +1 -1
  107. package/dist/{Tokenizer-D5MPgau0.js → Tokenizer-DF9r4hTW.js} +2 -2
  108. package/dist/Toolbar/index.d.ts +1 -1
  109. package/dist/TopNav/index.d.ts +1 -1
  110. package/dist/TopNav/index.js +1 -1
  111. package/dist/{TopNav-CjbMCbkC.js → TopNav-BH_s3uap.js} +3 -3
  112. package/dist/TreeList/index.d.ts +2 -0
  113. package/dist/TreeList/index.js +2 -0
  114. package/dist/TreeList-D9cR-w7r.js +506 -0
  115. package/dist/Typeahead/index.d.ts +1 -1
  116. package/dist/Typeahead/index.js +1 -1
  117. package/dist/{Typeahead-BMoU3hfx.js → Typeahead-s4DC1Qem.js} +2 -2
  118. package/dist/composables/index.d.ts +2 -2
  119. package/dist/composables/index.js +4 -1
  120. package/dist/{locale-56lkR7OK.js → context-BshXcNYX.js} +183 -18
  121. package/dist/{index-DjOdQv5B.d.ts → index--dh0s8Li.d.ts} +1 -1
  122. package/dist/{index-Cdi82rTW.d.ts → index-12ObcW99.d.ts} +6 -2
  123. package/dist/{index-JeZ0YTyd.d.ts → index-5R_pi3eT.d.ts} +2 -2
  124. package/dist/{index-Cc2HGODZ.d.ts → index-AkMWQ97a.d.ts} +3 -3
  125. package/dist/{index-CvLlWLIZ.d.ts → index-B4OOtNP8.d.ts} +4 -4
  126. package/dist/{index-_1-uvr27.d.ts → index-B8MbfMwV.d.ts} +1 -1
  127. package/dist/{index-MPcg1Pm4.d.ts → index-BKr7yvVv.d.ts} +1 -1
  128. package/dist/{index-CxspvLBl.d.ts → index-Bc0dgVM5.d.ts} +5 -5
  129. package/dist/{index-4FM5lQdV.d.ts → index-BlWLperN.d.ts} +1 -1
  130. package/dist/{index-DBcbfStA.d.ts → index-BnNh5Iml.d.ts} +84 -1
  131. package/dist/{index-Cp0NlzQv.d.ts → index-Bovw9_8d.d.ts} +1 -1
  132. package/dist/{index-CnVbMebA.d.ts → index-Bqb_Fyju.d.ts} +3 -3
  133. package/dist/{index-HV6W3xCx.d.ts → index-Byar3h1e.d.ts} +1 -1
  134. package/dist/{index-BQuN_dWR.d.ts → index-BzqRns96.d.ts} +1 -1
  135. package/dist/{index-C0S2Xzoi.d.ts → index-CNcQmDrK.d.ts} +93 -0
  136. package/dist/{index-CaHXYQ_E.d.ts → index-CQ9F1f_F.d.ts} +535 -137
  137. package/dist/index-CR6sUmRT.d.ts +356 -0
  138. package/dist/index-C_2Z65Rp.d.ts +67 -0
  139. package/dist/{index-Dw21t7Uf.d.ts → index-CsJpQElv.d.ts} +1 -1
  140. package/dist/index-CtlkhQ55.d.ts +36 -0
  141. package/dist/{index-C8NW9xre.d.ts → index-D3V7yRUP.d.ts} +7 -7
  142. package/dist/index-Da7Jm8Ht.d.ts +10 -0
  143. package/dist/{index-CPhDtlv-.d.ts → index-FEy8qFSD.d.ts} +3 -3
  144. package/dist/{index-BeJqhW4l.d.ts → index-Q4gqBSIZ.d.ts} +2 -2
  145. package/dist/{index-Cz9ZHVf6.d.ts → index-g03bmR4K.d.ts} +3 -3
  146. package/dist/{index-COxy6LEW.d.ts → index-gW0HW02U.d.ts} +1 -1
  147. package/dist/{index-BQa836Vz.d.ts → index-iBLzInje.d.ts} +6 -14
  148. package/dist/index-utZGF4GR.d.ts +79 -0
  149. package/dist/index.d.ts +54 -49
  150. package/dist/index.js +86 -64
  151. package/dist/locale/index.d.ts +1 -1
  152. package/dist/locale/index.js +2 -1
  153. package/dist/locale-Cpk_nrLA.js +18 -0
  154. package/dist/useFileSelection-BPtaegqK.js +58 -0
  155. package/dist/useMonthGrid-CmJsZTcB.js +139 -0
  156. package/dist/useTimeValue-DWk6oTAZ.js +113 -0
  157. package/package.json +49 -1
  158. package/styles/bordered-control.css +87 -0
  159. package/styles/calendar.css +8 -2
  160. package/styles/checkbox-list.css +15 -0
  161. package/styles/date-range-input.css +163 -0
  162. package/styles/date-time-input.css +40 -0
  163. package/styles/field.css +2 -3
  164. package/styles/file-input.css +87 -0
  165. package/styles/icon.css +32 -0
  166. package/styles/metadata-list.css +107 -0
  167. package/styles/number-input.css +6 -0
  168. package/styles/radio.css +32 -0
  169. package/styles/selector.css +10 -0
  170. package/styles/table.css +256 -0
  171. package/styles/text-area.css +6 -1
  172. package/styles/text-input.css +6 -0
  173. package/styles/thumbnail.css +151 -0
  174. package/styles/time-input.css +51 -0
  175. package/styles/timestamp.css +93 -0
  176. package/styles/tree-list.css +229 -0
  177. package/styles.css +11 -0
@@ -0,0 +1,385 @@
1
+ import { a as todayISODate, c as formatDateRange, f as orderRange, l as isDayOutsideSpan, n as buildMonthGrid, o as applyRangeClick, p as resolveWeekStart, t as addMonths, u as isRangeWithinSpan } from "./useMonthGrid-CmJsZTcB.js";
2
+ import { t as _sfc_main$2 } from "./FieldIcon--NTgW5IU.js";
3
+ import { t as _sfc_main$3 } from "./IconButton-BNQuz9W_.js";
4
+ import { n as weekdayNames, t as formatCalendarMonth } from "./locale-Cpk_nrLA.js";
5
+ import { a as useAstryxMessages, i as useAstryxLocale } from "./context-BshXcNYX.js";
6
+ import { t as _sfc_main$4 } from "./Icon-5MdZQ18k.js";
7
+ import { t as _sfc_main$5 } from "./Field-VlTBsIEo.js";
8
+ import { t as _sfc_main$6 } from "./Popover-Crhk9PNP.js";
9
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, mergeModels, normalizeClass, openBlock, renderList, shallowRef, toDisplayString, unref, useId, useModel, withCtx } from "vue";
10
+ import "../styles/calendar.css";
11
+ import "../styles/date-range-input.css";
12
+ import "../styles/bordered-control.css";
13
+ //#region src/DateRangeInput/RangeCalendar.vue
14
+ const _hoisted_1$1 = { class: "astryx-calendar astryx-date-range-calendar" };
15
+ const _hoisted_2$1 = { class: "astryx-calendar-header" };
16
+ const _hoisted_3$1 = ["aria-label"];
17
+ const _hoisted_4$1 = { class: "astryx-calendar-month-year" };
18
+ const _hoisted_5$1 = ["aria-label"];
19
+ const _hoisted_6$1 = { class: "astryx-date-range-months" };
20
+ const _hoisted_7$1 = { class: "astryx-calendar-weekdays" };
21
+ const _hoisted_8 = ["aria-label"];
22
+ const _hoisted_9 = [
23
+ "disabled",
24
+ "aria-pressed",
25
+ "aria-current",
26
+ "onClick",
27
+ "onMouseenter",
28
+ "onFocus"
29
+ ];
30
+ const _hoisted_10 = { class: "astryx-calendar-day" };
31
+ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
32
+ __name: "RangeCalendar",
33
+ props: /*@__PURE__*/ mergeModels({
34
+ cursorYear: {},
35
+ cursorMonth: {},
36
+ monthCount: { default: 2 },
37
+ range: { default: null },
38
+ pending: { default: null },
39
+ min: {},
40
+ max: {},
41
+ minRangeSpan: { default: 1 },
42
+ maxRangeSpan: {},
43
+ weekStartsOn: {}
44
+ }, {
45
+ "hover": { default: null },
46
+ "hoverModifiers": {}
47
+ }),
48
+ emits: /*@__PURE__*/ mergeModels(["select", "shift"], ["update:hover"]),
49
+ setup(__props, { emit: __emit }) {
50
+ const props = __props;
51
+ const emit = __emit;
52
+ const locale = useAstryxLocale();
53
+ const messages = useAstryxMessages();
54
+ const hover = useModel(__props, "hover");
55
+ const today = todayISODate();
56
+ const weekStart = computed(() => resolveWeekStart(props.weekStartsOn ?? (locale.value === "zh-CN" ? 1 : 0)));
57
+ const weekDays = computed(() => {
58
+ const names = weekdayNames(locale.value, "narrow");
59
+ const labels = weekdayNames(locale.value, "long");
60
+ const start = weekStart.value;
61
+ return Array.from({ length: 7 }, (_, index) => ({
62
+ name: names[(index + start) % 7],
63
+ label: labels[(index + start) % 7]
64
+ }));
65
+ });
66
+ const months = computed(() => Array.from({ length: props.monthCount }, (_, index) => {
67
+ const cursor = addMonths(props.cursorYear, props.cursorMonth, index);
68
+ return {
69
+ ...cursor,
70
+ label: formatCalendarMonth(cursor.year, cursor.month, locale.value),
71
+ weeks: buildMonthGrid(cursor.year, cursor.month, weekStart.value)
72
+ };
73
+ }));
74
+ const headerLabel = computed(() => months.value.map((month) => month.label).join(" – "));
75
+ const preview = computed(() => {
76
+ if (props.pending && hover.value && hover.value !== props.pending) return orderRange(props.pending, hover.value);
77
+ return props.range;
78
+ });
79
+ function monthKey(iso) {
80
+ return iso.slice(0, 7);
81
+ }
82
+ function inSpan(day, range) {
83
+ return range != null && day >= range.start && day <= range.end;
84
+ }
85
+ function isDisabled(day) {
86
+ if (props.min && day < props.min) return true;
87
+ if (props.max && day > props.max) return true;
88
+ return isDayOutsideSpan(props.pending, day, props.minRangeSpan, props.maxRangeSpan);
89
+ }
90
+ return (_ctx, _cache) => {
91
+ return openBlock(), createElementBlock("div", _hoisted_1$1, [createElementVNode("div", _hoisted_2$1, [
92
+ createElementVNode("button", {
93
+ type: "button",
94
+ class: "astryx-calendar-nav-button",
95
+ "aria-label": unref(messages).calendar.previousMonth,
96
+ onClick: _cache[0] || (_cache[0] = ($event) => emit("shift", -1))
97
+ }, [createVNode(_sfc_main$4, {
98
+ icon: "chevronLeft",
99
+ size: "sm"
100
+ })], 8, _hoisted_3$1),
101
+ createElementVNode("span", _hoisted_4$1, toDisplayString(headerLabel.value), 1),
102
+ createElementVNode("button", {
103
+ type: "button",
104
+ class: "astryx-calendar-nav-button",
105
+ "aria-label": unref(messages).calendar.nextMonth,
106
+ onClick: _cache[1] || (_cache[1] = ($event) => emit("shift", 1))
107
+ }, [createVNode(_sfc_main$4, {
108
+ icon: "chevronRight",
109
+ size: "sm"
110
+ })], 8, _hoisted_5$1)
111
+ ]), createElementVNode("div", _hoisted_6$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(months.value, (month) => {
112
+ return openBlock(), createElementBlock("div", {
113
+ key: `${month.year}-${month.month}`,
114
+ class: "astryx-date-range-month"
115
+ }, [createElementVNode("div", _hoisted_7$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(weekDays.value, (day) => {
116
+ return openBlock(), createElementBlock("div", {
117
+ key: day.label,
118
+ class: "astryx-calendar-weekday",
119
+ "aria-label": day.label
120
+ }, toDisplayString(day.name), 9, _hoisted_8);
121
+ }), 128))]), (openBlock(true), createElementBlock(Fragment, null, renderList(month.weeks, (week, weekIndex) => {
122
+ return openBlock(), createElementBlock("div", {
123
+ key: weekIndex,
124
+ class: "astryx-calendar-row"
125
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(week, (day) => {
126
+ return openBlock(), createElementBlock("button", {
127
+ key: day,
128
+ type: "button",
129
+ class: normalizeClass(["astryx-calendar-cell", {
130
+ "is-other-month": monthKey(day) !== `${month.year}-${String(month.month).padStart(2, "0")}`,
131
+ "is-today": day === unref(today),
132
+ "is-selected": day === preview.value?.start || day === preview.value?.end || day === __props.pending,
133
+ "is-in-range": inSpan(day, preview.value),
134
+ "is-range-start": day === preview.value?.start,
135
+ "is-range-end": day === preview.value?.end,
136
+ "is-disabled": isDisabled(day)
137
+ }]),
138
+ disabled: isDisabled(day),
139
+ "aria-pressed": day === preview.value?.start || day === preview.value?.end || void 0,
140
+ "aria-current": day === unref(today) ? "date" : void 0,
141
+ onClick: ($event) => emit("select", day),
142
+ onMouseenter: ($event) => hover.value = day,
143
+ onMouseleave: _cache[2] || (_cache[2] = ($event) => hover.value = null),
144
+ onFocus: ($event) => hover.value = day,
145
+ onBlur: _cache[3] || (_cache[3] = ($event) => hover.value = null)
146
+ }, [createElementVNode("span", _hoisted_10, toDisplayString(Number(day.slice(8))), 1)], 42, _hoisted_9);
147
+ }), 128))]);
148
+ }), 128))]);
149
+ }), 128))])]);
150
+ };
151
+ }
152
+ });
153
+ //#endregion
154
+ //#region src/DateRangeInput/DateRangeInput.vue
155
+ const _hoisted_1 = [
156
+ "data-size",
157
+ "data-status",
158
+ "data-disabled"
159
+ ];
160
+ const _hoisted_2 = [
161
+ "id",
162
+ "disabled",
163
+ "aria-describedby",
164
+ "aria-invalid"
165
+ ];
166
+ const _hoisted_3 = ["data-placeholder"];
167
+ const _hoisted_4 = { class: "astryx-date-range-popover" };
168
+ const _hoisted_5 = { class: "astryx-date-range-panel" };
169
+ const _hoisted_6 = {
170
+ key: 0,
171
+ class: "astryx-date-range-presets"
172
+ };
173
+ const _hoisted_7 = ["disabled", "onClick"];
174
+ const _sfc_main = /*@__PURE__*/ defineComponent({
175
+ name: "AstryxDateRangeInput",
176
+ __name: "DateRangeInput",
177
+ props: /*@__PURE__*/ mergeModels({
178
+ label: {},
179
+ id: {},
180
+ description: {},
181
+ placeholder: {},
182
+ presets: {},
183
+ monthCount: { default: 2 },
184
+ min: {},
185
+ max: {},
186
+ minRangeSpan: { default: 1 },
187
+ maxRangeSpan: {},
188
+ weekStartsOn: {},
189
+ hasClear: {
190
+ type: Boolean,
191
+ default: true
192
+ },
193
+ clearLabel: {},
194
+ size: { default: "md" },
195
+ isDisabled: { type: Boolean },
196
+ isRequired: { type: Boolean },
197
+ isOptional: { type: Boolean },
198
+ isLabelHidden: { type: Boolean },
199
+ status: {},
200
+ statusVariant: { default: "attached" },
201
+ width: {}
202
+ }, {
203
+ "modelValue": { default: null },
204
+ "modelModifiers": {}
205
+ }),
206
+ emits: /*@__PURE__*/ mergeModels(["update:modelValue", "change"], ["update:modelValue"]),
207
+ setup(__props, { emit: __emit }) {
208
+ const props = __props;
209
+ const emit = __emit;
210
+ const model = useModel(__props, "modelValue");
211
+ const messages = useAstryxMessages();
212
+ const locale = useAstryxLocale();
213
+ const generatedId = `astryx-date-range-${useId()}`;
214
+ const inputId = computed(() => props.id ?? generatedId);
215
+ const open = shallowRef(false);
216
+ const pending = shallowRef(null);
217
+ const today = todayISODate();
218
+ const cursor = shallowRef({
219
+ year: Number(today.slice(0, 4)),
220
+ month: Number(today.slice(5, 7))
221
+ });
222
+ const display = computed(() => formatDateRange(model.value, locale.value));
223
+ const placeholder = computed(() => props.placeholder ?? messages.value.dateRangeInput.placeholder);
224
+ const clearLabel = computed(() => props.clearLabel ?? messages.value.dateRangeInput.clear(props.label));
225
+ function commit(value) {
226
+ model.value = value;
227
+ emit("change", value);
228
+ }
229
+ function onSelect(day) {
230
+ const result = applyRangeClick(pending.value, day, props.minRangeSpan, props.maxRangeSpan);
231
+ pending.value = result.pending;
232
+ if (result.commit) {
233
+ commit(result.commit);
234
+ open.value = false;
235
+ }
236
+ }
237
+ function onShift(amount) {
238
+ cursor.value = addMonths(cursor.value.year, cursor.value.month, amount);
239
+ }
240
+ function onOpenChange(next) {
241
+ open.value = next;
242
+ if (next && model.value) {
243
+ cursor.value = {
244
+ year: Number(model.value.start.slice(0, 4)),
245
+ month: Number(model.value.start.slice(5, 7))
246
+ };
247
+ pending.value = null;
248
+ }
249
+ if (!next) pending.value = null;
250
+ }
251
+ function applyPreset(preset) {
252
+ const range = preset.getRange();
253
+ if (!isRangeWithinSpan(range, props.minRangeSpan, props.maxRangeSpan)) return;
254
+ commit(range);
255
+ pending.value = null;
256
+ open.value = false;
257
+ }
258
+ function presetDisabled(preset) {
259
+ return !isRangeWithinSpan(preset.getRange(), props.minRangeSpan, props.maxRangeSpan);
260
+ }
261
+ function clear() {
262
+ pending.value = null;
263
+ commit(null);
264
+ open.value = false;
265
+ }
266
+ return (_ctx, _cache) => {
267
+ return openBlock(), createBlock(_sfc_main$5, {
268
+ label: __props.label,
269
+ "input-id": inputId.value,
270
+ description: __props.description,
271
+ width: __props.width,
272
+ "is-label-hidden": __props.isLabelHidden,
273
+ "is-disabled": __props.isDisabled,
274
+ "is-optional": __props.isOptional,
275
+ "is-required": __props.isRequired,
276
+ status: __props.status,
277
+ "status-variant": __props.statusVariant
278
+ }, {
279
+ default: withCtx((field) => [createVNode(_sfc_main$6, {
280
+ "is-open": open.value,
281
+ "is-enabled": !__props.isDisabled,
282
+ placement: "below",
283
+ alignment: "start",
284
+ padding: 0,
285
+ width: "min(40rem, calc(100vw - 16px))",
286
+ "has-close-button": false,
287
+ "is-modal": false,
288
+ role: "dialog",
289
+ label: unref(messages).dateRangeInput.dialogLabel,
290
+ onOpenChange
291
+ }, {
292
+ content: withCtx(() => [createElementVNode("div", _hoisted_4, [createElementVNode("div", _hoisted_5, [__props.presets?.length ? (openBlock(), createElementBlock("div", _hoisted_6, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.presets, (preset) => {
293
+ return openBlock(), createElementBlock("button", {
294
+ key: preset.label,
295
+ type: "button",
296
+ class: "astryx-date-range-preset",
297
+ disabled: presetDisabled(preset),
298
+ onClick: ($event) => applyPreset(preset)
299
+ }, toDisplayString(preset.label), 9, _hoisted_7);
300
+ }), 128))])) : createCommentVNode("v-if", true), createVNode(_sfc_main$1, {
301
+ "cursor-year": cursor.value.year,
302
+ "cursor-month": cursor.value.month,
303
+ "month-count": __props.monthCount,
304
+ range: model.value,
305
+ pending: pending.value,
306
+ min: __props.min,
307
+ max: __props.max,
308
+ "min-range-span": __props.minRangeSpan,
309
+ "max-range-span": __props.maxRangeSpan,
310
+ "week-starts-on": __props.weekStartsOn,
311
+ onSelect,
312
+ onShift
313
+ }, null, 8, [
314
+ "cursor-year",
315
+ "cursor-month",
316
+ "month-count",
317
+ "range",
318
+ "pending",
319
+ "min",
320
+ "max",
321
+ "min-range-span",
322
+ "max-range-span",
323
+ "week-starts-on"
324
+ ])])])]),
325
+ default: withCtx(() => [createElementVNode("div", {
326
+ class: "astryx-date-range-input astryx-bordered-control",
327
+ "data-size": __props.size,
328
+ "data-status": __props.status?.type,
329
+ "data-disabled": __props.isDisabled || void 0
330
+ }, [
331
+ createElementVNode("button", {
332
+ id: inputId.value,
333
+ type: "button",
334
+ class: "astryx-date-range-trigger",
335
+ disabled: __props.isDisabled,
336
+ "aria-describedby": field.describedBy,
337
+ "aria-invalid": __props.status?.type === "error" || void 0
338
+ }, [createVNode(_sfc_main$4, {
339
+ class: "astryx-date-range-icon",
340
+ icon: "calendar",
341
+ size: "sm"
342
+ }), createElementVNode("span", {
343
+ class: "astryx-date-range-value",
344
+ "data-placeholder": !display.value || void 0
345
+ }, toDisplayString(display.value || placeholder.value), 9, _hoisted_3)], 8, _hoisted_2),
346
+ __props.hasClear && model.value && !__props.isDisabled ? (openBlock(), createBlock(_sfc_main$3, {
347
+ key: 0,
348
+ class: "astryx-input-clear-button",
349
+ variant: "ghost",
350
+ size: "sm",
351
+ label: clearLabel.value,
352
+ onClick: clear
353
+ }, {
354
+ default: withCtx(() => [createVNode(_sfc_main$2, { type: "clear" })]),
355
+ _: 1
356
+ }, 8, ["label"])) : createCommentVNode("v-if", true),
357
+ __props.status ? (openBlock(), createBlock(_sfc_main$2, {
358
+ key: 1,
359
+ type: __props.status.type
360
+ }, null, 8, ["type"])) : createCommentVNode("v-if", true)
361
+ ], 8, _hoisted_1)]),
362
+ _: 2
363
+ }, 1032, [
364
+ "is-open",
365
+ "is-enabled",
366
+ "label"
367
+ ])]),
368
+ _: 1
369
+ }, 8, [
370
+ "label",
371
+ "input-id",
372
+ "description",
373
+ "width",
374
+ "is-label-hidden",
375
+ "is-disabled",
376
+ "is-optional",
377
+ "is-required",
378
+ "status",
379
+ "status-variant"
380
+ ]);
381
+ };
382
+ }
383
+ });
384
+ //#endregion
385
+ export { _sfc_main as t };
@@ -0,0 +1,2 @@
1
+ import { Bn as _default, Hn as DateTimeInputProps, Un as DateTimeInputSize, Vn as DateTimeInputEmits } from "../index-CQ9F1f_F.js";
2
+ export { _default as DateTimeInput, type DateTimeInputEmits, type DateTimeInputProps, type DateTimeInputSize };
@@ -0,0 +1,2 @@
1
+ import { t as _sfc_main } from "../DateTimeInput-RitYX_Yx.js";
2
+ export { _sfc_main as DateTimeInput };
@@ -0,0 +1,196 @@
1
+ import { t as _sfc_main$1 } from "./FieldIcon--NTgW5IU.js";
2
+ import { t as _sfc_main$2 } from "./IconButton-BNQuz9W_.js";
3
+ import { a as useAstryxMessages } from "./context-BshXcNYX.js";
4
+ import { t as _sfc_main$3 } from "./Field-VlTBsIEo.js";
5
+ import { t as _sfc_main$4 } from "./DateInput-BOIb0zAp.js";
6
+ import { t as _sfc_main$5 } from "./TimeField-DeQ1ukHl.js";
7
+ import { computed, createBlock, createCommentVNode, createElementVNode, createVNode, defineComponent, mergeModels, openBlock, ref, unref, useId, useModel, watch, withCtx } from "vue";
8
+ import "../styles/date-time-input.css";
9
+ //#region src/DateTimeInput/DateTimeInput.vue
10
+ const _hoisted_1 = [
11
+ "data-size",
12
+ "data-status",
13
+ "data-disabled"
14
+ ];
15
+ const _hoisted_2 = { class: "astryx-date-time-fields" };
16
+ const _sfc_main = /*@__PURE__*/ defineComponent({
17
+ name: "AstryxDateTimeInput",
18
+ __name: "DateTimeInput",
19
+ props: /*@__PURE__*/ mergeModels({
20
+ label: {},
21
+ id: {},
22
+ description: {},
23
+ placeholder: {},
24
+ hourFormat: { default: "12h" },
25
+ presentation: {},
26
+ nativePicker: {},
27
+ hasClear: {
28
+ type: Boolean,
29
+ default: false
30
+ },
31
+ clearLabel: {},
32
+ size: { default: "md" },
33
+ min: {},
34
+ max: {},
35
+ isDisabled: { type: Boolean },
36
+ isReadOnly: { type: Boolean },
37
+ isRequired: { type: Boolean },
38
+ isOptional: { type: Boolean },
39
+ isLabelHidden: { type: Boolean },
40
+ status: {},
41
+ statusVariant: { default: "attached" },
42
+ width: {}
43
+ }, {
44
+ "modelValue": { default: null },
45
+ "modelModifiers": {}
46
+ }),
47
+ emits: /*@__PURE__*/ mergeModels(["update:modelValue", "change"], ["update:modelValue"]),
48
+ setup(__props, { emit: __emit }) {
49
+ const emit = __emit;
50
+ const model = useModel(__props, "modelValue");
51
+ const messages = useAstryxMessages();
52
+ const generatedId = `astryx-date-time-${useId()}`;
53
+ const draftDate = ref(void 0);
54
+ const draftTime = ref(void 0);
55
+ function parseDate(value) {
56
+ const date = value?.slice(0, 10) ?? "";
57
+ if (!/^\d{4}-\d{2}-\d{2}$/.test(date)) return null;
58
+ const [year, month, day] = date.split("-").map(Number);
59
+ return new Date(year, month - 1, day);
60
+ }
61
+ function parseTime(value) {
62
+ const time = value?.slice(11, 16) ?? "";
63
+ return /^\d{2}:\d{2}$/.test(time) ? time : null;
64
+ }
65
+ function formatDate(date) {
66
+ const month = String(date.getMonth() + 1).padStart(2, "0");
67
+ const day = String(date.getDate()).padStart(2, "0");
68
+ return `${date.getFullYear()}-${month}-${day}`;
69
+ }
70
+ const dateValue = computed(() => draftDate.value !== void 0 ? draftDate.value : parseDate(model.value));
71
+ const timeValue = computed(() => draftTime.value !== void 0 ? draftTime.value : parseTime(model.value));
72
+ const clearLabel = computed(() => messages.value.dateTimeInput.clear());
73
+ function publish() {
74
+ const date = dateValue.value;
75
+ const time = timeValue.value;
76
+ const next = date && time ? `${formatDate(date)}T${time}` : null;
77
+ if (next != null) {
78
+ draftDate.value = void 0;
79
+ draftTime.value = void 0;
80
+ }
81
+ if (next !== model.value) {
82
+ model.value = next;
83
+ emit("change", next);
84
+ }
85
+ }
86
+ function onDate(value) {
87
+ draftDate.value = value;
88
+ publish();
89
+ }
90
+ function onTime(value) {
91
+ draftTime.value = value;
92
+ publish();
93
+ }
94
+ function clear() {
95
+ draftDate.value = null;
96
+ draftTime.value = null;
97
+ if (model.value !== null) {
98
+ model.value = null;
99
+ emit("change", null);
100
+ }
101
+ }
102
+ watch(model, (value) => {
103
+ if (value) {
104
+ draftDate.value = void 0;
105
+ draftTime.value = void 0;
106
+ }
107
+ });
108
+ return (_ctx, _cache) => {
109
+ return openBlock(), createBlock(_sfc_main$3, {
110
+ label: __props.label,
111
+ "input-id": generatedId,
112
+ description: __props.description,
113
+ width: __props.width,
114
+ "is-label-hidden": __props.isLabelHidden,
115
+ "is-disabled": __props.isDisabled,
116
+ "is-optional": __props.isOptional,
117
+ "is-required": __props.isRequired,
118
+ status: __props.status,
119
+ "status-variant": __props.statusVariant
120
+ }, {
121
+ default: withCtx((field) => [createElementVNode("div", {
122
+ class: "astryx-date-time-input",
123
+ "data-size": __props.size,
124
+ "data-status": __props.status?.type,
125
+ "data-disabled": __props.isDisabled || void 0
126
+ }, [createElementVNode("div", _hoisted_2, [createVNode(_sfc_main$4, {
127
+ id: generatedId,
128
+ "model-value": dateValue.value,
129
+ label: unref(messages).dateTimeInput.dateLabel,
130
+ placeholder: __props.placeholder,
131
+ disabled: __props.isDisabled,
132
+ size: __props.size,
133
+ "described-by": field.describedBy,
134
+ "onUpdate:modelValue": onDate
135
+ }, null, 8, [
136
+ "model-value",
137
+ "label",
138
+ "placeholder",
139
+ "disabled",
140
+ "size",
141
+ "described-by"
142
+ ]), createVNode(_sfc_main$5, {
143
+ "model-value": timeValue.value,
144
+ label: unref(messages).dateTimeInput.timeLabel,
145
+ "described-by": field.describedBy,
146
+ "hour-format": __props.hourFormat,
147
+ presentation: __props.presentation,
148
+ "native-picker": __props.nativePicker,
149
+ min: __props.min,
150
+ max: __props.max,
151
+ size: __props.size,
152
+ "is-disabled": __props.isDisabled,
153
+ "is-read-only": __props.isReadOnly,
154
+ status: __props.status,
155
+ "onUpdate:modelValue": onTime
156
+ }, null, 8, [
157
+ "model-value",
158
+ "label",
159
+ "described-by",
160
+ "hour-format",
161
+ "presentation",
162
+ "native-picker",
163
+ "min",
164
+ "max",
165
+ "size",
166
+ "is-disabled",
167
+ "is-read-only",
168
+ "status"
169
+ ])]), __props.hasClear && (dateValue.value || timeValue.value) && !__props.isDisabled ? (openBlock(), createBlock(_sfc_main$2, {
170
+ key: 0,
171
+ class: "astryx-input-clear-button",
172
+ variant: "ghost",
173
+ size: "sm",
174
+ label: clearLabel.value,
175
+ onClick: clear
176
+ }, {
177
+ default: withCtx(() => [createVNode(_sfc_main$1, { type: "clear" })]),
178
+ _: 1
179
+ }, 8, ["label"])) : createCommentVNode("v-if", true)], 8, _hoisted_1)]),
180
+ _: 1
181
+ }, 8, [
182
+ "label",
183
+ "description",
184
+ "width",
185
+ "is-label-hidden",
186
+ "is-disabled",
187
+ "is-optional",
188
+ "is-required",
189
+ "status",
190
+ "status-variant"
191
+ ]);
192
+ };
193
+ }
194
+ });
195
+ //#endregion
196
+ export { _sfc_main as t };
@@ -1,2 +1,2 @@
1
- import { i as DividerVariant, n as DividerOrientation, r as DividerProps, t as _default } from "../index-HV6W3xCx.js";
1
+ import { i as DividerVariant, n as DividerOrientation, r as DividerProps, t as _default } from "../index-Byar3h1e.js";
2
2
  export { _default as Divider, type DividerOrientation, type DividerProps, type DividerVariant };
@@ -1,2 +1,2 @@
1
- import { S as DropdownMenuTriggerProps, _ as DropdownMenuOption, a as DropdownMenuContextValue, b as DropdownMenuSize, c as DropdownMenuDividerData, d as DropdownMenuGroupSlots, f as DropdownMenuItemData, g as DropdownMenuItemVariant, h as DropdownMenuItemSlots, i as _default, l as DropdownMenuEmits, m as DropdownMenuItemProps, n as _default$2, o as useDropdownMenuContext, p as DropdownMenuItemEmits, r as _default$1, s as DropdownMenuButtonProps, t as _default$3, u as DropdownMenuGroupProps, v as DropdownMenuProps, x as DropdownMenuSlots, y as DropdownMenuSection } from "../index-_1-uvr27.js";
1
+ import { S as DropdownMenuTriggerProps, _ as DropdownMenuOption, a as DropdownMenuContextValue, b as DropdownMenuSize, c as DropdownMenuDividerData, d as DropdownMenuGroupSlots, f as DropdownMenuItemData, g as DropdownMenuItemVariant, h as DropdownMenuItemSlots, i as _default, l as DropdownMenuEmits, m as DropdownMenuItemProps, n as _default$2, o as useDropdownMenuContext, p as DropdownMenuItemEmits, r as _default$1, s as DropdownMenuButtonProps, t as _default$3, u as DropdownMenuGroupProps, v as DropdownMenuProps, x as DropdownMenuSlots, y as DropdownMenuSection } from "../index-B8MbfMwV.js";
2
2
  export { _default as DropdownMenu, type DropdownMenuButtonProps, type DropdownMenuContextValue, _default$1 as DropdownMenuDivider, type DropdownMenuDividerData, type DropdownMenuEmits, _default$2 as DropdownMenuGroup, type DropdownMenuGroupProps, type DropdownMenuGroupSlots, _default$3 as DropdownMenuItem, type DropdownMenuItemData, type DropdownMenuItemEmits, type DropdownMenuItemProps, type DropdownMenuItemSlots, type DropdownMenuItemVariant, type DropdownMenuOption, type DropdownMenuProps, type DropdownMenuSection, type DropdownMenuSize, type DropdownMenuSlots, type DropdownMenuTriggerProps, useDropdownMenuContext };
@@ -1,2 +1,2 @@
1
- import { a as useDropdownMenuContext, i as _sfc_main$1, n as _sfc_main$3, r as _sfc_main$2, t as _sfc_main } from "../DropdownMenu-C3j2zaEn.js";
1
+ import { a as useDropdownMenuContext, i as _sfc_main$1, n as _sfc_main$3, r as _sfc_main$2, t as _sfc_main } from "../DropdownMenu-B0gogrvG.js";
2
2
  export { _sfc_main as DropdownMenu, _sfc_main$1 as DropdownMenuDivider, _sfc_main$2 as DropdownMenuGroup, _sfc_main$3 as DropdownMenuItem, useDropdownMenuContext };
@@ -1,10 +1,10 @@
1
1
  import { t as _sfc_main$5 } from "./Button-DrqeomlE.js";
2
2
  import { t as useDismiss } from "./useDismiss-CAiHU6QD.js";
3
3
  import { t as useTypeahead } from "./useTypeahead-PAK8lMYz.js";
4
- import { t as _sfc_main$6 } from "./Icon-B6qNgBP9.js";
4
+ import { t as _sfc_main$6 } from "./Icon-5MdZQ18k.js";
5
5
  import { t as _sfc_main$7 } from "./Divider-BtwnL18I.js";
6
- import { t as usePositionedLayer } from "./usePositionedLayer-C1NBOsVT.js";
7
6
  import { t as _sfc_main$8 } from "./Item-C1z6gXn8.js";
7
+ import { t as usePositionedLayer } from "./usePositionedLayer-C1NBOsVT.js";
8
8
  import { Fragment, Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, h, inject, mergeModels, mergeProps, nextTick, normalizeProps, onBeforeUnmount, onMounted, openBlock, provide, ref, renderSlot, shallowRef, toDisplayString, unref, useAttrs, useId, useModel, useSlots, vShow, watch, withCtx, withDirectives } from "vue";
9
9
  import "../styles/dropdown-menu.css";
10
10
  //#region src/DropdownMenu/context.ts
@@ -1,3 +1,3 @@
1
1
  import { a as FieldSlots, c as FieldStatusType, i as FieldSlotProps, l as FieldStatusVariant, n as FieldLabelSlots, o as FieldStatusInput, r as FieldProps, s as FieldStatusProps, t as FieldLabelProps } from "../types-3eXh_5os.js";
2
- import { n as _default$1, r as _default, t as _default$2 } from "../index-BQa836Vz.js";
3
- export { _default as Field, _default$1 as FieldLabel, type FieldLabelProps, type FieldLabelSlots, type FieldProps, type FieldSlotProps, type FieldSlots, _default$2 as FieldStatus, type FieldStatusInput, type FieldStatusProps, type FieldStatusType, type FieldStatusVariant };
2
+ import { n as _default, t as _default$1 } from "../index-iBLzInje.js";
3
+ export { _default as Field, _default$1 as FieldLabel, type FieldLabelProps, type FieldLabelSlots, type FieldProps, type FieldSlotProps, type FieldSlots, type FieldStatusInput, type FieldStatusProps, type FieldStatusType, type FieldStatusVariant };
@@ -1,4 +1,3 @@
1
1
  import { t as _sfc_main$1 } from "../FieldLabel-B1NRyQlS.js";
2
- import { t as _sfc_main$2 } from "../FieldStatus-MjY19ERl.js";
3
2
  import { t as _sfc_main } from "../Field-VlTBsIEo.js";
4
- export { _sfc_main as Field, _sfc_main$1 as FieldLabel, _sfc_main$2 as FieldStatus };
3
+ export { _sfc_main as Field, _sfc_main$1 as FieldLabel };
@@ -0,0 +1,2 @@
1
+ import { t as _default } from "../index-Da7Jm8Ht.js";
2
+ export { _default as FieldStatus };
@@ -0,0 +1,2 @@
1
+ import { t as _sfc_main } from "../FieldStatus-MjY19ERl.js";
2
+ export { _sfc_main as FieldStatus };
@@ -0,0 +1,2 @@
1
+ import { Fn as FileInputMode, In as FileInputProps, Ln as FileInputSize, Nn as _default, Pn as FileInputEmits, Rn as FileInputStatus, zn as FileInputValue } from "../index-CQ9F1f_F.js";
2
+ export { _default as FileInput, type FileInputEmits, type FileInputMode, type FileInputProps, type FileInputSize, type FileInputStatus, type FileInputValue };
@@ -0,0 +1,2 @@
1
+ import { t as _sfc_main } from "../FileInput-CYvEV503.js";
2
+ export { _sfc_main as FileInput };