@bsol-oss/react-datatable5 12.0.0-beta.66 → 12.0.0-beta.67
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/index.js +5 -2
- package/dist/index.mjs +5 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3718,6 +3718,7 @@ const validateData = (data, schema) => {
|
|
|
3718
3718
|
const validate = ajv.compile(schema);
|
|
3719
3719
|
const validationResult = validate(data);
|
|
3720
3720
|
const errors = validate.errors;
|
|
3721
|
+
console.log(errors, data);
|
|
3721
3722
|
return {
|
|
3722
3723
|
isValid: validationResult,
|
|
3723
3724
|
validate,
|
|
@@ -5141,9 +5142,11 @@ function TimePicker$1({ hour, setHour, minute, setMinute, meridiem, setMeridiem,
|
|
|
5141
5142
|
setInputValue(e.currentTarget.value);
|
|
5142
5143
|
}, onBlur: (e) => {
|
|
5143
5144
|
handleBlur(e.currentTarget.value);
|
|
5145
|
+
}, onFocus: (e) => {
|
|
5146
|
+
e.currentTarget.select();
|
|
5144
5147
|
}, value: inputValue, display: showInput ? undefined : "none", ref: inputRef }), jsxRuntime.jsxs(react.Button, { onClick: () => {
|
|
5145
5148
|
setShowInput(true);
|
|
5146
|
-
setInputValue(dayjs(`1970-01-01T${getTimeString(hour, minute, meridiem)}`, "hh:mmZ").format("
|
|
5149
|
+
setInputValue(dayjs(`1970-01-01T${getTimeString(hour, minute, meridiem)}`, "hh:mmZ").format("HH:mm"));
|
|
5147
5150
|
inputRef.current?.focus();
|
|
5148
5151
|
}, display: showInput ? "none" : "flex", alignItems: "center", justifyContent: "start", variant: "outline", gap: 2, children: [jsxRuntime.jsx(react.Icon, { size: "sm", children: jsxRuntime.jsx(bs.BsClock, {}) }), jsxRuntime.jsx(react.Text, { fontSize: "sm", children: stringTime
|
|
5149
5152
|
? dayjs(`1970-01-01T${stringTime}`, "hh:mmZ").format("hh:mm a")
|
|
@@ -5154,7 +5157,7 @@ dayjs.extend(timezone);
|
|
|
5154
5157
|
const TimePicker = ({ column, schema, prefix }) => {
|
|
5155
5158
|
const { watch, formState: { errors }, setValue, } = reactHookForm.useFormContext();
|
|
5156
5159
|
const { translate, timezone } = useSchemaContext();
|
|
5157
|
-
const { required, gridColumn = "span 4", gridRow = "span 1", timeFormat = "HH:
|
|
5160
|
+
const { required, gridColumn = "span 4", gridRow = "span 1", timeFormat = "HH:mm:ssZ", displayTimeFormat = "hh:mm A", } = schema;
|
|
5158
5161
|
const isRequired = required?.some((columnId) => columnId === column);
|
|
5159
5162
|
const colLabel = `${prefix}${column}`;
|
|
5160
5163
|
const [open, setOpen] = React.useState(false);
|
package/dist/index.mjs
CHANGED
|
@@ -3698,6 +3698,7 @@ const validateData = (data, schema) => {
|
|
|
3698
3698
|
const validate = ajv.compile(schema);
|
|
3699
3699
|
const validationResult = validate(data);
|
|
3700
3700
|
const errors = validate.errors;
|
|
3701
|
+
console.log(errors, data);
|
|
3701
3702
|
return {
|
|
3702
3703
|
isValid: validationResult,
|
|
3703
3704
|
validate,
|
|
@@ -5121,9 +5122,11 @@ function TimePicker$1({ hour, setHour, minute, setMinute, meridiem, setMeridiem,
|
|
|
5121
5122
|
setInputValue(e.currentTarget.value);
|
|
5122
5123
|
}, onBlur: (e) => {
|
|
5123
5124
|
handleBlur(e.currentTarget.value);
|
|
5125
|
+
}, onFocus: (e) => {
|
|
5126
|
+
e.currentTarget.select();
|
|
5124
5127
|
}, value: inputValue, display: showInput ? undefined : "none", ref: inputRef }), jsxs(Button$1, { onClick: () => {
|
|
5125
5128
|
setShowInput(true);
|
|
5126
|
-
setInputValue(dayjs(`1970-01-01T${getTimeString(hour, minute, meridiem)}`, "hh:mmZ").format("
|
|
5129
|
+
setInputValue(dayjs(`1970-01-01T${getTimeString(hour, minute, meridiem)}`, "hh:mmZ").format("HH:mm"));
|
|
5127
5130
|
inputRef.current?.focus();
|
|
5128
5131
|
}, display: showInput ? "none" : "flex", alignItems: "center", justifyContent: "start", variant: "outline", gap: 2, children: [jsx(Icon, { size: "sm", children: jsx(BsClock, {}) }), jsx(Text, { fontSize: "sm", children: stringTime
|
|
5129
5132
|
? dayjs(`1970-01-01T${stringTime}`, "hh:mmZ").format("hh:mm a")
|
|
@@ -5134,7 +5137,7 @@ dayjs.extend(timezone);
|
|
|
5134
5137
|
const TimePicker = ({ column, schema, prefix }) => {
|
|
5135
5138
|
const { watch, formState: { errors }, setValue, } = useFormContext();
|
|
5136
5139
|
const { translate, timezone } = useSchemaContext();
|
|
5137
|
-
const { required, gridColumn = "span 4", gridRow = "span 1", timeFormat = "HH:
|
|
5140
|
+
const { required, gridColumn = "span 4", gridRow = "span 1", timeFormat = "HH:mm:ssZ", displayTimeFormat = "hh:mm A", } = schema;
|
|
5138
5141
|
const isRequired = required?.some((columnId) => columnId === column);
|
|
5139
5142
|
const colLabel = `${prefix}${column}`;
|
|
5140
5143
|
const [open, setOpen] = useState(false);
|