@sps-woodland/column-manager 7.11.3 → 7.12.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.
@@ -8,6 +8,7 @@ export type ColumnmanagerProps = ComponentProps<{
8
8
  visibleColumns: ItemProps[];
9
9
  hiddenColumns: ItemProps[];
10
10
  manualSort?: boolean;
11
+ maxDisplayedItems?: number;
11
12
  showIcons?: boolean;
12
13
  showCount?: boolean;
13
14
  showFilter?: boolean;
@@ -16,4 +17,4 @@ export type ColumnmanagerProps = ComponentProps<{
16
17
  onClose?: () => void;
17
18
  onOpen?: () => void;
18
19
  }>;
19
- export declare function ColumnManager({ isOpen: isOpenProp, title, visibleColumnsHeader, hiddenColumnsHeader, visibleColumns, hiddenColumns, manualSort, showIcons, showCount, showFilter, showMoveAllLinks, onSave, onOpen, onClose, "data-testid": dataTestId, }: ColumnmanagerProps): JSX.Element | null;
20
+ export declare function ColumnManager({ isOpen: isOpenProp, title, visibleColumnsHeader, hiddenColumnsHeader, visibleColumns, hiddenColumns, maxDisplayedItems, manualSort, showIcons, showCount, showFilter, showMoveAllLinks, onSave, onOpen, onClose, "data-testid": dataTestId, }: ColumnmanagerProps): JSX.Element | null;
package/lib/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const H=require("react"),P=require("@sps-woodland/core"),B=require("@sps-woodland/add-to-list"),R=require("@sps-woodland/tokens"),b=require("@spscommerce/ds-react"),g=require("@spscommerce/ds-shared"),f=require("@spscommerce/utils");function A(n){if(n&&n.__esModule)return n;const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const o in n)if(o!=="default"){const s=Object.getOwnPropertyDescriptor(n,o);Object.defineProperty(r,o,s.get?s:{enumerable:!0,get:()=>n[o]})}}return r.default=n,Object.freeze(r)}const e=A(H);function T({isOpen:n,title:r,visibleColumnsHeader:o,hiddenColumnsHeader:s,visibleColumns:u,hiddenColumns:d,manualSort:a=!0,showIcons:i=!0,showCount:v=!0,showFilter:E=!0,showMoveAllLinks:M=!0,onSave:m,onOpen:c,onClose:l,"data-testid":t}){const[p,O]=e.useState(!!n),{t:h}=e.useContext(P.I18nContext),k=P.useChildTestIdAttrBuilder({"data-testid":t}),[C,S]=e.useState({visibleColumns:u,hiddenColumns:d}),w=()=>{O(!1),l==null||l()};return e.useEffect(()=>{p&&(S({visibleColumns:u,hiddenColumns:d}),c==null||c())},[p]),e.useEffect(()=>{O(!!n)},[n]),p?e.createElement(b.SpsModal,{title:r||h("design-system:columnManager.title"),kind:g.ModalKind.GENERAL,size:g.ModalSize.LARGE,"data-testid":t,onClose:w},e.createElement(B.AddToList,{onHeader:o||h("design-system:columnManager.onListHeader"),offHeader:s||h("design-system:columnManager.offListHeader"),onList:C.visibleColumns,offList:C.hiddenColumns,onChange:y=>{S({visibleColumns:y.onList,hiddenColumns:y.offList})},manualSort:a,showIcons:i,showCount:v,showFilter:E,showMoveAllLinks:M,...k("add-to-list")}),e.createElement(b.SpsModalFooter,null,e.createElement(b.SpsButton,{kind:g.ButtonKind.DEFAULT,onClick:()=>{S({visibleColumns:u,hiddenColumns:d}),w()},className:R.sprinkles({mr:"sm"}),...k("cancel-button")},h("design-system:columnManager.cancelButton")),e.createElement(b.SpsButton,{kind:g.ButtonKind.KEY,onClick:()=>{m==null||m(C.visibleColumns,C.hiddenColumns),w()},...k("save-button")},h("design-system:columnManager.saveButton")))):null}P.Metadata.set(T,{name:"Column Manager",props:{isOpen:{type:"boolean",required:!0},title:{type:"string"},visibleColumnsHeader:{type:"string"},hiddenColumnsHeader:{type:"string"},visibleColumns:{type:"ItemProps[]",required:!0},hiddenColumns:{type:"ItemProps[]",required:!0},manualSort:{type:"boolean"},showIcons:{type:"boolean"},showCount:{type:"boolean"},showFilter:{type:"boolean"},showMoveAllLinks:{type:"boolean"},onSave:{type:"(visibleColumns: ItemProps[], hiddenColumns: ItemProps[]) => void"},onClose:{type:"() => void"},onOpen:{type:"() => void"}}});const I=({isOpen:n,visibleColumns:r,hiddenColumns:o,onClose:s,onOpen:u,onSave:d})=>{const[a,i]=e.useState({isOpen:!!n,visibleColumns:r,hiddenColumns:o});e.useEffect(()=>{i(l=>({...l,isOpen:!!n}))},[n]);const v=()=>{i(l=>({...l,isOpen:!0})),u==null||u()},E=()=>{i(l=>({...l,isOpen:!1})),s==null||s()},M=(l,t)=>{i({isOpen:!1,visibleColumns:l,hiddenColumns:t}),d==null||d(l,t)},m=e.useCallback((l,t)=>{i(p=>({...p,visibleColumns:l,hiddenColumns:t}))},[]),c=e.useCallback(l=>{i(t=>({...t,isOpen:l}))},[]);return{visibleColumns:a.visibleColumns,hiddenColumns:a.hiddenColumns,isOpen:a.isOpen,columnManagerProps:{visibleColumns:a.visibleColumns,hiddenColumns:a.hiddenColumns,isOpen:a.isOpen,onClose:E,onSave:M},triggerProps:{onClick:v},setColumns:m,setOpen:c}},L={components:[T],examples:{basic:{label:"Basic Usage",examples:{basic:{react:f.code`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const B=require("react"),T=require("@sps-woodland/core"),R=require("@sps-woodland/add-to-list"),I=require("@sps-woodland/tokens"),C=require("@spscommerce/ds-react"),b=require("@spscommerce/ds-shared"),g=require("@spscommerce/utils");function A(n){if(n&&n.__esModule)return n;const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const o in n)if(o!=="default"){const s=Object.getOwnPropertyDescriptor(n,o);Object.defineProperty(r,o,s.get?s:{enumerable:!0,get:()=>n[o]})}}return r.default=n,Object.freeze(r)}const e=A(B);function y({isOpen:n,title:r,visibleColumnsHeader:o,hiddenColumnsHeader:s,visibleColumns:u,hiddenColumns:d,maxDisplayedItems:a,manualSort:i=!0,showIcons:f=!0,showCount:v=!0,showFilter:E=!0,showMoveAllLinks:M=!0,onSave:m,onOpen:l,onClose:t,"data-testid":p}){const[k,O]=e.useState(!!n),{t:c}=e.useContext(T.I18nContext),S=T.useChildTestIdAttrBuilder({"data-testid":p}),[h,w]=e.useState({visibleColumns:u,hiddenColumns:d}),P=()=>{O(!1),t==null||t()};return e.useEffect(()=>{k&&(w({visibleColumns:u,hiddenColumns:d}),l==null||l())},[k]),e.useEffect(()=>{O(!!n)},[n]),k?e.createElement(C.SpsModal,{title:r||c("design-system:columnManager.title"),kind:b.ModalKind.GENERAL,size:b.ModalSize.LARGE,"data-testid":p,onClose:P},e.createElement(R.AddToList,{onHeader:o||c("design-system:columnManager.onListHeader"),offHeader:s||c("design-system:columnManager.offListHeader"),onList:h.visibleColumns,offList:h.hiddenColumns,onChange:H=>{w({visibleColumns:H.onList,hiddenColumns:H.offList})},manualSort:i,maxDisplayedItems:a,showIcons:f,showCount:v,showFilter:E,showMoveAllLinks:M,...S("add-to-list")}),e.createElement(C.SpsModalFooter,null,e.createElement(C.SpsButton,{kind:b.ButtonKind.DEFAULT,onClick:()=>{w({visibleColumns:u,hiddenColumns:d}),P()},className:I.sprinkles({mr:"sm"}),...S("cancel-button")},c("design-system:columnManager.cancelButton")),e.createElement(C.SpsButton,{kind:b.ButtonKind.KEY,onClick:()=>{m==null||m(h.visibleColumns,h.hiddenColumns),P()},...S("save-button")},c("design-system:columnManager.saveButton")))):null}T.Metadata.set(y,{name:"Column Manager",props:{isOpen:{type:"boolean",required:!0},title:{type:"string"},visibleColumnsHeader:{type:"string"},hiddenColumnsHeader:{type:"string"},visibleColumns:{type:"ItemProps[]",required:!0},hiddenColumns:{type:"ItemProps[]",required:!0},manualSort:{type:"boolean"},maxDisplayedItems:{type:"number"},showIcons:{type:"boolean"},showCount:{type:"boolean"},showFilter:{type:"boolean"},showMoveAllLinks:{type:"boolean"},onSave:{type:"(visibleColumns: ItemProps[], hiddenColumns: ItemProps[]) => void"},onClose:{type:"() => void"},onOpen:{type:"() => void"}}});const L=({isOpen:n,visibleColumns:r,hiddenColumns:o,onClose:s,onOpen:u,onSave:d})=>{const[a,i]=e.useState({isOpen:!!n,visibleColumns:r,hiddenColumns:o});e.useEffect(()=>{i(l=>({...l,isOpen:!!n}))},[n]);const f=()=>{i(l=>({...l,isOpen:!0})),u==null||u()},v=()=>{i(l=>({...l,isOpen:!1})),s==null||s()},E=(l,t)=>{i({isOpen:!1,visibleColumns:l,hiddenColumns:t}),d==null||d(l,t)},M=e.useCallback((l,t)=>{i(p=>({...p,visibleColumns:l,hiddenColumns:t}))},[]),m=e.useCallback(l=>{i(t=>({...t,isOpen:l}))},[]);return{visibleColumns:a.visibleColumns,hiddenColumns:a.hiddenColumns,isOpen:a.isOpen,columnManagerProps:{visibleColumns:a.visibleColumns,hiddenColumns:a.hiddenColumns,isOpen:a.isOpen,onClose:v,onSave:E},triggerProps:{onClick:f},setColumns:M,setOpen:m}},q={components:[y],examples:{basic:{label:"Basic Usage",examples:{basic:{react:g.code`
2
2
  import { ColumnManager } from "@sps-woodland/column-manager";
3
3
  import { SpsButton } from "@spscommerce/ds-react";
4
4
 
@@ -50,7 +50,7 @@
50
50
  </div>
51
51
  )
52
52
  }
53
- `}}},hooks:{label:"useColumnManager hook",description:()=>e.createElement(e.Fragment,null,e.createElement("h5",null,"Arguments"),e.createElement("p",null,"The column manager comes with a ",e.createElement("code",null,"useColumnManager")," hook that implements the default behavior. Arguments for this hook include:"),e.createElement("dl",null,e.createElement("dt",null,e.createElement("code",null,"visibleColumns"),": ItemProps[] (required)"),e.createElement("dd",null,"The initial visible columns state"),e.createElement("dt",null,e.createElement("code",null,"hiddenColumns"),": ItemProps[] (required)"),e.createElement("dd",null,"The initial hidden columns state"),e.createElement("dt",null,e.createElement("code",null,"isOpen"),": boolean (optional)"),e.createElement("dd",null,"Whether the column manager is open by default"),e.createElement("dt",null,e.createElement("code",null,"onOpen"),": function (optional)"),e.createElement("dd",null,"Handler that is called when the column manager opens",e.createElement("code",null,"() => void")),e.createElement("dt",null,e.createElement("code",null,"onClose"),": function (optional)"),e.createElement("dd",null,"Handler that is called when the column manager closes",e.createElement("code",null,"() => void")),e.createElement("dt",null,e.createElement("code",null,"onSave"),": function (optional)"),e.createElement("dd",null,"Handler that is called when the column manager saves",e.createElement("code",null,"(visibleColumns: ItemProps[], hiddenColumns: ItemProps[]) => void"))),e.createElement("h5",null,"Return value"),e.createElement("p",null,"The ",e.createElement("code",null,"useColumnManager")," hook returns an object with"," ",e.createElement("code",null,"visibleColumns"),", ",e.createElement("code",null,"hiddenColumns"),", ",e.createElement("code",null,"columnManagerProps"),", ",e.createElement("code",null,"triggerProps")," ,",e.createElement("code",null,"setColumns")," and ",e.createElement("code",null,"setOpen")),e.createElement("p",null,e.createElement("code",null,"triggerProps"),": needs to be spread on the element that triggers the modal."),e.createElement("p",null,e.createElement("code",null,"columnManagerProps"),": needs to be spread on the ",e.createElement("code",null,"ColumnManager")," ","component"),e.createElement("p",null,e.createElement("code",null,"visibleColumns"),": the current state of the visible columns"),e.createElement("p",null,e.createElement("code",null,"hiddenColumns"),": the current state of the hidden columns"),e.createElement("p",null,e.createElement("code",null,"setColumns"),": function that allows programmatically setting the current state of the visible and hidden columns. This function is safe to use in effects."),e.createElement("p",null,e.createElement("code",null,"setOpen"),": function that allows programmatically setting the current isOpen state. This function is safe to use in effects."),e.createElement("p",null,"Please refer to the examples to see its implementation"))},hooksExamples:{label:"Hook Usage",examples:{basic:{description:"Minimal API Reference",react:f.code`
53
+ `}}},hooks:{label:"useColumnManager hook",description:()=>e.createElement(e.Fragment,null,e.createElement("h5",null,"Arguments"),e.createElement("p",null,"The column manager comes with a ",e.createElement("code",null,"useColumnManager")," hook that implements the default behavior. Arguments for this hook include:"),e.createElement("dl",null,e.createElement("dt",null,e.createElement("code",null,"visibleColumns"),": ItemProps[] (required)"),e.createElement("dd",null,"The initial visible columns state"),e.createElement("dt",null,e.createElement("code",null,"hiddenColumns"),": ItemProps[] (required)"),e.createElement("dd",null,"The initial hidden columns state"),e.createElement("dt",null,e.createElement("code",null,"isOpen"),": boolean (optional)"),e.createElement("dd",null,"Whether the column manager is open by default"),e.createElement("dt",null,e.createElement("code",null,"onOpen"),": function (optional)"),e.createElement("dd",null,"Handler that is called when the column manager opens",e.createElement("code",null,"() => void")),e.createElement("dt",null,e.createElement("code",null,"onClose"),": function (optional)"),e.createElement("dd",null,"Handler that is called when the column manager closes",e.createElement("code",null,"() => void")),e.createElement("dt",null,e.createElement("code",null,"onSave"),": function (optional)"),e.createElement("dd",null,"Handler that is called when the column manager saves",e.createElement("code",null,"(visibleColumns: ItemProps[], hiddenColumns: ItemProps[]) => void"))),e.createElement("h5",null,"Return value"),e.createElement("p",null,"The ",e.createElement("code",null,"useColumnManager")," hook returns an object with"," ",e.createElement("code",null,"visibleColumns"),", ",e.createElement("code",null,"hiddenColumns"),", ",e.createElement("code",null,"columnManagerProps"),", ",e.createElement("code",null,"triggerProps")," ,",e.createElement("code",null,"setColumns")," and ",e.createElement("code",null,"setOpen")),e.createElement("p",null,e.createElement("code",null,"triggerProps"),": needs to be spread on the element that triggers the modal."),e.createElement("p",null,e.createElement("code",null,"columnManagerProps"),": needs to be spread on the ",e.createElement("code",null,"ColumnManager")," ","component"),e.createElement("p",null,e.createElement("code",null,"visibleColumns"),": the current state of the visible columns"),e.createElement("p",null,e.createElement("code",null,"hiddenColumns"),": the current state of the hidden columns"),e.createElement("p",null,e.createElement("code",null,"setColumns"),": function that allows programmatically setting the current state of the visible and hidden columns. This function is safe to use in effects."),e.createElement("p",null,e.createElement("code",null,"setOpen"),": function that allows programmatically setting the current isOpen state. This function is safe to use in effects."),e.createElement("p",null,"Please refer to the examples to see its implementation"))},hooksExamples:{label:"Hook Usage",examples:{basic:{description:"Minimal API Reference",react:g.code`
54
54
  import { ColumnManager, useColumnManager } from "@sps-woodland/column-manager";
55
55
  import { SpsButton } from "@spscommerce/ds-react";
56
56
 
@@ -85,7 +85,7 @@
85
85
  </div>
86
86
  )
87
87
  }
88
- `},complete:{description:"Complete API Reference",react:f.code`
88
+ `},complete:{description:"Complete API Reference",react:g.code`
89
89
  import { ColumnManager, useColumnManager } from "@sps-woodland/column-manager";
90
90
  import { SpsButton } from "@spscommerce/ds-react";
91
91
 
@@ -136,7 +136,7 @@
136
136
  </div>
137
137
  )
138
138
  }
139
- `}}},minimalInterface:{label:"Minimal Interface",examples:{basic:{description:"This is the minimal visual interface for the ColumnManager component",react:f.code`
139
+ `}}},minimalInterface:{label:"Minimal Interface",examples:{basic:{description:"This is the minimal visual interface for the ColumnManager component",react:g.code`
140
140
  import { ColumnManager, useColumnManager } from "@sps-woodland/column-manager";
141
141
  import { SpsButton } from "@spscommerce/ds-react";
142
142
 
@@ -176,4 +176,4 @@
176
176
  </div>
177
177
  )
178
178
  }
179
- `}}}}},q={"Column Manager":L};exports.ColumnManager=T;exports.MANIFEST=q;exports.useColumnManager=I;
179
+ `}}}}},j={"Column Manager":q};exports.ColumnManager=y;exports.MANIFEST=j;exports.useColumnManager=L;
package/lib/index.es.js CHANGED
@@ -1,73 +1,75 @@
1
1
  import * as e from "react";
2
- import { Metadata as y, I18nContext as O, useChildTestIdAttrBuilder as B } from "@sps-woodland/core";
3
- import { AddToList as R } from "@sps-woodland/add-to-list";
2
+ import { Metadata as O, I18nContext as B, useChildTestIdAttrBuilder as R } from "@sps-woodland/core";
3
+ import { AddToList as I } from "@sps-woodland/add-to-list";
4
4
  import { sprinkles as A } from "@sps-woodland/tokens";
5
- import { SpsModal as I, SpsModalFooter as L, SpsButton as H } from "@spscommerce/ds-react";
6
- import { ModalKind as x, ModalSize as F, ButtonKind as P } from "@spscommerce/ds-shared";
7
- import { code as h } from "@spscommerce/utils";
8
- function T({
5
+ import { SpsModal as L, SpsModalFooter as x, SpsButton as P } from "@spscommerce/ds-react";
6
+ import { ModalKind as F, ModalSize as j, ButtonKind as T } from "@spscommerce/ds-shared";
7
+ import { code as p } from "@spscommerce/utils";
8
+ function y({
9
9
  isOpen: s,
10
- title: C,
11
- visibleColumnsHeader: b,
10
+ title: h,
11
+ visibleColumnsHeader: C,
12
12
  hiddenColumnsHeader: r,
13
13
  visibleColumns: a,
14
14
  hiddenColumns: i,
15
- manualSort: t = !0,
16
- showIcons: o = !0,
15
+ maxDisplayedItems: t,
16
+ manualSort: o = !0,
17
+ showIcons: b = !0,
17
18
  showCount: f = !0,
18
19
  showFilter: g = !0,
19
20
  showMoveAllLinks: v = !0,
20
21
  onSave: m,
21
- onOpen: u,
22
- onClose: n,
23
- "data-testid": l
22
+ onOpen: n,
23
+ onClose: l,
24
+ "data-testid": d
24
25
  }) {
25
- const [d, S] = e.useState(!!s), { t: c } = e.useContext(O), E = B({ "data-testid": l }), [p, M] = e.useState({
26
+ const [E, w] = e.useState(!!s), { t: u } = e.useContext(B), M = R({ "data-testid": d }), [c, k] = e.useState({
26
27
  visibleColumns: a,
27
28
  hiddenColumns: i
28
- }), k = () => {
29
- S(!1), n == null || n();
29
+ }), S = () => {
30
+ w(!1), l == null || l();
30
31
  };
31
32
  return e.useEffect(() => {
32
- d && (M({ visibleColumns: a, hiddenColumns: i }), u == null || u());
33
- }, [d]), e.useEffect(() => {
34
- S(!!s);
35
- }, [s]), d ? /* @__PURE__ */ e.createElement(I, {
36
- title: C || c("design-system:columnManager.title"),
37
- kind: x.GENERAL,
38
- size: F.LARGE,
39
- "data-testid": l,
40
- onClose: k
41
- }, /* @__PURE__ */ e.createElement(R, {
42
- onHeader: b || c("design-system:columnManager.onListHeader"),
43
- offHeader: r || c("design-system:columnManager.offListHeader"),
44
- onList: p.visibleColumns,
45
- offList: p.hiddenColumns,
46
- onChange: (w) => {
47
- M({ visibleColumns: w.onList, hiddenColumns: w.offList });
33
+ E && (k({ visibleColumns: a, hiddenColumns: i }), n == null || n());
34
+ }, [E]), e.useEffect(() => {
35
+ w(!!s);
36
+ }, [s]), E ? /* @__PURE__ */ e.createElement(L, {
37
+ title: h || u("design-system:columnManager.title"),
38
+ kind: F.GENERAL,
39
+ size: j.LARGE,
40
+ "data-testid": d,
41
+ onClose: S
42
+ }, /* @__PURE__ */ e.createElement(I, {
43
+ onHeader: C || u("design-system:columnManager.onListHeader"),
44
+ offHeader: r || u("design-system:columnManager.offListHeader"),
45
+ onList: c.visibleColumns,
46
+ offList: c.hiddenColumns,
47
+ onChange: (H) => {
48
+ k({ visibleColumns: H.onList, hiddenColumns: H.offList });
48
49
  },
49
- manualSort: t,
50
- showIcons: o,
50
+ manualSort: o,
51
+ maxDisplayedItems: t,
52
+ showIcons: b,
51
53
  showCount: f,
52
54
  showFilter: g,
53
55
  showMoveAllLinks: v,
54
- ...E("add-to-list")
55
- }), /* @__PURE__ */ e.createElement(L, null, /* @__PURE__ */ e.createElement(H, {
56
- kind: P.DEFAULT,
56
+ ...M("add-to-list")
57
+ }), /* @__PURE__ */ e.createElement(x, null, /* @__PURE__ */ e.createElement(P, {
58
+ kind: T.DEFAULT,
57
59
  onClick: () => {
58
- M({ visibleColumns: a, hiddenColumns: i }), k();
60
+ k({ visibleColumns: a, hiddenColumns: i }), S();
59
61
  },
60
62
  className: A({ mr: "sm" }),
61
- ...E("cancel-button")
62
- }, c("design-system:columnManager.cancelButton")), /* @__PURE__ */ e.createElement(H, {
63
- kind: P.KEY,
63
+ ...M("cancel-button")
64
+ }, u("design-system:columnManager.cancelButton")), /* @__PURE__ */ e.createElement(P, {
65
+ kind: T.KEY,
64
66
  onClick: () => {
65
- m == null || m(p.visibleColumns, p.hiddenColumns), k();
67
+ m == null || m(c.visibleColumns, c.hiddenColumns), S();
66
68
  },
67
- ...E("save-button")
68
- }, c("design-system:columnManager.saveButton")))) : null;
69
+ ...M("save-button")
70
+ }, u("design-system:columnManager.saveButton")))) : null;
69
71
  }
70
- y.set(T, {
72
+ O.set(y, {
71
73
  name: "Column Manager",
72
74
  props: {
73
75
  isOpen: { type: "boolean", required: !0 },
@@ -77,6 +79,7 @@ y.set(T, {
77
79
  visibleColumns: { type: "ItemProps[]", required: !0 },
78
80
  hiddenColumns: { type: "ItemProps[]", required: !0 },
79
81
  manualSort: { type: "boolean" },
82
+ maxDisplayedItems: { type: "number" },
80
83
  showIcons: { type: "boolean" },
81
84
  showCount: { type: "boolean" },
82
85
  showFilter: { type: "boolean" },
@@ -86,31 +89,31 @@ y.set(T, {
86
89
  onOpen: { type: "() => void" }
87
90
  }
88
91
  });
89
- const z = ({
92
+ const D = ({
90
93
  isOpen: s,
91
- visibleColumns: C,
92
- hiddenColumns: b,
94
+ visibleColumns: h,
95
+ hiddenColumns: C,
93
96
  onClose: r,
94
97
  onOpen: a,
95
98
  onSave: i
96
99
  }) => {
97
100
  const [t, o] = e.useState({
98
101
  isOpen: !!s,
99
- visibleColumns: C,
100
- hiddenColumns: b
102
+ visibleColumns: h,
103
+ hiddenColumns: C
101
104
  });
102
105
  e.useEffect(() => {
103
106
  o((n) => ({ ...n, isOpen: !!s }));
104
107
  }, [s]);
105
- const f = () => {
108
+ const b = () => {
106
109
  o((n) => ({ ...n, isOpen: !0 })), a == null || a();
107
- }, g = () => {
110
+ }, f = () => {
108
111
  o((n) => ({ ...n, isOpen: !1 })), r == null || r();
109
- }, v = (n, l) => {
112
+ }, g = (n, l) => {
110
113
  o({ isOpen: !1, visibleColumns: n, hiddenColumns: l }), i == null || i(n, l);
111
- }, m = e.useCallback((n, l) => {
114
+ }, v = e.useCallback((n, l) => {
112
115
  o((d) => ({ ...d, visibleColumns: n, hiddenColumns: l }));
113
- }, []), u = e.useCallback((n) => {
116
+ }, []), m = e.useCallback((n) => {
114
117
  o((l) => ({ ...l, isOpen: n }));
115
118
  }, []);
116
119
  return {
@@ -121,23 +124,23 @@ const z = ({
121
124
  visibleColumns: t.visibleColumns,
122
125
  hiddenColumns: t.hiddenColumns,
123
126
  isOpen: t.isOpen,
124
- onClose: g,
125
- onSave: v
127
+ onClose: f,
128
+ onSave: g
126
129
  },
127
130
  triggerProps: {
128
- onClick: f
131
+ onClick: b
129
132
  },
130
- setColumns: m,
131
- setOpen: u
133
+ setColumns: v,
134
+ setOpen: m
132
135
  };
133
- }, j = {
134
- components: [T],
136
+ }, q = {
137
+ components: [y],
135
138
  examples: {
136
139
  basic: {
137
140
  label: "Basic Usage",
138
141
  examples: {
139
142
  basic: {
140
- react: h`
143
+ react: p`
141
144
  import { ColumnManager } from "@sps-woodland/column-manager";
142
145
  import { SpsButton } from "@spscommerce/ds-react";
143
146
 
@@ -202,7 +205,7 @@ const z = ({
202
205
  examples: {
203
206
  basic: {
204
207
  description: "Minimal API Reference",
205
- react: h`
208
+ react: p`
206
209
  import { ColumnManager, useColumnManager } from "@sps-woodland/column-manager";
207
210
  import { SpsButton } from "@spscommerce/ds-react";
208
211
 
@@ -241,7 +244,7 @@ const z = ({
241
244
  },
242
245
  complete: {
243
246
  description: "Complete API Reference",
244
- react: h`
247
+ react: p`
245
248
  import { ColumnManager, useColumnManager } from "@sps-woodland/column-manager";
246
249
  import { SpsButton } from "@spscommerce/ds-react";
247
250
 
@@ -301,7 +304,7 @@ const z = ({
301
304
  examples: {
302
305
  basic: {
303
306
  description: "This is the minimal visual interface for the ColumnManager component",
304
- react: h`
307
+ react: p`
305
308
  import { ColumnManager, useColumnManager } from "@sps-woodland/column-manager";
306
309
  import { SpsButton } from "@spscommerce/ds-react";
307
310
 
@@ -347,10 +350,10 @@ const z = ({
347
350
  }
348
351
  }
349
352
  }, G = {
350
- "Column Manager": j
353
+ "Column Manager": q
351
354
  };
352
355
  export {
353
- T as ColumnManager,
356
+ y as ColumnManager,
354
357
  G as MANIFEST,
355
- z as useColumnManager
358
+ D as useColumnManager
356
359
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sps-woodland/column-manager",
3
3
  "description": "SPS Woodland Design System column manager component",
4
- "version": "7.11.3",
4
+ "version": "7.12.0",
5
5
  "author": "SPS Commerce",
6
6
  "license": "UNLICENSED",
7
7
  "repository": "https://github.com/SPSCommerce/woodland/tree/main/packages/@sps-woodland/column-manager",
@@ -21,26 +21,26 @@
21
21
  "access": "public"
22
22
  },
23
23
  "peerDependencies": {
24
- "@sps-woodland/core": "7.11.3",
25
- "@sps-woodland/add-to-list": "7.11.3",
26
- "@sps-woodland/tokens": "7.11.3",
24
+ "@sps-woodland/core": "7.12.0",
25
+ "@sps-woodland/add-to-list": "7.12.0",
26
+ "@sps-woodland/tokens": "7.12.0",
27
27
  "@spscommerce/utils": "^6.12.1",
28
28
  "@vanilla-extract/css-utils": "^0.1.3",
29
- "@spscommerce/ds-react": "7.11.3",
30
- "@spscommerce/ds-shared": "7.11.3",
29
+ "@spscommerce/ds-react": "7.12.0",
30
+ "@spscommerce/ds-shared": "7.12.0",
31
31
  "react": "^16.9.0",
32
32
  "react-dom": "^16.9.0"
33
33
  },
34
34
  "devDependencies": {
35
- "@sps-woodland/core": "7.11.3",
36
- "@sps-woodland/add-to-list": "7.11.3",
37
- "@sps-woodland/tokens": "7.11.3",
35
+ "@sps-woodland/core": "7.12.0",
36
+ "@sps-woodland/add-to-list": "7.12.0",
37
+ "@sps-woodland/tokens": "7.12.0",
38
38
  "@spscommerce/utils": "^6.12.1",
39
39
  "@vanilla-extract/css": "^1.9.1",
40
40
  "@vanilla-extract/recipes": "^0.2.5",
41
41
  "@vanilla-extract/css-utils": "^0.1.3",
42
- "@spscommerce/ds-react": "7.11.3",
43
- "@spscommerce/ds-shared": "7.11.3",
42
+ "@spscommerce/ds-react": "7.12.0",
43
+ "@spscommerce/ds-shared": "7.12.0",
44
44
  "react": "^16.9.0",
45
45
  "react-dom": "^16.9.0"
46
46
  },