@raystack/apsara 0.14.3 → 0.14.4

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 CHANGED
@@ -31750,7 +31750,7 @@ function DataTableClearFilter({ children, ...props }) {
31750
31750
  return (jsxRuntimeExports$1.jsx(Button$1, { variant: "ghost", onClick: () => {
31751
31751
  table.resetColumnFilters();
31752
31752
  resetColumns();
31753
- }, style: { width: "100%" }, ...props, children: children || (jsxRuntimeExports$1.jsxs(Flex, { gap: "small", align: "center", justify: "center", children: ["Clear filters ", jsxRuntimeExports$1.jsx(Cross2Icon, { width: 12, height: "12" })] })) }));
31753
+ }, ...props, children: children || (jsxRuntimeExports$1.jsxs(Flex, { gap: "small", align: "center", justify: "center", style: { textWrap: "nowrap" }, children: ["Clear filters ", jsxRuntimeExports$1.jsx(Cross2Icon, { width: 12, height: "12" })] })) }));
31754
31754
  }
31755
31755
 
31756
31756
  function DataTableFilterOptions({ children, ...props }) {
@@ -31966,15 +31966,14 @@ const getFilterValueType = ({ filterOperation, columnType, }) => {
31966
31966
  return filterValueTypeMap.text;
31967
31967
  }
31968
31968
  };
31969
- const FilterValues = ({ columnType = filterValueTypeMap.text, options = [], onValueChange, filterOperation, ...props }) => {
31970
- const [value, setValue] = React.useState({
31971
- value: "",
31972
- date: new Date(),
31973
- dateRange: {
31974
- to: new Date(),
31975
- from: new Date(),
31976
- },
31977
- });
31969
+ const FilterValues = ({ column, columnType = filterValueTypeMap.text, options = [], onValueChange, filterOperation, ...props }) => {
31970
+ const [value, setValue] = React.useState(column?.columnDef?.meta?.defaultValue
31971
+ ? { value: (column?.columnDef.meta).defaultValue }
31972
+ : {
31973
+ value: "",
31974
+ date: new Date(),
31975
+ dateRange: { to: new Date(), from: new Date() },
31976
+ });
31978
31977
  const valueType = getFilterValueType({ filterOperation, columnType });
31979
31978
  React.useEffect(() => {
31980
31979
  if (onValueChange) {
@@ -32028,7 +32027,7 @@ const FilteredChip = ({ column, updateColumnCustomFilter, }) => {
32028
32027
  setFilterOperation(undefined);
32029
32028
  setFilterValue({});
32030
32029
  }
32031
- return (jsxRuntimeExports$1.jsxs(Box, { className: styles$4.chip, children: [jsxRuntimeExports$1.jsx(Text, { className: styles$4.filterText, children: columnName }), jsxRuntimeExports$1.jsx(Operation, { columnType: filterVariant, onOperationSelect: setFilterOperation }), filterOperation?.hideValueField ? null : (jsxRuntimeExports$1.jsx(FilterValues, { columnType: filterVariant, options: options, onValueChange: setFilterValue, filterOperation: filterOperation })), jsxRuntimeExports$1.jsx(Flex, { children: jsxRuntimeExports$1.jsx(Cross1Icon, { height: "12", width: "12", onClick: removeFilter }) })] }));
32030
+ return (jsxRuntimeExports$1.jsxs(Box, { className: styles$4.chip, children: [jsxRuntimeExports$1.jsx(Text, { className: styles$4.filterText, children: columnName }), jsxRuntimeExports$1.jsx(Operation, { columnType: filterVariant, onOperationSelect: setFilterOperation }), filterOperation?.hideValueField ? null : (jsxRuntimeExports$1.jsx(FilterValues, { column: column, columnType: filterVariant, options: options, onValueChange: setFilterValue, filterOperation: filterOperation })), jsxRuntimeExports$1.jsx(Flex, { children: jsxRuntimeExports$1.jsx(Cross1Icon, { height: "12", width: "12", onClick: removeFilter }) })] }));
32032
32031
  };
32033
32032
 
32034
32033
  function DataTableFilterChips(props) {