iguazio.dashboard-react-controls 3.2.3 → 3.2.4

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.
@@ -4,8 +4,8 @@ import a from "prop-types";
4
4
  import j from "classnames";
5
5
  import { isEmpty as y, get as z, throttle as Re, isNil as G } from "lodash";
6
6
  import se from "../NewChipInput/NewChipInput.mjs";
7
- import be from "../../../elements/OptionsMenu/OptionsMenu.mjs";
8
- import ke from "../../../elements/ValidationTemplate/ValidationTemplate.mjs";
7
+ import ke from "../../../elements/OptionsMenu/OptionsMenu.mjs";
8
+ import be from "../../../elements/ValidationTemplate/ValidationTemplate.mjs";
9
9
  import { CHIP_OPTIONS as We } from "../../../types.mjs";
10
10
  import { CLICK as Ie, TAB as J, TAB_SHIFT as Ke } from "../../../constants.mjs";
11
11
  import { getTextWidth as D } from "../formChipCell.util.mjs";
@@ -15,13 +15,13 @@ import _e from "../../../images/close.svg.mjs";
15
15
  const Ne = {
16
16
  rules: {}
17
17
  };
18
- let P = ({
18
+ let E = ({
19
19
  chip: d,
20
20
  chipIndex: i,
21
21
  chipOptions: ne,
22
22
  className: ie = "",
23
23
  editConfig: r,
24
- handleRemoveChip: le,
24
+ handleRemoveChip: ue,
25
25
  isDeletable: Q,
26
26
  isEditable: u,
27
27
  keyName: N,
@@ -29,7 +29,7 @@ let P = ({
29
29
  onChange: q,
30
30
  setChipSizeIsRecalculated: U,
31
31
  setEditConfig: O,
32
- validationRules: ue = Ne.rules,
32
+ validationRules: le = Ne.rules,
33
33
  valueName: oe
34
34
  }, w) => {
35
35
  const [l, A] = $({
@@ -38,7 +38,7 @@ let P = ({
38
38
  value: d.value,
39
39
  keyFieldWidth: 0,
40
40
  valueFieldWidth: 0
41
- }), [v, ce] = $("key"), [X, ae] = $(ue), [p, B] = $(!1), { background: Y, borderColor: Z, borderRadius: C, density: g, font: ee } = ne, F = H(() => u ? 25 : 20, [u]), f = H(() => u ? 35 : 20, [u]), M = H(() => Ve(), []), o = T.useRef({}), c = T.useRef({}), S = T.useRef(), x = T.useRef(), de = j(
41
+ }), [v, ce] = $("key"), [X, ae] = $(le), [p, B] = $(!1), { background: Y, borderColor: Z, borderRadius: C, density: g, font: ee } = ne, F = H(() => u ? 25 : 20, [u]), f = H(() => u ? 35 : 20, [u]), M = H(() => Ve(), []), o = T.useRef({}), c = T.useRef({}), S = T.useRef(), x = T.useRef(), de = j(
42
42
  ie,
43
43
  !r.isKeyFocused && "item_edited",
44
44
  !y(z(m, ["error", i, "key"], [])) && !y(l.key) && !d.disabled && u && "item_edited_invalid"
@@ -57,29 +57,29 @@ let P = ({
57
57
  !y(z(m, ["error", i, "value"], [])) && !y(l.value) && u && "item_edited_invalid"
58
58
  ), he = j(
59
59
  "item-icon-close",
60
- !d.disabled && (r.chipIndex === i && u || !Q) && "item-icon-close invisible",
60
+ !d.disabled && (r.chipIndex === i && u || !Q && !u) && "item-icon-close invisible",
61
61
  !u && !Q && "item-icon-close hidden"
62
62
  ), K = I(() => {
63
63
  var e;
64
64
  if (o.current) {
65
- const t = D(o.current) + 1, s = D(c.current) + 1, n = ((e = w.current) == null ? void 0 : e.clientWidth) - 50, _ = t >= n / 2, L = s >= n / 2;
66
- let R = null, b = null;
67
- if (_ && L)
68
- R = b = n / 2;
65
+ const t = D(o.current) + 1, s = D(c.current) + 1, n = ((e = w.current) == null ? void 0 : e.clientWidth) - 50, _ = t >= n / 2, P = s >= n / 2;
66
+ let R = null, k = null;
67
+ if (_ && P)
68
+ R = k = n / 2;
69
69
  else if (_) {
70
- b = l.value ? s : f;
71
- const k = n - b;
72
- R = k > t ? t : k;
73
- } else if (L) {
70
+ k = l.value ? s : f;
71
+ const b = n - k;
72
+ R = b > t ? t : b;
73
+ } else if (P) {
74
74
  R = l.key ? t : F;
75
- const k = n - R;
76
- b = k > s ? s : k;
75
+ const b = n - R;
76
+ k = b > s ? s : b;
77
77
  } else
78
- R = !l.key || t <= F ? F : t, b = !l.value || s <= f ? f : s;
79
- o.current.style.width = `${R}px`, y(c.current) || (c.current.style.width = `${b}px`), A((k) => ({
80
- ...k,
78
+ R = !l.key || t <= F ? F : t, k = !l.value || s <= f ? f : s;
79
+ o.current.style.width = `${R}px`, y(c.current) || (c.current.style.width = `${k}px`), A((b) => ({
80
+ ...b,
81
81
  keyFieldWidth: R,
82
- valueFieldWidth: b
82
+ valueFieldWidth: k
83
83
  })), U(!0);
84
84
  }
85
85
  }, [
@@ -103,7 +103,7 @@ let P = ({
103
103
  }, [u, K, M]), h(() => {
104
104
  !l.keyFieldWidth && !l.valueFieldWidth && K();
105
105
  }, [l.keyFieldWidth, l.valueFieldWidth, K]);
106
- const E = I(
106
+ const L = I(
107
107
  (e, t) => {
108
108
  var s;
109
109
  r.chipIndex === i && (!(e.path ?? ((s = e.composedPath) == null ? void 0 : s.call(e))).includes(S.current) || t ? (q(e, Ie, !0), window.getSelection().removeAllRanges(), document.activeElement.blur()) : e.stopPropagation());
@@ -111,9 +111,9 @@ let P = ({
111
111
  [q, S, i, r.chipIndex]
112
112
  ), V = I(
113
113
  (e) => {
114
- x != null && x.current && !x.current.contains(e.target) && (B(!1), E(e, !0));
114
+ x != null && x.current && !x.current.contains(e.target) && (B(!1), L(e, !0));
115
115
  },
116
- [E]
116
+ [L]
117
117
  );
118
118
  h(() => (p && window.addEventListener("scroll", V, !0), () => {
119
119
  window.removeEventListener("scroll", V, !0);
@@ -130,10 +130,10 @@ let P = ({
130
130
  window.removeEventListener("scroll", V, !0);
131
131
  }), [V, p]), h(() => {
132
132
  if (r.isEdit)
133
- return document.addEventListener("click", E, !0), () => {
134
- document.removeEventListener("click", E, !0);
133
+ return document.addEventListener("click", L, !0), () => {
134
+ document.removeEventListener("click", L, !0);
135
135
  };
136
- }, [E, r.isEdit]);
136
+ }, [L, r.isEdit]);
137
137
  const ye = I(
138
138
  (e) => {
139
139
  if (r.chipIndex === i && u) {
@@ -178,11 +178,11 @@ let P = ({
178
178
  } else {
179
179
  const n = D(c.current);
180
180
  A((_) => {
181
- var L;
181
+ var P;
182
182
  return {
183
183
  ..._,
184
184
  value: c.current.value,
185
- valueFieldWidth: ((L = c.current.value) == null ? void 0 : L.length) <= 1 ? f : n >= t ? t : n > f ? n + 2 : f
185
+ valueFieldWidth: ((P = c.current.value) == null ? void 0 : P.length) <= 1 ? f : n >= t ? t : n > f ? n + 2 : f
186
186
  };
187
187
  });
188
188
  }
@@ -209,7 +209,7 @@ let P = ({
209
209
  }, [m, p, v, r.chipIndex]);
210
210
  const ve = I(() => {
211
211
  var e;
212
- return (e = X[v]) == null ? void 0 : e.map(({ isValid: t = !1, label: s, name: n }) => /* @__PURE__ */ W(ke, { valid: t, validationMessage: s }, n));
212
+ return (e = X[v]) == null ? void 0 : e.map(({ isValid: t = !1, label: s, name: n }) => /* @__PURE__ */ W(be, { valid: t, validationMessage: s }, n));
213
213
  }, [v, X]);
214
214
  return /* @__PURE__ */ Fe(
215
215
  "div",
@@ -250,18 +250,18 @@ let P = ({
250
250
  {
251
251
  disabled: d.disabled,
252
252
  className: he,
253
- onClick: (e) => !d.disabled && le(e, i),
253
+ onClick: (e) => !d.disabled && ue(e, i),
254
254
  children: /* @__PURE__ */ W(_e, {})
255
255
  }
256
256
  ),
257
- !d.disabled && (r.isKeyFocused ? !y(l.key) : !y(l.value)) && r.chipIndex === i && !y(z(m, ["error", r.chipIndex, v], [])) && /* @__PURE__ */ W(be, { show: p, ref: { refInputContainer: S, validationRulesRef: x }, children: ve() })
257
+ !d.disabled && (r.isKeyFocused ? !y(l.key) : !y(l.value)) && r.chipIndex === i && !y(z(m, ["error", r.chipIndex, v], [])) && /* @__PURE__ */ W(ke, { show: p, ref: { refInputContainer: S, validationRulesRef: x }, children: ve() })
258
258
  ]
259
259
  }
260
260
  );
261
261
  };
262
- P = we(P);
263
- P.displayName = "NewChipForm";
264
- P.propTypes = {
262
+ E = we(E);
263
+ E.displayName = "NewChipForm";
264
+ E.propTypes = {
265
265
  chip: a.object.isRequired,
266
266
  chipIndex: a.number.isRequired,
267
267
  chipOptions: We.isRequired,
@@ -278,7 +278,7 @@ P.propTypes = {
278
278
  validationRules: a.object,
279
279
  valueName: a.string.isRequired
280
280
  };
281
- const Me = P;
281
+ const Me = E;
282
282
  export {
283
283
  Me as default
284
284
  };
@@ -1 +1 @@
1
- {"version":3,"file":"NewChipForm.mjs","sources":["../../../../src/lib/components/FormChipCell/NewChipForm/NewChipForm.jsx"],"sourcesContent":["/*\nCopyright 2022 Iguazio Systems Ltd.\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.\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.\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, {\n useState,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n forwardRef\n} from 'react'\nimport PropTypes from 'prop-types'\nimport classnames from 'classnames'\nimport { isEmpty, get, isNil, throttle } from 'lodash'\n\nimport NewChipInput from '../NewChipInput/NewChipInput'\nimport OptionsMenu from '../../../elements/OptionsMenu/OptionsMenu'\nimport ValidationTemplate from '../../../elements/ValidationTemplate/ValidationTemplate'\n\nimport { CHIP_OPTIONS } from '../../../types'\nimport { CLICK, TAB, TAB_SHIFT } from '../../../constants'\nimport { getTextWidth } from '../formChipCell.util'\nimport { getTransitionEndEventName } from '../../../utils/common.util'\n\nimport Close from '../../../images/close.svg?react'\n\nimport './newChipForm.scss'\n\nconst defaultProps = {\n rules: {}\n}\n\nlet NewChipForm = (\n {\n chip,\n chipIndex,\n chipOptions,\n className = '',\n editConfig,\n handleRemoveChip,\n isDeletable,\n isEditable,\n keyName,\n meta,\n onChange,\n setChipSizeIsRecalculated,\n setEditConfig,\n validationRules: rules = defaultProps.rules,\n valueName\n },\n ref\n) => {\n const [chipData, setChipData] = useState({\n isKeyOnly: chip.isKeyOnly,\n key: chip.key,\n value: chip.value,\n keyFieldWidth: 0,\n valueFieldWidth: 0\n })\n const [selectedInput, setSelectedInput] = useState('key')\n const [validationRules, setValidationRules] = useState(rules)\n const [showValidationRules, setShowValidationRules] = useState(false)\n\n const { background, borderColor, borderRadius, density, font } = chipOptions\n const minWidthInput = useMemo(() => {\n return isEditable ? 25 : 20\n }, [isEditable])\n const minWidthValueInput = useMemo(() => {\n return isEditable ? 35 : 20\n }, [isEditable])\n const transitionEndEventName = useMemo(() => getTransitionEndEventName(), [])\n\n const refInputKey = React.useRef({})\n const refInputValue = React.useRef({})\n const refInputContainer = React.useRef()\n const validationRulesRef = React.useRef()\n\n const labelKeyClassName = classnames(\n className,\n !editConfig.isKeyFocused && 'item_edited',\n !isEmpty(get(meta, ['error', chipIndex, 'key'], [])) &&\n !isEmpty(chipData.key) &&\n !chip.disabled &&\n isEditable &&\n '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 isEditable && chip.disabled && 'edit-chip-container_disabled edit-chip-container-font_disabled'\n )\n const labelValueClassName = classnames(\n 'input-label-value',\n !editConfig.isValueFocused && 'item_edited',\n !isEmpty(get(meta, ['error', chipIndex, 'value'], [])) &&\n !isEmpty(chipData.value) &&\n isEditable &&\n 'item_edited_invalid'\n )\n\n const closeButtonClass = classnames(\n 'item-icon-close',\n !chip.disabled &&\n ((editConfig.chipIndex === chipIndex && isEditable) || !isDeletable) &&\n 'item-icon-close invisible',\n !isEditable && !isDeletable && 'item-icon-close hidden'\n )\n\n const resizeChip = useCallback(() => {\n if (refInputKey.current) {\n const currentWidthKeyInput = getTextWidth(refInputKey.current) + 1\n const currentWidthValueInput = getTextWidth(refInputValue.current) + 1\n const maxWidthInput = ref.current?.clientWidth - 50\n const keyEllipsis = currentWidthKeyInput >= maxWidthInput / 2\n const valueEllipsis = currentWidthValueInput >= maxWidthInput / 2\n let keyFieldWidth = null\n let valueFieldWidth = null\n\n if (keyEllipsis && valueEllipsis) {\n keyFieldWidth = valueFieldWidth = maxWidthInput / 2\n } else if (keyEllipsis) {\n valueFieldWidth = !chipData.value ? minWidthValueInput : currentWidthValueInput\n\n const remainingPlace = maxWidthInput - valueFieldWidth\n\n keyFieldWidth =\n remainingPlace > currentWidthKeyInput ? currentWidthKeyInput : remainingPlace\n } else if (valueEllipsis) {\n keyFieldWidth = !chipData.key ? minWidthInput : currentWidthKeyInput\n\n const remainingPlace = maxWidthInput - keyFieldWidth\n\n valueFieldWidth =\n remainingPlace > currentWidthValueInput ? currentWidthValueInput : remainingPlace\n } else {\n keyFieldWidth =\n !chipData.key || currentWidthKeyInput <= minWidthInput\n ? minWidthInput\n : currentWidthKeyInput\n valueFieldWidth =\n !chipData.value || currentWidthValueInput <= minWidthValueInput\n ? minWidthValueInput\n : currentWidthValueInput\n }\n\n refInputKey.current.style.width = `${keyFieldWidth}px`\n\n if (!isEmpty(refInputValue.current)) {\n refInputValue.current.style.width = `${valueFieldWidth}px`\n }\n\n setChipData(prevState => ({\n ...prevState,\n keyFieldWidth,\n valueFieldWidth\n }))\n setChipSizeIsRecalculated(true)\n }\n }, [\n chipData.key,\n chipData.value,\n minWidthInput,\n minWidthValueInput,\n ref,\n setChipSizeIsRecalculated\n ])\n\n useEffect(() => {\n if (!ref.current) return\n\n const element = ref.current\n const observer = new ResizeObserver(resizeChip)\n\n observer.observe(element)\n\n return () => observer.unobserve(element)\n }, [ref, resizeChip])\n\n useEffect(() => {\n const resizeChipDebounced = throttle(resizeChip, 500)\n\n if (isEditable) {\n window.addEventListener('resize', resizeChipDebounced)\n window.addEventListener(transitionEndEventName, resizeChipDebounced)\n\n return () => {\n window.removeEventListener('resize', resizeChipDebounced)\n window.removeEventListener(transitionEndEventName, resizeChipDebounced)\n }\n }\n }, [isEditable, resizeChip, transitionEndEventName])\n\n useEffect(() => {\n if (!chipData.keyFieldWidth && !chipData.valueFieldWidth) {\n resizeChip()\n }\n }, [chipData.keyFieldWidth, chipData.valueFieldWidth, resizeChip])\n\n const outsideClick = useCallback(\n (event, forceOutsideClick) => {\n if (editConfig.chipIndex === chipIndex) {\n const elementPath = event.path ?? event.composedPath?.()\n\n if (!elementPath.includes(refInputContainer.current) || forceOutsideClick) {\n onChange(event, CLICK, true)\n window.getSelection().removeAllRanges()\n document.activeElement.blur()\n } else {\n event.stopPropagation()\n }\n }\n },\n [onChange, refInputContainer, chipIndex, editConfig.chipIndex]\n )\n\n const handleScroll = useCallback(\n event => {\n if (validationRulesRef?.current && !validationRulesRef.current.contains(event.target)) {\n setShowValidationRules(false)\n outsideClick(event, true)\n }\n },\n [outsideClick]\n )\n\n useEffect(() => {\n if (showValidationRules) {\n window.addEventListener('scroll', handleScroll, true)\n }\n return () => {\n window.removeEventListener('scroll', handleScroll, true)\n }\n }, [handleScroll, showValidationRules])\n\n useEffect(() => {\n if (editConfig.chipIndex === chipIndex) {\n if (editConfig.isKeyFocused) {\n refInputKey.current.focus()\n } else if (editConfig.isValueFocused) {\n refInputValue.current.focus()\n }\n }\n }, [\n editConfig.isKeyFocused,\n editConfig.isValueFocused,\n refInputKey,\n refInputValue,\n chipIndex,\n editConfig.chipIndex\n ])\n\n useEffect(() => {\n if (showValidationRules) {\n window.addEventListener('scroll', handleScroll, true)\n }\n return () => {\n window.removeEventListener('scroll', handleScroll, true)\n }\n }, [handleScroll, showValidationRules])\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 if (editConfig.chipIndex === chipIndex && isEditable) {\n if (!event.shiftKey && event.key === TAB && editConfig.isValueFocused) {\n return onChange(event, TAB)\n } else if (event.shiftKey && event.key === TAB && editConfig.isKeyFocused) {\n return onChange(event, TAB_SHIFT)\n }\n }\n event.stopPropagation()\n },\n [editConfig, onChange, chipIndex, isEditable]\n )\n\n const handleOnFocus = useCallback(\n event => {\n const isKeyFocused = event.target.name === keyName\n\n if (editConfig.chipIndex === chipIndex) {\n if (isKeyFocused) {\n refInputKey.current.selectionStart = refInputKey.current.selectionEnd\n\n setEditConfig(prevConfig => ({\n ...prevConfig,\n isKeyFocused: true,\n isValueFocused: false\n }))\n } else {\n refInputValue.current.selectionStart = refInputValue.current.selectionEnd\n\n setEditConfig(prevConfig => ({\n ...prevConfig,\n isKeyFocused: false,\n isValueFocused: true\n }))\n }\n\n event && event.stopPropagation()\n } else if (isNil(editConfig.chipIndex)) {\n if (isKeyFocused) {\n refInputKey.current.selectionStart = refInputKey.current.selectionEnd\n } else {\n refInputValue.current.selectionStart = refInputValue.current.selectionEnd\n }\n setEditConfig({\n chipIndex,\n isEdit: true,\n isKeyFocused: isKeyFocused,\n isValueFocused: !isKeyFocused\n })\n }\n },\n [keyName, refInputKey, refInputValue, setEditConfig, editConfig.chipIndex, chipIndex]\n )\n\n const handleOnChange = useCallback(\n event => {\n const maxWidthInput = ref.current?.clientWidth - 50\n\n event.preventDefault()\n\n if (event.target.name === keyName) {\n const currentWidthKeyInput = getTextWidth(refInputKey.current)\n\n setChipData(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 = getTextWidth(refInputValue.current)\n\n setChipData(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 [keyName, minWidthInput, ref, minWidthValueInput]\n )\n\n useLayoutEffect(() => {\n if (editConfig.chipIndex === chipIndex) {\n setSelectedInput(editConfig.isKeyFocused ? 'key' : editConfig.isValueFocused ? 'value' : null)\n }\n }, [editConfig.isKeyFocused, editConfig.isValueFocused, editConfig.chipIndex, chipIndex])\n\n useEffect(() => {\n if (meta.valid && showValidationRules) {\n setShowValidationRules(false)\n }\n }, [meta.valid, showValidationRules])\n\n useEffect(() => {\n if (meta.error) {\n setValidationRules(prevState => {\n return {\n ...prevState,\n [selectedInput]: prevState[selectedInput]?.map(rule => {\n return {\n ...rule,\n isValid: isEmpty(get(meta, ['error', editConfig.chipIndex, selectedInput], []))\n ? true\n : !meta.error[editConfig.chipIndex][selectedInput].some(\n err => err && err.name === rule.name\n )\n }\n })\n }\n })\n\n !showValidationRules && setShowValidationRules(true)\n }\n }, [meta, showValidationRules, selectedInput, editConfig.chipIndex])\n\n const getValidationRules = useCallback(() => {\n return validationRules[selectedInput]?.map(({ isValid = false, label, name }) => {\n return <ValidationTemplate valid={isValid} validationMessage={label} key={name} />\n })\n }, [selectedInput, validationRules])\n\n return (\n <div\n className={labelContainerClassName}\n onKeyDown={event => !chip.disabled && editConfig.isEdit && focusChip(event)}\n ref={refInputContainer}\n >\n <NewChipInput\n className={labelKeyClassName}\n disabled={\n chip.disabled ||\n !isEditable ||\n (!isNil(editConfig.chipIndex) && editConfig.chipIndex !== chipIndex)\n }\n name={keyName}\n onChange={handleOnChange}\n onFocus={handleOnFocus}\n placeholder={isEditable ? 'key' : ''}\n ref={refInputKey}\n style={{ width: chipData.keyFieldWidth }}\n />\n {!chipData.isKeyOnly && <div className=\"edit-chip-separator\">:</div>}\n {!chipData.isKeyOnly && (\n <NewChipInput\n className={labelValueClassName}\n disabled={\n chip.disabled ||\n !isEditable ||\n (!isNil(editConfig.chipIndex) && editConfig.chipIndex !== chipIndex)\n }\n name={valueName}\n onChange={handleOnChange}\n onFocus={handleOnFocus}\n placeholder={isEditable ? 'value' : ''}\n ref={refInputValue}\n style={{ width: chipData.valueFieldWidth }}\n />\n )}\n\n <button\n disabled={chip.disabled}\n className={closeButtonClass}\n onClick={event => !chip.disabled && handleRemoveChip(event, chipIndex)}\n >\n <Close />\n </button>\n\n {!chip.disabled &&\n (editConfig.isKeyFocused ? !isEmpty(chipData.key) : !isEmpty(chipData.value)) &&\n editConfig.chipIndex === chipIndex &&\n !isEmpty(get(meta, ['error', editConfig.chipIndex, selectedInput], [])) && (\n <OptionsMenu show={showValidationRules} ref={{ refInputContainer, validationRulesRef }}>\n {getValidationRules()}\n </OptionsMenu>\n )}\n </div>\n )\n}\n\nNewChipForm = forwardRef(NewChipForm)\n\nNewChipForm.displayName = 'NewChipForm'\n\nNewChipForm.propTypes = {\n chip: PropTypes.object.isRequired,\n chipIndex: PropTypes.number.isRequired,\n chipOptions: CHIP_OPTIONS.isRequired,\n className: PropTypes.string,\n editConfig: PropTypes.object.isRequired,\n handleRemoveChip: PropTypes.func.isRequired,\n isDeletable: PropTypes.bool.isRequired,\n isEditable: PropTypes.bool.isRequired,\n keyName: PropTypes.string.isRequired,\n meta: PropTypes.object.isRequired,\n onChange: PropTypes.func.isRequired,\n setChipSizeIsRecalculated: PropTypes.func.isRequired,\n setEditConfig: PropTypes.func.isRequired,\n validationRules: PropTypes.object,\n valueName: PropTypes.string.isRequired\n}\n\nexport default NewChipForm\n"],"names":["defaultProps","NewChipForm","chip","chipIndex","chipOptions","className","editConfig","handleRemoveChip","isDeletable","isEditable","keyName","meta","onChange","setChipSizeIsRecalculated","setEditConfig","rules","valueName","ref","chipData","setChipData","useState","selectedInput","setSelectedInput","validationRules","setValidationRules","showValidationRules","setShowValidationRules","background","borderColor","borderRadius","density","font","minWidthInput","useMemo","minWidthValueInput","transitionEndEventName","getTransitionEndEventName","refInputKey","React","refInputValue","refInputContainer","validationRulesRef","labelKeyClassName","classnames","isEmpty","get","labelContainerClassName","labelValueClassName","closeButtonClass","resizeChip","useCallback","currentWidthKeyInput","getTextWidth","currentWidthValueInput","maxWidthInput","_a","keyEllipsis","valueEllipsis","keyFieldWidth","valueFieldWidth","remainingPlace","prevState","useEffect","element","observer","resizeChipDebounced","throttle","outsideClick","event","forceOutsideClick","CLICK","handleScroll","focusChip","TAB","TAB_SHIFT","handleOnFocus","isKeyFocused","prevConfig","isNil","handleOnChange","useLayoutEffect","rule","err","getValidationRules","isValid","label","name","ValidationTemplate","jsxs","jsx","NewChipInput","Close","OptionsMenu","forwardRef","PropTypes","CHIP_OPTIONS","NewChipForm$1"],"mappings":";;;;;;;;;;;;;;AAyCA,MAAMA,KAAe;AAAA,EACnB,OAAO,CAAA;AACT;AAEA,IAAIC,IAAc,CAChB;AAAA,EACE,MAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC,KAAY;AAAA,EACZ,YAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,2BAAAC;AAAA,EACA,eAAAC;AAAA,EACA,iBAAiBC,KAAQf,GAAa;AAAA,EACtC,WAAAgB;AACF,GACAC,MACG;AACH,QAAM,CAACC,GAAUC,CAAW,IAAIC,EAAS;AAAA,IACvC,WAAWlB,EAAK;AAAA,IAChB,KAAKA,EAAK;AAAA,IACV,OAAOA,EAAK;AAAA,IACZ,eAAe;AAAA,IACf,iBAAiB;AAAA,EAAA,CAClB,GACK,CAACmB,GAAeC,EAAgB,IAAIF,EAAS,KAAK,GAClD,CAACG,GAAiBC,EAAkB,IAAIJ,EAASL,EAAK,GACtD,CAACU,GAAqBC,CAAsB,IAAIN,EAAS,EA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 Iguazio Systems Ltd.\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.\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.\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, {\n useState,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n forwardRef\n} from 'react'\nimport PropTypes from 'prop-types'\nimport classnames from 'classnames'\nimport { isEmpty, get, isNil, throttle } from 'lodash'\n\nimport NewChipInput from '../NewChipInput/NewChipInput'\nimport OptionsMenu from '../../../elements/OptionsMenu/OptionsMenu'\nimport ValidationTemplate from '../../../elements/ValidationTemplate/ValidationTemplate'\n\nimport { CHIP_OPTIONS } from '../../../types'\nimport { CLICK, TAB, TAB_SHIFT } from '../../../constants'\nimport { getTextWidth } from '../formChipCell.util'\nimport { getTransitionEndEventName } from '../../../utils/common.util'\n\nimport Close from '../../../images/close.svg?react'\n\nimport './newChipForm.scss'\n\nconst defaultProps = {\n rules: {}\n}\n\nlet NewChipForm = (\n {\n chip,\n chipIndex,\n chipOptions,\n className = '',\n editConfig,\n handleRemoveChip,\n isDeletable,\n isEditable,\n keyName,\n meta,\n onChange,\n setChipSizeIsRecalculated,\n setEditConfig,\n validationRules: rules = defaultProps.rules,\n valueName\n },\n ref\n) => {\n const [chipData, setChipData] = useState({\n isKeyOnly: chip.isKeyOnly,\n key: chip.key,\n value: chip.value,\n keyFieldWidth: 0,\n valueFieldWidth: 0\n })\n const [selectedInput, setSelectedInput] = useState('key')\n const [validationRules, setValidationRules] = useState(rules)\n const [showValidationRules, setShowValidationRules] = useState(false)\n\n const { background, borderColor, borderRadius, density, font } = chipOptions\n const minWidthInput = useMemo(() => {\n return isEditable ? 25 : 20\n }, [isEditable])\n const minWidthValueInput = useMemo(() => {\n return isEditable ? 35 : 20\n }, [isEditable])\n const transitionEndEventName = useMemo(() => getTransitionEndEventName(), [])\n\n const refInputKey = React.useRef({})\n const refInputValue = React.useRef({})\n const refInputContainer = React.useRef()\n const validationRulesRef = React.useRef()\n\n const labelKeyClassName = classnames(\n className,\n !editConfig.isKeyFocused && 'item_edited',\n !isEmpty(get(meta, ['error', chipIndex, 'key'], [])) &&\n !isEmpty(chipData.key) &&\n !chip.disabled &&\n isEditable &&\n '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 isEditable && chip.disabled && 'edit-chip-container_disabled edit-chip-container-font_disabled'\n )\n const labelValueClassName = classnames(\n 'input-label-value',\n !editConfig.isValueFocused && 'item_edited',\n !isEmpty(get(meta, ['error', chipIndex, 'value'], [])) &&\n !isEmpty(chipData.value) &&\n isEditable &&\n 'item_edited_invalid'\n )\n\n const closeButtonClass = classnames(\n 'item-icon-close',\n !chip.disabled &&\n ((editConfig.chipIndex === chipIndex && isEditable) || (!isDeletable && !isEditable)) &&\n 'item-icon-close invisible',\n !isEditable && !isDeletable && 'item-icon-close hidden'\n )\n\n const resizeChip = useCallback(() => {\n if (refInputKey.current) {\n const currentWidthKeyInput = getTextWidth(refInputKey.current) + 1\n const currentWidthValueInput = getTextWidth(refInputValue.current) + 1\n const maxWidthInput = ref.current?.clientWidth - 50\n const keyEllipsis = currentWidthKeyInput >= maxWidthInput / 2\n const valueEllipsis = currentWidthValueInput >= maxWidthInput / 2\n let keyFieldWidth = null\n let valueFieldWidth = null\n\n if (keyEllipsis && valueEllipsis) {\n keyFieldWidth = valueFieldWidth = maxWidthInput / 2\n } else if (keyEllipsis) {\n valueFieldWidth = !chipData.value ? minWidthValueInput : currentWidthValueInput\n\n const remainingPlace = maxWidthInput - valueFieldWidth\n\n keyFieldWidth =\n remainingPlace > currentWidthKeyInput ? currentWidthKeyInput : remainingPlace\n } else if (valueEllipsis) {\n keyFieldWidth = !chipData.key ? minWidthInput : currentWidthKeyInput\n\n const remainingPlace = maxWidthInput - keyFieldWidth\n\n valueFieldWidth =\n remainingPlace > currentWidthValueInput ? currentWidthValueInput : remainingPlace\n } else {\n keyFieldWidth =\n !chipData.key || currentWidthKeyInput <= minWidthInput\n ? minWidthInput\n : currentWidthKeyInput\n valueFieldWidth =\n !chipData.value || currentWidthValueInput <= minWidthValueInput\n ? minWidthValueInput\n : currentWidthValueInput\n }\n\n refInputKey.current.style.width = `${keyFieldWidth}px`\n\n if (!isEmpty(refInputValue.current)) {\n refInputValue.current.style.width = `${valueFieldWidth}px`\n }\n\n setChipData(prevState => ({\n ...prevState,\n keyFieldWidth,\n valueFieldWidth\n }))\n setChipSizeIsRecalculated(true)\n }\n }, [\n chipData.key,\n chipData.value,\n minWidthInput,\n minWidthValueInput,\n ref,\n setChipSizeIsRecalculated\n ])\n\n useEffect(() => {\n if (!ref.current) return\n\n const element = ref.current\n const observer = new ResizeObserver(resizeChip)\n\n observer.observe(element)\n\n return () => observer.unobserve(element)\n }, [ref, resizeChip])\n\n useEffect(() => {\n const resizeChipDebounced = throttle(resizeChip, 500)\n\n if (isEditable) {\n window.addEventListener('resize', resizeChipDebounced)\n window.addEventListener(transitionEndEventName, resizeChipDebounced)\n\n return () => {\n window.removeEventListener('resize', resizeChipDebounced)\n window.removeEventListener(transitionEndEventName, resizeChipDebounced)\n }\n }\n }, [isEditable, resizeChip, transitionEndEventName])\n\n useEffect(() => {\n if (!chipData.keyFieldWidth && !chipData.valueFieldWidth) {\n resizeChip()\n }\n }, [chipData.keyFieldWidth, chipData.valueFieldWidth, resizeChip])\n\n const outsideClick = useCallback(\n (event, forceOutsideClick) => {\n if (editConfig.chipIndex === chipIndex) {\n const elementPath = event.path ?? event.composedPath?.()\n\n if (!elementPath.includes(refInputContainer.current) || forceOutsideClick) {\n onChange(event, CLICK, true)\n window.getSelection().removeAllRanges()\n document.activeElement.blur()\n } else {\n event.stopPropagation()\n }\n }\n },\n [onChange, refInputContainer, chipIndex, editConfig.chipIndex]\n )\n\n const handleScroll = useCallback(\n event => {\n if (validationRulesRef?.current && !validationRulesRef.current.contains(event.target)) {\n setShowValidationRules(false)\n outsideClick(event, true)\n }\n },\n [outsideClick]\n )\n\n useEffect(() => {\n if (showValidationRules) {\n window.addEventListener('scroll', handleScroll, true)\n }\n return () => {\n window.removeEventListener('scroll', handleScroll, true)\n }\n }, [handleScroll, showValidationRules])\n\n useEffect(() => {\n if (editConfig.chipIndex === chipIndex) {\n if (editConfig.isKeyFocused) {\n refInputKey.current.focus()\n } else if (editConfig.isValueFocused) {\n refInputValue.current.focus()\n }\n }\n }, [\n editConfig.isKeyFocused,\n editConfig.isValueFocused,\n refInputKey,\n refInputValue,\n chipIndex,\n editConfig.chipIndex\n ])\n\n useEffect(() => {\n if (showValidationRules) {\n window.addEventListener('scroll', handleScroll, true)\n }\n return () => {\n window.removeEventListener('scroll', handleScroll, true)\n }\n }, [handleScroll, showValidationRules])\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 if (editConfig.chipIndex === chipIndex && isEditable) {\n if (!event.shiftKey && event.key === TAB && editConfig.isValueFocused) {\n return onChange(event, TAB)\n } else if (event.shiftKey && event.key === TAB && editConfig.isKeyFocused) {\n return onChange(event, TAB_SHIFT)\n }\n }\n event.stopPropagation()\n },\n [editConfig, onChange, chipIndex, isEditable]\n )\n\n const handleOnFocus = useCallback(\n event => {\n const isKeyFocused = event.target.name === keyName\n\n if (editConfig.chipIndex === chipIndex) {\n if (isKeyFocused) {\n refInputKey.current.selectionStart = refInputKey.current.selectionEnd\n\n setEditConfig(prevConfig => ({\n ...prevConfig,\n isKeyFocused: true,\n isValueFocused: false\n }))\n } else {\n refInputValue.current.selectionStart = refInputValue.current.selectionEnd\n\n setEditConfig(prevConfig => ({\n ...prevConfig,\n isKeyFocused: false,\n isValueFocused: true\n }))\n }\n\n event && event.stopPropagation()\n } else if (isNil(editConfig.chipIndex)) {\n if (isKeyFocused) {\n refInputKey.current.selectionStart = refInputKey.current.selectionEnd\n } else {\n refInputValue.current.selectionStart = refInputValue.current.selectionEnd\n }\n setEditConfig({\n chipIndex,\n isEdit: true,\n isKeyFocused: isKeyFocused,\n isValueFocused: !isKeyFocused\n })\n }\n },\n [keyName, refInputKey, refInputValue, setEditConfig, editConfig.chipIndex, chipIndex]\n )\n\n const handleOnChange = useCallback(\n event => {\n const maxWidthInput = ref.current?.clientWidth - 50\n\n event.preventDefault()\n\n if (event.target.name === keyName) {\n const currentWidthKeyInput = getTextWidth(refInputKey.current)\n\n setChipData(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 = getTextWidth(refInputValue.current)\n\n setChipData(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 [keyName, minWidthInput, ref, minWidthValueInput]\n )\n\n useLayoutEffect(() => {\n if (editConfig.chipIndex === chipIndex) {\n setSelectedInput(editConfig.isKeyFocused ? 'key' : editConfig.isValueFocused ? 'value' : null)\n }\n }, [editConfig.isKeyFocused, editConfig.isValueFocused, editConfig.chipIndex, chipIndex])\n\n useEffect(() => {\n if (meta.valid && showValidationRules) {\n setShowValidationRules(false)\n }\n }, [meta.valid, showValidationRules])\n\n useEffect(() => {\n if (meta.error) {\n setValidationRules(prevState => {\n return {\n ...prevState,\n [selectedInput]: prevState[selectedInput]?.map(rule => {\n return {\n ...rule,\n isValid: isEmpty(get(meta, ['error', editConfig.chipIndex, selectedInput], []))\n ? true\n : !meta.error[editConfig.chipIndex][selectedInput].some(\n err => err && err.name === rule.name\n )\n }\n })\n }\n })\n\n !showValidationRules && setShowValidationRules(true)\n }\n }, [meta, showValidationRules, selectedInput, editConfig.chipIndex])\n\n const getValidationRules = useCallback(() => {\n return validationRules[selectedInput]?.map(({ isValid = false, label, name }) => {\n return <ValidationTemplate valid={isValid} validationMessage={label} key={name} />\n })\n }, [selectedInput, validationRules])\n\n return (\n <div\n className={labelContainerClassName}\n onKeyDown={event => !chip.disabled && editConfig.isEdit && focusChip(event)}\n ref={refInputContainer}\n >\n <NewChipInput\n className={labelKeyClassName}\n disabled={\n chip.disabled ||\n !isEditable ||\n (!isNil(editConfig.chipIndex) && editConfig.chipIndex !== chipIndex)\n }\n name={keyName}\n onChange={handleOnChange}\n onFocus={handleOnFocus}\n placeholder={isEditable ? 'key' : ''}\n ref={refInputKey}\n style={{ width: chipData.keyFieldWidth }}\n />\n {!chipData.isKeyOnly && <div className=\"edit-chip-separator\">:</div>}\n {!chipData.isKeyOnly && (\n <NewChipInput\n className={labelValueClassName}\n disabled={\n chip.disabled ||\n !isEditable ||\n (!isNil(editConfig.chipIndex) && editConfig.chipIndex !== chipIndex)\n }\n name={valueName}\n onChange={handleOnChange}\n onFocus={handleOnFocus}\n placeholder={isEditable ? 'value' : ''}\n ref={refInputValue}\n style={{ width: chipData.valueFieldWidth }}\n />\n )}\n\n <button\n disabled={chip.disabled}\n className={closeButtonClass}\n onClick={event => !chip.disabled && handleRemoveChip(event, chipIndex)}\n >\n <Close />\n </button>\n\n {!chip.disabled &&\n (editConfig.isKeyFocused ? !isEmpty(chipData.key) : !isEmpty(chipData.value)) &&\n editConfig.chipIndex === chipIndex &&\n !isEmpty(get(meta, ['error', editConfig.chipIndex, selectedInput], [])) && (\n <OptionsMenu show={showValidationRules} ref={{ refInputContainer, validationRulesRef }}>\n {getValidationRules()}\n </OptionsMenu>\n )}\n </div>\n )\n}\n\nNewChipForm = forwardRef(NewChipForm)\n\nNewChipForm.displayName = 'NewChipForm'\n\nNewChipForm.propTypes = {\n chip: PropTypes.object.isRequired,\n chipIndex: PropTypes.number.isRequired,\n chipOptions: CHIP_OPTIONS.isRequired,\n className: PropTypes.string,\n editConfig: PropTypes.object.isRequired,\n handleRemoveChip: PropTypes.func.isRequired,\n isDeletable: PropTypes.bool.isRequired,\n isEditable: PropTypes.bool.isRequired,\n keyName: PropTypes.string.isRequired,\n meta: PropTypes.object.isRequired,\n onChange: PropTypes.func.isRequired,\n setChipSizeIsRecalculated: PropTypes.func.isRequired,\n setEditConfig: PropTypes.func.isRequired,\n validationRules: PropTypes.object,\n valueName: PropTypes.string.isRequired\n}\n\nexport default NewChipForm\n"],"names":["defaultProps","NewChipForm","chip","chipIndex","chipOptions","className","editConfig","handleRemoveChip","isDeletable","isEditable","keyName","meta","onChange","setChipSizeIsRecalculated","setEditConfig","rules","valueName","ref","chipData","setChipData","useState","selectedInput","setSelectedInput","validationRules","setValidationRules","showValidationRules","setShowValidationRules","background","borderColor","borderRadius","density","font","minWidthInput","useMemo","minWidthValueInput","transitionEndEventName","getTransitionEndEventName","refInputKey","React","refInputValue","refInputContainer","validationRulesRef","labelKeyClassName","classnames","isEmpty","get","labelContainerClassName","labelValueClassName","closeButtonClass","resizeChip","useCallback","currentWidthKeyInput","getTextWidth","currentWidthValueInput","maxWidthInput","_a","keyEllipsis","valueEllipsis","keyFieldWidth","valueFieldWidth","remainingPlace","prevState","useEffect","element","observer","resizeChipDebounced","throttle","outsideClick","event","forceOutsideClick","CLICK","handleScroll","focusChip","TAB","TAB_SHIFT","handleOnFocus","isKeyFocused","prevConfig","isNil","handleOnChange","useLayoutEffect","rule","err","getValidationRules","isValid","label","name","ValidationTemplate","jsxs","jsx","NewChipInput","Close","OptionsMenu","forwardRef","PropTypes","CHIP_OPTIONS","NewChipForm$1"],"mappings":";;;;;;;;;;;;;;AAyCA,MAAMA,KAAe;AAAA,EACnB,OAAO,CAAA;AACT;AAEA,IAAIC,IAAc,CAChB;AAAA,EACE,MAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC,KAAY;AAAA,EACZ,YAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,2BAAAC;AAAA,EACA,eAAAC;AAAA,EACA,iBAAiBC,KAAQf,GAAa;AAAA,EACtC,WAAAgB;AACF,GACAC,MACG;AACH,QAAM,CAACC,GAAUC,CAAW,IAAIC,EAAS;AAAA,IACvC,WAAWlB,EAAK;AAAA,IAChB,KAAKA,EAAK;AAAA,IACV,OAAOA,EAAK;AAAA,IACZ,eAAe;AAAA,IACf,iBAAiB;AAAA,EAAA,CAClB,GACK,CAACmB,GAAeC,EAAgB,IAAIF,EAAS,KAAK,GAClD,CAACG,GAAiBC,EAAkB,IAAIJ,EAASL,EAAK,GACtD,CAACU,GAAqBC,CAAsB,IAAIN,EAAS,EAAK,GAE9D,EAAE,YAAAO,GAAY,aAAAC,GAAa,cAAAC,GAAc,SAAAC,GAAS,MAAAC,OAAS3B,IAC3D4B,IAAgBC,EAAQ,MACrBxB,IAAa,KAAK,IACxB,CAACA,CAAU,CAAC,GACTyB,IAAqBD,EAAQ,MAC1BxB,IAAa,KAAK,IACxB,CAACA,CAAU,CAAC,GACT0B,IAAyBF,EAAQ,MAAMG,GAA0B,GAAG,CAAA,CAA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,GAAG,IAAI,CAAC0B,EAAQ1B,EAAS,KAAK,MAC3EZ,EAAW,cAAcH,KACzB,CAACyC,EAAQC,EAAIlC,GAAM,CAAC,SAASL,EAAW,WAAWe,CAAa,GAAG,CAAE,CAAA,CAAC,uBACnEuE,IAAY,EAAA,MAAMnE,GAAqB,KAAK,EAAE,mBAAAe,GAAmB,oBAAAC,KAC/D,eACH,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAEN;AAEJ;AAEAxC,IAAc4F,GAAW5F,CAAW;AAEpCA,EAAY,cAAc;AAE1BA,EAAY,YAAY;AAAA,EACtB,MAAM6F,EAAU,OAAO;AAAA,EACvB,WAAWA,EAAU,OAAO;AAAA,EAC5B,aAAaC,GAAa;AAAA,EAC1B,WAAWD,EAAU;AAAA,EACrB,YAAYA,EAAU,OAAO;AAAA,EAC7B,kBAAkBA,EAAU,KAAK;AAAA,EACjC,aAAaA,EAAU,KAAK;AAAA,EAC5B,YAAYA,EAAU,KAAK;AAAA,EAC3B,SAASA,EAAU,OAAO;AAAA,EAC1B,MAAMA,EAAU,OAAO;AAAA,EACvB,UAAUA,EAAU,KAAK;AAAA,EACzB,2BAA2BA,EAAU,KAAK;AAAA,EAC1C,eAAeA,EAAU,KAAK;AAAA,EAC9B,iBAAiBA,EAAU;AAAA,EAC3B,WAAWA,EAAU,OAAO;AAC9B;AAEA,MAAAE,KAAe/F;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iguazio.dashboard-react-controls",
3
- "version": "3.2.3",
3
+ "version": "3.2.4",
4
4
  "description": "Collection of resources (such as CSS styles, fonts and images) and ReactJS 17.x components to share among different Iguazio React repos.",
5
5
  "module": "./dist/index.mjs",
6
6
  "main": "./dist/index.mjs",