analytica-frontend-lib 1.2.16 → 1.2.17
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/dist/AlertManager/index.js +108 -108
- package/dist/AlertManager/index.js.map +1 -1
- package/dist/AlertManager/index.mjs +101 -101
- package/dist/AlertManager/index.mjs.map +1 -1
- package/dist/AlertManagerView/index.js +13 -3
- package/dist/AlertManagerView/index.js.map +1 -1
- package/dist/AlertManagerView/index.mjs +13 -3
- package/dist/AlertManagerView/index.mjs.map +1 -1
- package/dist/Table/index.d.mts +1 -1
- package/dist/Table/index.d.ts +1 -1
- package/dist/Table/index.js +13 -3
- package/dist/Table/index.js.map +1 -1
- package/dist/Table/index.mjs +13 -3
- package/dist/Table/index.mjs.map +1 -1
- package/dist/index.d.mts +35 -1
- package/dist/index.d.ts +35 -1
- package/dist/index.js +15 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1088,6 +1088,101 @@ var CheckboxGroup = ({
|
|
|
1088
1088
|
);
|
|
1089
1089
|
};
|
|
1090
1090
|
|
|
1091
|
+
// src/components/AlertManager/useAlertForm.ts
|
|
1092
|
+
var import_zustand = require("zustand");
|
|
1093
|
+
var initialState = {
|
|
1094
|
+
title: "",
|
|
1095
|
+
message: "",
|
|
1096
|
+
image: null,
|
|
1097
|
+
date: "",
|
|
1098
|
+
time: "",
|
|
1099
|
+
sendToday: false,
|
|
1100
|
+
sendCopyToEmail: false,
|
|
1101
|
+
recipientCategories: {}
|
|
1102
|
+
};
|
|
1103
|
+
var useAlertFormStore = (0, import_zustand.create)((set) => ({
|
|
1104
|
+
...initialState,
|
|
1105
|
+
// Step 1 - Mensagem
|
|
1106
|
+
setTitle: (title) => set({ title }),
|
|
1107
|
+
setMessage: (message) => set({ message }),
|
|
1108
|
+
setImage: (image) => set({ image }),
|
|
1109
|
+
// Step 2 - Destinatários (Dinâmico)
|
|
1110
|
+
initializeCategory: (category) => set((state) => ({
|
|
1111
|
+
recipientCategories: {
|
|
1112
|
+
...state.recipientCategories,
|
|
1113
|
+
[category.key]: {
|
|
1114
|
+
...category,
|
|
1115
|
+
selectedIds: category.selectedIds || [],
|
|
1116
|
+
allSelected: category.allSelected || false
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
})),
|
|
1120
|
+
updateCategoryItems: (key, items) => set((state) => {
|
|
1121
|
+
const base = state.recipientCategories[key] ?? {
|
|
1122
|
+
key,
|
|
1123
|
+
label: key,
|
|
1124
|
+
availableItems: [],
|
|
1125
|
+
selectedIds: [],
|
|
1126
|
+
allSelected: false
|
|
1127
|
+
};
|
|
1128
|
+
return {
|
|
1129
|
+
recipientCategories: {
|
|
1130
|
+
...state.recipientCategories,
|
|
1131
|
+
[key]: { ...base, availableItems: items }
|
|
1132
|
+
}
|
|
1133
|
+
};
|
|
1134
|
+
}),
|
|
1135
|
+
updateCategorySelection: (key, selectedIds, allSelected) => set((state) => {
|
|
1136
|
+
const base = state.recipientCategories[key] ?? {
|
|
1137
|
+
key,
|
|
1138
|
+
label: key,
|
|
1139
|
+
availableItems: [],
|
|
1140
|
+
selectedIds: [],
|
|
1141
|
+
allSelected: false
|
|
1142
|
+
};
|
|
1143
|
+
return {
|
|
1144
|
+
recipientCategories: {
|
|
1145
|
+
...state.recipientCategories,
|
|
1146
|
+
[key]: { ...base, selectedIds, allSelected }
|
|
1147
|
+
}
|
|
1148
|
+
};
|
|
1149
|
+
}),
|
|
1150
|
+
clearCategorySelection: (key) => set((state) => {
|
|
1151
|
+
const base = state.recipientCategories[key] ?? {
|
|
1152
|
+
key,
|
|
1153
|
+
label: key,
|
|
1154
|
+
availableItems: [],
|
|
1155
|
+
selectedIds: [],
|
|
1156
|
+
allSelected: false
|
|
1157
|
+
};
|
|
1158
|
+
return {
|
|
1159
|
+
recipientCategories: {
|
|
1160
|
+
...state.recipientCategories,
|
|
1161
|
+
[key]: { ...base, selectedIds: [], allSelected: false }
|
|
1162
|
+
}
|
|
1163
|
+
};
|
|
1164
|
+
}),
|
|
1165
|
+
// Step 3 - Data de envio
|
|
1166
|
+
setDate: (date) => set({ date }),
|
|
1167
|
+
setTime: (time) => set({ time }),
|
|
1168
|
+
setSendToday: (sendToday) => {
|
|
1169
|
+
const now = /* @__PURE__ */ new Date();
|
|
1170
|
+
const year = now.getFullYear();
|
|
1171
|
+
const month = String(now.getMonth() + 1).padStart(2, "0");
|
|
1172
|
+
const day = String(now.getDate()).padStart(2, "0");
|
|
1173
|
+
const hours = String(now.getHours()).padStart(2, "0");
|
|
1174
|
+
const minutes = String(now.getMinutes()).padStart(2, "0");
|
|
1175
|
+
set({
|
|
1176
|
+
sendToday,
|
|
1177
|
+
date: `${year}-${month}-${day}`,
|
|
1178
|
+
time: `${hours}:${minutes}`
|
|
1179
|
+
});
|
|
1180
|
+
},
|
|
1181
|
+
setSendCopyToEmail: (sendCopyToEmail) => set({ sendCopyToEmail }),
|
|
1182
|
+
// Reset form
|
|
1183
|
+
resetForm: () => set(initialState)
|
|
1184
|
+
}));
|
|
1185
|
+
|
|
1091
1186
|
// src/components/Modal/Modal.tsx
|
|
1092
1187
|
var import_react5 = require("react");
|
|
1093
1188
|
var import_phosphor_react4 = require("phosphor-react");
|
|
@@ -1693,7 +1788,7 @@ var Input_default = Input;
|
|
|
1693
1788
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
1694
1789
|
var import_phosphor_react8 = require("phosphor-react");
|
|
1695
1790
|
var import_react10 = require("react");
|
|
1696
|
-
var
|
|
1791
|
+
var import_zustand3 = require("zustand");
|
|
1697
1792
|
|
|
1698
1793
|
// src/components/ThemeToggle/ThemeToggle.tsx
|
|
1699
1794
|
var import_phosphor_react7 = require("phosphor-react");
|
|
@@ -1703,7 +1798,7 @@ var import_react9 = require("react");
|
|
|
1703
1798
|
var import_react8 = require("react");
|
|
1704
1799
|
|
|
1705
1800
|
// src/store/themeStore.ts
|
|
1706
|
-
var
|
|
1801
|
+
var import_zustand2 = require("zustand");
|
|
1707
1802
|
var import_middleware = require("zustand/middleware");
|
|
1708
1803
|
var applyThemeToDOM = (mode) => {
|
|
1709
1804
|
const htmlElement = document.documentElement;
|
|
@@ -1737,7 +1832,7 @@ var saveOriginalTheme = () => {
|
|
|
1737
1832
|
htmlElement.setAttribute("data-original-theme", currentTheme);
|
|
1738
1833
|
}
|
|
1739
1834
|
};
|
|
1740
|
-
var useThemeStore = (0,
|
|
1835
|
+
var useThemeStore = (0, import_zustand2.create)()(
|
|
1741
1836
|
(0, import_middleware.devtools)(
|
|
1742
1837
|
(0, import_middleware.persist)(
|
|
1743
1838
|
(set, get) => ({
|
|
@@ -1891,7 +1986,7 @@ var ThemeToggle = ({
|
|
|
1891
1986
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
1892
1987
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1893
1988
|
function createDropdownStore() {
|
|
1894
|
-
return (0,
|
|
1989
|
+
return (0, import_zustand3.create)((set) => ({
|
|
1895
1990
|
open: false,
|
|
1896
1991
|
setOpen: (open) => set({ open })
|
|
1897
1992
|
}));
|
|
@@ -1941,7 +2036,7 @@ var DropdownMenu = ({
|
|
|
1941
2036
|
const storeRef = (0, import_react10.useRef)(null);
|
|
1942
2037
|
storeRef.current ??= createDropdownStore();
|
|
1943
2038
|
const store = storeRef.current;
|
|
1944
|
-
const { open, setOpen: storeSetOpen } = (0,
|
|
2039
|
+
const { open, setOpen: storeSetOpen } = (0, import_zustand3.useStore)(store, (s) => s);
|
|
1945
2040
|
const setOpen = (newOpen) => {
|
|
1946
2041
|
storeSetOpen(newOpen);
|
|
1947
2042
|
};
|
|
@@ -2007,7 +2102,7 @@ var DropdownMenuTrigger = ({
|
|
|
2007
2102
|
...props
|
|
2008
2103
|
}) => {
|
|
2009
2104
|
const store = useDropdownStore(externalStore);
|
|
2010
|
-
const open = (0,
|
|
2105
|
+
const open = (0, import_zustand3.useStore)(store, (s) => s.open);
|
|
2011
2106
|
const toggleOpen = () => store.setState({ open: !open });
|
|
2012
2107
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2013
2108
|
"div",
|
|
@@ -2076,7 +2171,7 @@ var DropdownMenuContent = (0, import_react10.forwardRef)(
|
|
|
2076
2171
|
...props
|
|
2077
2172
|
}, ref) => {
|
|
2078
2173
|
const store = useDropdownStore(externalStore);
|
|
2079
|
-
const open = (0,
|
|
2174
|
+
const open = (0, import_zustand3.useStore)(store, (s) => s.open);
|
|
2080
2175
|
const [isVisible, setIsVisible] = (0, import_react10.useState)(open);
|
|
2081
2176
|
(0, import_react10.useEffect)(() => {
|
|
2082
2177
|
if (open) {
|
|
@@ -2133,7 +2228,7 @@ var DropdownMenuItem = (0, import_react10.forwardRef)(
|
|
|
2133
2228
|
...props
|
|
2134
2229
|
}, ref) => {
|
|
2135
2230
|
const store = useDropdownStore(externalStore);
|
|
2136
|
-
const setOpen = (0,
|
|
2231
|
+
const setOpen = (0, import_zustand3.useStore)(store, (s) => s.setOpen);
|
|
2137
2232
|
const sizeClasses = ITEM_SIZE_CLASSES[size];
|
|
2138
2233
|
const handleClick = (e) => {
|
|
2139
2234
|
if (disabled) {
|
|
@@ -2207,7 +2302,7 @@ var DropdownMenuSeparator = (0, import_react10.forwardRef)(({ className, store:
|
|
|
2207
2302
|
DropdownMenuSeparator.displayName = "DropdownMenuSeparator";
|
|
2208
2303
|
var ProfileMenuTrigger = (0, import_react10.forwardRef)(({ className, onClick, store: externalStore, ...props }, ref) => {
|
|
2209
2304
|
const store = useDropdownStore(externalStore);
|
|
2210
|
-
const open = (0,
|
|
2305
|
+
const open = (0, import_zustand3.useStore)(store, (s) => s.open);
|
|
2211
2306
|
const toggleOpen = () => store.setState({ open: !open });
|
|
2212
2307
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2213
2308
|
"button",
|
|
@@ -2265,7 +2360,7 @@ var ProfileToggleTheme = ({
|
|
|
2265
2360
|
const internalStoreRef = (0, import_react10.useRef)(null);
|
|
2266
2361
|
internalStoreRef.current ??= createDropdownStore();
|
|
2267
2362
|
const store = externalStore ?? internalStoreRef.current;
|
|
2268
|
-
const setOpen = (0,
|
|
2363
|
+
const setOpen = (0, import_zustand3.useStore)(store, (s) => s.setOpen);
|
|
2269
2364
|
const handleClick = (e) => {
|
|
2270
2365
|
e.preventDefault();
|
|
2271
2366
|
e.stopPropagation();
|
|
@@ -2350,7 +2445,7 @@ var ProfileMenuFooter = ({
|
|
|
2350
2445
|
...props
|
|
2351
2446
|
}) => {
|
|
2352
2447
|
const store = useDropdownStore(externalStore);
|
|
2353
|
-
const setOpen = (0,
|
|
2448
|
+
const setOpen = (0, import_zustand3.useStore)(store, (s) => s.setOpen);
|
|
2354
2449
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
2355
2450
|
Button_default,
|
|
2356
2451
|
{
|
|
@@ -5172,10 +5267,10 @@ CardAccordation.displayName = "CardAccordation";
|
|
|
5172
5267
|
|
|
5173
5268
|
// src/components/Accordation/AccordionGroup.tsx
|
|
5174
5269
|
var import_react15 = require("react");
|
|
5175
|
-
var
|
|
5270
|
+
var import_zustand4 = require("zustand");
|
|
5176
5271
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
5177
5272
|
function createAccordionGroupStore(type, initialValue, collapsible) {
|
|
5178
|
-
return (0,
|
|
5273
|
+
return (0, import_zustand4.create)((set, get) => ({
|
|
5179
5274
|
type,
|
|
5180
5275
|
value: initialValue,
|
|
5181
5276
|
collapsible,
|
|
@@ -5321,101 +5416,6 @@ AccordionGroup.displayName = "AccordionGroup";
|
|
|
5321
5416
|
// src/components/AlertManager/AlertsManager.tsx
|
|
5322
5417
|
var import_phosphor_react13 = require("phosphor-react");
|
|
5323
5418
|
|
|
5324
|
-
// src/components/AlertManager/useAlertForm.ts
|
|
5325
|
-
var import_zustand4 = require("zustand");
|
|
5326
|
-
var initialState = {
|
|
5327
|
-
title: "",
|
|
5328
|
-
message: "",
|
|
5329
|
-
image: null,
|
|
5330
|
-
date: "",
|
|
5331
|
-
time: "",
|
|
5332
|
-
sendToday: false,
|
|
5333
|
-
sendCopyToEmail: false,
|
|
5334
|
-
recipientCategories: {}
|
|
5335
|
-
};
|
|
5336
|
-
var useAlertFormStore = (0, import_zustand4.create)((set) => ({
|
|
5337
|
-
...initialState,
|
|
5338
|
-
// Step 1 - Mensagem
|
|
5339
|
-
setTitle: (title) => set({ title }),
|
|
5340
|
-
setMessage: (message) => set({ message }),
|
|
5341
|
-
setImage: (image) => set({ image }),
|
|
5342
|
-
// Step 2 - Destinatários (Dinâmico)
|
|
5343
|
-
initializeCategory: (category) => set((state) => ({
|
|
5344
|
-
recipientCategories: {
|
|
5345
|
-
...state.recipientCategories,
|
|
5346
|
-
[category.key]: {
|
|
5347
|
-
...category,
|
|
5348
|
-
selectedIds: category.selectedIds || [],
|
|
5349
|
-
allSelected: category.allSelected || false
|
|
5350
|
-
}
|
|
5351
|
-
}
|
|
5352
|
-
})),
|
|
5353
|
-
updateCategoryItems: (key, items) => set((state) => {
|
|
5354
|
-
const base = state.recipientCategories[key] ?? {
|
|
5355
|
-
key,
|
|
5356
|
-
label: key,
|
|
5357
|
-
availableItems: [],
|
|
5358
|
-
selectedIds: [],
|
|
5359
|
-
allSelected: false
|
|
5360
|
-
};
|
|
5361
|
-
return {
|
|
5362
|
-
recipientCategories: {
|
|
5363
|
-
...state.recipientCategories,
|
|
5364
|
-
[key]: { ...base, availableItems: items }
|
|
5365
|
-
}
|
|
5366
|
-
};
|
|
5367
|
-
}),
|
|
5368
|
-
updateCategorySelection: (key, selectedIds, allSelected) => set((state) => {
|
|
5369
|
-
const base = state.recipientCategories[key] ?? {
|
|
5370
|
-
key,
|
|
5371
|
-
label: key,
|
|
5372
|
-
availableItems: [],
|
|
5373
|
-
selectedIds: [],
|
|
5374
|
-
allSelected: false
|
|
5375
|
-
};
|
|
5376
|
-
return {
|
|
5377
|
-
recipientCategories: {
|
|
5378
|
-
...state.recipientCategories,
|
|
5379
|
-
[key]: { ...base, selectedIds, allSelected }
|
|
5380
|
-
}
|
|
5381
|
-
};
|
|
5382
|
-
}),
|
|
5383
|
-
clearCategorySelection: (key) => set((state) => {
|
|
5384
|
-
const base = state.recipientCategories[key] ?? {
|
|
5385
|
-
key,
|
|
5386
|
-
label: key,
|
|
5387
|
-
availableItems: [],
|
|
5388
|
-
selectedIds: [],
|
|
5389
|
-
allSelected: false
|
|
5390
|
-
};
|
|
5391
|
-
return {
|
|
5392
|
-
recipientCategories: {
|
|
5393
|
-
...state.recipientCategories,
|
|
5394
|
-
[key]: { ...base, selectedIds: [], allSelected: false }
|
|
5395
|
-
}
|
|
5396
|
-
};
|
|
5397
|
-
}),
|
|
5398
|
-
// Step 3 - Data de envio
|
|
5399
|
-
setDate: (date) => set({ date }),
|
|
5400
|
-
setTime: (time) => set({ time }),
|
|
5401
|
-
setSendToday: (sendToday) => {
|
|
5402
|
-
const now = /* @__PURE__ */ new Date();
|
|
5403
|
-
const year = now.getFullYear();
|
|
5404
|
-
const month = String(now.getMonth() + 1).padStart(2, "0");
|
|
5405
|
-
const day = String(now.getDate()).padStart(2, "0");
|
|
5406
|
-
const hours = String(now.getHours()).padStart(2, "0");
|
|
5407
|
-
const minutes = String(now.getMinutes()).padStart(2, "0");
|
|
5408
|
-
set({
|
|
5409
|
-
sendToday,
|
|
5410
|
-
date: `${year}-${month}-${day}`,
|
|
5411
|
-
time: `${hours}:${minutes}`
|
|
5412
|
-
});
|
|
5413
|
-
},
|
|
5414
|
-
setSendCopyToEmail: (sendCopyToEmail) => set({ sendCopyToEmail }),
|
|
5415
|
-
// Reset form
|
|
5416
|
-
resetForm: () => set(initialState)
|
|
5417
|
-
}));
|
|
5418
|
-
|
|
5419
5419
|
// src/components/AlertManager/AlertSteps/MessageStep.tsx
|
|
5420
5420
|
var import_shallow = require("zustand/react/shallow");
|
|
5421
5421
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|