@sinco/react 1.2.3 → 1.2.4-rc.0

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/index.esm.js CHANGED
@@ -1,11 +1,10 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { Children, isValidElement, cloneElement, useState, useCallback, useEffect } from 'react';
3
- import { CheckCircleRounded, ErrorRounded, WarningRounded, InfoRounded, Close, KeyboardArrowDown, KeyboardArrowUp, AttachFile, UploadFileOutlined, Autorenew, CancelOutlined, DeleteOutline } from '@mui/icons-material';
3
+ import { CheckCircleRounded, ErrorRounded, WarningRounded, InfoRounded, Close, KeyboardArrowDown, KeyboardArrowUp } from '@mui/icons-material';
4
4
  import { withEmotionCache, ThemeContext, keyframes, css } from '@emotion/react';
5
5
  import { jsx, jsxs } from 'react/jsx-runtime';
6
6
  import * as ReactDOM from 'react-dom';
7
7
  import ReactDOM__default from 'react-dom';
8
- import { useDropzone } from 'react-dropzone';
9
8
 
10
9
  function _arrayLikeToArray(r, a) {
11
10
  (null == a || a > r.length) && (a = r.length);
@@ -15,9 +14,6 @@ function _arrayLikeToArray(r, a) {
15
14
  function _arrayWithHoles(r) {
16
15
  if (Array.isArray(r)) return r;
17
16
  }
18
- function _arrayWithoutHoles(r) {
19
- if (Array.isArray(r)) return _arrayLikeToArray(r);
20
- }
21
17
  function asyncGeneratorStep(n, t, e, r, o, a, c) {
22
18
  try {
23
19
  var i = n[a](c),
@@ -51,9 +47,6 @@ function _defineProperty(e, r, t) {
51
47
  writable: !0
52
48
  }) : e[r] = t, e;
53
49
  }
54
- function _iterableToArray(r) {
55
- if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
56
- }
57
50
  function _iterableToArrayLimit(r, l) {
58
51
  var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
59
52
  if (null != t) {
@@ -84,9 +77,6 @@ function _iterableToArrayLimit(r, l) {
84
77
  function _nonIterableRest() {
85
78
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
86
79
  }
87
- function _nonIterableSpread() {
88
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
89
- }
90
80
  function ownKeys(e, r) {
91
81
  var t = Object.keys(e);
92
82
  if (Object.getOwnPropertySymbols) {
@@ -412,9 +402,6 @@ function _regeneratorRuntime() {
412
402
  function _slicedToArray(r, e) {
413
403
  return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
414
404
  }
415
- function _toConsumableArray(r) {
416
- return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
417
- }
418
405
  function _toPrimitive(t, r) {
419
406
  if ("object" != typeof t || !t) return t;
420
407
  var e = t[Symbol.toPrimitive];
@@ -7364,6 +7351,14 @@ const styled = createStyled({
7364
7351
  });
7365
7352
 
7366
7353
  var components = {
7354
+ MuiBackdrop: {
7355
+ styleOverrides: {
7356
+ root: {
7357
+ backgroundColor: "#000000",
7358
+ opacity: "28%"
7359
+ }
7360
+ }
7361
+ },
7367
7362
  MuiSelect: {
7368
7363
  styleOverrides: {
7369
7364
  outlined: {
@@ -16834,7 +16829,7 @@ var DrawerComponent = function DrawerComponent(_ref) {
16834
16829
  onClose: onClose,
16835
16830
  sx: _objectSpread2({
16836
16831
  "& .MuiBackdrop-root": {
16837
- backgroundColor: "#F0f0f099 !important",
16832
+ backgroundColor: "#000000 !important",
16838
16833
  backdropFilter: "blur(4px)"
16839
16834
  },
16840
16835
  "& .MuiDrawer-paper": _objectSpread2({
@@ -20129,253 +20124,6 @@ var UserFolder = createSvgIcon(React__default.createElement("svg", {
20129
20124
  fill: "#00BCD4"
20130
20125
  })), "UserFolder");
20131
20126
 
20132
- var AdjuntarArchivo = function AdjuntarArchivo(_ref) {
20133
- var compact = _ref.compact,
20134
- sx = _ref.sx,
20135
- controlArchivo = _ref.controlArchivo;
20136
- var _useState = useState(function () {
20137
- var guardarArchivo = localStorage.getItem("archivos");
20138
- return guardarArchivo ? JSON.parse(guardarArchivo).map(function (file) {
20139
- return {
20140
- file: new File([file], file.name),
20141
- progress: 0,
20142
- loadingComplete: false
20143
- };
20144
- }) : [];
20145
- }),
20146
- _useState2 = _slicedToArray(_useState, 2),
20147
- archivos = _useState2[0],
20148
- setArchivos = _useState2[1];
20149
- useEffect(function () {
20150
- setArchivos([]);
20151
- }, []);
20152
- useEffect(function () {
20153
- archivos.forEach(function (archivo, index) {
20154
- if (archivo.progress < 100) {
20155
- var intervalo = setInterval(function () {
20156
- setArchivos(function (prevArchivos) {
20157
- return prevArchivos.map(function (item, idx) {
20158
- return idx === index ? _objectSpread2(_objectSpread2({}, item), {}, {
20159
- progress: Math.min(item.progress + 10, 100),
20160
- loadingComplete: Math.min(item.progress + 10, 100) === 100
20161
- }) : item;
20162
- });
20163
- });
20164
- }, 1000);
20165
- return function () {
20166
- return clearInterval(intervalo);
20167
- };
20168
- }
20169
- });
20170
- }, [archivos]);
20171
- var validarArchivoDuplicado = function validarArchivoDuplicado(file) {
20172
- var archivoDuplicado = archivos.some(function (archivoExistente) {
20173
- return archivoExistente.file.name === file.name;
20174
- });
20175
- if (archivoDuplicado) {
20176
- return {
20177
- code: "archivo-duplicado",
20178
- message: "No se puede elegir el mismo archivo, seleccione otro por favor"
20179
- };
20180
- }
20181
- return null;
20182
- };
20183
- var _useDropzone = useDropzone({
20184
- validator: validarArchivoDuplicado,
20185
- multiple: true,
20186
- onDrop: function onDrop(acceptedFiles) {
20187
- setArchivos(function (prev) {
20188
- var actualizarArchivos = [].concat(_toConsumableArray(prev), _toConsumableArray(acceptedFiles.map(function (file) {
20189
- return {
20190
- file: file,
20191
- progress: 0,
20192
- loadingComplete: false
20193
- };
20194
- })));
20195
- localStorage.setItem("archivos", JSON.stringify(actualizarArchivos.map(function (_ref2) {
20196
- var file = _ref2.file;
20197
- return file;
20198
- })));
20199
- return actualizarArchivos;
20200
- });
20201
- }
20202
- }),
20203
- getRootProps = _useDropzone.getRootProps,
20204
- getInputProps = _useDropzone.getInputProps;
20205
- var Eliminar = useCallback(function (index) {
20206
- setArchivos(function (prevFiles) {
20207
- var actualizarArchivos = prevFiles.filter(function (_, indexIteration) {
20208
- return indexIteration !== index;
20209
- });
20210
- localStorage.setItem("archivos", JSON.stringify(actualizarArchivos.map(function (_ref3) {
20211
- var file = _ref3.file;
20212
- return file;
20213
- })));
20214
- return actualizarArchivos;
20215
- });
20216
- }, [setArchivos]);
20217
- var Editar = useCallback(function (index) {
20218
- var input = document.createElement('input');
20219
- input.type = 'file';
20220
- input.onchange = function (event) {
20221
- var newFile = event.target.files[0];
20222
- if (newFile) {
20223
- setArchivos(function (prevFiles) {
20224
- var actualizarArchivos = prevFiles.map(function (archivo, idx) {
20225
- return idx === index ? _objectSpread2(_objectSpread2({}, archivo), {}, {
20226
- file: newFile,
20227
- progress: 0,
20228
- loadingComplete: false
20229
- }) : archivo;
20230
- });
20231
- localStorage.setItem("archivos", JSON.stringify(actualizarArchivos.map(function (_ref4) {
20232
- var file = _ref4.file;
20233
- return file;
20234
- })));
20235
- return actualizarArchivos;
20236
- });
20237
- }
20238
- };
20239
- input.click();
20240
- }, [setArchivos]);
20241
- var controlEventoAdjuntar = function controlEventoAdjuntar(e) {
20242
- e.stopPropagation();
20243
- controlArchivo(archivos.map(function (e) {
20244
- return e.file;
20245
- }));
20246
- setArchivos([]);
20247
- localStorage.removeItem("archivos");
20248
- };
20249
- return React__default.createElement(Stack, {
20250
- width: "100%",
20251
- alignItems: "center",
20252
- bgcolor: "transparent",
20253
- height: "100%",
20254
- gap: 1
20255
- }, React__default.createElement(Stack, _objectSpread2({
20256
- id: "dropzone",
20257
- alignItems: "center",
20258
- flexDirection: compact === true ? "row" : "column",
20259
- justifyContent: "center",
20260
- bgcolor: "transparent",
20261
- width: "100%",
20262
- boxShadow: 1,
20263
- gap: 1,
20264
- borderRadius: 1,
20265
- py: 3,
20266
- sx: _objectSpread2({
20267
- border: function border(theme) {
20268
- return "1px dashed ".concat(theme.palette.grey[500]);
20269
- },
20270
- cursor: "pointer",
20271
- ":hover": {
20272
- backgroundColor: "action.hover"
20273
- }
20274
- }, sx)
20275
- }, getRootProps()), React__default.createElement("input", _objectSpread2({}, getInputProps())), React__default.createElement("img", {
20276
- src: "src/assets/logoAdjuntarArchivos.svg",
20277
- alt: "icon"
20278
- }), React__default.createElement(Stack, {
20279
- gap: 0.5
20280
- }, React__default.createElement(Typography, {
20281
- variant: "body2",
20282
- color: "text.primary"
20283
- }, "Arrastrar o adjuntar archivos"), React__default.createElement(Typography, {
20284
- variant: "caption",
20285
- color: "text.secondary"
20286
- }, "DOCX, XML, PNG, JPG \u2022 Max 00 MB")), React__default.createElement(Button, {
20287
- size: "small",
20288
- startIcon: React__default.createElement(AttachFile, {
20289
- fontSize: "inherit"
20290
- }),
20291
- onClick: controlEventoAdjuntar
20292
- }, "Adjuntar")), React__default.createElement(Stack, {
20293
- id: "informacion",
20294
- width: "100%",
20295
- height: "auto",
20296
- gap: 1,
20297
- sx: {
20298
- overflowY: "auto"
20299
- }
20300
- }, archivos.map(function (_ref5, index) {
20301
- var file = _ref5.file,
20302
- progress = _ref5.progress,
20303
- loadingComplete = _ref5.loadingComplete;
20304
- return React__default.createElement(Stack, {
20305
- flexDirection: "row",
20306
- key: "".concat(file.name, "-").concat(index),
20307
- width: "100%",
20308
- gap: 1,
20309
- borderRadius: 0.5,
20310
- sx: {
20311
- ":hover": {
20312
- backgroundColor: "action.hover"
20313
- }
20314
- }
20315
- }, React__default.createElement(Stack, {
20316
- width: "100%",
20317
- alignItems: "center",
20318
- flexDirection: "row",
20319
- gap: 2,
20320
- p: 1
20321
- }, React__default.createElement(Stack, {
20322
- width: "100%",
20323
- flexDirection: "row",
20324
- alignItems: "center",
20325
- gap: 0.5
20326
- }, React__default.createElement(UploadFileOutlined, {
20327
- color: "primary",
20328
- fontSize: "small"
20329
- }), React__default.createElement(Stack, {
20330
- flexDirection: "column",
20331
- width: "100%"
20332
- }, React__default.createElement(Typography, {
20333
- variant: "body2",
20334
- color: "text.primary"
20335
- }, file.name), React__default.createElement(Typography, {
20336
- variant: "caption",
20337
- color: "text.secondary"
20338
- }, loadingComplete ? "".concat(new Date().toLocaleDateString(), " \u2022 ").concat(Math.round(file.size / 1024), " KB") : " Cargando... \u2022 ".concat(Math.round(file.size / 1024), " KB")), !loadingComplete && React__default.createElement(LinearProgress, {
20339
- color: "primary",
20340
- variant: "determinate",
20341
- value: progress,
20342
- sx: {
20343
- width: "100%"
20344
- }
20345
- })))), React__default.createElement(Box$2, {
20346
- display: "flex",
20347
- justifyContent: "center",
20348
- alignItems: "center"
20349
- }, !loadingComplete ? React__default.createElement(React__default.Fragment, null, React__default.createElement(IconButton, {
20350
- id: "editarArchivo",
20351
- size: "small",
20352
- onClick: function onClick() {
20353
- return Editar(index);
20354
- }
20355
- }, React__default.createElement(Autorenew, {
20356
- fontSize: "small",
20357
- color: "action"
20358
- })), React__default.createElement(IconButton, {
20359
- id: "EliminarArchivo",
20360
- size: "small",
20361
- onClick: function onClick() {
20362
- return Eliminar(index);
20363
- }
20364
- }, React__default.createElement(CancelOutlined, {
20365
- fontSize: "small",
20366
- color: "action"
20367
- }))) : React__default.createElement(IconButton, {
20368
- size: "medium",
20369
- onClick: function onClick() {
20370
- return Eliminar(index);
20371
- }
20372
- }, React__default.createElement(DeleteOutline, {
20373
- fontSize: "small",
20374
- color: "action"
20375
- }))));
20376
- })));
20377
- };
20378
-
20379
20127
  /**
20380
20128
  * @license
20381
20129
  * Copyright 2021 Google LLC
@@ -24789,4 +24537,4 @@ var useDynamicColor = function useDynamicColor(url) {
24789
24537
  };
24790
24538
  };
24791
24539
 
24792
- export { ADCSincoTheme, AddCalendar, AdjuntarArchivo, AdproSincoTheme, Ai, BarChart, BarChartHorizontal, BasicCalendar, Books, Box$1 as Box, BoxReceived, Boxes, Brick, Building, BussinesTarget, CalendarUserEvents, Call, CardRadio, Cement, Chat, CheckBill, CheckBillSearch, CheckDocSearch, CheckedCalendar, CircularChart, Click, ClipBoard, ClipBoardUser, Clock, Cloud, Coin, Config, ContactMails, Contacts, Conversation, Coupon, Crane, DaysCalendar, Develop, Diagram, Discount, Doc, DonutChart, DownloadDoc, DrawerComponent as Drawer, DrawerComponent, Drill, DuplicateTemplate, DynamicColor, EmailAddress, EmptyStateComponent as EmptyState, EmptyStateComponent, Engine, ErrorCalendar, ErrorDoc, EventsCalendar, Excavator, ExclamationBox, ExclamationCalendar, Flag, Flow, FooterAction, Gasoline, General, Hammer, Img, Law, Lego, Lift, Location, LockedFolder, Mail, Megaphone, Microphone, MoneyBill, MoneyBillSearch, MoneyDoc, MoneyDocSearch, MountainFlag, Notification, OpenBox, OpenFolder, Padlock, PageHeaderComponent as PageHeader, PageHeaderComponent, PaintRoller, Pdf, PintPot, Ppt, ProgressSinco, Puzzle, QuestionBill, QuestionBillSearch, QuestionBox, QuestionDocSearch, Rar, ReceivedMail, ReloadDoc, SealedBox, SearchCountry, SearchHome, SearchMoney, SearchUser, ShippingBox, Sholve, SincoTheme, Speedometer, StackedChart, StarChart, StartPennant, Support, TextDoc, TextFolder, ToastNotification, ToolBox, TrafficCone, TrendChart, Trolly, TrollyBox, Truck, Txt, UnlockedCalendar, Upload, UploadDoc, UserConfig, UserFolder, Users, WhatsApp, Xls, Zip, useDynamicColor };
24540
+ export { ADCSincoTheme, AddCalendar, AdproSincoTheme, Ai, BarChart, BarChartHorizontal, BasicCalendar, Books, Box$1 as Box, BoxReceived, Boxes, Brick, Building, BussinesTarget, CalendarUserEvents, Call, CardRadio, Cement, Chat, CheckBill, CheckBillSearch, CheckDocSearch, CheckedCalendar, CircularChart, Click, ClipBoard, ClipBoardUser, Clock, Cloud, Coin, Config, ContactMails, Contacts, Conversation, Coupon, Crane, DaysCalendar, Develop, Diagram, Discount, Doc, DonutChart, DownloadDoc, DrawerComponent as Drawer, DrawerComponent, Drill, DuplicateTemplate, DynamicColor, EmailAddress, EmptyStateComponent as EmptyState, EmptyStateComponent, Engine, ErrorCalendar, ErrorDoc, EventsCalendar, Excavator, ExclamationBox, ExclamationCalendar, Flag, Flow, FooterAction, Gasoline, General, Hammer, Img, Law, Lego, Lift, Location, LockedFolder, Mail, Megaphone, Microphone, MoneyBill, MoneyBillSearch, MoneyDoc, MoneyDocSearch, MountainFlag, Notification, OpenBox, OpenFolder, Padlock, PageHeaderComponent as PageHeader, PageHeaderComponent, PaintRoller, Pdf, PintPot, Ppt, ProgressSinco, Puzzle, QuestionBill, QuestionBillSearch, QuestionBox, QuestionDocSearch, Rar, ReceivedMail, ReloadDoc, SealedBox, SearchCountry, SearchHome, SearchMoney, SearchUser, ShippingBox, Sholve, SincoTheme, Speedometer, StackedChart, StarChart, StartPennant, Support, TextDoc, TextFolder, ToastNotification, ToolBox, TrafficCone, TrendChart, Trolly, TrollyBox, Truck, Txt, UnlockedCalendar, Upload, UploadDoc, UserConfig, UserFolder, Users, WhatsApp, Xls, Zip, useDynamicColor };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sinco/react",
3
- "version": "1.2.3",
3
+ "version": "1.2.4-rc.0",
4
4
  "description": "package for the configuration of mui react sinco",
5
5
  "private": false,
6
6
  "license": "MIT",
@@ -6,5 +6,3 @@ export * from "./PageHeader";
6
6
  export * from "./ProgressSinco";
7
7
  export * from "./CardRadio";
8
8
  export * from "./Icons";
9
- export * from './adjuntar/';
10
- export * from './MultiSelect/';
@@ -1,13 +0,0 @@
1
- import React from "react";
2
- export interface MultiSelectProps {
3
- topPanel?: React.ReactNode;
4
- acciones?: React.ReactNode;
5
- anchorEl: HTMLElement | null;
6
- dense?: boolean;
7
- open: boolean;
8
- items: any[];
9
- onClose?: () => void;
10
- filterFunction: (items: any[], filtroTexto: string) => any[];
11
- getItemLabel: (item: any) => string;
12
- }
13
- export declare const MultiSelect: ({ topPanel, acciones, open, onClose, items, filterFunction, getItemLabel, anchorEl, dense }: MultiSelectProps) => React.JSX.Element;
@@ -1 +0,0 @@
1
- export * from '../MultiSelect';
@@ -1,8 +0,0 @@
1
- import React from "react";
2
- import { SxProps } from "@mui/material";
3
- export interface AdjuntarProps {
4
- controlArchivo: (archivos: File[]) => any;
5
- compact?: boolean;
6
- sx?: SxProps;
7
- }
8
- export declare const AdjuntarArchivo: ({ compact, sx, controlArchivo }: AdjuntarProps) => React.JSX.Element;
@@ -1 +0,0 @@
1
- export * from './AdjuntarArchivos';