ywana-core8 0.1.84 → 0.1.86
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/__previewjs__/Wrapper.tsx +8 -5
- package/build-doc.sh +10 -0
- package/dist/index.cjs +418 -118
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +294 -94
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +418 -119
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +420 -120
- package/dist/index.umd.js.map +1 -1
- package/doc/README.md +196 -0
- package/doc/package-lock.json +17298 -0
- package/doc/package.json +34 -0
- package/doc/public/index.html +22 -0
- package/doc/scripts/generate-examples.js +129 -0
- package/doc/src/App.css +171 -0
- package/doc/src/App.js +45 -0
- package/doc/src/components/ExamplePage.js +104 -0
- package/doc/src/components/WelcomePage.js +84 -0
- package/doc/src/examples/button.example.js +47 -0
- package/doc/src/examples/input.example.js +91 -0
- package/doc/src/examples-config.js +170 -0
- package/doc/src/index.css +237 -0
- package/doc/src/index.js +13 -0
- package/package.json +9 -2
- package/preview.config.js +38 -0
- package/src/html/accordion.example.js +2 -2
- package/src/html/actions-cell.css +108 -0
- package/src/html/actions-cell.example.js +587 -0
- package/src/html/actions-cell.js +260 -0
- package/src/html/checkbox.example.js +2 -2
- package/src/html/chip.example.js +2 -2
- package/src/html/color.example.js +2 -2
- package/src/html/form.example.js +2 -2
- package/src/html/header2.example.js +2 -2
- package/src/html/index.js +1 -0
- package/src/html/menu.css +9 -2
- package/src/html/menu.js +14 -2
- package/src/html/progress.example.js +2 -2
- package/src/html/property.example.js +2 -2
- package/src/html/radio.example.js +2 -2
- package/src/html/switch.example.js +2 -2
- package/src/html/tab.example.js +2 -2
- package/src/html/table.css +47 -1
- package/src/html/table.example.js +1012 -0
- package/src/html/table.js +12 -7
- package/src/html/table2-actions-test.js +138 -0
- package/src/html/table2.css +40 -3
- package/src/html/table2.example.js +330 -0
- package/src/html/table2.js +56 -13
- package/src/html/tokenfield.example.js +2 -2
- package/src/widgets/calendar/Calendar.js +1 -1
- /package/{ACCORDION_EVALUATION.md → doc/evalulations/ACCORDION_EVALUATION.md} +0 -0
- /package/{CHECKBOX_EVALUATION.md → doc/evalulations/CHECKBOX_EVALUATION.md} +0 -0
- /package/{CHIP_EVALUATION.md → doc/evalulations/CHIP_EVALUATION.md} +0 -0
- /package/{COLOR_EVALUATION.md → doc/evalulations/COLOR_EVALUATION.md} +0 -0
- /package/{COMPONENTS_EVALUATION.md → doc/evalulations/COMPONENTS_EVALUATION.md} +0 -0
- /package/{FORM_EVALUATION.md → doc/evalulations/FORM_EVALUATION.md} +0 -0
- /package/{HEADER_EVALUATION.md → doc/evalulations/HEADER_EVALUATION.md} +0 -0
- /package/{ICON_EVALUATION.md → doc/evalulations/ICON_EVALUATION.md} +0 -0
- /package/{LIST_EVALUATION.md → doc/evalulations/LIST_EVALUATION.md} +0 -0
- /package/{PROGRESS_EVALUATION.md → doc/evalulations/PROGRESS_EVALUATION.md} +0 -0
- /package/{RADIO_EVALUATION.md → doc/evalulations/RADIO_EVALUATION.md} +0 -0
- /package/{RADIO_VISUAL_FIX.md → doc/evalulations/RADIO_VISUAL_FIX.md} +0 -0
- /package/{SECTION_IMPROVEMENTS.md → doc/evalulations/SECTION_IMPROVEMENTS.md} +0 -0
- /package/{SWITCH_EVALUATION.md → doc/evalulations/SWITCH_EVALUATION.md} +0 -0
- /package/{SWITCH_VISUAL_FIX.md → doc/evalulations/SWITCH_VISUAL_FIX.md} +0 -0
- /package/{TAB_EVALUATION.md → doc/evalulations/TAB_EVALUATION.md} +0 -0
- /package/{TEXTFIELD_EVALUATION.md → doc/evalulations/TEXTFIELD_EVALUATION.md} +0 -0
- /package/{TOOLTIP_FIX.md → doc/evalulations/TOOLTIP_FIX.md} +0 -0
- /package/{TREE_EVALUATION.md → doc/evalulations/TREE_EVALUATION.md} +0 -0
- /package/src/incubator/{PDFViewer.js → pdfViewer.js} +0 -0
package/src/html/table2.js
CHANGED
@@ -156,7 +156,6 @@ export const DataTable2 = (props) => {
|
|
156
156
|
|
157
157
|
// Handle tool selection
|
158
158
|
const handleToolSelect = useCallback((toolId) => {
|
159
|
-
console.log('handleToolSelect called with toolId:', toolId)
|
160
159
|
setActiveTool(prev => {
|
161
160
|
const newTool = prev === toolId ? null : toolId
|
162
161
|
console.log('Tool changed from', prev, 'to', newTool)
|
@@ -173,13 +172,13 @@ export const DataTable2 = (props) => {
|
|
173
172
|
const defaultTools = useMemo(() => [
|
174
173
|
{
|
175
174
|
id: 'columns',
|
176
|
-
icon: '
|
175
|
+
icon: 'view_column',
|
177
176
|
title: 'Configurar columnas',
|
178
177
|
component: ColumnsPanel
|
179
178
|
},
|
180
179
|
{
|
181
180
|
id: 'export',
|
182
|
-
icon: '
|
181
|
+
icon: 'ios_share',
|
183
182
|
title: 'Exportar datos',
|
184
183
|
component: ExportPanel
|
185
184
|
},
|
@@ -276,9 +275,13 @@ export const DataTable2 = (props) => {
|
|
276
275
|
className
|
277
276
|
].filter(Boolean).join(' '), [size, density, theme, readability, striped, bordered, hover, loading, skeleton, className])
|
278
277
|
|
279
|
-
// Check if any row has actions column
|
280
|
-
const hasActionsColumn = useMemo(() =>
|
281
|
-
|
278
|
+
// Check if any row has actions column or if there's an actions column defined
|
279
|
+
const hasActionsColumn = useMemo(() => {
|
280
|
+
const hasActionsColumnDefined = columns.some(col => col.id === 'actions')
|
281
|
+
const hasRowsWithActions = rows.some(row => row.actions && Array.isArray(row.actions))
|
282
|
+
const hasRowsWithInfo = rows.some(row => row.info)
|
283
|
+
return hasActionsColumnDefined || hasRowsWithActions || hasRowsWithInfo || filterable
|
284
|
+
}, [columns, rows, filterable])
|
282
285
|
|
283
286
|
// Función de ordenamiento (similar a table.js)
|
284
287
|
const multiSort = useCallback((array, sortObject = {}) => {
|
@@ -782,8 +785,8 @@ const DataTableSummaryRow = ({ columns, rows, showRowNumbers, hasActionsColumn,
|
|
782
785
|
)
|
783
786
|
})}
|
784
787
|
|
785
|
-
{/* Celda para acciones */}
|
786
|
-
{hasActionsColumn && (
|
788
|
+
{/* Celda para acciones - solo cuando no hay columna actions definida */}
|
789
|
+
{hasActionsColumn && !columns.some(col => col.id === 'actions') && (
|
787
790
|
<td className="datatable2__summary-cell datatable2__summary-cell--actions"></td>
|
788
791
|
)}
|
789
792
|
</tr>
|
@@ -1008,8 +1011,9 @@ const DataTableHeader = ({
|
|
1008
1011
|
)
|
1009
1012
|
})}
|
1010
1013
|
|
1011
|
-
{
|
1012
|
-
|
1014
|
+
{/* Cabecera de acciones solo cuando no hay columna actions definida pero sí hay info o filterable */}
|
1015
|
+
{hasActionsColumn && !columns.some(col => col.id === 'actions') && (
|
1016
|
+
<th className="datatable2__actions-header"></th>
|
1013
1017
|
)}
|
1014
1018
|
</tr>
|
1015
1019
|
|
@@ -1299,6 +1303,42 @@ const DataTableRow = ({
|
|
1299
1303
|
)
|
1300
1304
|
}
|
1301
1305
|
|
1306
|
+
// Manejar columna "actions" de manera especial
|
1307
|
+
if (column.id === 'actions') {
|
1308
|
+
return (
|
1309
|
+
<td key={column.id} className="datatable2__actions-cell">
|
1310
|
+
{/* Renderizar componentes React del array actions */}
|
1311
|
+
{row.actions && Array.isArray(row.actions) && (
|
1312
|
+
<div className="datatable2__actions-container">
|
1313
|
+
{row.actions.map((action, index) => (
|
1314
|
+
<span key={index} className="datatable2__action-item">
|
1315
|
+
{action}
|
1316
|
+
</span>
|
1317
|
+
))}
|
1318
|
+
</div>
|
1319
|
+
)}
|
1320
|
+
|
1321
|
+
{/* Icono de expansión para info (solo si no hay actions o si hay espacio) */}
|
1322
|
+
{row.info && (
|
1323
|
+
<Icon
|
1324
|
+
icon={isExpanded ? "expand_less" : "expand_more"}
|
1325
|
+
size="small"
|
1326
|
+
clickable
|
1327
|
+
action={() => {
|
1328
|
+
if (row.info && typeof row.info === 'object' && row.info.action) {
|
1329
|
+
row.info.action(row)
|
1330
|
+
}
|
1331
|
+
if (onRowExpand) {
|
1332
|
+
onRowExpand(row.id)
|
1333
|
+
}
|
1334
|
+
}}
|
1335
|
+
className="datatable2__expand-icon"
|
1336
|
+
/>
|
1337
|
+
)}
|
1338
|
+
</td>
|
1339
|
+
)
|
1340
|
+
}
|
1341
|
+
|
1302
1342
|
return (
|
1303
1343
|
<DataTableCell
|
1304
1344
|
key={column.id}
|
@@ -1314,8 +1354,10 @@ const DataTableRow = ({
|
|
1314
1354
|
)
|
1315
1355
|
})}
|
1316
1356
|
|
1317
|
-
{
|
1357
|
+
{/* Celda de acciones adicional cuando no hay columna actions definida pero sí hay info o filterable */}
|
1358
|
+
{hasActionsColumn && !columns.some(col => col.id === 'actions') && (
|
1318
1359
|
<td className="datatable2__actions-cell">
|
1360
|
+
{/* Icono de expansión para info */}
|
1319
1361
|
{row.info && (
|
1320
1362
|
<Icon
|
1321
1363
|
icon={isExpanded ? "expand_less" : "expand_more"}
|
@@ -1329,6 +1371,7 @@ const DataTableRow = ({
|
|
1329
1371
|
onRowExpand(row.id)
|
1330
1372
|
}
|
1331
1373
|
}}
|
1374
|
+
className="datatable2__expand-icon"
|
1332
1375
|
/>
|
1333
1376
|
)}
|
1334
1377
|
</td>
|
@@ -1513,8 +1556,8 @@ const DataTableFiltersRow = ({ columns, onClear, showRowNumbers, hasActionsColum
|
|
1513
1556
|
</td>
|
1514
1557
|
))}
|
1515
1558
|
|
1516
|
-
{/* Celda para acciones con botón de limpiar */}
|
1517
|
-
{hasActionsColumn && (
|
1559
|
+
{/* Celda para acciones con botón de limpiar - solo cuando no hay columna actions definida */}
|
1560
|
+
{hasActionsColumn && !columns.some(col => col.id === 'actions') && (
|
1518
1561
|
<td className="datatable2__filter-cell datatable2__filter-cell--actions">
|
1519
1562
|
<Icon
|
1520
1563
|
icon="close"
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import React, { useState } from 'react'
|
2
2
|
import { TokenField } from './tokenfield'
|
3
3
|
import { Button } from './button'
|
4
|
-
import { Text } from '
|
5
|
-
import { ExampleLayout, ExampleSection, ExampleSubsection, CodeSnippet } from './ExampleLayout'
|
4
|
+
import { Text } from './text'
|
5
|
+
import { ExampleLayout, ExampleSection, ExampleSubsection, CodeSnippet } from './ExampleLayout'
|
6
6
|
|
7
7
|
/**
|
8
8
|
* Ejemplos del componente TokenField mejorado manteniendo 100% compatibilidad
|
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react'
|
|
2
2
|
import { Button, Text } from '../../html'
|
3
3
|
import Moment from 'moment'
|
4
4
|
import { extendMoment } from 'moment-range';
|
5
|
-
import 'moment/locale/es'
|
5
|
+
import 'moment/locale/es.js'
|
6
6
|
import './Calendar.css'
|
7
7
|
|
8
8
|
Moment.locale('es')
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|