ywana-core8 0.0.566 → 0.0.567
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 +36 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +13 -0
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +36 -18
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +36 -18
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/CollectionPage.css +13 -0
- package/src/domain/CollectionPage.js +11 -5
- package/src/site/site.test.js +8 -8
package/package.json
CHANGED
@@ -11,6 +11,19 @@ menu.collection-page>header {
|
|
11
11
|
border-bottom: dotted 1px var(--divider-color);
|
12
12
|
}
|
13
13
|
|
14
|
+
menu.collection-page>nav.collection-filters {
|
15
|
+
height: 2rem;
|
16
|
+
display: flex;
|
17
|
+
justify-content: flex-end;
|
18
|
+
border-bottom: dotted 1px var(--divider-color);
|
19
|
+
background-color: var(--background-color);
|
20
|
+
}
|
21
|
+
|
22
|
+
menu.collection-page>main.collection-filters {
|
23
|
+
border-bottom: dotted 1px var(--divider-color);
|
24
|
+
background-color: var(--background-color);
|
25
|
+
}
|
26
|
+
|
14
27
|
menu.collection-page>.list {
|
15
28
|
overflow:auto;
|
16
29
|
}
|
@@ -29,12 +29,17 @@ export const CollectionPage = (props) => {
|
|
29
29
|
|
30
30
|
const [pageContext, setPageContext] = useContext(PageContext)
|
31
31
|
const context = CollectionContext(url, field, host, page, fetching)
|
32
|
+
const [showFilter, setShowFilter] = useState(true)
|
32
33
|
|
33
34
|
useEffect(async () => {
|
34
35
|
await context.load()
|
35
36
|
setPageContext(context)
|
36
37
|
}, [])
|
37
38
|
|
39
|
+
function toggleFilters() {
|
40
|
+
setShowFilter(!showFilter)
|
41
|
+
}
|
42
|
+
|
38
43
|
async function reload() {
|
39
44
|
await pageContext.load()
|
40
45
|
setPageContext(Object.assign({}, pageContext))
|
@@ -71,8 +76,9 @@ export const CollectionPage = (props) => {
|
|
71
76
|
</Header>
|
72
77
|
<menu className={`collection-page ${className}`}>
|
73
78
|
<Header title={<Text>{name}</Text>} >
|
79
|
+
{ canFilter ? showFilter ? <Icon icon="filter_list" size="small" clickable action={toggleFilters} /> : <Icon icon="filter_list_off" size="small" clickable action={toggleFilters} /> : false }
|
74
80
|
</Header>
|
75
|
-
{canFilter ? <CollectionFilters schema={schema} /> : null}
|
81
|
+
{canFilter && showFilter ? <CollectionFilters schema={schema} /> : null}
|
76
82
|
{levels ? <CollectionTree icon={icon} levels={levels} onSelect={onSelect} sorter={sorter} searchBy={searchBy} /> : <CollectionList groupBy={groupBy} onSelect={onSelect} searchBy={searchBy} />}
|
77
83
|
</menu>
|
78
84
|
<main key={id} className={`collection-page ${className}`}>
|
@@ -123,10 +129,10 @@ export const CollectionFilters = (props) => {
|
|
123
129
|
const content = new Content(filterSchema, form)
|
124
130
|
return (
|
125
131
|
<Fragment>
|
126
|
-
<
|
127
|
-
<Icon icon="
|
128
|
-
</
|
129
|
-
<main className="
|
132
|
+
<nav className="collection-filters">
|
133
|
+
<Icon icon="clear_all" size="small" clickable action={clear} />
|
134
|
+
</nav>
|
135
|
+
<main className="collection-filters">
|
130
136
|
<ContentEditor content={content} onChange={change} />
|
131
137
|
</main>
|
132
138
|
</Fragment>
|
package/src/site/site.test.js
CHANGED
@@ -199,16 +199,16 @@ const Page5 = (props) => {
|
|
199
199
|
}
|
200
200
|
|
201
201
|
const schema = {
|
202
|
-
field6: { id: "field6", section: "C", type: TYPES.ARRAY , item: ENTITYTYPE, label: "Collection 100"
|
203
|
-
name : { id: "name" , section: "A", type: TYPES.STRING, format: FORMATS.NONE , required: true, tab: false, grouper: true , column: true , filter: true , like: true, label: "Name" },
|
204
|
-
state : { id: "state" , section: "A", type: TYPES.STRING, format: FORMATS.NONE , required: true, tab: true , grouper: true , column: true , filter: false , label: "State" , options: [
|
202
|
+
field6: { id: "field6", section: "C", type: TYPES.ARRAY , item: ENTITYTYPE , filter: false , label: "Collection 100"},
|
203
|
+
name : { id: "name" , section: "A", type: TYPES.STRING , format: FORMATS.NONE , required: true, tab: false, grouper: true , column: true , filter: true , like: true, label: "Name" },
|
204
|
+
state : { id: "state" , section: "A", type: TYPES.STRING , format: FORMATS.NONE , required: true, tab: true , grouper: true , column: true , filter: false , label: "State" , options: [
|
205
205
|
{ label: "Pendiente", value: "NOT_CLASSIFIED" },
|
206
206
|
{ label: "Clasificada", value: "CLASSIFIED"},
|
207
207
|
]},
|
208
|
-
field1: { id: "field1", section: "A", type: TYPES.STRING , format: FORMATS.NONE , required: true, tab: false, grouper: true , column: true , filter:
|
209
|
-
field2: { id: "field2", section: "B", type: TYPES.STRING , format: FORMATS.NONE , required: true, tab: false, grouper: true , column: true , filter:
|
210
|
-
field4: { id: "field4", section: "B", type: TYPES.STRING , format: FORMATS.COLOR, required: true, tab: false, grouper: true , column: true , filter:
|
211
|
-
field5: { id: "field5", section: "B", type: TYPES.ENTITY, item: ENTITYTYPE, format: FORMATS.NONE , editable: true, tab: false, grouper: false, column: true , filter:
|
208
|
+
field1: { id: "field1", section: "A", type: TYPES.STRING , format: FORMATS.NONE , required: true, tab: false, grouper: true , column: true , filter: false , label: "field1" },
|
209
|
+
field2: { id: "field2", section: "B", type: TYPES.STRING , format: FORMATS.NONE , required: true, tab: false, grouper: true , column: true , filter: false , label: "field2" },
|
210
|
+
field4: { id: "field4", section: "B", type: TYPES.STRING , format: FORMATS.COLOR, required: true, tab: false, grouper: true , column: true , filter: false , label: "Color" },
|
211
|
+
field5: { id: "field5", section: "B", type: TYPES.ENTITY, item: ENTITYTYPE, format: FORMATS.NONE , editable: true, tab: false, grouper: false, column: true , filter: false, like: false, label: "Entity5"},
|
212
212
|
id : { id: "id", type: TYPES.STRING },
|
213
213
|
}
|
214
214
|
|
@@ -217,7 +217,7 @@ const Page5 = (props) => {
|
|
217
217
|
<CollectionPage
|
218
218
|
title="Referencias"
|
219
219
|
schema={schema} host="http://localhost:3000" url="/references" fetching={true} // resource
|
220
|
-
searchBy={["field1"]} levels={["color"]}
|
220
|
+
searchBy={["field1"]} levels={["color"]} canFilter={true} // menu
|
221
221
|
editor="TABBED" canAdd={true} // editor
|
222
222
|
/>
|
223
223
|
</Fragment>
|