@pnkx-lib/ui 1.9.565 → 1.9.567

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 (43) 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-AaUjBMaK.js → index.esm-Ds4t-z37.js} +90 -55
  4. package/es/chunks/{toArray-DACIS0E1.js → toArray-7SKWyzWi.js} +44 -42
  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 +16 -35
  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 +540 -578
  30. package/es/ui/Label.js +1 -1
  31. package/es/ui/Layout.js +28 -31
  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 +1 -1
  36. package/es/ui/SelectTable.js +10 -6
  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/UploadComponent.js +1 -1
  41. package/es/ui/UploadImage.js +1 -1
  42. package/es/ui/index.js +3 -3
  43. package/package.json +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-DACIS0E1.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,
@@ -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-AaUjBMaK.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
3
  import { useState, useRef, useCallback, useEffect } 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 { i as isEmpty } from '../chunks/isEmpty-DF7aUYTo.js';
7
7
  import { ErrorMessage } from './ErrorMessage.js';
@@ -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';
@@ -167,18 +167,22 @@ const SelectTable = ({
167
167
  setOpen(visible);
168
168
  };
169
169
  const handleRowClick = (record) => {
170
+ const key = typeof rowKey === "function" ? rowKey(record) : record[rowKey];
171
+ if (currentSelectedKeys.includes(key)) {
172
+ return;
173
+ }
170
174
  {
171
- const key = typeof rowKey === "function" ? rowKey(record) : record[rowKey];
172
- const isSelected = currentSelectedKeys.includes(key);
175
+ const key2 = typeof rowKey === "function" ? rowKey(record) : record[rowKey];
176
+ const isSelected = currentSelectedKeys.includes(key2);
173
177
  if (isSelected) {
174
- const newSelectedKeys = currentSelectedKeys.filter((k) => k !== key);
178
+ const newSelectedKeys = currentSelectedKeys.filter((k) => k !== key2);
175
179
  const newSelectedRows = value?.filter((row) => {
176
180
  const rowKeyValue = typeof rowKey === "function" ? rowKey(row) : row[rowKey];
177
- return rowKeyValue !== key;
181
+ return rowKeyValue !== key2;
178
182
  }) || [];
179
183
  onSelectChange(newSelectedKeys, newSelectedRows);
180
184
  } else {
181
- const newSelectedKeys = [...currentSelectedKeys, key];
185
+ const newSelectedKeys = [...currentSelectedKeys, key2];
182
186
  const newSelectedRows = [...value || [], record];
183
187
  onSelectChange(newSelectedKeys, newSelectedRows);
184
188
  }
@@ -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-AaUjBMaK.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';
@@ -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-AaUjBMaK.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/es/ui/index.js CHANGED
@@ -230,7 +230,7 @@ const ViewIcon = ({
230
230
  );
231
231
 
232
232
  const TrashCanIcon = ({
233
- size = 20,
233
+ size = 18,
234
234
  color = "currentColor",
235
235
  className,
236
236
  style,
@@ -258,13 +258,13 @@ const TrashCanIcon = ({
258
258
  {
259
259
  width: "100%",
260
260
  height: "100%",
261
- viewBox: "0 0 20 20",
261
+ viewBox: "0 0 24 24",
262
262
  fill: "none",
263
263
  xmlns: "http://www.w3.org/2000/svg",
264
264
  children: /* @__PURE__ */ jsx(
265
265
  "path",
266
266
  {
267
- d: "M15.7438 15.0298L16.4938 15.0365L15.7438 15.0298ZM3.33334 4.25002C2.91913 4.25002 2.58334 4.58581 2.58334 5.00002C2.58334 5.41423 2.91913 5.75002 3.33334 5.75002V5.00002V4.25002ZM16.6667 5.75002C17.0809 5.75002 17.4167 5.41423 17.4167 5.00002C17.4167 4.58581 17.0809 4.25002 16.6667 4.25002V5.00002V5.75002ZM9.08334 8.33335C9.08334 7.91914 8.74756 7.58335 8.33334 7.58335C7.91913 7.58335 7.58334 7.91914 7.58334 8.33335H8.33334H9.08334ZM7.58334 15C7.58334 15.4142 7.91913 15.75 8.33334 15.75C8.74756 15.75 9.08334 15.4142 9.08334 15H8.33334H7.58334ZM12.4167 8.33335C12.4167 7.91914 12.0809 7.58335 11.6667 7.58335C11.2525 7.58335 10.9167 7.91914 10.9167 8.33335H11.6667H12.4167ZM10.9167 15C10.9167 15.4142 11.2525 15.75 11.6667 15.75C12.0809 15.75 12.4167 15.4142 12.4167 15H11.6667H10.9167ZM15.8333 5.00002L15.0834 4.99332L14.9938 15.0231L15.7438 15.0298L16.4938 15.0365L16.5833 5.00672L15.8333 5.00002ZM12.4106 18.3334V17.5834H7.50001V18.3334V19.0834H12.4106V18.3334ZM4.16668 5.00002H3.41668V15H4.16668H4.91668V5.00002H4.16668ZM3.33334 5.00002V5.75002H4.16668V5.00002V4.25002H3.33334V5.00002ZM4.16668 5.00002V5.75002H6.66668V5.00002V4.25002H4.16668V5.00002ZM6.66668 5.00002V5.75002H13.3333V5.00002V4.25002H6.66668V5.00002ZM13.3333 5.00002V5.75002H15.8333V5.00002V4.25002H13.3333V5.00002ZM15.8333 5.00002V5.75002H16.6667V5.00002V4.25002H15.8333V5.00002ZM6.66668 4.62965H7.41668C7.41668 3.48807 8.48779 2.41669 10 2.41669V1.66669V0.916687C7.83033 0.916687 5.91668 2.49843 5.91668 4.62965H6.66668ZM10 1.66669V2.41669C11.5122 2.41669 12.5833 3.48807 12.5833 4.62965H13.3333H14.0833C14.0833 2.49843 12.1697 0.916687 10 0.916687V1.66669ZM6.66668 4.62965H5.91668V5.00002H6.66668H7.41668V4.62965H6.66668ZM13.3333 4.62965H12.5833V5.00002H13.3333H14.0833V4.62965H13.3333ZM7.50001 18.3334V17.5834C6.07327 17.5834 4.91668 16.4268 4.91668 15H4.16668H3.41668C3.41668 17.2552 5.24485 19.0834 7.50001 19.0834V18.3334ZM15.7438 15.0298L14.9938 15.0231C14.9812 16.4408 13.8283 17.5834 12.4106 17.5834V18.3334V19.0834C14.6515 19.0834 16.4738 17.2773 16.4938 15.0365L15.7438 15.0298ZM8.33334 8.33335H7.58334V15H8.33334H9.08334V8.33335H8.33334ZM11.6667 8.33335H10.9167V15H11.6667H12.4167V8.33335H11.6667Z",
267
+ d: "M18.8925 18.0357L19.3925 18.0402V18.0402L18.8925 18.0357ZM4 5.5C3.72386 5.5 3.5 5.72386 3.5 6C3.5 6.27614 3.72386 6.5 4 6.5V5.5ZM20 6.5C20.2761 6.5 20.5 6.27614 20.5 6C20.5 5.72386 20.2761 5.5 20 5.5V6.5ZM10.5 10C10.5 9.72386 10.2761 9.5 10 9.5C9.72386 9.5 9.5 9.72386 9.5 10H10.5ZM9.5 18C9.5 18.2761 9.72386 18.5 10 18.5C10.2761 18.5 10.5 18.2761 10.5 18H9.5ZM14.5 10C14.5 9.72386 14.2761 9.5 14 9.5C13.7239 9.5 13.5 9.72386 13.5 10H14.5ZM13.5 18C13.5 18.2761 13.7239 18.5 14 18.5C14.2761 18.5 14.5 18.2761 14.5 18H13.5ZM19 6L18.5 5.99554L18.3926 18.0312L18.8925 18.0357L19.3925 18.0402L19.5 6.00446L19 6ZM14.8927 22V21.5H9V22V22.5H14.8927V22ZM5 6H4.5V18H5H5.5V6H5ZM4 6V6.5H5V6V5.5H4V6ZM5 6V6.5H8V6V5.5H5V6ZM8 6V6.5H16V6V5.5H8V6ZM16 6V6.5H19V6V5.5H16V6ZM19 6V6.5H20V6V5.5H19V6ZM8 5.55556H8.5C8.5 3.92176 10.01 2.5 12 2.5V2V1.5C9.57171 1.5 7.5 3.262 7.5 5.55556H8ZM12 2V2.5C13.99 2.5 15.5 3.92176 15.5 5.55556H16H16.5C16.5 3.262 14.4283 1.5 12 1.5V2ZM8 5.55556H7.5V6H8H8.5V5.55556H8ZM16 5.55556H15.5V6H16H16.5V5.55556H16ZM9 22V21.5C7.067 21.5 5.5 19.933 5.5 18H5H4.5C4.5 20.4853 6.51472 22.5 9 22.5V22ZM18.8925 18.0357L18.3926 18.0312C18.3754 19.952 16.8135 21.5 14.8927 21.5V22V22.5C17.3623 22.5 19.3705 20.5097 19.3925 18.0402L18.8925 18.0357ZM10 10H9.5V18H10H10.5V10H10ZM14 10H13.5V18H14H14.5V10H14Z",
268
268
  fill: color || "#E0E0E0"
269
269
  }
270
270
  )
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pnkx-lib/ui",
3
3
  "private": false,
4
- "version": "1.9.565",
4
+ "version": "1.9.567",
5
5
  "type": "module",
6
6
  "main": "./es/index.js",
7
7
  "module": "./es/index.js",