@hitachivantara/uikit-react-core 5.25.3 → 5.26.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.
|
@@ -67,12 +67,12 @@ const HvBulkActions = (props) => {
|
|
|
67
67
|
[classes.semantic]: isSemantic
|
|
68
68
|
}, isSemantic && css({
|
|
69
69
|
[`& .${BulkActions_styles.staticClasses.selectAll} div`]: {
|
|
70
|
-
color: uikitStyles.theme.
|
|
70
|
+
color: uikitStyles.theme.bulkActions.semanticColor,
|
|
71
71
|
"&:hover:not(:disabled)": {
|
|
72
72
|
backgroundColor: hexToRgbA.hexToRgbA(baseColor, 0.3)
|
|
73
73
|
},
|
|
74
74
|
"& *": {
|
|
75
|
-
color: uikitStyles.theme.
|
|
75
|
+
color: uikitStyles.theme.bulkActions.semanticColor,
|
|
76
76
|
backgroundColor: "transparent"
|
|
77
77
|
}
|
|
78
78
|
},
|
|
@@ -98,9 +98,9 @@ const HvBulkActions = (props) => {
|
|
|
98
98
|
}), /* @__PURE__ */ jsxRuntime.jsx(Button.HvButton, {
|
|
99
99
|
id: setId.setId(id, "pages"),
|
|
100
100
|
className: classes.selectAllPages,
|
|
101
|
-
variant: isSemantic ?
|
|
101
|
+
variant: isSemantic ? activeTheme == null ? void 0 : activeTheme.bulkActions.actionButtonVariant : "secondaryGhost",
|
|
102
102
|
onClick: onSelectAllPages,
|
|
103
|
-
children: selectAllPagesLabel ?? `Select all ${numTotal} items
|
|
103
|
+
children: selectAllPagesLabel ?? `Select all ${numTotal} items`
|
|
104
104
|
})]
|
|
105
105
|
})]
|
|
106
106
|
}), /* @__PURE__ */ jsxRuntime.jsx(ActionsGeneric.HvActionsGeneric, {
|
|
@@ -108,7 +108,7 @@ const HvBulkActions = (props) => {
|
|
|
108
108
|
classes: {
|
|
109
109
|
root: classes.actions
|
|
110
110
|
},
|
|
111
|
-
category: isSemantic ?
|
|
111
|
+
category: isSemantic ? activeTheme == null ? void 0 : activeTheme.bulkActions.actionButtonVariant : "secondaryGhost",
|
|
112
112
|
actions,
|
|
113
113
|
disabled: actionsDisabled ?? numSelected === 0,
|
|
114
114
|
actionsCallback,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BulkActions.cjs","sources":["../../../../src/components/BulkActions/BulkActions.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { useDefaultProps } from \"@core/hooks/useDefaultProps\";\nimport { setId } from \"@core/utils/setId\";\nimport { useTheme } from \"@core/hooks/useTheme\";\nimport { HvBaseProps } from \"@core/types/generic\";\nimport { HvButton, HvButtonProps } from \"@core/components/Button\";\nimport { HvCheckBox, HvCheckBoxProps } from \"@core/components/CheckBox\";\nimport {\n HvActionGeneric,\n HvActionsGeneric,\n HvActionsGenericProps,\n} from \"@core/components/ActionsGeneric\";\nimport { HvTypography } from \"@core/components/Typography\";\nimport { ExtractNames } from \"@core/utils/classes\";\nimport { hexToRgbA } from \"@core/utils/hexToRgbA\";\n\nimport { staticClasses, useClasses } from \"./BulkActions.styles\";\n\nexport { staticClasses as bulkActionsClasses };\n\nexport type HvBulkActionsClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvBulkActionsProps extends HvBaseProps {\n /**\n * Custom label for select all checkbox\n */\n selectAllLabel?: React.ReactNode;\n /**\n * Custom label for select all checkbox conjunction\n */\n selectAllConjunctionLabel?: string;\n /**\n * Custom label for select all pages button\n */\n selectAllPagesLabel?: React.ReactNode;\n /**\n * Whether select all pages element should be visible\n */\n showSelectAllPages?: boolean;\n /**\n * The total number of elements\n */\n numTotal?: number;\n /**\n * The number of elements currently selected\n */\n numSelected?: number;\n /**\n * Function called when the \"select all\" Checkbox is toggled.\n */\n onSelectAll?: HvCheckBoxProps[\"onChange\"];\n /**\n * Function called when the \"select all pages\" button is clicked toggled.\n */\n onSelectAllPages?: HvButtonProps[\"onClick\"];\n /**\n * Whether the bulk actions should use the semantic styles when there are selected elements.\n */\n semantic?: boolean;\n /**\n * The renderable content inside the right actions slot,\n * or an Array of actions `{ id, label, icon, disabled, ... }`\n */\n actions?: React.ReactNode | HvActionGeneric[];\n /**\n * Whether actions should be all disabled\n */\n actionsDisabled?: boolean;\n /**\n * The callback function ran when an action is triggered, receiving `action` as param\n */\n actionsCallback?: HvActionsGenericProps[\"actionsCallback\"];\n /**\n * The number of maximum visible actions before they're collapsed into a `DropDownMenu`.\n */\n maxVisibleActions?: number;\n /**\n * Properties to be passed onto the checkbox component, the values of the object are equivalent to the\n * HvCheckbox API.\n */\n checkboxProps?: HvCheckBoxProps;\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes?: HvBulkActionsClasses;\n}\n\n/**\n * Bulk Actions allow users to perform an action on a single or multiple items.\n * Also known as \"batch production\" of multiple items at once, one stage at a time.\n */\nexport const HvBulkActions = (props: HvBulkActionsProps) => {\n const {\n id,\n className,\n classes: classesProp,\n selectAllPagesLabel,\n actionsDisabled,\n maxVisibleActions,\n checkboxProps,\n actions,\n numTotal = 0,\n numSelected = 0,\n selectAllLabel = \"All\",\n selectAllConjunctionLabel = \"/\",\n showSelectAllPages = false,\n semantic = true,\n actionsCallback,\n onSelectAll,\n onSelectAllPages,\n ...others\n } = useDefaultProps(\"HvBulkActions\", props);\n\n const { classes, cx, css } = useClasses(classesProp);\n\n const { activeTheme, selectedMode } = useTheme();\n\n const baseColor =\n activeTheme?.colors?.modes[selectedMode].base_light ||\n theme.colors.base_light;\n const anySelected = numSelected > 0;\n const isSemantic = semantic && anySelected;\n\n const selectAllLabelComponent = (\n <HvTypography\n component=\"span\"\n disabled={checkboxProps?.disabled}\n variant=\"body\"\n >\n {!anySelected ? (\n <>\n <HvTypography variant=\"label\">{selectAllLabel}</HvTypography>\n {` (${numTotal})`}\n </>\n ) : (\n <>\n <HvTypography variant=\"label\">{numSelected}</HvTypography>\n {` ${selectAllConjunctionLabel} ${numTotal}`}\n </>\n )}\n </HvTypography>\n );\n\n return (\n <div\n id={id}\n className={cx(\n classes.root,\n { [classes.semantic]: isSemantic },\n isSemantic &&\n css({\n [`& .${staticClasses.selectAll} div`]: {\n color: theme.colors.base_dark,\n\n \"&:hover:not(:disabled)\": {\n backgroundColor: hexToRgbA(baseColor, 0.3),\n },\n\n \"& *\": {\n color: theme.colors.base_dark,\n backgroundColor: \"transparent\",\n },\n },\n\n [`& .${staticClasses.selectAll}:focus-within div`]: {\n backgroundColor: hexToRgbA(baseColor, 0.3),\n },\n }),\n className\n )}\n {...others}\n >\n <div className={classes.selectAllContainer}>\n <HvCheckBox\n id={setId(id, \"select\")}\n className={classes.selectAll}\n checked={numSelected > 0}\n semantic={isSemantic}\n onChange={onSelectAll}\n indeterminate={numSelected > 0 && numSelected < numTotal}\n label={selectAllLabelComponent}\n {...checkboxProps}\n />\n {showSelectAllPages && anySelected && numSelected < numTotal && (\n <>\n <div className={classes.divider} />\n <HvButton\n id={setId(id, \"pages\")}\n className={classes.selectAllPages}\n variant={isSemantic ? \"semantic\" : \"secondaryGhost\"}\n onClick={onSelectAllPages}\n >\n {selectAllPagesLabel ??\n `Select all ${numTotal} items across all pages`}\n </HvButton>\n </>\n )}\n </div>\n <HvActionsGeneric\n id={setId(id, \"actions\")}\n classes={{ root: classes.actions }}\n category={isSemantic ? \"semantic\" : \"secondaryGhost\"}\n actions={actions}\n disabled={actionsDisabled ?? numSelected === 0}\n actionsCallback={actionsCallback}\n maxVisibleActions={maxVisibleActions}\n />\n </div>\n );\n};\n"],"names":["HvBulkActions","props","id","className","classes","classesProp","selectAllPagesLabel","actionsDisabled","maxVisibleActions","checkboxProps","actions","numTotal","numSelected","selectAllLabel","selectAllConjunctionLabel","showSelectAllPages","semantic","actionsCallback","onSelectAll","onSelectAllPages","others","useDefaultProps","cx","css","useClasses","activeTheme","selectedMode","useTheme","baseColor","colors","modes","base_light","theme","anySelected","isSemantic","selectAllLabelComponent","HvTypography","component","disabled","variant","children","_jsxs","_Fragment","_jsx","root","staticClasses","selectAll","color","base_dark","backgroundColor","hexToRgbA","selectAllContainer","HvCheckBox","setId","checked","onChange","indeterminate","label","divider","HvButton","selectAllPages","onClick","HvActionsGeneric","category"],"mappings":";;;;;;;;;;;;;AA4FaA,MAAAA,gBAAgBA,CAACC,UAA8B;;AACpD,QAAA;AAAA,IACJC;AAAAA,IACAC;AAAAA,IACAC,SAASC;AAAAA,IACTC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC,WAAW;AAAA,IACXC,cAAc;AAAA,IACdC,iBAAiB;AAAA,IACjBC,4BAA4B;AAAA,IAC5BC,qBAAqB;AAAA,IACrBC,WAAW;AAAA,IACXC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACA,GAAGC;AAAAA,EAAAA,IACDC,gBAAgB,gBAAA,iBAAiBpB,KAAK;AAEpC,QAAA;AAAA,IAAEG;AAAAA,IAASkB;AAAAA,IAAIC;AAAAA,EAAAA,IAAQC,mBAAAA,WAAWnB,WAAW;AAE7C,QAAA;AAAA,IAAEoB;AAAAA,IAAaC;AAAAA,MAAiBC,SAAS,SAAA;AAEzCC,QAAAA,cACJH,gDAAaI,WAAbJ,mBAAqBK,MAAMJ,cAAcK,eACzCC,YAAAA,MAAMH,OAAOE;AACf,QAAME,cAAcrB,cAAc;AAClC,QAAMsB,aAAalB,YAAYiB;AAEzBE,QAAAA,yDACHC,yBAAY;AAAA,IACXC,WAAU;AAAA,IACVC,UAAU7B,+CAAe6B;AAAAA,IACzBC,SAAQ;AAAA,IAAMC,UAEb,CAACP,cACAQ,2BAAAA,KAAAC,qBAAA;AAAA,MAAAF,UAAA,CACEG,2BAAAA,IAACP,yBAAY;AAAA,QAACG,SAAQ;AAAA,QAAOC,UAAE3B;AAAAA,MAA6B,CAAA,GAC1D,KAAIF,WAAW;AAAA,IAAA,CACjB,IAEF8B,2BAAAA,KAAAC,qBAAA;AAAA,MAAAF,UAAA,CACEG,2BAAAA,IAACP,yBAAY;AAAA,QAACG,SAAQ;AAAA,QAAOC,UAAE5B;AAA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AA,IAACgB,iBAAQ;AAAA,UACPzD,IAAImD,MAAAA,MAAMnD,IAAI,OAAO;AAAA,UACrBC,WAAWC,QAAQwD;AAAAA,UACnBrB,SAASL,aAAa,aAAa;AAAA,UACnC2B,SAAS1C;AAAAA,UAAiBqB,UAEzBlC,uBACE,cAAaK;AAAAA,QAAAA,CACR,CAAC;AAAA,MAAA,CACX,CACH;AAAA,IAAA,CACE,GACLgC,2BAAAA,IAACmB,iCAAgB;AAAA,MACf5D,IAAImD,MAAAA,MAAMnD,IAAI,SAAS;AAAA,MACvBE,SAAS;AAAA,QAAEwC,MAAMxC,QAAQM;AAAAA,MAAQ;AAAA,MACjCqD,UAAU7B,aAAa,aAAa;AAAA,MACpCxB;AAAAA,MACA4B,UAAU/B,mBAAmBK,gBAAgB;AAAA,MAC7CK;AAAAA,MACAT;AAAAA,IAAAA,CACD,CAAC;AAAA,EAAA,CACC;AAET;;;"}
|
|
1
|
+
{"version":3,"file":"BulkActions.cjs","sources":["../../../../src/components/BulkActions/BulkActions.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { useDefaultProps } from \"@core/hooks/useDefaultProps\";\nimport { setId } from \"@core/utils/setId\";\nimport { useTheme } from \"@core/hooks/useTheme\";\nimport { HvBaseProps } from \"@core/types/generic\";\nimport {\n HvButton,\n HvButtonProps,\n HvButtonVariant,\n} from \"@core/components/Button\";\nimport { HvCheckBox, HvCheckBoxProps } from \"@core/components/CheckBox\";\nimport {\n HvActionGeneric,\n HvActionsGeneric,\n HvActionsGenericProps,\n} from \"@core/components/ActionsGeneric\";\nimport { HvTypography } from \"@core/components/Typography\";\nimport { ExtractNames } from \"@core/utils/classes\";\nimport { hexToRgbA } from \"@core/utils/hexToRgbA\";\n\nimport { staticClasses, useClasses } from \"./BulkActions.styles\";\n\nexport { staticClasses as bulkActionsClasses };\n\nexport type HvBulkActionsClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvBulkActionsProps extends HvBaseProps {\n /**\n * Custom label for select all checkbox\n */\n selectAllLabel?: React.ReactNode;\n /**\n * Custom label for select all checkbox conjunction\n */\n selectAllConjunctionLabel?: string;\n /**\n * Custom label for select all pages button\n */\n selectAllPagesLabel?: React.ReactNode;\n /**\n * Whether select all pages element should be visible\n */\n showSelectAllPages?: boolean;\n /**\n * The total number of elements\n */\n numTotal?: number;\n /**\n * The number of elements currently selected\n */\n numSelected?: number;\n /**\n * Function called when the \"select all\" Checkbox is toggled.\n */\n onSelectAll?: HvCheckBoxProps[\"onChange\"];\n /**\n * Function called when the \"select all pages\" button is clicked toggled.\n */\n onSelectAllPages?: HvButtonProps[\"onClick\"];\n /**\n * Whether the bulk actions should use the semantic styles when there are selected elements.\n */\n semantic?: boolean;\n /**\n * The renderable content inside the right actions slot,\n * or an Array of actions `{ id, label, icon, disabled, ... }`\n */\n actions?: React.ReactNode | HvActionGeneric[];\n /**\n * Whether actions should be all disabled\n */\n actionsDisabled?: boolean;\n /**\n * The callback function ran when an action is triggered, receiving `action` as param\n */\n actionsCallback?: HvActionsGenericProps[\"actionsCallback\"];\n /**\n * The number of maximum visible actions before they're collapsed into a `DropDownMenu`.\n */\n maxVisibleActions?: number;\n /**\n * Properties to be passed onto the checkbox component, the values of the object are equivalent to the\n * HvCheckbox API.\n */\n checkboxProps?: HvCheckBoxProps;\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes?: HvBulkActionsClasses;\n}\n\n/**\n * Bulk Actions allow users to perform an action on a single or multiple items.\n * Also known as \"batch production\" of multiple items at once, one stage at a time.\n */\nexport const HvBulkActions = (props: HvBulkActionsProps) => {\n const {\n id,\n className,\n classes: classesProp,\n selectAllPagesLabel,\n actionsDisabled,\n maxVisibleActions,\n checkboxProps,\n actions,\n numTotal = 0,\n numSelected = 0,\n selectAllLabel = \"All\",\n selectAllConjunctionLabel = \"/\",\n showSelectAllPages = false,\n semantic = true,\n actionsCallback,\n onSelectAll,\n onSelectAllPages,\n ...others\n } = useDefaultProps(\"HvBulkActions\", props);\n\n const { classes, cx, css } = useClasses(classesProp);\n\n const { activeTheme, selectedMode } = useTheme();\n\n const baseColor =\n activeTheme?.colors?.modes[selectedMode].base_light ||\n theme.colors.base_light;\n const anySelected = numSelected > 0;\n const isSemantic = semantic && anySelected;\n\n const selectAllLabelComponent = (\n <HvTypography\n component=\"span\"\n disabled={checkboxProps?.disabled}\n variant=\"body\"\n >\n {!anySelected ? (\n <>\n <HvTypography variant=\"label\">{selectAllLabel}</HvTypography>\n {` (${numTotal})`}\n </>\n ) : (\n <>\n <HvTypography variant=\"label\">{numSelected}</HvTypography>\n {` ${selectAllConjunctionLabel} ${numTotal}`}\n </>\n )}\n </HvTypography>\n );\n\n return (\n <div\n id={id}\n className={cx(\n classes.root,\n { [classes.semantic]: isSemantic },\n isSemantic &&\n css({\n [`& .${staticClasses.selectAll} div`]: {\n color: theme.bulkActions.semanticColor,\n\n \"&:hover:not(:disabled)\": {\n backgroundColor: hexToRgbA(baseColor, 0.3),\n },\n\n \"& *\": {\n color: theme.bulkActions.semanticColor,\n backgroundColor: \"transparent\",\n },\n },\n\n [`& .${staticClasses.selectAll}:focus-within div`]: {\n backgroundColor: hexToRgbA(baseColor, 0.3),\n },\n }),\n className\n )}\n {...others}\n >\n <div className={classes.selectAllContainer}>\n <HvCheckBox\n id={setId(id, \"select\")}\n className={classes.selectAll}\n checked={numSelected > 0}\n semantic={isSemantic}\n onChange={onSelectAll}\n indeterminate={numSelected > 0 && numSelected < numTotal}\n label={selectAllLabelComponent}\n {...checkboxProps}\n />\n {showSelectAllPages && anySelected && numSelected < numTotal && (\n <>\n <div className={classes.divider} />\n <HvButton\n id={setId(id, \"pages\")}\n className={classes.selectAllPages}\n variant={\n isSemantic\n ? (activeTheme?.bulkActions\n .actionButtonVariant as HvButtonVariant)\n : \"secondaryGhost\"\n }\n onClick={onSelectAllPages}\n >\n {selectAllPagesLabel ?? `Select all ${numTotal} items`}\n </HvButton>\n </>\n )}\n </div>\n <HvActionsGeneric\n id={setId(id, \"actions\")}\n classes={{ root: classes.actions }}\n category={\n isSemantic\n ? (activeTheme?.bulkActions.actionButtonVariant as HvButtonVariant)\n : \"secondaryGhost\"\n }\n actions={actions}\n disabled={actionsDisabled ?? numSelected === 0}\n actionsCallback={actionsCallback}\n maxVisibleActions={maxVisibleActions}\n />\n </div>\n );\n};\n"],"names":["HvBulkActions","props","id","className","classes","classesProp","selectAllPagesLabel","actionsDisabled","maxVisibleActions","checkboxProps","actions","numTotal","numSelected","selectAllLabel","selectAllConjunctionLabel","showSelectAllPages","semantic","actionsCallback","onSelectAll","onSelectAllPages","others","useDefaultProps","cx","css","useClasses","activeTheme","selectedMode","useTheme","baseColor","colors","modes","base_light","theme","anySelected","isSemantic","selectAllLabelComponent","HvTypography","component","disabled","variant","children","_jsxs","_Fragment","_jsx","root","staticClasses","selectAll","color","bulkActions","semanticColor","backgroundColor","hexToRgbA","selectAllContainer","HvCheckBox","setId","checked","onChange","indeterminate","label","divider","HvButton","selectAllPages","actionButtonVariant","onClick","HvActionsGeneric","category"],"mappings":";;;;;;;;;;;;;AAgGaA,MAAAA,gBAAgBA,CAACC,UAA8B;;AACpD,QAAA;AAAA,IACJC;AAAAA,IACAC;AAAAA,IACAC,SAASC;AAAAA,IACTC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC,WAAW;AAAA,IACXC,cAAc;AAAA,IACdC,iBAAiB;AAAA,IACjBC,4BAA4B;AAAA,IAC5BC,qBAAqB;AAAA,IACrBC,WAAW;AAAA,IACXC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACA,GAAGC;AAAAA,EAAAA,IACDC,gBAAgB,gBAAA,iBAAiBpB,KAAK;AAEpC,QAAA;AAAA,IAAEG;AAAAA,IAASkB;AAAAA,IAAIC;AAAAA,EAAAA,IAAQC,mBAAAA,WAAWnB,WAAW;AAE7C,QAAA;AAAA,IAAEoB;AAAAA,IAAaC;AAAAA,MAAiBC,SAAS,SAAA;AAEz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.semantic]: isSemantic
|
|
66
66
|
}, isSemantic && css({
|
|
67
67
|
[`& .${staticClasses.selectAll} div`]: {
|
|
68
|
-
color: theme.
|
|
68
|
+
color: theme.bulkActions.semanticColor,
|
|
69
69
|
"&:hover:not(:disabled)": {
|
|
70
70
|
backgroundColor: hexToRgbA(baseColor, 0.3)
|
|
71
71
|
},
|
|
72
72
|
"& *": {
|
|
73
|
-
color: theme.
|
|
73
|
+
color: theme.bulkActions.semanticColor,
|
|
74
74
|
backgroundColor: "transparent"
|
|
75
75
|
}
|
|
76
76
|
},
|
|
@@ -96,9 +96,9 @@ const HvBulkActions = (props) => {
|
|
|
96
96
|
}), /* @__PURE__ */ jsx(HvButton, {
|
|
97
97
|
id: setId(id, "pages"),
|
|
98
98
|
className: classes.selectAllPages,
|
|
99
|
-
variant: isSemantic ?
|
|
99
|
+
variant: isSemantic ? activeTheme == null ? void 0 : activeTheme.bulkActions.actionButtonVariant : "secondaryGhost",
|
|
100
100
|
onClick: onSelectAllPages,
|
|
101
|
-
children: selectAllPagesLabel ?? `Select all ${numTotal} items
|
|
101
|
+
children: selectAllPagesLabel ?? `Select all ${numTotal} items`
|
|
102
102
|
})]
|
|
103
103
|
})]
|
|
104
104
|
}), /* @__PURE__ */ jsx(HvActionsGeneric, {
|
|
@@ -106,7 +106,7 @@ const HvBulkActions = (props) => {
|
|
|
106
106
|
classes: {
|
|
107
107
|
root: classes.actions
|
|
108
108
|
},
|
|
109
|
-
category: isSemantic ?
|
|
109
|
+
category: isSemantic ? activeTheme == null ? void 0 : activeTheme.bulkActions.actionButtonVariant : "secondaryGhost",
|
|
110
110
|
actions,
|
|
111
111
|
disabled: actionsDisabled ?? numSelected === 0,
|
|
112
112
|
actionsCallback,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BulkActions.js","sources":["../../../../src/components/BulkActions/BulkActions.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { useDefaultProps } from \"@core/hooks/useDefaultProps\";\nimport { setId } from \"@core/utils/setId\";\nimport { useTheme } from \"@core/hooks/useTheme\";\nimport { HvBaseProps } from \"@core/types/generic\";\nimport { HvButton, HvButtonProps } from \"@core/components/Button\";\nimport { HvCheckBox, HvCheckBoxProps } from \"@core/components/CheckBox\";\nimport {\n HvActionGeneric,\n HvActionsGeneric,\n HvActionsGenericProps,\n} from \"@core/components/ActionsGeneric\";\nimport { HvTypography } from \"@core/components/Typography\";\nimport { ExtractNames } from \"@core/utils/classes\";\nimport { hexToRgbA } from \"@core/utils/hexToRgbA\";\n\nimport { staticClasses, useClasses } from \"./BulkActions.styles\";\n\nexport { staticClasses as bulkActionsClasses };\n\nexport type HvBulkActionsClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvBulkActionsProps extends HvBaseProps {\n /**\n * Custom label for select all checkbox\n */\n selectAllLabel?: React.ReactNode;\n /**\n * Custom label for select all checkbox conjunction\n */\n selectAllConjunctionLabel?: string;\n /**\n * Custom label for select all pages button\n */\n selectAllPagesLabel?: React.ReactNode;\n /**\n * Whether select all pages element should be visible\n */\n showSelectAllPages?: boolean;\n /**\n * The total number of elements\n */\n numTotal?: number;\n /**\n * The number of elements currently selected\n */\n numSelected?: number;\n /**\n * Function called when the \"select all\" Checkbox is toggled.\n */\n onSelectAll?: HvCheckBoxProps[\"onChange\"];\n /**\n * Function called when the \"select all pages\" button is clicked toggled.\n */\n onSelectAllPages?: HvButtonProps[\"onClick\"];\n /**\n * Whether the bulk actions should use the semantic styles when there are selected elements.\n */\n semantic?: boolean;\n /**\n * The renderable content inside the right actions slot,\n * or an Array of actions `{ id, label, icon, disabled, ... }`\n */\n actions?: React.ReactNode | HvActionGeneric[];\n /**\n * Whether actions should be all disabled\n */\n actionsDisabled?: boolean;\n /**\n * The callback function ran when an action is triggered, receiving `action` as param\n */\n actionsCallback?: HvActionsGenericProps[\"actionsCallback\"];\n /**\n * The number of maximum visible actions before they're collapsed into a `DropDownMenu`.\n */\n maxVisibleActions?: number;\n /**\n * Properties to be passed onto the checkbox component, the values of the object are equivalent to the\n * HvCheckbox API.\n */\n checkboxProps?: HvCheckBoxProps;\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes?: HvBulkActionsClasses;\n}\n\n/**\n * Bulk Actions allow users to perform an action on a single or multiple items.\n * Also known as \"batch production\" of multiple items at once, one stage at a time.\n */\nexport const HvBulkActions = (props: HvBulkActionsProps) => {\n const {\n id,\n className,\n classes: classesProp,\n selectAllPagesLabel,\n actionsDisabled,\n maxVisibleActions,\n checkboxProps,\n actions,\n numTotal = 0,\n numSelected = 0,\n selectAllLabel = \"All\",\n selectAllConjunctionLabel = \"/\",\n showSelectAllPages = false,\n semantic = true,\n actionsCallback,\n onSelectAll,\n onSelectAllPages,\n ...others\n } = useDefaultProps(\"HvBulkActions\", props);\n\n const { classes, cx, css } = useClasses(classesProp);\n\n const { activeTheme, selectedMode } = useTheme();\n\n const baseColor =\n activeTheme?.colors?.modes[selectedMode].base_light ||\n theme.colors.base_light;\n const anySelected = numSelected > 0;\n const isSemantic = semantic && anySelected;\n\n const selectAllLabelComponent = (\n <HvTypography\n component=\"span\"\n disabled={checkboxProps?.disabled}\n variant=\"body\"\n >\n {!anySelected ? (\n <>\n <HvTypography variant=\"label\">{selectAllLabel}</HvTypography>\n {` (${numTotal})`}\n </>\n ) : (\n <>\n <HvTypography variant=\"label\">{numSelected}</HvTypography>\n {` ${selectAllConjunctionLabel} ${numTotal}`}\n </>\n )}\n </HvTypography>\n );\n\n return (\n <div\n id={id}\n className={cx(\n classes.root,\n { [classes.semantic]: isSemantic },\n isSemantic &&\n css({\n [`& .${staticClasses.selectAll} div`]: {\n color: theme.colors.base_dark,\n\n \"&:hover:not(:disabled)\": {\n backgroundColor: hexToRgbA(baseColor, 0.3),\n },\n\n \"& *\": {\n color: theme.colors.base_dark,\n backgroundColor: \"transparent\",\n },\n },\n\n [`& .${staticClasses.selectAll}:focus-within div`]: {\n backgroundColor: hexToRgbA(baseColor, 0.3),\n },\n }),\n className\n )}\n {...others}\n >\n <div className={classes.selectAllContainer}>\n <HvCheckBox\n id={setId(id, \"select\")}\n className={classes.selectAll}\n checked={numSelected > 0}\n semantic={isSemantic}\n onChange={onSelectAll}\n indeterminate={numSelected > 0 && numSelected < numTotal}\n label={selectAllLabelComponent}\n {...checkboxProps}\n />\n {showSelectAllPages && anySelected && numSelected < numTotal && (\n <>\n <div className={classes.divider} />\n <HvButton\n id={setId(id, \"pages\")}\n className={classes.selectAllPages}\n variant={isSemantic ? \"semantic\" : \"secondaryGhost\"}\n onClick={onSelectAllPages}\n >\n {selectAllPagesLabel ??\n `Select all ${numTotal} items across all pages`}\n </HvButton>\n </>\n )}\n </div>\n <HvActionsGeneric\n id={setId(id, \"actions\")}\n classes={{ root: classes.actions }}\n category={isSemantic ? \"semantic\" : \"secondaryGhost\"}\n actions={actions}\n disabled={actionsDisabled ?? numSelected === 0}\n actionsCallback={actionsCallback}\n maxVisibleActions={maxVisibleActions}\n />\n </div>\n );\n};\n"],"names":["HvBulkActions","props","id","className","classes","classesProp","selectAllPagesLabel","actionsDisabled","maxVisibleActions","checkboxProps","actions","numTotal","numSelected","selectAllLabel","selectAllConjunctionLabel","showSelectAllPages","semantic","actionsCallback","onSelectAll","onSelectAllPages","others","useDefaultProps","cx","css","useClasses","activeTheme","selectedMode","useTheme","baseColor","colors","modes","base_light","theme","anySelected","isSemantic","selectAllLabelComponent","HvTypography","component","disabled","variant","children","_jsxs","_Fragment","_jsx","root","staticClasses","selectAll","color","base_dark","backgroundColor","hexToRgbA","selectAllContainer","HvCheckBox","setId","checked","onChange","indeterminate","label","divider","HvButton","selectAllPages","onClick","HvActionsGeneric","category"],"mappings":";;;;;;;;;;;AA4FaA,MAAAA,gBAAgBA,CAACC,UAA8B;;AACpD,QAAA;AAAA,IACJC;AAAAA,IACAC;AAAAA,IACAC,SAASC;AAAAA,IACTC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC,WA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CxB;AAAAA,MACA4B,UAAU/B,mBAAmBK,gBAAgB;AAAA,MAC7CK;AAAAA,MACAT;AAAAA,IAAAA,CACD,CAAC;AAAA,EAAA,CACC;AAET;"}
|
|
1
|
+
{"version":3,"file":"BulkActions.js","sources":["../../../../src/components/BulkActions/BulkActions.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { useDefaultProps } from \"@core/hooks/useDefaultProps\";\nimport { setId } from \"@core/utils/setId\";\nimport { useTheme } from \"@core/hooks/useTheme\";\nimport { HvBaseProps } from \"@core/types/generic\";\nimport {\n HvButton,\n HvButtonProps,\n HvButtonVariant,\n} from \"@core/components/Button\";\nimport { HvCheckBox, HvCheckBoxProps } from \"@core/components/CheckBox\";\nimport {\n HvActionGeneric,\n HvActionsGeneric,\n HvActionsGenericProps,\n} from \"@core/components/ActionsGeneric\";\nimport { HvTypography } from \"@core/components/Typography\";\nimport { ExtractNames } from \"@core/utils/classes\";\nimport { hexToRgbA } from \"@core/utils/hexToRgbA\";\n\nimport { staticClasses, useClasses } from \"./BulkActions.styles\";\n\nexport { staticClasses as bulkActionsClasses };\n\nexport type HvBulkActionsClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvBulkActionsProps extends HvBaseProps {\n /**\n * Custom label for select all checkbox\n */\n selectAllLabel?: React.ReactNode;\n /**\n * Custom label for select all checkbox conjunction\n */\n selectAllConjunctionLabel?: string;\n /**\n * Custom label for select all pages button\n */\n selectAllPagesLabel?: React.ReactNode;\n /**\n * Whether select all pages element should be visible\n */\n showSelectAllPages?: boolean;\n /**\n * The total number of elements\n */\n numTotal?: number;\n /**\n * The number of elements currently selected\n */\n numSelected?: number;\n /**\n * Function called when the \"select all\" Checkbox is toggled.\n */\n onSelectAll?: HvCheckBoxProps[\"onChange\"];\n /**\n * Function called when the \"select all pages\" button is clicked toggled.\n */\n onSelectAllPages?: HvButtonProps[\"onClick\"];\n /**\n * Whether the bulk actions should use the semantic styles when there are selected elements.\n */\n semantic?: boolean;\n /**\n * The renderable content inside the right actions slot,\n * or an Array of actions `{ id, label, icon, disabled, ... }`\n */\n actions?: React.ReactNode | HvActionGeneric[];\n /**\n * Whether actions should be all disabled\n */\n actionsDisabled?: boolean;\n /**\n * The callback function ran when an action is triggered, receiving `action` as param\n */\n actionsCallback?: HvActionsGenericProps[\"actionsCallback\"];\n /**\n * The number of maximum visible actions before they're collapsed into a `DropDownMenu`.\n */\n maxVisibleActions?: number;\n /**\n * Properties to be passed onto the checkbox component, the values of the object are equivalent to the\n * HvCheckbox API.\n */\n checkboxProps?: HvCheckBoxProps;\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes?: HvBulkActionsClasses;\n}\n\n/**\n * Bulk Actions allow users to perform an action on a single or multiple items.\n * Also known as \"batch production\" of multiple items at once, one stage at a time.\n */\nexport const HvBulkActions = (props: HvBulkActionsProps) => {\n const {\n id,\n className,\n classes: classesProp,\n selectAllPagesLabel,\n actionsDisabled,\n maxVisibleActions,\n checkboxProps,\n actions,\n numTotal = 0,\n numSelected = 0,\n selectAllLabel = \"All\",\n selectAllConjunctionLabel = \"/\",\n showSelectAllPages = false,\n semantic = true,\n actionsCallback,\n onSelectAll,\n onSelectAllPages,\n ...others\n } = useDefaultProps(\"HvBulkActions\", props);\n\n const { classes, cx, css } = useClasses(classesProp);\n\n const { activeTheme, selectedMode } = useTheme();\n\n const baseColor =\n activeTheme?.colors?.modes[selectedMode].base_light ||\n theme.colors.base_light;\n const anySelected = numSelected > 0;\n const isSemantic = semantic && anySelected;\n\n const selectAllLabelComponent = (\n <HvTypography\n component=\"span\"\n disabled={checkboxProps?.disabled}\n variant=\"body\"\n >\n {!anySelected ? (\n <>\n <HvTypography variant=\"label\">{selectAllLabel}</HvTypography>\n {` (${numTotal})`}\n </>\n ) : (\n <>\n <HvTypography variant=\"label\">{numSelected}</HvTypography>\n {` ${selectAllConjunctionLabel} ${numTotal}`}\n </>\n )}\n </HvTypography>\n );\n\n return (\n <div\n id={id}\n className={cx(\n classes.root,\n { [classes.semantic]: isSemantic },\n isSemantic &&\n css({\n [`& .${staticClasses.selectAll} div`]: {\n color: theme.bulkActions.semanticColor,\n\n \"&:hover:not(:disabled)\": {\n backgroundColor: hexToRgbA(baseColor, 0.3),\n },\n\n \"& *\": {\n color: theme.bulkActions.semanticColor,\n backgroundColor: \"transparent\",\n },\n },\n\n [`& .${staticClasses.selectAll}:focus-within div`]: {\n backgroundColor: hexToRgbA(baseColor, 0.3),\n },\n }),\n className\n )}\n {...others}\n >\n <div className={classes.selectAllContainer}>\n <HvCheckBox\n id={setId(id, \"select\")}\n className={classes.selectAll}\n checked={numSelected > 0}\n semantic={isSemantic}\n onChange={onSelectAll}\n indeterminate={numSelected > 0 && numSelected < numTotal}\n label={selectAllLabelComponent}\n {...checkboxProps}\n />\n {showSelectAllPages && anySelected && numSelected < numTotal && (\n <>\n <div className={classes.divider} />\n <HvButton\n id={setId(id, \"pages\")}\n className={classes.selectAllPages}\n variant={\n isSemantic\n ? (activeTheme?.bulkActions\n .actionButtonVariant as HvButtonVariant)\n : \"secondaryGhost\"\n }\n onClick={onSelectAllPages}\n >\n {selectAllPagesLabel ?? `Select all ${numTotal} items`}\n </HvButton>\n </>\n )}\n </div>\n <HvActionsGeneric\n id={setId(id, \"actions\")}\n classes={{ root: classes.actions }}\n category={\n isSemantic\n ? (activeTheme?.bulkActions.actionButtonVariant as HvButtonVariant)\n : \"secondaryGhost\"\n }\n actions={actions}\n disabled={actionsDisabled ?? numSelected === 0}\n actionsCallback={actionsCallback}\n maxVisibleActions={maxVisibleActions}\n />\n </div>\n );\n};\n"],"names":["HvBulkActions","props","id","className","classes","classesProp","selectAllPagesLabel","actionsDisabled","maxVisibleActions","checkboxProps","actions","numTotal","numSelected","selectAllLabel","selectAllConjunctionLabel","showSelectAllPages","semantic","actionsCallback","onSelectAll","onSelectAllPages","others","useDefaultProps","cx","css","useClasses","activeTheme","selectedMode","useTheme","baseColor","colors","modes","base_light","theme","anySelected","isSemantic","selectAllLabelComponent","HvTypography","component","disabled","variant","children","_jsxs","_Fragment","_jsx","root","staticClasses","selectAll","color","bulkActions","semanticColor","backgroundColor","hexToRgbA","selectAllContainer","HvCheckBox","setId","checked","onChange","indeterminate","label","divider","HvButton","selectAllPages","actionButtonVariant","onClick","HvActionsGeneric","category"],"mappings":";;;;;;;;;;;AAgGaA,MAAAA,gBAAgBA,CAACC,UAA8B;;AACpD,QAAA;AAAA,IACJC;AAAAA,IACAC;AAAAA,IACAC,SAASC;AAAAA,IACTC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC,WAAW;AAAA,IACXC,cAAc;AAAA,IACdC,iBAAiB;AAAA,IACjBC,4BAA4B;AAAA,IAC5BC,qBAAqB;AAAA,IACrBC,WAAW;AAAA,IACXC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACA,GAAGC;AAAAA,EAAAA,IACDC,gBAAgB,iBAAiBpB,KAAK;AAEpC,QAAA;AAAA,IAAEG;AAAAA,IAASkB;AAAAA,IAAIC;AAAAA,EAAAA,IAAQC,WAAWnB,WAAW;AAE7C,QAAA;AAAA,IAAEoB;AAAAA,IAAaC;AAAAA,MAAiBC,SAAS;AAEzCC,QAAAA,cACJH,gDAAaI,WAAbJ,mBAAqBK,MAAMJ,cAAcK,eACzCC,MAAMH,OAAOE;AACf,QAAME,cAAcrB,cAAc;AAClC,QAAMsB,aAAalB,YAAYiB;AAEzBE,QAAAA,8CACHC,cAAY;AAAA,IACXC,WAAU;AAAA,IACVC,UAAU7B,+CAAe6B;AAAAA,IACzBC,SAAQ;AAAA,IAAMC,UAEb,CAACP,cACAQ,qBAAAC,UAAA;AAAA,MAAAF,UAAA,CACEG,oBAACP,cAAY;AAAA,QAACG,SAAQ;AAAA,QAAOC,UAAE3B;AAAAA,MAA6B,CAAA,GAC1D,KAAIF,WAAW;AAAA,IAAA,CACjB,IAEF8B,qBAAAC,UAAA;AAAA,MAAAF,UAAA,CACEG,oBAAC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AAIoD,MAAMpD,IAAI,OAAO;AAAA,UACrBC,WAAWC,QAAQyD;AAAAA,UACnBtB,SACEL,aACKT,2CAAauB,YACXc,sBACH;AAAA,UAENC,SAAS5C;AAAAA,UAAiBqB,UAEzBlC,uBAAwB,cAAaK;AAAAA,QAAAA,CAC9B,CAAC;AAAA,MAAA,CACX,CACH;AAAA,IAAA,CACE,GACLgC,oBAACqB,kBAAgB;AAAA,MACf9D,IAAIoD,MAAMpD,IAAI,SAAS;AAAA,MACvBE,SAAS;AAAA,QAAEwC,MAAMxC,QAAQM;AAAAA,MAAQ;AAAA,MACjCuD,UACE/B,aACKT,2CAAauB,YAAYc,sBAC1B;AAAA,MAENpD;AAAAA,MACA4B,UAAU/B,mBAAmBK,gBAAgB;AAAA,MAC7CK;AAAAA,MACAT;AAAAA,IAAAA,CACD,CAAC;AAAA,EAAA,CACC;AAET;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hitachivantara/uikit-react-core",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.26.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Hitachi Vantara UI Kit Team",
|
|
6
6
|
"description": "Core React components for the NEXT Design System.",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"@emotion/css": "^11.11.0",
|
|
34
34
|
"@emotion/serialize": "^1.1.2",
|
|
35
35
|
"@emotion/utils": "^1.2.1",
|
|
36
|
-
"@hitachivantara/uikit-react-icons": "^5.6.
|
|
37
|
-
"@hitachivantara/uikit-react-shared": "^5.1.
|
|
38
|
-
"@hitachivantara/uikit-styles": "^5.
|
|
36
|
+
"@hitachivantara/uikit-react-icons": "^5.6.2",
|
|
37
|
+
"@hitachivantara/uikit-react-shared": "^5.1.7",
|
|
38
|
+
"@hitachivantara/uikit-styles": "^5.11.0",
|
|
39
39
|
"@internationalized/date": "^3.2.0",
|
|
40
40
|
"@mui/base": "^5.0.0-beta.4",
|
|
41
41
|
"@popperjs/core": "^2.11.8",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"access": "public",
|
|
65
65
|
"directory": "package"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "b9b65e926b74ae9834d26017a487e72a621383c7",
|
|
68
68
|
"main": "dist/cjs/index.cjs",
|
|
69
69
|
"exports": {
|
|
70
70
|
".": {
|