@vidispine/vdt-mui 23.2.0-pre.2 → 23.2.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.
- package/dist/cjs/_utils/generateBadges.js +1 -0
- package/dist/cjs/_utils/isDefinedValue.js +1 -0
- package/dist/cjs/_utils/omit.js +1 -0
- package/dist/cjs/_utils/showSlot.js +1 -0
- package/dist/cjs/_utils/uuidv4.js +1 -0
- package/dist/cjs/_utils/withOverrides.js +1 -0
- package/dist/cjs/collection/CollectionCard/CollectionCard.js +1 -0
- package/dist/cjs/collection/CollectionCard/components/CollectionCardMedia.js +1 -0
- package/dist/cjs/collection/CollectionCard/index.js +1 -0
- package/dist/cjs/collection/CollectionList/CollectionList.js +1 -0
- package/dist/cjs/collection/CollectionList/index.js +1 -0
- package/dist/cjs/collection/CollectionListItem/CollectionListItem.js +1 -0
- package/dist/cjs/collection/CollectionListItem/index.js +1 -0
- package/dist/cjs/collection/CollectionRepresentativeThumbnail/CollectionRepresentativeThumbnail.js +1 -0
- package/dist/cjs/collection/CollectionRepresentativeThumbnail/index.js +1 -0
- package/dist/cjs/entity/EntityAvatar/EntityAvatar.js +1 -0
- package/dist/cjs/entity/EntityAvatar/index.js +1 -0
- package/dist/cjs/entity/EntityCard/components/EntityCardActions.js +1 -0
- package/dist/cjs/entity/EntityCard/components/EntityCardBase.js +1 -0
- package/dist/cjs/entity/EntityCard/components/EntityCardContent.js +1 -0
- package/dist/cjs/entity/EntityCard/components/EntityCardHeader.js +1 -0
- package/dist/cjs/entity/EntityIcon/EntityIcon.js +1 -0
- package/dist/cjs/entity/EntityIcon/index.js +1 -0
- package/dist/cjs/entity/EntityList/EntityList.js +1 -0
- package/dist/cjs/entity/EntityList/index.js +1 -0
- package/dist/cjs/entity/EntityListItem/components/EntityListItemAvatar.js +1 -0
- package/dist/cjs/entity/EntityListItem/components/EntityListItemButton.js +1 -0
- package/dist/cjs/entity/EntityListItem/components/EntityListItemSecondaryAction.js +1 -0
- package/dist/cjs/entity/EntityListItem/components/EntityListItemText.js +1 -0
- package/dist/cjs/entity/EntityTableRow/components/EntityTableCellAvatar.js +1 -0
- package/dist/cjs/entity/EntityTableRow/components/EntityTableCellCheckbox.js +1 -0
- package/dist/cjs/entity/_utils/getEntityProp.js +1 -0
- package/dist/cjs/entity/_utils/getEntityText.js +1 -0
- package/dist/cjs/general/AvatarMenu/AvatarMenu.js +1 -0
- package/dist/cjs/general/AvatarMenu/components/Avatar.js +1 -0
- package/dist/cjs/general/AvatarMenu/components/MenuItem.js +1 -0
- package/dist/cjs/general/AvatarMenu/index.js +1 -0
- package/dist/cjs/general/BlurredBackground/BlurredBackground.js +1 -0
- package/dist/cjs/general/BlurredBackground/index.js +1 -0
- package/dist/cjs/general/CalendarPicker/CalendarPicker.js +1 -0
- package/dist/cjs/general/CalendarPicker/components/PickersDay.js +1 -0
- package/dist/cjs/general/CalendarPicker/index.js +1 -0
- package/dist/cjs/general/CalendarPicker/utils/index.js +1 -0
- package/dist/cjs/general/CompactBadge/CompactBadge.js +1 -0
- package/dist/cjs/general/CompactBadge/index.js +1 -0
- package/dist/cjs/general/CompactLabel/CompactLabel.js +1 -0
- package/dist/cjs/general/CompactLabel/index.js +1 -0
- package/dist/cjs/general/CornerLabelPlacer/CornerLabelPlacer.js +1 -0
- package/dist/cjs/general/CornerLabelPlacer/index.js +1 -0
- package/dist/cjs/general/ExpandButton/ExpandButton.js +1 -0
- package/dist/cjs/general/ExpandButton/index.js +1 -0
- package/dist/cjs/general/Form/Form.js +1 -0
- package/dist/cjs/general/Form/index.js +1 -0
- package/dist/cjs/general/ImageCollage/ImageCollage.js +1 -0
- package/dist/cjs/general/ImageCollage/index.js +1 -0
- package/dist/cjs/general/MediaIcon/MediaIcon.js +1 -0
- package/dist/cjs/general/MediaIcon/index.js +1 -0
- package/dist/cjs/general/MenuItem/MenuItem.js +1 -0
- package/dist/cjs/general/MenuItem/index.js +1 -0
- package/dist/cjs/general/ScrubLine/ScrubLine.js +1 -0
- package/dist/cjs/general/ScrubLine/index.js +1 -0
- package/dist/cjs/general/Sort/Sort.js +1 -0
- package/dist/cjs/general/Sort/components/ButtonBase.js +1 -0
- package/dist/cjs/general/Sort/components/MenuItem.js +1 -0
- package/dist/cjs/general/Sort/index.js +1 -0
- package/dist/cjs/general/TablePagination/TablePagination.js +1 -0
- package/dist/cjs/general/TablePagination/index.js +1 -0
- package/dist/cjs/general/ThemeContext/ThemeContext.js +1 -0
- package/dist/cjs/inputs/BasicDateTimeInput/BasicDateTimeInput.js +1 -0
- package/dist/cjs/inputs/BasicDateTimeInput/index.js +1 -0
- package/dist/cjs/inputs/BooleanInput/BooleanInput.js +1 -0
- package/dist/cjs/inputs/BooleanInput/index.js +1 -0
- package/dist/cjs/inputs/CheckboxGroupInput/CheckboxGroupInput.js +1 -0
- package/dist/cjs/inputs/CheckboxGroupInput/components/CheckboxGroup.js +1 -0
- package/dist/cjs/inputs/CheckboxGroupInput/index.js +1 -0
- package/dist/cjs/inputs/DateRangeInput/DateRangeInput.js +1 -0
- package/dist/cjs/inputs/DateRangeInput/components/utils/valueManagers.js +1 -0
- package/dist/cjs/inputs/DateRangeInput/index.js +1 -0
- package/dist/cjs/inputs/DateRangeInput/utils/dateHelpers.js +1 -0
- package/dist/cjs/inputs/DateTimeInput/DateTimeInput.js +1 -0
- package/dist/cjs/inputs/DateTimeInput/index.js +1 -0
- package/dist/cjs/inputs/MaskedTextInput/MaskedTextInput.js +1 -0
- package/dist/cjs/inputs/MaskedTextInput/components/MaskedInputComponent.js +1 -0
- package/dist/cjs/inputs/MaskedTextInput/index.js +1 -0
- package/dist/cjs/inputs/NumberInput/NumberInput.js +1 -0
- package/dist/cjs/inputs/NumberInput/index.js +1 -0
- package/dist/cjs/inputs/RadioGroupInput/RadioGroupInput.js +1 -0
- package/dist/cjs/inputs/RadioGroupInput/components/RadioGroup.js +1 -0
- package/dist/cjs/inputs/RadioGroupInput/index.js +1 -0
- package/dist/cjs/inputs/SelectInput/SelectInput.js +1 -0
- package/dist/cjs/inputs/SelectInput/index.js +1 -0
- package/dist/cjs/inputs/SliderInput/SliderInput.js +1 -0
- package/dist/cjs/inputs/SliderInput/components/Slider.js +1 -0
- package/dist/cjs/inputs/SliderInput/index.js +1 -0
- package/dist/cjs/inputs/TagInput/TagInput.js +1 -0
- package/dist/cjs/inputs/TagInput/index.js +1 -0
- package/dist/cjs/inputs/TextInput/TextInput.js +1 -0
- package/dist/cjs/inputs/TextInput/index.js +1 -0
- package/dist/cjs/inputs/_components/FormControlLabel.js +1 -0
- package/dist/cjs/inputs/_components/MenuItem.js +1 -0
- package/dist/cjs/item/ItemCard/ItemCard.js +1 -0
- package/dist/cjs/item/ItemCard/components/ItemCardMedia.js +1 -0
- package/dist/cjs/item/ItemCard/index.js +1 -0
- package/dist/cjs/item/ItemList/ItemList.js +1 -0
- package/dist/cjs/item/ItemList/index.js +1 -0
- package/dist/cjs/item/ItemListItem/ItemListItem.js +1 -0
- package/dist/cjs/item/ItemListItem/index.js +1 -0
- package/dist/cjs/item/ItemPoster/ItemPoster.js +1 -0
- package/dist/cjs/item/ItemPoster/index.js +1 -0
- package/dist/cjs/item/ItemPosterList/ItemPosterList.js +1 -0
- package/dist/cjs/item/ItemPosterList/index.js +1 -0
- package/dist/cjs/item/ItemPosterViewer/ItemPosterViewer.js +1 -0
- package/dist/cjs/item/ItemPosterViewer/components/Toolbar.js +1 -0
- package/dist/cjs/item/ItemPosterViewer/index.js +1 -0
- package/dist/cjs/item/ItemTable/ItemTable.js +1 -0
- package/dist/cjs/item/ItemTable/components/ItemTableHead.js +1 -0
- package/dist/cjs/item/ItemTable/index.js +1 -0
- package/dist/cjs/item/ItemTableRow/ItemTableRow.js +1 -0
- package/dist/cjs/item/ItemTableRow/index.js +1 -0
- package/dist/cjs/item/ItemThumbnail/ItemThumbnail.js +1 -0
- package/dist/cjs/item/ItemThumbnail/index.js +1 -0
- package/dist/cjs/search/SearchFilterForm/SearchFilterForm.js +1 -0
- package/dist/cjs/search/SearchFilterForm/hooks/UseSearchFilterFormInputs.js +1 -0
- package/dist/cjs/search/SearchFilterForm/index.js +1 -0
- package/dist/cjs/search/SearchFilterForm/utils/mapValuesToFilter.js +1 -0
- package/dist/cjs/shape/ShapeMediaBadges/ShapeMediaBadges.js +1 -0
- package/dist/cjs/shape/ShapeMediaBadges/index.js +1 -0
- package/dist/cjs/transcode/TranscodePresetMediaBadges/TranscodePresetMediaBadges.js +1 -0
- package/dist/cjs/transcode/TranscodePresetMediaBadges/index.js +1 -0
- package/dist/es/_utils/generateBadges.js +75 -0
- package/dist/es/_utils/isDefinedValue.js +6 -0
- package/dist/es/_utils/omit.js +9 -0
- package/dist/es/_utils/showSlot.js +4 -0
- package/dist/es/_utils/uuidv4.js +7 -0
- package/dist/es/_utils/withOverrides.js +37 -0
- package/dist/es/collection/CollectionCard/CollectionCard.js +292 -0
- package/dist/es/collection/CollectionCard/components/CollectionCardMedia.js +14 -0
- package/dist/es/collection/CollectionCard/index.js +11 -0
- package/dist/es/collection/CollectionList/CollectionList.js +159 -0
- package/dist/es/collection/CollectionList/index.js +11 -0
- package/dist/es/collection/CollectionListItem/CollectionListItem.js +122 -0
- package/dist/es/collection/CollectionListItem/index.js +11 -0
- package/dist/es/collection/CollectionRepresentativeThumbnail/CollectionRepresentativeThumbnail.js +169 -0
- package/dist/es/collection/CollectionRepresentativeThumbnail/index.js +11 -0
- package/dist/es/entity/EntityAvatar/EntityAvatar.js +102 -0
- package/dist/es/entity/EntityAvatar/index.js +11 -0
- package/dist/es/entity/EntityCard/components/EntityCardActions.js +68 -0
- package/dist/es/entity/EntityCard/components/EntityCardBase.js +43 -0
- package/dist/es/entity/EntityCard/components/EntityCardContent.js +34 -0
- package/dist/es/entity/EntityCard/components/EntityCardHeader.js +115 -0
- package/dist/es/entity/EntityIcon/EntityIcon.js +107 -0
- package/dist/es/entity/EntityIcon/index.js +11 -0
- package/dist/es/entity/EntityList/EntityList.js +211 -0
- package/dist/es/entity/EntityList/index.js +11 -0
- package/dist/es/entity/EntityListItem/components/EntityListItemAvatar.js +26 -0
- package/dist/es/entity/EntityListItem/components/EntityListItemButton.js +27 -0
- package/dist/es/entity/EntityListItem/components/EntityListItemSecondaryAction.js +27 -0
- package/dist/es/entity/EntityListItem/components/EntityListItemText.js +26 -0
- package/dist/es/entity/EntityTableRow/components/EntityTableCellAvatar.js +26 -0
- package/dist/es/entity/EntityTableRow/components/EntityTableCellCheckbox.js +19 -0
- package/dist/es/entity/_utils/getEntityProp.js +11 -0
- package/dist/es/entity/_utils/getEntityText.js +34 -0
- package/dist/es/general/AvatarMenu/AvatarMenu.js +153 -0
- package/dist/es/general/AvatarMenu/components/Avatar.js +30 -0
- package/dist/es/general/AvatarMenu/components/MenuItem.js +29 -0
- package/dist/es/general/AvatarMenu/index.js +11 -0
- package/dist/es/general/BlurredBackground/BlurredBackground.js +85 -0
- package/dist/es/general/BlurredBackground/index.js +11 -0
- package/dist/es/general/CalendarPicker/CalendarPicker.js +397 -0
- package/dist/es/general/CalendarPicker/components/PickersDay.js +71 -0
- package/dist/es/general/CalendarPicker/index.js +11 -0
- package/dist/es/general/CalendarPicker/utils/index.js +17 -0
- package/dist/es/general/CompactBadge/CompactBadge.js +65 -0
- package/dist/es/general/CompactBadge/index.js +11 -0
- package/dist/es/general/CompactLabel/CompactLabel.js +70 -0
- package/dist/es/general/CompactLabel/index.js +11 -0
- package/dist/es/general/CornerLabelPlacer/CornerLabelPlacer.js +105 -0
- package/dist/es/general/CornerLabelPlacer/index.js +11 -0
- package/dist/es/general/ExpandButton/ExpandButton.js +81 -0
- package/dist/es/general/ExpandButton/index.js +11 -0
- package/dist/es/general/Form/Form.js +230 -0
- package/dist/es/general/Form/index.js +11 -0
- package/dist/es/general/ImageCollage/ImageCollage.js +151 -0
- package/dist/es/general/ImageCollage/index.js +11 -0
- package/dist/es/general/MediaIcon/MediaIcon.js +101 -0
- package/dist/es/general/MediaIcon/index.js +11 -0
- package/dist/es/general/MenuItem/MenuItem.js +91 -0
- package/dist/es/general/MenuItem/index.js +11 -0
- package/dist/es/general/ScrubLine/ScrubLine.js +141 -0
- package/dist/es/general/ScrubLine/index.js +11 -0
- package/dist/es/general/Sort/Sort.js +179 -0
- package/dist/es/general/Sort/components/ButtonBase.js +19 -0
- package/dist/es/general/Sort/components/MenuItem.js +15 -0
- package/dist/es/general/Sort/index.js +11 -0
- package/dist/es/general/TablePagination/TablePagination.js +104 -0
- package/dist/es/general/TablePagination/index.js +11 -0
- package/dist/es/general/ThemeContext/ThemeContext.js +96 -0
- package/dist/es/inputs/BasicDateTimeInput/BasicDateTimeInput.js +133 -0
- package/dist/es/inputs/BasicDateTimeInput/index.js +11 -0
- package/dist/es/inputs/BooleanInput/BooleanInput.js +196 -0
- package/dist/es/inputs/BooleanInput/index.js +11 -0
- package/dist/es/inputs/CheckboxGroupInput/CheckboxGroupInput.js +292 -0
- package/dist/es/inputs/CheckboxGroupInput/components/CheckboxGroup.js +81 -0
- package/dist/es/inputs/CheckboxGroupInput/index.js +11 -0
- package/dist/es/inputs/DateRangeInput/DateRangeInput.js +362 -0
- package/dist/es/inputs/DateRangeInput/components/utils/valueManagers.js +20 -0
- package/dist/es/inputs/DateRangeInput/index.js +11 -0
- package/dist/es/inputs/DateRangeInput/utils/dateHelpers.js +31 -0
- package/dist/es/inputs/DateTimeInput/DateTimeInput.js +250 -0
- package/dist/es/inputs/DateTimeInput/index.js +11 -0
- package/dist/es/inputs/MaskedTextInput/MaskedTextInput.js +235 -0
- package/dist/es/inputs/MaskedTextInput/components/MaskedInputComponent.js +13 -0
- package/dist/es/inputs/MaskedTextInput/index.js +11 -0
- package/dist/es/inputs/NumberInput/NumberInput.js +134 -0
- package/dist/es/inputs/NumberInput/index.js +11 -0
- package/dist/es/inputs/RadioGroupInput/RadioGroupInput.js +287 -0
- package/dist/es/inputs/RadioGroupInput/components/RadioGroup.js +72 -0
- package/dist/es/inputs/RadioGroupInput/index.js +11 -0
- package/dist/es/inputs/SelectInput/SelectInput.js +195 -0
- package/dist/es/inputs/SelectInput/index.js +11 -0
- package/dist/es/inputs/SliderInput/SliderInput.js +350 -0
- package/dist/es/inputs/SliderInput/components/Slider.js +124 -0
- package/dist/es/inputs/SliderInput/index.js +11 -0
- package/dist/es/inputs/TagInput/TagInput.js +356 -0
- package/dist/es/inputs/TagInput/index.js +11 -0
- package/dist/es/inputs/TextInput/TextInput.js +154 -0
- package/dist/es/inputs/TextInput/index.js +11 -0
- package/dist/es/inputs/_components/FormControlLabel.js +60 -0
- package/dist/es/inputs/_components/MenuItem.js +23 -0
- package/dist/es/item/ItemCard/ItemCard.js +293 -0
- package/dist/es/item/ItemCard/components/ItemCardMedia.js +20 -0
- package/dist/es/item/ItemCard/index.js +11 -0
- package/dist/es/item/ItemList/ItemList.js +158 -0
- package/dist/es/item/ItemList/index.js +11 -0
- package/dist/es/item/ItemListItem/ItemListItem.js +122 -0
- package/dist/es/item/ItemListItem/index.js +11 -0
- package/dist/es/item/ItemPoster/ItemPoster.js +132 -0
- package/dist/es/item/ItemPoster/index.js +11 -0
- package/dist/es/item/ItemPosterList/ItemPosterList.js +99 -0
- package/dist/es/item/ItemPosterList/index.js +11 -0
- package/dist/es/item/ItemPosterViewer/ItemPosterViewer.js +190 -0
- package/dist/es/item/ItemPosterViewer/components/Toolbar.js +27 -0
- package/dist/es/item/ItemPosterViewer/index.js +11 -0
- package/dist/es/item/ItemTable/ItemTable.js +201 -0
- package/dist/es/item/ItemTable/components/ItemTableHead.js +35 -0
- package/dist/es/item/ItemTable/index.js +11 -0
- package/dist/es/item/ItemTableRow/ItemTableRow.js +150 -0
- package/dist/es/item/ItemTableRow/index.js +11 -0
- package/dist/es/item/ItemThumbnail/ItemThumbnail.js +210 -0
- package/dist/es/item/ItemThumbnail/index.js +11 -0
- package/dist/es/search/SearchFilterForm/SearchFilterForm.js +138 -0
- package/dist/es/search/SearchFilterForm/hooks/UseSearchFilterFormInputs.js +130 -0
- package/dist/es/search/SearchFilterForm/index.js +12 -0
- package/dist/es/search/SearchFilterForm/utils/mapValuesToFilter.js +84 -0
- package/dist/es/shape/ShapeMediaBadges/ShapeMediaBadges.js +78 -0
- package/dist/es/shape/ShapeMediaBadges/index.js +11 -0
- package/dist/es/transcode/TranscodePresetMediaBadges/TranscodePresetMediaBadges.js +78 -0
- package/dist/es/transcode/TranscodePresetMediaBadges/index.js +11 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.es.js +93 -0
- package/package.json +35 -19
- package/dist/index.js +0 -13109
- package/dist/index.umd.cjs +0 -6
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as r, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import n from "@mui/material/Checkbox";
|
|
3
|
+
import x from "@mui/material/Skeleton";
|
|
4
|
+
import i from "@mui/material/TableCell";
|
|
5
|
+
import f from "@mui/material/TableHead";
|
|
6
|
+
import b from "@mui/material/TableRow";
|
|
7
|
+
function w({
|
|
8
|
+
rows: m,
|
|
9
|
+
isLoading: c,
|
|
10
|
+
checked: d,
|
|
11
|
+
showAvatar: h,
|
|
12
|
+
indeterminate: t,
|
|
13
|
+
onCheck: a,
|
|
14
|
+
...p
|
|
15
|
+
}) {
|
|
16
|
+
return /* @__PURE__ */ r(f, { ...p, children: /* @__PURE__ */ l(b, { children: [
|
|
17
|
+
a && /* @__PURE__ */ r(i, { padding: "checkbox", children: c ? /* @__PURE__ */ r(x, { sx: {
|
|
18
|
+
width: "18px",
|
|
19
|
+
height: "36px",
|
|
20
|
+
margin: "auto"
|
|
21
|
+
} }) : /* @__PURE__ */ r(n, { checked: d || t, indeterminate: t, onChange: (o) => {
|
|
22
|
+
var e;
|
|
23
|
+
return a(o, {
|
|
24
|
+
value: (e = o == null ? void 0 : o.target) == null ? void 0 : e.checked
|
|
25
|
+
});
|
|
26
|
+
} }) }),
|
|
27
|
+
h && /* @__PURE__ */ r(i, { padding: "checkbox" }),
|
|
28
|
+
m.map(({
|
|
29
|
+
label: o
|
|
30
|
+
}, e) => /* @__PURE__ */ r(i, { children: o }, o || e))
|
|
31
|
+
] }) });
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
w as default
|
|
35
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { styled as r } from "@mui/material/styles";
|
|
2
|
+
import { withOverrides as m } from "../../_utils/withOverrides.js";
|
|
3
|
+
import n from "./ItemTable.js";
|
|
4
|
+
const e = "ItemTable", o = `Vdt${e}`, s = m(o)(n), i = r(s, {
|
|
5
|
+
name: o,
|
|
6
|
+
overridesResolver: (a, t) => t.root
|
|
7
|
+
})(() => ({}));
|
|
8
|
+
i.displayName = e;
|
|
9
|
+
export {
|
|
10
|
+
i as default
|
|
11
|
+
};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { jsxs as R, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as g, useState as V } from "react";
|
|
3
|
+
import e from "prop-types";
|
|
4
|
+
import E from "@mui/material/TableRow";
|
|
5
|
+
import I from "@mui/material/TableCell";
|
|
6
|
+
import M from "@mui/material/Skeleton";
|
|
7
|
+
import S from "@mui/material/Checkbox";
|
|
8
|
+
import { styled as q } from "@mui/material/styles";
|
|
9
|
+
import N from "@vidispine/proptypes";
|
|
10
|
+
import { uuidv4 as P } from "../../_utils/uuidv4.js";
|
|
11
|
+
import "clsx";
|
|
12
|
+
import { getEntityText as U } from "../../entity/_utils/getEntityText.js";
|
|
13
|
+
import z from "../../entity/EntityTableRow/components/EntityTableCellAvatar.js";
|
|
14
|
+
import B from "../../entity/EntityTableRow/components/EntityTableCellCheckbox.js";
|
|
15
|
+
const D = q(E)(({
|
|
16
|
+
onClick: t
|
|
17
|
+
}) => ({
|
|
18
|
+
...t ? {
|
|
19
|
+
cursor: "pointer"
|
|
20
|
+
} : {}
|
|
21
|
+
})), F = {
|
|
22
|
+
Root: D,
|
|
23
|
+
TableCell: I,
|
|
24
|
+
TableCellAvatar: z,
|
|
25
|
+
TableCellCheckbox: B,
|
|
26
|
+
Checkbox: S
|
|
27
|
+
};
|
|
28
|
+
function h({
|
|
29
|
+
itemType: t,
|
|
30
|
+
rows: b,
|
|
31
|
+
defaultValue: s,
|
|
32
|
+
checked: c,
|
|
33
|
+
showAvatar: d,
|
|
34
|
+
avatarVariant: u,
|
|
35
|
+
isLoading: n,
|
|
36
|
+
onClick: f,
|
|
37
|
+
onCheck: p,
|
|
38
|
+
components: v,
|
|
39
|
+
componentsProps: l
|
|
40
|
+
}) {
|
|
41
|
+
const {
|
|
42
|
+
Root: k,
|
|
43
|
+
TableCell: T,
|
|
44
|
+
TableCellAvatar: x,
|
|
45
|
+
TableCellCheckbox: y,
|
|
46
|
+
Checkbox: O
|
|
47
|
+
} = v, A = g(() => b.map(({
|
|
48
|
+
value: o
|
|
49
|
+
} = {}) => U(o, {
|
|
50
|
+
itemType: t
|
|
51
|
+
}) || s), [t, s, b]), [j, w] = V(!1), i = c === void 0 ? j : c, m = typeof p != "function" ? void 0 : (o) => {
|
|
52
|
+
const a = !i;
|
|
53
|
+
p(o, {
|
|
54
|
+
value: a,
|
|
55
|
+
itemType: t
|
|
56
|
+
}), c === void 0 && w(a);
|
|
57
|
+
};
|
|
58
|
+
return /* @__PURE__ */ R(k, { hover: !0, selected: i, onClick: typeof f != "function" ? void 0 : (o) => {
|
|
59
|
+
var a, C;
|
|
60
|
+
((a = o == null ? void 0 : o.target) == null ? void 0 : a.nodeName) === "INPUT" && ((C = o == null ? void 0 : o.target) == null ? void 0 : C.checked) !== void 0 || f(o, {
|
|
61
|
+
itemType: t
|
|
62
|
+
});
|
|
63
|
+
}, ...l.root, children: [
|
|
64
|
+
m && /* @__PURE__ */ r(y, { itemType: t, isLoading: n, ...l.tableCellCheckbox, children: /* @__PURE__ */ r(O, { checked: i, onChange: m, ...l.checkbox }) }),
|
|
65
|
+
d && /* @__PURE__ */ r(x, { itemType: t, isLoading: n, variant: u, ...l.tableCellAvatar }),
|
|
66
|
+
A.map((o) => /* @__PURE__ */ r(T, { ...l.tableCell, children: n ? /* @__PURE__ */ r(M, {}) : o }, P()))
|
|
67
|
+
] });
|
|
68
|
+
}
|
|
69
|
+
h.propTypes = {
|
|
70
|
+
/**
|
|
71
|
+
* The `ItemType` to show
|
|
72
|
+
*/
|
|
73
|
+
itemType: N.ItemType,
|
|
74
|
+
/**
|
|
75
|
+
* A list of what item content to display in the table rows
|
|
76
|
+
*/
|
|
77
|
+
rows: e.arrayOf(e.shape({
|
|
78
|
+
value: e.oneOfType([e.node, e.func])
|
|
79
|
+
})),
|
|
80
|
+
/**
|
|
81
|
+
* Add a default value for all row values that are empty
|
|
82
|
+
*/
|
|
83
|
+
defaultValue: e.string,
|
|
84
|
+
/**
|
|
85
|
+
* Set if avatar should be shown on row
|
|
86
|
+
*/
|
|
87
|
+
showAvatar: e.bool,
|
|
88
|
+
/**
|
|
89
|
+
* Whether the checkbox is checked or not
|
|
90
|
+
*/
|
|
91
|
+
checked: e.bool,
|
|
92
|
+
/**
|
|
93
|
+
* Variant/shapes for the Avatar
|
|
94
|
+
*/
|
|
95
|
+
avatarVariant: e.oneOf(["circular", "rounded", "square"]),
|
|
96
|
+
/**
|
|
97
|
+
* Show skeleton table item as loading state
|
|
98
|
+
*/
|
|
99
|
+
isLoading: e.bool,
|
|
100
|
+
// Callbacks
|
|
101
|
+
/**
|
|
102
|
+
* A function that handles the item being clicked
|
|
103
|
+
*/
|
|
104
|
+
onClick: e.func,
|
|
105
|
+
/**
|
|
106
|
+
* A function that handles the checkbox being clicked
|
|
107
|
+
*/
|
|
108
|
+
onCheck: e.func,
|
|
109
|
+
// Overrides
|
|
110
|
+
/**
|
|
111
|
+
* Replace internal components
|
|
112
|
+
*/
|
|
113
|
+
components: e.shape({
|
|
114
|
+
Root: e.elementType,
|
|
115
|
+
TableCell: e.elementType,
|
|
116
|
+
TableCellAvatar: e.elementType,
|
|
117
|
+
TableCellCheckbox: e.elementType,
|
|
118
|
+
Checkbox: e.elementType
|
|
119
|
+
}),
|
|
120
|
+
/**
|
|
121
|
+
* Add internal component props
|
|
122
|
+
*/
|
|
123
|
+
componentsProps: e.shape({
|
|
124
|
+
root: e.instanceOf(Object),
|
|
125
|
+
tableCell: e.instanceOf(Object),
|
|
126
|
+
tableCellAvatar: e.shape({
|
|
127
|
+
entityAvatar: e.instanceOf(Object)
|
|
128
|
+
}),
|
|
129
|
+
tableCellCheckbox: e.shape({
|
|
130
|
+
checkbox: e.instanceOf(Object)
|
|
131
|
+
}),
|
|
132
|
+
checkbox: e.instanceOf(Object)
|
|
133
|
+
})
|
|
134
|
+
};
|
|
135
|
+
h.defaultProps = {
|
|
136
|
+
itemType: void 0,
|
|
137
|
+
defaultValue: void 0,
|
|
138
|
+
rows: [],
|
|
139
|
+
checked: void 0,
|
|
140
|
+
showAvatar: !0,
|
|
141
|
+
avatarVariant: "square",
|
|
142
|
+
isLoading: !1,
|
|
143
|
+
onClick: void 0,
|
|
144
|
+
onCheck: void 0,
|
|
145
|
+
components: F,
|
|
146
|
+
componentsProps: void 0
|
|
147
|
+
};
|
|
148
|
+
export {
|
|
149
|
+
h as default
|
|
150
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { styled as r } from "@mui/material/styles";
|
|
2
|
+
import { withOverrides as m } from "../../_utils/withOverrides.js";
|
|
3
|
+
import n from "./ItemTableRow.js";
|
|
4
|
+
const o = "ItemTableRow", e = `Vdt${o}`, s = m(e)(n), i = r(s, {
|
|
5
|
+
name: e,
|
|
6
|
+
overridesResolver: (a, t) => t.root
|
|
7
|
+
})(() => ({}));
|
|
8
|
+
i.displayName = o;
|
|
9
|
+
export {
|
|
10
|
+
i as default
|
|
11
|
+
};
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { jsx as i, jsxs as T } from "react/jsx-runtime";
|
|
2
|
+
import e from "prop-types";
|
|
3
|
+
import s from "@mui/material/Box";
|
|
4
|
+
import { styled as t } from "@mui/material/styles";
|
|
5
|
+
import w from "@vidispine/proptypes";
|
|
6
|
+
import "../../general/AvatarMenu/index.js";
|
|
7
|
+
import O from "../../general/BlurredBackground/index.js";
|
|
8
|
+
import "../../general/CalendarPicker/index.js";
|
|
9
|
+
import "../../general/CompactBadge/index.js";
|
|
10
|
+
import "../../general/CompactLabel/index.js";
|
|
11
|
+
import j from "../../general/CornerLabelPlacer/index.js";
|
|
12
|
+
import "../../general/ExpandButton/index.js";
|
|
13
|
+
import "../../general/ImageCollage/index.js";
|
|
14
|
+
import "../../general/MediaIcon/index.js";
|
|
15
|
+
import "../../general/MenuItem/index.js";
|
|
16
|
+
import z from "../../general/ScrubLine/index.js";
|
|
17
|
+
import "../../general/Sort/index.js";
|
|
18
|
+
import "../../general/TablePagination/index.js";
|
|
19
|
+
import "../../general/ThemeContext/ThemeContext.js";
|
|
20
|
+
const R = t(s)(({
|
|
21
|
+
onClick: o
|
|
22
|
+
}) => ({
|
|
23
|
+
height: "100%",
|
|
24
|
+
width: "100%",
|
|
25
|
+
...o && {
|
|
26
|
+
cursor: "pointer"
|
|
27
|
+
}
|
|
28
|
+
})), V = t(z)(() => ({
|
|
29
|
+
position: "relative",
|
|
30
|
+
zIndex: 10
|
|
31
|
+
})), $ = t(j)(() => ({
|
|
32
|
+
height: "100%",
|
|
33
|
+
width: "100%",
|
|
34
|
+
position: "absolute",
|
|
35
|
+
zIndex: 15,
|
|
36
|
+
top: 0
|
|
37
|
+
})), E = t(O)(() => ({
|
|
38
|
+
height: "100%",
|
|
39
|
+
width: "100%",
|
|
40
|
+
position: "absolute",
|
|
41
|
+
zIndex: 0,
|
|
42
|
+
top: 0
|
|
43
|
+
})), F = t(s, {
|
|
44
|
+
shouldForwardProp: (o) => !["image", "cover"].includes(o)
|
|
45
|
+
})(({
|
|
46
|
+
image: o,
|
|
47
|
+
cover: n
|
|
48
|
+
}) => ({
|
|
49
|
+
height: "inherit",
|
|
50
|
+
width: "inherit",
|
|
51
|
+
position: "relative",
|
|
52
|
+
zIndex: 5,
|
|
53
|
+
transition: "all .3s ease-in-out",
|
|
54
|
+
background: o ? `url(${o})` : "none",
|
|
55
|
+
backgroundPosition: "center",
|
|
56
|
+
backgroundRepeat: "no-repeat",
|
|
57
|
+
...n ? {
|
|
58
|
+
backgroundSize: "cover"
|
|
59
|
+
} : {
|
|
60
|
+
backgroundSize: "contain"
|
|
61
|
+
}
|
|
62
|
+
})), q = {
|
|
63
|
+
Root: R,
|
|
64
|
+
ScrubLine: V,
|
|
65
|
+
CornerLabelPlacer: $,
|
|
66
|
+
BlurredBackground: E,
|
|
67
|
+
ImageBox: F
|
|
68
|
+
};
|
|
69
|
+
function u({
|
|
70
|
+
itemType: o,
|
|
71
|
+
thumbnailIndex: n,
|
|
72
|
+
placeholderImage: p,
|
|
73
|
+
showBlurredBackground: m,
|
|
74
|
+
label: b,
|
|
75
|
+
cover: g,
|
|
76
|
+
showScrub: h,
|
|
77
|
+
scrubLabel: f,
|
|
78
|
+
scrubPosition: B,
|
|
79
|
+
onClick: l,
|
|
80
|
+
onMouseMove: v,
|
|
81
|
+
onMouseEnter: y,
|
|
82
|
+
onMouseLeave: k,
|
|
83
|
+
components: x,
|
|
84
|
+
componentsProps: r
|
|
85
|
+
}) {
|
|
86
|
+
var d;
|
|
87
|
+
const {
|
|
88
|
+
Root: L,
|
|
89
|
+
ScrubLine: S,
|
|
90
|
+
BlurredBackground: I,
|
|
91
|
+
ImageBox: C,
|
|
92
|
+
CornerLabelPlacer: M
|
|
93
|
+
} = x, {
|
|
94
|
+
thumbnails: c
|
|
95
|
+
} = o || {}, a = ((d = c == null ? void 0 : c.uri) == null ? void 0 : d[n]) || p;
|
|
96
|
+
return /* @__PURE__ */ i(L, { onClick: typeof l != "function" ? void 0 : (P) => {
|
|
97
|
+
l(P, {
|
|
98
|
+
itemType: o,
|
|
99
|
+
thumbnailIndex: n
|
|
100
|
+
});
|
|
101
|
+
}, ...r.root, children: /* @__PURE__ */ T(S, { show: h, label: f, position: B, onMouseMove: v, onMouseEnter: y, onMouseLeave: k, ...r.scrubLine, children: [
|
|
102
|
+
m && /* @__PURE__ */ i(I, { image: a, ...r.blurredBackground }),
|
|
103
|
+
/* @__PURE__ */ i(C, { component: "div", image: a, cover: g, ...r.imageBox }),
|
|
104
|
+
/* @__PURE__ */ i(M, { labelBottomRight: b, ...r.cornerLabelPlacer })
|
|
105
|
+
] }) });
|
|
106
|
+
}
|
|
107
|
+
u.propTypes = {
|
|
108
|
+
/**
|
|
109
|
+
* ItemType
|
|
110
|
+
*/
|
|
111
|
+
itemType: w.ItemType,
|
|
112
|
+
/**
|
|
113
|
+
* The index for which thumbnail to use from the ItemType
|
|
114
|
+
*/
|
|
115
|
+
thumbnailIndex: e.number,
|
|
116
|
+
/**
|
|
117
|
+
* Add a placeholder if image is unavailable
|
|
118
|
+
*/
|
|
119
|
+
placeholderImage: e.string,
|
|
120
|
+
/**
|
|
121
|
+
* Show a label on the thumbnail
|
|
122
|
+
*/
|
|
123
|
+
label: e.string,
|
|
124
|
+
/**
|
|
125
|
+
* Cover the whole width/height of container
|
|
126
|
+
*/
|
|
127
|
+
cover: e.bool,
|
|
128
|
+
/**
|
|
129
|
+
* Whether to show a blurred background behind the thumbnail or not
|
|
130
|
+
*/
|
|
131
|
+
showBlurredBackground: e.bool,
|
|
132
|
+
/**
|
|
133
|
+
* Show a scrub line above the thumbnail
|
|
134
|
+
*/
|
|
135
|
+
showScrub: e.bool,
|
|
136
|
+
/**
|
|
137
|
+
* Set position for the scrub line
|
|
138
|
+
*/
|
|
139
|
+
scrubPosition: e.number,
|
|
140
|
+
/**
|
|
141
|
+
* Show a label for the scrub line
|
|
142
|
+
*/
|
|
143
|
+
scrubLabel: e.string,
|
|
144
|
+
// Callbacks
|
|
145
|
+
/**
|
|
146
|
+
* Add event handler when the thumbnail is clicked
|
|
147
|
+
*
|
|
148
|
+
* Set `undefined` to disable
|
|
149
|
+
*/
|
|
150
|
+
onClick: e.func,
|
|
151
|
+
/**
|
|
152
|
+
* Callback when mouse moves over thumbnail
|
|
153
|
+
*
|
|
154
|
+
* e.g. to handle scrubbing
|
|
155
|
+
*/
|
|
156
|
+
onMouseMove: e.func,
|
|
157
|
+
/**
|
|
158
|
+
* Callback for mouse entering thumbnail
|
|
159
|
+
*
|
|
160
|
+
* e.g. to handle scrubbing or showing label/blurred background
|
|
161
|
+
*/
|
|
162
|
+
onMouseEnter: e.func,
|
|
163
|
+
/**
|
|
164
|
+
* Callback for mouse leaving thumbnail
|
|
165
|
+
*
|
|
166
|
+
* e.g. to handle scrubbing or hiding label/blurred background
|
|
167
|
+
*/
|
|
168
|
+
onMouseLeave: e.func,
|
|
169
|
+
// Overrides
|
|
170
|
+
/**
|
|
171
|
+
* Replace internal components
|
|
172
|
+
*/
|
|
173
|
+
components: e.shape({
|
|
174
|
+
Root: e.elementType,
|
|
175
|
+
ScrubLine: e.elementType,
|
|
176
|
+
BlurredBackground: e.elementType,
|
|
177
|
+
ImageBox: e.elementType,
|
|
178
|
+
CornerLabelPlacer: e.elementType
|
|
179
|
+
}),
|
|
180
|
+
/**
|
|
181
|
+
* Add internal component props
|
|
182
|
+
*/
|
|
183
|
+
componentsProps: e.shape({
|
|
184
|
+
root: e.instanceOf(Object),
|
|
185
|
+
scrubLine: e.instanceOf(Object),
|
|
186
|
+
blurredBackground: e.instanceOf(Object),
|
|
187
|
+
imageBox: e.instanceOf(Object),
|
|
188
|
+
cornerLabelPlacer: e.instanceOf(Object)
|
|
189
|
+
})
|
|
190
|
+
};
|
|
191
|
+
u.defaultProps = {
|
|
192
|
+
itemType: void 0,
|
|
193
|
+
thumbnailIndex: 0,
|
|
194
|
+
label: void 0,
|
|
195
|
+
placeholderImage: void 0,
|
|
196
|
+
showBlurredBackground: !1,
|
|
197
|
+
cover: !1,
|
|
198
|
+
showScrub: !1,
|
|
199
|
+
scrubLabel: void 0,
|
|
200
|
+
scrubPosition: 0,
|
|
201
|
+
onClick: void 0,
|
|
202
|
+
onMouseMove: void 0,
|
|
203
|
+
onMouseEnter: void 0,
|
|
204
|
+
onMouseLeave: void 0,
|
|
205
|
+
components: q,
|
|
206
|
+
componentsProps: void 0
|
|
207
|
+
};
|
|
208
|
+
export {
|
|
209
|
+
u as default
|
|
210
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { styled as m } from "@mui/material/styles";
|
|
2
|
+
import { withOverrides as r } from "../../_utils/withOverrides.js";
|
|
3
|
+
import n from "./ItemThumbnail.js";
|
|
4
|
+
const o = "ItemThumbnail", e = `Vdt${o}`, i = r(e)(n), s = m(i, {
|
|
5
|
+
name: e,
|
|
6
|
+
overridesResolver: (a, t) => t.root
|
|
7
|
+
})(() => ({}));
|
|
8
|
+
s.displayName = o;
|
|
9
|
+
export {
|
|
10
|
+
s as default
|
|
11
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import o from "prop-types";
|
|
3
|
+
import x from "@mui/material/Box";
|
|
4
|
+
import l from "@vidispine/proptypes";
|
|
5
|
+
import L from "../../general/Form/index.js";
|
|
6
|
+
import M from "./hooks/UseSearchFilterFormInputs.js";
|
|
7
|
+
import g from "./utils/mapValuesToFilter.js";
|
|
8
|
+
const E = {
|
|
9
|
+
Root: x,
|
|
10
|
+
Form: L
|
|
11
|
+
};
|
|
12
|
+
function m({
|
|
13
|
+
fieldList: u,
|
|
14
|
+
facetList: h,
|
|
15
|
+
dataToPropsMap: y,
|
|
16
|
+
includeFacetsAsOptions: v,
|
|
17
|
+
inputsProps: O,
|
|
18
|
+
mapValuesToFilter: r,
|
|
19
|
+
onClear: i,
|
|
20
|
+
onReset: p,
|
|
21
|
+
onChange: s,
|
|
22
|
+
onSubmit: a,
|
|
23
|
+
onError: c,
|
|
24
|
+
components: F,
|
|
25
|
+
componentsProps: f
|
|
26
|
+
}) {
|
|
27
|
+
const {
|
|
28
|
+
Root: b,
|
|
29
|
+
Form: T
|
|
30
|
+
} = F, n = M({
|
|
31
|
+
fieldList: u,
|
|
32
|
+
facetList: h,
|
|
33
|
+
dataToPropsMap: y,
|
|
34
|
+
includeFacetsAsOptions: v,
|
|
35
|
+
inputsProps: O
|
|
36
|
+
}), C = typeof i != "function" ? void 0 : (e, t) => {
|
|
37
|
+
i(e, r(t, n));
|
|
38
|
+
}, P = typeof p != "function" ? void 0 : (e, t) => {
|
|
39
|
+
p(e, r(t, n));
|
|
40
|
+
}, R = typeof s != "function" ? void 0 : (e, t) => {
|
|
41
|
+
s(e, r(t, n));
|
|
42
|
+
}, S = typeof a != "function" ? void 0 : (e, t) => {
|
|
43
|
+
a(e, r(t, n));
|
|
44
|
+
}, j = typeof c != "function" ? void 0 : (e, t) => {
|
|
45
|
+
c(e, t);
|
|
46
|
+
};
|
|
47
|
+
return /* @__PURE__ */ d(b, { ...f.root, children: /* @__PURE__ */ d(T, { inputs: n, onClear: C, onReset: P, onChange: R, onSubmit: S, onError: j, ...f.form }) });
|
|
48
|
+
}
|
|
49
|
+
m.propTypes = {
|
|
50
|
+
/**
|
|
51
|
+
* A VidiCore field definition list to create filter inputs from
|
|
52
|
+
*/
|
|
53
|
+
fieldList: o.arrayOf(l.MetadataFieldType),
|
|
54
|
+
/**
|
|
55
|
+
* A VidiCore facet list to add options and/or count for options for the filter inputs
|
|
56
|
+
*/
|
|
57
|
+
facetList: o.arrayOf(l.FacetType),
|
|
58
|
+
/**
|
|
59
|
+
* Override input props using field __name__ or __type__ as key
|
|
60
|
+
*
|
|
61
|
+
* Note: `name` props has precedence if prop is applicable from both name and type
|
|
62
|
+
*
|
|
63
|
+
* E.g. `{ 'vdt_stringField': { label: 'String Field', disabled: true, Component: CheckboxGroupInput } }` or `{ 'string-exact': { ...customInputProps } }`
|
|
64
|
+
*/
|
|
65
|
+
inputsProps: o.instanceOf(Object),
|
|
66
|
+
/**
|
|
67
|
+
* Add facets as options (if false, only adds facet count for field value enumerations)
|
|
68
|
+
*/
|
|
69
|
+
includeFacetsAsOptions: o.bool,
|
|
70
|
+
/**
|
|
71
|
+
* Map a field data key to an input prop
|
|
72
|
+
*
|
|
73
|
+
* E.g. `{ label: 'displayName' }` would add the value from data key 'displayName' as a label prop
|
|
74
|
+
*/
|
|
75
|
+
dataToPropsMap: o.instanceOf(Object),
|
|
76
|
+
/**
|
|
77
|
+
* Function for mapping values to filter
|
|
78
|
+
*/
|
|
79
|
+
mapValuesToFilter: o.func,
|
|
80
|
+
// Callbacks
|
|
81
|
+
/**
|
|
82
|
+
* Callback when filters are cleared (doesn't reset default values)
|
|
83
|
+
*/
|
|
84
|
+
onClear: o.func,
|
|
85
|
+
/**
|
|
86
|
+
* Callback when filters are reset (resets to default values)
|
|
87
|
+
*/
|
|
88
|
+
onReset: o.func,
|
|
89
|
+
/**
|
|
90
|
+
* Callback when filters are changed
|
|
91
|
+
*/
|
|
92
|
+
onChange: o.func,
|
|
93
|
+
/**
|
|
94
|
+
* Callback when filters are submitted
|
|
95
|
+
*/
|
|
96
|
+
onSubmit: o.func,
|
|
97
|
+
/**
|
|
98
|
+
* Callback when filters are submitted with errors (invalid values according to form rules)
|
|
99
|
+
*/
|
|
100
|
+
onError: o.func,
|
|
101
|
+
// Overrides
|
|
102
|
+
/**
|
|
103
|
+
* Replace internal components
|
|
104
|
+
*/
|
|
105
|
+
components: o.shape({
|
|
106
|
+
Root: o.elementType,
|
|
107
|
+
Form: o.elementType
|
|
108
|
+
}),
|
|
109
|
+
/**
|
|
110
|
+
* Add internal component props
|
|
111
|
+
*/
|
|
112
|
+
componentsProps: o.shape({
|
|
113
|
+
root: o.instanceOf(Object),
|
|
114
|
+
form: o.instanceOf(Object)
|
|
115
|
+
})
|
|
116
|
+
};
|
|
117
|
+
m.defaultProps = {
|
|
118
|
+
fieldList: void 0,
|
|
119
|
+
facetList: void 0,
|
|
120
|
+
includeFacetsAsOptions: !0,
|
|
121
|
+
dataToPropsMap: {
|
|
122
|
+
label: "label",
|
|
123
|
+
helperText: "description",
|
|
124
|
+
placeholder: "placeholder"
|
|
125
|
+
},
|
|
126
|
+
inputsProps: void 0,
|
|
127
|
+
mapValuesToFilter: g,
|
|
128
|
+
onClear: void 0,
|
|
129
|
+
onReset: void 0,
|
|
130
|
+
onChange: void 0,
|
|
131
|
+
onSubmit: void 0,
|
|
132
|
+
onError: void 0,
|
|
133
|
+
components: E,
|
|
134
|
+
componentsProps: void 0
|
|
135
|
+
};
|
|
136
|
+
export {
|
|
137
|
+
m as default
|
|
138
|
+
};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { useMemo as N, useCallback as f } from "react";
|
|
2
|
+
import { parseFieldDefinitionList as X, parseFacetList as z } from "@vidispine/vdt-js";
|
|
3
|
+
import B from "../../../inputs/DateRangeInput/index.js";
|
|
4
|
+
import H from "../../../inputs/SliderInput/index.js";
|
|
5
|
+
import J from "../../../inputs/TagInput/index.js";
|
|
6
|
+
import O from "../../../inputs/TextInput/index.js";
|
|
7
|
+
const Q = "Invalid value", Y = {
|
|
8
|
+
TextInput: O,
|
|
9
|
+
TagInput: J,
|
|
10
|
+
SliderInput: H,
|
|
11
|
+
DateRangeInput: B
|
|
12
|
+
}, ee = ({
|
|
13
|
+
fieldList: R,
|
|
14
|
+
facetList: b,
|
|
15
|
+
includeFacetsAsOptions: g,
|
|
16
|
+
dataToPropsMap: h,
|
|
17
|
+
errorMessages: i,
|
|
18
|
+
inputsProps: o
|
|
19
|
+
}) => {
|
|
20
|
+
const {
|
|
21
|
+
TextInput: T,
|
|
22
|
+
TagInput: d,
|
|
23
|
+
SliderInput: D,
|
|
24
|
+
DateRangeInput: _
|
|
25
|
+
} = Y, a = N(() => X(R), [R]), m = N(() => z(b), [b]), $ = f((e) => {
|
|
26
|
+
const n = (u) => {
|
|
27
|
+
const t = e == null ? void 0 : e[u], r = i == null ? void 0 : i[u];
|
|
28
|
+
if (t !== void 0)
|
|
29
|
+
return {
|
|
30
|
+
value: t,
|
|
31
|
+
message: (typeof r == "function" ? r(u) : r) || Q
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
return {
|
|
35
|
+
required: n("required"),
|
|
36
|
+
minLength: n("minLength"),
|
|
37
|
+
maxLength: n("maxLength"),
|
|
38
|
+
min: n("minInclusive"),
|
|
39
|
+
max: n("maxInclusive"),
|
|
40
|
+
pattern: n("pattern")
|
|
41
|
+
};
|
|
42
|
+
}, [i]), C = f((e, n) => n === void 0 ? e : e == null ? void 0 : e.map((u) => {
|
|
43
|
+
const t = n == null ? void 0 : n[u.value];
|
|
44
|
+
return {
|
|
45
|
+
...u,
|
|
46
|
+
...t ? {
|
|
47
|
+
count: t
|
|
48
|
+
} : {}
|
|
49
|
+
};
|
|
50
|
+
}), []), F = f(({
|
|
51
|
+
count: e,
|
|
52
|
+
range: n
|
|
53
|
+
}, u) => e ? [...u, ...Object.entries(e || {}).filter(([t]) => !(u != null && u.some((r) => r.value === t))).map(([t, r] = []) => ({
|
|
54
|
+
label: t,
|
|
55
|
+
value: t,
|
|
56
|
+
...r ? {
|
|
57
|
+
count: r
|
|
58
|
+
} : {}
|
|
59
|
+
}))] : n ? [...u, ...n.map(({
|
|
60
|
+
start: t,
|
|
61
|
+
end: r,
|
|
62
|
+
count: c
|
|
63
|
+
}, S) => {
|
|
64
|
+
const E = (() => t === "*" && r === "*" ? "*" : t === "*" ? `<= ${r}` : r === "*" ? `>= ${t}` : `${t} - ${r}`)(), v = [t === "*" ? Number.MIN_SAFE_INTEGER : Number(t), r === "*" ? Number.MAX_SAFE_INTEGER : Number(r)];
|
|
65
|
+
return {
|
|
66
|
+
label: E,
|
|
67
|
+
value: S + 1,
|
|
68
|
+
...t !== void 0 && r !== void 0 ? {
|
|
69
|
+
rangeValues: v
|
|
70
|
+
} : {},
|
|
71
|
+
...c ? {
|
|
72
|
+
count: c
|
|
73
|
+
} : {}
|
|
74
|
+
};
|
|
75
|
+
})] : u, []), A = (e) => ["float", "integer", "long"].includes(e), I = (e) => ["string", "string-exact"].includes(e), j = (e) => e === "date", G = f(({
|
|
76
|
+
type: e,
|
|
77
|
+
options: n
|
|
78
|
+
}) => I(e) ? {
|
|
79
|
+
freeSolo: !0,
|
|
80
|
+
multiple: !0,
|
|
81
|
+
placeholder: "",
|
|
82
|
+
showChipCount: !0
|
|
83
|
+
} : A(e) ? {
|
|
84
|
+
range: !0,
|
|
85
|
+
valueLabelDisplay: "auto",
|
|
86
|
+
showMarks: !1,
|
|
87
|
+
...n != null && n.length ? {} : {
|
|
88
|
+
step: 1,
|
|
89
|
+
infiniteMin: !0,
|
|
90
|
+
infiniteMax: !0
|
|
91
|
+
}
|
|
92
|
+
} : j(e) ? {} : {}, []), L = f(({
|
|
93
|
+
type: e
|
|
94
|
+
}) => I(e) ? d : A(e) ? D : j(e) ? _ : T, [_, D, d, T]);
|
|
95
|
+
return N(() => a == null ? void 0 : a.map(({
|
|
96
|
+
name: e,
|
|
97
|
+
restrictions: n,
|
|
98
|
+
options: u,
|
|
99
|
+
type: t,
|
|
100
|
+
data: r,
|
|
101
|
+
defaultValue: c
|
|
102
|
+
}) => {
|
|
103
|
+
var q, w;
|
|
104
|
+
const S = {
|
|
105
|
+
...(o == null ? void 0 : o[t]) || {},
|
|
106
|
+
...(o == null ? void 0 : o[e]) || {}
|
|
107
|
+
}, E = $(n), v = (q = m == null ? void 0 : m.find((l) => l.fieldName === e)) == null ? void 0 : q.count, V = (w = m == null ? void 0 : m.find((l) => l.fieldName === e)) == null ? void 0 : w.range, M = C(u, v), W = g === !0 ? F({
|
|
108
|
+
count: v,
|
|
109
|
+
range: V
|
|
110
|
+
}, M) : M, U = {
|
|
111
|
+
type: t,
|
|
112
|
+
defaultValue: c && I(t) ? [c] : void 0,
|
|
113
|
+
options: W,
|
|
114
|
+
rules: E,
|
|
115
|
+
...Object.fromEntries(Object.entries(h).map(([l, x]) => r[x] ? [l, r[x]] : void 0).filter((l) => !!l)),
|
|
116
|
+
...S
|
|
117
|
+
}, k = {
|
|
118
|
+
...G(U),
|
|
119
|
+
...U
|
|
120
|
+
};
|
|
121
|
+
return {
|
|
122
|
+
name: e,
|
|
123
|
+
Component: L(k),
|
|
124
|
+
...k
|
|
125
|
+
};
|
|
126
|
+
}), [C, F, h, L, G, $, g, o, m, a]);
|
|
127
|
+
};
|
|
128
|
+
export {
|
|
129
|
+
ee as default
|
|
130
|
+
};
|