@charlesgomes/leafcode-shared-lib-react 1.0.41 → 1.0.42

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.d.mts CHANGED
@@ -94,7 +94,7 @@ interface IItemProps {
94
94
  }
95
95
 
96
96
  declare const DateFilterTemplate: (options: any, mask?: (value: any) => string | number) => react_jsx_runtime.JSX.Element;
97
- declare const DateTimeFilterTemplate: (options: any) => react_jsx_runtime.JSX.Element;
97
+ declare const DateTimeFilterTemplate: (options: any, mask?: (date: Date) => string) => react_jsx_runtime.JSX.Element;
98
98
  declare const ValueFilterTemplate: (options: any, mask?: (value: any) => string | number) => react_jsx_runtime.JSX.Element;
99
99
  declare const SelectFilterTemplate: (options: any, isLanguagePtBr?: boolean, items?: IItemProps[]) => react_jsx_runtime.JSX.Element;
100
100
  declare const CustomFilterElement: (options: any, isLanguagePtBr?: boolean, items?: any[]) => react_jsx_runtime.JSX.Element;
package/dist/index.d.ts CHANGED
@@ -94,7 +94,7 @@ interface IItemProps {
94
94
  }
95
95
 
96
96
  declare const DateFilterTemplate: (options: any, mask?: (value: any) => string | number) => react_jsx_runtime.JSX.Element;
97
- declare const DateTimeFilterTemplate: (options: any) => react_jsx_runtime.JSX.Element;
97
+ declare const DateTimeFilterTemplate: (options: any, mask?: (date: Date) => string) => react_jsx_runtime.JSX.Element;
98
98
  declare const ValueFilterTemplate: (options: any, mask?: (value: any) => string | number) => react_jsx_runtime.JSX.Element;
99
99
  declare const SelectFilterTemplate: (options: any, isLanguagePtBr?: boolean, items?: IItemProps[]) => react_jsx_runtime.JSX.Element;
100
100
  declare const CustomFilterElement: (options: any, isLanguagePtBr?: boolean, items?: any[]) => react_jsx_runtime.JSX.Element;
package/dist/index.js CHANGED
@@ -1042,29 +1042,28 @@ var DateFilterTemplate = (options, mask) => {
1042
1042
  }
1043
1043
  );
1044
1044
  };
1045
- var DateTimeFilterTemplate = (options) => {
1046
- const value = typeof options.value === "string" ? (0, import_moment2.default)(options.value, "YYYY-MM-DDTHH:mm:ss.SSS").toDate() : options.value ?? null;
1045
+ var DateTimeFilterTemplate = (options, mask) => {
1046
+ const value = typeof options.value === "string" ? (0, import_moment2.default)(options.value).toDate() : options.value ?? null;
1047
1047
  return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1048
1048
  import_calendar.Calendar,
1049
1049
  {
1050
1050
  value,
1051
- onChange: (e) => {
1052
- if (!e.value) {
1053
- options.filterCallback(null, options.index);
1054
- return;
1055
- }
1056
- const formatted = (0, import_moment2.default)(e.value).format(
1057
- "YYYY-MM-DDTHH:mm:ss.SSS"
1058
- );
1059
- options.filterCallback(formatted, options.index);
1060
- },
1061
1051
  showTime: true,
1062
1052
  showSeconds: true,
1063
1053
  hourFormat: "24",
1064
- placeholder: "dd/mm/yyyy 00:00:00",
1065
1054
  dateFormat: "dd/mm/yy",
1055
+ placeholder: "dd/mm/yyyy 00:00:00",
1066
1056
  readOnlyInput: true,
1067
- inputClassName: "custom-input"
1057
+ inputClassName: "custom-input",
1058
+ onChange: (e) => {
1059
+ const selectedDate = e.value;
1060
+ if (!selectedDate) {
1061
+ options.filterCallback(null, options.index);
1062
+ return;
1063
+ }
1064
+ const formatted = mask ? mask(selectedDate) : (0, import_moment2.default)(selectedDate).utc().format("YYYY-MM-DDTHH:mm:ss.SSS[Z]");
1065
+ options.filterCallback(formatted, options.index);
1066
+ }
1068
1067
  }
1069
1068
  );
1070
1069
  };
package/dist/index.mjs CHANGED
@@ -991,29 +991,28 @@ var DateFilterTemplate = (options, mask) => {
991
991
  }
992
992
  );
993
993
  };
994
- var DateTimeFilterTemplate = (options) => {
995
- const value = typeof options.value === "string" ? moment2(options.value, "YYYY-MM-DDTHH:mm:ss.SSS").toDate() : options.value ?? null;
994
+ var DateTimeFilterTemplate = (options, mask) => {
995
+ const value = typeof options.value === "string" ? moment2(options.value).toDate() : options.value ?? null;
996
996
  return /* @__PURE__ */ jsx11(
997
997
  Calendar,
998
998
  {
999
999
  value,
1000
- onChange: (e) => {
1001
- if (!e.value) {
1002
- options.filterCallback(null, options.index);
1003
- return;
1004
- }
1005
- const formatted = moment2(e.value).format(
1006
- "YYYY-MM-DDTHH:mm:ss.SSS"
1007
- );
1008
- options.filterCallback(formatted, options.index);
1009
- },
1010
1000
  showTime: true,
1011
1001
  showSeconds: true,
1012
1002
  hourFormat: "24",
1013
- placeholder: "dd/mm/yyyy 00:00:00",
1014
1003
  dateFormat: "dd/mm/yy",
1004
+ placeholder: "dd/mm/yyyy 00:00:00",
1015
1005
  readOnlyInput: true,
1016
- inputClassName: "custom-input"
1006
+ inputClassName: "custom-input",
1007
+ onChange: (e) => {
1008
+ const selectedDate = e.value;
1009
+ if (!selectedDate) {
1010
+ options.filterCallback(null, options.index);
1011
+ return;
1012
+ }
1013
+ const formatted = mask ? mask(selectedDate) : moment2(selectedDate).utc().format("YYYY-MM-DDTHH:mm:ss.SSS[Z]");
1014
+ options.filterCallback(formatted, options.index);
1015
+ }
1017
1016
  }
1018
1017
  );
1019
1018
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@charlesgomes/leafcode-shared-lib-react",
3
- "version": "1.0.41",
3
+ "version": "1.0.42",
4
4
  "description": "Lib de componentes react",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",