@progress/kendo-react-dateinputs 7.5.0-develop.8 → 8.0.0-develop.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.
- package/calendar/components/Calendar.js +2 -2
- package/calendar/components/Calendar.mjs +46 -40
- package/calendar/components/CalendarCell.js +1 -1
- package/calendar/components/CalendarCell.mjs +53 -49
- package/calendar/components/CalendarWeekCell.js +1 -1
- package/calendar/components/CalendarWeekCell.mjs +12 -10
- package/calendar/components/Header.js +1 -1
- package/calendar/components/Header.mjs +20 -19
- package/calendar/components/HorizontalViewList.js +1 -1
- package/calendar/components/HorizontalViewList.mjs +37 -29
- package/calendar/components/MultiViewCalendar.js +1 -1
- package/calendar/components/MultiViewCalendar.mjs +153 -123
- package/calendar/components/TodayCommand.js +1 -1
- package/calendar/components/TodayCommand.mjs +1 -1
- package/calendar/components/View.js +1 -1
- package/calendar/components/View.mjs +56 -48
- package/calendar/components/ViewList.js +1 -1
- package/calendar/components/ViewList.mjs +47 -45
- package/calendar/services/MonthViewService.js +1 -1
- package/calendar/services/MonthViewService.mjs +14 -16
- package/calendar/services/WeekNamesService.js +1 -1
- package/calendar/services/WeekNamesService.mjs +5 -5
- package/common/ClearButton.js +8 -0
- package/common/ClearButton.mjs +41 -0
- package/dateinput/DateInput.js +1 -1
- package/dateinput/DateInput.mjs +32 -29
- package/datepicker/DatePicker.js +1 -1
- package/datepicker/DatePicker.mjs +3 -0
- package/daterangepicker/DateRangePicker.js +1 -1
- package/daterangepicker/DateRangePicker.mjs +6 -4
- package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
- package/index.d.mts +80 -7
- package/index.d.ts +80 -7
- package/messages/index.js +1 -1
- package/messages/index.mjs +38 -36
- package/package-metadata.mjs +1 -1
- package/package.json +8 -8
- 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
|
@@ -6,60 +6,67 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
10
|
-
import
|
|
11
|
-
import { cloneDate as p, weekInYear as
|
|
12
|
-
import { provideIntlService as D, registerForIntl as
|
|
9
|
+
import * as i from "react";
|
|
10
|
+
import s from "prop-types";
|
|
11
|
+
import { cloneDate as p, weekInYear as w } from "@progress/kendo-date-math";
|
|
12
|
+
import { provideIntlService as D, registerForIntl as v } from "@progress/kendo-react-intl";
|
|
13
13
|
import { CalendarCell as g } from "./CalendarCell.mjs";
|
|
14
|
-
import { CalendarWeekCell as
|
|
14
|
+
import { CalendarWeekCell as y } from "./CalendarWeekCell.mjs";
|
|
15
15
|
import { CalendarViewEnum as u } from "../models/CalendarViewEnum.mjs";
|
|
16
|
-
import { getToday as d, setTime as
|
|
17
|
-
import { WeekNamesService as
|
|
18
|
-
const k = (f) => /* @__PURE__ */
|
|
16
|
+
import { getToday as d, setTime as N } from "../../utils.mjs";
|
|
17
|
+
import { WeekNamesService as b } from "../services/WeekNamesService.mjs";
|
|
18
|
+
const k = (f) => /* @__PURE__ */ i.createElement("td", { key: f, className: "k-calendar-td k-empty" }, " "), c = class c extends i.Component {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(...arguments), this.intl = null, this.weekService = null, this.buildWeekNumber = (t, e) => {
|
|
21
21
|
if (!this.firstDate(t))
|
|
22
22
|
return k(`week-cell-${e}`);
|
|
23
|
-
const
|
|
23
|
+
const a = this.firstDate(t), n = this.getWeekNumber(a), o = `kendo-react-calendar-week-cell-${n}`, l = {
|
|
24
24
|
className: "k-alt",
|
|
25
|
-
value:
|
|
26
|
-
firstDate:
|
|
25
|
+
value: n,
|
|
26
|
+
firstDate: a,
|
|
27
|
+
weekDays: t,
|
|
28
|
+
onClick: this.handleWeekCellClick
|
|
27
29
|
};
|
|
28
|
-
return this.props.weekCell ? /* @__PURE__ */
|
|
29
|
-
}, this.buildRow = (t) => t.map((e,
|
|
30
|
+
return this.props.weekCell ? /* @__PURE__ */ i.createElement(this.props.weekCell, { ...l, key: o }, n) : /* @__PURE__ */ i.createElement(y, { ...l, key: o }, n);
|
|
31
|
+
}, this.buildRow = (t) => t.map((e, r) => {
|
|
30
32
|
if (!e)
|
|
31
|
-
return k(
|
|
32
|
-
const
|
|
33
|
-
...
|
|
33
|
+
return k(r);
|
|
34
|
+
const a = { "aria-selected": e.isSelected }, n = `kendo-react-calendar-cell-${e.value.getTime()}`, o = {
|
|
35
|
+
...a,
|
|
34
36
|
...e,
|
|
35
37
|
isDisabled: !e.isInRange,
|
|
36
38
|
view: this.props.activeView,
|
|
39
|
+
showOtherMonthDays: this.props.showOtherMonthDays,
|
|
40
|
+
allowReverse: this.props.allowReverse,
|
|
37
41
|
onClick: this.handleClick,
|
|
38
42
|
onMouseEnter: this.handleMouseEnter,
|
|
39
43
|
onMouseLeave: this.handleMouseLeave
|
|
40
44
|
};
|
|
41
|
-
return this.props.cell ? /* @__PURE__ */
|
|
45
|
+
return this.props.cell ? /* @__PURE__ */ i.createElement(this.props.cell, { ...o, key: n }, e.formattedValue) : /* @__PURE__ */ i.createElement(g, { ...o, key: n }, e.formattedValue);
|
|
42
46
|
}), this.firstDate = (t) => {
|
|
43
47
|
const e = this.firstWeekDateContext(t);
|
|
44
48
|
return e ? e.value : null;
|
|
45
49
|
}, this.firstWeekDateContext = (t) => {
|
|
46
50
|
if (!this.weekNumber)
|
|
47
51
|
return null;
|
|
48
|
-
let e = 0,
|
|
49
|
-
for (; !
|
|
50
|
-
|
|
51
|
-
return
|
|
52
|
+
let e = 0, r = t[e];
|
|
53
|
+
for (; !r && e < t.length; )
|
|
54
|
+
r = t[++e];
|
|
55
|
+
return r;
|
|
52
56
|
}, this.handleClick = (t, e) => {
|
|
53
|
-
const { onChange:
|
|
54
|
-
if (
|
|
55
|
-
const
|
|
57
|
+
const { onChange: r } = this.props;
|
|
58
|
+
if (r && e) {
|
|
59
|
+
const a = {
|
|
56
60
|
value: p(t),
|
|
57
61
|
target: this,
|
|
58
62
|
nativeEvent: e && e.nativeEvent,
|
|
59
63
|
syntheticEvent: e
|
|
60
64
|
};
|
|
61
|
-
|
|
65
|
+
r.call(void 0, a);
|
|
62
66
|
}
|
|
67
|
+
}, this.handleWeekCellClick = (t, e, r) => {
|
|
68
|
+
const { onWeekSelect: a } = this.props, n = e.findIndex((o) => o && o.value === t);
|
|
69
|
+
a && r && a.call(void 0, t, n, r);
|
|
63
70
|
}, this.handleMouseEnter = (t) => {
|
|
64
71
|
const { onCellEnter: e } = this.props;
|
|
65
72
|
e && e.call(void 0, p(t));
|
|
@@ -87,8 +94,8 @@ const k = (f) => /* @__PURE__ */ s.createElement("td", { key: f, className: "k-c
|
|
|
87
94
|
return this.props.selectedDate !== void 0 ? this.props.selectedDate : c.defaultProps.selectedDate;
|
|
88
95
|
}
|
|
89
96
|
render() {
|
|
90
|
-
this.intl = D(this), this.weekService = new
|
|
91
|
-
const t = this.weekService.getWeekNames(this.weekNumber), e = this.props.service.rowLength(this.weekNumber),
|
|
97
|
+
this.intl = D(this), this.weekService = new b(this.intl);
|
|
98
|
+
const t = this.weekService.getWeekNames(this.weekNumber, this.props.weekDaysFormat), e = this.props.service.rowLength(this.weekNumber), r = this.props.service.title(this.props.viewDate), a = d(), n = N(this.props.viewDate, a), o = this.props.service.data({
|
|
92
99
|
cellUID: this.props.cellUID,
|
|
93
100
|
min: this.min,
|
|
94
101
|
max: this.max,
|
|
@@ -96,58 +103,59 @@ const k = (f) => /* @__PURE__ */ s.createElement("td", { key: f, className: "k-c
|
|
|
96
103
|
isActiveView: !this.props.bus.canMoveDown(this.props.activeView),
|
|
97
104
|
selectedDate: this.selectedDate,
|
|
98
105
|
selectionRange: this.props.selectionRange,
|
|
99
|
-
viewDate:
|
|
106
|
+
viewDate: n
|
|
100
107
|
});
|
|
101
|
-
return /* @__PURE__ */
|
|
108
|
+
return /* @__PURE__ */ i.createElement(i.Fragment, null, this.isMonthView && this.isHorizontal && /* @__PURE__ */ i.createElement(
|
|
102
109
|
"thead",
|
|
103
110
|
{
|
|
104
111
|
role: "rowgroup",
|
|
105
112
|
className: "k-calendar-thead"
|
|
106
113
|
},
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
-
), /* @__PURE__ */
|
|
114
|
+
/* @__PURE__ */ i.createElement("tr", { role: "row", className: "k-calendar-tr" }, t.map((l, h) => /* @__PURE__ */ i.createElement("th", { key: h, className: "k-calendar-th" }, l)))
|
|
115
|
+
), /* @__PURE__ */ i.createElement(
|
|
109
116
|
"tbody",
|
|
110
117
|
{
|
|
111
118
|
role: "rowgroup",
|
|
112
119
|
className: "k-calendar-tbody"
|
|
113
120
|
},
|
|
114
|
-
!this.isHorizontal && /* @__PURE__ */
|
|
121
|
+
!this.isHorizontal && /* @__PURE__ */ i.createElement("tr", { role: "presentation", className: "k-calendar-tr" }, /* @__PURE__ */ i.createElement(
|
|
115
122
|
"th",
|
|
116
123
|
{
|
|
117
124
|
scope: "col",
|
|
118
125
|
colSpan: e,
|
|
119
126
|
className: "k-calendar-caption"
|
|
120
127
|
},
|
|
121
|
-
|
|
128
|
+
r
|
|
122
129
|
)),
|
|
123
|
-
o.map((l, h) => /* @__PURE__ */
|
|
130
|
+
o.map((l, h) => /* @__PURE__ */ i.createElement("tr", { role: "row", className: "k-calendar-tr", key: h }, this.weekNumber && this.buildWeekNumber(l, h), this.buildRow(l)))
|
|
124
131
|
));
|
|
125
132
|
}
|
|
126
133
|
getWeekNumber(t) {
|
|
127
|
-
return !this.weekNumber || !this.intl ? null :
|
|
134
|
+
return !this.weekNumber || !this.intl ? null : w(t, this.intl.firstDay());
|
|
128
135
|
}
|
|
129
136
|
};
|
|
130
137
|
c.propTypes = {
|
|
131
|
-
activeRangeEnd:
|
|
132
|
-
activeView:
|
|
133
|
-
cellUID:
|
|
134
|
-
direction:
|
|
135
|
-
focusedDate:
|
|
136
|
-
max:
|
|
137
|
-
min:
|
|
138
|
-
onChange:
|
|
139
|
-
selectedDate:
|
|
140
|
-
[
|
|
138
|
+
activeRangeEnd: s.oneOf(["start", "end", null]),
|
|
139
|
+
activeView: s.number.isRequired,
|
|
140
|
+
cellUID: s.string.isRequired,
|
|
141
|
+
direction: s.oneOf(["horizontal", "vertical"]),
|
|
142
|
+
focusedDate: s.instanceOf(Date).isRequired,
|
|
143
|
+
max: s.instanceOf(Date).isRequired,
|
|
144
|
+
min: s.instanceOf(Date).isRequired,
|
|
145
|
+
onChange: s.func,
|
|
146
|
+
selectedDate: s.oneOfType(
|
|
147
|
+
[s.instanceOf(Date), s.arrayOf(s.instanceOf(Date))]
|
|
141
148
|
),
|
|
142
|
-
showWeekNumbers:
|
|
143
|
-
|
|
149
|
+
showWeekNumbers: s.bool,
|
|
150
|
+
showOtherMonthDays: s.bool,
|
|
151
|
+
viewDate: s.instanceOf(Date).isRequired
|
|
144
152
|
}, c.defaultProps = {
|
|
145
153
|
direction: "vertical",
|
|
146
154
|
selectedDate: d(),
|
|
147
155
|
showWeekNumbers: !1
|
|
148
156
|
};
|
|
149
157
|
let m = c;
|
|
150
|
-
|
|
158
|
+
v(m);
|
|
151
159
|
export {
|
|
152
160
|
m as View
|
|
153
161
|
};
|
|
@@ -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 y=require("react"),r=require("prop-types"),V=require("@progress/kendo-react-common"),d=require("@progress/kendo-date-math"),f=require("@progress/kendo-react-intl"),x=require("../../virtualization/Virtualization.js"),S=require("./View.js"),C=require("./Header.js"),E=require("../services/WeekNamesService.js"),c=require("../../utils.js"),l=require("../models/CalendarViewEnum.js"),I=require("./TodayCommand.js");function T(h){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(h){for(const e in h)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(h,e);Object.defineProperty(o,e,t.get?t:{enumerable:!0,get:()=>h[e]})}}return o.default=h,Object.freeze(o)}const s=T(y),N=5,p=class p extends s.Component{constructor(o){super(o),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=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus"),t=this._element.querySelector(".k-state-pending-focus");e&&e[0]&&e[0].classList.remove("k-focus"),t&&t.classList.add("k-focus"),this.isActive=!0},this.blurActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus");e&&e.classList.remove("k-focus"),this.isActive=!1},this.handleVirtualizationMount=e=>{if(this.virtualization=e,this.virtualization&&this.table){this.table.style.transform=`translateY(${this.viewOffset}px)`;const t=c.dateInRange(this.props.focusedDate,this.props.min,this.props.max),i=this.props.service.skip(t,this.props.min);this.virtualization.scrollToIndex(i)}},this.buildMonthView=(e,t)=>s.createElement("table",{key:"calendar-view-list-weekdays",className:"k-calendar-table k-calendar-weekdays",role:"grid",tabIndex:this.props.tabIndex},s.createElement("colgroup",null,e.map((i,a)=>s.createElement("col",{key:a}))),s.createElement("thead",{className:"k-calendar-thead"},s.createElement("tr",{className:"k-calendar-tr"},t.map((i,a)=>s.createElement("th",{key:a,className:"k-calendar-th"},i))))),this.buildDates=(e,t)=>{const i=this.props.cellUID;return s.createElement("table",{className:"k-calendar-table",ref:a=>this.table=a,role:"grid",tabIndex:this.props.tabIndex,"aria-activedescendant":i+this.props.focusedDate.getTime()},s.createElement("colgroup",null,e.map((a,n)=>s.createElement("col",{key:n}))),t.map(a=>s.createElement(S.View,{ref:n=>{this.calendarView||(this.calendarView=n)},key:a.getTime(),activeView:this.props.activeView,viewDate:a,min:this.props.min,max:this.props.max,cellUID:i,focusedDate:this.props.focusedDate,cell:this.props.cell,selectedDate:this.props.value,showWeekNumbers:this.weekNumber,onChange:this.handleDateChange,bus:this.props.bus,service:this.props.service,weekCell:this.props.weekCell,showOtherMonthDays:this.props.showOtherMonthDays})))},this.calculateHeights=()=>{if(!this.props.dom)return;const e=this.props.activeView===l.CalendarViewEnum.month?this.props.dom.scrollableContentHeight:this.props.dom.scrollableYearContentHeight;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},this.getTake=(e,t)=>Math.min(t-e,this.take),this.handleScrollAction=({index:e,scrollAction:t,pageAction:i})=>{const a=i?i.skip:this.state.skip;if((this.state.index!==e||this.state.skip!==a)&&this.setState({index:e,skip:a}),this.table&&t){const n=`translateY(${t.offset}px)`;this.table.style.transform=n}},this.handleTodayClick=e=>{this.shouldScroll=!0,this.handleDateChange.call(void 0,e,!0)},this.handleDateChange=(e,t=!1)=>{const{onChange:i}=this.props;if(i){const a={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:d.cloneDate(e.value),target:this,isTodayClick:t};i.call(void 0,a)}},this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate,this.state={skip:this.props.service.skip(this.props.focusedDate,this.props.min),index:this.props.service.skip(this.props.focusedDate,this.props.min)}}get element(){return this._element}get weekNames(){this.intl=f.provideIntlService(this),this.weekService=new E.WeekNamesService(this.intl);const o=this.weekService.getWeekNames(this.weekNumber,this.props.weekDaysFormat),e=c.shiftWeekNames(o,this.intl.firstDay());return this.weekNumber?[""].concat(e):e}get weekNumber(){return!!(this.props.showWeekNumbers&&this.props.activeView===l.CalendarViewEnum.month)}get take(){return this.props.take!==void 0?this.props.take:p.defaultProps.take}get animate(){return!!(this.props.smoothScroll&&this.animateToIndex)}get todayIsInRange(){return c.isInRange(c.getToday(),d.getDate(this.props.min),d.getDate(this.props.max))}componentDidUpdate(o,e){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}render(){this.calculateHeights();const o=this.lastView!==this.props.activeView,e=c.dateInRange(this.props.focusedDate,this.props.min,this.props.max),t=o?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),n=this.props.service.addToDate(this.props.min,t),w=this.props.service.addToDate(this.props.min,this.state.index),m=new Array(this.props.service.rowLength(this.weekNumber)).fill(""),v=this.props.activeView!==this.lastView;this.animateToIndex=!v,(v||!d.isEqualDate(this.lastFocus,e)||this.shouldScroll||!this.props.shouldScroll||this.props.shouldScroll())&&(this.indexToScroll=this.props.service.skip(e,this.props.min)),this.lastFocus=e;const k=V.classNames("k-calendar-view k-vstack",{"k-calendar-monthview":this.props.activeView===l.CalendarViewEnum.month,"k-calendar-yearview":this.props.activeView===l.CalendarViewEnum.year,"k-calendar-decadeview":this.props.activeView===l.CalendarViewEnum.decade,"k-calendar-centuryview":this.props.activeView===l.CalendarViewEnum.century}),b=this.buildDates(m,this.props.service.datesList(n,a)),g=s.createElement(s.Fragment,null,s.createElement(C.Header,{key:"calendar-view-list-header",currentDate:w,min:this.props.min,max:this.props.max,activeView:this.props.activeView,bus:this.props.bus,service:this.props.service,headerTitle:this.props.headerTitle,header:this.props.header,commands:s.createElement(s.Fragment,null,s.createElement(I.TodayCommand,{min:this.props.min,max:this.props.max,onClick:this.handleTodayClick,disabled:!this.todayIsInRange,tabIndex:this.props.tabIndex}))}),this.props.activeView===l.CalendarViewEnum.month&&this.buildMonthView(m,this.weekNames),s.createElement(x.Virtualization,{key:"calendar-view-list-content",skip:t,take:this.take,total:i,itemHeight:this.viewHeight,topOffset:this.viewOffset,bottomOffset:this.bottomOffset,scrollOffsetSize:this.viewOffset,maxScrollDifference:this.viewHeight,onScroll:this.props.onScroll,onScrollAction:this.handleScrollAction,onMount:this.handleVirtualizationMount,children:b,tabIndex:this.props.tabIndex}));return s.createElement("div",{ref:D=>{this._element=D},className:k},this.props.dom.didCalculate?g:null)}};p.propTypes={activeView:r.number.isRequired,bottomOffset:r.number,cellUID:r.string.isRequired,focusedDate:r.instanceOf(Date).isRequired,max:r.instanceOf(Date).isRequired,min:r.instanceOf(Date).isRequired,onChange:r.func,showWeekNumbers:r.bool,smoothScroll:r.bool,take:r.number,value:r.instanceOf(Date),viewHeight:r.number,viewOffset:r.number,weekDaysFormat:r.oneOf(["short","abbreviated","narrow"]),tabIndex:r.number},p.defaultProps={take:N,showWeekNumbers:!1,weekDaysFormat:"short",smoothScroll:!0};let u=p;f.registerForIntl(u);exports.ViewList=u;
|
|
@@ -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, l = class l extends s.Component {
|
|
22
|
+
constructor(h) {
|
|
23
|
+
super(h), 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,
|
|
@@ -76,20 +77,21 @@ const H = 5, h = class h extends s.Component {
|
|
|
76
77
|
onChange: this.handleDateChange,
|
|
77
78
|
bus: this.props.bus,
|
|
78
79
|
service: this.props.service,
|
|
79
|
-
weekCell: this.props.weekCell
|
|
80
|
+
weekCell: this.props.weekCell,
|
|
81
|
+
showOtherMonthDays: this.props.showOtherMonthDays
|
|
80
82
|
}
|
|
81
83
|
))
|
|
82
84
|
);
|
|
83
85
|
}, this.calculateHeights = () => {
|
|
84
86
|
if (!this.props.dom)
|
|
85
87
|
return;
|
|
86
|
-
const e = this.props.activeView ===
|
|
88
|
+
const e = this.props.activeView === n.month ? this.props.dom.scrollableContentHeight : this.props.dom.scrollableYearContentHeight;
|
|
87
89
|
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
90
|
}, this.getTake = (e, t) => Math.min(t - e, this.take), this.handleScrollAction = ({ index: e, scrollAction: t, pageAction: i }) => {
|
|
89
91
|
const a = i ? i.skip : this.state.skip;
|
|
90
92
|
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 =
|
|
93
|
+
const r = `translateY(${t.offset}px)`;
|
|
94
|
+
this.table.style.transform = r;
|
|
93
95
|
}
|
|
94
96
|
}, this.handleTodayClick = (e) => {
|
|
95
97
|
this.shouldScroll = !0, this.handleDateChange.call(void 0, e, !0);
|
|
@@ -99,7 +101,7 @@ const H = 5, h = class h extends s.Component {
|
|
|
99
101
|
const a = {
|
|
100
102
|
syntheticEvent: e.syntheticEvent,
|
|
101
103
|
nativeEvent: e.nativeEvent,
|
|
102
|
-
value:
|
|
104
|
+
value: D(e.value),
|
|
103
105
|
target: this,
|
|
104
106
|
isTodayClick: t
|
|
105
107
|
};
|
|
@@ -114,53 +116,51 @@ const H = 5, h = class h extends s.Component {
|
|
|
114
116
|
return this._element;
|
|
115
117
|
}
|
|
116
118
|
get weekNames() {
|
|
117
|
-
this.intl = y(this);
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
this.intl.firstDay()
|
|
121
|
-
);
|
|
122
|
-
return this.weekNumber ? [""].concat(r) : r;
|
|
119
|
+
this.intl = y(this), this.weekService = new N(this.intl);
|
|
120
|
+
const h = this.weekService.getWeekNames(this.weekNumber, this.props.weekDaysFormat), e = C(h, this.intl.firstDay());
|
|
121
|
+
return this.weekNumber ? [""].concat(e) : e;
|
|
123
122
|
}
|
|
124
123
|
get weekNumber() {
|
|
125
|
-
return !!(this.props.showWeekNumbers && this.props.activeView ===
|
|
124
|
+
return !!(this.props.showWeekNumbers && this.props.activeView === n.month);
|
|
126
125
|
}
|
|
127
126
|
get take() {
|
|
128
|
-
return this.props.take !== void 0 ? this.props.take :
|
|
127
|
+
return this.props.take !== void 0 ? this.props.take : l.defaultProps.take;
|
|
129
128
|
}
|
|
130
129
|
get animate() {
|
|
131
130
|
return !!(this.props.smoothScroll && this.animateToIndex);
|
|
132
131
|
}
|
|
133
132
|
get todayIsInRange() {
|
|
134
|
-
return E(
|
|
133
|
+
return E(O(), d(this.props.min), d(this.props.max));
|
|
135
134
|
}
|
|
136
|
-
componentDidUpdate(
|
|
135
|
+
componentDidUpdate(h, e) {
|
|
137
136
|
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
137
|
}
|
|
139
138
|
render() {
|
|
140
139
|
this.calculateHeights();
|
|
141
|
-
const
|
|
142
|
-
this.animateToIndex = !m, (m || !
|
|
143
|
-
const
|
|
140
|
+
const h = this.lastView !== this.props.activeView, e = u(this.props.focusedDate, this.props.min, this.props.max), t = h ? 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;
|
|
141
|
+
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;
|
|
142
|
+
const f = g(
|
|
144
143
|
"k-calendar-view k-vstack",
|
|
145
144
|
{
|
|
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 ===
|
|
145
|
+
"k-calendar-monthview": this.props.activeView === n.month,
|
|
146
|
+
"k-calendar-yearview": this.props.activeView === n.year,
|
|
147
|
+
"k-calendar-decadeview": this.props.activeView === n.decade,
|
|
148
|
+
"k-calendar-centuryview": this.props.activeView === n.century
|
|
150
149
|
}
|
|
151
|
-
), w = this.buildDates(p, this.props.service.datesList(
|
|
150
|
+
), w = this.buildDates(p, this.props.service.datesList(r, a)), k = /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement(
|
|
152
151
|
T,
|
|
153
152
|
{
|
|
154
153
|
key: "calendar-view-list-header",
|
|
155
|
-
currentDate:
|
|
154
|
+
currentDate: v,
|
|
156
155
|
min: this.props.min,
|
|
157
156
|
max: this.props.max,
|
|
158
157
|
activeView: this.props.activeView,
|
|
159
158
|
bus: this.props.bus,
|
|
160
159
|
service: this.props.service,
|
|
161
160
|
headerTitle: this.props.headerTitle,
|
|
161
|
+
header: this.props.header,
|
|
162
162
|
commands: /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement(
|
|
163
|
-
|
|
163
|
+
H,
|
|
164
164
|
{
|
|
165
165
|
min: this.props.min,
|
|
166
166
|
max: this.props.max,
|
|
@@ -170,8 +170,8 @@ const H = 5, h = class h extends s.Component {
|
|
|
170
170
|
}
|
|
171
171
|
))
|
|
172
172
|
}
|
|
173
|
-
), this.props.activeView ===
|
|
174
|
-
|
|
173
|
+
), this.props.activeView === n.month && this.buildMonthView(p, this.weekNames), /* @__PURE__ */ s.createElement(
|
|
174
|
+
V,
|
|
175
175
|
{
|
|
176
176
|
key: "calendar-view-list-content",
|
|
177
177
|
skip: t,
|
|
@@ -195,13 +195,13 @@ const H = 5, h = class h extends s.Component {
|
|
|
195
195
|
ref: (b) => {
|
|
196
196
|
this._element = b;
|
|
197
197
|
},
|
|
198
|
-
className:
|
|
198
|
+
className: f
|
|
199
199
|
},
|
|
200
200
|
this.props.dom.didCalculate ? k : null
|
|
201
201
|
);
|
|
202
202
|
}
|
|
203
203
|
};
|
|
204
|
-
|
|
204
|
+
l.propTypes = {
|
|
205
205
|
activeView: o.number.isRequired,
|
|
206
206
|
bottomOffset: o.number,
|
|
207
207
|
cellUID: o.string.isRequired,
|
|
@@ -215,14 +215,16 @@ h.propTypes = {
|
|
|
215
215
|
value: o.instanceOf(Date),
|
|
216
216
|
viewHeight: o.number,
|
|
217
217
|
viewOffset: o.number,
|
|
218
|
+
weekDaysFormat: o.oneOf(["short", "abbreviated", "narrow"]),
|
|
218
219
|
tabIndex: o.number
|
|
219
|
-
},
|
|
220
|
-
take:
|
|
220
|
+
}, l.defaultProps = {
|
|
221
|
+
take: z,
|
|
221
222
|
showWeekNumbers: !1,
|
|
223
|
+
weekDaysFormat: "short",
|
|
222
224
|
smoothScroll: !0
|
|
223
225
|
};
|
|
224
|
-
let c =
|
|
225
|
-
|
|
226
|
+
let c = l;
|
|
227
|
+
S(c);
|
|
226
228
|
export {
|
|
227
229
|
c as ViewList
|
|
228
230
|
};
|
|
@@ -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 n=require("@progress/kendo-date-math"),l=require("../models/NavigationAction.js"),
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@progress/kendo-date-math"),l=require("../models/NavigationAction.js"),b=require("../models/SelectionRange.js"),h=require("../../utils.js"),v=[[]],f=7,O=6,p=6,V=0,k={[l.Action.Left]:a=>n.addDays(a,-1),[l.Action.Up]:a=>n.addWeeks(a,-1),[l.Action.Right]:a=>n.addDays(a,1),[l.Action.Down]:a=>n.addWeeks(a,1),[l.Action.PrevView]:a=>n.addMonths(a,-1),[l.Action.NextView]:a=>n.addMonths(a,1),[l.Action.FirstInView]:a=>n.firstDayOfMonth(a),[l.Action.LastInView]:a=>n.lastDayOfMonth(a)};class L{constructor(t){this.intl=t}addToDate(t,e){return n.addMonths(t,e)}datesList(t,e){return h.range(0,e).map(i=>n.addMonths(t,i))}data(t){const{cellUID:e,focusedDate:i,isActiveView:u,max:r,min:o,selectedDate:c,selectionRange:d=b.EMPTY_SELECTIONRANGE,viewDate:g}=t;if(!g)return v;const M=n.firstDayOfMonth(g),y=n.lastDayOfMonth(g),A=n.dayOfWeek(M,this.intl.firstDay(),-1),w=h.range(0,f),E=h.getToday();return h.range(0,O).map(T=>{const I=n.addDays(A,T*f);return w.map(R=>{const s=this.normalize(n.addDays(I,R),o,r),q=s<M||s>y,m=this.isEqual(s,d.start),S=this.isEqual(s,d.end),D=!m&&!S&&h.isInSelectionRange(s,d),N=u&&(Array.isArray(c)?this.isSelectedFromArray(s,c,o,r):h.isInRange(c,o,r)&&this.isEqual(s,c));return{formattedValue:this.value(s),id:`${e}${s.getTime()}`,isFocused:this.isEqual(s,i),isSelected:N,isInRange:h.isInRange(s,o,r),isWeekend:this.isWeekend(s),isRangeStart:m,isRangeMid:D,isRangeEnd:S,isRangeSplitStart:D&&this.isEqual(s,M),isRangeSplitEnd:D&&this.isEqual(s,y),isToday:this.isEqual(s,E),title:this.cellTitle(s),value:s,isOtherMonth:q}})})}isEqual(t,e){return!t||!e?!1:n.getDate(t).getTime()===n.getDate(e).getTime()}isSelectedFromArray(t,e,i,u){let r=!1;return e.forEach(o=>{h.isInRange(t,i,u)&&this.isEqual(t,o)&&(r=!0)}),r}isInArray(t,e){return!!e.length&&n.firstDayOfMonth(e[0])<=t&&t<=n.lastDayOfMonth(e[e.length-1])}isInRange(t,e,i){const u=n.getDate(t),r=!e||n.getDate(e)<=u,o=!i||u<=n.getDate(i);return r&&o}isInSameView(t,e){return n.durationInMonths(t,e)===0}isRangeStart(t){return!t.getMonth()}move(t,e){const i=k[e];return i?i(t):t}cellTitle(t){return this.intl.formatDate(t,"D")}navigationTitle(t){return t?this.isRangeStart(t)?t.getFullYear().toString():this.abbrMonthNames()[t.getMonth()]:""}title(t){return`${this.wideMonthNames()[t.getMonth()]} ${t.getFullYear()}`}rowLength(t){return f+(t?1:0)}skip(t,e){return n.durationInMonths(e,t)}total(t,e){return n.durationInMonths(t,e)+1}value(t){return t?t.getDate().toString():""}viewDate(t,e,i=1){return n.durationInMonths(t,e)<i?n.addMonths(t,-1):t}isWeekend(t){const e=t.getDay();return e===p||e===V}abbrMonthNames(){return this.intl.dateFormatNames({nameType:"abbreviated",type:"months"})}normalize(t,e,i){return t<e&&this.isEqual(t,e)?n.getDate(e):t>i&&this.isEqual(t,i)?n.getDate(i):t}wideMonthNames(){return this.intl.dateFormatNames({nameType:"wide",type:"months",standAlone:!0})}}exports.MonthViewService=L;
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import { addDays as g, addWeeks as I, addMonths as h, firstDayOfMonth as y, lastDayOfMonth as D, dayOfWeek as
|
|
9
|
+
import { addDays as g, addWeeks as I, addMonths as h, firstDayOfMonth as y, lastDayOfMonth as D, dayOfWeek as O, getDate as u, durationInMonths as d } from "@progress/kendo-date-math";
|
|
10
10
|
import { Action as o } from "../models/NavigationAction.mjs";
|
|
11
|
-
import { EMPTY_SELECTIONRANGE as
|
|
12
|
-
import { range as w, getToday as
|
|
13
|
-
const
|
|
11
|
+
import { EMPTY_SELECTIONRANGE as W } from "../models/SelectionRange.mjs";
|
|
12
|
+
import { range as w, getToday as Y, isInRange as T, isInSelectionRange as U } from "../../utils.mjs";
|
|
13
|
+
const _ = [[]], S = 7, $ = 6, C = 6, G = 0, P = {
|
|
14
14
|
[o.Left]: (s) => g(s, -1),
|
|
15
15
|
[o.Up]: (s) => I(s, -1),
|
|
16
16
|
[o.Right]: (s) => g(s, 1),
|
|
@@ -38,24 +38,21 @@ class Q {
|
|
|
38
38
|
max: r,
|
|
39
39
|
min: a,
|
|
40
40
|
selectedDate: c,
|
|
41
|
-
selectionRange: m =
|
|
41
|
+
selectionRange: m = W,
|
|
42
42
|
viewDate: f
|
|
43
43
|
} = t;
|
|
44
44
|
if (!f)
|
|
45
|
-
return
|
|
46
|
-
const M = y(f), R = D(f), N =
|
|
47
|
-
return w(0,
|
|
45
|
+
return _;
|
|
46
|
+
const M = y(f), R = D(f), N = O(M, this.intl.firstDay(), -1), b = w(0, S), q = Y();
|
|
47
|
+
return w(0, $).map((V) => {
|
|
48
48
|
const v = g(N, V * S);
|
|
49
49
|
return b.map((L) => {
|
|
50
|
-
const i = this.normalize(g(v, L), a, r);
|
|
51
|
-
if (i < M || i > R)
|
|
52
|
-
return null;
|
|
53
|
-
const p = this.isEqual(i, m.start), A = this.isEqual(i, m.end), E = !p && !A && Y(i, m), k = l && (Array.isArray(c) ? this.isSelectedFromArray(i, c, a, r) : T(c, a, r) && this.isEqual(i, c));
|
|
50
|
+
const i = this.normalize(g(v, L), a, r), k = i < M || i > R, p = this.isEqual(i, m.start), A = this.isEqual(i, m.end), E = !p && !A && U(i, m), F = l && (Array.isArray(c) ? this.isSelectedFromArray(i, c, a, r) : T(c, a, r) && this.isEqual(i, c));
|
|
54
51
|
return {
|
|
55
52
|
formattedValue: this.value(i),
|
|
56
53
|
id: `${e}${i.getTime()}`,
|
|
57
54
|
isFocused: this.isEqual(i, n),
|
|
58
|
-
isSelected:
|
|
55
|
+
isSelected: F,
|
|
59
56
|
isInRange: T(i, a, r),
|
|
60
57
|
isWeekend: this.isWeekend(i),
|
|
61
58
|
isRangeStart: p,
|
|
@@ -65,7 +62,8 @@ class Q {
|
|
|
65
62
|
isRangeSplitEnd: E && this.isEqual(i, R),
|
|
66
63
|
isToday: this.isEqual(i, q),
|
|
67
64
|
title: this.cellTitle(i),
|
|
68
|
-
value: i
|
|
65
|
+
value: i,
|
|
66
|
+
isOtherMonth: k
|
|
69
67
|
};
|
|
70
68
|
});
|
|
71
69
|
});
|
|
@@ -93,7 +91,7 @@ class Q {
|
|
|
93
91
|
return !t.getMonth();
|
|
94
92
|
}
|
|
95
93
|
move(t, e) {
|
|
96
|
-
const n =
|
|
94
|
+
const n = P[e];
|
|
97
95
|
return n ? n(t) : t;
|
|
98
96
|
}
|
|
99
97
|
cellTitle(t) {
|
|
@@ -122,7 +120,7 @@ class Q {
|
|
|
122
120
|
}
|
|
123
121
|
isWeekend(t) {
|
|
124
122
|
const e = t.getDay();
|
|
125
|
-
return e ===
|
|
123
|
+
return e === C || e === G;
|
|
126
124
|
}
|
|
127
125
|
abbrMonthNames() {
|
|
128
126
|
return this.intl.dateFormatNames({ nameType: "abbreviated", type: "months" });
|
|
@@ -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 {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";const i=require("react"),a=require("@progress/kendo-react-intl"),o=require("../messages/index.js"),l=require("@progress/kendo-react-common"),u=require("@progress/kendo-svg-icons");function p(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const c=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,c.get?c:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const r=p(i);class s extends r.Component{constructor(){super(...arguments),this.handelClick=e=>{e.stopPropagation();const{onClick:t}=this.props;t&&t.call(void 0,e)}}render(){const e=a.provideLocalizationService(this).toLanguageString(o.clear,o.messages[o.clear]);return r.createElement("span",{className:"k-clear-value",role:"button",onClick:this.handelClick,tabIndex:this.props.tabindex||-1,title:e,key:"clearbutton"},r.createElement(l.IconWrap,{name:"x",icon:u.xIcon}))}}a.registerForLocalization(s);module.exports=s;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as e from "react";
|
|
10
|
+
import { provideLocalizationService as a, registerForLocalization as n } from "@progress/kendo-react-intl";
|
|
11
|
+
import { clear as r, messages as i } from "../messages/index.mjs";
|
|
12
|
+
import { IconWrap as s } from "@progress/kendo-react-common";
|
|
13
|
+
import { xIcon as c } from "@progress/kendo-svg-icons";
|
|
14
|
+
class l extends e.Component {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments), this.handelClick = (t) => {
|
|
17
|
+
t.stopPropagation();
|
|
18
|
+
const { onClick: o } = this.props;
|
|
19
|
+
o && o.call(void 0, t);
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
const t = a(this).toLanguageString(r, i[r]);
|
|
24
|
+
return /* @__PURE__ */ e.createElement(
|
|
25
|
+
"span",
|
|
26
|
+
{
|
|
27
|
+
className: "k-clear-value",
|
|
28
|
+
role: "button",
|
|
29
|
+
onClick: this.handelClick,
|
|
30
|
+
tabIndex: this.props.tabindex || -1,
|
|
31
|
+
title: t,
|
|
32
|
+
key: "clearbutton"
|
|
33
|
+
},
|
|
34
|
+
/* @__PURE__ */ e.createElement(s, { name: "x", icon: c })
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
n(l);
|
|
39
|
+
export {
|
|
40
|
+
l as default
|
|
41
|
+
};
|