@charlesgomes/leafcode-shared-lib-react 1.0.70 → 1.0.72
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 +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +20 -9
- package/dist/index.mjs +20 -9
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -202,8 +202,8 @@ declare const FilterMatchModeSelect: ({ options, items, placeholder, }: FilterMa
|
|
|
202
202
|
declare const DateFilterTemplate: (options: any, isLanguagePtBr?: boolean, isNullable?: boolean, items?: any[], mask?: (value: Date) => string) => react_jsx_runtime.JSX.Element;
|
|
203
203
|
declare const DateTimeFilterTemplate: (options: any, isLanguagePtBr?: boolean, isNullable?: boolean, mask?: (date: Date) => string) => react_jsx_runtime.JSX.Element;
|
|
204
204
|
declare const ValueFilterTemplate: (options: any, mask?: (value: any) => string | number) => react_jsx_runtime.JSX.Element;
|
|
205
|
-
declare const SelectFilterTemplate: (options: any, isLanguagePtBr?: boolean, items?: IItemProps[]) => react_jsx_runtime.JSX.Element;
|
|
206
|
-
declare const CustomFilterElement: (options: any, isLanguagePtBr?: boolean, items?: any[]) => react_jsx_runtime.JSX.Element;
|
|
205
|
+
declare const SelectFilterTemplate: (options: any, isLanguagePtBr?: boolean, isNullable?: boolean, items?: IItemProps[]) => react_jsx_runtime.JSX.Element;
|
|
206
|
+
declare const CustomFilterElement: (options: any, isLanguagePtBr?: boolean, isNullable?: boolean, items?: any[]) => react_jsx_runtime.JSX.Element;
|
|
207
207
|
|
|
208
208
|
declare const customMatchModes: {
|
|
209
209
|
notStartsWith: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -202,8 +202,8 @@ declare const FilterMatchModeSelect: ({ options, items, placeholder, }: FilterMa
|
|
|
202
202
|
declare const DateFilterTemplate: (options: any, isLanguagePtBr?: boolean, isNullable?: boolean, items?: any[], mask?: (value: Date) => string) => react_jsx_runtime.JSX.Element;
|
|
203
203
|
declare const DateTimeFilterTemplate: (options: any, isLanguagePtBr?: boolean, isNullable?: boolean, mask?: (date: Date) => string) => react_jsx_runtime.JSX.Element;
|
|
204
204
|
declare const ValueFilterTemplate: (options: any, mask?: (value: any) => string | number) => react_jsx_runtime.JSX.Element;
|
|
205
|
-
declare const SelectFilterTemplate: (options: any, isLanguagePtBr?: boolean, items?: IItemProps[]) => react_jsx_runtime.JSX.Element;
|
|
206
|
-
declare const CustomFilterElement: (options: any, isLanguagePtBr?: boolean, items?: any[]) => react_jsx_runtime.JSX.Element;
|
|
205
|
+
declare const SelectFilterTemplate: (options: any, isLanguagePtBr?: boolean, isNullable?: boolean, items?: IItemProps[]) => react_jsx_runtime.JSX.Element;
|
|
206
|
+
declare const CustomFilterElement: (options: any, isLanguagePtBr?: boolean, isNullable?: boolean, items?: any[]) => react_jsx_runtime.JSX.Element;
|
|
207
207
|
|
|
208
208
|
declare const customMatchModes: {
|
|
209
209
|
notStartsWith: string;
|
package/dist/index.js
CHANGED
|
@@ -780,6 +780,14 @@ var InputBase3 = ({
|
|
|
780
780
|
if (!defaultValue) return;
|
|
781
781
|
setValue(defaultValue.label ?? defaultValue);
|
|
782
782
|
}, [defaultValue]);
|
|
783
|
+
(0, import_react12.useEffect)(() => {
|
|
784
|
+
if (typeof rest.value === "string") {
|
|
785
|
+
setValue(rest.value);
|
|
786
|
+
}
|
|
787
|
+
if (rest.value === null || rest.value === void 0) {
|
|
788
|
+
setValue("");
|
|
789
|
+
}
|
|
790
|
+
}, [rest.value]);
|
|
783
791
|
const handleScroll = () => {
|
|
784
792
|
if (!listRef.current || !data) return;
|
|
785
793
|
const { scrollTop, clientHeight, scrollHeight } = listRef.current;
|
|
@@ -814,7 +822,9 @@ var InputBase3 = ({
|
|
|
814
822
|
className: "input-wrapper",
|
|
815
823
|
style: styleVars,
|
|
816
824
|
tabIndex: -1,
|
|
817
|
-
onBlur: (e) =>
|
|
825
|
+
onBlur: (e) => {
|
|
826
|
+
e.relatedTarget === null && setIsOpen(false);
|
|
827
|
+
},
|
|
818
828
|
children: [
|
|
819
829
|
label && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
820
830
|
"label",
|
|
@@ -835,10 +845,11 @@ var InputBase3 = ({
|
|
|
835
845
|
placeholder,
|
|
836
846
|
autoComplete: "off",
|
|
837
847
|
className: "input",
|
|
838
|
-
value,
|
|
848
|
+
value: value ?? "",
|
|
839
849
|
onChange: (e) => {
|
|
840
|
-
|
|
841
|
-
|
|
850
|
+
const val = e.target.value;
|
|
851
|
+
setValue(val);
|
|
852
|
+
onChange?.(val);
|
|
842
853
|
setIsOpen(true);
|
|
843
854
|
},
|
|
844
855
|
onFocus: () => setIsOpen(true),
|
|
@@ -853,7 +864,7 @@ var InputBase3 = ({
|
|
|
853
864
|
setValue("");
|
|
854
865
|
setItems([]);
|
|
855
866
|
setPageNumber(1);
|
|
856
|
-
onChange?.(
|
|
867
|
+
onChange?.("");
|
|
857
868
|
onSelect(null);
|
|
858
869
|
},
|
|
859
870
|
className: "dropdown-clear",
|
|
@@ -1876,8 +1887,8 @@ var ValueFilterTemplate = (options, mask) => {
|
|
|
1876
1887
|
}
|
|
1877
1888
|
);
|
|
1878
1889
|
};
|
|
1879
|
-
var SelectFilterTemplate = (options, isLanguagePtBr = true, items = []) => {
|
|
1880
|
-
const matchModeItems = getDefaultFilterMatchOptionsEnum(isLanguagePtBr);
|
|
1890
|
+
var SelectFilterTemplate = (options, isLanguagePtBr = true, isNullable = true, items = []) => {
|
|
1891
|
+
const matchModeItems = getDefaultFilterMatchOptionsEnum(isLanguagePtBr, isNullable);
|
|
1881
1892
|
const selectOptions = items.length > 0 ? items : [
|
|
1882
1893
|
{ label: isLanguagePtBr ? "Sim" : "Yes", value: true },
|
|
1883
1894
|
{ label: isLanguagePtBr ? "N\xE3o" : "No", value: false }
|
|
@@ -1955,8 +1966,8 @@ var SelectFilterTemplate = (options, isLanguagePtBr = true, items = []) => {
|
|
|
1955
1966
|
)
|
|
1956
1967
|
] });
|
|
1957
1968
|
};
|
|
1958
|
-
var CustomFilterElement = (options, isLanguagePtBr = true, items) => {
|
|
1959
|
-
const resolvedItems = items ?? getDefaultFilterMatchOptionsString(isLanguagePtBr);
|
|
1969
|
+
var CustomFilterElement = (options, isLanguagePtBr = true, isNullable = true, items) => {
|
|
1970
|
+
const resolvedItems = items ?? getDefaultFilterMatchOptionsString(isLanguagePtBr, isNullable);
|
|
1960
1971
|
const rawFilter = options.value ?? {};
|
|
1961
1972
|
const currentMatchMode = rawFilter.matchMode ?? "contains";
|
|
1962
1973
|
const currentValue = typeof rawFilter.text === "string" ? rawFilter.text : "";
|
package/dist/index.mjs
CHANGED
|
@@ -730,6 +730,14 @@ var InputBase3 = ({
|
|
|
730
730
|
if (!defaultValue) return;
|
|
731
731
|
setValue(defaultValue.label ?? defaultValue);
|
|
732
732
|
}, [defaultValue]);
|
|
733
|
+
useEffect4(() => {
|
|
734
|
+
if (typeof rest.value === "string") {
|
|
735
|
+
setValue(rest.value);
|
|
736
|
+
}
|
|
737
|
+
if (rest.value === null || rest.value === void 0) {
|
|
738
|
+
setValue("");
|
|
739
|
+
}
|
|
740
|
+
}, [rest.value]);
|
|
733
741
|
const handleScroll = () => {
|
|
734
742
|
if (!listRef.current || !data) return;
|
|
735
743
|
const { scrollTop, clientHeight, scrollHeight } = listRef.current;
|
|
@@ -764,7 +772,9 @@ var InputBase3 = ({
|
|
|
764
772
|
className: "input-wrapper",
|
|
765
773
|
style: styleVars,
|
|
766
774
|
tabIndex: -1,
|
|
767
|
-
onBlur: (e) =>
|
|
775
|
+
onBlur: (e) => {
|
|
776
|
+
e.relatedTarget === null && setIsOpen(false);
|
|
777
|
+
},
|
|
768
778
|
children: [
|
|
769
779
|
label && /* @__PURE__ */ jsx10(
|
|
770
780
|
"label",
|
|
@@ -785,10 +795,11 @@ var InputBase3 = ({
|
|
|
785
795
|
placeholder,
|
|
786
796
|
autoComplete: "off",
|
|
787
797
|
className: "input",
|
|
788
|
-
value,
|
|
798
|
+
value: value ?? "",
|
|
789
799
|
onChange: (e) => {
|
|
790
|
-
|
|
791
|
-
|
|
800
|
+
const val = e.target.value;
|
|
801
|
+
setValue(val);
|
|
802
|
+
onChange?.(val);
|
|
792
803
|
setIsOpen(true);
|
|
793
804
|
},
|
|
794
805
|
onFocus: () => setIsOpen(true),
|
|
@@ -803,7 +814,7 @@ var InputBase3 = ({
|
|
|
803
814
|
setValue("");
|
|
804
815
|
setItems([]);
|
|
805
816
|
setPageNumber(1);
|
|
806
|
-
onChange?.(
|
|
817
|
+
onChange?.("");
|
|
807
818
|
onSelect(null);
|
|
808
819
|
},
|
|
809
820
|
className: "dropdown-clear",
|
|
@@ -1826,8 +1837,8 @@ var ValueFilterTemplate = (options, mask) => {
|
|
|
1826
1837
|
}
|
|
1827
1838
|
);
|
|
1828
1839
|
};
|
|
1829
|
-
var SelectFilterTemplate = (options, isLanguagePtBr = true, items = []) => {
|
|
1830
|
-
const matchModeItems = getDefaultFilterMatchOptionsEnum(isLanguagePtBr);
|
|
1840
|
+
var SelectFilterTemplate = (options, isLanguagePtBr = true, isNullable = true, items = []) => {
|
|
1841
|
+
const matchModeItems = getDefaultFilterMatchOptionsEnum(isLanguagePtBr, isNullable);
|
|
1831
1842
|
const selectOptions = items.length > 0 ? items : [
|
|
1832
1843
|
{ label: isLanguagePtBr ? "Sim" : "Yes", value: true },
|
|
1833
1844
|
{ label: isLanguagePtBr ? "N\xE3o" : "No", value: false }
|
|
@@ -1905,8 +1916,8 @@ var SelectFilterTemplate = (options, isLanguagePtBr = true, items = []) => {
|
|
|
1905
1916
|
)
|
|
1906
1917
|
] });
|
|
1907
1918
|
};
|
|
1908
|
-
var CustomFilterElement = (options, isLanguagePtBr = true, items) => {
|
|
1909
|
-
const resolvedItems = items ?? getDefaultFilterMatchOptionsString(isLanguagePtBr);
|
|
1919
|
+
var CustomFilterElement = (options, isLanguagePtBr = true, isNullable = true, items) => {
|
|
1920
|
+
const resolvedItems = items ?? getDefaultFilterMatchOptionsString(isLanguagePtBr, isNullable);
|
|
1910
1921
|
const rawFilter = options.value ?? {};
|
|
1911
1922
|
const currentMatchMode = rawFilter.matchMode ?? "contains";
|
|
1912
1923
|
const currentValue = typeof rawFilter.text === "string" ? rawFilter.text : "";
|