@frontify/fondue-components 29.0.1 → 29.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fondue-components111.js +3 -15
- package/dist/fondue-components111.js.map +1 -1
- package/dist/fondue-components112.js +5 -127
- package/dist/fondue-components112.js.map +1 -1
- package/dist/fondue-components113.js +14 -11
- package/dist/fondue-components113.js.map +1 -1
- package/dist/fondue-components114.js +17 -36
- package/dist/fondue-components114.js.map +1 -1
- package/dist/fondue-components115.js +111 -14
- package/dist/fondue-components115.js.map +1 -1
- package/dist/fondue-components116.js +12 -14
- package/dist/fondue-components116.js.map +1 -1
- package/dist/fondue-components117.js +16 -110
- package/dist/fondue-components117.js.map +1 -1
- package/dist/fondue-components118.js +10 -10
- package/dist/fondue-components118.js.map +1 -1
- package/dist/fondue-components119.js +17 -17
- package/dist/fondue-components119.js.map +1 -1
- package/dist/fondue-components120.js +126 -12
- package/dist/fondue-components120.js.map +1 -1
- package/dist/fondue-components121.js +11 -217
- package/dist/fondue-components121.js.map +1 -1
- package/dist/fondue-components122.js +34 -17
- package/dist/fondue-components122.js.map +1 -1
- package/dist/fondue-components123.js +214 -14
- package/dist/fondue-components123.js.map +1 -1
- package/dist/fondue-components124.js +17 -149
- package/dist/fondue-components124.js.map +1 -1
- package/dist/fondue-components125.js +16 -44
- package/dist/fondue-components125.js.map +1 -1
- package/dist/fondue-components126.js +150 -4
- package/dist/fondue-components126.js.map +1 -1
- package/dist/fondue-components127.js +44 -4
- package/dist/fondue-components127.js.map +1 -1
- package/dist/fondue-components128.js +31 -18
- package/dist/fondue-components128.js.map +1 -1
- package/dist/fondue-components131.js +170 -6
- package/dist/fondue-components131.js.map +1 -1
- package/dist/fondue-components132.js +60 -12
- package/dist/fondue-components132.js.map +1 -1
- package/dist/fondue-components133.js +9 -71
- package/dist/fondue-components133.js.map +1 -1
- package/dist/fondue-components134.js +255 -14
- package/dist/fondue-components134.js.map +1 -1
- package/dist/fondue-components135.js +6 -7
- package/dist/fondue-components135.js.map +1 -1
- package/dist/fondue-components136.js +11 -88
- package/dist/fondue-components136.js.map +1 -1
- package/dist/fondue-components137.js +69 -79
- package/dist/fondue-components137.js.map +1 -1
- package/dist/fondue-components138.js +14 -30
- package/dist/fondue-components138.js.map +1 -1
- package/dist/fondue-components139.js +7 -170
- package/dist/fondue-components139.js.map +1 -1
- package/dist/fondue-components140.js +86 -57
- package/dist/fondue-components140.js.map +1 -1
- package/dist/fondue-components141.js +81 -9
- package/dist/fondue-components141.js.map +1 -1
- package/dist/fondue-components142.js +29 -254
- package/dist/fondue-components142.js.map +1 -1
- package/dist/fondue-components145.js +2 -2
- package/dist/fondue-components147.js +2 -2
- package/dist/fondue-components148.js +1 -1
- package/dist/fondue-components43.js +2 -2
- package/dist/fondue-components50.js +1 -1
- package/dist/fondue-components60.js +10 -10
- package/dist/fondue-components60.js.map +1 -1
- package/dist/fondue-components61.js +3 -3
- package/dist/fondue-components62.js +2 -2
- package/dist/fondue-components74.js +2 -2
- package/dist/fondue-components77.js +1 -1
- package/dist/fondue-components78.js +1 -1
- package/dist/fondue-components79.js +1 -1
- package/dist/fondue-components82.js +1 -1
- package/dist/fondue-components84.js +2 -2
- package/dist/fondue-components90.js +2 -2
- package/dist/fondue-components91.js +2 -2
- package/dist/fondue-components92.js +2 -2
- package/dist/fondue-components93.js +2 -2
- package/dist/fondue-components94.js +1 -1
- package/dist/fondue-components95.js +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/style.css +1 -1
- package/package.json +3 -3
|
@@ -1,114 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return a.mode === "single" ? a.selected : (u = a.selected) == null ? void 0 : u.from;
|
|
17
|
-
}, [a]);
|
|
18
|
-
return /* @__PURE__ */ r("div", { ref: s, "data-test-id": t, className: e.wrapper, children: /* @__PURE__ */ r(
|
|
19
|
-
w,
|
|
20
|
-
{
|
|
21
|
-
navLayout: "around",
|
|
22
|
-
"data-test-id": t,
|
|
23
|
-
locale: n,
|
|
24
|
-
components: v(),
|
|
25
|
-
showOutsideDays: !0,
|
|
26
|
-
disabled: o,
|
|
27
|
-
defaultMonth: i,
|
|
28
|
-
dir: l,
|
|
29
|
-
timeZone: "UTC",
|
|
30
|
-
classNames: {
|
|
31
|
-
root: `${d.root} ${e.root}`,
|
|
32
|
-
day: `${e.day}`,
|
|
33
|
-
selected: `${e.selected}`,
|
|
34
|
-
week: `${d.week} ${e.week}`,
|
|
35
|
-
weekday: `${e.weekday}`,
|
|
36
|
-
weekdays: `${d.weekdays} ${e.weekdays}`,
|
|
37
|
-
range_start: `${e.selectedStart}`,
|
|
38
|
-
range_end: `${e.selectedEnd}`,
|
|
39
|
-
range_middle: `${e.selectedMiddle}`,
|
|
40
|
-
disabled: `${e.disabled}`,
|
|
41
|
-
outside: `${e.outside}`
|
|
42
|
-
},
|
|
43
|
-
...a,
|
|
44
|
-
modifiersClassNames: {
|
|
45
|
-
hoverAfter: `${e.hoverAfter}`,
|
|
46
|
-
hoverBefore: `${e.hoverBefore}`,
|
|
47
|
-
hoverSelected: `${e.hoverSelected}`
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
) });
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
N.displayName = "DatePickerCalendar";
|
|
54
|
-
const v = () => ({
|
|
55
|
-
DayButton: ({ day: t, modifiers: o, onClick: a, onMouseEnter: s, onMouseLeave: d, ...l }) => {
|
|
56
|
-
const n = p(null);
|
|
57
|
-
return y(() => {
|
|
58
|
-
var i;
|
|
59
|
-
o.focused && ((i = n.current) == null || i.focus());
|
|
60
|
-
}, [o.focused]), /* @__PURE__ */ r(
|
|
61
|
-
"button",
|
|
62
|
-
{
|
|
63
|
-
...l,
|
|
64
|
-
ref: n,
|
|
65
|
-
className: e.dayButton,
|
|
66
|
-
onClick: a,
|
|
67
|
-
onMouseEnter: s,
|
|
68
|
-
onMouseLeave: d,
|
|
69
|
-
type: "button",
|
|
70
|
-
children: /* @__PURE__ */ r("div", { className: `${e.dayContent} ${e.button}`, children: t.date.getDate() })
|
|
71
|
-
}
|
|
72
|
-
);
|
|
73
|
-
},
|
|
74
|
-
PreviousMonthButton: ({
|
|
75
|
-
onClick: t,
|
|
76
|
-
"aria-label": o,
|
|
77
|
-
"aria-disabled": a
|
|
78
|
-
}) => /* @__PURE__ */ r("div", { className: `${e.toggleMonthButtonContainer} `, children: /* @__PURE__ */ r(
|
|
79
|
-
c,
|
|
80
|
-
{
|
|
81
|
-
emphasis: "weak",
|
|
82
|
-
size: "small",
|
|
83
|
-
aspect: "square",
|
|
84
|
-
"aria-label": o,
|
|
85
|
-
"aria-disabled": a,
|
|
86
|
-
onPress: (s) => {
|
|
87
|
-
s && (t == null || t(s));
|
|
88
|
-
},
|
|
89
|
-
children: /* @__PURE__ */ r(f, { size: 16 })
|
|
90
|
-
}
|
|
91
|
-
) }),
|
|
92
|
-
NextMonthButton: ({
|
|
93
|
-
onClick: t,
|
|
94
|
-
"aria-label": o,
|
|
95
|
-
"aria-disabled": a
|
|
96
|
-
}) => /* @__PURE__ */ r("div", { className: `${e.toggleMonthButtonContainer} ${e.nextMonthButtonContainer}`, children: /* @__PURE__ */ r(
|
|
97
|
-
c,
|
|
98
|
-
{
|
|
99
|
-
emphasis: "weak",
|
|
100
|
-
size: "small",
|
|
101
|
-
aspect: "square",
|
|
102
|
-
"aria-label": o,
|
|
103
|
-
"aria-disabled": a,
|
|
104
|
-
onPress: (s) => {
|
|
105
|
-
s && (t == null || t(s));
|
|
106
|
-
},
|
|
107
|
-
children: /* @__PURE__ */ r(m, { size: 16 })
|
|
108
|
-
}
|
|
109
|
-
) })
|
|
1
|
+
import { useMemo as o } from "react";
|
|
2
|
+
const f = {
|
|
3
|
+
hoverBefore: !1,
|
|
4
|
+
hoverAfter: !1,
|
|
5
|
+
hoverSelected: !1
|
|
6
|
+
}, h = (r) => ({
|
|
7
|
+
hoverModifiers: o(() => !(r != null && r.from) || !(r != null && r.to) || (r == null ? void 0 : r.to.getTime()) > (r == null ? void 0 : r.from.getTime()) ? f : {
|
|
8
|
+
hoverBefore: {
|
|
9
|
+
before: r == null ? void 0 : r.from
|
|
10
|
+
},
|
|
11
|
+
hoverAfter: {
|
|
12
|
+
after: r == null ? void 0 : r.to
|
|
13
|
+
},
|
|
14
|
+
hoverSelected: r == null ? void 0 : r.from
|
|
15
|
+
}, [r])
|
|
110
16
|
});
|
|
111
17
|
export {
|
|
112
|
-
|
|
18
|
+
h as useRangeHover
|
|
113
19
|
};
|
|
114
20
|
//# sourceMappingURL=fondue-components117.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components117.js","sources":["../src/components/DatePicker/
|
|
1
|
+
{"version":3,"file":"fondue-components117.js","sources":["../src/components/DatePicker/hooks/useRangeHover.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { useMemo } from 'react';\nimport { type DateRange as InternalDayPickerDateRange } from 'react-day-picker';\n\ntype RangeHoverModifiers = {\n hoverBefore:\n | {\n before: Date;\n }\n | false;\n hoverAfter:\n | {\n after: Date;\n }\n | false;\n hoverSelected: Date | false;\n};\n\nconst DISABLED_MODIFIERS: RangeHoverModifiers = {\n hoverBefore: false,\n hoverAfter: false,\n hoverSelected: false,\n};\n\nexport const useRangeHover = (selectedDateRange?: InternalDayPickerDateRange) => {\n const hoverModifiers = useMemo(() => {\n if (\n !selectedDateRange?.from ||\n !selectedDateRange?.to ||\n selectedDateRange?.to.getTime() > selectedDateRange?.from.getTime()\n ) {\n return DISABLED_MODIFIERS;\n }\n return {\n hoverBefore: {\n before: selectedDateRange?.from,\n },\n hoverAfter: {\n after: selectedDateRange?.to,\n },\n hoverSelected: selectedDateRange?.from,\n };\n }, [selectedDateRange]);\n\n return {\n hoverModifiers,\n };\n};\n"],"names":["DISABLED_MODIFIERS","useRangeHover","selectedDateRange","useMemo"],"mappings":";AAmBA,MAAMA,IAA0C;AAAA,EAC5C,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,eAAe;AACnB,GAEaC,IAAgB,CAACC,OAoBnB;AAAA,EACH,gBApBmBC,EAAQ,MAEvB,EAACD,KAAA,QAAAA,EAAmB,SACpB,EAACA,KAAA,QAAAA,EAAmB,QACpBA,KAAA,gBAAAA,EAAmB,GAAG,cAAYA,KAAA,gBAAAA,EAAmB,KAAK,aAEnDF,IAEJ;AAAA,IACH,aAAa;AAAA,MACT,QAAQE,KAAA,gBAAAA,EAAmB;AAAA,IAAA;AAAA,IAE/B,YAAY;AAAA,MACR,OAAOA,KAAA,gBAAAA,EAAmB;AAAA,IAAA;AAAA,IAE9B,eAAeA,KAAA,gBAAAA,EAAmB;AAAA,EAAA,GAEvC,CAACA,CAAiB,CAAC;AAGlB;"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { useState as o, useMemo as
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
const [
|
|
5
|
-
return
|
|
6
|
-
|
|
7
|
-
handleSelect: (
|
|
8
|
-
const
|
|
9
|
-
|
|
1
|
+
import { useState as o, useMemo as i } from "react";
|
|
2
|
+
import { transformDatePickerDateToDate as m, transformDateToDatePickerDate as d } from "./fondue-components128.js";
|
|
3
|
+
const P = (e, t) => {
|
|
4
|
+
const [a, r] = o(e), [D, s] = o(e);
|
|
5
|
+
return D !== e && (s(e), r(e)), {
|
|
6
|
+
selectedDate: i(() => m(a), [a]),
|
|
7
|
+
handleSelect: (c) => {
|
|
8
|
+
const n = d(c);
|
|
9
|
+
r(n), t == null || t(n);
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
export {
|
|
14
|
-
|
|
14
|
+
P as useSingleDate
|
|
15
15
|
};
|
|
16
16
|
//# sourceMappingURL=fondue-components118.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components118.js","sources":["../src/components/DatePicker/hooks/
|
|
1
|
+
{"version":3,"file":"fondue-components118.js","sources":["../src/components/DatePicker/hooks/useSingleDate.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { useMemo, useState } from 'react';\nimport { type OnSelectHandler } from 'react-day-picker';\n\nimport { transformDatePickerDateToDate, transformDateToDatePickerDate } from '../helpers/dateTransformer';\nimport { type DatePickerDate } from '../types';\n\nexport const useSingleDate = (selected?: DatePickerDate, onSelect?: (date?: DatePickerDate) => void) => {\n const [internalSelectedDate, setInternalSelectedDate] = useState<DatePickerDate | undefined>(selected);\n const [prevSelected, setPrevSelected] = useState<DatePickerDate | undefined>(selected);\n\n if (prevSelected !== selected) {\n setPrevSelected(selected);\n setInternalSelectedDate(selected);\n }\n\n const selectedDate = useMemo(() => {\n return transformDatePickerDateToDate(internalSelectedDate);\n }, [internalSelectedDate]);\n\n const handleSelect: OnSelectHandler<Date> = (date) => {\n const datePickerDate = transformDateToDatePickerDate(date);\n\n setInternalSelectedDate(datePickerDate);\n onSelect?.(datePickerDate);\n };\n\n return {\n selectedDate,\n handleSelect,\n };\n};\n"],"names":["useSingleDate","selected","onSelect","internalSelectedDate","setInternalSelectedDate","useState","prevSelected","setPrevSelected","useMemo","transformDatePickerDateToDate","date","datePickerDate","transformDateToDatePickerDate"],"mappings":";;AAQO,MAAMA,IAAgB,CAACC,GAA2BC,MAA+C;AACpG,QAAM,CAACC,GAAsBC,CAAuB,IAAIC,EAAqCJ,CAAQ,GAC/F,CAACK,GAAcC,CAAe,IAAIF,EAAqCJ,CAAQ;AAErF,SAAIK,MAAiBL,MACjBM,EAAgBN,CAAQ,GACxBG,EAAwBH,CAAQ,IAc7B;AAAA,IACH,cAZiBO,EAAQ,MAClBC,EAA8BN,CAAoB,GAC1D,CAACA,CAAoB,CAAC;AAAA,IAWrB,cATwC,CAACO,MAAS;AAClD,YAAMC,IAAiBC,EAA8BF,CAAI;AAEzD,MAAAN,EAAwBO,CAAc,GACtCT,KAAA,QAAAA,EAAWS;AAAA,IACf;AAAA,EAII;AAER;"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
hoverAfter: {
|
|
12
|
-
after: r == null ? void 0 : r.to
|
|
13
|
-
},
|
|
14
|
-
hoverSelected: r == null ? void 0 : r.from
|
|
15
|
-
}, [r])
|
|
16
|
-
});
|
|
1
|
+
const o = "_root_18649_5", c = "_caret_18649_43", t = "_colorName_18649_58", _ = "_colorIndicator_18649_61", n = "_button_18649_82", r = "_actions_18649_113", a = "_clearIcon_18649_122", s = {
|
|
2
|
+
root: o,
|
|
3
|
+
caret: c,
|
|
4
|
+
colorName: t,
|
|
5
|
+
colorIndicator: _,
|
|
6
|
+
button: n,
|
|
7
|
+
actions: r,
|
|
8
|
+
clearIcon: a
|
|
9
|
+
};
|
|
17
10
|
export {
|
|
18
|
-
|
|
11
|
+
r as actions,
|
|
12
|
+
n as button,
|
|
13
|
+
c as caret,
|
|
14
|
+
a as clearIcon,
|
|
15
|
+
_ as colorIndicator,
|
|
16
|
+
t as colorName,
|
|
17
|
+
s as default,
|
|
18
|
+
o as root
|
|
19
19
|
};
|
|
20
20
|
//# sourceMappingURL=fondue-components119.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components119.js","sources":[
|
|
1
|
+
{"version":3,"file":"fondue-components119.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
|
@@ -1,16 +1,130 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { useCallback as c } from "react";
|
|
2
|
+
import { deepEqual as f } from "./fondue-components131.js";
|
|
3
|
+
import { defaultSortableTransition as x, Sortable as R } from "./fondue-components84.js";
|
|
4
|
+
import { isSortable as rr } from "./fondue-components84.js";
|
|
5
|
+
import { useInstance as T } from "@dnd-kit/react";
|
|
6
|
+
import { useDeepSignal as V, useOnValueChange as i, useIsomorphicLayoutEffect as k, useOnElementChange as m, useImmediateEffect as q } from "./fondue-components132.js";
|
|
7
|
+
import { currentValue as v } from "./fondue-components133.js";
|
|
8
|
+
import { batch as L } from "./fondue-components134.js";
|
|
9
|
+
var N = Object.defineProperty, U = Object.defineProperties, z = Object.getOwnPropertyDescriptors, I = Object.getOwnPropertySymbols, A = Object.prototype.hasOwnProperty, B = Object.prototype.propertyIsEnumerable, j = (o, t, a) => t in o ? N(o, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : o[t] = a, _ = (o, t) => {
|
|
10
|
+
for (var a in t || (t = {}))
|
|
11
|
+
A.call(t, a) && j(o, a, t[a]);
|
|
12
|
+
if (I)
|
|
13
|
+
for (var a of I(t))
|
|
14
|
+
B.call(t, a) && j(o, a, t[a]);
|
|
15
|
+
return o;
|
|
16
|
+
}, F = (o, t) => U(o, z(t));
|
|
17
|
+
function Y(o) {
|
|
18
|
+
const {
|
|
19
|
+
accept: t,
|
|
20
|
+
collisionDetector: a,
|
|
21
|
+
collisionPriority: b,
|
|
22
|
+
id: O,
|
|
23
|
+
data: p,
|
|
24
|
+
element: h,
|
|
25
|
+
handle: y,
|
|
26
|
+
index: g,
|
|
27
|
+
group: D,
|
|
28
|
+
disabled: P,
|
|
29
|
+
feedback: d,
|
|
30
|
+
modifiers: S,
|
|
31
|
+
sensors: w,
|
|
32
|
+
target: C,
|
|
33
|
+
type: E
|
|
34
|
+
} = o, l = _(_({}, x), o.transition), r = T((e) => new R(
|
|
35
|
+
F(_({}, o), {
|
|
36
|
+
transition: l,
|
|
37
|
+
register: !1,
|
|
38
|
+
handle: v(y),
|
|
39
|
+
element: v(h),
|
|
40
|
+
target: v(C),
|
|
41
|
+
feedback: d
|
|
42
|
+
}),
|
|
43
|
+
e
|
|
44
|
+
)), u = V(r, G);
|
|
45
|
+
return i(O, () => r.id = O), k(() => {
|
|
46
|
+
L(() => {
|
|
47
|
+
r.group = D, r.index = g;
|
|
48
|
+
});
|
|
49
|
+
}, [r, D, g]), i(E, () => r.type = E), i(
|
|
50
|
+
t,
|
|
51
|
+
() => r.accept = t,
|
|
52
|
+
void 0,
|
|
53
|
+
f
|
|
54
|
+
), i(p, () => p && (r.data = p)), i(
|
|
55
|
+
g,
|
|
56
|
+
() => {
|
|
57
|
+
var e;
|
|
58
|
+
(e = r.manager) != null && e.dragOperation.status.idle && (l != null && l.idle) && r.refreshShape();
|
|
59
|
+
},
|
|
60
|
+
q
|
|
61
|
+
), m(y, (e) => r.handle = e), m(h, (e) => r.element = e), m(C, (e) => r.target = e), i(P, () => r.disabled = P === !0), i(w, () => r.sensors = w), i(
|
|
62
|
+
a,
|
|
63
|
+
() => r.collisionDetector = a
|
|
64
|
+
), i(
|
|
65
|
+
b,
|
|
66
|
+
() => r.collisionPriority = b
|
|
67
|
+
), i(d, () => r.feedback = d ?? "default"), i(
|
|
68
|
+
l,
|
|
69
|
+
() => r.transition = l,
|
|
70
|
+
void 0,
|
|
71
|
+
f
|
|
72
|
+
), i(
|
|
73
|
+
S,
|
|
74
|
+
() => r.modifiers = S,
|
|
75
|
+
void 0,
|
|
76
|
+
f
|
|
77
|
+
), i(
|
|
78
|
+
o.alignment,
|
|
79
|
+
() => r.alignment = o.alignment
|
|
80
|
+
), {
|
|
81
|
+
sortable: u,
|
|
82
|
+
get isDragging() {
|
|
83
|
+
return u.isDragging;
|
|
84
|
+
},
|
|
85
|
+
get isDropping() {
|
|
86
|
+
return u.isDropping;
|
|
87
|
+
},
|
|
88
|
+
get isDragSource() {
|
|
89
|
+
return u.isDragSource;
|
|
90
|
+
},
|
|
91
|
+
get isDropTarget() {
|
|
92
|
+
return u.isDropTarget;
|
|
93
|
+
},
|
|
94
|
+
handleRef: c(
|
|
95
|
+
(e) => {
|
|
96
|
+
r.handle = e ?? void 0;
|
|
97
|
+
},
|
|
98
|
+
[r]
|
|
99
|
+
),
|
|
100
|
+
ref: c(
|
|
101
|
+
(e) => {
|
|
102
|
+
var n, s;
|
|
103
|
+
!e && ((n = r.element) != null && n.isConnected) && !((s = r.manager) != null && s.dragOperation.status.idle) || (r.element = e ?? void 0);
|
|
104
|
+
},
|
|
105
|
+
[r]
|
|
106
|
+
),
|
|
107
|
+
sourceRef: c(
|
|
108
|
+
(e) => {
|
|
109
|
+
var n, s;
|
|
110
|
+
!e && ((n = r.source) != null && n.isConnected) && !((s = r.manager) != null && s.dragOperation.status.idle) || (r.source = e ?? void 0);
|
|
111
|
+
},
|
|
112
|
+
[r]
|
|
113
|
+
),
|
|
114
|
+
targetRef: c(
|
|
115
|
+
(e) => {
|
|
116
|
+
var n, s;
|
|
117
|
+
!e && ((n = r.target) != null && n.isConnected) && !((s = r.manager) != null && s.dragOperation.status.idle) || (r.target = e ?? void 0);
|
|
118
|
+
},
|
|
119
|
+
[r]
|
|
120
|
+
)
|
|
11
121
|
};
|
|
12
|
-
}
|
|
122
|
+
}
|
|
123
|
+
function G(o, t, a) {
|
|
124
|
+
return !!(o === "isDragSource" && !a && t);
|
|
125
|
+
}
|
|
13
126
|
export {
|
|
14
|
-
|
|
127
|
+
rr as isSortable,
|
|
128
|
+
Y as useSortable
|
|
15
129
|
};
|
|
16
130
|
//# sourceMappingURL=fondue-components120.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components120.js","sources":["../src/components/DatePicker/hooks/useSingleDate.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { useMemo, useState } from 'react';\nimport { type OnSelectHandler } from 'react-day-picker';\n\nimport { transformDatePickerDateToDate, transformDateToDatePickerDate } from '../helpers/dateTransformer';\nimport { type DatePickerDate } from '../types';\n\nexport const useSingleDate = (selected?: DatePickerDate, onSelect?: (date?: DatePickerDate) => void) => {\n const [internalSelectedDate, setInternalSelectedDate] = useState<DatePickerDate | undefined>(selected);\n const [prevSelected, setPrevSelected] = useState<DatePickerDate | undefined>(selected);\n\n if (prevSelected !== selected) {\n setPrevSelected(selected);\n setInternalSelectedDate(selected);\n }\n\n const selectedDate = useMemo(() => {\n return transformDatePickerDateToDate(internalSelectedDate);\n }, [internalSelectedDate]);\n\n const handleSelect: OnSelectHandler<Date> = (date) => {\n const datePickerDate = transformDateToDatePickerDate(date);\n\n setInternalSelectedDate(datePickerDate);\n onSelect?.(datePickerDate);\n };\n\n return {\n selectedDate,\n handleSelect,\n };\n};\n"],"names":["useSingleDate","selected","onSelect","internalSelectedDate","setInternalSelectedDate","useState","prevSelected","setPrevSelected","useMemo","transformDatePickerDateToDate","date","datePickerDate","transformDateToDatePickerDate"],"mappings":";;AAQO,MAAMA,IAAgB,CAACC,GAA2BC,MAA+C;AACpG,QAAM,CAACC,GAAsBC,CAAuB,IAAIC,EAAqCJ,CAAQ,GAC/F,CAACK,GAAcC,CAAe,IAAIF,EAAqCJ,CAAQ;AAErF,SAAIK,MAAiBL,MACjBM,EAAgBN,CAAQ,GACxBG,EAAwBH,CAAQ,IAc7B;AAAA,IACH,cAZiBO,EAAQ,MAClBC,EAA8BN,CAAoB,GAC1D,CAACA,CAAoB,CAAC;AAAA,IAWrB,cATwC,CAACO,MAAS;AAClD,YAAMC,IAAiBC,EAA8BF,CAAI;AAEzD,MAAAN,EAAwBO,CAAc,GACtCT,KAAA,QAAAA,EAAWS;AAAA,IACf;AAAA,EAII;AAER;"}
|
|
1
|
+
{"version":3,"file":"fondue-components120.js","sources":["../../../node_modules/.pnpm/@dnd-kit+react@0.3.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@dnd-kit/react/sortable.js"],"sourcesContent":["import { useCallback } from 'react';\nimport { batch, deepEqual } from '@dnd-kit/state';\nimport { defaultSortableTransition, Sortable } from '@dnd-kit/dom/sortable';\nexport { isSortable, isSortableOperation } from '@dnd-kit/dom/sortable';\nimport { useInstance } from '@dnd-kit/react';\nimport { useDeepSignal, useOnValueChange, useIsomorphicLayoutEffect, useImmediateEffect, useOnElementChange } from '@dnd-kit/react/hooks';\nimport { currentValue } from '@dnd-kit/react/utilities';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nfunction useSortable(input) {\n const {\n accept,\n collisionDetector,\n collisionPriority,\n id,\n data,\n element,\n handle,\n index,\n group,\n disabled,\n feedback,\n modifiers,\n sensors,\n target,\n type\n } = input;\n const transition = __spreadValues(__spreadValues({}, defaultSortableTransition), input.transition);\n const sortable = useInstance((manager) => {\n return new Sortable(\n __spreadProps(__spreadValues({}, input), {\n transition,\n register: false,\n handle: currentValue(handle),\n element: currentValue(element),\n target: currentValue(target),\n feedback\n }),\n manager\n );\n });\n const trackedSortable = useDeepSignal(sortable, shouldUpdateSynchronously);\n useOnValueChange(id, () => sortable.id = id);\n useIsomorphicLayoutEffect(() => {\n batch(() => {\n sortable.group = group;\n sortable.index = index;\n });\n }, [sortable, group, index]);\n useOnValueChange(type, () => sortable.type = type);\n useOnValueChange(\n accept,\n () => sortable.accept = accept,\n void 0,\n deepEqual\n );\n useOnValueChange(data, () => data && (sortable.data = data));\n useOnValueChange(\n index,\n () => {\n var _a;\n if (((_a = sortable.manager) == null ? void 0 : _a.dragOperation.status.idle) && (transition == null ? void 0 : transition.idle)) {\n sortable.refreshShape();\n }\n },\n useImmediateEffect\n );\n useOnElementChange(handle, (handle2) => sortable.handle = handle2);\n useOnElementChange(element, (element2) => sortable.element = element2);\n useOnElementChange(target, (target2) => sortable.target = target2);\n useOnValueChange(disabled, () => sortable.disabled = disabled === true);\n useOnValueChange(sensors, () => sortable.sensors = sensors);\n useOnValueChange(\n collisionDetector,\n () => sortable.collisionDetector = collisionDetector\n );\n useOnValueChange(\n collisionPriority,\n () => sortable.collisionPriority = collisionPriority\n );\n useOnValueChange(feedback, () => sortable.feedback = feedback != null ? feedback : \"default\");\n useOnValueChange(\n transition,\n () => sortable.transition = transition,\n void 0,\n deepEqual\n );\n useOnValueChange(\n modifiers,\n () => sortable.modifiers = modifiers,\n void 0,\n deepEqual\n );\n useOnValueChange(\n input.alignment,\n () => sortable.alignment = input.alignment\n );\n return {\n sortable: trackedSortable,\n get isDragging() {\n return trackedSortable.isDragging;\n },\n get isDropping() {\n return trackedSortable.isDropping;\n },\n get isDragSource() {\n return trackedSortable.isDragSource;\n },\n get isDropTarget() {\n return trackedSortable.isDropTarget;\n },\n handleRef: useCallback(\n (element2) => {\n sortable.handle = element2 != null ? element2 : void 0;\n },\n [sortable]\n ),\n ref: useCallback(\n (element2) => {\n var _a, _b;\n if (!element2 && ((_a = sortable.element) == null ? void 0 : _a.isConnected) && !((_b = sortable.manager) == null ? void 0 : _b.dragOperation.status.idle)) {\n return;\n }\n sortable.element = element2 != null ? element2 : void 0;\n },\n [sortable]\n ),\n sourceRef: useCallback(\n (element2) => {\n var _a, _b;\n if (!element2 && ((_a = sortable.source) == null ? void 0 : _a.isConnected) && !((_b = sortable.manager) == null ? void 0 : _b.dragOperation.status.idle)) {\n return;\n }\n sortable.source = element2 != null ? element2 : void 0;\n },\n [sortable]\n ),\n targetRef: useCallback(\n (element2) => {\n var _a, _b;\n if (!element2 && ((_a = sortable.target) == null ? void 0 : _a.isConnected) && !((_b = sortable.manager) == null ? void 0 : _b.dragOperation.status.idle)) {\n return;\n }\n sortable.target = element2 != null ? element2 : void 0;\n },\n [sortable]\n )\n };\n}\nfunction shouldUpdateSynchronously(key, oldValue, newValue) {\n if (key === \"isDragSource\" && !newValue && oldValue) return true;\n return false;\n}\n\nexport { useSortable };\n//# sourceMappingURL=sortable.js.map\n//# sourceMappingURL=sortable.js.map"],"names":["__defProp","__defProps","__getOwnPropDescs","__getOwnPropSymbols","__hasOwnProp","__propIsEnum","__defNormalProp","obj","key","value","__spreadValues","a","b","prop","__spreadProps","useSortable","input","accept","collisionDetector","collisionPriority","id","data","element","handle","index","group","disabled","feedback","modifiers","sensors","target","type","transition","defaultSortableTransition","sortable","useInstance","manager","Sortable","currentValue","trackedSortable","useDeepSignal","shouldUpdateSynchronously","useOnValueChange","useIsomorphicLayoutEffect","batch","deepEqual","_a","useImmediateEffect","useOnElementChange","handle2","element2","target2","useCallback","_b","oldValue","newValue"],"mappings":";;;;;;;;AAQA,IAAIA,IAAY,OAAO,gBACnBC,IAAa,OAAO,kBACpBC,IAAoB,OAAO,2BAC3BC,IAAsB,OAAO,uBAC7BC,IAAe,OAAO,UAAU,gBAChCC,IAAe,OAAO,UAAU,sBAChCC,IAAkB,CAACC,GAAKC,GAAKC,MAAUD,KAAOD,IAAMP,EAAUO,GAAKC,GAAK,EAAE,YAAY,IAAM,cAAc,IAAM,UAAU,IAAM,OAAAC,EAAK,CAAE,IAAIF,EAAIC,CAAG,IAAIC,GACtJC,IAAiB,CAACC,GAAGC,MAAM;AAC7B,WAASC,KAAQD,MAAMA,IAAI,CAAA;AACzB,IAAIR,EAAa,KAAKQ,GAAGC,CAAI,KAC3BP,EAAgBK,GAAGE,GAAMD,EA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