@sprawlify/primitives 0.0.112 → 0.0.113
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/{date-utils-Dz9DZPcZ.cjs → date-utils-B-dqorZV.cjs} +48 -13
- package/dist/{date-utils-BqOQP2-U.mjs → date-utils-BdeeOQRI.mjs} +43 -14
- package/dist/date-utils.cjs +2 -1
- package/dist/date-utils.d.cts +6 -5
- package/dist/date-utils.d.mts +2 -2
- package/dist/date-utils.mjs +2 -2
- package/dist/{index-6cEVkXqi.d.mts → index-BfUngXif.d.mts} +6 -5
- package/dist/machines/accordion/index.d.cts +1 -1
- package/dist/machines/accordion/index.d.mts +1 -1
- package/dist/machines/angle-slider/index.cjs +64 -24
- package/dist/machines/angle-slider/index.d.cts +1 -1
- package/dist/machines/angle-slider/index.d.mts +1 -1
- package/dist/machines/angle-slider/index.mjs +65 -25
- package/dist/machines/carousel/index.d.cts +1 -1
- package/dist/machines/carousel/index.d.mts +1 -1
- package/dist/machines/cascade-select/index.cjs +44 -19
- package/dist/machines/cascade-select/index.d.cts +13 -10
- package/dist/machines/cascade-select/index.d.mts +13 -10
- package/dist/machines/cascade-select/index.mjs +45 -20
- package/dist/machines/checkbox/index.d.cts +1 -1
- package/dist/machines/checkbox/index.d.mts +1 -1
- package/dist/machines/clipboard/index.d.cts +1 -1
- package/dist/machines/clipboard/index.d.mts +1 -1
- package/dist/machines/collapsible/index.d.cts +1 -1
- package/dist/machines/collapsible/index.d.mts +1 -1
- package/dist/machines/color-picker/index.d.cts +1 -1
- package/dist/machines/color-picker/index.d.mts +1 -1
- package/dist/machines/combobox/index.cjs +13 -11
- package/dist/machines/combobox/index.d.cts +1 -1
- package/dist/machines/combobox/index.d.mts +1 -1
- package/dist/machines/combobox/index.mjs +14 -12
- package/dist/machines/date-picker/index.cjs +46 -25
- package/dist/machines/date-picker/index.d.cts +3 -2
- package/dist/machines/date-picker/index.d.mts +4 -3
- package/dist/machines/date-picker/index.mjs +47 -26
- package/dist/machines/dialog/index.d.cts +1 -1
- package/dist/machines/dialog/index.d.mts +1 -1
- package/dist/machines/drawer/index.d.cts +1 -1
- package/dist/machines/drawer/index.d.mts +1 -1
- package/dist/machines/dropdown-menu/index.d.cts +1 -1
- package/dist/machines/dropdown-menu/index.d.mts +1 -1
- package/dist/machines/editable/index.d.cts +1 -1
- package/dist/machines/editable/index.d.mts +1 -1
- package/dist/machines/file-upload/index.d.cts +1 -1
- package/dist/machines/file-upload/index.d.mts +1 -1
- package/dist/machines/floating-panel/index.d.cts +1 -1
- package/dist/machines/floating-panel/index.d.mts +1 -1
- package/dist/machines/image-cropper/index.d.cts +1 -1
- package/dist/machines/image-cropper/index.d.mts +1 -1
- package/dist/machines/listbox/index.d.cts +1 -1
- package/dist/machines/listbox/index.d.mts +1 -1
- package/dist/machines/marquee/index.d.cts +3 -3
- package/dist/machines/marquee/index.d.mts +3 -3
- package/dist/machines/navigation-menu/index.d.cts +1 -1
- package/dist/machines/navigation-menu/index.d.mts +1 -1
- package/dist/machines/number-input/index.d.cts +1 -1
- package/dist/machines/number-input/index.d.mts +1 -1
- package/dist/machines/pagination/index.d.cts +1 -1
- package/dist/machines/pagination/index.d.mts +1 -1
- package/dist/machines/password-input/index.d.cts +1 -1
- package/dist/machines/password-input/index.d.mts +1 -1
- package/dist/machines/popover/index.d.cts +1 -1
- package/dist/machines/popover/index.d.mts +1 -1
- package/dist/machines/progress/index.d.cts +1 -1
- package/dist/machines/progress/index.d.mts +1 -1
- package/dist/machines/radio-group/index.d.cts +1 -1
- package/dist/machines/radio-group/index.d.mts +1 -1
- package/dist/machines/select/index.d.cts +1 -1
- package/dist/machines/select/index.d.mts +1 -1
- package/dist/machines/signature-pad/index.d.cts +1 -1
- package/dist/machines/signature-pad/index.d.mts +1 -1
- package/dist/machines/slider/index.d.cts +1 -1
- package/dist/machines/slider/index.d.mts +1 -1
- package/dist/machines/splitter/index.d.cts +1 -1
- package/dist/machines/splitter/index.d.mts +1 -1
- package/dist/machines/steps/index.d.cts +1 -1
- package/dist/machines/steps/index.d.mts +1 -1
- package/dist/machines/switch/index.d.cts +1 -1
- package/dist/machines/switch/index.d.mts +1 -1
- package/dist/machines/tabs/index.d.cts +1 -1
- package/dist/machines/tabs/index.d.mts +1 -1
- package/dist/machines/tags-input/index.d.cts +1 -1
- package/dist/machines/tags-input/index.d.mts +1 -1
- package/dist/machines/timer/index.d.cts +1 -1
- package/dist/machines/timer/index.d.mts +1 -1
- package/dist/machines/toast/index.d.cts +1 -1
- package/dist/machines/toast/index.d.mts +1 -1
- package/dist/machines/tour/index.d.cts +1 -1
- package/dist/machines/tour/index.d.mts +1 -1
- package/dist/machines/tree-view/index.d.cts +1 -1
- package/dist/machines/tree-view/index.d.mts +1 -1
- package/package.json +1 -1
|
@@ -90,27 +90,32 @@ function getEndDate(startDate, duration) {
|
|
|
90
90
|
//#endregion
|
|
91
91
|
//#region src/shared/date-utils/get-era-format.ts
|
|
92
92
|
function getEraFormat(date) {
|
|
93
|
-
|
|
93
|
+
if (!date) return void 0;
|
|
94
|
+
const id = date.calendar.identifier;
|
|
95
|
+
if (id === "gregory" || id === "iso8601") return date.era === "BC" ? "short" : void 0;
|
|
96
|
+
return "short";
|
|
94
97
|
}
|
|
95
98
|
//#endregion
|
|
96
99
|
//#region src/shared/date-utils/formatter.ts
|
|
97
|
-
function getDayFormatter(locale, timeZone) {
|
|
100
|
+
function getDayFormatter(locale, timeZone, referenceDate) {
|
|
101
|
+
const date = referenceDate ?? (0, _internationalized_date.toCalendarDateTime)((0, _internationalized_date.today)(timeZone));
|
|
98
102
|
return new _internationalized_date.DateFormatter(locale, {
|
|
99
103
|
weekday: "long",
|
|
100
104
|
month: "long",
|
|
101
105
|
year: "numeric",
|
|
102
106
|
day: "numeric",
|
|
103
|
-
era: getEraFormat(
|
|
107
|
+
era: getEraFormat(date),
|
|
108
|
+
calendar: date.calendar.identifier,
|
|
104
109
|
timeZone
|
|
105
110
|
});
|
|
106
111
|
}
|
|
107
|
-
function getMonthFormatter(locale, timeZone) {
|
|
108
|
-
const date = (0, _internationalized_date.today)(timeZone);
|
|
112
|
+
function getMonthFormatter(locale, timeZone, referenceDate) {
|
|
113
|
+
const date = referenceDate ?? (0, _internationalized_date.today)(timeZone);
|
|
109
114
|
return new _internationalized_date.DateFormatter(locale, {
|
|
110
115
|
month: "long",
|
|
111
116
|
year: "numeric",
|
|
112
117
|
era: getEraFormat(date),
|
|
113
|
-
calendar: date
|
|
118
|
+
calendar: date.calendar.identifier,
|
|
114
119
|
timeZone
|
|
115
120
|
});
|
|
116
121
|
}
|
|
@@ -214,12 +219,25 @@ function getWeekDays(date, startOfWeekProp, timeZone, locale) {
|
|
|
214
219
|
const format = getWeekdayFormats(locale, timeZone);
|
|
215
220
|
return weeks.map((index) => format(firstDayOfWeek.add({ days: index })));
|
|
216
221
|
}
|
|
217
|
-
function getMonthNames(locale, format = "long") {
|
|
218
|
-
|
|
222
|
+
function getMonthNames(locale, format = "long", referenceDate) {
|
|
223
|
+
if (!referenceDate || referenceDate.calendar.identifier === "gregory" || referenceDate.calendar.identifier === "iso8601") {
|
|
224
|
+
const date = new Date(2021, 0, 1);
|
|
225
|
+
const monthNames = [];
|
|
226
|
+
for (let i = 0; i < 12; i++) {
|
|
227
|
+
monthNames.push(date.toLocaleString(locale, { month: format }));
|
|
228
|
+
date.setMonth(date.getMonth() + 1);
|
|
229
|
+
}
|
|
230
|
+
return monthNames;
|
|
231
|
+
}
|
|
232
|
+
const monthCount = referenceDate.calendar.getMonthsInYear(referenceDate);
|
|
233
|
+
const formatter = new _internationalized_date.DateFormatter(locale, {
|
|
234
|
+
month: format,
|
|
235
|
+
calendar: referenceDate.calendar.identifier
|
|
236
|
+
});
|
|
219
237
|
const monthNames = [];
|
|
220
|
-
for (let
|
|
221
|
-
|
|
222
|
-
|
|
238
|
+
for (let month = 1; month <= monthCount; month++) {
|
|
239
|
+
const d = referenceDate.set({ month });
|
|
240
|
+
monthNames.push(formatter.format(d.toDate("UTC")));
|
|
223
241
|
}
|
|
224
242
|
return monthNames;
|
|
225
243
|
}
|
|
@@ -248,6 +266,15 @@ function getYearsRange(range) {
|
|
|
248
266
|
for (let year = range.from; year <= range.to; year += 1) years.push(year);
|
|
249
267
|
return years;
|
|
250
268
|
}
|
|
269
|
+
const DEFAULT_MIN_YEAR = 1900;
|
|
270
|
+
const DEFAULT_MAX_YEAR = 2099;
|
|
271
|
+
function getDefaultYearRange(referenceDate, min, max) {
|
|
272
|
+
const calendar = referenceDate.calendar;
|
|
273
|
+
return {
|
|
274
|
+
from: min?.year ?? (0, _internationalized_date.toCalendar)(new _internationalized_date.CalendarDate(DEFAULT_MIN_YEAR, 1, 1), calendar).year,
|
|
275
|
+
to: max?.year ?? (0, _internationalized_date.toCalendar)(new _internationalized_date.CalendarDate(DEFAULT_MAX_YEAR, 12, 31), calendar).year
|
|
276
|
+
};
|
|
277
|
+
}
|
|
251
278
|
const FUTURE_YEAR_COERCION = 10;
|
|
252
279
|
function normalizeYear(year) {
|
|
253
280
|
if (!year) return;
|
|
@@ -271,8 +298,10 @@ function getDecadeRange(year, opts) {
|
|
|
271
298
|
}
|
|
272
299
|
//#endregion
|
|
273
300
|
//#region src/shared/date-utils/mutation.ts
|
|
274
|
-
function getTodayDate(timeZone) {
|
|
275
|
-
|
|
301
|
+
function getTodayDate(timeZone, calendar) {
|
|
302
|
+
const tod = (0, _internationalized_date.today)(timeZone ?? (0, _internationalized_date.getLocalTimeZone)());
|
|
303
|
+
if (calendar) return (0, _internationalized_date.toCalendar)(tod, calendar);
|
|
304
|
+
return tod;
|
|
276
305
|
}
|
|
277
306
|
function setCalendar(date, calendar) {
|
|
278
307
|
return (0, _internationalized_date.toCalendar)((0, _internationalized_date.toCalendarDateTime)(date), calendar);
|
|
@@ -565,6 +594,12 @@ Object.defineProperty(exports, "getDecadeRange", {
|
|
|
565
594
|
return getDecadeRange;
|
|
566
595
|
}
|
|
567
596
|
});
|
|
597
|
+
Object.defineProperty(exports, "getDefaultYearRange", {
|
|
598
|
+
enumerable: true,
|
|
599
|
+
get: function() {
|
|
600
|
+
return getDefaultYearRange;
|
|
601
|
+
}
|
|
602
|
+
});
|
|
568
603
|
Object.defineProperty(exports, "getEndDate", {
|
|
569
604
|
enumerable: true,
|
|
570
605
|
get: function() {
|
|
@@ -89,27 +89,32 @@ function getEndDate(startDate, duration) {
|
|
|
89
89
|
//#endregion
|
|
90
90
|
//#region src/shared/date-utils/get-era-format.ts
|
|
91
91
|
function getEraFormat(date) {
|
|
92
|
-
|
|
92
|
+
if (!date) return void 0;
|
|
93
|
+
const id = date.calendar.identifier;
|
|
94
|
+
if (id === "gregory" || id === "iso8601") return date.era === "BC" ? "short" : void 0;
|
|
95
|
+
return "short";
|
|
93
96
|
}
|
|
94
97
|
//#endregion
|
|
95
98
|
//#region src/shared/date-utils/formatter.ts
|
|
96
|
-
function getDayFormatter(locale, timeZone) {
|
|
99
|
+
function getDayFormatter(locale, timeZone, referenceDate) {
|
|
100
|
+
const date = referenceDate ?? toCalendarDateTime(today(timeZone));
|
|
97
101
|
return new DateFormatter(locale, {
|
|
98
102
|
weekday: "long",
|
|
99
103
|
month: "long",
|
|
100
104
|
year: "numeric",
|
|
101
105
|
day: "numeric",
|
|
102
|
-
era: getEraFormat(
|
|
106
|
+
era: getEraFormat(date),
|
|
107
|
+
calendar: date.calendar.identifier,
|
|
103
108
|
timeZone
|
|
104
109
|
});
|
|
105
110
|
}
|
|
106
|
-
function getMonthFormatter(locale, timeZone) {
|
|
107
|
-
const date = today(timeZone);
|
|
111
|
+
function getMonthFormatter(locale, timeZone, referenceDate) {
|
|
112
|
+
const date = referenceDate ?? today(timeZone);
|
|
108
113
|
return new DateFormatter(locale, {
|
|
109
114
|
month: "long",
|
|
110
115
|
year: "numeric",
|
|
111
116
|
era: getEraFormat(date),
|
|
112
|
-
calendar: date
|
|
117
|
+
calendar: date.calendar.identifier,
|
|
113
118
|
timeZone
|
|
114
119
|
});
|
|
115
120
|
}
|
|
@@ -213,12 +218,25 @@ function getWeekDays(date, startOfWeekProp, timeZone, locale) {
|
|
|
213
218
|
const format = getWeekdayFormats(locale, timeZone);
|
|
214
219
|
return weeks.map((index) => format(firstDayOfWeek.add({ days: index })));
|
|
215
220
|
}
|
|
216
|
-
function getMonthNames(locale, format = "long") {
|
|
217
|
-
|
|
221
|
+
function getMonthNames(locale, format = "long", referenceDate) {
|
|
222
|
+
if (!referenceDate || referenceDate.calendar.identifier === "gregory" || referenceDate.calendar.identifier === "iso8601") {
|
|
223
|
+
const date = new Date(2021, 0, 1);
|
|
224
|
+
const monthNames = [];
|
|
225
|
+
for (let i = 0; i < 12; i++) {
|
|
226
|
+
monthNames.push(date.toLocaleString(locale, { month: format }));
|
|
227
|
+
date.setMonth(date.getMonth() + 1);
|
|
228
|
+
}
|
|
229
|
+
return monthNames;
|
|
230
|
+
}
|
|
231
|
+
const monthCount = referenceDate.calendar.getMonthsInYear(referenceDate);
|
|
232
|
+
const formatter = new DateFormatter(locale, {
|
|
233
|
+
month: format,
|
|
234
|
+
calendar: referenceDate.calendar.identifier
|
|
235
|
+
});
|
|
218
236
|
const monthNames = [];
|
|
219
|
-
for (let
|
|
220
|
-
|
|
221
|
-
|
|
237
|
+
for (let month = 1; month <= monthCount; month++) {
|
|
238
|
+
const d = referenceDate.set({ month });
|
|
239
|
+
monthNames.push(formatter.format(d.toDate("UTC")));
|
|
222
240
|
}
|
|
223
241
|
return monthNames;
|
|
224
242
|
}
|
|
@@ -247,6 +265,15 @@ function getYearsRange(range) {
|
|
|
247
265
|
for (let year = range.from; year <= range.to; year += 1) years.push(year);
|
|
248
266
|
return years;
|
|
249
267
|
}
|
|
268
|
+
const DEFAULT_MIN_YEAR = 1900;
|
|
269
|
+
const DEFAULT_MAX_YEAR = 2099;
|
|
270
|
+
function getDefaultYearRange(referenceDate, min, max) {
|
|
271
|
+
const calendar = referenceDate.calendar;
|
|
272
|
+
return {
|
|
273
|
+
from: min?.year ?? toCalendar(new CalendarDate(DEFAULT_MIN_YEAR, 1, 1), calendar).year,
|
|
274
|
+
to: max?.year ?? toCalendar(new CalendarDate(DEFAULT_MAX_YEAR, 12, 31), calendar).year
|
|
275
|
+
};
|
|
276
|
+
}
|
|
250
277
|
const FUTURE_YEAR_COERCION = 10;
|
|
251
278
|
function normalizeYear(year) {
|
|
252
279
|
if (!year) return;
|
|
@@ -270,8 +297,10 @@ function getDecadeRange(year, opts) {
|
|
|
270
297
|
}
|
|
271
298
|
//#endregion
|
|
272
299
|
//#region src/shared/date-utils/mutation.ts
|
|
273
|
-
function getTodayDate(timeZone) {
|
|
274
|
-
|
|
300
|
+
function getTodayDate(timeZone, calendar) {
|
|
301
|
+
const tod = today(timeZone ?? getLocalTimeZone());
|
|
302
|
+
if (calendar) return toCalendar(tod, calendar);
|
|
303
|
+
return tod;
|
|
275
304
|
}
|
|
276
305
|
function setCalendar(date, calendar) {
|
|
277
306
|
return toCalendar(toCalendarDateTime(date), calendar);
|
|
@@ -474,4 +503,4 @@ function getDateRangePreset(preset, locale, timeZone) {
|
|
|
474
503
|
}
|
|
475
504
|
}
|
|
476
505
|
//#endregion
|
|
477
|
-
export {
|
|
506
|
+
export { formatVisibleRange as A, alignDate as B, getMonthNames as C, getWeekdayFormats as D, getWeekOfYear as E, isDateEqual as F, constrainStart as G, alignCenter as H, isDateOutsideRange as I, constrainValue as K, isDateUnavailable as L, getMonthFormatter as M, getEndDate as N, formatRange as O, getUnitDuration as P, isNextRangeInvalid as R, getMonthDays as S, getWeekDays as T, alignEnd as U, alignStartDate as V, alignStart as W, getDefaultYearRange as _, getNextRow as a, getDaysInWeek as b, getPreviousRow as c, getSectionStart as d, getPreviousAvailableDate as f, getDecadeRange as g, setDate as h, getNextPage as i, getDayFormatter as j, formatSelectedDate as k, getPreviousSection as l, setCalendar as m, parseDateString as n, getNextSection as o, getTodayDate as p, getAdjustedDateFn as r, getPreviousPage as s, getDateRangePreset as t, getSectionEnd as u, getYearsRange as v, getStartOfWeek as w, getEndOfWeek as x, normalizeYear as y, isPreviousRangeInvalid as z };
|
package/dist/date-utils.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_date_utils = require("./date-utils-
|
|
2
|
+
const require_date_utils = require("./date-utils-B-dqorZV.cjs");
|
|
3
3
|
exports.alignCenter = require_date_utils.alignCenter;
|
|
4
4
|
exports.alignDate = require_date_utils.alignDate;
|
|
5
5
|
exports.alignEnd = require_date_utils.alignEnd;
|
|
@@ -15,6 +15,7 @@ exports.getDateRangePreset = require_date_utils.getDateRangePreset;
|
|
|
15
15
|
exports.getDayFormatter = require_date_utils.getDayFormatter;
|
|
16
16
|
exports.getDaysInWeek = require_date_utils.getDaysInWeek;
|
|
17
17
|
exports.getDecadeRange = require_date_utils.getDecadeRange;
|
|
18
|
+
exports.getDefaultYearRange = require_date_utils.getDefaultYearRange;
|
|
18
19
|
exports.getEndDate = require_date_utils.getEndDate;
|
|
19
20
|
exports.getEndOfWeek = require_date_utils.getEndOfWeek;
|
|
20
21
|
exports.getMonthDays = require_date_utils.getMonthDays;
|
package/dist/date-utils.d.cts
CHANGED
|
@@ -35,8 +35,8 @@ declare function formatSelectedDate(startDate: DateValue | null | undefined, end
|
|
|
35
35
|
declare function formatVisibleRange(startDate: DateValue, endDate: DateValue | null, locale: string, timeZone: string): string;
|
|
36
36
|
//#endregion
|
|
37
37
|
//#region src/shared/date-utils/formatter.d.ts
|
|
38
|
-
declare function getDayFormatter(locale: string, timeZone: string): DateFormatter;
|
|
39
|
-
declare function getMonthFormatter(locale: string, timeZone: string): DateFormatter;
|
|
38
|
+
declare function getDayFormatter(locale: string, timeZone: string, referenceDate?: DateValue$1): DateFormatter;
|
|
39
|
+
declare function getMonthFormatter(locale: string, timeZone: string, referenceDate?: DateValue$1): DateFormatter;
|
|
40
40
|
//#endregion
|
|
41
41
|
//#region src/shared/date-utils/date-month.d.ts
|
|
42
42
|
declare function getStartOfWeek(date: DateValue$1, locale: string, firstDayOfWeek?: number): DateValue$1;
|
|
@@ -55,7 +55,7 @@ declare function getWeekDays(date: DateValue$1, startOfWeekProp: number | undefi
|
|
|
55
55
|
long: string;
|
|
56
56
|
narrow: string;
|
|
57
57
|
}[];
|
|
58
|
-
declare function getMonthNames(locale: string, format?: Intl.DateTimeFormatOptions["month"]): string[];
|
|
58
|
+
declare function getMonthNames(locale: string, format?: Intl.DateTimeFormatOptions["month"], referenceDate?: DateValue$1): string[];
|
|
59
59
|
declare function getWeekOfYear(date: DateValue$1, locale: string): number;
|
|
60
60
|
//#endregion
|
|
61
61
|
//#region src/shared/date-utils/date-year.d.ts
|
|
@@ -64,13 +64,14 @@ interface YearsRange {
|
|
|
64
64
|
to: number;
|
|
65
65
|
}
|
|
66
66
|
declare function getYearsRange(range: YearsRange): number[];
|
|
67
|
+
declare function getDefaultYearRange(referenceDate: DateValue$1, min?: DateValue$1, max?: DateValue$1): YearsRange;
|
|
67
68
|
declare function normalizeYear(year: string | null | undefined): string | undefined;
|
|
68
69
|
declare function getDecadeRange(year: number, opts?: {
|
|
69
70
|
strict?: boolean;
|
|
70
71
|
}): number[];
|
|
71
72
|
//#endregion
|
|
72
73
|
//#region src/shared/date-utils/mutation.d.ts
|
|
73
|
-
declare function getTodayDate(timeZone?: string): _internationalized_date0.CalendarDate;
|
|
74
|
+
declare function getTodayDate(timeZone?: string, calendar?: Calendar): _internationalized_date0.CalendarDate;
|
|
74
75
|
declare function setCalendar(date: DateValue$1, calendar: Calendar): _internationalized_date0.CalendarDateTime;
|
|
75
76
|
declare function setDate(date: DateValue$1, startDate: DateValue$1, isDateUnavailable: DateAvailableFn, locale: string, minValue: DateValue$1, maxValue: DateValue$1): DateValue$1 | undefined;
|
|
76
77
|
declare function getPreviousAvailableDate(date: DateValue$1, minValue: DateValue$1, locale: string, isDateUnavailable?: DateAvailableFn): DateValue$1 | undefined;
|
|
@@ -99,4 +100,4 @@ declare function parseDateString(date: string, locale: string, timeZone: string)
|
|
|
99
100
|
//#region src/shared/date-utils/preset.d.ts
|
|
100
101
|
declare function getDateRangePreset(preset: DateRangePreset, locale: string, timeZone: string): [DateValue$1, DateValue$1];
|
|
101
102
|
//#endregion
|
|
102
|
-
export { AdjustDateParams, AdjustDateReturn, DateAdjustFn, DateGranularity, DateRangePreset, DateValue, YearsRange, alignCenter, alignDate, alignEnd, alignStart, alignStartDate, constrainStart, constrainValue, formatRange, formatSelectedDate, formatVisibleRange, getAdjustedDateFn, getDateRangePreset, getDayFormatter, getDaysInWeek, getDecadeRange, getEndDate, getEndOfWeek, getMonthDays, getMonthFormatter, getMonthNames, getNextPage, getNextRow, getNextSection, getPreviousAvailableDate, getPreviousPage, getPreviousRow, getPreviousSection, getSectionEnd, getSectionStart, getStartOfWeek, getTodayDate, getUnitDuration, getWeekDays, getWeekOfYear, getWeekdayFormats, getYearsRange, isDateEqual, isDateOutsideRange, isDateUnavailable, isNextRangeInvalid, isPreviousRangeInvalid, normalizeYear, parseDateString, setCalendar, setDate };
|
|
103
|
+
export { AdjustDateParams, AdjustDateReturn, DateAdjustFn, DateGranularity, DateRangePreset, DateValue, YearsRange, alignCenter, alignDate, alignEnd, alignStart, alignStartDate, constrainStart, constrainValue, formatRange, formatSelectedDate, formatVisibleRange, getAdjustedDateFn, getDateRangePreset, getDayFormatter, getDaysInWeek, getDecadeRange, getDefaultYearRange, getEndDate, getEndOfWeek, getMonthDays, getMonthFormatter, getMonthNames, getNextPage, getNextRow, getNextSection, getPreviousAvailableDate, getPreviousPage, getPreviousRow, getPreviousSection, getSectionEnd, getSectionStart, getStartOfWeek, getTodayDate, getUnitDuration, getWeekDays, getWeekOfYear, getWeekdayFormats, getYearsRange, isDateEqual, isDateOutsideRange, isDateUnavailable, isNextRangeInvalid, isPreviousRangeInvalid, normalizeYear, parseDateString, setCalendar, setDate };
|
package/dist/date-utils.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { AdjustDateParams, AdjustDateReturn, DateAdjustFn, DateGranularity, DateRangePreset, DateValue, YearsRange, alignCenter, alignDate, alignEnd, alignStart, alignStartDate, constrainStart, constrainValue, formatRange, formatSelectedDate, formatVisibleRange, getAdjustedDateFn, getDateRangePreset, getDayFormatter, getDaysInWeek, getDecadeRange, getEndDate, getEndOfWeek, getMonthDays, getMonthFormatter, getMonthNames, getNextPage, getNextRow, getNextSection, getPreviousAvailableDate, getPreviousPage, getPreviousRow, getPreviousSection, getSectionEnd, getSectionStart, getStartOfWeek, getTodayDate, getUnitDuration, getWeekDays, getWeekOfYear, getWeekdayFormats, getYearsRange, isDateEqual, isDateOutsideRange, isDateUnavailable, isNextRangeInvalid, isPreviousRangeInvalid, normalizeYear, parseDateString, setCalendar, setDate };
|
|
1
|
+
import { $ as DateValue, A as getWeekdayFormats, B as alignStart, C as getDaysInWeek, D as getStartOfWeek, E as getMonthNames, F as formatVisibleRange, G as isDateUnavailable, H as constrainValue, I as getEndDate, J as alignDate, K as isNextRangeInvalid, L as getUnitDuration, M as getMonthFormatter, N as formatRange, O as getWeekDays, P as formatSelectedDate, Q as DateRangePreset, R as alignCenter, S as normalizeYear, T as getMonthDays, U as isDateEqual, V as constrainStart, W as isDateOutsideRange, X as DateAdjustFn, Y as alignStartDate, Z as DateGranularity, _ as setDate, a as getAdjustedDateFn, b as getDefaultYearRange, c as getNextSection, d as getPreviousSection, f as getSectionEnd, g as setCalendar, h as getTodayDate, i as AdjustDateReturn, j as getDayFormatter, k as getWeekOfYear, l as getPreviousPage, m as getPreviousAvailableDate, n as parseDateString, o as getNextPage, p as getSectionStart, q as isPreviousRangeInvalid, r as AdjustDateParams, s as getNextRow, t as getDateRangePreset, u as getPreviousRow, v as YearsRange, w as getEndOfWeek, x as getYearsRange, y as getDecadeRange, z as alignEnd } from "./index-BfUngXif.mjs";
|
|
2
|
+
export { AdjustDateParams, AdjustDateReturn, DateAdjustFn, DateGranularity, DateRangePreset, DateValue, YearsRange, alignCenter, alignDate, alignEnd, alignStart, alignStartDate, constrainStart, constrainValue, formatRange, formatSelectedDate, formatVisibleRange, getAdjustedDateFn, getDateRangePreset, getDayFormatter, getDaysInWeek, getDecadeRange, getDefaultYearRange, getEndDate, getEndOfWeek, getMonthDays, getMonthFormatter, getMonthNames, getNextPage, getNextRow, getNextSection, getPreviousAvailableDate, getPreviousPage, getPreviousRow, getPreviousSection, getSectionEnd, getSectionStart, getStartOfWeek, getTodayDate, getUnitDuration, getWeekDays, getWeekOfYear, getWeekdayFormats, getYearsRange, isDateEqual, isDateOutsideRange, isDateUnavailable, isNextRangeInvalid, isPreviousRangeInvalid, normalizeYear, parseDateString, setCalendar, setDate };
|
package/dist/date-utils.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { alignCenter, alignDate, alignEnd, alignStart, alignStartDate, constrainStart, constrainValue, formatRange, formatSelectedDate, formatVisibleRange, getAdjustedDateFn, getDateRangePreset, getDayFormatter, getDaysInWeek, getDecadeRange, getEndDate, getEndOfWeek, getMonthDays, getMonthFormatter, getMonthNames, getNextPage, getNextRow, getNextSection, getPreviousAvailableDate, getPreviousPage, getPreviousRow, getPreviousSection, getSectionEnd, getSectionStart, getStartOfWeek, getTodayDate, getUnitDuration, getWeekDays, getWeekOfYear, getWeekdayFormats, getYearsRange, isDateEqual, isDateOutsideRange, isDateUnavailable, isNextRangeInvalid, isPreviousRangeInvalid, normalizeYear, parseDateString, setCalendar, setDate };
|
|
1
|
+
import { A as formatVisibleRange, B as alignDate, C as getMonthNames, D as getWeekdayFormats, E as getWeekOfYear, F as isDateEqual, G as constrainStart, H as alignCenter, I as isDateOutsideRange, K as constrainValue, L as isDateUnavailable, M as getMonthFormatter, N as getEndDate, O as formatRange, P as getUnitDuration, R as isNextRangeInvalid, S as getMonthDays, T as getWeekDays, U as alignEnd, V as alignStartDate, W as alignStart, _ as getDefaultYearRange, a as getNextRow, b as getDaysInWeek, c as getPreviousRow, d as getSectionStart, f as getPreviousAvailableDate, g as getDecadeRange, h as setDate, i as getNextPage, j as getDayFormatter, k as formatSelectedDate, l as getPreviousSection, m as setCalendar, n as parseDateString, o as getNextSection, p as getTodayDate, r as getAdjustedDateFn, s as getPreviousPage, t as getDateRangePreset, u as getSectionEnd, v as getYearsRange, w as getStartOfWeek, x as getEndOfWeek, y as normalizeYear, z as isPreviousRangeInvalid } from "./date-utils-BdeeOQRI.mjs";
|
|
2
|
+
export { alignCenter, alignDate, alignEnd, alignStart, alignStartDate, constrainStart, constrainValue, formatRange, formatSelectedDate, formatVisibleRange, getAdjustedDateFn, getDateRangePreset, getDayFormatter, getDaysInWeek, getDecadeRange, getDefaultYearRange, getEndDate, getEndOfWeek, getMonthDays, getMonthFormatter, getMonthNames, getNextPage, getNextRow, getNextSection, getPreviousAvailableDate, getPreviousPage, getPreviousRow, getPreviousSection, getSectionEnd, getSectionStart, getStartOfWeek, getTodayDate, getUnitDuration, getWeekDays, getWeekOfYear, getWeekdayFormats, getYearsRange, isDateEqual, isDateOutsideRange, isDateUnavailable, isNextRangeInvalid, isPreviousRangeInvalid, normalizeYear, parseDateString, setCalendar, setDate };
|
|
@@ -49,8 +49,8 @@ declare function formatSelectedDate(startDate: DateValue$1 | null | undefined, e
|
|
|
49
49
|
declare function formatVisibleRange(startDate: DateValue$1, endDate: DateValue$1 | null, locale: string, timeZone: string): string;
|
|
50
50
|
//#endregion
|
|
51
51
|
//#region src/shared/date-utils/formatter.d.ts
|
|
52
|
-
declare function getDayFormatter(locale: string, timeZone: string): DateFormatter;
|
|
53
|
-
declare function getMonthFormatter(locale: string, timeZone: string): DateFormatter;
|
|
52
|
+
declare function getDayFormatter(locale: string, timeZone: string, referenceDate?: DateValue): DateFormatter;
|
|
53
|
+
declare function getMonthFormatter(locale: string, timeZone: string, referenceDate?: DateValue): DateFormatter;
|
|
54
54
|
//#endregion
|
|
55
55
|
//#region src/shared/date-utils/date-month.d.ts
|
|
56
56
|
declare function getStartOfWeek(date: DateValue, locale: string, firstDayOfWeek?: number): DateValue;
|
|
@@ -69,7 +69,7 @@ declare function getWeekDays(date: DateValue, startOfWeekProp: number | undefine
|
|
|
69
69
|
long: string;
|
|
70
70
|
narrow: string;
|
|
71
71
|
}[];
|
|
72
|
-
declare function getMonthNames(locale: string, format?: Intl.DateTimeFormatOptions["month"]): string[];
|
|
72
|
+
declare function getMonthNames(locale: string, format?: Intl.DateTimeFormatOptions["month"], referenceDate?: DateValue): string[];
|
|
73
73
|
declare function getWeekOfYear(date: DateValue, locale: string): number;
|
|
74
74
|
//#endregion
|
|
75
75
|
//#region src/shared/date-utils/date-year.d.ts
|
|
@@ -78,13 +78,14 @@ interface YearsRange {
|
|
|
78
78
|
to: number;
|
|
79
79
|
}
|
|
80
80
|
declare function getYearsRange(range: YearsRange): number[];
|
|
81
|
+
declare function getDefaultYearRange(referenceDate: DateValue, min?: DateValue, max?: DateValue): YearsRange;
|
|
81
82
|
declare function normalizeYear(year: string | null | undefined): string | undefined;
|
|
82
83
|
declare function getDecadeRange(year: number, opts?: {
|
|
83
84
|
strict?: boolean;
|
|
84
85
|
}): number[];
|
|
85
86
|
//#endregion
|
|
86
87
|
//#region src/shared/date-utils/mutation.d.ts
|
|
87
|
-
declare function getTodayDate(timeZone?: string): _internationalized_date0.CalendarDate;
|
|
88
|
+
declare function getTodayDate(timeZone?: string, calendar?: Calendar): _internationalized_date0.CalendarDate;
|
|
88
89
|
declare function setCalendar(date: DateValue, calendar: Calendar): _internationalized_date0.CalendarDateTime;
|
|
89
90
|
declare function setDate(date: DateValue, startDate: DateValue, isDateUnavailable: DateAvailableFn, locale: string, minValue: DateValue, maxValue: DateValue): DateValue | undefined;
|
|
90
91
|
declare function getPreviousAvailableDate(date: DateValue, minValue: DateValue, locale: string, isDateUnavailable?: DateAvailableFn): DateValue | undefined;
|
|
@@ -113,4 +114,4 @@ declare function parseDateString(date: string, locale: string, timeZone: string)
|
|
|
113
114
|
//#region src/shared/date-utils/preset.d.ts
|
|
114
115
|
declare function getDateRangePreset(preset: DateRangePreset, locale: string, timeZone: string): [DateValue, DateValue];
|
|
115
116
|
//#endregion
|
|
116
|
-
export {
|
|
117
|
+
export { DateValue$1 as $, getWeekdayFormats as A, alignStart as B, getDaysInWeek as C, getStartOfWeek as D, getMonthNames as E, formatVisibleRange as F, isDateUnavailable as G, constrainValue as H, getEndDate as I, alignDate as J, isNextRangeInvalid as K, getUnitDuration as L, getMonthFormatter as M, formatRange as N, getWeekDays as O, formatSelectedDate as P, DateRangePreset as Q, alignCenter as R, normalizeYear as S, getMonthDays as T, isDateEqual as U, constrainStart as V, isDateOutsideRange as W, DateAdjustFn as X, alignStartDate as Y, DateGranularity as Z, setDate as _, getAdjustedDateFn as a, getDefaultYearRange as b, getNextSection as c, getPreviousSection as d, getSectionEnd as f, setCalendar as g, getTodayDate as h, AdjustDateReturn as i, getDayFormatter as j, getWeekOfYear as k, getPreviousPage as l, getPreviousAvailableDate as m, parseDateString as n, getNextPage as o, getSectionStart as p, isPreviousRangeInvalid as q, AdjustDateParams as r, getNextRow as s, getDateRangePreset as t, getPreviousRow as u, YearsRange as v, getEndOfWeek as w, getYearsRange as x, getDecadeRange as y, alignEnd as z };
|
|
@@ -3,7 +3,7 @@ import { p as Machine, u as EventObject, y as Service } from "../../types-B24gMT
|
|
|
3
3
|
import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-CLRsezW5.cjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/accordion/accordion.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"root" | "item" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"root" | "item" | "itemIndicator" | "itemTrigger" | "itemContent">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/accordion/accordion.types.d.ts
|
|
9
9
|
interface ValueChangeDetails {
|
|
@@ -3,7 +3,7 @@ import { p as Machine, u as EventObject, y as Service } from "../../types-DUM9rz
|
|
|
3
3
|
import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-BVFlU3b9.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/accordion/accordion.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"root" | "item" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"root" | "item" | "itemIndicator" | "itemTrigger" | "itemContent">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/accordion/accordion.types.d.ts
|
|
9
9
|
interface ValueChangeDetails {
|
|
@@ -19,11 +19,24 @@ const getLabelId = (ctx) => ctx.ids?.label ?? `angle-slider:${ctx.id}:label`;
|
|
|
19
19
|
const getHiddenInputEl = (ctx) => ctx.getById(getHiddenInputId(ctx));
|
|
20
20
|
const getControlEl = (ctx) => ctx.getById(getControlId(ctx));
|
|
21
21
|
const getThumbEl = (ctx) => ctx.getById(getThumbId(ctx));
|
|
22
|
-
function
|
|
23
|
-
|
|
22
|
+
function mirrorAngle(angle) {
|
|
23
|
+
return (360 - angle) % 360;
|
|
24
|
+
}
|
|
25
|
+
function getAngle(controlEl, point, angularOffset, dir) {
|
|
26
|
+
let angle = require_rect_utils.getPointAngle(require_rect_utils.createRect(controlEl.getBoundingClientRect()), point);
|
|
24
27
|
if (angularOffset != null) return angle - angularOffset;
|
|
28
|
+
if (dir === "rtl") angle = mirrorAngle(angle);
|
|
25
29
|
return angle;
|
|
26
30
|
}
|
|
31
|
+
function getPointerValue(controlEl, point, angularOffset, value, dir) {
|
|
32
|
+
if (angularOffset == null) return getAngle(controlEl, point, null, dir);
|
|
33
|
+
const angle = getAngle(controlEl, point);
|
|
34
|
+
const clickAngle = value + angularOffset;
|
|
35
|
+
return dir === "rtl" ? value + clickAngle - angle : angle - angularOffset;
|
|
36
|
+
}
|
|
37
|
+
function getDisplayAngle(value, dir) {
|
|
38
|
+
return dir === "rtl" ? mirrorAngle(value) : value;
|
|
39
|
+
}
|
|
27
40
|
function clampAngle(degree) {
|
|
28
41
|
return Math.min(Math.max(degree, 0), 359);
|
|
29
42
|
}
|
|
@@ -43,6 +56,8 @@ function connect(service, normalize) {
|
|
|
43
56
|
const dragging = state.matches("dragging");
|
|
44
57
|
const value = context.get("value");
|
|
45
58
|
const valueAsDegree = computed("valueAsDegree");
|
|
59
|
+
const dir = prop("dir");
|
|
60
|
+
const displayAngle = getDisplayAngle(value, dir);
|
|
46
61
|
const disabled = prop("disabled");
|
|
47
62
|
const invalid = prop("invalid");
|
|
48
63
|
const readOnly = prop("readOnly");
|
|
@@ -63,12 +78,13 @@ function connect(service, normalize) {
|
|
|
63
78
|
return normalize.element({
|
|
64
79
|
...parts.root.attrs,
|
|
65
80
|
id: getRootId(scope),
|
|
81
|
+
dir: prop("dir"),
|
|
66
82
|
"data-disabled": require_dom_query.dataAttr(disabled),
|
|
67
83
|
"data-invalid": require_dom_query.dataAttr(invalid),
|
|
68
84
|
"data-readonly": require_dom_query.dataAttr(readOnly),
|
|
69
85
|
style: {
|
|
70
86
|
"--value": value,
|
|
71
|
-
"--angle":
|
|
87
|
+
"--angle": `${displayAngle}deg`
|
|
72
88
|
}
|
|
73
89
|
});
|
|
74
90
|
},
|
|
@@ -77,6 +93,7 @@ function connect(service, normalize) {
|
|
|
77
93
|
...parts.label.attrs,
|
|
78
94
|
id: getLabelId(scope),
|
|
79
95
|
htmlFor: getHiddenInputId(scope),
|
|
96
|
+
dir: prop("dir"),
|
|
80
97
|
"data-disabled": require_dom_query.dataAttr(disabled),
|
|
81
98
|
"data-invalid": require_dom_query.dataAttr(invalid),
|
|
82
99
|
"data-readonly": require_dom_query.dataAttr(readOnly),
|
|
@@ -92,7 +109,8 @@ function connect(service, normalize) {
|
|
|
92
109
|
type: "hidden",
|
|
93
110
|
value,
|
|
94
111
|
name: prop("name"),
|
|
95
|
-
id: getHiddenInputId(scope)
|
|
112
|
+
id: getHiddenInputId(scope),
|
|
113
|
+
dir: prop("dir")
|
|
96
114
|
});
|
|
97
115
|
},
|
|
98
116
|
getControlProps() {
|
|
@@ -100,6 +118,7 @@ function connect(service, normalize) {
|
|
|
100
118
|
...parts.control.attrs,
|
|
101
119
|
role: "presentation",
|
|
102
120
|
id: getControlId(scope),
|
|
121
|
+
dir: prop("dir"),
|
|
103
122
|
"data-disabled": require_dom_query.dataAttr(disabled),
|
|
104
123
|
"data-invalid": require_dom_query.dataAttr(invalid),
|
|
105
124
|
"data-readonly": require_dom_query.dataAttr(readOnly),
|
|
@@ -132,6 +151,7 @@ function connect(service, normalize) {
|
|
|
132
151
|
...parts.thumb.attrs,
|
|
133
152
|
id: getThumbId(scope),
|
|
134
153
|
role: "slider",
|
|
154
|
+
dir: prop("dir"),
|
|
135
155
|
"aria-label": ariaLabel,
|
|
136
156
|
"aria-labelledby": ariaLabelledBy ?? getLabelId(scope),
|
|
137
157
|
"aria-valuemax": 360,
|
|
@@ -150,32 +170,44 @@ function connect(service, normalize) {
|
|
|
150
170
|
onKeyDown(event) {
|
|
151
171
|
if (!interactive) return;
|
|
152
172
|
const step = require_dom_query.getEventStep(event) * prop("step");
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
173
|
+
const exec = {
|
|
174
|
+
ArrowLeft() {
|
|
175
|
+
send({
|
|
176
|
+
type: "THUMB.ARROW_DEC",
|
|
177
|
+
step
|
|
178
|
+
});
|
|
179
|
+
},
|
|
180
|
+
ArrowUp() {
|
|
157
181
|
send({
|
|
158
182
|
type: "THUMB.ARROW_DEC",
|
|
159
183
|
step
|
|
160
184
|
});
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
case "ArrowDown":
|
|
164
|
-
event.preventDefault();
|
|
185
|
+
},
|
|
186
|
+
ArrowRight() {
|
|
165
187
|
send({
|
|
166
188
|
type: "THUMB.ARROW_INC",
|
|
167
189
|
step
|
|
168
190
|
});
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
191
|
+
},
|
|
192
|
+
ArrowDown() {
|
|
193
|
+
send({
|
|
194
|
+
type: "THUMB.ARROW_INC",
|
|
195
|
+
step
|
|
196
|
+
});
|
|
197
|
+
},
|
|
198
|
+
Home() {
|
|
172
199
|
send({ type: "THUMB.HOME" });
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
event.preventDefault();
|
|
200
|
+
},
|
|
201
|
+
End() {
|
|
176
202
|
send({ type: "THUMB.END" });
|
|
177
|
-
|
|
178
|
-
|
|
203
|
+
}
|
|
204
|
+
}[require_dom_query.getEventKey(event, {
|
|
205
|
+
dir: prop("dir"),
|
|
206
|
+
orientation: "horizontal"
|
|
207
|
+
})];
|
|
208
|
+
if (exec) {
|
|
209
|
+
exec(event);
|
|
210
|
+
event.preventDefault();
|
|
179
211
|
}
|
|
180
212
|
},
|
|
181
213
|
style: { rotate: `var(--angle)` }
|
|
@@ -184,25 +216,32 @@ function connect(service, normalize) {
|
|
|
184
216
|
getValueTextProps() {
|
|
185
217
|
return normalize.element({
|
|
186
218
|
...parts.valueText.attrs,
|
|
187
|
-
id: getValueTextId(scope)
|
|
219
|
+
id: getValueTextId(scope),
|
|
220
|
+
dir: prop("dir")
|
|
188
221
|
});
|
|
189
222
|
},
|
|
190
223
|
getMarkerGroupProps() {
|
|
191
|
-
return normalize.element({
|
|
224
|
+
return normalize.element({
|
|
225
|
+
...parts.markerGroup.attrs,
|
|
226
|
+
dir: prop("dir")
|
|
227
|
+
});
|
|
192
228
|
},
|
|
193
229
|
getMarkerProps(props) {
|
|
194
230
|
let markerState;
|
|
195
231
|
if (props.value < value) markerState = "under-value";
|
|
196
232
|
else if (props.value > value) markerState = "over-value";
|
|
197
233
|
else markerState = "at-value";
|
|
234
|
+
const markerDisplayAngle = getDisplayAngle(props.value, dir);
|
|
198
235
|
return normalize.element({
|
|
199
236
|
...parts.marker.attrs,
|
|
237
|
+
dir: prop("dir"),
|
|
200
238
|
"data-value": props.value,
|
|
201
239
|
"data-state": markerState,
|
|
202
240
|
"data-disabled": require_dom_query.dataAttr(disabled),
|
|
203
241
|
style: {
|
|
204
242
|
"--marker-value": props.value,
|
|
205
|
-
|
|
243
|
+
"--marker-display-value": markerDisplayAngle,
|
|
244
|
+
rotate: `calc(var(--marker-display-value) * 1deg)`
|
|
206
245
|
}
|
|
207
246
|
});
|
|
208
247
|
}
|
|
@@ -313,7 +352,8 @@ const machine = require_core.createMachine({
|
|
|
313
352
|
const controlEl = getControlEl(scope);
|
|
314
353
|
if (!controlEl) return;
|
|
315
354
|
const angularOffset = refs.get("thumbDragOffset");
|
|
316
|
-
const
|
|
355
|
+
const value = context.get("value");
|
|
356
|
+
const deg = getPointerValue(controlEl, event.point, angularOffset, value, prop("dir"));
|
|
317
357
|
context.set("value", constrainAngle(deg, prop("step")));
|
|
318
358
|
},
|
|
319
359
|
setValueToMin({ context }) {
|
|
@@ -3,7 +3,7 @@ import { p as Machine, u as EventObject, y as Service } from "../../types-B24gMT
|
|
|
3
3
|
import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-CLRsezW5.cjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/angle-slider/angle-slider.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"root" | "label" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"root" | "label" | "thumb" | "valueText" | "track" | "control" | "markerGroup" | "marker">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/angle-slider/angle-slider.types.d.ts
|
|
9
9
|
interface ValueChangeDetails {
|
|
@@ -3,7 +3,7 @@ import { p as Machine, u as EventObject, y as Service } from "../../types-DUM9rz
|
|
|
3
3
|
import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-BVFlU3b9.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/angle-slider/angle-slider.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"root" | "label" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"root" | "label" | "thumb" | "valueText" | "track" | "control" | "markerGroup" | "marker">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/angle-slider/angle-slider.types.d.ts
|
|
9
9
|
interface ValueChangeDetails {
|