@progress/kendo-react-dateinputs 14.4.0-develop.1 → 14.4.0-develop.3
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/dateinput/DateInput.js +1 -1
- package/dateinput/DateInput.mjs +36 -36
- package/datetimepicker/DateTimeSelector.js +1 -1
- package/datetimepicker/DateTimeSelector.mjs +75 -73
- package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +8 -8
package/dateinput/DateInput.js
CHANGED
|
@@ -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 strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ve=require("react"),e=require("prop-types"),x=require("@progress/kendo-date-math"),te=require("@progress/kendo-react-buttons"),ne=require("@progress/kendo-svg-icons"),ae=require("@progress/kendo-react-intl"),o=require("@progress/kendo-react-common"),ke=require("@progress/kendo-react-labels"),pe=require("@progress/kendo-dateinputs-common"),_=require("./utils.js"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ve=require("react"),e=require("prop-types"),x=require("@progress/kendo-date-math"),te=require("@progress/kendo-react-buttons"),ne=require("@progress/kendo-svg-icons"),ae=require("@progress/kendo-react-intl"),o=require("@progress/kendo-react-common"),ke=require("@progress/kendo-react-labels"),pe=require("@progress/kendo-dateinputs-common"),_=require("./utils.js"),i=require("../utils.js"),c=require("../messages/index.js"),Ae=require("../timepicker/utils.js"),_e=require("../common/ClearButton.js"),je=require("./dateInputIntl.js");function Be(t){const b=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const m in t)if(m!=="default"){const C=Object.getOwnPropertyDescriptor(t,m);Object.defineProperty(b,m,C.get?C:{enumerable:!0,get:()=>t[m]})}}return b.default=t,Object.freeze(b)}const a=Be(Ve),Fe="Please enter a valid value!",B=a.forwardRef((t,b)=>{var ee;const m=o.useId(t.id),C=ae.useInternationalization(),E=ae.useLocalization(),re=o.useUnstyled(),F=o.usePropsContext(j,t).unstyled||re,{format:R=u.format,size:le=u.size,rounded:ue=u.rounded,fillMode:ie=u.fillMode,formatPlaceholder:oe=u.formatPlaceholder,spinners:se=u.spinners,disabled:w=u.disabled,min:ce=u.min,max:de=u.max,minTime:fe=u.minTime,maxTime:me=u.maxTime,validityStyles:ge=u.validityStyles,validationMessage:H=u.validationMessage,placeholder:y=u.placeholder,enableMouseWheel:ve=u.enableMouseWheel,autoCorrectParts:be=u.autoCorrectParts,autoSwitchParts:ye=u.autoSwitchParts,allowCaretMode:he=u.allowCaretMode,twoDigitYearMax:Ie=u.twoDigitYearMax,ariaHasPopup:Oe=u.ariaHasPopup,autoFocus:h=u.autoFocus}=o.usePropsContext(j,t),g=()=>P.current!==void 0?P.current:r.current&&r.current.value,z=()=>{const n=r.current&&r.current.currentText||"",l=g();return y!=null&&!qe.focused&&!l?y:n},U=()=>t.required!==void 0?t.required:!1,q=()=>{const n=g()||t.value,l=ce,D=de,k=_.isInRange(n,l,D)&&Ae.isInTimeRange(n,fe,me),p=H!==void 0,A=(!U()||n!=null)&&k,Ne=t.valid!==void 0?t.valid:A;return{customError:p,rangeOverflow:n&&D.getTime()<n.getTime()||!1,rangeUnderflow:n&&n.getTime()<l.getTime()||!1,valid:Ne,valueMissing:n===null}},De=()=>{s.current&&s.current.focus()},W=()=>new je.DateInputIntl(C),T=()=>{const n=g();return{format:R,steps:t.steps,formatPlaceholder:oe,placeholder:y,selectPreviousSegmentOnBackspace:!0,value:t.value||n,intlService:W(),autoFill:t.autoFill!==void 0?t.autoFill:!1,enableMouseWheel:ve,autoCorrectParts:be,autoSwitchParts:ye,autoSwitchKeys:t.autoSwitchKeys||[],twoDigitYearMax:Ie,allowCaretMode:he}},xe=n=>{d.current&&d.current.classList.add("k-focus"),N({focused:!0}),h&&Z(!0)},Ce=n=>{d.current&&d.current.classList.remove("k-focus"),N({focused:!1})},Ee=(n,l)=>typeof n!=typeof l?!0:typeof n=="string"&&typeof l=="string"?n!==l:typeof n=="object"&&typeof l=="object"?JSON.stringify(n)!==JSON.stringify(l):!1,we=n=>typeof n=="string"?n:{inputFormat:n,displayFormat:n},K=n=>{P.current=g(),Le(),v.current=n,P.current=void 0},J=n=>{t.onChange&&t.onChange(n)},Y=n=>{o.getActiveElement(document)===s.current&&n.preventDefault()},Te=()=>new pe.DateInput(s.current,{...T(),format:we(T().format),events:{focus:xe,blur:Ce,valueChange:K,click:J}}),X=()=>{s.current&&s.current.setCustomValidity&&s.current.setCustomValidity(q().valid?"":H||u.validationMessage)},Z=a.useCallback(n=>{var l;if(s.current&&h&&n){const D=(r==null?void 0:r.current).currentText,k=(r==null?void 0:r.current).currentText.search(/[^a-zA-Z]/),p=D[k],A=D.split(p)[0].length;d.current&&d.current.classList.add("k-focus"),(l=r==null?void 0:r.current)==null||l.selectNearestSegment(A)}},[h]),Me=n=>{!s.current||!r.current||K(n)},Se=n=>{n.preventDefault();const l=o.getActiveElement(document);s.current&&l!==s.current&&s.current.focus({preventScroll:!0})},f=n=>{const l=g();v.current&&t.onChange&&!x.isEqual(v.current.oldValue,l)&&t.onChange.call(void 0,{syntheticEvent:n,nativeEvent:v.current.event,value:v.current.value,target:M.current}),v.current=null},Pe=n=>{var l;(l=r.current)==null||l.modifyDateSegmentValue(1),f(n)},Re=n=>{var l;(l=r.current)==null||l.modifyDateSegmentValue(-1),f(n)},M=a.useRef(null),s=a.useRef(null),d=a.useRef(null);a.useImperativeHandle(M,()=>({props:t,get options(){return T()},get text(){return z()},get element(){return s.current},get name(){return t.name},get value(){return g()},get validity(){return q()},focus:De,updateOnPaste:Me})),a.useImperativeHandle(b,()=>M.current);const r=a.useRef(null),S=a.useRef(null),L=a.useRef(!1),P=a.useRef(null),v=a.useRef(null),I=a.useRef(t),[qe,N]=a.useState({focused:!1}),[,Le]=a.useReducer(n=>n+1,0);a.useLayoutEffect(()=>{L.current||(r.current=Te(),S.current=r.current.dateObject,L.current=!0)},[]),a.useEffect(()=>(X(),L.current||d.current&&d.current.addEventListener("wheel",Y,{passive:!1}),h&&(N({focused:!0}),Z(!0)),()=>{d.current&&d.current.removeEventListener("wheel",Y)}),[]),a.useEffect(()=>{X(),r.current&&(S.current=r.current.dateObject,(Ee(I.current.format,R)||I.current.readonly!==t.readonly||JSON.stringify(I.current.steps)!==JSON.stringify(t.steps)||W().locale!==r.current.options.intlService.locale)&&r.current.setOptions(T(),!0),I.current.value!==t.value&&(S.current.getValue()!==null||t.value!==null)&&S.current.setValue(t.value),t.ariaExpanded!==void 0&&t.ariaExpanded&&(r.current.options.placeholder=null),t.ariaExpanded!==void 0&&!t.ariaExpanded&&(r.current.options.placeholder=y),r.current.refreshElementValue(),I.current={format:R,readonly:t.readonly,ariaExpanded:t.ariaExpanded,steps:t.steps,value:t.value})});const $=t.id||m+"-accessibility-id",O=F&&F.uDateInput,G=z(),V=!ge||q().valid;a.useImperativeHandle(t._ref,()=>M.current);const Q=a.createElement("span",{ref:n=>{d.current=n},style:t.label?void 0:{width:t.width},dir:t.dir,className:o.classNames(o.uDateInput.wrapper({c:O,size:le,fillMode:ie,rounded:ue,disabled:w,required:U(),invalid:!V}),t.className)},a.createElement("input",{ref:n=>{s.current=n},role:t.ariaRole||"textbox",readOnly:t.readonly,tabIndex:t.tabIndex||0,disabled:w,title:t.title!==void 0?t.title:G,type:"text",spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoFocus:h,className:o.classNames(o.uDateInput.inputInner({c:O})),id:$,value:G,"aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabelledBy,"aria-describedby":t.ariaDescribedBy,"aria-haspopup":Oe,"aria-disabled":w,"aria-expanded":t.ariaExpanded,"aria-controls":t.ariaControls,"aria-required":t.required,"aria-invalid":!V,onKeyDown:f,onChange:f,onWheel:f,onInput:f,onClick:f,name:t.name,...t.inputAttributes}),t.children,t.clearButton&&t.value&&a.createElement(_e,{onClick:J,key:"clearbutton"}),se&&a.createElement("span",{className:o.classNames(o.uDateInput.inputSpinner({c:O})),onMouseDown:Se},a.createElement(te.Button,{tabIndex:-1,type:"button",className:o.classNames(o.uDateInput.spinnerIncrease({c:O})),icon:"caret-alt-up",svgIcon:ne.caretAltUpIcon,"aria-label":E.toLanguageString(c.increaseValue,c.messages[c.increaseValue]),title:E.toLanguageString(c.increaseValue,c.messages[c.increaseValue]),onClick:Pe}),a.createElement(te.Button,{tabIndex:-1,type:"button",className:o.classNames(o.uDateInput.spinnerDecrease({c:O})),icon:"caret-alt-down",svgIcon:ne.caretAltDownIcon,"aria-label":E.toLanguageString(c.decreaseValue,c.messages[c.decreaseValue]),title:E.toLanguageString(c.decreaseValue,c.messages[c.decreaseValue]),onClick:Re})));return t.label?a.createElement(ke.FloatingLabel,{label:t.label,editorId:$,editorValue:(ee=s.current)==null?void 0:ee.value,editorValid:V,editorDisabled:w,children:Q,style:{width:t.width}}):Q});B.propTypes={value:e.instanceOf(Date),format:e.oneOfType([i.nullable(e.string),e.shape({skeleton:e.string,pattern:e.string,date:e.oneOf(["short","medium","long","full"]),time:e.oneOf(["short","medium","long","full"]),datetime:e.oneOf(["short","medium","long","full"]),era:e.oneOf(["narrow","short","long"]),year:e.oneOf(["numeric","2-digit"]),month:e.oneOf(["numeric","2-digit","narrow","short","long"]),day:e.oneOf(["numeric","2-digit"]),weekday:e.oneOf(["narrow","short","long"]),hour:e.oneOf(["numeric","2-digit"]),hour12:e.bool,minute:e.oneOf(["numeric","2-digit"]),second:e.oneOf(["numeric","2-digit"]),timeZoneName:e.oneOf(["short","long"])})]),formatPlaceholder:e.oneOfType([i.nullable(e.oneOf(["wide","narrow","short","formatPattern"])),e.shape({year:i.nullable(e.string),month:i.nullable(e.string),day:i.nullable(e.string),hour:i.nullable(e.string),minute:i.nullable(e.string),second:i.nullable(e.string)})]),width:e.oneOfType([e.string,e.number]),tabIndex:e.number,title:e.string,steps:e.shape({year:i.nullable(e.number),month:i.nullable(e.number),day:i.nullable(e.number),hour:i.nullable(e.number),minute:i.nullable(e.number),second:i.nullable(e.number)}),min:e.instanceOf(Date),max:e.instanceOf(Date),disabled:e.bool,spinners:e.bool,name:e.string,dir:e.string,label:e.node,id:e.string,ariaLabelledBy:e.string,ariaDescribedBy:e.string,ariaLabel:e.string,ariaRole:e.string,ariaHasPopup:e.oneOfType([e.bool,e.oneOf(["grid","dialog"])]),ariaExpanded:e.oneOfType([e.bool]),onChange:e.func,validationMessage:e.string,required:e.bool,valid:e.bool,size:e.oneOf(["small","medium","large"]),rounded:e.oneOf(["small","medium","large","full","none"]),fillMode:e.oneOf(["solid","flat","outline"]),autoFocus:e.bool,inputAttributes:e.object};const u={format:_.DEFAULT_FORMAT,size:void 0,rounded:void 0,fillMode:void 0,formatPlaceholder:_.DEFAULT_FORMAT_PLACEHOLDER,spinners:!1,disabled:!1,max:x.cloneDate(i.MAX_DATE),min:x.cloneDate(i.MIN_DATE),minTime:x.cloneDate(i.MIN_TIME),maxTime:x.cloneDate(i.MAX_TIME),validityStyles:!0,validationMessage:Fe,placeholder:null,enableMouseWheel:!0,autoCorrectParts:!0,autoSwitchParts:!0,allowCaretMode:!1,twoDigitYearMax:68,ariaHasPopup:"grid",autoFocus:!1},j=o.createPropsContext();B.displayName="KendoReactDateInput";exports.DateInput=B;exports.DateInputPropsContext=j;exports.dateInputDefaultProps=u;
|
package/dateinput/DateInput.mjs
CHANGED
|
@@ -7,23 +7,23 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as r from "react";
|
|
9
9
|
import e from "prop-types";
|
|
10
|
-
import { cloneDate as
|
|
10
|
+
import { cloneDate as T, isEqual as ke } from "@progress/kendo-date-math";
|
|
11
11
|
import { Button as $ } from "@progress/kendo-react-buttons";
|
|
12
12
|
import { caretAltUpIcon as _e, caretAltDownIcon as Fe } from "@progress/kendo-svg-icons";
|
|
13
13
|
import { useInternationalization as He, useLocalization as Be } from "@progress/kendo-react-intl";
|
|
14
|
-
import { useId as qe, useUnstyled as ze, usePropsContext as Q, classNames as h, uDateInput as O, createPropsContext as
|
|
15
|
-
import { FloatingLabel as
|
|
16
|
-
import { DateInput as
|
|
14
|
+
import { useId as qe, useUnstyled as ze, usePropsContext as Q, classNames as h, uDateInput as O, createPropsContext as je, getActiveElement as ee } from "@progress/kendo-react-common";
|
|
15
|
+
import { FloatingLabel as Ue } from "@progress/kendo-react-labels";
|
|
16
|
+
import { DateInput as We } from "@progress/kendo-dateinputs-common";
|
|
17
17
|
import { DEFAULT_FORMAT_PLACEHOLDER as Ke, DEFAULT_FORMAT as Je, isInRange as Ye } from "./utils.mjs";
|
|
18
18
|
import { MAX_TIME as Xe, MIN_TIME as Ze, MIN_DATE as Ge, MAX_DATE as $e, nullable as u } from "../utils.mjs";
|
|
19
|
-
import { increaseValue as
|
|
19
|
+
import { increaseValue as M, messages as S, decreaseValue as P } from "../messages/index.mjs";
|
|
20
20
|
import { isInTimeRange as Qe } from "../timepicker/utils.mjs";
|
|
21
21
|
import et from "../common/ClearButton.mjs";
|
|
22
22
|
import { DateInputIntl as tt } from "./dateInputIntl.mjs";
|
|
23
23
|
const nt = "Please enter a valid value!", ne = r.forwardRef((t, re) => {
|
|
24
24
|
var G;
|
|
25
25
|
const ae = qe(t.id), ie = He(), E = Be(), oe = ze(), F = Q(te, t).unstyled || oe, {
|
|
26
|
-
format:
|
|
26
|
+
format: R = o.format,
|
|
27
27
|
size: le = o.size,
|
|
28
28
|
rounded: ue = o.rounded,
|
|
29
29
|
fillMode: se = o.fillMode,
|
|
@@ -44,10 +44,10 @@ const nt = "Please enter a valid value!", ne = r.forwardRef((t, re) => {
|
|
|
44
44
|
twoDigitYearMax: Ie = o.twoDigitYearMax,
|
|
45
45
|
ariaHasPopup: xe = o.ariaHasPopup,
|
|
46
46
|
autoFocus: g = o.autoFocus
|
|
47
|
-
} = Q(te, t), d = () =>
|
|
47
|
+
} = Q(te, t), d = () => D.current !== void 0 ? D.current : a.current && a.current.value, B = () => {
|
|
48
48
|
const n = a.current && a.current.currentText || "", i = d();
|
|
49
49
|
return m != null && !Ae.focused && !i ? m : n;
|
|
50
|
-
}, q = () => t.required !== void 0 ? t.required : !1,
|
|
50
|
+
}, q = () => t.required !== void 0 ? t.required : !1, L = () => {
|
|
51
51
|
const n = d() || t.value, i = fe, b = me, V = Ye(n, i, b) && Qe(n, ge, ve), k = H !== void 0, _ = (!q() || n != null) && V, Ve = t.valid !== void 0 ? t.valid : _;
|
|
52
52
|
return {
|
|
53
53
|
customError: k,
|
|
@@ -61,7 +61,7 @@ const nt = "Please enter a valid value!", ne = r.forwardRef((t, re) => {
|
|
|
61
61
|
}, z = () => new tt(ie), x = () => {
|
|
62
62
|
const n = d();
|
|
63
63
|
return {
|
|
64
|
-
format:
|
|
64
|
+
format: R,
|
|
65
65
|
steps: t.steps,
|
|
66
66
|
formatPlaceholder: ce,
|
|
67
67
|
placeholder: m,
|
|
@@ -83,24 +83,24 @@ const nt = "Please enter a valid value!", ne = r.forwardRef((t, re) => {
|
|
|
83
83
|
}, Te = (n, i) => typeof n != typeof i ? !0 : typeof n == "string" && typeof i == "string" ? n !== i : typeof n == "object" && typeof i == "object" ? JSON.stringify(n) !== JSON.stringify(i) : !1, Me = (n) => typeof n == "string" ? n : {
|
|
84
84
|
inputFormat: n,
|
|
85
85
|
displayFormat: n
|
|
86
|
+
}, j = (n) => {
|
|
87
|
+
D.current = d(), Ne(), f.current = n, D.current = void 0;
|
|
86
88
|
}, U = (n) => {
|
|
87
|
-
w.current = d(), Ne(), f.current = n, w.current = void 0;
|
|
88
|
-
}, W = (n) => {
|
|
89
89
|
t.onChange && t.onChange(n);
|
|
90
|
-
},
|
|
90
|
+
}, W = (n) => {
|
|
91
91
|
ee(document) === l.current && n.preventDefault();
|
|
92
|
-
}, Se = () => new
|
|
92
|
+
}, Se = () => new We(l.current, {
|
|
93
93
|
...x(),
|
|
94
94
|
format: Me(x().format),
|
|
95
95
|
events: {
|
|
96
96
|
focus: we,
|
|
97
97
|
blur: De,
|
|
98
|
-
valueChange:
|
|
99
|
-
click:
|
|
98
|
+
valueChange: j,
|
|
99
|
+
click: U
|
|
100
100
|
}
|
|
101
101
|
}), K = () => {
|
|
102
102
|
l.current && l.current.setCustomValidity && l.current.setCustomValidity(
|
|
103
|
-
|
|
103
|
+
L().valid ? "" : H || o.validationMessage
|
|
104
104
|
);
|
|
105
105
|
}, J = r.useCallback(
|
|
106
106
|
(n) => {
|
|
@@ -112,7 +112,7 @@ const nt = "Please enter a valid value!", ne = r.forwardRef((t, re) => {
|
|
|
112
112
|
},
|
|
113
113
|
[g]
|
|
114
114
|
), Pe = (n) => {
|
|
115
|
-
!l.current || !a.current ||
|
|
115
|
+
!l.current || !a.current || j(n);
|
|
116
116
|
}, Re = (n) => {
|
|
117
117
|
n.preventDefault();
|
|
118
118
|
const i = ee(document);
|
|
@@ -152,28 +152,28 @@ const nt = "Please enter a valid value!", ne = r.forwardRef((t, re) => {
|
|
|
152
152
|
return d();
|
|
153
153
|
},
|
|
154
154
|
get validity() {
|
|
155
|
-
return
|
|
155
|
+
return L();
|
|
156
156
|
},
|
|
157
157
|
// hidden methods
|
|
158
158
|
focus: Ce,
|
|
159
159
|
updateOnPaste: Pe
|
|
160
160
|
})
|
|
161
161
|
), r.useImperativeHandle(re, () => C.current);
|
|
162
|
-
const a = r.useRef(null),
|
|
162
|
+
const a = r.useRef(null), w = r.useRef(null), p = r.useRef(!1), D = r.useRef(null), f = r.useRef(null), v = r.useRef(t), [Ae, A] = r.useState({ focused: !1 }), [, Ne] = r.useReducer((n) => n + 1, 0);
|
|
163
163
|
r.useLayoutEffect(() => {
|
|
164
|
-
p.current || (a.current = Se(),
|
|
165
|
-
}, []), r.useEffect(() => (K(), p.current || s.current && s.current.addEventListener("wheel",
|
|
166
|
-
s.current && s.current.removeEventListener("wheel",
|
|
164
|
+
p.current || (a.current = Se(), w.current = a.current.dateObject, p.current = !0);
|
|
165
|
+
}, []), r.useEffect(() => (K(), p.current || s.current && s.current.addEventListener("wheel", W, { passive: !1 }), g && (A({ focused: !0 }), J(!0)), () => {
|
|
166
|
+
s.current && s.current.removeEventListener("wheel", W);
|
|
167
167
|
}), []), r.useEffect(() => {
|
|
168
|
-
K(), a.current && ((Te(v.current.format,
|
|
169
|
-
format:
|
|
168
|
+
K(), a.current && (w.current = a.current.dateObject, (Te(v.current.format, R) || v.current.readonly !== t.readonly || JSON.stringify(v.current.steps) !== JSON.stringify(t.steps) || z().locale !== a.current.options.intlService.locale) && a.current.setOptions(x(), !0), v.current.value !== t.value && (w.current.getValue() !== null || t.value !== null) && w.current.setValue(t.value), t.ariaExpanded !== void 0 && t.ariaExpanded && (a.current.options.placeholder = null), t.ariaExpanded !== void 0 && !t.ariaExpanded && (a.current.options.placeholder = m), a.current.refreshElementValue(), v.current = {
|
|
169
|
+
format: R,
|
|
170
170
|
readonly: t.readonly,
|
|
171
171
|
ariaExpanded: t.ariaExpanded,
|
|
172
172
|
steps: t.steps,
|
|
173
173
|
value: t.value
|
|
174
174
|
});
|
|
175
175
|
});
|
|
176
|
-
const Y = t.id || ae + "-accessibility-id", y = F && F.uDateInput, X = B(), N = !ye ||
|
|
176
|
+
const Y = t.id || ae + "-accessibility-id", y = F && F.uDateInput, X = B(), N = !ye || L().valid;
|
|
177
177
|
r.useImperativeHandle(t._ref, () => C.current);
|
|
178
178
|
const Z = /* @__PURE__ */ r.createElement(
|
|
179
179
|
"span",
|
|
@@ -234,7 +234,7 @@ const nt = "Please enter a valid value!", ne = r.forwardRef((t, re) => {
|
|
|
234
234
|
}
|
|
235
235
|
),
|
|
236
236
|
t.children,
|
|
237
|
-
t.clearButton && t.value && /* @__PURE__ */ r.createElement(et, { onClick:
|
|
237
|
+
t.clearButton && t.value && /* @__PURE__ */ r.createElement(et, { onClick: U, key: "clearbutton" }),
|
|
238
238
|
de && /* @__PURE__ */ r.createElement("span", { className: h(O.inputSpinner({ c: y })), onMouseDown: Re }, /* @__PURE__ */ r.createElement(
|
|
239
239
|
$,
|
|
240
240
|
{
|
|
@@ -243,8 +243,8 @@ const nt = "Please enter a valid value!", ne = r.forwardRef((t, re) => {
|
|
|
243
243
|
className: h(O.spinnerIncrease({ c: y })),
|
|
244
244
|
icon: "caret-alt-up",
|
|
245
245
|
svgIcon: _e,
|
|
246
|
-
"aria-label": E.toLanguageString(
|
|
247
|
-
title: E.toLanguageString(
|
|
246
|
+
"aria-label": E.toLanguageString(M, S[M]),
|
|
247
|
+
title: E.toLanguageString(M, S[M]),
|
|
248
248
|
onClick: Le
|
|
249
249
|
}
|
|
250
250
|
), /* @__PURE__ */ r.createElement(
|
|
@@ -255,14 +255,14 @@ const nt = "Please enter a valid value!", ne = r.forwardRef((t, re) => {
|
|
|
255
255
|
className: h(O.spinnerDecrease({ c: y })),
|
|
256
256
|
icon: "caret-alt-down",
|
|
257
257
|
svgIcon: Fe,
|
|
258
|
-
"aria-label": E.toLanguageString(
|
|
259
|
-
title: E.toLanguageString(
|
|
258
|
+
"aria-label": E.toLanguageString(P, S[P]),
|
|
259
|
+
title: E.toLanguageString(P, S[P]),
|
|
260
260
|
onClick: pe
|
|
261
261
|
}
|
|
262
262
|
))
|
|
263
263
|
);
|
|
264
264
|
return t.label ? /* @__PURE__ */ r.createElement(
|
|
265
|
-
|
|
265
|
+
Ue,
|
|
266
266
|
{
|
|
267
267
|
label: t.label,
|
|
268
268
|
editorId: Y,
|
|
@@ -355,10 +355,10 @@ const o = {
|
|
|
355
355
|
formatPlaceholder: Ke,
|
|
356
356
|
spinners: !1,
|
|
357
357
|
disabled: !1,
|
|
358
|
-
max:
|
|
359
|
-
min:
|
|
360
|
-
minTime:
|
|
361
|
-
maxTime:
|
|
358
|
+
max: T($e),
|
|
359
|
+
min: T(Ge),
|
|
360
|
+
minTime: T(Ze),
|
|
361
|
+
maxTime: T(Xe),
|
|
362
362
|
validityStyles: !0,
|
|
363
363
|
validationMessage: nt,
|
|
364
364
|
placeholder: null,
|
|
@@ -369,7 +369,7 @@ const o = {
|
|
|
369
369
|
twoDigitYearMax: 68,
|
|
370
370
|
ariaHasPopup: "grid",
|
|
371
371
|
autoFocus: !1
|
|
372
|
-
}, te =
|
|
372
|
+
}, te = je();
|
|
373
373
|
ne.displayName = "KendoReactDateInput";
|
|
374
374
|
export {
|
|
375
375
|
ne as DateInput,
|
|
@@ -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 strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react"),b=require("@progress/kendo-react-intl"),o=require("../messages/index.js"),p=require("@progress/kendo-react-buttons"),N=require("../calendar/components/Calendar.js"),B=require("../timepicker/TimePart.js"),c=require("../utils.js"),y=require("@progress/kendo-date-math"),a=require("@progress/kendo-react-common"),D=require("../timepicker/utils.js");function S(d){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(d){for(const e in d)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(d,e);Object.defineProperty(s,e,t.get?t:{enumerable:!0,get:()=>d[e]})}}return s.default=d,Object.freeze(s)}const n=S(E),v=class v extends n.Component{constructor(s){super(s),this._calendar=null,this._timePart=null,this._cancelButton=null,this._acceptButton=null,this._dateButtonRef=null,this._calendarWrap=null,this.shouldFocusPart=!1,this.focus=e=>{Promise.resolve().then(()=>{this.state.tab==="time"&&this._timePart&&this._timePart.focus(e);const t=this.calendarElement();this.state.tab==="date"&&t&&t.focus(e)})},this.calendarElement=()=>this._calendar&&this._calendar.element||this._calendarWrap&&this._calendarWrap.querySelector(".k-calendar"),this.move=e=>{if(e==="right"&&this.state.tab==="time"||e==="left"&&this.state.tab==="date")return;const t=e==="left"?"date":"time";this.shouldFocusPart=!0,this.setState({tab:t})},this.dateTimeFooter=()=>{const{cancelButton:e,unstyled:t}=this.props,i=t&&t.uDateTimePicker,r=this.localizationService.toLanguageString(o.dateTimePickerCancel,o.messages[o.dateTimePickerCancel]),h=this.localizationService.toLanguageString(o.dateTimePickerSet,o.messages[o.dateTimePickerSet]);return n.createElement("div",{className:a.classNames(a.uDateTimePicker.timeFooter({c:i}))},n.createElement(p.Button,{type:"button",themeColor:"primary",ref:l=>{this._acceptButton=l},className:a.classNames(a.uTime.accept({c:i})),disabled:!this.hasDateValue,onClick:this.handleAccept,onKeyDown:this.handleSetKeyDown,title:h,"aria-label":h},h),e&&n.createElement(p.Button,{type:"button",ref:l=>{this._cancelButton=l},className:a.classNames(a.uTime.cancel({c:i})),onClick:this.handleReject,onKeyDown:this.handleCancelKeyDown,title:r,"aria-label":r},r))},this.handleReject=e=>{this.setState({dateValue:this.props.value,timeValue:this.props.value||c.MIDNIGHT_DATE});const t=this.mergeDate(this.props.value,this.props.value||c.MIDNIGHT_DATE);if(this.props.onReject){const i={nativeEvent:e.nativeEvent,syntheticEvent:e,target:this,value:t};this.props.onReject.call(void 0,i)}},this.handleAccept=(e,t)=>{if(!this.state.dateValue||!this.state.timeValue||!this.hasDateValue)return;const i=this.mergeDate(this.state.dateValue,t||this.state.timeValue);this.props.onChange.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:i,target:this})},this.handleNowClick=e=>{this.setState({timeValue:D.getNow()}),this.handleAccept(e,D.getNow())},this.handleCalendarValueChange=e=>{e.syntheticEvent.stopPropagation(),this.setState({dateValue:e.value,tab:"time"}),this.shouldFocusPart=!0},this.handleTimeListContainerChange=e=>{this.setState({timeValue:e})},this.handleDateClick=e=>{e.stopPropagation(),this.move("left")},this.handleTimeClick=e=>{e.stopPropagation(),this.move("right")},this.handleKeyDown=e=>{const{keyCode:t,altKey:i}=e;if(!this.props.disabled)switch(t){case a.Keys.enter:!this.hasActiveButton()&&this.hasDateValue&&this.handleAccept(e);return;case a.Keys.left:if(!i)return;this.move("left");return;case a.Keys.right:if(!i)return;this.move("right");return;default:return}},this.handleCancelKeyDown=e=>{var i;const{keyCode:t}=e;t===a.Keys.tab&&((i=this._dateButtonRef)!=null&&i.element)&&(e.preventDefault(),this._dateButtonRef.element.focus())},this.handleSetKeyDown=e=>{var i;const{keyCode:t}=e;t===a.Keys.tab&&!this.props.cancelButton&&((i=this._dateButtonRef)!=null&&i.element)&&(e.preventDefault(),this._dateButtonRef.element.focus())},this.handleDateKeyDown=e=>{var r,h,l;const{keyCode:t,shiftKey:i}=e;i&&t===a.Keys.tab&&(e.stopPropagation(),(r=this._cancelButton)!=null&&r.element?this._cancelButton.element.focus():(l=(h=this._acceptButton)==null?void 0:h.element)==null||l.focus()),t===a.Keys.enter&&(e.stopPropagation(),this.move("left"))},this.handleTimeKeyDown=e=>{const{keyCode:t}=e;t===a.Keys.enter&&(e.stopPropagation(),this.move("right"))},this.handleTimePartMount=e=>{this.setState({timeValue:e})},this.state={tab:"date",dateValue:this.props.value,timeValue:this.props.value||c.MIDNIGHT_DATE}}get calendar(){return this._calendar}get timePart(){return this._timePart}get hasDateValue(){return this.state.dateValue!==null}get localizationService(){return b.provideLocalizationService(this)}componentDidUpdate(s,e){var t,i;this.shouldFocusPart&&this.focus({preventScroll:!0}),(((t=s.value)==null?void 0:t.getTime())!==((i=this.props.value)==null?void 0:i.getTime())||this.state.tab!==e.tab&&this.props.value)&&this.setState(r=>({dateValue:s.value&&this.props.value&&y.isEqualDate(s.value,this.props.value)?r.dateValue:this.props.value,timeValue:this.props.value||c.MIDNIGHT_DATE})),this.shouldFocusPart=!1}render(){const{disabled:s,min:e,max:t,weekNumber:i,focusedDate:r,format:h,mobileMode:l,footerActions:_,unstyled:g}=this.props,m=g&&g.uDateTimePicker,k=a.classNames(a.uDateTimePicker.wrap({c:m,date:this.state.tab==="date",time:this.state.tab==="time",disabled:s})),C=this.localizationService.toLanguageString(o.date,o.messages[o.date]),P=this.localizationService.toLanguageString(o.time,o.messages[o.time]),T={min:e,max:t,weekNumber:i,focusedDate:r,disabled:s||this.state.tab!=="date",value:this.state.dateValue,onChange:this.handleCalendarValueChange,navigation:!1,tabIndex:s||this.state.tab!=="date"?-1:void 0,mobileMode:l};return n.createElement("div",{onKeyDown:this.handleKeyDown,className:k,tabIndex:-1},n.createElement("div",{className:a.classNames(a.uDateTimePicker.buttonGroup({c:m}))},n.createElement(p.ButtonGroup,{width:"100%",unstyled:g},n.createElement(p.Button,{ref:u=>{this._dateButtonRef=u},type:"button",selected:this.state.tab==="date",togglable:!0,size:l?"large":void 0,onClick:this.handleDateClick,onKeyDown:this.handleDateKeyDown},C),n.createElement(p.Button,{type:"button",selected:this.state.tab==="time",togglable:!0,size:l?"large":void 0,onClick:this.handleTimeClick,onKeyDown:this.handleTimeKeyDown},P))),n.createElement("div",{className:a.classNames(a.uDateTimePicker.selector({c:m}))},n.createElement("div",{className:a.classNames(a.uDateTimePicker.calendarWrap({c:m})),ref:u=>{this._calendarWrap=u}},this.props.calendar?n.createElement(this.props.calendar,{key:this.state.tab,...T}):n.createElement(N.Calendar,{key:this.state.tab,ref:u=>{this._calendar=u},...T})),n.createElement("div",{className:a.classNames(a.uDateTimePicker.timeWrap({c:m}))},n.createElement("div",{className:a.classNames(a.uDateTimePicker.timeSelector({c:m,mobileMode:l}))},n.createElement(B.TimePart,{key:1,onNowClick:this.handleNowClick,disabled:s||this.state.tab!=="time",ref:u=>{this._timePart=u},min:this.minTime||c.MIN_TIME,max:this.maxTime||c.MAX_TIME,steps:this.props.steps,value:this.state.timeValue,format:h,onChange:this.handleTimeListContainerChange,onMount:this.handleTimePartMount,mobileMode:l,unstyled:g})))),_&&this.dateTimeFooter())}get minTime(){return this.props.minTime!==void 0?this.props.minTime:this.normalizeRange(this.props.min,this.state.dateValue)}get maxTime(){return this.props.maxTime!==void 0?this.props.maxTime:this.normalizeRange(this.props.max,this.state.dateValue)}normalizeRange(s,e){return y.isEqualDate(s,e||c.getToday())?s:null}hasActiveButton(){if(!this._acceptButton)return!1;const s=a.getActiveElement(document);return this._acceptButton&&s===this._acceptButton.element||this._cancelButton&&s===this._cancelButton.element}mergeTime(s,e){return s&&e?c.setTime(e,s):e}mergeDate(s,e){return s?c.setTime(s||c.getToday(),e):e}};v.defaultProps={footerActions:!0};let f=v;b.registerForLocalization(f);exports.DateTimeSelector=f;
|
|
@@ -7,17 +7,17 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as i from "react";
|
|
9
9
|
import { provideLocalizationService as R, registerForLocalization as M } from "@progress/kendo-react-intl";
|
|
10
|
-
import { dateTimePickerCancel as
|
|
11
|
-
import { Button as
|
|
10
|
+
import { dateTimePickerCancel as C, messages as p, dateTimePickerSet as D, date as _, time as T } from "../messages/index.mjs";
|
|
11
|
+
import { Button as f, ButtonGroup as x } from "@progress/kendo-react-buttons";
|
|
12
12
|
import { Calendar as z } from "../calendar/components/Calendar.mjs";
|
|
13
13
|
import { TimePart as A } from "../timepicker/TimePart.mjs";
|
|
14
|
-
import { MIDNIGHT_DATE as
|
|
14
|
+
import { MIDNIGHT_DATE as g, MAX_TIME as F, MIN_TIME as L, getToday as E, setTime as P } from "../utils.mjs";
|
|
15
15
|
import { isEqualDate as k } from "@progress/kendo-date-math";
|
|
16
|
-
import { classNames as l, uDateTimePicker as u, uTime as
|
|
17
|
-
import { getNow as
|
|
18
|
-
const
|
|
19
|
-
constructor(
|
|
20
|
-
super(
|
|
16
|
+
import { classNames as l, uDateTimePicker as u, uTime as V, Keys as h, getActiveElement as I } from "@progress/kendo-react-common";
|
|
17
|
+
import { getNow as B } from "../timepicker/utils.mjs";
|
|
18
|
+
const b = class b extends i.Component {
|
|
19
|
+
constructor(s) {
|
|
20
|
+
super(s), this._calendar = null, this._timePart = null, this._cancelButton = null, this._acceptButton = null, this._dateButtonRef = null, this._calendarWrap = null, this.shouldFocusPart = !1, this.focus = (t) => {
|
|
21
21
|
Promise.resolve().then(() => {
|
|
22
22
|
this.state.tab === "time" && this._timePart && this._timePart.focus(t);
|
|
23
23
|
const e = this.calendarElement();
|
|
@@ -29,30 +29,16 @@ const y = class y extends i.Component {
|
|
|
29
29
|
const e = t === "left" ? "date" : "time";
|
|
30
30
|
this.shouldFocusPart = !0, this.setState({ tab: e });
|
|
31
31
|
}, this.dateTimeFooter = () => {
|
|
32
|
-
const { cancelButton: t, unstyled: e } = this.props,
|
|
33
|
-
return /* @__PURE__ */ i.createElement("div", { className: l(u.timeFooter({ c:
|
|
34
|
-
|
|
35
|
-
{
|
|
36
|
-
type: "button",
|
|
37
|
-
ref: (n) => {
|
|
38
|
-
this._cancelButton = n;
|
|
39
|
-
},
|
|
40
|
-
className: l(B.cancel({ c: s })),
|
|
41
|
-
onClick: this.handleReject,
|
|
42
|
-
onKeyDown: this.handleCancelKeyDown,
|
|
43
|
-
title: o,
|
|
44
|
-
"aria-label": o
|
|
45
|
-
},
|
|
46
|
-
o
|
|
47
|
-
), /* @__PURE__ */ i.createElement(
|
|
48
|
-
g,
|
|
32
|
+
const { cancelButton: t, unstyled: e } = this.props, a = e && e.uDateTimePicker, o = this.localizationService.toLanguageString(C, p[C]), r = this.localizationService.toLanguageString(D, p[D]);
|
|
33
|
+
return /* @__PURE__ */ i.createElement("div", { className: l(u.timeFooter({ c: a })) }, /* @__PURE__ */ i.createElement(
|
|
34
|
+
f,
|
|
49
35
|
{
|
|
50
36
|
type: "button",
|
|
51
37
|
themeColor: "primary",
|
|
52
38
|
ref: (n) => {
|
|
53
39
|
this._acceptButton = n;
|
|
54
40
|
},
|
|
55
|
-
className: l(
|
|
41
|
+
className: l(V.accept({ c: a })),
|
|
56
42
|
disabled: !this.hasDateValue,
|
|
57
43
|
onClick: this.handleAccept,
|
|
58
44
|
onKeyDown: this.handleSetKeyDown,
|
|
@@ -60,31 +46,45 @@ const y = class y extends i.Component {
|
|
|
60
46
|
"aria-label": r
|
|
61
47
|
},
|
|
62
48
|
r
|
|
49
|
+
), t && /* @__PURE__ */ i.createElement(
|
|
50
|
+
f,
|
|
51
|
+
{
|
|
52
|
+
type: "button",
|
|
53
|
+
ref: (n) => {
|
|
54
|
+
this._cancelButton = n;
|
|
55
|
+
},
|
|
56
|
+
className: l(V.cancel({ c: a })),
|
|
57
|
+
onClick: this.handleReject,
|
|
58
|
+
onKeyDown: this.handleCancelKeyDown,
|
|
59
|
+
title: o,
|
|
60
|
+
"aria-label": o
|
|
61
|
+
},
|
|
62
|
+
o
|
|
63
63
|
));
|
|
64
64
|
}, this.handleReject = (t) => {
|
|
65
|
-
this.setState({ dateValue: this.props.value, timeValue: this.props.value ||
|
|
66
|
-
const e = this.mergeDate(this.props.value, this.props.value ||
|
|
65
|
+
this.setState({ dateValue: this.props.value, timeValue: this.props.value || g });
|
|
66
|
+
const e = this.mergeDate(this.props.value, this.props.value || g);
|
|
67
67
|
if (this.props.onReject) {
|
|
68
|
-
const
|
|
68
|
+
const a = {
|
|
69
69
|
nativeEvent: t.nativeEvent,
|
|
70
70
|
syntheticEvent: t,
|
|
71
71
|
target: this,
|
|
72
72
|
value: e
|
|
73
73
|
};
|
|
74
|
-
this.props.onReject.call(void 0,
|
|
74
|
+
this.props.onReject.call(void 0, a);
|
|
75
75
|
}
|
|
76
76
|
}, this.handleAccept = (t, e) => {
|
|
77
77
|
if (!this.state.dateValue || !this.state.timeValue || !this.hasDateValue)
|
|
78
78
|
return;
|
|
79
|
-
const
|
|
79
|
+
const a = this.mergeDate(this.state.dateValue, e || this.state.timeValue);
|
|
80
80
|
this.props.onChange.call(void 0, {
|
|
81
81
|
syntheticEvent: t,
|
|
82
82
|
nativeEvent: t.nativeEvent,
|
|
83
|
-
value:
|
|
83
|
+
value: a,
|
|
84
84
|
target: this
|
|
85
85
|
});
|
|
86
86
|
}, this.handleNowClick = (t) => {
|
|
87
|
-
this.setState({ timeValue:
|
|
87
|
+
this.setState({ timeValue: B() }), this.handleAccept(t, B());
|
|
88
88
|
}, this.handleCalendarValueChange = (t) => {
|
|
89
89
|
t.syntheticEvent.stopPropagation(), this.setState({ dateValue: t.value, tab: "time" }), this.shouldFocusPart = !0;
|
|
90
90
|
}, this.handleTimeListContainerChange = (t) => {
|
|
@@ -94,19 +94,19 @@ const y = class y extends i.Component {
|
|
|
94
94
|
}, this.handleTimeClick = (t) => {
|
|
95
95
|
t.stopPropagation(), this.move("right");
|
|
96
96
|
}, this.handleKeyDown = (t) => {
|
|
97
|
-
const { keyCode: e, altKey:
|
|
97
|
+
const { keyCode: e, altKey: a } = t;
|
|
98
98
|
if (!this.props.disabled)
|
|
99
99
|
switch (e) {
|
|
100
100
|
case h.enter:
|
|
101
101
|
!this.hasActiveButton() && this.hasDateValue && this.handleAccept(t);
|
|
102
102
|
return;
|
|
103
103
|
case h.left:
|
|
104
|
-
if (!
|
|
104
|
+
if (!a)
|
|
105
105
|
return;
|
|
106
106
|
this.move("left");
|
|
107
107
|
return;
|
|
108
108
|
case h.right:
|
|
109
|
-
if (!
|
|
109
|
+
if (!a)
|
|
110
110
|
return;
|
|
111
111
|
this.move("right");
|
|
112
112
|
return;
|
|
@@ -114,15 +114,17 @@ const y = class y extends i.Component {
|
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
116
|
}, this.handleCancelKeyDown = (t) => {
|
|
117
|
+
var a;
|
|
117
118
|
const { keyCode: e } = t;
|
|
118
|
-
e === h.tab &&
|
|
119
|
+
e === h.tab && ((a = this._dateButtonRef) != null && a.element) && (t.preventDefault(), this._dateButtonRef.element.focus());
|
|
119
120
|
}, this.handleSetKeyDown = (t) => {
|
|
121
|
+
var a;
|
|
120
122
|
const { keyCode: e } = t;
|
|
121
|
-
e === h.tab && this.
|
|
123
|
+
e === h.tab && !this.props.cancelButton && ((a = this._dateButtonRef) != null && a.element) && (t.preventDefault(), this._dateButtonRef.element.focus());
|
|
122
124
|
}, this.handleDateKeyDown = (t) => {
|
|
123
|
-
var o, r, n
|
|
124
|
-
const { keyCode: e, shiftKey:
|
|
125
|
-
|
|
125
|
+
var o, r, n;
|
|
126
|
+
const { keyCode: e, shiftKey: a } = t;
|
|
127
|
+
a && e === h.tab && (t.stopPropagation(), (o = this._cancelButton) != null && o.element ? this._cancelButton.element.focus() : (n = (r = this._acceptButton) == null ? void 0 : r.element) == null || n.focus()), e === h.enter && (t.stopPropagation(), this.move("left"));
|
|
126
128
|
}, this.handleTimeKeyDown = (t) => {
|
|
127
129
|
const { keyCode: e } = t;
|
|
128
130
|
e === h.enter && (t.stopPropagation(), this.move("right"));
|
|
@@ -131,7 +133,7 @@ const y = class y extends i.Component {
|
|
|
131
133
|
}, this.state = {
|
|
132
134
|
tab: "date",
|
|
133
135
|
dateValue: this.props.value,
|
|
134
|
-
timeValue: this.props.value ||
|
|
136
|
+
timeValue: this.props.value || g
|
|
135
137
|
};
|
|
136
138
|
}
|
|
137
139
|
get calendar() {
|
|
@@ -146,35 +148,35 @@ const y = class y extends i.Component {
|
|
|
146
148
|
get localizationService() {
|
|
147
149
|
return R(this);
|
|
148
150
|
}
|
|
149
|
-
componentDidUpdate(
|
|
150
|
-
var e,
|
|
151
|
-
this.shouldFocusPart && this.focus({ preventScroll: !0 }), (((e =
|
|
152
|
-
dateValue:
|
|
153
|
-
timeValue: this.props.value ||
|
|
151
|
+
componentDidUpdate(s, t) {
|
|
152
|
+
var e, a;
|
|
153
|
+
this.shouldFocusPart && this.focus({ preventScroll: !0 }), (((e = s.value) == null ? void 0 : e.getTime()) !== ((a = this.props.value) == null ? void 0 : a.getTime()) || this.state.tab !== t.tab && this.props.value) && this.setState((o) => ({
|
|
154
|
+
dateValue: s.value && this.props.value && k(s.value, this.props.value) ? o.dateValue : this.props.value,
|
|
155
|
+
timeValue: this.props.value || g
|
|
154
156
|
})), this.shouldFocusPart = !1;
|
|
155
157
|
}
|
|
156
158
|
render() {
|
|
157
|
-
const { disabled:
|
|
159
|
+
const { disabled: s, min: t, max: e, weekNumber: a, focusedDate: o, format: r, mobileMode: n, footerActions: w, unstyled: d } = this.props, m = d && d.uDateTimePicker, S = l(
|
|
158
160
|
u.wrap({
|
|
159
161
|
c: m,
|
|
160
162
|
date: this.state.tab === "date",
|
|
161
163
|
time: this.state.tab === "time",
|
|
162
|
-
disabled:
|
|
164
|
+
disabled: s
|
|
163
165
|
})
|
|
164
|
-
), K = this.localizationService.toLanguageString(
|
|
166
|
+
), K = this.localizationService.toLanguageString(_, p[_]), N = this.localizationService.toLanguageString(T, p[T]), y = {
|
|
165
167
|
min: t,
|
|
166
168
|
max: e,
|
|
167
|
-
weekNumber:
|
|
169
|
+
weekNumber: a,
|
|
168
170
|
focusedDate: o,
|
|
169
|
-
disabled:
|
|
171
|
+
disabled: s || this.state.tab !== "date",
|
|
170
172
|
value: this.state.dateValue,
|
|
171
173
|
onChange: this.handleCalendarValueChange,
|
|
172
174
|
navigation: !1,
|
|
173
|
-
tabIndex:
|
|
175
|
+
tabIndex: s || this.state.tab !== "date" ? -1 : void 0,
|
|
174
176
|
mobileMode: n
|
|
175
177
|
};
|
|
176
|
-
return /* @__PURE__ */ i.createElement("div", { onKeyDown: this.handleKeyDown, className: S, tabIndex: -1 }, /* @__PURE__ */ i.createElement("div", { className: l(u.buttonGroup({ c: m })) }, /* @__PURE__ */ i.createElement(x, { width: "100%", unstyled:
|
|
177
|
-
|
|
178
|
+
return /* @__PURE__ */ i.createElement("div", { onKeyDown: this.handleKeyDown, className: S, tabIndex: -1 }, /* @__PURE__ */ i.createElement("div", { className: l(u.buttonGroup({ c: m })) }, /* @__PURE__ */ i.createElement(x, { width: "100%", unstyled: d }, /* @__PURE__ */ i.createElement(
|
|
179
|
+
f,
|
|
178
180
|
{
|
|
179
181
|
ref: (c) => {
|
|
180
182
|
this._dateButtonRef = c;
|
|
@@ -188,7 +190,7 @@ const y = class y extends i.Component {
|
|
|
188
190
|
},
|
|
189
191
|
K
|
|
190
192
|
), /* @__PURE__ */ i.createElement(
|
|
191
|
-
|
|
193
|
+
f,
|
|
192
194
|
{
|
|
193
195
|
type: "button",
|
|
194
196
|
selected: this.state.tab === "time",
|
|
@@ -206,14 +208,14 @@ const y = class y extends i.Component {
|
|
|
206
208
|
this._calendarWrap = c;
|
|
207
209
|
}
|
|
208
210
|
},
|
|
209
|
-
this.props.calendar ? /* @__PURE__ */ i.createElement(this.props.calendar, { key: this.state.tab, ...
|
|
211
|
+
this.props.calendar ? /* @__PURE__ */ i.createElement(this.props.calendar, { key: this.state.tab, ...y }) : /* @__PURE__ */ i.createElement(
|
|
210
212
|
z,
|
|
211
213
|
{
|
|
212
214
|
key: this.state.tab,
|
|
213
215
|
ref: (c) => {
|
|
214
216
|
this._calendar = c;
|
|
215
217
|
},
|
|
216
|
-
...
|
|
218
|
+
...y
|
|
217
219
|
}
|
|
218
220
|
)
|
|
219
221
|
), /* @__PURE__ */ i.createElement("div", { className: l(u.timeWrap({ c: m })) }, /* @__PURE__ */ i.createElement("div", { className: l(u.timeSelector({ c: m, mobileMode: n })) }, /* @__PURE__ */ i.createElement(
|
|
@@ -221,7 +223,7 @@ const y = class y extends i.Component {
|
|
|
221
223
|
{
|
|
222
224
|
key: 1,
|
|
223
225
|
onNowClick: this.handleNowClick,
|
|
224
|
-
disabled:
|
|
226
|
+
disabled: s || this.state.tab !== "time",
|
|
225
227
|
ref: (c) => {
|
|
226
228
|
this._timePart = c;
|
|
227
229
|
},
|
|
@@ -233,9 +235,9 @@ const y = class y extends i.Component {
|
|
|
233
235
|
onChange: this.handleTimeListContainerChange,
|
|
234
236
|
onMount: this.handleTimePartMount,
|
|
235
237
|
mobileMode: n,
|
|
236
|
-
unstyled:
|
|
238
|
+
unstyled: d
|
|
237
239
|
}
|
|
238
|
-
)))),
|
|
240
|
+
)))), w && this.dateTimeFooter());
|
|
239
241
|
}
|
|
240
242
|
get minTime() {
|
|
241
243
|
return this.props.minTime !== void 0 ? this.props.minTime : this.normalizeRange(this.props.min, this.state.dateValue);
|
|
@@ -243,27 +245,27 @@ const y = class y extends i.Component {
|
|
|
243
245
|
get maxTime() {
|
|
244
246
|
return this.props.maxTime !== void 0 ? this.props.maxTime : this.normalizeRange(this.props.max, this.state.dateValue);
|
|
245
247
|
}
|
|
246
|
-
normalizeRange(
|
|
247
|
-
return k(
|
|
248
|
+
normalizeRange(s, t) {
|
|
249
|
+
return k(s, t || E()) ? s : null;
|
|
248
250
|
}
|
|
249
251
|
hasActiveButton() {
|
|
250
252
|
if (!this._acceptButton)
|
|
251
253
|
return !1;
|
|
252
|
-
const
|
|
253
|
-
return this._acceptButton &&
|
|
254
|
+
const s = I(document);
|
|
255
|
+
return this._acceptButton && s === this._acceptButton.element || this._cancelButton && s === this._cancelButton.element;
|
|
254
256
|
}
|
|
255
|
-
mergeTime(
|
|
256
|
-
return
|
|
257
|
+
mergeTime(s, t) {
|
|
258
|
+
return s && t ? P(t, s) : t;
|
|
257
259
|
}
|
|
258
|
-
mergeDate(
|
|
259
|
-
return
|
|
260
|
+
mergeDate(s, t) {
|
|
261
|
+
return s ? P(s || E(), t) : t;
|
|
260
262
|
}
|
|
261
263
|
};
|
|
262
|
-
|
|
264
|
+
b.defaultProps = {
|
|
263
265
|
footerActions: !0
|
|
264
266
|
};
|
|
265
|
-
let
|
|
266
|
-
M(
|
|
267
|
+
let v = b;
|
|
268
|
+
M(v);
|
|
267
269
|
export {
|
|
268
|
-
|
|
270
|
+
v as DateTimeSelector
|
|
269
271
|
};
|