@alfalab/core-components-date-time-input 4.0.3 → 4.0.5

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.
@@ -21,7 +21,7 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
21
21
  var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
22
22
  var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
23
23
 
24
- var styles = {"component":"date-time-input__component_1ngbn","calendarContainer":"date-time-input__calendarContainer_1ngbn","calendarResponsive":"date-time-input__calendarResponsive_1ngbn","block":"date-time-input__block_1ngbn","calendarIcon":"date-time-input__calendarIcon_1ngbn"};
24
+ var styles = {"component":"date-time-input__component_1h41f","calendarContainer":"date-time-input__calendarContainer_1h41f","calendarResponsive":"date-time-input__calendarResponsive_1h41f","block":"date-time-input__block_1h41f","calendarIcon":"date-time-input__calendarIcon_1h41f"};
25
25
  require('./index.css')
26
26
 
27
27
  /* eslint-disable no-useless-escape, jsx-a11y/click-events-have-key-events */
@@ -122,7 +122,7 @@ var DateTimeInput = React__default.default.forwardRef(function (_a, ref) {
122
122
  };
123
123
  var handleInputKeyDown = function (event) {
124
124
  var isCopy = (event.metaKey || event.ctrlKey) && event.key === 'c';
125
- if (disableUserInput && !isCopy) {
125
+ if (disableUserInput && !isCopy && event.key !== 'Tab') {
126
126
  event.preventDefault();
127
127
  }
128
128
  };
@@ -1,4 +1,4 @@
1
- /* hash: 1r6lu */
1
+ /* hash: 1gl8s */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-border-secondary: #e9e9eb; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -41,24 +41,24 @@
41
41
  /* marker */
42
42
  } :root {
43
43
  --calendar-popover-border-radius: var(--border-radius-m);
44
- } .date-time-input__component_1ngbn {
44
+ } .date-time-input__component_1h41f {
45
45
  display: inline-block;
46
46
  outline: none;
47
47
  position: relative;
48
- } .date-time-input__calendarContainer_1ngbn {
48
+ } .date-time-input__calendarContainer_1h41f {
49
49
  display: inline-block;
50
50
  box-sizing: border-box;
51
51
  border-radius: var(--calendar-popover-border-radius);
52
52
  border: 1px solid var(--color-light-border-secondary)
53
- } @media (max-width: 374px) { .date-time-input__calendarContainer_1ngbn {
53
+ } @media (max-width: 374px) { .date-time-input__calendarContainer_1h41f {
54
54
  width: 100%;
55
55
  min-width: 288px
56
56
  }
57
- } .date-time-input__calendarResponsive_1ngbn {
57
+ } .date-time-input__calendarResponsive_1h41f {
58
58
  width: var(--calendar-width);
59
- } .date-time-input__block_1ngbn {
59
+ } .date-time-input__block_1h41f {
60
60
  width: 100%;
61
- } .date-time-input__calendarIcon_1ngbn {
61
+ } .date-time-input__calendarIcon_1h41f {
62
62
  margin-right: var(--gap-s-neg);
63
63
  height: 100%;
64
64
  }
@@ -121,7 +121,7 @@ var DateTimeInput = React__default.default.forwardRef(function (_a, ref) {
121
121
  };
122
122
  var handleInputKeyDown = function (event) {
123
123
  var isCopy = (event.metaKey || event.ctrlKey) && event.key === 'c';
124
- if (disableUserInput && !isCopy) {
124
+ if (disableUserInput && !isCopy && event.key !== 'Tab') {
125
125
  event.preventDefault();
126
126
  }
127
127
  };
@@ -8,4 +8,8 @@ declare function easeInOutQuad(x: number): number;
8
8
  declare const easingFns: {
9
9
  easeInOutQuad: typeof easeInOutQuad;
10
10
  };
11
- export { isClient, getDataTestId, createPaddingStyle, easingFns };
11
+ declare function disableUserInput<T>(disabled: boolean | undefined, event: React.KeyboardEvent<T>): void;
12
+ declare const inputUtils: {
13
+ disableUserInput: typeof disableUserInput;
14
+ };
15
+ export { isClient, getDataTestId, createPaddingStyle, easingFns, inputUtils };
@@ -11,7 +11,7 @@ import { getDateWithoutTime, DATE_WITH_TIME_LENGTH, format, getFullDateTime, isC
11
11
  import 'date-fns/isValid';
12
12
  import 'date-fns/parse';
13
13
 
14
- var styles = {"component":"date-time-input__component_1ngbn","calendarContainer":"date-time-input__calendarContainer_1ngbn","calendarResponsive":"date-time-input__calendarResponsive_1ngbn","block":"date-time-input__block_1ngbn","calendarIcon":"date-time-input__calendarIcon_1ngbn"};
14
+ var styles = {"component":"date-time-input__component_1h41f","calendarContainer":"date-time-input__calendarContainer_1h41f","calendarResponsive":"date-time-input__calendarResponsive_1h41f","block":"date-time-input__block_1h41f","calendarIcon":"date-time-input__calendarIcon_1h41f"};
15
15
  require('./index.css')
16
16
 
17
17
  /* eslint-disable no-useless-escape, jsx-a11y/click-events-have-key-events */
@@ -112,7 +112,7 @@ var DateTimeInput = React.forwardRef(function (_a, ref) {
112
112
  };
113
113
  var handleInputKeyDown = function (event) {
114
114
  var isCopy = (event.metaKey || event.ctrlKey) && event.key === 'c';
115
- if (disableUserInput && !isCopy) {
115
+ if (disableUserInput && !isCopy && event.key !== 'Tab') {
116
116
  event.preventDefault();
117
117
  }
118
118
  };
@@ -1,4 +1,4 @@
1
- /* hash: 1r6lu */
1
+ /* hash: 1gl8s */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-border-secondary: #e9e9eb; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -41,24 +41,24 @@
41
41
  /* marker */
42
42
  } :root {
43
43
  --calendar-popover-border-radius: var(--border-radius-m);
44
- } .date-time-input__component_1ngbn {
44
+ } .date-time-input__component_1h41f {
45
45
  display: inline-block;
46
46
  outline: none;
47
47
  position: relative;
48
- } .date-time-input__calendarContainer_1ngbn {
48
+ } .date-time-input__calendarContainer_1h41f {
49
49
  display: inline-block;
50
50
  box-sizing: border-box;
51
51
  border-radius: var(--calendar-popover-border-radius);
52
52
  border: 1px solid var(--color-light-border-secondary)
53
- } @media (max-width: 374px) { .date-time-input__calendarContainer_1ngbn {
53
+ } @media (max-width: 374px) { .date-time-input__calendarContainer_1h41f {
54
54
  width: 100%;
55
55
  min-width: 288px
56
56
  }
57
- } .date-time-input__calendarResponsive_1ngbn {
57
+ } .date-time-input__calendarResponsive_1h41f {
58
58
  width: var(--calendar-width);
59
- } .date-time-input__block_1ngbn {
59
+ } .date-time-input__block_1h41f {
60
60
  width: 100%;
61
- } .date-time-input__calendarIcon_1ngbn {
61
+ } .date-time-input__calendarIcon_1h41f {
62
62
  margin-right: var(--gap-s-neg);
63
63
  height: 100%;
64
64
  }
@@ -8,4 +8,8 @@ declare function easeInOutQuad(x: number): number;
8
8
  declare const easingFns: {
9
9
  easeInOutQuad: typeof easeInOutQuad;
10
10
  };
11
- export { isClient, getDataTestId, createPaddingStyle, easingFns };
11
+ declare function disableUserInput<T>(disabled: boolean | undefined, event: React.KeyboardEvent<T>): void;
12
+ declare const inputUtils: {
13
+ disableUserInput: typeof disableUserInput;
14
+ };
15
+ export { isClient, getDataTestId, createPaddingStyle, easingFns, inputUtils };
@@ -8,4 +8,8 @@ declare function easeInOutQuad(x: number): number;
8
8
  declare const easingFns: {
9
9
  easeInOutQuad: typeof easeInOutQuad;
10
10
  };
11
- export { isClient, getDataTestId, createPaddingStyle, easingFns };
11
+ declare function disableUserInput<T>(disabled: boolean | undefined, event: React.KeyboardEvent<T>): void;
12
+ declare const inputUtils: {
13
+ disableUserInput: typeof disableUserInput;
14
+ };
15
+ export { isClient, getDataTestId, createPaddingStyle, easingFns, inputUtils };
@@ -10,7 +10,7 @@ import { getDateWithoutTime, DATE_WITH_TIME_LENGTH, format, getFullDateTime, isC
10
10
  import 'date-fns/isValid';
11
11
  import 'date-fns/parse';
12
12
 
13
- const styles = {"component":"date-time-input__component_1ngbn","calendarContainer":"date-time-input__calendarContainer_1ngbn","calendarResponsive":"date-time-input__calendarResponsive_1ngbn","block":"date-time-input__block_1ngbn","calendarIcon":"date-time-input__calendarIcon_1ngbn"};
13
+ const styles = {"component":"date-time-input__component_1h41f","calendarContainer":"date-time-input__calendarContainer_1h41f","calendarResponsive":"date-time-input__calendarResponsive_1h41f","block":"date-time-input__block_1h41f","calendarIcon":"date-time-input__calendarIcon_1h41f"};
14
14
  require('./index.css')
15
15
 
16
16
  /* eslint-disable no-useless-escape, jsx-a11y/click-events-have-key-events */
@@ -108,7 +108,7 @@ const DateTimeInput = React.forwardRef(({ className, inputClassName, popoverClas
108
108
  };
109
109
  const handleInputKeyDown = (event) => {
110
110
  const isCopy = (event.metaKey || event.ctrlKey) && event.key === 'c';
111
- if (disableUserInput && !isCopy) {
111
+ if (disableUserInput && !isCopy && event.key !== 'Tab') {
112
112
  event.preventDefault();
113
113
  }
114
114
  };
@@ -1,4 +1,4 @@
1
- /* hash: 1r6lu */
1
+ /* hash: 1gl8s */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-border-secondary: #e9e9eb; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -41,24 +41,24 @@
41
41
  /* marker */
42
42
  } :root {
43
43
  --calendar-popover-border-radius: var(--border-radius-m);
44
- } .date-time-input__component_1ngbn {
44
+ } .date-time-input__component_1h41f {
45
45
  display: inline-block;
46
46
  outline: none;
47
47
  position: relative;
48
- } .date-time-input__calendarContainer_1ngbn {
48
+ } .date-time-input__calendarContainer_1h41f {
49
49
  display: inline-block;
50
50
  box-sizing: border-box;
51
51
  border-radius: var(--calendar-popover-border-radius);
52
52
  border: 1px solid var(--color-light-border-secondary)
53
- } @media (max-width: 374px) { .date-time-input__calendarContainer_1ngbn {
53
+ } @media (max-width: 374px) { .date-time-input__calendarContainer_1h41f {
54
54
  width: 100%;
55
55
  min-width: 288px
56
56
  }
57
- } .date-time-input__calendarResponsive_1ngbn {
57
+ } .date-time-input__calendarResponsive_1h41f {
58
58
  width: var(--calendar-width);
59
- } .date-time-input__block_1ngbn {
59
+ } .date-time-input__block_1h41f {
60
60
  width: 100%;
61
- } .date-time-input__calendarIcon_1ngbn {
61
+ } .date-time-input__calendarIcon_1h41f {
62
62
  margin-right: var(--gap-s-neg);
63
63
  height: 100%;
64
64
  }
@@ -8,4 +8,8 @@ declare function easeInOutQuad(x: number): number;
8
8
  declare const easingFns: {
9
9
  easeInOutQuad: typeof easeInOutQuad;
10
10
  };
11
- export { isClient, getDataTestId, createPaddingStyle, easingFns };
11
+ declare function disableUserInput<T>(disabled: boolean | undefined, event: React.KeyboardEvent<T>): void;
12
+ declare const inputUtils: {
13
+ disableUserInput: typeof disableUserInput;
14
+ };
15
+ export { isClient, getDataTestId, createPaddingStyle, easingFns, inputUtils };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-date-time-input",
3
- "version": "4.0.3",
3
+ "version": "4.0.5",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -35,9 +35,9 @@
35
35
  "react-dom": "^16.9.0 || ^17.0.1 || ^18.0.0"
36
36
  },
37
37
  "dependencies": {
38
- "@alfalab/core-components-calendar": "^7.0.3",
39
- "@alfalab/core-components-input": "^12.0.2",
40
- "@alfalab/core-components-icon-button": "^6.2.2",
38
+ "@alfalab/core-components-calendar": "^7.0.4",
39
+ "@alfalab/core-components-input": "^12.1.0",
40
+ "@alfalab/core-components-icon-button": "^6.2.3",
41
41
  "@alfalab/core-components-popover": "^6.1.0",
42
42
  "@alfalab/hooks": "^1.13.0",
43
43
  "@alfalab/icons-glyph": "^2.108.0",
@@ -315,7 +315,7 @@ export const DateTimeInput = React.forwardRef<HTMLInputElement, DateTimeInputPro
315
315
  const handleInputKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {
316
316
  const isCopy = (event.metaKey || event.ctrlKey) && event.key === 'c';
317
317
 
318
- if (disableUserInput && !isCopy) {
318
+ if (disableUserInput && !isCopy && event.key !== 'Tab') {
319
319
  event.preventDefault();
320
320
  }
321
321
  };