@kaspernj/api-maker 1.0.241 → 1.0.243

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 CHANGED
@@ -16,7 +16,7 @@
16
16
  ]
17
17
  },
18
18
  "name": "@kaspernj/api-maker",
19
- "version": "1.0.241",
19
+ "version": "1.0.243",
20
20
  "type": "module",
21
21
  "description": "",
22
22
  "main": "index.js",
@@ -21,7 +21,7 @@ export default class ApiMakerInputsAttachment extends BaseComponent {
21
21
  }
22
22
  {this.getUrl() &&
23
23
  <div className="input-checkbox" style={{paddingTop: "15px", paddingBottom: "15px"}}>
24
- <Checkbox inputProps={{id: this.getPurgeInputId(), name: this.getPurgeInputName(), value: 1}} {...restProps} />
24
+ <Checkbox inputProps={{id: this.getPurgeInputId(), name: this.getPurgeInputName(), value: 1}} />
25
25
  <label className="checkbox-label" htmlFor={this.getPurgeInputId()}>
26
26
  {I18n.t("js.shared.delete")}
27
27
  </label>
@@ -0,0 +1,11 @@
1
+ export default function apiMakerTranslatedAttributes(attributeNames, availableLocales) {
2
+ translatedAttributes = []
3
+
4
+ for (const attribute of attributeNames) {
5
+ for (const locale of availableLocales) {
6
+ translatedAttributes.push(`${attribute}${locale.substring(0, 1).toUpperCase()}${locale.substring(1, 99)}`)
7
+ }
8
+ }
9
+
10
+ return translatedAttributes
11
+ }
@@ -0,0 +1,16 @@
1
+ import CanCanLoader from "./can-can-loader"
2
+
3
+ export default (WrappedComponent, abilities) => class WithCanCan extends React.PureComponent {
4
+ state = {
5
+ canCan: undefined
6
+ }
7
+
8
+ render() {
9
+ return (
10
+ <>
11
+ <CanCanLoader abilities={abilities} component={this} />
12
+ <WrappedComponent canCan={this.state.canCan} {...this.props} />
13
+ </>
14
+ )
15
+ }
16
+ }