@devgateway/dvz-ui-react
Version:
A modular, embeddable React component library for data visualization and UI, built with TypeScript. Provides reusable components for charts, maps, dashboards, and more, with built-in support for internationalization and Redux integration.
61 lines (60 loc) • 1.23 kB
JavaScript
import { jsx as w } from "react/jsx-runtime";
import { useEffect as x } from "react";
import y from "./PostsFilterDropdown.js";
import { getYearRange as F } from "@devgateway/wp-react-lib";
const T = (t) => {
const {
group: r,
placeholder: n,
allLabel: s,
noneLabel: l,
useSingleColumn: c,
enableTextSearch: i,
filterType: p,
showNoDataOption: f,
closeOnSelect: m,
allNoneSameBehaviour: u,
autoApply: h,
alphabeticalSort: d,
ascOrder: g,
onChange: Y,
setYearOptions: S,
setYearFilterLoading: a
} = t, D = async () => {
a(!0);
const b = (await F()).data.map((e) => ({
key: e,
value: e,
text: e.toString()
}));
return a(!1), b;
};
return x(() => {
(async () => {
const o = await D();
S(o);
})();
}, []), /* @__PURE__ */ w(
y,
{
...t,
group: r,
placeholder: n,
allLabel: s,
noneLabel: l,
useSingleColumn: c,
enableTextSearch: i,
filterType: p,
showNoDataOption: f,
closeOnSelect: m,
allNoneSameBehaviour: u,
autoApply: h,
alphabeticalSort: d,
ascOrder: g,
onChange: Y
}
);
};
export {
T as default
};