@burdenoff/microfe-healthybowl 2026.1201.1 → 2026.1201.2
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.
|
@@ -23,5 +23,11 @@ export interface CropFormDialogProps {
|
|
|
23
23
|
/** Resolves when saved (the dialog is then closed by the page). */
|
|
24
24
|
onSubmit: (data: CropFormData, editingCrop: Crop | null) => Promise<void>;
|
|
25
25
|
}
|
|
26
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* The Add and Edit crop dialog: every field of the old page, plus a way to add a field when the farm has none.
|
|
28
|
+
* BOFF-17477: under the depth-pages opt-in the same fields sit in titled sections in the shared dialog frame (the
|
|
29
|
+
* Crops area's icon and tone), and the optional ones say so; without it, exactly today's dialog. Name, variety and
|
|
30
|
+
* field are the ones the page requires. The section titles and the labels without an asterisk are the words the
|
|
31
|
+
* crop planner and the crop page already use (translated), so this layout adds no new words.
|
|
32
|
+
*/
|
|
27
33
|
export declare const CropFormDialog: FC<CropFormDialogProps>;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import "../../../components/index.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
2
|
+
import { Modal as e } from "../../../components/Modal.js";
|
|
3
|
+
import { HBEntityImages as t } from "../../../components/HBEntityImages.js";
|
|
4
|
+
import { useBasePath as n } from "../../../hooks/useBasePath.js";
|
|
5
|
+
import { isSeason as r } from "./cropsList.js";
|
|
6
|
+
import { useState as i } from "react";
|
|
7
|
+
import { useI18n as ee } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
8
|
+
import { CalendarDays as a, Camera as te, Sprout as o } from "lucide-react";
|
|
9
|
+
import { Link as s } from "react-router";
|
|
10
|
+
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
11
|
+
import { Button as d, DatePicker as f, FormField as p, FormGrid as m, FormSection as h, Input as g, ResponsiveDialog as ne, ResponsiveDialogContent as re, ResponsiveDialogDescription as _, ResponsiveDialogFooter as v, ResponsiveDialogHeader as y, ResponsiveDialogTitle as b, Select as x, SelectContent as S, SelectItem as C, SelectTrigger as w, SelectValue as T, Spinner as ie, useDepthPages as ae } from "@burdenoff/fe-libs/ui";
|
|
10
12
|
// src/healthybowl/pages/crops/list/CropFormDialog.tsx
|
|
11
|
-
var
|
|
13
|
+
var E = {
|
|
12
14
|
name: "",
|
|
13
15
|
variety: "",
|
|
14
16
|
category: "Vegetables",
|
|
@@ -19,7 +21,7 @@ var C = {
|
|
|
19
21
|
yieldEstimate: 0,
|
|
20
22
|
imageIds: []
|
|
21
23
|
};
|
|
22
|
-
function
|
|
24
|
+
function D(e) {
|
|
23
25
|
return {
|
|
24
26
|
name: e.name,
|
|
25
27
|
variety: e.variety,
|
|
@@ -32,196 +34,265 @@ function w(e) {
|
|
|
32
34
|
imageIds: e.imageIds ?? []
|
|
33
35
|
};
|
|
34
36
|
}
|
|
35
|
-
var
|
|
36
|
-
let { t:
|
|
37
|
+
var O = ({ open: O, editingCrop: k, fields: A, submitting: j, onClose: M, onSubmit: oe }) => {
|
|
38
|
+
let { t: N } = ee(), se = ae(), { buildPath: ce } = n(), [P, le] = i(k ? D(k) : E), F = (e, t) => le((n) => ({
|
|
37
39
|
...n,
|
|
38
40
|
[e]: t
|
|
39
|
-
})),
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
})), ue = () => oe(P, k), I = k ? N("healthybowl.crops.list.modal.editTitle", "Edit {{name}}", { name: k.name }) : N("healthybowl.crops.list.modal.addTitle", "Add New Crop"), L = k ? N("healthybowl.crops.list.modal.editDescription", "Update the crop details.") : N("healthybowl.crops.list.modal.addDescription", "Fill in the details to register a new crop on your farm."), R = (e) => /* @__PURE__ */ l(g, {
|
|
42
|
+
type: "text",
|
|
43
|
+
value: P.name,
|
|
44
|
+
onChange: (e) => F("name", e.target.value),
|
|
45
|
+
placeholder: N("healthybowl.crops.list.form.name.placeholder", "e.g., Tomatoes"),
|
|
46
|
+
className: e
|
|
47
|
+
}), z = (e) => /* @__PURE__ */ l(g, {
|
|
48
|
+
type: "text",
|
|
49
|
+
value: P.variety,
|
|
50
|
+
onChange: (e) => F("variety", e.target.value),
|
|
51
|
+
placeholder: N("healthybowl.crops.list.form.variety.placeholder", "e.g., Roma"),
|
|
52
|
+
className: e
|
|
53
|
+
}), B = (e) => /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(g, {
|
|
54
|
+
id: "crop-form-category",
|
|
55
|
+
type: "text",
|
|
56
|
+
value: P.category,
|
|
57
|
+
onChange: (e) => F("category", e.target.value),
|
|
58
|
+
list: "crop-form-category-suggestions",
|
|
59
|
+
className: e,
|
|
60
|
+
placeholder: N("healthybowl.crops.list.form.category.placeholder", "Type any category")
|
|
61
|
+
}), /* @__PURE__ */ l("datalist", {
|
|
62
|
+
id: "crop-form-category-suggestions",
|
|
63
|
+
children: [
|
|
64
|
+
"Vegetables",
|
|
65
|
+
"Fruits",
|
|
66
|
+
"Herbs",
|
|
67
|
+
"Leafy Greens",
|
|
68
|
+
"Grains",
|
|
69
|
+
"Legumes"
|
|
70
|
+
].map((e) => /* @__PURE__ */ l("option", { value: e }, e))
|
|
71
|
+
})] }), V = N("healthybowl.crops.list.form.category.hint", "Common labels are suggestions; custom categories remain editable."), H = (e) => /* @__PURE__ */ u(x, {
|
|
72
|
+
value: P.season,
|
|
73
|
+
onValueChange: (e) => {
|
|
74
|
+
r(e) && F("season", e);
|
|
75
|
+
},
|
|
76
|
+
children: [/* @__PURE__ */ l(w, {
|
|
77
|
+
className: e,
|
|
78
|
+
children: /* @__PURE__ */ l(T, {})
|
|
79
|
+
}), /* @__PURE__ */ u(S, { children: [
|
|
80
|
+
/* @__PURE__ */ l(C, {
|
|
81
|
+
value: "kharif",
|
|
82
|
+
children: N("healthybowl.crops.list.form.season.kharif", "Kharif (Summer)")
|
|
83
|
+
}),
|
|
84
|
+
/* @__PURE__ */ l(C, {
|
|
85
|
+
value: "rabi",
|
|
86
|
+
children: N("healthybowl.crops.list.form.season.rabi", "Rabi (Winter)")
|
|
87
|
+
}),
|
|
88
|
+
/* @__PURE__ */ l(C, {
|
|
89
|
+
value: "zaid",
|
|
90
|
+
children: N("healthybowl.crops.list.form.season.zaid", "Zaid (Spring)")
|
|
91
|
+
}),
|
|
92
|
+
/* @__PURE__ */ l(C, {
|
|
93
|
+
value: "perennial",
|
|
94
|
+
children: N("healthybowl.crops.list.form.season.perennial", "Perennial")
|
|
95
|
+
})
|
|
96
|
+
] })]
|
|
97
|
+
}), U = (e) => /* @__PURE__ */ u(x, {
|
|
98
|
+
value: P.field,
|
|
99
|
+
onValueChange: (e) => F("field", e),
|
|
100
|
+
children: [/* @__PURE__ */ l(w, {
|
|
101
|
+
className: e,
|
|
102
|
+
children: /* @__PURE__ */ l(T, { placeholder: N("healthybowl.crops.list.form.field.placeholder", "Select a field") })
|
|
103
|
+
}), /* @__PURE__ */ l(S, { children: A.map((e) => /* @__PURE__ */ u(C, {
|
|
104
|
+
value: e.id,
|
|
105
|
+
children: [
|
|
106
|
+
e.name,
|
|
107
|
+
" (",
|
|
108
|
+
e.area,
|
|
109
|
+
" ",
|
|
110
|
+
e.unit,
|
|
111
|
+
")"
|
|
112
|
+
]
|
|
113
|
+
}, e.id)) })]
|
|
114
|
+
}), W = A.length === 0 ? /* @__PURE__ */ u(c, { children: [
|
|
115
|
+
N("healthybowl.crops.list.form.noField", "A crop grows on a field."),
|
|
116
|
+
" ",
|
|
117
|
+
/* @__PURE__ */ l(s, {
|
|
118
|
+
className: "font-medium text-primary underline",
|
|
119
|
+
to: ce("crops/fields"),
|
|
120
|
+
children: N("healthybowl.crops.list.form.addField", "Add a field")
|
|
121
|
+
})
|
|
122
|
+
] }) : null, G = (e) => /* @__PURE__ */ l(g, {
|
|
123
|
+
type: "number",
|
|
124
|
+
min: 0,
|
|
125
|
+
value: P.yieldEstimate || "",
|
|
126
|
+
onChange: (e) => F("yieldEstimate", Number(e.target.value)),
|
|
127
|
+
placeholder: N("healthybowl.crops.list.form.yieldEstimate.placeholder", "e.g., 2500"),
|
|
128
|
+
className: e
|
|
129
|
+
}), K = N("healthybowl.crops.list.form.plantingDate.label", "Planting Date"), q = N("healthybowl.crops.list.form.expectedHarvestDate.label", "Expected Harvest Date"), J = /* @__PURE__ */ l(f, {
|
|
130
|
+
value: P.plantingDate || null,
|
|
131
|
+
onChange: (e) => F("plantingDate", e),
|
|
132
|
+
label: K,
|
|
133
|
+
className: "mt-1 w-full"
|
|
134
|
+
}), Y = /* @__PURE__ */ l(f, {
|
|
135
|
+
value: P.expectedHarvestDate || null,
|
|
136
|
+
onChange: (e) => F("expectedHarvestDate", e),
|
|
137
|
+
label: q,
|
|
138
|
+
className: "mt-1 w-full"
|
|
139
|
+
}), X = N("healthybowl.crops.list.form.photos.label", "Photos"), Z = /* @__PURE__ */ l(t, {
|
|
140
|
+
entity: "Crop",
|
|
141
|
+
imageIds: P.imageIds,
|
|
142
|
+
onChange: (e) => F("imageIds", e)
|
|
143
|
+
}), Q = /* @__PURE__ */ l(d, {
|
|
144
|
+
variant: "outline",
|
|
145
|
+
onClick: M,
|
|
146
|
+
children: N("healthybowl.common.cancel", "Cancel")
|
|
147
|
+
}), $ = /* @__PURE__ */ u(d, {
|
|
148
|
+
onClick: () => void ue(),
|
|
149
|
+
disabled: j,
|
|
150
|
+
children: [j ? /* @__PURE__ */ l(ie, { size: "sm" }) : null, j ? N("healthybowl.crops.list.modal.saving", "Saving...") : k ? N("healthybowl.crops.list.modal.saveChanges", "Save Changes") : N("healthybowl.crops.list.modal.addCrop", "Add Crop")]
|
|
151
|
+
});
|
|
152
|
+
if (se) {
|
|
153
|
+
let t = N("healthybowl.common.v3.optional", "optional");
|
|
154
|
+
return /* @__PURE__ */ u(e, {
|
|
155
|
+
open: O,
|
|
156
|
+
onClose: M,
|
|
157
|
+
title: I,
|
|
158
|
+
description: L,
|
|
159
|
+
size: "lg",
|
|
160
|
+
footer: /* @__PURE__ */ u(c, { children: [Q, $] }),
|
|
161
|
+
children: [
|
|
162
|
+
/* @__PURE__ */ l(h, {
|
|
163
|
+
icon: o,
|
|
164
|
+
title: N("healthybowl.crops.planning.modal.v3.section.crop", "The crop and the field"),
|
|
165
|
+
children: /* @__PURE__ */ u(m, { children: [
|
|
166
|
+
/* @__PURE__ */ l(p, {
|
|
167
|
+
label: N("healthybowl.crops.detail.form.cropName", "Crop Name"),
|
|
168
|
+
wide: !0,
|
|
169
|
+
children: R("w-full")
|
|
170
|
+
}),
|
|
171
|
+
/* @__PURE__ */ l(p, {
|
|
172
|
+
label: N("healthybowl.crops.detail.form.variety", "Variety"),
|
|
173
|
+
children: z("w-full")
|
|
174
|
+
}),
|
|
175
|
+
/* @__PURE__ */ l(p, {
|
|
176
|
+
label: N("healthybowl.crops.planning.form.fields.field.label", "Field"),
|
|
177
|
+
hint: W ?? void 0,
|
|
178
|
+
children: U("w-full")
|
|
179
|
+
}),
|
|
180
|
+
/* @__PURE__ */ l(p, {
|
|
181
|
+
label: N("healthybowl.crops.detail.form.category", "Category"),
|
|
182
|
+
htmlFor: "crop-form-category",
|
|
183
|
+
optional: t,
|
|
184
|
+
hint: V,
|
|
185
|
+
children: B("w-full")
|
|
186
|
+
})
|
|
187
|
+
] })
|
|
188
|
+
}),
|
|
189
|
+
/* @__PURE__ */ l(h, {
|
|
190
|
+
icon: a,
|
|
191
|
+
title: N("healthybowl.crops.planning.modal.v3.section.when", "Season and dates"),
|
|
192
|
+
children: /* @__PURE__ */ u(m, { children: [
|
|
193
|
+
/* @__PURE__ */ l(p, {
|
|
194
|
+
label: N("healthybowl.crops.list.form.season.label", "Season"),
|
|
195
|
+
children: H("w-full")
|
|
196
|
+
}),
|
|
197
|
+
/* @__PURE__ */ l(p, {
|
|
198
|
+
label: N("healthybowl.crops.list.form.yieldEstimate.label", "Yield Estimate (kg)"),
|
|
199
|
+
optional: t,
|
|
200
|
+
children: G("w-full tabular-nums")
|
|
201
|
+
}),
|
|
202
|
+
/* @__PURE__ */ l(p, {
|
|
203
|
+
label: K,
|
|
204
|
+
optional: t,
|
|
205
|
+
children: J
|
|
206
|
+
}),
|
|
207
|
+
/* @__PURE__ */ l(p, {
|
|
208
|
+
label: q,
|
|
209
|
+
optional: t,
|
|
210
|
+
children: Y
|
|
211
|
+
})
|
|
212
|
+
] })
|
|
213
|
+
}),
|
|
214
|
+
/* @__PURE__ */ l(h, {
|
|
215
|
+
icon: te,
|
|
216
|
+
title: X,
|
|
217
|
+
children: Z
|
|
218
|
+
})
|
|
219
|
+
]
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
return /* @__PURE__ */ l(ne, {
|
|
223
|
+
open: O,
|
|
42
224
|
onOpenChange: (e) => {
|
|
43
|
-
e ||
|
|
225
|
+
e || M();
|
|
44
226
|
},
|
|
45
|
-
children: /* @__PURE__ */
|
|
227
|
+
children: /* @__PURE__ */ u(re, {
|
|
46
228
|
className: "sm:max-w-2xl",
|
|
47
229
|
children: [
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
230
|
+
/* @__PURE__ */ u(y, { children: [/* @__PURE__ */ l(b, { children: I }), /* @__PURE__ */ l(_, { children: L })] }),
|
|
231
|
+
/* @__PURE__ */ u("div", {
|
|
50
232
|
className: "grid gap-4 sm:grid-cols-2",
|
|
51
233
|
children: [
|
|
52
|
-
/* @__PURE__ */
|
|
234
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
53
235
|
className: "text-sm font-medium text-text-primary",
|
|
54
|
-
children:
|
|
55
|
-
}),
|
|
56
|
-
|
|
57
|
-
value: N.name,
|
|
58
|
-
onChange: (e) => F("name", e.target.value),
|
|
59
|
-
placeholder: j("healthybowl.crops.list.form.name.placeholder", "e.g., Tomatoes"),
|
|
60
|
-
className: "mt-1"
|
|
61
|
-
})] }),
|
|
62
|
-
/* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("label", {
|
|
236
|
+
children: N("healthybowl.crops.list.form.name.label", "Crop Name *")
|
|
237
|
+
}), R("mt-1")] }),
|
|
238
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
63
239
|
className: "text-sm font-medium text-text-primary",
|
|
64
|
-
children:
|
|
65
|
-
}),
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
onChange: (e) => F("variety", e.target.value),
|
|
69
|
-
placeholder: j("healthybowl.crops.list.form.variety.placeholder", "e.g., Roma"),
|
|
70
|
-
className: "mt-1"
|
|
71
|
-
})] }),
|
|
72
|
-
/* @__PURE__ */ s("div", { children: [
|
|
73
|
-
/* @__PURE__ */ o("label", {
|
|
240
|
+
children: N("healthybowl.crops.list.form.variety.label", "Variety *")
|
|
241
|
+
}), z("mt-1")] }),
|
|
242
|
+
/* @__PURE__ */ u("div", { children: [
|
|
243
|
+
/* @__PURE__ */ l("label", {
|
|
74
244
|
htmlFor: "crop-form-category",
|
|
75
245
|
className: "text-sm font-medium text-text-primary",
|
|
76
|
-
children:
|
|
77
|
-
}),
|
|
78
|
-
/* @__PURE__ */ o(u, {
|
|
79
|
-
id: "crop-form-category",
|
|
80
|
-
type: "text",
|
|
81
|
-
value: N.category,
|
|
82
|
-
onChange: (e) => F("category", e.target.value),
|
|
83
|
-
list: "crop-form-category-suggestions",
|
|
84
|
-
className: "mt-1",
|
|
85
|
-
placeholder: j("healthybowl.crops.list.form.category.placeholder", "Type any category")
|
|
86
|
-
}),
|
|
87
|
-
/* @__PURE__ */ o("datalist", {
|
|
88
|
-
id: "crop-form-category-suggestions",
|
|
89
|
-
children: [
|
|
90
|
-
"Vegetables",
|
|
91
|
-
"Fruits",
|
|
92
|
-
"Herbs",
|
|
93
|
-
"Leafy Greens",
|
|
94
|
-
"Grains",
|
|
95
|
-
"Legumes"
|
|
96
|
-
].map((e) => /* @__PURE__ */ o("option", { value: e }, e))
|
|
246
|
+
children: N("healthybowl.crops.list.form.category.label", "Category")
|
|
97
247
|
}),
|
|
98
|
-
|
|
248
|
+
B("mt-1"),
|
|
249
|
+
/* @__PURE__ */ l("p", {
|
|
99
250
|
className: "mt-1 text-xs text-text-secondary",
|
|
100
|
-
children:
|
|
251
|
+
children: V
|
|
101
252
|
})
|
|
102
253
|
] }),
|
|
103
|
-
/* @__PURE__ */
|
|
254
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
104
255
|
className: "text-sm font-medium text-text-primary",
|
|
105
|
-
children:
|
|
106
|
-
}),
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
n(e) && F("season", e);
|
|
110
|
-
},
|
|
111
|
-
children: [/* @__PURE__ */ o(b, {
|
|
112
|
-
className: "mt-1",
|
|
113
|
-
children: /* @__PURE__ */ o(x, {})
|
|
114
|
-
}), /* @__PURE__ */ s(v, { children: [
|
|
115
|
-
/* @__PURE__ */ o(y, {
|
|
116
|
-
value: "kharif",
|
|
117
|
-
children: j("healthybowl.crops.list.form.season.kharif", "Kharif (Summer)")
|
|
118
|
-
}),
|
|
119
|
-
/* @__PURE__ */ o(y, {
|
|
120
|
-
value: "rabi",
|
|
121
|
-
children: j("healthybowl.crops.list.form.season.rabi", "Rabi (Winter)")
|
|
122
|
-
}),
|
|
123
|
-
/* @__PURE__ */ o(y, {
|
|
124
|
-
value: "zaid",
|
|
125
|
-
children: j("healthybowl.crops.list.form.season.zaid", "Zaid (Spring)")
|
|
126
|
-
}),
|
|
127
|
-
/* @__PURE__ */ o(y, {
|
|
128
|
-
value: "perennial",
|
|
129
|
-
children: j("healthybowl.crops.list.form.season.perennial", "Perennial")
|
|
130
|
-
})
|
|
131
|
-
] })]
|
|
132
|
-
})] }),
|
|
133
|
-
/* @__PURE__ */ s("div", { children: [
|
|
134
|
-
/* @__PURE__ */ o("label", {
|
|
256
|
+
children: N("healthybowl.crops.list.form.season.label", "Season")
|
|
257
|
+
}), H("mt-1")] }),
|
|
258
|
+
/* @__PURE__ */ u("div", { children: [
|
|
259
|
+
/* @__PURE__ */ l("label", {
|
|
135
260
|
className: "text-sm font-medium text-text-primary",
|
|
136
|
-
children:
|
|
137
|
-
}),
|
|
138
|
-
/* @__PURE__ */ s(_, {
|
|
139
|
-
value: N.field,
|
|
140
|
-
onValueChange: (e) => F("field", e),
|
|
141
|
-
children: [/* @__PURE__ */ o(b, {
|
|
142
|
-
className: "mt-1",
|
|
143
|
-
children: /* @__PURE__ */ o(x, { placeholder: j("healthybowl.crops.list.form.field.placeholder", "Select a field") })
|
|
144
|
-
}), /* @__PURE__ */ o(v, { children: D.map((e) => /* @__PURE__ */ s(y, {
|
|
145
|
-
value: e.id,
|
|
146
|
-
children: [
|
|
147
|
-
e.name,
|
|
148
|
-
" (",
|
|
149
|
-
e.area,
|
|
150
|
-
" ",
|
|
151
|
-
e.unit,
|
|
152
|
-
")"
|
|
153
|
-
]
|
|
154
|
-
}, e.id)) })]
|
|
261
|
+
children: N("healthybowl.crops.list.form.field.label", "Field *")
|
|
155
262
|
}),
|
|
156
|
-
|
|
263
|
+
U("mt-1"),
|
|
264
|
+
W ? /* @__PURE__ */ l("p", {
|
|
157
265
|
className: "mt-1 text-xs text-text-secondary",
|
|
158
|
-
children:
|
|
159
|
-
j("healthybowl.crops.list.form.noField", "A crop grows on a field."),
|
|
160
|
-
" ",
|
|
161
|
-
/* @__PURE__ */ o(a, {
|
|
162
|
-
className: "font-medium text-primary underline",
|
|
163
|
-
to: M("crops/fields"),
|
|
164
|
-
children: j("healthybowl.crops.list.form.addField", "Add a field")
|
|
165
|
-
})
|
|
166
|
-
]
|
|
266
|
+
children: W
|
|
167
267
|
}) : null
|
|
168
268
|
] }),
|
|
169
|
-
/* @__PURE__ */
|
|
269
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
170
270
|
className: "text-sm font-medium text-text-primary",
|
|
171
|
-
children:
|
|
172
|
-
}),
|
|
173
|
-
|
|
174
|
-
min: 0,
|
|
175
|
-
value: N.yieldEstimate || "",
|
|
176
|
-
onChange: (e) => F("yieldEstimate", Number(e.target.value)),
|
|
177
|
-
placeholder: j("healthybowl.crops.list.form.yieldEstimate.placeholder", "e.g., 2500"),
|
|
178
|
-
className: "mt-1 tabular-nums"
|
|
179
|
-
})] }),
|
|
180
|
-
/* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("label", {
|
|
271
|
+
children: N("healthybowl.crops.list.form.yieldEstimate.label", "Yield Estimate (kg)")
|
|
272
|
+
}), G("mt-1 tabular-nums")] }),
|
|
273
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
181
274
|
className: "text-sm font-medium text-text-primary",
|
|
182
|
-
children:
|
|
183
|
-
}),
|
|
184
|
-
|
|
185
|
-
onChange: (e) => F("plantingDate", e),
|
|
186
|
-
label: j("healthybowl.crops.list.form.plantingDate.label", "Planting Date"),
|
|
187
|
-
className: "mt-1 w-full"
|
|
188
|
-
})] }),
|
|
189
|
-
/* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("label", {
|
|
275
|
+
children: K
|
|
276
|
+
}), J] }),
|
|
277
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
190
278
|
className: "text-sm font-medium text-text-primary",
|
|
191
|
-
children:
|
|
192
|
-
}),
|
|
193
|
-
|
|
194
|
-
onChange: (e) => F("expectedHarvestDate", e),
|
|
195
|
-
label: j("healthybowl.crops.list.form.expectedHarvestDate.label", "Expected Harvest Date"),
|
|
196
|
-
className: "mt-1 w-full"
|
|
197
|
-
})] }),
|
|
198
|
-
/* @__PURE__ */ s("div", {
|
|
279
|
+
children: q
|
|
280
|
+
}), Y] }),
|
|
281
|
+
/* @__PURE__ */ u("div", {
|
|
199
282
|
className: "sm:col-span-2",
|
|
200
|
-
children: [/* @__PURE__ */
|
|
283
|
+
children: [/* @__PURE__ */ l("label", {
|
|
201
284
|
className: "text-sm font-medium text-text-primary",
|
|
202
|
-
children:
|
|
203
|
-
}), /* @__PURE__ */
|
|
285
|
+
children: X
|
|
286
|
+
}), /* @__PURE__ */ l("div", {
|
|
204
287
|
className: "mt-1",
|
|
205
|
-
children:
|
|
206
|
-
entity: "Crop",
|
|
207
|
-
imageIds: N.imageIds,
|
|
208
|
-
onChange: (e) => F("imageIds", e)
|
|
209
|
-
})
|
|
288
|
+
children: Z
|
|
210
289
|
})]
|
|
211
290
|
})
|
|
212
291
|
]
|
|
213
292
|
}),
|
|
214
|
-
/* @__PURE__ */
|
|
215
|
-
variant: "outline",
|
|
216
|
-
onClick: k,
|
|
217
|
-
children: j("healthybowl.common.cancel", "Cancel")
|
|
218
|
-
}), /* @__PURE__ */ s(c, {
|
|
219
|
-
onClick: () => void I(),
|
|
220
|
-
disabled: O,
|
|
221
|
-
children: [O ? /* @__PURE__ */ o(S, { size: "sm" }) : null, O ? j("healthybowl.crops.list.modal.saving", "Saving...") : E ? j("healthybowl.crops.list.modal.saveChanges", "Save Changes") : j("healthybowl.crops.list.modal.addCrop", "Add Crop")]
|
|
222
|
-
})] })
|
|
293
|
+
/* @__PURE__ */ u(v, { children: [Q, $] })
|
|
223
294
|
]
|
|
224
295
|
})
|
|
225
296
|
});
|
|
226
297
|
};
|
|
227
|
-
export {
|
|
298
|
+
export { O as CropFormDialog, E as defaultFormData, D as formDataOf };
|
package/package.json
CHANGED