nexaas-ui-components 1.0.15 → 1.0.17
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.cjs +14 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -10,7 +10,7 @@ var dateFns = require('date-fns');
|
|
|
10
10
|
var react = require('@headlessui/react');
|
|
11
11
|
var react$1 = require('@headlessui-float/react');
|
|
12
12
|
var IntlCurrencyInputRaw = require('react-intl-currency-input');
|
|
13
|
-
var
|
|
13
|
+
var lodashNamespace = require('lodash');
|
|
14
14
|
var InputMask = require('react-input-mask');
|
|
15
15
|
var ReactModalNamespace = require('react-modal');
|
|
16
16
|
var reactTooltip = require('react-tooltip');
|
|
@@ -42,7 +42,7 @@ function _interopNamespace(e) {
|
|
|
42
42
|
var clsx7__default = /*#__PURE__*/_interopDefault(clsx7);
|
|
43
43
|
var React2__namespace = /*#__PURE__*/_interopNamespace(React2);
|
|
44
44
|
var IntlCurrencyInputRaw__default = /*#__PURE__*/_interopDefault(IntlCurrencyInputRaw);
|
|
45
|
-
var
|
|
45
|
+
var lodashNamespace__namespace = /*#__PURE__*/_interopNamespace(lodashNamespace);
|
|
46
46
|
var InputMask__default = /*#__PURE__*/_interopDefault(InputMask);
|
|
47
47
|
var ReactModalNamespace__namespace = /*#__PURE__*/_interopNamespace(ReactModalNamespace);
|
|
48
48
|
var AsyncSelect__default = /*#__PURE__*/_interopDefault(AsyncSelect);
|
|
@@ -1869,6 +1869,9 @@ function InputMoney({
|
|
|
1869
1869
|
);
|
|
1870
1870
|
}
|
|
1871
1871
|
InputMoney.displayName = "InputMoney";
|
|
1872
|
+
var lodash = lodashNamespace__namespace.default || lodashNamespace__namespace;
|
|
1873
|
+
var debounce = lodash.debounce;
|
|
1874
|
+
var debounce_default = debounce;
|
|
1872
1875
|
function InputNumber({
|
|
1873
1876
|
label,
|
|
1874
1877
|
type,
|
|
@@ -1910,7 +1913,7 @@ function InputNumber({
|
|
|
1910
1913
|
}
|
|
1911
1914
|
};
|
|
1912
1915
|
const updateCount = React2.useMemo(() => {
|
|
1913
|
-
return
|
|
1916
|
+
return debounce_default(() => {
|
|
1914
1917
|
save();
|
|
1915
1918
|
}, 1e3);
|
|
1916
1919
|
}, []);
|
|
@@ -2536,7 +2539,7 @@ var SelectField = ({
|
|
|
2536
2539
|
isClearable = false,
|
|
2537
2540
|
onChange,
|
|
2538
2541
|
required,
|
|
2539
|
-
debounce = 0,
|
|
2542
|
+
debounce: debounce2 = 0,
|
|
2540
2543
|
filterOptions,
|
|
2541
2544
|
optionsList,
|
|
2542
2545
|
disabled,
|
|
@@ -2575,7 +2578,7 @@ var SelectField = ({
|
|
|
2575
2578
|
const loadOptions = (inputValue2) => {
|
|
2576
2579
|
setLoading(true);
|
|
2577
2580
|
if (isSearchable && filterOptions) {
|
|
2578
|
-
if (
|
|
2581
|
+
if (debounce2 && inputValue2.length >= debounce2 || !debounce2) {
|
|
2579
2582
|
const result = filterOptions(inputValue2);
|
|
2580
2583
|
setLoading(false);
|
|
2581
2584
|
return result;
|
|
@@ -2634,7 +2637,7 @@ var SelectField = ({
|
|
|
2634
2637
|
) });
|
|
2635
2638
|
};
|
|
2636
2639
|
const LoadingMessage = (props) => {
|
|
2637
|
-
if (!
|
|
2640
|
+
if (!debounce2 || debounce2 && inputValue.length >= debounce2) {
|
|
2638
2641
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2639
2642
|
"div",
|
|
2640
2643
|
{
|
|
@@ -2655,20 +2658,20 @@ var SelectField = ({
|
|
|
2655
2658
|
]
|
|
2656
2659
|
}
|
|
2657
2660
|
);
|
|
2658
|
-
} else if (
|
|
2661
|
+
} else if (debounce2 && inputValue.length < debounce2) {
|
|
2659
2662
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-2 text-neutral-300", children: [
|
|
2660
2663
|
"Digite ",
|
|
2661
|
-
|
|
2664
|
+
debounce2,
|
|
2662
2665
|
" ou mais caracteres para pesquisar"
|
|
2663
2666
|
] });
|
|
2664
2667
|
}
|
|
2665
2668
|
};
|
|
2666
2669
|
const NoOptionsMessage = (props) => {
|
|
2667
2670
|
var _a2;
|
|
2668
|
-
if (props.selectProps.inputValue.length == 0 &&
|
|
2671
|
+
if (props.selectProps.inputValue.length == 0 && debounce2 > 0 || debounce2 > 0 && props.selectProps.inputValue.length < debounce2) {
|
|
2669
2672
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-dangerous-500 text-sm", children: [
|
|
2670
2673
|
"Digite ",
|
|
2671
|
-
|
|
2674
|
+
debounce2,
|
|
2672
2675
|
" ou mais caracteres para pesquisar"
|
|
2673
2676
|
] });
|
|
2674
2677
|
} else if (props.selectProps.inputValue.length > 0 && ((_a2 = props == null ? void 0 : props.options) == null ? void 0 : _a2.length) == 0) {
|
|
@@ -2731,7 +2734,7 @@ var SelectField = ({
|
|
|
2731
2734
|
onBlur: () => setIsFocused(false),
|
|
2732
2735
|
loadingMessage: () => /* @__PURE__ */ jsxRuntime.jsx("div", { children: "Carregando" }),
|
|
2733
2736
|
isLoading: loading,
|
|
2734
|
-
defaultOptions:
|
|
2737
|
+
defaultOptions: debounce2 > 0 ? false : optionsList ? options : true,
|
|
2735
2738
|
loadOptions,
|
|
2736
2739
|
name: field.name,
|
|
2737
2740
|
isClearable,
|