@pnkx-lib/ui 1.8.1 → 1.8.3

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,4 +1,4 @@
1
- import { g as get, j as jsxRuntimeExports, L as Label, E as ErrorMessage, T as Typography } from './Switch-eMq9KkOy.js';
1
+ import { g as get, j as jsxRuntimeExports, L as Label, E as ErrorMessage, T as Typography } from './Switch-C3IZzn6L.js';
2
2
  import { Select as Select$1, Radio, Checkbox } from 'antd';
3
3
 
4
4
  const Select = (props) => {
@@ -1,4 +1,4 @@
1
- import { j as jsxRuntimeExports, b as Icon, _ as _extends, c as _typeof, u as useForm, P as PnkxField, I as Input, d as classNames, e as _arrayLikeToArray, f as _unsupportedIterableToArray, w as warningOnce, h as _createClass, i as _classCallCheck, k as _defineProperty, l as _slicedToArray, m as warning$1, n as canUseDom, o as _objectSpread2, p as updateCSS, r as removeCSS, q as _arrayWithHoles, s as _nonIterableRest, t as resetWarned$1, F as FastColor, v as generate, x as presetPrimaryColors, y as presetPalettes, z as _inherits, A as _createSuper, B as _assertThisInitialized, C as _objectWithoutProperties, G as IconContext } from './Switch-eMq9KkOy.js';
1
+ import { j as jsxRuntimeExports, b as Icon, _ as _extends, c as _typeof, u as useForm, P as PnkxField, I as Input, d as classNames, e as _arrayLikeToArray, f as _unsupportedIterableToArray, w as warningOnce, h as _createClass, i as _classCallCheck, k as _defineProperty, l as _slicedToArray, m as warning$1, n as canUseDom, o as _objectSpread2, p as updateCSS, r as removeCSS, q as _arrayWithHoles, s as _nonIterableRest, t as resetWarned$1, F as FastColor, v as generate, x as presetPrimaryColors, y as presetPalettes, z as _inherits, A as _createSuper, B as _assertThisInitialized, C as _objectWithoutProperties, G as IconContext } from './Switch-C3IZzn6L.js';
2
2
  import { Button as Button$1, Cascader, Space as Space$1, Card, Skeleton as Skeleton$1, Popconfirm as Popconfirm$1, Typography, Table as Table$1, Modal as Modal$1, Tooltip as Tooltip$1, Tabs as Tabs$1, Popover as Popover$1, Badge as Badge$1, Col as Col$1, Row as Row$1, Dropdown as Dropdown$1, Breadcrumb as Breadcrumb$1, Flex as Flex$1, Splitter as Splitter$1, Menu as Menu$1, Pagination as Pagination$1, Steps as Steps$1, Tag as Tag$1, Divider as Divider$2, Alert as Alert$1, Spin as Spin$1, Drawer as Drawer$1, QRCode as QRCode$1, Result as Result$1, Rate as Rate$1, Segmented as Segmented$1, Statistic as Statistic$1, Timeline as Timeline$1, Tour as Tour$1, Tree as Tree$1, Watermark as Watermark$1, Anchor as Anchor$1, Affix, AutoComplete as AutoComplete$1, Input as Input$1, Collapse, ColorPicker, Empty as Empty$2, Image as Image$1 } from 'antd';
3
3
  import * as React from 'react';
4
4
  import React__default, { version as version$1, isValidElement, useState, useEffect, useContext, createContext, useRef, useLayoutEffect as useLayoutEffect$1, useMemo as useMemo$1, Component } from 'react';
@@ -6158,7 +6158,7 @@ function genStyleUtils(config) {
6158
6158
  };
6159
6159
  }
6160
6160
 
6161
- const version = '5.25.1';
6161
+ const version = '5.24.7';
6162
6162
 
6163
6163
  function isStableColor(color) {
6164
6164
  return color >= 0 && color <= 255;
@@ -8024,23 +8024,6 @@ function toArray(children) {
8024
8024
  return ret;
8025
8025
  }
8026
8026
 
8027
- const addMediaQueryListener = (mql, handler) => {
8028
- // Don't delete here, please keep the code compatible
8029
- if (typeof (mql === null || mql === void 0 ? void 0 : mql.addEventListener) !== 'undefined') {
8030
- mql.addEventListener('change', handler);
8031
- } else if (typeof (mql === null || mql === void 0 ? void 0 : mql.addListener) !== 'undefined') {
8032
- mql.addListener(handler);
8033
- }
8034
- };
8035
- const removeMediaQueryListener = (mql, handler) => {
8036
- // Don't delete here, please keep the code compatible
8037
- if (typeof (mql === null || mql === void 0 ? void 0 : mql.removeEventListener) !== 'undefined') {
8038
- mql.removeEventListener('change', handler);
8039
- } else if (typeof (mql === null || mql === void 0 ? void 0 : mql.removeListener) !== 'undefined') {
8040
- mql.removeListener(handler);
8041
- }
8042
- };
8043
-
8044
8027
  const genLayoutStyle = token => {
8045
8028
  const {
8046
8029
  antCls,
@@ -8343,17 +8326,29 @@ const Sider = /*#__PURE__*/React.forwardRef((props, ref) => {
8343
8326
  };
8344
8327
  useEffect(() => {
8345
8328
  function responsiveHandler(mql) {
8346
- var _a;
8347
- return (_a = responsiveHandlerRef.current) === null || _a === void 0 ? void 0 : _a.call(responsiveHandlerRef, mql);
8329
+ return responsiveHandlerRef.current(mql);
8348
8330
  }
8349
8331
  let mql;
8350
- if (typeof (window === null || window === void 0 ? void 0 : window.matchMedia) !== 'undefined' && breakpoint && breakpoint in dimensionMaxMap) {
8351
- mql = window.matchMedia(`screen and (max-width: ${dimensionMaxMap[breakpoint]})`);
8352
- addMediaQueryListener(mql, responsiveHandler);
8353
- responsiveHandler(mql);
8332
+ if (typeof window !== 'undefined') {
8333
+ const {
8334
+ matchMedia
8335
+ } = window;
8336
+ if (matchMedia && breakpoint && breakpoint in dimensionMaxMap) {
8337
+ mql = matchMedia(`screen and (max-width: ${dimensionMaxMap[breakpoint]})`);
8338
+ try {
8339
+ mql.addEventListener('change', responsiveHandler);
8340
+ } catch (_a) {
8341
+ mql.addListener(responsiveHandler);
8342
+ }
8343
+ responsiveHandler(mql);
8344
+ }
8354
8345
  }
8355
8346
  return () => {
8356
- removeMediaQueryListener(mql, responsiveHandler);
8347
+ try {
8348
+ mql === null || mql === void 0 ? void 0 : mql.removeEventListener('change', responsiveHandler);
8349
+ } catch (_a) {
8350
+ mql === null || mql === void 0 ? void 0 : mql.removeListener(responsiveHandler);
8351
+ }
8357
8352
  };
8358
8353
  }, [breakpoint]); // in order to accept dynamic 'breakpoint' property, we need to add 'breakpoint' into dependency array.
8359
8354
  useEffect(() => {
@@ -12183,23 +12178,10 @@ const AnchorLink = props => {
12183
12178
  href
12184
12179
  });
12185
12180
  scrollTo === null || scrollTo === void 0 ? void 0 : scrollTo(href);
12186
- // Support clicking on an anchor does not record history.
12187
- if (e.defaultPrevented) {
12188
- return;
12189
- }
12190
- const isExternalLink = href.startsWith('http://') || href.startsWith('https://');
12191
- // Support external link
12192
- if (isExternalLink) {
12193
- if (replace) {
12194
- e.preventDefault();
12195
- window.location.replace(href);
12196
- }
12197
- return;
12181
+ if (replace) {
12182
+ e.preventDefault();
12183
+ window.location.replace(href);
12198
12184
  }
12199
- // Handling internal anchor link
12200
- e.preventDefault();
12201
- const historyMethod = replace ? 'replaceState' : 'pushState';
12202
- window.history[historyMethod](null, '', href);
12203
12185
  };
12204
12186
  // =================== Warning =====================
12205
12187
  if (process.env.NODE_ENV !== 'production') {
@@ -12259,17 +12241,132 @@ const Image = (props) => {
12259
12241
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Image$1, { ...props });
12260
12242
  };
12261
12243
 
12244
+ const ConfirmModal = ({
12245
+ title,
12246
+ content,
12247
+ typeIcon,
12248
+ titleCancelBtn = "Huỷ bỏ",
12249
+ titleSubmitBtn = "Xác nhận",
12250
+ handleCancel,
12251
+ handleSubmit,
12252
+ ...restProps
12253
+ }) => {
12254
+ //! State
12255
+ const IconType = () => {
12256
+ switch (typeIcon) {
12257
+ case "success":
12258
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
12259
+ "svg",
12260
+ {
12261
+ xmlns: "http://www.w3.org/2000/svg",
12262
+ width: "24",
12263
+ height: "24",
12264
+ viewBox: "0 0 24 24",
12265
+ fill: "none",
12266
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
12267
+ "path",
12268
+ {
12269
+ d: "M12 1.5C6.20156 1.5 1.5 6.20156 1.5 12C1.5 17.7984 6.20156 22.5 12 22.5C17.7984 22.5 22.5 17.7984 22.5 12C22.5 6.20156 17.7984 1.5 12 1.5ZM16.5352 8.57109L11.5992 15.4148C11.5302 15.5111 11.4393 15.5896 11.3339 15.6437C11.2286 15.6978 11.1118 15.7261 10.9934 15.7261C10.8749 15.7261 10.7582 15.6978 10.6528 15.6437C10.5474 15.5896 10.4565 15.5111 10.3875 15.4148L7.46484 11.3648C7.37578 11.2406 7.46484 11.0672 7.61719 11.0672H8.71641C8.95547 11.0672 9.18281 11.182 9.32344 11.3789L10.9922 13.6945L14.6766 8.58516C14.8172 8.39062 15.0422 8.27344 15.2836 8.27344H16.3828C16.5352 8.27344 16.6242 8.44688 16.5352 8.57109Z",
12270
+ fill: "#52C41A"
12271
+ }
12272
+ )
12273
+ }
12274
+ );
12275
+ case "error":
12276
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
12277
+ "svg",
12278
+ {
12279
+ xmlns: "http://www.w3.org/2000/svg",
12280
+ width: "24",
12281
+ height: "24",
12282
+ viewBox: "0 0 24 24",
12283
+ fill: "none",
12284
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
12285
+ "path",
12286
+ {
12287
+ d: "M12 1.5C6.20156 1.5 1.5 6.20156 1.5 12C1.5 17.7984 6.20156 22.5 12 22.5C17.7984 22.5 22.5 17.7984 22.5 12C22.5 6.20156 17.7984 1.5 12 1.5ZM15.8766 15.9891L14.3297 15.982L12 13.2047L9.67266 15.9797L8.12344 15.9867C8.02031 15.9867 7.93594 15.9047 7.93594 15.7992C7.93594 15.7547 7.95234 15.7125 7.98047 15.6773L11.0297 12.0445L7.98047 8.41406C7.95215 8.37971 7.93643 8.3367 7.93594 8.29219C7.93594 8.18906 8.02031 8.10469 8.12344 8.10469L9.67266 8.11172L12 10.8891L14.3273 8.11406L15.8742 8.10703C15.9773 8.10703 16.0617 8.18906 16.0617 8.29453C16.0617 8.33906 16.0453 8.38125 16.0172 8.41641L12.9727 12.0469L16.0195 15.6797C16.0477 15.7148 16.0641 15.757 16.0641 15.8016C16.0641 15.9047 15.9797 15.9891 15.8766 15.9891Z",
12288
+ fill: "#FF4D4F"
12289
+ }
12290
+ )
12291
+ }
12292
+ );
12293
+ case "info":
12294
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
12295
+ "svg",
12296
+ {
12297
+ xmlns: "http://www.w3.org/2000/svg",
12298
+ width: "24",
12299
+ height: "24",
12300
+ viewBox: "0 0 24 24",
12301
+ fill: "none",
12302
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
12303
+ "path",
12304
+ {
12305
+ d: "M12 1.5C6.20156 1.5 1.5 6.20156 1.5 12C1.5 17.7984 6.20156 22.5 12 22.5C17.7984 22.5 22.5 17.7984 22.5 12C22.5 6.20156 17.7984 1.5 12 1.5ZM12.75 17.0625C12.75 17.1656 12.6656 17.25 12.5625 17.25H11.4375C11.3344 17.25 11.25 17.1656 11.25 17.0625V10.6875C11.25 10.5844 11.3344 10.5 11.4375 10.5H12.5625C12.6656 10.5 12.75 10.5844 12.75 10.6875V17.0625ZM12 9C11.7056 8.99399 11.4253 8.87282 11.2192 8.6625C11.0132 8.45218 10.8977 8.16945 10.8977 7.875C10.8977 7.58055 11.0132 7.29782 11.2192 7.0875C11.4253 6.87718 11.7056 6.75601 12 6.75C12.2944 6.75601 12.5747 6.87718 12.7808 7.0875C12.9868 7.29782 13.1023 7.58055 13.1023 7.875C13.1023 8.16945 12.9868 8.45218 12.7808 8.6625C12.5747 8.87282 12.2944 8.99399 12 9Z",
12306
+ fill: "#1677FF"
12307
+ }
12308
+ )
12309
+ }
12310
+ );
12311
+ case "warning":
12312
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
12313
+ "svg",
12314
+ {
12315
+ xmlns: "http://www.w3.org/2000/svg",
12316
+ width: "24",
12317
+ height: "24",
12318
+ viewBox: "0 0 24 24",
12319
+ fill: "none",
12320
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
12321
+ "path",
12322
+ {
12323
+ d: "M12 1.5C6.20156 1.5 1.5 6.20156 1.5 12C1.5 17.7984 6.20156 22.5 12 22.5C17.7984 22.5 22.5 17.7984 22.5 12C22.5 6.20156 17.7984 1.5 12 1.5ZM11.25 6.9375C11.25 6.83437 11.3344 6.75 11.4375 6.75H12.5625C12.6656 6.75 12.75 6.83437 12.75 6.9375V13.3125C12.75 13.4156 12.6656 13.5 12.5625 13.5H11.4375C11.3344 13.5 11.25 13.4156 11.25 13.3125V6.9375ZM12 17.25C11.7056 17.244 11.4253 17.1228 11.2192 16.9125C11.0132 16.7022 10.8977 16.4195 10.8977 16.125C10.8977 15.8305 11.0132 15.5478 11.2192 15.3375C11.4253 15.1272 11.7056 15.006 12 15C12.2944 15.006 12.5747 15.1272 12.7808 15.3375C12.9868 15.5478 13.1023 15.8305 13.1023 16.125C13.1023 16.4195 12.9868 16.7022 12.7808 16.9125C12.5747 17.1228 12.2944 17.244 12 17.25Z",
12324
+ fill: "#FAAD14"
12325
+ }
12326
+ )
12327
+ }
12328
+ );
12329
+ }
12330
+ };
12331
+ //! Function
12332
+ //! Render
12333
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Modal, { ...restProps, footer: null, closeIcon: null, width: 400, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
12334
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-3", children: [
12335
+ /* @__PURE__ */ jsxRuntimeExports.jsx(IconType, {}),
12336
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
12337
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-base font-semibold", children: title }),
12338
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm", children: content })
12339
+ ] })
12340
+ ] }),
12341
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2 w-full justify-end items-end pt-3", children: [
12342
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { shape: "round", onClick: handleCancel, children: titleCancelBtn }),
12343
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { shape: "round", type: "primary", onClick: handleSubmit, children: titleSubmitBtn })
12344
+ ] })
12345
+ ] }) });
12346
+ };
12347
+
12348
+ var CATEGORY_LIST_ENUM = /* @__PURE__ */ ((CATEGORY_LIST_ENUM2) => {
12349
+ CATEGORY_LIST_ENUM2[CATEGORY_LIST_ENUM2["DRAFT"] = 0] = "DRAFT";
12350
+ CATEGORY_LIST_ENUM2[CATEGORY_LIST_ENUM2["WATING_APPROVAL"] = 1] = "WATING_APPROVAL";
12351
+ CATEGORY_LIST_ENUM2[CATEGORY_LIST_ENUM2["ACTIVE"] = 2] = "ACTIVE";
12352
+ CATEGORY_LIST_ENUM2[CATEGORY_LIST_ENUM2["INACTIVE"] = 3] = "INACTIVE";
12353
+ CATEGORY_LIST_ENUM2[CATEGORY_LIST_ENUM2["REJECT"] = 4] = "REJECT";
12354
+ CATEGORY_LIST_ENUM2[CATEGORY_LIST_ENUM2["DELETE"] = 5] = "DELETE";
12355
+ return CATEGORY_LIST_ENUM2;
12356
+ })(CATEGORY_LIST_ENUM || {});
12357
+
12262
12358
  const BulkAction = ({
12263
12359
  quantity,
12264
- handleRefresh,
12265
- handleSend,
12266
- handleSlash,
12267
- handleProhibit,
12268
- handleCheck,
12269
- handleClose,
12360
+ handleRestore,
12361
+ handleSendApproval,
12362
+ handleCancelSendApproval,
12363
+ handleRefuseApproval,
12364
+ handleApproval,
12365
+ handleCancelApproval,
12270
12366
  handleDelete,
12271
- handleUnLock,
12272
- handleLock
12367
+ handleActivate,
12368
+ handleInActivate,
12369
+ status
12273
12370
  }) => {
12274
12371
  //! State
12275
12372
  const listIcon = [
@@ -12294,7 +12391,10 @@ const BulkAction = ({
12294
12391
  )
12295
12392
  }
12296
12393
  ),
12297
- action: handleRefresh
12394
+ action: handleRestore,
12395
+ showConfirmModal: false,
12396
+ title: "Khôi phục",
12397
+ arrShow: [CATEGORY_LIST_ENUM?.DELETE, CATEGORY_LIST_ENUM?.REJECT]
12298
12398
  },
12299
12399
  {
12300
12400
  icon: /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -12316,7 +12416,12 @@ const BulkAction = ({
12316
12416
  )
12317
12417
  }
12318
12418
  ),
12319
- action: handleSend
12419
+ action: handleSendApproval,
12420
+ showConfirmModal: true,
12421
+ typeIcon: "info",
12422
+ title: "Xác nhận gửi duyệt",
12423
+ content: "Bạn có chắc chắn muốn gửi duyệt mục này không?",
12424
+ arrShow: [CATEGORY_LIST_ENUM?.DRAFT]
12320
12425
  },
12321
12426
  {
12322
12427
  icon: /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -12338,7 +12443,12 @@ const BulkAction = ({
12338
12443
  )
12339
12444
  }
12340
12445
  ),
12341
- action: handleSlash
12446
+ action: handleCancelSendApproval,
12447
+ showConfirmModal: true,
12448
+ typeIcon: "error",
12449
+ title: "Xác nhận hủy gửi duyệt",
12450
+ content: "Bạn có chắc chắn muốn hủy gửi duyệt mục này không?",
12451
+ arrShow: [CATEGORY_LIST_ENUM?.WATING_APPROVAL]
12342
12452
  },
12343
12453
  {
12344
12454
  icon: /* @__PURE__ */ jsxRuntimeExports.jsxs(
@@ -12369,7 +12479,12 @@ const BulkAction = ({
12369
12479
  ]
12370
12480
  }
12371
12481
  ),
12372
- action: handleProhibit
12482
+ action: handleRefuseApproval,
12483
+ showConfirmModal: true,
12484
+ typeIcon: "error",
12485
+ title: "Xác nhận từ chối duyệt",
12486
+ content: "Bạn có chắc chắn muốn từ chối duyệt mục này không? Hành động này không thể hoàn tác.",
12487
+ arrShow: [CATEGORY_LIST_ENUM?.WATING_APPROVAL]
12373
12488
  },
12374
12489
  {
12375
12490
  icon: /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -12391,7 +12506,12 @@ const BulkAction = ({
12391
12506
  )
12392
12507
  }
12393
12508
  ),
12394
- action: handleCheck
12509
+ action: handleApproval,
12510
+ showConfirmModal: true,
12511
+ typeIcon: "info",
12512
+ title: "Xác nhận duyệt",
12513
+ content: "Bạn có chắc chắn muốn duyệt mục này không?",
12514
+ arrShow: [CATEGORY_LIST_ENUM?.WATING_APPROVAL]
12395
12515
  },
12396
12516
  {
12397
12517
  icon: /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -12413,7 +12533,12 @@ const BulkAction = ({
12413
12533
  )
12414
12534
  }
12415
12535
  ),
12416
- action: handleClose
12536
+ action: handleCancelApproval,
12537
+ showConfirmModal: true,
12538
+ typeIcon: "error",
12539
+ title: "Xác nhận hủy duyệt",
12540
+ content: "Bạn có chắc chắn muốn hủy duyệt mục này không?",
12541
+ arrShow: [CATEGORY_LIST_ENUM?.ACTIVE]
12417
12542
  },
12418
12543
  {
12419
12544
  icon: /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -12433,7 +12558,16 @@ const BulkAction = ({
12433
12558
  )
12434
12559
  }
12435
12560
  ),
12436
- action: handleDelete
12561
+ action: handleDelete,
12562
+ showConfirmModal: true,
12563
+ typeIcon: "error",
12564
+ title: "Xác nhận xóa",
12565
+ content: "Bạn có chắc chắn muốn xóa mục này không? Hành động này không thể hoàn tác.",
12566
+ arrShow: [
12567
+ CATEGORY_LIST_ENUM?.DRAFT,
12568
+ CATEGORY_LIST_ENUM?.ACTIVE,
12569
+ CATEGORY_LIST_ENUM?.INACTIVE
12570
+ ]
12437
12571
  },
12438
12572
  {
12439
12573
  icon: /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -12455,7 +12589,12 @@ const BulkAction = ({
12455
12589
  )
12456
12590
  }
12457
12591
  ),
12458
- action: handleUnLock
12592
+ action: handleActivate,
12593
+ showConfirmModal: true,
12594
+ typeIcon: "info",
12595
+ title: "Xác nhận kích hoạt",
12596
+ content: "Bạn có chắc chắn muốn kích hoạt mục này không?",
12597
+ arrShow: [CATEGORY_LIST_ENUM?.INACTIVE]
12459
12598
  },
12460
12599
  {
12461
12600
  icon: /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -12477,132 +12616,68 @@ const BulkAction = ({
12477
12616
  )
12478
12617
  }
12479
12618
  ),
12480
- action: handleLock
12619
+ action: handleInActivate,
12620
+ showConfirmModal: true,
12621
+ typeIcon: "info",
12622
+ title: "Xác nhận vô hiệu hóa",
12623
+ content: "Bạn có chắc chắn muốn vô hiệu hóa mục này không?",
12624
+ arrShow: [CATEGORY_LIST_ENUM?.ACTIVE]
12481
12625
  }
12482
12626
  ];
12627
+ const [open, setOpen] = useState(false);
12628
+ const [notifyContent, setNotifyContent] = useState({
12629
+ title: "",
12630
+ content: "",
12631
+ typeIcon: "info",
12632
+ handleCancel: () => {
12633
+ },
12634
+ handleSubmit: () => {
12635
+ }
12636
+ });
12483
12637
  //! Function
12638
+ const IsShow = (arrStatus) => {
12639
+ return arrStatus.includes(status);
12640
+ };
12484
12641
  //! Render
12485
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3 px-[10px] py-3 bg-[#2561ED] rounded-lg w-fit", children: [
12642
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-full flex justify-center items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3 px-[10px] py-3 bg-[#2561ED] rounded-lg w-fit", children: [
12486
12643
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-white px-3", children: [
12487
12644
  "Đã chọn: ",
12488
12645
  quantity
12489
12646
  ] }),
12490
12647
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-5 border-l border-white mx-1" }),
12491
12648
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center space-x-3", children: listIcon.map(
12492
- (item, index) => item?.action && /* @__PURE__ */ jsxRuntimeExports.jsx(
12649
+ (item, index) => IsShow(item?.arrShow) && /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { title: item?.title, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
12493
12650
  "button",
12494
12651
  {
12495
12652
  className: "p-1 rounded-sm transition duration-200 cursor-pointer hover:bg-[#1B4ACB] hover:rounded-sm",
12496
- onClick: item.action,
12653
+ onClick: item?.showConfirmModal ? () => {
12654
+ setOpen(true);
12655
+ setNotifyContent({
12656
+ title: item?.title || "",
12657
+ content: item?.content || "",
12658
+ typeIcon: item?.typeIcon,
12659
+ handleCancel: () => {
12660
+ setOpen(false);
12661
+ },
12662
+ handleSubmit: item?.action
12663
+ });
12664
+ } : item?.action,
12497
12665
  children: item.icon
12498
12666
  },
12499
12667
  index
12500
- )
12501
- ) })
12502
- ] });
12503
- };
12504
-
12505
- const ConfirmModal = ({
12506
- title,
12507
- content,
12508
- typeIcon,
12509
- titleCancelBtn = "Huỷ bỏ",
12510
- titleSubmitBtn = "Xác nhận",
12511
- handleCancel,
12512
- handleSubmit,
12513
- ...restProps
12514
- }) => {
12515
- //! State
12516
- const IconType = () => {
12517
- switch (typeIcon) {
12518
- case "success":
12519
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
12520
- "svg",
12521
- {
12522
- xmlns: "http://www.w3.org/2000/svg",
12523
- width: "24",
12524
- height: "24",
12525
- viewBox: "0 0 24 24",
12526
- fill: "none",
12527
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(
12528
- "path",
12529
- {
12530
- d: "M12 1.5C6.20156 1.5 1.5 6.20156 1.5 12C1.5 17.7984 6.20156 22.5 12 22.5C17.7984 22.5 22.5 17.7984 22.5 12C22.5 6.20156 17.7984 1.5 12 1.5ZM16.5352 8.57109L11.5992 15.4148C11.5302 15.5111 11.4393 15.5896 11.3339 15.6437C11.2286 15.6978 11.1118 15.7261 10.9934 15.7261C10.8749 15.7261 10.7582 15.6978 10.6528 15.6437C10.5474 15.5896 10.4565 15.5111 10.3875 15.4148L7.46484 11.3648C7.37578 11.2406 7.46484 11.0672 7.61719 11.0672H8.71641C8.95547 11.0672 9.18281 11.182 9.32344 11.3789L10.9922 13.6945L14.6766 8.58516C14.8172 8.39062 15.0422 8.27344 15.2836 8.27344H16.3828C16.5352 8.27344 16.6242 8.44688 16.5352 8.57109Z",
12531
- fill: "#52C41A"
12532
- }
12533
- )
12534
- }
12535
- );
12536
- case "error":
12537
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
12538
- "svg",
12539
- {
12540
- xmlns: "http://www.w3.org/2000/svg",
12541
- width: "24",
12542
- height: "24",
12543
- viewBox: "0 0 24 24",
12544
- fill: "none",
12545
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(
12546
- "path",
12547
- {
12548
- d: "M12 1.5C6.20156 1.5 1.5 6.20156 1.5 12C1.5 17.7984 6.20156 22.5 12 22.5C17.7984 22.5 22.5 17.7984 22.5 12C22.5 6.20156 17.7984 1.5 12 1.5ZM15.8766 15.9891L14.3297 15.982L12 13.2047L9.67266 15.9797L8.12344 15.9867C8.02031 15.9867 7.93594 15.9047 7.93594 15.7992C7.93594 15.7547 7.95234 15.7125 7.98047 15.6773L11.0297 12.0445L7.98047 8.41406C7.95215 8.37971 7.93643 8.3367 7.93594 8.29219C7.93594 8.18906 8.02031 8.10469 8.12344 8.10469L9.67266 8.11172L12 10.8891L14.3273 8.11406L15.8742 8.10703C15.9773 8.10703 16.0617 8.18906 16.0617 8.29453C16.0617 8.33906 16.0453 8.38125 16.0172 8.41641L12.9727 12.0469L16.0195 15.6797C16.0477 15.7148 16.0641 15.757 16.0641 15.8016C16.0641 15.9047 15.9797 15.9891 15.8766 15.9891Z",
12549
- fill: "#FF4D4F"
12550
- }
12551
- )
12552
- }
12553
- );
12554
- case "info":
12555
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
12556
- "svg",
12557
- {
12558
- xmlns: "http://www.w3.org/2000/svg",
12559
- width: "24",
12560
- height: "24",
12561
- viewBox: "0 0 24 24",
12562
- fill: "none",
12563
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(
12564
- "path",
12565
- {
12566
- d: "M12 1.5C6.20156 1.5 1.5 6.20156 1.5 12C1.5 17.7984 6.20156 22.5 12 22.5C17.7984 22.5 22.5 17.7984 22.5 12C22.5 6.20156 17.7984 1.5 12 1.5ZM12.75 17.0625C12.75 17.1656 12.6656 17.25 12.5625 17.25H11.4375C11.3344 17.25 11.25 17.1656 11.25 17.0625V10.6875C11.25 10.5844 11.3344 10.5 11.4375 10.5H12.5625C12.6656 10.5 12.75 10.5844 12.75 10.6875V17.0625ZM12 9C11.7056 8.99399 11.4253 8.87282 11.2192 8.6625C11.0132 8.45218 10.8977 8.16945 10.8977 7.875C10.8977 7.58055 11.0132 7.29782 11.2192 7.0875C11.4253 6.87718 11.7056 6.75601 12 6.75C12.2944 6.75601 12.5747 6.87718 12.7808 7.0875C12.9868 7.29782 13.1023 7.58055 13.1023 7.875C13.1023 8.16945 12.9868 8.45218 12.7808 8.6625C12.5747 8.87282 12.2944 8.99399 12 9Z",
12567
- fill: "#1677FF"
12568
- }
12569
- )
12570
- }
12571
- );
12572
- case "warning":
12573
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
12574
- "svg",
12575
- {
12576
- xmlns: "http://www.w3.org/2000/svg",
12577
- width: "24",
12578
- height: "24",
12579
- viewBox: "0 0 24 24",
12580
- fill: "none",
12581
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(
12582
- "path",
12583
- {
12584
- d: "M12 1.5C6.20156 1.5 1.5 6.20156 1.5 12C1.5 17.7984 6.20156 22.5 12 22.5C17.7984 22.5 22.5 17.7984 22.5 12C22.5 6.20156 17.7984 1.5 12 1.5ZM11.25 6.9375C11.25 6.83437 11.3344 6.75 11.4375 6.75H12.5625C12.6656 6.75 12.75 6.83437 12.75 6.9375V13.3125C12.75 13.4156 12.6656 13.5 12.5625 13.5H11.4375C11.3344 13.5 11.25 13.4156 11.25 13.3125V6.9375ZM12 17.25C11.7056 17.244 11.4253 17.1228 11.2192 16.9125C11.0132 16.7022 10.8977 16.4195 10.8977 16.125C10.8977 15.8305 11.0132 15.5478 11.2192 15.3375C11.4253 15.1272 11.7056 15.006 12 15C12.2944 15.006 12.5747 15.1272 12.7808 15.3375C12.9868 15.5478 13.1023 15.8305 13.1023 16.125C13.1023 16.4195 12.9868 16.7022 12.7808 16.9125C12.5747 17.1228 12.2944 17.244 12 17.25Z",
12585
- fill: "#FAAD14"
12586
- }
12587
- )
12588
- }
12589
- );
12590
- }
12591
- };
12592
- //! Function
12593
- //! Render
12594
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Modal, { ...restProps, footer: null, closeIcon: null, width: 400, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
12595
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-3", children: [
12596
- /* @__PURE__ */ jsxRuntimeExports.jsx(IconType, {}),
12597
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
12598
- /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-base font-semibold", children: title }),
12599
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm", children: content })
12600
- ] })
12601
- ] }),
12602
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2 w-full justify-end items-end pt-3", children: [
12603
- /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { shape: "round", onClick: handleCancel, children: titleCancelBtn }),
12604
- /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { shape: "round", type: "primary", onClick: handleSubmit, children: titleSubmitBtn })
12605
- ] })
12668
+ ) })
12669
+ ) }),
12670
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
12671
+ ConfirmModal,
12672
+ {
12673
+ title: notifyContent?.title,
12674
+ content: notifyContent?.content,
12675
+ typeIcon: notifyContent?.typeIcon,
12676
+ open,
12677
+ handleCancel: notifyContent?.handleCancel,
12678
+ handleSubmit: notifyContent?.handleSubmit
12679
+ }
12680
+ )
12606
12681
  ] }) });
12607
12682
  };
12608
12683
 
@@ -3495,8 +3495,6 @@ var getProxyFormState = (formState, control, localProxyFormState, isRoot = true)
3495
3495
  return result;
3496
3496
  };
3497
3497
 
3498
- const useIsomorphicLayoutEffect$1 = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
3499
-
3500
3498
  /**
3501
3499
  * This custom hook allows you to subscribe to each form state, and isolate the re-render at the custom hook level. It has its scope in terms of form state subscription, so it would not affect other useFormState and useForm. Using this hook can reduce the re-render impact on large and complex form application.
3502
3500
  *
@@ -3541,8 +3539,10 @@ function useFormState(props) {
3541
3539
  isValid: false,
3542
3540
  errors: false,
3543
3541
  });
3544
- useIsomorphicLayoutEffect$1(() => control._subscribe({
3545
- name: name,
3542
+ const _name = React__default.useRef(name);
3543
+ _name.current = name;
3544
+ React__default.useEffect(() => control._subscribe({
3545
+ name: _name.current,
3546
3546
  formState: _localProxyFormState.current,
3547
3547
  exact,
3548
3548
  callback: (formState) => {
@@ -3552,7 +3552,7 @@ function useFormState(props) {
3552
3552
  ...formState,
3553
3553
  });
3554
3554
  },
3555
- }), [name, disabled, exact]);
3555
+ }), [control, disabled, exact]);
3556
3556
  React__default.useEffect(() => {
3557
3557
  _localProxyFormState.current.isValid && control._setValid(true);
3558
3558
  }, [control]);
@@ -3592,17 +3592,19 @@ var generateWatchOutput = (names, _names, formValues, isGlobal, defaultValue) =>
3592
3592
  function useWatch(props) {
3593
3593
  const methods = useFormContext();
3594
3594
  const { control = methods.control, name, defaultValue, disabled, exact, } = props || {};
3595
+ const _name = React__default.useRef(name);
3595
3596
  const _defaultValue = React__default.useRef(defaultValue);
3596
- const [value, updateValue] = React__default.useState(control._getWatch(name, _defaultValue.current));
3597
- useIsomorphicLayoutEffect$1(() => control._subscribe({
3598
- name: name,
3597
+ _name.current = name;
3598
+ React__default.useEffect(() => control._subscribe({
3599
+ name: _name.current,
3599
3600
  formState: {
3600
3601
  values: true,
3601
3602
  },
3602
3603
  exact,
3603
3604
  callback: (formState) => !disabled &&
3604
- updateValue(generateWatchOutput(name, control._names, formState.values || control._formValues, false, _defaultValue.current)),
3605
- }), [name, control, disabled, exact]);
3605
+ updateValue(generateWatchOutput(_name.current, control._names, formState.values || control._formValues, false, _defaultValue.current)),
3606
+ }), [control, disabled, exact]);
3607
+ const [value, updateValue] = React__default.useState(control._getWatch(name, defaultValue));
3606
3608
  React__default.useEffect(() => control._removeUnmounted());
3607
3609
  return value;
3608
3610
  }
@@ -4418,7 +4420,6 @@ function createFormControl(props = {}) {
4418
4420
  let _formState = {
4419
4421
  submitCount: 0,
4420
4422
  isDirty: false,
4421
- isReady: false,
4422
4423
  isLoading: isFunction$1(_options.defaultValues),
4423
4424
  isValidating: false,
4424
4425
  isSubmitted: false,
@@ -4433,7 +4434,7 @@ function createFormControl(props = {}) {
4433
4434
  };
4434
4435
  const _fields = {};
4435
4436
  let _defaultValues = isObject(_options.defaultValues) || isObject(_options.values)
4436
- ? cloneObject(_options.defaultValues || _options.values) || {}
4437
+ ? cloneObject(_options.values || _options.defaultValues) || {}
4437
4438
  : {};
4438
4439
  let _formValues = _options.shouldUnregister
4439
4440
  ? {}
@@ -5484,7 +5485,6 @@ function useForm(props = {}) {
5484
5485
  validatingFields: {},
5485
5486
  errors: props.errors || {},
5486
5487
  disabled: props.disabled || false,
5487
- isReady: false,
5488
5488
  defaultValues: isFunction$1(props.defaultValues)
5489
5489
  ? undefined
5490
5490
  : props.defaultValues,
@@ -5502,37 +5502,12 @@ function useForm(props = {}) {
5502
5502
  }
5503
5503
  const control = _formControl.current.control;
5504
5504
  control._options = props;
5505
- useIsomorphicLayoutEffect$1(() => {
5506
- const sub = control._subscribe({
5507
- formState: control._proxyFormState,
5508
- callback: () => updateFormState({ ...control._formState }),
5509
- reRenderRoot: true,
5510
- });
5511
- updateFormState((data) => ({
5512
- ...data,
5513
- isReady: true,
5514
- }));
5515
- control._formState.isReady = true;
5516
- return sub;
5517
- }, [control]);
5505
+ React__default.useLayoutEffect(() => control._subscribe({
5506
+ formState: control._proxyFormState,
5507
+ callback: () => updateFormState({ ...control._formState }),
5508
+ reRenderRoot: true,
5509
+ }), [control]);
5518
5510
  React__default.useEffect(() => control._disableForm(props.disabled), [control, props.disabled]);
5519
- React__default.useEffect(() => {
5520
- if (props.mode) {
5521
- control._options.mode = props.mode;
5522
- }
5523
- if (props.reValidateMode) {
5524
- control._options.reValidateMode = props.reValidateMode;
5525
- }
5526
- if (props.errors && !isEmptyObject(props.errors)) {
5527
- control._setErrors(props.errors);
5528
- }
5529
- }, [control, props.errors, props.mode, props.reValidateMode]);
5530
- React__default.useEffect(() => {
5531
- props.shouldUnregister &&
5532
- control._subjects.state.next({
5533
- values: control._getWatch(),
5534
- });
5535
- }, [control, props.shouldUnregister]);
5536
5511
  React__default.useEffect(() => {
5537
5512
  if (control._proxyFormState.isDirty) {
5538
5513
  const isDirty = control._getDirty();
@@ -5552,7 +5527,12 @@ function useForm(props = {}) {
5552
5527
  else {
5553
5528
  control._resetDefaultValues();
5554
5529
  }
5555
- }, [control, props.values]);
5530
+ }, [props.values, control]);
5531
+ React__default.useEffect(() => {
5532
+ if (props.errors && !isEmptyObject(props.errors)) {
5533
+ control._setErrors(props.errors);
5534
+ }
5535
+ }, [props.errors, control]);
5556
5536
  React__default.useEffect(() => {
5557
5537
  if (!control._state.mount) {
5558
5538
  control._setValid();
@@ -5564,6 +5544,12 @@ function useForm(props = {}) {
5564
5544
  }
5565
5545
  control._removeUnmounted();
5566
5546
  });
5547
+ React__default.useEffect(() => {
5548
+ props.shouldUnregister &&
5549
+ control._subjects.state.next({
5550
+ values: control._getWatch(),
5551
+ });
5552
+ }, [props.shouldUnregister, control]);
5567
5553
  _formControl.current.formState = getProxyFormState(formState, control);
5568
5554
  return _formControl.current;
5569
5555
  }
@@ -1,2 +1,2 @@
1
- export { D as DatePickerField, I as Input, P as PnkxField, R as RangePickerField, a as TinyMCE } from '../chunks/Switch-eMq9KkOy.js';
2
- export { C as CheckboxField, R as RadioGroup, S as Select } from '../chunks/Checkbox-CJ_M7IzZ.js';
1
+ export { D as DatePickerField, I as Input, P as PnkxField, R as RangePickerField, a as TinyMCE } from '../chunks/Switch-C3IZzn6L.js';
2
+ export { C as CheckboxField, R as RadioGroup, S as Select } from '../chunks/Checkbox-2LoiNtBe.js';
package/es/index.js CHANGED
@@ -1,5 +1,5 @@
1
- export { A as Alert, E as Anchor, G as Appfix, I as AutoComplete, e as Badge, g as Breadcrumb, U as BulkAction, B as Button, C as CascaderField, f as Col, V as ConfirmModal, d as Container, o as Divider, q as Drawer, D as Dropdown, N as Empty, X as ErrorBoundary, F as Flex, H as Heading, O as Image, L as Layout, j as Menu, M as Modal, k as Pagination, J as PnkxCollapse, K as PnkxColorPicker, r as Popconfirm, P as Popover, Q as QRCode, u as Rate, s as Result, R as Row, c as SearchFiltersForm, v as Segmented, m as Sidebar, S as Skeleton, h as Space, p as Spin, i as Splitter, w as Statistic, l as Steps, T as Table, b as Tabs, n as Tag, x as Timeline, a as Tooltip, y as Tour, z as Tree, W as Watermark, t as typeColorMap } from './chunks/ErrorBoundary-CgNFuAOJ.js';
2
- export { D as DatePickerField, E as ErrorMessage, I as Input, L as Label, P as PnkxField, R as RangePickerField, a as TinyMCE, T as Typography } from './chunks/Switch-eMq9KkOy.js';
3
- export { C as CheckboxField, R as RadioGroup, S as Select } from './chunks/Checkbox-CJ_M7IzZ.js';
1
+ export { A as Alert, E as Anchor, G as Appfix, I as AutoComplete, e as Badge, g as Breadcrumb, U as BulkAction, B as Button, C as CascaderField, f as Col, V as ConfirmModal, d as Container, o as Divider, q as Drawer, D as Dropdown, N as Empty, X as ErrorBoundary, F as Flex, H as Heading, O as Image, L as Layout, j as Menu, M as Modal, k as Pagination, J as PnkxCollapse, K as PnkxColorPicker, r as Popconfirm, P as Popover, Q as QRCode, u as Rate, s as Result, R as Row, c as SearchFiltersForm, v as Segmented, m as Sidebar, S as Skeleton, h as Space, p as Spin, i as Splitter, w as Statistic, l as Steps, T as Table, b as Tabs, n as Tag, x as Timeline, a as Tooltip, y as Tour, z as Tree, W as Watermark, t as typeColorMap } from './chunks/ErrorBoundary-Ja4PIPaU.js';
2
+ export { D as DatePickerField, E as ErrorMessage, I as Input, L as Label, P as PnkxField, R as RangePickerField, a as TinyMCE, T as Typography } from './chunks/Switch-C3IZzn6L.js';
3
+ export { C as CheckboxField, R as RadioGroup, S as Select } from './chunks/Checkbox-2LoiNtBe.js';
4
4
  export { u as useToast } from './chunks/cloneDeep-BLYi2V0G.js';
5
5
  export { u as useFiltersHandler, a as useMessage } from './chunks/useMessage-D_-VT5B4.js';
package/es/ui/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { A as Alert, E as Anchor, G as Appfix, I as AutoComplete, e as Badge, g as Breadcrumb, U as BulkAction, B as Button, C as CascaderField, f as Col, V as ConfirmModal, d as Container, o as Divider, q as Drawer, D as Dropdown, N as Empty, X as ErrorBoundary, F as Flex, H as Heading, O as Image, L as Layout, j as Menu, M as Modal, k as Pagination, J as PnkxCollapse, K as PnkxColorPicker, r as Popconfirm, P as Popover, Q as QRCode, u as Rate, s as Result, R as Row, c as SearchFiltersForm, v as Segmented, m as Sidebar, S as Skeleton, h as Space, p as Spin, i as Splitter, w as Statistic, l as Steps, T as Table, b as Tabs, n as Tag, x as Timeline, a as Tooltip, y as Tour, z as Tree, W as Watermark, t as typeColorMap } from '../chunks/ErrorBoundary-CgNFuAOJ.js';
2
- export { E as ErrorMessage, L as Label, T as Typography } from '../chunks/Switch-eMq9KkOy.js';
1
+ export { A as Alert, E as Anchor, G as Appfix, I as AutoComplete, e as Badge, g as Breadcrumb, U as BulkAction, B as Button, C as CascaderField, f as Col, V as ConfirmModal, d as Container, o as Divider, q as Drawer, D as Dropdown, N as Empty, X as ErrorBoundary, F as Flex, H as Heading, O as Image, L as Layout, j as Menu, M as Modal, k as Pagination, J as PnkxCollapse, K as PnkxColorPicker, r as Popconfirm, P as Popover, Q as QRCode, u as Rate, s as Result, R as Row, c as SearchFiltersForm, v as Segmented, m as Sidebar, S as Skeleton, h as Space, p as Spin, i as Splitter, w as Statistic, l as Steps, T as Table, b as Tabs, n as Tag, x as Timeline, a as Tooltip, y as Tour, z as Tree, W as Watermark, t as typeColorMap } from '../chunks/ErrorBoundary-Ja4PIPaU.js';
2
+ export { E as ErrorMessage, L as Label, T as Typography } from '../chunks/Switch-C3IZzn6L.js';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pnkx-lib/ui",
3
3
  "private": false,
4
- "version": "1.8.1",
4
+ "version": "1.8.3",
5
5
  "type": "module",
6
6
  "main": "./es/index.js",
7
7
  "module": "./es/index.js",
@@ -107,4 +107,4 @@
107
107
  "yup": "^1.6.1",
108
108
  "zustand": "^5.0.3"
109
109
  }
110
- }
110
+ }
package/types/hooks.d.ts CHANGED
@@ -1,14 +1,14 @@
1
- import { ArgsProps } from 'antd/es/notification';
2
- import { ArgsProps as ArgsProps_2 } from 'antd/lib/message';
1
+ import { ArgsProps } from 'antd/lib/message';
2
+ import { ArgsProps as ArgsProps_2 } from 'antd/es/notification';
3
3
  import { default as default_2 } from 'react';
4
4
 
5
5
  export declare type InitialFiltersSearch<T> = T & PaginationFilters;
6
6
 
7
- export declare type OptionalArgsMessage = Partial<ArgsProps_2> & {
8
- type?: ArgsProps_2["type"];
7
+ export declare type OptionalArgsMessage = Partial<ArgsProps> & {
8
+ type?: ArgsProps["type"];
9
9
  };
10
10
 
11
- export declare type OptionalArgsToast = Partial<ArgsProps> & {
11
+ export declare type OptionalArgsToast = Partial<ArgsProps_2> & {
12
12
  message?: React.ReactNode;
13
13
  };
14
14
 
package/types/index.d.ts CHANGED
@@ -2,8 +2,8 @@ import { AffixProps } from 'antd';
2
2
  import { AlertProps as AlertProps_2 } from 'antd';
3
3
  import { Anchor as Anchor_2 } from 'antd';
4
4
  import { AnchorProps } from 'antd';
5
- import { ArgsProps } from 'antd/es/notification';
6
- import { ArgsProps as ArgsProps_2 } from 'antd/lib/message';
5
+ import { ArgsProps } from 'antd/lib/message';
6
+ import { ArgsProps as ArgsProps_2 } from 'antd/es/notification';
7
7
  import { AutoCompleteProps as AutoCompleteProps_2 } from 'antd';
8
8
  import { BadgeProps as BadgeProps_2 } from 'antd';
9
9
  import { BasicProps } from 'antd/es/layout/layout';
@@ -23,8 +23,8 @@ import { Control } from 'react-hook-form';
23
23
  import { ControllerFieldState } from 'react-hook-form';
24
24
  import { ControllerRenderProps } from 'react-hook-form';
25
25
  import { Dayjs } from 'dayjs';
26
- import { default as default_2 } from 'react';
27
- import { default as default_3 } from 'antd/es/anchor/AnchorLink';
26
+ import { default as default_2 } from 'antd/es/anchor/AnchorLink';
27
+ import { default as default_3 } from 'react';
28
28
  import { DefaultOptionType } from 'antd/es/cascader';
29
29
  import { DefaultValues } from 'react-hook-form';
30
30
  import { DividerProps as DividerProps_2 } from 'antd';
@@ -105,7 +105,7 @@ export declare const Alert: React.FC<AlertProps>;
105
105
  export declare type AlertProps = AlertProps_2;
106
106
 
107
107
  export declare const Anchor: typeof Anchor_2 & {
108
- Link: typeof default_3;
108
+ Link: typeof default_2;
109
109
  };
110
110
 
111
111
  export declare type AnchorPropsUnion = BaseProps_13 & AnchorProps;
@@ -113,7 +113,7 @@ export declare type AnchorPropsUnion = BaseProps_13 & AnchorProps;
113
113
  export declare const Appfix: ({ children, ...rest }: AppfixProps) => JSX.Element;
114
114
 
115
115
  export declare interface AppfixProps extends AffixProps {
116
- children: default_2.ReactNode;
116
+ children: default_3.ReactNode;
117
117
  }
118
118
 
119
119
  export declare const AutoComplete: React.FC<AutoCompleteProps>;
@@ -202,22 +202,23 @@ export declare type BreadcrumbPropsUnion = BaseProps_6 & BreadcrumbProps;
202
202
 
203
203
  export declare type BreadcrumbSeparatorType = BreadcrumbSeparatorType_2;
204
204
 
205
- export declare const BulkAction: ({ quantity, handleRefresh, handleSend, handleSlash, handleProhibit, handleCheck, handleClose, handleDelete, handleUnLock, handleLock, }: BulkActionProps) => JSX.Element;
205
+ export declare const BulkAction: ({ quantity, handleRestore, handleSendApproval, handleCancelSendApproval, handleRefuseApproval, handleApproval, handleCancelApproval, handleDelete, handleActivate, handleInActivate, status, }: BulkActionProps) => JSX.Element;
206
206
 
207
207
  export declare interface BulkActionProps {
208
208
  quantity: number;
209
- handleRefresh?: () => void;
210
- handleSend?: () => void;
211
- handleSlash?: () => void;
212
- handleProhibit?: () => void;
213
- handleCheck?: () => void;
214
- handleClose?: () => void;
209
+ handleRestore?: () => void;
210
+ handleSendApproval?: () => void;
211
+ handleCancelSendApproval?: () => void;
212
+ handleRefuseApproval?: () => void;
213
+ handleApproval?: () => void;
214
+ handleCancelApproval?: () => void;
215
215
  handleDelete?: () => void;
216
- handleUnLock?: () => void;
217
- handleLock?: () => void;
216
+ handleActivate?: () => void;
217
+ handleInActivate?: () => void;
218
+ status?: number;
218
219
  }
219
220
 
220
- export declare const Button: default_2.FC<ButtonProps>;
221
+ export declare const Button: default_3.FC<ButtonProps>;
221
222
 
222
223
  export declare type ButtonProps = ButtonProps_2;
223
224
 
@@ -264,20 +265,22 @@ export declare interface ConfirmModalProps extends ModalProps {
264
265
  content: string;
265
266
  titleCancelBtn?: string;
266
267
  titleSubmitBtn?: string;
267
- typeIcon: "success" | "error" | "warning" | "info";
268
+ typeIcon: ConfirmModalType;
268
269
  handleCancel?: () => void;
269
270
  handleSubmit?: () => void;
270
271
  }
271
272
 
272
- export declare const Container: default_2.FC<ContainerProps>;
273
+ export declare type ConfirmModalType = "success" | "error" | "warning" | "info";
274
+
275
+ export declare const Container: default_3.FC<ContainerProps>;
273
276
 
274
277
  export declare interface ContainerProps {
275
- children: default_2.ReactNode;
278
+ children: default_3.ReactNode;
276
279
  size?: TailwindMaxWidth;
277
280
  className?: string;
278
281
  }
279
282
 
280
- declare type CustomInputTypeAttribute = default_2.HTMLInputTypeAttribute | "money";
283
+ declare type CustomInputTypeAttribute = default_3.HTMLInputTypeAttribute | "money";
281
284
 
282
285
  export declare interface DatePickerDMYProps extends Omit<ReactDatePickerProps, "onChange"> {
283
286
  field?: ControllerRenderProps<any, any>;
@@ -291,7 +294,7 @@ export declare interface DatePickerDMYProps extends Omit<ReactDatePickerProps, "
291
294
  label?: string;
292
295
  maxDate?: Date;
293
296
  showTimeSelect?: boolean;
294
- customOnChange?: (date: any, event: default_2.SyntheticEvent<any>) => void;
297
+ customOnChange?: (date: any, event: default_3.SyntheticEvent<any>) => void;
295
298
  customValue?: Date | null;
296
299
  size?: TSize;
297
300
  }
@@ -334,7 +337,7 @@ declare class ErrorBoundaryClass extends Component<ErrorBoundaryProps, ErrorBoun
334
337
  static getDerivedStateFromError(error: Error): ErrorBoundaryState;
335
338
  componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
336
339
  handleReload: () => void;
337
- render(): default_2.ReactNode;
340
+ render(): default_3.ReactNode;
338
341
  }
339
342
 
340
343
  export declare interface ErrorBoundaryProps {
@@ -347,7 +350,7 @@ export declare interface ErrorBoundaryState {
347
350
  errorInfo: ErrorInfo | null;
348
351
  }
349
352
 
350
- export declare const ErrorMessage: default_2.MemoExoticComponent<({ errorMessage, isTouched, isSubmitted }: ErrorMessageProps) => JSX.Element | null>;
353
+ export declare const ErrorMessage: default_3.MemoExoticComponent<({ errorMessage, isTouched, isSubmitted }: ErrorMessageProps) => JSX.Element | null>;
351
354
 
352
355
  export declare interface ErrorMessageProps {
353
356
  errorMessage?: string;
@@ -390,8 +393,8 @@ export declare interface InputProps extends InputProps_2 {
390
393
  customStyleInput?: string;
391
394
  type?: CustomInputTypeAttribute;
392
395
  afterOnChange?: (value: number | string | null) => void;
393
- iconStartInput?: default_2.ReactNode;
394
- iconEndInput?: default_2.ReactNode;
396
+ iconStartInput?: default_3.ReactNode;
397
+ iconEndInput?: default_3.ReactNode;
395
398
  allowNegative?: boolean;
396
399
  decimalScale?: number;
397
400
  prefix?: string;
@@ -411,12 +414,12 @@ export declare interface LabelProps {
411
414
  required?: boolean;
412
415
  }
413
416
 
414
- export declare const Layout: default_2.FC<LayoutProps> & {
415
- Header: default_2.ForwardRefExoticComponent<BasicProps & default_2.RefAttributes<HTMLElement>>;
416
- Footer: default_2.ForwardRefExoticComponent<BasicProps & default_2.RefAttributes<HTMLElement>>;
417
- Content: default_2.ForwardRefExoticComponent<BasicProps & default_2.RefAttributes<HTMLElement>>;
418
- Sider: default_2.ForwardRefExoticComponent<SiderProps & default_2.RefAttributes<HTMLDivElement>>;
419
- _InternalSiderContext: default_2.Context<SiderContextProps>;
417
+ export declare const Layout: default_3.FC<LayoutProps> & {
418
+ Header: default_3.ForwardRefExoticComponent<BasicProps & default_3.RefAttributes<HTMLElement>>;
419
+ Footer: default_3.ForwardRefExoticComponent<BasicProps & default_3.RefAttributes<HTMLElement>>;
420
+ Content: default_3.ForwardRefExoticComponent<BasicProps & default_3.RefAttributes<HTMLElement>>;
421
+ Sider: default_3.ForwardRefExoticComponent<SiderProps & default_3.RefAttributes<HTMLDivElement>>;
422
+ _InternalSiderContext: default_3.Context<SiderContextProps>;
420
423
  };
421
424
 
422
425
  export declare type LayoutProps = BaseProps_8 & BasicProps;
@@ -442,11 +445,11 @@ declare type MultipleCascaderProps = CascaderProps<DefaultOptionType, string, tr
442
445
  multiple: true;
443
446
  };
444
447
 
445
- export declare type OptionalArgsMessage = Partial<ArgsProps_2> & {
446
- type?: ArgsProps_2["type"];
448
+ export declare type OptionalArgsMessage = Partial<ArgsProps> & {
449
+ type?: ArgsProps["type"];
447
450
  };
448
451
 
449
- export declare type OptionalArgsToast = Partial<ArgsProps> & {
452
+ export declare type OptionalArgsToast = Partial<ArgsProps_2> & {
450
453
  message?: React.ReactNode;
451
454
  };
452
455
 
@@ -564,7 +567,7 @@ export declare interface SearchFiltersFormProps<T extends FieldValues> {
564
567
  setValue?: UseFormSetValue<T>;
565
568
  handleSubmit?: FormEventHandler<any>;
566
569
  reset?: UseFormReset<T>;
567
- }) => default_2.ReactNode;
570
+ }) => default_3.ReactNode;
568
571
  onReset?: () => void;
569
572
  classNamesContainer?: string;
570
573
  classNameWrapperForm?: string;
@@ -658,8 +661,8 @@ export declare interface SwitchFieldProps extends Omit<SwitchProps, "onChange" |
658
661
 
659
662
  declare type TabItem = {
660
663
  key: string;
661
- label: default_2.ReactNode;
662
- children: default_2.ReactNode;
664
+ label: default_3.ReactNode;
665
+ children: default_3.ReactNode;
663
666
  disabled?: boolean;
664
667
  };
665
668
 
@@ -680,8 +683,8 @@ export declare interface TableCommonProps<T> extends Omit<TableProps<T>, "column
680
683
  onChangePage: (page: number) => void;
681
684
  onChangePageSize: (size: number) => void;
682
685
  onSort?: (sortField: string | number | symbol) => void;
683
- rowsSelected?: default_2.Key[];
684
- onSelect: (newSelectedRowKeys: default_2.Key[]) => void;
686
+ rowsSelected?: default_3.Key[];
687
+ onSelect: (newSelectedRowKeys: default_3.Key[]) => void;
685
688
  onRowClick?: (record: T) => void;
686
689
  rowKey?: string | ((record: T) => string);
687
690
  className?: string;
@@ -689,7 +692,7 @@ export declare interface TableCommonProps<T> extends Omit<TableProps<T>, "column
689
692
  onSave?: (data: T) => void;
690
693
  }
691
694
 
692
- export declare const Tabs: default_2.FC<TabsProps>;
695
+ export declare const Tabs: default_3.FC<TabsProps>;
693
696
 
694
697
  export declare type TabsProps = TabsProps_2 & {
695
698
  items: TabItem[];
@@ -735,7 +738,7 @@ export declare interface TinyProps extends IAllProps {
735
738
  text_patterns?: any;
736
739
  }
737
740
 
738
- export declare const Tooltip: default_2.FC<TooltipProps>;
741
+ export declare const Tooltip: default_3.FC<TooltipProps>;
739
742
 
740
743
  export declare type TooltipProps = TooltipProps_2;
741
744
 
@@ -779,13 +782,13 @@ export declare interface UploadFieldProps extends Omit<UploadProps, "value" | "o
779
782
 
780
783
  export declare const useFiltersHandler: <T>(initialFilters: InitialFiltersSearch<T>) => {
781
784
  filters: InitialFiltersSearch<T>;
782
- rowsSelected: default_2.Key[];
783
- setRowsSelected: default_2.Dispatch<default_2.SetStateAction<default_2.Key[]>>;
784
- setFilters: default_2.Dispatch<default_2.SetStateAction<InitialFiltersSearch<T>>>;
785
+ rowsSelected: default_3.Key[];
786
+ setRowsSelected: default_3.Dispatch<default_3.SetStateAction<default_3.Key[]>>;
787
+ setFilters: default_3.Dispatch<default_3.SetStateAction<InitialFiltersSearch<T>>>;
785
788
  goToPage: (PageIndex: number) => void;
786
789
  changeRowlimit: (value: number) => void;
787
790
  resetToInitialFilters: () => void;
788
- handleCheckBox: (newSelectedRowKeys: default_2.Key[]) => void;
791
+ handleCheckBox: (newSelectedRowKeys: default_3.Key[]) => void;
789
792
  handleChangePage: (nextPage: number) => void;
790
793
  handleRequestSort: (sortField: string | number | symbol) => void;
791
794
  handleSearch: (nextFilters: InitialFiltersSearch<T>) => void;
package/types/ui.d.ts CHANGED
@@ -17,8 +17,8 @@ import { ColProps as ColProps_2 } from 'antd';
17
17
  import { ColSize } from 'antd/es/grid';
18
18
  import { Component } from 'react';
19
19
  import { Control } from 'react-hook-form';
20
- import { default as default_2 } from 'react';
21
- import { default as default_3 } from 'antd/es/anchor/AnchorLink';
20
+ import { default as default_2 } from 'antd/es/anchor/AnchorLink';
21
+ import { default as default_3 } from 'react';
22
22
  import { DefaultOptionType } from 'antd/es/cascader';
23
23
  import { DefaultValues } from 'react-hook-form';
24
24
  import { DividerProps as DividerProps_2 } from 'antd';
@@ -86,7 +86,7 @@ export declare const Alert: React.FC<AlertProps>;
86
86
  export declare type AlertProps = AlertProps_2;
87
87
 
88
88
  export declare const Anchor: typeof Anchor_2 & {
89
- Link: typeof default_3;
89
+ Link: typeof default_2;
90
90
  };
91
91
 
92
92
  export declare type AnchorPropsUnion = BaseProps_13 & AnchorProps;
@@ -94,7 +94,7 @@ export declare type AnchorPropsUnion = BaseProps_13 & AnchorProps;
94
94
  export declare const Appfix: ({ children, ...rest }: AppfixProps) => JSX.Element;
95
95
 
96
96
  export declare interface AppfixProps extends AffixProps {
97
- children: default_2.ReactNode;
97
+ children: default_3.ReactNode;
98
98
  }
99
99
 
100
100
  export declare const AutoComplete: React.FC<AutoCompleteProps>;
@@ -183,22 +183,23 @@ export declare type BreadcrumbPropsUnion = BaseProps_6 & BreadcrumbProps;
183
183
 
184
184
  export declare type BreadcrumbSeparatorType = BreadcrumbSeparatorType_2;
185
185
 
186
- export declare const BulkAction: ({ quantity, handleRefresh, handleSend, handleSlash, handleProhibit, handleCheck, handleClose, handleDelete, handleUnLock, handleLock, }: BulkActionProps) => JSX.Element;
186
+ export declare const BulkAction: ({ quantity, handleRestore, handleSendApproval, handleCancelSendApproval, handleRefuseApproval, handleApproval, handleCancelApproval, handleDelete, handleActivate, handleInActivate, status, }: BulkActionProps) => JSX.Element;
187
187
 
188
188
  export declare interface BulkActionProps {
189
189
  quantity: number;
190
- handleRefresh?: () => void;
191
- handleSend?: () => void;
192
- handleSlash?: () => void;
193
- handleProhibit?: () => void;
194
- handleCheck?: () => void;
195
- handleClose?: () => void;
190
+ handleRestore?: () => void;
191
+ handleSendApproval?: () => void;
192
+ handleCancelSendApproval?: () => void;
193
+ handleRefuseApproval?: () => void;
194
+ handleApproval?: () => void;
195
+ handleCancelApproval?: () => void;
196
196
  handleDelete?: () => void;
197
- handleUnLock?: () => void;
198
- handleLock?: () => void;
197
+ handleActivate?: () => void;
198
+ handleInActivate?: () => void;
199
+ status?: number;
199
200
  }
200
201
 
201
- export declare const Button: default_2.FC<ButtonProps>;
202
+ export declare const Button: default_3.FC<ButtonProps>;
202
203
 
203
204
  export declare type ButtonProps = ButtonProps_2;
204
205
 
@@ -231,15 +232,17 @@ export declare interface ConfirmModalProps extends ModalProps {
231
232
  content: string;
232
233
  titleCancelBtn?: string;
233
234
  titleSubmitBtn?: string;
234
- typeIcon: "success" | "error" | "warning" | "info";
235
+ typeIcon: ConfirmModalType;
235
236
  handleCancel?: () => void;
236
237
  handleSubmit?: () => void;
237
238
  }
238
239
 
239
- export declare const Container: default_2.FC<ContainerProps>;
240
+ export declare type ConfirmModalType = "success" | "error" | "warning" | "info";
241
+
242
+ export declare const Container: default_3.FC<ContainerProps>;
240
243
 
241
244
  export declare interface ContainerProps {
242
- children: default_2.ReactNode;
245
+ children: default_3.ReactNode;
243
246
  size?: TailwindMaxWidth;
244
247
  className?: string;
245
248
  }
@@ -280,7 +283,7 @@ declare class ErrorBoundaryClass extends Component<ErrorBoundaryProps, ErrorBoun
280
283
  static getDerivedStateFromError(error: Error): ErrorBoundaryState;
281
284
  componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
282
285
  handleReload: () => void;
283
- render(): default_2.ReactNode;
286
+ render(): default_3.ReactNode;
284
287
  }
285
288
 
286
289
  export declare interface ErrorBoundaryProps {
@@ -293,7 +296,7 @@ export declare interface ErrorBoundaryState {
293
296
  errorInfo: ErrorInfo | null;
294
297
  }
295
298
 
296
- export declare const ErrorMessage: default_2.MemoExoticComponent<({ errorMessage, isTouched, isSubmitted }: ErrorMessageProps) => JSX.Element | null>;
299
+ export declare const ErrorMessage: default_3.MemoExoticComponent<({ errorMessage, isTouched, isSubmitted }: ErrorMessageProps) => JSX.Element | null>;
297
300
 
298
301
  export declare interface ErrorMessageProps {
299
302
  errorMessage?: string;
@@ -338,12 +341,12 @@ export declare interface LabelProps {
338
341
  required?: boolean;
339
342
  }
340
343
 
341
- export declare const Layout: default_2.FC<LayoutProps> & {
342
- Header: default_2.ForwardRefExoticComponent<BasicProps & default_2.RefAttributes<HTMLElement>>;
343
- Footer: default_2.ForwardRefExoticComponent<BasicProps & default_2.RefAttributes<HTMLElement>>;
344
- Content: default_2.ForwardRefExoticComponent<BasicProps & default_2.RefAttributes<HTMLElement>>;
345
- Sider: default_2.ForwardRefExoticComponent<SiderProps & default_2.RefAttributes<HTMLDivElement>>;
346
- _InternalSiderContext: default_2.Context<SiderContextProps>;
344
+ export declare const Layout: default_3.FC<LayoutProps> & {
345
+ Header: default_3.ForwardRefExoticComponent<BasicProps & default_3.RefAttributes<HTMLElement>>;
346
+ Footer: default_3.ForwardRefExoticComponent<BasicProps & default_3.RefAttributes<HTMLElement>>;
347
+ Content: default_3.ForwardRefExoticComponent<BasicProps & default_3.RefAttributes<HTMLElement>>;
348
+ Sider: default_3.ForwardRefExoticComponent<SiderProps & default_3.RefAttributes<HTMLDivElement>>;
349
+ _InternalSiderContext: default_3.Context<SiderContextProps>;
347
350
  };
348
351
 
349
352
  export declare type LayoutProps = BaseProps_8 & BasicProps;
@@ -431,7 +434,7 @@ export declare interface SearchFiltersFormProps<T extends FieldValues> {
431
434
  setValue?: UseFormSetValue<T>;
432
435
  handleSubmit?: FormEventHandler<any>;
433
436
  reset?: UseFormReset<T>;
434
- }) => default_2.ReactNode;
437
+ }) => default_3.ReactNode;
435
438
  onReset?: () => void;
436
439
  classNamesContainer?: string;
437
440
  classNameWrapperForm?: string;
@@ -503,8 +506,8 @@ export declare type SubMenuProps = SubMenuProps_2;
503
506
 
504
507
  declare type TabItem = {
505
508
  key: string;
506
- label: default_2.ReactNode;
507
- children: default_2.ReactNode;
509
+ label: default_3.ReactNode;
510
+ children: default_3.ReactNode;
508
511
  disabled?: boolean;
509
512
  };
510
513
 
@@ -525,8 +528,8 @@ export declare interface TableCommonProps<T> extends Omit<TableProps<T>, "column
525
528
  onChangePage: (page: number) => void;
526
529
  onChangePageSize: (size: number) => void;
527
530
  onSort?: (sortField: string | number | symbol) => void;
528
- rowsSelected?: default_2.Key[];
529
- onSelect: (newSelectedRowKeys: default_2.Key[]) => void;
531
+ rowsSelected?: default_3.Key[];
532
+ onSelect: (newSelectedRowKeys: default_3.Key[]) => void;
530
533
  onRowClick?: (record: T) => void;
531
534
  rowKey?: string | ((record: T) => string);
532
535
  className?: string;
@@ -534,7 +537,7 @@ export declare interface TableCommonProps<T> extends Omit<TableProps<T>, "column
534
537
  onSave?: (data: T) => void;
535
538
  }
536
539
 
537
- export declare const Tabs: default_2.FC<TabsProps>;
540
+ export declare const Tabs: default_3.FC<TabsProps>;
538
541
 
539
542
  export declare type TabsProps = TabsProps_2 & {
540
543
  items: TabItem[];
@@ -553,7 +556,7 @@ export declare const Timeline: React.FC<TimelineProps>;
553
556
 
554
557
  export declare type TimelineProps = TimelineProps_2;
555
558
 
556
- export declare const Tooltip: default_2.FC<TooltipProps>;
559
+ export declare const Tooltip: default_3.FC<TooltipProps>;
557
560
 
558
561
  export declare type TooltipProps = TooltipProps_2;
559
562