@kaspernj/api-maker 1.0.448 → 1.0.450
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/build/bootstrap/attribute-row/index.js +2 -2
- package/build/bootstrap/attribute-rows.js +2 -1
- package/build/bootstrap/card.js +2 -2
- package/build/bootstrap/checkboxes.js +2 -2
- package/build/bootstrap/input.js +3 -2
- package/build/bootstrap/paginate.js +2 -2
- package/build/bootstrap/sort-link.js +2 -1
- package/build/draggable-sort/index.js +2 -2
- package/build/draggable-sort/item.js +2 -2
- package/build/flash-message.js +49 -0
- package/build/form.js +3 -3
- package/build/inputs/attachment.js +12 -4
- package/build/inputs/checkbox.js +2 -2
- package/build/inputs/input-wrapper.js +2 -1
- package/build/inputs/input.js +19 -6
- package/build/inputs/money.js +3 -3
- package/build/inputs/select.js +3 -2
- package/build/link.js +2 -1
- package/build/modal.js +2 -1
- package/build/money-formatter.js +6 -5
- package/build/router/route.js +11 -3
- package/build/router.js +3 -3
- package/build/super-admin/edit-page/edit-attribute-input.js +2 -2
- package/build/super-admin/edit-page/edit-attribute.js +2 -1
- package/build/super-admin/edit-page.js +4 -1
- package/build/super-admin/index-page.js +2 -1
- package/build/super-admin/index.js +3 -2
- package/build/super-admin/layout/header/index.js +2 -1
- package/build/super-admin/layout/index.js +6 -6
- package/build/super-admin/layout/menu/index.js +3 -1
- package/build/super-admin/layout/menu/menu-content.js +9 -3
- package/build/super-admin/layout/menu/menu-item.js +2 -1
- package/build/super-admin/layout/no-access.js +6 -4
- package/build/super-admin/model-class-table.js +2 -2
- package/build/super-admin/show-nav.js +3 -1
- package/build/super-admin/show-page/belongs-to-attribute-row.js +2 -1
- package/build/super-admin/show-page/index.js +2 -2
- package/build/super-admin/show-reflection-actions.js +2 -2
- package/build/super-admin/show-reflection-link.js +3 -1
- package/build/super-admin/show-reflection-page.js +2 -1
- package/build/table/column-content.js +10 -5
- package/build/table/components/column.js +2 -1
- package/build/table/components/flat-list.js +2 -1
- package/build/table/components/header.js +2 -1
- package/build/table/components/row.js +2 -1
- package/build/table/filters/attribute-element.js +2 -1
- package/build/table/filters/filter-form.js +15 -5
- package/build/table/filters/filter.js +2 -1
- package/build/table/filters/index.js +4 -2
- package/build/table/filters/load-search-modal.js +4 -3
- package/build/table/filters/reflection-element.js +2 -1
- package/build/table/filters/save-search-modal.js +3 -1
- package/build/table/filters/scope-element.js +2 -1
- package/build/table/header-column-content.js +2 -1
- package/build/table/header-column.js +2 -2
- package/build/table/header-select.js +2 -1
- package/build/table/model-column.js +11 -1
- package/build/table/model-row.js +16 -3
- package/build/table/settings/column-row.js +2 -2
- package/build/table/settings/download-action.js +2 -1
- package/build/table/settings/index.js +2 -2
- package/build/table/worker-plugins-check-all-checkbox.js +2 -2
- package/build/table/worker-plugins-checkbox.js +2 -2
- package/build/translated-collections.js +3 -2
- package/build/use-input.js +4 -7
- package/build/utils/default-style.js +2 -2
- package/build/utils/text.js +2 -1
- package/build/with-collection.js +2 -1
- package/build/with-current-user.js +2 -1
- package/build/with-model.js +2 -1
- package/build/with-router.js +2 -1
- package/package.json +3 -3
- package/src/bootstrap/attribute-row/index.jsx +1 -1
- package/src/bootstrap/attribute-rows.jsx +1 -0
- package/src/bootstrap/card.jsx +1 -1
- package/src/bootstrap/checkboxes.jsx +1 -1
- package/src/bootstrap/input.jsx +2 -1
- package/src/bootstrap/paginate.jsx +1 -1
- package/src/bootstrap/sort-link.jsx +1 -0
- package/src/draggable-sort/index.jsx +1 -1
- package/src/draggable-sort/item.jsx +1 -1
- package/src/flash-message.js +51 -0
- package/src/form.jsx +2 -3
- package/src/inputs/attachment.jsx +5 -3
- package/src/inputs/checkbox.jsx +1 -1
- package/src/inputs/input-wrapper.jsx +1 -0
- package/src/inputs/input.jsx +10 -5
- package/src/inputs/money.jsx +2 -2
- package/src/inputs/select.jsx +2 -1
- package/src/link.jsx +1 -0
- package/src/modal.jsx +1 -0
- package/src/money-formatter.js +5 -4
- package/src/router/route.jsx +5 -2
- package/src/router.jsx +3 -2
- package/src/super-admin/edit-page/edit-attribute-input.jsx +1 -1
- package/src/super-admin/edit-page/edit-attribute.jsx +1 -0
- package/src/super-admin/edit-page.jsx +3 -0
- package/src/super-admin/index-page.jsx +1 -0
- package/src/super-admin/index.jsx +2 -1
- package/src/super-admin/layout/header/index.jsx +1 -0
- package/src/super-admin/layout/index.jsx +4 -4
- package/src/super-admin/layout/menu/index.jsx +2 -0
- package/src/super-admin/layout/menu/menu-content.jsx +4 -2
- package/src/super-admin/layout/menu/menu-item.jsx +1 -0
- package/src/super-admin/layout/no-access.jsx +4 -2
- package/src/super-admin/model-class-table.jsx +1 -1
- package/src/super-admin/show-nav.jsx +2 -0
- package/src/super-admin/show-page/belongs-to-attribute-row.jsx +1 -0
- package/src/super-admin/show-page/index.jsx +1 -1
- package/src/super-admin/show-reflection-actions.jsx +1 -1
- package/src/super-admin/show-reflection-link.jsx +2 -0
- package/src/super-admin/show-reflection-page.jsx +1 -0
- package/src/table/column-content.jsx +8 -5
- package/src/table/components/column.jsx +1 -0
- package/src/table/components/flat-list.jsx +1 -0
- package/src/table/components/header.jsx +1 -0
- package/src/table/components/row.jsx +1 -0
- package/src/table/filters/attribute-element.jsx +1 -0
- package/src/table/filters/filter-form.jsx +13 -5
- package/src/table/filters/filter.jsx +1 -0
- package/src/table/filters/index.jsx +3 -1
- package/src/table/filters/load-search-modal.jsx +3 -2
- package/src/table/filters/reflection-element.jsx +1 -0
- package/src/table/filters/save-search-modal.jsx +2 -0
- package/src/table/filters/scope-element.jsx +1 -0
- package/src/table/header-column-content.jsx +1 -0
- package/src/table/header-column.jsx +1 -1
- package/src/table/header-select.jsx +1 -0
- package/src/table/model-column.jsx +4 -1
- package/src/table/model-row.jsx +10 -1
- package/src/table/settings/column-row.jsx +1 -1
- package/src/table/settings/download-action.jsx +1 -0
- package/src/table/settings/index.jsx +1 -1
- package/src/table/worker-plugins-check-all-checkbox.jsx +1 -1
- package/src/table/worker-plugins-checkbox.jsx +1 -1
- package/src/translated-collections.js +2 -1
- package/src/use-input.js +3 -8
- package/src/utils/default-style.jsx +1 -1
- package/src/utils/text.jsx +1 -0
- package/src/with-collection.jsx +1 -0
- package/src/with-current-user.jsx +1 -0
- package/src/with-model.jsx +1 -0
- package/src/with-router.jsx +1 -0
|
@@ -8,9 +8,11 @@ import EventEmitter from "events"
|
|
|
8
8
|
import PropTypes from "prop-types"
|
|
9
9
|
import propTypesExact from "prop-types-exact"
|
|
10
10
|
import memo from "set-state-compare/src/memo"
|
|
11
|
+
import React from "react"
|
|
11
12
|
import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
12
13
|
import Text from "../utils/text"
|
|
13
14
|
import useBreakpoint from "../use-breakpoint"
|
|
15
|
+
import useI18n from "i18n-on-steroids/src/use-i18n"
|
|
14
16
|
|
|
15
17
|
export default memo(shapeComponent(class ApiMakerTableModelColumn extends BaseComponent {
|
|
16
18
|
static propTypes = propTypesExact({
|
|
@@ -27,6 +29,7 @@ export default memo(shapeComponent(class ApiMakerTableModelColumn extends BaseCo
|
|
|
27
29
|
})
|
|
28
30
|
|
|
29
31
|
render() {
|
|
32
|
+
const {l, t} = useI18n({namespace: "js.api_maker.table.model_column"})
|
|
30
33
|
const {mdUp} = useBreakpoint()
|
|
31
34
|
const {animatedWidth, animatedZIndex, column, columnIndex, even, model, table} = this.props
|
|
32
35
|
const columnProps = table.columnProps(column)
|
|
@@ -62,7 +65,7 @@ export default memo(shapeComponent(class ApiMakerTableModelColumn extends BaseCo
|
|
|
62
65
|
</View>
|
|
63
66
|
}
|
|
64
67
|
<View dataSet={{class: "table--column-value"}}>
|
|
65
|
-
{new ColumnContent({column, model, table}).content()}
|
|
68
|
+
{new ColumnContent({column, l, model, t, table}).content()}
|
|
66
69
|
</View>
|
|
67
70
|
</Column>
|
|
68
71
|
)
|
package/src/table/model-row.jsx
CHANGED
|
@@ -10,9 +10,11 @@ import Link from "../link"
|
|
|
10
10
|
import ModelColumn from "./model-column"
|
|
11
11
|
import PropTypes from "prop-types"
|
|
12
12
|
import propTypesExact from "prop-types-exact"
|
|
13
|
+
import React from "react"
|
|
13
14
|
import Row from "./components/row"
|
|
14
15
|
import memo from "set-state-compare/src/memo"
|
|
15
16
|
import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
17
|
+
import useI18n from "i18n-on-steroids/src/use-i18n"
|
|
16
18
|
|
|
17
19
|
const WorkerPluginsCheckbox = React.lazy(() => import("./worker-plugins-checkbox"))
|
|
18
20
|
|
|
@@ -28,6 +30,12 @@ export default memo(shapeComponent(class ApiMakerBootStrapLiveTableModelRow exte
|
|
|
28
30
|
tableSettingFullCacheKey: PropTypes.string.isRequired
|
|
29
31
|
})
|
|
30
32
|
|
|
33
|
+
setup() {
|
|
34
|
+
const {t} = useI18n({namespace: "js.api_maker.table.model_row"})
|
|
35
|
+
|
|
36
|
+
this.t = t
|
|
37
|
+
}
|
|
38
|
+
|
|
31
39
|
render() {
|
|
32
40
|
const {index, table, model} = this.p
|
|
33
41
|
const {modelClass, workplace} = table.p
|
|
@@ -106,10 +114,11 @@ export default memo(shapeComponent(class ApiMakerBootStrapLiveTableModelRow exte
|
|
|
106
114
|
}
|
|
107
115
|
|
|
108
116
|
onDestroyClicked = async () => {
|
|
117
|
+
const {t} = this.tt
|
|
109
118
|
const {destroyMessage} = this.p.table.props
|
|
110
119
|
const {model} = this.p
|
|
111
120
|
|
|
112
|
-
if (!confirm(
|
|
121
|
+
if (!confirm(t("js.shared.are_you_sure"))) {
|
|
113
122
|
return
|
|
114
123
|
}
|
|
115
124
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import React, {useEffect, useRef} from "react"
|
|
1
2
|
import BaseComponent from "../../base-component"
|
|
2
3
|
import columnIdentifier from "../column-identifier"
|
|
3
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
|
-
import {useEffect, useRef} from "react"
|
|
7
7
|
import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
8
8
|
import Text from "../../utils/text"
|
|
9
9
|
import {View} from "react-native"
|
|
@@ -7,6 +7,7 @@ import FontAwesomeIcon from "react-native-vector-icons/FontAwesome"
|
|
|
7
7
|
import memo from "set-state-compare/src/memo"
|
|
8
8
|
import PropTypes from "prop-types"
|
|
9
9
|
import propTypesExact from "prop-types-exact"
|
|
10
|
+
import React from "react"
|
|
10
11
|
import {renderToString} from "react-dom/server"
|
|
11
12
|
import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
12
13
|
import {Pressable} from "react-native"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import React, {useRef} from "react"
|
|
1
2
|
import BaseComponent from "../../base-component"
|
|
2
3
|
import columnIdentifier from "../column-identifier"
|
|
3
4
|
import ColumnRow from "./column-row"
|
|
4
5
|
import DownloadAction from "./download-action"
|
|
5
|
-
import {useRef} from "react"
|
|
6
6
|
import memo from "set-state-compare/src/memo"
|
|
7
7
|
import Modal from "../../modal"
|
|
8
8
|
import PropTypes from "prop-types"
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React, {useMemo} from "react"
|
|
1
2
|
import BaseComponent from "../base-component"
|
|
2
3
|
import classNames from "classnames"
|
|
3
4
|
import {digg} from "diggerize"
|
|
@@ -5,7 +6,6 @@ import memo from "set-state-compare/src/memo"
|
|
|
5
6
|
import modelClassRequire from "../model-class-require"
|
|
6
7
|
import PropTypes from "prop-types"
|
|
7
8
|
import PropTypesExact from "prop-types-exact"
|
|
8
|
-
import {useMemo} from "react"
|
|
9
9
|
import {shapeComponent} from "set-state-compare/src/shape-component"
|
|
10
10
|
import useModelEvent from "../use-model-event"
|
|
11
11
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {digg} from "diggerize"
|
|
2
|
+
import I18nOnSteroids from "i18n-on-steroids"
|
|
2
3
|
import translatedCollectionsData from "../src/translated-collections-data.js.erb"
|
|
3
4
|
|
|
4
5
|
export default class ApiMakerTranslatedCollections {
|
|
5
6
|
static get (modelClass, collectionName) {
|
|
6
|
-
const locale =
|
|
7
|
+
const locale = I18nOnSteroids.getCurrent().locale
|
|
7
8
|
const modelClassName = digg(modelClass.modelClassData(), "name")
|
|
8
9
|
const collection = digg(translatedCollectionsData, modelClassName, collectionName, locale, "collection_array")
|
|
9
10
|
|
package/src/use-input.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {dig, digg} from "diggerize"
|
|
2
|
-
import {useCallback, useEffect, useMemo} from "react"
|
|
2
|
+
import {useCallback, useEffect, useMemo, useRef} from "react"
|
|
3
3
|
import idForComponent from "./inputs/id-for-component"
|
|
4
4
|
import nameForComponent from "./inputs/name-for-component"
|
|
5
5
|
import strftime from "strftime"
|
|
@@ -14,6 +14,7 @@ const useInput = ({props, wrapperOptions, ...useInputRestProps}) => {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
const s = useShape(props)
|
|
17
|
+
const backupRef = useRef()
|
|
17
18
|
|
|
18
19
|
s.useStates({
|
|
19
20
|
form: undefined
|
|
@@ -67,13 +68,7 @@ const useInput = ({props, wrapperOptions, ...useInputRestProps}) => {
|
|
|
67
68
|
}
|
|
68
69
|
}, [])
|
|
69
70
|
|
|
70
|
-
const
|
|
71
|
-
if (!s.meta._inputRefBackup) s.meta._inputRefBackup = React.createRef()
|
|
72
|
-
|
|
73
|
-
return s.meta._inputRefBackup
|
|
74
|
-
}, [])
|
|
75
|
-
|
|
76
|
-
const inputRef = useCallback(() => s.props.inputRef || inputRefBackup())
|
|
71
|
+
const inputRef = useCallback(() => s.props.inputRef || backupRef)
|
|
77
72
|
|
|
78
73
|
const inputType = useCallback(() => {
|
|
79
74
|
if ("type" in s.props) {
|
package/src/utils/text.jsx
CHANGED
package/src/with-collection.jsx
CHANGED
package/src/with-model.jsx
CHANGED
package/src/with-router.jsx
CHANGED