1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00

refactor(docker/containers): migrate commands tab to react [EE-5208] (#10085)

This commit is contained in:
Chaim Lev-Ari 2023-09-04 19:07:29 +01:00 committed by GitHub
parent 46e73ee524
commit f7366d9788
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 1783 additions and 951 deletions

View file

@ -66,7 +66,7 @@ function sizeClassLabel(size?: Size) {
case 'medium':
return 'col-sm-4 col-lg-3';
case 'xsmall':
return 'col-sm-2';
return 'col-sm-1';
case 'vertical':
return '';
default:
@ -81,7 +81,7 @@ function sizeClassChildren(size?: Size) {
case 'medium':
return 'col-sm-8 col-lg-9';
case 'xsmall':
return 'col-sm-10';
return 'col-sm-11';
case 'vertical':
return '';
default:

View file

@ -13,7 +13,9 @@ export function Input({
className,
mRef: ref,
...props
}: InputHTMLAttributes<HTMLInputElement> & { mRef?: Ref<HTMLInputElement> }) {
}: InputHTMLAttributes<HTMLInputElement> & {
mRef?: Ref<HTMLInputElement>;
}) {
return (
<input
// eslint-disable-next-line react/jsx-props-no-spreading

View file

@ -1,23 +1,24 @@
import { PropsWithChildren } from 'react';
import clsx from 'clsx';
import { useInputGroupContext } from './InputGroup';
/**
* Should wrap all buttons inside a InputGroup
*
* example:
* ```
* <InputGroup>
* <InputGroup.ButtonWrapper>
* <Button>...</Button>
* <Button>...</Button>
* </InputGroup.ButtonWrapper>
* </InputGroup>
* ```
*/
export function InputGroupButtonWrapper({
children,
}: PropsWithChildren<unknown>) {
useInputGroupContext();
return (
<span
className={clsx(
'input-group-btn [&>button]:!ml-0',
// the button should be rounded at the end (right) if it's the last child and start (left) if it's the first child
// if the button is in the middle of the group, it shouldn't be rounded
'[&:first-child>button]:!rounded-l-[5px] [&:last-child>button]:!rounded-r-[5px] [&>button]:!rounded-none'
)}
>
{children}
</span>
);
return <span className="input-group-btn">{children}</span>;
}

View file

@ -6,6 +6,19 @@ import { InputGroupButtonWrapper } from './InputGroupButtonWrapper';
interface InputGroupSubComponents {
Addon: typeof InputGroupAddon;
/**
* Should wrap all buttons inside a InputGroup
*
* example:
* ```
* <InputGroup>
* <InputGroup.ButtonWrapper>
* <Button>...</Button>
* <Button>...</Button>
* </InputGroup.ButtonWrapper>
* </InputGroup>
* ```
*/
ButtonWrapper: typeof InputGroupButtonWrapper;
Input: typeof Input;
className: string | undefined;