pallote-react 0.14.0 → 0.14.2
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.js +4 -264
- package/package.json +2 -1
package/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import React, { useState, useEffect, useRef
|
|
1
|
+
import React, { useState, useEffect, useRef } from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { createPortal } from 'react-dom';
|
|
5
|
-
import { X, CalendarBlank, Clock, CaretUpDown, ArrowSquareOut
|
|
6
|
-
import { Link as Link$1 } from 'react-router-dom';
|
|
5
|
+
import { X, CalendarBlank, Clock, CaretUpDown, ArrowSquareOut } from '@phosphor-icons/react';
|
|
7
6
|
import SyntaxHighlighter from 'react-syntax-highlighter';
|
|
8
7
|
|
|
9
8
|
const Color = ({
|
|
@@ -916,7 +915,7 @@ const NavItem = ({
|
|
|
916
915
|
if (dropdown) {
|
|
917
916
|
Component = 'button';
|
|
918
917
|
} else {
|
|
919
|
-
Component = component ||
|
|
918
|
+
Component = component || "a";
|
|
920
919
|
}
|
|
921
920
|
return /*#__PURE__*/React.createElement("div", {
|
|
922
921
|
className: classnames(['nav_item', {
|
|
@@ -1316,265 +1315,6 @@ Switch.propTypes = {
|
|
|
1316
1315
|
className: PropTypes.node
|
|
1317
1316
|
};
|
|
1318
1317
|
|
|
1319
|
-
const TabsContext = /*#__PURE__*/createContext();
|
|
1320
|
-
const Tabs = ({
|
|
1321
|
-
direction,
|
|
1322
|
-
dense,
|
|
1323
|
-
hasBorder,
|
|
1324
|
-
className,
|
|
1325
|
-
children
|
|
1326
|
-
}) => {
|
|
1327
|
-
const [activeIndex, setActiveIndex] = useState(0);
|
|
1328
|
-
return /*#__PURE__*/React.createElement(TabsContext.Provider, {
|
|
1329
|
-
value: {
|
|
1330
|
-
activeIndex,
|
|
1331
|
-
setActiveIndex
|
|
1332
|
-
}
|
|
1333
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
1334
|
-
className: classnames(['tabs', {
|
|
1335
|
-
[`tabs-${direction}`]: direction,
|
|
1336
|
-
'tabs-dense': dense,
|
|
1337
|
-
'tabs-hasBorder': hasBorder
|
|
1338
|
-
}, className])
|
|
1339
|
-
}, children));
|
|
1340
|
-
};
|
|
1341
|
-
Tabs.propTypes = {
|
|
1342
|
-
direction: PropTypes.oneOf(['portrait', 'landscape']),
|
|
1343
|
-
dense: PropTypes.bool,
|
|
1344
|
-
hasBorder: PropTypes.bool,
|
|
1345
|
-
className: PropTypes.node,
|
|
1346
|
-
children: PropTypes.node.isRequired
|
|
1347
|
-
};
|
|
1348
|
-
|
|
1349
|
-
const Tab = ({
|
|
1350
|
-
index,
|
|
1351
|
-
label,
|
|
1352
|
-
className
|
|
1353
|
-
}) => {
|
|
1354
|
-
const {
|
|
1355
|
-
activeIndex,
|
|
1356
|
-
setActiveIndex
|
|
1357
|
-
} = useContext(TabsContext);
|
|
1358
|
-
const isSelected = activeIndex === index;
|
|
1359
|
-
return /*#__PURE__*/React.createElement("button", {
|
|
1360
|
-
className: classnames(['tab', {
|
|
1361
|
-
'tab-active': isSelected
|
|
1362
|
-
}, className]),
|
|
1363
|
-
role: "tab",
|
|
1364
|
-
"aria-selected": isSelected,
|
|
1365
|
-
"aria-controls": `tabpanel-${index}`,
|
|
1366
|
-
id: `tab-${index}`,
|
|
1367
|
-
tabIndex: isSelected ? 0 : -1,
|
|
1368
|
-
onClick: () => setActiveIndex(index)
|
|
1369
|
-
}, label);
|
|
1370
|
-
};
|
|
1371
|
-
Tab.propTypes = {
|
|
1372
|
-
label: PropTypes.string,
|
|
1373
|
-
className: PropTypes.node.isRequired
|
|
1374
|
-
};
|
|
1375
|
-
|
|
1376
|
-
const TableFooter = ({
|
|
1377
|
-
className,
|
|
1378
|
-
...props
|
|
1379
|
-
}) => {
|
|
1380
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
1381
|
-
className: classnames(['table_footer', className])
|
|
1382
|
-
}, props), /*#__PURE__*/React.createElement(Select, {
|
|
1383
|
-
dense: true,
|
|
1384
|
-
id: "rows",
|
|
1385
|
-
className: "table_rowSelect"
|
|
1386
|
-
}, /*#__PURE__*/React.createElement("option", {
|
|
1387
|
-
value: "1"
|
|
1388
|
-
}, "10"), /*#__PURE__*/React.createElement("option", {
|
|
1389
|
-
value: "2"
|
|
1390
|
-
}, "25"), /*#__PURE__*/React.createElement("option", {
|
|
1391
|
-
value: "2"
|
|
1392
|
-
}, "50"), /*#__PURE__*/React.createElement("option", {
|
|
1393
|
-
value: "2"
|
|
1394
|
-
}, "100"), /*#__PURE__*/React.createElement("option", {
|
|
1395
|
-
value: "2"
|
|
1396
|
-
}, "All")), /*#__PURE__*/React.createElement(Buttons, {
|
|
1397
|
-
className: "table_pagination"
|
|
1398
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
1399
|
-
kind: "icon",
|
|
1400
|
-
variant: "transparent",
|
|
1401
|
-
size: "sm"
|
|
1402
|
-
}, /*#__PURE__*/React.createElement(CaretDoubleLeft, null)), /*#__PURE__*/React.createElement(Button, {
|
|
1403
|
-
kind: "icon",
|
|
1404
|
-
variant: "transparent",
|
|
1405
|
-
size: "sm"
|
|
1406
|
-
}, /*#__PURE__*/React.createElement(CaretLeft, null)), /*#__PURE__*/React.createElement(Button, {
|
|
1407
|
-
kind: "icon",
|
|
1408
|
-
size: "sm"
|
|
1409
|
-
}, "1"), /*#__PURE__*/React.createElement(Button, {
|
|
1410
|
-
kind: "icon",
|
|
1411
|
-
variant: "transparent",
|
|
1412
|
-
size: "sm"
|
|
1413
|
-
}, "2"), /*#__PURE__*/React.createElement(Button, {
|
|
1414
|
-
kind: "icon",
|
|
1415
|
-
variant: "transparent",
|
|
1416
|
-
size: "sm"
|
|
1417
|
-
}, "3"), /*#__PURE__*/React.createElement(Button, {
|
|
1418
|
-
kind: "icon",
|
|
1419
|
-
variant: "transparent",
|
|
1420
|
-
size: "sm"
|
|
1421
|
-
}, "\u2026"), /*#__PURE__*/React.createElement(Button, {
|
|
1422
|
-
kind: "icon",
|
|
1423
|
-
variant: "transparent",
|
|
1424
|
-
size: "sm"
|
|
1425
|
-
}, "8"), /*#__PURE__*/React.createElement(Button, {
|
|
1426
|
-
kind: "icon",
|
|
1427
|
-
variant: "transparent",
|
|
1428
|
-
size: "sm"
|
|
1429
|
-
}, /*#__PURE__*/React.createElement(CaretRight, null)), /*#__PURE__*/React.createElement(Button, {
|
|
1430
|
-
kind: "icon",
|
|
1431
|
-
variant: "transparent",
|
|
1432
|
-
size: "sm"
|
|
1433
|
-
}, /*#__PURE__*/React.createElement(CaretDoubleRight, null))));
|
|
1434
|
-
};
|
|
1435
|
-
TableFooter.propTypes = {
|
|
1436
|
-
className: PropTypes.node
|
|
1437
|
-
};
|
|
1438
|
-
|
|
1439
|
-
const DenseContext = /*#__PURE__*/createContext(false);
|
|
1440
|
-
const Table = ({
|
|
1441
|
-
striped,
|
|
1442
|
-
hasHover,
|
|
1443
|
-
dense,
|
|
1444
|
-
border,
|
|
1445
|
-
withFooter,
|
|
1446
|
-
className,
|
|
1447
|
-
children,
|
|
1448
|
-
...props
|
|
1449
|
-
}) => {
|
|
1450
|
-
return /*#__PURE__*/React.createElement(DenseContext.Provider, {
|
|
1451
|
-
value: dense
|
|
1452
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
1453
|
-
className: classnames(['table', {
|
|
1454
|
-
'table-striped': striped,
|
|
1455
|
-
'table-hasHover': hasHover,
|
|
1456
|
-
'table-dense': dense,
|
|
1457
|
-
'table-border': border
|
|
1458
|
-
}, className])
|
|
1459
|
-
}, /*#__PURE__*/React.createElement("table", _extends({
|
|
1460
|
-
cellPadding: 0,
|
|
1461
|
-
cellSpacing: 0,
|
|
1462
|
-
className: classnames('table_content')
|
|
1463
|
-
}, props), children), withFooter ? /*#__PURE__*/React.createElement(TableFooter, {
|
|
1464
|
-
dense: dense ? dense : null
|
|
1465
|
-
}) : null));
|
|
1466
|
-
};
|
|
1467
|
-
Table.propTypes = {
|
|
1468
|
-
striped: PropTypes.bool,
|
|
1469
|
-
hasHover: PropTypes.bool,
|
|
1470
|
-
dense: PropTypes.bool,
|
|
1471
|
-
border: PropTypes.bool,
|
|
1472
|
-
withFooter: PropTypes.bool,
|
|
1473
|
-
className: PropTypes.node,
|
|
1474
|
-
children: PropTypes.node.isRequired
|
|
1475
|
-
};
|
|
1476
|
-
|
|
1477
|
-
const TableBody = ({
|
|
1478
|
-
className,
|
|
1479
|
-
children,
|
|
1480
|
-
...props
|
|
1481
|
-
}) => {
|
|
1482
|
-
return /*#__PURE__*/React.createElement("tbody", _extends({
|
|
1483
|
-
className: classnames(['table_body', className])
|
|
1484
|
-
}, props), children);
|
|
1485
|
-
};
|
|
1486
|
-
TableBody.propTypes = {
|
|
1487
|
-
className: PropTypes.node,
|
|
1488
|
-
children: PropTypes.node.isRequired
|
|
1489
|
-
};
|
|
1490
|
-
|
|
1491
|
-
const TableCellComponentContext = /*#__PURE__*/createContext('td');
|
|
1492
|
-
const TableHead = ({
|
|
1493
|
-
className,
|
|
1494
|
-
children,
|
|
1495
|
-
...props
|
|
1496
|
-
}) => {
|
|
1497
|
-
return /*#__PURE__*/React.createElement(TableCellComponentContext.Provider, {
|
|
1498
|
-
value: "th"
|
|
1499
|
-
}, /*#__PURE__*/React.createElement("thead", _extends({
|
|
1500
|
-
className: classnames(['table_head', className])
|
|
1501
|
-
}, props), children));
|
|
1502
|
-
};
|
|
1503
|
-
TableHead.propTypes = {
|
|
1504
|
-
className: PropTypes.node,
|
|
1505
|
-
children: PropTypes.node.isRequired
|
|
1506
|
-
};
|
|
1507
|
-
|
|
1508
|
-
const TableCell = ({
|
|
1509
|
-
kind = 'default',
|
|
1510
|
-
className,
|
|
1511
|
-
children,
|
|
1512
|
-
...props
|
|
1513
|
-
}) => {
|
|
1514
|
-
const useTableCellComponent = () => useContext(TableCellComponentContext);
|
|
1515
|
-
const Component = useTableCellComponent();
|
|
1516
|
-
return /*#__PURE__*/React.createElement(Component, _extends({
|
|
1517
|
-
className: classnames(['table_cell', {
|
|
1518
|
-
[`table_cell-${kind}`]: kind
|
|
1519
|
-
}, className])
|
|
1520
|
-
}, props), children);
|
|
1521
|
-
};
|
|
1522
|
-
TableCell.propTypes = {
|
|
1523
|
-
kind: PropTypes.oneOf(['default', 'number', 'action']),
|
|
1524
|
-
className: PropTypes.node,
|
|
1525
|
-
children: PropTypes.node.isRequired
|
|
1526
|
-
};
|
|
1527
|
-
|
|
1528
|
-
const TableRow = ({
|
|
1529
|
-
className,
|
|
1530
|
-
children,
|
|
1531
|
-
...props
|
|
1532
|
-
}) => {
|
|
1533
|
-
return /*#__PURE__*/React.createElement("tr", _extends({
|
|
1534
|
-
className: classnames(['table_row', className])
|
|
1535
|
-
}, props), children);
|
|
1536
|
-
};
|
|
1537
|
-
TableRow.propTypes = {
|
|
1538
|
-
className: PropTypes.node,
|
|
1539
|
-
children: PropTypes.node.isRequired
|
|
1540
|
-
};
|
|
1541
|
-
|
|
1542
|
-
const TabsControl = ({
|
|
1543
|
-
className,
|
|
1544
|
-
children
|
|
1545
|
-
}) => {
|
|
1546
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
1547
|
-
role: "tablist",
|
|
1548
|
-
className: classnames(['tabs_controls', className])
|
|
1549
|
-
}, children);
|
|
1550
|
-
};
|
|
1551
|
-
TabsControl.propTypes = {
|
|
1552
|
-
className: PropTypes.node,
|
|
1553
|
-
children: PropTypes.node.isRequired
|
|
1554
|
-
};
|
|
1555
|
-
|
|
1556
|
-
const TabsPanel = ({
|
|
1557
|
-
index,
|
|
1558
|
-
className,
|
|
1559
|
-
children
|
|
1560
|
-
}) => {
|
|
1561
|
-
const {
|
|
1562
|
-
activeIndex
|
|
1563
|
-
} = useContext(TabsContext);
|
|
1564
|
-
const isActive = activeIndex === index;
|
|
1565
|
-
return isActive ? /*#__PURE__*/React.createElement("div", {
|
|
1566
|
-
className: classnames(['tabs_panel', className]),
|
|
1567
|
-
role: "tabpanel",
|
|
1568
|
-
id: `tabpanel-${index}`,
|
|
1569
|
-
"aria-labelledby": `tab-${index}`,
|
|
1570
|
-
hidden: !isActive
|
|
1571
|
-
}, children) : null;
|
|
1572
|
-
};
|
|
1573
|
-
TabsPanel.propTypes = {
|
|
1574
|
-
className: PropTypes.node,
|
|
1575
|
-
children: PropTypes.node.isRequired
|
|
1576
|
-
};
|
|
1577
|
-
|
|
1578
1318
|
const Tag = ({
|
|
1579
1319
|
color = 'primary',
|
|
1580
1320
|
dense,
|
|
@@ -1653,4 +1393,4 @@ Textarea.propTypes = {
|
|
|
1653
1393
|
className: PropTypes.node
|
|
1654
1394
|
};
|
|
1655
1395
|
|
|
1656
|
-
export { Alert, Breadcrumbs, Button, Buttons, Card, CardActions, CardContent, CardHeader, CardMedia, Checkbox, Checkboxes, Color, Display, Divider, Grid, Input, InputLabel, Link, List, ListItem, Nav, NavBar, NavItem, Radio, RadioButtons, Section, SectionContent, SectionHeader, Select, Snippet, Status, Switch,
|
|
1396
|
+
export { Alert, Breadcrumbs, Button, Buttons, Card, CardActions, CardContent, CardHeader, CardMedia, Checkbox, Checkboxes, Color, Display, Divider, Grid, Input, InputLabel, Link, List, ListItem, Nav, NavBar, NavItem, Radio, RadioButtons, Section, SectionContent, SectionHeader, Select, Snippet, Status, Switch, Tag, Text, Textarea };
|