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
|
@@ -1064,6 +1064,101 @@ var CheckboxGroup = ({
|
|
|
1064
1064
|
);
|
|
1065
1065
|
};
|
|
1066
1066
|
|
|
1067
|
+
// src/components/AlertManager/useAlertForm.ts
|
|
1068
|
+
import { create } from "zustand";
|
|
1069
|
+
var initialState = {
|
|
1070
|
+
title: "",
|
|
1071
|
+
message: "",
|
|
1072
|
+
image: null,
|
|
1073
|
+
date: "",
|
|
1074
|
+
time: "",
|
|
1075
|
+
sendToday: false,
|
|
1076
|
+
sendCopyToEmail: false,
|
|
1077
|
+
recipientCategories: {}
|
|
1078
|
+
};
|
|
1079
|
+
var useAlertFormStore = create((set) => ({
|
|
1080
|
+
...initialState,
|
|
1081
|
+
// Step 1 - Mensagem
|
|
1082
|
+
setTitle: (title) => set({ title }),
|
|
1083
|
+
setMessage: (message) => set({ message }),
|
|
1084
|
+
setImage: (image) => set({ image }),
|
|
1085
|
+
// Step 2 - Destinatários (Dinâmico)
|
|
1086
|
+
initializeCategory: (category) => set((state) => ({
|
|
1087
|
+
recipientCategories: {
|
|
1088
|
+
...state.recipientCategories,
|
|
1089
|
+
[category.key]: {
|
|
1090
|
+
...category,
|
|
1091
|
+
selectedIds: category.selectedIds || [],
|
|
1092
|
+
allSelected: category.allSelected || false
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
})),
|
|
1096
|
+
updateCategoryItems: (key, items) => set((state) => {
|
|
1097
|
+
const base = state.recipientCategories[key] ?? {
|
|
1098
|
+
key,
|
|
1099
|
+
label: key,
|
|
1100
|
+
availableItems: [],
|
|
1101
|
+
selectedIds: [],
|
|
1102
|
+
allSelected: false
|
|
1103
|
+
};
|
|
1104
|
+
return {
|
|
1105
|
+
recipientCategories: {
|
|
1106
|
+
...state.recipientCategories,
|
|
1107
|
+
[key]: { ...base, availableItems: items }
|
|
1108
|
+
}
|
|
1109
|
+
};
|
|
1110
|
+
}),
|
|
1111
|
+
updateCategorySelection: (key, selectedIds, allSelected) => set((state) => {
|
|
1112
|
+
const base = state.recipientCategories[key] ?? {
|
|
1113
|
+
key,
|
|
1114
|
+
label: key,
|
|
1115
|
+
availableItems: [],
|
|
1116
|
+
selectedIds: [],
|
|
1117
|
+
allSelected: false
|
|
1118
|
+
};
|
|
1119
|
+
return {
|
|
1120
|
+
recipientCategories: {
|
|
1121
|
+
...state.recipientCategories,
|
|
1122
|
+
[key]: { ...base, selectedIds, allSelected }
|
|
1123
|
+
}
|
|
1124
|
+
};
|
|
1125
|
+
}),
|
|
1126
|
+
clearCategorySelection: (key) => set((state) => {
|
|
1127
|
+
const base = state.recipientCategories[key] ?? {
|
|
1128
|
+
key,
|
|
1129
|
+
label: key,
|
|
1130
|
+
availableItems: [],
|
|
1131
|
+
selectedIds: [],
|
|
1132
|
+
allSelected: false
|
|
1133
|
+
};
|
|
1134
|
+
return {
|
|
1135
|
+
recipientCategories: {
|
|
1136
|
+
...state.recipientCategories,
|
|
1137
|
+
[key]: { ...base, selectedIds: [], allSelected: false }
|
|
1138
|
+
}
|
|
1139
|
+
};
|
|
1140
|
+
}),
|
|
1141
|
+
// Step 3 - Data de envio
|
|
1142
|
+
setDate: (date) => set({ date }),
|
|
1143
|
+
setTime: (time) => set({ time }),
|
|
1144
|
+
setSendToday: (sendToday) => {
|
|
1145
|
+
const now = /* @__PURE__ */ new Date();
|
|
1146
|
+
const year = now.getFullYear();
|
|
1147
|
+
const month = String(now.getMonth() + 1).padStart(2, "0");
|
|
1148
|
+
const day = String(now.getDate()).padStart(2, "0");
|
|
1149
|
+
const hours = String(now.getHours()).padStart(2, "0");
|
|
1150
|
+
const minutes = String(now.getMinutes()).padStart(2, "0");
|
|
1151
|
+
set({
|
|
1152
|
+
sendToday,
|
|
1153
|
+
date: `${year}-${month}-${day}`,
|
|
1154
|
+
time: `${hours}:${minutes}`
|
|
1155
|
+
});
|
|
1156
|
+
},
|
|
1157
|
+
setSendCopyToEmail: (sendCopyToEmail) => set({ sendCopyToEmail }),
|
|
1158
|
+
// Reset form
|
|
1159
|
+
resetForm: () => set(initialState)
|
|
1160
|
+
}));
|
|
1161
|
+
|
|
1067
1162
|
// src/components/Modal/Modal.tsx
|
|
1068
1163
|
import { useEffect as useEffect2, useId as useId2 } from "react";
|
|
1069
1164
|
import { X as X2 } from "phosphor-react";
|
|
@@ -1686,7 +1781,7 @@ import {
|
|
|
1686
1781
|
cloneElement,
|
|
1687
1782
|
useState as useState7
|
|
1688
1783
|
} from "react";
|
|
1689
|
-
import { create as
|
|
1784
|
+
import { create as create3, useStore } from "zustand";
|
|
1690
1785
|
|
|
1691
1786
|
// src/components/ThemeToggle/ThemeToggle.tsx
|
|
1692
1787
|
import { Moon, Sun } from "phosphor-react";
|
|
@@ -1696,7 +1791,7 @@ import { useState as useState6, useEffect as useEffect4 } from "react";
|
|
|
1696
1791
|
import { useEffect as useEffect3 } from "react";
|
|
1697
1792
|
|
|
1698
1793
|
// src/store/themeStore.ts
|
|
1699
|
-
import { create } from "zustand";
|
|
1794
|
+
import { create as create2 } from "zustand";
|
|
1700
1795
|
import { devtools, persist } from "zustand/middleware";
|
|
1701
1796
|
var applyThemeToDOM = (mode) => {
|
|
1702
1797
|
const htmlElement = document.documentElement;
|
|
@@ -1730,7 +1825,7 @@ var saveOriginalTheme = () => {
|
|
|
1730
1825
|
htmlElement.setAttribute("data-original-theme", currentTheme);
|
|
1731
1826
|
}
|
|
1732
1827
|
};
|
|
1733
|
-
var useThemeStore =
|
|
1828
|
+
var useThemeStore = create2()(
|
|
1734
1829
|
devtools(
|
|
1735
1830
|
persist(
|
|
1736
1831
|
(set, get) => ({
|
|
@@ -1884,7 +1979,7 @@ var ThemeToggle = ({
|
|
|
1884
1979
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
1885
1980
|
import { Fragment, jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1886
1981
|
function createDropdownStore() {
|
|
1887
|
-
return
|
|
1982
|
+
return create3((set) => ({
|
|
1888
1983
|
open: false,
|
|
1889
1984
|
setOpen: (open) => set({ open })
|
|
1890
1985
|
}));
|
|
@@ -5200,10 +5295,10 @@ import {
|
|
|
5200
5295
|
useRef as useRef6,
|
|
5201
5296
|
useState as useState11
|
|
5202
5297
|
} from "react";
|
|
5203
|
-
import { create as
|
|
5298
|
+
import { create as create4 } from "zustand";
|
|
5204
5299
|
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
5205
5300
|
function createAccordionGroupStore(type, initialValue, collapsible) {
|
|
5206
|
-
return
|
|
5301
|
+
return create4((set, get) => ({
|
|
5207
5302
|
type,
|
|
5208
5303
|
value: initialValue,
|
|
5209
5304
|
collapsible,
|
|
@@ -5349,101 +5444,6 @@ AccordionGroup.displayName = "AccordionGroup";
|
|
|
5349
5444
|
// src/components/AlertManager/AlertsManager.tsx
|
|
5350
5445
|
import { CaretLeft, CaretRight as CaretRight4, PaperPlaneTilt } from "phosphor-react";
|
|
5351
5446
|
|
|
5352
|
-
// src/components/AlertManager/useAlertForm.ts
|
|
5353
|
-
import { create as create4 } from "zustand";
|
|
5354
|
-
var initialState = {
|
|
5355
|
-
title: "",
|
|
5356
|
-
message: "",
|
|
5357
|
-
image: null,
|
|
5358
|
-
date: "",
|
|
5359
|
-
time: "",
|
|
5360
|
-
sendToday: false,
|
|
5361
|
-
sendCopyToEmail: false,
|
|
5362
|
-
recipientCategories: {}
|
|
5363
|
-
};
|
|
5364
|
-
var useAlertFormStore = create4((set) => ({
|
|
5365
|
-
...initialState,
|
|
5366
|
-
// Step 1 - Mensagem
|
|
5367
|
-
setTitle: (title) => set({ title }),
|
|
5368
|
-
setMessage: (message) => set({ message }),
|
|
5369
|
-
setImage: (image) => set({ image }),
|
|
5370
|
-
// Step 2 - Destinatários (Dinâmico)
|
|
5371
|
-
initializeCategory: (category) => set((state) => ({
|
|
5372
|
-
recipientCategories: {
|
|
5373
|
-
...state.recipientCategories,
|
|
5374
|
-
[category.key]: {
|
|
5375
|
-
...category,
|
|
5376
|
-
selectedIds: category.selectedIds || [],
|
|
5377
|
-
allSelected: category.allSelected || false
|
|
5378
|
-
}
|
|
5379
|
-
}
|
|
5380
|
-
})),
|
|
5381
|
-
updateCategoryItems: (key, items) => set((state) => {
|
|
5382
|
-
const base = state.recipientCategories[key] ?? {
|
|
5383
|
-
key,
|
|
5384
|
-
label: key,
|
|
5385
|
-
availableItems: [],
|
|
5386
|
-
selectedIds: [],
|
|
5387
|
-
allSelected: false
|
|
5388
|
-
};
|
|
5389
|
-
return {
|
|
5390
|
-
recipientCategories: {
|
|
5391
|
-
...state.recipientCategories,
|
|
5392
|
-
[key]: { ...base, availableItems: items }
|
|
5393
|
-
}
|
|
5394
|
-
};
|
|
5395
|
-
}),
|
|
5396
|
-
updateCategorySelection: (key, selectedIds, allSelected) => set((state) => {
|
|
5397
|
-
const base = state.recipientCategories[key] ?? {
|
|
5398
|
-
key,
|
|
5399
|
-
label: key,
|
|
5400
|
-
availableItems: [],
|
|
5401
|
-
selectedIds: [],
|
|
5402
|
-
allSelected: false
|
|
5403
|
-
};
|
|
5404
|
-
return {
|
|
5405
|
-
recipientCategories: {
|
|
5406
|
-
...state.recipientCategories,
|
|
5407
|
-
[key]: { ...base, selectedIds, allSelected }
|
|
5408
|
-
}
|
|
5409
|
-
};
|
|
5410
|
-
}),
|
|
5411
|
-
clearCategorySelection: (key) => set((state) => {
|
|
5412
|
-
const base = state.recipientCategories[key] ?? {
|
|
5413
|
-
key,
|
|
5414
|
-
label: key,
|
|
5415
|
-
availableItems: [],
|
|
5416
|
-
selectedIds: [],
|
|
5417
|
-
allSelected: false
|
|
5418
|
-
};
|
|
5419
|
-
return {
|
|
5420
|
-
recipientCategories: {
|
|
5421
|
-
...state.recipientCategories,
|
|
5422
|
-
[key]: { ...base, selectedIds: [], allSelected: false }
|
|
5423
|
-
}
|
|
5424
|
-
};
|
|
5425
|
-
}),
|
|
5426
|
-
// Step 3 - Data de envio
|
|
5427
|
-
setDate: (date) => set({ date }),
|
|
5428
|
-
setTime: (time) => set({ time }),
|
|
5429
|
-
setSendToday: (sendToday) => {
|
|
5430
|
-
const now = /* @__PURE__ */ new Date();
|
|
5431
|
-
const year = now.getFullYear();
|
|
5432
|
-
const month = String(now.getMonth() + 1).padStart(2, "0");
|
|
5433
|
-
const day = String(now.getDate()).padStart(2, "0");
|
|
5434
|
-
const hours = String(now.getHours()).padStart(2, "0");
|
|
5435
|
-
const minutes = String(now.getMinutes()).padStart(2, "0");
|
|
5436
|
-
set({
|
|
5437
|
-
sendToday,
|
|
5438
|
-
date: `${year}-${month}-${day}`,
|
|
5439
|
-
time: `${hours}:${minutes}`
|
|
5440
|
-
});
|
|
5441
|
-
},
|
|
5442
|
-
setSendCopyToEmail: (sendCopyToEmail) => set({ sendCopyToEmail }),
|
|
5443
|
-
// Reset form
|
|
5444
|
-
resetForm: () => set(initialState)
|
|
5445
|
-
}));
|
|
5446
|
-
|
|
5447
5447
|
// src/components/AlertManager/AlertSteps/MessageStep.tsx
|
|
5448
5448
|
import { useShallow } from "zustand/react/shallow";
|
|
5449
5449
|
import { jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
|