@box/metadata-view 0.14.0 → 0.15.1

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.
@@ -0,0 +1,24 @@
1
+ import { Text as o } from "@box/blueprint-web";
2
+ import { jsxs as e, jsx as r } from "react/jsx-runtime";
3
+ import { FilterRow as i } from "../filter-row/filter-row.js";
4
+ import '../../../../styles/action-bar.css';const a = "_actionBar_17enr_1", c = {
5
+ actionBar: a
6
+ }, d = ({
7
+ filterRowProps: t
8
+ }) => /* @__PURE__ */ e("div", {
9
+ className: c.actionBar,
10
+ children: [/* @__PURE__ */ r("div", {
11
+ children: /* @__PURE__ */ r(i, {
12
+ ...t
13
+ })
14
+ }), /* @__PURE__ */ r("div", {
15
+ children: /* @__PURE__ */ r(o, {
16
+ as: "span",
17
+ children: "placeholder to be replaced with buttons from other tickets"
18
+ })
19
+ })]
20
+ });
21
+ export {
22
+ d as ActionBar,
23
+ d as default
24
+ };
@@ -0,0 +1,4 @@
1
+ import { ActionBar as t } from "./action-bar.js";
2
+ export {
3
+ t as ActionBar
4
+ };
@@ -1,11 +1,11 @@
1
1
  import { FilterChip as a } from "@box/blueprint-web";
2
- import { Filter as p, MetadataBadge as S } from "@box/blueprint-web-assets/icons/Line";
2
+ import { Filter as g, MetadataBadge as S } from "@box/blueprint-web-assets/icons/Line";
3
3
  import { Formik as b, Form as v } from "formik";
4
4
  import { useState as w, useRef as C } from "react";
5
5
  import { useIntl as I } from "react-intl";
6
6
  import { StringFilterChip as j } from "./string-filter-chip.js";
7
7
  import k from "./messages.js";
8
- import { jsx as i, jsxs as c } from "react/jsx-runtime";
8
+ import { jsx as i, jsxs as m } from "react/jsx-runtime";
9
9
  const x = (e, n, s) => {
10
10
  switch (e.fieldType) {
11
11
  case "float":
@@ -19,7 +19,7 @@ const x = (e, n, s) => {
19
19
  case "date":
20
20
  case "enum":
21
21
  case "multiSelect":
22
- return /* @__PURE__ */ c(a.Chip, {
22
+ return /* @__PURE__ */ m(a.Chip, {
23
23
  value: e.id,
24
24
  children: [/* @__PURE__ */ i(a.Icon, {
25
25
  icon: S
@@ -34,21 +34,21 @@ const x = (e, n, s) => {
34
34
  filterOptions: e,
35
35
  isAllFiltersDisabled: n,
36
36
  onAllFiltersClick: s,
37
- onFilterSubmit: d
37
+ onFilterSubmit: o
38
38
  }) => {
39
39
  const {
40
40
  formatMessage: u
41
- } = I(), [o, h] = w([]), F = ([t, r]) => {
41
+ } = I(), [c, h] = w([]), f = ([t, r]) => {
42
42
  var l;
43
43
  return ((l = r.value) == null ? void 0 : l.enum) && r.value.enum.length > 0;
44
- }, f = ({
44
+ }, p = ({
45
45
  metadata: {
46
46
  fields: t
47
47
  }
48
48
  }) => {
49
- const r = Object.entries(t).filter(F).map(([l]) => l);
50
- h(r), d(t);
51
- }, g = {
49
+ const r = Object.entries(t).filter(f).map(([l]) => l);
50
+ h(r), o(t);
51
+ }, F = {
52
52
  metadata: {
53
53
  fields: e.reduce((t, r) => {
54
54
  let l;
@@ -65,26 +65,26 @@ const x = (e, n, s) => {
65
65
  }, t;
66
66
  }, {})
67
67
  }
68
- }, m = C(null);
68
+ }, d = C(null);
69
69
  return /* @__PURE__ */ i(b, {
70
- initialValues: g,
71
- onSubmit: f,
70
+ initialValues: F,
71
+ onSubmit: p,
72
72
  children: /* @__PURE__ */ i(v, {
73
- ref: m,
74
- children: /* @__PURE__ */ c(a.Group, {
73
+ ref: d,
74
+ children: /* @__PURE__ */ m(a.Group, {
75
75
  name: "metadata-view-filters",
76
76
  type: "multiple",
77
- children: [n ? null : /* @__PURE__ */ c(a.ChipButton, {
77
+ children: [n ? null : /* @__PURE__ */ m(a.ChipButton, {
78
78
  onClick: s,
79
79
  value: "all-filters-chip-btn",
80
80
  children: [/* @__PURE__ */ i(a.Icon, {
81
- icon: p
81
+ icon: g
82
82
  }), /* @__PURE__ */ i(a.Label, {
83
83
  children: u(k.allFilters)
84
- }), e.length > 0 && /* @__PURE__ */ i(a.Status, {
85
- children: e.length.toString()
84
+ }), c.length > 0 && /* @__PURE__ */ i(a.Status, {
85
+ children: c.length.toString()
86
86
  })]
87
- }), e.map((t) => x(t, o.includes(t.id), m))]
87
+ }), e.map((t) => x(t, c.includes(t.id), d))]
88
88
  })
89
89
  })
90
90
  });
@@ -1,22 +1,22 @@
1
1
  import r from "./components/pagination/pagination.js";
2
- import { jsxs as e, jsx as t } from "react/jsx-runtime";
3
- import { FilterRow as i } from "./components/filter-row/filter-row.js";
4
- import m from "./components/metadata-table/metadata-table.js";
5
- import '../../styles/metadata-view.css';const n = {};
6
- function d({
2
+ import { jsxs as i, jsx as t } from "react/jsx-runtime";
3
+ import { ActionBar as e } from "./components/action-bar/action-bar.js";
4
+ import n from "./components/metadata-table/metadata-table.js";
5
+ import '../../styles/metadata-view.css';const m = {};
6
+ function l({
7
7
  filterRowProps: a,
8
8
  metadataTableProps: o
9
9
  }) {
10
- return /* @__PURE__ */ e("div", {
11
- className: n.container,
12
- children: [/* @__PURE__ */ t(i, {
13
- ...a
14
- }), /* @__PURE__ */ t(m, {
10
+ return /* @__PURE__ */ i("div", {
11
+ className: m.container,
12
+ children: [/* @__PURE__ */ t(e, {
13
+ filterRowProps: a
14
+ }), /* @__PURE__ */ t(n, {
15
15
  ...o
16
16
  }), /* @__PURE__ */ t(r, {})]
17
17
  });
18
18
  }
19
19
  export {
20
- d as MetadataView,
21
- d as default
20
+ l as MetadataView,
21
+ l as default
22
22
  };
@@ -0,0 +1 @@
1
+ ._actionBar_17enr_1{display:flex;justify-content:space-between}
@@ -0,0 +1,6 @@
1
+ import { FilterRowProps } from '../filter-row';
2
+ export interface ActionBarProps {
3
+ filterRowProps: FilterRowProps;
4
+ }
5
+ export declare const ActionBar: ({ filterRowProps }: ActionBarProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default ActionBar;
@@ -0,0 +1 @@
1
+ export * from './action-bar';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/metadata-view",
3
- "version": "0.14.0",
3
+ "version": "0.15.1",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "peerDependencies": {
6
6
  "@box/blueprint-web": "^11.12.0",
@@ -16,11 +16,11 @@
16
16
  },
17
17
  "devDependencies": {
18
18
  "@box/blueprint-web": "^11.12.0",
19
- "@box/blueprint-web-assets": "^4.55.0",
19
+ "@box/blueprint-web-assets": "^4.56.0",
20
20
  "@box/eslint-plugin-blueprint": "*",
21
- "@box/item-icon": "^0.10.1",
22
- "@box/metadata-filter": "^1.11.0",
23
- "@box/storybook-utils": "0.13.8",
21
+ "@box/item-icon": "^0.10.2",
22
+ "@box/metadata-filter": "^1.11.1",
23
+ "@box/storybook-utils": "0.13.9",
24
24
  "@box/types": "0.2.0",
25
25
  "react-intl": "^6.4.2"
26
26
  },