@kaspernj/api-maker 1.0.434 → 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.
Files changed (74) hide show
  1. package/package.json +2 -2
  2. package/src/base-component.jsx +1 -4
  3. package/src/bootstrap/attribute-row/index.jsx +2 -1
  4. package/src/bootstrap/attribute-rows.jsx +1 -1
  5. package/src/bootstrap/card.jsx +2 -1
  6. package/src/bootstrap/input.jsx +1 -1
  7. package/src/bootstrap/paginate.jsx +2 -1
  8. package/src/bootstrap/sort-link.jsx +29 -44
  9. package/src/collection-loader.jsx +2 -1
  10. package/src/event-created.jsx +1 -1
  11. package/src/event-destroyed.jsx +1 -1
  12. package/src/event-emitter-listener.jsx +1 -1
  13. package/src/event-listener.jsx +1 -1
  14. package/src/event-updated.jsx +4 -3
  15. package/src/form.jsx +2 -1
  16. package/src/inputs/attachment.jsx +1 -1
  17. package/src/inputs/checkbox.jsx +1 -1
  18. package/src/inputs/checkboxes.jsx +1 -1
  19. package/src/inputs/input.jsx +2 -1
  20. package/src/inputs/money.jsx +2 -1
  21. package/src/inputs/select.jsx +1 -1
  22. package/src/link.jsx +12 -7
  23. package/src/modal.jsx +1 -1
  24. package/src/resize-observer.jsx +1 -1
  25. package/src/super-admin/edit-page/edit-attribute-checkbox.jsx +2 -1
  26. package/src/super-admin/edit-page/edit-attribute-content.jsx +1 -1
  27. package/src/super-admin/edit-page/edit-attribute-input.jsx +2 -1
  28. package/src/super-admin/edit-page/edit-attribute.jsx +1 -1
  29. package/src/super-admin/edit-page.jsx +1 -1
  30. package/src/super-admin/index-page.jsx +1 -1
  31. package/src/super-admin/index.jsx +2 -1
  32. package/src/super-admin/layout/header/index.jsx +2 -1
  33. package/src/super-admin/layout/index.jsx +2 -2
  34. package/src/super-admin/layout/menu/index.jsx +1 -1
  35. package/src/super-admin/layout/menu/menu-content.jsx +2 -1
  36. package/src/super-admin/layout/menu/menu-item/index.jsx +1 -1
  37. package/src/super-admin/layout/no-access.jsx +1 -1
  38. package/src/super-admin/model-class-table.jsx +2 -1
  39. package/src/super-admin/show-nav.jsx +1 -1
  40. package/src/super-admin/show-page/belongs-to-attribute-row.jsx +1 -1
  41. package/src/super-admin/show-page/index.jsx +2 -1
  42. package/src/super-admin/show-reflection-actions.jsx +2 -1
  43. package/src/super-admin/show-reflection-link.jsx +1 -1
  44. package/src/super-admin/show-reflection-page.jsx +1 -1
  45. package/src/table/components/column.jsx +1 -1
  46. package/src/table/components/flat-list.jsx +1 -1
  47. package/src/table/components/header.jsx +10 -2
  48. package/src/table/components/row.jsx +1 -1
  49. package/src/table/filters/attribute-element.jsx +1 -1
  50. package/src/table/filters/filter-form.jsx +2 -1
  51. package/src/table/filters/filter.jsx +1 -1
  52. package/src/table/filters/index.jsx +1 -1
  53. package/src/table/filters/load-search-modal.jsx +2 -1
  54. package/src/table/filters/reflection-element.jsx +1 -1
  55. package/src/table/filters/save-search-modal.jsx +1 -1
  56. package/src/table/filters/scope-element.jsx +1 -1
  57. package/src/table/header-column-content.jsx +54 -0
  58. package/src/table/header-column.jsx +3 -18
  59. package/src/table/header-select.jsx +72 -0
  60. package/src/table/model-column.jsx +3 -4
  61. package/src/table/model-row.jsx +2 -4
  62. package/src/table/settings/column-row.jsx +2 -1
  63. package/src/table/settings/download-action.jsx +1 -1
  64. package/src/table/settings/index.jsx +2 -1
  65. package/src/table/table.jsx +65 -41
  66. package/src/table/use-sorting.mjs +30 -0
  67. package/src/table/worker-plugins-check-all-checkbox.jsx +2 -1
  68. package/src/table/worker-plugins-checkbox.jsx +2 -1
  69. package/src/utils/card.jsx +49 -0
  70. package/src/utils/checkbox.jsx +1 -1
  71. package/src/utils/modal.jsx +59 -0
  72. package/src/with-can-can.jsx +1 -1
  73. package/src/with-collection.jsx +1 -1
  74. package/src/with-model.jsx +1 -1
@@ -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
+ }))
@@ -1,6 +1,6 @@
1
1
  import BaseComponent from "../base-component"
2
2
  import {CheckBox, Pressable, View} from "react-native"
3
- import {memo} from "react"
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
+ }))
@@ -1,5 +1,5 @@
1
1
  import useCanCan from "./use-can-can.mjs"
2
- import {memo} from "react"
2
+ import memo from "set-state-compare/src/memo"
3
3
 
4
4
  export default (WrappedComponent, abilities) => {
5
5
  const WithCanCan = (props) => {
@@ -1,5 +1,5 @@
1
1
  import {digg} from "diggerize"
2
- import {memo} from "react"
2
+ import memo from "set-state-compare/src/memo"
3
3
  import useCollection from "./use-collection"
4
4
 
5
5
  export default (WrappedComponent, withCollectionArgs) => memo(() => {
@@ -1,4 +1,4 @@
1
- import {memo} from "react"
1
+ import memo from "set-state-compare/src/memo"
2
2
  import useModel from "./use-model.mjs"
3
3
 
4
4
  export default (WrappedComponent, modelClass, givenArgs) => {