ywana-core8 0.1.84 → 0.1.85

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.
Files changed (72) hide show
  1. package/__previewjs__/Wrapper.tsx +8 -5
  2. package/build-doc.sh +10 -0
  3. package/dist/index.cjs +418 -118
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.css +294 -94
  6. package/dist/index.css.map +1 -1
  7. package/dist/index.modern.js +418 -119
  8. package/dist/index.modern.js.map +1 -1
  9. package/dist/index.umd.js +420 -120
  10. package/dist/index.umd.js.map +1 -1
  11. package/doc/README.md +196 -0
  12. package/doc/craco.config.js +31 -0
  13. package/doc/generate-examples.cjs +310 -0
  14. package/doc/package-lock.json +17298 -0
  15. package/doc/package.json +33 -0
  16. package/doc/public/index.html +22 -0
  17. package/doc/src/App.css +171 -0
  18. package/doc/src/App.js +214 -0
  19. package/doc/src/components/ExamplePage.js +104 -0
  20. package/doc/src/components/WelcomePage.js +84 -0
  21. package/doc/src/examples/button.example.js +47 -0
  22. package/doc/src/examples/input.example.js +91 -0
  23. package/doc/src/index.css +237 -0
  24. package/doc/src/index.js +11 -0
  25. package/package.json +9 -2
  26. package/preview.config.js +38 -0
  27. package/src/html/accordion.example.js +2 -2
  28. package/src/html/actions-cell.css +108 -0
  29. package/src/html/actions-cell.example.js +587 -0
  30. package/src/html/actions-cell.js +260 -0
  31. package/src/html/checkbox.example.js +2 -2
  32. package/src/html/chip.example.js +2 -2
  33. package/src/html/color.example.js +2 -2
  34. package/src/html/form.example.js +2 -2
  35. package/src/html/header2.example.js +2 -2
  36. package/src/html/index.js +1 -0
  37. package/src/html/menu.css +9 -2
  38. package/src/html/menu.js +14 -2
  39. package/src/html/progress.example.js +2 -2
  40. package/src/html/property.example.js +2 -2
  41. package/src/html/radio.example.js +2 -2
  42. package/src/html/switch.example.js +2 -2
  43. package/src/html/tab.example.js +2 -2
  44. package/src/html/table.css +47 -1
  45. package/src/html/table.example.js +1012 -0
  46. package/src/html/table.js +12 -7
  47. package/src/html/table2-actions-test.js +138 -0
  48. package/src/html/table2.css +40 -3
  49. package/src/html/table2.example.js +330 -0
  50. package/src/html/table2.js +56 -13
  51. package/src/html/tokenfield.example.js +2 -2
  52. package/src/widgets/calendar/Calendar.js +1 -1
  53. /package/{ACCORDION_EVALUATION.md → doc/evalulations/ACCORDION_EVALUATION.md} +0 -0
  54. /package/{CHECKBOX_EVALUATION.md → doc/evalulations/CHECKBOX_EVALUATION.md} +0 -0
  55. /package/{CHIP_EVALUATION.md → doc/evalulations/CHIP_EVALUATION.md} +0 -0
  56. /package/{COLOR_EVALUATION.md → doc/evalulations/COLOR_EVALUATION.md} +0 -0
  57. /package/{COMPONENTS_EVALUATION.md → doc/evalulations/COMPONENTS_EVALUATION.md} +0 -0
  58. /package/{FORM_EVALUATION.md → doc/evalulations/FORM_EVALUATION.md} +0 -0
  59. /package/{HEADER_EVALUATION.md → doc/evalulations/HEADER_EVALUATION.md} +0 -0
  60. /package/{ICON_EVALUATION.md → doc/evalulations/ICON_EVALUATION.md} +0 -0
  61. /package/{LIST_EVALUATION.md → doc/evalulations/LIST_EVALUATION.md} +0 -0
  62. /package/{PROGRESS_EVALUATION.md → doc/evalulations/PROGRESS_EVALUATION.md} +0 -0
  63. /package/{RADIO_EVALUATION.md → doc/evalulations/RADIO_EVALUATION.md} +0 -0
  64. /package/{RADIO_VISUAL_FIX.md → doc/evalulations/RADIO_VISUAL_FIX.md} +0 -0
  65. /package/{SECTION_IMPROVEMENTS.md → doc/evalulations/SECTION_IMPROVEMENTS.md} +0 -0
  66. /package/{SWITCH_EVALUATION.md → doc/evalulations/SWITCH_EVALUATION.md} +0 -0
  67. /package/{SWITCH_VISUAL_FIX.md → doc/evalulations/SWITCH_VISUAL_FIX.md} +0 -0
  68. /package/{TAB_EVALUATION.md → doc/evalulations/TAB_EVALUATION.md} +0 -0
  69. /package/{TEXTFIELD_EVALUATION.md → doc/evalulations/TEXTFIELD_EVALUATION.md} +0 -0
  70. /package/{TOOLTIP_FIX.md → doc/evalulations/TOOLTIP_FIX.md} +0 -0
  71. /package/{TREE_EVALUATION.md → doc/evalulations/TREE_EVALUATION.md} +0 -0
  72. /package/src/incubator/{PDFViewer.js → pdfViewer.js} +0 -0
package/dist/index.umd.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('material-design-icons-iconfont/dist/material-design-icons.css'), require('react'), require('resumablejs'), require('react-switch'), require('react-notifications-component'), require('react-notifications-component/dist/theme.css'), require('moment'), require('moment-range'), require('moment/locale/es'), require('axios'), require('deep-equal')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'material-design-icons-iconfont/dist/material-design-icons.css', 'react', 'resumablejs', 'react-switch', 'react-notifications-component', 'react-notifications-component/dist/theme.css', 'moment', 'moment-range', 'moment/locale/es', 'axios', 'deep-equal'], factory) :
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('material-design-icons-iconfont/dist/material-design-icons.css'), require('react'), require('resumablejs'), require('react-switch'), require('react-notifications-component'), require('react-notifications-component/dist/theme.css'), require('moment'), require('moment-range'), require('moment/locale/es.js'), require('axios'), require('deep-equal')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'material-design-icons-iconfont/dist/material-design-icons.css', 'react', 'resumablejs', 'react-switch', 'react-notifications-component', 'react-notifications-component/dist/theme.css', 'moment', 'moment-range', 'moment/locale/es.js', 'axios', 'deep-equal'], factory) :
4
4
  (global = global || self, factory(global.ywanaCore8 = {}, null, global.react, global.resumablejs, global.reactSwitch, global.reactNotificationsComponent, null, global.moment, global.momentRange, null, global.axios, global.deepEqual));
5
- })(this, (function (exports, materialDesignIcons_css, React, ResumableJS, RSwitch, reactNotificationsComponent, theme_css, moment$1, momentRange, es, axios, equal) {
5
+ })(this, (function (exports, materialDesignIcons_css, React, ResumableJS, RSwitch, reactNotificationsComponent, theme_css, moment$1, momentRange, es_js, axios, equal) {
6
6
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
7
7
 
8
8
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
@@ -1350,7 +1350,7 @@
1350
1350
  */
1351
1351
  var SiteContext = React__default["default"].createContext({});
1352
1352
 
1353
- var _excluded$h = ["format", "children", "className", "size", "weight", "color", "align", "transform", "decoration", "truncate", "maxLength", "locale", "currency", "minimumFractionDigits", "maximumFractionDigits", "dateStyle", "timeStyle", "fallback", "loading", "skeleton", "copyable", "selectable", "as", "style", "onClick"];
1353
+ var _excluded$i = ["format", "children", "className", "size", "weight", "color", "align", "transform", "decoration", "truncate", "maxLength", "locale", "currency", "minimumFractionDigits", "maximumFractionDigits", "dateStyle", "timeStyle", "fallback", "loading", "skeleton", "copyable", "selectable", "as", "style", "onClick"];
1354
1354
  function _catch$d(body, recover) {
1355
1355
  try {
1356
1356
  var result = body();
@@ -1421,7 +1421,7 @@
1421
1421
  as = _props$as === void 0 ? 'span' : _props$as,
1422
1422
  style = props.style,
1423
1423
  onClick = props.onClick,
1424
- restProps = _objectWithoutPropertiesLoose(props, _excluded$h);
1424
+ restProps = _objectWithoutPropertiesLoose(props, _excluded$i);
1425
1425
  var site = React.useContext(SiteContext);
1426
1426
 
1427
1427
  // Memoize formatted value for performance
@@ -1807,7 +1807,7 @@
1807
1807
  className: ''
1808
1808
  };
1809
1809
 
1810
- var _excluded$g = ["className", "sections", "disabled", "allowMultiple", "animated", "onCheck", "onToggle", "onSectionChange", "ariaLabel"],
1810
+ var _excluded$h = ["className", "sections", "disabled", "allowMultiple", "animated", "onCheck", "onToggle", "onSectionChange", "ariaLabel"],
1811
1811
  _excluded2$9 = ["checked", "icon", "title", "subtitle", "open", "disabled", "animated", "sectionIndex", "onToggle", "onCheck", "toolbar", "info", "children", "ariaLabel"];
1812
1812
 
1813
1813
  /**
@@ -1827,7 +1827,7 @@
1827
1827
  onToggle = props.onToggle,
1828
1828
  onSectionChange = props.onSectionChange,
1829
1829
  ariaLabel = props.ariaLabel,
1830
- restProps = _objectWithoutPropertiesLoose(props, _excluded$g);
1830
+ restProps = _objectWithoutPropertiesLoose(props, _excluded$h);
1831
1831
  var _useState = React.useState([]),
1832
1832
  openSections = _useState[0],
1833
1833
  setOpenSections = _useState[1];
@@ -2073,6 +2073,340 @@
2073
2073
  animated: true
2074
2074
  };
2075
2075
 
2076
+ /**
2077
+ * Page Context
2078
+ */
2079
+ var MenuContext = React__default["default"].createContext({});
2080
+
2081
+ /**
2082
+ * Menu
2083
+ **/
2084
+ var Menu = function Menu(props) {
2085
+ var children = props.children;
2086
+ return /*#__PURE__*/React__default["default"].createElement("ul", null, children);
2087
+ };
2088
+
2089
+ /**
2090
+ * Menu Icon
2091
+ */
2092
+ var MenuIcon = function MenuIcon(props) {
2093
+ var _props$icon = props.icon,
2094
+ icon = _props$icon === void 0 ? "more_vert" : _props$icon,
2095
+ children = props.children,
2096
+ _props$align = props.align,
2097
+ align = _props$align === void 0 ? "left" : _props$align,
2098
+ _props$size = props.size,
2099
+ size = _props$size === void 0 ? "normal" : _props$size;
2100
+ var _useState = React.useState(false),
2101
+ open = _useState[0],
2102
+ setOpen = _useState[1];
2103
+ function toggle() {
2104
+ setOpen(!open);
2105
+ }
2106
+
2107
+ // Convertir valores de align a clases CSS
2108
+ var getAlignClass = function getAlignClass(alignment) {
2109
+ switch (alignment) {
2110
+ case 'right':
2111
+ return 'alignRight';
2112
+ case 'left':
2113
+ return 'alignLeft';
2114
+ default:
2115
+ return 'alignLeft';
2116
+ // Por defecto a la izquierda
2117
+ }
2118
+ };
2119
+ return /*#__PURE__*/React__default["default"].createElement(MenuContext.Provider, {
2120
+ value: [open, setOpen]
2121
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
2122
+ className: "menu-icon"
2123
+ }, /*#__PURE__*/React__default["default"].createElement(Icon, {
2124
+ icon: icon,
2125
+ size: size,
2126
+ clickable: true,
2127
+ action: toggle
2128
+ }), open ? /*#__PURE__*/React__default["default"].createElement("menu", {
2129
+ className: getAlignClass(align)
2130
+ }, children) : null, open ? /*#__PURE__*/React__default["default"].createElement("div", {
2131
+ className: "overlay",
2132
+ onClick: toggle
2133
+ }) : null));
2134
+ };
2135
+
2136
+ /**
2137
+ * Menu Item
2138
+ */
2139
+ var MenuItem = function MenuItem(props) {
2140
+ var icon = props.icon,
2141
+ label = props.label,
2142
+ meta = props.meta,
2143
+ _props$disabled = props.disabled,
2144
+ disabled = _props$disabled === void 0 ? false : _props$disabled,
2145
+ _props$size2 = props.size,
2146
+ size = _props$size2 === void 0 ? "normal" : _props$size2,
2147
+ onSelect = props.onSelect;
2148
+ var _useContext = React.useContext(MenuContext),
2149
+ setOpen = _useContext[1];
2150
+ function select() {
2151
+ if (!disabled) {
2152
+ if (onSelect) onSelect();
2153
+ setOpen(false);
2154
+ }
2155
+ }
2156
+ var style = disabled ? "disabled" : "";
2157
+ var labelTxt = label ? /*#__PURE__*/React__default["default"].createElement(Text, {
2158
+ format: TEXTFORMATS.STRING
2159
+ }, label) : null;
2160
+ return /*#__PURE__*/React__default["default"].createElement("li", {
2161
+ className: "menu-item " + style,
2162
+ onClick: select
2163
+ }, icon ? /*#__PURE__*/React__default["default"].createElement(Icon, {
2164
+ icon: icon,
2165
+ size: size
2166
+ }) : null, /*#__PURE__*/React__default["default"].createElement("label", null, labelTxt), meta ? /*#__PURE__*/React__default["default"].createElement("div", {
2167
+ className: "meta"
2168
+ }, meta) : null);
2169
+ };
2170
+
2171
+ /**
2172
+ * Menu Separator
2173
+ */
2174
+ var MenuSeparator = function MenuSeparator(props) {
2175
+ return /*#__PURE__*/React__default["default"].createElement("li", {
2176
+ className: "menu-separator"
2177
+ });
2178
+ };
2179
+
2180
+ var _excluded$g = ["actions", "maxWidth", "menuIcon", "menuAlign", "menuSize", "className", "style", "gap"];
2181
+
2182
+ /**
2183
+ * ActionsCell - Componente reutilizable para manejar acciones con overflow automático
2184
+ *
2185
+ * Características:
2186
+ * - Detecta automáticamente si las acciones exceden el ancho máximo
2187
+ * - Convierte automáticamente a menú desplegable cuando es necesario
2188
+ * - Extrae acciones de componentes React para crear elementos de menú
2189
+ * - Reutilizable en tablas, headers, accordions, listas, etc.
2190
+ */
2191
+ var ActionsCell = function ActionsCell(_ref) {
2192
+ var actions = _ref.actions,
2193
+ _ref$maxWidth = _ref.maxWidth,
2194
+ maxWidth = _ref$maxWidth === void 0 ? 200 : _ref$maxWidth,
2195
+ _ref$menuIcon = _ref.menuIcon,
2196
+ menuIcon = _ref$menuIcon === void 0 ? "more_horiz" : _ref$menuIcon,
2197
+ _ref$menuAlign = _ref.menuAlign,
2198
+ menuAlign = _ref$menuAlign === void 0 ? "left" : _ref$menuAlign,
2199
+ _ref$menuSize = _ref.menuSize,
2200
+ menuSize = _ref$menuSize === void 0 ? "small" : _ref$menuSize,
2201
+ _ref$className = _ref.className,
2202
+ className = _ref$className === void 0 ? "" : _ref$className,
2203
+ _ref$style = _ref.style,
2204
+ style = _ref$style === void 0 ? {} : _ref$style,
2205
+ _ref$gap = _ref.gap,
2206
+ gap = _ref$gap === void 0 ? "4px" : _ref$gap,
2207
+ restProps = _objectWithoutPropertiesLoose(_ref, _excluded$g);
2208
+ var _useState = React.useState(false),
2209
+ isOverflowing = _useState[0],
2210
+ setIsOverflowing = _useState[1];
2211
+ var _useState2 = React.useState(false),
2212
+ isReady = _useState2[0],
2213
+ setIsReady = _useState2[1];
2214
+ var actionsRef = React.useRef(null);
2215
+ var containerRef = React.useRef(null);
2216
+
2217
+ // Check if actions overflow the max width
2218
+ React.useEffect(function () {
2219
+ var checkOverflow = function checkOverflow() {
2220
+ if (actions) {
2221
+ try {
2222
+ // Create a temporary element to measure the actual width needed
2223
+ var tempDiv = document.createElement('div');
2224
+ tempDiv.style.cssText = "\n position: absolute;\n visibility: hidden;\n white-space: nowrap;\n display: flex;\n align-items: center;\n gap: " + gap + ";\n pointer-events: none;\n z-index: -1000;\n top: -1000px;\n left: -1000px;\n ";
2225
+
2226
+ // Create a wrapper to render the actions
2227
+ var actionsWrapper = document.createElement('div');
2228
+ actionsWrapper.style.cssText = "\n display: flex;\n align-items: center;\n gap: " + gap + ";\n flex-wrap: nowrap;\n ";
2229
+
2230
+ // We need to render the React element to measure it properly
2231
+ // For now, we'll use a heuristic based on the number of actions
2232
+ var estimatedWidth = 0;
2233
+ if (actions.props && actions.props.children) {
2234
+ var children = Array.isArray(actions.props.children) ? actions.props.children : [actions.props.children];
2235
+ children.forEach(function (child) {
2236
+ if (child && child.props) {
2237
+ // Estimate width based on button content
2238
+ var hasText = child.props.children && typeof child.props.children === 'string';
2239
+ var textLength = hasText ? child.props.children.length : 0;
2240
+ if (hasText) {
2241
+ // Button with text: ~8px per character + 32px for icon + padding
2242
+ estimatedWidth += textLength * 8 + 32 + 16;
2243
+ } else {
2244
+ // Icon-only button: ~32px + padding
2245
+ estimatedWidth += 32 + 8;
2246
+ }
2247
+ }
2248
+ });
2249
+
2250
+ // Add gap between buttons
2251
+ var gapWidth = parseInt(gap) || 4;
2252
+ estimatedWidth += (children.length - 1) * gapWidth;
2253
+ } else {
2254
+ // Single action
2255
+ var hasText = actions.props && actions.props.children && typeof actions.props.children === 'string';
2256
+ var textLength = hasText ? actions.props.children.length : 0;
2257
+ if (hasText) {
2258
+ estimatedWidth = textLength * 8 + 32 + 16;
2259
+ } else {
2260
+ estimatedWidth = 32 + 8;
2261
+ }
2262
+ }
2263
+
2264
+ // Check if it overflows the max width (with some padding for safety)
2265
+ var shouldOverflow = estimatedWidth > maxWidth - 8; // 8px for container padding
2266
+ setIsOverflowing(shouldOverflow);
2267
+ setIsReady(true);
2268
+ } catch (error) {
2269
+ console.warn('ActionsCell: Error measuring width', error);
2270
+ setIsOverflowing(false);
2271
+ setIsReady(true);
2272
+ }
2273
+ } else {
2274
+ setIsReady(true);
2275
+ }
2276
+ };
2277
+
2278
+ // Use a small delay to ensure DOM is ready
2279
+ var timer = setTimeout(checkOverflow, 10);
2280
+ return function () {
2281
+ return clearTimeout(timer);
2282
+ };
2283
+ }, [actions, maxWidth, gap]);
2284
+
2285
+ // Extract action items from React elements for menu
2286
+ var extractActionItems = function extractActionItems(actionsElement) {
2287
+ if (!actionsElement) return [];
2288
+ var items = [];
2289
+ try {
2290
+ // If it's a div with children (multiple actions)
2291
+ if (actionsElement.props && actionsElement.props.children) {
2292
+ var children = Array.isArray(actionsElement.props.children) ? actionsElement.props.children : [actionsElement.props.children];
2293
+ children.forEach(function (child, index) {
2294
+ if (child && child.props) {
2295
+ var _child$props = child.props,
2296
+ icon = _child$props.icon,
2297
+ label = _child$props.children,
2298
+ onClick = _child$props.onClick,
2299
+ disabled = _child$props.disabled,
2300
+ title = _child$props.title;
2301
+ items.push({
2302
+ id: "action-" + index,
2303
+ icon: icon,
2304
+ label: title || label || "Action " + (index + 1),
2305
+ onSelect: onClick,
2306
+ disabled: disabled
2307
+ });
2308
+ }
2309
+ });
2310
+ } else if (actionsElement.props) {
2311
+ // Single action
2312
+ var _actionsElement$props = actionsElement.props,
2313
+ icon = _actionsElement$props.icon,
2314
+ label = _actionsElement$props.children,
2315
+ onClick = _actionsElement$props.onClick,
2316
+ disabled = _actionsElement$props.disabled,
2317
+ title = _actionsElement$props.title;
2318
+ items.push({
2319
+ id: 'action-0',
2320
+ icon: icon,
2321
+ label: title || label || 'Action',
2322
+ onSelect: onClick,
2323
+ disabled: disabled
2324
+ });
2325
+ }
2326
+ } catch (error) {
2327
+ console.warn('ActionsCell: Error extracting action items', error);
2328
+ }
2329
+ return items;
2330
+ };
2331
+ if (!actions) return null;
2332
+ var containerClasses = ['actions-cell', className].filter(Boolean).join(' ');
2333
+ var containerStyles = _extends({
2334
+ maxWidth: maxWidth + "px",
2335
+ width: isOverflowing ? 'auto' : 'fit-content'
2336
+ }, style);
2337
+ return /*#__PURE__*/React__default["default"].createElement("div", _extends({
2338
+ ref: containerRef,
2339
+ className: containerClasses,
2340
+ style: containerStyles
2341
+ }, restProps), !isReady ?
2342
+ /*#__PURE__*/
2343
+ // Loading state - show a minimal placeholder
2344
+ React__default["default"].createElement("div", {
2345
+ className: "actions-cell__loading",
2346
+ style: {
2347
+ width: '48px',
2348
+ height: '32px'
2349
+ }
2350
+ }) : !isOverflowing ?
2351
+ /*#__PURE__*/
2352
+ // Show actions normally
2353
+ React__default["default"].createElement("div", {
2354
+ ref: actionsRef,
2355
+ className: "actions-cell__content",
2356
+ style: {
2357
+ display: 'flex',
2358
+ alignItems: 'center',
2359
+ gap: gap,
2360
+ flexWrap: 'nowrap'
2361
+ }
2362
+ }, actions) :
2363
+ /*#__PURE__*/
2364
+ // Show menu when overflowing
2365
+ React__default["default"].createElement(Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
2366
+ ref: actionsRef,
2367
+ style: {
2368
+ position: 'absolute',
2369
+ visibility: 'hidden',
2370
+ whiteSpace: 'nowrap',
2371
+ display: 'flex',
2372
+ alignItems: 'center',
2373
+ gap: gap,
2374
+ pointerEvents: 'none',
2375
+ zIndex: -1000
2376
+ }
2377
+ }, actions), /*#__PURE__*/React__default["default"].createElement(MenuIcon, {
2378
+ icon: menuIcon,
2379
+ size: menuSize,
2380
+ align: menuAlign
2381
+ }, extractActionItems(actions).map(function (item) {
2382
+ return /*#__PURE__*/React__default["default"].createElement(MenuItem, {
2383
+ key: item.id,
2384
+ icon: item.icon,
2385
+ label: item.label,
2386
+ onSelect: item.onSelect,
2387
+ disabled: item.disabled
2388
+ });
2389
+ }))));
2390
+ };
2391
+ ActionsCell.propTypes = {
2392
+ /** Acciones a mostrar (componentes React) */
2393
+ actions: PropTypes.node,
2394
+ /** Ancho máximo antes de convertirse en menú */
2395
+ maxWidth: PropTypes.number,
2396
+ /** Icono del menú desplegable */
2397
+ menuIcon: PropTypes.string,
2398
+ /** Alineación del menú (left: se abre hacia la izquierda, right: hacia la derecha, center: centrado) */
2399
+ menuAlign: PropTypes.oneOf(['left', 'right', 'center']),
2400
+ /** Tamaño del icono del menú */
2401
+ menuSize: PropTypes.oneOf(['small', 'medium', 'large']),
2402
+ /** Clase CSS adicional */
2403
+ className: PropTypes.string,
2404
+ /** Estilos adicionales */
2405
+ style: PropTypes.object,
2406
+ /** Espacio entre acciones */
2407
+ gap: PropTypes.string
2408
+ };
2409
+
2076
2410
  var _excluded$f = ["id", "label", "icon", "action", "disabled", "loading", "outlined", "raised", "size", "type", "className", "ariaLabel", "tooltip", "form", "onClick", "onFocus", "onBlur", "onKeyDown"],
2077
2411
  _excluded2$8 = ["states", "state", "className", "disabled", "onStateChange"];
2078
2412
  function _catch$c(body, recover) {
@@ -4865,96 +5199,6 @@
4865
5199
  role: 'list'
4866
5200
  };
4867
5201
 
4868
- /**
4869
- * Page Context
4870
- */
4871
- var MenuContext = React__default["default"].createContext({});
4872
-
4873
- /**
4874
- * Menu
4875
- **/
4876
- var Menu = function Menu(props) {
4877
- var children = props.children;
4878
- return /*#__PURE__*/React__default["default"].createElement("ul", null, children);
4879
- };
4880
-
4881
- /**
4882
- * Menu Icon
4883
- */
4884
- var MenuIcon = function MenuIcon(props) {
4885
- var _props$icon = props.icon,
4886
- icon = _props$icon === void 0 ? "more_vert" : _props$icon,
4887
- children = props.children,
4888
- align = props.align,
4889
- _props$size = props.size,
4890
- size = _props$size === void 0 ? "normal" : _props$size;
4891
- var _useState = React.useState(false),
4892
- open = _useState[0],
4893
- setOpen = _useState[1];
4894
- function toggle() {
4895
- setOpen(!open);
4896
- }
4897
- return /*#__PURE__*/React__default["default"].createElement(MenuContext.Provider, {
4898
- value: [open, setOpen]
4899
- }, /*#__PURE__*/React__default["default"].createElement("div", {
4900
- className: "menu-icon"
4901
- }, /*#__PURE__*/React__default["default"].createElement(Icon, {
4902
- icon: icon,
4903
- size: size,
4904
- clickable: true,
4905
- action: toggle
4906
- }), open ? /*#__PURE__*/React__default["default"].createElement("menu", {
4907
- className: "" + align
4908
- }, children) : null, open ? /*#__PURE__*/React__default["default"].createElement("div", {
4909
- className: "overlay",
4910
- onClick: toggle
4911
- }) : null));
4912
- };
4913
-
4914
- /**
4915
- * Menu Item
4916
- */
4917
- var MenuItem = function MenuItem(props) {
4918
- var icon = props.icon,
4919
- label = props.label,
4920
- meta = props.meta,
4921
- _props$disabled = props.disabled,
4922
- disabled = _props$disabled === void 0 ? false : _props$disabled,
4923
- _props$size2 = props.size,
4924
- size = _props$size2 === void 0 ? "normal" : _props$size2,
4925
- onSelect = props.onSelect;
4926
- var _useContext = React.useContext(MenuContext),
4927
- setOpen = _useContext[1];
4928
- function select() {
4929
- if (!disabled) {
4930
- if (onSelect) onSelect();
4931
- setOpen(false);
4932
- }
4933
- }
4934
- var style = disabled ? "disabled" : "";
4935
- var labelTxt = label ? /*#__PURE__*/React__default["default"].createElement(Text, {
4936
- format: TEXTFORMATS.STRING
4937
- }, label) : null;
4938
- return /*#__PURE__*/React__default["default"].createElement("li", {
4939
- className: "menu-item " + style,
4940
- onClick: select
4941
- }, icon ? /*#__PURE__*/React__default["default"].createElement(Icon, {
4942
- icon: icon,
4943
- size: size
4944
- }) : null, /*#__PURE__*/React__default["default"].createElement("label", null, labelTxt), meta ? /*#__PURE__*/React__default["default"].createElement("div", {
4945
- className: "meta"
4946
- }, meta) : null);
4947
- };
4948
-
4949
- /**
4950
- * Menu Separator
4951
- */
4952
- var MenuSeparator = function MenuSeparator(props) {
4953
- return /*#__PURE__*/React__default["default"].createElement("li", {
4954
- className: "menu-separator"
4955
- });
4956
- };
4957
-
4958
5202
  var _excluded$9 = ["id", "className", "label", "name", "initial", "value", "editable", "onChange", "options", "type", "disabled", "required", "placeholder", "multiline", "rows", "maxLength", "minLength", "pattern", "validateValue", "size", "variant", "layout", "nameWidth", "copyable", "error", "helperText", "onFocus", "onBlur", "onValidationError", "clearable", "readOnly", "loading", "skeleton", "style"];
4959
5203
  function _catch$a(body, recover) {
4960
5204
  try {
@@ -6563,6 +6807,11 @@
6563
6807
  var _useState2 = React.useState(false),
6564
6808
  allChecked = _useState2[0],
6565
6809
  setAllChecked = _useState2[1];
6810
+
6811
+ // Detectar si alguna fila tiene info para mostrar la columna de expansión
6812
+ var hasInfoRows = rows.some(function (row) {
6813
+ return row.info;
6814
+ });
6566
6815
  function changeSort(id) {
6567
6816
  if (multisort) {
6568
6817
  var _Object$assign;
@@ -6643,15 +6892,16 @@
6643
6892
  }).length] : [2, 1],
6644
6893
  rowspan = _ref2[0],
6645
6894
  colspan = _ref2[1];
6895
+ var headerClasses = (resizableStyle + " " + id).trim();
6646
6896
  return /*#__PURE__*/React__default["default"].createElement("th", {
6647
6897
  key: id,
6648
- className: resizableStyle,
6898
+ className: headerClasses,
6649
6899
  rowSpan: rowspan,
6650
6900
  colSpan: colspan
6651
6901
  }, /*#__PURE__*/React__default["default"].createElement("div", null, id === "checked" && onCheckAll ? /*#__PURE__*/React__default["default"].createElement(CheckBox, {
6652
6902
  onChange: checkAll,
6653
6903
  value: allChecked
6654
- }) : /*#__PURE__*/React__default["default"].createElement(Text, {
6904
+ }) : id === "actions" ? null : /*#__PURE__*/React__default["default"].createElement(Text, {
6655
6905
  key: "th_" + id
6656
6906
  }, label), sortable ? /*#__PURE__*/React__default["default"].createElement(SortIcon, {
6657
6907
  sortDir: sortDir[id],
@@ -6659,10 +6909,13 @@
6659
6909
  return changeSort(id);
6660
6910
  }
6661
6911
  }) : null));
6662
- }), /*#__PURE__*/React__default["default"].createElement("th", {
6912
+ }), hasInfoRows ? /*#__PURE__*/React__default["default"].createElement("th", {
6663
6913
  rowSpan: 2,
6664
- colSpan: 1
6665
- })), /*#__PURE__*/React__default["default"].createElement("tr", null, columns.filter(function (_ref3) {
6914
+ colSpan: 1,
6915
+ style: {
6916
+ width: '3rem'
6917
+ }
6918
+ }) : null), /*#__PURE__*/React__default["default"].createElement("tr", null, columns.filter(function (_ref3) {
6666
6919
  var type = _ref3.type;
6667
6920
  return type === TYPES$1.ENTITY;
6668
6921
  }).map(function (column) {
@@ -6685,7 +6938,8 @@
6685
6938
  onSelect: select,
6686
6939
  onDrop: moveRow,
6687
6940
  editable: editable,
6688
- expanded: expanded
6941
+ expanded: expanded,
6942
+ hasInfoRows: hasInfoRows
6689
6943
  });
6690
6944
  }) : /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", {
6691
6945
  colSpan: 1000
@@ -6766,7 +7020,9 @@
6766
7020
  onSelect = props.onSelect,
6767
7021
  editable = props.editable,
6768
7022
  _props$expanded2 = props.expanded,
6769
- expanded = _props$expanded2 === void 0 ? false : _props$expanded2;
7023
+ expanded = _props$expanded2 === void 0 ? false : _props$expanded2,
7024
+ _props$hasInfoRows = props.hasInfoRows,
7025
+ hasInfoRows = _props$hasInfoRows === void 0 ? false : _props$hasInfoRows;
6770
7026
  var _row$selected = row.selected,
6771
7027
  selected = _row$selected === void 0 ? false : _row$selected,
6772
7028
  className = row.className;
@@ -6790,16 +7046,16 @@
6790
7046
  cell: row[column.id],
6791
7047
  editable: editable || column.editable
6792
7048
  });
6793
- }), row.info ? /*#__PURE__*/React__default["default"].createElement("td", null, /*#__PURE__*/React__default["default"].createElement(Icon, {
7049
+ }), hasInfoRows ? row.info ? /*#__PURE__*/React__default["default"].createElement("td", null, /*#__PURE__*/React__default["default"].createElement(Icon, {
6794
7050
  icon: infoIcon,
6795
7051
  clickable: true,
6796
7052
  action: function action() {
6797
7053
  return toggleInfo(!isInfoOpen);
6798
7054
  }
6799
- })) : /*#__PURE__*/React__default["default"].createElement("td", null)), row.info && isInfoOpen ? /*#__PURE__*/React__default["default"].createElement("tr", {
7055
+ })) : /*#__PURE__*/React__default["default"].createElement("td", null) : null), row.info && isInfoOpen ? /*#__PURE__*/React__default["default"].createElement("tr", {
6800
7056
  className: "table-row-info"
6801
7057
  }, /*#__PURE__*/React__default["default"].createElement("td", {
6802
- colSpan: columns.length + 1
7058
+ colSpan: columns.length + (hasInfoRows ? 1 : 0)
6803
7059
  }, isFunction$2(row.info) ? row.info() : row.info)) : null);
6804
7060
  };
6805
7061
 
@@ -8346,7 +8602,6 @@
8346
8602
 
8347
8603
  // Handle tool selection
8348
8604
  var handleToolSelect = React.useCallback(function (toolId) {
8349
- console.log('handleToolSelect called with toolId:', toolId);
8350
8605
  setActiveTool(function (prev) {
8351
8606
  var newTool = prev === toolId ? null : toolId;
8352
8607
  console.log('Tool changed from', prev, 'to', newTool);
@@ -8363,12 +8618,12 @@
8363
8618
  var defaultTools = React.useMemo(function () {
8364
8619
  return [{
8365
8620
  id: 'columns',
8366
- icon: 'person',
8621
+ icon: 'view_column',
8367
8622
  title: 'Configurar columnas',
8368
8623
  component: ColumnsPanel
8369
8624
  }, {
8370
8625
  id: 'export',
8371
- icon: 'person',
8626
+ icon: 'ios_share',
8372
8627
  title: 'Exportar datos',
8373
8628
  component: ExportPanel
8374
8629
  }];
@@ -8449,12 +8704,19 @@
8449
8704
  return ['datatable2', "datatable2--" + size, "datatable2--" + density, "datatable2--" + theme, readability && 'datatable2--readable', readability && "datatable2--readable-" + readability, striped && 'datatable2--striped', bordered && 'datatable2--bordered', !hover && 'datatable2--no-hover', loading && 'datatable2--loading', skeleton && 'datatable2--skeleton', className].filter(Boolean).join(' ');
8450
8705
  }, [size, density, theme, readability, striped, bordered, hover, loading, skeleton, className]);
8451
8706
 
8452
- // Check if any row has actions column
8707
+ // Check if any row has actions column or if there's an actions column defined
8453
8708
  var hasActionsColumn = React.useMemo(function () {
8454
- return rows.some(function (row) {
8709
+ var hasActionsColumnDefined = columns.some(function (col) {
8710
+ return col.id === 'actions';
8711
+ });
8712
+ var hasRowsWithActions = rows.some(function (row) {
8713
+ return row.actions && Array.isArray(row.actions);
8714
+ });
8715
+ var hasRowsWithInfo = rows.some(function (row) {
8455
8716
  return row.info;
8456
- }) || filterable;
8457
- }, [rows, filterable]);
8717
+ });
8718
+ return hasActionsColumnDefined || hasRowsWithActions || hasRowsWithInfo || filterable;
8719
+ }, [columns, rows, filterable]);
8458
8720
 
8459
8721
  // Función de ordenamiento (similar a table.js)
8460
8722
  var multiSort = React.useCallback(function (array, sortObject) {
@@ -8933,7 +9195,9 @@
8933
9195
  }, summary.formatted) :
8934
9196
  // Mostrar "Total" en la primera columna si no hay checkboxes ni números
8935
9197
  index === 0 && !shouldShowCheckboxes && !showRowNumbers ? /*#__PURE__*/React__default["default"].createElement("strong", null, "Total") : null);
8936
- }), hasActionsColumn && /*#__PURE__*/React__default["default"].createElement("td", {
9198
+ }), hasActionsColumn && !columns.some(function (col) {
9199
+ return col.id === 'actions';
9200
+ }) && /*#__PURE__*/React__default["default"].createElement("td", {
8937
9201
  className: "datatable2__summary-cell datatable2__summary-cell--actions"
8938
9202
  }));
8939
9203
  };
@@ -9134,9 +9398,11 @@
9134
9398
  width: columnWidths[column.id],
9135
9399
  onResize: onColumnResize
9136
9400
  });
9137
- }), hasActionsColumn && /*#__PURE__*/React__default["default"].createElement("th", {
9401
+ }), hasActionsColumn && !columns.some(function (col) {
9402
+ return col.id === 'actions';
9403
+ }) && /*#__PURE__*/React__default["default"].createElement("th", {
9138
9404
  className: "datatable2__actions-header"
9139
- }, "Actions")), filterable && /*#__PURE__*/React__default["default"].createElement(DataTableFiltersRow, {
9405
+ })), filterable && /*#__PURE__*/React__default["default"].createElement(DataTableFiltersRow, {
9140
9406
  columns: columns,
9141
9407
  onClear: onClearFilters,
9142
9408
  showRowNumbers: showRowNumbers,
@@ -9384,6 +9650,34 @@
9384
9650
  }
9385
9651
  }));
9386
9652
  }
9653
+
9654
+ // Manejar columna "actions" de manera especial
9655
+ if (column.id === 'actions') {
9656
+ return /*#__PURE__*/React__default["default"].createElement("td", {
9657
+ key: column.id,
9658
+ className: "datatable2__actions-cell"
9659
+ }, row.actions && Array.isArray(row.actions) && /*#__PURE__*/React__default["default"].createElement("div", {
9660
+ className: "datatable2__actions-container"
9661
+ }, row.actions.map(function (action, index) {
9662
+ return /*#__PURE__*/React__default["default"].createElement("span", {
9663
+ key: index,
9664
+ className: "datatable2__action-item"
9665
+ }, action);
9666
+ })), row.info && /*#__PURE__*/React__default["default"].createElement(Icon, {
9667
+ icon: isExpanded ? "expand_less" : "expand_more",
9668
+ size: "small",
9669
+ clickable: true,
9670
+ action: function action() {
9671
+ if (row.info && typeof row.info === 'object' && row.info.action) {
9672
+ row.info.action(row);
9673
+ }
9674
+ if (onRowExpand) {
9675
+ onRowExpand(row.id);
9676
+ }
9677
+ },
9678
+ className: "datatable2__expand-icon"
9679
+ }));
9680
+ }
9387
9681
  return /*#__PURE__*/React__default["default"].createElement(DataTableCell, {
9388
9682
  key: column.id,
9389
9683
  column: column,
@@ -9395,7 +9689,9 @@
9395
9689
  onCellEdit: onCellEdit,
9396
9690
  cellClassName: cellClassName
9397
9691
  });
9398
- }), hasActionsColumn && /*#__PURE__*/React__default["default"].createElement("td", {
9692
+ }), hasActionsColumn && !columns.some(function (col) {
9693
+ return col.id === 'actions';
9694
+ }) && /*#__PURE__*/React__default["default"].createElement("td", {
9399
9695
  className: "datatable2__actions-cell"
9400
9696
  }, row.info && /*#__PURE__*/React__default["default"].createElement(Icon, {
9401
9697
  icon: isExpanded ? "expand_less" : "expand_more",
@@ -9408,7 +9704,8 @@
9408
9704
  if (onRowExpand) {
9409
9705
  onRowExpand(row.id);
9410
9706
  }
9411
- }
9707
+ },
9708
+ className: "datatable2__expand-icon"
9412
9709
  })));
9413
9710
  };
9414
9711
 
@@ -9571,7 +9868,9 @@
9571
9868
  key: column.id,
9572
9869
  className: "datatable2__filter-cell"
9573
9870
  }, column.filterable ? renderFilterField(column) : null);
9574
- }), hasActionsColumn && /*#__PURE__*/React__default["default"].createElement("td", {
9871
+ }), hasActionsColumn && !columns.some(function (col) {
9872
+ return col.id === 'actions';
9873
+ }) && /*#__PURE__*/React__default["default"].createElement("td", {
9575
9874
  className: "datatable2__filter-cell datatable2__filter-cell--actions"
9576
9875
  }, /*#__PURE__*/React__default["default"].createElement(Icon, {
9577
9876
  icon: "close",
@@ -23137,6 +23436,7 @@
23137
23436
 
23138
23437
  exports.Accordion = Accordion;
23139
23438
  exports.ActionButton = ActionButton;
23439
+ exports.ActionsCell = ActionsCell;
23140
23440
  exports.Avatar = Avatar;
23141
23441
  exports.Button = Button;
23142
23442
  exports.Calendar = Calendar;