@raystack/apsara 0.14.3 → 0.14.5

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
@@ -28197,7 +28197,7 @@ const Calendar = function ({ className, classNames, showOutsideDays = true, ...p
28197
28197
  }, className: root$1({ className }), ...props }));
28198
28198
  };
28199
28199
 
28200
- var styles$5 = {"textfield":"textfield-module_textfield__u4AGg","textfield-sm":"textfield-module_textfield-sm__OKPic","textfield-md":"textfield-module_textfield-md__e2ayW","textfield-invlid":"textfield-module_textfield-invlid__zo9MF","textfield-valid":"textfield-module_textfield-valid__6rMM9","textfield-leading":"textfield-module_textfield-leading__AE-ld","textfield-trailing":"textfield-module_textfield-trailing__Hj2jX"};
28200
+ var styles$5 = {"textfield":"textfield-module_textfield__u4AGg","textfield-sm":"textfield-module_textfield-sm__OKPic","textfield-md":"textfield-module_textfield-md__e2ayW","textfield-invlid":"textfield-module_textfield-invlid__zo9MF","textfield-valid":"textfield-module_textfield-valid__6rMM9","textfield-leading":"textfield-module_textfield-leading__AE-ld","textfield-trailing":"textfield-module_textfield-trailing__Hj2jX","leadingIcon":"textfield-module_leadingIcon__u-GJ6","trailingIcon":"textfield-module_trailingIcon__q-49S"};
28201
28201
 
28202
28202
  const textfield = cva(styles$5.textfield, {
28203
28203
  variants: {
@@ -28223,13 +28223,13 @@ const textfield = cva(styles$5.textfield, {
28223
28223
  const TextField = React.forwardRef(({ leading, trailing, className, src, size, state, style, ...props }, ref) => {
28224
28224
  const hasLeadingElement = Boolean(leading);
28225
28225
  const hasTrailingElement = Boolean(trailing);
28226
- return (jsxRuntimeExports$1.jsxs(Flex, { align: "center", style: { position: "relative", width: "100%" }, children: [hasLeadingElement ? (jsxRuntimeExports$1.jsx(Flex, { style: { position: "absolute", left: "8px" }, children: leading })) : null, jsxRuntimeExports$1.jsx("input", { className: cx(textfield({
28226
+ return (jsxRuntimeExports$1.jsxs(Flex, { align: "center", style: { position: "relative", width: "100%" }, children: [hasLeadingElement ? (jsxRuntimeExports$1.jsx(Flex, { style: { left: "8px" }, className: styles$5.leadingIcon, children: leading })) : null, jsxRuntimeExports$1.jsx("input", { className: cx(textfield({
28227
28227
  size,
28228
28228
  state,
28229
28229
  className,
28230
28230
  hasLeadingElement,
28231
28231
  hasTrailingElement,
28232
- })), ...props, ref: ref }), hasTrailingElement ? (jsxRuntimeExports$1.jsx(Flex, { style: { position: "absolute", right: "8px" }, children: trailing })) : null] }));
28232
+ })), ...props, ref: ref }), hasTrailingElement ? (jsxRuntimeExports$1.jsx(Flex, { style: { right: "8px" }, className: styles$5.trailingIcon, children: trailing })) : null] }));
28233
28233
  });
28234
28234
  TextField.displayName = "TextField";
28235
28235
 
@@ -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) {