ywana-core8 0.0.227 → 0.0.231
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 +48 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +27 -0
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +47 -2
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +48 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/ContentType.js +1 -0
- package/src/html/index.js +2 -1
- package/src/html/table.js +11 -1
- package/src/html/thumbnail.css +16 -0
- package/src/html/thumbnail.js +22 -0
- package/src/widgets/index.js +2 -1
- package/src/widgets/waiter/index.js +1 -0
- package/src/widgets/waiter/waiter.css +11 -0
- package/src/widgets/waiter/waiter.js +11 -0
package/package.json
CHANGED
package/src/html/index.js
CHANGED
@@ -17,4 +17,5 @@ export { TextField, DropDown } from './textfield'
|
|
17
17
|
export { TokenField } from './tokenfield'
|
18
18
|
export { Tree, TreeNode, TreeItem } from './tree'
|
19
19
|
export { Switch } from './switch'
|
20
|
-
export { Tooltip } from './tooltip'
|
20
|
+
export { Tooltip } from './tooltip'
|
21
|
+
export { Thumbnail } from './thumbnail'
|
package/src/html/table.js
CHANGED
@@ -203,8 +203,18 @@ const BooleanCellViewer = ({ id, value = false }) => {
|
|
203
203
|
const StringCellViewer = ({ id, value, format, options }) => {
|
204
204
|
const option = options ? options.find(o => o.value === value) : null
|
205
205
|
let text = option ? option.label : value
|
206
|
+
const locale = window.navigator.userLanguage || window.navigator.language;
|
206
207
|
switch (format) {
|
207
|
-
case FORMATS.DATE: text = new Date(text).toLocaleString(
|
208
|
+
case FORMATS.DATE: text = new Date(text).toLocaleString( locale, {
|
209
|
+
year: 'numeric',
|
210
|
+
month: 'numeric',
|
211
|
+
day: 'numeric'
|
212
|
+
}); break;
|
213
|
+
case FORMATS.TIME: text = new Date(text).toLocaleString( locale, {
|
214
|
+
year: 'hour',
|
215
|
+
month: 'minute',
|
216
|
+
day: 'second'
|
217
|
+
}); break;
|
208
218
|
}
|
209
219
|
return (<div className="field-editor string-viewer">{text}</div>)
|
210
220
|
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import './thumbnail.css'
|
3
|
+
|
4
|
+
/**
|
5
|
+
* Thumbnail
|
6
|
+
*/
|
7
|
+
export const Thumbnail = (props) => {
|
8
|
+
|
9
|
+
const {
|
10
|
+
src = "https://www.w3schools.com/howto/img_forest.jpg",
|
11
|
+
empty = "",
|
12
|
+
objectFit = "cover"
|
13
|
+
} = props
|
14
|
+
|
15
|
+
const image = src ? src : empty
|
16
|
+
const style = { objectFit }
|
17
|
+
return (
|
18
|
+
<div className="thumbnail" >
|
19
|
+
<img src={image} style={style} />
|
20
|
+
</div>
|
21
|
+
)
|
22
|
+
}
|
package/src/widgets/index.js
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
export * from './waiter'
|