@pnkx-lib/ui 1.9.520 → 1.9.522

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.
package/es/ui/index.js CHANGED
@@ -23766,7 +23766,13 @@ const ListDataConvert = ({
23766
23766
  content: "Bạn có chắc chắn muốn từ chối xác nhận không?",
23767
23767
  arrShow: [CATEGORY_PRICE_LIST_ENUM?.WAITING_APPROVAL],
23768
23768
  showTitle: true,
23769
- countLevel: [COUNT_LEVEL.TWO_LEVEL]
23769
+ countLevel: [COUNT_LEVEL.TWO_LEVEL],
23770
+ arrShows: [
23771
+ {
23772
+ status: [CATEGORY_PRICE_LIST_ENUM?.WAITING_APPROVAL],
23773
+ level: [COUNT_LEVEL.TWO_LEVEL]
23774
+ }
23775
+ ]
23770
23776
  },
23771
23777
  {
23772
23778
  icon: /* @__PURE__ */ jsx(CancelSendConfirmIcon, { className: "w-6 -h-6", size: 22, color: "#B2B7C2" }),
@@ -23777,9 +23783,15 @@ const ListDataConvert = ({
23777
23783
  typeIcon: "error",
23778
23784
  title: "Xác nhận huỷ gửi xác nhận",
23779
23785
  content: "Bạn có chắc chắn muốn huỷ gửi xác nhận không?",
23780
- arrShow: [CATEGORY_PRICE_LIST_ENUM?.WAITING_CONFIRM],
23786
+ arrShow: [CATEGORY_PRICE_LIST_ENUM?.CREATED],
23781
23787
  showTitle: true,
23782
- countLevel: [COUNT_LEVEL.TWO_LEVEL]
23788
+ countLevel: [COUNT_LEVEL.TWO_LEVEL],
23789
+ arrShows: [
23790
+ {
23791
+ status: [CATEGORY_PRICE_LIST_ENUM?.CREATED],
23792
+ level: [COUNT_LEVEL.TWO_LEVEL]
23793
+ }
23794
+ ]
23783
23795
  },
23784
23796
  {
23785
23797
  icon: /* @__PURE__ */ jsx(ConfirmIcon, { className: "w-6 -h-6", size: 22, color: "#B2B7C2" }),
@@ -23792,7 +23804,13 @@ const ListDataConvert = ({
23792
23804
  content: "Bạn có chắc chắn muốn xác nhận không?",
23793
23805
  arrShow: [CATEGORY_PRICE_LIST_ENUM?.WAITING_APPROVAL],
23794
23806
  showTitle: true,
23795
- countLevel: [COUNT_LEVEL.TWO_LEVEL]
23807
+ countLevel: [COUNT_LEVEL.TWO_LEVEL],
23808
+ arrShows: [
23809
+ {
23810
+ status: [CATEGORY_PRICE_LIST_ENUM?.WAITING_APPROVAL],
23811
+ level: [COUNT_LEVEL.TWO_LEVEL]
23812
+ }
23813
+ ]
23796
23814
  },
23797
23815
  {
23798
23816
  icon: /* @__PURE__ */ jsx(SendConfirmIcon, { className: "w-6 -h-6", size: 22, color: "#B2B7C2" }),
@@ -23805,7 +23823,13 @@ const ListDataConvert = ({
23805
23823
  content: "Bạn có chắc chắn muốn gửi xác nhận không?",
23806
23824
  arrShow: [CATEGORY_PRICE_LIST_ENUM?.WAITING_APPROVAL],
23807
23825
  showTitle: true,
23808
- countLevel: [COUNT_LEVEL.TWO_LEVEL]
23826
+ countLevel: [COUNT_LEVEL.TWO_LEVEL],
23827
+ arrShows: [
23828
+ {
23829
+ status: [CATEGORY_PRICE_LIST_ENUM?.WAITING_APPROVAL],
23830
+ level: [COUNT_LEVEL.TWO_LEVEL]
23831
+ }
23832
+ ]
23809
23833
  },
23810
23834
  {
23811
23835
  icon: /* @__PURE__ */ jsx(SendApproveIcon, { className: "w-6 -h-6", size: 22, color: "#B2B7C2" }),
@@ -23818,7 +23842,17 @@ const ListDataConvert = ({
23818
23842
  content: "Bạn có chắc chắn muốn gửi duyệt không?",
23819
23843
  arrShow: [CATEGORY_PRICE_LIST_ENUM?.CREATED],
23820
23844
  showTitle: true,
23821
- countLevel: [COUNT_LEVEL.ONE_LEVEL]
23845
+ countLevel: [COUNT_LEVEL.ONE_LEVEL],
23846
+ arrShows: [
23847
+ {
23848
+ status: [CATEGORY_PRICE_LIST_ENUM?.CREATED],
23849
+ level: [COUNT_LEVEL.ONE_LEVEL]
23850
+ },
23851
+ {
23852
+ status: [CATEGORY_PRICE_LIST_ENUM?.WAITING_APPROVAL],
23853
+ level: [COUNT_LEVEL.ONE_LEVEL]
23854
+ }
23855
+ ]
23822
23856
  },
23823
23857
  {
23824
23858
  icon: /* @__PURE__ */ jsx(CancelSendApproveIcon, { className: "w-6 -h-6", size: 22, color: "#B2B7C2" }),
@@ -23831,7 +23865,17 @@ const ListDataConvert = ({
23831
23865
  content: "Bạn có chắc chắn muốn hủy gửi duyệt không?",
23832
23866
  arrShow: [CATEGORY_PRICE_LIST_ENUM?.WAITING_CONFIRM],
23833
23867
  showTitle: true,
23834
- countLevel: [COUNT_LEVEL.ONE_LEVEL, COUNT_LEVEL.TWO_LEVEL]
23868
+ countLevel: [COUNT_LEVEL.ONE_LEVEL, COUNT_LEVEL.TWO_LEVEL],
23869
+ arrShows: [
23870
+ {
23871
+ status: [CATEGORY_PRICE_LIST_ENUM?.WAITING_APPROVAL],
23872
+ level: [COUNT_LEVEL.ONE_LEVEL, COUNT_LEVEL.TWO_LEVEL]
23873
+ },
23874
+ {
23875
+ status: [CATEGORY_PRICE_LIST_ENUM?.WAITING_CONFIRM],
23876
+ level: [COUNT_LEVEL.ONE_LEVEL]
23877
+ }
23878
+ ]
23835
23879
  },
23836
23880
  {
23837
23881
  icon: /* @__PURE__ */ jsx(RejectApproveIcon, { className: "w-6 -h-6", size: 22, color: "#B2B7C2" }),
@@ -23844,7 +23888,17 @@ const ListDataConvert = ({
23844
23888
  content: "Bạn có chắc chắn muốn từ chối duyệt không? Hành động này không thể hoàn tác.",
23845
23889
  arrShow: [CATEGORY_PRICE_LIST_ENUM?.WAITING_CONFIRM],
23846
23890
  showTitle: true,
23847
- countLevel: [COUNT_LEVEL.ONE_LEVEL, COUNT_LEVEL.TWO_LEVEL]
23891
+ countLevel: [COUNT_LEVEL.ONE_LEVEL, COUNT_LEVEL.TWO_LEVEL],
23892
+ arrShows: [
23893
+ {
23894
+ status: [CATEGORY_PRICE_LIST_ENUM?.WAITING_APPROVAL],
23895
+ level: [COUNT_LEVEL.ONE_LEVEL, COUNT_LEVEL.TWO_LEVEL]
23896
+ },
23897
+ {
23898
+ status: [CATEGORY_PRICE_LIST_ENUM?.WAITING_CONFIRM],
23899
+ level: [COUNT_LEVEL.ONE_LEVEL]
23900
+ }
23901
+ ]
23848
23902
  },
23849
23903
  {
23850
23904
  icon: /* @__PURE__ */ jsx(ApproveIcon, { className: "w-6 -h-6", size: 22, color: "#B2B7C2" }),
@@ -23878,19 +23932,25 @@ const DropListActions = ({
23878
23932
  }) => {
23879
23933
  //! State
23880
23934
  //! Function
23881
- const IsShow = (arrStatus, arrLevel) => {
23882
- return arrStatus.includes(status) && arrLevel.includes(countLevel);
23935
+ const IsShow = (arrShows) => {
23936
+ console.log("arrShows", arrShows);
23937
+ if (!arrShows || arrShows.length === 0) return false;
23938
+ return arrShows.some((cond) => {
23939
+ const okStatus = !cond.status || cond.status.length === 0 || cond.status.includes(status);
23940
+ const okLevel = !cond.level || cond.level.length === 0 || cond.level.includes(countLevel);
23941
+ return okStatus && okLevel;
23942
+ });
23883
23943
  };
23884
23944
  const renderContentPopover = () => {
23885
23945
  return /* @__PURE__ */ jsx("div", { className: "flex flex-col", children: !isEmpty(listIcon) && listIcon?.map(
23886
- (item, index) => item?.showTitle && IsShow(item?.arrShow, item?.countLevel) && /* @__PURE__ */ jsxs(
23946
+ (item, index) => item?.showTitle && IsShow(item?.arrShows) && /* @__PURE__ */ jsxs(
23887
23947
  "button",
23888
23948
  {
23889
23949
  className: twMerge(
23890
23950
  "flex gap-4 px-3 py-2 rounded-sm transition duration-200 hover:rounded-sm",
23891
- IsShow(item?.arrShow, item?.countLevel) ? "hover:bg-[#F5F6F7] cursor-pointer" : "text-[#B2B7C2] cursor-not-allowed"
23951
+ IsShow(item?.arrShows) ? "hover:bg-[#F5F6F7] cursor-pointer" : "text-[#B2B7C2] cursor-not-allowed"
23892
23952
  ),
23893
- disabled: IsShow(item?.arrShow, item?.countLevel) ? false : true,
23953
+ disabled: IsShow(item?.arrShows) ? false : true,
23894
23954
  onClick: () => {
23895
23955
  toggle();
23896
23956
  setNotifyContent({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pnkx-lib/ui",
3
3
  "private": false,
4
- "version": "1.9.520",
4
+ "version": "1.9.522",
5
5
  "type": "module",
6
6
  "main": "./es/index.js",
7
7
  "module": "./es/index.js",
@@ -22,5 +22,9 @@ export type TListIcon = {
22
22
  name?: string;
23
23
  showTitle?: boolean;
24
24
  countLevel?: COUNT_LEVEL[];
25
+ arrShows?: {
26
+ status?: CATEGORY_PRICE_LIST_ENUM[];
27
+ level?: COUNT_LEVEL[];
28
+ }[];
25
29
  };
26
30
  export declare const ListDataConvert: ({ isApproved, typeService, handleBulkAction, handleBulkActionPrice, }: CustomeBulkActionsProps) => TListIcon[];
@@ -1,13 +1,17 @@
1
1
  import { ConfirmModalProps } from '../ConfirmModal';
2
- import { CATEGORY_LIST_ENUM, COUNT_LEVEL } from '../CategoryStatus';
2
+ import { CATEGORY_LIST_ENUM, CATEGORY_PRICE_LIST_ENUM, COUNT_LEVEL } from '../CategoryStatus';
3
3
  export interface DropListActionsProps {
4
4
  listIcon: TListIcon[];
5
- status?: unknown;
5
+ status: CATEGORY_PRICE_LIST_ENUM;
6
6
  setNotifyContent: React.Dispatch<React.SetStateAction<ConfirmModalProps>>;
7
7
  toggle: () => void;
8
8
  contentDropList?: React.ReactNode;
9
- countLevel?: COUNT_LEVEL;
9
+ countLevel: COUNT_LEVEL;
10
10
  }
11
+ export type typeArrShows = {
12
+ status?: CATEGORY_PRICE_LIST_ENUM[];
13
+ level?: COUNT_LEVEL[];
14
+ };
11
15
  export type TListIcon = {
12
16
  icon: React.ReactNode;
13
17
  iconDisable: React.ReactNode;
@@ -20,5 +24,6 @@ export type TListIcon = {
20
24
  name?: string;
21
25
  showTitle?: boolean;
22
26
  countLevel: COUNT_LEVEL[];
27
+ arrShows: typeArrShows[];
23
28
  };
24
29
  export declare const DropListActions: ({ listIcon, status, setNotifyContent, toggle, contentDropList, countLevel, }: DropListActionsProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,17 +1,17 @@
1
1
  import { TypeBulkActions, TypeCategoryBulkActions } from '../../../constants/bulkAction';
2
2
  import { default as React } from 'react';
3
3
  import { BulkActionHandlers, BulkActionPriceHandlers } from '@pnkx-lib/core';
4
- import { COUNT_LEVEL } from '../CategoryStatus';
4
+ import { CATEGORY_PRICE_LIST_ENUM, COUNT_LEVEL } from '../CategoryStatus';
5
5
  interface CustomeBulkActionsProps {
6
6
  quantity?: number;
7
- status?: unknown;
7
+ status: CATEGORY_PRICE_LIST_ENUM;
8
8
  isApproved?: boolean;
9
9
  typeBulkaction?: TypeBulkActions;
10
10
  typeService?: TypeCategoryBulkActions;
11
11
  handleBulkAction?: BulkActionHandlers;
12
12
  handleBulkActionPrice?: BulkActionPriceHandlers;
13
13
  contentDropList?: React.ReactNode;
14
- countLevel?: COUNT_LEVEL;
14
+ countLevel: COUNT_LEVEL;
15
15
  }
16
16
  export declare const CustomeBulkActions: ({ quantity, status, isApproved, typeBulkaction, typeService, handleBulkAction, handleBulkActionPrice, contentDropList, countLevel, }: CustomeBulkActionsProps) => import("react/jsx-runtime").JSX.Element;
17
17
  declare const _default: React.MemoExoticComponent<({ quantity, status, isApproved, typeBulkaction, typeService, handleBulkAction, handleBulkActionPrice, contentDropList, countLevel, }: CustomeBulkActionsProps) => import("react/jsx-runtime").JSX.Element>;