@natoora-libs/core 0.2.23 → 0.2.24-dev-package-upgrades-2
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.
|
@@ -1083,10 +1083,12 @@ interface HashtagInputProps extends Omit<AutocompleteType<any>, 'options' | 'ren
|
|
|
1083
1083
|
variant?: TextFieldProps['variant'];
|
|
1084
1084
|
error?: TextFieldProps['error'];
|
|
1085
1085
|
helperText?: TextFieldProps['helperText'];
|
|
1086
|
+
autoFocus?: TextFieldProps['autoFocus'];
|
|
1087
|
+
disableOnBlurCreation?: boolean;
|
|
1086
1088
|
onCreateTag?: (tagName?: string) => void;
|
|
1087
1089
|
onDeleteTag?: (tag?: Tag | string) => void;
|
|
1088
1090
|
}
|
|
1089
|
-
declare const HashtagInput: ({ label, placeholder, variant, error, helperText, onCreateTag, onDeleteTag, ...props }: HashtagInputProps) => react_jsx_runtime.JSX.Element;
|
|
1091
|
+
declare const HashtagInput: ({ label, placeholder, variant, error, helperText, onCreateTag, onDeleteTag, autoFocus, disableOnBlurCreation, onBlur, ...props }: HashtagInputProps) => react_jsx_runtime.JSX.Element;
|
|
1090
1092
|
|
|
1091
1093
|
declare const SvgIconCompare: (props: SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
1092
1094
|
|
|
@@ -1083,10 +1083,12 @@ interface HashtagInputProps extends Omit<AutocompleteType<any>, 'options' | 'ren
|
|
|
1083
1083
|
variant?: TextFieldProps['variant'];
|
|
1084
1084
|
error?: TextFieldProps['error'];
|
|
1085
1085
|
helperText?: TextFieldProps['helperText'];
|
|
1086
|
+
autoFocus?: TextFieldProps['autoFocus'];
|
|
1087
|
+
disableOnBlurCreation?: boolean;
|
|
1086
1088
|
onCreateTag?: (tagName?: string) => void;
|
|
1087
1089
|
onDeleteTag?: (tag?: Tag | string) => void;
|
|
1088
1090
|
}
|
|
1089
|
-
declare const HashtagInput: ({ label, placeholder, variant, error, helperText, onCreateTag, onDeleteTag, ...props }: HashtagInputProps) => react_jsx_runtime.JSX.Element;
|
|
1091
|
+
declare const HashtagInput: ({ label, placeholder, variant, error, helperText, onCreateTag, onDeleteTag, autoFocus, disableOnBlurCreation, onBlur, ...props }: HashtagInputProps) => react_jsx_runtime.JSX.Element;
|
|
1090
1092
|
|
|
1091
1093
|
declare const SvgIconCompare: (props: SVGProps<SVGSVGElement>) => react_jsx_runtime.JSX.Element;
|
|
1092
1094
|
|
package/dist/components/index.js
CHANGED
|
@@ -8572,7 +8572,7 @@ var TableDesktopSmartSelect = ({
|
|
|
8572
8572
|
};
|
|
8573
8573
|
|
|
8574
8574
|
// src/components/TableDesktopEditableField/TableDesktopTagsField.tsx
|
|
8575
|
-
import { useEffect as useEffect12, useState as useState21 } from "react";
|
|
8575
|
+
import { useEffect as useEffect12, useMemo as useMemo6, useState as useState21, useRef as useRef8 } from "react";
|
|
8576
8576
|
|
|
8577
8577
|
// src/components/HashtagInput/HashtagInput.tsx
|
|
8578
8578
|
import { useState as useState20 } from "react";
|
|
@@ -8593,6 +8593,9 @@ var HashtagInput = ({
|
|
|
8593
8593
|
helperText,
|
|
8594
8594
|
onCreateTag,
|
|
8595
8595
|
onDeleteTag,
|
|
8596
|
+
autoFocus = false,
|
|
8597
|
+
disableOnBlurCreation = false,
|
|
8598
|
+
onBlur,
|
|
8596
8599
|
...props
|
|
8597
8600
|
}) => {
|
|
8598
8601
|
const { palette } = useTheme();
|
|
@@ -8600,14 +8603,17 @@ var HashtagInput = ({
|
|
|
8600
8603
|
const sanitizeTag = (value) => {
|
|
8601
8604
|
return value.toLowerCase().replace(/[^a-z0-9#]/g, "").trim();
|
|
8602
8605
|
};
|
|
8606
|
+
const handleAddTag = () => {
|
|
8607
|
+
const cleanedTag = sanitizeTag(inputValue);
|
|
8608
|
+
if (!cleanedTag) return;
|
|
8609
|
+
onCreateTag?.(cleanedTag);
|
|
8610
|
+
setInputValue("");
|
|
8611
|
+
};
|
|
8603
8612
|
const handleKeyDown = (event) => {
|
|
8604
8613
|
if ((event.key === " " || event.key === "Enter") && inputValue) {
|
|
8605
8614
|
event.preventDefault();
|
|
8606
8615
|
event.stopPropagation();
|
|
8607
|
-
|
|
8608
|
-
if (!cleaned) return;
|
|
8609
|
-
onCreateTag?.(cleaned);
|
|
8610
|
-
setInputValue("");
|
|
8616
|
+
handleAddTag();
|
|
8611
8617
|
}
|
|
8612
8618
|
};
|
|
8613
8619
|
return /* @__PURE__ */ jsx130(
|
|
@@ -8629,16 +8635,23 @@ var HashtagInput = ({
|
|
|
8629
8635
|
onDeleteTag?.(details.option);
|
|
8630
8636
|
}
|
|
8631
8637
|
},
|
|
8632
|
-
renderInput: (
|
|
8638
|
+
renderInput: (textFieldProps) => /* @__PURE__ */ jsx130(
|
|
8633
8639
|
TextField8,
|
|
8634
8640
|
{
|
|
8635
|
-
...
|
|
8641
|
+
...textFieldProps,
|
|
8642
|
+
autoFocus,
|
|
8636
8643
|
label,
|
|
8637
8644
|
placeholder,
|
|
8638
8645
|
helperText,
|
|
8639
8646
|
variant,
|
|
8640
8647
|
error,
|
|
8641
|
-
onKeyDown: handleKeyDown
|
|
8648
|
+
onKeyDown: handleKeyDown,
|
|
8649
|
+
onBlur: (e) => {
|
|
8650
|
+
if (!disableOnBlurCreation) {
|
|
8651
|
+
handleAddTag();
|
|
8652
|
+
}
|
|
8653
|
+
onBlur?.(e);
|
|
8654
|
+
}
|
|
8642
8655
|
}
|
|
8643
8656
|
),
|
|
8644
8657
|
renderValue: (value, getTagProps) => value.map((option, index) => {
|
|
@@ -8676,6 +8689,7 @@ var TableDesktopTagsField = ({
|
|
|
8676
8689
|
}) => {
|
|
8677
8690
|
const [error, setError] = useState21();
|
|
8678
8691
|
const [values, setValues] = useState21([]);
|
|
8692
|
+
const valuesRef = useRef8([]);
|
|
8679
8693
|
const validateTag = (tag) => {
|
|
8680
8694
|
if (tag.length >= 30) {
|
|
8681
8695
|
return false;
|
|
@@ -8692,13 +8706,19 @@ var TableDesktopTagsField = ({
|
|
|
8692
8706
|
setError(null);
|
|
8693
8707
|
const newTags = isRemoving ? values.filter((t) => t !== tag) : [...values, tag];
|
|
8694
8708
|
setValues(newTags);
|
|
8709
|
+
valuesRef.current = newTags;
|
|
8695
8710
|
};
|
|
8696
|
-
|
|
8697
|
-
|
|
8711
|
+
const initialValueTags = useMemo6(() => {
|
|
8712
|
+
return (initialValue ?? []).map((val) => val.tag);
|
|
8698
8713
|
}, [initialValue]);
|
|
8714
|
+
useEffect12(() => {
|
|
8715
|
+
setValues(initialValueTags);
|
|
8716
|
+
valuesRef.current = initialValueTags;
|
|
8717
|
+
}, [initialValueTags]);
|
|
8699
8718
|
return /* @__PURE__ */ jsx131(Fragment15, { children: /* @__PURE__ */ jsx131(
|
|
8700
8719
|
HashtagInput,
|
|
8701
8720
|
{
|
|
8721
|
+
autoFocus: true,
|
|
8702
8722
|
label: inputLabel,
|
|
8703
8723
|
variant,
|
|
8704
8724
|
size,
|
|
@@ -8715,11 +8735,14 @@ var TableDesktopTagsField = ({
|
|
|
8715
8735
|
handleManageTags(tag, "REMOVE");
|
|
8716
8736
|
},
|
|
8717
8737
|
onBlur: () => {
|
|
8738
|
+
const currentTagsString = [...valuesRef.current].sort().join(", ");
|
|
8739
|
+
const initialTagsString = [...initialValueTags].sort().join(", ");
|
|
8740
|
+
if (currentTagsString === initialTagsString) return;
|
|
8718
8741
|
onUpdateEditableCell?.({
|
|
8719
8742
|
rowId,
|
|
8720
8743
|
columnId,
|
|
8721
|
-
value:
|
|
8722
|
-
label:
|
|
8744
|
+
value: valuesRef.current,
|
|
8745
|
+
label: valuesRef.current.join(", ")
|
|
8723
8746
|
});
|
|
8724
8747
|
}
|
|
8725
8748
|
}
|
|
@@ -8727,7 +8750,7 @@ var TableDesktopTagsField = ({
|
|
|
8727
8750
|
};
|
|
8728
8751
|
|
|
8729
8752
|
// src/components/TableDesktopEditableField/TableDesktopTextField.tsx
|
|
8730
|
-
import { useMemo as
|
|
8753
|
+
import { useMemo as useMemo7, useState as useState22, useRef as useRef9 } from "react";
|
|
8731
8754
|
import { TextField as TextField9 } from "@mui/material";
|
|
8732
8755
|
import { jsx as jsx132 } from "react/jsx-runtime";
|
|
8733
8756
|
var TableDesktopTextField = ({
|
|
@@ -8743,12 +8766,12 @@ var TableDesktopTextField = ({
|
|
|
8743
8766
|
onUpdateEditableCell
|
|
8744
8767
|
}) => {
|
|
8745
8768
|
const [input, setInput] = useState22(initialValue);
|
|
8746
|
-
const oldValue =
|
|
8747
|
-
const isDirty =
|
|
8769
|
+
const oldValue = useRef9(initialValue);
|
|
8770
|
+
const isDirty = useMemo7(
|
|
8748
8771
|
() => input !== oldValue.current,
|
|
8749
8772
|
[input, oldValue.current]
|
|
8750
8773
|
);
|
|
8751
|
-
const hasValidationError =
|
|
8774
|
+
const hasValidationError = useMemo7(
|
|
8752
8775
|
() => isDirty && validateInput && !validateInput(input),
|
|
8753
8776
|
[input, validateInput]
|
|
8754
8777
|
);
|
|
@@ -9183,8 +9206,8 @@ var TableDesktopCell = ({
|
|
|
9183
9206
|
// src/components/TableDesktopToolbar/TableDesktopToolbar.tsx
|
|
9184
9207
|
import {
|
|
9185
9208
|
useState as useState25,
|
|
9186
|
-
useMemo as
|
|
9187
|
-
useRef as
|
|
9209
|
+
useMemo as useMemo8,
|
|
9210
|
+
useRef as useRef10
|
|
9188
9211
|
} from "react";
|
|
9189
9212
|
import Download from "@mui/icons-material/Download";
|
|
9190
9213
|
import KeyboardArrowLeft2 from "@mui/icons-material/KeyboardArrowLeft";
|
|
@@ -9222,12 +9245,12 @@ var TableDesktopToolbar = ({
|
|
|
9222
9245
|
renderTableColumnConfigurationMenu,
|
|
9223
9246
|
renderInfoIcons
|
|
9224
9247
|
}) => {
|
|
9225
|
-
const scrollRef =
|
|
9248
|
+
const scrollRef = useRef10(null);
|
|
9226
9249
|
const [bulkChanges, setBulkChanges] = useState25([]);
|
|
9227
9250
|
const [isBulkChangesDialogOpen, setIsBulkChangesDialogOpen] = useState25(false);
|
|
9228
9251
|
const [isExportCsvDialogOpen, setIsExportCsvDialogOpen] = useState25(false);
|
|
9229
9252
|
const [resetCounter, setResetCounter] = useState25(0);
|
|
9230
|
-
const visibleEditableColumns =
|
|
9253
|
+
const visibleEditableColumns = useMemo8(
|
|
9231
9254
|
() => headCells.filter(
|
|
9232
9255
|
(headCell) => headCell?.enabled && !!headCell?.editableCellType
|
|
9233
9256
|
),
|