@conduction/components 2.1.10 → 2.1.11
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/README.md
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
- **Version 2.1 (breaking changes from 2.0.x)**
|
|
6
6
|
|
|
7
|
+
- 2.1.11: Added CreateKeyValue component disabled state on delete buttons
|
|
7
8
|
- 2.1.10: PrimaryTopNav overflow scroll removed from desktop
|
|
8
9
|
- 2.1.8 & 2.1.9: PrimaryTopNav will always show subItems on mobile
|
|
9
10
|
- 2.1.7: Add disabled placholders to all Select elements.
|
|
@@ -27,5 +27,5 @@ const KeyValueComponent = ({ defaultValue, handleChange, disabled }) => {
|
|
|
27
27
|
React.useEffect(() => {
|
|
28
28
|
handleChange(keyValues);
|
|
29
29
|
}, [keyValues]);
|
|
30
|
-
return (_jsxs("div", { className: styles.keyValue, children: [keyValues && (_jsxs(Table, { className: styles.table, children: [_jsx(TableHead, { children: _jsxs(TableRow, { children: [_jsx(TableHeader, { children: "Key" }), _jsx(TableHeader, { children: "Value" }), _jsx(TableHeader, {})] }) }), _jsx(TableBody, { children: keyValues.map((keyValue, idx) => (_jsxs(TableRow, { children: [_jsx(TableCell, { children: keyValue.key }), _jsx(TableCell, { children: keyValue.value }), _jsx(TableCell, { className: styles.tdDelete, children: _jsx(Button, { onClick: () => setKeyValues(keyValues.filter((_keyValue) => _keyValue !== keyValue)), children: "Delete" }) })] }, `${keyValue}${idx}`))) })] })), _jsxs("div", { className: styles.form, children: [_jsx("input", { type: "text", placeholder: "Key", value: currentKey, ref: currentKeyRef, className: "denhaag-textfield__input", onChange: (e) => setCurrentKey(e.target.value), ...{ disabled } }), _jsx("input", { type: "text", placeholder: "Value", value: currentValue, ref: currentValueRef, className: "denhaag-textfield__input", onChange: (e) => setCurrentValue(e.target.value), ...{ disabled } }), _jsx(Button, { onClick: handleCreate, disabled: !currentKey || !currentValue || disabled, children: "Add" })] })] }));
|
|
30
|
+
return (_jsxs("div", { className: styles.keyValue, children: [keyValues && (_jsxs(Table, { className: styles.table, children: [_jsx(TableHead, { children: _jsxs(TableRow, { children: [_jsx(TableHeader, { children: "Key" }), _jsx(TableHeader, { children: "Value" }), _jsx(TableHeader, {})] }) }), _jsx(TableBody, { children: keyValues.map((keyValue, idx) => (_jsxs(TableRow, { children: [_jsx(TableCell, { children: keyValue.key }), _jsx(TableCell, { children: keyValue.value }), _jsx(TableCell, { className: styles.tdDelete, children: _jsx(Button, { ...{ disabled }, onClick: () => setKeyValues(keyValues.filter((_keyValue) => _keyValue !== keyValue)), children: "Delete" }) })] }, `${keyValue}${idx}`))) })] })), _jsxs("div", { className: styles.form, children: [_jsx("input", { type: "text", placeholder: "Key", value: currentKey, ref: currentKeyRef, className: "denhaag-textfield__input", onChange: (e) => setCurrentKey(e.target.value), ...{ disabled } }), _jsx("input", { type: "text", placeholder: "Value", value: currentValue, ref: currentValueRef, className: "denhaag-textfield__input", onChange: (e) => setCurrentValue(e.target.value), ...{ disabled } }), _jsx(Button, { onClick: handleCreate, disabled: !currentKey || !currentValue || disabled, children: "Add" })] })] }));
|
|
31
31
|
};
|
package/package.json
CHANGED
|
@@ -91,7 +91,10 @@ const KeyValueComponent: React.FC<CreateKeyValueComponentProps> = ({ defaultValu
|
|
|
91
91
|
<TableCell>{keyValue.key}</TableCell>
|
|
92
92
|
<TableCell>{keyValue.value}</TableCell>
|
|
93
93
|
<TableCell className={styles.tdDelete}>
|
|
94
|
-
<Button
|
|
94
|
+
<Button
|
|
95
|
+
{...{ disabled }}
|
|
96
|
+
onClick={() => setKeyValues(keyValues.filter((_keyValue) => _keyValue !== keyValue))}
|
|
97
|
+
>
|
|
95
98
|
Delete
|
|
96
99
|
</Button>
|
|
97
100
|
</TableCell>
|