@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaspernj/api-maker",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.435",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "index.js",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"qs": ">= 6.9.3",
|
|
38
38
|
"react-native-vector-icons": "^10.2.0",
|
|
39
39
|
"replaceall": ">= 0.1.6",
|
|
40
|
-
"set-state-compare": "
|
|
40
|
+
"set-state-compare": ">= 1.0.51",
|
|
41
41
|
"spark-md5": "^3.0.2",
|
|
42
42
|
"stacktrace-parser": "^0.1.10",
|
|
43
43
|
"strftime": ">= 0.10.0",
|
package/src/base-component.jsx
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import fetchingObject from "fetching-object"
|
|
2
1
|
import {ShapeComponent} from "set-state-compare/src/shape-component"
|
|
3
2
|
|
|
4
3
|
export default class BaseComponent extends ShapeComponent {
|
|
5
|
-
|
|
6
|
-
s = fetchingObject(() => this.shape || this.state)
|
|
7
|
-
tt = fetchingObject(this)
|
|
4
|
+
// Nothing yet.
|
|
8
5
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import classNames from "classnames"
|
|
2
2
|
import {digg} from "diggerize"
|
|
3
3
|
import * as inflection from "inflection"
|
|
4
|
+
import memo from "set-state-compare/src/memo"
|
|
4
5
|
import MoneyFormatter from "../../money-formatter"
|
|
5
6
|
import PropTypes from "prop-types"
|
|
6
|
-
import {
|
|
7
|
+
import {useMemo} from "react"
|
|
7
8
|
import {shapeComponent, ShapeComponent} from "set-state-compare/src/shape-component.js"
|
|
8
9
|
import strftime from "strftime"
|
|
9
10
|
import useI18n from "i18n-on-steroids/src/use-i18n.mjs"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import AttributeRow from "./attribute-row"
|
|
2
2
|
import BaseComponent from "../base-component"
|
|
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"
|
package/src/bootstrap/card.jsx
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import BaseComponent from "../base-component"
|
|
2
2
|
import classNames from "classnames"
|
|
3
3
|
import {digg, digs} from "diggerize"
|
|
4
|
+
import memo from "set-state-compare/src/memo"
|
|
4
5
|
import PropTypes from "prop-types"
|
|
5
|
-
import {
|
|
6
|
+
import {useRef} from "react"
|
|
6
7
|
import {shapeComponent} from "set-state-compare/src/shape-component.js"
|
|
7
8
|
|
|
8
9
|
export default memo(shapeComponent(class ApiMakerBootstrapCard extends BaseComponent {
|
package/src/bootstrap/input.jsx
CHANGED
|
@@ -4,7 +4,7 @@ import {Input} from "../inputs/input"
|
|
|
4
4
|
import InvalidFeedback from "./invalid-feedback"
|
|
5
5
|
import Money from "../inputs/money"
|
|
6
6
|
import PropTypes from "prop-types"
|
|
7
|
-
import
|
|
7
|
+
import memo from "set-state-compare/src/memo"
|
|
8
8
|
import {shapeComponent, ShapeComponent} from "set-state-compare/src/shape-component.js"
|
|
9
9
|
|
|
10
10
|
const ApiMakerBootstrapInput = memo(shapeComponent(class ApiMakerBootstrapInput extends ShapeComponent {
|
|
@@ -3,8 +3,9 @@ import instanceOfClassName from "../instance-of-class-name"
|
|
|
3
3
|
import Link from "../link"
|
|
4
4
|
import PropTypes from "prop-types"
|
|
5
5
|
import propTypesExact from "prop-types-exact"
|
|
6
|
+
import memo from "set-state-compare/src/memo"
|
|
6
7
|
import qs from "qs"
|
|
7
|
-
import {
|
|
8
|
+
import {useMemo} from "react"
|
|
8
9
|
import Text from "../utils/text"
|
|
9
10
|
import Result from "../result"
|
|
10
11
|
import {shapeComponent} from "set-state-compare/src/shape-component.js"
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import BaseComponent from "../base-component"
|
|
2
2
|
import * as inflection from "inflection"
|
|
3
|
+
import FontAwesomeIcon from "react-native-vector-icons/FontAwesome"
|
|
3
4
|
import PropTypes from "prop-types"
|
|
4
5
|
import qs from "qs"
|
|
5
|
-
import
|
|
6
|
+
import memo from "set-state-compare/src/memo"
|
|
6
7
|
import Text from "../utils/text"
|
|
7
8
|
import {shapeComponent} from "set-state-compare/src/shape-component.js"
|
|
8
9
|
import urlEncode from "../url-encode.mjs"
|
|
10
|
+
import useSorting from "../table/use-sorting.mjs"
|
|
9
11
|
|
|
10
12
|
import Link from "../link"
|
|
11
13
|
import useQueryParams from "on-location-changed/src/use-query-params"
|
|
@@ -22,18 +24,27 @@ export default memo(shapeComponent(class ApiMakerBootstrapSortLink extends BaseC
|
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
setup() {
|
|
27
|
+
const {attribute, defaultParams, query} = this.props
|
|
28
|
+
const {qParams, searchKey, sortAttribute, sortMode} = useSorting({defaultParams, query})
|
|
29
|
+
|
|
30
|
+
this.setInstance({
|
|
31
|
+
isSortedByAttribute: sortAttribute == attribute,
|
|
32
|
+
qParams,
|
|
33
|
+
searchKey,
|
|
34
|
+
sortMode
|
|
35
|
+
})
|
|
36
|
+
|
|
25
37
|
this.queryParams = useQueryParams()
|
|
26
38
|
this.searchKey = this.p.query.queryArgs.searchKey || "q"
|
|
39
|
+
this.attribute = inflection.underscore(this.p.attribute)
|
|
27
40
|
}
|
|
28
41
|
|
|
29
|
-
attribute = () => inflection.underscore(this.p.attribute)
|
|
30
|
-
|
|
31
42
|
href () {
|
|
32
|
-
const qParams = this.qParams
|
|
33
|
-
const {queryParams, searchKey} = this.tt
|
|
43
|
+
const qParams = Object.assign({}, this.tt.qParams)
|
|
44
|
+
const {attribute, queryParams, searchKey, sortMode} = this.tt
|
|
34
45
|
const newQueryParams = {...queryParams}
|
|
35
46
|
|
|
36
|
-
qParams.s = `${
|
|
47
|
+
qParams.s = `${attribute} ${sortMode == "asc" ? "desc" : "asc"}` // eslint-disable-line id-length
|
|
37
48
|
|
|
38
49
|
newQueryParams[searchKey] = JSON.stringify(qParams)
|
|
39
50
|
|
|
@@ -43,58 +54,46 @@ export default memo(shapeComponent(class ApiMakerBootstrapSortLink extends BaseC
|
|
|
43
54
|
return newPath
|
|
44
55
|
}
|
|
45
56
|
|
|
46
|
-
isSortedByAttribute () {
|
|
47
|
-
const params = this.qParams()
|
|
48
|
-
|
|
49
|
-
if (params.s == this.attribute()) return true
|
|
50
|
-
if (params.s == `${this.attribute()} asc`) return true
|
|
51
|
-
|
|
52
|
-
return false
|
|
53
|
-
}
|
|
54
|
-
|
|
55
57
|
render () {
|
|
58
|
+
const {isSortedByAttribute, sortMode} = this.tt
|
|
56
59
|
const LinkComponent = this.linkComponent()
|
|
57
|
-
const {attribute, className, defaultParams, linkComponent, onChanged, query, textProps, title, ...restProps} = this.props
|
|
60
|
+
const {attribute, className, dataSet, defaultParams, linkComponent, onChanged, query, style, textProps, title, ...restProps} = this.props
|
|
61
|
+
const actualDataSet = Object.assign(
|
|
62
|
+
{
|
|
63
|
+
attribute,
|
|
64
|
+
class: className,
|
|
65
|
+
component: "api-maker/bootstrap/sort-link",
|
|
66
|
+
sortMode: this.tt.sortMode
|
|
67
|
+
},
|
|
68
|
+
dataSet
|
|
69
|
+
)
|
|
70
|
+
const actualStyle = Object.assign(
|
|
71
|
+
{display: "flex", flexDirection: "row", alignItems: "center"},
|
|
72
|
+
style
|
|
73
|
+
)
|
|
58
74
|
|
|
59
75
|
return (
|
|
60
76
|
<LinkComponent
|
|
61
|
-
dataSet={
|
|
62
|
-
|
|
63
|
-
class: className,
|
|
64
|
-
component: "api-maker--bootstrap--sort-link",
|
|
65
|
-
sortMode: this.sortMode()
|
|
66
|
-
}}
|
|
77
|
+
dataSet={actualDataSet}
|
|
78
|
+
style={actualStyle}
|
|
67
79
|
to={this.href()}
|
|
68
80
|
{...restProps}
|
|
69
81
|
>
|
|
70
82
|
<Text {...textProps}>
|
|
71
83
|
{this.title()}
|
|
72
84
|
</Text>
|
|
85
|
+
{isSortedByAttribute && sortMode == "asc" &&
|
|
86
|
+
<FontAwesomeIcon name="chevron-down" size={14} style={{marginLeft: 3}} />
|
|
87
|
+
}
|
|
88
|
+
{isSortedByAttribute && sortMode == "desc" &&
|
|
89
|
+
<FontAwesomeIcon name="chevron-up" size={14} style={{marginLeft: 3}} />
|
|
90
|
+
}
|
|
73
91
|
</LinkComponent>
|
|
74
92
|
)
|
|
75
93
|
}
|
|
76
94
|
|
|
77
95
|
linkComponent = () => this.props.linkComponent || Link
|
|
78
96
|
|
|
79
|
-
qParams() {
|
|
80
|
-
const {defaultParams} = this.props
|
|
81
|
-
const {queryParams, searchKey} = this.tt
|
|
82
|
-
|
|
83
|
-
if (searchKey in queryParams) {
|
|
84
|
-
return JSON.parse(queryParams[searchKey])
|
|
85
|
-
} else if (defaultParams) {
|
|
86
|
-
return {...defaultParams}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return {}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
sortMode () {
|
|
93
|
-
if (this.isSortedByAttribute()) return "desc"
|
|
94
|
-
|
|
95
|
-
return "asc"
|
|
96
|
-
}
|
|
97
|
-
|
|
98
97
|
title () {
|
|
99
98
|
const {attribute, query} = this.p
|
|
100
99
|
const {title} = this.props
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Collection from "./collection.mjs"
|
|
2
2
|
import {digg} from "diggerize"
|
|
3
|
-
import
|
|
3
|
+
import memo from "set-state-compare/src/memo"
|
|
4
|
+
import {useMemo} from "react"
|
|
4
5
|
import PropTypes from "prop-types"
|
|
5
6
|
import PropTypesExact from "prop-types-exact"
|
|
6
7
|
import useCollection from "./use-collection"
|
package/src/event-created.jsx
CHANGED
package/src/event-destroyed.jsx
CHANGED
package/src/event-listener.jsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import memo from "set-state-compare/src/memo"
|
|
1
2
|
import PropTypes from "prop-types"
|
|
2
3
|
import propTypesExact from "prop-types-exact"
|
|
3
|
-
import {memo} from "react"
|
|
4
4
|
import useEventListener from "./use-event-listener.mjs"
|
|
5
5
|
|
|
6
6
|
const callEvent = (target, eventName, args = []) => {
|
package/src/event-updated.jsx
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import BaseComponent from "./base-component"
|
|
2
|
+
import memo from "set-state-compare/src/memo"
|
|
1
3
|
import PropTypes from "prop-types"
|
|
2
4
|
import propTypesExact from "prop-types-exact"
|
|
3
|
-
import {
|
|
4
|
-
import {shapeComponent, ShapeComponent} from "set-state-compare/src/shape-component.js"
|
|
5
|
+
import {shapeComponent} from "set-state-compare/src/shape-component.js"
|
|
5
6
|
import useUpdatedEvent from "./use-updated-event.mjs"
|
|
6
7
|
|
|
7
|
-
export default memo(shapeComponent(class ApiMakerEventUpdated extends
|
|
8
|
+
export default memo(shapeComponent(class ApiMakerEventUpdated extends BaseComponent {
|
|
8
9
|
static propTypes = propTypesExact({
|
|
9
10
|
active: PropTypes.bool,
|
|
10
11
|
debounce: PropTypes.oneOfType([
|
package/src/form.jsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {createContext,
|
|
1
|
+
import {createContext, useContext, useMemo} from "react"
|
|
2
2
|
import BaseComponent from "./base-component"
|
|
3
3
|
import FormDataObjectizer from "form-data-objectizer"
|
|
4
|
+
import memo from "set-state-compare/src/memo"
|
|
4
5
|
import {Platform} from "react-native"
|
|
5
6
|
import PropTypes from "prop-types"
|
|
6
7
|
import {shapeComponent} from "set-state-compare/src/shape-component.js"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import BaseComponent from "../base-component"
|
|
2
2
|
import {Input as ApiMakerInput} from "@kaspernj/api-maker/src/inputs/input"
|
|
3
3
|
import {Checkbox} from "./checkbox"
|
|
4
|
-
import
|
|
4
|
+
import memo from "set-state-compare/src/memo"
|
|
5
5
|
import {shapeComponent} from "set-state-compare/src/shape-component.js"
|
|
6
6
|
|
|
7
7
|
export default memo(shapeComponent(class ApiMakerInputsAttachment extends BaseComponent {
|
package/src/inputs/checkbox.jsx
CHANGED
|
@@ -4,7 +4,7 @@ import {digg, digs} from "diggerize"
|
|
|
4
4
|
import EventUpdated from "../event-updated"
|
|
5
5
|
import inputWrapper from "./input-wrapper"
|
|
6
6
|
import PropTypes from "prop-types"
|
|
7
|
-
import
|
|
7
|
+
import memo from "set-state-compare/src/memo"
|
|
8
8
|
import {shapeComponent} from "set-state-compare/src/shape-component.js"
|
|
9
9
|
import {useForm} from "../form"
|
|
10
10
|
|
|
@@ -6,7 +6,7 @@ import * as inflection from "inflection"
|
|
|
6
6
|
import InvalidFeedback from "../bootstrap/invalid-feedback"
|
|
7
7
|
import PropTypes from "prop-types"
|
|
8
8
|
import propTypesExact from "prop-types-exact"
|
|
9
|
-
import
|
|
9
|
+
import memo from "set-state-compare/src/memo"
|
|
10
10
|
import {shapeComponent} from "set-state-compare/src/shape-component.js"
|
|
11
11
|
|
|
12
12
|
const ApiMakerInputsCheckboxes = memo(shapeComponent(class ApiMakerInputsCheckboxes extends BaseComponent {
|
package/src/inputs/input.jsx
CHANGED
|
@@ -3,9 +3,10 @@ import BaseComponent from "../base-component"
|
|
|
3
3
|
import {dig, digg, digs} from "diggerize"
|
|
4
4
|
import EventUpdated from "../event-updated"
|
|
5
5
|
import inputWrapper from "./input-wrapper"
|
|
6
|
+
import memo from "set-state-compare/src/memo"
|
|
6
7
|
import Money from "./money"
|
|
7
8
|
import PropTypes from "prop-types"
|
|
8
|
-
import {
|
|
9
|
+
import {useMemo, useRef} from "react"
|
|
9
10
|
import replaceall from "replaceall"
|
|
10
11
|
import {shapeComponent} from "set-state-compare/src/shape-component.js"
|
|
11
12
|
import strftime from "strftime"
|
package/src/inputs/money.jsx
CHANGED
|
@@ -3,10 +3,11 @@ import Config from "../config.mjs"
|
|
|
3
3
|
import {digg} from "diggerize"
|
|
4
4
|
import idForComponent from "./id-for-component.mjs"
|
|
5
5
|
import * as inflection from "inflection"
|
|
6
|
+
import memo from "set-state-compare/src/memo"
|
|
6
7
|
import MoneyFormatter from "../money-formatter"
|
|
7
8
|
import PropTypes from "prop-types"
|
|
8
9
|
import PropTypesExact from "prop-types-exact"
|
|
9
|
-
import {
|
|
10
|
+
import {useRef} from "react"
|
|
10
11
|
import {shapeComponent, ShapeComponent} from "set-state-compare/src/shape-component.js"
|
|
11
12
|
|
|
12
13
|
export default memo(shapeComponent(class ApiMakerInputsMoney extends ShapeComponent {
|
package/src/inputs/select.jsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import BaseComponent from "../base-component"
|
|
2
2
|
import inputWrapper from "./input-wrapper"
|
|
3
3
|
import PropTypes from "prop-types"
|
|
4
|
-
import
|
|
4
|
+
import memo from "set-state-compare/src/memo"
|
|
5
5
|
import {shapeComponent} from "set-state-compare/src/shape-component.js"
|
|
6
6
|
import {useForm} from "../form"
|
|
7
7
|
|
package/src/link.jsx
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
+
import {Platform, Pressable} from "react-native"
|
|
1
2
|
import BaseComponent from "./base-component"
|
|
2
3
|
import dataSetToAttributes from "./data-set-to-attributes.mjs"
|
|
3
|
-
import
|
|
4
|
-
import
|
|
4
|
+
import memo from "set-state-compare/src/memo"
|
|
5
|
+
import PropTypes from "prop-types"
|
|
5
6
|
import {shapeComponent} from "set-state-compare/src/shape-component.js"
|
|
6
7
|
|
|
7
|
-
export default memo(shapeComponent(class
|
|
8
|
+
export default memo(shapeComponent(class ApiMakerLink extends BaseComponent {
|
|
9
|
+
static propTypes = {
|
|
10
|
+
usePressable: PropTypes.bool
|
|
11
|
+
}
|
|
12
|
+
|
|
8
13
|
render() {
|
|
9
|
-
const {dataSet, to, onClick, onPress, ...restProps} = this.props
|
|
14
|
+
const {dataSet, to, onClick, onPress, usePressable, ...restProps} = this.props
|
|
10
15
|
|
|
11
|
-
if (Platform.OS == "web") {
|
|
16
|
+
if (Platform.OS == "web" && !usePressable) {
|
|
12
17
|
return (
|
|
13
18
|
<a {...dataSetToAttributes(dataSet)} href={to} {...restProps} onClick={this.tt.onLinkClicked} />
|
|
14
19
|
)
|
|
@@ -37,7 +42,7 @@ export default memo(shapeComponent(class Link extends BaseComponent {
|
|
|
37
42
|
}
|
|
38
43
|
}
|
|
39
44
|
|
|
40
|
-
onPress() {
|
|
45
|
+
onPress = () => {
|
|
41
46
|
const {onClick, onPress} = this.props
|
|
42
47
|
|
|
43
48
|
if (onClick) {
|
|
@@ -51,7 +56,7 @@ export default memo(shapeComponent(class Link extends BaseComponent {
|
|
|
51
56
|
this.redirect()
|
|
52
57
|
}
|
|
53
58
|
|
|
54
|
-
redirect() {
|
|
59
|
+
redirect = () => {
|
|
55
60
|
const history = globalThis.apiMakerConfigGlobal?.history
|
|
56
61
|
|
|
57
62
|
if (!history) throw new Error("History hasn't been set in the API maker configuration")
|
package/src/modal.jsx
CHANGED
package/src/resize-observer.jsx
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {useMemo} from "react"
|
|
2
2
|
import {StyleSheet, View} from "react-native"
|
|
3
3
|
import Checkbox from "../../utils/checkbox"
|
|
4
4
|
import BaseComponent from "../../base-component"
|
|
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.js"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import BaseComponent from "../../base-component"
|
|
2
|
-
import
|
|
2
|
+
import memo from "set-state-compare/src/memo"
|
|
3
3
|
import PropTypes from "prop-types"
|
|
4
4
|
import propTypesExact from "prop-types-exact"
|
|
5
5
|
import {shapeComponent} from "set-state-compare/src/shape-component.js"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {useMemo} from "react"
|
|
2
2
|
import {TextInput, View} from "react-native"
|
|
3
3
|
import BaseComponent from "../../base-component"
|
|
4
|
+
import memo from "set-state-compare/src/memo"
|
|
4
5
|
import PropTypes from "prop-types"
|
|
5
6
|
import propTypesExact from "prop-types-exact"
|
|
6
7
|
import {shapeComponent} from "set-state-compare/src/shape-component.js"
|
|
@@ -5,7 +5,7 @@ import EditAttributeContent from "./edit-attribute-content"
|
|
|
5
5
|
import EditAttributeInput from "./edit-attribute-input"
|
|
6
6
|
import * as inflection from "inflection"
|
|
7
7
|
import Locales from "shared/locales"
|
|
8
|
-
import
|
|
8
|
+
import memo from "set-state-compare/src/memo"
|
|
9
9
|
import PropTypes from "prop-types"
|
|
10
10
|
import propTypesExact from "prop-types-exact"
|
|
11
11
|
import {View} from "react-native"
|
|
@@ -6,7 +6,7 @@ import EditAttribute from "./edit-page/edit-attribute"
|
|
|
6
6
|
import {Form} from "../form"
|
|
7
7
|
import * as inflection from "inflection"
|
|
8
8
|
import Locales from "shared/locales"
|
|
9
|
-
import
|
|
9
|
+
import memo from "set-state-compare/src/memo"
|
|
10
10
|
import PropTypes from "prop-types"
|
|
11
11
|
import propTypesExact from "prop-types-exact"
|
|
12
12
|
import {shapeComponent} from "set-state-compare/src/shape-component.js"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import BaseComponent from "../base-component"
|
|
2
|
-
import
|
|
2
|
+
import memo from "set-state-compare/src/memo"
|
|
3
3
|
import ModelClassTable from "./model-class-table"
|
|
4
4
|
import PropTypes from "prop-types"
|
|
5
5
|
import {shapeComponent} from "set-state-compare/src/shape-component.js"
|
|
@@ -6,7 +6,8 @@ import hasEditConfig from "./has-edit-config.js"
|
|
|
6
6
|
import IndexPage from "./index-page"
|
|
7
7
|
import Layout from "./layout"
|
|
8
8
|
import Link from "../link"
|
|
9
|
-
import
|
|
9
|
+
import memo from "set-state-compare/src/memo"
|
|
10
|
+
import {useMemo} from "react"
|
|
10
11
|
import * as modelsModule from "@kaspernj/api-maker/src/models.mjs.erb"
|
|
11
12
|
import {shapeComponent} from "set-state-compare/src/shape-component.js"
|
|
12
13
|
import ShowPage from "./show-page"
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import "./style"
|
|
2
2
|
import BaseComponent from "../../../base-component"
|
|
3
3
|
import FontAwesomeIcon from "react-native-vector-icons/FontAwesome"
|
|
4
|
-
import
|
|
4
|
+
import memo from "set-state-compare/src/memo"
|
|
5
|
+
import {useRef} from "react"
|
|
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.js"
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import "./style"
|
|
2
2
|
import BaseComponent from "../../base-component"
|
|
3
|
-
import classNames from "classnames"
|
|
4
3
|
import CommandsPool from "../../commands-pool"
|
|
5
4
|
import config from "super-admin/config"
|
|
6
5
|
import Header from "./header"
|
|
6
|
+
import memo from "set-state-compare/src/memo"
|
|
7
7
|
import Menu from "./menu"
|
|
8
8
|
import PropTypes from "prop-types"
|
|
9
9
|
import PropTypesExact from "prop-types-exact"
|
|
10
|
-
import {
|
|
10
|
+
import {useMemo} from "react"
|
|
11
11
|
import {shapeComponent} from "set-state-compare/src/shape-component.js"
|
|
12
12
|
import useCurrentUser from "../../use-current-user"
|
|
13
13
|
import useI18n from "i18n-on-steroids/src/use-i18n.mjs"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import BaseComponent from "../../../base-component"
|
|
2
2
|
import {digg} from "diggerize"
|
|
3
|
-
import
|
|
3
|
+
import memo from "set-state-compare/src/memo"
|
|
4
|
+
import {useMemo} from "react"
|
|
4
5
|
import MenuItem from "./menu-item"
|
|
5
6
|
import models from "../../models"
|
|
6
7
|
import Params from "../../../params"
|
|
@@ -2,7 +2,7 @@ import "./style"
|
|
|
2
2
|
import BaseComponent from "../../../../base-component"
|
|
3
3
|
import classNames from "classnames"
|
|
4
4
|
import Link from "../../../../link"
|
|
5
|
-
import
|
|
5
|
+
import memo from "set-state-compare/src/memo"
|
|
6
6
|
import PropTypes from "prop-types"
|
|
7
7
|
import {shapeComponent} from "set-state-compare/src/shape-component.js"
|
|
8
8
|
import Text from "../../../../utils/text"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import BaseComponent from "../../base-component"
|
|
2
|
-
import
|
|
2
|
+
import memo from "set-state-compare/src/memo"
|
|
3
3
|
import {shapeComponent} from "set-state-compare/src/shape-component.js"
|
|
4
4
|
import useCurrentUser from "../../use-current-user"
|
|
5
5
|
import useI18n from "i18n-on-steroids/src/use-i18n.mjs"
|
|
@@ -3,9 +3,10 @@ import ConfigReader from "./config-reader.jsx"
|
|
|
3
3
|
import {digg} from "diggerize"
|
|
4
4
|
import hasEditConfig from "./has-edit-config.js"
|
|
5
5
|
import * as inflection from "inflection"
|
|
6
|
+
import memo from "set-state-compare/src/memo"
|
|
6
7
|
import Params from "../params"
|
|
7
8
|
import PropTypes from "prop-types"
|
|
8
|
-
import {
|
|
9
|
+
import {useMemo} from "react"
|
|
9
10
|
import {shapeComponent} from "set-state-compare/src/shape-component.js"
|
|
10
11
|
import Table from "../table/table"
|
|
11
12
|
import useCurrentUser from "../use-current-user"
|
|
@@ -2,7 +2,7 @@ import BaseComponent from "../base-component"
|
|
|
2
2
|
import Link from "../link"
|
|
3
3
|
import PropTypes from "prop-types"
|
|
4
4
|
import PropTypesExact from "prop-types-exact"
|
|
5
|
-
import
|
|
5
|
+
import memo from "set-state-compare/src/memo"
|
|
6
6
|
import {shapeComponent} from "set-state-compare/src/shape-component.js"
|
|
7
7
|
import ShowReflectionLink from "./show-reflection-link"
|
|
8
8
|
import Text from "../utils/text"
|
|
@@ -2,7 +2,7 @@ import AttributeRow from "../../bootstrap/attribute-row"
|
|
|
2
2
|
import BaseComponent from "../../base-component"
|
|
3
3
|
import * as inflection from "inflection"
|
|
4
4
|
import Link from "../../link"
|
|
5
|
-
import
|
|
5
|
+
import memo from "set-state-compare/src/memo"
|
|
6
6
|
import Params from "../../params"
|
|
7
7
|
import {shapeComponent} from "set-state-compare/src/shape-component.js"
|
|
8
8
|
import Text from "../../utils/text"
|
|
@@ -3,9 +3,10 @@ import BaseComponent from "../../base-component"
|
|
|
3
3
|
import BelongsToAttributeRow from "./belongs-to-attribute-row"
|
|
4
4
|
import ConfigReader from "../config-reader.jsx"
|
|
5
5
|
import {digg} from "diggerize"
|
|
6
|
+
import memo from "set-state-compare/src/memo"
|
|
6
7
|
import * as inflection from "inflection"
|
|
7
8
|
import PropTypes from "prop-types"
|
|
8
|
-
import {
|
|
9
|
+
import {useMemo} from "react"
|
|
9
10
|
import {shapeComponent} from "set-state-compare/src/shape-component.js"
|
|
10
11
|
import ShowNav from "../show-nav"
|
|
11
12
|
import useModel from "../../use-model"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import BaseComponent from "../base-component"
|
|
2
2
|
import {digg} from "diggerize"
|
|
3
|
-
import
|
|
3
|
+
import memo from "set-state-compare/src/memo"
|
|
4
|
+
import {useMemo} from "react"
|
|
4
5
|
import PropTypes from "prop-types"
|
|
5
6
|
import propTypesExact from "prop-types-exact"
|
|
6
7
|
import {shapeComponent} from "set-state-compare/src/shape-component.js"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import BaseComponent from "../base-component"
|
|
2
2
|
import {digg} from "diggerize"
|
|
3
3
|
import Link from "../link"
|
|
4
|
-
import
|
|
4
|
+
import memo from "set-state-compare/src/memo"
|
|
5
5
|
import {shapeComponent} from "set-state-compare/src/shape-component.js"
|
|
6
6
|
import Text from "../utils/text"
|
|
7
7
|
import {useMemo} from "react"
|
|
@@ -2,7 +2,7 @@ import BaseComponent from "../base-component"
|
|
|
2
2
|
import {digg} from "diggerize"
|
|
3
3
|
import PropTypes from "prop-types"
|
|
4
4
|
import propTypesExact from "prop-types-exact"
|
|
5
|
-
import
|
|
5
|
+
import memo from "set-state-compare/src/memo"
|
|
6
6
|
import ModelClassTable from "./model-class-table"
|
|
7
7
|
import {shapeComponent} from "set-state-compare/src/shape-component.js"
|
|
8
8
|
import ShowNav from "./show-nav"
|