iguazio.dashboard-react-controls 3.0.4 → 3.1.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/dist/components/ActionsMenu/ActionsMenu.d.ts +18 -0
- package/dist/components/ActionsMenu/ActionsMenu.d.ts.map +1 -0
- package/dist/components/ActionsMenu/ActionsMenu.mjs +126 -0
- package/dist/components/ActionsMenu/ActionsMenu.mjs.map +1 -0
- package/dist/components/BlockerSpy/BlockerSpy.d.ts +12 -0
- package/dist/components/BlockerSpy/BlockerSpy.d.ts.map +1 -0
- package/dist/components/BlockerSpy/BlockerSpy.mjs +18 -0
- package/dist/components/BlockerSpy/BlockerSpy.mjs.map +1 -0
- package/dist/components/Button/Button.mjs +21 -20
- package/dist/components/Button/Button.mjs.map +1 -1
- package/dist/components/Chip/Chip.d.ts +3 -0
- package/dist/components/Chip/Chip.d.ts.map +1 -0
- package/dist/components/Chip/Chip.mjs +153 -0
- package/dist/components/Chip/Chip.mjs.map +1 -0
- package/dist/components/Chip/Chip.stories.d.ts +26 -0
- package/dist/components/Chip/Chip.stories.d.ts.map +1 -0
- package/dist/components/ChipCell/ChipCell.d.ts +3 -0
- package/dist/components/ChipCell/ChipCell.d.ts.map +1 -0
- package/dist/components/ChipCell/ChipCell.mjs +212 -0
- package/dist/components/ChipCell/ChipCell.mjs.map +1 -0
- package/dist/components/ChipCell/ChipTooltip/ChipTooltip.d.ts +15 -0
- package/dist/components/ChipCell/ChipTooltip/ChipTooltip.d.ts.map +1 -0
- package/dist/components/ChipCell/ChipTooltip/ChipTooltip.mjs +36 -0
- package/dist/components/ChipCell/ChipTooltip/ChipTooltip.mjs.map +1 -0
- package/dist/components/ChipCell/HiddenChipsBlock/HiddenChipsBlock.d.ts +35 -0
- package/dist/components/ChipCell/HiddenChipsBlock/HiddenChipsBlock.d.ts.map +1 -0
- package/dist/components/ChipCell/HiddenChipsBlock/HiddenChipsBlock.mjs +73 -0
- package/dist/components/ChipCell/HiddenChipsBlock/HiddenChipsBlock.mjs.map +1 -0
- package/dist/components/ChipForm/ChipForm.d.ts +25 -0
- package/dist/components/ChipForm/ChipForm.d.ts.map +1 -0
- package/dist/components/ChipForm/ChipForm.mjs +184 -0
- package/dist/components/ChipForm/ChipForm.mjs.map +1 -0
- package/dist/components/CopyToClipboard/CopyToClipboard.d.ts +18 -0
- package/dist/components/CopyToClipboard/CopyToClipboard.d.ts.map +1 -0
- package/dist/components/CopyToClipboard/CopyToClipboard.mjs +51 -0
- package/dist/components/CopyToClipboard/CopyToClipboard.mjs.map +1 -0
- package/dist/components/ErrorMessage/ErrorMessage.d.ts +12 -0
- package/dist/components/ErrorMessage/ErrorMessage.d.ts.map +1 -0
- package/dist/components/ErrorMessage/ErrorMessage.mjs +23 -0
- package/dist/components/ErrorMessage/ErrorMessage.mjs.map +1 -0
- package/dist/components/FormChipCell/FormChipCellView.mjs +1 -1
- package/dist/components/LoadButton/LoadButton.d.ts +16 -0
- package/dist/components/LoadButton/LoadButton.d.ts.map +1 -0
- package/dist/components/LoadButton/LoadButton.mjs +22 -0
- package/dist/components/LoadButton/LoadButton.mjs.map +1 -0
- package/dist/components/LoadButton/LoadButton.stories.d.ts +10 -0
- package/dist/components/LoadButton/LoadButton.stories.d.ts.map +1 -0
- package/dist/components/Loader/Loader.d.ts +3 -0
- package/dist/components/Loader/Loader.d.ts.map +1 -0
- package/dist/components/Loader/Loader.mjs +24 -0
- package/dist/components/Loader/Loader.mjs.map +1 -0
- package/dist/components/Loader/LoaderForSuspenseFallback.d.ts +3 -0
- package/dist/components/Loader/LoaderForSuspenseFallback.d.ts.map +1 -0
- package/dist/components/Loader/LoaderForSuspenseFallback.mjs +13 -0
- package/dist/components/Loader/LoaderForSuspenseFallback.mjs.map +1 -0
- package/dist/components/TableCell/TableCell.d.ts +28 -0
- package/dist/components/TableCell/TableCell.d.ts.map +1 -0
- package/dist/components/TableCell/TableCell.mjs +104 -0
- package/dist/components/TableCell/TableCell.mjs.map +1 -0
- package/dist/components/TabsSlider/TabsSlider.d.ts +20 -0
- package/dist/components/TabsSlider/TabsSlider.d.ts.map +1 -0
- package/dist/components/TabsSlider/TabsSlider.mjs +133 -0
- package/dist/components/TabsSlider/TabsSlider.mjs.map +1 -0
- package/dist/components/index.d.ts +12 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.mjs +60 -38
- package/dist/components/index.mjs.map +1 -1
- package/dist/constants.d.ts +8 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.mjs +34 -26
- package/dist/constants.mjs.map +1 -1
- package/dist/elements/ActionsMenuItem/ActionsMenuItem.d.ts +16 -0
- package/dist/elements/ActionsMenuItem/ActionsMenuItem.d.ts.map +1 -0
- package/dist/elements/ActionsMenuItem/ActionsMenuItem.mjs +51 -0
- package/dist/elements/ActionsMenuItem/ActionsMenuItem.mjs.map +1 -0
- package/dist/elements/TableHead/TableHead.d.ts +20 -0
- package/dist/elements/TableHead/TableHead.d.ts.map +1 -0
- package/dist/elements/TableHead/TableHead.mjs +58 -0
- package/dist/elements/TableHead/TableHead.mjs.map +1 -0
- package/dist/elements/TableLinkCell/TableLinkCell.d.ts +24 -0
- package/dist/elements/TableLinkCell/TableLinkCell.d.ts.map +1 -0
- package/dist/elements/TableLinkCell/TableLinkCell.mjs +87 -0
- package/dist/elements/TableLinkCell/TableLinkCell.mjs.map +1 -0
- package/dist/elements/TableTypeCell/TableTypeCell.d.ts +12 -0
- package/dist/elements/TableTypeCell/TableTypeCell.d.ts.map +1 -0
- package/dist/elements/TableTypeCell/TableTypeCell.mjs +37 -0
- package/dist/elements/TableTypeCell/TableTypeCell.mjs.map +1 -0
- package/dist/elements/index.d.ts +5 -1
- package/dist/elements/index.d.ts.map +1 -1
- package/dist/elements/index.mjs +18 -10
- package/dist/elements/index.mjs.map +1 -1
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.mjs +14 -8
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/hooks/useDetails.hook.d.ts +72 -0
- package/dist/hooks/useDetails.hook.d.ts.map +1 -0
- package/dist/hooks/useDetails.hook.mjs +204 -0
- package/dist/hooks/useDetails.hook.mjs.map +1 -0
- package/dist/hooks/useDetailsHeader.hook.d.ts +77 -0
- package/dist/hooks/useDetailsHeader.hook.d.ts.map +1 -0
- package/dist/hooks/useDetailsHeader.hook.mjs +219 -0
- package/dist/hooks/useDetailsHeader.hook.mjs.map +1 -0
- package/dist/hooks/useTable.hook.d.ts +60 -0
- package/dist/hooks/useTable.hook.d.ts.map +1 -0
- package/dist/hooks/useTable.hook.mjs +129 -0
- package/dist/hooks/useTable.hook.mjs.map +1 -0
- package/dist/images/add.svg.mjs +2 -3
- package/dist/images/add.svg.mjs.map +1 -1
- package/dist/images/add.svg2.mjs +6 -0
- package/dist/images/add.svg2.mjs.map +1 -0
- package/dist/images/cancel.svg +3 -0
- package/dist/images/copy-to-clipboard-icon.svg.mjs +6 -0
- package/dist/images/copy-to-clipboard-icon.svg.mjs.map +1 -0
- package/dist/images/elipsis.svg.mjs +6 -0
- package/dist/images/elipsis.svg.mjs.map +1 -0
- package/dist/images/history.svg.mjs +6 -0
- package/dist/images/history.svg.mjs.map +1 -0
- package/dist/images/ml-enlarge.svg.mjs +6 -0
- package/dist/images/ml-enlarge.svg.mjs.map +1 -0
- package/dist/images/ml-minimize.svg.mjs +6 -0
- package/dist/images/ml-minimize.svg.mjs.map +1 -0
- package/dist/images/refresh.svg.mjs +6 -0
- package/dist/images/refresh.svg.mjs.map +1 -0
- package/dist/images/unsuccess_alert.svg.mjs +6 -0
- package/dist/images/unsuccess_alert.svg.mjs.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +10 -8
- package/dist/index.mjs.map +1 -1
- package/dist/reducers/commonDetailsReducer.d.ts +12 -0
- package/dist/reducers/commonDetailsReducer.d.ts.map +1 -0
- package/dist/reducers/commonDetailsReducer.mjs +77 -0
- package/dist/reducers/commonDetailsReducer.mjs.map +1 -0
- package/dist/reducers/index.d.ts +3 -0
- package/dist/reducers/index.d.ts.map +1 -0
- package/dist/reducers/index.mjs +7 -0
- package/dist/reducers/index.mjs.map +1 -0
- package/dist/reducers/notificationReducer.d.ts +3 -0
- package/dist/reducers/notificationReducer.d.ts.map +1 -0
- package/dist/reducers/notificationReducer.mjs +21 -0
- package/dist/reducers/notificationReducer.mjs.map +1 -0
- package/dist/scss/common.scss +655 -0
- package/dist/scss/details.scss +376 -0
- package/dist/scss/mixins.scss +1 -1
- package/dist/scss/table.scss +283 -0
- package/dist/types.d.ts +6 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.mjs +89 -45
- package/dist/types.mjs.map +1 -1
- package/dist/utils/chips.util.d.ts +30 -0
- package/dist/utils/chips.util.d.ts.map +1 -0
- package/dist/utils/chips.util.mjs +75 -0
- package/dist/utils/chips.util.mjs.map +1 -0
- package/dist/utils/common.util.d.ts +5 -0
- package/dist/utils/common.util.d.ts.map +1 -1
- package/dist/utils/common.util.mjs +80 -33
- package/dist/utils/common.util.mjs.map +1 -1
- package/dist/utils/datetime.util.d.ts +9 -0
- package/dist/utils/datetime.util.d.ts.map +1 -0
- package/dist/utils/datetime.util.mjs +53 -0
- package/dist/utils/datetime.util.mjs.map +1 -0
- package/dist/utils/filter.util.d.ts +5 -0
- package/dist/utils/filter.util.d.ts.map +1 -0
- package/dist/utils/filter.util.mjs +23 -0
- package/dist/utils/filter.util.mjs.map +1 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.mjs +22 -12
- package/dist/utils/index.mjs.map +1 -1
- package/dist/utils/notification.util.d.ts +2 -0
- package/dist/utils/notification.util.d.ts.map +1 -0
- package/dist/utils/notification.util.mjs +17 -0
- package/dist/utils/notification.util.mjs.map +1 -0
- package/dist/utils/string.util.d.ts +6 -0
- package/dist/utils/string.util.d.ts.map +1 -0
- package/dist/utils/string.util.mjs +13 -0
- package/dist/utils/string.util.mjs.map +1 -0
- package/package.json +11 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChipForm.mjs","sources":["../../../src/lib/components/ChipForm/ChipForm.jsx"],"sourcesContent":["/*\nCopyright 2019 Iguazio Systems Ltd.\n\nLicensed under the Apache License, Version 2.0 (the \"License\") with\nan addition restriction as set forth herein. You may not use this\nfile except in compliance with the License. You may obtain a copy of\nthe License at http://www.apache.org/licenses/LICENSE-2.0.\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\nimplied. See the License for the specific language governing\npermissions and limitations under the License.\n\nIn addition, you may not use the software for any purposes that are\nillegal under applicable law, and the grant of the foregoing license\nunder the Apache 2.0 license is conditioned upon your compliance with\nsuch restriction.\n*/\nimport React, { useState, useCallback, useEffect, useLayoutEffect, useMemo, useRef } from 'react'\nimport PropTypes from 'prop-types'\nimport classnames from 'classnames'\nimport { isEmpty } from 'lodash'\n\nimport OptionsMenu from '../../elements/OptionsMenu/OptionsMenu'\nimport ValidationTemplate from '../../elements/ValidationTemplate/ValidationTemplate'\n\nimport { TAB, TAB_SHIFT } from '../../constants'\nimport { CHIP_OPTIONS } from '../../types'\n\nimport './chipForm.scss'\n\nlet ChipForm = (\n {\n checkValidation = null,\n chipOptions,\n className = '',\n editConfig,\n onChange,\n setEditConfig,\n validationRules = [],\n value\n },\n ref\n) => {\n const [chip, setChip] = useState({\n ...value,\n keyFieldWidth: 0,\n valueFieldWidth: 0\n })\n const maxWidthInput = useMemo(() => {\n return ref.current?.clientWidth - 50\n }, [ref])\n const { background, borderColor, density, font, borderRadius } = chipOptions\n const minWidthInput = 25\n const minWidthValueInput = 35\n\n const refInputKey = useRef()\n const refInputValue = useRef()\n const refInputContainer = useRef()\n\n const labelKeyClassName = classnames(\n className,\n !editConfig.isKeyFocused && 'item_edited',\n !isEmpty(validationRules) && 'item_edited_invalid'\n )\n const labelContainerClassName = classnames(\n 'edit-chip-container',\n background && `edit-chip-container-background_${background}`,\n borderColor && `edit-chip-container-border_${borderColor}`,\n font && `edit-chip-container-font_${font}`,\n density && `edit-chip-container-density_${density}`,\n borderRadius && `edit-chip-container-border_${borderRadius}`,\n (editConfig.isEdit || editConfig.isNewChip) && 'edit-chip-container_edited'\n )\n const labelValueClassName = classnames(\n 'input-label-value',\n !editConfig.isValueFocused && 'item_edited'\n )\n\n useLayoutEffect(() => {\n if (!chip.keyFieldWidth && !chip.valueFieldWidth) {\n const currentWidthKeyInput = refInputKey.current.scrollWidth + 1\n const currentWidthValueInput = refInputValue.current.scrollWidth + 1\n\n if (chip.key && chip.value) {\n setChip(prevState => ({\n ...prevState,\n keyFieldWidth:\n currentWidthKeyInput >= maxWidthInput ? maxWidthInput : currentWidthKeyInput,\n valueFieldWidth:\n currentWidthValueInput >= maxWidthInput ? maxWidthInput : currentWidthValueInput\n }))\n } else {\n setChip(prevState => ({\n ...prevState,\n keyFieldWidth: minWidthInput,\n valueFieldWidth: minWidthValueInput\n }))\n }\n }\n }, [\n chip.key,\n chip.keyFieldWidth,\n chip.value,\n chip.valueFieldWidth,\n maxWidthInput,\n refInputKey,\n refInputValue\n ])\n\n useEffect(() => {\n if (editConfig.isKeyFocused) {\n refInputKey.current.focus()\n } else if (editConfig.isValueFocused) {\n refInputValue.current.focus()\n }\n }, [editConfig.isKeyFocused, editConfig.isValueFocused, refInputKey, refInputValue])\n\n const outsideClick = useCallback(\n event => {\n event.stopPropagation()\n const elementPath = event.path ?? event.composedPath?.()\n\n if (!elementPath.includes(refInputContainer.current)) {\n onChange(event, chip, 'Click')\n }\n },\n [chip, onChange, refInputContainer]\n )\n\n useEffect(() => {\n if (editConfig.isEdit) {\n document.addEventListener('click', outsideClick, true)\n\n return () => {\n document.removeEventListener('click', outsideClick, true)\n }\n }\n }, [outsideClick, editConfig.isEdit])\n\n const focusChip = useCallback(\n event => {\n event.stopPropagation()\n\n if (!event.shiftKey && event.key === TAB && editConfig.isValueFocused) {\n onChange(event, chip, TAB)\n } else if (event.shiftKey && event.key === TAB && editConfig.isKeyFocused) {\n onChange(event, chip, TAB_SHIFT)\n }\n\n if (event.key === 'Backspace' || event.key === 'Delete') {\n setChip(prevState => ({\n ...prevState,\n keyFieldWidth: editConfig.isKeyFocused ? minWidthInput : prevState.keyFieldWidth,\n valueFieldWidth: editConfig.isValueFocused\n ? minWidthValueInput\n : prevState.valueFieldWidth\n }))\n }\n },\n [editConfig, onChange, chip]\n )\n\n const handleOnFocus = useCallback(\n event => {\n if (event.target.name === 'key') {\n refInputKey.current.selectionStart = refInputKey.current.selectionEnd\n\n setEditConfig(prevState => ({\n ...prevState,\n isKeyFocused: true,\n isValueFocused: false\n }))\n } else {\n refInputValue.current.selectionStart = refInputValue.current.selectionEnd\n\n setEditConfig(prevState => ({\n ...prevState,\n isKeyFocused: false,\n isValueFocused: true\n }))\n }\n },\n [refInputKey, refInputValue, setEditConfig]\n )\n\n const handleOnChange = useCallback(\n event => {\n event.preventDefault()\n\n if (event.target.name === 'key') {\n const currentWidthKeyInput = refInputKey.current.scrollWidth\n checkValidation && checkValidation(refInputKey.current.value)\n\n setChip(prevState => ({\n ...prevState,\n key: refInputKey.current.value,\n keyFieldWidth:\n refInputKey.current.value.length <= 1\n ? minWidthInput\n : currentWidthKeyInput >= maxWidthInput\n ? maxWidthInput\n : currentWidthKeyInput > minWidthInput\n ? currentWidthKeyInput + 2\n : minWidthInput\n }))\n } else {\n const currentWidthValueInput = refInputValue.current.scrollWidth\n\n setChip(prevState => ({\n ...prevState,\n value: refInputValue.current.value,\n valueFieldWidth:\n refInputValue.current.value.length <= 1\n ? minWidthValueInput\n : currentWidthValueInput >= maxWidthInput\n ? maxWidthInput\n : currentWidthValueInput > minWidthValueInput\n ? currentWidthValueInput + 2\n : minWidthValueInput\n }))\n }\n },\n [checkValidation, maxWidthInput, refInputKey, refInputValue]\n )\n\n const getValidationRules = useCallback(() => {\n return validationRules.map(({ isValid = false, label, name }) => {\n return <ValidationTemplate valid={isValid} validationMessage={label} key={name} />\n })\n }, [validationRules])\n\n return (\n <>\n <div\n ref={refInputContainer}\n className={labelContainerClassName}\n onKeyDown={event => editConfig.isEdit && focusChip(event)}\n >\n <input\n autoComplete=\"off\"\n className={labelKeyClassName}\n name=\"key\"\n style={{ width: chip.keyFieldWidth }}\n onChange={handleOnChange}\n onFocus={handleOnFocus}\n placeholder=\"key\"\n ref={refInputKey}\n type=\"text\"\n value={chip.key}\n />\n <div className=\"edit-chip-separator\">:</div>\n <input\n autoComplete=\"off\"\n className={labelValueClassName}\n name=\"value\"\n onChange={handleOnChange}\n onFocus={handleOnFocus}\n placeholder=\"value\"\n ref={refInputValue}\n style={{ width: chip.valueFieldWidth }}\n type=\"text\"\n value={chip.value}\n />\n </div>\n {validationRules.length > 0 && (\n <OptionsMenu show={validationRules.length > 0} ref={{ refInputContainer }}>\n {getValidationRules()}\n </OptionsMenu>\n )}\n </>\n )\n}\n\nChipForm = React.forwardRef(ChipForm)\n\nChipForm.displayName = 'ChipForm'\n\nChipForm.propTypes = {\n checkValidation: PropTypes.func,\n chipOptions: CHIP_OPTIONS.isRequired,\n className: PropTypes.string,\n editConfig: PropTypes.object.isRequired,\n onChange: PropTypes.func.isRequired,\n setEditConfig: PropTypes.func.isRequired,\n validationRules: PropTypes.array,\n value: PropTypes.object.isRequired\n}\n\nexport default ChipForm\n"],"names":["ChipForm","checkValidation","chipOptions","className","editConfig","onChange","setEditConfig","validationRules","value","ref","chip","setChip","useState","maxWidthInput","useMemo","_a","background","borderColor","density","font","borderRadius","minWidthInput","minWidthValueInput","refInputKey","useRef","refInputValue","refInputContainer","labelKeyClassName","classnames","isEmpty","labelContainerClassName","labelValueClassName","useLayoutEffect","currentWidthKeyInput","currentWidthValueInput","prevState","useEffect","outsideClick","useCallback","event","focusChip","TAB","TAB_SHIFT","handleOnFocus","handleOnChange","getValidationRules","isValid","label","name","ValidationTemplate","jsxs","Fragment","jsx","OptionsMenu","React","PropTypes","CHI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;AAAA,cACL,UAAUa;AAAA,cACV,SAASD;AAAA,cACT,aAAY;AAAA,cACZ,KAAKlB;AAAA,cACL,OAAO,EAAE,OAAOf,EAAK,gBAAgB;AAAA,cACrC,MAAK;AAAA,cACL,OAAOA,EAAK;AAAA,YAAA;AAAA,UAAA;AAAA,QACd;AAAA,MAAA;AAAA,IACF;AAAA,IACCH,EAAgB,SAAS,KACxB,gBAAA6C,EAACC,KAAY,MAAM9C,EAAgB,SAAS,GAAG,KAAK,EAAE,mBAAAmB,EAAkB,GACrE,cACH,CAAA;AAAA,EAAA,GAEJ;AAEJ;AAEA1B,IAAWsD,EAAM,WAAWtD,CAAQ;AAEpCA,EAAS,cAAc;AAEvBA,EAAS,YAAY;AAAA,EACnB,iBAAiBuD,EAAU;AAAA,EAC3B,aAAaC,EAAa;AAAA,EAC1B,WAAWD,EAAU;AAAA,EACrB,YAAYA,EAAU,OAAO;AAAA,EAC7B,UAAUA,EAAU,KAAK;AAAA,EACzB,eAAeA,EAAU,KAAK;AAAA,EAC9B,iBAAiBA,EAAU;AAAA,EAC3B,OAAOA,EAAU,OAAO;AAC1B;AAEA,MAAAE,KAAezD;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export default CopyToClipboard;
|
|
2
|
+
declare function CopyToClipboard({ children, className, disabled, textToCopy, tooltipText }: {
|
|
3
|
+
children?: any;
|
|
4
|
+
className?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
textToCopy?: string;
|
|
7
|
+
tooltipText: any;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
declare namespace CopyToClipboard {
|
|
10
|
+
namespace propTypes {
|
|
11
|
+
let children: any;
|
|
12
|
+
let className: any;
|
|
13
|
+
let disabled: any;
|
|
14
|
+
let textToCopy: any;
|
|
15
|
+
let tooltipText: any;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=CopyToClipboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CopyToClipboard.d.ts","sourceRoot":"","sources":["../../../src/lib/components/CopyToClipboard/CopyToClipboard.jsx"],"names":[],"mappings":";AAgCA;;;;;;gCA4CC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import o from "prop-types";
|
|
3
|
+
import { useMemo as d } from "react";
|
|
4
|
+
import { useDispatch as f } from "react-redux";
|
|
5
|
+
import u from "../RoundedIcon/RoundedIcon.mjs";
|
|
6
|
+
import b from "../TooltipTemplate/TextTooltipTemplate.mjs";
|
|
7
|
+
import h from "../Tooltip/Tooltip.mjs";
|
|
8
|
+
import { setNotification as y } from "../../reducers/notificationReducer.mjs";
|
|
9
|
+
import { showErrorNotification as T } from "../../utils/notification.util.mjs";
|
|
10
|
+
import g from "../../images/copy-to-clipboard-icon.svg.mjs";
|
|
11
|
+
const C = ({
|
|
12
|
+
children: i = null,
|
|
13
|
+
className: l = "",
|
|
14
|
+
disabled: e = !1,
|
|
15
|
+
textToCopy: r = "",
|
|
16
|
+
tooltipText: p
|
|
17
|
+
}) => {
|
|
18
|
+
const s = f(), c = d(() => e || !r, [e, r]), a = (m) => {
|
|
19
|
+
navigator.clipboard.writeText(m).then(() => {
|
|
20
|
+
s(
|
|
21
|
+
y({
|
|
22
|
+
status: 200,
|
|
23
|
+
id: Math.random(),
|
|
24
|
+
message: "Copied to clipboard successfully"
|
|
25
|
+
})
|
|
26
|
+
);
|
|
27
|
+
}).catch((n) => {
|
|
28
|
+
T(s, n, "", "Copy to clipboard failed");
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
return /* @__PURE__ */ t("div", { className: l, "data-testid": "copy-to-clipboard", children: i ? /* @__PURE__ */ t(h, { template: /* @__PURE__ */ t(b, { text: p }), textShow: !0, children: /* @__PURE__ */ t("span", { onClick: () => a(r), children: i }) }) : /* @__PURE__ */ t(
|
|
32
|
+
u,
|
|
33
|
+
{
|
|
34
|
+
tooltipText: p,
|
|
35
|
+
onClick: () => a(r),
|
|
36
|
+
disabled: c,
|
|
37
|
+
children: /* @__PURE__ */ t(g, {})
|
|
38
|
+
}
|
|
39
|
+
) });
|
|
40
|
+
};
|
|
41
|
+
C.propTypes = {
|
|
42
|
+
children: o.oneOfType([o.string, o.array, o.element]),
|
|
43
|
+
className: o.string,
|
|
44
|
+
disabled: o.bool,
|
|
45
|
+
textToCopy: o.string,
|
|
46
|
+
tooltipText: o.string.isRequired
|
|
47
|
+
};
|
|
48
|
+
export {
|
|
49
|
+
C as default
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=CopyToClipboard.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CopyToClipboard.mjs","sources":["../../../src/lib/components/CopyToClipboard/CopyToClipboard.jsx"],"sourcesContent":["/*\nCopyright 2019 Iguazio Systems Ltd.\n\nLicensed under the Apache License, Version 2.0 (the \"License\") with\nan addition restriction as set forth herein. You may not use this\nfile except in compliance with the License. You may obtain a copy of\nthe License at http://www.apache.org/licenses/LICENSE-2.0.\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\nimplied. See the License for the specific language governing\npermissions and limitations under the License.\n\nIn addition, you may not use the software for any purposes that are\nillegal under applicable law, and the grant of the foregoing license\nunder the Apache 2.0 license is conditioned upon your compliance with\nsuch restriction.\n*/\nimport PropTypes from 'prop-types'\nimport { useMemo } from 'react'\nimport { useDispatch } from 'react-redux'\n\nimport RoundedIcon from '../RoundedIcon/RoundedIcon'\nimport TextTooltipTemplate from '../TooltipTemplate/TextTooltipTemplate'\nimport Tooltip from '../Tooltip/Tooltip'\n\nimport { setNotification } from '../../reducers/notificationReducer'\nimport { showErrorNotification } from '../../utils/notification.util'\n\nimport Copy from '../../images/copy-to-clipboard-icon.svg?react'\n\nconst CopyToClipboard = ({\n children = null,\n className = '',\n disabled = false,\n textToCopy = '',\n tooltipText\n}) => {\n const dispatch = useDispatch()\n const copyIsDisabled = useMemo(() => disabled || !textToCopy, [disabled, textToCopy])\n\n const copyToClipboard = textToCopy => {\n navigator.clipboard\n .writeText(textToCopy)\n .then(() => {\n dispatch(\n setNotification({\n status: 200,\n id: Math.random(),\n message: 'Copied to clipboard successfully'\n })\n )\n })\n .catch(error => {\n showErrorNotification(dispatch, error, '', 'Copy to clipboard failed')\n })\n }\n\n return (\n <div className={className} data-testid=\"copy-to-clipboard\">\n {children ? (\n <Tooltip template={<TextTooltipTemplate text={tooltipText} />} textShow>\n <span onClick={() => copyToClipboard(textToCopy)}>{children}</span>\n </Tooltip>\n ) : (\n <RoundedIcon\n tooltipText={tooltipText}\n onClick={() => copyToClipboard(textToCopy)}\n disabled={copyIsDisabled}\n >\n <Copy />\n </RoundedIcon>\n )}\n </div>\n )\n}\n\nCopyToClipboard.propTypes = {\n children: PropTypes.oneOfType([PropTypes.string, PropTypes.array, PropTypes.element]),\n className: PropTypes.string,\n disabled: PropTypes.bool,\n textToCopy: PropTypes.string,\n tooltipText: PropTypes.string.isRequired\n}\n\nexport default CopyToClipboard\n"],"names":["CopyToClipboard","children","className","disabled","textToCopy","tooltipText","dispatch","useDispatch","copyIsDisabled","useMemo","copyToClipboard","setNotification","error","showErrorNotification","jsx","Tooltip","TextTooltipTemplate","RoundedIcon","Copy","PropTypes"],"mappings":";;;;;;;;;;AAgCA,MAAMA,IAAkB,CAAC;AAAA,EACvB,UAAAC,IAAW;AAAA,EACX,WAAAC,IAAY;AAAA,EACZ,UAAAC,IAAW;AAAA,EACX,YAAAC,IAAa;AAAA,EACb,aAAAC;AACF,MAAM;AACJ,QAAMC,IAAWC,EAAY,GACvBC,IAAiBC,EAAQ,MAAMN,KAAY,CAACC,GAAY,CAACD,GAAUC,CAAU,CAAC,GAE9EM,IAAkB,CAAAN,MAAc;AACpC,cAAU,UACP,UAAUA,CAAU,EACpB,KAAK,MAAM;AACV,MAAAE;AAAA,QACEK,EAAgB;AAAA,UACd,QAAQ;AAAA,UACR,IAAI,KAAK,OAAO;AAAA,UAChB,SAAS;AAAA,QACV,CAAA;AAAA,MACH;AAAA,IAAA,CACD,EACA,MAAM,CAASC,MAAA;AACQ,MAAAC,EAAAP,GAAUM,GAAO,IAAI,0BAA0B;AAAA,IAAA,CACtE;AAAA,EACL;AAGE,SAAA,gBAAAE,EAAC,OAAI,EAAA,WAAAZ,GAAsB,eAAY,qBACpC,cACE,gBAAAY,EAAAC,GAAA,EAAQ,UAAU,gBAAAD,EAACE,GAAoB,EAAA,MAAMX,EAAa,CAAA,GAAI,UAAQ,IACrE,UAAA,gBAAAS,EAAC,QAAK,EAAA,SAAS,MAAMJ,EAAgBN,CAAU,GAAI,UAAAH,EAAS,CAAA,EAAA,CAC9D,IAEA,gBAAAa;AAAA,IAACG;AAAA,IAAA;AAAA,MACC,aAAAZ;AAAA,MACA,SAAS,MAAMK,EAAgBN,CAAU;AAAA,MACzC,UAAUI;AAAA,MAEV,4BAACU,GAAK,CAAA,CAAA;AAAA,IAAA;AAAA,EAAA,GAGZ;AAEJ;AAEAlB,EAAgB,YAAY;AAAA,EAC1B,UAAUmB,EAAU,UAAU,CAACA,EAAU,QAAQA,EAAU,OAAOA,EAAU,OAAO,CAAC;AAAA,EACpF,WAAWA,EAAU;AAAA,EACrB,UAAUA,EAAU;AAAA,EACpB,YAAYA,EAAU;AAAA,EACtB,aAAaA,EAAU,OAAO;AAChC;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default ErrorMessage;
|
|
2
|
+
declare function ErrorMessage({ closeError, message }: {
|
|
3
|
+
closeError?: any;
|
|
4
|
+
message: any;
|
|
5
|
+
}): JSX.Element;
|
|
6
|
+
declare namespace ErrorMessage {
|
|
7
|
+
namespace propTypes {
|
|
8
|
+
let closeError: any;
|
|
9
|
+
let message: any;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=ErrorMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorMessage.d.ts","sourceRoot":"","sources":["../../../src/lib/components/ErrorMessage/ErrorMessage.jsx"],"names":[],"mappings":";AA8BA;;;gBAkBC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsxs as o, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import s from "prop-types";
|
|
4
|
+
import i from "../Tooltip/Tooltip.mjs";
|
|
5
|
+
import m from "../TooltipTemplate/TextTooltipTemplate.mjs";
|
|
6
|
+
import a from "../../images/unsuccess_alert.svg.mjs";
|
|
7
|
+
import l from "../../images/close.svg.mjs";
|
|
8
|
+
/* empty css */
|
|
9
|
+
const p = ({ closeError: e = null, message: t }) => /* @__PURE__ */ o("div", { "data-testid": "error-message", className: "error", children: [
|
|
10
|
+
/* @__PURE__ */ o("div", { className: "error__data", children: [
|
|
11
|
+
/* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(a, { className: "error__icon" }) }),
|
|
12
|
+
/* @__PURE__ */ r("div", { className: "error__message", children: t })
|
|
13
|
+
] }),
|
|
14
|
+
e && /* @__PURE__ */ r("button", { "data-testid": "close", onClick: e, children: /* @__PURE__ */ r(i, { template: /* @__PURE__ */ r(m, { text: "Close" }), children: /* @__PURE__ */ r(l, {}) }) })
|
|
15
|
+
] });
|
|
16
|
+
p.propTypes = {
|
|
17
|
+
closeError: s.func,
|
|
18
|
+
message: s.string.isRequired
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
p as default
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=ErrorMessage.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorMessage.mjs","sources":["../../../src/lib/components/ErrorMessage/ErrorMessage.jsx"],"sourcesContent":["/*\nCopyright 2019 Iguazio Systems Ltd.\n\nLicensed under the Apache License, Version 2.0 (the \"License\") with\nan addition restriction as set forth herein. You may not use this\nfile except in compliance with the License. You may obtain a copy of\nthe License at http://www.apache.org/licenses/LICENSE-2.0.\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\nimplied. See the License for the specific language governing\npermissions and limitations under the License.\n\nIn addition, you may not use the software for any purposes that are\nillegal under applicable law, and the grant of the foregoing license\nunder the Apache 2.0 license is conditioned upon your compliance with\nsuch restriction.\n*/\nimport React from 'react'\nimport PropTypes from 'prop-types'\n\nimport Tooltip from '../Tooltip/Tooltip'\nimport TextTooltipTemplate from '../TooltipTemplate/TextTooltipTemplate'\n\nimport UnsuccessAlert from '../../images/unsuccess_alert.svg?react'\nimport Close from '../../images/close.svg?react'\n\nimport './errorMessage.scss'\n\nconst ErrorMessage = ({ closeError = null, message }) => {\n return (\n <div data-testid=\"error-message\" className=\"error\">\n <div className=\"error__data\">\n <div>\n <UnsuccessAlert className=\"error__icon\" />\n </div>\n <div className=\"error__message\">{message}</div>\n </div>\n {closeError && (\n <button data-testid=\"close\" onClick={closeError}>\n <Tooltip template={<TextTooltipTemplate text=\"Close\" />}>\n <Close />\n </Tooltip>\n </button>\n )}\n </div>\n )\n}\n\nErrorMessage.propTypes = {\n closeError: PropTypes.func,\n message: PropTypes.string.isRequired\n}\n\nexport default ErrorMessage\n"],"names":["ErrorMessage","closeError","message","jsxs","jsx","UnsuccessAlert","Tooltip","TextTooltipTemplate","Close","PropTypes"],"mappings":";;;;;;;;AA8BA,MAAMA,IAAe,CAAC,EAAE,YAAAC,IAAa,MAAM,SAAAC,QAEtC,gBAAAC,EAAA,OAAA,EAAI,eAAY,iBAAgB,WAAU,SACzC,UAAA;AAAA,EAAC,gBAAAA,EAAA,OAAA,EAAI,WAAU,eACb,UAAA;AAAA,IAAA,gBAAAC,EAAC,OACC,EAAA,UAAA,gBAAAA,EAACC,GAAe,EAAA,WAAU,cAAc,CAAA,GAC1C;AAAA,IACC,gBAAAD,EAAA,OAAA,EAAI,WAAU,kBAAkB,UAAQF,EAAA,CAAA;AAAA,EAAA,GAC3C;AAAA,EACCD,KACE,gBAAAG,EAAA,UAAA,EAAO,eAAY,SAAQ,SAASH,GACnC,UAAC,gBAAAG,EAAAE,GAAA,EAAQ,UAAU,gBAAAF,EAACG,KAAoB,MAAK,QAAQ,CAAA,GACnD,UAAC,gBAAAH,EAAAI,GAAA,CAAM,CAAA,EACT,CAAA,EACF,CAAA;AAAA,GAEJ;AAIJR,EAAa,YAAY;AAAA,EACvB,YAAYS,EAAU;AAAA,EACtB,SAASA,EAAU,OAAO;AAC5B;"}
|
|
@@ -11,7 +11,7 @@ import X from "../Tooltip/Tooltip.mjs";
|
|
|
11
11
|
import { CHIP_OPTIONS as Y } from "../../types.mjs";
|
|
12
12
|
import { isEveryObjectValueEmpty as Z } from "../../utils/common.util.mjs";
|
|
13
13
|
import { uniquenessError as g } from "./formChipCell.util.mjs";
|
|
14
|
-
import O from "../../images/add.
|
|
14
|
+
import O from "../../images/add.svg2.mjs";
|
|
15
15
|
let n = ({
|
|
16
16
|
chipOptions: e = {
|
|
17
17
|
background: "purple",
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export default LoadButton;
|
|
2
|
+
declare function LoadButton({ className, label, variant, ...restProps }: {
|
|
3
|
+
[x: string]: any;
|
|
4
|
+
className?: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
variant?: string;
|
|
7
|
+
}, ref: any): JSX.Element;
|
|
8
|
+
declare namespace LoadButton {
|
|
9
|
+
let displayName: string;
|
|
10
|
+
namespace propTypes {
|
|
11
|
+
let className: any;
|
|
12
|
+
let label: any;
|
|
13
|
+
let variant: any;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=LoadButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadButton.d.ts","sourceRoot":"","sources":["../../../src/lib/components/LoadButton/LoadButton.jsx"],"names":[],"mappings":";AA2BA;;;;;0BAWC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import i from "react";
|
|
3
|
+
import t from "prop-types";
|
|
4
|
+
import d from "classnames";
|
|
5
|
+
import { TERTIARY_BUTTON as a, PRIMARY_BUTTON as f, SECONDARY_BUTTON as T } from "../../constants.mjs";
|
|
6
|
+
/* empty css */
|
|
7
|
+
let o = ({ className: e = "", label: r = "Load button", variant: n = a, ...s }, m) => {
|
|
8
|
+
const l = d("btn-load", `btn-load-${n}`, e);
|
|
9
|
+
return /* @__PURE__ */ p("button", { ref: m, ...s, className: l, children: r });
|
|
10
|
+
};
|
|
11
|
+
o = i.forwardRef(o);
|
|
12
|
+
o.displayName = "LoadButton";
|
|
13
|
+
o.propTypes = {
|
|
14
|
+
className: t.string,
|
|
15
|
+
label: t.oneOfType([t.string, t.element]),
|
|
16
|
+
variant: t.oneOf([f, T, a]).isRequired
|
|
17
|
+
};
|
|
18
|
+
const O = o;
|
|
19
|
+
export {
|
|
20
|
+
O as default
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=LoadButton.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadButton.mjs","sources":["../../../src/lib/components/LoadButton/LoadButton.jsx"],"sourcesContent":["/*\nCopyright 2019 Iguazio Systems Ltd.\n\nLicensed under the Apache License, Version 2.0 (the \"License\") with\nan addition restriction as set forth herein. You may not use this\nfile except in compliance with the License. You may obtain a copy of\nthe License at http://www.apache.org/licenses/LICENSE-2.0.\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\nimplied. See the License for the specific language governing\npermissions and limitations under the License.\n\nIn addition, you may not use the software for any purposes that are\nillegal under applicable law, and the grant of the foregoing license\nunder the Apache 2.0 license is conditioned upon your compliance with\nsuch restriction.\n*/\nimport React from 'react'\nimport PropTypes from 'prop-types'\nimport classNames from 'classnames'\n\nimport { PRIMARY_BUTTON, SECONDARY_BUTTON, TERTIARY_BUTTON } from '../../constants'\n\nimport './loadButton.scss'\n\nlet LoadButton = (\n { className = '', label = 'Load button', variant = TERTIARY_BUTTON, ...restProps },\n ref\n) => {\n const buttonClassName = classNames('btn-load', `btn-load-${variant}`, className)\n\n return (\n <button ref={ref} {...restProps} className={buttonClassName}>\n {label}\n </button>\n )\n}\n\nLoadButton = React.forwardRef(LoadButton)\n\nLoadButton.displayName = 'LoadButton'\n\nLoadButton.propTypes = {\n className: PropTypes.string,\n label: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n variant: PropTypes.oneOf([PRIMARY_BUTTON, SECONDARY_BUTTON, TERTIARY_BUTTON]).isRequired\n}\n\nexport default LoadButton\n"],"names":["LoadButton","className","label","variant","TERTIARY_BUTTON","restProps","ref","buttonClassName","classNames","React","PropTypes","PRIMARY_BUTTON","SECONDARY_BUTTON","LoadButton$1"],"mappings":";;;;;;AA2BA,IAAIA,IAAa,CACf,EAAE,WAAAC,IAAY,IAAI,OAAAC,IAAQ,eAAe,SAAAC,IAAUC,GAAiB,GAAGC,EAAU,GACjFC,MACG;AACH,QAAMC,IAAkBC,EAAW,YAAY,YAAYL,CAAO,IAAIF,CAAS;AAE/E,2BACG,UAAO,EAAA,KAAAK,GAAW,GAAGD,GAAW,WAAWE,GACzC,UACHL,GAAA;AAEJ;AAEAF,IAAaS,EAAM,WAAWT,CAAU;AAExCA,EAAW,cAAc;AAEzBA,EAAW,YAAY;AAAA,EACrB,WAAWU,EAAU;AAAA,EACrB,OAAOA,EAAU,UAAU,CAACA,EAAU,QAAQA,EAAU,OAAO,CAAC;AAAA,EAChE,SAASA,EAAU,MAAM,CAACC,GAAgBC,GAAkBR,CAAe,CAAC,EAAE;AAChF;AAEA,MAAAS,IAAeb;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export let title: string;
|
|
3
|
+
export { LoadButton as component };
|
|
4
|
+
}
|
|
5
|
+
export default _default;
|
|
6
|
+
export const PrimaryLoader: any;
|
|
7
|
+
export const SecondaryLoader: any;
|
|
8
|
+
export const TertiaryLoader: any;
|
|
9
|
+
import LoadButton from './LoadButton';
|
|
10
|
+
//# sourceMappingURL=LoadButton.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadButton.stories.d.ts","sourceRoot":"","sources":["../../../src/lib/components/LoadButton/LoadButton.stories.js"],"names":[],"mappings":";;;;;AAoCA,gCAA8C;AAO9C,kCAAgD;AAOhD,iCAA+C;uBA7BxB,cAAc"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Loader.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Loader/Loader.jsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import d from "react";
|
|
3
|
+
import m from "classnames";
|
|
4
|
+
import o from "prop-types";
|
|
5
|
+
/* empty css */
|
|
6
|
+
const e = ({ secondary: r = !1, section: s = !1, small: l = !1 }) => {
|
|
7
|
+
const t = m(
|
|
8
|
+
"loader-wrapper",
|
|
9
|
+
s && "section-loader",
|
|
10
|
+
l && "small-loader",
|
|
11
|
+
r && "secondary-loader"
|
|
12
|
+
);
|
|
13
|
+
return /* @__PURE__ */ a("div", { className: t, "data-testid": "loader", children: /* @__PURE__ */ a("div", { className: "loader" }) });
|
|
14
|
+
};
|
|
15
|
+
e.propTypes = {
|
|
16
|
+
secondary: o.bool,
|
|
17
|
+
section: o.bool,
|
|
18
|
+
small: o.bool
|
|
19
|
+
};
|
|
20
|
+
const y = d.memo(e);
|
|
21
|
+
export {
|
|
22
|
+
y as default
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=Loader.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Loader.mjs","sources":["../../../src/lib/components/Loader/Loader.jsx"],"sourcesContent":["/*\nCopyright 2019 Iguazio Systems Ltd.\n\nLicensed under the Apache License, Version 2.0 (the \"License\") with\nan addition restriction as set forth herein. You may not use this\nfile except in compliance with the License. You may obtain a copy of\nthe License at http://www.apache.org/licenses/LICENSE-2.0.\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\nimplied. See the License for the specific language governing\npermissions and limitations under the License.\n\nIn addition, you may not use the software for any purposes that are\nillegal under applicable law, and the grant of the foregoing license\nunder the Apache 2.0 license is conditioned upon your compliance with\nsuch restriction.\n*/\nimport React from 'react'\nimport classnames from 'classnames'\nimport PropTypes from 'prop-types'\n\nimport './loader.scss'\n\nconst Loader = ({ secondary = false, section = false, small = false }) => {\n const wrapperClassNames = classnames(\n 'loader-wrapper',\n section && 'section-loader',\n small && 'small-loader',\n secondary && 'secondary-loader'\n )\n\n return (\n <div className={wrapperClassNames} data-testid=\"loader\">\n <div className=\"loader\" />\n </div>\n )\n}\n\nLoader.propTypes = {\n secondary: PropTypes.bool,\n section: PropTypes.bool,\n small: PropTypes.bool\n}\n\nexport default React.memo(Loader)\n"],"names":["Loader","secondary","section","small","wrapperClassNames","classnames","jsx","PropTypes","Loader$1","React"],"mappings":";;;;;AAyBA,MAAMA,IAAS,CAAC,EAAE,WAAAC,IAAY,IAAO,SAAAC,IAAU,IAAO,OAAAC,IAAQ,SAAY;AACxE,QAAMC,IAAoBC;AAAA,IACxB;AAAA,IACAH,KAAW;AAAA,IACXC,KAAS;AAAA,IACTF,KAAa;AAAA,EACf;AAGE,SAAA,gBAAAK,EAAC,OAAI,EAAA,WAAWF,GAAmB,eAAY,UAC7C,UAAC,gBAAAE,EAAA,OAAA,EAAI,WAAU,SAAA,CAAS,EAC1B,CAAA;AAEJ;AAEAN,EAAO,YAAY;AAAA,EACjB,WAAWO,EAAU;AAAA,EACrB,SAASA,EAAU;AAAA,EACnB,OAAOA,EAAU;AACnB;AAEA,MAAAC,IAAeC,EAAM,KAAKT,CAAM;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoaderForSuspenseFallback.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Loader/LoaderForSuspenseFallback.jsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import o, { useLayoutEffect as r } from "react";
|
|
3
|
+
import s from "./Loader.mjs";
|
|
4
|
+
const l = () => (r(() => {
|
|
5
|
+
const e = document.getElementById("overlay_container"), t = e ? e.style.visibility : "visible";
|
|
6
|
+
return e && (e.style.visibility = "hidden"), () => {
|
|
7
|
+
e && (e.style.visibility = t);
|
|
8
|
+
};
|
|
9
|
+
}, []), /* @__PURE__ */ i(s, {})), c = o.memo(l);
|
|
10
|
+
export {
|
|
11
|
+
c as default
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=LoaderForSuspenseFallback.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoaderForSuspenseFallback.mjs","sources":["../../../src/lib/components/Loader/LoaderForSuspenseFallback.jsx"],"sourcesContent":["/*\nCopyright 2019 Iguazio Systems Ltd.\n\nLicensed under the Apache License, Version 2.0 (the \"License\") with\nan addition restriction as set forth herein. You may not use this\nfile except in compliance with the License. You may obtain a copy of\nthe License at http://www.apache.org/licenses/LICENSE-2.0.\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\nimplied. See the License for the specific language governing\npermissions and limitations under the License.\n\nIn addition, you may not use the software for any purposes that are\nillegal under applicable law, and the grant of the foregoing license\nunder the Apache 2.0 license is conditioned upon your compliance with\nsuch restriction.\n*/\nimport React, { useLayoutEffect } from 'react'\n\nimport Loader from './Loader'\n\nconst LoaderForSuspenseFallback = () => {\n useLayoutEffect(() => {\n const overlayContainer = document.getElementById('overlay_container')\n const savedVisibilityStyle = overlayContainer ? overlayContainer.style.visibility : 'visible'\n\n if (overlayContainer) overlayContainer.style.visibility = 'hidden'\n\n return () => {\n if (overlayContainer) overlayContainer.style.visibility = savedVisibilityStyle\n }\n }, [])\n\n return <Loader />\n}\n\nexport default React.memo(LoaderForSuspenseFallback)\n"],"names":["LoaderForSuspenseFallback","useLayoutEffect","overlayContainer","savedVisibilityStyle","Loader","LoaderForSuspenseFallback$1","React"],"mappings":";;;AAuBA,MAAMA,IAA4B,OAChCC,EAAgB,MAAM;AACd,QAAAC,IAAmB,SAAS,eAAe,mBAAmB,GAC9DC,IAAuBD,IAAmBA,EAAiB,MAAM,aAAa;AAEhF,SAAAA,MAAmCA,EAAA,MAAM,aAAa,WAEnD,MAAM;AACP,IAAAA,MAAmCA,EAAA,MAAM,aAAaC;AAAA,EAC5D;AACF,GAAG,EAAE,qBAEGC,GAAO,EAAA,IAGjBC,IAAeC,EAAM,KAAKN,CAAyB;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export default TableCell;
|
|
2
|
+
declare function TableCell({ cellData, className, firstCell, item, link, onClick, selectItem, selectedItem, showExpandButton, toggleRow }: {
|
|
3
|
+
cellData: any;
|
|
4
|
+
className?: string;
|
|
5
|
+
firstCell?: boolean;
|
|
6
|
+
item: any;
|
|
7
|
+
link?: string;
|
|
8
|
+
onClick?: any;
|
|
9
|
+
selectItem?: () => void;
|
|
10
|
+
selectedItem?: {};
|
|
11
|
+
showExpandButton?: boolean;
|
|
12
|
+
toggleRow?: any;
|
|
13
|
+
}): JSX.Element;
|
|
14
|
+
declare namespace TableCell {
|
|
15
|
+
namespace propTypes {
|
|
16
|
+
let cellData: any;
|
|
17
|
+
let className: any;
|
|
18
|
+
let firstCell: any;
|
|
19
|
+
let item: any;
|
|
20
|
+
let link: any;
|
|
21
|
+
let onClick: any;
|
|
22
|
+
let selectItem: any;
|
|
23
|
+
let selectedItem: any;
|
|
24
|
+
let showExpandButton: any;
|
|
25
|
+
let toggleRow: any;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=TableCell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableCell.d.ts","sourceRoot":"","sources":["../../../src/lib/components/TableCell/TableCell.jsx"],"names":[],"mappings":";AAkCA;;;;;;;;;;;gBAyHC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { jsx as t, jsxs as C } from "react/jsx-runtime";
|
|
2
|
+
import { cloneElement as T } from "react";
|
|
3
|
+
import s from "prop-types";
|
|
4
|
+
import c from "classnames";
|
|
5
|
+
import j from "../ChipCell/ChipCell.mjs";
|
|
6
|
+
import I from "../../elements/TableLinkCell/TableLinkCell.mjs";
|
|
7
|
+
import O from "../../elements/TableTypeCell/TableTypeCell.mjs";
|
|
8
|
+
import i from "../TooltipTemplate/TextTooltipTemplate.mjs";
|
|
9
|
+
import p from "../Tooltip/Tooltip.mjs";
|
|
10
|
+
import { getChipOptions as A } from "../../utils/chips.util.mjs";
|
|
11
|
+
import { truncateUid as L } from "../../utils/string.util.mjs";
|
|
12
|
+
import _ from "../../images/arrow.svg.mjs";
|
|
13
|
+
const g = ({
|
|
14
|
+
cellData: e,
|
|
15
|
+
className: m = "",
|
|
16
|
+
firstCell: h = !1,
|
|
17
|
+
item: r,
|
|
18
|
+
link: l = "",
|
|
19
|
+
onClick: d = null,
|
|
20
|
+
selectItem: y = () => {
|
|
21
|
+
},
|
|
22
|
+
selectedItem: N = {},
|
|
23
|
+
showExpandButton: a = !1,
|
|
24
|
+
toggleRow: u = null
|
|
25
|
+
}) => {
|
|
26
|
+
const { value: b, label: f, className: v } = r.state ?? {}, o = c(
|
|
27
|
+
"table-body__cell",
|
|
28
|
+
e.className,
|
|
29
|
+
m,
|
|
30
|
+
e.bodyCellClassName,
|
|
31
|
+
d && "link"
|
|
32
|
+
);
|
|
33
|
+
return e.template ? T(e.template, {
|
|
34
|
+
className: m
|
|
35
|
+
}) : l && e.type !== "hidden" ? /* @__PURE__ */ t(
|
|
36
|
+
I,
|
|
37
|
+
{
|
|
38
|
+
className: m,
|
|
39
|
+
cellData: e,
|
|
40
|
+
item: r,
|
|
41
|
+
link: l,
|
|
42
|
+
selectItem: y,
|
|
43
|
+
selectedItem: N,
|
|
44
|
+
showExpandButton: a,
|
|
45
|
+
toggleRow: u
|
|
46
|
+
}
|
|
47
|
+
) : h && !l ? /* @__PURE__ */ C(
|
|
48
|
+
"td",
|
|
49
|
+
{
|
|
50
|
+
onClick: () => e.value && d && d(e.value),
|
|
51
|
+
className: o,
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ t("div", { className: "data-ellipsis", children: e && /* @__PURE__ */ t(
|
|
54
|
+
p,
|
|
55
|
+
{
|
|
56
|
+
template: /* @__PURE__ */ t(i, { text: e.tooltip || e.value || "" }),
|
|
57
|
+
children: e.value
|
|
58
|
+
}
|
|
59
|
+
) }),
|
|
60
|
+
r.state && b && f && /* @__PURE__ */ t(p, { className: "status", template: /* @__PURE__ */ t(i, { text: f }), children: /* @__PURE__ */ t("i", { className: v }) }),
|
|
61
|
+
!r.state && r.status && /* @__PURE__ */ t(p, { className: "status", template: /* @__PURE__ */ t(i, { text: r.status }), children: /* @__PURE__ */ t("i", { className: `${r.status[0].toLowerCase()}${r.status.slice(1)}` }) }),
|
|
62
|
+
a && /* @__PURE__ */ t(_, { onClick: (n) => u && u(n, r), className: "expand-arrow" })
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
) : e.type === "type" ? /* @__PURE__ */ t(O, { className: m, cellData: e }) : e.type === "icons" ? /* @__PURE__ */ t("td", { "data-testid": e.headerId, className: o, children: e.value.map((n, x) => /* @__PURE__ */ t(
|
|
66
|
+
p,
|
|
67
|
+
{
|
|
68
|
+
template: /* @__PURE__ */ t(i, { text: n.tooltip }),
|
|
69
|
+
children: n.icon
|
|
70
|
+
},
|
|
71
|
+
n.tooltip + x
|
|
72
|
+
)) }) : Array.isArray(e.value) ? /* @__PURE__ */ t("td", { "data-testid": e.headerId, className: o, children: /* @__PURE__ */ t(j, { chipOptions: A(e.type), elements: e.value, tooltip: !0 }) }) : e.type === "hash" ? /* @__PURE__ */ t("td", { "data-testid": e.headerId, className: o, children: /* @__PURE__ */ t(p, { template: /* @__PURE__ */ t(i, { text: e.value }), children: /* @__PURE__ */ t("span", { children: L(e.value) }) }) }) : e.type === "hidden" ? null : e.type === "component" ? /* @__PURE__ */ t("td", { "data-testid": e.headerId, className: o, children: e.value }) : /* @__PURE__ */ t(
|
|
73
|
+
"td",
|
|
74
|
+
{
|
|
75
|
+
"data-testid": e == null ? void 0 : e.headerId,
|
|
76
|
+
className: o,
|
|
77
|
+
onClick: () => e.value && d && d(e.value),
|
|
78
|
+
children: /* @__PURE__ */ t(
|
|
79
|
+
p,
|
|
80
|
+
{
|
|
81
|
+
className: "text_small",
|
|
82
|
+
template: /* @__PURE__ */ t(i, { text: e.tooltip || e.value || "" }),
|
|
83
|
+
children: e.value
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
};
|
|
89
|
+
g.propTypes = {
|
|
90
|
+
cellData: s.object.isRequired,
|
|
91
|
+
className: s.string,
|
|
92
|
+
firstCell: s.bool,
|
|
93
|
+
item: s.oneOfType([s.object, s.bool]),
|
|
94
|
+
link: s.oneOfType([s.string, s.bool]),
|
|
95
|
+
onClick: s.func,
|
|
96
|
+
selectItem: s.func,
|
|
97
|
+
selectedItem: s.object,
|
|
98
|
+
showExpandButton: s.bool,
|
|
99
|
+
toggleRow: s.func
|
|
100
|
+
};
|
|
101
|
+
export {
|
|
102
|
+
g as default
|
|
103
|
+
};
|
|
104
|
+
//# sourceMappingURL=TableCell.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableCell.mjs","sources":["../../../src/lib/components/TableCell/TableCell.jsx"],"sourcesContent":["/*\nCopyright 2019 Iguazio Systems Ltd.\n\nLicensed under the Apache License, Version 2.0 (the \"License\") with\nan addition restriction as set forth herein. You may not use this\nfile except in compliance with the License. You may obtain a copy of\nthe License at http://www.apache.org/licenses/LICENSE-2.0.\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\nimplied. See the License for the specific language governing\npermissions and limitations under the License.\n\nIn addition, you may not use the software for any purposes that are\nillegal under applicable law, and the grant of the foregoing license\nunder the Apache 2.0 license is conditioned upon your compliance with\nsuch restriction.\n*/\nimport React, { cloneElement } from 'react'\nimport PropTypes from 'prop-types'\nimport classnames from 'classnames'\n\nimport ChipCell from '../ChipCell/ChipCell'\nimport TableLinkCell from '../../elements/TableLinkCell/TableLinkCell'\nimport TableTypeCell from '../../elements/TableTypeCell/TableTypeCell'\nimport TextTooltipTemplate from '../TooltipTemplate/TextTooltipTemplate'\nimport Tooltip from '../Tooltip/Tooltip'\n\nimport { getChipOptions } from '../../utils/chips.util'\nimport { truncateUid } from '../../utils/string.util'\n\nimport Arrow from '../../images/arrow.svg?react'\n\nconst TableCell = ({\n cellData,\n className = '',\n firstCell = false,\n item,\n link = '',\n onClick = null,\n selectItem = () => {},\n selectedItem = {},\n showExpandButton = false,\n toggleRow = null\n}) => {\n const { value: stateValue, label: stateLabel, className: stateClassName } = item.state ?? {}\n const cellClassNames = classnames(\n 'table-body__cell',\n cellData.className,\n className,\n cellData.bodyCellClassName,\n onClick && 'link'\n )\n\n if (cellData.template) {\n return cloneElement(cellData.template, {\n className\n })\n } else if (link && cellData.type !== 'hidden') {\n return (\n <TableLinkCell\n className={className}\n cellData={cellData}\n item={item}\n link={link}\n selectItem={selectItem}\n selectedItem={selectedItem}\n showExpandButton={showExpandButton}\n toggleRow={toggleRow}\n />\n )\n } else if (firstCell && !link) {\n return (\n <td\n onClick={() => cellData.value && onClick && onClick(cellData.value)}\n className={cellClassNames}\n >\n <div className=\"data-ellipsis\">\n {cellData && (\n <Tooltip\n template={<TextTooltipTemplate text={cellData.tooltip || cellData.value || ''} />}\n >\n {cellData.value}\n </Tooltip>\n )}\n </div>\n {item.state && stateValue && stateLabel && (\n <Tooltip className=\"status\" template={<TextTooltipTemplate text={stateLabel} />}>\n <i className={stateClassName} />\n </Tooltip>\n )}\n {!item.state && item.status && (\n <Tooltip className=\"status\" template={<TextTooltipTemplate text={item.status} />}>\n <i className={`${item.status[0].toLowerCase()}${item.status.slice(1)}`} />\n </Tooltip>\n )}\n {showExpandButton && (\n <Arrow onClick={e => toggleRow && toggleRow(e, item)} className=\"expand-arrow\" />\n )}\n </td>\n )\n } else if (cellData.type === 'type') {\n return <TableTypeCell className={className} cellData={cellData} />\n } else if (cellData.type === 'icons') {\n return (\n <td data-testid={cellData.headerId} className={cellClassNames}>\n {cellData.value.map((valueItem, index) => (\n <Tooltip\n key={valueItem.tooltip + index}\n template={<TextTooltipTemplate text={valueItem.tooltip} />}\n >\n {valueItem.icon}\n </Tooltip>\n ))}\n </td>\n )\n } else if (Array.isArray(cellData.value)) {\n return (\n <td data-testid={cellData.headerId} className={cellClassNames}>\n <ChipCell chipOptions={getChipOptions(cellData.type)} elements={cellData.value} tooltip />\n </td>\n )\n } else if (cellData.type === 'hash') {\n return (\n <td data-testid={cellData.headerId} className={cellClassNames}>\n <Tooltip template={<TextTooltipTemplate text={cellData.value} />}>\n <span>{truncateUid(cellData.value)}</span>\n </Tooltip>\n </td>\n )\n } else if (cellData.type === 'hidden') {\n return null\n } else if (cellData.type === 'component') {\n return (\n <td data-testid={cellData.headerId} className={cellClassNames}>\n {cellData.value}\n </td>\n )\n } else {\n return (\n <td\n data-testid={cellData?.headerId}\n className={cellClassNames}\n onClick={() => cellData.value && onClick && onClick(cellData.value)}\n >\n <Tooltip\n className=\"text_small\"\n template={<TextTooltipTemplate text={cellData.tooltip || cellData.value || ''} />}\n >\n {cellData.value}\n </Tooltip>\n </td>\n )\n }\n}\n\nTableCell.propTypes = {\n cellData: PropTypes.object.isRequired,\n className: PropTypes.string,\n firstCell: PropTypes.bool,\n item: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]),\n link: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),\n onClick: PropTypes.func,\n selectItem: PropTypes.func,\n selectedItem: PropTypes.object,\n showExpandButton: PropTypes.bool,\n toggleRow: PropTypes.func\n}\n\nexport default TableCell\n"],"names":["TableCell","cellData","className","firstCell","item","link","onClick","selectItem","selectedItem","showExpandButton","toggleRow","stateValue","stateLabel","stateClassName","cellClassNames","classnames","cloneElement","jsx","TableLinkCell","jsxs","Tooltip","TextTooltipTemplate","Arrow","e","TableTypeCell","valueItem","index","ChipCell","getChipOptions","PropTypes"],"mappings":";;;;;;;;;;;;AAkCA,MAAMA,IAAY,CAAC;AAAA,EACjB,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,WAAAC,IAAY;AAAA,EACZ,MAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,SAAAC,IAAU;AAAA,EACV,YAAAC,IAAa,MAAM;AAAA,EAAC;AAAA,EACpB,cAAAC,IAAe,CAAC;AAAA,EAChB,kBAAAC,IAAmB;AAAA,EACnB,WAAAC,IAAY;AACd,MAAM;AACE,QAAA,EAAE,OAAOC,GAAY,OAAOC,GAAY,WAAWC,EAAe,IAAIT,EAAK,SAAS,CAAC,GACrFU,IAAiBC;AAAA,IACrB;AAAA,IACAd,EAAS;AAAA,IACTC;AAAA,IACAD,EAAS;AAAA,IACTK,KAAW;AAAA,EACb;AAEA,SAAIL,EAAS,WACJe,EAAaf,EAAS,UAAU;AAAA,IACrC,WAAAC;AAAA,EAAA,CACD,IACQG,KAAQJ,EAAS,SAAS,WAEjC,gBAAAgB;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAAhB;AAAA,MACA,UAAAD;AAAA,MACA,MAAAG;AAAA,MACA,MAAAC;AAA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AAA,EACF;AAGN;AAEAD,EAAU,YAAY;AAAA,EACpB,UAAU6B,EAAU,OAAO;AAAA,EAC3B,WAAWA,EAAU;AAAA,EACrB,WAAWA,EAAU;AAAA,EACrB,MAAMA,EAAU,UAAU,CAACA,EAAU,QAAQA,EAAU,IAAI,CAAC;AAAA,EAC5D,MAAMA,EAAU,UAAU,CAACA,EAAU,QAAQA,EAAU,IAAI,CAAC;AAAA,EAC5D,SAASA,EAAU;AAAA,EACnB,YAAYA,EAAU;AAAA,EACtB,cAAcA,EAAU;AAAA,EACxB,kBAAkBA,EAAU;AAAA,EAC5B,WAAWA,EAAU;AACvB;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default TabsSlider;
|
|
2
|
+
declare function TabsSlider({ fontSize, initialTab, isDetailsPopUp, onClick, skipLink, tabsList }: {
|
|
3
|
+
fontSize?: string;
|
|
4
|
+
initialTab?: string;
|
|
5
|
+
isDetailsPopUp?: boolean;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
skipLink?: boolean;
|
|
8
|
+
tabsList: any;
|
|
9
|
+
}): JSX.Element;
|
|
10
|
+
declare namespace TabsSlider {
|
|
11
|
+
namespace propTypes {
|
|
12
|
+
let fontSize: any;
|
|
13
|
+
let initialTab: any;
|
|
14
|
+
let isDetailsPopUp: any;
|
|
15
|
+
let onClick: any;
|
|
16
|
+
let skipLink: any;
|
|
17
|
+
let tabsList: any;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=TabsSlider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TabsSlider.d.ts","sourceRoot":"","sources":["../../../src/lib/components/TabsSlider/TabsSlider.jsx"],"names":[],"mappings":";AA+BA;;;;;;;gBAoMC"}
|