@bloom-housing/ui-components 5.1.1-alpha.19 → 5.1.1-alpha.21

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.
@@ -1,10 +1,10 @@
1
1
  import React, { useState, useEffect } from "react"
2
2
  import { DragDropContext, Droppable, Draggable, DropResult } from "react-beautiful-dnd"
3
3
  import { nanoid } from "nanoid"
4
+ import { faGripLines } from "@fortawesome/free-solid-svg-icons"
4
5
  import { getTranslationWithArguments } from "../helpers/getTranslationWithArguments"
5
6
  import { Icon, IconFillColors } from "../icons/Icon"
6
7
  import { t } from "../helpers/translator"
7
- import { faGripLines } from "@fortawesome/free-solid-svg-icons"
8
8
 
9
9
  export interface TableHeadersOptions {
10
10
  name: string
@@ -74,6 +74,10 @@ export interface StandardTableProps {
74
74
  translateData?: boolean
75
75
  /** An id applied to the table */
76
76
  id?: string
77
+ strings?: {
78
+ orderString?: string
79
+ sortString?: string
80
+ }
77
81
  }
78
82
 
79
83
  const headerName = (header: string | TableHeadersOptions) => {
@@ -110,12 +114,16 @@ export const StandardTable = (props: StandardTableProps) => {
110
114
  }, [props.data])
111
115
 
112
116
  if (props.draggable) {
113
- headerLabels.splice(0, 0, <th key={"header-draggable"}>{t("t.order")}</th>)
117
+ headerLabels.splice(
118
+ 0,
119
+ 0,
120
+ <th key={"header-draggable"}>{props.strings?.orderString ?? t("t.order")}</th>
121
+ )
114
122
  headerLabels.splice(
115
123
  0,
116
124
  0,
117
125
  <th key={"header-draggable"} className={"table__draggable-cell pl-5"}>
118
- {t("t.sort")}
126
+ {props.strings?.sortString ?? t("t.sort")}
119
127
  </th>
120
128
  )
121
129
  }
@@ -156,7 +164,7 @@ export const StandardTable = (props: StandardTableProps) => {
156
164
  0,
157
165
  <Cell
158
166
  key={`${dataIndex}-order-draggable`}
159
- headerLabel={t("t.sort")}
167
+ headerLabel={props.strings?.sortString ?? t("t.sort")}
160
168
  className={`pl-5 ${cellClassName ?? undefined}`}
161
169
  >
162
170
  {dataIndex + 1}
@@ -167,7 +175,7 @@ export const StandardTable = (props: StandardTableProps) => {
167
175
  0,
168
176
  <Cell
169
177
  key={`${dataIndex}-sort-draggable`}
170
- headerLabel={t("t.sort")}
178
+ headerLabel={props.strings?.sortString ?? t("t.sort")}
171
179
  className={`table__draggable-cell pl-7`}
172
180
  >
173
181
  <Icon symbol={faGripLines} size={"medium"} fill={IconFillColors.primary} />