@kaspernj/api-maker 1.0.433 → 1.0.435
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/package.json +2 -2
- package/src/base-component.jsx +1 -4
- package/src/bootstrap/attribute-row/index.jsx +2 -1
- package/src/bootstrap/attribute-rows.jsx +1 -1
- package/src/bootstrap/card.jsx +2 -1
- package/src/bootstrap/input.jsx +1 -1
- package/src/bootstrap/paginate.jsx +2 -1
- package/src/bootstrap/sort-link.jsx +40 -41
- package/src/collection-loader.jsx +2 -1
- package/src/event-created.jsx +1 -1
- package/src/event-destroyed.jsx +1 -1
- package/src/event-emitter-listener.jsx +1 -1
- package/src/event-listener.jsx +1 -1
- package/src/event-updated.jsx +4 -3
- package/src/form.jsx +2 -1
- package/src/inputs/attachment.jsx +1 -1
- package/src/inputs/checkbox.jsx +1 -1
- package/src/inputs/checkboxes.jsx +1 -1
- package/src/inputs/input.jsx +2 -1
- package/src/inputs/money.jsx +2 -1
- package/src/inputs/select.jsx +1 -1
- package/src/link.jsx +12 -7
- package/src/modal.jsx +1 -1
- package/src/resize-observer.jsx +1 -1
- package/src/super-admin/edit-page/edit-attribute-checkbox.jsx +2 -1
- package/src/super-admin/edit-page/edit-attribute-content.jsx +1 -1
- package/src/super-admin/edit-page/edit-attribute-input.jsx +2 -1
- package/src/super-admin/edit-page/edit-attribute.jsx +1 -1
- package/src/super-admin/edit-page.jsx +1 -1
- package/src/super-admin/index-page.jsx +1 -1
- package/src/super-admin/index.jsx +2 -1
- package/src/super-admin/layout/header/index.jsx +2 -1
- package/src/super-admin/layout/index.jsx +2 -2
- package/src/super-admin/layout/menu/index.jsx +1 -1
- package/src/super-admin/layout/menu/menu-content.jsx +2 -1
- package/src/super-admin/layout/menu/menu-item/index.jsx +1 -1
- package/src/super-admin/layout/no-access.jsx +1 -1
- package/src/super-admin/model-class-table.jsx +2 -1
- package/src/super-admin/show-nav.jsx +1 -1
- package/src/super-admin/show-page/belongs-to-attribute-row.jsx +1 -1
- package/src/super-admin/show-page/index.jsx +2 -1
- package/src/super-admin/show-reflection-actions.jsx +2 -1
- package/src/super-admin/show-reflection-link.jsx +1 -1
- package/src/super-admin/show-reflection-page.jsx +1 -1
- package/src/table/components/column.jsx +1 -1
- package/src/table/components/flat-list.jsx +1 -1
- package/src/table/components/header.jsx +10 -2
- package/src/table/components/row.jsx +4 -2
- package/src/table/filters/attribute-element.jsx +1 -1
- package/src/table/filters/filter-form.jsx +2 -1
- package/src/table/filters/filter.jsx +1 -1
- package/src/table/filters/index.jsx +1 -1
- package/src/table/filters/load-search-modal.jsx +2 -1
- package/src/table/filters/reflection-element.jsx +1 -1
- package/src/table/filters/save-search-modal.jsx +1 -1
- package/src/table/filters/scope-element.jsx +1 -1
- package/src/table/header-column-content.jsx +54 -0
- package/src/table/header-column.jsx +25 -32
- package/src/table/header-select.jsx +72 -0
- package/src/table/model-column.jsx +14 -6
- package/src/table/model-row.jsx +2 -4
- package/src/table/settings/column-row.jsx +2 -1
- package/src/table/settings/download-action.jsx +1 -1
- package/src/table/settings/index.jsx +2 -1
- package/src/table/table.jsx +82 -42
- package/src/table/use-sorting.mjs +30 -0
- package/src/table/worker-plugins-check-all-checkbox.jsx +2 -1
- package/src/table/worker-plugins-checkbox.jsx +2 -1
- package/src/utils/card.jsx +49 -0
- package/src/utils/checkbox.jsx +1 -1
- package/src/utils/modal.jsx +59 -0
- package/src/with-can-can.jsx +1 -1
- package/src/with-collection.jsx +1 -1
- package/src/with-model.jsx +1 -1
package/src/table/table.jsx
CHANGED
|
@@ -11,13 +11,15 @@ import FlatList from "./components/flat-list"
|
|
|
11
11
|
import FontAwesomeIcon from "react-native-vector-icons/FontAwesome"
|
|
12
12
|
import Header from "./components/header"
|
|
13
13
|
import HeaderColumn from "./header-column"
|
|
14
|
+
import HeaderSelect from "./header-select"
|
|
14
15
|
import * as inflection from "inflection"
|
|
16
|
+
import memo from "set-state-compare/src/memo"
|
|
15
17
|
import modelClassRequire from "../model-class-require.mjs"
|
|
16
18
|
import ModelRow from "./model-row"
|
|
17
19
|
import Paginate from "../bootstrap/paginate"
|
|
18
20
|
import Params from "../params"
|
|
19
21
|
import PropTypes from "prop-types"
|
|
20
|
-
import React, {
|
|
22
|
+
import React, {createContext, useContext, useMemo, useRef} from "react"
|
|
21
23
|
import Row from "./components/row"
|
|
22
24
|
import selectCalculator from "./select-calculator"
|
|
23
25
|
import Select from "../inputs/select"
|
|
@@ -42,6 +44,45 @@ const styleSheet = StyleSheet.create({
|
|
|
42
44
|
overflowX: "auto"
|
|
43
45
|
}
|
|
44
46
|
})
|
|
47
|
+
const TableContext = createContext()
|
|
48
|
+
|
|
49
|
+
const ListHeaderComponent = memo(() => {
|
|
50
|
+
const {mdUp} = useBreakpoint()
|
|
51
|
+
const tableContextValue = useContext(TableContext)
|
|
52
|
+
const table = tableContextValue.table
|
|
53
|
+
const {collection, queryWithoutPagination, t} = table.tt
|
|
54
|
+
const {query} = digs(collection, "query")
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<Row dataSet={{class: "api-maker/table/header-row"}} style={table.styleForRowHeader()}>
|
|
58
|
+
{table.p.workplace && table.s.currentWorkplace &&
|
|
59
|
+
<Header style={table.styleForHeader({style: {width: mdUp ? 41 : undefined}})}>
|
|
60
|
+
<WorkerPluginsCheckAllCheckbox
|
|
61
|
+
currentWorkplace={table.s.currentWorkplace}
|
|
62
|
+
query={queryWithoutPagination}
|
|
63
|
+
style={{marginHorizontal: "auto"}}
|
|
64
|
+
/>
|
|
65
|
+
{!mdUp &&
|
|
66
|
+
<Text style={{marginLeft: 3}}>
|
|
67
|
+
{t(".select_all_found", {defaultValue: "Select all found"})}
|
|
68
|
+
</Text>
|
|
69
|
+
}
|
|
70
|
+
</Header>
|
|
71
|
+
}
|
|
72
|
+
{!mdUp &&
|
|
73
|
+
<Header style={table.styleForHeader({style: {}})}>
|
|
74
|
+
<HeaderSelect preparedColumns={table.s.preparedColumns} query={query} table={table} />
|
|
75
|
+
</Header>
|
|
76
|
+
}
|
|
77
|
+
{mdUp &&
|
|
78
|
+
<>
|
|
79
|
+
{table.headersContentFromColumns()}
|
|
80
|
+
<Header style={table.styleForHeader({style: {}, type: "actions"})} />
|
|
81
|
+
</>
|
|
82
|
+
}
|
|
83
|
+
</Row>
|
|
84
|
+
)
|
|
85
|
+
})
|
|
45
86
|
|
|
46
87
|
export default memo(shapeComponent(class ApiMakerTable extends BaseComponent {
|
|
47
88
|
static defaultProps = {
|
|
@@ -99,13 +140,13 @@ export default memo(shapeComponent(class ApiMakerTable extends BaseComponent {
|
|
|
99
140
|
|
|
100
141
|
setup() {
|
|
101
142
|
const {t} = useI18n({namespace: "js.api_maker.table"})
|
|
102
|
-
const {name: breakpoint} = useBreakpoint()
|
|
143
|
+
const {name: breakpoint, mdUp} = useBreakpoint()
|
|
103
144
|
const queryParams = useQueryParams()
|
|
104
145
|
|
|
105
146
|
this.setInstance({
|
|
106
147
|
breakpoint,
|
|
107
148
|
filterFormRef: useRef(),
|
|
108
|
-
|
|
149
|
+
mdUp,
|
|
109
150
|
t
|
|
110
151
|
})
|
|
111
152
|
|
|
@@ -139,6 +180,8 @@ export default memo(shapeComponent(class ApiMakerTable extends BaseComponent {
|
|
|
139
180
|
widths: null
|
|
140
181
|
})
|
|
141
182
|
|
|
183
|
+
this.tableContextValue = useMemo(() => ({cacheKey: this.s.tableSettingFullCacheKey, table: this}), [this.s.tableSettingFullCacheKey])
|
|
184
|
+
|
|
142
185
|
useMemo(() => {
|
|
143
186
|
if (this.props.workplace) {
|
|
144
187
|
this.loadCurrentWorkplace().then(() => {
|
|
@@ -390,17 +433,19 @@ export default memo(shapeComponent(class ApiMakerTable extends BaseComponent {
|
|
|
390
433
|
}
|
|
391
434
|
|
|
392
435
|
const flatList = (
|
|
393
|
-
<
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
436
|
+
<TableContext.Provider value={this.tt.tableContextValue}>
|
|
437
|
+
<FlatList
|
|
438
|
+
data={models}
|
|
439
|
+
dataSet={{class: classNames("api-maker--table", className), cacheKey: this.s.tableSettingFullCacheKey}}
|
|
440
|
+
extraData={this.s.lastUpdate}
|
|
441
|
+
keyExtractor={this.tt.keyExtrator}
|
|
442
|
+
ListHeaderComponent={ListHeaderComponent}
|
|
443
|
+
renderItem={this.tt.renderItem}
|
|
444
|
+
showsHorizontalScrollIndicator
|
|
445
|
+
style={styleSheet.flatList}
|
|
446
|
+
{...restProps}
|
|
447
|
+
/>
|
|
448
|
+
</TableContext.Provider>
|
|
404
449
|
)
|
|
405
450
|
|
|
406
451
|
return (
|
|
@@ -467,7 +512,7 @@ export default memo(shapeComponent(class ApiMakerTable extends BaseComponent {
|
|
|
467
512
|
}
|
|
468
513
|
}
|
|
469
514
|
|
|
470
|
-
keyExtrator = (model) => model.id()
|
|
515
|
+
keyExtrator = (model) => `${this.s.tableSettingFullCacheKey}-${model.id()}`
|
|
471
516
|
|
|
472
517
|
filterForm = () => {
|
|
473
518
|
const {filterFormRef, submitFilter, submitFilterDebounce} = this.tt
|
|
@@ -513,26 +558,6 @@ export default memo(shapeComponent(class ApiMakerTable extends BaseComponent {
|
|
|
513
558
|
Params.changeParams(paramsChange)
|
|
514
559
|
}
|
|
515
560
|
|
|
516
|
-
listHeaderComponent = () => {
|
|
517
|
-
const {queryWithoutPagination} = this.tt
|
|
518
|
-
|
|
519
|
-
return (
|
|
520
|
-
<Row dataSet={{class: "live-table-header-row"}} style={this.styleForRow()}>
|
|
521
|
-
{this.p.workplace && this.s.currentWorkplace &&
|
|
522
|
-
<Header style={this.styleForHeader({style: {width: 41}})}>
|
|
523
|
-
<WorkerPluginsCheckAllCheckbox
|
|
524
|
-
currentWorkplace={this.s.currentWorkplace}
|
|
525
|
-
query={queryWithoutPagination}
|
|
526
|
-
style={{marginHorizontal: "auto"}}
|
|
527
|
-
/>
|
|
528
|
-
</Header>
|
|
529
|
-
}
|
|
530
|
-
{this.headersContentFromColumns()}
|
|
531
|
-
<Header style={this.styleForHeader({style: {}, type: "actions"})} />
|
|
532
|
-
</Row>
|
|
533
|
-
)
|
|
534
|
-
}
|
|
535
|
-
|
|
536
561
|
renderItem = ({index, item: model}) => {
|
|
537
562
|
const {preparedColumns, tableSettingFullCacheKey} = this.s
|
|
538
563
|
|
|
@@ -540,7 +565,7 @@ export default memo(shapeComponent(class ApiMakerTable extends BaseComponent {
|
|
|
540
565
|
return (
|
|
541
566
|
<View>
|
|
542
567
|
<Text>
|
|
543
|
-
Loading...
|
|
568
|
+
{this.t(".loading_dot_dot_dot", {defaultValue: "Loading..."})}
|
|
544
569
|
</Text>
|
|
545
570
|
</View>
|
|
546
571
|
)
|
|
@@ -551,7 +576,6 @@ export default memo(shapeComponent(class ApiMakerTable extends BaseComponent {
|
|
|
551
576
|
cacheKey={model.cacheKey()}
|
|
552
577
|
columnWidths={this.columnWidths()}
|
|
553
578
|
index={index}
|
|
554
|
-
isSmallScreen={this.tt.isSmallScreen}
|
|
555
579
|
key={model.id()}
|
|
556
580
|
model={model}
|
|
557
581
|
preparedColumns={preparedColumns}
|
|
@@ -561,7 +585,7 @@ export default memo(shapeComponent(class ApiMakerTable extends BaseComponent {
|
|
|
561
585
|
)
|
|
562
586
|
}
|
|
563
587
|
|
|
564
|
-
styleForColumn({column, columnIndex, even, style, type}) {
|
|
588
|
+
styleForColumn = ({column, columnIndex, even, style, type}) => {
|
|
565
589
|
const defaultStyle = {
|
|
566
590
|
justifyContent: "center",
|
|
567
591
|
padding: 8,
|
|
@@ -572,8 +596,13 @@ export default memo(shapeComponent(class ApiMakerTable extends BaseComponent {
|
|
|
572
596
|
if (type == "actions") {
|
|
573
597
|
defaultStyle.flexDirection = "row"
|
|
574
598
|
defaultStyle.alignItems = "center"
|
|
575
|
-
|
|
576
|
-
|
|
599
|
+
|
|
600
|
+
if (this.tt.mdUp) {
|
|
601
|
+
defaultStyle.marginLeft = "auto"
|
|
602
|
+
} else {
|
|
603
|
+
defaultStyle.marginRight = "auto"
|
|
604
|
+
}
|
|
605
|
+
} else if (this.tt.mdUp) {
|
|
577
606
|
defaultStyle.borderRight = "1px solid #dbdbdb"
|
|
578
607
|
}
|
|
579
608
|
|
|
@@ -585,12 +614,14 @@ export default memo(shapeComponent(class ApiMakerTable extends BaseComponent {
|
|
|
585
614
|
return actualStyle
|
|
586
615
|
}
|
|
587
616
|
|
|
588
|
-
styleForHeader({column, columnIndex, style, type}) {
|
|
617
|
+
styleForHeader = ({column, columnIndex, style, type}) => {
|
|
589
618
|
const defaultStyle = {
|
|
619
|
+
flexDirection: "row",
|
|
620
|
+
alignItems: "center",
|
|
590
621
|
padding: 8
|
|
591
622
|
}
|
|
592
623
|
|
|
593
|
-
if (type != "actions") {
|
|
624
|
+
if (type != "actions" && this.tt.mdUp) {
|
|
594
625
|
defaultStyle.borderRight = "1px solid #dbdbdb"
|
|
595
626
|
}
|
|
596
627
|
|
|
@@ -621,6 +652,15 @@ export default memo(shapeComponent(class ApiMakerTable extends BaseComponent {
|
|
|
621
652
|
return actualStyle
|
|
622
653
|
}
|
|
623
654
|
|
|
655
|
+
styleForRowHeader() {
|
|
656
|
+
const actualStyle = {
|
|
657
|
+
flex: 1,
|
|
658
|
+
alignItems: "stretch"
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
return actualStyle
|
|
662
|
+
}
|
|
663
|
+
|
|
624
664
|
tableControls() {
|
|
625
665
|
const {controls} = this.props
|
|
626
666
|
const {showSettings} = this.s
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {camelize} from "inflection"
|
|
2
|
+
import useQueryParams from "on-location-changed/src/use-query-params.js"
|
|
3
|
+
|
|
4
|
+
const calculateQParams = (defaultParams, queryParams, searchKey) => {
|
|
5
|
+
if (searchKey in queryParams) {
|
|
6
|
+
return JSON.parse(queryParams[searchKey])
|
|
7
|
+
} else if (defaultParams) {
|
|
8
|
+
return {...defaultParams}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
return {}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const useSorting = ({defaultParams, query}) => {
|
|
15
|
+
const queryParams = useQueryParams()
|
|
16
|
+
const searchKey = query.queryArgs.searchKey || "q"
|
|
17
|
+
const qParams = calculateQParams(defaultParams, queryParams, searchKey)
|
|
18
|
+
const matchSortParam = qParams.s?.match(/^(.+?)( asc| desc|)$/)
|
|
19
|
+
const sortAttribute = matchSortParam ? camelize(matchSortParam[1], true) : null
|
|
20
|
+
const sortMode = matchSortParam ? matchSortParam[2].trim() : null
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
qParams,
|
|
24
|
+
searchKey,
|
|
25
|
+
sortAttribute,
|
|
26
|
+
sortMode
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default useSorting
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {useEffect, useMemo, useRef} from "react"
|
|
2
2
|
import BaseComponent from "../base-component"
|
|
3
3
|
import classNames from "classnames"
|
|
4
4
|
import Collection from "../collection.mjs"
|
|
5
|
+
import memo from "set-state-compare/src/memo"
|
|
5
6
|
import PropTypes from "prop-types"
|
|
6
7
|
import propTypesExact from "prop-types-exact"
|
|
7
8
|
import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import BaseComponent from "../base-component"
|
|
2
2
|
import classNames from "classnames"
|
|
3
3
|
import {digg} from "diggerize"
|
|
4
|
+
import memo from "set-state-compare/src/memo"
|
|
4
5
|
import modelClassRequire from "../model-class-require.mjs"
|
|
5
6
|
import PropTypes from "prop-types"
|
|
6
7
|
import PropTypesExact from "prop-types-exact"
|
|
7
|
-
import {
|
|
8
|
+
import {useMemo} from "react"
|
|
8
9
|
import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
9
10
|
import useModelEvent from "../use-model-event.js"
|
|
10
11
|
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import BaseComponent from "../base-component"
|
|
2
|
+
import memo from "set-state-compare/src/memo"
|
|
3
|
+
import PropTypes from "prop-types"
|
|
4
|
+
import propTypesExact from "prop-types-exact"
|
|
5
|
+
import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
6
|
+
import Text from "./text"
|
|
7
|
+
|
|
8
|
+
export default memo(shapeComponent(class ApiMakerUtilsCard extends BaseComponent {
|
|
9
|
+
static propTypes = propTypesExact({
|
|
10
|
+
children: PropTypes.node,
|
|
11
|
+
controls: PropTypes.node,
|
|
12
|
+
dataSet: PropTypes.object,
|
|
13
|
+
header: PropTypes.string,
|
|
14
|
+
style: PropTypes.object
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
render() {
|
|
18
|
+
const {children, controls, dataSet, header, style} = this.props
|
|
19
|
+
const {component, ...restDataSet} = dataSet || {}
|
|
20
|
+
const actualDataSet = Object.assign(
|
|
21
|
+
{component: classNames("api-maker/utils/card", component)},
|
|
22
|
+
restDataSet
|
|
23
|
+
)
|
|
24
|
+
const actualStyle = Object.assign(
|
|
25
|
+
{
|
|
26
|
+
backgroundColor: "#fff",
|
|
27
|
+
borderRadius: 15,
|
|
28
|
+
padding: 30
|
|
29
|
+
},
|
|
30
|
+
style
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<View dataSet={actualDataSet} style={actualStyle}>
|
|
35
|
+
{controls &&
|
|
36
|
+
<View style={{position: "absolute", top: 15, right: 15}}>
|
|
37
|
+
{controls}
|
|
38
|
+
</View>
|
|
39
|
+
}
|
|
40
|
+
{header &&
|
|
41
|
+
<Text style={{fontSize: 24}}>
|
|
42
|
+
{header}
|
|
43
|
+
</Text>
|
|
44
|
+
}
|
|
45
|
+
{children}
|
|
46
|
+
</View>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
}))
|
package/src/utils/checkbox.jsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import BaseComponent from "../base-component"
|
|
2
2
|
import {CheckBox, Pressable, View} from "react-native"
|
|
3
|
-
import
|
|
3
|
+
import memo from "set-state-compare/src/memo"
|
|
4
4
|
import PropTypes from "prop-types"
|
|
5
5
|
import propTypesExact from "prop-types-exact"
|
|
6
6
|
import {shapeComponent} from "set-state-compare/src/shape-component.js"
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import {Modal, Pressable, View} from "react-native"
|
|
2
|
+
import BaseComponent from "../base-component"
|
|
3
|
+
import Card from "./card"
|
|
4
|
+
import FontAwesomeIcon from "react-native-vector-icons/FontAwesome"
|
|
5
|
+
import memo from "set-state-compare/src/memo"
|
|
6
|
+
import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
7
|
+
import useBreakpoint from "../use-breakpoint"
|
|
8
|
+
|
|
9
|
+
export default memo(shapeComponent(class ApiMakerUtilsComponent extends BaseComponent {
|
|
10
|
+
render() {
|
|
11
|
+
const {xs, sm} = useBreakpoint()
|
|
12
|
+
const {children, dataSet, ...restProps} = this.props
|
|
13
|
+
const actualDataSet = Object.assign(
|
|
14
|
+
{
|
|
15
|
+
component: "api-maker/utils/modal"
|
|
16
|
+
},
|
|
17
|
+
dataSet
|
|
18
|
+
)
|
|
19
|
+
let width, maxWidth
|
|
20
|
+
|
|
21
|
+
if (xs || sm) {
|
|
22
|
+
width = "95%"
|
|
23
|
+
} else {
|
|
24
|
+
width = "80%"
|
|
25
|
+
maxWidth = 800
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<Modal dataSet={actualDataSet} {...restProps}>
|
|
30
|
+
<View
|
|
31
|
+
style={{
|
|
32
|
+
alignItems: "center",
|
|
33
|
+
justifyContent: "center",
|
|
34
|
+
width: "100%",
|
|
35
|
+
height: "100%",
|
|
36
|
+
backgroundColor: "rgba(0, 0, 0, 0.8)"
|
|
37
|
+
}}
|
|
38
|
+
>
|
|
39
|
+
<Card
|
|
40
|
+
controls={this.cardHeaderControls()}
|
|
41
|
+
style={{width, maxWidth}}
|
|
42
|
+
>
|
|
43
|
+
{children}
|
|
44
|
+
</Card>
|
|
45
|
+
</View>
|
|
46
|
+
</Modal>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
cardHeaderControls() {
|
|
51
|
+
return (
|
|
52
|
+
<Pressable onPress={this.tt.onModalClosePress} style={{marginLeft: "auto", padding: 5}}>
|
|
53
|
+
<FontAwesomeIcon name="remove" />
|
|
54
|
+
</Pressable>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
onModalClosePress = () => this.props.onRequestClose && this.props.onRequestClose()
|
|
59
|
+
}))
|
package/src/with-can-can.jsx
CHANGED
package/src/with-collection.jsx
CHANGED
package/src/with-model.jsx
CHANGED