@kaspernj/api-maker 1.0.440 → 1.0.441

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaspernj/api-maker",
3
- "version": "1.0.440",
3
+ "version": "1.0.441",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "index.js",
@@ -184,7 +184,7 @@ export default memo(shapeComponent(class ApiMakerTableFiltersFilterForm extends
184
184
  </View>
185
185
  <View style={{flexDirection: "row"}}>
186
186
  <View>
187
- {this.s.associations?.map((reflection) =>
187
+ {this.s.associations && this.sortedReflectionsByName(this.s.associations).map((reflection) =>
188
188
  <ReflectionElement
189
189
  key={reflection.reflectionName}
190
190
  modelClassName={this.s.modelClassName}
@@ -194,7 +194,7 @@ export default memo(shapeComponent(class ApiMakerTableFiltersFilterForm extends
194
194
  )}
195
195
  </View>
196
196
  <View>
197
- {this.s.ransackableAttributes?.map((attribute) =>
197
+ {this.s.ransackableAttributes && this.sortedAttributesByName(this.s.ransackableAttributes)?.map((attribute) =>
198
198
  <AttributeElement
199
199
  active={attribute.attributeName == this.s.attribute?.attributeName}
200
200
  attribute={attribute}
@@ -377,9 +377,23 @@ export default memo(shapeComponent(class ApiMakerTableFiltersFilterForm extends
377
377
  })
378
378
  }
379
379
 
380
- sortedByName(reflections, currentModelClass) {
380
+ sortedAttributesByName(attributes) {
381
+ return attributes.sort((a, b) =>
382
+ digg(a, "humanName")
383
+ .toLowerCase()
384
+ .localeCompare(
385
+ digg(b, "humanName").toLowerCase()
386
+ )
387
+ )
388
+ }
389
+
390
+ sortedReflectionsByName(reflections) {
381
391
  return reflections.sort((a, b) =>
382
- currentModelClass.humanAttributeName(a.name()).toLowerCase().localeCompare(currentModelClass.humanAttributeName(b.name()).toLowerCase())
392
+ digg(a, "humanName")
393
+ .toLowerCase()
394
+ .localeCompare(
395
+ digg(b, "humanName").toLowerCase()
396
+ )
383
397
  )
384
398
  }
385
399
  }))
@@ -44,7 +44,7 @@ export default memo(shapeComponent(class ApiMakerTableHeaderColumn extends BaseC
44
44
  />
45
45
  }
46
46
  {(!tableSettingColumn.hasSortKey() || !query) &&
47
- <Text ellipsizeMode="clip" numberOfLines={1}>
47
+ <Text ellipsizeMode="clip" numberOfLines={1} style={{fontWeight: "bold"}}>
48
48
  {table.headerLabelForColumn(column)}
49
49
  </Text>
50
50
  }