@pnkx-lib/ui 1.9.35 → 1.9.37

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,5 +1,5 @@
1
- import { j as jsxRuntimeExports, c as Icon, _ as _extends, d as _typeof, P as PnkxField, C as CheckboxField, u as useForm, I as Input, e as classNames, f as _arrayLikeToArray, h as _unsupportedIterableToArray, w as warningOnce, i as _createClass, k as _classCallCheck, l as _defineProperty, m as _slicedToArray, n as warning$1, o as canUseDom, p as _objectSpread2, q as updateCSS, r as removeCSS, s as _arrayWithHoles, t as _nonIterableRest, v as resetWarned$1, F as FastColor, x as generate, y as presetPrimaryColors, z as presetPalettes, A as _inherits, B as _createSuper, G as _assertThisInitialized, H as _objectWithoutProperties, J as IconContext } from './Switch-Ck9WdQgt.js';
2
- import { Button as Button$1, Cascader, Space as Space$1, Card, Skeleton as Skeleton$1, Modal as Modal$1, Tooltip as Tooltip$1, Popconfirm as Popconfirm$1, Typography, Table as Table$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';
1
+ import { j as jsxRuntimeExports, c as Icon, _ as _extends, d as _typeof, P as PnkxField, C as CheckboxField, u as useForm, I as Input, S as Select, e as classNames, T as Typography, l as lodashExports, f as RefIcon$7, h as _arrayLikeToArray, i as _unsupportedIterableToArray, w as warningOnce, k as _createClass, m as _classCallCheck, n as _defineProperty, o as _slicedToArray, p as warning$1, q as canUseDom, r as _objectSpread2, s as updateCSS, t as removeCSS, v as _arrayWithHoles, x as _nonIterableRest, y as resetWarned$1, F as FastColor, z as generate, A as presetPrimaryColors, B as presetPalettes, G as _inherits, H as _createSuper, J as _assertThisInitialized, K as _objectWithoutProperties, M as IconContext } from './Switch-5fY0eC69.js';
2
+ import { Button as Button$1, Cascader, Space as Space$1, Card, Skeleton as Skeleton$1, Modal as Modal$1, Tag as Tag$1, Badge as Badge$1, Breadcrumb as Breadcrumb$1, Tooltip as Tooltip$1, Divider as Divider$2, Popconfirm as Popconfirm$1, Typography as Typography$1, Table as Table$1, Tabs as Tabs$1, Popover as Popover$1, Col as Col$1, Row as Row$1, Dropdown as Dropdown$1, Flex as Flex$1, Splitter as Splitter$1, Menu as Menu$1, Pagination as Pagination$1, Steps as Steps$1, 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, useLayoutEffect as useLayoutEffect$1, useEffect, useRef, useMemo as useMemo$1, useCallback, useState, createContext, memo, useReducer, useContext, Component } from 'react';
5
5
  import ReactDOM__default, { unstable_batchedUpdates, createPortal } from 'react-dom';
@@ -2177,12 +2177,12 @@ const Skeleton = ({ type, skeletonButtonCount }) => {
2177
2177
  }
2178
2178
  ),
2179
2179
  /* @__PURE__ */ jsxRuntimeExports.jsx(Card, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Space$1, { direction: "vertical", size: "middle", style: { width: "100%" }, children: renderInputs(10) }) }),
2180
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { ...styles$1.rightAlign, marginTop: 20 }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton$1.Input, { size: "small", active: true }) })
2180
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { ...styles$2.rightAlign, marginTop: 20 }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton$1.Input, { size: "small", active: true }) })
2181
2181
  ] });
2182
2182
  }
2183
2183
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Card, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { display: "grid", rowGap: 8 }, children: renderInputs(3) }) });
2184
2184
  };
2185
- const styles$1 = {
2185
+ const styles$2 = {
2186
2186
  rightAlign: {
2187
2187
  display: "flex",
2188
2188
  justifyContent: "flex-end",
@@ -6553,18 +6553,34 @@ const DragIcon = ({ stroke, fill }) => /* @__PURE__ */ jsxRuntimeExports.jsx("sv
6553
6553
  }
6554
6554
  ) });
6555
6555
 
6556
- const SettingIcon = ({ stroke, fill }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: 30, height: 30, fill: "none", children: [
6557
- /* @__PURE__ */ jsxRuntimeExports.jsx("rect", { width: 29, height: 29, x: 0.5, y: 0.5, fill: "#fff", rx: 14.5 }),
6558
- /* @__PURE__ */ jsxRuntimeExports.jsx("rect", { width: 29, height: 29, x: 0.5, y: 0.5, stroke: "#D6E6FE", rx: 14.5 }),
6559
- /* @__PURE__ */ jsxRuntimeExports.jsx(
6560
- "path",
6561
- {
6562
- fill,
6563
- stroke,
6564
- d: "M16.085 11a1.5 1.5 0 0 1 2.83 0H21v1h-2.085a1.5 1.5 0 0 1-2.83 0H9v-1h5.987M17 11v1h1v-1h-1Zm.5 7a1.5 1.5 0 0 1 1.415 1H21v1h-2.085a1.5 1.5 0 0 1-2.83 0H9v-1h7.085a1.5 1.5 0 0 1 1.415-1Zm-.5 1v1h1v-1h-1Zm4-4v1h-7.085a1.5 1.5 0 0 1-2.83 0H9v-1h2.085a1.5 1.5 0 0 1 2.83 0H21Zm-9 0v1h1v-1h-1Z"
6565
- }
6566
- )
6567
- ] });
6556
+ const SettingIcon = ({
6557
+ stroke,
6558
+ fill,
6559
+ className,
6560
+ onClick
6561
+ }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
6562
+ "svg",
6563
+ {
6564
+ xmlns: "http://www.w3.org/2000/svg",
6565
+ width: 30,
6566
+ height: 30,
6567
+ fill: "none",
6568
+ className,
6569
+ onClick,
6570
+ children: [
6571
+ /* @__PURE__ */ jsxRuntimeExports.jsx("rect", { width: 29, height: 29, x: 0.5, y: 0.5, fill: "#fff", rx: 14.5 }),
6572
+ /* @__PURE__ */ jsxRuntimeExports.jsx("rect", { width: 29, height: 29, x: 0.5, y: 0.5, stroke: "#D6E6FE", rx: 14.5 }),
6573
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
6574
+ "path",
6575
+ {
6576
+ fill,
6577
+ stroke,
6578
+ d: "M16.085 11a1.5 1.5 0 0 1 2.83 0H21v1h-2.085a1.5 1.5 0 0 1-2.83 0H9v-1h5.987M17 11v1h1v-1h-1Zm.5 7a1.5 1.5 0 0 1 1.415 1H21v1h-2.085a1.5 1.5 0 0 1-2.83 0H9v-1h7.085a1.5 1.5 0 0 1 1.415-1Zm-.5 1v1h1v-1h-1Zm4-4v1h-7.085a1.5 1.5 0 0 1-2.83 0H9v-1h2.085a1.5 1.5 0 0 1 2.83 0H21Zm-9 0v1h1v-1h-1Z"
6579
+ }
6580
+ )
6581
+ ]
6582
+ }
6583
+ );
6568
6584
 
6569
6585
  const SendApprovalIcon = ({ stroke, fill }) => /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: 22, height: 22, fill: "none", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
6570
6586
  "path",
@@ -9764,10 +9780,500 @@ const SettingTable = (props) => {
9764
9780
  );
9765
9781
  };
9766
9782
 
9783
+ const containerSearchSelect = "_containerSearchSelect_1f1fs_1";
9784
+ const inputSearchKey = "_inputSearchKey_1f1fs_8";
9785
+ const customBadge = "_customBadge_1f1fs_14";
9786
+ const customBadgeActive = "_customBadgeActive_1f1fs_22";
9787
+ const customContainButtonIcon = "_customContainButtonIcon_1f1fs_31";
9788
+ const styles$1 = {
9789
+ containerSearchSelect: containerSearchSelect,
9790
+ inputSearchKey: inputSearchKey,
9791
+ customBadge: customBadge,
9792
+ customBadgeActive: customBadgeActive,
9793
+ customContainButtonIcon: customContainButtonIcon
9794
+ };
9795
+
9796
+ class Timer {
9797
+ timer;
9798
+ constructor() {
9799
+ this.timer = null;
9800
+ }
9801
+ debounce(func, time) {
9802
+ if (this.timer) {
9803
+ clearTimeout(this.timer);
9804
+ }
9805
+ this.timer = setTimeout(func, time);
9806
+ }
9807
+ }
9808
+
9809
+ const SearchIcon = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(
9810
+ "svg",
9811
+ {
9812
+ xmlns: "http://www.w3.org/2000/svg",
9813
+ width: 18,
9814
+ height: 18,
9815
+ fill: "none",
9816
+ ...props,
9817
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
9818
+ "path",
9819
+ {
9820
+ fill: props?.color || "#116DFF",
9821
+ fillRule: "evenodd",
9822
+ d: "M14.854 14.147a.498.498 0 0 1-.704.703l-2.13-2.124a5.5 5.5 0 1 1 .707-.707l2.127 2.128ZM8.5 13a4.5 4.5 0 1 0 0-9 4.5 4.5 0 0 0 0 9Z",
9823
+ clipRule: "evenodd"
9824
+ }
9825
+ )
9826
+ }
9827
+ );
9828
+
9829
+ const AllowClearIcon = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(
9830
+ "svg",
9831
+ {
9832
+ xmlns: "http://www.w3.org/2000/svg",
9833
+ width: 6,
9834
+ height: 6,
9835
+ fill: "none",
9836
+ ...props,
9837
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
9838
+ "path",
9839
+ {
9840
+ fill: props?.color || "#116DFF",
9841
+ fillRule: "evenodd",
9842
+ d: "M5.2 0 3 2.2.8 0 0 .8 2.2 3 0 5.3l.8.7L3 3.8 5.2 6l.8-.7L3.8 3 6 .8 5.2 0Z",
9843
+ clipRule: "evenodd"
9844
+ }
9845
+ )
9846
+ }
9847
+ );
9848
+
9849
+ const TrashCanIcon = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(
9850
+ "svg",
9851
+ {
9852
+ width: "18",
9853
+ height: "18",
9854
+ viewBox: "0 0 24 24",
9855
+ fill: "none",
9856
+ xmlns: "http://www.w3.org/2000/svg",
9857
+ ...props,
9858
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
9859
+ "path",
9860
+ {
9861
+ d: "M18.893 18.0357L19.393 18.0402V18.0402L18.893 18.0357ZM4.00049 5.5C3.72435 5.5 3.50049 5.72386 3.50049 6C3.50049 6.27614 3.72435 6.5 4.00049 6.5V5.5ZM20.0005 6.5C20.2766 6.5 20.5005 6.27614 20.5005 6C20.5005 5.72386 20.2766 5.5 20.0005 5.5V6.5ZM10.5005 10C10.5005 9.72386 10.2766 9.5 10.0005 9.5C9.72435 9.5 9.50049 9.72386 9.50049 10H10.5005ZM9.50049 18C9.50049 18.2761 9.72435 18.5 10.0005 18.5C10.2766 18.5 10.5005 18.2761 10.5005 18H9.50049ZM14.5005 10C14.5005 9.72386 14.2766 9.5 14.0005 9.5C13.7243 9.5 13.5005 9.72386 13.5005 10H14.5005ZM13.5005 18C13.5005 18.2761 13.7243 18.5 14.0005 18.5C14.2766 18.5 14.5005 18.2761 14.5005 18H13.5005ZM19.0005 6L18.5005 5.99554L18.393 18.0312L18.893 18.0357L19.393 18.0402L19.5005 6.00446L19.0005 6ZM14.8932 22V21.5H9.00049V22V22.5H14.8932V22ZM5.00049 6H4.50049V18H5.00049H5.50049V6H5.00049ZM4.00049 6V6.5H5.00049V6V5.5H4.00049V6ZM5.00049 6V6.5H8.00049V6V5.5H5.00049V6ZM8.00049 6V6.5H16.0005V6V5.5H8.00049V6ZM16.0005 6V6.5H19.0005V6V5.5H16.0005V6ZM19.0005 6V6.5H20.0005V6V5.5H19.0005V6ZM8.00049 5.55556H8.50049C8.50049 3.92176 10.0105 2.5 12.0005 2.5V2V1.5C9.5722 1.5 7.50049 3.262 7.50049 5.55556H8.00049ZM12.0005 2V2.5C13.9905 2.5 15.5005 3.92176 15.5005 5.55556H16.0005H16.5005C16.5005 3.262 14.4288 1.5 12.0005 1.5V2ZM8.00049 5.55556H7.50049V6H8.00049H8.50049V5.55556H8.00049ZM16.0005 5.55556H15.5005V6H16.0005H16.5005V5.55556H16.0005ZM9.00049 22V21.5C7.06749 21.5 5.50049 19.933 5.50049 18H5.00049H4.50049C4.50049 20.4853 6.51521 22.5 9.00049 22.5V22ZM18.893 18.0357L18.393 18.0312C18.3759 19.952 16.814 21.5 14.8932 21.5V22V22.5C17.3628 22.5 19.371 20.5097 19.393 18.0402L18.893 18.0357ZM10.0005 10H9.50049V18H10.0005H10.5005V10H10.0005ZM14.0005 10H13.5005V18H14.0005H14.5005V10H14.0005Z",
9862
+ fill: props?.color || "#E0E0E0"
9863
+ }
9864
+ )
9865
+ }
9866
+ );
9867
+
9868
+ const RenderFilterFields = (props) => {
9869
+ const {
9870
+ control,
9871
+ handleSubmit,
9872
+ reset,
9873
+ isHiddenRemove,
9874
+ resetToInitialFilters,
9875
+ isNullFilter
9876
+ } = props;
9877
+ const timer = new Timer();
9878
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-3 mb-3 ", children: [
9879
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
9880
+ PnkxField,
9881
+ {
9882
+ iconStartInput: /* @__PURE__ */ jsxRuntimeExports.jsx(SearchIcon, {}),
9883
+ allowClear: {
9884
+ clearIcon: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "!bg-[#E7F0FF] w-[18px] h-[18px] inline-flex justify-center !items-center rounded-[50%]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(AllowClearIcon, { className: "" }) })
9885
+ },
9886
+ className: `!w-[255px] !rounded-[100px] !border-[#BDE3FF] ${styles$1.inputSearchKey}`,
9887
+ component: Input,
9888
+ name: "textSearch",
9889
+ control,
9890
+ type: "search",
9891
+ placeholder: "Tìm theo mã, tên thuộc tính",
9892
+ afterOnChange: () => {
9893
+ timer.debounce((e) => {
9894
+ if (handleSubmit) {
9895
+ handleSubmit(e);
9896
+ }
9897
+ }, 300);
9898
+ }
9899
+ }
9900
+ ),
9901
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
9902
+ PnkxField,
9903
+ {
9904
+ className: styles$1.containerSearchSelect,
9905
+ component: Select,
9906
+ name: "attributeTypeValue",
9907
+ control,
9908
+ options: [
9909
+ {
9910
+ value: "1",
9911
+ label: "Loại 1"
9912
+ },
9913
+ {
9914
+ value: "2",
9915
+ label: "Loại 2"
9916
+ },
9917
+ {
9918
+ value: "3",
9919
+ label: "Loại 3"
9920
+ }
9921
+ ],
9922
+ placeholder: "Loại thuộc tính",
9923
+ afterOnChange: () => {
9924
+ timer.debounce((e) => {
9925
+ if (handleSubmit) {
9926
+ handleSubmit(e);
9927
+ }
9928
+ }, 300);
9929
+ }
9930
+ }
9931
+ ),
9932
+ !isHiddenRemove && /* @__PURE__ */ jsxRuntimeExports.jsx(
9933
+ Button,
9934
+ {
9935
+ onClick: () => {
9936
+ resetToInitialFilters();
9937
+ if (reset) {
9938
+ reset();
9939
+ }
9940
+ },
9941
+ className: twMerge(
9942
+ "!rounded-full items-center",
9943
+ isNullFilter ? "!border-none !text-[#E0E0E0] !shadow-none !font-light" : "!border-[#FFCDC9] !text-[#DD4338]",
9944
+ styles$1.customContainButtonIcon
9945
+ ),
9946
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(TrashCanIcon, { color: isNullFilter ? "" : "#DD4338" }),
9947
+ children: "Xoá tất cả"
9948
+ }
9949
+ )
9950
+ ] });
9951
+ };
9952
+
9953
+ const Tag = (props) => {
9954
+ const { children, ...rest } = props;
9955
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Tag$1, { ...rest, children: [
9956
+ " ",
9957
+ children
9958
+ ] });
9959
+ };
9960
+
9961
+ const TagsFilter = (props) => {
9962
+ const { items, resetToInitialFilters, reset, setItems, isHiddenRemove } = props;
9963
+ const handleRemoveTag = (removeIndex) => {
9964
+ if (!items) return;
9965
+ const newTags = [
9966
+ ...items.slice(0, removeIndex),
9967
+ ...items.slice(removeIndex + 1)
9968
+ ];
9969
+ console.log(newTags);
9970
+ setItems && setItems(newTags);
9971
+ };
9972
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "", children: [
9973
+ items?.map((tag, index) => /* @__PURE__ */ jsxRuntimeExports.jsx(
9974
+ Tag,
9975
+ {
9976
+ closable: {
9977
+ closeIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(AllowClearIcon, { className: "inline !ml-2", color: "#000624" }),
9978
+ "aria-label": "Close Button"
9979
+ },
9980
+ className: "!pt-[5px] !pb-[5px] !pl-[9px] w-fit !rounded-[100px] !text-[#0F1D40] !text-[14px]",
9981
+ color: "#C4DEF9",
9982
+ onClose: (e) => {
9983
+ e.preventDefault();
9984
+ handleRemoveTag(index);
9985
+ },
9986
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: tag })
9987
+ },
9988
+ index
9989
+ )),
9990
+ !isHiddenRemove && /* @__PURE__ */ jsxRuntimeExports.jsx(
9991
+ Button,
9992
+ {
9993
+ onClick: () => {
9994
+ resetToInitialFilters();
9995
+ if (reset) {
9996
+ reset();
9997
+ }
9998
+ setItems && setItems([]);
9999
+ },
10000
+ className: twMerge(
10001
+ "!rounded-[100px] !border-[#FFCDC9] !text-[#DD4338]",
10002
+ styles$1.customContainButtonIcon
10003
+ ),
10004
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(TrashCanIcon, { color: "#DD4338" }),
10005
+ children: "Xoá tất cả"
10006
+ }
10007
+ )
10008
+ ] });
10009
+ };
10010
+
10011
+ const typeColorMap = {
10012
+ error: "red",
10013
+ info: "blue",
10014
+ success: "green",
10015
+ warning: "yellow"
10016
+ };
10017
+ const Badge = ({ type, children, customColor, ...rest }) => {
10018
+ const color = type ? typeColorMap[type] : customColor;
10019
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Badge$1, { color, ...rest, children });
10020
+ };
10021
+
10022
+ const ButtonBadge = (props) => {
10023
+ const { label, value, active, setKeyActive, keyActive } = props;
10024
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
10025
+ Button,
10026
+ {
10027
+ className: `ml-1 mt-1 !rounded-[8px] !text-[12px] ${active ? "!border-[#007BE5] !bg-[#E5F4FF] !font-medium" : "!border-[white] !shadow-none"}`,
10028
+ onClick: () => setKeyActive(keyActive),
10029
+ children: [
10030
+ label,
10031
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
10032
+ Badge,
10033
+ {
10034
+ count: value,
10035
+ color: `${active ? "#BDE3FF]" : "#EEEEF0"}`,
10036
+ className: `!text-[#4D4D57] !rounded-[8px]
10037
+ ${active ? `!bg-[#BDE3FF] ${styles$1.customBadgeActive}` : `!bg-[#EEEEF0] ${styles$1.customBadge}`}
10038
+ `
10039
+ }
10040
+ )
10041
+ ]
10042
+ }
10043
+ );
10044
+ };
10045
+ const GroupHeadingButton = (props) => {
10046
+ const { keyActive, setKeyActive, items } = props;
10047
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "pb-[15px]", children: items?.map((i, index) => /* @__PURE__ */ jsxRuntimeExports.jsx(
10048
+ ButtonBadge,
10049
+ {
10050
+ label: i.label,
10051
+ value: i.value,
10052
+ active: i.keyActive === keyActive,
10053
+ setKeyActive,
10054
+ keyActive: i.keyActive
10055
+ },
10056
+ index
10057
+ )) });
10058
+ };
10059
+
10060
+ const SearchFiltersForm = ({
10061
+ initialValues,
10062
+ renderFilterFields,
10063
+ onSubmit,
10064
+ onReset,
10065
+ classNamesContainer,
10066
+ classNameWrapperForm,
10067
+ hideDefaultSubmit,
10068
+ hideResetButton
10069
+ }) => {
10070
+ const { control, handleSubmit, reset, setValue } = useForm({
10071
+ defaultValues: initialValues
10072
+ });
10073
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("form", { className: classNameWrapperForm, onSubmit: handleSubmit(onSubmit), children: [
10074
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classNamesContainer, children: renderFilterFields && renderFilterFields({
10075
+ control,
10076
+ setValue,
10077
+ handleSubmit: handleSubmit(onSubmit),
10078
+ reset
10079
+ }) }),
10080
+ !hideDefaultSubmit && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-end gap-2 mb-3", children: [
10081
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
10082
+ Button,
10083
+ {
10084
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon, {}),
10085
+ className: "px-3 py-1 ",
10086
+ color: "blue",
10087
+ variant: "solid",
10088
+ htmlType: "submit",
10089
+ children: "Tìm kiếm"
10090
+ }
10091
+ ),
10092
+ !hideResetButton && /* @__PURE__ */ jsxRuntimeExports.jsx(
10093
+ Button,
10094
+ {
10095
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$3, {}),
10096
+ className: "px-3 py-1",
10097
+ onClick: () => {
10098
+ reset();
10099
+ onReset?.();
10100
+ },
10101
+ children: "Đặt lại"
10102
+ }
10103
+ )
10104
+ ] })
10105
+ ] });
10106
+ };
10107
+
10108
+ const Breadcrumb = (props) => {
10109
+ const { containerClassName, breadcrumbClassName, ...restProps } = props;
10110
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: containerClassName, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Breadcrumb$1, { className: breadcrumbClassName, ...restProps }) });
10111
+ };
10112
+
10113
+ const Heading = (props) => {
10114
+ const {
10115
+ rightContent,
10116
+ children,
10117
+ noBreadcum,
10118
+ classNameWrapHeading,
10119
+ breadcrumbItems
10120
+ } = props;
10121
+ //! State
10122
+ //! Function
10123
+ //! Render
10124
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
10125
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
10126
+ "div",
10127
+ {
10128
+ className: classNames(
10129
+ "flex justify-between items-end ",
10130
+ classNameWrapHeading
10131
+ ),
10132
+ children: [
10133
+ !noBreadcum && /* @__PURE__ */ jsxRuntimeExports.jsx(Breadcrumb, { items: breadcrumbItems }),
10134
+ rightContent
10135
+ ]
10136
+ }
10137
+ ),
10138
+ children
10139
+ ] });
10140
+ };
10141
+
10142
+ function hasFalsyFieldsObject(obj) {
10143
+ return Object.values(obj).every((value) => !value);
10144
+ }
10145
+
9767
10146
  const Tooltip = ({ children, ...props }) => {
9768
10147
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip$1, { ...props, children });
9769
10148
  };
9770
10149
 
10150
+ const IconSettingTable = (props) => {
10151
+ const { showSetting, setOpenStting } = props;
10152
+ if (showSetting) {
10153
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "w-5 mr-3 ", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { title: "Cài đặt hiển thị bảng", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
10154
+ SettingIcon,
10155
+ {
10156
+ className: "cursor-pointer",
10157
+ onClick: () => setOpenStting(true)
10158
+ }
10159
+ ) }) });
10160
+ }
10161
+ return null;
10162
+ };
10163
+
10164
+ const Divider$1 = ({ children, ...rest }) => {
10165
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Divider$2, { ...rest, children });
10166
+ };
10167
+
10168
+ const breadCrumb = [
10169
+ {
10170
+ href: "/main",
10171
+ title: "Trang chủ"
10172
+ },
10173
+ {
10174
+ href: "/category",
10175
+ title: "Danh mục"
10176
+ },
10177
+ {
10178
+ title: /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: "", children: "Danh mục thuộc tính" })
10179
+ }
10180
+ ];
10181
+ const HeadingTable = (props) => {
10182
+ const {
10183
+ filters,
10184
+ handleSearch,
10185
+ resetToInitialFilters,
10186
+ setOpenStting,
10187
+ showSetting,
10188
+ keyActive,
10189
+ setKeyActive,
10190
+ groupHeadingButtonItems,
10191
+ tagSearchItems,
10192
+ setTagSearchItems
10193
+ } = props;
10194
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
10195
+ Heading,
10196
+ {
10197
+ breadcrumbItems: breadCrumb,
10198
+ classNameWrapHeading: "justify-between",
10199
+ rightContent: /* @__PURE__ */ jsxRuntimeExports.jsx(
10200
+ Button,
10201
+ {
10202
+ color: "blue",
10203
+ variant: "solid",
10204
+ shape: "round",
10205
+ rootClassName: "transform translate-y-[110%]",
10206
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$7, {}),
10207
+ children: "Thêm mới"
10208
+ }
10209
+ ),
10210
+ children: [
10211
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Title, { level: 2, children: " Danh mục thuộc tính" }),
10212
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
10213
+ SearchFiltersForm,
10214
+ {
10215
+ onSubmit: (values) => {
10216
+ handleSearch({
10217
+ ...filters,
10218
+ keyword: values?.keyword,
10219
+ attributeType: values?.attributeType
10220
+ });
10221
+ },
10222
+ initialValues: {
10223
+ keyword: filters?.keyword,
10224
+ attributeType: filters?.attributeType
10225
+ },
10226
+ classNamesContainer: "flex",
10227
+ hideDefaultSubmit: true,
10228
+ renderFilterFields: ({ control, handleSubmit, reset }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
10229
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
10230
+ RenderFilterFields,
10231
+ {
10232
+ control,
10233
+ handleSubmit,
10234
+ reset,
10235
+ resetToInitialFilters,
10236
+ isHiddenRemove: !!tagSearchItems && tagSearchItems?.length > 0,
10237
+ isNullFilter: hasFalsyFieldsObject(
10238
+ lodashExports.omit(filters, ["PageIndex", "PageSize"])
10239
+ )
10240
+ }
10241
+ ),
10242
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
10243
+ TagsFilter,
10244
+ {
10245
+ items: tagSearchItems,
10246
+ setItems: setTagSearchItems,
10247
+ resetToInitialFilters,
10248
+ isHiddenRemove: !tagSearchItems || tagSearchItems?.length === 0
10249
+ }
10250
+ )
10251
+ ] })
10252
+ }
10253
+ ),
10254
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Divider$1, {}),
10255
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
10256
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
10257
+ GroupHeadingButton,
10258
+ {
10259
+ keyActive,
10260
+ setKeyActive,
10261
+ items: groupHeadingButtonItems
10262
+ }
10263
+ ),
10264
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
10265
+ IconSettingTable,
10266
+ {
10267
+ setOpenStting,
10268
+ showSetting
10269
+ }
10270
+ )
10271
+ ] })
10272
+ ]
10273
+ }
10274
+ );
10275
+ };
10276
+
9771
10277
  const EditableCell = ({
9772
10278
  editing,
9773
10279
  dataIndex,
@@ -9829,6 +10335,13 @@ const Table = ({
9829
10335
  titleSettingTableModal,
9830
10336
  showSetting,
9831
10337
  setColumns,
10338
+ resetToInitialFilters,
10339
+ handleSearch,
10340
+ groupHeadingButtonItems,
10341
+ tagSearchItems,
10342
+ setTagSearchItems,
10343
+ setKeyActive,
10344
+ keyActive,
9832
10345
  ...rest
9833
10346
  }) => {
9834
10347
  //! State
@@ -9894,7 +10407,7 @@ const Table = ({
9894
10407
  {
9895
10408
  title: "Bạn có chắc chắn muốn huỷ chỉnh sửa?",
9896
10409
  onConfirm: cancel,
9897
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { type: "danger", children: " Huỷ bỏ" })
10410
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Typography$1.Text, { type: "danger", children: " Huỷ bỏ" })
9898
10411
  }
9899
10412
  ),
9900
10413
  /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { htmlType: "submit", variant: "text", color: "blue", children: "Lưu" })
@@ -9963,14 +10476,22 @@ const Table = ({
9963
10476
  /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-500", children: "Kiểm tra lại bộ lọc hoặc thêm mới dữ liệu" })
9964
10477
  ] });
9965
10478
  };
9966
- const settingDiv = () => {
9967
- if (showSetting) {
9968
- return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "absolute right-0 top-[-50px] p-2 z-10", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { title: "Cài đặt hiển thị bảng", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SettingIcon, {}) }) });
9969
- }
9970
- return null;
9971
- };
9972
10479
  const tableContent = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: twMerge(showSetting ? "relative" : ""), children: [
9973
- settingDiv(),
10480
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
10481
+ HeadingTable,
10482
+ {
10483
+ filters,
10484
+ handleSearch,
10485
+ resetToInitialFilters,
10486
+ setOpenStting,
10487
+ showSetting,
10488
+ groupHeadingButtonItems,
10489
+ tagSearchItems,
10490
+ setTagSearchItems,
10491
+ keyActive,
10492
+ setKeyActive
10493
+ }
10494
+ ),
9974
10495
  /* @__PURE__ */ jsxRuntimeExports.jsx(
9975
10496
  Table$1,
9976
10497
  {
@@ -10096,54 +10617,6 @@ const Popover = (props) => {
10096
10617
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: containerClassName, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Popover$1, { className: popoverClassName, ...restProps }) });
10097
10618
  };
10098
10619
 
10099
- const SearchFiltersForm = ({
10100
- initialValues,
10101
- renderFilterFields,
10102
- onSubmit,
10103
- onReset,
10104
- classNamesContainer,
10105
- classNameWrapperForm,
10106
- hideDefaultSubmit,
10107
- hideResetButton
10108
- }) => {
10109
- const { control, handleSubmit, reset, setValue } = useForm({
10110
- defaultValues: initialValues
10111
- });
10112
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("form", { className: classNameWrapperForm, onSubmit: handleSubmit(onSubmit), children: [
10113
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classNamesContainer, children: renderFilterFields && renderFilterFields({
10114
- control,
10115
- setValue,
10116
- handleSubmit: handleSubmit(onSubmit),
10117
- reset
10118
- }) }),
10119
- !hideDefaultSubmit && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-end gap-2 mb-3", children: [
10120
- /* @__PURE__ */ jsxRuntimeExports.jsx(
10121
- Button,
10122
- {
10123
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon, {}),
10124
- className: "px-3 py-1 ",
10125
- color: "blue",
10126
- variant: "solid",
10127
- htmlType: "submit",
10128
- children: "Tìm kiếm"
10129
- }
10130
- ),
10131
- !hideResetButton && /* @__PURE__ */ jsxRuntimeExports.jsx(
10132
- Button,
10133
- {
10134
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$3, {}),
10135
- className: "px-3 py-1",
10136
- onClick: () => {
10137
- reset();
10138
- onReset?.();
10139
- },
10140
- children: "Đặt lại"
10141
- }
10142
- )
10143
- ] })
10144
- ] });
10145
- };
10146
-
10147
10620
  const Container = ({
10148
10621
  children,
10149
10622
  className,
@@ -10158,17 +10631,6 @@ const Container = ({
10158
10631
  );
10159
10632
  };
10160
10633
 
10161
- const typeColorMap = {
10162
- error: "red",
10163
- info: "blue",
10164
- success: "green",
10165
- warning: "yellow"
10166
- };
10167
- const Badge = ({ type, children, customColor, ...rest }) => {
10168
- const color = type ? typeColorMap[type] : customColor;
10169
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Badge$1, { color, ...rest, children });
10170
- };
10171
-
10172
10634
  const Col = (props) => {
10173
10635
  const { colClassName, ...restProps } = props;
10174
10636
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Col$1, { className: colClassName, ...restProps });
@@ -10184,11 +10646,6 @@ const Dropdown = (props) => {
10184
10646
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: containerClassName, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Dropdown$1, { className: dropdownClassName, ...restProps }) });
10185
10647
  };
10186
10648
 
10187
- const Breadcrumb = (props) => {
10188
- const { containerClassName, breadcrumbClassName, ...restProps } = props;
10189
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: containerClassName, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Breadcrumb$1, { className: breadcrumbClassName, ...restProps }) });
10190
- };
10191
-
10192
10649
  const Flex = (props) => {
10193
10650
  const { containerClassName, flexClassName, ...restProps } = props;
10194
10651
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: containerClassName, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Flex$1, { className: flexClassName, ...restProps }) });
@@ -16183,12 +16640,12 @@ const MenuItem = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(Menu$1.Item, {
16183
16640
  MenuItem.displayName = "Menu.Item";
16184
16641
  const SubMenu = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(Menu$1.SubMenu, { ...props });
16185
16642
  SubMenu.displayName = "Menu.SubMenu";
16186
- const Divider$1 = Menu$1.Divider;
16643
+ const Divider = Menu$1.Divider;
16187
16644
  const ItemGroup = Menu$1.ItemGroup;
16188
16645
  const MenuComp = MenuComponent;
16189
16646
  MenuComp.Item = MenuItem;
16190
16647
  MenuComp.SubMenu = SubMenu;
16191
- MenuComp.Divider = Divider$1;
16648
+ MenuComp.Divider = Divider;
16192
16649
  MenuComp.ItemGroup = ItemGroup;
16193
16650
  const Menu = MenuComp;
16194
16651
 
@@ -16655,47 +17112,6 @@ const Sidebar = ({ children, menu }) => {
16655
17112
  ] });
16656
17113
  };
16657
17114
 
16658
- const Heading = (props) => {
16659
- const {
16660
- rightContent,
16661
- children,
16662
- noBreadcum,
16663
- classNameWrapHeading,
16664
- breadcrumbItems
16665
- } = props;
16666
- //! State
16667
- //! Function
16668
- //! Render
16669
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
16670
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
16671
- "div",
16672
- {
16673
- className: classNames(
16674
- "flex justify-between items-end ",
16675
- classNameWrapHeading
16676
- ),
16677
- children: [
16678
- !noBreadcum && /* @__PURE__ */ jsxRuntimeExports.jsx(Breadcrumb, { items: breadcrumbItems }),
16679
- rightContent
16680
- ]
16681
- }
16682
- ),
16683
- children
16684
- ] });
16685
- };
16686
-
16687
- const Tag = (props) => {
16688
- const { children, ...rest } = props;
16689
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(Tag$1, { ...rest, children: [
16690
- " ",
16691
- children
16692
- ] });
16693
- };
16694
-
16695
- const Divider = ({ children, ...rest }) => {
16696
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Divider$2, { ...rest, children });
16697
- };
16698
-
16699
17115
  const Alert = (props) => {
16700
17116
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Alert$1, { ...props });
16701
17117
  };
@@ -16756,9 +17172,9 @@ const Tree = (props) => {
16756
17172
  };
16757
17173
 
16758
17174
  const Watermark = ({ ...rest }) => {
16759
- const { Paragraph } = Typography;
17175
+ const { Paragraph } = Typography$1;
16760
17176
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Flex$1, { gap: "middle", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Watermark$1, { ...rest, children: [
16761
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Typography, { children: [
17177
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Typography$1, { children: [
16762
17178
  /* @__PURE__ */ jsxRuntimeExports.jsx(Paragraph, { children: "The light-speed iteration of the digital world makes products more complex. However, human consciousness and attention resources are limited. Facing this design contradiction, the pursuit of natural interaction will be the consistent direction of Ant Design." }),
16763
17179
  /* @__PURE__ */ jsxRuntimeExports.jsx(Paragraph, { children: "Natural user cognition: According to cognitive psychology, about 80% of external information is obtained through visual channels. The most important visual elements in the interface design, including layout, colors, illustrations, icons, etc., should fully absorb the laws of nature, thereby reducing the user's cognitive cost and bringing authentic and smooth feelings. In some scenarios, opportunely adding other sensory channels such as hearing, touch can create a richer and more natural product experience." }),
16764
17180
  /* @__PURE__ */ jsxRuntimeExports.jsx(Paragraph, { children: "Natural user behavior: In the interaction with the system, the designer should fully understand the relationship between users, system roles, and task objectives, and also contextually organize system functions and services. At the same time, a series of methods such as behavior analysis, artificial intelligence and sensors could be applied to assist users to make effective decisions and reduce extra operations of users, to save users' mental and physical resources and make human-computer interaction more natural." })
@@ -17265,12 +17681,12 @@ const CategoryStatus = ({ status }) => {
17265
17681
  statusName
17266
17682
  }) => {
17267
17683
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
17268
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classNames(`w-3 h-3 rounded-sm `, color) }),
17684
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: twMerge("w-3 h-3 rounded-sm", color || "") }),
17269
17685
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm font-normal", children: statusName })
17270
17686
  ] }) });
17271
17687
  };
17272
17688
  //! Render
17273
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ItemStatus, { color: bagde.color, statusName: bagde.text }) });
17689
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ItemStatus, { color: bagde?.color, statusName: bagde.text });
17274
17690
  };
17275
17691
 
17276
17692
  const ActionRowTable = ({
@@ -17342,4 +17758,4 @@ const ActionRowTable = ({
17342
17758
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: renderAction() });
17343
17759
  };
17344
17760
 
17345
- export { Alert as A, Button as B, CascaderField as C, Dropdown as D, Anchor as E, Flex as F, Appfix as G, Heading as H, AutoComplete as I, PnkxCollapse as J, PnkxColorPicker as K, Layout as L, Modal as M, Empty as N, Image as O, Popover as P, QRCode as Q, Row as R, Skeleton as S, Table as T, BulkAction as U, ConfirmModal as V, Watermark as W, ErrorBoundary as X, CategoryStatus as Y, ActionRowTable as Z, Tooltip as a, Tabs as b, SearchFiltersForm as c, Container as d, Badge as e, Col as f, Breadcrumb as g, Space as h, Splitter as i, Menu as j, Pagination as k, Steps as l, Sidebar as m, Tag as n, Divider as o, Spin as p, Drawer as q, Popconfirm as r, Result as s, typeColorMap as t, Rate as u, Segmented as v, Statistic as w, Timeline as x, Tour as y, Tree as z };
17761
+ export { Alert as A, Button as B, CascaderField as C, Dropdown as D, Anchor as E, Flex as F, Appfix as G, Heading as H, AutoComplete as I, PnkxCollapse as J, PnkxColorPicker as K, Layout as L, Modal as M, Empty as N, Image as O, Popover as P, QRCode as Q, Row as R, Skeleton as S, Table as T, BulkAction as U, ConfirmModal as V, Watermark as W, ErrorBoundary as X, CategoryStatus as Y, ActionRowTable as Z, Tooltip as a, Tabs as b, SearchFiltersForm as c, Container as d, Badge as e, Col as f, Breadcrumb as g, Space as h, Splitter as i, Menu as j, Pagination as k, Steps as l, Sidebar as m, Tag as n, Divider$1 as o, Spin as p, Drawer as q, Popconfirm as r, Result as s, typeColorMap as t, Rate as u, Segmented as v, Statistic as w, Timeline as x, Tour as y, Tree as z };