@thx/controls 16.0.0-alpha.27 → 16.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/date/DatePicker/styles.css.js +7 -0
- package/dist/esm/date/DatePicker/styles.css.js.map +1 -0
- package/dist/esm/date/LocalDatePicker/LocalDatePicker.js +12 -60
- package/dist/esm/date/LocalDatePicker/LocalDatePicker.js.map +1 -1
- package/dist/esm/date/LocalDatePicker/MaskedDateInput.js +6 -35
- package/dist/esm/date/LocalDatePicker/MaskedDateInput.js.map +1 -1
- package/dist/esm/date/LocalMonthSelect/LocalMonthSelect.js +6 -32
- package/dist/esm/date/LocalMonthSelect/LocalMonthSelect.js.map +1 -1
- package/dist/esm/date/LocalTimePicker/LocalTimePicker.js +12 -57
- package/dist/esm/date/LocalTimePicker/LocalTimePicker.js.map +1 -1
- package/dist/esm/date/LocalTimePicker/MaskedTimeInput.js +7 -33
- package/dist/esm/date/LocalTimePicker/MaskedTimeInput.js.map +1 -1
- package/dist/esm/date/MonthDayPicker/MonthDayPicker.js +12 -57
- package/dist/esm/date/MonthDayPicker/MonthDayPicker.js.map +1 -1
- package/dist/esm/date/MonthYearPicker/MonthYearPicker.js +14 -61
- package/dist/esm/date/MonthYearPicker/MonthYearPicker.js.map +1 -1
- package/dist/esm/date/YearSelect/YearSelect.js +6 -32
- package/dist/esm/date/YearSelect/YearSelect.js.map +1 -1
- package/dist/esm/external/style-inject/dist/style-inject.es.js +29 -0
- package/dist/esm/external/style-inject/dist/style-inject.es.js.map +1 -0
- package/dist/esm/form/TForm/TForm.js +4 -4
- package/dist/esm/form/TForm/TForm.js.map +1 -1
- package/dist/esm/form/TForm/useTForm.js +5 -35
- package/dist/esm/form/TForm/useTForm.js.map +1 -1
- package/dist/esm/index.js +5 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/inputs/CreditCardInput/CreditCardInput.js +3 -2
- package/dist/esm/inputs/CreditCardInput/CreditCardInput.js.map +1 -1
- package/dist/esm/inputs/CreditCardInput/CreditCardNumberInput.js +5 -35
- package/dist/esm/inputs/CreditCardInput/CreditCardNumberInput.js.map +1 -1
- package/dist/esm/inputs/CreditCardInput/styles.css.js +7 -0
- package/dist/esm/inputs/CreditCardInput/styles.css.js.map +1 -0
- package/dist/esm/inputs/MaskedInput/MaskedInput.js +5 -30
- package/dist/esm/inputs/MaskedInput/MaskedInput.js.map +1 -1
- package/dist/esm/inputs/MaskedInput/useMaskedInput.js +13 -32
- package/dist/esm/inputs/MaskedInput/useMaskedInput.js.map +1 -1
- package/dist/esm/inputs/PhoneInput/PhoneInput.js +6 -34
- package/dist/esm/inputs/PhoneInput/PhoneInput.js.map +1 -1
- package/dist/esm/inputs/RadioGroup/RadioGroup.js +6 -32
- package/dist/esm/inputs/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/esm/inputs/Scriptel/Scriptel.js +1 -1
- package/dist/esm/inputs/Scriptel/Scriptel.js.map +1 -1
- package/dist/esm/inputs/Scriptel/ScriptelContext.js.map +1 -1
- package/dist/esm/inputs/Scriptel/scriptel/enums.js.map +1 -1
- package/dist/esm/inputs/Scriptel/scriptel/index.js.map +1 -1
- package/dist/esm/inputs/Scriptel/withScriptel.js +6 -17
- package/dist/esm/inputs/Scriptel/withScriptel.js.map +1 -1
- package/dist/esm/inputs/ScriptelInput/ScriptelInput.js +7 -10
- package/dist/esm/inputs/ScriptelInput/ScriptelInput.js.map +1 -1
- package/dist/esm/inputs/SinInput/SinInput.js +5 -35
- package/dist/esm/inputs/SinInput/SinInput.js.map +1 -1
- package/dist/esm/inputs/TableInput/DropdownCell.js +5 -34
- package/dist/esm/inputs/TableInput/DropdownCell.js.map +1 -1
- package/dist/esm/inputs/TableInput/HoverCell.js +4 -17
- package/dist/esm/inputs/TableInput/HoverCell.js.map +1 -1
- package/dist/esm/inputs/TableInput/MoneyCell.js +2 -1
- package/dist/esm/inputs/TableInput/MoneyCell.js.map +1 -1
- package/dist/esm/inputs/TableInput/MoneyEditCell.js +3 -3
- package/dist/esm/inputs/TableInput/MoneyEditCell.js.map +1 -1
- package/dist/esm/inputs/TableInput/MoneySumFooter.js +1 -0
- package/dist/esm/inputs/TableInput/MoneySumFooter.js.map +1 -1
- package/dist/esm/inputs/TableInput/StringEditCell.js +5 -24
- package/dist/esm/inputs/TableInput/StringEditCell.js.map +1 -1
- package/dist/esm/inputs/TableInput/TableInput.js +24 -27
- package/dist/esm/inputs/TableInput/TableInput.js.map +1 -1
- package/dist/esm/inputs/TableInput/addRowOnTab.js.map +1 -1
- package/dist/esm/money/MoneyCurrencyInput/MoneyCurrencyInput.js +7 -37
- package/dist/esm/money/MoneyCurrencyInput/MoneyCurrencyInput.js.map +1 -1
- package/dist/esm/money/MoneyInput/MoneyInput.js +5 -31
- package/dist/esm/money/MoneyInput/MoneyInput.js.map +1 -1
- package/dist/esm/money/useMoneyInput.js +7 -10
- package/dist/esm/money/useMoneyInput.js.map +1 -1
- package/dist/esm/step/FormStep.js +1 -1
- package/dist/esm/step/FormStep.js.map +1 -1
- package/dist/esm/step/Step.js +1 -0
- package/dist/esm/step/Step.js.map +1 -1
- package/dist/esm/step/StepProvider.js +17 -37
- package/dist/esm/step/StepProvider.js.map +1 -1
- package/dist/esm/step/stepContext.js.map +1 -1
- package/dist/esm/step/useStep.js.map +1 -1
- package/dist/stats.html +2689 -0
- package/dist/stats.txt +94 -0
- package/dist/types/date/LocalDatePicker/LocalDatePicker.d.ts +1 -0
- package/dist/types/inputs/MaskedInput/useMaskedInput.d.ts +1 -1
- package/package.json +12 -20
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import styleInject from './../../external/style-inject/dist/style-inject.es.js';
|
|
2
|
+
|
|
3
|
+
var css_248z = ".rw-datetimepicker > input {\n\tborder: none !important;\n}\n\n.rw-datetimepicker .rw-calendar-grid.rw-nav-view .rw-btn {\n\tpadding: 0 !important;\n}\n\n.dateTimePickerAutoWidth {\n\twidth: auto;\n\tdisplay: inline-flex;\n}\n\n.dateTimePickerAutoWidth > input {\n\twidth: auto;\n}\n\n.react-datepicker-wrapper {\n\twidth: 100%;\n\tdisplay: inline !important;\n}\n\n.react-datepicker__input-container {\n\tdisplay: inline !important;\n}\n\n.react-datepicker-popper {\n\tz-index: 5 !important;\n}\n";
|
|
4
|
+
styleInject(css_248z);
|
|
5
|
+
|
|
6
|
+
export { css_248z as default };
|
|
7
|
+
//# sourceMappingURL=styles.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,wBAAwB,uDAAyD;AACjF;AACA;AACA;AACA;AACA;"}
|
|
@@ -1,42 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { toDate, toLocalDate } from '@thx/date';
|
|
2
3
|
import debug from 'debug';
|
|
3
4
|
import DatePicker from 'react-datepicker';
|
|
5
|
+
import '../DatePicker/styles.css.js';
|
|
4
6
|
import { MaskedDateInput } from './MaskedDateInput.js';
|
|
5
7
|
|
|
6
|
-
var __defProp = Object.defineProperty;
|
|
7
|
-
var __defProps = Object.defineProperties;
|
|
8
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
9
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
10
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
-
var __spreadValues = (a, b) => {
|
|
14
|
-
for (var prop in b || (b = {}))
|
|
15
|
-
if (__hasOwnProp.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
if (__getOwnPropSymbols)
|
|
18
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
-
if (__propIsEnum.call(b, prop))
|
|
20
|
-
__defNormalProp(a, prop, b[prop]);
|
|
21
|
-
}
|
|
22
|
-
return a;
|
|
23
|
-
};
|
|
24
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
|
-
var __objRest = (source, exclude) => {
|
|
26
|
-
var target = {};
|
|
27
|
-
for (var prop in source)
|
|
28
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
-
target[prop] = source[prop];
|
|
30
|
-
if (source != null && __getOwnPropSymbols)
|
|
31
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
-
target[prop] = source[prop];
|
|
34
|
-
}
|
|
35
|
-
return target;
|
|
36
|
-
};
|
|
37
8
|
debug("thx.controls.date.LocalDatePicker");
|
|
38
9
|
function LocalDatePicker(props) {
|
|
39
|
-
const
|
|
10
|
+
const {
|
|
40
11
|
minDate,
|
|
41
12
|
maxDate,
|
|
42
13
|
value,
|
|
@@ -57,30 +28,9 @@ function LocalDatePicker(props) {
|
|
|
57
28
|
loading,
|
|
58
29
|
size,
|
|
59
30
|
tabIndex,
|
|
60
|
-
transparent
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"maxDate",
|
|
64
|
-
"value",
|
|
65
|
-
"onChange",
|
|
66
|
-
"onBlur",
|
|
67
|
-
"as",
|
|
68
|
-
"action",
|
|
69
|
-
"actionPosition",
|
|
70
|
-
"className",
|
|
71
|
-
"error",
|
|
72
|
-
"fluid",
|
|
73
|
-
"focus",
|
|
74
|
-
"icon",
|
|
75
|
-
"iconPosition",
|
|
76
|
-
"inverted",
|
|
77
|
-
"label",
|
|
78
|
-
"labelPosition",
|
|
79
|
-
"loading",
|
|
80
|
-
"size",
|
|
81
|
-
"tabIndex",
|
|
82
|
-
"transparent"
|
|
83
|
-
]);
|
|
31
|
+
transparent,
|
|
32
|
+
...rest
|
|
33
|
+
} = props;
|
|
84
34
|
const selected = value ? toDate(value) : null;
|
|
85
35
|
const inputProps = {
|
|
86
36
|
as,
|
|
@@ -100,19 +50,21 @@ function LocalDatePicker(props) {
|
|
|
100
50
|
tabIndex,
|
|
101
51
|
transparent
|
|
102
52
|
};
|
|
103
|
-
return /* @__PURE__ */ React.createElement(DatePicker,
|
|
53
|
+
return /* @__PURE__ */ React.createElement(DatePicker, {
|
|
54
|
+
...rest,
|
|
104
55
|
selected,
|
|
105
56
|
onChange: (date) => {
|
|
106
57
|
if (onChange)
|
|
107
58
|
onChange(date ? toLocalDate(date) : null);
|
|
108
59
|
},
|
|
109
60
|
onBlur,
|
|
110
|
-
customInput: /* @__PURE__ */ React.createElement(MaskedDateInput,
|
|
61
|
+
customInput: /* @__PURE__ */ React.createElement(MaskedDateInput, {
|
|
62
|
+
...inputProps,
|
|
111
63
|
onBlur
|
|
112
|
-
})
|
|
64
|
+
}),
|
|
113
65
|
minDate: minDate ? toDate(minDate) : null,
|
|
114
66
|
maxDate: maxDate ? toDate(maxDate) : null
|
|
115
|
-
})
|
|
67
|
+
});
|
|
116
68
|
}
|
|
117
69
|
|
|
118
70
|
export { LocalDatePicker };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalDatePicker.js","sources":["../../../../src/date/LocalDatePicker/LocalDatePicker.tsx"],"sourcesContent":["import type {LocalDate} from '@js-joda/core';\nimport {toDate, toLocalDate} from '@thx/date';\nimport debug from 'debug';\nimport type {ReactDatePickerProps} from 'react-datepicker';\nimport type {InputProps} from 'semantic-ui-react';\nimport {DatePicker} from '../DatePicker/index';\nimport {MaskedDateInput} from './MaskedDateInput';\n\nconst d = debug('thx.controls.date.LocalDatePicker');\n\ninterface ILocalDatePicker {\n\tvalue?: LocalDate | number | null;\n\tonChange?: (value: LocalDate | null) => void;\n\tonChangeRaw?: () => void;\n\tminDate?: LocalDate;\n\tmaxDate?: LocalDate;\n}\n\ntype InputPropsOmitted = Omit<InputProps, 'onChange'>;\ntype ReactDatePickerPropsOmitted = Omit<Omit<ReactDatePickerProps, 'value'>, 'onChange' | 'minDate' | 'maxDate'>;\nexport type LocalDatePickerProps = ILocalDatePicker & InputPropsOmitted & ReactDatePickerPropsOmitted;\n\nexport function LocalDatePicker(props: LocalDatePickerProps): JSX.Element {\n\tconst {\n\t\tminDate,\n\t\tmaxDate,\n\t\tvalue,\n\t\tonChange,\n\t\tonBlur,\n\t\tas,\n\t\taction,\n\t\tactionPosition,\n\t\tclassName,\n\t\terror,\n\t\tfluid,\n\t\tfocus,\n\t\ticon,\n\t\ticonPosition,\n\t\tinverted,\n\t\tlabel,\n\t\tlabelPosition,\n\t\tloading,\n\t\tsize,\n\t\ttabIndex,\n\t\ttransparent,\n\t\t...rest\n\t} = props;\n\n\tconst selected = value ? toDate(value) : null;\n\n\tconst inputProps = {\n\t\tas,\n\t\taction,\n\t\tactionPosition,\n\t\tclassName,\n\t\terror,\n\t\tfluid,\n\t\tfocus,\n\t\ticon,\n\t\ticonPosition,\n\t\tinverted,\n\t\tlabel,\n\t\tlabelPosition,\n\t\tloading,\n\t\tsize,\n\t\ttabIndex,\n\t\ttransparent,\n\t};\n\n\treturn (\n\t\t<DatePicker\n\t\t\t{...rest}\n\t\t\tselected={selected}\n\t\t\tonChange={date => {\n\t\t\t\tif (onChange) onChange(date ? toLocalDate(date) : null);\n\t\t\t}}\n\t\t\tonBlur={onBlur}\n\t\t\tcustomInput={<MaskedDateInput {...inputProps} onBlur={onBlur} />}\n\t\t\tminDate={minDate ? toDate(minDate) : null}\n\t\t\tmaxDate={maxDate ? toDate(maxDate) : null}\n\t\t/>\n\t);\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LocalDatePicker.js","sources":["../../../../src/date/LocalDatePicker/LocalDatePicker.tsx"],"sourcesContent":["import type {LocalDate} from '@js-joda/core';\nimport {toDate, toLocalDate} from '@thx/date';\nimport debug from 'debug';\nimport type {ReactDatePickerProps} from 'react-datepicker';\nimport type {InputProps} from 'semantic-ui-react';\nimport {DatePicker} from '../DatePicker/index';\nimport '../DatePicker/styles.css';\nimport {MaskedDateInput} from './MaskedDateInput';\n\nconst d = debug('thx.controls.date.LocalDatePicker');\n\ninterface ILocalDatePicker {\n\tvalue?: LocalDate | number | null;\n\tonChange?: (value: LocalDate | null) => void;\n\tonChangeRaw?: () => void;\n\tminDate?: LocalDate;\n\tmaxDate?: LocalDate;\n}\n\ntype InputPropsOmitted = Omit<InputProps, 'onChange'>;\ntype ReactDatePickerPropsOmitted = Omit<Omit<ReactDatePickerProps, 'value'>, 'onChange' | 'minDate' | 'maxDate'>;\nexport type LocalDatePickerProps = ILocalDatePicker & InputPropsOmitted & ReactDatePickerPropsOmitted;\n\nexport function LocalDatePicker(props: LocalDatePickerProps): JSX.Element {\n\tconst {\n\t\tminDate,\n\t\tmaxDate,\n\t\tvalue,\n\t\tonChange,\n\t\tonBlur,\n\t\tas,\n\t\taction,\n\t\tactionPosition,\n\t\tclassName,\n\t\terror,\n\t\tfluid,\n\t\tfocus,\n\t\ticon,\n\t\ticonPosition,\n\t\tinverted,\n\t\tlabel,\n\t\tlabelPosition,\n\t\tloading,\n\t\tsize,\n\t\ttabIndex,\n\t\ttransparent,\n\t\t...rest\n\t} = props;\n\n\tconst selected = value ? toDate(value) : null;\n\n\tconst inputProps = {\n\t\tas,\n\t\taction,\n\t\tactionPosition,\n\t\tclassName,\n\t\terror,\n\t\tfluid,\n\t\tfocus,\n\t\ticon,\n\t\ticonPosition,\n\t\tinverted,\n\t\tlabel,\n\t\tlabelPosition,\n\t\tloading,\n\t\tsize,\n\t\ttabIndex,\n\t\ttransparent,\n\t};\n\n\treturn (\n\t\t<DatePicker\n\t\t\t{...rest}\n\t\t\tselected={selected}\n\t\t\tonChange={date => {\n\t\t\t\tif (onChange) onChange(date ? toLocalDate(date) : null);\n\t\t\t}}\n\t\t\tonBlur={onBlur}\n\t\t\tcustomInput={<MaskedDateInput {...inputProps} onBlur={onBlur} />}\n\t\t\tminDate={minDate ? toDate(minDate) : null}\n\t\t\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AAA;AAAA,IACA,6BAAc,KAAA,CAAA,aAAA,CAAA,eAAA,EAAA;AAAA,MAAoB,GAAA,UAAA;AAAA,MAAY,MAAA;AAAA,KAAgB,CAAA;AAAA,IAC9D,OAAS,EAAA,OAAA,GAAU,MAAO,CAAA,OAAO,CAAI,GAAA,IAAA;AAAA,IACrC,OAAS,EAAA,OAAA,GAAU,MAAO,CAAA,OAAO,CAAI,GAAA,IAAA;AAAA,GACtC,CAAA,CAAA;AAEF;;;;"}
|
|
@@ -1,49 +1,20 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
1
2
|
import debug from 'debug';
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
3
|
import { MaskedInput } from '../../inputs/MaskedInput/MaskedInput.js';
|
|
4
|
+
import '../../inputs/MaskedInput/useMaskedInput.js';
|
|
4
5
|
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __defProps = Object.defineProperties;
|
|
7
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
8
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
-
var __spreadValues = (a, b) => {
|
|
13
|
-
for (var prop in b || (b = {}))
|
|
14
|
-
if (__hasOwnProp.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
if (__getOwnPropSymbols)
|
|
17
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
-
if (__propIsEnum.call(b, prop))
|
|
19
|
-
__defNormalProp(a, prop, b[prop]);
|
|
20
|
-
}
|
|
21
|
-
return a;
|
|
22
|
-
};
|
|
23
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
-
var __objRest = (source, exclude) => {
|
|
25
|
-
var target = {};
|
|
26
|
-
for (var prop in source)
|
|
27
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
if (source != null && __getOwnPropSymbols)
|
|
30
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
31
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
32
|
-
target[prop] = source[prop];
|
|
33
|
-
}
|
|
34
|
-
return target;
|
|
35
|
-
};
|
|
36
6
|
debug("thx.controls.date.LocalDatePicker.MaskedDateInput");
|
|
37
7
|
function MaskedDateInputInner(props, ref) {
|
|
38
|
-
const
|
|
39
|
-
return /* @__PURE__ */ React.createElement(MaskedInput,
|
|
8
|
+
const { onChange, name, ...rest } = props;
|
|
9
|
+
return /* @__PURE__ */ React.createElement(MaskedInput, {
|
|
10
|
+
...rest,
|
|
40
11
|
name,
|
|
41
12
|
mask: { alias: "datetime", inputFormat: "mm/dd/yyyy" },
|
|
42
13
|
onChange: (value) => {
|
|
43
14
|
if (onChange)
|
|
44
15
|
onChange({ target: { value: value || "" } });
|
|
45
16
|
}
|
|
46
|
-
})
|
|
17
|
+
});
|
|
47
18
|
}
|
|
48
19
|
const MaskedDateInput = forwardRef(MaskedDateInputInner);
|
|
49
20
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MaskedDateInput.js","sources":["../../../../src/date/LocalDatePicker/MaskedDateInput.tsx"],"sourcesContent":["import debug from 'debug';\nimport {forwardRef} from 'react';\nimport {MaskedInput, MaskedInputProps} from '../../inputs/MaskedInput';\n\nconst d = debug('thx.controls.date.LocalDatePicker.MaskedDateInput');\n\nexport interface MaskedDateInputValue {\n\ttarget: {\n\t\tvalue: string;\n\t};\n}\n\nexport interface MaskedDateInputProps {\n\tname?: string;\n\tonChange?: (value: MaskedDateInputValue) => void;\n}\n\n// eslint-disable-next-line no-unused-vars,@typescript-eslint/no-unused-vars\nfunction MaskedDateInputInner(props: MaskedDateInputProps & Omit<MaskedInputProps, 'onChange'>, ref: any) {\n\tconst {onChange, name, ...rest} = props;\n\n\treturn (\n\t\t<MaskedInput\n\t\t\t{...rest}\n\t\t\tname={name}\n\t\t\tmask={{alias: 'datetime', inputFormat: 'mm/dd/yyyy'}}\n\t\t\tonChange={value => {\n\t\t\t\tif (onChange) onChange({target: {value: value || ''}});\n\t\t\t}}\n\t\t/>\n\t);\n}\n\nexport const MaskedDateInput = forwardRef(MaskedDateInputInner);\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MaskedDateInput.js","sources":["../../../../src/date/LocalDatePicker/MaskedDateInput.tsx"],"sourcesContent":["import debug from 'debug';\nimport {forwardRef} from 'react';\nimport {MaskedInput, MaskedInputProps} from '../../inputs/MaskedInput';\n\nconst d = debug('thx.controls.date.LocalDatePicker.MaskedDateInput');\n\nexport interface MaskedDateInputValue {\n\ttarget: {\n\t\tvalue: string;\n\t};\n}\n\nexport interface MaskedDateInputProps {\n\tname?: string;\n\tonChange?: (value: MaskedDateInputValue) => void;\n}\n\n// eslint-disable-next-line no-unused-vars,@typescript-eslint/no-unused-vars\nfunction MaskedDateInputInner(props: MaskedDateInputProps & Omit<MaskedInputProps, 'onChange'>, ref: any) {\n\tconst {onChange, name, ...rest} = props;\n\n\treturn (\n\t\t<MaskedInput\n\t\t\t{...rest}\n\t\t\tname={name}\n\t\t\tmask={{alias: 'datetime', inputFormat: 'mm/dd/yyyy'}}\n\t\t\tonChange={value => {\n\t\t\t\tif (onChange) onChange({target: {value: value || ''}});\n\t\t\t}}\n\t\t/>\n\t);\n}\n\nexport const MaskedDateInput = forwardRef(MaskedDateInputInner);\n"],"names":[],"mappings":";;;;;AAIU,MAAM,mDAAmD,EAAA;AAcnE,SAAA,oBAAA,CAA8B,OAAkE,GAAU,EAAA;AACzG,EAAM,MAAA,EAAC,QAAU,EAAA,IAAA,EAAA,GAAS,IAAQ,EAAA,GAAA,KAAA,CAAA;AAElC,EAAA,uBACE,KAAA,CAAA,aAAA,CAAA,WAAA,EAAA;AAAA,IACI,GAAA,IAAA;AAAA,IACJ,IAAA;AAAA,IACA,IAAM,EAAA,EAAC,KAAO,EAAA,UAAA,EAAY,aAAa,YAAY,EAAA;AAAA,IACnD,UAAU,CAAS,KAAA,KAAA;AAClB,MAAI,IAAA,QAAA;AAAU,QAAA,QAAA,CAAS,EAAC,MAAQ,EAAA,EAAC,OAAO,KAAS,IAAA,EAAA,IAAI,CAAA,CAAA;AAAA,KACtD;AAAA,GACD,CAAA,CAAA;AAEF,CAAA;AAEa,MAAA,eAAA,GAAkB,WAAW,oBAAoB;;;;"}
|
|
@@ -1,35 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { LocalDate } from '@js-joda/core';
|
|
2
3
|
import debug from 'debug';
|
|
3
4
|
import { Select } from 'semantic-ui-react';
|
|
4
5
|
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
-
var __spreadValues = (a, b) => {
|
|
11
|
-
for (var prop in b || (b = {}))
|
|
12
|
-
if (__hasOwnProp.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
if (__getOwnPropSymbols)
|
|
15
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
-
if (__propIsEnum.call(b, prop))
|
|
17
|
-
__defNormalProp(a, prop, b[prop]);
|
|
18
|
-
}
|
|
19
|
-
return a;
|
|
20
|
-
};
|
|
21
|
-
var __objRest = (source, exclude) => {
|
|
22
|
-
var target = {};
|
|
23
|
-
for (var prop in source)
|
|
24
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
25
|
-
target[prop] = source[prop];
|
|
26
|
-
if (source != null && __getOwnPropSymbols)
|
|
27
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
28
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
29
|
-
target[prop] = source[prop];
|
|
30
|
-
}
|
|
31
|
-
return target;
|
|
32
|
-
};
|
|
33
6
|
debug("thx.controls.date.LocalMonthSelect");
|
|
34
7
|
const monthOptions = [
|
|
35
8
|
{ text: "January", value: 1, key: 1 },
|
|
@@ -46,9 +19,9 @@ const monthOptions = [
|
|
|
46
19
|
{ text: "December", value: 12, key: 12 }
|
|
47
20
|
];
|
|
48
21
|
function LocalMonthSelect(props) {
|
|
49
|
-
const
|
|
22
|
+
const { value, onChange, year, handleBlur, ...rest } = props;
|
|
50
23
|
const theYear = year || LocalDate.now().year();
|
|
51
|
-
return /* @__PURE__ */ React.createElement(Select,
|
|
24
|
+
return /* @__PURE__ */ React.createElement(Select, {
|
|
52
25
|
placeholder: "Select Month",
|
|
53
26
|
options: monthOptions,
|
|
54
27
|
value: value ? value.monthValue() : "",
|
|
@@ -61,8 +34,9 @@ function LocalMonthSelect(props) {
|
|
|
61
34
|
}
|
|
62
35
|
}
|
|
63
36
|
},
|
|
64
|
-
onBlur: handleBlur
|
|
65
|
-
|
|
37
|
+
onBlur: handleBlur,
|
|
38
|
+
...rest
|
|
39
|
+
});
|
|
66
40
|
}
|
|
67
41
|
|
|
68
42
|
export { LocalMonthSelect };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalMonthSelect.js","sources":["../../../../src/date/LocalMonthSelect/LocalMonthSelect.tsx"],"sourcesContent":["import {LocalDate} from '@js-joda/core';\nimport debug from 'debug';\nimport {Select, SelectProps} from 'semantic-ui-react';\n\nconst d = debug('thx.controls.date.LocalMonthSelect');\n\nconst monthOptions = [\n\t{text: 'January', value: 1, key: 1},\n\t{text: 'February', value: 2, key: 2},\n\t{text: 'March', value: 3, key: 3},\n\t{text: 'April', value: 4, key: 4},\n\t{text: 'May', value: 5, key: 5},\n\t{text: 'June', value: 6, key: 6},\n\t{text: 'July', value: 7, key: 7},\n\t{text: 'August', value: 8, key: 8},\n\t{text: 'September', value: 9, key: 9},\n\t{text: 'October', value: 10, key: 10},\n\t{text: 'November', value: 11, key: 11},\n\t{text: 'December', value: 12, key: 12},\n];\n\ninterface ILocalMonthSelectProps {\n\tonChange?: (value: LocalDate | null) => void;\n\tvalue?: LocalDate | null;\n\tyear?: number;\n\thandleBlur?: (event: any) => void;\n}\n\nexport type LocalMonthSelectProps = ILocalMonthSelectProps & Omit<SelectProps, 'options'>;\n\nexport function LocalMonthSelect(props: LocalMonthSelectProps): JSX.Element {\n\tconst {value, onChange, year, handleBlur, ...rest} = props;\n\n\tconst theYear = year || LocalDate.now().year();\n\n\treturn (\n\t\t<Select\n\t\t\tplaceholder=\"Select Month\"\n\t\t\toptions={monthOptions}\n\t\t\tvalue={value ? value.monthValue() : ''}\n\t\t\tonChange={(ev, v) => {\n\t\t\t\tif (onChange) {\n\t\t\t\t\tif (typeof v.value === 'number') {\n\t\t\t\t\t\tonChange(v ? LocalDate.of(theYear, v.value, 1) : null);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tonChange(null);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}}\n\t\t\tonBlur={handleBlur}\n\t\t\t{...rest}\n\t\t/>\n\t);\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LocalMonthSelect.js","sources":["../../../../src/date/LocalMonthSelect/LocalMonthSelect.tsx"],"sourcesContent":["import {LocalDate} from '@js-joda/core';\nimport debug from 'debug';\nimport {Select, SelectProps} from 'semantic-ui-react';\n\nconst d = debug('thx.controls.date.LocalMonthSelect');\n\nconst monthOptions = [\n\t{text: 'January', value: 1, key: 1},\n\t{text: 'February', value: 2, key: 2},\n\t{text: 'March', value: 3, key: 3},\n\t{text: 'April', value: 4, key: 4},\n\t{text: 'May', value: 5, key: 5},\n\t{text: 'June', value: 6, key: 6},\n\t{text: 'July', value: 7, key: 7},\n\t{text: 'August', value: 8, key: 8},\n\t{text: 'September', value: 9, key: 9},\n\t{text: 'October', value: 10, key: 10},\n\t{text: 'November', value: 11, key: 11},\n\t{text: 'December', value: 12, key: 12},\n];\n\ninterface ILocalMonthSelectProps {\n\tonChange?: (value: LocalDate | null) => void;\n\tvalue?: LocalDate | null;\n\tyear?: number;\n\thandleBlur?: (event: any) => void;\n}\n\nexport type LocalMonthSelectProps = ILocalMonthSelectProps & Omit<SelectProps, 'options'>;\n\nexport function LocalMonthSelect(props: LocalMonthSelectProps): JSX.Element {\n\tconst {value, onChange, year, handleBlur, ...rest} = props;\n\n\tconst theYear = year || LocalDate.now().year();\n\n\treturn (\n\t\t<Select\n\t\t\tplaceholder=\"Select Month\"\n\t\t\toptions={monthOptions}\n\t\t\tvalue={value ? value.monthValue() : ''}\n\t\t\tonChange={(ev, v) => {\n\t\t\t\tif (onChange) {\n\t\t\t\t\tif (typeof v.value === 'number') {\n\t\t\t\t\t\tonChange(v ? LocalDate.of(theYear, v.value, 1) : null);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tonChange(null);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}}\n\t\t\tonBlur={handleBlur}\n\t\t\t{...rest}\n\t\t/>\n\t);\n}\n"],"names":[],"mappings":";;;;;AAIU,MAAM,oCAAoC,EAAA;AAEpD,MAAM,YAAe,GAAA;AAAA,EACpB,EAAC,IAAM,EAAA,SAAA,EAAW,KAAO,EAAA,CAAA,EAAG,KAAK,CAAC,EAAA;AAAA,EAClC,EAAC,IAAM,EAAA,UAAA,EAAY,KAAO,EAAA,CAAA,EAAG,KAAK,CAAC,EAAA;AAAA,EACnC,EAAC,IAAM,EAAA,OAAA,EAAS,KAAO,EAAA,CAAA,EAAG,KAAK,CAAC,EAAA;AAAA,E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,KAAA;AACpB,MAAA,IAAI,QAAU,EAAA;AACb,QAAI,IAAA,OAAO,CAAE,CAAA,KAAA,KAAU,QAAU,EAAA;AAChC,UAAS,QAAA,CAAA,CAAA,GAAI,UAAU,EAAG,CAAA,OAAA,EAAS,EAAE,KAAO,EAAA,CAAC,IAAI,IAAI,CAAA,CAAA;AAAA,SAC/C,MAAA;AACN,UAAA,QAAA,CAAS,IAAI,CAAA,CAAA;AAAA,SACd;AAAA,OACD;AAAA,KACD;AAAA,IACA,MAAQ,EAAA,UAAA;AAAA,IACJ,GAAA,IAAA;AAAA,GACL,CAAA,CAAA;AAEF;;;;"}
|
|
@@ -1,43 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { LocalTime } from '@js-joda/core';
|
|
2
3
|
import { toDate, toLocalTime } from '@thx/date';
|
|
3
4
|
import debug from 'debug';
|
|
4
5
|
import DatePicker from 'react-datepicker';
|
|
6
|
+
import '../DatePicker/styles.css.js';
|
|
5
7
|
import { MaskedTimeInput } from './MaskedTimeInput.js';
|
|
6
8
|
|
|
7
|
-
var __defProp = Object.defineProperty;
|
|
8
|
-
var __defProps = Object.defineProperties;
|
|
9
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
10
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
11
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
13
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
14
|
-
var __spreadValues = (a, b) => {
|
|
15
|
-
for (var prop in b || (b = {}))
|
|
16
|
-
if (__hasOwnProp.call(b, prop))
|
|
17
|
-
__defNormalProp(a, prop, b[prop]);
|
|
18
|
-
if (__getOwnPropSymbols)
|
|
19
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
20
|
-
if (__propIsEnum.call(b, prop))
|
|
21
|
-
__defNormalProp(a, prop, b[prop]);
|
|
22
|
-
}
|
|
23
|
-
return a;
|
|
24
|
-
};
|
|
25
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
26
|
-
var __objRest = (source, exclude) => {
|
|
27
|
-
var target = {};
|
|
28
|
-
for (var prop in source)
|
|
29
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
30
|
-
target[prop] = source[prop];
|
|
31
|
-
if (source != null && __getOwnPropSymbols)
|
|
32
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
33
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
34
|
-
target[prop] = source[prop];
|
|
35
|
-
}
|
|
36
|
-
return target;
|
|
37
|
-
};
|
|
38
9
|
debug("thx.controls.date.LocalTimePicker");
|
|
39
10
|
function LocalTimePicker(props) {
|
|
40
|
-
const
|
|
11
|
+
const {
|
|
41
12
|
value,
|
|
42
13
|
onChange,
|
|
43
14
|
as,
|
|
@@ -56,28 +27,9 @@ function LocalTimePicker(props) {
|
|
|
56
27
|
loading,
|
|
57
28
|
size,
|
|
58
29
|
tabIndex,
|
|
59
|
-
transparent
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
"onChange",
|
|
63
|
-
"as",
|
|
64
|
-
"action",
|
|
65
|
-
"actionPosition",
|
|
66
|
-
"className",
|
|
67
|
-
"disabled",
|
|
68
|
-
"error",
|
|
69
|
-
"fluid",
|
|
70
|
-
"focus",
|
|
71
|
-
"icon",
|
|
72
|
-
"iconPosition",
|
|
73
|
-
"inverted",
|
|
74
|
-
"label",
|
|
75
|
-
"labelPosition",
|
|
76
|
-
"loading",
|
|
77
|
-
"size",
|
|
78
|
-
"tabIndex",
|
|
79
|
-
"transparent"
|
|
80
|
-
]);
|
|
30
|
+
transparent,
|
|
31
|
+
...rest
|
|
32
|
+
} = props;
|
|
81
33
|
let selected;
|
|
82
34
|
if (typeof value === "number")
|
|
83
35
|
selected = toDate(LocalTime.ofSecondOfDay(value));
|
|
@@ -102,7 +54,8 @@ function LocalTimePicker(props) {
|
|
|
102
54
|
tabIndex,
|
|
103
55
|
transparent
|
|
104
56
|
};
|
|
105
|
-
return /* @__PURE__ */ React.createElement(DatePicker,
|
|
57
|
+
return /* @__PURE__ */ React.createElement(DatePicker, {
|
|
58
|
+
...rest,
|
|
106
59
|
selected,
|
|
107
60
|
onChange: (date) => {
|
|
108
61
|
if (onChange)
|
|
@@ -113,8 +66,10 @@ function LocalTimePicker(props) {
|
|
|
113
66
|
timeIntervals: 15,
|
|
114
67
|
timeCaption: "Time",
|
|
115
68
|
dateFormat: "hh:mm aa",
|
|
116
|
-
customInput: /* @__PURE__ */ React.createElement(MaskedTimeInput,
|
|
117
|
-
|
|
69
|
+
customInput: /* @__PURE__ */ React.createElement(MaskedTimeInput, {
|
|
70
|
+
...inputProps
|
|
71
|
+
})
|
|
72
|
+
});
|
|
118
73
|
}
|
|
119
74
|
|
|
120
75
|
export { LocalTimePicker };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalTimePicker.js","sources":["../../../../src/date/LocalTimePicker/LocalTimePicker.tsx"],"sourcesContent":["import {LocalTime} from '@js-joda/core';\nimport {toDate, toLocalTime} from '@thx/date';\nimport debug from 'debug';\nimport type {ReactDatePickerProps} from 'react-datepicker';\nimport type {InputProps} from 'semantic-ui-react';\nimport {DatePicker} from '../DatePicker/index';\nimport {MaskedTimeInput} from './MaskedTimeInput';\n\nconst d = debug('thx.controls.date.LocalTimePicker');\n\ninterface ILocalTimePicker {\n\tvalue?: LocalTime | number | null;\n\tonChange?: (value: LocalTime | null) => void;\n\tonChangeRaw?: () => void;\n}\n\ntype InputPropsOmitted = Omit<InputProps, 'onChange'>;\ntype ReactDatePickerPropsOmitted = Omit<Omit<ReactDatePickerProps, 'value'>, 'onChange'>;\nexport type LocalTimePickerProps = ILocalTimePicker & InputPropsOmitted & ReactDatePickerPropsOmitted;\n\nexport function LocalTimePicker(props: LocalTimePickerProps): JSX.Element {\n\tconst {\n\t\tvalue,\n\t\tonChange,\n\t\tas,\n\t\taction,\n\t\tactionPosition,\n\t\tclassName,\n\t\tdisabled,\n\t\terror,\n\t\tfluid,\n\t\tfocus,\n\t\ticon,\n\t\ticonPosition,\n\t\tinverted,\n\t\tlabel,\n\t\tlabelPosition,\n\t\tloading,\n\t\tsize,\n\t\ttabIndex,\n\t\ttransparent,\n\t\t...rest\n\t} = props;\n\n\tlet selected;\n\tif (typeof value === 'number') selected = toDate(LocalTime.ofSecondOfDay(value));\n\telse selected = value ? toDate(value) : null;\n\n\tconst inputProps = {\n\t\tas,\n\t\taction,\n\t\tactionPosition,\n\t\tclassName,\n\t\tdisabled,\n\t\terror,\n\t\tfluid,\n\t\tfocus,\n\t\ticon,\n\t\ticonPosition,\n\t\tinverted,\n\t\tlabel,\n\t\tlabelPosition,\n\t\tloading,\n\t\tsize,\n\t\ttabIndex,\n\t\ttransparent,\n\t};\n\n\treturn (\n\t\t<DatePicker\n\t\t\t{...rest}\n\t\t\tselected={selected}\n\t\t\tonChange={date => {\n\t\t\t\tif (onChange) onChange(date ? toLocalTime(date) : null);\n\t\t\t}}\n\t\t\tshowTimeSelect\n\t\t\tshowTimeSelectOnly\n\t\t\ttimeIntervals={15}\n\t\t\ttimeCaption=\"Time\"\n\t\t\tdateFormat=\"hh:mm aa\"\n\t\t\tcustomInput={<MaskedTimeInput {...inputProps} />}\n\t\t/>\n\t);\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LocalTimePicker.js","sources":["../../../../src/date/LocalTimePicker/LocalTimePicker.tsx"],"sourcesContent":["import {LocalTime} from '@js-joda/core';\nimport {toDate, toLocalTime} from '@thx/date';\nimport debug from 'debug';\nimport type {ReactDatePickerProps} from 'react-datepicker';\nimport type {InputProps} from 'semantic-ui-react';\nimport {DatePicker} from '../DatePicker/index';\nimport {MaskedTimeInput} from './MaskedTimeInput';\n\nconst d = debug('thx.controls.date.LocalTimePicker');\n\ninterface ILocalTimePicker {\n\tvalue?: LocalTime | number | null;\n\tonChange?: (value: LocalTime | null) => void;\n\tonChangeRaw?: () => void;\n}\n\ntype InputPropsOmitted = Omit<InputProps, 'onChange'>;\ntype ReactDatePickerPropsOmitted = Omit<Omit<ReactDatePickerProps, 'value'>, 'onChange'>;\nexport type LocalTimePickerProps = ILocalTimePicker & InputPropsOmitted & ReactDatePickerPropsOmitted;\n\nexport function LocalTimePicker(props: LocalTimePickerProps): JSX.Element {\n\tconst {\n\t\tvalue,\n\t\tonChange,\n\t\tas,\n\t\taction,\n\t\tactionPosition,\n\t\tclassName,\n\t\tdisabled,\n\t\terror,\n\t\tfluid,\n\t\tfocus,\n\t\ticon,\n\t\ticonPosition,\n\t\tinverted,\n\t\tlabel,\n\t\tlabelPosition,\n\t\tloading,\n\t\tsize,\n\t\ttabIndex,\n\t\ttransparent,\n\t\t...rest\n\t} = props;\n\n\tlet selected;\n\tif (typeof value === 'number') selected = toDate(LocalTime.ofSecondOfDay(value));\n\telse selected = value ? toDate(value) : null;\n\n\tconst inputProps = {\n\t\tas,\n\t\taction,\n\t\tactionPosition,\n\t\tclassName,\n\t\tdisabled,\n\t\terror,\n\t\tfluid,\n\t\tfocus,\n\t\ticon,\n\t\ticonPosition,\n\t\tinverted,\n\t\tlabel,\n\t\tlabelPosition,\n\t\tloading,\n\t\tsize,\n\t\ttabIndex,\n\t\ttransparent,\n\t};\n\n\treturn (\n\t\t<DatePicker\n\t\t\t{...rest}\n\t\t\tselected={selected}\n\t\t\tonChange={date => {\n\t\t\t\tif (onChange) onChange(date ? toLocalTime(date) : null);\n\t\t\t}}\n\t\t\tshowTimeSelect\n\t\t\tshowTimeSelectOnly\n\t\t\ttimeIntervals={15}\n\t\t\ttimeCaption=\"Time\"\n\t\t\tdateFormat=\"hh:mm aa\"\n\t\t\tcustomInput={<MaskedTimeInput {...inputProps} />}\n\t\t/>\n\t);\n}\n"],"names":[],"mappings":";;;;;;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A,CAAY,IAAI,CAAA,GAAI,IAAI,CAAA,CAAA;AAAA,KACvD;AAAA,IACA,cAAc,EAAA,IAAA;AAAA,IACd,kBAAkB,EAAA,IAAA;AAAA,IAClB,aAAe,EAAA,EAAA;AAAA,IACf,WAAY,EAAA,MAAA;AAAA,IACZ,UAAW,EAAA,UAAA;AAAA,IACX,6BAAc,KAAA,CAAA,aAAA,CAAA,eAAA,EAAA;AAAA,MAAoB,GAAA,UAAA;AAAA,KAAY,CAAA;AAAA,GAC/C,CAAA,CAAA;AAEF;;;;"}
|
|
@@ -1,45 +1,19 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
1
2
|
import debug from 'debug';
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
3
|
import { MaskedInput } from '../../inputs/MaskedInput/MaskedInput.js';
|
|
4
|
+
import '../../inputs/MaskedInput/useMaskedInput.js';
|
|
4
5
|
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
-
var __spreadValues = (a, b) => {
|
|
11
|
-
for (var prop in b || (b = {}))
|
|
12
|
-
if (__hasOwnProp.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
if (__getOwnPropSymbols)
|
|
15
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
-
if (__propIsEnum.call(b, prop))
|
|
17
|
-
__defNormalProp(a, prop, b[prop]);
|
|
18
|
-
}
|
|
19
|
-
return a;
|
|
20
|
-
};
|
|
21
|
-
var __objRest = (source, exclude) => {
|
|
22
|
-
var target = {};
|
|
23
|
-
for (var prop in source)
|
|
24
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
25
|
-
target[prop] = source[prop];
|
|
26
|
-
if (source != null && __getOwnPropSymbols)
|
|
27
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
28
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
29
|
-
target[prop] = source[prop];
|
|
30
|
-
}
|
|
31
|
-
return target;
|
|
32
|
-
};
|
|
33
6
|
debug("thx.controls.date.LocalTimePicker.MaskedTimeInput");
|
|
34
7
|
function MaskedTimeInputInner(props, ref) {
|
|
35
|
-
const
|
|
36
|
-
return /* @__PURE__ */ React.createElement(MaskedInput,
|
|
8
|
+
const { onChange, ...rest } = props;
|
|
9
|
+
return /* @__PURE__ */ React.createElement(MaskedInput, {
|
|
37
10
|
mask: { alias: "datetime", inputFormat: "hh:MM TT" },
|
|
38
11
|
onChange: (value) => {
|
|
39
12
|
if (onChange)
|
|
40
13
|
onChange({ target: { value: value || "" } });
|
|
41
|
-
}
|
|
42
|
-
|
|
14
|
+
},
|
|
15
|
+
...rest
|
|
16
|
+
});
|
|
43
17
|
}
|
|
44
18
|
const MaskedTimeInput = forwardRef(MaskedTimeInputInner);
|
|
45
19
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MaskedTimeInput.js","sources":["../../../../src/date/LocalTimePicker/MaskedTimeInput.tsx"],"sourcesContent":["import debug from 'debug';\nimport {forwardRef} from 'react';\nimport {MaskedInput, MaskedInputProps} from '../../inputs/MaskedInput';\n\nconst d = debug('thx.controls.date.LocalTimePicker.MaskedTimeInput');\n\nexport interface MaskedTimeInputValue {\n\ttarget: {\n\t\tvalue: string;\n\t};\n}\n\nexport interface MaskedTimeInputProps {\n\tonChange?: (value: MaskedTimeInputValue) => void;\n}\n\n// eslint-disable-next-line no-unused-vars,@typescript-eslint/no-unused-vars\nfunction MaskedTimeInputInner(props: MaskedTimeInputProps & Omit<MaskedInputProps, 'onChange'>, ref: any) {\n\tconst {onChange, ...rest} = props;\n\n\treturn (\n\t\t<MaskedInput\n\t\t\tmask={{alias: 'datetime', inputFormat: 'hh:MM TT'}}\n\t\t\tonChange={value => {\n\t\t\t\tif (onChange) onChange({target: {value: value || ''}});\n\t\t\t}}\n\t\t\t{...rest}\n\t\t/>\n\t);\n}\n\nexport const MaskedTimeInput = forwardRef(MaskedTimeInputInner);\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MaskedTimeInput.js","sources":["../../../../src/date/LocalTimePicker/MaskedTimeInput.tsx"],"sourcesContent":["import debug from 'debug';\nimport {forwardRef} from 'react';\nimport {MaskedInput, MaskedInputProps} from '../../inputs/MaskedInput';\n\nconst d = debug('thx.controls.date.LocalTimePicker.MaskedTimeInput');\n\nexport interface MaskedTimeInputValue {\n\ttarget: {\n\t\tvalue: string;\n\t};\n}\n\nexport interface MaskedTimeInputProps {\n\tonChange?: (value: MaskedTimeInputValue) => void;\n}\n\n// eslint-disable-next-line no-unused-vars,@typescript-eslint/no-unused-vars\nfunction MaskedTimeInputInner(props: MaskedTimeInputProps & Omit<MaskedInputProps, 'onChange'>, ref: any) {\n\tconst {onChange, ...rest} = props;\n\n\treturn (\n\t\t<MaskedInput\n\t\t\tmask={{alias: 'datetime', inputFormat: 'hh:MM TT'}}\n\t\t\tonChange={value => {\n\t\t\t\tif (onChange) onChange({target: {value: value || ''}});\n\t\t\t}}\n\t\t\t{...rest}\n\t\t/>\n\t);\n}\n\nexport const MaskedTimeInput = forwardRef(MaskedTimeInputInner);\n"],"names":[],"mappings":";;;;;AAIU,MAAM,mDAAmD,EAAA;AAanE,SAAA,oBAAA,CAA8B,OAAkE,GAAU,EAAA;AACzG,EAAM,MAAA,EAAC,aAAa,IAAQ,EAAA,GAAA,KAAA,CAAA;AAE5B,EAAA,uBACE,KAAA,CAAA,aAAA,CAAA,WAAA,EAAA;AAAA,IACA,IAAM,EAAA,EAAC,KAAO,EAAA,UAAA,EAAY,aAAa,UAAU,EAAA;AAAA,IACjD,UAAU,CAAS,KAAA,KAAA;AAClB,MAAI,IAAA,QAAA;AAAU,QAAA,QAAA,CAAS,EAAC,MAAQ,EAAA,EAAC,OAAO,KAAS,IAAA,EAAA,IAAI,CAAA,CAAA;AAAA,KACtD;AAAA,IACI,GAAA,IAAA;AAAA,GACL,CAAA,CAAA;AAEF,CAAA;AAEa,MAAA,eAAA,GAAkB,WAAW,oBAAoB;;;;"}
|
|
@@ -1,39 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { toDate, toLocalDate } from '@thx/date';
|
|
2
3
|
import debug from 'debug';
|
|
3
4
|
import { Input } from 'semantic-ui-react';
|
|
4
5
|
import DatePicker from 'react-datepicker';
|
|
6
|
+
import '../DatePicker/styles.css.js';
|
|
5
7
|
|
|
6
|
-
var __defProp = Object.defineProperty;
|
|
7
|
-
var __defProps = Object.defineProperties;
|
|
8
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
9
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
10
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
-
var __spreadValues = (a, b) => {
|
|
14
|
-
for (var prop in b || (b = {}))
|
|
15
|
-
if (__hasOwnProp.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
if (__getOwnPropSymbols)
|
|
18
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
-
if (__propIsEnum.call(b, prop))
|
|
20
|
-
__defNormalProp(a, prop, b[prop]);
|
|
21
|
-
}
|
|
22
|
-
return a;
|
|
23
|
-
};
|
|
24
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
|
-
var __objRest = (source, exclude) => {
|
|
26
|
-
var target = {};
|
|
27
|
-
for (var prop in source)
|
|
28
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
-
target[prop] = source[prop];
|
|
30
|
-
if (source != null && __getOwnPropSymbols)
|
|
31
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
-
target[prop] = source[prop];
|
|
34
|
-
}
|
|
35
|
-
return target;
|
|
36
|
-
};
|
|
37
8
|
debug("thx.controls.date.MonthDayPicker");
|
|
38
9
|
const months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
39
10
|
function MonthDayHeader(props) {
|
|
@@ -54,7 +25,7 @@ function MonthDayHeader(props) {
|
|
|
54
25
|
}, "Next Month"));
|
|
55
26
|
}
|
|
56
27
|
function MonthDayPicker(props) {
|
|
57
|
-
const
|
|
28
|
+
const {
|
|
58
29
|
value,
|
|
59
30
|
onChange,
|
|
60
31
|
as,
|
|
@@ -73,28 +44,9 @@ function MonthDayPicker(props) {
|
|
|
73
44
|
loading,
|
|
74
45
|
size,
|
|
75
46
|
tabIndex,
|
|
76
|
-
transparent
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
"onChange",
|
|
80
|
-
"as",
|
|
81
|
-
"action",
|
|
82
|
-
"actionPosition",
|
|
83
|
-
"className",
|
|
84
|
-
"disabled",
|
|
85
|
-
"error",
|
|
86
|
-
"fluid",
|
|
87
|
-
"focus",
|
|
88
|
-
"icon",
|
|
89
|
-
"iconPosition",
|
|
90
|
-
"inverted",
|
|
91
|
-
"label",
|
|
92
|
-
"labelPosition",
|
|
93
|
-
"loading",
|
|
94
|
-
"size",
|
|
95
|
-
"tabIndex",
|
|
96
|
-
"transparent"
|
|
97
|
-
]);
|
|
47
|
+
transparent,
|
|
48
|
+
...rest
|
|
49
|
+
} = props;
|
|
98
50
|
const selected = value ? toDate(value) : null;
|
|
99
51
|
const inputProps = {
|
|
100
52
|
as,
|
|
@@ -115,16 +67,19 @@ function MonthDayPicker(props) {
|
|
|
115
67
|
tabIndex,
|
|
116
68
|
transparent
|
|
117
69
|
};
|
|
118
|
-
return /* @__PURE__ */ React.createElement(DatePicker,
|
|
70
|
+
return /* @__PURE__ */ React.createElement(DatePicker, {
|
|
71
|
+
...rest,
|
|
119
72
|
selected,
|
|
120
73
|
onChange: (date) => {
|
|
121
74
|
if (onChange)
|
|
122
75
|
onChange(date ? toLocalDate(date) : null);
|
|
123
76
|
},
|
|
124
|
-
customInput: /* @__PURE__ */ React.createElement(Input,
|
|
77
|
+
customInput: /* @__PURE__ */ React.createElement(Input, {
|
|
78
|
+
...inputProps
|
|
79
|
+
}),
|
|
125
80
|
renderCustomHeader: MonthDayHeader,
|
|
126
81
|
dateFormat: "MMMM d"
|
|
127
|
-
})
|
|
82
|
+
});
|
|
128
83
|
}
|
|
129
84
|
|
|
130
85
|
export { MonthDayPicker };
|