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.
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/package-lock.json +17298 -0
  13. package/doc/package.json +34 -0
  14. package/doc/public/index.html +22 -0
  15. package/doc/scripts/generate-examples.js +129 -0
  16. package/doc/src/App.css +171 -0
  17. package/doc/src/App.js +45 -0
  18. package/doc/src/components/ExamplePage.js +104 -0
  19. package/doc/src/components/WelcomePage.js +84 -0
  20. package/doc/src/examples/button.example.js +47 -0
  21. package/doc/src/examples/input.example.js +91 -0
  22. package/doc/src/examples-config.js +170 -0
  23. package/doc/src/index.css +237 -0
  24. package/doc/src/index.js +13 -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.cjs CHANGED
@@ -6,7 +6,7 @@ var reactNotificationsComponent = require('react-notifications-component');
6
6
  require('react-notifications-component/dist/theme.css');
7
7
  var moment$1 = require('moment');
8
8
  var momentRange = require('moment-range');
9
- require('moment/locale/es');
9
+ require('moment/locale/es.js');
10
10
  var axios = require('axios');
11
11
  var equal = require('deep-equal');
12
12
 
@@ -1357,7 +1357,7 @@ var PropTypes = propTypes;
1357
1357
  */
1358
1358
  var SiteContext = React__default["default"].createContext({});
1359
1359
 
1360
- 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"];
1360
+ 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"];
1361
1361
  function _catch$d(body, recover) {
1362
1362
  try {
1363
1363
  var result = body();
@@ -1428,7 +1428,7 @@ var Text = function Text(props) {
1428
1428
  as = _props$as === void 0 ? 'span' : _props$as,
1429
1429
  style = props.style,
1430
1430
  onClick = props.onClick,
1431
- restProps = _objectWithoutPropertiesLoose(props, _excluded$h);
1431
+ restProps = _objectWithoutPropertiesLoose(props, _excluded$i);
1432
1432
  var site = React.useContext(SiteContext);
1433
1433
 
1434
1434
  // Memoize formatted value for performance
@@ -1814,7 +1814,7 @@ Icon.defaultProps = {
1814
1814
  className: ''
1815
1815
  };
1816
1816
 
1817
- var _excluded$g = ["className", "sections", "disabled", "allowMultiple", "animated", "onCheck", "onToggle", "onSectionChange", "ariaLabel"],
1817
+ var _excluded$h = ["className", "sections", "disabled", "allowMultiple", "animated", "onCheck", "onToggle", "onSectionChange", "ariaLabel"],
1818
1818
  _excluded2$9 = ["checked", "icon", "title", "subtitle", "open", "disabled", "animated", "sectionIndex", "onToggle", "onCheck", "toolbar", "info", "children", "ariaLabel"];
1819
1819
 
1820
1820
  /**
@@ -1834,7 +1834,7 @@ var Accordion = function Accordion(props) {
1834
1834
  onToggle = props.onToggle,
1835
1835
  onSectionChange = props.onSectionChange,
1836
1836
  ariaLabel = props.ariaLabel,
1837
- restProps = _objectWithoutPropertiesLoose(props, _excluded$g);
1837
+ restProps = _objectWithoutPropertiesLoose(props, _excluded$h);
1838
1838
  var _useState = React.useState([]),
1839
1839
  openSections = _useState[0],
1840
1840
  setOpenSections = _useState[1];
@@ -2080,6 +2080,340 @@ Accordion.defaultProps = {
2080
2080
  animated: true
2081
2081
  };
2082
2082
 
2083
+ /**
2084
+ * Page Context
2085
+ */
2086
+ var MenuContext = React__default["default"].createContext({});
2087
+
2088
+ /**
2089
+ * Menu
2090
+ **/
2091
+ var Menu = function Menu(props) {
2092
+ var children = props.children;
2093
+ return /*#__PURE__*/React__default["default"].createElement("ul", null, children);
2094
+ };
2095
+
2096
+ /**
2097
+ * Menu Icon
2098
+ */
2099
+ var MenuIcon = function MenuIcon(props) {
2100
+ var _props$icon = props.icon,
2101
+ icon = _props$icon === void 0 ? "more_vert" : _props$icon,
2102
+ children = props.children,
2103
+ _props$align = props.align,
2104
+ align = _props$align === void 0 ? "left" : _props$align,
2105
+ _props$size = props.size,
2106
+ size = _props$size === void 0 ? "normal" : _props$size;
2107
+ var _useState = React.useState(false),
2108
+ open = _useState[0],
2109
+ setOpen = _useState[1];
2110
+ function toggle() {
2111
+ setOpen(!open);
2112
+ }
2113
+
2114
+ // Convertir valores de align a clases CSS
2115
+ var getAlignClass = function getAlignClass(alignment) {
2116
+ switch (alignment) {
2117
+ case 'right':
2118
+ return 'alignRight';
2119
+ case 'left':
2120
+ return 'alignLeft';
2121
+ default:
2122
+ return 'alignLeft';
2123
+ // Por defecto a la izquierda
2124
+ }
2125
+ };
2126
+ return /*#__PURE__*/React__default["default"].createElement(MenuContext.Provider, {
2127
+ value: [open, setOpen]
2128
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
2129
+ className: "menu-icon"
2130
+ }, /*#__PURE__*/React__default["default"].createElement(Icon, {
2131
+ icon: icon,
2132
+ size: size,
2133
+ clickable: true,
2134
+ action: toggle
2135
+ }), open ? /*#__PURE__*/React__default["default"].createElement("menu", {
2136
+ className: getAlignClass(align)
2137
+ }, children) : null, open ? /*#__PURE__*/React__default["default"].createElement("div", {
2138
+ className: "overlay",
2139
+ onClick: toggle
2140
+ }) : null));
2141
+ };
2142
+
2143
+ /**
2144
+ * Menu Item
2145
+ */
2146
+ var MenuItem = function MenuItem(props) {
2147
+ var icon = props.icon,
2148
+ label = props.label,
2149
+ meta = props.meta,
2150
+ _props$disabled = props.disabled,
2151
+ disabled = _props$disabled === void 0 ? false : _props$disabled,
2152
+ _props$size2 = props.size,
2153
+ size = _props$size2 === void 0 ? "normal" : _props$size2,
2154
+ onSelect = props.onSelect;
2155
+ var _useContext = React.useContext(MenuContext),
2156
+ setOpen = _useContext[1];
2157
+ function select() {
2158
+ if (!disabled) {
2159
+ if (onSelect) onSelect();
2160
+ setOpen(false);
2161
+ }
2162
+ }
2163
+ var style = disabled ? "disabled" : "";
2164
+ var labelTxt = label ? /*#__PURE__*/React__default["default"].createElement(Text, {
2165
+ format: TEXTFORMATS.STRING
2166
+ }, label) : null;
2167
+ return /*#__PURE__*/React__default["default"].createElement("li", {
2168
+ className: "menu-item " + style,
2169
+ onClick: select
2170
+ }, icon ? /*#__PURE__*/React__default["default"].createElement(Icon, {
2171
+ icon: icon,
2172
+ size: size
2173
+ }) : null, /*#__PURE__*/React__default["default"].createElement("label", null, labelTxt), meta ? /*#__PURE__*/React__default["default"].createElement("div", {
2174
+ className: "meta"
2175
+ }, meta) : null);
2176
+ };
2177
+
2178
+ /**
2179
+ * Menu Separator
2180
+ */
2181
+ var MenuSeparator = function MenuSeparator(props) {
2182
+ return /*#__PURE__*/React__default["default"].createElement("li", {
2183
+ className: "menu-separator"
2184
+ });
2185
+ };
2186
+
2187
+ var _excluded$g = ["actions", "maxWidth", "menuIcon", "menuAlign", "menuSize", "className", "style", "gap"];
2188
+
2189
+ /**
2190
+ * ActionsCell - Componente reutilizable para manejar acciones con overflow automático
2191
+ *
2192
+ * Características:
2193
+ * - Detecta automáticamente si las acciones exceden el ancho máximo
2194
+ * - Convierte automáticamente a menú desplegable cuando es necesario
2195
+ * - Extrae acciones de componentes React para crear elementos de menú
2196
+ * - Reutilizable en tablas, headers, accordions, listas, etc.
2197
+ */
2198
+ var ActionsCell = function ActionsCell(_ref) {
2199
+ var actions = _ref.actions,
2200
+ _ref$maxWidth = _ref.maxWidth,
2201
+ maxWidth = _ref$maxWidth === void 0 ? 200 : _ref$maxWidth,
2202
+ _ref$menuIcon = _ref.menuIcon,
2203
+ menuIcon = _ref$menuIcon === void 0 ? "more_horiz" : _ref$menuIcon,
2204
+ _ref$menuAlign = _ref.menuAlign,
2205
+ menuAlign = _ref$menuAlign === void 0 ? "left" : _ref$menuAlign,
2206
+ _ref$menuSize = _ref.menuSize,
2207
+ menuSize = _ref$menuSize === void 0 ? "small" : _ref$menuSize,
2208
+ _ref$className = _ref.className,
2209
+ className = _ref$className === void 0 ? "" : _ref$className,
2210
+ _ref$style = _ref.style,
2211
+ style = _ref$style === void 0 ? {} : _ref$style,
2212
+ _ref$gap = _ref.gap,
2213
+ gap = _ref$gap === void 0 ? "4px" : _ref$gap,
2214
+ restProps = _objectWithoutPropertiesLoose(_ref, _excluded$g);
2215
+ var _useState = React.useState(false),
2216
+ isOverflowing = _useState[0],
2217
+ setIsOverflowing = _useState[1];
2218
+ var _useState2 = React.useState(false),
2219
+ isReady = _useState2[0],
2220
+ setIsReady = _useState2[1];
2221
+ var actionsRef = React.useRef(null);
2222
+ var containerRef = React.useRef(null);
2223
+
2224
+ // Check if actions overflow the max width
2225
+ React.useEffect(function () {
2226
+ var checkOverflow = function checkOverflow() {
2227
+ if (actions) {
2228
+ try {
2229
+ // Create a temporary element to measure the actual width needed
2230
+ var tempDiv = document.createElement('div');
2231
+ 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 ";
2232
+
2233
+ // Create a wrapper to render the actions
2234
+ var actionsWrapper = document.createElement('div');
2235
+ actionsWrapper.style.cssText = "\n display: flex;\n align-items: center;\n gap: " + gap + ";\n flex-wrap: nowrap;\n ";
2236
+
2237
+ // We need to render the React element to measure it properly
2238
+ // For now, we'll use a heuristic based on the number of actions
2239
+ var estimatedWidth = 0;
2240
+ if (actions.props && actions.props.children) {
2241
+ var children = Array.isArray(actions.props.children) ? actions.props.children : [actions.props.children];
2242
+ children.forEach(function (child) {
2243
+ if (child && child.props) {
2244
+ // Estimate width based on button content
2245
+ var hasText = child.props.children && typeof child.props.children === 'string';
2246
+ var textLength = hasText ? child.props.children.length : 0;
2247
+ if (hasText) {
2248
+ // Button with text: ~8px per character + 32px for icon + padding
2249
+ estimatedWidth += textLength * 8 + 32 + 16;
2250
+ } else {
2251
+ // Icon-only button: ~32px + padding
2252
+ estimatedWidth += 32 + 8;
2253
+ }
2254
+ }
2255
+ });
2256
+
2257
+ // Add gap between buttons
2258
+ var gapWidth = parseInt(gap) || 4;
2259
+ estimatedWidth += (children.length - 1) * gapWidth;
2260
+ } else {
2261
+ // Single action
2262
+ var hasText = actions.props && actions.props.children && typeof actions.props.children === 'string';
2263
+ var textLength = hasText ? actions.props.children.length : 0;
2264
+ if (hasText) {
2265
+ estimatedWidth = textLength * 8 + 32 + 16;
2266
+ } else {
2267
+ estimatedWidth = 32 + 8;
2268
+ }
2269
+ }
2270
+
2271
+ // Check if it overflows the max width (with some padding for safety)
2272
+ var shouldOverflow = estimatedWidth > maxWidth - 8; // 8px for container padding
2273
+ setIsOverflowing(shouldOverflow);
2274
+ setIsReady(true);
2275
+ } catch (error) {
2276
+ console.warn('ActionsCell: Error measuring width', error);
2277
+ setIsOverflowing(false);
2278
+ setIsReady(true);
2279
+ }
2280
+ } else {
2281
+ setIsReady(true);
2282
+ }
2283
+ };
2284
+
2285
+ // Use a small delay to ensure DOM is ready
2286
+ var timer = setTimeout(checkOverflow, 10);
2287
+ return function () {
2288
+ return clearTimeout(timer);
2289
+ };
2290
+ }, [actions, maxWidth, gap]);
2291
+
2292
+ // Extract action items from React elements for menu
2293
+ var extractActionItems = function extractActionItems(actionsElement) {
2294
+ if (!actionsElement) return [];
2295
+ var items = [];
2296
+ try {
2297
+ // If it's a div with children (multiple actions)
2298
+ if (actionsElement.props && actionsElement.props.children) {
2299
+ var children = Array.isArray(actionsElement.props.children) ? actionsElement.props.children : [actionsElement.props.children];
2300
+ children.forEach(function (child, index) {
2301
+ if (child && child.props) {
2302
+ var _child$props = child.props,
2303
+ icon = _child$props.icon,
2304
+ label = _child$props.children,
2305
+ onClick = _child$props.onClick,
2306
+ disabled = _child$props.disabled,
2307
+ title = _child$props.title;
2308
+ items.push({
2309
+ id: "action-" + index,
2310
+ icon: icon,
2311
+ label: title || label || "Action " + (index + 1),
2312
+ onSelect: onClick,
2313
+ disabled: disabled
2314
+ });
2315
+ }
2316
+ });
2317
+ } else if (actionsElement.props) {
2318
+ // Single action
2319
+ var _actionsElement$props = actionsElement.props,
2320
+ icon = _actionsElement$props.icon,
2321
+ label = _actionsElement$props.children,
2322
+ onClick = _actionsElement$props.onClick,
2323
+ disabled = _actionsElement$props.disabled,
2324
+ title = _actionsElement$props.title;
2325
+ items.push({
2326
+ id: 'action-0',
2327
+ icon: icon,
2328
+ label: title || label || 'Action',
2329
+ onSelect: onClick,
2330
+ disabled: disabled
2331
+ });
2332
+ }
2333
+ } catch (error) {
2334
+ console.warn('ActionsCell: Error extracting action items', error);
2335
+ }
2336
+ return items;
2337
+ };
2338
+ if (!actions) return null;
2339
+ var containerClasses = ['actions-cell', className].filter(Boolean).join(' ');
2340
+ var containerStyles = _extends({
2341
+ maxWidth: maxWidth + "px",
2342
+ width: isOverflowing ? 'auto' : 'fit-content'
2343
+ }, style);
2344
+ return /*#__PURE__*/React__default["default"].createElement("div", _extends({
2345
+ ref: containerRef,
2346
+ className: containerClasses,
2347
+ style: containerStyles
2348
+ }, restProps), !isReady ?
2349
+ /*#__PURE__*/
2350
+ // Loading state - show a minimal placeholder
2351
+ React__default["default"].createElement("div", {
2352
+ className: "actions-cell__loading",
2353
+ style: {
2354
+ width: '48px',
2355
+ height: '32px'
2356
+ }
2357
+ }) : !isOverflowing ?
2358
+ /*#__PURE__*/
2359
+ // Show actions normally
2360
+ React__default["default"].createElement("div", {
2361
+ ref: actionsRef,
2362
+ className: "actions-cell__content",
2363
+ style: {
2364
+ display: 'flex',
2365
+ alignItems: 'center',
2366
+ gap: gap,
2367
+ flexWrap: 'nowrap'
2368
+ }
2369
+ }, actions) :
2370
+ /*#__PURE__*/
2371
+ // Show menu when overflowing
2372
+ React__default["default"].createElement(Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
2373
+ ref: actionsRef,
2374
+ style: {
2375
+ position: 'absolute',
2376
+ visibility: 'hidden',
2377
+ whiteSpace: 'nowrap',
2378
+ display: 'flex',
2379
+ alignItems: 'center',
2380
+ gap: gap,
2381
+ pointerEvents: 'none',
2382
+ zIndex: -1000
2383
+ }
2384
+ }, actions), /*#__PURE__*/React__default["default"].createElement(MenuIcon, {
2385
+ icon: menuIcon,
2386
+ size: menuSize,
2387
+ align: menuAlign
2388
+ }, extractActionItems(actions).map(function (item) {
2389
+ return /*#__PURE__*/React__default["default"].createElement(MenuItem, {
2390
+ key: item.id,
2391
+ icon: item.icon,
2392
+ label: item.label,
2393
+ onSelect: item.onSelect,
2394
+ disabled: item.disabled
2395
+ });
2396
+ }))));
2397
+ };
2398
+ ActionsCell.propTypes = {
2399
+ /** Acciones a mostrar (componentes React) */
2400
+ actions: PropTypes.node,
2401
+ /** Ancho máximo antes de convertirse en menú */
2402
+ maxWidth: PropTypes.number,
2403
+ /** Icono del menú desplegable */
2404
+ menuIcon: PropTypes.string,
2405
+ /** Alineación del menú (left: se abre hacia la izquierda, right: hacia la derecha, center: centrado) */
2406
+ menuAlign: PropTypes.oneOf(['left', 'right', 'center']),
2407
+ /** Tamaño del icono del menú */
2408
+ menuSize: PropTypes.oneOf(['small', 'medium', 'large']),
2409
+ /** Clase CSS adicional */
2410
+ className: PropTypes.string,
2411
+ /** Estilos adicionales */
2412
+ style: PropTypes.object,
2413
+ /** Espacio entre acciones */
2414
+ gap: PropTypes.string
2415
+ };
2416
+
2083
2417
  var _excluded$f = ["id", "label", "icon", "action", "disabled", "loading", "outlined", "raised", "size", "type", "className", "ariaLabel", "tooltip", "form", "onClick", "onFocus", "onBlur", "onKeyDown"],
2084
2418
  _excluded2$8 = ["states", "state", "className", "disabled", "onStateChange"];
2085
2419
  function _catch$c(body, recover) {
@@ -4872,96 +5206,6 @@ List.defaultProps = {
4872
5206
  role: 'list'
4873
5207
  };
4874
5208
 
4875
- /**
4876
- * Page Context
4877
- */
4878
- var MenuContext = React__default["default"].createContext({});
4879
-
4880
- /**
4881
- * Menu
4882
- **/
4883
- var Menu = function Menu(props) {
4884
- var children = props.children;
4885
- return /*#__PURE__*/React__default["default"].createElement("ul", null, children);
4886
- };
4887
-
4888
- /**
4889
- * Menu Icon
4890
- */
4891
- var MenuIcon = function MenuIcon(props) {
4892
- var _props$icon = props.icon,
4893
- icon = _props$icon === void 0 ? "more_vert" : _props$icon,
4894
- children = props.children,
4895
- align = props.align,
4896
- _props$size = props.size,
4897
- size = _props$size === void 0 ? "normal" : _props$size;
4898
- var _useState = React.useState(false),
4899
- open = _useState[0],
4900
- setOpen = _useState[1];
4901
- function toggle() {
4902
- setOpen(!open);
4903
- }
4904
- return /*#__PURE__*/React__default["default"].createElement(MenuContext.Provider, {
4905
- value: [open, setOpen]
4906
- }, /*#__PURE__*/React__default["default"].createElement("div", {
4907
- className: "menu-icon"
4908
- }, /*#__PURE__*/React__default["default"].createElement(Icon, {
4909
- icon: icon,
4910
- size: size,
4911
- clickable: true,
4912
- action: toggle
4913
- }), open ? /*#__PURE__*/React__default["default"].createElement("menu", {
4914
- className: "" + align
4915
- }, children) : null, open ? /*#__PURE__*/React__default["default"].createElement("div", {
4916
- className: "overlay",
4917
- onClick: toggle
4918
- }) : null));
4919
- };
4920
-
4921
- /**
4922
- * Menu Item
4923
- */
4924
- var MenuItem = function MenuItem(props) {
4925
- var icon = props.icon,
4926
- label = props.label,
4927
- meta = props.meta,
4928
- _props$disabled = props.disabled,
4929
- disabled = _props$disabled === void 0 ? false : _props$disabled,
4930
- _props$size2 = props.size,
4931
- size = _props$size2 === void 0 ? "normal" : _props$size2,
4932
- onSelect = props.onSelect;
4933
- var _useContext = React.useContext(MenuContext),
4934
- setOpen = _useContext[1];
4935
- function select() {
4936
- if (!disabled) {
4937
- if (onSelect) onSelect();
4938
- setOpen(false);
4939
- }
4940
- }
4941
- var style = disabled ? "disabled" : "";
4942
- var labelTxt = label ? /*#__PURE__*/React__default["default"].createElement(Text, {
4943
- format: TEXTFORMATS.STRING
4944
- }, label) : null;
4945
- return /*#__PURE__*/React__default["default"].createElement("li", {
4946
- className: "menu-item " + style,
4947
- onClick: select
4948
- }, icon ? /*#__PURE__*/React__default["default"].createElement(Icon, {
4949
- icon: icon,
4950
- size: size
4951
- }) : null, /*#__PURE__*/React__default["default"].createElement("label", null, labelTxt), meta ? /*#__PURE__*/React__default["default"].createElement("div", {
4952
- className: "meta"
4953
- }, meta) : null);
4954
- };
4955
-
4956
- /**
4957
- * Menu Separator
4958
- */
4959
- var MenuSeparator = function MenuSeparator(props) {
4960
- return /*#__PURE__*/React__default["default"].createElement("li", {
4961
- className: "menu-separator"
4962
- });
4963
- };
4964
-
4965
5209
  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"];
4966
5210
  function _catch$a(body, recover) {
4967
5211
  try {
@@ -6570,6 +6814,11 @@ var DataTable = function DataTable(props) {
6570
6814
  var _useState2 = React.useState(false),
6571
6815
  allChecked = _useState2[0],
6572
6816
  setAllChecked = _useState2[1];
6817
+
6818
+ // Detectar si alguna fila tiene info para mostrar la columna de expansión
6819
+ var hasInfoRows = rows.some(function (row) {
6820
+ return row.info;
6821
+ });
6573
6822
  function changeSort(id) {
6574
6823
  if (multisort) {
6575
6824
  var _Object$assign;
@@ -6650,15 +6899,16 @@ var DataTable = function DataTable(props) {
6650
6899
  }).length] : [2, 1],
6651
6900
  rowspan = _ref2[0],
6652
6901
  colspan = _ref2[1];
6902
+ var headerClasses = (resizableStyle + " " + id).trim();
6653
6903
  return /*#__PURE__*/React__default["default"].createElement("th", {
6654
6904
  key: id,
6655
- className: resizableStyle,
6905
+ className: headerClasses,
6656
6906
  rowSpan: rowspan,
6657
6907
  colSpan: colspan
6658
6908
  }, /*#__PURE__*/React__default["default"].createElement("div", null, id === "checked" && onCheckAll ? /*#__PURE__*/React__default["default"].createElement(CheckBox, {
6659
6909
  onChange: checkAll,
6660
6910
  value: allChecked
6661
- }) : /*#__PURE__*/React__default["default"].createElement(Text, {
6911
+ }) : id === "actions" ? null : /*#__PURE__*/React__default["default"].createElement(Text, {
6662
6912
  key: "th_" + id
6663
6913
  }, label), sortable ? /*#__PURE__*/React__default["default"].createElement(SortIcon, {
6664
6914
  sortDir: sortDir[id],
@@ -6666,10 +6916,13 @@ var DataTable = function DataTable(props) {
6666
6916
  return changeSort(id);
6667
6917
  }
6668
6918
  }) : null));
6669
- }), /*#__PURE__*/React__default["default"].createElement("th", {
6919
+ }), hasInfoRows ? /*#__PURE__*/React__default["default"].createElement("th", {
6670
6920
  rowSpan: 2,
6671
- colSpan: 1
6672
- })), /*#__PURE__*/React__default["default"].createElement("tr", null, columns.filter(function (_ref3) {
6921
+ colSpan: 1,
6922
+ style: {
6923
+ width: '3rem'
6924
+ }
6925
+ }) : null), /*#__PURE__*/React__default["default"].createElement("tr", null, columns.filter(function (_ref3) {
6673
6926
  var type = _ref3.type;
6674
6927
  return type === TYPES$1.ENTITY;
6675
6928
  }).map(function (column) {
@@ -6692,7 +6945,8 @@ var DataTable = function DataTable(props) {
6692
6945
  onSelect: select,
6693
6946
  onDrop: moveRow,
6694
6947
  editable: editable,
6695
- expanded: expanded
6948
+ expanded: expanded,
6949
+ hasInfoRows: hasInfoRows
6696
6950
  });
6697
6951
  }) : /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", {
6698
6952
  colSpan: 1000
@@ -6773,7 +7027,9 @@ var DataTableRow$1 = function DataTableRow(props) {
6773
7027
  onSelect = props.onSelect,
6774
7028
  editable = props.editable,
6775
7029
  _props$expanded2 = props.expanded,
6776
- expanded = _props$expanded2 === void 0 ? false : _props$expanded2;
7030
+ expanded = _props$expanded2 === void 0 ? false : _props$expanded2,
7031
+ _props$hasInfoRows = props.hasInfoRows,
7032
+ hasInfoRows = _props$hasInfoRows === void 0 ? false : _props$hasInfoRows;
6777
7033
  var _row$selected = row.selected,
6778
7034
  selected = _row$selected === void 0 ? false : _row$selected,
6779
7035
  className = row.className;
@@ -6797,16 +7053,16 @@ var DataTableRow$1 = function DataTableRow(props) {
6797
7053
  cell: row[column.id],
6798
7054
  editable: editable || column.editable
6799
7055
  });
6800
- }), row.info ? /*#__PURE__*/React__default["default"].createElement("td", null, /*#__PURE__*/React__default["default"].createElement(Icon, {
7056
+ }), hasInfoRows ? row.info ? /*#__PURE__*/React__default["default"].createElement("td", null, /*#__PURE__*/React__default["default"].createElement(Icon, {
6801
7057
  icon: infoIcon,
6802
7058
  clickable: true,
6803
7059
  action: function action() {
6804
7060
  return toggleInfo(!isInfoOpen);
6805
7061
  }
6806
- })) : /*#__PURE__*/React__default["default"].createElement("td", null)), row.info && isInfoOpen ? /*#__PURE__*/React__default["default"].createElement("tr", {
7062
+ })) : /*#__PURE__*/React__default["default"].createElement("td", null) : null), row.info && isInfoOpen ? /*#__PURE__*/React__default["default"].createElement("tr", {
6807
7063
  className: "table-row-info"
6808
7064
  }, /*#__PURE__*/React__default["default"].createElement("td", {
6809
- colSpan: columns.length + 1
7065
+ colSpan: columns.length + (hasInfoRows ? 1 : 0)
6810
7066
  }, isFunction$2(row.info) ? row.info() : row.info)) : null);
6811
7067
  };
6812
7068
 
@@ -8353,7 +8609,6 @@ var DataTable2 = function DataTable2(props) {
8353
8609
 
8354
8610
  // Handle tool selection
8355
8611
  var handleToolSelect = React.useCallback(function (toolId) {
8356
- console.log('handleToolSelect called with toolId:', toolId);
8357
8612
  setActiveTool(function (prev) {
8358
8613
  var newTool = prev === toolId ? null : toolId;
8359
8614
  console.log('Tool changed from', prev, 'to', newTool);
@@ -8370,12 +8625,12 @@ var DataTable2 = function DataTable2(props) {
8370
8625
  var defaultTools = React.useMemo(function () {
8371
8626
  return [{
8372
8627
  id: 'columns',
8373
- icon: 'person',
8628
+ icon: 'view_column',
8374
8629
  title: 'Configurar columnas',
8375
8630
  component: ColumnsPanel
8376
8631
  }, {
8377
8632
  id: 'export',
8378
- icon: 'person',
8633
+ icon: 'ios_share',
8379
8634
  title: 'Exportar datos',
8380
8635
  component: ExportPanel
8381
8636
  }];
@@ -8456,12 +8711,19 @@ var DataTable2 = function DataTable2(props) {
8456
8711
  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(' ');
8457
8712
  }, [size, density, theme, readability, striped, bordered, hover, loading, skeleton, className]);
8458
8713
 
8459
- // Check if any row has actions column
8714
+ // Check if any row has actions column or if there's an actions column defined
8460
8715
  var hasActionsColumn = React.useMemo(function () {
8461
- return rows.some(function (row) {
8716
+ var hasActionsColumnDefined = columns.some(function (col) {
8717
+ return col.id === 'actions';
8718
+ });
8719
+ var hasRowsWithActions = rows.some(function (row) {
8720
+ return row.actions && Array.isArray(row.actions);
8721
+ });
8722
+ var hasRowsWithInfo = rows.some(function (row) {
8462
8723
  return row.info;
8463
- }) || filterable;
8464
- }, [rows, filterable]);
8724
+ });
8725
+ return hasActionsColumnDefined || hasRowsWithActions || hasRowsWithInfo || filterable;
8726
+ }, [columns, rows, filterable]);
8465
8727
 
8466
8728
  // Función de ordenamiento (similar a table.js)
8467
8729
  var multiSort = React.useCallback(function (array, sortObject) {
@@ -8940,7 +9202,9 @@ var DataTableSummaryRow = function DataTableSummaryRow(_ref5) {
8940
9202
  }, summary.formatted) :
8941
9203
  // Mostrar "Total" en la primera columna si no hay checkboxes ni números
8942
9204
  index === 0 && !shouldShowCheckboxes && !showRowNumbers ? /*#__PURE__*/React__default["default"].createElement("strong", null, "Total") : null);
8943
- }), hasActionsColumn && /*#__PURE__*/React__default["default"].createElement("td", {
9205
+ }), hasActionsColumn && !columns.some(function (col) {
9206
+ return col.id === 'actions';
9207
+ }) && /*#__PURE__*/React__default["default"].createElement("td", {
8944
9208
  className: "datatable2__summary-cell datatable2__summary-cell--actions"
8945
9209
  }));
8946
9210
  };
@@ -9141,9 +9405,11 @@ var DataTableHeader = function DataTableHeader(_ref8) {
9141
9405
  width: columnWidths[column.id],
9142
9406
  onResize: onColumnResize
9143
9407
  });
9144
- }), hasActionsColumn && /*#__PURE__*/React__default["default"].createElement("th", {
9408
+ }), hasActionsColumn && !columns.some(function (col) {
9409
+ return col.id === 'actions';
9410
+ }) && /*#__PURE__*/React__default["default"].createElement("th", {
9145
9411
  className: "datatable2__actions-header"
9146
- }, "Actions")), filterable && /*#__PURE__*/React__default["default"].createElement(DataTableFiltersRow, {
9412
+ })), filterable && /*#__PURE__*/React__default["default"].createElement(DataTableFiltersRow, {
9147
9413
  columns: columns,
9148
9414
  onClear: onClearFilters,
9149
9415
  showRowNumbers: showRowNumbers,
@@ -9391,6 +9657,34 @@ var DataTableRow = function DataTableRow(_ref1) {
9391
9657
  }
9392
9658
  }));
9393
9659
  }
9660
+
9661
+ // Manejar columna "actions" de manera especial
9662
+ if (column.id === 'actions') {
9663
+ return /*#__PURE__*/React__default["default"].createElement("td", {
9664
+ key: column.id,
9665
+ className: "datatable2__actions-cell"
9666
+ }, row.actions && Array.isArray(row.actions) && /*#__PURE__*/React__default["default"].createElement("div", {
9667
+ className: "datatable2__actions-container"
9668
+ }, row.actions.map(function (action, index) {
9669
+ return /*#__PURE__*/React__default["default"].createElement("span", {
9670
+ key: index,
9671
+ className: "datatable2__action-item"
9672
+ }, action);
9673
+ })), row.info && /*#__PURE__*/React__default["default"].createElement(Icon, {
9674
+ icon: isExpanded ? "expand_less" : "expand_more",
9675
+ size: "small",
9676
+ clickable: true,
9677
+ action: function action() {
9678
+ if (row.info && typeof row.info === 'object' && row.info.action) {
9679
+ row.info.action(row);
9680
+ }
9681
+ if (onRowExpand) {
9682
+ onRowExpand(row.id);
9683
+ }
9684
+ },
9685
+ className: "datatable2__expand-icon"
9686
+ }));
9687
+ }
9394
9688
  return /*#__PURE__*/React__default["default"].createElement(DataTableCell, {
9395
9689
  key: column.id,
9396
9690
  column: column,
@@ -9402,7 +9696,9 @@ var DataTableRow = function DataTableRow(_ref1) {
9402
9696
  onCellEdit: onCellEdit,
9403
9697
  cellClassName: cellClassName
9404
9698
  });
9405
- }), hasActionsColumn && /*#__PURE__*/React__default["default"].createElement("td", {
9699
+ }), hasActionsColumn && !columns.some(function (col) {
9700
+ return col.id === 'actions';
9701
+ }) && /*#__PURE__*/React__default["default"].createElement("td", {
9406
9702
  className: "datatable2__actions-cell"
9407
9703
  }, row.info && /*#__PURE__*/React__default["default"].createElement(Icon, {
9408
9704
  icon: isExpanded ? "expand_less" : "expand_more",
@@ -9415,7 +9711,8 @@ var DataTableRow = function DataTableRow(_ref1) {
9415
9711
  if (onRowExpand) {
9416
9712
  onRowExpand(row.id);
9417
9713
  }
9418
- }
9714
+ },
9715
+ className: "datatable2__expand-icon"
9419
9716
  })));
9420
9717
  };
9421
9718
 
@@ -9578,7 +9875,9 @@ var DataTableFiltersRow = function DataTableFiltersRow(_ref11) {
9578
9875
  key: column.id,
9579
9876
  className: "datatable2__filter-cell"
9580
9877
  }, column.filterable ? renderFilterField(column) : null);
9581
- }), hasActionsColumn && /*#__PURE__*/React__default["default"].createElement("td", {
9878
+ }), hasActionsColumn && !columns.some(function (col) {
9879
+ return col.id === 'actions';
9880
+ }) && /*#__PURE__*/React__default["default"].createElement("td", {
9582
9881
  className: "datatable2__filter-cell datatable2__filter-cell--actions"
9583
9882
  }, /*#__PURE__*/React__default["default"].createElement(Icon, {
9584
9883
  icon: "close",
@@ -23144,6 +23443,7 @@ var isFunction = function isFunction(value) {
23144
23443
 
23145
23444
  exports.Accordion = Accordion;
23146
23445
  exports.ActionButton = ActionButton;
23446
+ exports.ActionsCell = ActionsCell;
23147
23447
  exports.Avatar = Avatar;
23148
23448
  exports.Button = Button;
23149
23449
  exports.Calendar = Calendar;