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.
- package/dist/index.cjs +3493 -2320
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +2096 -1125
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +3493 -2320
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +3493 -2320
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/html/ExampleLayout.css +401 -0
- package/src/html/ExampleLayout.js +192 -0
- package/src/html/README-sidebar-navigation.md +195 -0
- package/src/html/accordion.example.js +123 -4
- package/src/html/accordion.example.js.backup +390 -0
- package/src/html/button.example.js +50 -3
- package/src/html/button.example.js.backup +374 -0
- package/src/html/button.example.new.js +416 -0
- package/src/html/button.js +22 -4
- package/src/html/checkbox.example.js +93 -4
- package/src/html/checkbox.example.js.backup +316 -0
- package/src/html/chip.example.js +108 -4
- package/src/html/chip.example.js.backup +355 -0
- package/src/html/color.example.js +108 -4
- package/src/html/color.example.js.backup +527 -0
- package/src/html/components.example.js +123 -4
- package/src/html/components.example.js.backup +492 -0
- package/src/html/convert-examples.js +183 -0
- package/src/html/demo-sidebar.html +410 -0
- package/src/html/form.example.js +93 -4
- package/src/html/form.example.js.backup +385 -0
- package/src/html/header.js +20 -3
- package/src/html/header2.example.js +108 -4
- package/src/html/header2.example.js.backup +411 -0
- package/src/html/icon.example.js +77 -3
- package/src/html/icon.example.js.backup +268 -0
- package/src/html/list.example.js +93 -4
- package/src/html/list.example.js.backup +404 -0
- package/src/html/progress.example.js +74 -4
- package/src/html/progress.example.js.backup +424 -0
- package/src/html/property.example.js +123 -4
- package/src/html/property.example.js.backup +553 -0
- package/src/html/radio.example.js +108 -4
- package/src/html/radio.example.js.backup +389 -0
- package/src/html/section.example.js +42 -3
- package/src/html/section.example.js.backup +99 -0
- package/src/html/switch.example.js +108 -4
- package/src/html/switch.example.js.backup +461 -0
- package/src/html/tab.example.js +93 -4
- package/src/html/tab.example.js.backup +446 -0
- package/src/html/table-export-utils.js +483 -0
- package/src/html/table-summary-functions.js +363 -0
- package/src/html/table2.css +1449 -479
- package/src/html/table2.example.js +2937 -512
- package/src/html/table2.example.js.broken +1226 -0
- package/src/html/table2.js +1426 -1000
- package/src/html/test-resize.html +279 -0
- package/src/html/test-selection.html +387 -0
- package/src/html/textfield.js +73 -7
- package/src/html/textfield2.example.js +108 -4
- package/src/html/textfield2.example.js.backup +1370 -0
- package/src/html/textfield2.js +19 -4
- package/src/html/tokenfield.example.js +108 -4
- package/src/html/tokenfield.example.js.backup +503 -0
- package/src/html/tooltip.js +21 -3
- package/src/html/tree.css +2 -4
- package/src/html/tree.example.js +93 -4
- package/src/html/tree.example.js.backup +475 -0
- package/src/html/tree.js +19 -3
- package/src/widgets/login/LoginBox.css +1 -0
- package/src/widgets/login/LoginBox.js +29 -6
package/src/html/textfield.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import React, { useContext, useEffect, useState } from 'react'
|
1
|
+
import React, { useContext, useEffect, useState, useMemo } from 'react'
|
2
2
|
import { SiteContext } from '../site/siteContext'
|
3
3
|
import { Icon } from './icon'
|
4
4
|
import { TEXTFORMATS, Text } from './text'
|
@@ -59,7 +59,25 @@ export const TextField = (props) => {
|
|
59
59
|
const labelStyle = label ? "" : "no-label"
|
60
60
|
const labelPositionStyle = labelPosition == 'left' ? "label-left" : "label-top"
|
61
61
|
const style = `${labelStyle} ${labelPositionStyle} ${borderStyle} textfield-${type}`
|
62
|
-
|
62
|
+
|
63
|
+
// Label text - support both string and React components
|
64
|
+
const labelTxt = useMemo(() => {
|
65
|
+
if (!label) return null
|
66
|
+
|
67
|
+
// If label is already a React element, use it directly
|
68
|
+
if (React.isValidElement(label)) {
|
69
|
+
return label
|
70
|
+
}
|
71
|
+
|
72
|
+
// If label is a string, wrap it in Text component
|
73
|
+
if (typeof label === 'string') {
|
74
|
+
return <Text>{label}</Text>
|
75
|
+
}
|
76
|
+
|
77
|
+
// Fallback for other types (convert to string)
|
78
|
+
return <Text>{String(label)}</Text>
|
79
|
+
}, [label])
|
80
|
+
|
63
81
|
const placeholderTxt = site.translate ? site.translate(placeholder) : placeholder
|
64
82
|
|
65
83
|
return (
|
@@ -110,10 +128,26 @@ export const TextArea = (props) => {
|
|
110
128
|
if (onChange) onChange(id, "")
|
111
129
|
}
|
112
130
|
|
113
|
-
const borderStyle = outlined ? "textarea-outlined" : "textarea"
|
114
131
|
const labelStyle = label ? "" : "no-label"
|
115
132
|
const style = `textarea ${labelStyle} textarea-${type}`
|
116
|
-
|
133
|
+
|
134
|
+
// Label text - support both string and React components
|
135
|
+
const labelTxt = useMemo(() => {
|
136
|
+
if (!label) return null
|
137
|
+
|
138
|
+
// If label is already a React element, use it directly
|
139
|
+
if (React.isValidElement(label)) {
|
140
|
+
return label
|
141
|
+
}
|
142
|
+
|
143
|
+
// If label is a string, wrap it in Text component
|
144
|
+
if (typeof label === 'string') {
|
145
|
+
return <Text>{label}</Text>
|
146
|
+
}
|
147
|
+
|
148
|
+
// Fallback for other types (convert to string)
|
149
|
+
return <Text>{String(label)}</Text>
|
150
|
+
}, [label])
|
117
151
|
|
118
152
|
const placeholderTxt = site.translate ? site.translate(placeholder) : placeholder
|
119
153
|
|
@@ -222,7 +256,7 @@ export const DropDown = (props) => {
|
|
222
256
|
*/
|
223
257
|
export const DateRange = (props) => {
|
224
258
|
|
225
|
-
const { id, label,
|
259
|
+
const { id, label, onChange } = props
|
226
260
|
const [form, setForm] = useState({})
|
227
261
|
|
228
262
|
useEffect(() => {
|
@@ -237,7 +271,23 @@ export const DateRange = (props) => {
|
|
237
271
|
setForm(next)
|
238
272
|
}
|
239
273
|
|
240
|
-
|
274
|
+
// Label text - support both string and React components
|
275
|
+
const labelTxt = useMemo(() => {
|
276
|
+
if (!label) return null
|
277
|
+
|
278
|
+
// If label is already a React element, use it directly
|
279
|
+
if (React.isValidElement(label)) {
|
280
|
+
return label
|
281
|
+
}
|
282
|
+
|
283
|
+
// If label is a string, wrap it in Text component
|
284
|
+
if (typeof label === 'string') {
|
285
|
+
return <Text>{label}</Text>
|
286
|
+
}
|
287
|
+
|
288
|
+
// Fallback for other types (convert to string)
|
289
|
+
return <Text>{String(label)}</Text>
|
290
|
+
}, [label])
|
241
291
|
|
242
292
|
return (
|
243
293
|
<div className="date-range">
|
@@ -257,7 +307,23 @@ export const PasswordField = (props) => {
|
|
257
307
|
setShow(!show)
|
258
308
|
}
|
259
309
|
|
260
|
-
|
310
|
+
// Label text - support both string and React components
|
311
|
+
const labelTxt = useMemo(() => {
|
312
|
+
if (!label) return null
|
313
|
+
|
314
|
+
// If label is already a React element, use it directly
|
315
|
+
if (React.isValidElement(label)) {
|
316
|
+
return label
|
317
|
+
}
|
318
|
+
|
319
|
+
// If label is a string, wrap it in Text component
|
320
|
+
if (typeof label === 'string') {
|
321
|
+
return <Text>{label}</Text>
|
322
|
+
}
|
323
|
+
|
324
|
+
// Fallback for other types (convert to string)
|
325
|
+
return <Text>{String(label)}</Text>
|
326
|
+
}, [label])
|
261
327
|
|
262
328
|
return (
|
263
329
|
<div className="password-field">
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import React, { useState } from 'react'
|
2
|
-
import { TextField2, TextArea2, PasswordField2, DropDown2, DateRange2 } from '
|
2
|
+
import { TextField2, TextArea2, PasswordField2, DropDown2, DateRange2 } from '
|
3
|
+
import { ExampleLayout, ExampleSection, ExampleSubsection, CodeSnippet } from './ExampleLayout'./textfield2'
|
3
4
|
|
4
5
|
/**
|
5
6
|
* Ejemplos de uso de los componentes TextField2 mejorados
|
@@ -87,9 +88,111 @@ export const TextField2Examples = () => {
|
|
87
88
|
{ value: 'urgent', label: 'Urgent', icon: 'warning' }
|
88
89
|
]
|
89
90
|
|
91
|
+
// Definir secciones para el menú lateral
|
92
|
+
|
93
|
+
|
94
|
+
const sections =
|
95
|
+
|
96
|
+
[
|
97
|
+
|
98
|
+
|
99
|
+
{
|
100
|
+
|
101
|
+
|
102
|
+
"id": "overview",
|
103
|
+
|
104
|
+
|
105
|
+
"title": "Introducción",
|
106
|
+
|
107
|
+
|
108
|
+
"icon": "info"
|
109
|
+
|
110
|
+
|
111
|
+
},
|
112
|
+
|
113
|
+
|
114
|
+
{
|
115
|
+
|
116
|
+
|
117
|
+
"id": "basic-examples",
|
118
|
+
|
119
|
+
|
120
|
+
"title": "Ejemplos Básicos",
|
121
|
+
|
122
|
+
|
123
|
+
"icon": "widgets"
|
124
|
+
|
125
|
+
|
126
|
+
},
|
127
|
+
|
128
|
+
|
129
|
+
{
|
130
|
+
|
131
|
+
|
132
|
+
"id": "advanced-features",
|
133
|
+
|
134
|
+
|
135
|
+
"title": "Características Avanzadas",
|
136
|
+
|
137
|
+
|
138
|
+
"icon": "settings"
|
139
|
+
|
140
|
+
|
141
|
+
},
|
142
|
+
|
143
|
+
|
144
|
+
{
|
145
|
+
|
146
|
+
|
147
|
+
"id": "variants",
|
148
|
+
|
149
|
+
|
150
|
+
"title": "Variantes y Temas",
|
151
|
+
|
152
|
+
|
153
|
+
"icon": "palette"
|
154
|
+
|
155
|
+
|
156
|
+
},
|
157
|
+
|
158
|
+
|
159
|
+
{
|
160
|
+
|
161
|
+
|
162
|
+
"id": "states",
|
163
|
+
|
164
|
+
|
165
|
+
"title": "Estados",
|
166
|
+
|
167
|
+
|
168
|
+
"icon": "toggle_on"
|
169
|
+
|
170
|
+
|
171
|
+
},
|
172
|
+
|
173
|
+
|
174
|
+
{
|
175
|
+
|
176
|
+
|
177
|
+
"id": "sizes",
|
178
|
+
|
179
|
+
|
180
|
+
"title": "Tamaños",
|
181
|
+
|
182
|
+
|
183
|
+
"icon": "format_size"
|
184
|
+
|
185
|
+
|
186
|
+
}
|
187
|
+
|
188
|
+
|
189
|
+
]
|
190
|
+
|
191
|
+
|
192
|
+
|
90
193
|
return (
|
91
|
-
<
|
92
|
-
<
|
194
|
+
<ExampleLayout title="Textfield2 Examples" sections={sections}>
|
195
|
+
<ExampleSection id="overview" title="Ejemplos de Componentes TextField2 Mejorados" icon="widgets">
|
93
196
|
|
94
197
|
<div style={{
|
95
198
|
background: '#f8f9fa',
|
@@ -1363,7 +1466,8 @@ export const TextField2Examples = () => {
|
|
1363
1466
|
</div>
|
1364
1467
|
</div>
|
1365
1468
|
</section>
|
1366
|
-
|
1469
|
+
</ExampleSection>
|
1470
|
+
</ExampleLayout>
|
1367
1471
|
)
|
1368
1472
|
}
|
1369
1473
|
|