@plumile/backoffice-react 0.1.161 → 0.1.162
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/README.md +3 -0
- package/lib/esm/auth/authRefreshNotice.css.js +0 -1
- package/lib/esm/auth/login/loginPage.css.js +0 -1
- package/lib/esm/components/backoffice/columns/buildDataTableColumns.js +52 -42
- package/lib/esm/components/backoffice/columns/buildDataTableColumns.js.map +1 -1
- package/lib/esm/components/backoffice/detail/backofficeDetailBadgeRow.css.js +1 -0
- package/lib/esm/components/backoffice/filters/backofficeFilterAction.css.js +1 -1
- package/lib/esm/components/backoffice/filters/backofficeFilterAction.css.js.map +1 -1
- package/lib/esm/components/backoffice/layout/backofficeSidebarActions.css.js +1 -0
- package/lib/esm/components/backoffice/layout/breadcrumb/buildBreadcrumbs.js +4 -6
- package/lib/esm/components/backoffice/layout/breadcrumb/buildBreadcrumbs.js.map +1 -1
- package/lib/esm/components/backoffice/refs/BackofficeEntityLink.js +1 -1
- package/lib/esm/components/backoffice/refs/BackofficeEntityLink.js.map +1 -1
- package/lib/esm/components/backoffice/shared/BackofficeInlineFilterRow.js +27 -8
- package/lib/esm/components/backoffice/shared/BackofficeInlineFilterRow.js.map +1 -1
- package/lib/esm/components/backoffice/shared/backofficeInlineFilterRow.css.js +2 -2
- package/lib/esm/components/backoffice/shared/backofficeInlineFilterRow.css.js.map +1 -1
- package/lib/esm/components/backoffice/technical/TechnicalIdentifierValue.js +26 -0
- package/lib/esm/components/backoffice/technical/TechnicalIdentifierValue.js.map +1 -0
- package/lib/esm/index.js +9 -6
- package/lib/esm/modules/uploads.js +31 -0
- package/lib/esm/modules/uploads.js.map +1 -0
- package/lib/esm/pages/BackofficeEntityDetailPage.view-helpers.js +313 -262
- package/lib/esm/pages/BackofficeEntityDetailPage.view-helpers.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityListPage.helpers.js +8 -8
- package/lib/esm/pages/BackofficeEntityListPage.helpers.js.map +1 -1
- package/lib/esm/relay/shortAccessTokenEnvironment.js +15 -0
- package/lib/esm/relay/shortAccessTokenEnvironment.js.map +1 -0
- package/lib/esm/relay/useMutationAction.js +33 -0
- package/lib/esm/relay/useMutationAction.js.map +1 -0
- package/lib/types/components/backoffice/columns/buildDataTableColumns.d.ts.map +1 -1
- package/lib/types/components/backoffice/filters/backofficeFilterAction.css.d.ts.map +1 -1
- package/lib/types/components/backoffice/layout/breadcrumb/buildBreadcrumbs.d.ts.map +1 -1
- package/lib/types/components/backoffice/shared/BackofficeInlineFilterRow.d.ts.map +1 -1
- package/lib/types/components/backoffice/shared/backofficeInlineFilterRow.css.d.ts +2 -0
- package/lib/types/components/backoffice/shared/backofficeInlineFilterRow.css.d.ts.map +1 -1
- package/lib/types/components/backoffice/technical/TechnicalIdentifierValue.d.ts +12 -0
- package/lib/types/components/backoffice/technical/TechnicalIdentifierValue.d.ts.map +1 -0
- package/lib/types/index.d.ts +3 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/modules/uploads.d.ts +27 -0
- package/lib/types/modules/uploads.d.ts.map +1 -0
- package/lib/types/pages/BackofficeEntityDetailPage.view-helpers.d.ts.map +1 -1
- package/lib/types/relay/shortAccessTokenEnvironment.d.ts +4 -0
- package/lib/types/relay/shortAccessTokenEnvironment.d.ts.map +1 -0
- package/lib/types/relay/useMutationAction.d.ts +15 -0
- package/lib/types/relay/useMutationAction.d.ts.map +1 -0
- package/package.json +19 -19
package/README.md
CHANGED
|
@@ -73,6 +73,9 @@ packages.
|
|
|
73
73
|
- `useConditionalSubscription`
|
|
74
74
|
- `useCopyToClipboard`
|
|
75
75
|
- `useRefetchNeededReload`
|
|
76
|
+
- `uploadFilesSequentially` runs browser file upload preparation one file at a
|
|
77
|
+
time, reports per-file progress, preserves partial failures, and lets
|
|
78
|
+
applications map descriptors into their own uploaded-file shape.
|
|
76
79
|
|
|
77
80
|
### Relay and mutation helpers
|
|
78
81
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* empty css */
|
|
2
1
|
/* empty css */
|
|
3
2
|
//#region src/auth/login/loginPage.css.ts
|
|
4
3
|
var e = "txvbqbfpn txvbqbh4x txvbqbheb", t = "txvbqbfpn txvbqbh4x txvbqb19uf", n = "txvbqb1bg3 txvbqb9j txvbqbo7v txvbqbny4", r = "txvbqbey txvbqb1bg3 txvbqbfpn txvbqbhdl txvbqbs00 txvbqbp6j", i = "txvbqb1b9r txvbqbk07 txvbqbfvs txvbqb2wi txvbqb1bk3", a = "txvbqbey txvbqbfpn txvbqbh7g txvbqbhdy txvbqblt7 txvbqbrza", o = "w8yhmy0 txvbqb1b4r txvbqb1tv txvbqb2rt txvbqb1bhb txvbqbv txvbqbhbf txvbqbwvi txvbqb3f txvbqb7h txvbqb76 txvbqb7t txvbqb1etp txvbqb1gct", s = "txvbqb10o0 txvbqb11ll txvbqb12j6 txvbqbxv9 txvbqbc7z txvbqbc27 txvbqbci3 txvbqbce4", c = "txvbqbfpn txvbqbh4x txvbqbheb", l = "txvbqb19uf", u = "txvbqbo7v txvbqbam txvbqbhbs txvbqb1bhb txvbqbmu1", d = "txvbqbrzn", f = "w8yhmy1 txvbqb1f2 txvbqb29r txvbqb2sj txvbqb1bhb txvbqb1b9n txvbqb7h txvbqb75 txvbqb7t";
|
|
@@ -1,73 +1,83 @@
|
|
|
1
1
|
import { BackofficeInlineLink as e } from "../links/BackofficeInlineLink.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import a from "@plumile/
|
|
6
|
-
import
|
|
2
|
+
import { TechnicalIdentifierValue as t } from "../technical/TechnicalIdentifierValue.js";
|
|
3
|
+
import { Fragment as n, jsx as r } from "react/jsx-runtime";
|
|
4
|
+
import { FormattedDate as i } from "@plumile/ui/atomic/atoms/formatted-date/FormattedDate.js";
|
|
5
|
+
import { BACKOFFICE_DATE_TIME_OPTIONS as a } from "@plumile/backoffice-core/constants.js";
|
|
6
|
+
import o from "@plumile/router/routing/Link.js";
|
|
7
|
+
import { Tag as s } from "@plumile/ui/backoffice/atoms/tag/Tag.js";
|
|
7
8
|
//#region src/components/backoffice/columns/buildDataTableColumns.tsx
|
|
8
|
-
var
|
|
9
|
+
var c = (e, t) => e(t), l = (e, t) => e == null || typeof e == "string" && e.trim() === "" ? t : String(e), u = (e) => {
|
|
9
10
|
if (e === "sm" || e === "md" || e === "lg" || e === "xl") return e;
|
|
10
11
|
};
|
|
11
|
-
function
|
|
12
|
-
let { tApp:
|
|
13
|
-
return
|
|
14
|
-
id:
|
|
15
|
-
header:
|
|
16
|
-
size:
|
|
17
|
-
isPrimary:
|
|
18
|
-
priority:
|
|
19
|
-
align:
|
|
20
|
-
mobileRole:
|
|
21
|
-
minVisibleAt:
|
|
22
|
-
cell: (
|
|
23
|
-
let { cell:
|
|
24
|
-
switch (
|
|
25
|
-
case "text": return
|
|
12
|
+
function d(d, f) {
|
|
13
|
+
let { tApp: p, t: m } = f, h = m("common.notAvailable");
|
|
14
|
+
return d.filter((e) => e.key !== "id").map((d) => ({
|
|
15
|
+
id: d.key,
|
|
16
|
+
header: c(d.header, p),
|
|
17
|
+
size: d.size,
|
|
18
|
+
isPrimary: d.visibility?.priority === "primary",
|
|
19
|
+
priority: d.visibility?.priority,
|
|
20
|
+
align: d.visibility?.align,
|
|
21
|
+
mobileRole: d.visibility?.mobile,
|
|
22
|
+
minVisibleAt: u(d.visibility?.minVisibleAt),
|
|
23
|
+
cell: (c) => {
|
|
24
|
+
let { cell: u } = d;
|
|
25
|
+
switch (u.type) {
|
|
26
|
+
case "text": return l(u.value(c), h);
|
|
26
27
|
case "link": {
|
|
27
|
-
let e =
|
|
28
|
-
return e == null || typeof e == "string" && e.trim() === "" ?
|
|
29
|
-
to:
|
|
28
|
+
let e = u.value(c);
|
|
29
|
+
return e == null || typeof e == "string" && e.trim() === "" ? h : /* @__PURE__ */ r(o, {
|
|
30
|
+
to: u.to(c),
|
|
30
31
|
preloadOnMouseEnter: !0,
|
|
31
32
|
children: e
|
|
32
33
|
});
|
|
33
34
|
}
|
|
34
35
|
case "badge": {
|
|
35
|
-
let e =
|
|
36
|
-
if (e == null || e.trim() === "") return
|
|
37
|
-
let { tone: t } =
|
|
38
|
-
return typeof t == "function" && (t = t(
|
|
36
|
+
let e = u.value(c);
|
|
37
|
+
if (e == null || e.trim() === "") return h;
|
|
38
|
+
let { tone: t } = u;
|
|
39
|
+
return typeof t == "function" && (t = t(c)), /* @__PURE__ */ r(s, {
|
|
39
40
|
tone: t,
|
|
40
41
|
children: e
|
|
41
42
|
});
|
|
42
43
|
}
|
|
43
|
-
case "dateTime": return /* @__PURE__ */
|
|
44
|
-
value:
|
|
45
|
-
fallback:
|
|
46
|
-
options:
|
|
44
|
+
case "dateTime": return /* @__PURE__ */ r(i, {
|
|
45
|
+
value: u.value(c),
|
|
46
|
+
fallback: h,
|
|
47
|
+
options: a
|
|
47
48
|
});
|
|
48
49
|
case "entityRef": {
|
|
49
|
-
let t =
|
|
50
|
-
if (t.trim() === "") return
|
|
51
|
-
let
|
|
52
|
-
return /* @__PURE__ */
|
|
50
|
+
let t = u.value(c);
|
|
51
|
+
if (t.trim() === "") return h;
|
|
52
|
+
let n = u.label?.(c);
|
|
53
|
+
return n == null || n.trim() === "" ? m("filters.placeholders.unresolved") : /* @__PURE__ */ r(e, {
|
|
53
54
|
target: {
|
|
54
55
|
kind: "entity-detail",
|
|
55
|
-
entityId:
|
|
56
|
+
entityId: u.entity,
|
|
56
57
|
id: t
|
|
57
58
|
},
|
|
58
|
-
children:
|
|
59
|
+
children: n
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
case "technicalIdentifier": {
|
|
63
|
+
let e = u.value(c);
|
|
64
|
+
return e == null || String(e).trim() === "" ? h : /* @__PURE__ */ r(t, {
|
|
65
|
+
value: e,
|
|
66
|
+
copyValue: u.copyValue?.(c) ?? void 0,
|
|
67
|
+
variant: u.variant,
|
|
68
|
+
copyLabel: m("common.actions.copy")
|
|
59
69
|
});
|
|
60
70
|
}
|
|
61
71
|
case "custom": {
|
|
62
|
-
let e =
|
|
63
|
-
return e == null || e === "" ?
|
|
72
|
+
let e = u.render(c);
|
|
73
|
+
return e == null || e === "" ? h : /* @__PURE__ */ r(n, { children: e });
|
|
64
74
|
}
|
|
65
|
-
default: return
|
|
75
|
+
default: return h;
|
|
66
76
|
}
|
|
67
77
|
}
|
|
68
78
|
}));
|
|
69
79
|
}
|
|
70
80
|
//#endregion
|
|
71
|
-
export {
|
|
81
|
+
export { d as buildDataTableColumns };
|
|
72
82
|
|
|
73
83
|
//# sourceMappingURL=buildDataTableColumns.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildDataTableColumns.js","names":[],"sources":["../../../../../src/components/backoffice/columns/buildDataTableColumns.tsx"],"sourcesContent":["import { BACKOFFICE_DATE_TIME_OPTIONS } from '@plumile/backoffice-core/constants.js';\nimport type {\n BackofficeColumnSpec,\n BackofficeFieldSize,\n BackofficeListColumnVisibility,\n I18nLabel,\n} from '@plumile/backoffice-core/types.js';\nimport type { TFunction } from 'i18next';\nimport Link from '@plumile/router/routing/Link.js';\nimport { FormattedDate } from '@plumile/ui/atomic/atoms/formatted-date/FormattedDate.js';\nimport { Tag } from '@plumile/ui/backoffice/atoms/tag/Tag.js';\nimport { type DataTableColumn } from '@plumile/ui/components/data-table/DataTable.js';\nimport { type DataTableBreakpoint } from '@plumile/ui/components/data-table/tableBreakpoints.js';\nimport { BackofficeInlineLink } from '../links/BackofficeInlineLink.js';\nimport type { BackofficeLinkTarget } from '../links/types.js';\n\nconst resolveLabel = (label: I18nLabel, tApp: TFunction): string => {\n return label(tApp);\n};\n\nconst resolveTextValue = (\n value: string | number | null,\n fallback: string,\n): string => {\n if (value == null) {\n return fallback;\n }\n if (typeof value === 'string' && value.trim() === '') {\n return fallback;\n }\n return String(value);\n};\n\nexport type BuildDataTableColumnsOptions = {\n tApp: TFunction;\n t: TFunction;\n};\n\nexport type BackofficeSizedDataTableColumn<Row> = DataTableColumn<Row> & {\n size: BackofficeFieldSize;\n};\n\nconst resolveBreakpoint = (\n value: BackofficeListColumnVisibility['minVisibleAt'] | undefined,\n): DataTableBreakpoint | undefined => {\n if (value === 'sm' || value === 'md' || value === 'lg' || value === 'xl') {\n return value;\n }\n return undefined;\n};\n\n/**\n *\n */\nexport function buildDataTableColumns<Row>(\n columns: readonly BackofficeColumnSpec<Row>[],\n options: BuildDataTableColumnsOptions,\n): readonly BackofficeSizedDataTableColumn<Row>[] {\n const { tApp, t } = options;\n const fallback = t('common.notAvailable');\n const filteredColumns = columns.filter((column) => {\n return column.key !== 'id';\n });\n\n return filteredColumns.map((column) => {\n return {\n id: column.key,\n header: resolveLabel(column.header, tApp),\n size: column.size,\n isPrimary: column.visibility?.priority === 'primary',\n priority: column.visibility?.priority,\n align: column.visibility?.align,\n mobileRole: column.visibility?.mobile,\n minVisibleAt: resolveBreakpoint(column.visibility?.minVisibleAt),\n cell: (row) => {\n const { cell } = column;\n switch (cell.type) {\n case 'text': {\n return resolveTextValue(cell.value(row), fallback);\n }\n case 'link': {\n const value = cell.value(row);\n if (\n value == null ||\n (typeof value === 'string' && value.trim() === '')\n ) {\n return fallback;\n }\n return (\n <Link to={cell.to(row)} preloadOnMouseEnter>\n {value}\n </Link>\n );\n }\n case 'badge': {\n const value = cell.value(row);\n if (value == null || value.trim() === '') {\n return fallback;\n }\n let { tone } = cell;\n if (typeof tone === 'function') {\n tone = tone(row);\n }\n return <Tag tone={tone}>{value}</Tag>;\n }\n case 'dateTime': {\n const value = cell.value(row);\n return (\n <FormattedDate\n value={value}\n fallback={fallback}\n options={BACKOFFICE_DATE_TIME_OPTIONS}\n />\n );\n }\n case 'entityRef': {\n const id = cell.value(row);\n if (id.trim() === '') {\n return fallback;\n }\n const label = cell.label?.(row)
|
|
1
|
+
{"version":3,"file":"buildDataTableColumns.js","names":[],"sources":["../../../../../src/components/backoffice/columns/buildDataTableColumns.tsx"],"sourcesContent":["import { BACKOFFICE_DATE_TIME_OPTIONS } from '@plumile/backoffice-core/constants.js';\nimport type {\n BackofficeColumnSpec,\n BackofficeFieldSize,\n BackofficeListColumnVisibility,\n I18nLabel,\n} from '@plumile/backoffice-core/types.js';\nimport type { TFunction } from 'i18next';\nimport Link from '@plumile/router/routing/Link.js';\nimport { FormattedDate } from '@plumile/ui/atomic/atoms/formatted-date/FormattedDate.js';\nimport { Tag } from '@plumile/ui/backoffice/atoms/tag/Tag.js';\nimport { type DataTableColumn } from '@plumile/ui/components/data-table/DataTable.js';\nimport { type DataTableBreakpoint } from '@plumile/ui/components/data-table/tableBreakpoints.js';\nimport { BackofficeInlineLink } from '../links/BackofficeInlineLink.js';\nimport type { BackofficeLinkTarget } from '../links/types.js';\nimport { TechnicalIdentifierValue } from '../technical/TechnicalIdentifierValue.js';\n\nconst resolveLabel = (label: I18nLabel, tApp: TFunction): string => {\n return label(tApp);\n};\n\nconst resolveTextValue = (\n value: string | number | null,\n fallback: string,\n): string => {\n if (value == null) {\n return fallback;\n }\n if (typeof value === 'string' && value.trim() === '') {\n return fallback;\n }\n return String(value);\n};\n\nexport type BuildDataTableColumnsOptions = {\n tApp: TFunction;\n t: TFunction;\n};\n\nexport type BackofficeSizedDataTableColumn<Row> = DataTableColumn<Row> & {\n size: BackofficeFieldSize;\n};\n\nconst resolveBreakpoint = (\n value: BackofficeListColumnVisibility['minVisibleAt'] | undefined,\n): DataTableBreakpoint | undefined => {\n if (value === 'sm' || value === 'md' || value === 'lg' || value === 'xl') {\n return value;\n }\n return undefined;\n};\n\n/**\n *\n */\nexport function buildDataTableColumns<Row>(\n columns: readonly BackofficeColumnSpec<Row>[],\n options: BuildDataTableColumnsOptions,\n): readonly BackofficeSizedDataTableColumn<Row>[] {\n const { tApp, t } = options;\n const fallback = t('common.notAvailable');\n const filteredColumns = columns.filter((column) => {\n return column.key !== 'id';\n });\n\n return filteredColumns.map((column) => {\n return {\n id: column.key,\n header: resolveLabel(column.header, tApp),\n size: column.size,\n isPrimary: column.visibility?.priority === 'primary',\n priority: column.visibility?.priority,\n align: column.visibility?.align,\n mobileRole: column.visibility?.mobile,\n minVisibleAt: resolveBreakpoint(column.visibility?.minVisibleAt),\n cell: (row) => {\n const { cell } = column;\n switch (cell.type) {\n case 'text': {\n return resolveTextValue(cell.value(row), fallback);\n }\n case 'link': {\n const value = cell.value(row);\n if (\n value == null ||\n (typeof value === 'string' && value.trim() === '')\n ) {\n return fallback;\n }\n return (\n <Link to={cell.to(row)} preloadOnMouseEnter>\n {value}\n </Link>\n );\n }\n case 'badge': {\n const value = cell.value(row);\n if (value == null || value.trim() === '') {\n return fallback;\n }\n let { tone } = cell;\n if (typeof tone === 'function') {\n tone = tone(row);\n }\n return <Tag tone={tone}>{value}</Tag>;\n }\n case 'dateTime': {\n const value = cell.value(row);\n return (\n <FormattedDate\n value={value}\n fallback={fallback}\n options={BACKOFFICE_DATE_TIME_OPTIONS}\n />\n );\n }\n case 'entityRef': {\n const id = cell.value(row);\n if (id.trim() === '') {\n return fallback;\n }\n const label = cell.label?.(row);\n if (label == null || label.trim() === '') {\n return t('filters.placeholders.unresolved');\n }\n const target = {\n kind: 'entity-detail',\n entityId: cell.entity,\n id,\n } as BackofficeLinkTarget;\n return (\n <BackofficeInlineLink target={target}>\n {label}\n </BackofficeInlineLink>\n );\n }\n case 'technicalIdentifier': {\n const value = cell.value(row);\n if (value == null || String(value).trim() === '') {\n return fallback;\n }\n return (\n <TechnicalIdentifierValue\n value={value}\n copyValue={cell.copyValue?.(row) ?? undefined}\n variant={cell.variant}\n copyLabel={t('common.actions.copy')}\n />\n );\n }\n case 'custom': {\n const rendered = cell.render(row);\n if (rendered == null || rendered === '') {\n return fallback;\n }\n return <>{rendered}</>;\n }\n default: {\n return fallback;\n }\n }\n },\n };\n });\n}\n"],"mappings":";;;;;;;;AAiBA,IAAM,KAAgB,GAAkB,MAC/B,EAAM,CAAI,GAGb,KACJ,GACA,MAEI,KAAS,QAGT,OAAO,KAAU,YAAY,EAAM,KAAK,MAAM,KACzC,IAEF,OAAO,CAAK,GAYf,KACJ,MACoC;CACpC,IAAI,MAAU,QAAQ,MAAU,QAAQ,MAAU,QAAQ,MAAU,MAClE,OAAO;AAGX;AAKA,SAAgB,EACd,GACA,GACgD;CAChD,IAAM,EAAE,SAAM,SAAM,GACd,IAAW,EAAE,qBAAqB;CAKxC,OAJwB,EAAQ,QAAQ,MAC/B,EAAO,QAAQ,IAGjB,EAAgB,KAAK,OACnB;EACL,IAAI,EAAO;EACX,QAAQ,EAAa,EAAO,QAAQ,CAAI;EACxC,MAAM,EAAO;EACb,WAAW,EAAO,YAAY,aAAa;EAC3C,UAAU,EAAO,YAAY;EAC7B,OAAO,EAAO,YAAY;EAC1B,YAAY,EAAO,YAAY;EAC/B,cAAc,EAAkB,EAAO,YAAY,YAAY;EAC/D,OAAO,MAAQ;GACb,IAAM,EAAE,YAAS;GACjB,QAAQ,EAAK,MAAb;IACE,KAAK,QACH,OAAO,EAAiB,EAAK,MAAM,CAAG,GAAG,CAAQ;IAEnD,KAAK,QAAQ;KACX,IAAM,IAAQ,EAAK,MAAM,CAAG;KAO5B,OALE,KAAS,QACR,OAAO,KAAU,YAAY,EAAM,KAAK,MAAM,KAExC,IAGP,kBAAC,GAAD;MAAM,IAAI,EAAK,GAAG,CAAG;MAAG,qBAAA;gBACrB;KACG,CAAA;IAEV;IACA,KAAK,SAAS;KACZ,IAAM,IAAQ,EAAK,MAAM,CAAG;KAC5B,IAAI,KAAS,QAAQ,EAAM,KAAK,MAAM,IACpC,OAAO;KAET,IAAI,EAAE,YAAS;KAIf,OAHI,OAAO,KAAS,eAClB,IAAO,EAAK,CAAG,IAEV,kBAAC,GAAD;MAAW;gBAAO;KAAW,CAAA;IACtC;IACA,KAAK,YAEH,OACE,kBAAC,GAAD;KACS,OAHG,EAAK,MAAM,CAGd;KACG;KACV,SAAS;IACV,CAAA;IAGL,KAAK,aAAa;KAChB,IAAM,IAAK,EAAK,MAAM,CAAG;KACzB,IAAI,EAAG,KAAK,MAAM,IAChB,OAAO;KAET,IAAM,IAAQ,EAAK,QAAQ,CAAG;KAS9B,OARI,KAAS,QAAQ,EAAM,KAAK,MAAM,KAC7B,EAAE,iCAAiC,IAQ1C,kBAAC,GAAD;MAA8B,QAAA;OAL9B,MAAM;OACN,UAAU,EAAK;OACf;MAG8B;gBAC3B;KACmB,CAAA;IAE1B;IACA,KAAK,uBAAuB;KAC1B,IAAM,IAAQ,EAAK,MAAM,CAAG;KAI5B,OAHI,KAAS,QAAQ,OAAO,CAAK,EAAE,KAAK,MAAM,KACrC,IAGP,kBAAC,GAAD;MACS;MACP,WAAW,EAAK,YAAY,CAAG,KAAK,KAAA;MACpC,SAAS,EAAK;MACd,WAAW,EAAE,qBAAqB;KACnC,CAAA;IAEL;IACA,KAAK,UAAU;KACb,IAAM,IAAW,EAAK,OAAO,CAAG;KAIhC,OAHI,KAAY,QAAQ,MAAa,KAC5B,IAEF,kBAAA,GAAA,EAAA,UAAG,EAAW,CAAA;IACvB;IACA,SACE,OAAO;GAEX;EACF;CACF,EACD;AACH"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* empty css */
|
|
2
2
|
//#region src/components/backoffice/filters/backofficeFilterAction.css.ts
|
|
3
|
-
var e = "hwnq700 txvbqbfqq txvbqbey txvbqbls4 txvbqb19gp txvbqbjm4 txvbqbwvi txvbqb2tz txvbqb28o txvbqb2sj txvbqb1d9 txvbqb1b83 txvbqb1bhb txvbqbv txvbqb3f txvbqb7h txvbqb75 txvbqb7t txvbqb1eol txvbqb1czh txvbqb1dth qbwcue0 txvbqb1ffs txvbqb1ga0", t = "txvbqb19fm txvbqbjl1";
|
|
3
|
+
var e = "hwnq700 txvbqbfqq txvbqbey txvbqbls4 txvbqbh6d txvbqb19gp txvbqbjm4 txvbqbwvi txvbqb2tz txvbqb28o txvbqb2sj txvbqb1d9 txvbqb1b83 txvbqb1bhb txvbqbv txvbqb3f txvbqb7h txvbqb75 txvbqb7t txvbqb1eol txvbqb1czh txvbqb1dth qbwcue0 txvbqb1ffs txvbqb1ga0", t = "txvbqb19fm txvbqbjl1";
|
|
4
4
|
//#endregion
|
|
5
5
|
export { e as action, t as icon };
|
|
6
6
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backofficeFilterAction.css.js","names":[],"sources":["../../../../../src/components/backoffice/filters/backofficeFilterAction.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css';\nimport { sprinkles, stateSprinkles } from '@plumile/ui/theme/sprinkles.css.js';\nimport { focusRing } from '@plumile/ui/theme/styleRecipes.css.js';\n\nexport const action = style([\n sprinkles({\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: 7,\n height: 7,\n padding: 0,\n borderRadius: 'md',\n borderWidth: 'default',\n borderStyle: 'solid',\n borderColor: 'borderSubtle',\n backgroundColor: 'surfaceMuted',\n color: 'tonePrimaryText',\n cursor: 'pointer',\n textDecoration: 'none',\n transitionProperty: 'colors',\n transitionDuration: 120,\n transitionTimingFunction: 'ease',\n }),\n stateSprinkles({\n color: { hover: 'text' },\n backgroundColor: { hover: 'tonePrimarySurface' },\n borderColor: { hover: 'tonePrimaryBorder' },\n }),\n focusRing,\n]);\n\nexport const icon = sprinkles({\n width: 4,\n height: 4,\n});\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"backofficeFilterAction.css.js","names":[],"sources":["../../../../../src/components/backoffice/filters/backofficeFilterAction.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css';\nimport { sprinkles, stateSprinkles } from '@plumile/ui/theme/sprinkles.css.js';\nimport { focusRing } from '@plumile/ui/theme/styleRecipes.css.js';\n\nexport const action = style([\n sprinkles({\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n flexShrink: 0,\n width: 7,\n height: 7,\n padding: 0,\n borderRadius: 'md',\n borderWidth: 'default',\n borderStyle: 'solid',\n borderColor: 'borderSubtle',\n backgroundColor: 'surfaceMuted',\n color: 'tonePrimaryText',\n cursor: 'pointer',\n textDecoration: 'none',\n transitionProperty: 'colors',\n transitionDuration: 120,\n transitionTimingFunction: 'ease',\n }),\n stateSprinkles({\n color: { hover: 'text' },\n backgroundColor: { hover: 'tonePrimarySurface' },\n borderColor: { hover: 'tonePrimaryBorder' },\n }),\n focusRing,\n]);\n\nexport const icon = sprinkles({\n width: 4,\n height: 4,\n});\n"],"mappings":""}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
//#region src/components/backoffice/layout/breadcrumb/buildBreadcrumbs.ts
|
|
2
2
|
var e = (e, t) => e(t), t = (t) => {
|
|
3
|
-
let n = t.detailHeader.titleValue?.(t.layoutView, t.tApp);
|
|
4
|
-
if (typeof n == "string" && n.trim() !== "") return n;
|
|
5
|
-
let
|
|
6
|
-
|
|
7
|
-
let i = t.layoutView.id;
|
|
8
|
-
return typeof i == "string" && i.trim() !== "" ? i : "";
|
|
3
|
+
let n = t.detailHeader.titleValue?.(t.layoutView, t.tApp), r = t.layoutView.id, i = null;
|
|
4
|
+
if (typeof r == "string" && r.trim() !== "" && (i = r.trim()), typeof n == "string" && n.trim() !== "" && n.trim() !== i) return n;
|
|
5
|
+
let a = e(t.detailHeader.title, t.tApp);
|
|
6
|
+
return a.trim() === "" ? "" : a;
|
|
9
7
|
}, n = (e) => [{
|
|
10
8
|
kind: "current",
|
|
11
9
|
target: { kind: "dashboard" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildBreadcrumbs.js","names":[],"sources":["../../../../../../src/components/backoffice/layout/breadcrumb/buildBreadcrumbs.ts"],"sourcesContent":["import type { TFunction } from 'i18next';\n\nimport type {\n BackofficeEntityManifestMap,\n BackofficeManifestDetailEntityId,\n BackofficeManifestListEntityId,\n BackofficeManifestToolId,\n BackofficeResolvedDetailLayoutFacetConfig,\n BackofficeResolvedDetailPageFacetConfig,\n BackofficeRuntimeResolvedListFacetConfig,\n I18nLabel,\n} from '@plumile/backoffice-core/types.js';\n\nimport type { BackofficeTopbarBreadcrumbItem } from './types.js';\n\nconst resolveLabel = (label: I18nLabel, tApp: TFunction): string => {\n return label(tApp);\n};\n\nexport const resolveEntityTitleFromDetailHeader = <\n LayoutView extends object,\n>(input: {\n layoutView: LayoutView;\n detailHeader: BackofficeResolvedDetailLayoutFacetConfig['header'];\n tApp: TFunction;\n}): string => {\n const titleValue = input.detailHeader.titleValue?.(\n input.layoutView,\n input.tApp,\n );\n if (typeof
|
|
1
|
+
{"version":3,"file":"buildBreadcrumbs.js","names":[],"sources":["../../../../../../src/components/backoffice/layout/breadcrumb/buildBreadcrumbs.ts"],"sourcesContent":["import type { TFunction } from 'i18next';\n\nimport type {\n BackofficeEntityManifestMap,\n BackofficeManifestDetailEntityId,\n BackofficeManifestListEntityId,\n BackofficeManifestToolId,\n BackofficeResolvedDetailLayoutFacetConfig,\n BackofficeResolvedDetailPageFacetConfig,\n BackofficeRuntimeResolvedListFacetConfig,\n I18nLabel,\n} from '@plumile/backoffice-core/types.js';\n\nimport type { BackofficeTopbarBreadcrumbItem } from './types.js';\n\nconst resolveLabel = (label: I18nLabel, tApp: TFunction): string => {\n return label(tApp);\n};\n\nexport const resolveEntityTitleFromDetailHeader = <\n LayoutView extends object,\n>(input: {\n layoutView: LayoutView;\n detailHeader: BackofficeResolvedDetailLayoutFacetConfig['header'];\n tApp: TFunction;\n}): string => {\n const titleValue = input.detailHeader.titleValue?.(\n input.layoutView,\n input.tApp,\n );\n const maybeId = (input.layoutView as { id?: unknown }).id;\n let normalizedId: string | null = null;\n if (typeof maybeId === 'string' && maybeId.trim() !== '') {\n normalizedId = maybeId.trim();\n }\n if (\n typeof titleValue === 'string' &&\n titleValue.trim() !== '' &&\n titleValue.trim() !== normalizedId\n ) {\n return titleValue;\n }\n\n const title = resolveLabel(input.detailHeader.title, input.tApp);\n if (title.trim() !== '') {\n return title;\n }\n\n return '';\n};\n\nexport const buildDashboardBreadcrumb = (\n t: TFunction,\n): readonly BackofficeTopbarBreadcrumbItem[] => {\n return [\n {\n kind: 'current',\n target: { kind: 'dashboard' },\n label: t('sidebar.items.dashboard'),\n },\n ];\n};\n\nexport const buildHubBreadcrumb = <\n TManifest extends BackofficeEntityManifestMap = BackofficeEntityManifestMap,\n>(input: {\n id: string;\n title: string;\n}): readonly BackofficeTopbarBreadcrumbItem<TManifest>[] => {\n return [\n {\n kind: 'current',\n target: { kind: 'hub', hubId: input.id },\n label: input.title,\n },\n ];\n};\n\nexport const buildEntityListBreadcrumb = <\n TManifest extends BackofficeEntityManifestMap = BackofficeEntityManifestMap,\n>(\n config: BackofficeRuntimeResolvedListFacetConfig,\n tApp: TFunction,\n): readonly BackofficeTopbarBreadcrumbItem<TManifest>[] => {\n return [\n {\n kind: 'current',\n target: {\n kind: 'entity-list',\n entityId: config.id as BackofficeManifestListEntityId<TManifest>,\n },\n label: resolveLabel(config.label, tApp),\n },\n ];\n};\n\nexport const buildEntityDetailBreadcrumb = <\n TManifest extends BackofficeEntityManifestMap = BackofficeEntityManifestMap,\n>(input: {\n config:\n | BackofficeResolvedDetailLayoutFacetConfig\n | BackofficeResolvedDetailPageFacetConfig;\n tApp: TFunction;\n entityId: string;\n layoutView: unknown;\n pageLabel: string;\n pageId?: string;\n}): readonly BackofficeTopbarBreadcrumbItem<TManifest>[] => {\n const listLabel = resolveLabel(input.config.label, input.tApp);\n const entityTitle = resolveEntityTitleFromDetailHeader({\n layoutView: input.layoutView as object,\n detailHeader: input.config.header,\n tApp: input.tApp,\n });\n\n return [\n {\n kind: 'link',\n target: {\n kind: 'entity-list',\n entityId: input.config.id as BackofficeManifestListEntityId<TManifest>,\n },\n label: listLabel,\n },\n {\n kind: 'link',\n target: {\n kind: 'entity-detail',\n entityId: input.config\n .id as BackofficeManifestDetailEntityId<TManifest>,\n id: input.entityId,\n },\n label: entityTitle,\n },\n {\n kind: 'current',\n target: {\n kind: 'entity-detail-page',\n entityId: input.config\n .id as BackofficeManifestDetailEntityId<TManifest>,\n id: input.entityId,\n pageId: input.pageId ?? input.pageLabel,\n } as never,\n label: input.pageLabel,\n },\n ];\n};\n\nexport const buildToolBreadcrumb = <\n TManifest extends BackofficeEntityManifestMap = BackofficeEntityManifestMap,\n>(input: {\n id?: BackofficeManifestToolId<TManifest> | string;\n title: string;\n}): readonly BackofficeTopbarBreadcrumbItem<TManifest>[] => {\n let target: BackofficeTopbarBreadcrumbItem<TManifest>['target'] = {\n kind: 'href',\n href: `/tools/${input.title}`,\n };\n if (input.id != null) {\n target = {\n kind: 'tool',\n toolId: input.id as BackofficeManifestToolId<TManifest>,\n };\n }\n return [\n {\n kind: 'current',\n target,\n label: input.title,\n },\n ];\n};\n"],"mappings":";AAeA,IAAM,KAAgB,GAAkB,MAC/B,EAAM,CAAI,GAGN,KAEX,MAIY;CACZ,IAAM,IAAa,EAAM,aAAa,aACpC,EAAM,YACN,EAAM,IACR,GACM,IAAW,EAAM,WAAgC,IACnD,IAA8B;CAIlC,IAHI,OAAO,KAAY,YAAY,EAAQ,KAAK,MAAM,OACpD,IAAe,EAAQ,KAAK,IAG5B,OAAO,KAAe,YACtB,EAAW,KAAK,MAAM,MACtB,EAAW,KAAK,MAAM,GAEtB,OAAO;CAGT,IAAM,IAAQ,EAAa,EAAM,aAAa,OAAO,EAAM,IAAI;CAK/D,OAJI,EAAM,KAAK,MAAM,KAId,KAHE;AAIX,GAEa,KACX,MAEO,CACL;CACE,MAAM;CACN,QAAQ,EAAE,MAAM,YAAY;CAC5B,OAAO,EAAE,yBAAyB;AACpC,CACF,GAGW,KAEX,MAIO,CACL;CACE,MAAM;CACN,QAAQ;EAAE,MAAM;EAAO,OAAO,EAAM;CAAG;CACvC,OAAO,EAAM;AACf,CACF,GAGW,KAGX,GACA,MAEO,CACL;CACE,MAAM;CACN,QAAQ;EACN,MAAM;EACN,UAAU,EAAO;CACnB;CACA,OAAO,EAAa,EAAO,OAAO,CAAI;AACxC,CACF,GAGW,KAEX,MAS0D;CAC1D,IAAM,IAAY,EAAa,EAAM,OAAO,OAAO,EAAM,IAAI,GACvD,IAAc,EAAmC;EACrD,YAAY,EAAM;EAClB,cAAc,EAAM,OAAO;EAC3B,MAAM,EAAM;CACd,CAAC;CAED,OAAO;EACL;GACE,MAAM;GACN,QAAQ;IACN,MAAM;IACN,UAAU,EAAM,OAAO;GACzB;GACA,OAAO;EACT;EACA;GACE,MAAM;GACN,QAAQ;IACN,MAAM;IACN,UAAU,EAAM,OACb;IACH,IAAI,EAAM;GACZ;GACA,OAAO;EACT;EACA;GACE,MAAM;GACN,QAAQ;IACN,MAAM;IACN,UAAU,EAAM,OACb;IACH,IAAI,EAAM;IACV,QAAQ,EAAM,UAAU,EAAM;GAChC;GACA,OAAO,EAAM;EACf;CACF;AACF,GAEa,KAEX,MAG0D;CAC1D,IAAI,IAA8D;EAChE,MAAM;EACN,MAAM,UAAU,EAAM;CACxB;CAOA,OANI,EAAM,MAAM,SACd,IAAS;EACP,MAAM;EACN,QAAQ,EAAM;CAChB,IAEK,CACL;EACE,MAAM;EACN;EACA,OAAO,EAAM;CACf,CACF;AACF"}
|
|
@@ -19,7 +19,7 @@ var i = ({ id: i, label: a, entity: o, filterWhereKey: s, filterValue: c, filter
|
|
|
19
19
|
entityId: o,
|
|
20
20
|
id: p
|
|
21
21
|
}, g = a ?? "";
|
|
22
|
-
return g.trim() === "" && (g = f("actions.view")), /* @__PURE__ */ r(n, {
|
|
22
|
+
return (g.trim() === "" || g.trim() === p) && (g = f("actions.view")), /* @__PURE__ */ r(n, {
|
|
23
23
|
filterAction: m,
|
|
24
24
|
target: h,
|
|
25
25
|
title: g,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackofficeEntityLink.js","names":[],"sources":["../../../../../src/components/backoffice/refs/BackofficeEntityLink.tsx"],"sourcesContent":["import { type JSX } from 'react';\nimport type { BackofficeRuntimeResolvedListFacetConfig } from '@plumile/backoffice-core/types.js';\n\nimport { useBackofficeReactTranslation } from '../../../i18n/useBackofficeReactTranslation.js';\nimport type { BackofficeLinkTarget } from '../links/types.js';\nimport { BackofficeFilterAction } from '../filters/BackofficeFilterAction.js';\nimport { BackofficeFilterableCell } from '../shared/BackofficeFilterableCell.js';\n\nexport type BackofficeEntityLinkProps = {\n id: string | null | undefined;\n label?: string | null | undefined;\n entity: string;\n filterWhereKey?: string;\n filterValue?: string;\n filterPath?: readonly string[];\n filterLabel?: string;\n listConfig?: BackofficeRuntimeResolvedListFacetConfig;\n};\n\nexport const BackofficeEntityLink = ({\n id,\n label,\n entity,\n filterWhereKey,\n filterValue,\n filterPath,\n filterLabel,\n listConfig,\n}: BackofficeEntityLinkProps): JSX.Element => {\n const { t } = useBackofficeReactTranslation();\n let resolvedId = '';\n if (typeof id === 'string') {\n resolvedId = id.trim();\n }\n if (resolvedId === '') {\n return <span>{t('common.notAvailable')}</span>;\n }\n\n let filterAction: JSX.Element | null = null;\n if (filterWhereKey != null) {\n const resolvedFilterValue = filterValue ?? resolvedId;\n filterAction = (\n <BackofficeFilterAction\n whereKey={filterWhereKey}\n value={resolvedFilterValue}\n path={filterPath}\n label={filterLabel}\n listConfig={listConfig}\n />\n );\n }\n\n const target = {\n kind: 'entity-detail',\n entityId: entity,\n id: resolvedId,\n } as BackofficeLinkTarget;\n let resolvedLabel = label ?? '';\n if (resolvedLabel.trim() === '') {\n resolvedLabel = t('actions.view');\n }\n\n return (\n <BackofficeFilterableCell\n filterAction={filterAction}\n target={target}\n title={resolvedLabel}\n openInNewTab\n >\n {resolvedLabel}\n </BackofficeFilterableCell>\n );\n};\n\nexport default BackofficeEntityLink;\n"],"mappings":";;;;;AAmBA,IAAa,KAAwB,EACnC,OACA,UACA,WACA,mBACA,gBACA,eACA,gBACA,oBAC4C;CAC5C,IAAM,EAAE,SAAM,EAA8B,GACxC,IAAa;CAIjB,IAHI,OAAO,KAAO,aAChB,IAAa,EAAG,KAAK,IAEnB,MAAe,IACjB,OAAO,kBAAC,QAAD,EAAA,UAAO,EAAE,qBAAqB,EAAQ,CAAA;CAG/C,IAAI,IAAmC;CACvC,AAAI,KAAkB,SAEpB,IACE,kBAAC,GAAD;EACE,UAAU;EACV,OAJwB,KAAe;EAKvC,MAAM;EACN,OAAO;EACK;CACb,CAAA;CAIL,IAAM,IAAS;EACb,MAAM;EACN,UAAU;EACV,IAAI;CACN,GACI,IAAgB,KAAS;CAK7B,
|
|
1
|
+
{"version":3,"file":"BackofficeEntityLink.js","names":[],"sources":["../../../../../src/components/backoffice/refs/BackofficeEntityLink.tsx"],"sourcesContent":["import { type JSX } from 'react';\nimport type { BackofficeRuntimeResolvedListFacetConfig } from '@plumile/backoffice-core/types.js';\n\nimport { useBackofficeReactTranslation } from '../../../i18n/useBackofficeReactTranslation.js';\nimport type { BackofficeLinkTarget } from '../links/types.js';\nimport { BackofficeFilterAction } from '../filters/BackofficeFilterAction.js';\nimport { BackofficeFilterableCell } from '../shared/BackofficeFilterableCell.js';\n\nexport type BackofficeEntityLinkProps = {\n id: string | null | undefined;\n label?: string | null | undefined;\n entity: string;\n filterWhereKey?: string;\n filterValue?: string;\n filterPath?: readonly string[];\n filterLabel?: string;\n listConfig?: BackofficeRuntimeResolvedListFacetConfig;\n};\n\nexport const BackofficeEntityLink = ({\n id,\n label,\n entity,\n filterWhereKey,\n filterValue,\n filterPath,\n filterLabel,\n listConfig,\n}: BackofficeEntityLinkProps): JSX.Element => {\n const { t } = useBackofficeReactTranslation();\n let resolvedId = '';\n if (typeof id === 'string') {\n resolvedId = id.trim();\n }\n if (resolvedId === '') {\n return <span>{t('common.notAvailable')}</span>;\n }\n\n let filterAction: JSX.Element | null = null;\n if (filterWhereKey != null) {\n const resolvedFilterValue = filterValue ?? resolvedId;\n filterAction = (\n <BackofficeFilterAction\n whereKey={filterWhereKey}\n value={resolvedFilterValue}\n path={filterPath}\n label={filterLabel}\n listConfig={listConfig}\n />\n );\n }\n\n const target = {\n kind: 'entity-detail',\n entityId: entity,\n id: resolvedId,\n } as BackofficeLinkTarget;\n let resolvedLabel = label ?? '';\n if (resolvedLabel.trim() === '' || resolvedLabel.trim() === resolvedId) {\n resolvedLabel = t('actions.view');\n }\n\n return (\n <BackofficeFilterableCell\n filterAction={filterAction}\n target={target}\n title={resolvedLabel}\n openInNewTab\n >\n {resolvedLabel}\n </BackofficeFilterableCell>\n );\n};\n\nexport default BackofficeEntityLink;\n"],"mappings":";;;;;AAmBA,IAAa,KAAwB,EACnC,OACA,UACA,WACA,mBACA,gBACA,eACA,gBACA,oBAC4C;CAC5C,IAAM,EAAE,SAAM,EAA8B,GACxC,IAAa;CAIjB,IAHI,OAAO,KAAO,aAChB,IAAa,EAAG,KAAK,IAEnB,MAAe,IACjB,OAAO,kBAAC,QAAD,EAAA,UAAO,EAAE,qBAAqB,EAAQ,CAAA;CAG/C,IAAI,IAAmC;CACvC,AAAI,KAAkB,SAEpB,IACE,kBAAC,GAAD;EACE,UAAU;EACV,OAJwB,KAAe;EAKvC,MAAM;EACN,OAAO;EACK;CACb,CAAA;CAIL,IAAM,IAAS;EACb,MAAM;EACN,UAAU;EACV,IAAI;CACN,GACI,IAAgB,KAAS;CAK7B,QAJI,EAAc,KAAK,MAAM,MAAM,EAAc,KAAK,MAAM,OAC1D,IAAgB,EAAE,cAAc,IAIhC,kBAAC,GAAD;EACgB;EACN;EACR,OAAO;EACP,cAAA;YAEC;CACuB,CAAA;AAE9B"}
|
|
@@ -1,12 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { actionSlot as e, container as t, valueSlot as n } from "./backofficeInlineFilterRow.css.js";
|
|
2
|
+
import { Children as r } from "react";
|
|
3
|
+
import { cx as i } from "@plumile/ui/theme/tools.js";
|
|
4
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
4
5
|
//#region src/components/backoffice/shared/BackofficeInlineFilterRow.tsx
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
var s = ({ children: s, className: c }) => {
|
|
7
|
+
let l = r.toArray(s), u = null, d = l;
|
|
8
|
+
if (l.length > 1) {
|
|
9
|
+
let [e, ...t] = l;
|
|
10
|
+
u = e, d = t;
|
|
11
|
+
}
|
|
12
|
+
let f = null;
|
|
13
|
+
if (d.length === 1) {
|
|
14
|
+
let [e] = d;
|
|
15
|
+
f = e;
|
|
16
|
+
} else d.length > 1 && (f = d);
|
|
17
|
+
return /* @__PURE__ */ o("span", {
|
|
18
|
+
className: i(t, c),
|
|
19
|
+
children: [/* @__PURE__ */ a("span", {
|
|
20
|
+
className: e,
|
|
21
|
+
children: u
|
|
22
|
+
}), /* @__PURE__ */ a("span", {
|
|
23
|
+
className: n,
|
|
24
|
+
children: f
|
|
25
|
+
})]
|
|
26
|
+
});
|
|
27
|
+
};
|
|
9
28
|
//#endregion
|
|
10
|
-
export {
|
|
29
|
+
export { s as BackofficeInlineFilterRow, s as default };
|
|
11
30
|
|
|
12
31
|
//# sourceMappingURL=BackofficeInlineFilterRow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackofficeInlineFilterRow.js","names":[],"sources":["../../../../../src/components/backoffice/shared/BackofficeInlineFilterRow.tsx"],"sourcesContent":["import { type JSX, type ReactNode } from 'react';\n\nimport { cx } from '@plumile/ui/theme/tools.js';\n\nimport * as styles from './backofficeInlineFilterRow.css.js';\n\nexport type BackofficeInlineFilterRowProps = {\n children: ReactNode;\n className?: string;\n};\n\nexport const BackofficeInlineFilterRow = ({\n children,\n className,\n}: BackofficeInlineFilterRowProps): JSX.Element => {\n return <span className={cx(styles.container, className)}>{
|
|
1
|
+
{"version":3,"file":"BackofficeInlineFilterRow.js","names":[],"sources":["../../../../../src/components/backoffice/shared/BackofficeInlineFilterRow.tsx"],"sourcesContent":["import { Children, type JSX, type ReactNode } from 'react';\n\nimport { cx } from '@plumile/ui/theme/tools.js';\n\nimport * as styles from './backofficeInlineFilterRow.css.js';\n\nexport type BackofficeInlineFilterRowProps = {\n children: ReactNode;\n className?: string;\n};\n\nexport const BackofficeInlineFilterRow = ({\n children,\n className,\n}: BackofficeInlineFilterRowProps): JSX.Element => {\n const childNodes = Children.toArray(children);\n let actionNode: ReactNode = null;\n let valueNodes = childNodes;\n if (childNodes.length > 1) {\n const [firstNode, ...remainingNodes] = childNodes;\n actionNode = firstNode;\n valueNodes = remainingNodes;\n }\n let valueNode: ReactNode = null;\n if (valueNodes.length === 1) {\n const [singleValueNode] = valueNodes;\n valueNode = singleValueNode;\n } else if (valueNodes.length > 1) {\n valueNode = valueNodes;\n }\n\n return (\n <span className={cx(styles.container, className)}>\n <span className={styles.actionSlot}>{actionNode}</span>\n <span className={styles.valueSlot}>{valueNode}</span>\n </span>\n );\n};\n\nexport default BackofficeInlineFilterRow;\n"],"mappings":";;;;;AAWA,IAAa,KAA6B,EACxC,aACA,mBACiD;CACjD,IAAM,IAAa,EAAS,QAAQ,CAAQ,GACxC,IAAwB,MACxB,IAAa;CACjB,IAAI,EAAW,SAAS,GAAG;EACzB,IAAM,CAAC,GAAW,GAAG,KAAkB;EAEvC,AADA,IAAa,GACb,IAAa;CACf;CACA,IAAI,IAAuB;CAC3B,IAAI,EAAW,WAAW,GAAG;EAC3B,IAAM,CAAC,KAAmB;EAC1B,IAAY;CACd,OAAO,AAAI,EAAW,SAAS,MAC7B,IAAY;CAGd,OACE,kBAAC,QAAD;EAAM,WAAW,EAAG,GAAkB,CAAS;YAA/C,CACE,kBAAC,QAAD;GAAM,WAAW;aAAoB;EAAiB,CAAA,GACtD,kBAAC,QAAD;GAAM,WAAW;aAAmB;EAAgB,CAAA,CAChD;;AAEV"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* empty css */
|
|
2
2
|
//#region src/components/backoffice/shared/backofficeInlineFilterRow.css.ts
|
|
3
|
-
var e = "txvbqbfqq txvbqbey txvbqbhd8 txvbqbh73 txvbqbu4k txvbqbv7x";
|
|
3
|
+
var e = "txvbqbfqq txvbqbey txvbqbhd8 txvbqbh73 txvbqbu4k txvbqbv7x txvbqbwr6", t = "txvbqbfqq txvbqbey txvbqbls4 txvbqbh6d", n = "txvbqbv7x txvbqbu4k txvbqbwr6 txvbqb18ef txvbqb1avz";
|
|
4
4
|
//#endregion
|
|
5
|
-
export { e as container };
|
|
5
|
+
export { t as actionSlot, e as container, n as valueSlot };
|
|
6
6
|
|
|
7
7
|
//# sourceMappingURL=backofficeInlineFilterRow.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backofficeInlineFilterRow.css.js","names":[],"sources":["../../../../../src/components/backoffice/shared/backofficeInlineFilterRow.css.ts"],"sourcesContent":["import { sprinkles } from '@plumile/ui/theme/sprinkles.css.js';\n\nexport const container = sprinkles({\n display: 'inline-flex',\n alignItems: 'center',\n gap: 1,\n flexWrap: 'nowrap',\n maxWidth: 'full',\n minWidth: 0,\n});\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"backofficeInlineFilterRow.css.js","names":[],"sources":["../../../../../src/components/backoffice/shared/backofficeInlineFilterRow.css.ts"],"sourcesContent":["import { sprinkles } from '@plumile/ui/theme/sprinkles.css.js';\n\nexport const container = sprinkles({\n display: 'inline-flex',\n alignItems: 'center',\n gap: 1,\n flexWrap: 'nowrap',\n maxWidth: 'full',\n minWidth: 0,\n overflow: 'hidden',\n});\n\nexport const actionSlot = sprinkles({\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n flexShrink: 0,\n});\n\nexport const valueSlot = sprinkles({\n minWidth: 0,\n maxWidth: 'full',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n});\n"],"mappings":""}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { CopyableText as t } from "@plumile/ui/backoffice/atoms/copyable_text/CopyableText.js";
|
|
3
|
+
//#region src/components/backoffice/technical/TechnicalIdentifierValue.tsx
|
|
4
|
+
var n = 16, r = 6, i = (e) => {
|
|
5
|
+
if (e == null) return null;
|
|
6
|
+
let t = String(e).trim();
|
|
7
|
+
return t === "" ? null : t;
|
|
8
|
+
}, a = (e, t = "id") => {
|
|
9
|
+
if (e.length <= n) return e;
|
|
10
|
+
if (t === "fingerprint") {
|
|
11
|
+
let t = e.split(":");
|
|
12
|
+
if (t.length > 4) return `${t.slice(0, 2).join(":")}:...:${t.slice(-2).join(":")}`;
|
|
13
|
+
}
|
|
14
|
+
return `${e.slice(0, r)}...${e.slice(-6)}`;
|
|
15
|
+
}, o = ({ value: n, copyValue: r, variant: o, copyLabel: s }) => {
|
|
16
|
+
let c = i(n);
|
|
17
|
+
return c == null ? null : /* @__PURE__ */ e(t, {
|
|
18
|
+
value: a(c, o),
|
|
19
|
+
copyValue: r ?? c,
|
|
20
|
+
copyLabel: s
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { o as TechnicalIdentifierValue, a as abbreviateTechnicalIdentifier, i as normalizeTechnicalIdentifier };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=TechnicalIdentifierValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TechnicalIdentifierValue.js","names":[],"sources":["../../../../../src/components/backoffice/technical/TechnicalIdentifierValue.tsx"],"sourcesContent":["import { type JSX } from 'react';\n\nimport { CopyableText } from '@plumile/ui/backoffice/atoms/copyable_text/CopyableText.js';\n\nconst MIN_ABBREVIATED_LENGTH = 16;\nconst PREFIX_LENGTH = 6;\nconst SUFFIX_LENGTH = 6;\n\nexport type TechnicalIdentifierVariant =\n | 'id'\n | 'hash'\n | 'token'\n | 'fingerprint'\n | 'external';\n\nexport const normalizeTechnicalIdentifier = (\n value: string | number | null | undefined,\n): string | null => {\n if (value == null) {\n return null;\n }\n const normalized = String(value).trim();\n if (normalized === '') {\n return null;\n }\n return normalized;\n};\n\nexport const abbreviateTechnicalIdentifier = (\n value: string,\n variant: TechnicalIdentifierVariant = 'id',\n): string => {\n if (value.length <= MIN_ABBREVIATED_LENGTH) {\n return value;\n }\n\n if (variant === 'fingerprint') {\n const parts = value.split(':');\n if (parts.length > 4) {\n return `${parts.slice(0, 2).join(':')}:...:${parts.slice(-2).join(':')}`;\n }\n }\n\n return `${value.slice(0, PREFIX_LENGTH)}...${value.slice(-SUFFIX_LENGTH)}`;\n};\n\nexport type TechnicalIdentifierValueProps = {\n value: string | number | null | undefined;\n copyValue?: string | null | undefined;\n variant?: TechnicalIdentifierVariant;\n copyLabel: string;\n};\n\nexport const TechnicalIdentifierValue = ({\n value,\n copyValue,\n variant,\n copyLabel,\n}: TechnicalIdentifierValueProps): JSX.Element | null => {\n const normalized = normalizeTechnicalIdentifier(value);\n if (normalized == null) {\n return null;\n }\n\n return (\n <CopyableText\n value={abbreviateTechnicalIdentifier(normalized, variant)}\n copyValue={copyValue ?? normalized}\n copyLabel={copyLabel}\n />\n );\n};\n"],"mappings":";;;AAIA,IAAM,IAAyB,IACzB,IAAgB,GAUT,KACX,MACkB;CAClB,IAAI,KAAS,MACX,OAAO;CAET,IAAM,IAAa,OAAO,CAAK,EAAE,KAAK;CAItC,OAHI,MAAe,KACV,OAEF;AACT,GAEa,KACX,GACA,IAAsC,SAC3B;CACX,IAAI,EAAM,UAAU,GAClB,OAAO;CAGT,IAAI,MAAY,eAAe;EAC7B,IAAM,IAAQ,EAAM,MAAM,GAAG;EAC7B,IAAI,EAAM,SAAS,GACjB,OAAO,GAAG,EAAM,MAAM,GAAG,CAAC,EAAE,KAAK,GAAG,EAAE,OAAO,EAAM,MAAM,EAAE,EAAE,KAAK,GAAG;CAEzE;CAEA,OAAO,GAAG,EAAM,MAAM,GAAG,CAAa,EAAE,KAAK,EAAM,MAAM,EAAc;AACzE,GASa,KAA4B,EACvC,UACA,cACA,YACA,mBACuD;CACvD,IAAM,IAAa,EAA6B,CAAK;CAKrD,OAJI,KAAc,OACT,OAIP,kBAAC,GAAD;EACE,OAAO,EAA8B,GAAY,CAAO;EACxD,WAAW,KAAa;EACb;CACZ,CAAA;AAEL"}
|
package/lib/esm/index.js
CHANGED
|
@@ -65,9 +65,12 @@ import { BackofficeProvider as Ee } from "./provider/BackofficeProvider.js";
|
|
|
65
65
|
import { createBackofficeLazyValue as De } from "./provider/lazyValue.js";
|
|
66
66
|
import { decodeBase64ToUtf8 as Oe, encodeUtf8ToBase64 as ke } from "./modules/base64.js";
|
|
67
67
|
import { formatFileSize as Ae } from "./modules/formatFileSize.js";
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
|
|
68
|
+
import { uploadFilesSequentially as je } from "./modules/uploads.js";
|
|
69
|
+
import { resolveVisibleDetailPages as Me } from "./pages/detail/pageResolution.js";
|
|
70
|
+
import { createInlineDataReader as Ne } from "./relay/createInlineReader.js";
|
|
71
|
+
import { appendNodeToConnections as Pe } from "./relay/connectionUtils.js";
|
|
72
|
+
import { configureBackofficeShortAccessTokenRelayEnvironment as Fe } from "./relay/shortAccessTokenEnvironment.js";
|
|
73
|
+
import { useMutationAction as Ie } from "./relay/useMutationAction.js";
|
|
74
|
+
import { identityView as Le } from "./relay/identityView.js";
|
|
75
|
+
import { useCursorResumableSubscription as Re } from "./subscriptions/useCursorResumableSubscription.js";
|
|
76
|
+
export { o as AcceptInvitationScreen, e as AuthRefreshNotice, v as BackofficeBillingUsageChart, w as BackofficeDetailBadgeRow, G as BackofficeEntityLink, O as BackofficeEntitySummaryHeader, k as BackofficeEnumLabel, g as BackofficeErrorBoundary, R as BackofficeFilterAction, W as BackofficeFilterableCell, Y as BackofficeFormattedCurrency, ee as BackofficeFormattedNumber, z as BackofficeHubTemplate, X as BackofficeInlineFilterRow, S as BackofficeInlineLink, K as BackofficeLazyEntityCount, A as BackofficeLifecycleTimelineSection, B as BackofficeLink, V as BackofficeLinkLabel, U as BackofficeOverviewLayout, Ee as BackofficeProvider, j as BackofficeReferenceValue, q as BackofficeRelatedCountLink, M as BackofficeRelationGrid, M as BackofficeRelationsSummaryGrid, H as BackofficeRightPageLayout, N as BackofficeStatusGroup, D as BackofficeStatusMetaBadge, J as BackofficeTabbedDetailShell, P as BackofficeTokenUsageBreakdown, Z as BackofficeToolsDocPanel, Q as BackofficeToolsErrorFallback, $ as BackofficeToolsJsonForm, te as BackofficeToolsQueryBoundary, F as BackofficeUsageCostBreakdown, T as EntityFilterValue, E as EntityFilterValueText, h as EntityIdFilterField, _ as EntityIdPickerDialog, i as LoginFlow, s as PasswordResetCompleteScreen, c as PasswordResetRequestScreen, Te as RelayProvider, n as TotpQrCode, l as VerifyEmailScreen, Pe as appendNodeToConnections, Se as backofficeReactI18nResources, de as base64UrlToBuffer, fe as bufferToBase64Url, C as buildDataTableColumns, r as buildTotpOtpAuthUri, Fe as configureBackofficeShortAccessTokenRelayEnvironment, re as configureRelayEnvironment, I as createBackofficeEntityLinkProps, De as createBackofficeLazyValue, xe as createI18nInstance, Ne as createInlineDataReader, he as createUseAuth, Oe as decodeBase64ToUtf8, ke as encodeUtf8ToBase64, Ae as formatFileSize, L as formatListAsMarkdown, ie as getEnvironment, ae as getNetwork, oe as getRelayTransportSnapshot, Le as identityView, pe as mapWebAuthnRegistrationError, me as parseSignCount, ne as parseToolJson, se as reconnectRelayWebSocket, ce as refreshRelayWebSocketAuthentication, u as requireField, d as requireLinkedRecordId, le as resetRelayStore, f as resolveAgentStartOutcome, b as resolveBackofficeLink, y as resolveBackofficeTargetIcon, p as resolveMutationOutcome, Me as resolveVisibleDetailPages, ue as subscribeRelayTransport, a as synchronizeAuthStatusQuery, je as uploadFilesSequentially, t as useAuthRefreshStateSnapshot, m as useBackofficeConfig, x as useBackofficeLink, ge as useBackofficeListUrlState, _e as useConditionalSubscription, ve as useCopyToClipboard, Re as useCursorResumableSubscription, ye as useInfiniteConnection, Ie as useMutationAction, be as useRefetchNeededReload, we as useReviewStatusLabel, Ce as withBackofficeReactI18nResources };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//#region src/modules/uploads.ts
|
|
2
|
+
var e = "application/octet-stream", t = (e, t, n) => typeof URL < "u" && typeof URL.createObjectURL == "function" ? URL.createObjectURL(e) : n?.(t), n = (e, t) => e instanceof Error ? e : t == null ? /* @__PURE__ */ Error("Upload error") : t(e), r = async (r) => {
|
|
3
|
+
let i = [], a = r.fallbackMimeType ?? e;
|
|
4
|
+
for (let e of r.files) try {
|
|
5
|
+
let n = await r.prepareUpload(e), o = t(e, n, r.getDescriptorPreviewUrl), s = e.type;
|
|
6
|
+
s === "" && (s = a);
|
|
7
|
+
let c = {
|
|
8
|
+
file: e,
|
|
9
|
+
ok: !0,
|
|
10
|
+
item: r.toUploadedFile({
|
|
11
|
+
file: e,
|
|
12
|
+
descriptor: n,
|
|
13
|
+
previewUrl: o,
|
|
14
|
+
mimeType: s
|
|
15
|
+
})
|
|
16
|
+
};
|
|
17
|
+
i.push(c), r.onProgress?.(c);
|
|
18
|
+
} catch (t) {
|
|
19
|
+
let a = {
|
|
20
|
+
file: e,
|
|
21
|
+
ok: !1,
|
|
22
|
+
error: n(t, r.mapUnknownError)
|
|
23
|
+
};
|
|
24
|
+
i.push(a), r.onProgress?.(a);
|
|
25
|
+
}
|
|
26
|
+
return i;
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { r as uploadFilesSequentially };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=uploads.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploads.js","names":[],"sources":["../../../src/modules/uploads.ts"],"sourcesContent":["export type SequentialFileUploadSuccess<TUploaded> = {\n file: File;\n ok: true;\n item: TUploaded;\n};\n\nexport type SequentialFileUploadFailure = {\n file: File;\n ok: false;\n error: Error;\n};\n\nexport type SequentialFileUploadResult<TUploaded> =\n | SequentialFileUploadSuccess<TUploaded>\n | SequentialFileUploadFailure;\n\nexport type UploadFilesSequentiallyOptions<TDescriptor, TUploaded> = {\n files: readonly File[];\n prepareUpload: (file: File) => Promise<TDescriptor>;\n toUploadedFile: (input: {\n file: File;\n descriptor: TDescriptor;\n previewUrl: string | undefined;\n mimeType: string;\n }) => TUploaded;\n onProgress?: (result: SequentialFileUploadResult<TUploaded>) => void;\n getDescriptorPreviewUrl?: (descriptor: TDescriptor) => string | undefined;\n fallbackMimeType?: string;\n mapUnknownError?: (error: unknown) => Error;\n};\n\nconst DEFAULT_FALLBACK_MIME_TYPE = 'application/octet-stream';\n\nconst resolvePreviewUrl = <TDescriptor>(\n file: File,\n descriptor: TDescriptor,\n getDescriptorPreviewUrl?: (descriptor: TDescriptor) => string | undefined,\n): string | undefined => {\n if (typeof URL !== 'undefined' && typeof URL.createObjectURL === 'function') {\n return URL.createObjectURL(file);\n }\n\n return getDescriptorPreviewUrl?.(descriptor);\n};\n\nconst resolveUploadError = (\n error: unknown,\n mapUnknownError?: (error: unknown) => Error,\n): Error => {\n if (error instanceof Error) {\n return error;\n }\n\n if (mapUnknownError != null) {\n return mapUnknownError(error);\n }\n\n return new Error('Upload error');\n};\n\nexport const uploadFilesSequentially = async <TDescriptor, TUploaded>(\n options: UploadFilesSequentiallyOptions<TDescriptor, TUploaded>,\n): Promise<SequentialFileUploadResult<TUploaded>[]> => {\n const results: SequentialFileUploadResult<TUploaded>[] = [];\n const fallbackMimeType =\n options.fallbackMimeType ?? DEFAULT_FALLBACK_MIME_TYPE;\n\n for (const file of options.files) {\n try {\n const descriptor = await options.prepareUpload(file);\n const previewUrl = resolvePreviewUrl(\n file,\n descriptor,\n options.getDescriptorPreviewUrl,\n );\n let mimeType = file.type;\n if (mimeType === '') {\n mimeType = fallbackMimeType;\n }\n const result: SequentialFileUploadResult<TUploaded> = {\n file,\n ok: true,\n item: options.toUploadedFile({\n file,\n descriptor,\n previewUrl,\n mimeType,\n }),\n };\n results.push(result);\n options.onProgress?.(result);\n } catch (error) {\n const result: SequentialFileUploadResult<TUploaded> = {\n file,\n ok: false,\n error: resolveUploadError(error, options.mapUnknownError),\n };\n results.push(result);\n options.onProgress?.(result);\n }\n }\n\n return results;\n};\n"],"mappings":";AA+BA,IAAM,IAA6B,4BAE7B,KACJ,GACA,GACA,MAEI,OAAO,MAAQ,OAAe,OAAO,IAAI,mBAAoB,aACxD,IAAI,gBAAgB,CAAI,IAG1B,IAA0B,CAAU,GAGvC,KACJ,GACA,MAEI,aAAiB,QACZ,IAGL,KAAmB,OAIhB,gBAAI,MAAM,cAAc,IAHtB,EAAgB,CAAK,GAMnB,IAA0B,OACrC,MACqD;CACrD,IAAM,IAAmD,CAAC,GACpD,IACJ,EAAQ,oBAAoB;CAE9B,KAAK,IAAM,KAAQ,EAAQ,OACzB,IAAI;EACF,IAAM,IAAa,MAAM,EAAQ,cAAc,CAAI,GAC7C,IAAa,EACjB,GACA,GACA,EAAQ,uBACV,GACI,IAAW,EAAK;EACpB,AAAI,MAAa,OACf,IAAW;EAEb,IAAM,IAAgD;GACpD;GACA,IAAI;GACJ,MAAM,EAAQ,eAAe;IAC3B;IACA;IACA;IACA;GACF,CAAC;EACH;EAEA,AADA,EAAQ,KAAK,CAAM,GACnB,EAAQ,aAAa,CAAM;CAC7B,SAAS,GAAO;EACd,IAAM,IAAgD;GACpD;GACA,IAAI;GACJ,OAAO,EAAmB,GAAO,EAAQ,eAAe;EAC1D;EAEA,AADA,EAAQ,KAAK,CAAM,GACnB,EAAQ,aAAa,CAAM;CAC7B;CAGF,OAAO;AACT"}
|