ywana-core8 0.0.907 → 0.0.909
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/index.cjs +12 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +14 -6
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +12 -6
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +12 -6
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/TablePage.js +4 -1
- package/src/widgets/calendar/Calendar.css +14 -6
- package/src/widgets/calendar/Calendar.js +16 -9
- package/src/widgets/calendar/Calendar.test.js +4 -4
- package/src/widgets/image/ImageComparator.js +80 -0
- package/src/widgets/planner/Planner.test.js +1 -0
package/package.json
CHANGED
package/src/domain/TablePage.js
CHANGED
@@ -458,7 +458,10 @@ export const TableEditor = (props) => {
|
|
458
458
|
format: field.format,
|
459
459
|
item: field.item ? field.item : [],
|
460
460
|
onChange: field.id === "checked" ? checkOne : field.editable ? change : null, /* checked has it´s own handler */
|
461
|
-
options
|
461
|
+
options,
|
462
|
+
sortable: field.sortable || false,
|
463
|
+
filterable: field.filterable || false,
|
464
|
+
resizable: field.resizable || false,
|
462
465
|
}
|
463
466
|
}),
|
464
467
|
rows: groups[groupName]
|
@@ -1,10 +1,11 @@
|
|
1
1
|
|
2
2
|
.calendar {
|
3
|
-
margin:
|
3
|
+
margin: 1rem;
|
4
4
|
overflow: hidden;
|
5
5
|
display: flex;
|
6
6
|
flex-direction: column;
|
7
|
-
padding:
|
7
|
+
padding: 0rem;
|
8
|
+
|
8
9
|
}
|
9
10
|
|
10
11
|
.calendar>nav {
|
@@ -26,6 +27,7 @@
|
|
26
27
|
|
27
28
|
.calendar>header {
|
28
29
|
border: solid 1px var(--divider-color);
|
30
|
+
border-top: 0px;
|
29
31
|
border-width: 1px 1px 0 0px;
|
30
32
|
display: grid;
|
31
33
|
grid-template-columns: repeat(7, 1fr);
|
@@ -45,9 +47,9 @@
|
|
45
47
|
}
|
46
48
|
|
47
49
|
.week-day-cell {
|
48
|
-
border
|
50
|
+
border: solid 0px var(--divider-color);
|
49
51
|
padding: 2px;
|
50
|
-
text-align:
|
52
|
+
text-align: right;
|
51
53
|
min-width: 5rem;
|
52
54
|
}
|
53
55
|
|
@@ -58,11 +60,17 @@
|
|
58
60
|
text-align: right;
|
59
61
|
min-height: 5rem;
|
60
62
|
min-width: 5rem;
|
63
|
+
font-weight: 400;
|
61
64
|
}
|
62
65
|
|
63
66
|
.day-cell.today>header {
|
64
|
-
|
65
|
-
padding: .3rem
|
67
|
+
border-bottom: solid 2px var(--primary-color);
|
68
|
+
padding: .3rem;
|
69
|
+
font-weight: 600;
|
70
|
+
}
|
71
|
+
|
72
|
+
.day-cell.other-month {
|
73
|
+
color: var(--text-color-lighter);
|
66
74
|
}
|
67
75
|
|
68
76
|
.day-cell:hover {
|
@@ -41,7 +41,7 @@ export const Calendar = (props) => {
|
|
41
41
|
|
42
42
|
function today() {
|
43
43
|
const today = moment()
|
44
|
-
setPosition(today)
|
44
|
+
setPosition(today)
|
45
45
|
}
|
46
46
|
|
47
47
|
if (!position) return "..."
|
@@ -56,11 +56,17 @@ export const Calendar = (props) => {
|
|
56
56
|
const days = Array.from(range.by('days'))
|
57
57
|
|
58
58
|
const cells = days.map(day => {
|
59
|
-
|
60
|
-
|
61
|
-
|
59
|
+
|
60
|
+
const eventsOfDay = events.filter(event => {
|
61
|
+
console.log(event.date, day.format("YYYY-MM-DD"))
|
62
|
+
const eventDay = moment(event.date)
|
63
|
+
return eventDay.isSame(day, 'day')
|
62
64
|
})
|
63
|
-
|
65
|
+
|
66
|
+
return {
|
67
|
+
day,
|
68
|
+
events: eventsOfDay
|
69
|
+
}
|
64
70
|
})
|
65
71
|
|
66
72
|
return (
|
@@ -68,7 +74,7 @@ export const Calendar = (props) => {
|
|
68
74
|
<nav>
|
69
75
|
<label> {monthName} {year}</label>
|
70
76
|
<Button icon="chevron_left" raised action={prev} />
|
71
|
-
<Button label="Hoy" outlined action={today}/>
|
77
|
+
<Button label="Hoy" outlined action={today} />
|
72
78
|
<Button icon="chevron_right" raised action={next} />
|
73
79
|
</nav>
|
74
80
|
<header>
|
@@ -81,7 +87,7 @@ export const Calendar = (props) => {
|
|
81
87
|
<div className='week-day-cell'>Dom</div>
|
82
88
|
</header>
|
83
89
|
<main>
|
84
|
-
{cells.map(cell => <DayCell cell={cell} >{children}</DayCell>)}
|
90
|
+
{cells.map(cell => <DayCell key={cell.day} cell={cell} >{children}</DayCell>)}
|
85
91
|
</main>
|
86
92
|
</div>
|
87
93
|
)
|
@@ -89,11 +95,12 @@ export const Calendar = (props) => {
|
|
89
95
|
|
90
96
|
const DayCell = (props) => {
|
91
97
|
const { cell = [], children } = props
|
92
|
-
const {day, events} = cell
|
98
|
+
const { day, events } = cell
|
93
99
|
const todayStyle = day.isSame(moment(), 'day') ? 'today' : ''
|
100
|
+
const sameMonthStyle = day.isSame(moment(), 'month') ? '' : 'other-month'
|
94
101
|
|
95
102
|
return (
|
96
|
-
<div className={`day-cell ${todayStyle}`}>
|
103
|
+
<div className={`day-cell ${todayStyle} ${sameMonthStyle}`}>
|
97
104
|
<header>
|
98
105
|
{day.format("DD")}
|
99
106
|
</header>
|
@@ -6,9 +6,9 @@ const CalendarTest = (prop) => {
|
|
6
6
|
|
7
7
|
const events = [
|
8
8
|
{ id: 1, date: "2022-05-26", title: 'Event 1' },
|
9
|
-
{ id:
|
10
|
-
{ id:
|
11
|
-
|
9
|
+
{ id: 2, date: "2023-12-26", title: 'Event 2' },
|
10
|
+
{ id: 3, date: "2023-12-07", title: 'Event 3' },
|
11
|
+
|
12
12
|
]
|
13
13
|
|
14
14
|
return (
|
@@ -22,7 +22,7 @@ const CustomEvent = (props) => {
|
|
22
22
|
const { event } = props
|
23
23
|
return (
|
24
24
|
<div className="custom-event" onClick={() => alert("!xxx")}>
|
25
|
-
|
25
|
+
{event.title}
|
26
26
|
</div>
|
27
27
|
)
|
28
28
|
}
|
@@ -0,0 +1,80 @@
|
|
1
|
+
import React, {useState, useEffect} from 'react';
|
2
|
+
|
3
|
+
function CompareImages({ images, orientation, zoom }) {
|
4
|
+
const [image1, setImage1] = useState(null);
|
5
|
+
const [image2, setImage2] = useState(null);
|
6
|
+
const [curtain, setCurtain] = useState({
|
7
|
+
position: orientation === "vertical" ? "50%" : "33.3333%",
|
8
|
+
width: orientation === "vertical" ? 0 : 1,
|
9
|
+
});
|
10
|
+
const [zoomFactor, setZoomFactor] = useState(zoom);
|
11
|
+
|
12
|
+
useEffect(() => {
|
13
|
+
setImage1(images[0]);
|
14
|
+
setImage2(images[1]);
|
15
|
+
}, [images]);
|
16
|
+
|
17
|
+
const handleZoom = (event) => {
|
18
|
+
setZoomFactor(event.deltaY / 10);
|
19
|
+
};
|
20
|
+
|
21
|
+
const handleMove = (event) => {
|
22
|
+
const { x, y } = event.touches[0] || event.clientX;
|
23
|
+
setCurtain({
|
24
|
+
position: orientation === "vertical" ? y / window.innerHeight : x / window.innerWidth,
|
25
|
+
width: orientation === "vertical" ? 0 : 1 - curtain.position,
|
26
|
+
});
|
27
|
+
};
|
28
|
+
|
29
|
+
return (
|
30
|
+
<div style={{ width: "100%", height: "100%" }}>
|
31
|
+
<div style={{ width: "100%", height: "100%" }}>
|
32
|
+
<div style={{ width: "50%" }}>
|
33
|
+
<img src={image1} style={{ zoom: zoomFactor }} />
|
34
|
+
</div>
|
35
|
+
<div style={{ width: "50%" }}>
|
36
|
+
<img src={image2} style={{ zoom: zoomFactor }} />
|
37
|
+
</div>
|
38
|
+
</div>
|
39
|
+
<div
|
40
|
+
style={{
|
41
|
+
position: "absolute",
|
42
|
+
top: 0,
|
43
|
+
left: 0,
|
44
|
+
width: "100%",
|
45
|
+
height: "100%",
|
46
|
+
zIndex: 1,
|
47
|
+
pointerEvents: "none",
|
48
|
+
}}
|
49
|
+
>
|
50
|
+
<div
|
51
|
+
style={{
|
52
|
+
position: "absolute",
|
53
|
+
width: curtain.width,
|
54
|
+
height: curtain.height,
|
55
|
+
top: curtain.position * window.innerHeight,
|
56
|
+
left: curtain.position * window.innerWidth,
|
57
|
+
backgroundColor: "black",
|
58
|
+
opacity: 0.5,
|
59
|
+
}}
|
60
|
+
></div>
|
61
|
+
</div>
|
62
|
+
</div>
|
63
|
+
);
|
64
|
+
}
|
65
|
+
|
66
|
+
|
67
|
+
const CompareImagesTest = () => {
|
68
|
+
return (
|
69
|
+
<div style={{ width: "100%", height: "100%" }}>
|
70
|
+
<CompareImages
|
71
|
+
images={[
|
72
|
+
"https://img.freepik.com/free-photo/painting-mountain-lake-with-mountain-background_188544-9126.jpg?size=626&ext=jpg&ga=GA1.1.1546980028.1702080000&semt=sph",
|
73
|
+
"https://t4.ftcdn.net/jpg/06/68/30/09/360_F_668300949_oDIKoExgMgVETBk9MuJicJ0MTrMHhTDW.jpg",
|
74
|
+
]}
|
75
|
+
orientation="vertical"
|
76
|
+
zoom={1}
|
77
|
+
/>
|
78
|
+
</div>
|
79
|
+
);
|
80
|
+
}
|