@dashadmin/dash-components 1.3.25 → 1.3.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/README.md +35 -0
  2. package/dist/components/AuditLog/AuditLog.js +345 -1
  3. package/dist/components/AuditLog/index.js +4 -1
  4. package/dist/components/AutoCompleteArrayInput/AutoCompleteCheckBoxInput.js +630 -3
  5. package/dist/components/AutoCompleteArrayInput/AutocompleteCheckBoxArrayInput.js +53 -1
  6. package/dist/components/AutoCompleteArrayInputAutoSearch/AutoCompleteCheckBoxInput.js +647 -3
  7. package/dist/components/AutoCompleteArrayInputAutoSearch/AutocompleteCheckBoxArrayInput.js +53 -1
  8. package/dist/components/Json/Json.js +235 -1
  9. package/dist/components/JsonColorSelector/JsonColorSelector.js +1172 -1
  10. package/dist/components/JsonColorSelector/JsonColorSelectorEnhanced.js +863 -2
  11. package/dist/components/JsonColorSelector/JsonCssVarValues.js +738 -1
  12. package/dist/components/JsonColorSelector/components/ColorEditDialog.js +426 -1
  13. package/dist/components/JsonColorSelector/components/ColorPaletteItem.js +75 -1
  14. package/dist/components/JsonColorSelector/components/ImageColorExtractor.js +283 -1
  15. package/dist/components/JsonColorSelector/helpers/functions.js +101 -1
  16. package/dist/components/JsonColorSelector/useAsyncColorThief.js +105 -1
  17. package/dist/components/ListActive/ListActive.js +126 -1
  18. package/dist/components/ListActive/ListBoolean.js +124 -1
  19. package/dist/components/NotificationPreferences/NotificationPreferences.js +317 -1
  20. package/dist/components/NotificationPreferences/index.js +7 -1
  21. package/dist/components/SearchableSelects/RASearchableSelect.js +236 -1
  22. package/dist/components/SearchableSelects/RASearchableSelectCheckboxes.js +479 -1
  23. package/dist/components/SearchableSelects/RASearchableSelectChips.js +465 -1
  24. package/dist/components/SearchableSelects/RASearchableSelectChipsRecordContext.js +295 -1
  25. package/dist/components/SearchableSelects/SearchableSelect.js +202 -1
  26. package/dist/components/SearchableSelects/SearchableSelectCheckboxes.js +290 -1
  27. package/dist/components/SortableDataGrid/SortableDataGrid.js +72 -1
  28. package/dist/components/SortableDataGrid/SortableDataGridBody.js +167 -1
  29. package/dist/components/SortableDataGrid/SortableDataGridHeader.js +109 -1
  30. package/dist/components/SortableDataGrid/SortableDataGridRow.js +283 -1
  31. package/dist/components/Upload/SingleImageUploader.js +40 -1
  32. package/dist/components/custom/PackageCopyMethod.js +78 -1
  33. package/dist/components/custom/PackageRadioButtonGroup.js +45 -1
  34. package/dist/components/dialog/Basic.js +8 -1
  35. package/dist/components/dialog/Correct.js +14 -1
  36. package/dist/components/dialog/Error.js +14 -1
  37. package/dist/components/dialog/Info.js +14 -1
  38. package/dist/components/dialog/InfoV2.js +21 -1
  39. package/dist/components/dialog/NotFound.js +14 -1
  40. package/dist/components/dialog/QuickSearch.js +117 -1
  41. package/dist/components/notifications/NotificationsCenter.js +597 -1
  42. package/dist/components/notifications/index.js +24 -1
  43. package/dist/components/tables/PaginationComponent.js +36 -1
  44. package/dist/components/theme/AppLoadingFallback.js +38 -2
  45. package/dist/components/theme/ErrorBoundary.js +52 -1
  46. package/dist/components/theme/InitialLoader.js +13 -1
  47. package/dist/components/theme/NotFound.js +136 -1
  48. package/dist/components/theme/NotResults.js +38 -1
  49. package/dist/hooks/useDraggable.js +6 -1
  50. package/dist/hooks/useNotifications.js +8 -1
  51. package/dist/hooks/useQuickSearch.js +26 -1
  52. package/dist/index.js +66 -5567
  53. package/dist/utils/setNativeValue.js +17 -1
  54. package/package.json +148 -132
  55. package/src/components/AuditLog/AuditLog.tsx +476 -0
  56. package/src/components/AuditLog/index.ts +2 -0
  57. package/src/components/AutoCompleteArrayInput/AutoCompleteCheckBoxInput.tsx +917 -0
  58. package/src/components/AutoCompleteArrayInput/AutocompleteCheckBoxArrayInput.tsx +39 -0
  59. package/src/components/AutoCompleteArrayInputAutoSearch/AutoCompleteCheckBoxInput.tsx +916 -0
  60. package/src/components/AutoCompleteArrayInputAutoSearch/AutocompleteCheckBoxArrayInput.tsx +44 -0
  61. package/src/components/Json/Json.tsx +312 -0
  62. package/src/components/JsonColorSelector/JsonColorSelector.tsx +1435 -0
  63. package/src/components/JsonColorSelector/JsonColorSelectorEnhanced.tsx +1029 -0
  64. package/src/components/JsonColorSelector/JsonCssVarValues.tsx +863 -0
  65. package/src/components/JsonColorSelector/components/ColorEditDialog.tsx +491 -0
  66. package/src/components/JsonColorSelector/components/ColorPaletteItem.tsx +80 -0
  67. package/src/components/JsonColorSelector/components/ImageColorExtractor.tsx +328 -0
  68. package/src/components/JsonColorSelector/helpers/functions.tsx +123 -0
  69. package/src/components/JsonColorSelector/interfaces/interfaces.tsx +22 -0
  70. package/src/components/JsonColorSelector/useAsyncColorThief.tsx +97 -0
  71. package/src/components/ListActive/ListActive.tsx +106 -0
  72. package/src/components/ListActive/ListBoolean.tsx +96 -0
  73. package/src/components/NotificationPreferences/NotificationPreferences.tsx +463 -0
  74. package/src/components/NotificationPreferences/index.tsx +2 -0
  75. package/src/components/SearchableSelects/RASearchableSelect.tsx +300 -0
  76. package/src/components/SearchableSelects/RASearchableSelectCheckboxes.tsx +604 -0
  77. package/src/components/SearchableSelects/RASearchableSelectChips.tsx +558 -0
  78. package/src/components/SearchableSelects/RASearchableSelectChipsRecordContext.tsx +362 -0
  79. package/src/components/SearchableSelects/SearchableSelect.tsx +321 -0
  80. package/src/components/SearchableSelects/SearchableSelectCheckboxes.tsx +355 -0
  81. package/src/components/SortableDataGrid/SortableDataGrid.tsx +56 -0
  82. package/src/components/SortableDataGrid/SortableDataGridBody.tsx +175 -0
  83. package/src/components/SortableDataGrid/SortableDataGridHeader.tsx +171 -0
  84. package/src/components/SortableDataGrid/SortableDataGridRow.tsx +247 -0
  85. package/src/components/Upload/SingleImageUploader.tsx +55 -0
  86. package/src/components/custom/PackageCopyMethod.tsx +109 -0
  87. package/src/components/custom/PackageRadioButtonGroup.tsx +47 -0
  88. package/src/components/dialog/Basic.tsx +11 -0
  89. package/src/components/dialog/Correct.tsx +16 -0
  90. package/src/components/dialog/Error.tsx +15 -0
  91. package/src/components/dialog/Info.tsx +15 -0
  92. package/src/components/dialog/InfoV2.tsx +35 -0
  93. package/src/components/dialog/NotFound.tsx +18 -0
  94. package/src/components/dialog/QuickSearch.tsx +115 -0
  95. package/src/components/notifications/NotificationsCenter.tsx +792 -0
  96. package/src/components/notifications/index.ts +42 -0
  97. package/src/components/tables/PaginationComponent.tsx +17 -0
  98. package/src/components/theme/AppLoadingFallback.tsx +42 -0
  99. package/src/components/theme/ErrorBoundary.tsx +57 -0
  100. package/src/components/theme/InitialLoader.tsx +16 -0
  101. package/src/components/theme/NotFound.tsx +124 -0
  102. package/src/components/theme/NotResults.tsx +54 -0
  103. package/src/hooks/useDraggable.ts +11 -0
  104. package/src/hooks/useNotifications.ts +14 -0
  105. package/src/hooks/useQuickSearch.tsx +29 -0
  106. package/src/index.tsx +77 -0
  107. package/src/utils/setNativeValue.tsx +23 -0
  108. package/dist/color-thief-CTwGFhOB.js +0 -272
  109. /package/{dist → src}/components/AutoCompleteArrayInputAutoSearch/AutocompleteCheckBoxArrayAutoSearch.tsx.wip +0 -0
  110. /package/{dist → src}/components/JsonColorSelector/JsonColorSelector.tsx.bkup +0 -0
  111. /package/{dist → src}/components/SortableDataGrid/README.md +0 -0
  112. /package/{dist → src}/styles/index.less +0 -0
@@ -1 +1,117 @@
1
- import{Fragment as T,jsx as o,jsxs as b}from"react/jsx-runtime";import{useEffect as h,useState as g}from"react";import S from"@mui/material/Button";import{useNavigate as k}from"react-router-dom";import*as c from"react";import q from"@dashadmin/dash-modal";import{TextField as v}from"@mui/material";import x from"../../hooks/useQuickSearch";import B from"../../utils/setNativeValue";const y=u=>{const{searchUrl:l="/admin/package"}=u,f=k(),[a,m]=g({q:""}),[t,r]=c.useState(!1),{sendQuickSearchEvent:p}=x(),i=c.useRef(null),n=e=>{if(e==null){r(!0);return}r(!t)},s=()=>{n(!1),f({pathname:l}),setTimeout(()=>{p(a.q),B(document.getElementById("quickSearch"),a.q)},2e3)};return h(()=>{t===!0&&setTimeout(()=>{i.current?.focus()},10)},[t]),b(T,{children:[o(S,{className:"dash-header-actions-btn",onClick:()=>n(!0),children:"B\xFAsqueda r\xE1pida"}),o(q,{onCancel:()=>{n(!1)},onConfirm:()=>s(),title:"B\xFAsqueda r\xE1pida",variant:"info",open:t,confirmText:"Buscar",children:o("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch",textAlign:"left"},children:o(v,{inputRef:i,autoFocus:!0,variant:"outlined",placeholder:"Buscar por nombre, apellido, ID dash",label:"Buscar",onChange:({target:{value:e}})=>m(d=>({...d,q:e})),onKeyDown:e=>{e.key==="Enter"&&s()}})})})]})};var A=y;export{A as default};
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
21
+ import { useEffect, useState } from "react";
22
+ import Button from "@mui/material/Button";
23
+ import { useNavigate } from "react-router-dom";
24
+ import * as React from "react";
25
+ import DASHModal from "dash-modal";
26
+ import { TextField } from "@mui/material";
27
+ import useQuickSearch from "../../hooks/useQuickSearch";
28
+ import setNativeValue from "../../utils/setNativeValue";
29
+ const QuickSearch = (props) => {
30
+ const { searchUrl = "/admin/package" } = props;
31
+ const navigateTo = useNavigate();
32
+ const [options, setOptions] = useState({ q: "" });
33
+ const [open, setOpen] = React.useState(false);
34
+ const { sendQuickSearchEvent } = useQuickSearch();
35
+ const inputRef = React.useRef(null);
36
+ const toggleModal = (value) => {
37
+ if (value === null || value === void 0) {
38
+ setOpen(true);
39
+ return;
40
+ }
41
+ setOpen(!open);
42
+ };
43
+ const search = () => {
44
+ toggleModal(false);
45
+ navigateTo({
46
+ pathname: searchUrl
47
+ //search: `filter=${stringify({ quickSearch: options.q}, { arrayFormat: 'bracket', arrayFormatSeparator:":" })}`,
48
+ //search: `quickSearch=${options.q}`
49
+ });
50
+ setTimeout(() => {
51
+ sendQuickSearchEvent(options.q);
52
+ setNativeValue(document.getElementById("quickSearch"), options.q);
53
+ }, 2e3);
54
+ };
55
+ useEffect(() => {
56
+ if (open === true) {
57
+ setTimeout(() => {
58
+ var _a;
59
+ (_a = inputRef.current) == null ? void 0 : _a.focus();
60
+ }, 10);
61
+ }
62
+ }, [open]);
63
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
64
+ /* @__PURE__ */ jsx(
65
+ Button,
66
+ {
67
+ className: "dash-header-actions-btn",
68
+ onClick: () => toggleModal(true),
69
+ children: "B\xFAsqueda r\xE1pida"
70
+ }
71
+ ),
72
+ /* @__PURE__ */ jsx(
73
+ DASHModal,
74
+ {
75
+ onCancel: () => {
76
+ toggleModal(false);
77
+ },
78
+ onConfirm: () => search(),
79
+ title: "B\xFAsqueda r\xE1pida",
80
+ variant: "info",
81
+ open,
82
+ confirmText: "Buscar",
83
+ children: /* @__PURE__ */ jsx(
84
+ "div",
85
+ {
86
+ style: {
87
+ display: "flex",
88
+ flexDirection: "column",
89
+ alignItems: "stretch",
90
+ textAlign: "left"
91
+ },
92
+ children: /* @__PURE__ */ jsx(
93
+ TextField,
94
+ {
95
+ inputRef,
96
+ autoFocus: true,
97
+ variant: "outlined",
98
+ placeholder: "Buscar por nombre, apellido, ID dash",
99
+ label: "Buscar",
100
+ onChange: ({ target: { value } }) => setOptions((prevState) => __spreadProps(__spreadValues({}, prevState), { q: value })),
101
+ onKeyDown: (ev) => {
102
+ if (ev.key === "Enter") {
103
+ search();
104
+ }
105
+ }
106
+ }
107
+ )
108
+ }
109
+ )
110
+ }
111
+ )
112
+ ] });
113
+ };
114
+ var QuickSearch_default = QuickSearch;
115
+ export {
116
+ QuickSearch_default as default
117
+ };