ywana-core8 0.1.83 → 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 (76) hide show
  1. package/__previewjs__/Wrapper.tsx +8 -5
  2. package/build-doc.sh +10 -0
  3. package/dist/index.cjs +627 -194
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.css +353 -105
  6. package/dist/index.css.map +1 -1
  7. package/dist/index.modern.js +628 -196
  8. package/dist/index.modern.js.map +1 -1
  9. package/dist/index.umd.js +629 -196
  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/textfield.css +17 -4
  52. package/src/html/tokenfield.example.js +2 -2
  53. package/src/html/tree.css +42 -7
  54. package/src/html/tree.example.js +169 -7
  55. package/src/html/tree.js +216 -93
  56. package/src/widgets/calendar/Calendar.js +1 -1
  57. /package/{ACCORDION_EVALUATION.md → doc/evalulations/ACCORDION_EVALUATION.md} +0 -0
  58. /package/{CHECKBOX_EVALUATION.md → doc/evalulations/CHECKBOX_EVALUATION.md} +0 -0
  59. /package/{CHIP_EVALUATION.md → doc/evalulations/CHIP_EVALUATION.md} +0 -0
  60. /package/{COLOR_EVALUATION.md → doc/evalulations/COLOR_EVALUATION.md} +0 -0
  61. /package/{COMPONENTS_EVALUATION.md → doc/evalulations/COMPONENTS_EVALUATION.md} +0 -0
  62. /package/{FORM_EVALUATION.md → doc/evalulations/FORM_EVALUATION.md} +0 -0
  63. /package/{HEADER_EVALUATION.md → doc/evalulations/HEADER_EVALUATION.md} +0 -0
  64. /package/{ICON_EVALUATION.md → doc/evalulations/ICON_EVALUATION.md} +0 -0
  65. /package/{LIST_EVALUATION.md → doc/evalulations/LIST_EVALUATION.md} +0 -0
  66. /package/{PROGRESS_EVALUATION.md → doc/evalulations/PROGRESS_EVALUATION.md} +0 -0
  67. /package/{RADIO_EVALUATION.md → doc/evalulations/RADIO_EVALUATION.md} +0 -0
  68. /package/{RADIO_VISUAL_FIX.md → doc/evalulations/RADIO_VISUAL_FIX.md} +0 -0
  69. /package/{SECTION_IMPROVEMENTS.md → doc/evalulations/SECTION_IMPROVEMENTS.md} +0 -0
  70. /package/{SWITCH_EVALUATION.md → doc/evalulations/SWITCH_EVALUATION.md} +0 -0
  71. /package/{SWITCH_VISUAL_FIX.md → doc/evalulations/SWITCH_VISUAL_FIX.md} +0 -0
  72. /package/{TAB_EVALUATION.md → doc/evalulations/TAB_EVALUATION.md} +0 -0
  73. /package/{TEXTFIELD_EVALUATION.md → doc/evalulations/TEXTFIELD_EVALUATION.md} +0 -0
  74. /package/{TOOLTIP_FIX.md → doc/evalulations/TOOLTIP_FIX.md} +0 -0
  75. /package/{TREE_EVALUATION.md → doc/evalulations/TREE_EVALUATION.md} +0 -0
  76. /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",
@@ -11343,10 +11642,20 @@
11343
11642
  variant: 'default'
11344
11643
  };
11345
11644
 
11346
- var _excluded$4 = ["nodes", "children", "searchable", "searchPlaceholder", "searchBy", "filterable", "sortable", "sortBy", "sortDirection", "multiSelect", "onMultiSelect", "expandAll", "collapseAll", "onExpandAll", "onCollapseAll", "disabled", "loading", "empty", "emptyMessage", "emptyIcon", "className", "style", "ariaLabel"],
11645
+ var _excluded$4 = ["nodes", "children", "searchable", "searchPlaceholder", "searchBy", "filterable", "sortable", "sortBy", "sortDirection", "multiSelect", "onMultiSelect", "showExpandIcon", "onExpandAll", "onCollapseAll", "disabled", "loading", "empty", "emptyMessage", "emptyIcon", "className", "style", "ariaLabel"],
11347
11646
  _excluded2$1 = ["id", "icon", "label", "tooltip", "open", "children", "actions", "onSelect", "disabled", "draggable", "onDragStart", "onDragEnd", "onDrop", "expandable", "level", "hasChildren", "loading", "badge", "className", "style"],
11348
11647
  _excluded3 = ["id", "icon", "label", "actions", "onSelect", "selected", "onCheck", "checked", "disabled", "draggable", "onDragStart", "onDragEnd", "onDrop", "level", "badge", "tooltip", "className", "style"];
11349
11648
 
11649
+ // Context for tree state
11650
+ var TreeContext = React.createContext({
11651
+ multiSelect: false,
11652
+ selectedItems: [],
11653
+ onMultiSelect: null,
11654
+ searchTerm: '',
11655
+ forceExpandAll: false,
11656
+ forceCollapseAll: false
11657
+ });
11658
+
11350
11659
  /**
11351
11660
  * Enhanced Tree component with improved functionality while maintaining 100% compatibility
11352
11661
  */
@@ -11358,13 +11667,13 @@
11358
11667
  searchable = _props$searchable === void 0 ? false : _props$searchable,
11359
11668
  _props$searchPlacehol = props.searchPlaceholder,
11360
11669
  searchPlaceholder = _props$searchPlacehol === void 0 ? "Search..." : _props$searchPlacehol,
11670
+ _props$searchBy = props.searchBy,
11671
+ searchBy = _props$searchBy === void 0 ? ['label'] : _props$searchBy,
11361
11672
  _props$multiSelect = props.multiSelect,
11362
11673
  multiSelect = _props$multiSelect === void 0 ? false : _props$multiSelect,
11363
11674
  onMultiSelect = props.onMultiSelect,
11364
- _props$expandAll = props.expandAll,
11365
- expandAll = _props$expandAll === void 0 ? false : _props$expandAll,
11366
- _props$collapseAll = props.collapseAll,
11367
- collapseAll = _props$collapseAll === void 0 ? false : _props$collapseAll,
11675
+ _props$showExpandIcon = props.showExpandIcon,
11676
+ showExpandIcon = _props$showExpandIcon === void 0 ? false : _props$showExpandIcon,
11368
11677
  onExpandAll = props.onExpandAll,
11369
11678
  onCollapseAll = props.onCollapseAll,
11370
11679
  _props$disabled = props.disabled,
@@ -11385,8 +11694,18 @@
11385
11694
  searchTerm = _useState[0],
11386
11695
  setSearchTerm = _useState[1];
11387
11696
  var _useState2 = React.useState([]),
11697
+ selectedItems = _useState2[0],
11388
11698
  setSelectedItems = _useState2[1];
11389
11699
  React.useState(new Set());
11700
+ var _useState4 = React.useState(false),
11701
+ allExpanded = _useState4[0],
11702
+ setAllExpanded = _useState4[1];
11703
+ var _useState5 = React.useState(false),
11704
+ forceExpandAll = _useState5[0],
11705
+ setForceExpandAll = _useState5[1];
11706
+ var _useState6 = React.useState(false),
11707
+ forceCollapseAll = _useState6[0],
11708
+ setForceCollapseAll = _useState6[1];
11390
11709
  var treeRef = React.useRef(null);
11391
11710
 
11392
11711
  // Validate props
@@ -11399,8 +11718,70 @@
11399
11718
  setSearchTerm(value);
11400
11719
  }, []);
11401
11720
 
11721
+ // Apply expansion state to nodes based on current tree state
11722
+ var applyExpansionState = React.useCallback(function (nodeElements) {
11723
+ return React__default["default"].Children.toArray(nodeElements).map(function (child) {
11724
+ var _child$type;
11725
+ if (!React__default["default"].isValidElement(child)) return child;
11726
+
11727
+ // If it's a TreeNode, apply the current expansion state
11728
+ if (((_child$type = child.type) == null ? void 0 : _child$type.displayName) === 'TreeNode' || child.props.hasOwnProperty('open')) {
11729
+ var processedChildren = child.props.children ? applyExpansionState(child.props.children) : child.props.children;
11730
+ return React__default["default"].cloneElement(child, _extends({}, child.props, {
11731
+ open: allExpanded,
11732
+ // Apply current expansion state
11733
+ children: processedChildren
11734
+ }));
11735
+ }
11736
+ return child;
11737
+ });
11738
+ }, [allExpanded]);
11739
+
11740
+ // Filter nodes based on search term and auto-expand matching nodes
11741
+ var filterNodes = React.useCallback(function (nodeElements, searchTerm) {
11742
+ if (!searchTerm.trim()) {
11743
+ // When search is cleared, apply current expansion state
11744
+ return applyExpansionState(nodeElements);
11745
+ }
11746
+ return React__default["default"].Children.toArray(nodeElements).map(function (child) {
11747
+ if (!React__default["default"].isValidElement(child)) return child;
11748
+
11749
+ // Check if current node matches search
11750
+ var label = child.props.label || '';
11751
+ var matches = searchBy.some(function (field) {
11752
+ var value = child.props[field] || label;
11753
+ return typeof value === 'string' && value.toLowerCase().includes(searchTerm.toLowerCase());
11754
+ });
11755
+
11756
+ // Check if any children match (recursive)
11757
+ var hasMatchingChildren = false;
11758
+ var filteredChildren = child.props.children;
11759
+ if (child.props.children) {
11760
+ filteredChildren = filterNodes(child.props.children, searchTerm);
11761
+ hasMatchingChildren = React__default["default"].Children.count(filteredChildren) > 0;
11762
+ }
11763
+
11764
+ // If current node or children match, include it and auto-expand
11765
+ if (matches || hasMatchingChildren) {
11766
+ var _child$type2;
11767
+ // Clone the element and force it to be open if it's a TreeNode
11768
+ if (((_child$type2 = child.type) == null ? void 0 : _child$type2.displayName) === 'TreeNode' || child.props.hasOwnProperty('open')) {
11769
+ return React__default["default"].cloneElement(child, _extends({}, child.props, {
11770
+ open: true,
11771
+ // Auto-expand nodes with matches during search
11772
+ children: filteredChildren
11773
+ }));
11774
+ }
11775
+ return React__default["default"].cloneElement(child, _extends({}, child.props, {
11776
+ children: filteredChildren
11777
+ }));
11778
+ }
11779
+ return null;
11780
+ }).filter(Boolean);
11781
+ }, [searchBy, applyExpansionState]);
11782
+
11402
11783
  // Handle multi-selection
11403
- React.useCallback(function (id, selected) {
11784
+ var handleMultiSelect = React.useCallback(function (id, selected) {
11404
11785
  if (!multiSelect) return;
11405
11786
  setSelectedItems(function (prev) {
11406
11787
  var newSelected = selected ? [].concat(prev, [id]) : prev.filter(function (item) {
@@ -11413,15 +11794,26 @@
11413
11794
  });
11414
11795
  }, [multiSelect, onMultiSelect]);
11415
11796
 
11416
- // Handle expand/collapse all
11417
- var handleExpandAll = React.useCallback(function () {
11418
- if (onExpandAll) onExpandAll();
11419
- // Implementation would depend on tree structure
11420
- }, [onExpandAll]);
11421
- var handleCollapseAll = React.useCallback(function () {
11422
- if (onCollapseAll) onCollapseAll();
11423
- // Implementation would depend on tree structure
11424
- }, [onCollapseAll]);
11797
+ // Handle expand/collapse toggle - using context to propagate to all TreeNodes
11798
+ var handleExpandToggle = React.useCallback(function () {
11799
+ var newState = !allExpanded;
11800
+ setAllExpanded(newState);
11801
+ if (newState) {
11802
+ if (onExpandAll) onExpandAll();
11803
+ // Trigger expand all via context
11804
+ setForceExpandAll(true);
11805
+ setTimeout(function () {
11806
+ return setForceExpandAll(false);
11807
+ }, 100);
11808
+ } else {
11809
+ if (onCollapseAll) onCollapseAll();
11810
+ // Trigger collapse all via context
11811
+ setForceCollapseAll(true);
11812
+ setTimeout(function () {
11813
+ return setForceCollapseAll(false);
11814
+ }, 100);
11815
+ }
11816
+ }, [allExpanded, onExpandAll, onCollapseAll]);
11425
11817
 
11426
11818
  // Generate CSS classes
11427
11819
  var cssClasses = ['tree', disabled && 'tree--disabled', loading && 'tree--loading', searchable && 'tree--searchable', multiSelect && 'tree--multi-select', className].filter(Boolean).join(' ');
@@ -11469,11 +11861,23 @@
11469
11861
  size: "large"
11470
11862
  }), /*#__PURE__*/React__default["default"].createElement(Text, null, emptyMessage)));
11471
11863
  }
11472
- return /*#__PURE__*/React__default["default"].createElement("div", _extends({
11864
+ var contextValue = {
11865
+ multiSelect: multiSelect,
11866
+ selectedItems: selectedItems,
11867
+ onMultiSelect: handleMultiSelect,
11868
+ searchTerm: searchTerm,
11869
+ forceExpandAll: forceExpandAll,
11870
+ forceCollapseAll: forceCollapseAll
11871
+ };
11872
+ return /*#__PURE__*/React__default["default"].createElement(TreeContext.Provider, {
11873
+ value: contextValue
11874
+ }, /*#__PURE__*/React__default["default"].createElement("div", _extends({
11473
11875
  className: cssClasses,
11474
11876
  style: style,
11475
11877
  ref: treeRef
11476
- }, ariaAttributes, restProps), searchable && /*#__PURE__*/React__default["default"].createElement("div", {
11878
+ }, ariaAttributes, restProps), (searchable || showExpandIcon) && /*#__PURE__*/React__default["default"].createElement("div", {
11879
+ className: "tree__header " + (!searchable && showExpandIcon ? 'tree__header--expand-only' : '')
11880
+ }, searchable && /*#__PURE__*/React__default["default"].createElement("div", {
11477
11881
  className: "tree__search"
11478
11882
  }, /*#__PURE__*/React__default["default"].createElement(TextField, {
11479
11883
  id: "tree-search",
@@ -11483,29 +11887,17 @@
11483
11887
  icon: "search",
11484
11888
  outlined: true,
11485
11889
  size: "small"
11486
- })), (expandAll || collapseAll) && /*#__PURE__*/React__default["default"].createElement("div", {
11487
- className: "tree__controls"
11488
- }, expandAll && /*#__PURE__*/React__default["default"].createElement("button", {
11489
- className: "tree__control-button",
11490
- onClick: handleExpandAll,
11491
- "aria-label": "Expand all nodes"
11492
- }, /*#__PURE__*/React__default["default"].createElement(Icon, {
11493
- icon: "unfold_more",
11494
- size: "small"
11495
- }), /*#__PURE__*/React__default["default"].createElement(Text, {
11496
- size: "sm"
11497
- }, "Expand All")), collapseAll && /*#__PURE__*/React__default["default"].createElement("button", {
11498
- className: "tree__control-button",
11499
- onClick: handleCollapseAll,
11500
- "aria-label": "Collapse all nodes"
11890
+ })), showExpandIcon && /*#__PURE__*/React__default["default"].createElement("div", {
11891
+ className: "tree__expand-control"
11501
11892
  }, /*#__PURE__*/React__default["default"].createElement(Icon, {
11502
- icon: "unfold_less",
11503
- size: "small"
11504
- }), /*#__PURE__*/React__default["default"].createElement(Text, {
11505
- size: "sm"
11506
- }, "Collapse All"))), /*#__PURE__*/React__default["default"].createElement("div", {
11893
+ icon: allExpanded ? "unfold_less" : "unfold_more",
11894
+ size: "small",
11895
+ clickable: true,
11896
+ action: handleExpandToggle,
11897
+ tooltip: allExpanded ? "Collapse all" : "Expand all"
11898
+ }))), /*#__PURE__*/React__default["default"].createElement("div", {
11507
11899
  className: "tree__content"
11508
- }, nodes, children));
11900
+ }, nodes, searchable ? filterNodes(children, searchTerm) : applyExpansionState(children))));
11509
11901
  };
11510
11902
 
11511
11903
  /**
@@ -11541,19 +11933,44 @@
11541
11933
  className = props.className,
11542
11934
  style = props.style,
11543
11935
  restProps = _objectWithoutPropertiesLoose(props, _excluded2$1);
11544
- var _useState4 = React.useState(open),
11545
- isOpen = _useState4[0],
11546
- setIsOpen = _useState4[1];
11547
- var _useState5 = React.useState(false),
11548
- isDragging = _useState5[0],
11549
- setIsDragging = _useState5[1];
11936
+ var _useState7 = React.useState(open),
11937
+ isOpen = _useState7[0],
11938
+ setIsOpen = _useState7[1];
11939
+ var _useState8 = React.useState(false),
11940
+ isDragging = _useState8[0],
11941
+ setIsDragging = _useState8[1];
11550
11942
  var nodeRef = React.useRef(null);
11551
11943
 
11944
+ // Get tree context for forced expand/collapse
11945
+ var treeContext = React.useContext(TreeContext);
11946
+ var forceExpandAll = treeContext.forceExpandAll,
11947
+ forceCollapseAll = treeContext.forceCollapseAll;
11948
+
11552
11949
  // Sync with open prop
11553
11950
  React.useEffect(function () {
11554
11951
  setIsOpen(open);
11555
11952
  }, [open]);
11556
11953
 
11954
+ // Handle forced expand/collapse from tree context
11955
+ React.useEffect(function () {
11956
+ if (forceExpandAll && expandable) {
11957
+ setIsOpen(true);
11958
+ // Also update the DOM element
11959
+ if (nodeRef.current) {
11960
+ nodeRef.current.open = true;
11961
+ }
11962
+ }
11963
+ }, [forceExpandAll, expandable]);
11964
+ React.useEffect(function () {
11965
+ if (forceCollapseAll && expandable) {
11966
+ setIsOpen(false);
11967
+ // Also update the DOM element
11968
+ if (nodeRef.current) {
11969
+ nodeRef.current.open = false;
11970
+ }
11971
+ }
11972
+ }, [forceCollapseAll, expandable]);
11973
+
11557
11974
  // Handle selection (maintaining original behavior)
11558
11975
  var handleSelect = React.useCallback(function (event) {
11559
11976
  if (disabled) return;
@@ -11561,14 +11978,13 @@
11561
11978
  if (onSelect) onSelect(id);
11562
11979
  }, [disabled, onSelect, id]);
11563
11980
 
11564
- // Handle toggle
11981
+ // Handle toggle - sync with details element
11565
11982
  var handleToggle = React.useCallback(function (event) {
11566
11983
  if (disabled || !expandable) return;
11567
- event.preventDefault();
11568
- event.stopPropagation();
11569
- setIsOpen(function (prev) {
11570
- return !prev;
11571
- });
11984
+
11985
+ // Sync our state with the details element
11986
+ var detailsElement = event.currentTarget;
11987
+ setIsOpen(detailsElement.open);
11572
11988
  }, [disabled, expandable]);
11573
11989
 
11574
11990
  // Handle keyboard interaction
@@ -11646,24 +12062,29 @@
11646
12062
  onDragStart: handleDragStart,
11647
12063
  onDragEnd: handleDragEnd,
11648
12064
  onDrop: handleDrop,
11649
- onDragOver: handleDragOver
12065
+ onDragOver: handleDragOver,
12066
+ onToggle: handleToggle
11650
12067
  }, restProps), /*#__PURE__*/React__default["default"].createElement("summary", _extends({
11651
12068
  className: "tree-item",
11652
12069
  onClick: function onClick(event) {
11653
- // Si se hace click en el área general del nodo (no en el label), toggle
11654
- if (event.target === event.currentTarget || event.target.closest('.tree-node__toggle')) {
11655
- handleToggle(event);
12070
+ // Si se hace click en el toggle, permitir el comportamiento natural
12071
+ if (event.target.closest('.tree-node__toggle')) {
12072
+ // No hacer nada, dejar que el details maneje el toggle
12073
+ return;
12074
+ }
12075
+
12076
+ // Si hay onSelect y se hace click fuera del toggle, seleccionar
12077
+ if (onSelect) {
12078
+ event.preventDefault(); // Prevenir el toggle del details
12079
+ handleSelect(event);
11656
12080
  }
12081
+ // Si no hay onSelect, permitir el comportamiento natural del details
11657
12082
  },
11658
12083
  onKeyDown: handleKeyDown
11659
12084
  }, ariaAttributes, {
11660
12085
  title: tooltip
11661
12086
  }), hasChildren && expandable && /*#__PURE__*/React__default["default"].createElement("div", {
11662
- className: "tree-node__toggle",
11663
- onClick: function onClick(event) {
11664
- event.stopPropagation();
11665
- handleToggle(event);
11666
- }
12087
+ className: "tree-node__toggle"
11667
12088
  }, /*#__PURE__*/React__default["default"].createElement(Icon, {
11668
12089
  icon: isOpen ? 'expand_less' : 'expand_more',
11669
12090
  size: "small",
@@ -11680,11 +12101,7 @@
11680
12101
  icon: "hourglass_empty",
11681
12102
  size: "small"
11682
12103
  })), /*#__PURE__*/React__default["default"].createElement("div", {
11683
- className: "label " + clickable,
11684
- onClick: function onClick(event) {
11685
- event.stopPropagation();
11686
- handleSelect(event);
11687
- }
12104
+ className: "label " + clickable
11688
12105
  }, /*#__PURE__*/React__default["default"].createElement("span", {
11689
12106
  className: "tree-node__label-text"
11690
12107
  }, labelTxt), badge && /*#__PURE__*/React__default["default"].createElement("span", {
@@ -11726,11 +12143,20 @@
11726
12143
  className = props.className,
11727
12144
  style = props.style,
11728
12145
  restProps = _objectWithoutPropertiesLoose(props, _excluded3);
11729
- var _useState6 = React.useState(false),
11730
- isDragging = _useState6[0],
11731
- setIsDragging = _useState6[1];
12146
+ var _useState9 = React.useState(false),
12147
+ isDragging = _useState9[0],
12148
+ setIsDragging = _useState9[1];
11732
12149
  var itemRef = React.useRef(null);
11733
12150
 
12151
+ // Get tree context
12152
+ var treeContext = React.useContext(TreeContext);
12153
+ var multiSelect = treeContext.multiSelect,
12154
+ selectedItems = treeContext.selectedItems,
12155
+ handleTreeMultiSelect = treeContext.onMultiSelect;
12156
+
12157
+ // Check if this item is selected in multi-select mode
12158
+ var isMultiSelected = multiSelect && selectedItems.includes(id);
12159
+
11734
12160
  // Handle selection (maintaining original behavior)
11735
12161
  var handleSelect = React.useCallback(function (event) {
11736
12162
  if (disabled) return;
@@ -11738,12 +12164,20 @@
11738
12164
  if (onSelect) onSelect(id);
11739
12165
  }, [disabled, onSelect, id]);
11740
12166
 
11741
- // Handle checkbox (maintaining original behavior)
12167
+ // Handle checkbox (maintaining original behavior + multi-select)
11742
12168
  var handleCheck = React.useCallback(function (event) {
11743
12169
  if (disabled) return;
11744
12170
  event.stopPropagation();
11745
- if (onCheck) onCheck(id, event.target.checked);
11746
- }, [disabled, onCheck, id]);
12171
+ var isChecked = event.target.checked;
12172
+
12173
+ // Handle original onCheck callback
12174
+ if (onCheck) onCheck(id, isChecked);
12175
+
12176
+ // Handle multi-select if enabled
12177
+ if (multiSelect && handleTreeMultiSelect) {
12178
+ handleTreeMultiSelect(id, isChecked);
12179
+ }
12180
+ }, [disabled, onCheck, id, multiSelect, handleTreeMultiSelect]);
11747
12181
 
11748
12182
  // Handle keyboard interaction
11749
12183
  var handleKeyDown = React.useCallback(function (event) {
@@ -11810,11 +12244,11 @@
11810
12244
  onDrop: handleDrop,
11811
12245
  onDragOver: handleDragOver,
11812
12246
  title: tooltip
11813
- }, ariaAttributes, restProps), onCheck && /*#__PURE__*/React__default["default"].createElement("div", {
12247
+ }, ariaAttributes, restProps), (onCheck || multiSelect) && /*#__PURE__*/React__default["default"].createElement("div", {
11814
12248
  className: "tree-item__checkbox"
11815
12249
  }, /*#__PURE__*/React__default["default"].createElement("input", {
11816
12250
  type: "checkbox",
11817
- checked: checked,
12251
+ checked: multiSelect ? isMultiSelected : checked,
11818
12252
  onChange: handleCheck,
11819
12253
  disabled: disabled,
11820
12254
  "aria-label": "Select " + (typeof label === 'string' ? label : 'item')
@@ -11857,10 +12291,8 @@
11857
12291
  multiSelect: PropTypes.bool,
11858
12292
  /** Multi-selection callback */
11859
12293
  onMultiSelect: PropTypes.func,
11860
- /** Show expand all button */
11861
- expandAll: PropTypes.bool,
11862
- /** Show collapse all button */
11863
- collapseAll: PropTypes.bool,
12294
+ /** Show expand/collapse icon */
12295
+ showExpandIcon: PropTypes.bool,
11864
12296
  /** Expand all callback */
11865
12297
  onExpandAll: PropTypes.func,
11866
12298
  /** Collapse all callback */
@@ -23004,6 +23436,7 @@
23004
23436
 
23005
23437
  exports.Accordion = Accordion;
23006
23438
  exports.ActionButton = ActionButton;
23439
+ exports.ActionsCell = ActionsCell;
23007
23440
  exports.Avatar = Avatar;
23008
23441
  exports.Button = Button;
23009
23442
  exports.Calendar = Calendar;