ywana-core8 0.1.79 → 0.1.81

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 (70) hide show
  1. package/dist/index.cjs +3493 -2320
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +2096 -1125
  4. package/dist/index.css.map +1 -1
  5. package/dist/index.modern.js +3493 -2320
  6. package/dist/index.modern.js.map +1 -1
  7. package/dist/index.umd.js +3493 -2320
  8. package/dist/index.umd.js.map +1 -1
  9. package/package.json +1 -1
  10. package/src/html/ExampleLayout.css +401 -0
  11. package/src/html/ExampleLayout.js +192 -0
  12. package/src/html/README-sidebar-navigation.md +195 -0
  13. package/src/html/accordion.example.js +123 -4
  14. package/src/html/accordion.example.js.backup +390 -0
  15. package/src/html/button.example.js +50 -3
  16. package/src/html/button.example.js.backup +374 -0
  17. package/src/html/button.example.new.js +416 -0
  18. package/src/html/button.js +22 -4
  19. package/src/html/checkbox.example.js +93 -4
  20. package/src/html/checkbox.example.js.backup +316 -0
  21. package/src/html/chip.example.js +108 -4
  22. package/src/html/chip.example.js.backup +355 -0
  23. package/src/html/color.example.js +108 -4
  24. package/src/html/color.example.js.backup +527 -0
  25. package/src/html/components.example.js +123 -4
  26. package/src/html/components.example.js.backup +492 -0
  27. package/src/html/convert-examples.js +183 -0
  28. package/src/html/demo-sidebar.html +410 -0
  29. package/src/html/form.example.js +93 -4
  30. package/src/html/form.example.js.backup +385 -0
  31. package/src/html/header.js +20 -3
  32. package/src/html/header2.example.js +108 -4
  33. package/src/html/header2.example.js.backup +411 -0
  34. package/src/html/icon.example.js +77 -3
  35. package/src/html/icon.example.js.backup +268 -0
  36. package/src/html/list.example.js +93 -4
  37. package/src/html/list.example.js.backup +404 -0
  38. package/src/html/progress.example.js +74 -4
  39. package/src/html/progress.example.js.backup +424 -0
  40. package/src/html/property.example.js +123 -4
  41. package/src/html/property.example.js.backup +553 -0
  42. package/src/html/radio.example.js +108 -4
  43. package/src/html/radio.example.js.backup +389 -0
  44. package/src/html/section.example.js +42 -3
  45. package/src/html/section.example.js.backup +99 -0
  46. package/src/html/switch.example.js +108 -4
  47. package/src/html/switch.example.js.backup +461 -0
  48. package/src/html/tab.example.js +93 -4
  49. package/src/html/tab.example.js.backup +446 -0
  50. package/src/html/table-export-utils.js +483 -0
  51. package/src/html/table-summary-functions.js +363 -0
  52. package/src/html/table2.css +1449 -479
  53. package/src/html/table2.example.js +2937 -512
  54. package/src/html/table2.example.js.broken +1226 -0
  55. package/src/html/table2.js +1426 -1000
  56. package/src/html/test-resize.html +279 -0
  57. package/src/html/test-selection.html +387 -0
  58. package/src/html/textfield.js +73 -7
  59. package/src/html/textfield2.example.js +108 -4
  60. package/src/html/textfield2.example.js.backup +1370 -0
  61. package/src/html/textfield2.js +19 -4
  62. package/src/html/tokenfield.example.js +108 -4
  63. package/src/html/tokenfield.example.js.backup +503 -0
  64. package/src/html/tooltip.js +21 -3
  65. package/src/html/tree.css +2 -4
  66. package/src/html/tree.example.js +93 -4
  67. package/src/html/tree.example.js.backup +475 -0
  68. package/src/html/tree.js +19 -3
  69. package/src/widgets/login/LoginBox.css +1 -0
  70. package/src/widgets/login/LoginBox.js +29 -6
package/src/html/tree.js CHANGED
@@ -240,6 +240,7 @@ export const TreeNode = (props) => {
240
240
  if (disabled || !expandable) return
241
241
 
242
242
  event.preventDefault()
243
+ event.stopPropagation()
243
244
  setIsOpen(prev => !prev)
244
245
  }, [disabled, expandable])
245
246
 
@@ -337,14 +338,26 @@ export const TreeNode = (props) => {
337
338
  >
338
339
  <summary
339
340
  className="tree-item"
340
- onClick={handleToggle}
341
+ onClick={(event) => {
342
+ // Si se hace click en el área general del nodo (no en el label), toggle
343
+ if (event.target === event.currentTarget ||
344
+ event.target.closest('.tree-node__toggle')) {
345
+ handleToggle(event)
346
+ }
347
+ }}
341
348
  onKeyDown={handleKeyDown}
342
349
  {...ariaAttributes}
343
350
  title={tooltip}
344
351
  >
345
352
  {/* Expand/collapse indicator */}
346
353
  {hasChildren && expandable && (
347
- <div className="tree-node__toggle">
354
+ <div
355
+ className="tree-node__toggle"
356
+ onClick={(event) => {
357
+ event.stopPropagation()
358
+ handleToggle(event)
359
+ }}
360
+ >
348
361
  <Icon
349
362
  icon={isOpen ? 'expand_less' : 'expand_more'}
350
363
  size="small"
@@ -374,7 +387,10 @@ export const TreeNode = (props) => {
374
387
  {/* Label with badge */}
375
388
  <div
376
389
  className={`label ${clickable}`}
377
- onClick={handleSelect}
390
+ onClick={(event) => {
391
+ event.stopPropagation()
392
+ handleSelect(event)
393
+ }}
378
394
  >
379
395
  <span className="tree-node__label-text">
380
396
  {labelTxt}
@@ -6,6 +6,7 @@
6
6
  padding: 1rem 1rem 0 1rem;
7
7
  display: flex;
8
8
  flex-direction: column;
9
+ gap: 1rem
9
10
  }
10
11
 
11
12
  .login-box .message {
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from 'react'
2
- import { Icon , Button, Text, TextField } from '../../html'
2
+ import { Icon , Button, Text, TextField2 as TextField } from '../../html'
3
3
  import './LoginBox.css'
4
4
 
5
5
  /**
@@ -24,23 +24,46 @@ export const LoginBox = ({
24
24
  if (onOK && canOK()) onOK(user, forcedPwd || password)
25
25
  }
26
26
 
27
+ // Helper function for backward compatibility
28
+ // TextField2 now supports both strings and React elements
27
29
  function tx(txt) {
30
+ // For TextField2, we can pass strings directly for better performance
31
+ // But keep this function for backward compatibility with other components
28
32
  return <Text>{txt}</Text>
29
33
  }
30
34
 
31
- function changeUser(id, value) {
35
+ function changeUser(_, value) {
32
36
  setUser(value)
33
37
  }
34
-
35
- function changePassword(id, value) {
38
+
39
+ function changePassword(_, value) {
36
40
  setPassword(value)
37
41
  }
38
42
 
39
43
  return (
40
44
  <div className="login-box">
41
45
  <main>
42
- <TextField label={tx(userLabel)} value={user} onChange={changeUser} onEnter={ok} outlined autoComplete="on" />
43
- <TextField id="loginbox-password" label={tx(passwordLabel)} value={password} onChange={changePassword} onEnter={ok} type="password" outlined autoComplete="on" />
46
+ <TextField
47
+ id="loginbox-user"
48
+ label={tx(userLabel)}
49
+ value={user}
50
+ onChange={changeUser}
51
+ onEnter={ok}
52
+ outlined
53
+ autoComplete="username"
54
+ required
55
+ />
56
+ <TextField
57
+ id="loginbox-password"
58
+ label={tx(passwordLabel)}
59
+ value={password}
60
+ onChange={changePassword}
61
+ onEnter={ok}
62
+ type="password"
63
+ outlined
64
+ autoComplete="current-password"
65
+ required
66
+ />
44
67
  </main>
45
68
  <footer>
46
69
  { loading ? <div className="load-box"><Icon icon="refresh" /></div> : null }