carbon-react 158.40.0 → 158.41.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/esm/components/flat-table/flat-table-checkbox/flat-table-checkbox.component.d.ts +3 -1
- package/esm/components/flat-table/flat-table-checkbox/flat-table-checkbox.component.js +1 -1
- package/lib/components/flat-table/flat-table-checkbox/flat-table-checkbox.component.d.ts +3 -1
- package/lib/components/flat-table/flat-table-checkbox/flat-table-checkbox.component.js +1 -1
- package/package.json +1 -1
|
@@ -15,9 +15,11 @@ export interface FlatTableCheckboxProps extends TagProps {
|
|
|
15
15
|
ariaLabelledBy?: string;
|
|
16
16
|
/** Sets an id string on the element */
|
|
17
17
|
id?: string;
|
|
18
|
+
/** Prop to set disabled state on Checkbox */
|
|
19
|
+
disabled?: boolean;
|
|
18
20
|
}
|
|
19
21
|
export declare const FlatTableCheckbox: {
|
|
20
|
-
({ as, checked, onChange, selectable, onClick, ariaLabelledBy, id, ...rest }: FlatTableCheckboxProps): React.JSX.Element;
|
|
22
|
+
({ as, checked, onChange, selectable, onClick, ariaLabelledBy, id, disabled, ...rest }: FlatTableCheckboxProps): React.JSX.Element;
|
|
21
23
|
displayName: string;
|
|
22
24
|
};
|
|
23
25
|
export default FlatTableCheckbox;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{useRef as t,useContext as r,useCallback as o}from"react";import n from"./flat-table-checkbox.style.js";import"../../checkbox/checkbox-group/checkbox-group.component.js";import{Checkbox as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useRef as t,useContext as r,useCallback as o}from"react";import n from"./flat-table-checkbox.style.js";import"../../checkbox/checkbox-group/checkbox-group.component.js";import{Checkbox as l}from"../../checkbox/checkbox.component.js";import c from"../../../__internal__/utils/helpers/events/events.js";import i from"../../../__internal__/utils/helpers/tags/tags.js";import a from"../../../__internal__/utils/helpers/guid/index.js";import s from"../flat-table-row/__internal__/flat-table-row.context.js";function b(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),o.forEach((function(t){b(e,t,r[t])}))}return e}const f=b=>{var{as:f="td",checked:u,onChange:m,selectable:y=!0,onClick:d,ariaLabelledBy:O,id:h,disabled:g=!1}=b,j=function(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},l=Object.keys(e);for(o=0;o<l.length;o++)r=l[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(o=0;o<l.length;o++)r=l[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(b,["as","checked","onChange","selectable","onClick","ariaLabelledBy","id","disabled"]);const k=t(null),P=t(h||a()),{leftPositions:x,rightPositions:_}=r(s),v=x[P.current],w=_[P.current],C=void 0!==v||void 0!==w,S="flat-table-checkbox-"+("td"===f?"cell":"header"),D=o((e=>{e.stopPropagation(),null==d||d(e)}),[d]),B=o((e=>{c.isDownKey(e)||c.isUpKey(e)||e.stopPropagation()}),[]);return e(n,(E=p({ref:k,makeCellSticky:C,className:C?"isSticky":void 0,leftPosition:v,rightPosition:w,as:f},i("flat-table-checkbox",p({"data-element":S},j))),K=null!=(K={id:P.current,children:y&&e(l,{checked:u,onChange:m,name:"flat-table-checkbox",mb:0,ariaLabelledBy:O,onClick:D,onKeyDown:B,disabled:g})})?K:{},Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(K)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(K)).forEach((function(e){Object.defineProperty(E,e,Object.getOwnPropertyDescriptor(K,e))})),E));var E,K};f.displayName="FlatTableCheckbox";export{f as FlatTableCheckbox,f as default};
|
|
@@ -15,9 +15,11 @@ export interface FlatTableCheckboxProps extends TagProps {
|
|
|
15
15
|
ariaLabelledBy?: string;
|
|
16
16
|
/** Sets an id string on the element */
|
|
17
17
|
id?: string;
|
|
18
|
+
/** Prop to set disabled state on Checkbox */
|
|
19
|
+
disabled?: boolean;
|
|
18
20
|
}
|
|
19
21
|
export declare const FlatTableCheckbox: {
|
|
20
|
-
({ as, checked, onChange, selectable, onClick, ariaLabelledBy, id, ...rest }: FlatTableCheckboxProps): React.JSX.Element;
|
|
22
|
+
({ as, checked, onChange, selectable, onClick, ariaLabelledBy, id, disabled, ...rest }: FlatTableCheckboxProps): React.JSX.Element;
|
|
21
23
|
displayName: string;
|
|
22
24
|
};
|
|
23
25
|
export default FlatTableCheckbox;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("./flat-table-checkbox.style.js");require("../../checkbox/checkbox-group/checkbox-group.component.js");var n=require("../../checkbox/checkbox.component.js"),o=require("../../../__internal__/utils/helpers/events/events.js"),l=require("../../../__internal__/utils/helpers/tags/tags.js"),a=require("../../../__internal__/utils/helpers/guid/index.js"),c=require("../flat-table-row/__internal__/flat-table-row.context.js");function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){i(e,t,r[t])}))}return e}const u=i=>{var{as:u="td",checked:b,onChange:f,selectable:p=!0,onClick:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("./flat-table-checkbox.style.js");require("../../checkbox/checkbox-group/checkbox-group.component.js");var n=require("../../checkbox/checkbox.component.js"),o=require("../../../__internal__/utils/helpers/events/events.js"),l=require("../../../__internal__/utils/helpers/tags/tags.js"),a=require("../../../__internal__/utils/helpers/guid/index.js"),c=require("../flat-table-row/__internal__/flat-table-row.context.js");function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){i(e,t,r[t])}))}return e}const u=i=>{var{as:u="td",checked:b,onChange:f,selectable:p=!0,onClick:d,ariaLabelledBy:y,id:h,disabled:O=!1}=i,j=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(i,["as","checked","onChange","selectable","onClick","ariaLabelledBy","id","disabled"]);const g=t.useRef(null),k=t.useRef(h||a.default()),{leftPositions:x,rightPositions:P}=t.useContext(c.default),m=x[k.current],v=P[k.current],_=void 0!==m||void 0!==v,w="flat-table-checkbox-"+("td"===u?"cell":"header"),C=t.useCallback((e=>{e.stopPropagation(),null==d||d(e)}),[d]),q=t.useCallback((e=>{o.default.isDownKey(e)||o.default.isUpKey(e)||e.stopPropagation()}),[]);return e.jsx(r.default,(S=s({ref:g,makeCellSticky:_,className:_?"isSticky":void 0,leftPosition:m,rightPosition:v,as:u},l.default("flat-table-checkbox",s({"data-element":w},j))),D=null!=(D={id:k.current,children:p&&e.jsx(n.Checkbox,{checked:b,onChange:f,name:"flat-table-checkbox",mb:0,ariaLabelledBy:y,onClick:C,onKeyDown:q,disabled:O})})?D:{},Object.getOwnPropertyDescriptors?Object.defineProperties(S,Object.getOwnPropertyDescriptors(D)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(D)).forEach((function(e){Object.defineProperty(S,e,Object.getOwnPropertyDescriptor(D,e))})),S));var S,D};u.displayName="FlatTableCheckbox",exports.FlatTableCheckbox=u,exports.default=u;
|