@progress/kendo-react-dateinputs 7.5.0-develop.1 → 7.5.0-develop.11
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/calendar/components/Calendar.js +2 -2
- package/calendar/components/Calendar.mjs +35 -32
- package/calendar/components/HorizontalViewList.js +1 -1
- package/calendar/components/HorizontalViewList.mjs +2 -0
- package/calendar/components/MultiViewCalendar.js +1 -1
- package/calendar/components/MultiViewCalendar.mjs +93 -90
- package/calendar/components/View.js +1 -1
- package/calendar/components/View.mjs +5 -5
- package/calendar/components/ViewList.js +1 -1
- package/calendar/components/ViewList.mjs +42 -42
- package/calendar/services/WeekNamesService.js +1 -1
- package/calendar/services/WeekNamesService.mjs +5 -5
- package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
- package/index.d.mts +33 -6
- package/index.d.ts +33 -6
- package/package-metadata.mjs +1 -1
- package/package.json +7 -7
- package/virtualization/Virtualization.js +1 -1
- package/virtualization/Virtualization.mjs +5 -6
- package/virtualization/services/RowHeightService.js +0 -8
- package/virtualization/services/RowHeightService.mjs +0 -50
|
@@ -9,17 +9,18 @@
|
|
|
9
9
|
import * as s from "react";
|
|
10
10
|
import o from "prop-types";
|
|
11
11
|
import { classNames as g } from "@progress/kendo-react-common";
|
|
12
|
-
import { cloneDate as
|
|
13
|
-
import { provideIntlService as y, registerForIntl as
|
|
14
|
-
import { Virtualization as
|
|
12
|
+
import { cloneDate as D, getDate as d, isEqualDate as x } from "@progress/kendo-date-math";
|
|
13
|
+
import { provideIntlService as y, registerForIntl as S } from "@progress/kendo-react-intl";
|
|
14
|
+
import { Virtualization as V } from "../../virtualization/Virtualization.mjs";
|
|
15
15
|
import { View as I } from "./View.mjs";
|
|
16
16
|
import { Header as T } from "./Header.mjs";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
import { WeekNamesService as N } from "../services/WeekNamesService.mjs";
|
|
18
|
+
import { dateInRange as u, shiftWeekNames as C, isInRange as E, getToday as O } from "../../utils.mjs";
|
|
19
|
+
import { CalendarViewEnum as n } from "../models/CalendarViewEnum.mjs";
|
|
20
|
+
import { TodayCommand as H } from "./TodayCommand.mjs";
|
|
21
|
+
const z = 5, h = class h extends s.Component {
|
|
22
|
+
constructor(l) {
|
|
23
|
+
super(l), this.virtualization = null, this.calendarView = null, this.table = null, this.intl = null, this.bottomOffset = 0, this.viewOffset = 0, this.viewHeight = 0, this._element = null, this.isActive = !1, this.animateToIndex = !0, this.shouldScroll = !1, this.weekService = null, this.focusActiveDate = () => {
|
|
23
24
|
if (!this._element)
|
|
24
25
|
return;
|
|
25
26
|
const e = this._element.querySelector("td.k-focus"), t = this._element.querySelector(".k-state-pending-focus");
|
|
@@ -56,12 +57,12 @@ const H = 5, h = class h extends s.Component {
|
|
|
56
57
|
tabIndex: this.props.tabIndex,
|
|
57
58
|
"aria-activedescendant": i + this.props.focusedDate.getTime()
|
|
58
59
|
},
|
|
59
|
-
/* @__PURE__ */ s.createElement("colgroup", null, e.map((a,
|
|
60
|
+
/* @__PURE__ */ s.createElement("colgroup", null, e.map((a, r) => /* @__PURE__ */ s.createElement("col", { key: r }))),
|
|
60
61
|
t.map((a) => /* @__PURE__ */ s.createElement(
|
|
61
62
|
I,
|
|
62
63
|
{
|
|
63
|
-
ref: (
|
|
64
|
-
this.calendarView || (this.calendarView =
|
|
64
|
+
ref: (r) => {
|
|
65
|
+
this.calendarView || (this.calendarView = r);
|
|
65
66
|
},
|
|
66
67
|
key: a.getTime(),
|
|
67
68
|
activeView: this.props.activeView,
|
|
@@ -83,13 +84,13 @@ const H = 5, h = class h extends s.Component {
|
|
|
83
84
|
}, this.calculateHeights = () => {
|
|
84
85
|
if (!this.props.dom)
|
|
85
86
|
return;
|
|
86
|
-
const e = this.props.activeView ===
|
|
87
|
+
const e = this.props.activeView === n.month ? this.props.dom.scrollableContentHeight : this.props.dom.scrollableYearContentHeight;
|
|
87
88
|
this.bottomOffset = e - this.props.dom.viewHeight(this.props.activeView), this.viewOffset = -1 * this.props.dom.headerHeight, this.viewHeight = this.props.dom.viewHeight(this.props.activeView) || 1;
|
|
88
89
|
}, this.getTake = (e, t) => Math.min(t - e, this.take), this.handleScrollAction = ({ index: e, scrollAction: t, pageAction: i }) => {
|
|
89
90
|
const a = i ? i.skip : this.state.skip;
|
|
90
91
|
if ((this.state.index !== e || this.state.skip !== a) && this.setState({ index: e, skip: a }), this.table && t) {
|
|
91
|
-
const
|
|
92
|
-
this.table.style.transform =
|
|
92
|
+
const r = `translateY(${t.offset}px)`;
|
|
93
|
+
this.table.style.transform = r;
|
|
93
94
|
}
|
|
94
95
|
}, this.handleTodayClick = (e) => {
|
|
95
96
|
this.shouldScroll = !0, this.handleDateChange.call(void 0, e, !0);
|
|
@@ -99,7 +100,7 @@ const H = 5, h = class h extends s.Component {
|
|
|
99
100
|
const a = {
|
|
100
101
|
syntheticEvent: e.syntheticEvent,
|
|
101
102
|
nativeEvent: e.nativeEvent,
|
|
102
|
-
value:
|
|
103
|
+
value: D(e.value),
|
|
103
104
|
target: this,
|
|
104
105
|
isTodayClick: t
|
|
105
106
|
};
|
|
@@ -114,15 +115,12 @@ const H = 5, h = class h extends s.Component {
|
|
|
114
115
|
return this._element;
|
|
115
116
|
}
|
|
116
117
|
get weekNames() {
|
|
117
|
-
this.intl = y(this);
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
this.intl.firstDay()
|
|
121
|
-
);
|
|
122
|
-
return this.weekNumber ? [""].concat(r) : r;
|
|
118
|
+
this.intl = y(this), this.weekService = new N(this.intl);
|
|
119
|
+
const l = this.weekService.getWeekNames(this.weekNumber, this.props.weekDaysFormat), e = C(l, this.intl.firstDay());
|
|
120
|
+
return this.weekNumber ? [""].concat(e) : e;
|
|
123
121
|
}
|
|
124
122
|
get weekNumber() {
|
|
125
|
-
return !!(this.props.showWeekNumbers && this.props.activeView ===
|
|
123
|
+
return !!(this.props.showWeekNumbers && this.props.activeView === n.month);
|
|
126
124
|
}
|
|
127
125
|
get take() {
|
|
128
126
|
return this.props.take !== void 0 ? this.props.take : h.defaultProps.take;
|
|
@@ -131,28 +129,28 @@ const H = 5, h = class h extends s.Component {
|
|
|
131
129
|
return !!(this.props.smoothScroll && this.animateToIndex);
|
|
132
130
|
}
|
|
133
131
|
get todayIsInRange() {
|
|
134
|
-
return E(
|
|
132
|
+
return E(O(), d(this.props.min), d(this.props.max));
|
|
135
133
|
}
|
|
136
|
-
componentDidUpdate(
|
|
134
|
+
componentDidUpdate(l, e) {
|
|
137
135
|
this.shouldScroll = !1, this.indexToScroll !== void 0 && this.virtualization && this.virtualization[this.animate ? "animateToIndex" : "scrollToIndex"](this.indexToScroll), this.isActive && this.focusActiveDate(), this.lastView = this.props.activeView, this.indexToScroll = void 0;
|
|
138
136
|
}
|
|
139
137
|
render() {
|
|
140
138
|
this.calculateHeights();
|
|
141
|
-
const
|
|
142
|
-
this.animateToIndex = !m, (m || !
|
|
143
|
-
const
|
|
139
|
+
const l = this.lastView !== this.props.activeView, e = u(this.props.focusedDate, this.props.min, this.props.max), t = l ? this.props.service.skip(e, this.props.min) : this.state.skip, i = this.props.service.total(this.props.min, this.props.max), a = this.getTake(t, i), r = this.props.service.addToDate(this.props.min, t), v = this.props.service.addToDate(this.props.min, this.state.index), p = new Array(this.props.service.rowLength(this.weekNumber)).fill(""), m = this.props.activeView !== this.lastView;
|
|
140
|
+
this.animateToIndex = !m, (m || !x(this.lastFocus, e) || this.shouldScroll || !this.props.shouldScroll || this.props.shouldScroll()) && (this.indexToScroll = this.props.service.skip(e, this.props.min)), this.lastFocus = e;
|
|
141
|
+
const f = g(
|
|
144
142
|
"k-calendar-view k-vstack",
|
|
145
143
|
{
|
|
146
|
-
"k-calendar-monthview": this.props.activeView ===
|
|
147
|
-
"k-calendar-yearview": this.props.activeView ===
|
|
148
|
-
"k-calendar-decadeview": this.props.activeView ===
|
|
149
|
-
"k-calendar-centuryview": this.props.activeView ===
|
|
144
|
+
"k-calendar-monthview": this.props.activeView === n.month,
|
|
145
|
+
"k-calendar-yearview": this.props.activeView === n.year,
|
|
146
|
+
"k-calendar-decadeview": this.props.activeView === n.decade,
|
|
147
|
+
"k-calendar-centuryview": this.props.activeView === n.century
|
|
150
148
|
}
|
|
151
|
-
),
|
|
149
|
+
), k = this.buildDates(p, this.props.service.datesList(r, a)), w = /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement(
|
|
152
150
|
T,
|
|
153
151
|
{
|
|
154
152
|
key: "calendar-view-list-header",
|
|
155
|
-
currentDate:
|
|
153
|
+
currentDate: v,
|
|
156
154
|
min: this.props.min,
|
|
157
155
|
max: this.props.max,
|
|
158
156
|
activeView: this.props.activeView,
|
|
@@ -160,7 +158,7 @@ const H = 5, h = class h extends s.Component {
|
|
|
160
158
|
service: this.props.service,
|
|
161
159
|
headerTitle: this.props.headerTitle,
|
|
162
160
|
commands: /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement(
|
|
163
|
-
|
|
161
|
+
H,
|
|
164
162
|
{
|
|
165
163
|
min: this.props.min,
|
|
166
164
|
max: this.props.max,
|
|
@@ -170,8 +168,8 @@ const H = 5, h = class h extends s.Component {
|
|
|
170
168
|
}
|
|
171
169
|
))
|
|
172
170
|
}
|
|
173
|
-
), this.props.activeView ===
|
|
174
|
-
|
|
171
|
+
), this.props.activeView === n.month && this.buildMonthView(p, this.weekNames), /* @__PURE__ */ s.createElement(
|
|
172
|
+
V,
|
|
175
173
|
{
|
|
176
174
|
key: "calendar-view-list-content",
|
|
177
175
|
skip: t,
|
|
@@ -185,7 +183,7 @@ const H = 5, h = class h extends s.Component {
|
|
|
185
183
|
onScroll: this.props.onScroll,
|
|
186
184
|
onScrollAction: this.handleScrollAction,
|
|
187
185
|
onMount: this.handleVirtualizationMount,
|
|
188
|
-
children:
|
|
186
|
+
children: k,
|
|
189
187
|
tabIndex: this.props.tabIndex
|
|
190
188
|
}
|
|
191
189
|
));
|
|
@@ -195,9 +193,9 @@ const H = 5, h = class h extends s.Component {
|
|
|
195
193
|
ref: (b) => {
|
|
196
194
|
this._element = b;
|
|
197
195
|
},
|
|
198
|
-
className:
|
|
196
|
+
className: f
|
|
199
197
|
},
|
|
200
|
-
this.props.dom.didCalculate ?
|
|
198
|
+
this.props.dom.didCalculate ? w : null
|
|
201
199
|
);
|
|
202
200
|
}
|
|
203
201
|
};
|
|
@@ -215,14 +213,16 @@ h.propTypes = {
|
|
|
215
213
|
value: o.instanceOf(Date),
|
|
216
214
|
viewHeight: o.number,
|
|
217
215
|
viewOffset: o.number,
|
|
216
|
+
weekDaysFormat: o.oneOf(["short", "abbreviated", "narrow"]),
|
|
218
217
|
tabIndex: o.number
|
|
219
218
|
}, h.defaultProps = {
|
|
220
|
-
take:
|
|
219
|
+
take: z,
|
|
221
220
|
showWeekNumbers: !1,
|
|
221
|
+
weekDaysFormat: "short",
|
|
222
222
|
smoothScroll: !0
|
|
223
223
|
};
|
|
224
224
|
let c = h;
|
|
225
|
-
|
|
225
|
+
S(c);
|
|
226
226
|
export {
|
|
227
227
|
c as ViewList
|
|
228
228
|
};
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../utils.js");class c{constructor(e){this.intl=e}getWeekNames(e=!1,t){const s=i.shiftWeekNames(this.intl.dateFormatNames({nameType:t!=null?t:"short",type:"days"}),this.intl.firstDay());return e?[""].concat(s):s}}exports.WeekNamesService=c;
|
|
@@ -6,17 +6,17 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import { shiftWeekNames as
|
|
9
|
+
import { shiftWeekNames as i } from "../../utils.mjs";
|
|
10
10
|
class r {
|
|
11
11
|
constructor(e) {
|
|
12
12
|
this.intl = e;
|
|
13
13
|
}
|
|
14
|
-
getWeekNames(e = !1) {
|
|
15
|
-
const
|
|
16
|
-
this.intl.dateFormatNames({ nameType: "short", type: "days" }),
|
|
14
|
+
getWeekNames(e = !1, t) {
|
|
15
|
+
const s = i(
|
|
16
|
+
this.intl.dateFormatNames({ nameType: t != null ? t : "short", type: "days" }),
|
|
17
17
|
this.intl.firstDay()
|
|
18
18
|
);
|
|
19
|
-
return e ? [""].concat(
|
|
19
|
+
return e ? [""].concat(s) : s;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
export {
|