@uxf/ui 11.90.1 → 11.91.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,9 +4,9 @@ export interface ColorRadioProps<ValueType = string | number> extends Omit<FormC
4
4
  checked: boolean;
5
5
  className?: string;
6
6
  color: HexColor;
7
- colorLabel: string;
7
+ colorLabel: ReactNode;
8
8
  onChange?: (value: ValueType) => void;
9
- renderContent?: (className: string, checked: boolean | undefined, colorLabel: string, value: ValueType) => ReactNode;
9
+ renderContent?: (className: string, checked: boolean | undefined, colorLabel: ReactNode, value: ValueType) => ReactNode;
10
10
  style?: CSSProperties;
11
11
  }
12
12
  export declare const ColorRadio: React.ForwardRefExoticComponent<ColorRadioProps<string | number> & React.RefAttributes<HTMLDivElement>>;
@@ -3,7 +3,7 @@ import { FormControlProps, HexColor } from "../types";
3
3
  export type ColorRadioGroupOptionValue = HexColor;
4
4
  export interface ColorRadioGroupOption {
5
5
  disabled?: boolean;
6
- label: string;
6
+ label: ReactNode;
7
7
  value: ColorRadioGroupOptionValue;
8
8
  }
9
9
  export interface ColorRadioGroupProps extends FormControlProps<ColorRadioGroupOptionValue | null> {
@@ -11,7 +11,7 @@ export interface ColorRadioGroupProps extends FormControlProps<ColorRadioGroupOp
11
11
  helperText?: ReactNode;
12
12
  hiddenLabel?: boolean;
13
13
  id?: string;
14
- label: string;
14
+ label: ReactNode;
15
15
  options: ColorRadioGroupOption[];
16
16
  style?: CSSProperties;
17
17
  }
@@ -6,7 +6,7 @@ export interface DropzoneListProps extends FormControlProps<DropzoneFile[] | und
6
6
  errorText?: string;
7
7
  isDownloadableOnClick?: boolean;
8
8
  onRemoveConfirm?: (file: DropzoneFile) => Promise<boolean>;
9
- renderItem?: (file: DropzoneFile) => ReactNode;
9
+ renderItem?: (file: DropzoneFile, onRemove: (file: DropzoneFile, isUploading: boolean) => void, isUploading: boolean) => ReactNode;
10
10
  style?: CSSProperties;
11
11
  }
12
12
  export declare function DropzoneList(props: DropzoneListProps): React.JSX.Element | null;
@@ -48,23 +48,23 @@ const get_file_icon_1 = require("../utils/files/get-file-icon");
48
48
  function DropzoneList(props) {
49
49
  var _a, _b, _c;
50
50
  const context = (0, react_1.useContext)(context_1.UiContext);
51
- const handleRemove = (file, value, isUploading) => {
52
- var _a;
53
- if (isUploading) {
54
- (_a = file.abortController) === null || _a === void 0 ? void 0 : _a.abort();
55
- }
56
- props.onChange(value.filter((f) => f.id !== file.id));
57
- };
58
51
  const onRemove = (file, isUploading) => () => {
59
52
  if (!props.value) {
60
53
  return;
61
54
  }
55
+ const handleRemove = (value) => {
56
+ var _a;
57
+ if (isUploading) {
58
+ (_a = file.abortController) === null || _a === void 0 ? void 0 : _a.abort();
59
+ }
60
+ props.onChange(value.filter((f) => f.id !== file.id));
61
+ };
62
62
  if (!props.onRemoveConfirm) {
63
- return handleRemove(file, props.value, isUploading);
63
+ return handleRemove(props.value);
64
64
  }
65
65
  props.onRemoveConfirm(file).then((canRemove) => {
66
66
  if (canRemove && props.value) {
67
- return handleRemove(file, props.value, isUploading);
67
+ return handleRemove(props.value);
68
68
  }
69
69
  });
70
70
  };
@@ -74,7 +74,7 @@ function DropzoneList(props) {
74
74
  return (react_1.default.createElement("ul", { className: `uxf-dropzone-list ${(_b = props.className) !== null && _b !== void 0 ? _b : ""}`, style: props.style }, (_c = props.value) === null || _c === void 0 ? void 0 : _c.map((file) => {
75
75
  var _a, _b, _c;
76
76
  const isUploading = file.id < 0 && !file.error;
77
- return ((_b = (_a = props.renderItem) === null || _a === void 0 ? void 0 : _a.call(props, file)) !== null && _b !== void 0 ? _b : (react_1.default.createElement("li", { className: "uxf-dropzone-list__item-wrapper", key: file.id },
77
+ return ((_b = (_a = props.renderItem) === null || _a === void 0 ? void 0 : _a.call(props, file, onRemove, isUploading)) !== null && _b !== void 0 ? _b : (react_1.default.createElement("li", { className: "uxf-dropzone-list__item-wrapper", key: file.id },
78
78
  react_1.default.createElement("div", { className: (0, cx_1.cx)("uxf-dropzone-list__item", Boolean(file.error) && classes_1.CLASSES.IS_INVALID) },
79
79
  react_1.default.createElement("div", { className: "uxf-dropzone-list__item__block" },
80
80
  react_1.default.createElement(icon_1.Icon, { className: "uxf-dropzone-list__item__block__icon", name: (0, get_file_icon_1.getIconNameFromFileExtension)(file.extension.toLowerCase()) }),
@@ -28,7 +28,7 @@ export interface MultiComboboxProps<ValueId = MultiComboboxValueId, Option = Mul
28
28
  id?: string;
29
29
  inputArrow?: (open: boolean) => ReactNode;
30
30
  keyExtractor?: (option: Option) => string | number;
31
- label: string;
31
+ label: ReactNode;
32
32
  leftAddon?: ReactNode;
33
33
  leftElement?: ReactNode;
34
34
  loadOptions?: (query: string) => Promise<Option[]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxf/ui",
3
- "version": "11.90.1",
3
+ "version": "11.91.0",
4
4
  "description": "",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -23,10 +23,10 @@
23
23
  "dependencies": {
24
24
  "@floating-ui/react": "0.27.16",
25
25
  "@headlessui/react": "1.7.19",
26
- "@uxf/core": "11.90.0",
27
- "@uxf/core-react": "11.90.1",
26
+ "@uxf/core": "11.91.0",
27
+ "@uxf/core-react": "11.91.0",
28
28
  "@uxf/datepicker": "11.90.0",
29
- "@uxf/styles": "11.90.0",
29
+ "@uxf/styles": "11.91.0",
30
30
  "color2k": "2.0.3",
31
31
  "dayjs": "1.11.19",
32
32
  "react-dropzone": "14.3.8"