ywana-core8 0.0.236 → 0.0.240
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/__reactpreview__/Wrapper.tsx +16 -7
- package/dist/index.cjs +81 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +178 -3
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +81 -8
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +81 -7
- package/dist/index.umd.js.map +1 -1
- package/package.json +3 -1
- package/src/domain/TablePage.js +5 -3
- package/src/html/header.css +2 -1
- package/src/html/index.js +1 -1
- package/src/html/textarea.css +158 -0
- package/src/html/textfield.css +7 -2
- package/src/html/textfield.js +55 -2
- package/src/html/textfield.test.js +21 -0
- package/src/widgets/kanban/Kanban.test.js +18 -0
- package/src/widgets/planner/Planner.css +179 -0
- package/src/widgets/planner/Planner.js +208 -0
- package/src/widgets/planner/Planner.test.js +25 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "ywana-core8",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.240",
|
4
4
|
"description": "ywana-core8",
|
5
5
|
"author": "Ernesto Roldan Garcia",
|
6
6
|
"license": "MIT",
|
@@ -31,6 +31,8 @@
|
|
31
31
|
"dependencies": {
|
32
32
|
"deep-equal": "^2.0.5",
|
33
33
|
"material-design-icons-iconfont": "^6.1.1",
|
34
|
+
"moment": "^2.29.1",
|
35
|
+
"moment-range": "^4.0.2",
|
34
36
|
"react-datepicker": "^4.6.0",
|
35
37
|
"react-error-overlay": "^6.0.10",
|
36
38
|
"react-notifications": "^1.7.3",
|
package/src/domain/TablePage.js
CHANGED
@@ -312,11 +312,14 @@ const TableEditor = (props) => {
|
|
312
312
|
|
313
313
|
function renderGroupLabel(groupName) {
|
314
314
|
const grouper = schema[groupBy]
|
315
|
+
|
316
|
+
if (!groupName || !grouper) return ""
|
317
|
+
|
315
318
|
if (grouper.options) {
|
316
319
|
const options = CHECK['isFunction'](grouper.options) ? grouper.options() : grouper.options
|
317
320
|
const option = options.find(option => option.value === groupName)
|
318
321
|
console.log(groupName, options, option )
|
319
|
-
return option
|
322
|
+
return option ? option.label : groupName
|
320
323
|
} else {
|
321
324
|
return groupName
|
322
325
|
}
|
@@ -372,8 +375,7 @@ const TableEditor = (props) => {
|
|
372
375
|
|
373
376
|
return (
|
374
377
|
<Fragment key={groupName}>
|
375
|
-
<Header title={groupName} >
|
376
|
-
{renderGroupLabel(groupName)}
|
378
|
+
<Header title={renderGroupLabel(groupName)} >
|
377
379
|
<span className="size">{groupSize}</span>
|
378
380
|
</Header>
|
379
381
|
<DataTable {...table} onRowSelection={select} editable={editable} onCheckAll={check} />
|
package/src/html/header.css
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
align-items: center;
|
6
6
|
background-repeat: no-repeat;
|
7
7
|
background-size: cover;
|
8
|
+
overflow: visible;
|
8
9
|
}
|
9
10
|
|
10
11
|
.header>.icon .header>img {
|
@@ -50,7 +51,7 @@
|
|
50
51
|
display: flex;
|
51
52
|
flex-direction: row-reverse;
|
52
53
|
align-items: center;
|
53
|
-
overflow:
|
54
|
+
overflow: visible;
|
54
55
|
}
|
55
56
|
|
56
57
|
.header.primary {
|
package/src/html/index.js
CHANGED
@@ -13,7 +13,7 @@ export { Section } from './section'
|
|
13
13
|
export { Tabs, Tab, Stack } from './tab'
|
14
14
|
export { DataTable } from './table'
|
15
15
|
export { Text } from './text'
|
16
|
-
export { TextField, DropDown } from './textfield'
|
16
|
+
export { TextField, DropDown, TextArea } from './textfield'
|
17
17
|
export { TokenField } from './tokenfield'
|
18
18
|
export { Tree, TreeNode, TreeItem } from './tree'
|
19
19
|
export { Switch } from './switch'
|
@@ -0,0 +1,158 @@
|
|
1
|
+
.textarea {
|
2
|
+
flex: 1;
|
3
|
+
position: relative;
|
4
|
+
padding-top: 1.5rem;
|
5
|
+
overflow: hidden;
|
6
|
+
display: flex;
|
7
|
+
min-height: 3.5;
|
8
|
+
}
|
9
|
+
|
10
|
+
.textarea.no-label {
|
11
|
+
padding-top: .5rem;
|
12
|
+
padding-bottom: .5rem;
|
13
|
+
}
|
14
|
+
|
15
|
+
.textarea > textarea {
|
16
|
+
flex: 1;
|
17
|
+
padding: 10px 10px 10px .5rem;
|
18
|
+
display: block;
|
19
|
+
border: none;
|
20
|
+
border-bottom: 1px solid var(--divider-color);
|
21
|
+
overflow: hidden;
|
22
|
+
font-size: 1rem;
|
23
|
+
color: var(--text-color);
|
24
|
+
background-color: var(--paper-color);
|
25
|
+
}
|
26
|
+
|
27
|
+
.textarea > textarea:focus {
|
28
|
+
outline: none;
|
29
|
+
}
|
30
|
+
|
31
|
+
.textarea>.icon {
|
32
|
+
position: absolute;
|
33
|
+
top: 1.5rem;
|
34
|
+
right: .2rem;
|
35
|
+
color: rgba(150,150,150,1);
|
36
|
+
}
|
37
|
+
|
38
|
+
.textarea-date>.icon,
|
39
|
+
.textarea-DATE>.icon {
|
40
|
+
right: 2.5rem;
|
41
|
+
}
|
42
|
+
|
43
|
+
.textarea > label {
|
44
|
+
color: var(--primary-color);
|
45
|
+
font-size: .9rem;
|
46
|
+
font-weight: normal;
|
47
|
+
position: absolute;
|
48
|
+
pointer-events: none;
|
49
|
+
left: .4rem;
|
50
|
+
top: 2rem;
|
51
|
+
transition: 0.2s ease all;
|
52
|
+
-moz-transition: 0.2s ease all;
|
53
|
+
-webkit-transition: 0.2s ease all;
|
54
|
+
}
|
55
|
+
|
56
|
+
textarea:read-only {
|
57
|
+
background-color: rgba(200,200,200,.1);
|
58
|
+
border: 0px !important;
|
59
|
+
}
|
60
|
+
|
61
|
+
.textarea textarea[type="date"] ~ label {
|
62
|
+
top: .3rem;
|
63
|
+
font-size: .8rem;
|
64
|
+
color: var(--primary-color);
|
65
|
+
}
|
66
|
+
|
67
|
+
/* active state */
|
68
|
+
textarea:read-only ~ label,
|
69
|
+
.textarea > textarea:focus ~ label,
|
70
|
+
.textarea > textarea:valid ~ label {
|
71
|
+
top: .3rem;
|
72
|
+
font-size: .8rem;
|
73
|
+
color: var(--primary-color);
|
74
|
+
}
|
75
|
+
|
76
|
+
.textarea > .bar {
|
77
|
+
position: relative;
|
78
|
+
display: block;
|
79
|
+
}
|
80
|
+
|
81
|
+
.textarea > .bar:before,
|
82
|
+
.textarea > .bar:after {
|
83
|
+
content: "";
|
84
|
+
height: 2px;
|
85
|
+
width: 0;
|
86
|
+
bottom: 1px;
|
87
|
+
position: absolute;
|
88
|
+
background: #5264ae;
|
89
|
+
transition: 0.2s ease all;
|
90
|
+
-moz-transition: 0.2s ease all;
|
91
|
+
-webkit-transition: 0.2s ease all;
|
92
|
+
}
|
93
|
+
|
94
|
+
.textarea > .bar:before {
|
95
|
+
left: 50%;
|
96
|
+
}
|
97
|
+
|
98
|
+
.textarea > .bar:after {
|
99
|
+
right: 50%;
|
100
|
+
}
|
101
|
+
|
102
|
+
/* active state */
|
103
|
+
.textarea > textarea:focus ~ .bar:before,
|
104
|
+
.textarea > textarea:focus ~ .bar:after {
|
105
|
+
width: 50%;
|
106
|
+
}
|
107
|
+
|
108
|
+
.dropdown {
|
109
|
+
position: relative;
|
110
|
+
}
|
111
|
+
|
112
|
+
.dropdown>.icon {
|
113
|
+
position: absolute;
|
114
|
+
top: 1.7rem;
|
115
|
+
right: .2rem;
|
116
|
+
}
|
117
|
+
|
118
|
+
.dropdown>.textarea>.icon,
|
119
|
+
.dropdown>.textarea-outlined>.icon {
|
120
|
+
position: absolute;
|
121
|
+
top: 1.7rem;
|
122
|
+
right: 2rem;
|
123
|
+
color: rgba(150,150,150,1);
|
124
|
+
}
|
125
|
+
|
126
|
+
.dropdown>menu {
|
127
|
+
z-index: 11;
|
128
|
+
position: absolute;
|
129
|
+
top: 3.8rem;
|
130
|
+
left: 0px;
|
131
|
+
right: 0px;
|
132
|
+
margin: 0;
|
133
|
+
border: solid 1px var(--divider-color);
|
134
|
+
color: var(--text-color);
|
135
|
+
background-color: var(--paper-color);
|
136
|
+
padding: 0;
|
137
|
+
max-height: 20rem;
|
138
|
+
overflow: auto;
|
139
|
+
}
|
140
|
+
|
141
|
+
.dropdown>menu ul {
|
142
|
+
list-style: none;
|
143
|
+
margin: 0;
|
144
|
+
padding: .5rem 0;
|
145
|
+
cursor: pointer;
|
146
|
+
}
|
147
|
+
|
148
|
+
.dropdown>menu li {
|
149
|
+
min-height: 2rem;
|
150
|
+
padding: 0 .5rem;
|
151
|
+
display: flex;
|
152
|
+
align-items: center;
|
153
|
+
font-size: .9rem;
|
154
|
+
}
|
155
|
+
|
156
|
+
.dropdown>menu li:hover {
|
157
|
+
background-color: var(--primary-color-lighter);
|
158
|
+
}
|
package/src/html/textfield.css
CHANGED
@@ -31,11 +31,16 @@
|
|
31
31
|
|
32
32
|
.textfield>.icon {
|
33
33
|
position: absolute;
|
34
|
-
top: 1.
|
34
|
+
top: 1.5rem;
|
35
35
|
right: .2rem;
|
36
36
|
color: rgba(150,150,150,1);
|
37
37
|
}
|
38
38
|
|
39
|
+
.textfield-date>.icon,
|
40
|
+
.textfield-DATE>.icon {
|
41
|
+
right: 2.5rem;
|
42
|
+
}
|
43
|
+
|
39
44
|
.textfield > label {
|
40
45
|
color: var(--primary-color);
|
41
46
|
font-size: .9rem;
|
@@ -120,7 +125,7 @@ input:read-only ~ label,
|
|
120
125
|
}
|
121
126
|
|
122
127
|
.dropdown>menu {
|
123
|
-
z-index:
|
128
|
+
z-index: 11;
|
124
129
|
position: absolute;
|
125
130
|
top: 3.8rem;
|
126
131
|
left: 0px;
|
package/src/html/textfield.js
CHANGED
@@ -4,6 +4,7 @@ import { Icon } from './icon'
|
|
4
4
|
import { Text } from './text'
|
5
5
|
import './textfield-outlined.css'
|
6
6
|
import './textfield.css'
|
7
|
+
import './textarea.css'
|
7
8
|
|
8
9
|
/**
|
9
10
|
* Text Field
|
@@ -43,7 +44,7 @@ export const TextField = (props) => {
|
|
43
44
|
|
44
45
|
const borderStyle = outlined ? "textfield-outlined" : "textfield"
|
45
46
|
const labelStyle = label ? "" : "no-label"
|
46
|
-
const style = `${labelStyle} ${borderStyle}`
|
47
|
+
const style = `${labelStyle} ${borderStyle} textfield-${type}`
|
47
48
|
const labelTxt = <Text>{label}</Text>
|
48
49
|
|
49
50
|
return (
|
@@ -56,6 +57,58 @@ export const TextField = (props) => {
|
|
56
57
|
)
|
57
58
|
}
|
58
59
|
|
60
|
+
|
61
|
+
/**
|
62
|
+
* Text Area
|
63
|
+
*/
|
64
|
+
export const TextArea = (props) => {
|
65
|
+
|
66
|
+
const site = useContext(SiteContext)
|
67
|
+
const { id, type = 'text', label, placeholder, value, outlined, readOnly = false, canClear = true, onChange, onEnter, onClick } = props
|
68
|
+
|
69
|
+
function onKeyPress(event) {
|
70
|
+
var key = event.charCode ? event.charCode : event.keyCode ? event.keyCode : 0;
|
71
|
+
if (key == 13) {
|
72
|
+
if (onEnter) onEnter()
|
73
|
+
}
|
74
|
+
}
|
75
|
+
|
76
|
+
function change(event) {
|
77
|
+
event.stopPropagation()
|
78
|
+
event.preventDefault()
|
79
|
+
const value = event.target.value
|
80
|
+
if (onChange) onChange(id, value)
|
81
|
+
}
|
82
|
+
|
83
|
+
function focus() {
|
84
|
+
if (site) {
|
85
|
+
site.changeFocus({
|
86
|
+
lose: () => {
|
87
|
+
// DO NOTHING
|
88
|
+
}
|
89
|
+
})
|
90
|
+
}
|
91
|
+
}
|
92
|
+
|
93
|
+
function clear() {
|
94
|
+
if (onChange) onChange(id, "")
|
95
|
+
}
|
96
|
+
|
97
|
+
const labelStyle = label ? "" : "no-label"
|
98
|
+
const style = `textarea ${labelStyle} textarea-${type}`
|
99
|
+
const labelTxt = <Text>{label}</Text>
|
100
|
+
|
101
|
+
return (
|
102
|
+
<div className={`${style}`} onClick={onClick}>
|
103
|
+
<textarea id={id} placeholder={placeholder} value={value} required onChange={change} onKeyDown={onKeyPress} onFocus={focus} readOnly={readOnly} />
|
104
|
+
{!readOnly && canClear && value && value.length > 0 ? <Icon icon="close" clickable size="small" action={clear} /> : null }
|
105
|
+
<span className="bar"></span>
|
106
|
+
{label ? <label>{labelTxt}</label> : null}
|
107
|
+
</div>
|
108
|
+
)
|
109
|
+
}
|
110
|
+
|
111
|
+
|
59
112
|
/**
|
60
113
|
* Dropdown
|
61
114
|
*/
|
@@ -83,7 +136,7 @@ export const DropDown = (props) => {
|
|
83
136
|
}
|
84
137
|
|
85
138
|
function toggle() {
|
86
|
-
if (site) {
|
139
|
+
if (site && site.changeFocus) {
|
87
140
|
site.changeFocus({
|
88
141
|
lose: () => {
|
89
142
|
setOpen(false)
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import React, { useState } from 'react'
|
2
|
+
import { DropDown, TextField, TextArea } from '.'
|
3
|
+
import { Wrapper } from '../../__reactpreview__/Wrapper'
|
4
|
+
|
5
|
+
const TextFieldTest = (prop) => {
|
6
|
+
|
7
|
+
const [form, setForm] = useState({})
|
8
|
+
|
9
|
+
function change(id, value) {
|
10
|
+
const next = Object.assign({}, form, { [id]: value })
|
11
|
+
setForm(next)
|
12
|
+
}
|
13
|
+
|
14
|
+
return (
|
15
|
+
<>
|
16
|
+
<TextArea id="text1" label="Text 1" value="Lorem ipsum dolor sit amet..." onChange={change}/>
|
17
|
+
<TextField id="date1" type="DATE" label="Date" value={form.date1} onChange={change}/>
|
18
|
+
<DropDown id="gender1" label="Gender" value={form.gender1} onChange={change} options={[ {label: "Male", value: "M"}, { label: "Female", value: "F" }]} />
|
19
|
+
</>
|
20
|
+
)
|
21
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { Kanban, KanbanCard, KanbanColumn } from './Kanban'
|
3
|
+
|
4
|
+
const KanbanTest = (prop) => {
|
5
|
+
return (
|
6
|
+
<Kanban>
|
7
|
+
<KanbanColumn title="TODO">
|
8
|
+
<KanbanCard />
|
9
|
+
</KanbanColumn>
|
10
|
+
<KanbanColumn title="IN PROGRESS">
|
11
|
+
|
12
|
+
</KanbanColumn>
|
13
|
+
<KanbanColumn title="DONE">
|
14
|
+
|
15
|
+
</KanbanColumn>
|
16
|
+
</Kanban>
|
17
|
+
)
|
18
|
+
}
|
@@ -0,0 +1,179 @@
|
|
1
|
+
.planner-box {
|
2
|
+
flex:1;
|
3
|
+
display: flex;
|
4
|
+
flex-direction: column;
|
5
|
+
overflow: hidden;
|
6
|
+
border: solid 1px var(--divider-color);
|
7
|
+
}
|
8
|
+
|
9
|
+
.planner-box > header > label {
|
10
|
+
min-width:13rem;
|
11
|
+
}
|
12
|
+
|
13
|
+
.planner {
|
14
|
+
flex: 1;
|
15
|
+
display: flex;
|
16
|
+
height: 70rem;
|
17
|
+
overflow-y: auto;
|
18
|
+
margin: 1rem;
|
19
|
+
|
20
|
+
--row-height: 8rem;
|
21
|
+
--column-width: 14rem;
|
22
|
+
}
|
23
|
+
|
24
|
+
.planner > .column0 {
|
25
|
+
position: sticky;
|
26
|
+
left: 0px;
|
27
|
+
z-index: 11;
|
28
|
+
background-color: var(--paper-color);
|
29
|
+
width: var(--column-width);
|
30
|
+
border-right: solid 1px var(--divider-color);
|
31
|
+
}
|
32
|
+
|
33
|
+
.column-header {
|
34
|
+
width: var(--column-width);
|
35
|
+
background-color: var(--paper-color);
|
36
|
+
height: 2.6rem;
|
37
|
+
}
|
38
|
+
|
39
|
+
.date-header {
|
40
|
+
display: flex;
|
41
|
+
padding: 0.5rem 1rem;
|
42
|
+
align-items: baseline;
|
43
|
+
}
|
44
|
+
|
45
|
+
.weekend {
|
46
|
+
background-color: rgb(245, 245, 245);
|
47
|
+
}
|
48
|
+
|
49
|
+
.month-header {
|
50
|
+
padding: 0.5rem 1rem;
|
51
|
+
border-top: solid 1px var(--divider-color);
|
52
|
+
}
|
53
|
+
|
54
|
+
.month-header>* {
|
55
|
+
display: none
|
56
|
+
}
|
57
|
+
|
58
|
+
.month-header.first {
|
59
|
+
border-left: solid 1px var(--divider-color);
|
60
|
+
}
|
61
|
+
|
62
|
+
.month-header.first>* {
|
63
|
+
display: block
|
64
|
+
}
|
65
|
+
|
66
|
+
.column0 > .column-header {
|
67
|
+
position: sticky;
|
68
|
+
top: 0px;
|
69
|
+
height: 6rem;
|
70
|
+
border-bottom: solid 1px var(--divider-color);
|
71
|
+
border-right: solid 1px var(--divider-color);
|
72
|
+
}
|
73
|
+
|
74
|
+
.row-header {
|
75
|
+
width: var(--column-width);
|
76
|
+
height: var(--row-height);
|
77
|
+
border-bottom: solid 1px var(--divider-color);
|
78
|
+
display: flex;
|
79
|
+
justify-content: center;
|
80
|
+
align-items: center;
|
81
|
+
}
|
82
|
+
|
83
|
+
.planner > .rows {
|
84
|
+
flex: 1;
|
85
|
+
}
|
86
|
+
|
87
|
+
.planner .row {
|
88
|
+
height: var(--row-height);
|
89
|
+
border-bottom: solid 1px var(--divider-color);
|
90
|
+
display: flex;
|
91
|
+
}
|
92
|
+
|
93
|
+
.planner .row0 {
|
94
|
+
position: sticky;
|
95
|
+
top: 0px;
|
96
|
+
z-index: 10;
|
97
|
+
height: 3rem;
|
98
|
+
background-color: var(--paper-color);
|
99
|
+
border-bottom: solid 1px var(--divider-color);
|
100
|
+
}
|
101
|
+
|
102
|
+
.planner .row1 {
|
103
|
+
position: sticky;
|
104
|
+
top: 3rem;
|
105
|
+
z-index: 10;
|
106
|
+
height: 3rem;
|
107
|
+
background-color: var(--paper-color);
|
108
|
+
border-bottom: solid 1px var(--divider-color);
|
109
|
+
}
|
110
|
+
|
111
|
+
.planner .cell {
|
112
|
+
width: var(--column-width);
|
113
|
+
height: 100%;
|
114
|
+
padding: 0.5rem;
|
115
|
+
display: flex;
|
116
|
+
justify-content: center;
|
117
|
+
align-items: center;
|
118
|
+
border-right: dotted 1px var(--divider-color);
|
119
|
+
}
|
120
|
+
|
121
|
+
.photoshoot-icon {
|
122
|
+
border: solid 0px var(--divider-color);
|
123
|
+
border-radius: 4px;
|
124
|
+
flex: 1;
|
125
|
+
height: 100%;
|
126
|
+
padding: 0.5rem;
|
127
|
+
display: flex;
|
128
|
+
justify-content: center;
|
129
|
+
align-items: center;
|
130
|
+
color: rgba(200, 200, 200, 0.5);
|
131
|
+
}
|
132
|
+
|
133
|
+
.photoshoot-icon.dragOver {
|
134
|
+
background-color: rgba(225,225,250);
|
135
|
+
}
|
136
|
+
|
137
|
+
.photoshoot-card {
|
138
|
+
border: solid 1px var(--divider-color);
|
139
|
+
border-radius: 4px;
|
140
|
+
flex: 1;
|
141
|
+
width: 100%;
|
142
|
+
height: 100%;
|
143
|
+
display: flex;
|
144
|
+
flex-direction: column;
|
145
|
+
overflow: hidden;
|
146
|
+
}
|
147
|
+
|
148
|
+
.photoshoot-card > * {
|
149
|
+
background-color: #FFF;
|
150
|
+
opacity: .8;
|
151
|
+
}
|
152
|
+
|
153
|
+
.photoshoot-card > header {
|
154
|
+
padding: 0 0.5rem ;
|
155
|
+
|
156
|
+
}
|
157
|
+
|
158
|
+
.photoshoot-card > main {
|
159
|
+
padding: 0 0.5rem ;
|
160
|
+
flex: 1;
|
161
|
+
}
|
162
|
+
|
163
|
+
.photoshoot-card > footer {
|
164
|
+
display: flex;
|
165
|
+
}
|
166
|
+
|
167
|
+
.photoshoot-card.disabled {
|
168
|
+
opacity: 0.3;
|
169
|
+
}
|
170
|
+
|
171
|
+
.photoshoot-card:hover {
|
172
|
+
cursor: pointer;
|
173
|
+
box-shadow: var(--shadow1);
|
174
|
+
}
|
175
|
+
|
176
|
+
.expand {
|
177
|
+
flex: 1;
|
178
|
+
}
|
179
|
+
|