keski_lib_catalog 1.3.13 → 1.3.14

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,6 +1,6 @@
1
1
  import React, { useState, useEffect } from 'react';
2
2
  import Carousel from 'react-material-ui-carousel';
3
- import { Box, Slide, Card, Typography, Chip, Button, CardMedia, Grid as Grid$1, useTheme, useMediaQuery, CardContent, Container } from '@mui/material';
3
+ import { Box, Slide, Card, Typography, Chip, Button, CardMedia, Grid as Grid$1, useTheme, useMediaQuery, CardContent, Container, Accordion, AccordionSummary, AccordionDetails } from '@mui/material';
4
4
  import Avatar from '@mui/material/Avatar';
5
5
  import { styled } from '@mui/material/styles';
6
6
  import Paper from '@mui/material/Paper';
@@ -1064,6 +1064,273 @@ var List = /*#__PURE__*/function (_AtomicElements) {
1064
1064
  return List;
1065
1065
  }(AtomicElements);
1066
1066
 
1067
+ function Layout1$6(content) {
1068
+ return /*#__PURE__*/React.createElement(Grid$1, {
1069
+ container: true,
1070
+ sx: {
1071
+ minHeight: '250px',
1072
+ width: '100%',
1073
+ margin: 'auto',
1074
+ padding: '0px'
1075
+ }
1076
+ }, /*#__PURE__*/React.createElement(Item$3, {
1077
+ title: content.component.title,
1078
+ content: content.component.subcomponent,
1079
+ side: content.component.justify_content
1080
+ }));
1081
+ }
1082
+ function Item$3(props) {
1083
+ var content = props.content,
1084
+ title = props.title;
1085
+ var _useState = useState([]),
1086
+ arrayFourElements = _useState[0],
1087
+ setArrayFourElements = _useState[1];
1088
+ var visible = true;
1089
+ var theme = useTheme();
1090
+ var isXsScreen = useMediaQuery(theme.breakpoints.down('sm'));
1091
+ var isSmScreen = useMediaQuery(theme.breakpoints.between('sm', 'md'));
1092
+ var isMdScreen = useMediaQuery(theme.breakpoints.between('md', 'lg'));
1093
+ var isLgScreen = useMediaQuery(theme.breakpoints.up('lg'));
1094
+ function divideArreglo(arreglo, tamanoMaximo) {
1095
+ var subarreglos = [];
1096
+ var subarregloActual = [];
1097
+ for (var i = 0; i < arreglo.length; i++) {
1098
+ subarregloActual.push(arreglo[i]);
1099
+ if (subarregloActual.length === tamanoMaximo || i === arreglo.length - 1) {
1100
+ subarreglos.push(subarregloActual);
1101
+ subarregloActual = [];
1102
+ }
1103
+ }
1104
+ return subarreglos;
1105
+ }
1106
+ useEffect(function () {
1107
+ var tamanoMaximo;
1108
+ if (isSmScreen) {
1109
+ tamanoMaximo = 2;
1110
+ } else if (isMdScreen) {
1111
+ tamanoMaximo = 3;
1112
+ } else if (isLgScreen) {
1113
+ tamanoMaximo = 4;
1114
+ } else if (isXsScreen) {
1115
+ tamanoMaximo = 1;
1116
+ }
1117
+ setArrayFourElements(divideArreglo(content, tamanoMaximo));
1118
+ }, [isXsScreen, isSmScreen, isMdScreen, isLgScreen, content]);
1119
+ if (!arrayFourElements) {
1120
+ return null;
1121
+ } else {
1122
+ return content.length >= 1 ? /*#__PURE__*/React.createElement(Carousel, {
1123
+ autoPlay: true,
1124
+ indicators: false,
1125
+ swipe: true,
1126
+ cycleNavigation: true,
1127
+ sx: {
1128
+ width: '100%',
1129
+ height: '250px',
1130
+ paddingTop: '60px',
1131
+ position: 'relative'
1132
+ }
1133
+ }, arrayFourElements.map(function (items, i) {
1134
+ return /*#__PURE__*/React.createElement(Container, {
1135
+ maxWidth: "lg"
1136
+ }, /*#__PURE__*/React.createElement(Grid$1, {
1137
+ container: true,
1138
+ key: i,
1139
+ spacing: 0,
1140
+ sx: {
1141
+ margin: 'auto',
1142
+ padding: 'auto'
1143
+ }
1144
+ }, /*#__PURE__*/React.createElement(Box, {
1145
+ sx: {
1146
+ position: 'absolute',
1147
+ top: {
1148
+ xs: '-40px',
1149
+ sm: '-80px'
1150
+ },
1151
+ zIndex: 1
1152
+ }
1153
+ }, " ", /*#__PURE__*/React.createElement(Typography, {
1154
+ component: 'h2',
1155
+ dangerouslySetInnerHTML: {
1156
+ __html: title ? title : ''
1157
+ },
1158
+ sx: {
1159
+ height: '100%',
1160
+ fontSize: {
1161
+ xl: '3em',
1162
+ lg: '3em',
1163
+ md: '2.25em',
1164
+ sm: '1.875em',
1165
+ xs: '1.875em'
1166
+ }
1167
+ }
1168
+ })), items.map(function (item, j) {
1169
+ return /*#__PURE__*/React.createElement(Grid$1, {
1170
+ item: true,
1171
+ key: j,
1172
+ xs: 12,
1173
+ sm: 6,
1174
+ md: 4,
1175
+ lg: 3,
1176
+ xl: 3,
1177
+ sx: {
1178
+ margin: {
1179
+ xs: '0px',
1180
+ sm: '0px'
1181
+ },
1182
+ width: 'object-fit',
1183
+ display: 'flex',
1184
+ justifyContent: 'center',
1185
+ alignItems: 'center',
1186
+ '&.MuiGrid-item': {
1187
+ paddingLeft: '17px',
1188
+ paddingTop: '10px'
1189
+ }
1190
+ }
1191
+ }, /*#__PURE__*/React.createElement(Slide, {
1192
+ direction: "left",
1193
+ "in": visible
1194
+ }, /*#__PURE__*/React.createElement(Card, {
1195
+ elevation: 0,
1196
+ sx: {
1197
+ width: '100%',
1198
+ height: '100%',
1199
+ borderRadius: '10px',
1200
+ background: 'none'
1201
+ }
1202
+ }, /*#__PURE__*/React.createElement(CardMedia, {
1203
+ component: "img",
1204
+ image: item.image.url ? item.image.url : 'none',
1205
+ alt: item.description ? item.description : 'none',
1206
+ sx: {
1207
+ width: '100%',
1208
+ height: '140px',
1209
+ transform: "translate(" + item.image_transform_x + "%, " + item.image_transform_y + "%) scale(" + (item.image_scale ? item.image_scale : '1') + ")"
1210
+ }
1211
+ }))));
1212
+ })));
1213
+ })) : null;
1214
+ }
1215
+ }
1216
+
1217
+ var Brands = /*#__PURE__*/function (_AtomicElements) {
1218
+ _inheritsLoose(Brands, _AtomicElements);
1219
+ function Brands() {
1220
+ var _this;
1221
+ _this = _AtomicElements.call(this) || this;
1222
+ _this.layout = [Layout1$6];
1223
+ _this.layoutFootprint = ['brands_layout_1.png'];
1224
+ _this.layoutFootprintReq = [{
1225
+ 'type': 0,
1226
+ 'title': 'Tittle',
1227
+ 'description': 'Description',
1228
+ 'image_scale': 'image scale',
1229
+ 'image_transform_x': 'image transform x',
1230
+ 'image_transform_y': 'image transform y',
1231
+ 'image': 'Image'
1232
+ }];
1233
+ return _this;
1234
+ }
1235
+ return Brands;
1236
+ }(AtomicElements);
1237
+
1238
+ function Layout1$7(content) {
1239
+ var _content$component$su, _content$component$su2;
1240
+ var visible = true;
1241
+ return /*#__PURE__*/React.createElement(Slide, {
1242
+ direction: "left",
1243
+ "in": visible
1244
+ }, /*#__PURE__*/React.createElement(Box, {
1245
+ sx: {
1246
+ width: {
1247
+ xs: '100%',
1248
+ md: '100%'
1249
+ },
1250
+ color: (_content$component$su = content.component.subcomponent[0]) === null || _content$component$su === void 0 ? void 0 : _content$component$su.text_color,
1251
+ textAlign: content.component.justify_content
1252
+ }
1253
+ }, /*#__PURE__*/React.createElement(Typography, {
1254
+ component: 'h2',
1255
+ dangerouslySetInnerHTML: {
1256
+ __html: content.component.title ? content.component.title : 'Agregue titulo'
1257
+ },
1258
+ sx: {
1259
+ marginBottom: '16px',
1260
+ whiteSpace: 'pre-wrap',
1261
+ fontSize: {
1262
+ xs: "1.875em",
1263
+ sm: "2.25em",
1264
+ md: "3em",
1265
+ lg: "3em",
1266
+ xl: "3em"
1267
+ },
1268
+ fontWeight: "bold"
1269
+ }
1270
+ }), /*#__PURE__*/React.createElement(Box, {
1271
+ sx: {
1272
+ width: content.component.justify_content == "center" ? "100%" : {
1273
+ xl: "70%",
1274
+ lg: "72%",
1275
+ md: "84%",
1276
+ sm: "100%",
1277
+ xs: "100%"
1278
+ }
1279
+ }
1280
+ }, (_content$component$su2 = content.component.subcomponent) === null || _content$component$su2 === void 0 ? void 0 : _content$component$su2.map(function (item, index) {
1281
+ return /*#__PURE__*/React.createElement(Accordion, {
1282
+ key: index,
1283
+ elevation: 2
1284
+ }, /*#__PURE__*/React.createElement(AccordionSummary, {
1285
+ "aria-controls": "panel1a-content",
1286
+ id: "panel1a-header",
1287
+ expandIcon: '+',
1288
+ sx: {
1289
+ marginBottom: '16px'
1290
+ }
1291
+ }, /*#__PURE__*/React.createElement(Typography, {
1292
+ component: 'h3',
1293
+ dangerouslySetInnerHTML: {
1294
+ __html: item.subtitle ? item.subtitle : 'Agregue pregunta'
1295
+ },
1296
+ sx: {
1297
+ fontSize: '1.25em',
1298
+ fontWeight: 'bold'
1299
+ }
1300
+ })), /*#__PURE__*/React.createElement(AccordionDetails, {
1301
+ sx: {
1302
+ padding: '16px'
1303
+ }
1304
+ }, /*#__PURE__*/React.createElement(Typography, {
1305
+ component: 'p',
1306
+ dangerouslySetInnerHTML: {
1307
+ __html: item.description ? item.description : 'Agregue respuesta'
1308
+ },
1309
+ sx: {
1310
+ fontSize: '1.125em'
1311
+ }
1312
+ })));
1313
+ }))));
1314
+ }
1315
+
1316
+ var FAQ = /*#__PURE__*/function (_AtomicElements) {
1317
+ _inheritsLoose(FAQ, _AtomicElements);
1318
+ function FAQ() {
1319
+ var _this;
1320
+ _this = _AtomicElements.call(this) || this;
1321
+ _this.layout = [Layout1$7];
1322
+ _this.layoutFootprint = ['faq_layout_1.png'];
1323
+ _this.layoutFootprintReq = [{
1324
+ 'type': 0,
1325
+ 'title': 'Tittle',
1326
+ 'subtitle': 'Subtitle',
1327
+ 'description': 'Description'
1328
+ }];
1329
+ return _this;
1330
+ }
1331
+ return FAQ;
1332
+ }(AtomicElements);
1333
+
1067
1334
  function CanvasContainer(props) {
1068
1335
  var _json$component$bg_im;
1069
1336
  var json = props.json,
@@ -1095,9 +1362,9 @@ function CanvasContainer(props) {
1095
1362
  xs: '64px 0px'
1096
1363
  },
1097
1364
  width: '100%',
1098
- height: '100%'
1365
+ height: json.type === 6 ? '250px' : '100%'
1099
1366
  }
1100
- }, /*#__PURE__*/React.createElement(Container, {
1367
+ }, json.type === 6 || json.component.layout === 1 ? children : /*#__PURE__*/React.createElement(Container, {
1101
1368
  maxWidth: "lg",
1102
1369
  sx: {
1103
1370
  padding: '0px',
@@ -1201,7 +1468,9 @@ var Sections = /*#__PURE__*/function () {
1201
1468
  this.gallery = new Section(new Gallery());
1202
1469
  this.text = new Section(new Text());
1203
1470
  this.list = new Section(new List());
1204
- this.sections = [this.banner, this.textPlusImg, this.quotes, this.gallery, this.text, this.list];
1471
+ this.brands = new Section(new Brands());
1472
+ this.faq = new Section(new FAQ());
1473
+ this.sections = [this.banner, this.textPlusImg, this.quotes, this.gallery, this.text, this.list, this.brands, this.faq];
1205
1474
  }
1206
1475
  var _proto2 = Sections.prototype;
1207
1476
  _proto2.getSectionList = function getSectionList() {
@@ -1211,7 +1480,9 @@ var Sections = /*#__PURE__*/function () {
1211
1480
  '2': 'Citas/Testimonios',
1212
1481
  '3': 'Galeria',
1213
1482
  '4': 'Texto',
1214
- '5': 'Lista'
1483
+ '5': 'Lista',
1484
+ '6': 'Marcas',
1485
+ '7': 'FAQ'
1215
1486
  };
1216
1487
  };
1217
1488
  _proto2.getLayoutsFromSection = function getLayoutsFromSection(index) {