forstok-ui-lib 6.5.9 → 6.6.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forstok-ui-lib",
3
- "version": "6.5.9",
3
+ "version": "6.6.1",
4
4
  "description": "Forstok UI Components Library",
5
5
  "path": "dist",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  import styled, { css } from 'styled-components';
2
2
  import { responseWidth, formLabel, elipsis, multiElipsis, headTable, clearList, dropBase, buttonStyle, buttonActiveStyle, buttonHoverStyle } from './bases.styles';
3
- import { ModeListTableColumn } from '../../typeds';
3
+ import { ModeListTableColumn, modeTable } from '../../typeds';
4
4
 
5
5
  const getTabsContentModFunc = ({ $mode }:{ $mode?: string }) => {
6
6
  let style = ``
@@ -1412,6 +1412,486 @@ export const FoContainer = styled.section<{ $mode?: 'detail' }>`
1412
1412
  }
1413
1413
  `}
1414
1414
  `
1415
+ export const PopupTableHead = styled.div`
1416
+ display: grid;
1417
+ grid-template-columns: 1fr 100px 100px 100px;
1418
+ padding: 16px 16px 12px;
1419
+ grid-gap: 12px;
1420
+ border-bottom: 1px solid var(--sec-clr-ln);
1421
+ font-size: 12px;
1422
+ font-weight: 600;
1423
+ color: var(--mt-clr);
1424
+ > div:not(:first-child) {
1425
+ justify-self: end;
1426
+ }
1427
+ `
1428
+ export const PopupTableItem = styled.div`
1429
+ display: grid;
1430
+ grid-template-columns: 28px 1fr 100px 100px 100px;
1431
+ grid-gap: 16px;
1432
+ justify-content: center;
1433
+ align-items: center;
1434
+ > a:nth-child(n+3),
1435
+ > span:nth-child(n+3),
1436
+ div:nth-child(n+3) {
1437
+ justify-self: end;
1438
+ }
1439
+ `
1440
+ export const PopupTableBody = styled.div`
1441
+ display: grid;
1442
+ grid-auto-flow: row;
1443
+ grid-gap: 10px;
1444
+ padding: 12px 16px 16px;
1445
+ `
1446
+ const getTableModFunc = ({ $mode }:{ $mode?: modeTable }) => css`
1447
+ ${($mode === 'picklist' || $mode === 'listing' || $mode === 'price') && css`
1448
+ background-color: transparent;
1449
+ border: none;
1450
+ width: 100%;
1451
+ border-radius: 0;
1452
+ margin: 0 0 16px !important;
1453
+ ${PopupTableHead} {
1454
+ background-color: var(--sec-clr-bg);
1455
+ padding: 16px 16px 16px;
1456
+ justify-content: center;
1457
+ align-items: center;
1458
+ border-top: 1px solid var(--sec-clr-ln);
1459
+ }
1460
+ ${PopupTableItem} {
1461
+ border-top: 1px solid var(--pri-clr-ln);
1462
+ padding: 12px 16px 4px 16px;
1463
+ justify-content: center;
1464
+ &:first-child{
1465
+ border: none;
1466
+ }
1467
+ &:last-child {
1468
+ border-bottom: 1px solid var(--pri-clr-ln);
1469
+ padding-bottom: 14px;
1470
+ }
1471
+ }
1472
+ ${PopupTableBody} {
1473
+ padding: 0;
1474
+ }
1475
+ @media only screen and (min-width: 1024px) {
1476
+ padding: 0 16px 16px 16px;
1477
+ margin-bottom: 0;
1478
+ }
1479
+
1480
+ ${$mode === 'picklist' && css`
1481
+ ${PopupTableHead},
1482
+ ${PopupTableBody} {
1483
+ width: 938px;
1484
+ }
1485
+ @media only screen and (min-width: 1024px) {
1486
+ ${PopupTableHead},
1487
+ ${PopupTableBody} {
1488
+ width: 100%;
1489
+ }
1490
+ }
1491
+ ${PopupTableHead} {
1492
+ grid-template-columns: 1fr 100px 72px 72px 69px 69px 51px;
1493
+ padding: 16px 16px 12px;
1494
+ > div:nth-child(2) {
1495
+ justify-self: start;
1496
+ }
1497
+ }
1498
+ ${PopupTableItem} {
1499
+ grid-template-columns: 28px 1fr 100px 72px 72px 69px 69px 51px;
1500
+ padding: 12px 16px 12px;
1501
+ > *:nth-child(3) {
1502
+ justify-self: start;
1503
+ }
1504
+ }
1505
+ `}
1506
+
1507
+ ${$mode === 'listing' && css`
1508
+ margin: 0 0 16px !important;
1509
+ ${PopupTableHead},
1510
+ ${PopupTableItem} {
1511
+ grid-template-columns: 1fr 340px var(--qty-pd20);
1512
+ > div:nth-child(2) {
1513
+ justify-self: start;
1514
+ }
1515
+ }
1516
+ @media only screen and (min-width: 1024px) {
1517
+ padding: 16px 0 0;
1518
+ }
1519
+ `}
1520
+ `}
1521
+
1522
+ ${($mode === 'price' || $mode === 'price-full' || $mode === 'price-mid') && css`
1523
+ margin: 0 0 16px !important;
1524
+ ${PopupTableHead},
1525
+ ${PopupTableItem} {
1526
+ grid-template-columns: ${$mode === 'price' ? '1fr 95px 118px' : ($mode === 'price-mid' ? '1fr 95px repeat(2, 118px)' : '1fr 95px repeat(4, 118px)' )};
1527
+ }
1528
+ ${PopupTableHead} {
1529
+ > div {
1530
+ justify-self: start;
1531
+ }
1532
+ }
1533
+ ${PopupTableItem} {
1534
+ padding: 4px 0 16px;
1535
+ border-bottom: 1px solid var(--sec-clr-ln);
1536
+ &:last-child {
1537
+ border-bottom: 0;
1538
+ padding-bottom: 0;
1539
+ }
1540
+ }
1541
+ @media only screen and (min-width: 1024px) {
1542
+ padding: 0;
1543
+ }
1544
+ `}
1545
+ `
1546
+ export const PopupTable = styled.div<{ $mode?: modeTable }>`
1547
+ background-color: var(--sec-clr-bg);
1548
+ border: 1px solid var(--sec-clr-ln);
1549
+ border-radius: var(--sec-rd);
1550
+ overflow-x: auto;
1551
+ margin: 0 0 16px;
1552
+ ${PopupTableHead},
1553
+ ${PopupTableBody} {
1554
+ width: 733px;
1555
+ }
1556
+ @media only screen and (min-width: 375px) {
1557
+ margin: 0 12px 16px 16px;
1558
+ }
1559
+ @media only screen and (min-width: 768px) {
1560
+ margin: 0 30px 16px 34px;
1561
+ overflow-x: unset;
1562
+ ${PopupTableHead},
1563
+ ${PopupTableBody} {
1564
+ width: 100%;
1565
+ }
1566
+ }
1567
+ ${getTableModFunc}
1568
+ `
1569
+ export const PopupList = styled.div<{ $mode?: string }>`
1570
+ padding: 0 15px;
1571
+ overflow: hidden;
1572
+ i.arrow-down:before {
1573
+ transform: none;
1574
+ }
1575
+ ${({ $mode }) => $mode === 'single' && css`
1576
+ padding: 0 15px;
1577
+ ${PopupItem} {
1578
+ padding: 20px 16px 14px 0;
1579
+ @media only screen and (min-width: 768px) {
1580
+ padding: 20px 16px 14px;
1581
+ }
1582
+ }
1583
+ `}
1584
+ ${({ $mode }) => !$mode && css`
1585
+ &.is-shown {
1586
+ ${PopupTable} {
1587
+ top: 0;
1588
+ position: relative;
1589
+ border: 1px solid var(--sec-clr-ln);
1590
+ &.is-loading {
1591
+ height: 0 !important;
1592
+ border: none;
1593
+ }
1594
+ }
1595
+ i.arrow-down:before {
1596
+ transform: rotate(180deg);
1597
+ }
1598
+ }
1599
+ ${PopupTable} {
1600
+ overflow-y: hidden;
1601
+ transition: height .35s ease;
1602
+ border: none;
1603
+ position: absolute;
1604
+ top: -99999%;
1605
+ }
1606
+ `}
1607
+ `
1608
+ const getPopupItemModFunc = ({ $mode, $isReadyToShip, $isNoTable, $isMarkAsPickedUp }:{ $mode?: 'multiple' | 'package' | 'master', $isReadyToShip?: boolean, $isNoTable?: boolean, $isMarkAsPickedUp?: boolean }) => {
1609
+ let style = ``
1610
+ const Accpx = $isNoTable ? '12px' : '25px'
1611
+ if ($mode === 'multiple') {
1612
+ style += `
1613
+ position: relative;
1614
+ grid-template-columns: ${Accpx} 28px 1.5fr 20px;
1615
+ > div {
1616
+ &:first-child {
1617
+ justify-self: center;
1618
+ cursor: pointer;
1619
+ align-self: center;
1620
+ }
1621
+ &:last-child > div:last-child {
1622
+ cursor: pointer;
1623
+ }
1624
+ }
1625
+ @media (max-width: 767.98px) {
1626
+ > div:nth-last-child(2) {
1627
+ width: 100%;
1628
+ display: inline-grid;
1629
+ grid-area: 2/ 2/ auto/ span 2;
1630
+ justify-content: start;
1631
+ justify-items: start;
1632
+ grid-auto-flow: row;
1633
+ grid-template-columns: 1fr;
1634
+ > div {
1635
+ width: 100%;
1636
+ min-width: unset;
1637
+ }
1638
+ }
1639
+ }
1640
+ @media only screen and (min-width: 768px) {
1641
+ grid-template-columns: ${Accpx} 28px 1.5fr 3fr 20px;
1642
+ }
1643
+ `
1644
+ if ($isReadyToShip) {
1645
+ style += `
1646
+ align-items: self-start;
1647
+ > div {
1648
+ &:nth-child(2) {
1649
+ align-self: baseline;
1650
+ }
1651
+ &:nth-child(4) {
1652
+ height: 30px;
1653
+ padding-top: 0;
1654
+ display: grid;
1655
+ align-content: center;
1656
+ align-self: start;
1657
+ }
1658
+ &:nth-child(5) {
1659
+ > div,
1660
+ > input {
1661
+ margin-bottom: 10px;
1662
+ }
1663
+ }
1664
+ &:last-child {
1665
+ padding-top: 10px;
1666
+ }
1667
+ }
1668
+ @media (max-width: 767.98px) {
1669
+ > div:nth-last-child(3) {
1670
+ grid-area: 2/ 2/ auto/ span 2;
1671
+ > span {
1672
+ text-align: left !important;
1673
+ }
1674
+ }
1675
+ > div:nth-last-child(2) {
1676
+ grid-area: 3/ 2/ auto/ span 3;
1677
+ > div {
1678
+ width: 100%;
1679
+ }
1680
+ }
1681
+ }
1682
+ @media only screen and (min-width: 768px) {
1683
+ grid-template-columns: ${Accpx} 28px 1.5fr 100px 300px 20px !important;
1684
+ > div:nth-child(5) {
1685
+ > div,
1686
+ > input {
1687
+ margin-bottom: 0;
1688
+ }
1689
+ }
1690
+ }
1691
+ @media only screen and (min-width: 1024px) {
1692
+ grid-template-columns: ${Accpx} 28px 1.5fr 110px 355px 20px !important;
1693
+ }
1694
+ `
1695
+ }
1696
+ } else if ($isReadyToShip) {
1697
+ style +=`
1698
+ grid-template-columns: 28px 1.5fr;
1699
+ align-items: self-start;
1700
+ > div:nth-child(1) {
1701
+ align-self: baseline;
1702
+ }
1703
+ > div:nth-child(3) {
1704
+ height: 30px;
1705
+ padding-top: 0;
1706
+ display: grid;
1707
+ align-content: center;
1708
+ align-self: start;
1709
+ }
1710
+ > div:nth-child(4) {
1711
+ > div,
1712
+ > input {
1713
+ margin-bottom: 10px;
1714
+ }
1715
+ }
1716
+ @media (max-width: 767.98px) {
1717
+ > div:nth-last-child(3) {
1718
+ grid-area: unset;
1719
+ }
1720
+ > div:nth-last-child(2) {
1721
+ grid-area: 2/ 2/ auto/ span 2;
1722
+ > span {
1723
+ text-align: left !important;
1724
+ }
1725
+ }
1726
+ > div:last-child {
1727
+ grid-area: 3/ 2/ auto/ span 3;
1728
+ justify-content: start;
1729
+ justify-items: start;
1730
+ > div {
1731
+ width: 100%;
1732
+ }
1733
+ }
1734
+ }
1735
+ @media only screen and (min-width: 768px) {
1736
+ grid-template-columns: 28px 1.5fr 100px 300px !important;
1737
+ > div:nth-child(4) {
1738
+ > div,
1739
+ > input {
1740
+ margin-bottom: 0;
1741
+ }
1742
+ }
1743
+ }
1744
+ @media only screen and (min-width: 1024px) {
1745
+ grid-template-columns: 28px 1.5fr 110px 355px !important;
1746
+ }
1747
+ `
1748
+ } else if ($isMarkAsPickedUp) {
1749
+ style +=`
1750
+ grid-template-columns: 28px 2fr 3fr;
1751
+ > div:last-child {
1752
+ justify-self: end;
1753
+ }
1754
+ `
1755
+ } else if ($mode === 'package') {
1756
+ style +=`
1757
+ grid-template-columns: 28px 160px 1.5fr;
1758
+ `
1759
+ } else if ($mode === 'master') {
1760
+ style +=`
1761
+ padding: 0;
1762
+ grid-template-columns: 34px 1fr;
1763
+ grid-gap: 8px;
1764
+ `
1765
+ } else {
1766
+ style +=`
1767
+ grid-template-columns: 28px 1.5fr;
1768
+ @media (max-width: 767.98px) {
1769
+ > div:nth-last-child(1) {
1770
+ width: 100%;
1771
+ display: inline-grid;
1772
+ grid-area: 2/ 2/ auto/ span 2;
1773
+ justify-content: start;
1774
+ justify-items: start;
1775
+ grid-auto-flow: row;
1776
+ grid-template-columns: 1fr;
1777
+ > div {
1778
+ width: 100%;
1779
+ min-width: unset;
1780
+ }
1781
+ }
1782
+ }
1783
+ @media only screen and (min-width: 768px) {
1784
+ grid-template-columns: 28px 1.5fr 3fr;
1785
+ }
1786
+ & + ${PopupTable} {
1787
+ margin: 0 0 16px;
1788
+ @media only screen and (min-width: 768px) {
1789
+ margin: 0 16px 16px;
1790
+ }
1791
+ }
1792
+ `
1793
+ }
1794
+ return style
1795
+ }
1796
+ export const PopupItem = styled.div<{ $mode?: 'multiple' | 'package' | 'master', $isReadyToShip?: boolean, $isNoTable?: boolean, $isMarkAsPickedUp?: boolean }>`
1797
+ display: inline-grid;
1798
+ width: 100%;
1799
+ grid-template-columns: 25px 32px 1.25fr 20px;
1800
+ grid-gap: 10px;
1801
+ align-items: self-start;
1802
+ padding: 20px 0px 16px;
1803
+ div > img {
1804
+ display: grid;
1805
+ }
1806
+ ${getPopupItemModFunc}
1807
+ `
1808
+ const PopupRowGroupStyle = {
1809
+ warning: css`
1810
+ justify-content: start;
1811
+ position: relative;
1812
+ > i {
1813
+ position: absolute;
1814
+ top: 10px;
1815
+ right: -5px;
1816
+ &:before {
1817
+ display: inline-block;
1818
+ }
1819
+ }
1820
+ @media only screen and (min-width: 768px) {
1821
+ grid-template-areas: 'a c'
1822
+ 'b b';
1823
+ > i {
1824
+ position: relative;
1825
+ top: 10px;
1826
+ right: auto;
1827
+ left: 10px;
1828
+ &:before {
1829
+ display: grid;
1830
+ }
1831
+ }
1832
+ }
1833
+ `,
1834
+ items: css`
1835
+ grid-gap: 3px;
1836
+ strong {
1837
+ ${multiElipsis}
1838
+ }
1839
+ `,
1840
+ } as const
1841
+ export const PopupRowGroup = styled.div<{ $mode?: 'warning' | 'items' }>`
1842
+ display: grid;
1843
+ grid-auto-flow: row;
1844
+ grid-gap: 2px;
1845
+ ${({ $mode }) => $mode && $mode in PopupRowGroupStyle ? PopupRowGroupStyle[$mode] : ''}
1846
+ `
1847
+ const getPopupColumnGroupModFunc = ({ $content, $mode }:{ $content?: 'right', $mode?: 'ext' }) => css`
1848
+ ${($content && $content === 'right') && css`
1849
+ grid-gap: 10px;
1850
+ justify-content: end;
1851
+ align-items: start;
1852
+ > div {
1853
+ min-width: 170px;
1854
+ width: 170px;
1855
+ }
1856
+ @media only screen and (min-width: 768px) {
1857
+ > div {
1858
+ min-width: 145px;
1859
+ width: 145px;
1860
+ }
1861
+ }
1862
+ @media only screen and (min-width: 1024px) {
1863
+ > div {
1864
+ min-width: 160px;
1865
+ width: 160px;
1866
+ }
1867
+ }
1868
+ `}
1869
+
1870
+ ${($mode && $mode === 'ext') && css`
1871
+ grid-template-columns: 1fr 1fr 1fr;
1872
+ grid-auto-flow: unset;
1873
+ input::placeholder {
1874
+ font-style: normal;
1875
+ }
1876
+ `}
1877
+ `
1878
+ export const PopupColumnGroup = styled.div<{ $content?: 'right', $mode?: 'ext' }>`
1879
+ display: grid;
1880
+ grid-auto-flow: column;
1881
+ grid-gap: 4px;
1882
+ justify-content: left;
1883
+ align-items: end;
1884
+ ${getPopupColumnGroupModFunc}
1885
+ `
1886
+ export const PopupItemName = styled.span`
1887
+ font-weight: 600;
1888
+ color: var(--hd-clr);
1889
+ text-transform: capitalize;
1890
+ ${elipsis}
1891
+ `
1892
+ export const PopupItemLabel = styled.div`
1893
+ ${elipsis}
1894
+ `
1415
1895
  export const BreadcrumbContainer = styled.aside`
1416
1896
  position: relative;
1417
1897
  padding: 0;
@@ -2463,6 +2943,17 @@ const listTableStyles = {
2463
2943
  }
2464
2944
  }
2465
2945
  `,
2946
+ 'item-nocheck': css`
2947
+ ${ItemTable} {
2948
+ grid-template-columns: var(--item) minmax(auto, max-content) var(--time) minmax(88px, auto);
2949
+ &[role=rowheader] > div[role=group],
2950
+ &[role=row] > div[role=cellgroup] > div[role=rowgroup],
2951
+ ._refCollapse > div:not(._refCollapseContainer),
2952
+ ._refCollapseContainer > div {
2953
+ grid-template-columns: var(--variant) var(--sku) var(--qty-big) var(--price) var(--status-big);
2954
+ }
2955
+ }
2956
+ `,
2466
2957
  listing: css`
2467
2958
  ${ItemTable} {
2468
2959
  grid-template-columns: var(--checkbox) var(--item) minmax(auto, max-content) minmax(88px, auto);
@@ -3269,7 +3760,7 @@ export const FilterButton = styled.div`
3269
3760
  grid-template-columns: 1fr auto;
3270
3761
  gap: 4px;
3271
3762
  `
3272
- export const IconDot = styled.span<{ $mode?: 'list' | 'header' | 'chat' }>`
3763
+ export const IconDot = styled.span<{ $mode?: 'list' | 'header' | 'chat', $width?: string, $height?: string, $size?: 'string' }>`
3273
3764
  display: grid;
3274
3765
  min-width: 18px;
3275
3766
  height: 18px;
@@ -3306,6 +3797,15 @@ export const IconDot = styled.span<{ $mode?: 'list' | 'header' | 'chat' }>`
3306
3797
  transform: scale(1) translate(50%, -50%);
3307
3798
  `}
3308
3799
  `}
3800
+ ${({ $width }) => $width && css`
3801
+ min-width: ${$width}px;
3802
+ `}
3803
+ ${({ $height }) => $height && css`
3804
+ height: ${$height}px;
3805
+ `}
3806
+ ${({ $size }) => $size && css`
3807
+ font-size: ${$size}px;
3808
+ `}
3309
3809
  `
3310
3810
  export const SortByWrapper = styled.section`
3311
3811
  justify-self: end;
@@ -267,6 +267,7 @@ export type TStateCallback<TData> = DispatchWithCallback<React.SetStateAction<TD
267
267
 
268
268
  export type ModeListTableColumn =
269
269
  | 'item'
270
+ | 'item-nocheck'
270
271
  | 'listing'
271
272
  | 'quantity'
272
273
  | 'picklist'
@@ -309,4 +310,12 @@ export type TInDetailProps = {
309
310
  hasTab?: boolean
310
311
  tabDef?: string
311
312
  hasSubscription?: boolean
312
- }
313
+ }
314
+
315
+ export type modeTable =
316
+ | 'picklist'
317
+ | 'listing'
318
+ | 'price'
319
+ | 'price'
320
+ | 'price-full'
321
+ | 'price-mid'