@pnkx-lib/ui 1.9.558 → 1.9.560
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Select, Table } from 'antd';
|
|
3
|
-
import { useState, useRef, useCallback } from 'react';
|
|
3
|
+
import { useState, useRef, useCallback, useEffect } from 'react';
|
|
4
4
|
import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
|
|
5
5
|
import { g as get } from '../chunks/get-BtGVDpFp.js';
|
|
6
6
|
import { i as isEmpty } from '../chunks/isEmpty-DF7aUYTo.js';
|
|
@@ -31,6 +31,7 @@ const SelectSingleTable = ({
|
|
|
31
31
|
label,
|
|
32
32
|
required,
|
|
33
33
|
classNameLabel,
|
|
34
|
+
defaultValue,
|
|
34
35
|
...selectProps
|
|
35
36
|
}) => {
|
|
36
37
|
const [open, setOpen] = useState(false);
|
|
@@ -145,6 +146,16 @@ const SelectSingleTable = ({
|
|
|
145
146
|
setSearchValue("");
|
|
146
147
|
}
|
|
147
148
|
};
|
|
149
|
+
useEffect(() => {
|
|
150
|
+
if (defaultValue && onChange) {
|
|
151
|
+
onChange({
|
|
152
|
+
target: {
|
|
153
|
+
name,
|
|
154
|
+
value: defaultValue
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
}, [defaultValue]);
|
|
148
159
|
const dropdownRender = () => /* @__PURE__ */ jsx("div", { className: "select-single-table-dropdown", children: /* @__PURE__ */ jsx(
|
|
149
160
|
"div",
|
|
150
161
|
{
|
|
@@ -173,6 +184,7 @@ const SelectSingleTable = ({
|
|
|
173
184
|
)
|
|
174
185
|
}
|
|
175
186
|
) });
|
|
187
|
+
console.log(getDisplayValue());
|
|
176
188
|
return /* @__PURE__ */ jsxs(
|
|
177
189
|
"div",
|
|
178
190
|
{
|
package/package.json
CHANGED
|
@@ -33,4 +33,4 @@ export interface SelectSingleTableProps<T = Record<string, unknown>> extends Omi
|
|
|
33
33
|
classNameContainer?: string;
|
|
34
34
|
classNameLabel?: string;
|
|
35
35
|
}
|
|
36
|
-
export declare const SelectSingleTable: <T>({ columns, dataSource, selectedKey, selectedRow, onSelectionChange, onLoadMore, onSearch, hasMore, loading, rowKey, tableProps, infiniteScroll, loadMoreThreshold, searchPlaceholder, displayField, customeContentTable, customeContainerTable, field, formState, classNameContainer, label, required, classNameLabel, ...selectProps }: SelectSingleTableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export declare const SelectSingleTable: <T>({ columns, dataSource, selectedKey, selectedRow, onSelectionChange, onLoadMore, onSearch, hasMore, loading, rowKey, tableProps, infiniteScroll, loadMoreThreshold, searchPlaceholder, displayField, customeContentTable, customeContainerTable, field, formState, classNameContainer, label, required, classNameLabel, defaultValue, ...selectProps }: SelectSingleTableProps<T>) => import("react/jsx-runtime").JSX.Element;
|