@agilant/toga-blox 1.0.92 → 1.0.94
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/components/BaseInput/BaseCheckbox.d.ts +10 -0
- package/dist/components/BaseInput/BaseCheckbox.js +9 -0
- package/dist/components/BaseInput/BaseInput.d.ts +4 -0
- package/dist/components/BaseInput/BaseInput.js +100 -0
- package/dist/components/BaseInput/BaseInput.stories.d.ts +12 -0
- package/dist/components/BaseInput/BaseInput.stories.js +375 -0
- package/dist/components/BaseInput/BaseInput.test.d.ts +1 -0
- package/dist/components/BaseInput/BaseInput.test.js +560 -0
- package/dist/components/BaseInput/BaseInput.types.d.ts +139 -0
- package/dist/components/BaseInput/BaseInput.types.js +1 -0
- package/dist/components/BaseInput/BaseMultiSelect.d.ts +33 -0
- package/dist/components/BaseInput/BaseMultiSelect.js +68 -0
- package/dist/components/BaseInput/BaseRadio.d.ts +18 -0
- package/dist/components/BaseInput/BaseRadio.js +7 -0
- package/dist/components/BaseInput/BaseSelect.d.ts +41 -0
- package/dist/components/BaseInput/BaseSelect.js +83 -0
- package/dist/components/BaseInput/BaseTextInput.d.ts +27 -0
- package/dist/components/BaseInput/BaseTextInput.js +45 -0
- package/dist/components/BaseInput/BaseTextareaInput.d.ts +27 -0
- package/dist/components/BaseInput/BaseTextareaInput.js +36 -0
- package/dist/components/BaseInput/BaseToggle.d.ts +24 -0
- package/dist/components/BaseInput/BaseToggle.js +8 -0
- package/dist/components/BaseInput/DisabledSelect.d.ts +7 -0
- package/dist/components/BaseInput/DisabledSelect.js +6 -0
- package/dist/components/BaseInput/components/BaseErrorMessage.d.ts +8 -0
- package/dist/components/BaseInput/components/BaseErrorMessage.js +5 -0
- package/dist/components/BaseInput/components/CharacterLimitMessage.d.ts +9 -0
- package/dist/components/BaseInput/components/CharacterLimitMessage.js +7 -0
- package/dist/components/BaseInput/components/DropDownIndicator.d.ts +6 -0
- package/dist/components/BaseInput/components/DropDownIndicator.js +5 -0
- package/dist/components/BaseInput/components/MultiValueRemove.d.ts +4 -0
- package/dist/components/BaseInput/components/MultiValueRemove.js +7 -0
- package/dist/components/BaseInput/components/Option.d.ts +2 -0
- package/dist/components/BaseInput/components/Option.js +19 -0
- package/dist/components/BaseInput/components/SingleValue.d.ts +4 -0
- package/dist/components/BaseInput/components/SingleValue.js +14 -0
- package/dist/components/SearchInput/SearchInput.js +2 -2
- package/dist/components/SearchInput/SearchInput.stories.js +0 -4
- package/dist/components/ToggleButton/ToggleButton.js +2 -2
- package/dist/utils/formatePhoneNumber.d.ts +2 -0
- package/dist/utils/formatePhoneNumber.js +14 -0
- package/dist/utils/fromatTableData.d.ts +45 -0
- package/dist/utils/fromatTableData.js +80 -0
- package/dist/utils/getColSPanClass.d.ts +2 -0
- package/dist/utils/getColSPanClass.js +15 -0
- package/package.json +2 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
const ArrowDownIcon = ({ className }) => (_jsx("div", { className: "pr-2", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "8", viewBox: "0 0 14 8", fill: "none", className: className, children: _jsx("path", { d: "M1.41469 1.03648L1.41467 1.0365L1.41749 1.03925L6.76749 6.26425L7.0015 6.4928L7.23442 6.26314L12.5844 0.988141L12.5844 0.988147L12.5861 0.986484C12.6809 0.891658 12.8199 0.891659 12.9147 0.986483C13.0092 1.08103 13.0095 1.21943 12.9155 1.31424C12.9152 1.31452 12.915 1.3148 12.9147 1.31508L7.16676 6.96302L7.16676 6.96301L7.16469 6.96508C7.06838 7.06139 7.02352 7.06745 7.00039 7.06745C6.94147 7.06745 6.89042 7.05301 6.82064 6.99988L1.08526 1.36425C0.991268 1.26944 0.991545 1.13103 1.08609 1.03648C1.18092 0.941658 1.31986 0.941658 1.41469 1.03648Z", fill: "currentColor" // Use currentColor to apply the color from the class
|
|
3
|
+
, stroke: "currentColor" // Use currentColor to apply the color from the class
|
|
4
|
+
, strokeWidth: "0.666667" }) }) }));
|
|
5
|
+
export default ArrowDownIcon;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { components as defaultComponents } from "react-select";
|
|
3
|
+
import { getFontAwesomeIcon } from "../../../utils/getFontAwesomeIcon";
|
|
4
|
+
const MultiValueRemove = (props) => {
|
|
5
|
+
return (_jsx(defaultComponents.MultiValueRemove, { ...props, children: _jsx("div", { className: "flex text-white text-xs pl-2 items-center", children: getFontAwesomeIcon("xmark", "regular") }) }));
|
|
6
|
+
};
|
|
7
|
+
export default MultiValueRemove;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { components } from "react-select";
|
|
3
|
+
import { getFontAwesomeIcon } from "../../../utils/getFontAwesomeIcon";
|
|
4
|
+
const Option = (props) => {
|
|
5
|
+
if (props.isMulti) {
|
|
6
|
+
return (_jsx(components.Option, { ...props, children: _jsxs("div", { className: "py-1 border-b border-slate-200 hover:bg-supply-blue-50", children: [_jsx("input", { type: "checkbox", checked: props.isSelected, className: "sr-only", id: `checkbox-${props.data.name}`, onChange: () => null }), _jsxs("label", { className: "pl-2 flex items-center", htmlFor: `checkbox-${props.data.name}`, children: [_jsx("span", { className: `rounded border text-xs ${props.isSelected
|
|
7
|
+
? "bg-supply-blue-400"
|
|
8
|
+
: "bg-white"} w-5 h-5 inline-block mr-2 relative p-0`, children: props.isSelected && (_jsx("div", { className: "absolute w-3 h-3 fill-current text-white top-[3px] left-[3px]", children: getFontAwesomeIcon("check", "solid") })) }), props.data.name] })] }) }));
|
|
9
|
+
}
|
|
10
|
+
else if (Array.isArray(props.data.name)) {
|
|
11
|
+
let firstValue = props.data.name[0];
|
|
12
|
+
let secondValue = props.data.name[1];
|
|
13
|
+
return (_jsx(components.Option, { ...props, children: _jsxs("div", { className: "border-b border-slate-200 hover:bg-supply-blue-50", children: [_jsx("input", { type: "", checked: props.isSelected, className: "sr-only", id: `${props.value}`, onChange: () => null }), props.isSelected ? (_jsxs("label", { className: "flex items-center py-1 px-2", htmlFor: `${props.value}`, children: [_jsx("div", { className: "flex items-start pr-2.5", children: _jsx("div", { className: "w-3 h-3 fill-current text-supply-blue-400", children: getFontAwesomeIcon("check", "solid") }) }), _jsxs("div", { className: "flex flex-col py-1", children: [_jsx("div", { className: "", children: firstValue }), _jsx("div", { className: "text-navy-350", children: secondValue })] })] })) : (_jsx("label", { className: "pl-2 flex items-center py-1 px-4", htmlFor: `${props.value}`, children: _jsxs("div", { className: "flex flex-col py-1", children: [_jsx("div", { className: "", children: firstValue }), _jsx("div", { className: "text-navy-350", children: secondValue })] }) }))] }) }));
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
return (_jsx(components.Option, { ...props, children: _jsxs("div", { className: "border-b border-slate-200 hover:bg-supply-blue-50", children: [_jsx("input", { type: "", checked: props.isSelected, className: "sr-only", id: `${props.value}`, onChange: () => null }), props.isSelected ? (_jsxs("label", { className: "relative pl-8 flex items-center py-1 px-4", htmlFor: `${props.value}`, children: [_jsx("div", { className: "absolute w-3 h-3 fill-current text-supply-blue-400 top-[5px] left-[5px]", children: getFontAwesomeIcon("check", "solid") }), props.label] })) : (_jsx("label", { className: "pl-2 flex items-center py-1 px-4", htmlFor: `${props.value}`, children: props.label }))] }) }));
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
export default Option;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { components } from "react-select";
|
|
3
|
+
const SingleValue = (props) => {
|
|
4
|
+
const { data } = props;
|
|
5
|
+
if (Array.isArray(data.name)) {
|
|
6
|
+
let firstValue = data.name[0];
|
|
7
|
+
let secondValue = data.name[1];
|
|
8
|
+
return (_jsx(components.SingleValue, { ...props, children: _jsxs("div", { className: "flex flex-col py-1", children: [_jsx("div", { className: "max-w-14", children: firstValue }), data.name.length > 1 && (_jsx("div", { className: "text-navy-350", children: secondValue }))] }) }));
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
return (_jsx(components.SingleValue, { ...props, children: _jsx("div", { className: "flex items-center py-1", children: data.name }) }));
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
export default SingleValue;
|
|
@@ -19,13 +19,13 @@ const SearchInput = ({ bgColor = "bg-sky-500", textHighlight = "text-sky-500", i
|
|
|
19
19
|
case "text":
|
|
20
20
|
return (_jsx(SearchTextInput, { dropdownIconProp: dropdownIconProp, dropdownOptions: dropdownOptions, selectedDropdownOption: selectedDropdownOption, onDropdownOptionSelect: onDropdownOptionSelect, searchItems: searchItems, setSearchItems: setSearchItems, handleFilter: handleFilter, setSearchCriteria: setSearchCriteria, column: column, setEditingHeader: setEditingHeader, pillColor: pillColor, firstIconClasses: firstIconClasses, fontFamily: fontFamily,
|
|
21
21
|
//will remove the filter options from the badge shown in the input
|
|
22
|
-
removePattern: removePattern }));
|
|
22
|
+
removePattern: removePattern, textHighlight: textHighlight }));
|
|
23
23
|
case "number":
|
|
24
24
|
return (_jsx(SearchNumberInput, { dropdownIconProp: dropdownIconProp, dropdownOptions: dropdownOptions, selectedDropdownOption: selectedDropdownOption, onDropdownOptionSelect: onDropdownOptionSelect, toggleStatus: toggleStatus, setToggleStatus: setToggleStatus, minValue: minValue, maxValue: maxValue, setMinValue: setMinValue, setMaxValue: setMaxValue, handleFilter: handleFilter, setSearchCriteria: setSearchCriteria, column: column, themeBgColor: dataPickerThemeColor, toggleColor: toggleColor, toggleTextColor: toggleTextColor }));
|
|
25
25
|
case "multiSelect":
|
|
26
26
|
return (_jsx(SearchDropdownInput, { options: dropdownOptions, placeholder: "Search", additionalClasses: "", onChange: onChange, selectedValue: selectedValue, bgColor: dataPickerThemeColor, clearText: "Clear", clearTextColor: "text-sky-500", buttonText: "Filter", handleFilter: handleFilter, column: column, setSearchCriteria: setSearchCriteria, textHighlight: textHighlight, isBoolean: isBoolean }));
|
|
27
27
|
case "date":
|
|
28
|
-
return (_jsx(SearchDatePickerInput, { textHighlight: textHighlight, dropdownOptions: dropdownOptions, toggleStatus: toggleStatus, setToggleStatus: setToggleStatus, selectedDate: selectedDate, onDateSelect: onDateSelect, selectedStartDate: selectedStartDate, onStartDateSelect: onStartDateSelect, selectedEndDate: selectedEndDate, onEndDateSelect: onEndDateSelect, handleFilter: handleFilter, themeBgColor: dataPickerThemeColor, lightThemeBg: dataPickerThemeColorAccent, setSearchCriteria: setSearchCriteria, column: column, setEditingHeader: setEditingHeader, searchItems: searchItems, setSearchItems: setSearchItems, pillColor: pillColor, toggleColor: toggleColor, toggleTextColor: toggleTextColor, fontFamily: fontFamily, removePattern: removePattern }));
|
|
28
|
+
return (_jsx(SearchDatePickerInput, { textHighlight: textHighlight, dropdownOptions: dropdownOptions, toggleStatus: toggleStatus, setToggleStatus: setToggleStatus, selectedDate: selectedDate, onDateSelect: onDateSelect, selectedStartDate: selectedStartDate, onStartDateSelect: onStartDateSelect, selectedEndDate: selectedEndDate, onEndDateSelect: onEndDateSelect, handleFilter: handleFilter, themeBgColor: dataPickerThemeColor, lightThemeBg: dataPickerThemeColorAccent, setSearchCriteria: setSearchCriteria, column: column, setEditingHeader: setEditingHeader, searchItems: searchItems, setSearchItems: setSearchItems, pillColor: pillColor, toggleColor: toggleColor, toggleTextColor: toggleTextColor, fontFamily: fontFamily, removePattern: removePattern, dropdownIconProp: dropdownIconProp }));
|
|
29
29
|
default:
|
|
30
30
|
return null;
|
|
31
31
|
}
|
|
@@ -39,10 +39,6 @@ export default {
|
|
|
39
39
|
},
|
|
40
40
|
parameters: { layout: "centered" },
|
|
41
41
|
};
|
|
42
|
-
/**
|
|
43
|
-
* Our 'Template' sets up local state for everything,
|
|
44
|
-
* so the SearchInput can function (adding/removing badges, toggling date range, etc.)
|
|
45
|
-
*/
|
|
46
42
|
const Template = (args) => {
|
|
47
43
|
const [selectedOption, setSelectedOption] = useState(args.selectedDropdownOption);
|
|
48
44
|
const [searchItems, setSearchItems] = useState([]);
|
|
@@ -8,8 +8,8 @@ const textPositionMap = {
|
|
|
8
8
|
};
|
|
9
9
|
const getToggleClasses = (status, smallToggle, borderStyle, activeColorBorder, inactiveColorBorder, activeColorBackground, inactiveColorBackground) => {
|
|
10
10
|
const baseClasses = "peer rounded-full border";
|
|
11
|
-
const borderToggleClasses = "after:absolute after:left-[4px] after:top-1 after:h-3 after:w-3 after:rounded-full after:bg-
|
|
12
|
-
const borderToggleCircleClasses = "peer-checked:after:translate-x-full peer-checked:after:border-white peer-checked:after:bg-
|
|
11
|
+
const borderToggleClasses = "after:absolute after:left-[4px] after:top-1 after:h-3 after:w-3 after:rounded-full after:bg-blue-300 after:transition-all after:content-['']";
|
|
12
|
+
const borderToggleCircleClasses = "peer-checked:after:translate-x-full peer-checked:after:border-white peer-checked:after:bg-blue-500";
|
|
13
13
|
const smallBackgroundToggleClasses = "after:absolute after:left-[4px] after:top-1 after:h-3 after:w-3 after:rounded-full after:bg-navy-300 after:transition-all after:content-['']";
|
|
14
14
|
const largeBackgroundToggleClasses = "after:absolute after:left-[3px] after:top-[4.5px] after:h-[19px] after:w-[19px] after:rounded-full after:bg-white after:transition-all after:content-['']";
|
|
15
15
|
switch (true) {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// This function is used to update phone number format to (xxx) xxx-xxxx during onChange of input field
|
|
2
|
+
const formatPhoneNumber = (value) => {
|
|
3
|
+
if (!value)
|
|
4
|
+
return value;
|
|
5
|
+
const phoneNumber = value.replace(/[^\d]/g, "");
|
|
6
|
+
const phoneNumberLength = phoneNumber.length;
|
|
7
|
+
if (phoneNumberLength < 4)
|
|
8
|
+
return phoneNumber;
|
|
9
|
+
if (phoneNumberLength < 7) {
|
|
10
|
+
return `(${phoneNumber.slice(0, 3)}) ${phoneNumber.slice(3)}`;
|
|
11
|
+
}
|
|
12
|
+
return `(${phoneNumber.slice(0, 3)}) ${phoneNumber.slice(3, 6)}-${phoneNumber.slice(6, 10)}`;
|
|
13
|
+
};
|
|
14
|
+
export default formatPhoneNumber;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CellProps } from "react-table";
|
|
3
|
+
/** Config each column might have */
|
|
4
|
+
export interface SharedColumnConfig {
|
|
5
|
+
key: string;
|
|
6
|
+
type?: string;
|
|
7
|
+
linkClasses?: string;
|
|
8
|
+
leftIcon?: string;
|
|
9
|
+
rightIcon?: string;
|
|
10
|
+
leftImage?: string;
|
|
11
|
+
rightImage?: string;
|
|
12
|
+
transform?: (value: any) => any;
|
|
13
|
+
}
|
|
14
|
+
/** Minimally typed shape for returned React Table columns */
|
|
15
|
+
export interface TableColumn {
|
|
16
|
+
Header: string | (() => JSX.Element);
|
|
17
|
+
accessor: string;
|
|
18
|
+
Cell: (props: CellProps<{
|
|
19
|
+
[key: string]: string | React.ReactElement;
|
|
20
|
+
}, string | React.ReactElement>) => JSX.Element;
|
|
21
|
+
sticky?: "left" | "right";
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Callbacks for each app to provide their own "implementation details":
|
|
25
|
+
* - e.g. how to render icons, how to handle images, etc.
|
|
26
|
+
*/
|
|
27
|
+
export interface Renderers {
|
|
28
|
+
renderIcon?: (iconName: string, style?: "solid" | "regular") => JSX.Element;
|
|
29
|
+
renderImage?: (props: {
|
|
30
|
+
imageUrl: string;
|
|
31
|
+
altText: string;
|
|
32
|
+
className?: string;
|
|
33
|
+
width?: number;
|
|
34
|
+
height?: number;
|
|
35
|
+
}) => JSX.Element;
|
|
36
|
+
renderStatus?: (value: string, extra?: any) => JSX.Element;
|
|
37
|
+
renderCurrency?: (value: string) => string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* A generic table formatter you can reuse in both apps.
|
|
41
|
+
* This version delegates certain rendering details to the `renderers`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function formatTableData(columnTitles: string[], accessors: string[], columnConfigs: SharedColumnConfig[], renderers?: Renderers): TableColumn[];
|
|
44
|
+
/** Simple helper to generate the default "col1", "col2", ... accessors */
|
|
45
|
+
export declare function generateAccessors(columnTitles: string[]): string[];
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* A generic table formatter you can reuse in both apps.
|
|
4
|
+
* This version delegates certain rendering details to the `renderers`.
|
|
5
|
+
*/
|
|
6
|
+
export function formatTableData(columnTitles, accessors, columnConfigs, renderers = {}) {
|
|
7
|
+
function renderCellContent(config) {
|
|
8
|
+
return ({ value }) => {
|
|
9
|
+
// 1. Check leftIcon, rightIcon, leftImage, rightImage, etc.
|
|
10
|
+
if (config.leftIcon && renderers.renderIcon) {
|
|
11
|
+
const icon = (_jsx("div", { className: "pr-2", children: renderers.renderIcon(config.leftIcon, "solid") }));
|
|
12
|
+
return renderContent(config, value, icon, "left");
|
|
13
|
+
}
|
|
14
|
+
if (config.rightIcon && renderers.renderIcon) {
|
|
15
|
+
const icon = (_jsx("div", { className: "pl-2", children: renderers.renderIcon(config.rightIcon, "solid") }));
|
|
16
|
+
return renderContent(config, value, icon, "right");
|
|
17
|
+
}
|
|
18
|
+
if (config.leftImage && renderers.renderImage) {
|
|
19
|
+
const image = (_jsx("div", { className: "pr-2", children: renderers.renderImage({
|
|
20
|
+
imageUrl: config.leftImage,
|
|
21
|
+
altText: "Image",
|
|
22
|
+
width: 30,
|
|
23
|
+
height: 30,
|
|
24
|
+
}) }));
|
|
25
|
+
return renderContent(config, value, image, "left");
|
|
26
|
+
}
|
|
27
|
+
if (config.rightImage && renderers.renderImage) {
|
|
28
|
+
const image = (_jsx("div", { className: "pl-2", children: renderers.renderImage({
|
|
29
|
+
imageUrl: config.rightImage,
|
|
30
|
+
altText: "Image",
|
|
31
|
+
width: 30,
|
|
32
|
+
height: 30,
|
|
33
|
+
}) }));
|
|
34
|
+
return renderContent(config, value, image, "right");
|
|
35
|
+
}
|
|
36
|
+
// 2. Check type (CURRENCY, STATUS, etc.)
|
|
37
|
+
switch (config.type) {
|
|
38
|
+
case "STATUS":
|
|
39
|
+
if (renderers.renderStatus && typeof value === "string") {
|
|
40
|
+
return renderContent(config, value, renderers.renderStatus(value));
|
|
41
|
+
}
|
|
42
|
+
break;
|
|
43
|
+
case "CURRENCY":
|
|
44
|
+
if (renderers.renderCurrency && typeof value === "string") {
|
|
45
|
+
const formatted = renderers.renderCurrency(value);
|
|
46
|
+
return renderContent(config, formatted);
|
|
47
|
+
}
|
|
48
|
+
break;
|
|
49
|
+
// Add other type cases (BOOLEAN, NUMBER, DATE, etc.) as you see fit
|
|
50
|
+
}
|
|
51
|
+
// 3. If we get here, just render raw text
|
|
52
|
+
return (_jsx("div", { style: { display: "flex", alignItems: "center" }, children: typeof value === "string" ? _jsx("p", { children: value }) : value }));
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function renderContent(config, value, content, position) {
|
|
56
|
+
return (_jsx("div", { style: { display: "flex", alignItems: "center" }, className: "flex w-full", children: config.linkClasses ? (_jsxs("a", { href: "#", className: `flex ${config.linkClasses}`, onClick: (e) => e.stopPropagation(), children: [position === "left" && content, typeof value === "string" ? _jsx("p", { children: value }) : value, position === "right" && content] })) : (_jsxs(_Fragment, { children: [position === "left" && content, typeof value === "string" ? _jsx("p", { children: value }) : value, position === "right" && content] })) }));
|
|
57
|
+
}
|
|
58
|
+
// Map each title to a column definition
|
|
59
|
+
const columns = columnTitles.map((title, i) => {
|
|
60
|
+
const accessor = accessors[i];
|
|
61
|
+
const key = `col${i + 1}`;
|
|
62
|
+
const config = columnConfigs.find((c) => c.key === key) ||
|
|
63
|
+
{
|
|
64
|
+
key,
|
|
65
|
+
type: "DEFAULT",
|
|
66
|
+
};
|
|
67
|
+
return {
|
|
68
|
+
Header: title,
|
|
69
|
+
accessor,
|
|
70
|
+
Cell: ({ value }) => renderCellContent(config)({ value }),
|
|
71
|
+
};
|
|
72
|
+
});
|
|
73
|
+
// Return the final array of columns.
|
|
74
|
+
// (Apps can push a custom "sticky" col onto this if they want.)
|
|
75
|
+
return columns;
|
|
76
|
+
}
|
|
77
|
+
/** Simple helper to generate the default "col1", "col2", ... accessors */
|
|
78
|
+
export function generateAccessors(columnTitles) {
|
|
79
|
+
return columnTitles.map((_, index) => `col${index + 1}`);
|
|
80
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const getColSpanClass = (colSpan) => {
|
|
2
|
+
switch (colSpan) {
|
|
3
|
+
case "col-span-1":
|
|
4
|
+
return "col-span-1";
|
|
5
|
+
case "col-span-2":
|
|
6
|
+
return "col-span-2";
|
|
7
|
+
case "col-span-3":
|
|
8
|
+
return "col-span-3";
|
|
9
|
+
case "col-span-4":
|
|
10
|
+
return "col-span-4";
|
|
11
|
+
default:
|
|
12
|
+
return "";
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
export default getColSpanClass;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agilant/toga-blox",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.94",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"@storybook/addon-viewport": "^7.6.10",
|
|
31
31
|
"@tanstack/react-virtual": "^3.1.3",
|
|
32
32
|
"@tanstack/virtual-core": "^3.1.3",
|
|
33
|
+
"classnames": "^2.5.1",
|
|
33
34
|
"esbuild-wasm": "^0.23.0",
|
|
34
35
|
"framer-motion": "^11.0.8",
|
|
35
36
|
"nouislider": "^15.8.1",
|