@box/metadata-view 1.54.9 → 1.54.11
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/chunks/action-bar.js +48 -0
- package/dist/chunks/empty-state.js +24 -0
- package/dist/chunks/error-state.js +23 -0
- package/dist/chunks/filter-row.module.js +6 -8
- package/dist/chunks/filter-side-panel.js +65 -0
- package/dist/chunks/header.js +56 -0
- package/dist/chunks/inline-editing-cell.js +34 -0
- package/dist/chunks/item-action-menu.js +86 -0
- package/dist/chunks/metadata-grid.js +44 -0
- package/dist/chunks/metadata-location-field.js +35 -0
- package/dist/chunks/metadata-view.js +102 -0
- package/dist/chunks/pagination-controls.js +40 -0
- package/dist/chunks/table-row.js +72 -0
- package/dist/chunks/types.js +6 -11
- package/dist/chunks/types2.js +4 -0
- package/dist/chunks/zoom-button.js +20 -0
- package/dist/esm/index.js +29 -59
- package/dist/esm/lib/components/action-bar/action-bar.js +2 -62
- package/dist/esm/lib/components/action-bar/index.js +2 -4
- package/dist/esm/lib/components/action-bar/messages.js +22 -24
- package/dist/esm/lib/components/action-bar/zoom-button.js +2 -30
- package/dist/esm/lib/components/constants.js +14 -6
- package/dist/esm/lib/components/empty-state/empty-state.js +2 -30
- package/dist/esm/lib/components/empty-state/index.js +2 -4
- package/dist/esm/lib/components/empty-state/messages.js +10 -12
- package/dist/esm/lib/components/error-state/error-state.js +2 -31
- package/dist/esm/lib/components/error-state/index.js +2 -4
- package/dist/esm/lib/components/error-state/messages.js +10 -12
- package/dist/esm/lib/components/filter-row/advanced-field-content.js +30 -52
- package/dist/esm/lib/components/filter-row/advanced-filter-context.js +3 -6
- package/dist/esm/lib/components/filter-row/all-filters-chip.js +31 -49
- package/dist/esm/lib/components/filter-row/filter-row.js +35 -59
- package/dist/esm/lib/components/filter-row/form-filter-chip.js +84 -113
- package/dist/esm/lib/components/filter-row/index.js +6 -12
- package/dist/esm/lib/components/filter-row/initial-field-values.js +31 -51
- package/dist/esm/lib/components/filter-row/is-blank-or-not-blank-filter.js +2 -4
- package/dist/esm/lib/components/filter-row/is-filter-selected.js +37 -58
- package/dist/esm/lib/components/filter-row/messages.js +38 -40
- package/dist/esm/lib/components/filter-row/metadata-filter-chip.js +74 -103
- package/dist/esm/lib/components/filter-row/predefinedFilters/index.js +2 -6
- package/dist/esm/lib/components/filter-row/predefinedFilters/predefined-filter-options-factory.js +14 -21
- package/dist/esm/lib/components/filter-row/predefinedFilters/use-predefined-filter.js +58 -71
- package/dist/esm/lib/components/filter-row/select-filter-chip.js +41 -58
- package/dist/esm/lib/components/filter-row/use-form-filter-chip.js +36 -40
- package/dist/esm/lib/components/filter-sidepanel/filter-side-panel.js +2 -82
- package/dist/esm/lib/components/filter-sidepanel/filter.js +95 -140
- package/dist/esm/lib/components/filter-sidepanel/index.js +3 -6
- package/dist/esm/lib/components/filter-sidepanel/messages.js +18 -20
- package/dist/esm/lib/components/header/header.js +2 -82
- package/dist/esm/lib/components/header/index.js +2 -4
- package/dist/esm/lib/components/header/messages.js +14 -16
- package/dist/esm/lib/components/index.js +26 -53
- package/dist/esm/lib/components/item-action-menu/identifier.js +4 -7
- package/dist/esm/lib/components/item-action-menu/index.js +2 -4
- package/dist/esm/lib/components/item-action-menu/item-action-menu.js +2 -127
- package/dist/esm/lib/components/item-action-menu/messages.js +5 -9
- package/dist/esm/lib/components/metadata-grid/index.js +2 -4
- package/dist/esm/lib/components/metadata-grid/messages.js +5 -9
- package/dist/esm/lib/components/metadata-grid/metadata-grid.js +2 -62
- package/dist/esm/lib/components/metadata-table/actionColumn.js +3 -5
- package/dist/esm/lib/components/metadata-table/hooks/useInfiniteScrollTableItems.js +24 -29
- package/dist/esm/lib/components/metadata-table/index.js +4 -8
- package/dist/esm/lib/components/metadata-table/messages.js +14 -16
- package/dist/esm/lib/components/metadata-table/metadata-table.js +89 -127
- package/dist/esm/lib/components/metadata-table/table-body/ghost-table-body.js +10 -19
- package/dist/esm/lib/components/metadata-table/table-body/ghost-table-row/ghost-table-row.js +8 -19
- package/dist/esm/lib/components/metadata-table/table-body/ghost-table-row/index.js +2 -4
- package/dist/esm/lib/components/metadata-table/table-body/inline-editing-cell/index.js +2 -4
- package/dist/esm/lib/components/metadata-table/table-body/inline-editing-cell/inline-editing-cell.js +2 -56
- package/dist/esm/lib/components/metadata-table/table-body/table-body-with-data.js +135 -209
- package/dist/esm/lib/components/metadata-table/table-body/table-row/index.js +2 -4
- package/dist/esm/lib/components/metadata-table/table-body/table-row/table-row.js +2 -12
- package/dist/esm/lib/components/metadata-table/table-renderer.js +34 -55
- package/dist/esm/lib/components/metadata-value/index.js +6 -12
- package/dist/esm/lib/components/metadata-value/messages.js +15 -17
- package/dist/esm/lib/components/metadata-value/metadata-checkbox-field.js +24 -34
- package/dist/esm/lib/components/metadata-value/metadata-file-chip.js +14 -22
- package/dist/esm/lib/components/metadata-value/metadata-file-field.js +12 -19
- package/dist/esm/lib/components/metadata-value/metadata-location-field.js +2 -48
- package/dist/esm/lib/components/metadata-value/metadata-radio-field.js +26 -37
- package/dist/esm/lib/components/metadata-value/metadata-search-field.js +19 -30
- package/dist/esm/lib/components/pagination/index.js +4 -9
- package/dist/esm/lib/components/pagination/marker-based-pagination.js +12 -19
- package/dist/esm/lib/components/pagination/messages.js +19 -21
- package/dist/esm/lib/components/pagination/offset-based-pagination.js +22 -31
- package/dist/esm/lib/components/pagination/pagination-controls.js +2 -53
- package/dist/esm/lib/components/pagination/pagination.js +20 -35
- package/dist/esm/lib/components/pagination/utils.js +4 -6
- package/dist/esm/lib/components/sort-dropdown/index.js +2 -4
- package/dist/esm/lib/components/sort-dropdown/sort-dropdown.js +37 -56
- package/dist/esm/lib/components/switch-case/index.js +2 -5
- package/dist/esm/lib/components/switch-case/switch-case.js +4 -12
- package/dist/esm/lib/hooks/use-header.js +41 -37
- package/dist/esm/lib/index.js +28 -59
- package/dist/esm/lib/metadata-view.js +2 -151
- package/dist/styles/action-bar.css +1 -1
- package/dist/styles/empty-state.css +1 -1
- package/dist/styles/filter-row.css +1 -1
- package/dist/styles/header.css +1 -1
- package/dist/styles/inline-editing-cell.css +1 -1
- package/dist/styles/item-action-menu.css +1 -1
- package/dist/styles/metadata-grid.css +1 -1
- package/dist/styles/metadata-view.css +1 -1
- package/dist/styles/pagination-controls.css +1 -1
- package/dist/styles/table-row.css +1 -0
- package/dist/styles/zoom-button.css +1 -1
- package/package.json +14 -14
- package/dist/chunks/index.js +0 -105
- package/dist/styles/index.css +0 -1
|
@@ -1,60 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { jsx as
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
), m = G(null);
|
|
36
|
-
return /* @__PURE__ */ i(C, {
|
|
37
|
-
enableReinitialize: !0,
|
|
38
|
-
initialValues: h,
|
|
39
|
-
onSubmit: u,
|
|
40
|
-
children: /* @__PURE__ */ i(R, {
|
|
41
|
-
ref: m,
|
|
42
|
-
children: /* @__PURE__ */ S(F.Group, {
|
|
43
|
-
className: w.filterChipGroup,
|
|
44
|
-
name: "metadata-view-filters",
|
|
45
|
-
type: "multiple",
|
|
46
|
-
children: [f ? null : /* @__PURE__ */ i(j, {
|
|
47
|
-
containerRef: s,
|
|
48
|
-
filterGroups: l,
|
|
49
|
-
onAllFiltersClick: n
|
|
50
|
-
}), r.filter((e) => e.shouldRenderChip).map((e) => /* @__PURE__ */ i(M, {
|
|
51
|
-
filterOption: e,
|
|
52
|
-
formRef: m
|
|
53
|
-
}, e.id))]
|
|
54
|
-
})
|
|
55
|
-
})
|
|
56
|
-
});
|
|
57
|
-
};
|
|
58
|
-
export {
|
|
59
|
-
q as FilterRow
|
|
1
|
+
import { getInitialFieldValues as e } from "./initial-field-values.js";
|
|
2
|
+
import { t } from "../../../../chunks/filter-row.module.js";
|
|
3
|
+
import n from "./all-filters-chip.js";
|
|
4
|
+
import { MetadataFilterChip as r } from "./metadata-filter-chip.js";
|
|
5
|
+
import { usePredefinedFilter as i } from "./predefinedFilters/use-predefined-filter.js";
|
|
6
|
+
import { FilterChip as a } from "@box/blueprint-web";
|
|
7
|
+
import { useMemo as o, useRef as s } from "react";
|
|
8
|
+
import { Form as c, Formik as l } from "formik";
|
|
9
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
10
|
+
var f = ({ predefinedFilterOptions: f, containerRef: p, filterGroups: m = [], initialFilterValues: h, isAllFiltersDisabled: g, onAllFiltersClick: _, onFilterSubmit: v }) => {
|
|
11
|
+
let y = i(f), b = ({ metadata: { fields: e } }) => {
|
|
12
|
+
v && v(e);
|
|
13
|
+
}, x = [...y, ...m], S = x.flatMap(({ filters: e }) => e), C = o(() => e(S, h), [S.map((e) => `${e.id}:${e.fieldType}`).join("|"), h]), w = s(null);
|
|
14
|
+
return /* @__PURE__ */ u(l, {
|
|
15
|
+
enableReinitialize: !0,
|
|
16
|
+
initialValues: C,
|
|
17
|
+
onSubmit: b,
|
|
18
|
+
children: /* @__PURE__ */ u(c, {
|
|
19
|
+
ref: w,
|
|
20
|
+
children: /* @__PURE__ */ d(a.Group, {
|
|
21
|
+
className: t.filterChipGroup,
|
|
22
|
+
name: "metadata-view-filters",
|
|
23
|
+
type: "multiple",
|
|
24
|
+
children: [g ? null : /* @__PURE__ */ u(n, {
|
|
25
|
+
containerRef: p,
|
|
26
|
+
filterGroups: x,
|
|
27
|
+
onAllFiltersClick: _
|
|
28
|
+
}), S.filter((e) => e.shouldRenderChip).map((e) => /* @__PURE__ */ u(r, {
|
|
29
|
+
filterOption: e,
|
|
30
|
+
formRef: w
|
|
31
|
+
}, e.id))]
|
|
32
|
+
})
|
|
33
|
+
})
|
|
34
|
+
});
|
|
60
35
|
};
|
|
36
|
+
export { f as FilterRow };
|
|
@@ -1,114 +1,85 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import { jsx as
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}, t)
|
|
85
|
-
}), /* @__PURE__ */ s(n.ContentContainer, {
|
|
86
|
-
align: "start",
|
|
87
|
-
className: T.popoverContent,
|
|
88
|
-
container: B.current,
|
|
89
|
-
"data-testid": "form-filter-chip-popover",
|
|
90
|
-
children: [/* @__PURE__ */ r(n.MainContent, {
|
|
91
|
-
children: W
|
|
92
|
-
}), /* @__PURE__ */ s(n.Footer, {
|
|
93
|
-
className: T.popoverFooter,
|
|
94
|
-
children: [/* @__PURE__ */ r(O, {
|
|
95
|
-
onClick: J,
|
|
96
|
-
size: "small",
|
|
97
|
-
variant: "secondary",
|
|
98
|
-
children: h(D.clearButton)
|
|
99
|
-
}), /* @__PURE__ */ r(O, {
|
|
100
|
-
disabled: Q(),
|
|
101
|
-
onClick: w,
|
|
102
|
-
size: "small",
|
|
103
|
-
type: "submit",
|
|
104
|
-
variant: "primary",
|
|
105
|
-
children: h(D.applyButton)
|
|
106
|
-
})]
|
|
107
|
-
})]
|
|
108
|
-
})]
|
|
109
|
-
})
|
|
110
|
-
});
|
|
111
|
-
};
|
|
112
|
-
export {
|
|
113
|
-
he as FormFilterChip
|
|
1
|
+
import { getDefaultFieldValue as e } from "./initial-field-values.js";
|
|
2
|
+
import { isBlankOrNotBlankFilter as t } from "./is-blank-or-not-blank-filter.js";
|
|
3
|
+
import { extractAdvancedFilterOption as n, isFilterSelected as r } from "./is-filter-selected.js";
|
|
4
|
+
import i from "./messages.js";
|
|
5
|
+
import { t as a } from "../../../../chunks/filter-row.module.js";
|
|
6
|
+
import { AdvancedFilterContext as o } from "./advanced-filter-context.js";
|
|
7
|
+
import { useFormFilterChip as s } from "./use-form-filter-chip.js";
|
|
8
|
+
import { Button as c, FilterChip as l, Popover as u } from "@box/blueprint-web";
|
|
9
|
+
import { useMemo as d, useState as f } from "react";
|
|
10
|
+
import { useIntl as p } from "react-intl";
|
|
11
|
+
import { getIn as m, useFormikContext as h } from "formik";
|
|
12
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
13
|
+
var v = ({ children: v, formRef: y, icon: b, id: x, name: S = "", isAdvancedFilterEnabled: C, advancedFilterOptionsMap: w }) => {
|
|
14
|
+
let { formatMessage: T } = p(), [E, D] = f(!1), { handleSubmit: O, setFieldValue: k, resetForm: A, values: j } = h(), M = m(j, `metadata.fields.${x}.fieldType`), N = m(j, `metadata.fields.${x}.value`), { appliedAdvancedFilterOption: P, currentAdvancedFilterOption: F, dynamicDisplayName: I, handleAdvancedFilterOptionChange: L, handleApply: R, handleCancel: z, handleClear: B } = s({
|
|
15
|
+
name: S,
|
|
16
|
+
advancedFilterOptionsMap: w,
|
|
17
|
+
initialAdvancedFilterOption: C && N ? n(N) : void 0
|
|
18
|
+
}), [V, H] = f(0), U = () => {
|
|
19
|
+
C && R(), O(), D(!1);
|
|
20
|
+
}, [W, G] = f(j), K = (e) => {
|
|
21
|
+
D(e), e ? (G(j), C && H((e) => e + 1)) : (A({ values: W }), C && z());
|
|
22
|
+
}, q = () => {
|
|
23
|
+
k(`metadata.fields.${x}.value`, e({
|
|
24
|
+
fieldType: M,
|
|
25
|
+
isAdvancedFilterEnabled: C
|
|
26
|
+
})), C && B();
|
|
27
|
+
}, J = d(() => {
|
|
28
|
+
if (C && t(P)) return !0;
|
|
29
|
+
let e = m(j, `metadata.fields.${x}.value`);
|
|
30
|
+
return e ? r(e) : !1;
|
|
31
|
+
}, [
|
|
32
|
+
j,
|
|
33
|
+
x,
|
|
34
|
+
C,
|
|
35
|
+
P
|
|
36
|
+
]), Y = () => {
|
|
37
|
+
if (M === "date") {
|
|
38
|
+
let e = m(j, `metadata.fields.${x}.value.customType`), t = e && e !== "anyTime" && e !== "customRange", n = m(j, `metadata.fields.${x}.value.relativeType`);
|
|
39
|
+
return (t || n && n !== "customRange") && !J;
|
|
40
|
+
}
|
|
41
|
+
return !1;
|
|
42
|
+
}, X = C && J ? I : S, Z = C ? /* @__PURE__ */ g(o.Provider, {
|
|
43
|
+
value: {
|
|
44
|
+
currentOption: F,
|
|
45
|
+
onOptionChange: L,
|
|
46
|
+
resetKey: V
|
|
47
|
+
},
|
|
48
|
+
children: v
|
|
49
|
+
}) : v;
|
|
50
|
+
return /* @__PURE__ */ g("div", { children: /* @__PURE__ */ _(u.Root, {
|
|
51
|
+
onOpenChange: K,
|
|
52
|
+
open: E,
|
|
53
|
+
children: [/* @__PURE__ */ g(u.Trigger, { children: /* @__PURE__ */ _(l.TriggerChip, {
|
|
54
|
+
selected: J,
|
|
55
|
+
value: x,
|
|
56
|
+
children: [
|
|
57
|
+
b && /* @__PURE__ */ g(l.Icon, { icon: b }),
|
|
58
|
+
/* @__PURE__ */ g(l.Label, { children: X }),
|
|
59
|
+
/* @__PURE__ */ g(l.DropdownIndicator, {})
|
|
60
|
+
]
|
|
61
|
+
}, x) }), /* @__PURE__ */ _(u.ContentContainer, {
|
|
62
|
+
align: "start",
|
|
63
|
+
className: a.popoverContent,
|
|
64
|
+
container: y.current,
|
|
65
|
+
"data-testid": "form-filter-chip-popover",
|
|
66
|
+
children: [/* @__PURE__ */ g(u.MainContent, { children: Z }), /* @__PURE__ */ _(u.Footer, {
|
|
67
|
+
className: a.popoverFooter,
|
|
68
|
+
children: [/* @__PURE__ */ g(c, {
|
|
69
|
+
onClick: q,
|
|
70
|
+
size: "small",
|
|
71
|
+
variant: "secondary",
|
|
72
|
+
children: T(i.clearButton)
|
|
73
|
+
}), /* @__PURE__ */ g(c, {
|
|
74
|
+
disabled: Y(),
|
|
75
|
+
onClick: U,
|
|
76
|
+
size: "small",
|
|
77
|
+
type: "submit",
|
|
78
|
+
variant: "primary",
|
|
79
|
+
children: T(i.applyButton)
|
|
80
|
+
})]
|
|
81
|
+
})]
|
|
82
|
+
})]
|
|
83
|
+
}) });
|
|
114
84
|
};
|
|
85
|
+
export { v as FormFilterChip };
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { MetadataFilterChip as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
export {
|
|
7
|
-
t as FilterRow,
|
|
8
|
-
i as FormFilterChip,
|
|
9
|
-
m as MetadataFilterChip,
|
|
10
|
-
x as PredefinedFilterName,
|
|
11
|
-
l as SelectFilterChip
|
|
12
|
-
};
|
|
1
|
+
import { FormFilterChip as e } from "./form-filter-chip.js";
|
|
2
|
+
import { SelectFilterChip as t } from "./select-filter-chip.js";
|
|
3
|
+
import { MetadataFilterChip as n } from "./metadata-filter-chip.js";
|
|
4
|
+
import { t as r } from "../../../../chunks/types2.js";
|
|
5
|
+
import { FilterRow as i } from "./filter-row.js";
|
|
6
|
+
export { i as FilterRow, e as FormFilterChip, n as MetadataFilterChip, r as PredefinedFilterName, t as SelectFilterChip };
|
|
@@ -1,52 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}),
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return n[r.id] = {
|
|
32
|
-
value: a ?? u,
|
|
33
|
-
fieldType: r.fieldType,
|
|
34
|
-
options: d(r)
|
|
35
|
-
}, n;
|
|
36
|
-
}, {});
|
|
37
|
-
return t && Object.keys(t).filter((n) => !i[n]).forEach((n) => {
|
|
38
|
-
i[n] = {
|
|
39
|
-
value: t[n].value,
|
|
40
|
-
fieldType: l(t[n].value)
|
|
41
|
-
};
|
|
42
|
-
}), {
|
|
43
|
-
metadata: {
|
|
44
|
-
fields: i
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
export {
|
|
49
|
-
s as getDefaultFieldValue,
|
|
50
|
-
o as getInitialFieldValues,
|
|
51
|
-
l as inferFieldType
|
|
1
|
+
var e = (e) => ({
|
|
2
|
+
key: e,
|
|
3
|
+
id: e
|
|
4
|
+
}), t = ({ fieldType: t, options: n }) => ["enum", "multiSelect"].includes(t) ? (n || []).map(e) : [], n = ({ fieldType: e, isAdvancedFilterEnabled: t }) => e === "date" ? {
|
|
5
|
+
customType: "anyTime",
|
|
6
|
+
range: {
|
|
7
|
+
gt: "",
|
|
8
|
+
lt: ""
|
|
9
|
+
}
|
|
10
|
+
} : e === "float" ? t ? { enum: [] } : { range: {
|
|
11
|
+
gt: "",
|
|
12
|
+
lt: ""
|
|
13
|
+
} } : { enum: [] }, r = (e) => Array.isArray(e) ? e.length > 1 ? "multiSelect" : "enum" : !e || typeof e != "object" ? "enum" : "customDays" in e || "relativeDays" in e || "customType" in e || "relativeType" in e ? "date" : "range" in e ? "float" : "enum" in e && e.enum.length > 1 ? "multiSelect" : "enum", i = (e, i) => {
|
|
14
|
+
let a = e.reduce((e, r) => {
|
|
15
|
+
let a = i?.[r.id]?.value, o = n({
|
|
16
|
+
fieldType: r.fieldType,
|
|
17
|
+
isAdvancedFilterEnabled: r.isAdvancedFilterEnabled
|
|
18
|
+
});
|
|
19
|
+
return e[r.id] = {
|
|
20
|
+
value: a ?? o,
|
|
21
|
+
fieldType: r.fieldType,
|
|
22
|
+
options: t(r)
|
|
23
|
+
}, e;
|
|
24
|
+
}, {});
|
|
25
|
+
return i && Object.keys(i).filter((e) => !a[e]).forEach((e) => {
|
|
26
|
+
a[e] = {
|
|
27
|
+
value: i[e].value,
|
|
28
|
+
fieldType: r(i[e].value)
|
|
29
|
+
};
|
|
30
|
+
}), { metadata: { fields: a } };
|
|
52
31
|
};
|
|
32
|
+
export { n as getDefaultFieldValue, i as getInitialFieldValues, r as inferFieldType };
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import { FilterKeyTypes as e } from "@box/metadata-filter";
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
l as isBlankOrNotBlankFilter
|
|
5
|
-
};
|
|
2
|
+
var t = (t) => t === e.IS_BLANK || t === e.IS_NOT_BLANK;
|
|
3
|
+
export { t as isBlankOrNotBlankFilter };
|
|
@@ -1,59 +1,38 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return !0;
|
|
38
|
-
if ("range" in t) {
|
|
39
|
-
const {
|
|
40
|
-
range: r
|
|
41
|
-
} = t;
|
|
42
|
-
return !!(r && (r.gt || r.lt));
|
|
43
|
-
}
|
|
44
|
-
if ("enum" in t) {
|
|
45
|
-
const r = t.enum;
|
|
46
|
-
if (o(r))
|
|
47
|
-
return s(r);
|
|
48
|
-
const n = r;
|
|
49
|
-
if (!n || n.length === 0)
|
|
50
|
-
return !1;
|
|
51
|
-
const e = n[0];
|
|
52
|
-
return c(e) ? a(e) : !!e;
|
|
53
|
-
}
|
|
54
|
-
return !1;
|
|
55
|
-
};
|
|
56
|
-
export {
|
|
57
|
-
y as extractAdvancedFilterOption,
|
|
58
|
-
m as isFilterSelected
|
|
1
|
+
import { isBlankOrNotBlankFilter as e } from "./is-blank-or-not-blank-filter.js";
|
|
2
|
+
import { FilterKeyTypes as t } from "@box/metadata-filter";
|
|
3
|
+
var n = (e) => !!e && typeof e == "object" && !Array.isArray(e) && "advancedFilterOption" in e, r = ({ value: t, advancedFilterOption: n }) => e(n) ? !0 : !!(t && t.length > 0 && t[0]), i = (e) => !!e && typeof e == "object" && !Array.isArray(e) && "advancedFilterOption" in e, a = ({ value: t, advancedFilterOption: n }) => {
|
|
4
|
+
if (e(n)) return !0;
|
|
5
|
+
if (typeof t == "string") return !!t;
|
|
6
|
+
if (t && typeof t == "object" && "range" in t) {
|
|
7
|
+
let { range: e } = t;
|
|
8
|
+
return !!(e && (e.gt || e.lt));
|
|
9
|
+
}
|
|
10
|
+
return !1;
|
|
11
|
+
}, o = (e) => {
|
|
12
|
+
if ("advancedFilterOption" in e) return e.advancedFilterOption;
|
|
13
|
+
if ("enum" in e) {
|
|
14
|
+
let t = e.enum;
|
|
15
|
+
if (n(t)) return t.advancedFilterOption;
|
|
16
|
+
let r = t?.[0];
|
|
17
|
+
if (i(r)) return r.advancedFilterOption;
|
|
18
|
+
}
|
|
19
|
+
}, s = (e) => {
|
|
20
|
+
let n = o(e);
|
|
21
|
+
return n && n !== t.SELECT_FILTER_TYPE ? n : void 0;
|
|
22
|
+
}, c = (t) => {
|
|
23
|
+
if ("advancedFilterOption" in t && e(t.advancedFilterOption)) return !0;
|
|
24
|
+
if ("range" in t) {
|
|
25
|
+
let { range: e } = t;
|
|
26
|
+
return !!(e && (e.gt || e.lt));
|
|
27
|
+
}
|
|
28
|
+
if ("enum" in t) {
|
|
29
|
+
let e = t.enum;
|
|
30
|
+
if (n(e)) return r(e);
|
|
31
|
+
let o = e;
|
|
32
|
+
if (!o || o.length === 0) return !1;
|
|
33
|
+
let s = o[0];
|
|
34
|
+
return i(s) ? a(s) : !!s;
|
|
35
|
+
}
|
|
36
|
+
return !1;
|
|
59
37
|
};
|
|
38
|
+
export { s as extractAdvancedFilterOption, c as isFilterSelected };
|
|
@@ -1,42 +1,40 @@
|
|
|
1
1
|
import { defineMessages as e } from "react-intl";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
2
|
+
var t = e({
|
|
3
|
+
applyButton: {
|
|
4
|
+
id: "groupSharedFeatures.metadataView.filterRow.applyButton",
|
|
5
|
+
defaultMessage: "Apply"
|
|
6
|
+
},
|
|
7
|
+
clearButton: {
|
|
8
|
+
id: "groupSharedFeatures.metadataView.filterRow.clearButton",
|
|
9
|
+
defaultMessage: "Clear"
|
|
10
|
+
},
|
|
11
|
+
textInputPlaceholder: {
|
|
12
|
+
id: "groupSharedFeatures.metadataView.filterRow.textInputPlaceholder",
|
|
13
|
+
defaultMessage: "Set Value"
|
|
14
|
+
},
|
|
15
|
+
allFilters: {
|
|
16
|
+
id: "groupSharedFeatures.metadataView.filterRow.AllFilters",
|
|
17
|
+
defaultMessage: "All Filters"
|
|
18
|
+
},
|
|
19
|
+
keywordSearchFilterPlaceholder: {
|
|
20
|
+
id: "groupSharedFeatures.metadataView.filterRow.keywordSearchFilterPlaceholder",
|
|
21
|
+
defaultMessage: "Enter keywords"
|
|
22
|
+
},
|
|
23
|
+
chipNameWithCount: {
|
|
24
|
+
id: "groupSharedFeatures.metadataView.filterRow.chipNameWithCount",
|
|
25
|
+
defaultMessage: "{name} ({count})"
|
|
26
|
+
},
|
|
27
|
+
fileTypeFilterTitle: {
|
|
28
|
+
id: "groupSharedFeatures.metadataView.filterRow.fileTypeFilterTitle",
|
|
29
|
+
defaultMessage: "File Type"
|
|
30
|
+
},
|
|
31
|
+
locationFilterTitle: {
|
|
32
|
+
id: "groupSharedFeatures.metadataView.filterRow.locationFilterTitle",
|
|
33
|
+
defaultMessage: "Location"
|
|
34
|
+
},
|
|
35
|
+
chipNameWithFilterOption: {
|
|
36
|
+
id: "groupSharedFeatures.metadataView.filterRow.chipNameWithFilterOption",
|
|
37
|
+
defaultMessage: "{name} - {optionLabel}"
|
|
38
|
+
}
|
|
39
39
|
});
|
|
40
|
-
export {
|
|
41
|
-
a as default
|
|
42
|
-
};
|
|
40
|
+
export { t as default };
|