@kaspernj/api-maker 1.0.438 → 1.0.439

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.438",
3
+ "version": "1.0.439",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "index.js",
@@ -1,15 +1,12 @@
1
1
  import BaseComponent from "../base-component"
2
2
  import classNames from "classnames"
3
- import {digs} from "diggerize"
4
3
  import Header from "./components/header"
5
4
  import HeaderColumnContent from "./header-column-content"
6
5
  import memo from "set-state-compare/src/memo"
7
- import {Platform, Pressable, View} from "react-native"
6
+ import {Platform, Pressable} from "react-native"
8
7
  import PropTypes from "prop-types"
9
8
  import propTypesExact from "prop-types-exact"
10
9
  import {shapeComponent} from "set-state-compare/src/shape-component"
11
- import SortLink from "../bootstrap/sort-link"
12
- import Text from "../utils/text"
13
10
  import useBreakpoint from "../use-breakpoint"
14
11
  import useEventListener from "../use-event-listener.mjs"
15
12
  import Widths from "./widths"
@@ -40,13 +37,11 @@ export default memo(shapeComponent(class ApiMakerTableHeaderColumn extends BaseC
40
37
  }
41
38
 
42
39
  render() {
43
- const {breakpoint, mdUp, smDown} = this.tt
40
+ const {mdUp} = this.tt
44
41
  const {column, resizing, table, tableSettingColumn, width} = this.p
45
- const {defaultParams} = table.props
46
- const {styleForHeader, styleForHeaderText} = table.tt
47
- const {query} = digs(table.collection, "query")
48
- const columnProps = table.columnProps(column)
49
- const {style, ...restColumnProps} = columnProps
42
+ const {styleForHeader} = table.tt
43
+ const headerProps = table.headerProps(column)
44
+ const {style, ...restColumnProps} = headerProps
50
45
  const actualStyle = Object.assign(
51
46
  {
52
47
  cursor: resizing ? "col-resize" : undefined,
@@ -633,16 +633,21 @@ export default memo(shapeComponent(class ApiMakerTable extends BaseComponent {
633
633
  }
634
634
 
635
635
  styleForHeader = ({column, columnIndex, style, type}) => {
636
+ const {mdUp} = this.tt
636
637
  const defaultStyle = {
637
638
  flexDirection: "row",
638
639
  alignItems: "center",
639
640
  padding: 8
640
641
  }
641
642
 
642
- if (type != "actions" && this.tt.mdUp && this.p.styleUI) {
643
+ if (type != "actions" && mdUp && this.p.styleUI) {
643
644
  defaultStyle.borderRight = "1px solid #dbdbdb"
644
645
  }
645
646
 
647
+ if (mdUp) {
648
+
649
+ }
650
+
646
651
  const actualStyle = Object.assign(
647
652
  defaultStyle,
648
653
  style
@@ -763,6 +768,22 @@ export default memo(shapeComponent(class ApiMakerTable extends BaseComponent {
763
768
  return props
764
769
  }
765
770
 
771
+ headerProps(column) {
772
+ const props = {}
773
+
774
+ if (column.textCenter) {
775
+ props.style ||= {}
776
+ props.style.justifyContent = "center"
777
+ }
778
+
779
+ if (column.textRight) {
780
+ props.style ||= {}
781
+ props.style.justifyContent = "end"
782
+ }
783
+
784
+ return props
785
+ }
786
+
766
787
  columnWidths() {
767
788
  const columnWidths = {}
768
789
 
@@ -786,7 +807,7 @@ export default memo(shapeComponent(class ApiMakerTable extends BaseComponent {
786
807
  )
787
808
 
788
809
  headerClassNameForColumn(column) {
789
- const classNames = ["live-table-header"]
810
+ const classNames = []
790
811
 
791
812
  if (column.commonProps && column.commonProps.className) classNames.push(column.commonProps.className)
792
813
  if (column.headerProps && column.headerProps.className) classNames.push(column.headerProps.className)