@producteca/producteca-ui-kit 1.44.4 → 1.45.0
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/draggableList/draggableList.d.js +1 -0
- package/dist/components/draggableList/draggableList.d.ts +5 -0
- package/dist/components/draggableList/draggableList.examples.d.js +1 -0
- package/dist/components/draggableList/draggableList.examples.d.ts +16 -0
- package/dist/components/draggableList/draggableList.types.d.js +1 -0
- package/dist/components/draggableList/draggableList.types.d.ts +23 -0
- package/dist/components/draggableList/draggableRow.d.js +1 -0
- package/dist/components/draggableList/draggableRow.d.ts +15 -0
- package/dist/components/draggableList/index.d.js +2 -0
- package/dist/components/draggableList/index.d.ts +3 -0
- package/dist/components/icons/index.d.js +1 -0
- package/dist/components/icons/index.d.ts +1 -0
- package/dist/components/icons/trashIcon/trashIcon.d.js +1 -0
- package/dist/components/icons/trashIcon/trashIcon.d.ts +5 -0
- package/dist/components/index.d.js +2 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/locales/description.d.ts +1 -0
- package/dist/locales/es.d.ts +30 -0
- package/dist/producteca-ui-kit.es.js +118 -85
- package/dist/producteca-ui-kit.umd.js +9 -8
- package/dist/style.css +1 -1
- package/package.json +16 -13
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SelectFieldProps, SelectOption } from '../inputs/selectField/selectField.types';
|
|
3
|
+
import { DraggableComponentProps } from './draggableList.types';
|
|
4
|
+
import { FormFieldProps } from '../inputs/formField/formField';
|
|
5
|
+
|
|
6
|
+
export type DraggableSelectFieldProps = DraggableComponentProps & Partial<SelectFieldProps> & {
|
|
7
|
+
onItemChange?: (value: string) => void;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export type DraggableFormFieldProps = DraggableComponentProps & Partial<FormFieldProps> & {
|
|
11
|
+
onItemChange?: (value: string) => void;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare const selectOptions: SelectOption[];
|
|
15
|
+
export declare const DraggableSelectField: React.MemoExoticComponent<({ item, onItemChange, ...props }: DraggableSelectFieldProps) => import("react/jsx-runtime").JSX.Element>;
|
|
16
|
+
export declare const DraggableFormField: React.MemoExoticComponent<({ item, onItemChange, ...props }: DraggableFormFieldProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ChangeEvent, ComponentType } from 'react';
|
|
2
|
+
import { ReduxFormInput } from '../../hooks/useReduxFormField';
|
|
3
|
+
|
|
4
|
+
export interface DraggableComponentProps {
|
|
5
|
+
item: DraggableItem;
|
|
6
|
+
onItemChange?: (value: string) => void;
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}
|
|
9
|
+
export interface DraggableItem {
|
|
10
|
+
id: string;
|
|
11
|
+
value?: string;
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}
|
|
14
|
+
export interface DraggableProps {
|
|
15
|
+
addLabel?: string;
|
|
16
|
+
label?: string;
|
|
17
|
+
value?: DraggableItem[];
|
|
18
|
+
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
19
|
+
canRemove?: () => boolean;
|
|
20
|
+
itemComponent?: ComponentType<DraggableComponentProps & Record<string, unknown>>;
|
|
21
|
+
componentProps?: Record<string, unknown>;
|
|
22
|
+
input?: ReduxFormInput;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { DraggableItem, DraggableProps } from './draggableList.types';
|
|
3
|
+
|
|
4
|
+
interface DraggableRowProps {
|
|
5
|
+
isAdding?: boolean;
|
|
6
|
+
item: DraggableItem;
|
|
7
|
+
isRemoving?: boolean;
|
|
8
|
+
onRemove: (id: string) => void;
|
|
9
|
+
canRemove?: () => boolean;
|
|
10
|
+
component?: DraggableProps['itemComponent'];
|
|
11
|
+
componentProps?: Record<string, unknown>;
|
|
12
|
+
onSelectValue: (id: string, value: string) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const DraggableRow: React.MemoExoticComponent<({ item, isAdding, onRemove, canRemove, component, isRemoving, onSelectValue, componentProps, }: DraggableRowProps) => import("react/jsx-runtime").JSX.Element>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -14,3 +14,4 @@ export declare const saveBarExample = "\n #### Uso b\u00E1sico\n ```typescript
|
|
|
14
14
|
export declare const checkboxInputReduxFormExample = "\n #### Ejemplo de uso con Redux Form - CheckboxInput\n \n ```typescript\n <Field\n name=\"salesSync\"\n component={CheckboxInput}\n classComponent={'decrease-stock'}\n props={{\n name: 'cancelSales',\n value: this.salesSync().cancelSales,\n checked: this.salesSync().cancelSales,\n label: this.context.localize('settings.cancelSales')\n }}\n />\n ```\n";
|
|
15
15
|
export declare const breadcrumbItemFormat = "\n ## Formato de BreadcrumbItem\n\n El componente Breadcrumb acepta un array de objetos `BreadcrumbItem` con las siguientes propiedades:\n\n ### Propiedades disponibles:\n\n - **`text`** (string, requerido): El texto que se muestra para el item del breadcrumb\n - **`onClick`** (function, opcional): Funci\u00F3n que se ejecuta al hacer click en el item\n - **`isActive`** (boolean, opcional): Indica si el item est\u00E1 activo. Por defecto, el \u00FAltimo item se considera activo\n - **`href`** (string, opcional): URL del enlace (actualmente no implementado en el renderizado)\n\n ### Comportamiento:\n\n - Los items con `onClick` se renderizan como botones clickeables\n - Los items sin `onClick` se renderizan como texto est\u00E1tico\n - El \u00FAltimo item siempre se considera activo (a menos que se especifique `isActive: true` en otro item)\n - Cada item se separa autom\u00E1ticamente con el s\u00EDmbolo \">\"\n\n ### Ejemplo de uso:\n\n ```tsx\n const breadcrumbItems = [\n { text: 'Dashboard' },\n { text: 'Productos', onClick: () => navigate('/products') },\n { text: 'Detalles', isActive: true }\n ]\n\n <Breadcrumb items={breadcrumbItems} />\n ```\n";
|
|
16
16
|
export declare const menuItems = "Lista de \u00EDtems que se mostrar\u00E1n en el men\u00FA.\n \n**Tipo:** `MenuActionItem[]`\n\n```ts\ninterface MenuActionItem {\n label: React.ReactNode\n icon?: React.ReactElement\n onClick?: () => void\n selected?: boolean\n disabled?: boolean\n}\n```\n";
|
|
17
|
+
export declare const draggableListExample = "\n## Uso del componente\n\nEl componente `DraggableList` permite crear listas de items arrastrables con un componente personalizado para cada item.\n\n### Ejemplo b\u00E1sico:\n\n```tsx\n<DraggableList\n label=\"Seleccionar un deposito\"\n addLabel=\"+ Agregar\"\n itemComponent={SelectField}\n componentProps={{\n placeholder: 'Seleccionar...',\n options: [\n { value: 'option1', label: 'Opci\u00F3n 1' },\n { value: 'option2', label: 'Opci\u00F3n 2' },\n ],\n size: 'md',\n }}\n value={[\n { id: 'item-1', value: 'option1' },\n { id: 'item-2', value: 'option2' },\n ]}\n onChange={(event) => console.log('Items actualizados:', event.target.value)}\n/>\n```\n\n### Ejemplo con Redux Form (Field):\n\n```tsx\n<Field\n name=\"warehouses\"\n component={DraggableList}\n itemComponent={DraggableFormField}\n label=\"Dep\u00F3sitos\"\n addLabel=\"+ Agregar\"\n componentProps={{\n placeholder: 'Nombre del dep\u00F3sito',\n size: 'md',\n type: 'text',\n }}\n/>\n```\n\n";
|
package/dist/locales/es.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ declare const _default: {
|
|
|
18
18
|
loremIpsum: string;
|
|
19
19
|
loremIpsumExtraLarge: string;
|
|
20
20
|
add: string;
|
|
21
|
+
addPlus: string;
|
|
21
22
|
previous: string;
|
|
22
23
|
continue: string;
|
|
23
24
|
cancel: string;
|
|
@@ -91,6 +92,15 @@ declare const _default: {
|
|
|
91
92
|
clickPreviousButton: string;
|
|
92
93
|
clickSaveButtonOnly: string;
|
|
93
94
|
};
|
|
95
|
+
draggableList: {
|
|
96
|
+
example: string;
|
|
97
|
+
itemComponent: string;
|
|
98
|
+
value: string;
|
|
99
|
+
onChange: string;
|
|
100
|
+
addLabel: string;
|
|
101
|
+
label: string;
|
|
102
|
+
componentProps: string;
|
|
103
|
+
};
|
|
94
104
|
formField: {
|
|
95
105
|
example: string;
|
|
96
106
|
isValid: string;
|
|
@@ -158,6 +168,26 @@ declare const _default: {
|
|
|
158
168
|
edit: string;
|
|
159
169
|
customAction: string;
|
|
160
170
|
};
|
|
171
|
+
draggableList: {
|
|
172
|
+
addLabel: string;
|
|
173
|
+
addRow: string;
|
|
174
|
+
placeholder: string;
|
|
175
|
+
textLabel: string;
|
|
176
|
+
nameLabel: string;
|
|
177
|
+
elementLabel: string;
|
|
178
|
+
activeLabel: string;
|
|
179
|
+
enabledLabel: string;
|
|
180
|
+
options: {
|
|
181
|
+
store: string;
|
|
182
|
+
marketplace: string;
|
|
183
|
+
stock: string;
|
|
184
|
+
logistics: string;
|
|
185
|
+
};
|
|
186
|
+
sampleValues: {
|
|
187
|
+
one: string;
|
|
188
|
+
two: string;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
161
191
|
breadcrumb: {
|
|
162
192
|
historyChanges: string;
|
|
163
193
|
products: string;
|