ywana-core8 0.1.84 → 0.1.85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/__previewjs__/Wrapper.tsx +8 -5
  2. package/build-doc.sh +10 -0
  3. package/dist/index.cjs +418 -118
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.css +294 -94
  6. package/dist/index.css.map +1 -1
  7. package/dist/index.modern.js +418 -119
  8. package/dist/index.modern.js.map +1 -1
  9. package/dist/index.umd.js +420 -120
  10. package/dist/index.umd.js.map +1 -1
  11. package/doc/README.md +196 -0
  12. package/doc/craco.config.js +31 -0
  13. package/doc/generate-examples.cjs +310 -0
  14. package/doc/package-lock.json +17298 -0
  15. package/doc/package.json +33 -0
  16. package/doc/public/index.html +22 -0
  17. package/doc/src/App.css +171 -0
  18. package/doc/src/App.js +214 -0
  19. package/doc/src/components/ExamplePage.js +104 -0
  20. package/doc/src/components/WelcomePage.js +84 -0
  21. package/doc/src/examples/button.example.js +47 -0
  22. package/doc/src/examples/input.example.js +91 -0
  23. package/doc/src/index.css +237 -0
  24. package/doc/src/index.js +11 -0
  25. package/package.json +9 -2
  26. package/preview.config.js +38 -0
  27. package/src/html/accordion.example.js +2 -2
  28. package/src/html/actions-cell.css +108 -0
  29. package/src/html/actions-cell.example.js +587 -0
  30. package/src/html/actions-cell.js +260 -0
  31. package/src/html/checkbox.example.js +2 -2
  32. package/src/html/chip.example.js +2 -2
  33. package/src/html/color.example.js +2 -2
  34. package/src/html/form.example.js +2 -2
  35. package/src/html/header2.example.js +2 -2
  36. package/src/html/index.js +1 -0
  37. package/src/html/menu.css +9 -2
  38. package/src/html/menu.js +14 -2
  39. package/src/html/progress.example.js +2 -2
  40. package/src/html/property.example.js +2 -2
  41. package/src/html/radio.example.js +2 -2
  42. package/src/html/switch.example.js +2 -2
  43. package/src/html/tab.example.js +2 -2
  44. package/src/html/table.css +47 -1
  45. package/src/html/table.example.js +1012 -0
  46. package/src/html/table.js +12 -7
  47. package/src/html/table2-actions-test.js +138 -0
  48. package/src/html/table2.css +40 -3
  49. package/src/html/table2.example.js +330 -0
  50. package/src/html/table2.js +56 -13
  51. package/src/html/tokenfield.example.js +2 -2
  52. package/src/widgets/calendar/Calendar.js +1 -1
  53. /package/{ACCORDION_EVALUATION.md → doc/evalulations/ACCORDION_EVALUATION.md} +0 -0
  54. /package/{CHECKBOX_EVALUATION.md → doc/evalulations/CHECKBOX_EVALUATION.md} +0 -0
  55. /package/{CHIP_EVALUATION.md → doc/evalulations/CHIP_EVALUATION.md} +0 -0
  56. /package/{COLOR_EVALUATION.md → doc/evalulations/COLOR_EVALUATION.md} +0 -0
  57. /package/{COMPONENTS_EVALUATION.md → doc/evalulations/COMPONENTS_EVALUATION.md} +0 -0
  58. /package/{FORM_EVALUATION.md → doc/evalulations/FORM_EVALUATION.md} +0 -0
  59. /package/{HEADER_EVALUATION.md → doc/evalulations/HEADER_EVALUATION.md} +0 -0
  60. /package/{ICON_EVALUATION.md → doc/evalulations/ICON_EVALUATION.md} +0 -0
  61. /package/{LIST_EVALUATION.md → doc/evalulations/LIST_EVALUATION.md} +0 -0
  62. /package/{PROGRESS_EVALUATION.md → doc/evalulations/PROGRESS_EVALUATION.md} +0 -0
  63. /package/{RADIO_EVALUATION.md → doc/evalulations/RADIO_EVALUATION.md} +0 -0
  64. /package/{RADIO_VISUAL_FIX.md → doc/evalulations/RADIO_VISUAL_FIX.md} +0 -0
  65. /package/{SECTION_IMPROVEMENTS.md → doc/evalulations/SECTION_IMPROVEMENTS.md} +0 -0
  66. /package/{SWITCH_EVALUATION.md → doc/evalulations/SWITCH_EVALUATION.md} +0 -0
  67. /package/{SWITCH_VISUAL_FIX.md → doc/evalulations/SWITCH_VISUAL_FIX.md} +0 -0
  68. /package/{TAB_EVALUATION.md → doc/evalulations/TAB_EVALUATION.md} +0 -0
  69. /package/{TEXTFIELD_EVALUATION.md → doc/evalulations/TEXTFIELD_EVALUATION.md} +0 -0
  70. /package/{TOOLTIP_FIX.md → doc/evalulations/TOOLTIP_FIX.md} +0 -0
  71. /package/{TREE_EVALUATION.md → doc/evalulations/TREE_EVALUATION.md} +0 -0
  72. /package/src/incubator/{PDFViewer.js → pdfViewer.js} +0 -0
@@ -6,7 +6,7 @@ import { Store, ReactNotifications } from 'react-notifications-component';
6
6
  import 'react-notifications-component/dist/theme.css';
7
7
  import moment$1 from 'moment';
8
8
  import { extendMoment } from 'moment-range';
9
- import 'moment/locale/es';
9
+ import 'moment/locale/es.js';
10
10
  import axios from 'axios';
11
11
  import equal from 'deep-equal';
12
12
 
@@ -1348,7 +1348,7 @@ var PropTypes = propTypes;
1348
1348
  */
1349
1349
  var SiteContext = React.createContext({});
1350
1350
 
1351
- 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"];
1351
+ 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"];
1352
1352
  function _catch$d(body, recover) {
1353
1353
  try {
1354
1354
  var result = body();
@@ -1419,7 +1419,7 @@ var Text = function Text(props) {
1419
1419
  as = _props$as === void 0 ? 'span' : _props$as,
1420
1420
  style = props.style,
1421
1421
  onClick = props.onClick,
1422
- restProps = _objectWithoutPropertiesLoose(props, _excluded$h);
1422
+ restProps = _objectWithoutPropertiesLoose(props, _excluded$i);
1423
1423
  var site = useContext(SiteContext);
1424
1424
 
1425
1425
  // Memoize formatted value for performance
@@ -1805,7 +1805,7 @@ Icon.defaultProps = {
1805
1805
  className: ''
1806
1806
  };
1807
1807
 
1808
- var _excluded$g = ["className", "sections", "disabled", "allowMultiple", "animated", "onCheck", "onToggle", "onSectionChange", "ariaLabel"],
1808
+ var _excluded$h = ["className", "sections", "disabled", "allowMultiple", "animated", "onCheck", "onToggle", "onSectionChange", "ariaLabel"],
1809
1809
  _excluded2$9 = ["checked", "icon", "title", "subtitle", "open", "disabled", "animated", "sectionIndex", "onToggle", "onCheck", "toolbar", "info", "children", "ariaLabel"];
1810
1810
 
1811
1811
  /**
@@ -1825,7 +1825,7 @@ var Accordion = function Accordion(props) {
1825
1825
  onToggle = props.onToggle,
1826
1826
  onSectionChange = props.onSectionChange,
1827
1827
  ariaLabel = props.ariaLabel,
1828
- restProps = _objectWithoutPropertiesLoose(props, _excluded$g);
1828
+ restProps = _objectWithoutPropertiesLoose(props, _excluded$h);
1829
1829
  var _useState = useState([]),
1830
1830
  openSections = _useState[0],
1831
1831
  setOpenSections = _useState[1];
@@ -2071,6 +2071,340 @@ Accordion.defaultProps = {
2071
2071
  animated: true
2072
2072
  };
2073
2073
 
2074
+ /**
2075
+ * Page Context
2076
+ */
2077
+ var MenuContext = React.createContext({});
2078
+
2079
+ /**
2080
+ * Menu
2081
+ **/
2082
+ var Menu = function Menu(props) {
2083
+ var children = props.children;
2084
+ return /*#__PURE__*/React.createElement("ul", null, children);
2085
+ };
2086
+
2087
+ /**
2088
+ * Menu Icon
2089
+ */
2090
+ var MenuIcon = function MenuIcon(props) {
2091
+ var _props$icon = props.icon,
2092
+ icon = _props$icon === void 0 ? "more_vert" : _props$icon,
2093
+ children = props.children,
2094
+ _props$align = props.align,
2095
+ align = _props$align === void 0 ? "left" : _props$align,
2096
+ _props$size = props.size,
2097
+ size = _props$size === void 0 ? "normal" : _props$size;
2098
+ var _useState = useState(false),
2099
+ open = _useState[0],
2100
+ setOpen = _useState[1];
2101
+ function toggle() {
2102
+ setOpen(!open);
2103
+ }
2104
+
2105
+ // Convertir valores de align a clases CSS
2106
+ var getAlignClass = function getAlignClass(alignment) {
2107
+ switch (alignment) {
2108
+ case 'right':
2109
+ return 'alignRight';
2110
+ case 'left':
2111
+ return 'alignLeft';
2112
+ default:
2113
+ return 'alignLeft';
2114
+ // Por defecto a la izquierda
2115
+ }
2116
+ };
2117
+ return /*#__PURE__*/React.createElement(MenuContext.Provider, {
2118
+ value: [open, setOpen]
2119
+ }, /*#__PURE__*/React.createElement("div", {
2120
+ className: "menu-icon"
2121
+ }, /*#__PURE__*/React.createElement(Icon, {
2122
+ icon: icon,
2123
+ size: size,
2124
+ clickable: true,
2125
+ action: toggle
2126
+ }), open ? /*#__PURE__*/React.createElement("menu", {
2127
+ className: getAlignClass(align)
2128
+ }, children) : null, open ? /*#__PURE__*/React.createElement("div", {
2129
+ className: "overlay",
2130
+ onClick: toggle
2131
+ }) : null));
2132
+ };
2133
+
2134
+ /**
2135
+ * Menu Item
2136
+ */
2137
+ var MenuItem = function MenuItem(props) {
2138
+ var icon = props.icon,
2139
+ label = props.label,
2140
+ meta = props.meta,
2141
+ _props$disabled = props.disabled,
2142
+ disabled = _props$disabled === void 0 ? false : _props$disabled,
2143
+ _props$size2 = props.size,
2144
+ size = _props$size2 === void 0 ? "normal" : _props$size2,
2145
+ onSelect = props.onSelect;
2146
+ var _useContext = useContext(MenuContext),
2147
+ setOpen = _useContext[1];
2148
+ function select() {
2149
+ if (!disabled) {
2150
+ if (onSelect) onSelect();
2151
+ setOpen(false);
2152
+ }
2153
+ }
2154
+ var style = disabled ? "disabled" : "";
2155
+ var labelTxt = label ? /*#__PURE__*/React.createElement(Text, {
2156
+ format: TEXTFORMATS.STRING
2157
+ }, label) : null;
2158
+ return /*#__PURE__*/React.createElement("li", {
2159
+ className: "menu-item " + style,
2160
+ onClick: select
2161
+ }, icon ? /*#__PURE__*/React.createElement(Icon, {
2162
+ icon: icon,
2163
+ size: size
2164
+ }) : null, /*#__PURE__*/React.createElement("label", null, labelTxt), meta ? /*#__PURE__*/React.createElement("div", {
2165
+ className: "meta"
2166
+ }, meta) : null);
2167
+ };
2168
+
2169
+ /**
2170
+ * Menu Separator
2171
+ */
2172
+ var MenuSeparator = function MenuSeparator(props) {
2173
+ return /*#__PURE__*/React.createElement("li", {
2174
+ className: "menu-separator"
2175
+ });
2176
+ };
2177
+
2178
+ var _excluded$g = ["actions", "maxWidth", "menuIcon", "menuAlign", "menuSize", "className", "style", "gap"];
2179
+
2180
+ /**
2181
+ * ActionsCell - Componente reutilizable para manejar acciones con overflow automático
2182
+ *
2183
+ * Características:
2184
+ * - Detecta automáticamente si las acciones exceden el ancho máximo
2185
+ * - Convierte automáticamente a menú desplegable cuando es necesario
2186
+ * - Extrae acciones de componentes React para crear elementos de menú
2187
+ * - Reutilizable en tablas, headers, accordions, listas, etc.
2188
+ */
2189
+ var ActionsCell = function ActionsCell(_ref) {
2190
+ var actions = _ref.actions,
2191
+ _ref$maxWidth = _ref.maxWidth,
2192
+ maxWidth = _ref$maxWidth === void 0 ? 200 : _ref$maxWidth,
2193
+ _ref$menuIcon = _ref.menuIcon,
2194
+ menuIcon = _ref$menuIcon === void 0 ? "more_horiz" : _ref$menuIcon,
2195
+ _ref$menuAlign = _ref.menuAlign,
2196
+ menuAlign = _ref$menuAlign === void 0 ? "left" : _ref$menuAlign,
2197
+ _ref$menuSize = _ref.menuSize,
2198
+ menuSize = _ref$menuSize === void 0 ? "small" : _ref$menuSize,
2199
+ _ref$className = _ref.className,
2200
+ className = _ref$className === void 0 ? "" : _ref$className,
2201
+ _ref$style = _ref.style,
2202
+ style = _ref$style === void 0 ? {} : _ref$style,
2203
+ _ref$gap = _ref.gap,
2204
+ gap = _ref$gap === void 0 ? "4px" : _ref$gap,
2205
+ restProps = _objectWithoutPropertiesLoose(_ref, _excluded$g);
2206
+ var _useState = useState(false),
2207
+ isOverflowing = _useState[0],
2208
+ setIsOverflowing = _useState[1];
2209
+ var _useState2 = useState(false),
2210
+ isReady = _useState2[0],
2211
+ setIsReady = _useState2[1];
2212
+ var actionsRef = useRef(null);
2213
+ var containerRef = useRef(null);
2214
+
2215
+ // Check if actions overflow the max width
2216
+ useEffect(function () {
2217
+ var checkOverflow = function checkOverflow() {
2218
+ if (actions) {
2219
+ try {
2220
+ // Create a temporary element to measure the actual width needed
2221
+ var tempDiv = document.createElement('div');
2222
+ 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 ";
2223
+
2224
+ // Create a wrapper to render the actions
2225
+ var actionsWrapper = document.createElement('div');
2226
+ actionsWrapper.style.cssText = "\n display: flex;\n align-items: center;\n gap: " + gap + ";\n flex-wrap: nowrap;\n ";
2227
+
2228
+ // We need to render the React element to measure it properly
2229
+ // For now, we'll use a heuristic based on the number of actions
2230
+ var estimatedWidth = 0;
2231
+ if (actions.props && actions.props.children) {
2232
+ var children = Array.isArray(actions.props.children) ? actions.props.children : [actions.props.children];
2233
+ children.forEach(function (child) {
2234
+ if (child && child.props) {
2235
+ // Estimate width based on button content
2236
+ var hasText = child.props.children && typeof child.props.children === 'string';
2237
+ var textLength = hasText ? child.props.children.length : 0;
2238
+ if (hasText) {
2239
+ // Button with text: ~8px per character + 32px for icon + padding
2240
+ estimatedWidth += textLength * 8 + 32 + 16;
2241
+ } else {
2242
+ // Icon-only button: ~32px + padding
2243
+ estimatedWidth += 32 + 8;
2244
+ }
2245
+ }
2246
+ });
2247
+
2248
+ // Add gap between buttons
2249
+ var gapWidth = parseInt(gap) || 4;
2250
+ estimatedWidth += (children.length - 1) * gapWidth;
2251
+ } else {
2252
+ // Single action
2253
+ var hasText = actions.props && actions.props.children && typeof actions.props.children === 'string';
2254
+ var textLength = hasText ? actions.props.children.length : 0;
2255
+ if (hasText) {
2256
+ estimatedWidth = textLength * 8 + 32 + 16;
2257
+ } else {
2258
+ estimatedWidth = 32 + 8;
2259
+ }
2260
+ }
2261
+
2262
+ // Check if it overflows the max width (with some padding for safety)
2263
+ var shouldOverflow = estimatedWidth > maxWidth - 8; // 8px for container padding
2264
+ setIsOverflowing(shouldOverflow);
2265
+ setIsReady(true);
2266
+ } catch (error) {
2267
+ console.warn('ActionsCell: Error measuring width', error);
2268
+ setIsOverflowing(false);
2269
+ setIsReady(true);
2270
+ }
2271
+ } else {
2272
+ setIsReady(true);
2273
+ }
2274
+ };
2275
+
2276
+ // Use a small delay to ensure DOM is ready
2277
+ var timer = setTimeout(checkOverflow, 10);
2278
+ return function () {
2279
+ return clearTimeout(timer);
2280
+ };
2281
+ }, [actions, maxWidth, gap]);
2282
+
2283
+ // Extract action items from React elements for menu
2284
+ var extractActionItems = function extractActionItems(actionsElement) {
2285
+ if (!actionsElement) return [];
2286
+ var items = [];
2287
+ try {
2288
+ // If it's a div with children (multiple actions)
2289
+ if (actionsElement.props && actionsElement.props.children) {
2290
+ var children = Array.isArray(actionsElement.props.children) ? actionsElement.props.children : [actionsElement.props.children];
2291
+ children.forEach(function (child, index) {
2292
+ if (child && child.props) {
2293
+ var _child$props = child.props,
2294
+ icon = _child$props.icon,
2295
+ label = _child$props.children,
2296
+ onClick = _child$props.onClick,
2297
+ disabled = _child$props.disabled,
2298
+ title = _child$props.title;
2299
+ items.push({
2300
+ id: "action-" + index,
2301
+ icon: icon,
2302
+ label: title || label || "Action " + (index + 1),
2303
+ onSelect: onClick,
2304
+ disabled: disabled
2305
+ });
2306
+ }
2307
+ });
2308
+ } else if (actionsElement.props) {
2309
+ // Single action
2310
+ var _actionsElement$props = actionsElement.props,
2311
+ icon = _actionsElement$props.icon,
2312
+ label = _actionsElement$props.children,
2313
+ onClick = _actionsElement$props.onClick,
2314
+ disabled = _actionsElement$props.disabled,
2315
+ title = _actionsElement$props.title;
2316
+ items.push({
2317
+ id: 'action-0',
2318
+ icon: icon,
2319
+ label: title || label || 'Action',
2320
+ onSelect: onClick,
2321
+ disabled: disabled
2322
+ });
2323
+ }
2324
+ } catch (error) {
2325
+ console.warn('ActionsCell: Error extracting action items', error);
2326
+ }
2327
+ return items;
2328
+ };
2329
+ if (!actions) return null;
2330
+ var containerClasses = ['actions-cell', className].filter(Boolean).join(' ');
2331
+ var containerStyles = _extends({
2332
+ maxWidth: maxWidth + "px",
2333
+ width: isOverflowing ? 'auto' : 'fit-content'
2334
+ }, style);
2335
+ return /*#__PURE__*/React.createElement("div", _extends({
2336
+ ref: containerRef,
2337
+ className: containerClasses,
2338
+ style: containerStyles
2339
+ }, restProps), !isReady ?
2340
+ /*#__PURE__*/
2341
+ // Loading state - show a minimal placeholder
2342
+ React.createElement("div", {
2343
+ className: "actions-cell__loading",
2344
+ style: {
2345
+ width: '48px',
2346
+ height: '32px'
2347
+ }
2348
+ }) : !isOverflowing ?
2349
+ /*#__PURE__*/
2350
+ // Show actions normally
2351
+ React.createElement("div", {
2352
+ ref: actionsRef,
2353
+ className: "actions-cell__content",
2354
+ style: {
2355
+ display: 'flex',
2356
+ alignItems: 'center',
2357
+ gap: gap,
2358
+ flexWrap: 'nowrap'
2359
+ }
2360
+ }, actions) :
2361
+ /*#__PURE__*/
2362
+ // Show menu when overflowing
2363
+ React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
2364
+ ref: actionsRef,
2365
+ style: {
2366
+ position: 'absolute',
2367
+ visibility: 'hidden',
2368
+ whiteSpace: 'nowrap',
2369
+ display: 'flex',
2370
+ alignItems: 'center',
2371
+ gap: gap,
2372
+ pointerEvents: 'none',
2373
+ zIndex: -1000
2374
+ }
2375
+ }, actions), /*#__PURE__*/React.createElement(MenuIcon, {
2376
+ icon: menuIcon,
2377
+ size: menuSize,
2378
+ align: menuAlign
2379
+ }, extractActionItems(actions).map(function (item) {
2380
+ return /*#__PURE__*/React.createElement(MenuItem, {
2381
+ key: item.id,
2382
+ icon: item.icon,
2383
+ label: item.label,
2384
+ onSelect: item.onSelect,
2385
+ disabled: item.disabled
2386
+ });
2387
+ }))));
2388
+ };
2389
+ ActionsCell.propTypes = {
2390
+ /** Acciones a mostrar (componentes React) */
2391
+ actions: PropTypes.node,
2392
+ /** Ancho máximo antes de convertirse en menú */
2393
+ maxWidth: PropTypes.number,
2394
+ /** Icono del menú desplegable */
2395
+ menuIcon: PropTypes.string,
2396
+ /** Alineación del menú (left: se abre hacia la izquierda, right: hacia la derecha, center: centrado) */
2397
+ menuAlign: PropTypes.oneOf(['left', 'right', 'center']),
2398
+ /** Tamaño del icono del menú */
2399
+ menuSize: PropTypes.oneOf(['small', 'medium', 'large']),
2400
+ /** Clase CSS adicional */
2401
+ className: PropTypes.string,
2402
+ /** Estilos adicionales */
2403
+ style: PropTypes.object,
2404
+ /** Espacio entre acciones */
2405
+ gap: PropTypes.string
2406
+ };
2407
+
2074
2408
  var _excluded$f = ["id", "label", "icon", "action", "disabled", "loading", "outlined", "raised", "size", "type", "className", "ariaLabel", "tooltip", "form", "onClick", "onFocus", "onBlur", "onKeyDown"],
2075
2409
  _excluded2$8 = ["states", "state", "className", "disabled", "onStateChange"];
2076
2410
  function _catch$c(body, recover) {
@@ -4863,96 +5197,6 @@ List.defaultProps = {
4863
5197
  role: 'list'
4864
5198
  };
4865
5199
 
4866
- /**
4867
- * Page Context
4868
- */
4869
- var MenuContext = React.createContext({});
4870
-
4871
- /**
4872
- * Menu
4873
- **/
4874
- var Menu = function Menu(props) {
4875
- var children = props.children;
4876
- return /*#__PURE__*/React.createElement("ul", null, children);
4877
- };
4878
-
4879
- /**
4880
- * Menu Icon
4881
- */
4882
- var MenuIcon = function MenuIcon(props) {
4883
- var _props$icon = props.icon,
4884
- icon = _props$icon === void 0 ? "more_vert" : _props$icon,
4885
- children = props.children,
4886
- align = props.align,
4887
- _props$size = props.size,
4888
- size = _props$size === void 0 ? "normal" : _props$size;
4889
- var _useState = useState(false),
4890
- open = _useState[0],
4891
- setOpen = _useState[1];
4892
- function toggle() {
4893
- setOpen(!open);
4894
- }
4895
- return /*#__PURE__*/React.createElement(MenuContext.Provider, {
4896
- value: [open, setOpen]
4897
- }, /*#__PURE__*/React.createElement("div", {
4898
- className: "menu-icon"
4899
- }, /*#__PURE__*/React.createElement(Icon, {
4900
- icon: icon,
4901
- size: size,
4902
- clickable: true,
4903
- action: toggle
4904
- }), open ? /*#__PURE__*/React.createElement("menu", {
4905
- className: "" + align
4906
- }, children) : null, open ? /*#__PURE__*/React.createElement("div", {
4907
- className: "overlay",
4908
- onClick: toggle
4909
- }) : null));
4910
- };
4911
-
4912
- /**
4913
- * Menu Item
4914
- */
4915
- var MenuItem = function MenuItem(props) {
4916
- var icon = props.icon,
4917
- label = props.label,
4918
- meta = props.meta,
4919
- _props$disabled = props.disabled,
4920
- disabled = _props$disabled === void 0 ? false : _props$disabled,
4921
- _props$size2 = props.size,
4922
- size = _props$size2 === void 0 ? "normal" : _props$size2,
4923
- onSelect = props.onSelect;
4924
- var _useContext = useContext(MenuContext),
4925
- setOpen = _useContext[1];
4926
- function select() {
4927
- if (!disabled) {
4928
- if (onSelect) onSelect();
4929
- setOpen(false);
4930
- }
4931
- }
4932
- var style = disabled ? "disabled" : "";
4933
- var labelTxt = label ? /*#__PURE__*/React.createElement(Text, {
4934
- format: TEXTFORMATS.STRING
4935
- }, label) : null;
4936
- return /*#__PURE__*/React.createElement("li", {
4937
- className: "menu-item " + style,
4938
- onClick: select
4939
- }, icon ? /*#__PURE__*/React.createElement(Icon, {
4940
- icon: icon,
4941
- size: size
4942
- }) : null, /*#__PURE__*/React.createElement("label", null, labelTxt), meta ? /*#__PURE__*/React.createElement("div", {
4943
- className: "meta"
4944
- }, meta) : null);
4945
- };
4946
-
4947
- /**
4948
- * Menu Separator
4949
- */
4950
- var MenuSeparator = function MenuSeparator(props) {
4951
- return /*#__PURE__*/React.createElement("li", {
4952
- className: "menu-separator"
4953
- });
4954
- };
4955
-
4956
5200
  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"];
4957
5201
  function _catch$a(body, recover) {
4958
5202
  try {
@@ -6561,6 +6805,11 @@ var DataTable = function DataTable(props) {
6561
6805
  var _useState2 = useState(false),
6562
6806
  allChecked = _useState2[0],
6563
6807
  setAllChecked = _useState2[1];
6808
+
6809
+ // Detectar si alguna fila tiene info para mostrar la columna de expansión
6810
+ var hasInfoRows = rows.some(function (row) {
6811
+ return row.info;
6812
+ });
6564
6813
  function changeSort(id) {
6565
6814
  if (multisort) {
6566
6815
  var _Object$assign;
@@ -6641,15 +6890,16 @@ var DataTable = function DataTable(props) {
6641
6890
  }).length] : [2, 1],
6642
6891
  rowspan = _ref2[0],
6643
6892
  colspan = _ref2[1];
6893
+ var headerClasses = (resizableStyle + " " + id).trim();
6644
6894
  return /*#__PURE__*/React.createElement("th", {
6645
6895
  key: id,
6646
- className: resizableStyle,
6896
+ className: headerClasses,
6647
6897
  rowSpan: rowspan,
6648
6898
  colSpan: colspan
6649
6899
  }, /*#__PURE__*/React.createElement("div", null, id === "checked" && onCheckAll ? /*#__PURE__*/React.createElement(CheckBox, {
6650
6900
  onChange: checkAll,
6651
6901
  value: allChecked
6652
- }) : /*#__PURE__*/React.createElement(Text, {
6902
+ }) : id === "actions" ? null : /*#__PURE__*/React.createElement(Text, {
6653
6903
  key: "th_" + id
6654
6904
  }, label), sortable ? /*#__PURE__*/React.createElement(SortIcon, {
6655
6905
  sortDir: sortDir[id],
@@ -6657,10 +6907,13 @@ var DataTable = function DataTable(props) {
6657
6907
  return changeSort(id);
6658
6908
  }
6659
6909
  }) : null));
6660
- }), /*#__PURE__*/React.createElement("th", {
6910
+ }), hasInfoRows ? /*#__PURE__*/React.createElement("th", {
6661
6911
  rowSpan: 2,
6662
- colSpan: 1
6663
- })), /*#__PURE__*/React.createElement("tr", null, columns.filter(function (_ref3) {
6912
+ colSpan: 1,
6913
+ style: {
6914
+ width: '3rem'
6915
+ }
6916
+ }) : null), /*#__PURE__*/React.createElement("tr", null, columns.filter(function (_ref3) {
6664
6917
  var type = _ref3.type;
6665
6918
  return type === TYPES$1.ENTITY;
6666
6919
  }).map(function (column) {
@@ -6683,7 +6936,8 @@ var DataTable = function DataTable(props) {
6683
6936
  onSelect: select,
6684
6937
  onDrop: moveRow,
6685
6938
  editable: editable,
6686
- expanded: expanded
6939
+ expanded: expanded,
6940
+ hasInfoRows: hasInfoRows
6687
6941
  });
6688
6942
  }) : /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
6689
6943
  colSpan: 1000
@@ -6764,7 +7018,9 @@ var DataTableRow$1 = function DataTableRow(props) {
6764
7018
  onSelect = props.onSelect,
6765
7019
  editable = props.editable,
6766
7020
  _props$expanded2 = props.expanded,
6767
- expanded = _props$expanded2 === void 0 ? false : _props$expanded2;
7021
+ expanded = _props$expanded2 === void 0 ? false : _props$expanded2,
7022
+ _props$hasInfoRows = props.hasInfoRows,
7023
+ hasInfoRows = _props$hasInfoRows === void 0 ? false : _props$hasInfoRows;
6768
7024
  var _row$selected = row.selected,
6769
7025
  selected = _row$selected === void 0 ? false : _row$selected,
6770
7026
  className = row.className;
@@ -6788,16 +7044,16 @@ var DataTableRow$1 = function DataTableRow(props) {
6788
7044
  cell: row[column.id],
6789
7045
  editable: editable || column.editable
6790
7046
  });
6791
- }), row.info ? /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement(Icon, {
7047
+ }), hasInfoRows ? row.info ? /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement(Icon, {
6792
7048
  icon: infoIcon,
6793
7049
  clickable: true,
6794
7050
  action: function action() {
6795
7051
  return toggleInfo(!isInfoOpen);
6796
7052
  }
6797
- })) : /*#__PURE__*/React.createElement("td", null)), row.info && isInfoOpen ? /*#__PURE__*/React.createElement("tr", {
7053
+ })) : /*#__PURE__*/React.createElement("td", null) : null), row.info && isInfoOpen ? /*#__PURE__*/React.createElement("tr", {
6798
7054
  className: "table-row-info"
6799
7055
  }, /*#__PURE__*/React.createElement("td", {
6800
- colSpan: columns.length + 1
7056
+ colSpan: columns.length + (hasInfoRows ? 1 : 0)
6801
7057
  }, isFunction$2(row.info) ? row.info() : row.info)) : null);
6802
7058
  };
6803
7059
 
@@ -8344,7 +8600,6 @@ var DataTable2 = function DataTable2(props) {
8344
8600
 
8345
8601
  // Handle tool selection
8346
8602
  var handleToolSelect = useCallback(function (toolId) {
8347
- console.log('handleToolSelect called with toolId:', toolId);
8348
8603
  setActiveTool(function (prev) {
8349
8604
  var newTool = prev === toolId ? null : toolId;
8350
8605
  console.log('Tool changed from', prev, 'to', newTool);
@@ -8361,12 +8616,12 @@ var DataTable2 = function DataTable2(props) {
8361
8616
  var defaultTools = useMemo(function () {
8362
8617
  return [{
8363
8618
  id: 'columns',
8364
- icon: 'person',
8619
+ icon: 'view_column',
8365
8620
  title: 'Configurar columnas',
8366
8621
  component: ColumnsPanel
8367
8622
  }, {
8368
8623
  id: 'export',
8369
- icon: 'person',
8624
+ icon: 'ios_share',
8370
8625
  title: 'Exportar datos',
8371
8626
  component: ExportPanel
8372
8627
  }];
@@ -8447,12 +8702,19 @@ var DataTable2 = function DataTable2(props) {
8447
8702
  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(' ');
8448
8703
  }, [size, density, theme, readability, striped, bordered, hover, loading, skeleton, className]);
8449
8704
 
8450
- // Check if any row has actions column
8705
+ // Check if any row has actions column or if there's an actions column defined
8451
8706
  var hasActionsColumn = useMemo(function () {
8452
- return rows.some(function (row) {
8707
+ var hasActionsColumnDefined = columns.some(function (col) {
8708
+ return col.id === 'actions';
8709
+ });
8710
+ var hasRowsWithActions = rows.some(function (row) {
8711
+ return row.actions && Array.isArray(row.actions);
8712
+ });
8713
+ var hasRowsWithInfo = rows.some(function (row) {
8453
8714
  return row.info;
8454
- }) || filterable;
8455
- }, [rows, filterable]);
8715
+ });
8716
+ return hasActionsColumnDefined || hasRowsWithActions || hasRowsWithInfo || filterable;
8717
+ }, [columns, rows, filterable]);
8456
8718
 
8457
8719
  // Función de ordenamiento (similar a table.js)
8458
8720
  var multiSort = useCallback(function (array, sortObject) {
@@ -8931,7 +9193,9 @@ var DataTableSummaryRow = function DataTableSummaryRow(_ref5) {
8931
9193
  }, summary.formatted) :
8932
9194
  // Mostrar "Total" en la primera columna si no hay checkboxes ni números
8933
9195
  index === 0 && !shouldShowCheckboxes && !showRowNumbers ? /*#__PURE__*/React.createElement("strong", null, "Total") : null);
8934
- }), hasActionsColumn && /*#__PURE__*/React.createElement("td", {
9196
+ }), hasActionsColumn && !columns.some(function (col) {
9197
+ return col.id === 'actions';
9198
+ }) && /*#__PURE__*/React.createElement("td", {
8935
9199
  className: "datatable2__summary-cell datatable2__summary-cell--actions"
8936
9200
  }));
8937
9201
  };
@@ -9132,9 +9396,11 @@ var DataTableHeader = function DataTableHeader(_ref8) {
9132
9396
  width: columnWidths[column.id],
9133
9397
  onResize: onColumnResize
9134
9398
  });
9135
- }), hasActionsColumn && /*#__PURE__*/React.createElement("th", {
9399
+ }), hasActionsColumn && !columns.some(function (col) {
9400
+ return col.id === 'actions';
9401
+ }) && /*#__PURE__*/React.createElement("th", {
9136
9402
  className: "datatable2__actions-header"
9137
- }, "Actions")), filterable && /*#__PURE__*/React.createElement(DataTableFiltersRow, {
9403
+ })), filterable && /*#__PURE__*/React.createElement(DataTableFiltersRow, {
9138
9404
  columns: columns,
9139
9405
  onClear: onClearFilters,
9140
9406
  showRowNumbers: showRowNumbers,
@@ -9382,6 +9648,34 @@ var DataTableRow = function DataTableRow(_ref1) {
9382
9648
  }
9383
9649
  }));
9384
9650
  }
9651
+
9652
+ // Manejar columna "actions" de manera especial
9653
+ if (column.id === 'actions') {
9654
+ return /*#__PURE__*/React.createElement("td", {
9655
+ key: column.id,
9656
+ className: "datatable2__actions-cell"
9657
+ }, row.actions && Array.isArray(row.actions) && /*#__PURE__*/React.createElement("div", {
9658
+ className: "datatable2__actions-container"
9659
+ }, row.actions.map(function (action, index) {
9660
+ return /*#__PURE__*/React.createElement("span", {
9661
+ key: index,
9662
+ className: "datatable2__action-item"
9663
+ }, action);
9664
+ })), row.info && /*#__PURE__*/React.createElement(Icon, {
9665
+ icon: isExpanded ? "expand_less" : "expand_more",
9666
+ size: "small",
9667
+ clickable: true,
9668
+ action: function action() {
9669
+ if (row.info && typeof row.info === 'object' && row.info.action) {
9670
+ row.info.action(row);
9671
+ }
9672
+ if (onRowExpand) {
9673
+ onRowExpand(row.id);
9674
+ }
9675
+ },
9676
+ className: "datatable2__expand-icon"
9677
+ }));
9678
+ }
9385
9679
  return /*#__PURE__*/React.createElement(DataTableCell, {
9386
9680
  key: column.id,
9387
9681
  column: column,
@@ -9393,7 +9687,9 @@ var DataTableRow = function DataTableRow(_ref1) {
9393
9687
  onCellEdit: onCellEdit,
9394
9688
  cellClassName: cellClassName
9395
9689
  });
9396
- }), hasActionsColumn && /*#__PURE__*/React.createElement("td", {
9690
+ }), hasActionsColumn && !columns.some(function (col) {
9691
+ return col.id === 'actions';
9692
+ }) && /*#__PURE__*/React.createElement("td", {
9397
9693
  className: "datatable2__actions-cell"
9398
9694
  }, row.info && /*#__PURE__*/React.createElement(Icon, {
9399
9695
  icon: isExpanded ? "expand_less" : "expand_more",
@@ -9406,7 +9702,8 @@ var DataTableRow = function DataTableRow(_ref1) {
9406
9702
  if (onRowExpand) {
9407
9703
  onRowExpand(row.id);
9408
9704
  }
9409
- }
9705
+ },
9706
+ className: "datatable2__expand-icon"
9410
9707
  })));
9411
9708
  };
9412
9709
 
@@ -9569,7 +9866,9 @@ var DataTableFiltersRow = function DataTableFiltersRow(_ref11) {
9569
9866
  key: column.id,
9570
9867
  className: "datatable2__filter-cell"
9571
9868
  }, column.filterable ? renderFilterField(column) : null);
9572
- }), hasActionsColumn && /*#__PURE__*/React.createElement("td", {
9869
+ }), hasActionsColumn && !columns.some(function (col) {
9870
+ return col.id === 'actions';
9871
+ }) && /*#__PURE__*/React.createElement("td", {
9573
9872
  className: "datatable2__filter-cell datatable2__filter-cell--actions"
9574
9873
  }, /*#__PURE__*/React.createElement(Icon, {
9575
9874
  icon: "close",
@@ -23133,5 +23432,5 @@ var isFunction = function isFunction(value) {
23133
23432
  return value && (Object.prototype.toString.call(value) === "[object Function]" || "function" === typeof value || value instanceof Function);
23134
23433
  };
23135
23434
 
23136
- export { Accordion, ActionButton, Avatar, Button, Calendar, ChangeUserPasswordAction, ChangeUserPasswordDialog, CheckBox, Chip, Chips, CircularProgress, CollectionAPI$1 as CollectionAPI, CollectionAPI as CollectionAPI2, CollectionContext$1 as CollectionContext, CollectionContext as CollectionContext2, CollectionEditor$2 as CollectionEditor, CollectionFilters$1 as CollectionFilters, CollectionPage$1 as CollectionPage, CollectionPage as CollectionPage2, CollectionTree, ColorField, Content, ContentEditor, ContentForm, ContentViewer, CreateContentDialog, DataTable, DataTable2, DateRange, DateRange2, Dialog, DropDown, DropDown2, DynamicForm, EditContentDialog, EmptyMessage, FORMATS$1 as FORMATS, FieldEditor, FileExplorer, FileExplorerView, FileGridItem, FilesGridView, FilesSearchBox, FilesTableView, _FoldersTreeView as FoldersTreeView, ForgetUserPasswordAction, Form, HTTPClient, Header, Header2, Icon, ImageViewer, Kanban, KanbanCard, KanbanColumn, KanbanHeader, KanbanSwimlane, LOGIN_API, LOGIN_CONTEXT, LOGIN_DICTIONARY, LinearProgress, List, ListEditor, LoginBox, Menu, MenuIcon, MenuItem, MenuSeparator, MonthCalendar, MultiSelector, Page, PageContext, PageLink, PageProvider, PasswordEditor, PasswordField, PasswordField2, Planner, Planner2, Property, RadioButton, RadioGroup, ResetPasswordBox, Section, Session, Site, SiteContext, SiteProvider, Stack, Switch, Switch2, TASK_STATES, TEXTFORMATS, TYPES$1 as TYPES, Tab, TabbedContentEditor, TabbedTablePage, TabbedView, TableEditor$2 as TableEditor, TablePage, TablePage2, Tabs, TaskContext, TaskContextProvider, TaskMonitor, TaskProgress, Text, TextArea, TextArea2, TextField, TextField2, Thumbnail, ToggleButton, TokenField, Tooltip, Tree, TreeItem, TreeNode, TreededContentEditor, UnlockUserAction, UploadArea, UploadDialog, UploadFile$1 as UploadFile, UploadForm, UploadIcon, Uploader, View, Viewer, WaitScreen, Wizard, WizardContext, isEmpty, isFunction, useHashPage, validatePassword };
23435
+ export { Accordion, ActionButton, ActionsCell, Avatar, Button, Calendar, ChangeUserPasswordAction, ChangeUserPasswordDialog, CheckBox, Chip, Chips, CircularProgress, CollectionAPI$1 as CollectionAPI, CollectionAPI as CollectionAPI2, CollectionContext$1 as CollectionContext, CollectionContext as CollectionContext2, CollectionEditor$2 as CollectionEditor, CollectionFilters$1 as CollectionFilters, CollectionPage$1 as CollectionPage, CollectionPage as CollectionPage2, CollectionTree, ColorField, Content, ContentEditor, ContentForm, ContentViewer, CreateContentDialog, DataTable, DataTable2, DateRange, DateRange2, Dialog, DropDown, DropDown2, DynamicForm, EditContentDialog, EmptyMessage, FORMATS$1 as FORMATS, FieldEditor, FileExplorer, FileExplorerView, FileGridItem, FilesGridView, FilesSearchBox, FilesTableView, _FoldersTreeView as FoldersTreeView, ForgetUserPasswordAction, Form, HTTPClient, Header, Header2, Icon, ImageViewer, Kanban, KanbanCard, KanbanColumn, KanbanHeader, KanbanSwimlane, LOGIN_API, LOGIN_CONTEXT, LOGIN_DICTIONARY, LinearProgress, List, ListEditor, LoginBox, Menu, MenuIcon, MenuItem, MenuSeparator, MonthCalendar, MultiSelector, Page, PageContext, PageLink, PageProvider, PasswordEditor, PasswordField, PasswordField2, Planner, Planner2, Property, RadioButton, RadioGroup, ResetPasswordBox, Section, Session, Site, SiteContext, SiteProvider, Stack, Switch, Switch2, TASK_STATES, TEXTFORMATS, TYPES$1 as TYPES, Tab, TabbedContentEditor, TabbedTablePage, TabbedView, TableEditor$2 as TableEditor, TablePage, TablePage2, Tabs, TaskContext, TaskContextProvider, TaskMonitor, TaskProgress, Text, TextArea, TextArea2, TextField, TextField2, Thumbnail, ToggleButton, TokenField, Tooltip, Tree, TreeItem, TreeNode, TreededContentEditor, UnlockUserAction, UploadArea, UploadDialog, UploadFile$1 as UploadFile, UploadForm, UploadIcon, Uploader, View, Viewer, WaitScreen, Wizard, WizardContext, isEmpty, isFunction, useHashPage, validatePassword };
23137
23436
  //# sourceMappingURL=index.modern.js.map