@kaspernj/api-maker 1.0.362 → 1.0.364
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/bootstrap/input.jsx +3 -3
- package/src/bootstrap/live-table.jsx +1 -1
- package/src/bootstrap/paginate.jsx +1 -1
- package/src/inputs/input.jsx +3 -3
- package/src/inputs/money.jsx +3 -3
- package/src/table/filters/index.jsx +1 -1
- package/src/table/model-row.jsx +3 -2
- package/src/table/worker-plugins-checkbox.jsx +3 -3
- package/src/url-encode.mjs +4 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaspernj/api-maker",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.364",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"on-location-changed": ">= 1.0.10",
|
|
36
36
|
"qs": ">= 6.9.3",
|
|
37
37
|
"replaceall": ">= 0.1.6",
|
|
38
|
-
"set-state-compare": "^1.0.
|
|
38
|
+
"set-state-compare": "^1.0.42",
|
|
39
39
|
"spark-md5": "^3.0.2",
|
|
40
40
|
"strftime": ">= 0.10.0",
|
|
41
41
|
"uniqunize": "^1.0.1",
|
package/src/bootstrap/input.jsx
CHANGED
|
@@ -4,10 +4,10 @@ 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 "react"
|
|
8
8
|
import {shapeComponent, ShapeComponent} from "set-state-compare/src/shape-component.js"
|
|
9
9
|
|
|
10
|
-
const ApiMakerBootstrapInput = shapeComponent(class ApiMakerBootstrapInput extends ShapeComponent {
|
|
10
|
+
const ApiMakerBootstrapInput = memo(shapeComponent(class ApiMakerBootstrapInput extends ShapeComponent {
|
|
11
11
|
static propTypes = {
|
|
12
12
|
append: PropTypes.node,
|
|
13
13
|
appendText: PropTypes.node,
|
|
@@ -167,6 +167,6 @@ const ApiMakerBootstrapInput = shapeComponent(class ApiMakerBootstrapInput exten
|
|
|
167
167
|
|
|
168
168
|
return classNames.join(" ")
|
|
169
169
|
}
|
|
170
|
-
})
|
|
170
|
+
}))
|
|
171
171
|
|
|
172
172
|
export default inputWrapper(ApiMakerBootstrapInput)
|
|
@@ -9,7 +9,7 @@ import ModelRow from "./live-table/model-row"
|
|
|
9
9
|
import Paginate from "./paginate"
|
|
10
10
|
import Params from "../params"
|
|
11
11
|
import PropTypes from "prop-types"
|
|
12
|
-
import
|
|
12
|
+
import {memo} from "react"
|
|
13
13
|
import {shapeComponent, ShapeComponent} from "set-state-compare/src/shape-component.js"
|
|
14
14
|
import SortLink from "./sort-link"
|
|
15
15
|
|
|
@@ -3,7 +3,7 @@ import Link from "../link"
|
|
|
3
3
|
import PropTypes from "prop-types"
|
|
4
4
|
import propTypesExact from "prop-types-exact"
|
|
5
5
|
import qs from "qs"
|
|
6
|
-
import
|
|
6
|
+
import {memo} from "react"
|
|
7
7
|
import Result from "../result"
|
|
8
8
|
import {shapeComponent, ShapeComponent} from "set-state-compare/src/shape-component.js"
|
|
9
9
|
import urlEncode from "../url-encode.mjs"
|
package/src/inputs/input.jsx
CHANGED
|
@@ -4,12 +4,12 @@ import EventUpdated from "../event-updated"
|
|
|
4
4
|
import inputWrapper from "./input-wrapper"
|
|
5
5
|
import Money from "./money"
|
|
6
6
|
import PropTypes from "prop-types"
|
|
7
|
-
import
|
|
7
|
+
import {memo, useRef} from "react"
|
|
8
8
|
import replaceall from "replaceall"
|
|
9
9
|
import {shapeComponent, ShapeComponent} from "set-state-compare/src/shape-component.js"
|
|
10
10
|
import strftime from "strftime"
|
|
11
11
|
|
|
12
|
-
const ApiMakerInputsInput = shapeComponent(class ApiMakerInputsInput extends ShapeComponent {
|
|
12
|
+
const ApiMakerInputsInput = memo(shapeComponent(class ApiMakerInputsInput extends ShapeComponent {
|
|
13
13
|
static defaultProps = {
|
|
14
14
|
autoRefresh: false,
|
|
15
15
|
autoSubmit: false,
|
|
@@ -229,7 +229,7 @@ const ApiMakerInputsInput = shapeComponent(class ApiMakerInputsInput extends Sha
|
|
|
229
229
|
if (this.props.inputProps.type == "file" && value == "")
|
|
230
230
|
return true
|
|
231
231
|
}
|
|
232
|
-
})
|
|
232
|
+
}))
|
|
233
233
|
|
|
234
234
|
export {ApiMakerInputsInput as Input}
|
|
235
235
|
export default inputWrapper(ApiMakerInputsInput)
|
package/src/inputs/money.jsx
CHANGED
|
@@ -6,10 +6,10 @@ import * as inflection from "inflection"
|
|
|
6
6
|
import MoneyFormatter from "../money-formatter"
|
|
7
7
|
import PropTypes from "prop-types"
|
|
8
8
|
import PropTypesExact from "prop-types-exact"
|
|
9
|
-
import
|
|
9
|
+
import {memo, useRef} from "react"
|
|
10
10
|
import {shapeComponent, ShapeComponent} from "set-state-compare/src/shape-component.js"
|
|
11
11
|
|
|
12
|
-
export default shapeComponent(class ApiMakerInputsMoney extends ShapeComponent {
|
|
12
|
+
export default memo(shapeComponent(class ApiMakerInputsMoney extends ShapeComponent {
|
|
13
13
|
static defaultProps = {
|
|
14
14
|
disabled: false,
|
|
15
15
|
showCurrencyOptions: true
|
|
@@ -183,4 +183,4 @@ export default shapeComponent(class ApiMakerInputsMoney extends ShapeComponent {
|
|
|
183
183
|
if (this.props.onChange && oldCents != cents)
|
|
184
184
|
this.props.onChange()
|
|
185
185
|
}
|
|
186
|
-
})
|
|
186
|
+
}))
|
|
@@ -3,7 +3,7 @@ import FilterForm from "./filter-form"
|
|
|
3
3
|
import LoadSearchModal from "./load-search-modal"
|
|
4
4
|
import SaveSearchModal from "./save-search-modal"
|
|
5
5
|
import PropTypes from "prop-types"
|
|
6
|
-
import
|
|
6
|
+
import {memo} from "react"
|
|
7
7
|
import {shapeComponent, ShapeComponent} from "set-state-compare/src/shape-component.js"
|
|
8
8
|
import useI18n from "i18n-on-steroids/src/use-i18n.mjs"
|
|
9
9
|
import useQueryParams from "on-location-changed/src/use-query-params"
|
package/src/table/model-row.jsx
CHANGED
|
@@ -6,11 +6,12 @@ import * as inflection from "inflection"
|
|
|
6
6
|
import Link from "../link"
|
|
7
7
|
import MoneyFormatter from "../money-formatter"
|
|
8
8
|
import PropTypes from "prop-types"
|
|
9
|
+
import {memo} from "react"
|
|
9
10
|
import {shapeComponent, ShapeComponent} from "set-state-compare/src/shape-component"
|
|
10
11
|
|
|
11
12
|
const WorkerPluginsCheckbox = React.lazy(() => import("./worker-plugins-checkbox"))
|
|
12
13
|
|
|
13
|
-
export default shapeComponent(class ApiMakerBootStrapLiveTableModelRow extends ShapeComponent {
|
|
14
|
+
export default memo(shapeComponent(class ApiMakerBootStrapLiveTableModelRow extends ShapeComponent {
|
|
14
15
|
static propTypes = {
|
|
15
16
|
cacheKey: PropTypes.string.isRequired,
|
|
16
17
|
model: PropTypes.object.isRequired,
|
|
@@ -188,4 +189,4 @@ export default shapeComponent(class ApiMakerBootStrapLiveTableModelRow extends S
|
|
|
188
189
|
throw new Error(`Unhandled type: ${apiMakerType}`)
|
|
189
190
|
}
|
|
190
191
|
}
|
|
191
|
-
})
|
|
192
|
+
}))
|
|
@@ -4,12 +4,12 @@ import EventConnection from "../event-connection"
|
|
|
4
4
|
import modelClassRequire from "../model-class-require.mjs"
|
|
5
5
|
import PropTypes from "prop-types"
|
|
6
6
|
import PropTypesExact from "prop-types-exact"
|
|
7
|
-
import
|
|
7
|
+
import {memo, useEffect} from "react"
|
|
8
8
|
import {shapeComponent, ShapeComponent} from "set-state-compare/src/shape-component"
|
|
9
9
|
|
|
10
10
|
const Workplace = modelClassRequire("Workplace")
|
|
11
11
|
|
|
12
|
-
export default shapeComponent(class ApiMakerTableWorkerPluginsCheckbox extends ShapeComponent {
|
|
12
|
+
export default memo(shapeComponent(class ApiMakerTableWorkerPluginsCheckbox extends ShapeComponent {
|
|
13
13
|
static propTypes = PropTypesExact({
|
|
14
14
|
currentWorkplace: PropTypes.object,
|
|
15
15
|
model: PropTypes.object.isRequired
|
|
@@ -102,4 +102,4 @@ export default shapeComponent(class ApiMakerTableWorkerPluginsCheckbox extends S
|
|
|
102
102
|
this.setState({checked: false})
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
})
|
|
105
|
+
}))
|
package/src/url-encode.mjs
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
const replaces = {
|
|
2
2
|
" ": "+",
|
|
3
3
|
"&": "%26",
|
|
4
|
-
"#": "%23"
|
|
4
|
+
"#": "%23",
|
|
5
|
+
"/": "%2F",
|
|
6
|
+
"?": "%3F"
|
|
5
7
|
}
|
|
6
8
|
|
|
7
9
|
const urlEncode = (string) => {
|
|
8
|
-
return `${string}`.replaceAll(/(
|
|
10
|
+
return `${string}`.replaceAll(/( |&|#|\/|\?)/g, (character) => {
|
|
9
11
|
if (!(character in replaces)) {
|
|
10
12
|
throw new Error(`Didn't exist in replaces: "${character}"`)
|
|
11
13
|
}
|