@pnkx-lib/ui 1.9.395 → 1.9.396

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.
@@ -1321,15 +1321,6 @@ const Input = (props) => {
1321
1321
  const handleCompositionEnd = useCallback(
1322
1322
  (e) => {
1323
1323
  setIsComposing(false);
1324
- const syntheticEvent = {
1325
- target: {
1326
- value: e.currentTarget.value,
1327
- name
1328
- }
1329
- };
1330
- setTimeout(() => {
1331
- handleChange(syntheticEvent);
1332
- }, 0);
1333
1324
  const input = inputRef.current?.input;
1334
1325
  if (input) {
1335
1326
  setTimeout(() => {
@@ -19,7 +19,8 @@ const SelectSingleTable = ({
19
19
  loadMoreThreshold = 50,
20
20
  searchPlaceholder = "Tìm kiếm...",
21
21
  displayField,
22
- customeClassTable = "",
22
+ customeContentTable = "",
23
+ customeContainerTable = "",
23
24
  ...selectProps
24
25
  }) => {
25
26
  const [open, setOpen] = useState(false);
@@ -95,33 +96,41 @@ const SelectSingleTable = ({
95
96
  setOpen(visible);
96
97
  };
97
98
  const dropdownRender = () => /* @__PURE__ */ jsxs("div", { className: "select-single-table-dropdown", children: [
98
- /* @__PURE__ */ jsxs("div", { className: "overflow-x-hidden w-full", children: [
99
- /* @__PURE__ */ jsx(
100
- Table,
101
- {
102
- className: twMerge(`select-single-table-custom ${customeClassTable}`),
103
- columns,
104
- dataSource: currentDataSource,
105
- rowKey,
106
- size: tableProps.size || "small",
107
- pagination: false,
108
- scroll: { y: 400 },
109
- style: { overflowX: "hidden" },
110
- loading: false,
111
- onScroll: handleScroll,
112
- onRow: (record) => ({
113
- onClick: () => handleRowClick(record),
114
- className: selectedKey === (typeof rowKey === "function" ? rowKey(record) : record[rowKey]) ? "ant-table-row-selected" : ""
115
- }),
116
- ...tableProps
117
- }
118
- ),
119
- (internalLoading || loading) && /* @__PURE__ */ jsxs("div", { className: "text-center py-2 border-t border-gray-200", children: [
120
- /* @__PURE__ */ jsx(Spin, { size: "small" }),
121
- " Đang tải thêm..."
122
- ] }),
123
- !hasMore && currentDataSource.length > 0 && infiniteScroll && /* @__PURE__ */ jsx("div", { className: "text-center py-2 border-t border-gray-200 text-gray-500 text-xs", children: "Đã hiển thị tất cả dữ liệu" })
124
- ] }),
99
+ /* @__PURE__ */ jsxs(
100
+ "div",
101
+ {
102
+ className: twMerge("overflow-x-hidden w-full", customeContainerTable),
103
+ children: [
104
+ /* @__PURE__ */ jsx(
105
+ Table,
106
+ {
107
+ className: twMerge(
108
+ `select-single-table-custom ${customeContentTable}`
109
+ ),
110
+ columns,
111
+ dataSource: currentDataSource,
112
+ rowKey,
113
+ size: tableProps.size || "small",
114
+ pagination: false,
115
+ scroll: { y: 400 },
116
+ style: { overflowX: "hidden" },
117
+ loading: false,
118
+ onScroll: handleScroll,
119
+ onRow: (record) => ({
120
+ onClick: () => handleRowClick(record),
121
+ className: selectedKey === (typeof rowKey === "function" ? rowKey(record) : record[rowKey]) ? "ant-table-row-selected" : ""
122
+ }),
123
+ ...tableProps
124
+ }
125
+ ),
126
+ (internalLoading || loading) && /* @__PURE__ */ jsxs("div", { className: "text-center py-2 border-t border-gray-200", children: [
127
+ /* @__PURE__ */ jsx(Spin, { size: "small" }),
128
+ " Đang tải thêm..."
129
+ ] }),
130
+ !hasMore && currentDataSource.length > 0 && infiniteScroll && /* @__PURE__ */ jsx("div", { className: "text-center py-2 border-t border-gray-200 text-gray-500 text-xs", children: "Đã hiển thị tất cả dữ liệu" })
131
+ ]
132
+ }
133
+ ),
125
134
  /* @__PURE__ */ jsxs("div", { className: "mt-2 p-2 border-t border-gray-200 text-xs text-gray-600", children: [
126
135
  selectedKey ? `Đã chọn: 1 mục` : "Chưa chọn mục nào",
127
136
  " | Tổng:",
@@ -1,6 +1,7 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { Select, Table, Spin } from 'antd';
3
3
  import { useState, useCallback } from 'react';
4
+ import { t as twMerge } from '../chunks/bundle-mjs-BME7zF0Z.js';
4
5
 
5
6
  const SelectTable = ({
6
7
  columns,
@@ -18,6 +19,8 @@ const SelectTable = ({
18
19
  searchPlaceholder = "Tìm kiếm...",
19
20
  displayField = "",
20
21
  selectedRows = [],
22
+ customeContentTable = "",
23
+ customeContainerTable = "",
21
24
  ...selectProps
22
25
  }) => {
23
26
  const [open, setOpen] = useState(false);
@@ -93,11 +96,11 @@ const SelectTable = ({
93
96
  }
94
97
  setOpen(visible);
95
98
  };
96
- const dropdownRender = () => /* @__PURE__ */ jsx("div", { className: "select-table-dropdown", children: /* @__PURE__ */ jsxs("div", { className: "overflow-x-hidden w-full", children: [
99
+ const dropdownRender = () => /* @__PURE__ */ jsx("div", { className: "select-table-dropdown", children: /* @__PURE__ */ jsxs("div", { className: twMerge("overflow-x-hidden w-full", customeContainerTable), children: [
97
100
  /* @__PURE__ */ jsx(
98
101
  Table,
99
102
  {
100
- className: "select-table-custom",
103
+ className: twMerge("select-table-custom", customeContentTable),
101
104
  rowSelection,
102
105
  columns,
103
106
  dataSource: currentDataSource,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pnkx-lib/ui",
3
3
  "private": false,
4
- "version": "1.9.395",
4
+ "version": "1.9.396",
5
5
  "type": "module",
6
6
  "main": "./es/index.js",
7
7
  "module": "./es/index.js",
@@ -19,6 +19,7 @@ export interface SelectSingleTableProps<T = Record<string, unknown>> extends Omi
19
19
  loadMoreThreshold?: number;
20
20
  searchPlaceholder?: string;
21
21
  displayField: string;
22
- customeClassTable?: string;
22
+ customeContentTable?: string;
23
+ customeContainerTable?: string;
23
24
  }
24
- export declare const SelectSingleTable: <T>({ columns, dataSource, selectedKey, selectedRow, onSelectionChange, onLoadMore, onSearch, hasMore, loading, rowKey, tableProps, infiniteScroll, loadMoreThreshold, searchPlaceholder, displayField, customeClassTable, ...selectProps }: SelectSingleTableProps<T>) => import("react/jsx-runtime").JSX.Element;
25
+ export declare const SelectSingleTable: <T>({ columns, dataSource, selectedKey, selectedRow, onSelectionChange, onLoadMore, onSearch, hasMore, loading, rowKey, tableProps, infiniteScroll, loadMoreThreshold, searchPlaceholder, displayField, customeContentTable, customeContainerTable, ...selectProps }: SelectSingleTableProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -19,5 +19,7 @@ export interface SelectTableProps<T = Record<string, unknown>> extends Omit<Sele
19
19
  searchPlaceholder?: string;
20
20
  displayField?: string;
21
21
  selectedRows?: T[];
22
+ customeContentTable?: string;
23
+ customeContainerTable?: string;
22
24
  }
23
- export declare const SelectTable: <T>({ columns, dataSource, selectedKeys, onSelectionChange, onLoadMore, onSearch, hasMore, loading, rowKey, tableProps, infiniteScroll, loadMoreThreshold, searchPlaceholder, displayField, selectedRows, ...selectProps }: SelectTableProps<T>) => import("react/jsx-runtime").JSX.Element;
25
+ export declare const SelectTable: <T>({ columns, dataSource, selectedKeys, onSelectionChange, onLoadMore, onSearch, hasMore, loading, rowKey, tableProps, infiniteScroll, loadMoreThreshold, searchPlaceholder, displayField, selectedRows, customeContentTable, customeContainerTable, ...selectProps }: SelectTableProps<T>) => import("react/jsx-runtime").JSX.Element;