@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.css CHANGED
@@ -1873,6 +1873,9 @@ html[data-theme="dark"] {
1873
1873
  cursor: pointer;
1874
1874
  border: none;
1875
1875
  background: transparent;
1876
+ width: 100%;
1877
+ height: 100%;
1878
+ padding: unset;
1876
1879
  }
1877
1880
 
1878
1881
  .calendar-module_day_outside__WN68B {
@@ -1981,6 +1984,12 @@ html[data-theme="dark"] {
1981
1984
  padding-right: 32px;
1982
1985
  }
1983
1986
 
1987
+ .textfield-module_leadingIcon__u-GJ6,
1988
+ .textfield-module_trailingIcon__q-49S {
1989
+ position: absolute;
1990
+ pointer-events: none;
1991
+ }
1992
+
1984
1993
  .datatable-module_wrapper__Sxg2d {
1985
1994
  width: 100%;
1986
1995
  height: 100%;
package/dist/index.js CHANGED
@@ -28177,7 +28177,7 @@ const Calendar = function ({ className, classNames, showOutsideDays = true, ...p
28177
28177
  }, className: root$1({ className }), ...props }));
28178
28178
  };
28179
28179
 
28180
- 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"};
28180
+ 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"};
28181
28181
 
28182
28182
  const textfield = cva(styles$5.textfield, {
28183
28183
  variants: {
@@ -28203,13 +28203,13 @@ const textfield = cva(styles$5.textfield, {
28203
28203
  const TextField = forwardRef(({ leading, trailing, className, src, size, state, style, ...props }, ref) => {
28204
28204
  const hasLeadingElement = Boolean(leading);
28205
28205
  const hasTrailingElement = Boolean(trailing);
28206
- 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({
28206
+ 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({
28207
28207
  size,
28208
28208
  state,
28209
28209
  className,
28210
28210
  hasLeadingElement,
28211
28211
  hasTrailingElement,
28212
- })), ...props, ref: ref }), hasTrailingElement ? (jsxRuntimeExports$1.jsx(Flex, { style: { position: "absolute", right: "8px" }, children: trailing })) : null] }));
28212
+ })), ...props, ref: ref }), hasTrailingElement ? (jsxRuntimeExports$1.jsx(Flex, { style: { right: "8px" }, className: styles$5.trailingIcon, children: trailing })) : null] }));
28213
28213
  });
28214
28214
  TextField.displayName = "TextField";
28215
28215
 
@@ -31730,7 +31730,7 @@ function DataTableClearFilter({ children, ...props }) {
31730
31730
  return (jsxRuntimeExports$1.jsx(Button$1, { variant: "ghost", onClick: () => {
31731
31731
  table.resetColumnFilters();
31732
31732
  resetColumns();
31733
- }, 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" })] })) }));
31733
+ }, ...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" })] })) }));
31734
31734
  }
31735
31735
 
31736
31736
  function DataTableFilterOptions({ children, ...props }) {
@@ -31946,15 +31946,14 @@ const getFilterValueType = ({ filterOperation, columnType, }) => {
31946
31946
  return filterValueTypeMap.text;
31947
31947
  }
31948
31948
  };
31949
- const FilterValues = ({ columnType = filterValueTypeMap.text, options = [], onValueChange, filterOperation, ...props }) => {
31950
- const [value, setValue] = useState({
31951
- value: "",
31952
- date: new Date(),
31953
- dateRange: {
31954
- to: new Date(),
31955
- from: new Date(),
31956
- },
31957
- });
31949
+ const FilterValues = ({ column, columnType = filterValueTypeMap.text, options = [], onValueChange, filterOperation, ...props }) => {
31950
+ const [value, setValue] = useState(column?.columnDef?.meta?.defaultValue
31951
+ ? { value: (column?.columnDef.meta).defaultValue }
31952
+ : {
31953
+ value: "",
31954
+ date: new Date(),
31955
+ dateRange: { to: new Date(), from: new Date() },
31956
+ });
31958
31957
  const valueType = getFilterValueType({ filterOperation, columnType });
31959
31958
  useEffect(() => {
31960
31959
  if (onValueChange) {
@@ -32008,7 +32007,7 @@ const FilteredChip = ({ column, updateColumnCustomFilter, }) => {
32008
32007
  setFilterOperation(undefined);
32009
32008
  setFilterValue({});
32010
32009
  }
32011
- 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 }) })] }));
32010
+ 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 }) })] }));
32012
32011
  };
32013
32012
 
32014
32013
  function DataTableFilterChips(props) {