ywana-core8 0.0.575 → 0.0.578
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 +86 -65
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +86 -65
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +86 -65
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/TabbedTablePage.js +12 -7
- package/src/domain/TablePage2.js +15 -10
- package/src/widgets/planner/Planner.js +2 -1
package/package.json
CHANGED
@@ -333,22 +333,20 @@ const TableFilters = (props) => {
|
|
333
333
|
}, [schema])
|
334
334
|
|
335
335
|
useEffect(() => {
|
336
|
-
if (filters) setForm(filters)
|
336
|
+
if (filters && !equal(filters, form)) setForm(filters)
|
337
337
|
}, [filters])
|
338
338
|
|
339
339
|
useEffect(() => {
|
340
|
-
|
340
|
+
if (pageContext.changeFilters && !equal(filters,form)) {
|
341
|
+
pageContext.changeFilters(form)
|
342
|
+
setPageContext(Object.assign({}, pageContext))
|
343
|
+
}
|
341
344
|
}, [form])
|
342
345
|
|
343
346
|
async function change(next) {
|
344
347
|
setForm(next)
|
345
348
|
}
|
346
349
|
|
347
|
-
async function reload() {
|
348
|
-
await pageContext.load(form, likes)
|
349
|
-
setPageContext(Object.assign({}, pageContext))
|
350
|
-
}
|
351
|
-
|
352
350
|
function clear() {
|
353
351
|
change({})
|
354
352
|
}
|
@@ -384,6 +382,13 @@ export const TableEditor = (props) => {
|
|
384
382
|
const { icon, title, schema, editable, canDelete, filter, actions, tabs, className } = props
|
385
383
|
const [groupBy, setGroupBy] = useState(props.groupBy)
|
386
384
|
|
385
|
+
useEffect(async () => {
|
386
|
+
if (filters) {
|
387
|
+
await pageContext.load(filters)
|
388
|
+
setPageContext(Object.assign({}, pageContext))
|
389
|
+
}
|
390
|
+
}, [filters])
|
391
|
+
|
387
392
|
function changeGroup(id, value) {
|
388
393
|
setGroupBy(value)
|
389
394
|
}
|
package/src/domain/TablePage2.js
CHANGED
@@ -31,7 +31,7 @@ export const TablePage2 = (props) => {
|
|
31
31
|
children
|
32
32
|
} = props
|
33
33
|
|
34
|
-
const [
|
34
|
+
const [pageContext, setPageContext] = useContext(PageContext)
|
35
35
|
const context = TableContext(url, field, host, urlQuery, params)
|
36
36
|
const { selected } = pageContext
|
37
37
|
const timer = useRef(null)
|
@@ -283,22 +283,20 @@ const TableFilters = (props) => {
|
|
283
283
|
}, [schema])
|
284
284
|
|
285
285
|
useEffect(() => {
|
286
|
-
if (filters) setForm(filters)
|
286
|
+
if (filters && !equal(filters, form)) setForm(filters)
|
287
287
|
}, [filters])
|
288
288
|
|
289
289
|
useEffect(() => {
|
290
|
-
|
290
|
+
if (pageContext.changeFilters && !equal(filters,form)) {
|
291
|
+
pageContext.changeFilters(form)
|
292
|
+
setPageContext(Object.assign({}, pageContext))
|
293
|
+
}
|
291
294
|
}, [form])
|
292
295
|
|
293
296
|
async function change(next) {
|
294
297
|
setForm(next)
|
295
298
|
}
|
296
299
|
|
297
|
-
async function reload() {
|
298
|
-
await pageContext.load(form)
|
299
|
-
setPageContext(Object.assign({}, pageContext))
|
300
|
-
}
|
301
|
-
|
302
300
|
function clear() {
|
303
301
|
change({})
|
304
302
|
}
|
@@ -331,10 +329,17 @@ export const TableEditor = (props) => {
|
|
331
329
|
const site = useContext(SiteContext)
|
332
330
|
const [pageContext, setPageContext] = useContext(PageContext)
|
333
331
|
const { all = [], filters } = pageContext
|
334
|
-
const { icon, title, schema, editable, canDelete, filter, actions, className } = props
|
332
|
+
const { icon, title, schema, editable, canDelete, filter, actions, className, tabbedBy } = props
|
335
333
|
const [groupBy, setGroupBy] = useState(props.groupBy)
|
336
334
|
const [tab, setTab] = useState(0)
|
337
335
|
|
336
|
+
useEffect(async () => {
|
337
|
+
if (filters) {
|
338
|
+
await pageContext.load(filters)
|
339
|
+
setPageContext(Object.assign({}, pageContext))
|
340
|
+
}
|
341
|
+
}, [filters])
|
342
|
+
|
338
343
|
useEffect(async () => {
|
339
344
|
if (tab) {
|
340
345
|
const filter = { [tab.field]: tab.value }
|
@@ -632,7 +637,7 @@ const TableAPI = (url, host, params = "") => {
|
|
632
637
|
}, "")
|
633
638
|
return query.concat(param)
|
634
639
|
} else {
|
635
|
-
return query.concat(`${key}
|
640
|
+
return query.concat(`${key}=${filters[key]}&`)
|
636
641
|
}
|
637
642
|
}, "")
|
638
643
|
queryParams = queryParams.concat(filterQuery)
|
@@ -66,7 +66,8 @@ export const Planner = ({ title, events = [], lanes = [], navigation = true, onS
|
|
66
66
|
}
|
67
67
|
|
68
68
|
function showThisWeek() {
|
69
|
-
const element =
|
69
|
+
const element = thisMondayElement.current
|
70
|
+
//const element = document.querySelector(".thisMonday")
|
70
71
|
if (element) element.scrollIntoView({
|
71
72
|
behavior: 'smooth',
|
72
73
|
block: 'start',
|