dce-reactkit 3.1.2 → 3.1.5
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/cjs/index.js +199 -10
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/CheckboxButton.d.ts +1 -0
- package/dist/cjs/types/components/ItemPicker/NestableItemList.d.ts +17 -0
- package/dist/cjs/types/components/ItemPicker/index.d.ts +18 -0
- package/dist/cjs/types/components/ItemPicker/types/PickableItem.d.ts +16 -0
- package/dist/cjs/types/helpers/onlyKeepLetters.d.ts +8 -0
- package/dist/cjs/types/index.d.ts +3 -1
- package/dist/esm/index.js +199 -12
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/CheckboxButton.d.ts +1 -0
- package/dist/esm/types/components/ItemPicker/NestableItemList.d.ts +17 -0
- package/dist/esm/types/components/ItemPicker/index.d.ts +18 -0
- package/dist/esm/types/components/ItemPicker/types/PickableItem.d.ts +16 -0
- package/dist/esm/types/helpers/onlyKeepLetters.d.ts +8 -0
- package/dist/esm/types/index.d.ts +3 -1
- package/dist/index.d.ts +69 -27
- package/package.json +1 -1
- package/src/components/CheckboxButton.tsx +4 -1
- package/src/components/ItemPicker/NestableItemList.tsx +288 -0
- package/src/components/ItemPicker/index.tsx +85 -0
- package/src/components/ItemPicker/types/PickableItem.tsx +30 -0
- package/src/helpers/onlyKeepLetters.ts +11 -0
- package/src/index.ts +4 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reusable nested item picker
|
|
3
|
+
* @author Yuen Ler Chow
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import PickableItem from './types/PickableItem';
|
|
7
|
+
declare type Props = {
|
|
8
|
+
items: PickableItem[];
|
|
9
|
+
/**
|
|
10
|
+
* Handler to call when item selection is changed
|
|
11
|
+
* @param updatedItems an updated copy of the list of items with checked
|
|
12
|
+
* values updated
|
|
13
|
+
*/
|
|
14
|
+
onChanged: (updatedItems: PickableItem[]) => void;
|
|
15
|
+
};
|
|
16
|
+
declare const NestableItemList: React.FC<Props>;
|
|
17
|
+
export default NestableItemList;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reusable nested item picker
|
|
3
|
+
* @author Yuen Ler Chow
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import PickableItem from './types/PickableItem';
|
|
7
|
+
declare type Props = {
|
|
8
|
+
title: string;
|
|
9
|
+
items: PickableItem[];
|
|
10
|
+
/**
|
|
11
|
+
* Handler to call when item selection is changed
|
|
12
|
+
* @param updatedItems an updated copy of the list of items with checked
|
|
13
|
+
* values updated
|
|
14
|
+
*/
|
|
15
|
+
onChanged: (updatedItems: PickableItem[]) => void;
|
|
16
|
+
};
|
|
17
|
+
declare const ItemPicker: React.FC<Props>;
|
|
18
|
+
export default ItemPicker;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An item that can be chosen (for use within ItemPicker)
|
|
3
|
+
* @author Gabe Abrams
|
|
4
|
+
*/
|
|
5
|
+
declare type PickableItem = ({
|
|
6
|
+
id: number | string;
|
|
7
|
+
name: string;
|
|
8
|
+
link?: string;
|
|
9
|
+
} & ({
|
|
10
|
+
isGroup: false;
|
|
11
|
+
checked: boolean;
|
|
12
|
+
} | {
|
|
13
|
+
isGroup: true;
|
|
14
|
+
children: PickableItem[];
|
|
15
|
+
}));
|
|
16
|
+
export default PickableItem;
|
|
@@ -12,6 +12,7 @@ import PopSuccessMark from './components/PopSuccessMark';
|
|
|
12
12
|
import PopFailureMark from './components/PopFailureMark';
|
|
13
13
|
import PopPendingMark from './components/PopPendingMark';
|
|
14
14
|
import CopiableBox from './components/CopiableBox';
|
|
15
|
+
import ItemPicker from './components/ItemPicker';
|
|
15
16
|
import ErrorWithCode from './errors/ErrorWithCode';
|
|
16
17
|
import MINUTE_IN_MS from './constants/MINUTE_IN_MS';
|
|
17
18
|
import HOUR_IN_MS from './constants/HOUR_IN_MS';
|
|
@@ -38,6 +39,7 @@ import startMinWait from './helpers/startMinWait';
|
|
|
38
39
|
import getHumanReadableDate from './helpers/getHumanReadableDate';
|
|
39
40
|
import getPartOfDay from './helpers/getPartOfDay';
|
|
40
41
|
import stringsToHumanReadableList from './helpers/stringsToHumanReadableList';
|
|
42
|
+
import onlyKeepLetters from './helpers/onlyKeepLetters';
|
|
41
43
|
import ModalButtonType from './types/ModalButtonType';
|
|
42
44
|
import ModalSize from './types/ModalSize';
|
|
43
45
|
import ModalType from './types/ModalType';
|
|
@@ -45,4 +47,4 @@ import ReactKitErrorCode from './types/ReactKitErrorCode';
|
|
|
45
47
|
import Variant from './types/Variant';
|
|
46
48
|
import ParamType from './types/ParamType';
|
|
47
49
|
import DayOfWeek from './types/DayOfWeek';
|
|
48
|
-
export { AppWrapper, LoadingSpinner, ErrorBox, Modal, TabBox, RadioButton, CheckboxButton, ButtonInputGroup, SimpleDateChooser, Drawer, PopSuccessMark, PopFailureMark, PopPendingMark, CopiableBox, alert, confirm, showFatalError, ErrorWithCode, MINUTE_IN_MS, HOUR_IN_MS, DAY_IN_MS, abbreviate, avg, ceilToNumDecimals, floorToNumDecimals, forceNumIntoBounds, padDecimalZeros, padZerosLeft, roundToNumDecimals, sum, waitMs, getOrdinal, getTimeInfoInET, stubServerEndpoint, startMinWait, getHumanReadableDate, getPartOfDay, stringsToHumanReadableList, visitServerEndpoint, initServer, genRouteHandler, handleError, handleSuccess, ModalButtonType, ModalSize, ModalType, ReactKitErrorCode, Variant, DayOfWeek, ParamType, };
|
|
50
|
+
export { AppWrapper, LoadingSpinner, ErrorBox, Modal, TabBox, RadioButton, CheckboxButton, ButtonInputGroup, SimpleDateChooser, Drawer, PopSuccessMark, PopFailureMark, PopPendingMark, CopiableBox, ItemPicker, alert, confirm, showFatalError, ErrorWithCode, MINUTE_IN_MS, HOUR_IN_MS, DAY_IN_MS, abbreviate, avg, ceilToNumDecimals, floorToNumDecimals, forceNumIntoBounds, padDecimalZeros, padZerosLeft, roundToNumDecimals, sum, waitMs, getOrdinal, getTimeInfoInET, stubServerEndpoint, startMinWait, getHumanReadableDate, getPartOfDay, stringsToHumanReadableList, onlyKeepLetters, visitServerEndpoint, initServer, genRouteHandler, handleError, handleSuccess, ModalButtonType, ModalSize, ModalType, ReactKitErrorCode, Variant, DayOfWeek, ParamType, };
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useRef, useEffect, useReducer } from 'react';
|
|
2
2
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
3
|
-
import { faExclamationTriangle, faCircle, faDotCircle, faCheckSquare, faHourglass, faClipboard } from '@fortawesome/free-solid-svg-icons';
|
|
3
|
+
import { faExclamationTriangle, faCircle, faDotCircle, faCheckSquare, faHourglass, faClipboard, faChevronDown, faChevronRight } from '@fortawesome/free-solid-svg-icons';
|
|
4
4
|
import { faCircle as faCircle$1, faSquareMinus, faSquare } from '@fortawesome/free-regular-svg-icons';
|
|
5
5
|
|
|
6
6
|
/******************************************************************************
|
|
@@ -929,7 +929,7 @@ const CheckboxButton = (props) => {
|
|
|
929
929
|
/* Setup */
|
|
930
930
|
/*------------------------------------------------------------------------*/
|
|
931
931
|
/* -------------- Props ------------- */
|
|
932
|
-
const { text, onChanged, ariaLabel, title, checked, id, noMarginOnRight, checkedVariant = Variant$1.Secondary, uncheckedVariant = Variant$1.Light, small, dashed, } = props;
|
|
932
|
+
const { text, onChanged, ariaLabel, title, checked, id, className, noMarginOnRight, checkedVariant = Variant$1.Secondary, uncheckedVariant = Variant$1.Light, small, dashed, } = props;
|
|
933
933
|
/*------------------------------------------------------------------------*/
|
|
934
934
|
/* Render */
|
|
935
935
|
/*------------------------------------------------------------------------*/
|
|
@@ -947,7 +947,7 @@ const CheckboxButton = (props) => {
|
|
|
947
947
|
: faSquare);
|
|
948
948
|
}
|
|
949
949
|
// Create the button
|
|
950
|
-
return (React.createElement("button", { type: "button", id: id, title: title, className: `CheckboxButton-status-${checked ? 'checked' : 'unchecked'} ${dashed ? 'CheckboxButton-dashed ' : ''}btn btn-${checked ? checkedVariant : uncheckedVariant}${checked ? ' selected' : ''}${small ? ' btn-sm' : ''} m-0${noMarginOnRight ? '' : ' me-1'}`, "aria-label": `${ariaLabel}${checked ? ': currently checked' : ''}`, onClick: () => {
|
|
950
|
+
return (React.createElement("button", { type: "button", id: id, title: title, className: `CheckboxButton-status-${checked ? 'checked' : 'unchecked'} ${dashed ? 'CheckboxButton-dashed ' : ''}btn btn-${checked ? checkedVariant : uncheckedVariant}${checked ? ' selected' : ''}${small ? ' btn-sm' : ''} m-0${noMarginOnRight ? '' : ' me-1'} ${className !== null && className !== void 0 ? className : ''}`, "aria-label": `${ariaLabel}${checked ? ': currently checked' : ''}`, onClick: () => {
|
|
951
951
|
onChanged(!checked);
|
|
952
952
|
} },
|
|
953
953
|
React.createElement(FontAwesomeIcon, { icon: icon, className: "me-1" }),
|
|
@@ -1535,27 +1535,27 @@ const PopPendingMark = (props) => {
|
|
|
1535
1535
|
*/
|
|
1536
1536
|
/* ------------- Actions ------------ */
|
|
1537
1537
|
// Types of actions
|
|
1538
|
-
var ActionType;
|
|
1538
|
+
var ActionType$1;
|
|
1539
1539
|
(function (ActionType) {
|
|
1540
1540
|
// Indicate that the text was recently copied
|
|
1541
1541
|
ActionType["IndicateRecentlyCopied"] = "indicate-recently-copied";
|
|
1542
1542
|
// Clear the status
|
|
1543
1543
|
ActionType["ClearRecentlyCopiedStatus"] = "clear-recently-copied-status";
|
|
1544
|
-
})(ActionType || (ActionType = {}));
|
|
1544
|
+
})(ActionType$1 || (ActionType$1 = {}));
|
|
1545
1545
|
/**
|
|
1546
1546
|
* Reducer that executes actions
|
|
1547
1547
|
* @author Gabe Abrams
|
|
1548
1548
|
* @param state current state
|
|
1549
1549
|
* @param action action to execute
|
|
1550
1550
|
*/
|
|
1551
|
-
const reducer = (state, action) => {
|
|
1551
|
+
const reducer$1 = (state, action) => {
|
|
1552
1552
|
switch (action.type) {
|
|
1553
|
-
case ActionType.IndicateRecentlyCopied: {
|
|
1553
|
+
case ActionType$1.IndicateRecentlyCopied: {
|
|
1554
1554
|
return {
|
|
1555
1555
|
recentlyCopied: true,
|
|
1556
1556
|
};
|
|
1557
1557
|
}
|
|
1558
|
-
case ActionType.ClearRecentlyCopiedStatus: {
|
|
1558
|
+
case ActionType$1.ClearRecentlyCopiedStatus: {
|
|
1559
1559
|
return {
|
|
1560
1560
|
recentlyCopied: false,
|
|
1561
1561
|
};
|
|
@@ -1581,7 +1581,7 @@ const CopiableBox = (props) => {
|
|
|
1581
1581
|
recentlyCopied: false,
|
|
1582
1582
|
};
|
|
1583
1583
|
// Initialize state
|
|
1584
|
-
const [state, dispatch] = useReducer(reducer, initialState);
|
|
1584
|
+
const [state, dispatch] = useReducer(reducer$1, initialState);
|
|
1585
1585
|
// Destructure common state
|
|
1586
1586
|
const { recentlyCopied, } = state;
|
|
1587
1587
|
/*------------------------------------------------------------------------*/
|
|
@@ -1601,13 +1601,13 @@ const CopiableBox = (props) => {
|
|
|
1601
1601
|
}
|
|
1602
1602
|
// Show copied notice
|
|
1603
1603
|
dispatch({
|
|
1604
|
-
type: ActionType.IndicateRecentlyCopied,
|
|
1604
|
+
type: ActionType$1.IndicateRecentlyCopied,
|
|
1605
1605
|
});
|
|
1606
1606
|
// Wait a moment
|
|
1607
1607
|
yield waitMs(4000);
|
|
1608
1608
|
// Hide copied notice
|
|
1609
1609
|
dispatch({
|
|
1610
|
-
type: ActionType.ClearRecentlyCopiedStatus,
|
|
1610
|
+
type: ActionType$1.ClearRecentlyCopiedStatus,
|
|
1611
1611
|
});
|
|
1612
1612
|
});
|
|
1613
1613
|
/*------------------------------------------------------------------------*/
|
|
@@ -1656,6 +1656,183 @@ const CopiableBox = (props) => {
|
|
|
1656
1656
|
"Copy")))));
|
|
1657
1657
|
};
|
|
1658
1658
|
|
|
1659
|
+
/**
|
|
1660
|
+
* Reusable nested item picker
|
|
1661
|
+
* @author Yuen Ler Chow
|
|
1662
|
+
*/
|
|
1663
|
+
/* ------------- Actions ------------ */
|
|
1664
|
+
// Types of actions
|
|
1665
|
+
var ActionType;
|
|
1666
|
+
(function (ActionType) {
|
|
1667
|
+
// Toggle whether the children are being shown
|
|
1668
|
+
ActionType["ToggleItems"] = "toggle-items";
|
|
1669
|
+
})(ActionType || (ActionType = {}));
|
|
1670
|
+
/**
|
|
1671
|
+
* Reducer that executes actions
|
|
1672
|
+
* @author Yuen Ler Chow
|
|
1673
|
+
* @param state current state
|
|
1674
|
+
* @param action action to execute
|
|
1675
|
+
*/
|
|
1676
|
+
const reducer = (state, action) => {
|
|
1677
|
+
switch (action.type) {
|
|
1678
|
+
case ActionType.ToggleItems: {
|
|
1679
|
+
return { isShowingItems: !state.isShowingItems };
|
|
1680
|
+
}
|
|
1681
|
+
default: {
|
|
1682
|
+
return state;
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1685
|
+
};
|
|
1686
|
+
/*------------------------------------------------------------------------*/
|
|
1687
|
+
/* Component */
|
|
1688
|
+
/*------------------------------------------------------------------------*/
|
|
1689
|
+
const NestableItemList = (props) => {
|
|
1690
|
+
/*------------------------------------------------------------------------*/
|
|
1691
|
+
/* Setup */
|
|
1692
|
+
/*------------------------------------------------------------------------*/
|
|
1693
|
+
/* -------------- Props ------------- */
|
|
1694
|
+
// Destructure all props
|
|
1695
|
+
const { items, onChanged, } = props;
|
|
1696
|
+
/* -------------- State ------------- */
|
|
1697
|
+
// Initial state
|
|
1698
|
+
const initialState = {
|
|
1699
|
+
isShowingItems: true,
|
|
1700
|
+
};
|
|
1701
|
+
// Initialize state
|
|
1702
|
+
const [state, dispatch] = useReducer(reducer, initialState);
|
|
1703
|
+
// Destructure common state
|
|
1704
|
+
const { isShowingItems, } = state;
|
|
1705
|
+
/*------------------------------------------------------------------------*/
|
|
1706
|
+
/* Component Functions */
|
|
1707
|
+
/*------------------------------------------------------------------------*/
|
|
1708
|
+
/**
|
|
1709
|
+
* Checks if all items in a list are checked
|
|
1710
|
+
* @author Yuen Ler Chow
|
|
1711
|
+
* @param pickableItems a list of items
|
|
1712
|
+
* @returns true if all items are checked. If any item is a group,
|
|
1713
|
+
* we recursively check its children
|
|
1714
|
+
*/
|
|
1715
|
+
const allChecked = (pickableItems) => {
|
|
1716
|
+
return pickableItems.every((item) => {
|
|
1717
|
+
if (item.isGroup) {
|
|
1718
|
+
return allChecked(item.children);
|
|
1719
|
+
}
|
|
1720
|
+
return item.checked;
|
|
1721
|
+
});
|
|
1722
|
+
};
|
|
1723
|
+
/**
|
|
1724
|
+
* Checks if none of the items in a list are checked
|
|
1725
|
+
* @author Yuen Ler Chow
|
|
1726
|
+
* @param pickableItems a list of items
|
|
1727
|
+
* @returns true if all items are unchecked. If any item is a group, we
|
|
1728
|
+
* recursively check its children
|
|
1729
|
+
*/
|
|
1730
|
+
const noneChecked = (pickableItems) => {
|
|
1731
|
+
return pickableItems.every((item) => {
|
|
1732
|
+
if (item.isGroup) {
|
|
1733
|
+
return noneChecked(item.children);
|
|
1734
|
+
}
|
|
1735
|
+
return !item.checked;
|
|
1736
|
+
});
|
|
1737
|
+
};
|
|
1738
|
+
/**
|
|
1739
|
+
* Change whether specific items are checked
|
|
1740
|
+
* @author Yuen Ler Chow
|
|
1741
|
+
* @param id the id of the item we want to check or uncheck OR true if
|
|
1742
|
+
* we are checking/unchecking all items, independent of their id
|
|
1743
|
+
* @param checked if true, the item will be checked.
|
|
1744
|
+
* @param pickableItems the list of items we iterate through to find the item
|
|
1745
|
+
* we want to check/uncheck
|
|
1746
|
+
* @returns a list of items with the item now checked/unchecked.
|
|
1747
|
+
* If it is a group, its children will also become checked/unchecked
|
|
1748
|
+
*/
|
|
1749
|
+
const changeChecked = (id, checked, pickableItems) => {
|
|
1750
|
+
const updatedItems = pickableItems.map((item) => {
|
|
1751
|
+
if (item.id === id || id === true) {
|
|
1752
|
+
if (item.isGroup) {
|
|
1753
|
+
return Object.assign(Object.assign({}, item), { children: changeChecked(true, checked, item.children) });
|
|
1754
|
+
}
|
|
1755
|
+
return Object.assign(Object.assign({}, item), { checked });
|
|
1756
|
+
}
|
|
1757
|
+
if (item.isGroup) {
|
|
1758
|
+
return Object.assign(Object.assign({}, item), { children: changeChecked(id, checked, item.children) });
|
|
1759
|
+
}
|
|
1760
|
+
return item;
|
|
1761
|
+
});
|
|
1762
|
+
return updatedItems;
|
|
1763
|
+
};
|
|
1764
|
+
/**
|
|
1765
|
+
* Within a tree of items, swap in the list of updated items into the spot
|
|
1766
|
+
* indicated by the id
|
|
1767
|
+
* @author Yuen Ler Chow
|
|
1768
|
+
* @param id the id of the item group we want to change
|
|
1769
|
+
* @param updatedItems the list of items we want to change the items in the group to
|
|
1770
|
+
* @returns a list of all items containing the updated items
|
|
1771
|
+
*/
|
|
1772
|
+
const changeItems = (id, updatedItems) => {
|
|
1773
|
+
return items.map((item) => {
|
|
1774
|
+
if (item.id === id) {
|
|
1775
|
+
return Object.assign(Object.assign({}, item), { children: updatedItems });
|
|
1776
|
+
}
|
|
1777
|
+
return item;
|
|
1778
|
+
});
|
|
1779
|
+
};
|
|
1780
|
+
/*------------------------------------------------------------------------*/
|
|
1781
|
+
/* Render */
|
|
1782
|
+
/*------------------------------------------------------------------------*/
|
|
1783
|
+
return (React.createElement("div", null, items.map((item) => {
|
|
1784
|
+
return (React.createElement("div", { key: item.id },
|
|
1785
|
+
React.createElement("span", { className: "NestableItemList-dropdown-button-container d-inline-block", style: {
|
|
1786
|
+
minWidth: '2rem',
|
|
1787
|
+
} }, item.isGroup && (React.createElement("button", { className: `NestableItemList-dropdown-button NestableItemList-dropdown-button-${item.id}`, style: {
|
|
1788
|
+
border: 0,
|
|
1789
|
+
backgroundColor: 'transparent',
|
|
1790
|
+
}, type: "button", onClick: () => {
|
|
1791
|
+
dispatch({
|
|
1792
|
+
type: ActionType.ToggleItems,
|
|
1793
|
+
});
|
|
1794
|
+
}, "aria-label": `${isShowingItems ? 'Hide' : 'Show'} items in ${item.name}` },
|
|
1795
|
+
React.createElement(FontAwesomeIcon, { icon: isShowingItems ? faChevronDown : faChevronRight })))),
|
|
1796
|
+
React.createElement(CheckboxButton, { className: `NestableItemList-CheckboxButton-${item.id}`, text: item.name, checked: item.isGroup ? allChecked(item.children) : item.checked, dashed: item.isGroup ? !noneChecked(item.children) : false, onChanged: (checked) => {
|
|
1797
|
+
onChanged(changeChecked(item.id, checked, items));
|
|
1798
|
+
}, ariaLabel: `Select ${item.name}`, checkedVariant: Variant$1.Light }),
|
|
1799
|
+
item.isGroup && isShowingItems && (React.createElement("div", { className: "NestableItemList-children-container", style: {
|
|
1800
|
+
paddingLeft: '2.2rem',
|
|
1801
|
+
} },
|
|
1802
|
+
React.createElement(NestableItemList, { items: item.children, onChanged: (updatedItems) => {
|
|
1803
|
+
onChanged(changeItems(item.id, updatedItems));
|
|
1804
|
+
} })))));
|
|
1805
|
+
})));
|
|
1806
|
+
};
|
|
1807
|
+
|
|
1808
|
+
/**
|
|
1809
|
+
* Reusable nested item picker
|
|
1810
|
+
* @author Yuen Ler Chow
|
|
1811
|
+
*/
|
|
1812
|
+
/*------------------------------------------------------------------------*/
|
|
1813
|
+
/* Component */
|
|
1814
|
+
/*------------------------------------------------------------------------*/
|
|
1815
|
+
const ItemPicker = (props) => {
|
|
1816
|
+
/*------------------------------------------------------------------------*/
|
|
1817
|
+
/* Setup */
|
|
1818
|
+
/*------------------------------------------------------------------------*/
|
|
1819
|
+
/* -------------- Props ------------- */
|
|
1820
|
+
// Destructure all props
|
|
1821
|
+
const { title, items, onChanged, } = props;
|
|
1822
|
+
/*------------------------------------------------------------------------*/
|
|
1823
|
+
/* Component Functions */
|
|
1824
|
+
/*------------------------------------------------------------------------*/
|
|
1825
|
+
/*------------------------------------------------------------------------*/
|
|
1826
|
+
/* Render */
|
|
1827
|
+
/*------------------------------------------------------------------------*/
|
|
1828
|
+
/*----------------------------------------*/
|
|
1829
|
+
/* Main UI */
|
|
1830
|
+
/*----------------------------------------*/
|
|
1831
|
+
return (React.createElement(TabBox, { title: title },
|
|
1832
|
+
React.createElement("div", { style: { overflowX: 'scroll' } },
|
|
1833
|
+
React.createElement(NestableItemList, { items: items, onChanged: onChanged }))));
|
|
1834
|
+
};
|
|
1835
|
+
|
|
1659
1836
|
/**
|
|
1660
1837
|
* One minute in ms
|
|
1661
1838
|
* @author Gabe Abrams
|
|
@@ -2471,6 +2648,16 @@ const stringsToHumanReadableList = (items) => {
|
|
|
2471
2648
|
return list;
|
|
2472
2649
|
};
|
|
2473
2650
|
|
|
2651
|
+
/**
|
|
2652
|
+
* Given a string, only keep the letters inside it
|
|
2653
|
+
* @author Gabe Abrams
|
|
2654
|
+
* @param str the string to parse
|
|
2655
|
+
* @returns only the letters inside of the string
|
|
2656
|
+
*/
|
|
2657
|
+
const onlyKeepLetters = (str) => {
|
|
2658
|
+
return str.replace(/[^a-zA-Z]+/g, '');
|
|
2659
|
+
};
|
|
2660
|
+
|
|
2474
2661
|
/**
|
|
2475
2662
|
* Days of the week
|
|
2476
2663
|
* @author Gabe Abrams
|
|
@@ -2487,5 +2674,5 @@ var DayOfWeek;
|
|
|
2487
2674
|
})(DayOfWeek || (DayOfWeek = {}));
|
|
2488
2675
|
var DayOfWeek$1 = DayOfWeek;
|
|
2489
2676
|
|
|
2490
|
-
export { AppWrapper, ButtonInputGroup, CheckboxButton, CopiableBox, DAY_IN_MS, DayOfWeek$1 as DayOfWeek, Drawer, ErrorBox, ErrorWithCode, HOUR_IN_MS, LoadingSpinner, MINUTE_IN_MS, Modal, ModalButtonType$1 as ModalButtonType, ModalSize$1 as ModalSize, ModalType$1 as ModalType, ParamType$1 as ParamType, PopFailureMark, PopPendingMark, PopSuccessMark, RadioButton, ReactKitErrorCode$1 as ReactKitErrorCode, SimpleDateChooser, TabBox, Variant$1 as Variant, abbreviate, alert$1 as alert, avg, ceilToNumDecimals, confirm, floorToNumDecimals, forceNumIntoBounds, genRouteHandler, getHumanReadableDate, getOrdinal, getPartOfDay, getTimeInfoInET, handleError, handleSuccess, initServer, padDecimalZeros, padZerosLeft, roundToNumDecimals, showFatalError, startMinWait, stringsToHumanReadableList, stubServerEndpoint, sum, visitServerEndpoint, waitMs };
|
|
2677
|
+
export { AppWrapper, ButtonInputGroup, CheckboxButton, CopiableBox, DAY_IN_MS, DayOfWeek$1 as DayOfWeek, Drawer, ErrorBox, ErrorWithCode, HOUR_IN_MS, ItemPicker, LoadingSpinner, MINUTE_IN_MS, Modal, ModalButtonType$1 as ModalButtonType, ModalSize$1 as ModalSize, ModalType$1 as ModalType, ParamType$1 as ParamType, PopFailureMark, PopPendingMark, PopSuccessMark, RadioButton, ReactKitErrorCode$1 as ReactKitErrorCode, SimpleDateChooser, TabBox, Variant$1 as Variant, abbreviate, alert$1 as alert, avg, ceilToNumDecimals, confirm, floorToNumDecimals, forceNumIntoBounds, genRouteHandler, getHumanReadableDate, getOrdinal, getPartOfDay, getTimeInfoInET, handleError, handleSuccess, initServer, onlyKeepLetters, padDecimalZeros, padZerosLeft, roundToNumDecimals, showFatalError, startMinWait, stringsToHumanReadableList, stubServerEndpoint, sum, visitServerEndpoint, waitMs };
|
|
2491
2678
|
//# sourceMappingURL=index.js.map
|