@nivaro/react 0.2.54 → 0.2.56
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/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +99 -98
- package/dist/index.d.ts +367 -2
- package/dist/index.js +645 -616
- package/dist/layout-editor.d.ts +4 -0
- package/dist/shared/components/BackgroundRunOffer.js +117 -0
- package/dist/shared/components/BroadcastView.js +214 -213
- package/dist/shared/components/CollectionBrowserView.js +2592 -2695
- package/dist/shared/components/ItemEditForm.js +4066 -3832
- package/dist/shared/components/JobsTray.js +100 -55
- package/dist/shared/components/MyWorkView.js +91 -89
- package/dist/shared/components/NotificationBell.js +80 -79
- package/dist/shared/components/ProfileView.js +568 -520
- package/dist/shared/components/RecordCompare.js +254 -0
- package/dist/shared/components/RecordReadView.js +599 -552
- package/dist/shared/components/ReportView.js +578 -543
- package/dist/shared/components/RowPresence.js +91 -0
- package/dist/shared/components/WidgetSlot.js +474 -458
- package/dist/shared/components/ai/AiAnalyticsView.js +16 -6
- package/dist/shared/components/ai/AskPanel.js +139 -119
- package/dist/shared/components/ai/FirstWeekCard.js +126 -0
- package/dist/shared/components/bulk/BulkFieldUpdate.js +289 -0
- package/dist/shared/components/bulk/bulk-field-options.js +45 -0
- package/dist/shared/components/charts/CumulativeFlowChart.js +176 -0
- package/dist/shared/components/chat/ChannelArchive.js +326 -0
- package/dist/shared/components/chat/ChannelExtras.js +141 -121
- package/dist/shared/components/chat/ChatAnalyticsView.js +112 -110
- package/dist/shared/components/chat/ChatPanel.js +1695 -1733
- package/dist/shared/components/chat/Composer.js +357 -303
- package/dist/shared/components/chat/MessageActions.js +92 -0
- package/dist/shared/components/chat/MessageFormat.js +290 -264
- package/dist/shared/components/chat/OutboxBubbles.js +146 -0
- package/dist/shared/components/chat/RequestIdCard.js +135 -0
- package/dist/shared/components/chat/RoomHeaderMenu.js +202 -0
- package/dist/shared/components/chat/RoomParts.js +213 -274
- package/dist/shared/components/chat/ScreenClip.js +184 -0
- package/dist/shared/components/chat/chat-core.js +402 -483
- package/dist/shared/components/chat/chat-drafts.js +59 -0
- package/dist/shared/components/chat/chat-emoji.js +348 -0
- package/dist/shared/components/chat/chat-local-time.js +41 -0
- package/dist/shared/components/chat/chat-outbox.js +303 -0
- package/dist/shared/components/chat/chat-window.js +163 -0
- package/dist/shared/components/chat/huddle/HuddleControls.js +143 -0
- package/dist/shared/components/chat/huddle/HuddleStage.js +164 -0
- package/dist/shared/components/chat/huddle/huddle-store.js +342 -0
- package/dist/shared/components/chat/huddle/useHuddle.js +58 -0
- package/dist/shared/components/help-videos/api.js +76 -73
- package/dist/shared/components/item-edit/CatalogPickerField.js +113 -112
- package/dist/shared/components/item-edit/ChangeReasonDialog.js +13 -13
- package/dist/shared/components/item-edit/FieldAffordances.js +2 -2
- package/dist/shared/components/item-edit/FieldRenderer.js +248 -245
- package/dist/shared/components/item-edit/FieldRow.js +292 -279
- package/dist/shared/components/item-edit/GroupSection.js +698 -574
- package/dist/shared/components/item-edit/InlineTableField.js +3 -1
- package/dist/shared/components/item-edit/RelationCombobox.js +186 -176
- package/dist/shared/components/item-edit/entry/EntryStrip.js +54 -0
- package/dist/shared/components/item-edit/entry/entry-keys.js +27 -0
- package/dist/shared/components/item-edit/entry/useEntryKeyboard.js +70 -0
- package/dist/shared/components/item-edit/entry/useEntryMode.js +59 -0
- package/dist/shared/components/item-edit/form-structure-ui.js +105 -0
- package/dist/shared/components/item-edit/lazy-sections.js +36 -0
- package/dist/shared/components/item-edit/lock-why.js +39 -32
- package/dist/shared/components/item-edit/picker-miss.js +26 -0
- package/dist/shared/components/item-edit/placement-behaviour.js +196 -0
- package/dist/shared/components/item-edit/useFormUsageBeacon.js +51 -45
- package/dist/shared/components/layout-editor/AddPanel.js +134 -117
- package/dist/shared/components/layout-editor/ChangeNote.js +25 -24
- package/dist/shared/components/layout-editor/CollabParts.js +80 -75
- package/dist/shared/components/layout-editor/DesignNode.js +126 -120
- package/dist/shared/components/layout-editor/EditorCanvas.js +30 -27
- package/dist/shared/components/layout-editor/EditorTopBar.js +203 -192
- package/dist/shared/components/layout-editor/HistoryPanel.js +120 -104
- package/dist/shared/components/layout-editor/LayoutEditor.js +768 -671
- package/dist/shared/components/layout-editor/RestorePiece.js +143 -0
- package/dist/shared/components/layout-editor/StagedChip.js +22 -0
- package/dist/shared/components/layout-editor/StructureMenu.js +237 -186
- package/dist/shared/components/layout-editor/collab/FormFollowShare.js +149 -103
- package/dist/shared/components/layout-editor/collab/collab-api.js +29 -26
- package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +81 -80
- package/dist/shared/components/layout-editor/dnd/node.js +69 -57
- package/dist/shared/components/layout-editor/draft-recovery.js +113 -43
- package/dist/shared/components/layout-editor/entry/PlacementPresets.js +149 -0
- package/dist/shared/components/layout-editor/entry/entry-editor-context.js +10 -0
- package/dist/shared/components/layout-editor/entry/presets.js +71 -0
- package/dist/shared/components/layout-editor/entry/tab-order.js +110 -0
- package/dist/shared/components/layout-editor/entry/theme-preview.js +37 -0
- package/dist/shared/components/layout-editor/grid-guides.js +142 -0
- package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +402 -0
- package/dist/shared/components/layout-editor/inspector/BulkInspector.js +61 -57
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +247 -151
- package/dist/shared/components/layout-editor/inspector/Inspector.js +176 -155
- package/dist/shared/components/layout-editor/inspector/LookTab.js +167 -116
- package/dist/shared/components/layout-editor/inspector/PickerMisses.js +129 -0
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +84 -82
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +66 -62
- package/dist/shared/components/layout-editor/inspector/kit.js +69 -68
- package/dist/shared/components/layout-editor/outputs/OutputsButton.js +254 -0
- package/dist/shared/components/layout-editor/outputs/help-sheet.js +154 -0
- package/dist/shared/components/layout-editor/outputs/output-api.js +61 -0
- package/dist/shared/components/layout-editor/overview/describe-conditions.js +6 -0
- package/dist/shared/components/layout-editor/overview/purpose.js +15 -13
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/restore-piece.js +192 -0
- package/dist/shared/components/layout-editor/section-structure.js +241 -0
- package/dist/shared/components/layout-editor/settings/EntrySection.js +296 -0
- package/dist/shared/components/layout-editor/settings/FormSettings.js +41 -39
- package/dist/shared/components/layout-editor/settings/ResolveSettings.js +255 -0
- package/dist/shared/components/layout-editor/settings/ToolsSection.js +147 -111
- package/dist/shared/components/layout-editor/settings/WhoSection.js +29 -26
- package/dist/shared/components/layout-editor/settings/settings-registry.js +114 -17
- package/dist/shared/components/layout-editor/staged-api.js +64 -0
- package/dist/shared/components/layout-editor/structure-ops.js +81 -77
- package/dist/shared/components/layout-editor/testing/TestingPanels.js +65 -60
- package/dist/shared/components/layout-editor/testing/testing-model.js +198 -185
- package/dist/shared/components/layout-editor/toolbar-kit.js +11 -11
- package/dist/shared/components/layout-editor/usage/AbTestSection.js +355 -0
- package/dist/shared/components/layout-editor/usage/UsagePanel.js +144 -70
- package/dist/shared/components/layout-editor/usage/ab-api.js +86 -0
- package/dist/shared/components/layout-editor/usage/suggest-collapse.js +32 -0
- package/dist/shared/components/layout-editor/useLayoutDraft.js +25 -24
- package/dist/shared/components/notifications/NotificationAnalyticsView.js +148 -77
- package/dist/shared/components/panels/ErpFailureBanner.js +18 -17
- package/dist/shared/components/panels/ExternalRequestsChip.js +63 -62
- package/dist/shared/components/pipeline/PipelineEditorView.js +106 -104
- package/dist/shared/components/profile/AgentsPanel.js +479 -0
- package/dist/shared/components/queue/QueueWorklist.js +1026 -1040
- package/dist/shared/components/support/SupportAnalytics.js +171 -0
- package/dist/shared/components/support/SupportView.js +75 -73
- package/dist/shared/lib/background-runs.js +150 -0
- package/dist/shared/lib/delivery-ack.js +9 -0
- package/dist/shared/lib/entry-badge-style.js +13 -0
- package/dist/shared/lib/entry-config.js +71 -0
- package/dist/shared/lib/form-sections.js +64 -0
- package/dist/shared/lib/form-structure.js +99 -0
- package/dist/shared/lib/form-usage-beacon.js +101 -52
- package/dist/shared/lib/jobs-tray.js +25 -23
- package/dist/shared/lib/keyset-pager.js +37 -0
- package/dist/shared/lib/layout-ops.js +84 -82
- package/dist/shared/lib/layout-resolve.js +113 -0
- package/dist/shared/lib/placement-behaviour.js +144 -0
- package/dist/shared/lib/prefetch.js +149 -0
- package/dist/shared/lib/presence-hooks.js +199 -0
- package/dist/shared/lib/record-outbox.js +82 -81
- package/dist/shared/lib/replay-socket.js +93 -0
- package/dist/shared/lib/request-gate.js +51 -50
- package/dist/shared/lib/room-gaps.js +96 -0
- package/dist/shared/lib/search-log.js +27 -0
- package/dist/shared/lib/socket-realtime.js +101 -80
- package/dist/shared/lib/stale-chunk.js +60 -0
- package/dist/shared/lib/worker-socket.js +200 -0
- package/package.json +1 -1
|
@@ -1,207 +1,212 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
1
|
+
import { jsxs as b, jsx as t, Fragment as V } from "react/jsx-runtime";
|
|
2
|
+
import { rowOf as K, readGroupStructure as X, isFolded as _ } from "../../../lib/form-structure.js";
|
|
3
|
+
import { InlineDisplaySection as z } from "../editors/inline-display.js";
|
|
4
|
+
import { foldPlan as J, rowUpdatePlan as Q } from "../section-structure.js";
|
|
5
|
+
import { AiFillSetting as Y } from "./AiFillSetting.js";
|
|
6
|
+
import { showsNumbers as Z, showsDateMode as ee, showsInputMask as te } from "./applies.js";
|
|
7
|
+
import { TextRulesSetting as le, CounterSetting as oe } from "./BehaviourSettings.js";
|
|
8
|
+
import { ColumnFit as ae } from "./ColumnFit.js";
|
|
9
|
+
import { useFieldCtx as H } from "./field-context.js";
|
|
10
|
+
import { interfaceOptions as ie, interfaceLabel as ne, currentInterface as re } from "./interfaces.js";
|
|
11
|
+
import { useGlobalValue as m, Setting as n, TextInput as v, Toggle as k, Choice as N, Segmented as w, Section as G, Buffered as de, DraftInput as y } from "./kit.js";
|
|
12
|
+
import { inlineDisplayOf as se, withInlineDisplay as ce } from "./model.js";
|
|
13
|
+
import { FieldTranslations as ue } from "./Translations.js";
|
|
14
|
+
const F = [
|
|
12
15
|
{ value: "12", label: "Full" },
|
|
13
16
|
{ value: "6", label: "½" },
|
|
14
17
|
{ value: "4", label: "⅓" },
|
|
15
18
|
{ value: "3", label: "¼" }
|
|
16
|
-
],
|
|
19
|
+
], A = [
|
|
17
20
|
{ value: "", label: "Default" },
|
|
18
21
|
{ value: "int", label: "Integer" },
|
|
19
22
|
{ value: "decimal", label: "Decimal" },
|
|
20
23
|
{ value: "currency", label: "Currency" }
|
|
21
|
-
],
|
|
24
|
+
], fe = [
|
|
22
25
|
{ value: "", label: "None" },
|
|
23
26
|
{ value: "SUM", label: "Sum" },
|
|
24
27
|
{ value: "COUNT", label: "Count" },
|
|
25
28
|
{ value: "AVG", label: "Average" },
|
|
26
29
|
{ value: "MIN", label: "Smallest" },
|
|
27
30
|
{ value: "MAX", label: "Largest" }
|
|
28
|
-
],
|
|
29
|
-
function
|
|
30
|
-
var
|
|
31
|
-
const
|
|
32
|
-
{ input_bindings:
|
|
33
|
-
`Change what shows under ${
|
|
31
|
+
], f = (o) => typeof o == "string" ? o : "";
|
|
32
|
+
function Te() {
|
|
33
|
+
var T, I, L, D;
|
|
34
|
+
const o = H(), { info: a, ov: s, opts: c, env: g, row: u, globalOptions: i } = o, l = a.label, p = ((T = a.global) == null ? void 0 : T.label) || l, r = s.label === "", M = Z(a), U = ee(a), C = te(a), R = ie(a.abstractType), S = ne(a.abstractType, ((I = a.global) == null ? void 0 : I.interface) ?? null) ?? ((L = a.global) != null && L.interface ? "custom input" : null), $ = f(s.interface), P = re(a.abstractType, $) ?? $, x = m("field.format", f(i.format)), q = m("field.currency", f(i.currency)), E = m("field.aggregate", f(i.aggregate)), W = m("field.unit", f(i.unit)), j = m("field.input_mask", f(i.input_mask)), B = se(u), O = (e) => o.setPlacement(
|
|
35
|
+
{ input_bindings: ce(u, e) },
|
|
36
|
+
`Change what shows under ${l}`,
|
|
34
37
|
!0
|
|
35
38
|
);
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
-
/* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ b("div", { className: "space-y-5", children: [
|
|
40
|
+
/* @__PURE__ */ t(
|
|
38
41
|
n,
|
|
39
42
|
{
|
|
40
43
|
k: "field.label",
|
|
41
44
|
label: "Label",
|
|
42
|
-
effect: `What this form calls the field. Empty uses the field's own label (${
|
|
43
|
-
children: /* @__PURE__ */
|
|
44
|
-
|
|
45
|
+
effect: `What this form calls the field. Empty uses the field's own label (${p}).`,
|
|
46
|
+
children: /* @__PURE__ */ t(
|
|
47
|
+
v,
|
|
45
48
|
{
|
|
46
49
|
ariaLabel: "Label",
|
|
47
|
-
value:
|
|
48
|
-
placeholder:
|
|
49
|
-
onChange: (e) =>
|
|
50
|
+
value: r ? "" : f(s.label),
|
|
51
|
+
placeholder: p,
|
|
52
|
+
onChange: (e) => o.setOverride("label", e === "" ? void 0 : e, `Rename ${l}`, !0)
|
|
50
53
|
}
|
|
51
54
|
)
|
|
52
55
|
}
|
|
53
56
|
),
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
|
|
57
|
+
/* @__PURE__ */ t(
|
|
58
|
+
k,
|
|
56
59
|
{
|
|
57
60
|
k: "field.label_hidden",
|
|
58
61
|
label: "Hide the label",
|
|
59
62
|
effect: "Shows the value without its label on this form.",
|
|
60
|
-
checked:
|
|
61
|
-
onChange: (e) =>
|
|
63
|
+
checked: r,
|
|
64
|
+
onChange: (e) => o.setOverride(
|
|
62
65
|
"label",
|
|
63
66
|
e ? "" : void 0,
|
|
64
|
-
e ? `Hide the label of ${
|
|
67
|
+
e ? `Hide the label of ${l}` : `Show the label of ${l}`
|
|
65
68
|
)
|
|
66
69
|
}
|
|
67
70
|
),
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
|
|
71
|
+
/* @__PURE__ */ t(n, { k: "field.interface", label: "Input", effect: "How the field is edited on this form.", children: /* @__PURE__ */ t(
|
|
72
|
+
N,
|
|
70
73
|
{
|
|
71
74
|
ariaLabel: "Input",
|
|
72
|
-
value:
|
|
75
|
+
value: P,
|
|
73
76
|
unknownLabel: (e) => `Custom input (${e})`,
|
|
74
77
|
options: [
|
|
75
|
-
{ value: "", label:
|
|
76
|
-
...
|
|
78
|
+
{ value: "", label: S ? `Field's own (${S})` : "Field's own" },
|
|
79
|
+
...R
|
|
77
80
|
],
|
|
78
|
-
onChange: (e) =>
|
|
81
|
+
onChange: (e) => o.setOverride("interface", e || void 0, `Change how ${l} is edited`)
|
|
79
82
|
}
|
|
80
83
|
) }),
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
|
|
84
|
+
/* @__PURE__ */ t(n, { k: "field.placeholder", label: "Placeholder", effect: "Grey hint inside the empty input.", children: /* @__PURE__ */ t(
|
|
85
|
+
v,
|
|
83
86
|
{
|
|
84
87
|
ariaLabel: "Placeholder",
|
|
85
|
-
value:
|
|
86
|
-
onChange: (e) =>
|
|
88
|
+
value: f(s.placeholder),
|
|
89
|
+
onChange: (e) => o.setOverride(
|
|
87
90
|
"placeholder",
|
|
88
91
|
e || void 0,
|
|
89
|
-
`Change the placeholder of ${
|
|
92
|
+
`Change the placeholder of ${l}`,
|
|
90
93
|
!0
|
|
91
94
|
)
|
|
92
95
|
}
|
|
93
96
|
) }),
|
|
94
|
-
/* @__PURE__ */
|
|
95
|
-
|
|
97
|
+
/* @__PURE__ */ t(n, { k: "field.note", label: "Help text", effect: "A line of help under the field.", children: /* @__PURE__ */ t(
|
|
98
|
+
v,
|
|
96
99
|
{
|
|
97
100
|
ariaLabel: "Help text",
|
|
98
|
-
value:
|
|
99
|
-
placeholder: ((D =
|
|
100
|
-
onChange: (e) =>
|
|
101
|
+
value: f(s.note),
|
|
102
|
+
placeholder: ((D = a.global) == null ? void 0 : D.note) ?? "",
|
|
103
|
+
onChange: (e) => o.setOverride("note", e || void 0, `Change the help text of ${l}`, !0)
|
|
101
104
|
}
|
|
102
105
|
) }),
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
|
|
106
|
+
/* @__PURE__ */ t(le, {}),
|
|
107
|
+
/* @__PURE__ */ t(
|
|
108
|
+
k,
|
|
105
109
|
{
|
|
106
110
|
k: "field.hidden",
|
|
107
111
|
label: "Hidden",
|
|
108
112
|
effect: "Leaves the field off this form; its value is kept.",
|
|
109
|
-
checked:
|
|
110
|
-
onChange: (e) =>
|
|
113
|
+
checked: s.hidden === !0,
|
|
114
|
+
onChange: (e) => o.setOverride("hidden", e ? !0 : void 0, e ? `Hide ${l}` : `Show ${l}`)
|
|
111
115
|
}
|
|
112
116
|
),
|
|
113
|
-
|
|
114
|
-
|
|
117
|
+
g.layoutType !== "table" && /* @__PURE__ */ t(n, { k: "field.col_span", label: "Width", effect: "Share of the row the field takes.", children: /* @__PURE__ */ t(
|
|
118
|
+
w,
|
|
115
119
|
{
|
|
116
|
-
value: String(
|
|
117
|
-
options:
|
|
120
|
+
value: String(u.col_span ?? 12),
|
|
121
|
+
options: F,
|
|
118
122
|
onChange: (e) => {
|
|
119
|
-
var
|
|
120
|
-
return
|
|
123
|
+
var d;
|
|
124
|
+
return o.setPlacement(
|
|
121
125
|
{ col_span: e === "12" ? null : Number(e) },
|
|
122
|
-
`Set the width of ${
|
|
126
|
+
`Set the width of ${l} to ${(d = F.find((h) => h.value === e)) == null ? void 0 : d.label}`
|
|
123
127
|
);
|
|
124
128
|
}
|
|
125
129
|
}
|
|
126
130
|
) }),
|
|
127
|
-
/* @__PURE__ */
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
-
|
|
131
|
+
/* @__PURE__ */ t(ae, {}),
|
|
132
|
+
g.layoutType !== "table" && u.group_key !== null && /* @__PURE__ */ t(he, {}),
|
|
133
|
+
a.relKind === "M2O" && a.relatedCollection && /* @__PURE__ */ b(G, { title: "Show under the value", children: [
|
|
134
|
+
/* @__PURE__ */ t("p", { className: "text-[12px] leading-snug text-slate-500 dark:text-muted-foreground", children: "Fields of the picked record shown with it on this form." }),
|
|
135
|
+
/* @__PURE__ */ t(de, { value: B, children: (e, d) => /* @__PURE__ */ t(
|
|
136
|
+
z,
|
|
132
137
|
{
|
|
133
|
-
relatedCollection:
|
|
138
|
+
relatedCollection: a.relatedCollection,
|
|
134
139
|
entries: e.entries,
|
|
135
140
|
separator: e.separator,
|
|
136
|
-
onChange: (
|
|
137
|
-
onSeparatorChange: (
|
|
141
|
+
onChange: (h) => O(d({ ...e, entries: h })),
|
|
142
|
+
onSeparatorChange: (h) => O(d({ ...e, separator: h }))
|
|
138
143
|
}
|
|
139
144
|
) })
|
|
140
145
|
] }),
|
|
141
|
-
|
|
146
|
+
U && /* @__PURE__ */ t(
|
|
142
147
|
n,
|
|
143
148
|
{
|
|
144
149
|
k: "field.date_mode",
|
|
145
150
|
label: "Show",
|
|
146
151
|
effect: "Date only hides the time in the picker and wherever this form shows the value.",
|
|
147
|
-
children: /* @__PURE__ */
|
|
148
|
-
|
|
152
|
+
children: /* @__PURE__ */ t(
|
|
153
|
+
w,
|
|
149
154
|
{
|
|
150
|
-
value:
|
|
155
|
+
value: c.date_mode === "date" ? "date" : "datetime",
|
|
151
156
|
options: [
|
|
152
157
|
{ value: "datetime", label: "Date & time" },
|
|
153
158
|
{ value: "date", label: "Date only" }
|
|
154
159
|
],
|
|
155
|
-
onChange: (e) =>
|
|
160
|
+
onChange: (e) => o.setOption(
|
|
156
161
|
"date_mode",
|
|
157
162
|
e === "date" ? "date" : void 0,
|
|
158
|
-
e === "date" ? `Show ${
|
|
163
|
+
e === "date" ? `Show ${l} as a date only` : `Show ${l} with its time`
|
|
159
164
|
)
|
|
160
165
|
}
|
|
161
166
|
)
|
|
162
167
|
}
|
|
163
168
|
),
|
|
164
|
-
|
|
165
|
-
/* @__PURE__ */
|
|
169
|
+
M && /* @__PURE__ */ b(G, { title: "Numbers", children: [
|
|
170
|
+
/* @__PURE__ */ t(
|
|
166
171
|
n,
|
|
167
172
|
{
|
|
168
173
|
k: "field.precision",
|
|
169
174
|
label: "Decimal places",
|
|
170
175
|
effect: "Rounds entry and display on this form.",
|
|
171
|
-
children: /* @__PURE__ */
|
|
172
|
-
|
|
176
|
+
children: /* @__PURE__ */ t(
|
|
177
|
+
v,
|
|
173
178
|
{
|
|
174
179
|
type: "number",
|
|
175
180
|
ariaLabel: "Decimal places",
|
|
176
|
-
value:
|
|
181
|
+
value: c.precision == null ? "" : String(c.precision),
|
|
177
182
|
placeholder: "2",
|
|
178
183
|
onChange: (e) => {
|
|
179
|
-
const
|
|
180
|
-
|
|
184
|
+
const d = e === "" ? void 0 : Math.max(0, Math.min(10, Math.round(Number(e))));
|
|
185
|
+
d !== void 0 && Number.isNaN(d) || o.setOption("precision", d, `Set the decimal places of ${l}`, !0);
|
|
181
186
|
}
|
|
182
187
|
}
|
|
183
188
|
)
|
|
184
189
|
}
|
|
185
190
|
),
|
|
186
|
-
/* @__PURE__ */
|
|
191
|
+
/* @__PURE__ */ t(
|
|
187
192
|
n,
|
|
188
193
|
{
|
|
189
194
|
k: "field.format",
|
|
190
195
|
label: "Number format",
|
|
191
196
|
scope: "field",
|
|
192
197
|
effect: "How the value is written everywhere it shows.",
|
|
193
|
-
children: /* @__PURE__ */
|
|
194
|
-
|
|
198
|
+
children: /* @__PURE__ */ t(
|
|
199
|
+
w,
|
|
195
200
|
{
|
|
196
|
-
value:
|
|
197
|
-
options:
|
|
201
|
+
value: x,
|
|
202
|
+
options: A,
|
|
198
203
|
onChange: (e) => {
|
|
199
|
-
var
|
|
200
|
-
return
|
|
204
|
+
var d;
|
|
205
|
+
return o.proposeGlobalOption(
|
|
201
206
|
"field.format",
|
|
202
207
|
"format",
|
|
203
208
|
e || void 0,
|
|
204
|
-
`Show ${
|
|
209
|
+
`Show ${l} as ${(d = A.find((h) => h.value === e)) == null ? void 0 : d.label.toLowerCase()}`,
|
|
205
210
|
e
|
|
206
211
|
);
|
|
207
212
|
}
|
|
@@ -209,72 +214,72 @@ function me() {
|
|
|
209
214
|
)
|
|
210
215
|
}
|
|
211
216
|
),
|
|
212
|
-
|
|
217
|
+
x === "currency" && /* @__PURE__ */ t(
|
|
213
218
|
n,
|
|
214
219
|
{
|
|
215
220
|
k: "field.currency",
|
|
216
221
|
label: "Currency",
|
|
217
222
|
scope: "field",
|
|
218
223
|
effect: "Three-letter code, for example USD.",
|
|
219
|
-
children: /* @__PURE__ */
|
|
220
|
-
|
|
224
|
+
children: /* @__PURE__ */ t(
|
|
225
|
+
y,
|
|
221
226
|
{
|
|
222
227
|
ariaLabel: "Currency",
|
|
223
|
-
value:
|
|
228
|
+
value: q,
|
|
224
229
|
placeholder: "USD",
|
|
225
230
|
mono: !0,
|
|
226
|
-
onCommit: (e) =>
|
|
231
|
+
onCommit: (e) => o.proposeGlobalOption(
|
|
227
232
|
"field.currency",
|
|
228
233
|
"currency",
|
|
229
234
|
e.trim().toUpperCase() || void 0,
|
|
230
|
-
`Show ${
|
|
235
|
+
`Show ${l} in ${e.trim().toUpperCase() || "USD"}`,
|
|
231
236
|
e
|
|
232
237
|
)
|
|
233
238
|
}
|
|
234
239
|
)
|
|
235
240
|
}
|
|
236
241
|
),
|
|
237
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ t(
|
|
238
243
|
n,
|
|
239
244
|
{
|
|
240
245
|
k: "field.aggregate",
|
|
241
246
|
label: "Grid footer",
|
|
242
247
|
scope: "field",
|
|
243
248
|
effect: "The figure under this column wherever it shows in a grid.",
|
|
244
|
-
children: /* @__PURE__ */
|
|
245
|
-
|
|
249
|
+
children: /* @__PURE__ */ t(
|
|
250
|
+
N,
|
|
246
251
|
{
|
|
247
252
|
ariaLabel: "Grid footer",
|
|
248
|
-
value:
|
|
249
|
-
options:
|
|
250
|
-
onChange: (e) =>
|
|
253
|
+
value: E,
|
|
254
|
+
options: fe,
|
|
255
|
+
onChange: (e) => o.proposeGlobalOption(
|
|
251
256
|
"field.aggregate",
|
|
252
257
|
"aggregate",
|
|
253
258
|
e || void 0,
|
|
254
|
-
`Change the grid footer of ${
|
|
259
|
+
`Change the grid footer of ${l}`,
|
|
255
260
|
e
|
|
256
261
|
)
|
|
257
262
|
}
|
|
258
263
|
)
|
|
259
264
|
}
|
|
260
265
|
),
|
|
261
|
-
/* @__PURE__ */
|
|
266
|
+
/* @__PURE__ */ t(
|
|
262
267
|
n,
|
|
263
268
|
{
|
|
264
269
|
k: "field.unit",
|
|
265
270
|
label: "Unit",
|
|
266
271
|
scope: "field",
|
|
267
272
|
effect: '"$" shows currency, "%" a percent; other text follows the number. A number format wins.',
|
|
268
|
-
children: /* @__PURE__ */
|
|
269
|
-
|
|
273
|
+
children: /* @__PURE__ */ t(
|
|
274
|
+
y,
|
|
270
275
|
{
|
|
271
276
|
ariaLabel: "Unit",
|
|
272
|
-
value:
|
|
273
|
-
onCommit: (e) =>
|
|
277
|
+
value: W,
|
|
278
|
+
onCommit: (e) => o.proposeGlobalOption(
|
|
274
279
|
"field.unit",
|
|
275
280
|
"unit",
|
|
276
281
|
e || void 0,
|
|
277
|
-
`Set the unit of ${
|
|
282
|
+
`Set the unit of ${l}`,
|
|
278
283
|
e
|
|
279
284
|
)
|
|
280
285
|
}
|
|
@@ -282,35 +287,81 @@ function me() {
|
|
|
282
287
|
}
|
|
283
288
|
)
|
|
284
289
|
] }),
|
|
285
|
-
C && /* @__PURE__ */
|
|
290
|
+
C && /* @__PURE__ */ t(
|
|
286
291
|
n,
|
|
287
292
|
{
|
|
288
293
|
k: "field.input_mask",
|
|
289
294
|
label: "Input mask",
|
|
290
295
|
scope: "field",
|
|
291
296
|
effect: "# a digit, A a letter, * anything. The value is stored without the mask.",
|
|
292
|
-
children: /* @__PURE__ */
|
|
293
|
-
|
|
297
|
+
children: /* @__PURE__ */ t(
|
|
298
|
+
y,
|
|
294
299
|
{
|
|
295
300
|
ariaLabel: "Input mask",
|
|
296
|
-
value:
|
|
301
|
+
value: j,
|
|
297
302
|
mono: !0,
|
|
298
303
|
placeholder: "(###) ###-####",
|
|
299
|
-
onCommit: (e) =>
|
|
304
|
+
onCommit: (e) => o.proposeGlobalOption(
|
|
300
305
|
"field.input_mask",
|
|
301
306
|
"input_mask",
|
|
302
307
|
e || void 0,
|
|
303
|
-
`Set the input mask of ${
|
|
308
|
+
`Set the input mask of ${l}`,
|
|
304
309
|
e
|
|
305
310
|
)
|
|
306
311
|
}
|
|
307
312
|
)
|
|
308
313
|
}
|
|
309
314
|
),
|
|
310
|
-
|
|
311
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ t(oe, {}),
|
|
316
|
+
C && !a.isPath && !a.computedType && /* @__PURE__ */ t(Y, {}),
|
|
317
|
+
/* @__PURE__ */ t(ue, {})
|
|
318
|
+
] });
|
|
319
|
+
}
|
|
320
|
+
function he() {
|
|
321
|
+
const { info: o, ov: a, env: s, row: c } = H(), g = o.label, u = s.bundle.groups.find((r) => r.key === c.group_key) ?? null;
|
|
322
|
+
if (!u || !["section", "tab"].includes(u.type)) return null;
|
|
323
|
+
const i = K(X(u.swap_config).rows, c.field), l = a.required === !0, p = (r) => {
|
|
324
|
+
r.ok && s.apply(r.ops, { label: r.label });
|
|
325
|
+
};
|
|
326
|
+
return /* @__PURE__ */ b(V, { children: [
|
|
327
|
+
/* @__PURE__ */ t(
|
|
328
|
+
k,
|
|
329
|
+
{
|
|
330
|
+
k: "field.fold",
|
|
331
|
+
label: "Behind “Show more”",
|
|
332
|
+
effect: i ? "Fields side by side in a row always show." : l ? "Required fields always show." : "Tucked under “Show N more” at the end of the section while empty. It opens on its own once one of them has a value.",
|
|
333
|
+
checked: _(c.overrides) && !i,
|
|
334
|
+
disabled: !!i || l && !_(c.overrides),
|
|
335
|
+
onChange: (r) => p(J(s.bundle, [c], r))
|
|
336
|
+
}
|
|
337
|
+
),
|
|
338
|
+
i && /* @__PURE__ */ t(
|
|
339
|
+
n,
|
|
340
|
+
{
|
|
341
|
+
k: "field.row_group",
|
|
342
|
+
label: "Shares a row",
|
|
343
|
+
effect: `Side by side under “${i.label || "one label"}”. Rename the row in the section's settings.`,
|
|
344
|
+
children: /* @__PURE__ */ b(
|
|
345
|
+
"button",
|
|
346
|
+
{
|
|
347
|
+
type: "button",
|
|
348
|
+
onClick: () => p(
|
|
349
|
+
Q(s.bundle, u.key, i.key, {
|
|
350
|
+
fields: i.fields.filter((r) => r !== c.field)
|
|
351
|
+
})
|
|
352
|
+
),
|
|
353
|
+
className: "rounded-md border border-slate-200 px-2.5 py-1 text-[12px] font-medium text-slate-700 hover:bg-muted dark:border-border dark:text-foreground",
|
|
354
|
+
children: [
|
|
355
|
+
"Take ",
|
|
356
|
+
g,
|
|
357
|
+
" out of the row"
|
|
358
|
+
]
|
|
359
|
+
}
|
|
360
|
+
)
|
|
361
|
+
}
|
|
362
|
+
)
|
|
312
363
|
] });
|
|
313
364
|
}
|
|
314
365
|
export {
|
|
315
|
-
|
|
366
|
+
Te as LookTab
|
|
316
367
|
};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { jsx as t, jsxs as s, Fragment as x } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as $, useQuery as q } from "@tanstack/react-query";
|
|
3
|
+
import { useState as y } from "react";
|
|
4
|
+
import { useNivaroClient as A } from "../../../context.js";
|
|
5
|
+
import { get as T, del as D } from "../../../lib/commands.js";
|
|
6
|
+
import { Skeleton as d } from "../../ui/skeleton.js";
|
|
7
|
+
import { Section as K } from "./kit.js";
|
|
8
|
+
const Q = (n) => {
|
|
9
|
+
const r = Math.round(
|
|
10
|
+
(Date.parse(`${j()}T00:00:00Z`) - Date.parse(`${n}T00:00:00Z`)) / 864e5
|
|
11
|
+
);
|
|
12
|
+
return r <= 0 ? "today" : r === 1 ? "yesterday" : `${r} days ago`;
|
|
13
|
+
}, j = () => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
14
|
+
function P({ layoutId: n, field: r }) {
|
|
15
|
+
const l = A(), b = $(), c = ["layout-editor", "picker-misses", n, r], { data: o, isLoading: v, isError: N, refetch: k } = q({
|
|
16
|
+
queryKey: c,
|
|
17
|
+
queryFn: () => l.request(T(`/layout-usage/${n}/picker-misses`, { field: r })).then((e) => {
|
|
18
|
+
var p, f, g;
|
|
19
|
+
return {
|
|
20
|
+
available: ((p = e == null ? void 0 : e.data) == null ? void 0 : p.available) !== !1,
|
|
21
|
+
target: ((f = e == null ? void 0 : e.data) == null ? void 0 : f.target) ?? null,
|
|
22
|
+
fields: Array.isArray((g = e == null ? void 0 : e.data) == null ? void 0 : g.fields) ? e.data.fields : []
|
|
23
|
+
};
|
|
24
|
+
}),
|
|
25
|
+
enabled: n > 0,
|
|
26
|
+
staleTime: 6e4,
|
|
27
|
+
retry: !1
|
|
28
|
+
}), [C, i] = y(!1), [w, u] = y(!1), a = o == null ? void 0 : o.fields.find((e) => e.field === r), m = Array.isArray(a == null ? void 0 : a.misses) ? a.misses : [], h = (a == null ? void 0 : a.total) ?? 0, S = async () => {
|
|
29
|
+
u(!0);
|
|
30
|
+
try {
|
|
31
|
+
await l.request(
|
|
32
|
+
D(`/layout-usage/${n}/picker-misses?field=${encodeURIComponent(r)}`)
|
|
33
|
+
), await b.invalidateQueries({ queryKey: c });
|
|
34
|
+
} finally {
|
|
35
|
+
u(!1), i(!1);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
return /* @__PURE__ */ t(K, { title: "Searches that found nothing", children: /* @__PURE__ */ s("div", { className: "space-y-3", "data-picker-misses": r, children: [
|
|
39
|
+
/* @__PURE__ */ t("p", { className: "text-[12px] leading-5 text-muted-foreground", children: "What people typed into this picker on this form in the last 14 days that matched no record. Counts only, never who typed it." }),
|
|
40
|
+
v ? /* @__PURE__ */ s("div", { className: "space-y-2", "aria-busy": "true", children: [
|
|
41
|
+
/* @__PURE__ */ t(d, { className: "h-4 w-3/4" }),
|
|
42
|
+
/* @__PURE__ */ t(d, { className: "h-3 w-full" }),
|
|
43
|
+
/* @__PURE__ */ t(d, { className: "h-4 w-1/2" })
|
|
44
|
+
] }) : N ? /* @__PURE__ */ s("p", { className: "text-[12px] text-muted-foreground", children: [
|
|
45
|
+
"Could not load the searches.",
|
|
46
|
+
" ",
|
|
47
|
+
/* @__PURE__ */ t(
|
|
48
|
+
"button",
|
|
49
|
+
{
|
|
50
|
+
type: "button",
|
|
51
|
+
onClick: () => void k(),
|
|
52
|
+
className: "font-medium text-foreground underline-offset-2 hover:underline",
|
|
53
|
+
children: "Try again"
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
] }) : o && !o.available ? /* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: "Searches are not being recorded on this server right now." }) : m.length === 0 ? /* @__PURE__ */ t("p", { className: "rounded-md border border-dashed border-border px-3 py-2.5 text-[12px] leading-5 text-muted-foreground", children: "None in the last 14 days. Words that find nothing show here with a suggested fix." }) : /* @__PURE__ */ s(x, { children: [
|
|
57
|
+
/* @__PURE__ */ t("ol", { className: "divide-y divide-border overflow-hidden rounded-md border border-border", children: m.map((e) => /* @__PURE__ */ s("li", { className: "space-y-1 bg-card px-3 py-2", "data-picker-miss": e.term, children: [
|
|
58
|
+
/* @__PURE__ */ s("div", { className: "flex items-baseline gap-2", children: [
|
|
59
|
+
/* @__PURE__ */ s("span", { className: "min-w-0 flex-1 truncate text-[12.5px] font-medium text-foreground", children: [
|
|
60
|
+
"“",
|
|
61
|
+
e.term,
|
|
62
|
+
"”"
|
|
63
|
+
] }),
|
|
64
|
+
/* @__PURE__ */ s(
|
|
65
|
+
"span",
|
|
66
|
+
{
|
|
67
|
+
className: "shrink-0 text-[11.5px] tabular-nums text-muted-foreground",
|
|
68
|
+
"data-tip": `Last searched ${Q(e.last)}`,
|
|
69
|
+
children: [
|
|
70
|
+
e.count,
|
|
71
|
+
" ",
|
|
72
|
+
e.count === 1 ? "time" : "times"
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
] }),
|
|
77
|
+
e.suggestion && /* @__PURE__ */ t(
|
|
78
|
+
"p",
|
|
79
|
+
{
|
|
80
|
+
className: "text-[11.5px] leading-4 text-muted-foreground",
|
|
81
|
+
"data-picker-miss-fix": e.suggestion.kind,
|
|
82
|
+
children: e.suggestion.text
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
] }, e.term)) }),
|
|
86
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-2 text-[11.5px] text-muted-foreground", children: [
|
|
87
|
+
/* @__PURE__ */ s("span", { className: "flex-1", children: [
|
|
88
|
+
h,
|
|
89
|
+
" missed ",
|
|
90
|
+
h === 1 ? "search" : "searches",
|
|
91
|
+
" in 14 days"
|
|
92
|
+
] }),
|
|
93
|
+
C ? /* @__PURE__ */ s(x, { children: [
|
|
94
|
+
/* @__PURE__ */ t("span", { children: "Clear the list?" }),
|
|
95
|
+
/* @__PURE__ */ t(
|
|
96
|
+
"button",
|
|
97
|
+
{
|
|
98
|
+
type: "button",
|
|
99
|
+
disabled: w,
|
|
100
|
+
onClick: () => void S(),
|
|
101
|
+
className: "rounded px-1.5 py-0.5 font-medium text-red-600 hover:bg-red-50 disabled:opacity-50 dark:text-red-400 dark:hover:bg-red-500/10",
|
|
102
|
+
children: "Clear"
|
|
103
|
+
}
|
|
104
|
+
),
|
|
105
|
+
/* @__PURE__ */ t(
|
|
106
|
+
"button",
|
|
107
|
+
{
|
|
108
|
+
type: "button",
|
|
109
|
+
onClick: () => i(!1),
|
|
110
|
+
className: "rounded px-1.5 py-0.5 hover:bg-muted hover:text-foreground",
|
|
111
|
+
children: "Keep"
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
] }) : /* @__PURE__ */ t(
|
|
115
|
+
"button",
|
|
116
|
+
{
|
|
117
|
+
type: "button",
|
|
118
|
+
onClick: () => i(!0),
|
|
119
|
+
className: "rounded px-1.5 py-0.5 hover:bg-muted hover:text-foreground",
|
|
120
|
+
children: "Clear list"
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
] })
|
|
124
|
+
] })
|
|
125
|
+
] }) });
|
|
126
|
+
}
|
|
127
|
+
export {
|
|
128
|
+
P as PickerMisses
|
|
129
|
+
};
|