@spscommerce/ds-react 6.2.0 → 6.2.1
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/lib/index.cjs.js +1 -1
- package/lib/index.es.js +1 -1
- package/package.json +11 -11
package/lib/index.cjs.js
CHANGED
|
@@ -3638,7 +3638,7 @@ var a=n.defineLocale("zh-tw",{months:"\u4E00\u6708_\u4E8C\u6708_\u4E09\u6708_\u5
|
|
|
3638
3638
|
></SpsTextInput>
|
|
3639
3639
|
</>;
|
|
3640
3640
|
}
|
|
3641
|
-
`}}}},aI={clearSelected:{type:"() => void",required:!0},itemsSelected:{type:"string | number",required:!0}},sI=H(I({},U),{clearSelected:ae().isRequired,itemsSelected:w.exports.oneOfType([w.exports.string,w.exports.number])});function ji(e){const m=e,{itemsSelected:t,clearSelected:n,children:a,className:o,"data-testid":i,unsafelyReplaceClassName:l}=m,c=z(m,["itemsSelected","clearSelected","children","className","data-testid","unsafelyReplaceClassName"]),{t:p}=s.useContext(Ae),u=()=>{typeof n=="function"&&n()},f=A(l||"sps-list-action-bar-container","z-stratum-
|
|
3641
|
+
`}}}},aI={clearSelected:{type:"() => void",required:!0},itemsSelected:{type:"string | number",required:!0}},sI=H(I({},U),{clearSelected:ae().isRequired,itemsSelected:w.exports.oneOfType([w.exports.string,w.exports.number])});function ji(e){const m=e,{itemsSelected:t,clearSelected:n,children:a,className:o,"data-testid":i,unsafelyReplaceClassName:l}=m,c=z(m,["itemsSelected","clearSelected","children","className","data-testid","unsafelyReplaceClassName"]),{t:p}=s.useContext(Ae),u=()=>{typeof n=="function"&&n()},f=A(l||"sps-list-action-bar-container","z-stratum-actionbar",o);return!!t&&s.createElement("div",H(I({className:f},c),{"data-testid":i}),s.createElement("div",{className:"sps-list-action-bar"},s.createElement("div",{className:"sps-list-action-bar__details"},s.createElement("span",{className:"sps-tag sps-tag--info","data-testid":`${i}__badge`},t),p("design-system:listActionBar.itemsSelected")),s.createElement("div",{className:"sps-list-action-bar__actions"},s.createElement(It.Provider,{value:{fixed:!0}},a)),s.createElement("div",{className:"sps-list-action-bar__clear"},s.createElement($e,{kind:M.ButtonKind.LINK,icon:M.SpsIcon.X,onClick:u,"data-testid":`${i}__clear-button`},p("design-system:listActionBar.clearSelected")))))}Object.assign(ji,{props:aI,propTypes:sI,displayName:"SpsListActionBar"});const Yi=s.createContext({resizeable:!1,resizeState:{},setResizeState:()=>{},setSingleResizeState:()=>{},sort:[],setSort:()=>{}}),rI=({children:e,resizeable:t=!1,resizeState:n,onResizeStateChange:a,sort:o,onSortChange:i})=>{const[l,c]=s.useState(n||{}),[p,u]=s.useState(o||[]),f=s.useRef(i);f.current=i;const m=s.useRef(a);m.current=a;const g=s.useCallback(T=>{var y;u(T),(y=f.current)==null||y.call(f,T)},[]),S=s.useCallback(T=>{var y;c(T),(y=m.current)==null||y.call(m,T)},[]),C=s.useCallback((T,y)=>{c(D=>{var k;const v=H(I({},D),{[T]:y});return(k=m.current)==null||k.call(m,v),v})},[]),N=s.useMemo(()=>({resizeable:t,resizeState:l,setResizeState:S,setSingleResizeState:C,sort:p,setSort:g}),[t,l,S,C,p,g]);return s.createElement(Yi.Provider,{value:N},e)},oI=e=>{const t=/(auto|scroll)/,n=(c,p)=>c.parentNode===null?p:n(c.parentNode,p.concat([c])),a=(c,p)=>getComputedStyle(c,null).getPropertyValue(p),o=c=>a(c,"overflow")+a(c,"overflow-y"),i=c=>t.test(o(c));return(c=>{if(!(c instanceof HTMLElement||c instanceof SVGElement))return;const p=n(c.parentNode,[]);for(let u=0;u<p.length;u+=1)if(i(p[u]))return p[u];return null})(e)},jm=(e,t)=>{s.useLayoutEffect(()=>{if(e&&t.current){let n=0,a=!0,o=t.current.previousElementSibling;for(;o!==null;){if(!o.classList.contains("sps-table__cell--pinned")){a=!1;break}o=o.previousElementSibling}if(a){for(o=t.current.previousElementSibling;o!==null;)n+=o.clientWidth,o=o.previousElementSibling;t.current.style.left=`${n}px`}else{let i=t.current.nextElementSibling;for(;i!==null;)n+=i.clientWidth,i=i.nextElementSibling;t.current.style.right=`${n}px`}}})},iI=e=>{s.useLayoutEffect(()=>{const t=()=>{if(!e.current)return;const n=e.current.querySelectorAll("table > thead > tr:first-child > .sps-table__cell--pinned"),a=e.current.offsetWidth-e.current.clientWidth,o=e.current.offsetHeight-e.current.clientHeight;if(n.length>0){const i=[],l=[];n.forEach(u=>{let f=!0,m=u.previousElementSibling;for(;m!==null;){if(!m.classList.contains("sps-table__cell--pinned")){f=!1;break}m=m.previousElementSibling}f?i.push(u):l.push(u)});const c=i.reduce((u,f)=>u+f.clientWidth,0),p=l.reduce((u,f)=>u+f.clientWidth,0);e.current.style.backgroundPosition=`${c}px 0,
|
|
3642
3642
|
calc(100% - ${p}px) 0,
|
|
3643
3643
|
${c}px ${-o}px,
|
|
3644
3644
|
calc(100% - ${p+a}px) ${-o}px`}else e.current.style.backgroundPosition=`0 0, 100% 0, 0 ${-o}px,
|
package/lib/index.es.js
CHANGED
|
@@ -25610,7 +25610,7 @@ function SpsListActionBar(props2) {
|
|
|
25610
25610
|
clearSelected();
|
|
25611
25611
|
}
|
|
25612
25612
|
};
|
|
25613
|
-
const classes = clsx(unsafelyReplaceClassName || "sps-list-action-bar-container", "z-stratum-
|
|
25613
|
+
const classes = clsx(unsafelyReplaceClassName || "sps-list-action-bar-container", "z-stratum-actionbar", className);
|
|
25614
25614
|
return !!itemsSelected && /* @__PURE__ */ React.createElement("div", __spreadProps(__spreadValues({
|
|
25615
25615
|
className: classes
|
|
25616
25616
|
}, rest), {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spscommerce/ds-react",
|
|
3
3
|
"description": "SPS Design System React components",
|
|
4
|
-
"version": "6.2.
|
|
4
|
+
"version": "6.2.1",
|
|
5
5
|
"author": "SPS Commerce",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"repository": "https://github.com/spscommerce/design-system/tree/main/packages/@spscommerce/ds-react",
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@react-stately/collections": "^3.3.3",
|
|
31
|
-
"@spscommerce/ds-colors": "6.2.
|
|
32
|
-
"@spscommerce/ds-illustrations": "6.2.
|
|
33
|
-
"@spscommerce/ds-shared": "6.2.
|
|
34
|
-
"@spscommerce/positioning": "6.2.
|
|
35
|
-
"@spscommerce/utils": "6.2.
|
|
31
|
+
"@spscommerce/ds-colors": "6.2.1",
|
|
32
|
+
"@spscommerce/ds-illustrations": "6.2.1",
|
|
33
|
+
"@spscommerce/ds-shared": "6.2.1",
|
|
34
|
+
"@spscommerce/positioning": "6.2.1",
|
|
35
|
+
"@spscommerce/utils": "6.2.1",
|
|
36
36
|
"moment": "^2.25.3",
|
|
37
37
|
"moment-timezone": "^0.5.28",
|
|
38
38
|
"react": "^16.9.0",
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@react-stately/collections": "^3.3.3",
|
|
43
|
-
"@spscommerce/ds-colors": "6.2.
|
|
44
|
-
"@spscommerce/ds-illustrations": "6.2.
|
|
45
|
-
"@spscommerce/ds-shared": "6.2.
|
|
46
|
-
"@spscommerce/positioning": "6.2.
|
|
47
|
-
"@spscommerce/utils": "6.2.
|
|
43
|
+
"@spscommerce/ds-colors": "6.2.1",
|
|
44
|
+
"@spscommerce/ds-illustrations": "6.2.1",
|
|
45
|
+
"@spscommerce/ds-shared": "6.2.1",
|
|
46
|
+
"@spscommerce/positioning": "6.2.1",
|
|
47
|
+
"@spscommerce/utils": "6.2.1",
|
|
48
48
|
"@testing-library/react": "^9.3.2",
|
|
49
49
|
"@types/prop-types": "^15.7.1",
|
|
50
50
|
"@types/react": "^16.9.0",
|