@equinor/apollo-components 3.6.1 → 3.7.0

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/dist/index.d.ts CHANGED
@@ -29,8 +29,9 @@ declare const ChipsCell: (props: {
29
29
 
30
30
  interface ColumnSelectProps<T> {
31
31
  table: Table<T>;
32
+ columnSelectPlaceholder?: string;
32
33
  }
33
- declare function ColumnSelect<T>({ table }: ColumnSelectProps<T>): JSX.Element;
34
+ declare function ColumnSelect<T>({ table, columnSelectPlaceholder }: ColumnSelectProps<T>): JSX.Element;
34
35
 
35
36
  interface TableHeaderProps<T> {
36
37
  table: Table<T>;
@@ -144,6 +145,7 @@ interface DataTableProps<T> {
144
145
  enableColumnSelect?: boolean;
145
146
  enableGlobalFilterInput?: boolean;
146
147
  globalFilterPlaceholder?: string;
148
+ columnSelectPlaceholder?: string;
147
149
  filterFromLeafRows?: boolean;
148
150
  /**
149
151
  * @deprecated Use `customActionsLeft` instead
package/dist/index.js CHANGED
@@ -3010,24 +3010,34 @@ var ActionsWrapper = import_styled_components10.default.div`
3010
3010
  justify-content: flex-end;
3011
3011
  gap: 0.5rem;
3012
3012
  `;
3013
- function ColumnSelect({ table }) {
3013
+ function ColumnSelect({ table, columnSelectPlaceholder }) {
3014
3014
  const [isOpen, setIsOpen] = (0, import_react3.useState)(false);
3015
3015
  const referenceElement = (0, import_react3.useRef)(null);
3016
3016
  const selectableColumns = table.getAllLeafColumns().filter((column) => column.id !== "select");
3017
3017
  return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
3018
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_eds_core_react10.Tooltip, { title: "Select columns", placement: "left", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3019
- import_eds_core_react10.Button,
3018
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3019
+ import_eds_core_react10.Tooltip,
3020
3020
  {
3021
- "aria-haspopup": true,
3022
- id: "column-select-anchor",
3023
- "aria-controls": "column-select-popover",
3024
- "aria-expanded": isOpen,
3025
- ref: referenceElement,
3026
- variant: "ghost_icon",
3027
- onClick: () => setIsOpen(true),
3028
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_eds_core_react10.Icon, { name: "view_column", data: import_eds_icons5.view_column })
3021
+ title: columnSelectPlaceholder ? "" : "Select columns",
3022
+ placement: "left",
3023
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
3024
+ import_eds_core_react10.Button,
3025
+ {
3026
+ "aria-haspopup": true,
3027
+ id: "column-select-anchor",
3028
+ "aria-controls": "column-select-popover",
3029
+ "aria-expanded": isOpen,
3030
+ ref: referenceElement,
3031
+ variant: columnSelectPlaceholder ? "ghost" : "ghost_icon",
3032
+ onClick: () => setIsOpen(true),
3033
+ children: [
3034
+ columnSelectPlaceholder,
3035
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_eds_core_react10.Icon, { name: "view_column", data: import_eds_icons5.view_column })
3036
+ ]
3037
+ }
3038
+ )
3029
3039
  }
3030
- ) }),
3040
+ ),
3031
3041
  /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
3032
3042
  import_eds_core_react10.Popover,
3033
3043
  {
@@ -3280,7 +3290,7 @@ function TableBanner({
3280
3290
  onChange: (value) => globalFilter.onChange(String(value))
3281
3291
  }
3282
3292
  ),
3283
- (bannerConfig == null ? void 0 : bannerConfig.enableColumnSelect) && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ColumnSelect, { table }),
3293
+ (bannerConfig == null ? void 0 : bannerConfig.enableColumnSelect) && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ColumnSelect, { table, columnSelectPlaceholder: bannerConfig.columnSelectPlaceholder }),
3284
3294
  (bannerConfig == null ? void 0 : bannerConfig.totalRowCount) && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { children: [
3285
3295
  table.options.data.length.toLocaleString(),
3286
3296
  " /",
package/dist/index.mjs CHANGED
@@ -2957,24 +2957,34 @@ var ActionsWrapper = styled10.div`
2957
2957
  justify-content: flex-end;
2958
2958
  gap: 0.5rem;
2959
2959
  `;
2960
- function ColumnSelect({ table }) {
2960
+ function ColumnSelect({ table, columnSelectPlaceholder }) {
2961
2961
  const [isOpen, setIsOpen] = useState3(false);
2962
2962
  const referenceElement = useRef2(null);
2963
2963
  const selectableColumns = table.getAllLeafColumns().filter((column) => column.id !== "select");
2964
2964
  return /* @__PURE__ */ jsxs7(Fragment2, { children: [
2965
- /* @__PURE__ */ jsx11(Tooltip, { title: "Select columns", placement: "left", children: /* @__PURE__ */ jsx11(
2966
- Button3,
2965
+ /* @__PURE__ */ jsx11(
2966
+ Tooltip,
2967
2967
  {
2968
- "aria-haspopup": true,
2969
- id: "column-select-anchor",
2970
- "aria-controls": "column-select-popover",
2971
- "aria-expanded": isOpen,
2972
- ref: referenceElement,
2973
- variant: "ghost_icon",
2974
- onClick: () => setIsOpen(true),
2975
- children: /* @__PURE__ */ jsx11(Icon5, { name: "view_column", data: view_column })
2968
+ title: columnSelectPlaceholder ? "" : "Select columns",
2969
+ placement: "left",
2970
+ children: /* @__PURE__ */ jsxs7(
2971
+ Button3,
2972
+ {
2973
+ "aria-haspopup": true,
2974
+ id: "column-select-anchor",
2975
+ "aria-controls": "column-select-popover",
2976
+ "aria-expanded": isOpen,
2977
+ ref: referenceElement,
2978
+ variant: columnSelectPlaceholder ? "ghost" : "ghost_icon",
2979
+ onClick: () => setIsOpen(true),
2980
+ children: [
2981
+ columnSelectPlaceholder,
2982
+ /* @__PURE__ */ jsx11(Icon5, { name: "view_column", data: view_column })
2983
+ ]
2984
+ }
2985
+ )
2976
2986
  }
2977
- ) }),
2987
+ ),
2978
2988
  /* @__PURE__ */ jsxs7(
2979
2989
  Popover2,
2980
2990
  {
@@ -3233,7 +3243,7 @@ function TableBanner({
3233
3243
  onChange: (value) => globalFilter.onChange(String(value))
3234
3244
  }
3235
3245
  ),
3236
- (bannerConfig == null ? void 0 : bannerConfig.enableColumnSelect) && /* @__PURE__ */ jsx17(ColumnSelect, { table }),
3246
+ (bannerConfig == null ? void 0 : bannerConfig.enableColumnSelect) && /* @__PURE__ */ jsx17(ColumnSelect, { table, columnSelectPlaceholder: bannerConfig.columnSelectPlaceholder }),
3237
3247
  (bannerConfig == null ? void 0 : bannerConfig.totalRowCount) && /* @__PURE__ */ jsxs9("span", { children: [
3238
3248
  table.options.data.length.toLocaleString(),
3239
3249
  " /",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/apollo-components",
3
- "version": "3.6.1",
3
+ "version": "3.7.0",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",