@pnkx-lib/ui 1.9.438 → 1.9.439

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.
@@ -0,0 +1,43 @@
1
+ const START_PAGE = 1;
2
+ const START_PAGE_SIZE = 10;
3
+ const PAGE_NUMBER = "page";
4
+ const PAGE_SIZE = "size";
5
+ const SORT = "sort";
6
+ var TypeActionRowTable = /* @__PURE__ */ ((TypeActionRowTable2) => {
7
+ TypeActionRowTable2["DELETE"] = "DELETE";
8
+ TypeActionRowTable2["EDIT"] = "EDIT";
9
+ TypeActionRowTable2["UNDO"] = "UNDO";
10
+ TypeActionRowTable2["CANCELUNDO"] = "CANCELUNDO";
11
+ TypeActionRowTable2["CHECKIN"] = "CHECKIN";
12
+ TypeActionRowTable2["PRINT"] = "PRINT";
13
+ TypeActionRowTable2["PAYMENT"] = "PAYMENT";
14
+ TypeActionRowTable2["PLAY"] = "PLAY";
15
+ TypeActionRowTable2["PAUSE"] = "PAUSE";
16
+ TypeActionRowTable2["DOWNLOAD"] = "DOWNLOAD";
17
+ TypeActionRowTable2["VIEW"] = "VIEW";
18
+ return TypeActionRowTable2;
19
+ })(TypeActionRowTable || {});
20
+ var TypeBulkActions = /* @__PURE__ */ ((TypeBulkActions2) => {
21
+ TypeBulkActions2["BULKACTION"] = "bulkaction";
22
+ TypeBulkActions2["DROPLIST"] = "droplist";
23
+ return TypeBulkActions2;
24
+ })(TypeBulkActions || {});
25
+ var TypeStatusTable = /* @__PURE__ */ ((TypeStatusTable2) => {
26
+ TypeStatusTable2["ALL"] = "ALL";
27
+ TypeStatusTable2[TypeStatusTable2["DRAFT"] = 0] = "DRAFT";
28
+ TypeStatusTable2[TypeStatusTable2["WAITING_APPROVAL"] = 1] = "WAITING_APPROVAL";
29
+ TypeStatusTable2[TypeStatusTable2["ACTIVE"] = 2] = "ACTIVE";
30
+ TypeStatusTable2[TypeStatusTable2["INACTIVE"] = 3] = "INACTIVE";
31
+ TypeStatusTable2[TypeStatusTable2["REJECTED"] = 4] = "REJECTED";
32
+ TypeStatusTable2[TypeStatusTable2["DELETED"] = 5] = "DELETED";
33
+ return TypeStatusTable2;
34
+ })(TypeStatusTable || {});
35
+ var CategoryAccountStatus = /* @__PURE__ */ ((CategoryAccountStatus2) => {
36
+ CategoryAccountStatus2["ALL"] = "ALL";
37
+ CategoryAccountStatus2[CategoryAccountStatus2["ACTIVE"] = 1] = "ACTIVE";
38
+ CategoryAccountStatus2[CategoryAccountStatus2["INACTIVE"] = 2] = "INACTIVE";
39
+ CategoryAccountStatus2[CategoryAccountStatus2["DELETED"] = 3] = "DELETED";
40
+ return CategoryAccountStatus2;
41
+ })(CategoryAccountStatus || {});
42
+
43
+ export { CategoryAccountStatus as C, PAGE_NUMBER as P, START_PAGE as S, TypeActionRowTable as T, START_PAGE_SIZE as a, PAGE_SIZE as b, SORT as c, TypeBulkActions as d, TypeStatusTable as e };
@@ -1,45 +1,2 @@
1
1
  export { I as ID_TABLE_WRAPPER, a as MAX_TAG_COUNT, M as MAX_TAG_TEXT_LENGTH, T as TINY_API } from '../chunks/common-BcURBmQ-.js';
2
-
3
- const START_PAGE = 1;
4
- const START_PAGE_SIZE = 10;
5
- const PAGE_NUMBER = "page";
6
- const PAGE_SIZE = "size";
7
- const SORT = "sort";
8
- var TypeActionRowTable = /* @__PURE__ */ ((TypeActionRowTable2) => {
9
- TypeActionRowTable2["DELETE"] = "DELETE";
10
- TypeActionRowTable2["EDIT"] = "EDIT";
11
- TypeActionRowTable2["UNDO"] = "UNDO";
12
- TypeActionRowTable2["CANCELUNDO"] = "CANCELUNDO";
13
- TypeActionRowTable2["CHECKIN"] = "CHECKIN";
14
- TypeActionRowTable2["PRINT"] = "PRINT";
15
- TypeActionRowTable2["PAYMENT"] = "PAYMENT";
16
- TypeActionRowTable2["PLAY"] = "PLAY";
17
- TypeActionRowTable2["PAUSE"] = "PAUSE";
18
- TypeActionRowTable2["DOWNLOAD"] = "DOWNLOAD";
19
- TypeActionRowTable2["VIEW"] = "VIEW";
20
- return TypeActionRowTable2;
21
- })(TypeActionRowTable || {});
22
- var TypeBulkActions = /* @__PURE__ */ ((TypeBulkActions2) => {
23
- TypeBulkActions2["BULKACTION"] = "bulkaction";
24
- TypeBulkActions2["DROPLIST"] = "droplist";
25
- return TypeBulkActions2;
26
- })(TypeBulkActions || {});
27
- var TypeStatusTable = /* @__PURE__ */ ((TypeStatusTable2) => {
28
- TypeStatusTable2["ALL"] = "ALL";
29
- TypeStatusTable2[TypeStatusTable2["DRAFT"] = 0] = "DRAFT";
30
- TypeStatusTable2[TypeStatusTable2["WAITING_APPROVAL"] = 1] = "WAITING_APPROVAL";
31
- TypeStatusTable2[TypeStatusTable2["ACTIVE"] = 2] = "ACTIVE";
32
- TypeStatusTable2[TypeStatusTable2["INACTIVE"] = 3] = "INACTIVE";
33
- TypeStatusTable2[TypeStatusTable2["REJECTED"] = 4] = "REJECTED";
34
- TypeStatusTable2[TypeStatusTable2["DELETED"] = 5] = "DELETED";
35
- return TypeStatusTable2;
36
- })(TypeStatusTable || {});
37
- var CategoryAccountStatus = /* @__PURE__ */ ((CategoryAccountStatus2) => {
38
- CategoryAccountStatus2["ALL"] = "ALL";
39
- CategoryAccountStatus2[CategoryAccountStatus2["ACTIVE"] = 1] = "ACTIVE";
40
- CategoryAccountStatus2[CategoryAccountStatus2["INACTIVE"] = 2] = "INACTIVE";
41
- CategoryAccountStatus2[CategoryAccountStatus2["REJECTED"] = 3] = "REJECTED";
42
- return CategoryAccountStatus2;
43
- })(CategoryAccountStatus || {});
44
-
45
- export { CategoryAccountStatus, PAGE_NUMBER, PAGE_SIZE, SORT, START_PAGE, START_PAGE_SIZE, TypeActionRowTable, TypeBulkActions, TypeStatusTable };
2
+ export { C as CategoryAccountStatus, P as PAGE_NUMBER, b as PAGE_SIZE, c as SORT, S as START_PAGE, a as START_PAGE_SIZE, T as TypeActionRowTable, d as TypeBulkActions, e as TypeStatusTable } from '../chunks/table-DAdT33TE.js';
package/es/index.js CHANGED
@@ -48,9 +48,9 @@ export { Empty } from './ui/Empty.js';
48
48
  export { Image } from './ui/Image.js';
49
49
  export { ConfirmModal } from './ui/ConfirmModal.js';
50
50
  export { ErrorBoundary } from './ui/ErrorBoundary.js';
51
- export { CATEGORY_LIST_ENUM, CategoryStatus, badgeStatusCategoryConfig } from './ui/CategoryStatus.js';
51
+ export { CATEGORY_LIST_ENUM, CategoryStatus, badgeStatusCategoryAccount, badgeStatusCategoryConfig } from './ui/CategoryStatus.js';
52
52
  export { I as ID_TABLE_WRAPPER, a as MAX_TAG_COUNT, M as MAX_TAG_TEXT_LENGTH, T as TINY_API } from './chunks/common-BcURBmQ-.js';
53
- export { CategoryAccountStatus, PAGE_NUMBER, PAGE_SIZE, SORT, START_PAGE, START_PAGE_SIZE, TypeActionRowTable, TypeBulkActions, TypeStatusTable } from './constants/index.js';
53
+ export { C as CategoryAccountStatus, P as PAGE_NUMBER, b as PAGE_SIZE, c as SORT, S as START_PAGE, a as START_PAGE_SIZE, T as TypeActionRowTable, d as TypeBulkActions, e as TypeStatusTable } from './chunks/table-DAdT33TE.js';
54
54
  export { BreadcrumbHeading } from './ui/BreadcrumbHeading.js';
55
55
  export { Card } from './ui/Card.js';
56
56
  export { ConfigProvider } from './ui/ConfigProvider.js';
@@ -1,5 +1,6 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
3
+ import { C as CategoryAccountStatus } from '../chunks/table-DAdT33TE.js';
3
4
 
4
5
  var CATEGORY_LIST_ENUM = /* @__PURE__ */ ((CATEGORY_LIST_ENUM2) => {
5
6
  CATEGORY_LIST_ENUM2[CATEGORY_LIST_ENUM2["DRAFT"] = 0] = "DRAFT";
@@ -30,9 +31,20 @@ const badgeStatusCategoryConfig = {
30
31
  text: "Đã xóa"
31
32
  }
32
33
  };
33
- const CategoryStatus = ({ status }) => {
34
+ const badgeStatusCategoryAccount = {
35
+ [CategoryAccountStatus.ACTIVE]: { color: "bg-[#27CD7F]", text: "Hoạt động" },
36
+ [CategoryAccountStatus.INACTIVE]: {
37
+ color: "bg-[#DD4338]",
38
+ text: "Ngừng hoạt động"
39
+ },
40
+ [CategoryAccountStatus.DELETED]: {
41
+ color: "bg-[#B2B7C2]",
42
+ text: "Đã xóa"
43
+ }
44
+ };
45
+ const CategoryStatus = ({ status, mode }) => {
34
46
  //! State
35
- const bagde = badgeStatusCategoryConfig[Number(status)];
47
+ const bagde = mode === "categoryAccount" ? badgeStatusCategoryAccount[Number(status)] : badgeStatusCategoryConfig[Number(status)];
36
48
  //! Function
37
49
  const ItemStatus = ({
38
50
  color,
@@ -47,4 +59,4 @@ const CategoryStatus = ({ status }) => {
47
59
  return /* @__PURE__ */ jsx(ItemStatus, { color: bagde?.color, statusName: bagde?.text });
48
60
  };
49
61
 
50
- export { CATEGORY_LIST_ENUM, CategoryStatus, badgeStatusCategoryConfig };
62
+ export { CATEGORY_LIST_ENUM, CategoryStatus, badgeStatusCategoryAccount, badgeStatusCategoryConfig };
package/es/ui/index.js CHANGED
@@ -7,8 +7,8 @@ import { useState, useCallback, useEffect, useRef } from 'react';
7
7
  import { Select, Input, Pagination, Table as Table$1, Tooltip as Tooltip$1 } from 'antd';
8
8
  import { I as ID_TABLE_WRAPPER } from '../chunks/common-BcURBmQ-.js';
9
9
  export { a as MAX_TAG_COUNT, M as MAX_TAG_TEXT_LENGTH, T as TINY_API } from '../chunks/common-BcURBmQ-.js';
10
- import { TypeStatusTable, TypeActionRowTable, TypeBulkActions } from '../constants/index.js';
11
- export { CategoryAccountStatus, PAGE_NUMBER, PAGE_SIZE, SORT, START_PAGE, START_PAGE_SIZE } from '../constants/index.js';
10
+ import { e as TypeStatusTable, T as TypeActionRowTable, d as TypeBulkActions } from '../chunks/table-DAdT33TE.js';
11
+ export { C as CategoryAccountStatus, P as PAGE_NUMBER, b as PAGE_SIZE, c as SORT, S as START_PAGE, a as START_PAGE_SIZE } from '../chunks/table-DAdT33TE.js';
12
12
  export { Modal } from './Modal.js';
13
13
  import { Tooltip } from './Tooltip.js';
14
14
  export { Tabs } from './Tabs.js';
@@ -55,7 +55,7 @@ export { Image } from './Image.js';
55
55
  import { ConfirmModal } from './ConfirmModal.js';
56
56
  export { ErrorBoundary } from './ErrorBoundary.js';
57
57
  import { CATEGORY_LIST_ENUM } from './CategoryStatus.js';
58
- export { CategoryStatus, badgeStatusCategoryConfig } from './CategoryStatus.js';
58
+ export { CategoryStatus, badgeStatusCategoryAccount, badgeStatusCategoryConfig } from './CategoryStatus.js';
59
59
  import { useToggle } from '@pnkx-lib/core';
60
60
  import { isEmpty, isBoolean } from 'lodash';
61
61
  import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pnkx-lib/ui",
3
3
  "private": false,
4
- "version": "1.9.438",
4
+ "version": "1.9.439",
5
5
  "type": "module",
6
6
  "main": "./es/index.js",
7
7
  "module": "./es/index.js",
@@ -1,4 +1,4 @@
1
- import { TypeStatusTable } from '../../constants';
1
+ import { CategoryAccountStatus, TypeStatusTable } from '../../constants';
2
2
  export declare enum CATEGORY_LIST_ENUM {
3
3
  DRAFT = 0,// tạo mới
4
4
  WATING_APPROVAL = 1,// đang chờ duyệt
@@ -14,8 +14,10 @@ type BadgeConfig = {
14
14
  };
15
15
  };
16
16
  export declare const badgeStatusCategoryConfig: BadgeConfig;
17
+ export declare const badgeStatusCategoryAccount: BadgeConfig;
17
18
  export interface CategoryStatusProps {
18
- status: TypeStatusTable;
19
+ status: TypeStatusTable | CategoryAccountStatus;
20
+ mode?: string;
19
21
  }
20
- export declare const CategoryStatus: ({ status }: CategoryStatusProps) => import("react/jsx-runtime").JSX.Element;
22
+ export declare const CategoryStatus: ({ status, mode }: CategoryStatusProps) => import("react/jsx-runtime").JSX.Element;
21
23
  export {};
@@ -33,5 +33,5 @@ export declare enum CategoryAccountStatus {
33
33
  ALL = "ALL",// Tất cả
34
34
  ACTIVE = 1,// Hoạt động
35
35
  INACTIVE = 2,// Không hoạt động
36
- REJECTED = 3
36
+ DELETED = 3
37
37
  }