@pnkx-lib/ui 1.9.495 → 1.9.497

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.
@@ -13,6 +13,7 @@ import { R as RefIcon$7 } from './LoadingOutlined-DCtDXz9K.js';
13
13
  import { R as RefIcon$8, a as RefIcon$a } from './CloseCircleFilled-Bo29sDEQ.js';
14
14
  import { R as RefIcon$9 } from './CloseOutlined-CZUJ_3tW.js';
15
15
  import { C as Controller } from './index.esm-Dr5ZHcf7.js';
16
+ import { toast } from '@pnkx-lib/core';
16
17
  import { R as RefIcon$b } from './InboxOutlined-BBuIJe6u.js';
17
18
 
18
19
  // This icon file is generated automatically.
@@ -11481,7 +11482,8 @@ function GenericUploadModal({
11481
11482
  texts,
11482
11483
  setFileList,
11483
11484
  fileList,
11484
- trans
11485
+ trans,
11486
+ onDeleteFile
11485
11487
  }) {
11486
11488
  const [displayFileList, setDisplayFileList] = useState(fileList);
11487
11489
  const [listFileId, setListFileId] = useState([]);
@@ -11503,6 +11505,13 @@ function GenericUploadModal({
11503
11505
  showUploadList: true,
11504
11506
  fileList: displayFileList,
11505
11507
  beforeUpload: (file) => {
11508
+ const MAX_FILE_SIZE = 5 * 1024 * 1024;
11509
+ if (file.size > MAX_FILE_SIZE && texts?.fileSizeError) {
11510
+ toast.warning(
11511
+ trans("categoryModernMedicine:fileError", { name: file.name })
11512
+ );
11513
+ return Upload$2.LIST_IGNORE;
11514
+ }
11506
11515
  const newFile = {
11507
11516
  uid: file.uid,
11508
11517
  name: file.name,
@@ -11543,6 +11552,14 @@ function GenericUploadModal({
11543
11552
  }
11544
11553
  });
11545
11554
  const handleSubmitDeleteFile = async () => {
11555
+ if (listFileId.length > 0) {
11556
+ try {
11557
+ onDeleteFile(listFileId);
11558
+ } catch (error) {
11559
+ onCancel();
11560
+ console.log("error", error);
11561
+ }
11562
+ }
11546
11563
  onCancel();
11547
11564
  };
11548
11565
  return /* @__PURE__ */ jsx(
package/es/index.js CHANGED
@@ -65,7 +65,7 @@ export { ViewPdf } from './ui/ViewPdf.js';
65
65
  export { Sidebar } from './ui/Sidebar/index.js';
66
66
  export { SelectTable } from './ui/SelectTable.js';
67
67
  export { SelectSingleTable } from './ui/SelectSingleTable.js';
68
- export { G as GenericUploadModal } from './chunks/GenericUploadModal-DlXxiQ6N.js';
68
+ export { G as GenericUploadModal } from './chunks/GenericUploadModal-DZ5QrHqG.js';
69
69
  export { Descriptions } from './ui/Descriptions.js';
70
70
  export { Input } from './fields/Input.js';
71
71
  export { PnkxField } from './fields/PnkxField.js';
@@ -1,6 +1,7 @@
1
1
  import 'react/jsx-runtime';
2
2
  import 'antd';
3
- export { G as GenericUploadModal } from '../chunks/GenericUploadModal-DlXxiQ6N.js';
3
+ export { G as GenericUploadModal } from '../chunks/GenericUploadModal-DZ5QrHqG.js';
4
4
  import '../chunks/index.esm-Dr5ZHcf7.js';
5
5
  import 'react';
6
+ import '@pnkx-lib/core';
6
7
  import '../chunks/InboxOutlined-BBuIJe6u.js';
package/es/ui/Tabs.js CHANGED
@@ -23,7 +23,7 @@ const createStoreImpl = (createState) => {
23
23
  const initialState = state = createState(setState, getState, api);
24
24
  return api;
25
25
  };
26
- const createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
26
+ const createStore = ((createState) => createState ? createStoreImpl(createState) : createStoreImpl);
27
27
 
28
28
  const identity = (arg) => arg;
29
29
  function useStore(api, selector = identity) {
@@ -41,7 +41,7 @@ const createImpl = (createState) => {
41
41
  Object.assign(useBoundStore, api);
42
42
  return useBoundStore;
43
43
  };
44
- const create = (createState) => createState ? createImpl(createState) : createImpl;
44
+ const create = ((createState) => createState ? createImpl(createState) : createImpl);
45
45
 
46
46
  const useTabStore = create((set) => ({
47
47
  activeTabKey: void 0,
package/es/ui/index.js CHANGED
@@ -64,8 +64,8 @@ import { r as requireClassnames, c as classNames } from '../chunks/index-BLRvgOF
64
64
  import { F as FastColor, m as blue, n as blueDark, o as cyan, q as cyanDark, s as geekblue, t as geekblueDark, i as generate, v as gold, x as goldDark, y as gray, z as green, A as greenDark, B as grey, C as greyDark, D as lime, E as limeDark, G as magenta, H as magentaDark, J as orange, K as orangeDark, L as presetDarkPalettes, j as presetPalettes, p as presetPrimaryColors, M as purple, N as purpleDark, O as red, P as redDark, Q as volcano, R as volcanoDark, S as yellow, T as yellowDark, c as _slicedToArray, b as _objectSpread2, w as warningOnce, a as _objectWithoutProperties, _ as _extends$1 } from '../chunks/AntdIcon-Bve8mGNz.js';
65
65
  import { b as _defineProperty, _ as _typeof$1 } from '../chunks/defineProperty-CTLrw71t.js';
66
66
  import { z as lintWarning, A as toStyleStr, B as ATTR_CACHE_MAP, E as serialize, F as extract, G as CSS_VAR_PREFIX, H as STYLE_PREFIX, I as extract$1, T as TOKEN_PREFIX, J as extract$2, K as unitlessKeys, M as supportWhere, N as supportLogicProps, O as StyleContext, P as StyleProvider, Q as Theme, R as createCache, U as createTheme, V as getComputedToken, W as token2CSSVar, u as unit$1, X as useCSSVarRegister, Y as useCacheToken, Z as useStyleRegister, $ as genCalc$1, a0 as genStyleUtils$1, m as merge, a1 as statistic, a2 as statisticToken, a3 as MotionProvider, _ as _toConsumableArray, a4 as merge$1, a5 as get$1, a6 as set$1, a7 as isEqual$1, t as toArray$3 } from '../chunks/toArray-2LkvUaha.js';
67
- import { K as Keyframe, C as CSSMotion, a as CSSMotionList, T as Tooltip, P as Popup, _ as _asyncToGenerator, b as _regeneratorRuntime, c as Color, u as useEvent$2, d as useMergedState$1, r as requireReactIs, p as pickAttrs } from '../chunks/GenericUploadModal-DlXxiQ6N.js';
68
- export { G as GenericUploadModal } from '../chunks/GenericUploadModal-DlXxiQ6N.js';
67
+ import { K as Keyframe, C as CSSMotion, a as CSSMotionList, T as Tooltip, P as Popup, _ as _asyncToGenerator, b as _regeneratorRuntime, c as Color, u as useEvent$2, d as useMergedState$1, r as requireReactIs, p as pickAttrs } from '../chunks/GenericUploadModal-DZ5QrHqG.js';
68
+ export { G as GenericUploadModal } from '../chunks/GenericUploadModal-DZ5QrHqG.js';
69
69
  import { _ as _createClass, a as _classCallCheck, b as _inherits, c as _createSuper, d as _assertThisInitialized, e as _isNativeReflectConstruct, f as _setPrototypeOf, g as _getPrototypeOf } from '../chunks/createSuper-C9_dQ5Zr.js';
70
70
  import ReactDOM__default, { unstable_batchedUpdates, createPortal } from 'react-dom';
71
71
  import { isEmpty, isBoolean } from 'lodash';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pnkx-lib/ui",
3
3
  "private": false,
4
- "version": "1.9.495",
4
+ "version": "1.9.497",
5
5
  "type": "module",
6
6
  "main": "./es/index.js",
7
7
  "module": "./es/index.js",
@@ -10,6 +10,7 @@ export interface GenericUploadModalProps {
10
10
  uid: string;
11
11
  fileName: string;
12
12
  }>;
13
+ onDeleteFile: (values: string[]) => void;
13
14
  setFileList: (value: any) => void;
14
15
  allowedExtensions: string[];
15
16
  maxSize?: number;
@@ -26,4 +27,4 @@ export interface GenericUploadModalProps {
26
27
  uploading?: string;
27
28
  };
28
29
  }
29
- export declare function GenericUploadModal({ open, onCancel, control, record, texts, setFileList, fileList, trans, }: GenericUploadModalProps): import("react/jsx-runtime").JSX.Element;
30
+ export declare function GenericUploadModal({ open, onCancel, control, record, texts, setFileList, fileList, trans, onDeleteFile, }: GenericUploadModalProps): import("react/jsx-runtime").JSX.Element;
@@ -31,7 +31,7 @@ export interface TableCommonProps<T> extends Omit<TableProps<T>, "columns"> {
31
31
  size?: SizeType;
32
32
  defaultEllipsis?: boolean;
33
33
  handleSubmit?: FormEventHandler<any>;
34
- noPagination?: boolean;
34
+ noPagination: boolean;
35
35
  customPagination?: React.ReactNode;
36
36
  }
37
37
  export declare const Table: <T>({ dataSource, columns, loading, totalItems, filters, onChangePage, onChangePageSize, onSort, rowsSelected, onSelect, onRowClick, rowKey, showIndexColumn, size, defaultEllipsis, onDoubleClickRow, handleSubmit, customPagination, noPagination, ...rest }: TableCommonProps<T>) => import("react/jsx-runtime").JSX.Element;