@pnkx-lib/ui 1.9.559 → 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.
Files changed (44) hide show
  1. package/dist/style.css +2 -2
  2. package/es/chunks/{bundle-mjs-BME7zF0Z.js → bundle-mjs-BBFHkixS.js} +1 -1
  3. package/es/chunks/{index.esm-Dr5ZHcf7.js → index.esm-Ds4t-z37.js} +3 -6
  4. package/es/chunks/{toArray-GtzhUyP3.js → toArray-7SKWyzWi.js} +79 -67
  5. package/es/fields/CascaderField.js +1 -1
  6. package/es/fields/Checkbox.js +1 -1
  7. package/es/fields/DatePicker.js +1 -1
  8. package/es/fields/DateRangePicker.js +1 -1
  9. package/es/fields/Input.js +1 -1
  10. package/es/fields/InputRangePicker.js +1 -1
  11. package/es/fields/PnkxField.js +1 -1
  12. package/es/fields/Select.js +1 -1
  13. package/es/fields/SliderRanger.js +1 -1
  14. package/es/fields/SliderSingle.js +1 -1
  15. package/es/fields/Switch.js +1 -1
  16. package/es/fields/Textarea.js +1 -1
  17. package/es/fields/TimePicker.js +1 -1
  18. package/es/fields/TimeRangePicker.js +1 -1
  19. package/es/fields/TinyMCE.js +17 -36
  20. package/es/ui/BulkActions/index.js +1 -1
  21. package/es/ui/Button.js +1 -1
  22. package/es/ui/Cascader.js +1 -1
  23. package/es/ui/CategoryStatus.js +1 -1
  24. package/es/ui/ClinicalStatus.js +1 -1
  25. package/es/ui/Clock/index.js +1 -1
  26. package/es/ui/Container.js +1 -1
  27. package/es/ui/CustomeBulkActions/index.js +1 -1
  28. package/es/ui/Descriptions.js +1 -1
  29. package/es/ui/GenericUploadModal.js +575 -637
  30. package/es/ui/Label.js +1 -1
  31. package/es/ui/Layout.js +30 -33
  32. package/es/ui/Modal.js +1 -1
  33. package/es/ui/PriceStatus.js +1 -1
  34. package/es/ui/SearchFilterForm.js +1 -1
  35. package/es/ui/SelectSingleTable.js +14 -2
  36. package/es/ui/SelectTable.js +1 -1
  37. package/es/ui/Sidebar/index.js +1 -1
  38. package/es/ui/TableCategory/index.js +2 -2
  39. package/es/ui/TableForm/index.js +1 -1
  40. package/es/ui/Tabs.js +2 -2
  41. package/es/ui/UploadComponent.js +1 -1
  42. package/es/ui/UploadImage.js +1 -1
  43. package/package.json +1 -1
  44. package/types/components/ui/SelectSingleTable.d.ts +1 -1
package/es/ui/Label.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
- import { t as twMerge } from '../chunks/bundle-mjs-BME7zF0Z.js';
2
+ import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
3
3
  import { Typography } from './Typography.js';
4
4
 
5
5
  const Label = ({ label, required, classNameLabel, isSubLabel }) => {
package/es/ui/Layout.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
- import { g as genStyleHooks, u as unit, C as ConfigContext, o as omit, t as toArray, a as useComponentConfig, _ as _toConsumableArray } from '../chunks/toArray-GtzhUyP3.js';
2
+ import { g as genStyleHooks, u as unit, C as ConfigContext, o as omit, t as toArray, a as useComponentConfig, _ as _toConsumableArray } from '../chunks/toArray-7SKWyzWi.js';
3
3
  import * as React from 'react';
4
4
  import { useContext, useState, useEffect, useRef } from 'react';
5
5
  import { c as classNames } from '../chunks/index-xdC7i8zM.js';
@@ -60,23 +60,6 @@ const LayoutContext = /*#__PURE__*/React.createContext({
60
60
  }
61
61
  });
62
62
 
63
- const addMediaQueryListener = (mql, handler) => {
64
- // Don't delete here, please keep the code compatible
65
- if (typeof (mql === null || mql === void 0 ? void 0 : mql.addEventListener) !== 'undefined') {
66
- mql.addEventListener('change', handler);
67
- } else if (typeof (mql === null || mql === void 0 ? void 0 : mql.addListener) !== 'undefined') {
68
- mql.addListener(handler);
69
- }
70
- };
71
- const removeMediaQueryListener = (mql, handler) => {
72
- // Don't delete here, please keep the code compatible
73
- if (typeof (mql === null || mql === void 0 ? void 0 : mql.removeEventListener) !== 'undefined') {
74
- mql.removeEventListener('change', handler);
75
- } else if (typeof (mql === null || mql === void 0 ? void 0 : mql.removeListener) !== 'undefined') {
76
- mql.removeListener(handler);
77
- }
78
- };
79
-
80
63
  const genLayoutStyle = token => {
81
64
  const {
82
65
  antCls,
@@ -185,7 +168,7 @@ const prepareComponentToken = token => {
185
168
  };
186
169
  // ============================== Export ==============================
187
170
  const DEPRECATED_TOKENS = [['colorBgBody', 'bodyBg'], ['colorBgHeader', 'headerBg'], ['colorBgTrigger', 'triggerBg']];
188
- const useStyle$1 = genStyleHooks('Layout', genLayoutStyle, prepareComponentToken, {
171
+ const useStyle$1 = genStyleHooks('Layout', token => [genLayoutStyle(token)], prepareComponentToken, {
189
172
  deprecatedTokens: DEPRECATED_TOKENS
190
173
  });
191
174
 
@@ -296,7 +279,7 @@ const genSiderStyle = token => {
296
279
  }
297
280
  };
298
281
  };
299
- const useStyle = genStyleHooks(['Layout', 'Sider'], genSiderStyle, prepareComponentToken, {
282
+ const useStyle = genStyleHooks(['Layout', 'Sider'], token => [genSiderStyle(token)], prepareComponentToken, {
300
283
  deprecatedTokens: DEPRECATED_TOKENS
301
284
  });
302
285
 
@@ -320,7 +303,8 @@ const isNumeric = value => !Number.isNaN(Number.parseFloat(value)) && isFinite(v
320
303
  const SiderContext = /*#__PURE__*/React.createContext({});
321
304
  const generateId = (() => {
322
305
  let i = 0;
323
- return (prefix = '') => {
306
+ return function () {
307
+ let prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
324
308
  i += 1;
325
309
  return `${prefix}${i}`;
326
310
  };
@@ -378,17 +362,29 @@ const Sider = /*#__PURE__*/React.forwardRef((props, ref) => {
378
362
  };
379
363
  useEffect(() => {
380
364
  function responsiveHandler(mql) {
381
- var _a;
382
- return (_a = responsiveHandlerRef.current) === null || _a === void 0 ? void 0 : _a.call(responsiveHandlerRef, mql);
365
+ return responsiveHandlerRef.current(mql);
383
366
  }
384
367
  let mql;
385
- if (typeof (window === null || window === void 0 ? void 0 : window.matchMedia) !== 'undefined' && breakpoint && breakpoint in dimensionMaxMap) {
386
- mql = window.matchMedia(`screen and (max-width: ${dimensionMaxMap[breakpoint]})`);
387
- addMediaQueryListener(mql, responsiveHandler);
388
- responsiveHandler(mql);
368
+ if (typeof window !== 'undefined') {
369
+ const {
370
+ matchMedia
371
+ } = window;
372
+ if (matchMedia && breakpoint && breakpoint in dimensionMaxMap) {
373
+ mql = matchMedia(`screen and (max-width: ${dimensionMaxMap[breakpoint]})`);
374
+ try {
375
+ mql.addEventListener('change', responsiveHandler);
376
+ } catch (_a) {
377
+ mql.addListener(responsiveHandler);
378
+ }
379
+ responsiveHandler(mql);
380
+ }
389
381
  }
390
382
  return () => {
391
- removeMediaQueryListener(mql, responsiveHandler);
383
+ try {
384
+ mql === null || mql === void 0 ? void 0 : mql.removeEventListener('change', responsiveHandler);
385
+ } catch (_a) {
386
+ mql === null || mql === void 0 ? void 0 : mql.removeListener(responsiveHandler);
387
+ }
392
388
  };
393
389
  }, [breakpoint]); // in order to accept dynamic 'breakpoint' property, we need to add 'breakpoint' into dependency array.
394
390
  useEffect(() => {
@@ -472,11 +468,12 @@ var __rest = undefined && undefined.__rest || function (s, e) {
472
468
  }
473
469
  return t;
474
470
  };
475
- function generator({
476
- suffixCls,
477
- tagName,
478
- displayName
479
- }) {
471
+ function generator(_ref) {
472
+ let {
473
+ suffixCls,
474
+ tagName,
475
+ displayName
476
+ } = _ref;
480
477
  return BasicComponent => {
481
478
  const Adapter = /*#__PURE__*/React.forwardRef((props, ref) => (/*#__PURE__*/React.createElement(BasicComponent, Object.assign({
482
479
  ref: ref,
package/es/ui/Modal.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { Modal as Modal$1 } from 'antd';
3
- import { t as twMerge } from '../chunks/bundle-mjs-BME7zF0Z.js';
3
+ import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
4
4
 
5
5
  const widthMap = {
6
6
  xs: 400,
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
- import { t as twMerge } from '../chunks/bundle-mjs-BME7zF0Z.js';
2
+ import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
3
3
 
4
4
  var CATEGORY_PRICE_ENUM = /* @__PURE__ */ ((CATEGORY_PRICE_ENUM2) => {
5
5
  CATEGORY_PRICE_ENUM2[CATEGORY_PRICE_ENUM2["CREATE"] = 0] = "CREATE";
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
- import { u as useForm } from '../chunks/index.esm-Dr5ZHcf7.js';
2
+ import { u as useForm } from '../chunks/index.esm-Ds4t-z37.js';
3
3
  import { Button } from './Button.js';
4
4
  import { I as Icon, _ as _extends } from '../chunks/AntdIcon-KP2HuB_x.js';
5
5
  import * as React from 'react';
@@ -1,7 +1,7 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { Select, Table } from 'antd';
3
- import { useState, useRef, useCallback } from 'react';
4
- import { t as twMerge } from '../chunks/bundle-mjs-BME7zF0Z.js';
3
+ import { useState, useRef, useCallback, useEffect } from 'react';
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';
7
7
  import { ErrorMessage } from './ErrorMessage.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
  {
@@ -1,7 +1,7 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { Select, Table } from 'antd';
3
3
  import { useState, useCallback } from 'react';
4
- import { t as twMerge } from '../chunks/bundle-mjs-BME7zF0Z.js';
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 { ErrorMessage } from './ErrorMessage.js';
7
7
  import { Label } from './Label.js';
@@ -5,7 +5,7 @@ import { useLocation, useNavigate } from 'react-router';
5
5
  import { Flex, AutoComplete, Divider, ConfigProvider, Dropdown } from 'antd';
6
6
  import { Layout } from '../Layout.js';
7
7
  import { Input } from '../../fields/Input.js';
8
- import { t as twMerge } from '../../chunks/bundle-mjs-BME7zF0Z.js';
8
+ import { t as twMerge } from '../../chunks/bundle-mjs-BBFHkixS.js';
9
9
  import { R as RefIcon$2 } from '../../chunks/DownOutlined-Cl95zPIN.js';
10
10
  import { I as Icon, _ as _extends } from '../../chunks/AntdIcon-KP2HuB_x.js';
11
11
 
@@ -1,10 +1,10 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import React__default, { useLayoutEffect, useEffect, useRef, useMemo, useCallback, useState, memo, useReducer, createContext, useContext } from 'react';
3
- import { u as useForm } from '../../chunks/index.esm-Dr5ZHcf7.js';
3
+ import { u as useForm } from '../../chunks/index.esm-Ds4t-z37.js';
4
4
  import { Checkbox } from '../../fields/Checkbox.js';
5
5
  import { PnkxField } from '../../fields/PnkxField.js';
6
6
  import { unstable_batchedUpdates, createPortal } from 'react-dom';
7
- import { t as twMerge } from '../../chunks/bundle-mjs-BME7zF0Z.js';
7
+ import { t as twMerge } from '../../chunks/bundle-mjs-BBFHkixS.js';
8
8
  import { Modal } from '../Modal.js';
9
9
  import { Button } from '../Button.js';
10
10
  import { L as ListStatusApproved, d as TypeBulkActions } from '../../chunks/table-CIEieGXp.js';
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { Button, Typography, Divider, Tag, Table } from '@pnkx-lib/ui';
3
- import { t as twMerge } from '../../chunks/bundle-mjs-BME7zF0Z.js';
3
+ import { t as twMerge } from '../../chunks/bundle-mjs-BBFHkixS.js';
4
4
  import { g as getDefaultExportFromCjs } from '../../chunks/_commonjsHelpers-D5KtpA0t.js';
5
5
  import { r as requireIsObjectLike, a as requireIsArray, b as require_baseGetTag } from '../../chunks/isArray-DNoLuxS1.js';
6
6
  import { R as RemoveIconColor } from '../../chunks/table-CIEieGXp.js';
package/es/ui/Tabs.js CHANGED
@@ -29,8 +29,8 @@ const identity = (arg) => arg;
29
29
  function useStore(api, selector = identity) {
30
30
  const slice = React__default.useSyncExternalStore(
31
31
  api.subscribe,
32
- React__default.useCallback(() => selector(api.getState()), [api, selector]),
33
- React__default.useCallback(() => selector(api.getInitialState()), [api, selector])
32
+ () => selector(api.getState()),
33
+ () => selector(api.getInitialState())
34
34
  );
35
35
  React__default.useDebugValue(slice);
36
36
  return slice;
@@ -1,7 +1,7 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { Upload, Image, Tooltip } from 'antd';
3
3
  import { Spin } from './Spin.js';
4
- import { t as twMerge } from '../chunks/bundle-mjs-BME7zF0Z.js';
4
+ import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
5
5
  import { Label } from './Label.js';
6
6
  import { R as RefIcon } from '../chunks/CloseOutlined-DdLJZQvZ.js';
7
7
 
@@ -1,5 +1,5 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
- import { C as Controller } from '../chunks/index.esm-Dr5ZHcf7.js';
2
+ import { C as Controller } from '../chunks/index.esm-Ds4t-z37.js';
3
3
  import { UploadComponent } from './UploadComponent.js';
4
4
 
5
5
  const UploadImage = ({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pnkx-lib/ui",
3
3
  "private": false,
4
- "version": "1.9.559",
4
+ "version": "1.9.560",
5
5
  "type": "module",
6
6
  "main": "./es/index.js",
7
7
  "module": "./es/index.js",
@@ -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;