@ctlyst.id/internal-ui 5.0.0 → 5.0.2

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.mjs CHANGED
@@ -924,10 +924,10 @@ import { css } from "@emotion/react";
924
924
  import { flexRender, getCoreRowModel, getSortedRowModel, useReactTable } from "@tanstack/react-table";
925
925
  import * as React5 from "react";
926
926
 
927
- // src/hooks/useDragOrClick.ts
927
+ // src/hooks/use-drag-threshold/use-drag-or-click.ts
928
928
  import { useRef } from "react";
929
929
 
930
- // src/components/data-table/drag-threshold.ts
930
+ // src/hooks/use-drag-threshold/drag-threshold.ts
931
931
  var DragThreshold = class {
932
932
  constructor() {
933
933
  __publicField(this, "isDrag");
@@ -966,7 +966,7 @@ var DragThreshold = class {
966
966
  }
967
967
  };
968
968
 
969
- // src/hooks/useDragOrClick.ts
969
+ // src/hooks/use-drag-threshold/use-drag-or-click.ts
970
970
  var useDragOrClick = () => {
971
971
  const clickOrDragged = useRef(new DragThreshold());
972
972
  const getDragOrClickProps = ({
@@ -1153,7 +1153,6 @@ var useDataTable = ({
1153
1153
  const { getSelectedRowModel, toggleAllRowsSelected } = table;
1154
1154
  const { flatRows } = getSelectedRowModel();
1155
1155
  React5.useEffect(() => {
1156
- console.log("changed");
1157
1156
  const rowData = flatRows.map((row) => row.original);
1158
1157
  if (onSelectedRow) {
1159
1158
  onSelectedRow(rowData);
@@ -1404,6 +1403,16 @@ var DataTable = React5.forwardRef((props, ref) => {
1404
1403
  });
1405
1404
  var data_table_default = DataTable;
1406
1405
 
1406
+ // src/components/data-table/hook/use-select-table.ts
1407
+ import React6 from "react";
1408
+ var useSelectTable = (intialRowSelection) => {
1409
+ const [rowSelection, onRowSelectionChange] = React6.useState(intialRowSelection != null ? intialRowSelection : {});
1410
+ return {
1411
+ rowSelection,
1412
+ onRowSelectionChange
1413
+ };
1414
+ };
1415
+
1407
1416
  // src/components/datepicker/components/datepicker.tsx
1408
1417
  import { FormControl as FormControl3, FormErrorMessage as FormErrorMessage3, FormHelperText as FormHelperText3, IconButton as IconButton4 } from "@chakra-ui/react";
1409
1418
  import { cx as cx8 } from "@chakra-ui/shared-utils";
@@ -2787,10 +2796,10 @@ var styles_default = Styles;
2787
2796
 
2788
2797
  // src/components/datepicker/components/time-input.tsx
2789
2798
  import { Flex as Flex3, Input, InputGroup as InputGroup3, InputRightAddon as InputRightAddon3, Text as Text4 } from "@chakra-ui/react";
2790
- import React6 from "react";
2799
+ import React7 from "react";
2791
2800
  import { jsx as jsx26, jsxs as jsxs9 } from "react/jsx-runtime";
2792
2801
  var TimeInput = ({ value, onChange, label, rightAddon }) => {
2793
- const [time, setTime] = React6.useState(value || "00:00");
2802
+ const [time, setTime] = React7.useState(value || "00:00");
2794
2803
  const handleChange = (e) => {
2795
2804
  var _a, _b;
2796
2805
  setTime(((_a = e.target) == null ? void 0 : _a.value) || "00:00");
@@ -2950,10 +2959,10 @@ var datepicker_default = Datepicker;
2950
2959
  // src/components/datepicker/components/datepicker-month/datepicker-month.tsx
2951
2960
  import { Box as Box12, Input as Input2 } from "@chakra-ui/react";
2952
2961
  import { css as css2 } from "@emotion/react";
2953
- import React7 from "react";
2962
+ import React8 from "react";
2954
2963
  import { jsx as jsx28 } from "react/jsx-runtime";
2955
2964
  var DatePickerMonth = ({ onChange, min, max, ...props }) => {
2956
- const [date, setDate] = React7.useState(null);
2965
+ const [date, setDate] = React8.useState(null);
2957
2966
  return /* @__PURE__ */ jsx28(
2958
2967
  Box12,
2959
2968
  {
@@ -3009,7 +3018,7 @@ var datepicker_month_default = DatePickerMonth;
3009
3018
  // src/components/datepicker/components/datepicker-month/multi-datepicker-month.tsx
3010
3019
  import { Box as Box13 } from "@chakra-ui/react";
3011
3020
  import styled from "@emotion/styled";
3012
- import React8 from "react";
3021
+ import React9 from "react";
3013
3022
  import { jsx as jsx29, jsxs as jsxs11 } from "react/jsx-runtime";
3014
3023
  var MultiDateWrapper = styled(Box13)`
3015
3024
  display: flex;
@@ -3026,7 +3035,7 @@ var MultiDatePickerMonth = ({
3026
3035
  min = "2020-01-01",
3027
3036
  max = "2020-12-31"
3028
3037
  }) => {
3029
- const [date, setDate] = React8.useState([null, null]);
3038
+ const [date, setDate] = React9.useState([null, null]);
3030
3039
  return /* @__PURE__ */ jsxs11(MultiDateWrapper, { isError, children: [
3031
3040
  /* @__PURE__ */ jsx29(
3032
3041
  datepicker_month_default,
@@ -4125,7 +4134,7 @@ var pagination_detail_default = PaginationDetail;
4125
4134
 
4126
4135
  // src/components/pagination/components/pagination-filter.tsx
4127
4136
  import { Box as Box24, Select, Text as Text12, useColorModeValue as useColorModeValue6 } from "@chakra-ui/react";
4128
- import * as React9 from "react";
4137
+ import * as React10 from "react";
4129
4138
  import { FiChevronDown } from "react-icons/fi";
4130
4139
  import { jsx as jsx49, jsxs as jsxs22 } from "react/jsx-runtime";
4131
4140
  var PaginationFilter = ({
@@ -4135,7 +4144,7 @@ var PaginationFilter = ({
4135
4144
  onChange,
4136
4145
  ...rest
4137
4146
  }) => {
4138
- const [value, setValue] = React9.useState(limit);
4147
+ const [value, setValue] = React10.useState(limit);
4139
4148
  return /* @__PURE__ */ jsxs22(Box24, { display: "flex", flexDirection: "row", alignItems: "center", children: [
4140
4149
  /* @__PURE__ */ jsx49(Text12, { fontSize: "text.sm", lineHeight: 18, color: useColorModeValue6("neutral.900", "white"), ...rest, children: label }),
4141
4150
  /* @__PURE__ */ jsx49(
@@ -8266,6 +8275,7 @@ export {
8266
8275
  useRadio,
8267
8276
  useRadioGroup,
8268
8277
  useRadioGroupContext,
8278
+ useSelectTable,
8269
8279
  useSteps,
8270
8280
  useTab2 as useTab,
8271
8281
  useTabIndicator,