@gurpinderjitsingh/recipe-ui 0.2.1 → 0.4.0
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/cjs/app-modal_7.cjs.entry.js +43 -8
- package/dist/cjs/app-toast.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/recipe-ui.cjs.js +1 -1
- package/dist/collection/components/app-toast/app-toast.js +1 -1
- package/dist/collection/components/meal-plan-day/meal-plan-day.js +1 -1
- package/dist/collection/components/recipe-card/recipe-card.js +1 -1
- package/dist/collection/components/recipe-filter-bar/recipe-filter-bar.js +1 -1
- package/dist/collection/components/recipe-form/recipe-form.css +139 -17
- package/dist/collection/components/recipe-form/recipe-form.js +79 -11
- package/dist/collection/components/recipe-rating/recipe-rating.js +1 -1
- package/dist/collection/components/recipe-search-bar/recipe-search-bar.js +1 -1
- package/dist/components/app-toast.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-gWE9Vqi0.js → p-B92NkO3p.js} +1 -1
- package/dist/components/{p-Q8V4JgYC.js → p-BzvqJQ_R.js} +1 -1
- package/dist/components/{p-snMSuFkY.js → p-Cn_qfIvv.js} +1 -1
- package/dist/components/{p-fNGqqs-I.js → p-K-btCLSj.js} +1 -1
- package/dist/components/{p-DrDPFXTB.js → p-mY_lBX8M.js} +1 -1
- package/dist/components/p-u-o4onHp.js +1 -0
- package/dist/components/recipe-card.js +1 -1
- package/dist/components/recipe-filter-bar.js +1 -1
- package/dist/components/recipe-form.js +1 -1
- package/dist/components/recipe-rating.js +1 -1
- package/dist/components/recipe-search-bar.js +1 -1
- package/dist/esm/app-modal_7.entry.js +43 -8
- package/dist/esm/app-toast.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/recipe-ui.js +1 -1
- package/dist/recipe-ui/p-1f2f28cf.entry.js +1 -0
- package/dist/recipe-ui/p-e66a8ded.entry.js +1 -0
- package/dist/recipe-ui/recipe-ui.esm.js +1 -1
- package/dist/types/components/recipe-form/recipe-form.d.ts +8 -6
- package/dist/types/components.d.ts +16 -22
- package/package.json +1 -1
- package/dist/components/p-CN2vLHNY.js +0 -1
- package/dist/recipe-ui/p-268be6b1.entry.js +0 -1
- package/dist/recipe-ui/p-97e73b62.entry.js +0 -1
|
@@ -19,7 +19,7 @@ const RecipeCard = class {
|
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
|
-
return (index.h("div", { key: '
|
|
22
|
+
return (index.h("div", { key: '72e604b38c4156bfe101f0609fac315cd317c981', class: "card", onClick: () => this.cardClick.emit() }, index.h("div", { key: 'bb707d57e573970201644e029eb6257e100e2276', class: "image-wrap" }, this.image ? index.h("img", { src: this.image, alt: this.recipeTitle }) : index.h("div", { class: "placeholder" }), index.h("button", { key: 'bb052a897f227e8b8ca938704a083d8502036037', class: { 'fav-btn': true, active: this.favorite }, onClick: this.onFavoriteClick, "aria-label": "Toggle favorite" }, this.favorite ? '★' : '☆')), index.h("div", { key: 'e4c139b9bdbdac25e92def0705d8506d89a0ce65', class: "body" }, index.h("h3", { key: 'aea91bd0827cdbe2608d91b428489a11eb7de0fa' }, this.recipeTitle), this.category && index.h("span", { key: '96219817064ee274999487452db6c70dee93d82f', class: "category" }, this.category), index.h("div", { key: 'c2593b0d879744a24c4be179af1d9359e3e904fa', class: "actions" }, index.h("slot", { key: '19e921048e6d469a33531c2bb949067a7925c7ac', name: "actions" })))));
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
RecipeCard.style = recipeCardCss();
|
|
@@ -55,7 +55,7 @@ const RecipeSearchBar = class {
|
|
|
55
55
|
this.internalValue = newVal;
|
|
56
56
|
}
|
|
57
57
|
render() {
|
|
58
|
-
return (index.h("div", { key: '
|
|
58
|
+
return (index.h("div", { key: '7fa4a3ce06ef9b7e68b968a0bf29cce896cc7db0', class: "wrap" }, index.h("input", { key: 'ae2e528fafd1f342de8a88c14f0651857bc0486d', type: "search", placeholder: this.placeholder, value: this.internalValue, onInput: this.onInput, onKeyDown: this.onKeyDown }), index.h("button", { key: 'c9a369dca794014f17cd64cfaa4b7b9f0e06d171', onClick: () => this.search.emit({ value: this.internalValue }), "aria-label": "Search" }, "\uD83D\uDD0D")));
|
|
59
59
|
}
|
|
60
60
|
static get watchers() { return {
|
|
61
61
|
"value": [{
|
|
@@ -79,7 +79,7 @@ const RecipeFilterBar = class {
|
|
|
79
79
|
}
|
|
80
80
|
render() {
|
|
81
81
|
const cats = Array.isArray(this.categories) ? this.categories : [];
|
|
82
|
-
return (index.h("div", { key: '
|
|
82
|
+
return (index.h("div", { key: '336e3431325ab3338cda5be917414c6be4be1cf9', class: "wrap" }, index.h("button", { key: 'f1a5c228cf9ef1dd2017b26be55afdd07e27c837', class: { chip: true, active: this.active === '' }, onClick: () => this.select('') }, "All"), cats.map((c) => (index.h("button", { class: { chip: true, active: this.active === c }, onClick: () => this.select(c) }, c)))));
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
85
|
RecipeFilterBar.style = recipeFilterBarCss();
|
|
@@ -96,21 +96,34 @@ const RecipeRating = class {
|
|
|
96
96
|
}
|
|
97
97
|
render() {
|
|
98
98
|
const stars = Array.from({ length: this.max }, (_, i) => i + 1);
|
|
99
|
-
return (index.h("div", { key: '
|
|
99
|
+
return (index.h("div", { key: '9e67a7c471e6b20bbc2bc0164a5346c8cd5f10dc', class: "wrap", role: this.readonly ? undefined : 'radiogroup' }, stars.map((s) => (index.h("span", { class: { star: true, filled: s <= this.value, clickable: !this.readonly }, onClick: () => !this.readonly && this.ratingChange.emit({ value: s }) }, "\u2605")))));
|
|
100
100
|
}
|
|
101
101
|
};
|
|
102
102
|
RecipeRating.style = recipeRatingCss();
|
|
103
103
|
|
|
104
|
-
const recipeFormCss = () => `:host{display:block;font-family:system-ui, sans-serif}form{display:flex;flex-direction:column;gap:14px}label{display:flex;flex-direction:column;gap:4px;font-size:13px;color:#333;font-weight:600}input,textarea{font-weight:400;padding:8px 10px;border:1px solid #ddd;border-radius:6px;font-size:14px;font-family:inherit}.field{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:600}.ingredient-row{display:flex;gap:6px}.ingredient-row input{flex:1}.ingredient-row button{border:none;background:#f4f4f4;border-radius:6px;cursor:pointer;width:30px}.add-btn{align-self:flex-start;border:1px dashed #bbb;background:none;border-radius:6px;padding:6px 10px;cursor:pointer;font-size:13px;color:#555}.error{color:#e74c3c;font-size:12px;font-weight:400}.footer{display:flex;justify-content:flex-end;gap:10px;margin-top:6px}.cancel-btn{border:1px solid #ddd;background:#fff;border-radius:8px;padding:8px 16px;cursor:pointer}.save-btn{border:none;background:#ff6b35;color:#fff;border-radius:8px;padding:8px 18px;cursor:pointer;font-weight:600}`;
|
|
104
|
+
const recipeFormCss = () => `:host{display:block;font-family:system-ui, sans-serif}form{display:flex;flex-direction:column;gap:14px}label{display:flex;flex-direction:column;gap:4px;font-size:13px;color:#333;font-weight:600}input,textarea,select{font-weight:400;padding:8px 10px;border:1px solid #ddd;border-radius:6px;font-size:14px;font-family:inherit;background:#fff;transition:border-color 0.15s ease, box-shadow 0.15s ease}input:focus,textarea:focus,select:focus{outline:none;border-color:#ff6b35;box-shadow:0 0 0 3px rgba(255, 107, 53, 0.14)}select{appearance:none;-webkit-appearance:none;-moz-appearance:none;padding-right:34px;cursor:pointer;color:#1f2937;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center;background-size:14px}select:hover{border-color:#bbb}select:invalid,select option[value=""]{color:#9ca3af}.row{display:grid;grid-template-columns:1fr 1fr;gap:14px}@media (max-width: 480px){.row{grid-template-columns:1fr}}.field{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:600}.ingredient-row{display:flex;gap:6px}.ingredient-row input{flex:1}.ingredient-row button{border:none;background:#f4f4f4;border-radius:6px;cursor:pointer;width:30px}.add-btn{align-self:flex-start;border:1px dashed #bbb;background:none;border-radius:6px;padding:6px 10px;cursor:pointer;font-size:13px;color:#555}.error{color:#e74c3c;font-size:12px;font-weight:400}.footer{display:flex;justify-content:flex-end;gap:10px;margin-top:6px}.cancel-btn{border:1px solid #ddd;background:#fff;border-radius:8px;padding:8px 16px;cursor:pointer}.save-btn{border:none;background:#ff6b35;color:#fff;border-radius:8px;padding:8px 18px;cursor:pointer;font-weight:600}`;
|
|
105
105
|
|
|
106
|
+
const DEFAULT_AREAS = [
|
|
107
|
+
'American', 'British', 'Chinese', 'Croatian', 'Dutch', 'Egyptian',
|
|
108
|
+
'Filipino', 'French', 'Greek', 'Indian', 'Irish', 'Italian', 'Jamaican',
|
|
109
|
+
'Japanese', 'Kenyan', 'Malaysian', 'Mexican', 'Moroccan', 'Polish',
|
|
110
|
+
'Portuguese', 'Russian', 'Spanish', 'Thai', 'Tunisian', 'Turkish',
|
|
111
|
+
'Vietnamese', 'Other',
|
|
112
|
+
];
|
|
106
113
|
const RecipeForm = class {
|
|
107
114
|
constructor(hostRef) {
|
|
108
115
|
index.registerInstance(this, hostRef);
|
|
109
116
|
this.save = index.createEvent(this, "save");
|
|
110
117
|
this.cancel = index.createEvent(this, "cancel");
|
|
118
|
+
/** Full override of the cuisine dropdown options */
|
|
119
|
+
this.areas = DEFAULT_AREAS;
|
|
120
|
+
/** Additional cuisine options merged in before "Other" */
|
|
121
|
+
this.extraAreas = [];
|
|
111
122
|
this.title = '';
|
|
112
123
|
this.image = '';
|
|
113
124
|
this.category = '';
|
|
125
|
+
this.area = '';
|
|
126
|
+
this.customArea = '';
|
|
114
127
|
this.ingredients = [''];
|
|
115
128
|
this.instructions = '';
|
|
116
129
|
this.errors = {};
|
|
@@ -118,11 +131,13 @@ const RecipeForm = class {
|
|
|
118
131
|
e.preventDefault();
|
|
119
132
|
if (!this.validate())
|
|
120
133
|
return;
|
|
134
|
+
const resolvedArea = this.area === 'Other' ? this.customArea.trim() : this.area;
|
|
121
135
|
const data = {
|
|
122
136
|
id: this.initialData?.id,
|
|
123
137
|
title: this.title.trim(),
|
|
124
138
|
image: this.image.trim(),
|
|
125
139
|
category: this.category.trim(),
|
|
140
|
+
area: resolvedArea,
|
|
126
141
|
ingredients: this.ingredients.map((i) => i.trim()).filter(Boolean),
|
|
127
142
|
instructions: this.instructions.trim(),
|
|
128
143
|
};
|
|
@@ -141,6 +156,16 @@ const RecipeForm = class {
|
|
|
141
156
|
onInitialDataChange() {
|
|
142
157
|
this.loadInitialData();
|
|
143
158
|
}
|
|
159
|
+
get fullAreaList() {
|
|
160
|
+
const withoutOther = this.areas.filter((a) => a !== 'Other');
|
|
161
|
+
const merged = [...withoutOther];
|
|
162
|
+
for (const extra of this.extraAreas) {
|
|
163
|
+
if (extra && !merged.includes(extra))
|
|
164
|
+
merged.push(extra);
|
|
165
|
+
}
|
|
166
|
+
merged.push('Other');
|
|
167
|
+
return merged;
|
|
168
|
+
}
|
|
144
169
|
loadInitialData() {
|
|
145
170
|
let data;
|
|
146
171
|
if (typeof this.initialData === 'string' && this.initialData) {
|
|
@@ -160,19 +185,29 @@ const RecipeForm = class {
|
|
|
160
185
|
this.category = data.category ?? '';
|
|
161
186
|
this.ingredients = data.ingredients?.length ? [...data.ingredients] : [''];
|
|
162
187
|
this.instructions = data.instructions ?? '';
|
|
188
|
+
const knownAreas = this.fullAreaList.filter((a) => a !== 'Other');
|
|
189
|
+
if (data.area && !knownAreas.includes(data.area)) {
|
|
190
|
+
this.area = 'Other';
|
|
191
|
+
this.customArea = data.area;
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
this.area = data.area ?? '';
|
|
195
|
+
this.customArea = '';
|
|
196
|
+
}
|
|
163
197
|
}
|
|
164
198
|
}
|
|
165
199
|
validate() {
|
|
166
200
|
const errors = {};
|
|
167
201
|
if (!this.title.trim())
|
|
168
202
|
errors.title = 'Title is required.';
|
|
169
|
-
if (!this.category.trim())
|
|
170
|
-
errors.category = 'Category is required.';
|
|
171
203
|
const cleanIngredients = this.ingredients.map((i) => i.trim()).filter(Boolean);
|
|
172
204
|
if (cleanIngredients.length === 0)
|
|
173
205
|
errors.ingredients = 'Add at least one ingredient.';
|
|
174
206
|
if (!this.instructions.trim())
|
|
175
207
|
errors.instructions = 'Instructions are required.';
|
|
208
|
+
if (this.area === 'Other' && !this.customArea.trim()) {
|
|
209
|
+
errors.customArea = 'Enter a cuisine name.';
|
|
210
|
+
}
|
|
176
211
|
this.errors = errors;
|
|
177
212
|
return Object.keys(errors).length === 0;
|
|
178
213
|
}
|
|
@@ -182,7 +217,7 @@ const RecipeForm = class {
|
|
|
182
217
|
this.ingredients = next;
|
|
183
218
|
}
|
|
184
219
|
render() {
|
|
185
|
-
return (index.h("form", { key: '
|
|
220
|
+
return (index.h("form", { key: 'b9e50e96b20b8f3bb28ecb516b102c87088daddd', onSubmit: this.onSubmit }, index.h("slot", { key: '648424eb3444acdacb69e541799571ffa6572004', name: "header" }), index.h("label", { key: '77ec1e8acd2ba845262909f672fadf06907702f2' }, "Title", index.h("input", { key: '2f5dd98ab985831eb07ac43afed983908f2646d1', type: "text", value: this.title, onInput: (e) => (this.title = e.target.value) }), this.errors.title && index.h("span", { key: '244560b4dc4cb47cbb514d0f8fe41be267299885', class: "error" }, this.errors.title)), index.h("label", { key: '8bb49420325a7629186a5801162b9a2e4321e4f7' }, "Image URL", index.h("input", { key: 'fe121c2389308b5bc0e6f7b977f15fec91f9baae', type: "text", value: this.image, onInput: (e) => (this.image = e.target.value) })), index.h("div", { key: '2ede3939f5230f805841945a29fc37fc4d2f3627', class: "row" }, index.h("label", { key: 'b736ee46a12a1070cb52c76fc41d31e0f8d1169b' }, "Category", index.h("input", { key: '6952f8378b13313c1c63d2cb1b1cd9c2593d1806', type: "text", value: this.category, onInput: (e) => (this.category = e.target.value) })), index.h("label", { key: 'a6e477f0bfdfbab6a75831a62334b665272a98db' }, "Cuisine / Area", index.h("select", { key: '1434d68a1782d19f92cd2d5ef638f440a8adc7dd', onInput: (e) => (this.area = e.target.value) }, index.h("option", { key: 'a40b1cacf4deb98590689325f23e572522069268', value: "", selected: this.area === '' }, "Select a cuisine\u2026"), this.fullAreaList.map((a) => (index.h("option", { value: a, selected: a === this.area }, a)))))), this.area === 'Other' && (index.h("label", { key: '77ab0849f544aacc7c2a207dc222c916dfb7a41b', class: "custom-area-field" }, "Enter cuisine name", index.h("input", { key: 'fd7c97a89c0e2b8f23cc28fbc502563eb759fdb4', type: "text", placeholder: "e.g. Ethiopian", value: this.customArea, onInput: (e) => (this.customArea = e.target.value) }), this.errors.customArea && index.h("span", { key: '2b2425b63b0d5ee311fe16040d012a43919c8ca6', class: "error" }, this.errors.customArea))), index.h("div", { key: 'fafa1824f121c9c2c96069772d2011a13ce0683f', class: "field" }, index.h("span", { key: 'bea9e5877093e412b1fffb12f0aad4c79604cc16' }, "Ingredients"), this.ingredients.map((ing, i) => (index.h("div", { class: "ingredient-row" }, index.h("input", { type: "text", value: ing, onInput: (e) => this.updateIngredient(i, e.target.value) }), index.h("button", { type: "button", onClick: () => this.removeIngredient(i), "aria-label": "Remove" }, "\u2715")))), index.h("button", { key: 'fc7a817c01706f4f99594ff09a72fa8b046f4820', type: "button", class: "add-btn", onClick: this.addIngredient }, "+ Add ingredient"), this.errors.ingredients && index.h("span", { key: 'd4b4bee30e1369f951f0aabe7f54b0b1ae393a83', class: "error" }, this.errors.ingredients)), index.h("label", { key: '5028ae3ead65e280a2196f93d5f31580a5f8c95a' }, "Instructions", index.h("textarea", { key: '08461bc98ab47d1f2240dfa23e1ec1264de12002', rows: 5, onInput: (e) => (this.instructions = e.target.value) }, this.instructions), this.errors.instructions && index.h("span", { key: '932de400651f180d7e5b14e4ff118ccdcd24d2b3', class: "error" }, this.errors.instructions)), index.h("div", { key: '7da02b77a1390447a738882d0104292b28f675b0', class: "footer" }, index.h("slot", { key: '74ed118f385e1e6e1318dd405aa0008e195ef9c0', name: "footer" }), index.h("button", { key: 'e2548efd3826d3a984c11cd6d7bd486e226c8ca9', type: "button", class: "cancel-btn", onClick: () => this.cancel.emit() }, "Cancel"), index.h("button", { key: '8011e51d4579a0e6ddd88cd8c83708524551d801', type: "submit", class: "save-btn" }, "Save Recipe"))));
|
|
186
221
|
}
|
|
187
222
|
static get watchers() { return {
|
|
188
223
|
"initialData": [{
|
|
@@ -18,7 +18,7 @@ const AppToast = class {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
render() {
|
|
21
|
-
return (index.h("div", { key: '
|
|
21
|
+
return (index.h("div", { key: '40cf0d0171712b45dd8786bd69aa2f94a1fc7335', class: `toast ${this.type}` }, index.h("span", { key: '5256c39505158066715c94420ff65a479a7ab382' }, this.message), index.h("button", { key: '523f0f7617a902910d13179147ca75fa57499433', onClick: () => this.dismiss.emit(), "aria-label": "Dismiss" }, "\u2715")));
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
AppToast.style = appToastCss();
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -6,7 +6,7 @@ var appGlobals = require('./app-globals-V2Kpy_OQ.js');
|
|
|
6
6
|
const defineCustomElements = async (win, options) => {
|
|
7
7
|
if (typeof window === 'undefined') return undefined;
|
|
8
8
|
await appGlobals.globalScripts();
|
|
9
|
-
return index.bootstrapLazy([["app-modal_7.cjs",[[257,"app-modal",{"open":[4],"modalTitle":[1,"modal-title"]}],[1,"meal-plan-day",{"day":[1],"meals":[16],"icon":[1]}],[257,"recipe-card",{"recipeTitle":[1,"recipe-title"],"image":[1],"category":[1],"favorite":[4]}],[1,"recipe-filter-bar",{"categories":[16],"active":[1]}],[257,"recipe-form",{"initialData":[1,"initial-data"],"title":[32],"image":[32],"category":[32],"ingredients":[32],"instructions":[32],"errors":[32]},null,{"initialData":[{"onInitialDataChange":0}]}],[1,"recipe-rating",{"value":[2],"readonly":[4],"max":[2]}],[1,"recipe-search-bar",{"placeholder":[1],"value":[1],"debounceMs":[2,"debounce-ms"],"internalValue":[32]},null,{"value":[{"onValuePropChange":0}]}]]],["app-toast.cjs",[[1,"app-toast",{"message":[1],"type":[1],"duration":[2]}]]]], options);
|
|
9
|
+
return index.bootstrapLazy([["app-modal_7.cjs",[[257,"app-modal",{"open":[4],"modalTitle":[1,"modal-title"]}],[1,"meal-plan-day",{"day":[1],"meals":[16],"icon":[1]}],[257,"recipe-card",{"recipeTitle":[1,"recipe-title"],"image":[1],"category":[1],"favorite":[4]}],[1,"recipe-filter-bar",{"categories":[16],"active":[1]}],[257,"recipe-form",{"initialData":[1,"initial-data"],"areas":[16],"extraAreas":[16],"title":[32],"image":[32],"category":[32],"area":[32],"customArea":[32],"ingredients":[32],"instructions":[32],"errors":[32]},null,{"initialData":[{"onInitialDataChange":0}]}],[1,"recipe-rating",{"value":[2],"readonly":[4],"max":[2]}],[1,"recipe-search-bar",{"placeholder":[1],"value":[1],"debounceMs":[2,"debounce-ms"],"internalValue":[32]},null,{"value":[{"onValuePropChange":0}]}]]],["app-toast.cjs",[[1,"app-toast",{"message":[1],"type":[1],"duration":[2]}]]]], options);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
exports.setNonce = index.setNonce;
|
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["app-modal_7.cjs",[[257,"app-modal",{"open":[4],"modalTitle":[1,"modal-title"]}],[1,"meal-plan-day",{"day":[1],"meals":[16],"icon":[1]}],[257,"recipe-card",{"recipeTitle":[1,"recipe-title"],"image":[1],"category":[1],"favorite":[4]}],[1,"recipe-filter-bar",{"categories":[16],"active":[1]}],[257,"recipe-form",{"initialData":[1,"initial-data"],"title":[32],"image":[32],"category":[32],"ingredients":[32],"instructions":[32],"errors":[32]},null,{"initialData":[{"onInitialDataChange":0}]}],[1,"recipe-rating",{"value":[2],"readonly":[4],"max":[2]}],[1,"recipe-search-bar",{"placeholder":[1],"value":[1],"debounceMs":[2,"debounce-ms"],"internalValue":[32]},null,{"value":[{"onValuePropChange":0}]}]]],["app-toast.cjs",[[1,"app-toast",{"message":[1],"type":[1],"duration":[2]}]]]], options);
|
|
22
|
+
return index.bootstrapLazy([["app-modal_7.cjs",[[257,"app-modal",{"open":[4],"modalTitle":[1,"modal-title"]}],[1,"meal-plan-day",{"day":[1],"meals":[16],"icon":[1]}],[257,"recipe-card",{"recipeTitle":[1,"recipe-title"],"image":[1],"category":[1],"favorite":[4]}],[1,"recipe-filter-bar",{"categories":[16],"active":[1]}],[257,"recipe-form",{"initialData":[1,"initial-data"],"areas":[16],"extraAreas":[16],"title":[32],"image":[32],"category":[32],"area":[32],"customArea":[32],"ingredients":[32],"instructions":[32],"errors":[32]},null,{"initialData":[{"onInitialDataChange":0}]}],[1,"recipe-rating",{"value":[2],"readonly":[4],"max":[2]}],[1,"recipe-search-bar",{"placeholder":[1],"value":[1],"debounceMs":[2,"debounce-ms"],"internalValue":[32]},null,{"value":[{"onValuePropChange":0}]}]]],["app-toast.cjs",[[1,"app-toast",{"message":[1],"type":[1],"duration":[2]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -12,7 +12,7 @@ export class AppToast {
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
render() {
|
|
15
|
-
return (h("div", { key: '
|
|
15
|
+
return (h("div", { key: '40cf0d0171712b45dd8786bd69aa2f94a1fc7335', class: `toast ${this.type}` }, h("span", { key: '5256c39505158066715c94420ff65a479a7ab382' }, this.message), h("button", { key: '523f0f7617a902910d13179147ca75fa57499433', onClick: () => this.dismiss.emit(), "aria-label": "Dismiss" }, "\u2715")));
|
|
16
16
|
}
|
|
17
17
|
static get is() { return "app-toast"; }
|
|
18
18
|
static get encapsulation() { return "shadow"; }
|
|
@@ -53,7 +53,7 @@ export class MealPlanDay {
|
|
|
53
53
|
"references": {
|
|
54
54
|
"PlannedMeal": {
|
|
55
55
|
"location": "local",
|
|
56
|
-
"path": "C:/Users/gurpi/
|
|
56
|
+
"path": "C:/Users/gurpi/source/repos/Recipe-Finder/packages/recipe-ui/src/components/meal-plan-day/meal-plan-day.tsx",
|
|
57
57
|
"id": "src/components/meal-plan-day/meal-plan-day.tsx::PlannedMeal"
|
|
58
58
|
}
|
|
59
59
|
}
|
|
@@ -17,7 +17,7 @@ export class RecipeCard {
|
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
render() {
|
|
20
|
-
return (h("div", { key: '
|
|
20
|
+
return (h("div", { key: '72e604b38c4156bfe101f0609fac315cd317c981', class: "card", onClick: () => this.cardClick.emit() }, h("div", { key: 'bb707d57e573970201644e029eb6257e100e2276', class: "image-wrap" }, this.image ? h("img", { src: this.image, alt: this.recipeTitle }) : h("div", { class: "placeholder" }), h("button", { key: 'bb052a897f227e8b8ca938704a083d8502036037', class: { 'fav-btn': true, active: this.favorite }, onClick: this.onFavoriteClick, "aria-label": "Toggle favorite" }, this.favorite ? '★' : '☆')), h("div", { key: 'e4c139b9bdbdac25e92def0705d8506d89a0ce65', class: "body" }, h("h3", { key: 'aea91bd0827cdbe2608d91b428489a11eb7de0fa' }, this.recipeTitle), this.category && h("span", { key: '96219817064ee274999487452db6c70dee93d82f', class: "category" }, this.category), h("div", { key: 'c2593b0d879744a24c4be179af1d9359e3e904fa', class: "actions" }, h("slot", { key: '19e921048e6d469a33531c2bb949067a7925c7ac', name: "actions" })))));
|
|
21
21
|
}
|
|
22
22
|
static get is() { return "recipe-card"; }
|
|
23
23
|
static get encapsulation() { return "shadow"; }
|
|
@@ -15,7 +15,7 @@ export class RecipeFilterBar {
|
|
|
15
15
|
}
|
|
16
16
|
render() {
|
|
17
17
|
const cats = Array.isArray(this.categories) ? this.categories : [];
|
|
18
|
-
return (h("div", { key: '
|
|
18
|
+
return (h("div", { key: '336e3431325ab3338cda5be917414c6be4be1cf9', class: "wrap" }, h("button", { key: 'f1a5c228cf9ef1dd2017b26be55afdd07e27c837', class: { chip: true, active: this.active === '' }, onClick: () => this.select('') }, "All"), cats.map((c) => (h("button", { class: { chip: true, active: this.active === c }, onClick: () => this.select(c) }, c)))));
|
|
19
19
|
}
|
|
20
20
|
static get is() { return "recipe-filter-bar"; }
|
|
21
21
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,19 +1,141 @@
|
|
|
1
|
-
:host {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
font-family: system-ui, sans-serif;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
form {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
gap: 14px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
label {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
gap: 4px;
|
|
16
|
+
font-size: 13px;
|
|
17
|
+
color: #333;
|
|
18
|
+
font-weight: 600;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
input,
|
|
22
|
+
textarea,
|
|
23
|
+
select {
|
|
24
|
+
font-weight: 400;
|
|
25
|
+
padding: 8px 10px;
|
|
26
|
+
border: 1px solid #ddd;
|
|
27
|
+
border-radius: 6px;
|
|
28
|
+
font-size: 14px;
|
|
29
|
+
font-family: inherit;
|
|
30
|
+
background: #fff;
|
|
31
|
+
transition: border-color 0.15s ease, box-shadow 0.15s ease;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
input:focus,
|
|
35
|
+
textarea:focus,
|
|
36
|
+
select:focus {
|
|
37
|
+
outline: none;
|
|
38
|
+
border-color: #ff6b35;
|
|
39
|
+
box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.14);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
select {
|
|
43
|
+
appearance: none;
|
|
44
|
+
-webkit-appearance: none;
|
|
45
|
+
-moz-appearance: none;
|
|
46
|
+
padding-right: 34px;
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
color: #1f2937;
|
|
49
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
|
|
50
|
+
background-repeat: no-repeat;
|
|
51
|
+
background-position: right 10px center;
|
|
52
|
+
background-size: 14px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
select:hover {
|
|
56
|
+
border-color: #bbb;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
select:invalid,
|
|
60
|
+
select option[value=""] {
|
|
61
|
+
color: #9ca3af;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.row {
|
|
65
|
+
display: grid;
|
|
66
|
+
grid-template-columns: 1fr 1fr;
|
|
67
|
+
gap: 14px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@media (max-width: 480px) {
|
|
71
|
+
.row {
|
|
72
|
+
grid-template-columns: 1fr;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.field {
|
|
77
|
+
display: flex;
|
|
78
|
+
flex-direction: column;
|
|
79
|
+
gap: 6px;
|
|
80
|
+
font-size: 13px;
|
|
81
|
+
font-weight: 600;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.ingredient-row {
|
|
85
|
+
display: flex;
|
|
86
|
+
gap: 6px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.ingredient-row input {
|
|
90
|
+
flex: 1;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.ingredient-row button {
|
|
94
|
+
border: none;
|
|
95
|
+
background: #f4f4f4;
|
|
96
|
+
border-radius: 6px;
|
|
97
|
+
cursor: pointer;
|
|
98
|
+
width: 30px;
|
|
99
|
+
}
|
|
100
|
+
|
|
12
101
|
.add-btn {
|
|
13
|
-
align-self: flex-start;
|
|
14
|
-
|
|
102
|
+
align-self: flex-start;
|
|
103
|
+
border: 1px dashed #bbb;
|
|
104
|
+
background: none;
|
|
105
|
+
border-radius: 6px;
|
|
106
|
+
padding: 6px 10px;
|
|
107
|
+
cursor: pointer;
|
|
108
|
+
font-size: 13px;
|
|
109
|
+
color: #555;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.error {
|
|
113
|
+
color: #e74c3c;
|
|
114
|
+
font-size: 12px;
|
|
115
|
+
font-weight: 400;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.footer {
|
|
119
|
+
display: flex;
|
|
120
|
+
justify-content: flex-end;
|
|
121
|
+
gap: 10px;
|
|
122
|
+
margin-top: 6px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.cancel-btn {
|
|
126
|
+
border: 1px solid #ddd;
|
|
127
|
+
background: #fff;
|
|
128
|
+
border-radius: 8px;
|
|
129
|
+
padding: 8px 16px;
|
|
130
|
+
cursor: pointer;
|
|
15
131
|
}
|
|
16
|
-
|
|
17
|
-
.
|
|
18
|
-
|
|
19
|
-
|
|
132
|
+
|
|
133
|
+
.save-btn {
|
|
134
|
+
border: none;
|
|
135
|
+
background: #ff6b35;
|
|
136
|
+
color: #fff;
|
|
137
|
+
border-radius: 8px;
|
|
138
|
+
padding: 8px 18px;
|
|
139
|
+
cursor: pointer;
|
|
140
|
+
font-weight: 600;
|
|
141
|
+
}
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
const DEFAULT_AREAS = [
|
|
3
|
+
'American', 'British', 'Chinese', 'Croatian', 'Dutch', 'Egyptian',
|
|
4
|
+
'Filipino', 'French', 'Greek', 'Indian', 'Irish', 'Italian', 'Jamaican',
|
|
5
|
+
'Japanese', 'Kenyan', 'Malaysian', 'Mexican', 'Moroccan', 'Polish',
|
|
6
|
+
'Portuguese', 'Russian', 'Spanish', 'Thai', 'Tunisian', 'Turkish',
|
|
7
|
+
'Vietnamese', 'Other',
|
|
8
|
+
];
|
|
7
9
|
export class RecipeForm {
|
|
8
10
|
constructor() {
|
|
11
|
+
/** Full override of the cuisine dropdown options */
|
|
12
|
+
this.areas = DEFAULT_AREAS;
|
|
13
|
+
/** Additional cuisine options merged in before "Other" */
|
|
14
|
+
this.extraAreas = [];
|
|
9
15
|
this.title = '';
|
|
10
16
|
this.image = '';
|
|
11
17
|
this.category = '';
|
|
18
|
+
this.area = '';
|
|
19
|
+
this.customArea = '';
|
|
12
20
|
this.ingredients = [''];
|
|
13
21
|
this.instructions = '';
|
|
14
22
|
this.errors = {};
|
|
@@ -16,11 +24,13 @@ export class RecipeForm {
|
|
|
16
24
|
e.preventDefault();
|
|
17
25
|
if (!this.validate())
|
|
18
26
|
return;
|
|
27
|
+
const resolvedArea = this.area === 'Other' ? this.customArea.trim() : this.area;
|
|
19
28
|
const data = {
|
|
20
29
|
id: this.initialData?.id,
|
|
21
30
|
title: this.title.trim(),
|
|
22
31
|
image: this.image.trim(),
|
|
23
32
|
category: this.category.trim(),
|
|
33
|
+
area: resolvedArea,
|
|
24
34
|
ingredients: this.ingredients.map((i) => i.trim()).filter(Boolean),
|
|
25
35
|
instructions: this.instructions.trim(),
|
|
26
36
|
};
|
|
@@ -39,6 +49,16 @@ export class RecipeForm {
|
|
|
39
49
|
onInitialDataChange() {
|
|
40
50
|
this.loadInitialData();
|
|
41
51
|
}
|
|
52
|
+
get fullAreaList() {
|
|
53
|
+
const withoutOther = this.areas.filter((a) => a !== 'Other');
|
|
54
|
+
const merged = [...withoutOther];
|
|
55
|
+
for (const extra of this.extraAreas) {
|
|
56
|
+
if (extra && !merged.includes(extra))
|
|
57
|
+
merged.push(extra);
|
|
58
|
+
}
|
|
59
|
+
merged.push('Other');
|
|
60
|
+
return merged;
|
|
61
|
+
}
|
|
42
62
|
loadInitialData() {
|
|
43
63
|
let data;
|
|
44
64
|
if (typeof this.initialData === 'string' && this.initialData) {
|
|
@@ -58,19 +78,29 @@ export class RecipeForm {
|
|
|
58
78
|
this.category = data.category ?? '';
|
|
59
79
|
this.ingredients = data.ingredients?.length ? [...data.ingredients] : [''];
|
|
60
80
|
this.instructions = data.instructions ?? '';
|
|
81
|
+
const knownAreas = this.fullAreaList.filter((a) => a !== 'Other');
|
|
82
|
+
if (data.area && !knownAreas.includes(data.area)) {
|
|
83
|
+
this.area = 'Other';
|
|
84
|
+
this.customArea = data.area;
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
this.area = data.area ?? '';
|
|
88
|
+
this.customArea = '';
|
|
89
|
+
}
|
|
61
90
|
}
|
|
62
91
|
}
|
|
63
92
|
validate() {
|
|
64
93
|
const errors = {};
|
|
65
94
|
if (!this.title.trim())
|
|
66
95
|
errors.title = 'Title is required.';
|
|
67
|
-
if (!this.category.trim())
|
|
68
|
-
errors.category = 'Category is required.';
|
|
69
96
|
const cleanIngredients = this.ingredients.map((i) => i.trim()).filter(Boolean);
|
|
70
97
|
if (cleanIngredients.length === 0)
|
|
71
98
|
errors.ingredients = 'Add at least one ingredient.';
|
|
72
99
|
if (!this.instructions.trim())
|
|
73
100
|
errors.instructions = 'Instructions are required.';
|
|
101
|
+
if (this.area === 'Other' && !this.customArea.trim()) {
|
|
102
|
+
errors.customArea = 'Enter a cuisine name.';
|
|
103
|
+
}
|
|
74
104
|
this.errors = errors;
|
|
75
105
|
return Object.keys(errors).length === 0;
|
|
76
106
|
}
|
|
@@ -80,7 +110,7 @@ export class RecipeForm {
|
|
|
80
110
|
this.ingredients = next;
|
|
81
111
|
}
|
|
82
112
|
render() {
|
|
83
|
-
return (h("form", { key: '
|
|
113
|
+
return (h("form", { key: 'b9e50e96b20b8f3bb28ecb516b102c87088daddd', onSubmit: this.onSubmit }, h("slot", { key: '648424eb3444acdacb69e541799571ffa6572004', name: "header" }), h("label", { key: '77ec1e8acd2ba845262909f672fadf06907702f2' }, "Title", h("input", { key: '2f5dd98ab985831eb07ac43afed983908f2646d1', type: "text", value: this.title, onInput: (e) => (this.title = e.target.value) }), this.errors.title && h("span", { key: '244560b4dc4cb47cbb514d0f8fe41be267299885', class: "error" }, this.errors.title)), h("label", { key: '8bb49420325a7629186a5801162b9a2e4321e4f7' }, "Image URL", h("input", { key: 'fe121c2389308b5bc0e6f7b977f15fec91f9baae', type: "text", value: this.image, onInput: (e) => (this.image = e.target.value) })), h("div", { key: '2ede3939f5230f805841945a29fc37fc4d2f3627', class: "row" }, h("label", { key: 'b736ee46a12a1070cb52c76fc41d31e0f8d1169b' }, "Category", h("input", { key: '6952f8378b13313c1c63d2cb1b1cd9c2593d1806', type: "text", value: this.category, onInput: (e) => (this.category = e.target.value) })), h("label", { key: 'a6e477f0bfdfbab6a75831a62334b665272a98db' }, "Cuisine / Area", h("select", { key: '1434d68a1782d19f92cd2d5ef638f440a8adc7dd', onInput: (e) => (this.area = e.target.value) }, h("option", { key: 'a40b1cacf4deb98590689325f23e572522069268', value: "", selected: this.area === '' }, "Select a cuisine\u2026"), this.fullAreaList.map((a) => (h("option", { value: a, selected: a === this.area }, a)))))), this.area === 'Other' && (h("label", { key: '77ab0849f544aacc7c2a207dc222c916dfb7a41b', class: "custom-area-field" }, "Enter cuisine name", h("input", { key: 'fd7c97a89c0e2b8f23cc28fbc502563eb759fdb4', type: "text", placeholder: "e.g. Ethiopian", value: this.customArea, onInput: (e) => (this.customArea = e.target.value) }), this.errors.customArea && h("span", { key: '2b2425b63b0d5ee311fe16040d012a43919c8ca6', class: "error" }, this.errors.customArea))), h("div", { key: 'fafa1824f121c9c2c96069772d2011a13ce0683f', class: "field" }, h("span", { key: 'bea9e5877093e412b1fffb12f0aad4c79604cc16' }, "Ingredients"), this.ingredients.map((ing, i) => (h("div", { class: "ingredient-row" }, h("input", { type: "text", value: ing, onInput: (e) => this.updateIngredient(i, e.target.value) }), h("button", { type: "button", onClick: () => this.removeIngredient(i), "aria-label": "Remove" }, "\u2715")))), h("button", { key: 'fc7a817c01706f4f99594ff09a72fa8b046f4820', type: "button", class: "add-btn", onClick: this.addIngredient }, "+ Add ingredient"), this.errors.ingredients && h("span", { key: 'd4b4bee30e1369f951f0aabe7f54b0b1ae393a83', class: "error" }, this.errors.ingredients)), h("label", { key: '5028ae3ead65e280a2196f93d5f31580a5f8c95a' }, "Instructions", h("textarea", { key: '08461bc98ab47d1f2240dfa23e1ec1264de12002', rows: 5, onInput: (e) => (this.instructions = e.target.value) }, this.instructions), this.errors.instructions && h("span", { key: '932de400651f180d7e5b14e4ff118ccdcd24d2b3', class: "error" }, this.errors.instructions)), h("div", { key: '7da02b77a1390447a738882d0104292b28f675b0', class: "footer" }, h("slot", { key: '74ed118f385e1e6e1318dd405aa0008e195ef9c0', name: "footer" }), h("button", { key: 'e2548efd3826d3a984c11cd6d7bd486e226c8ca9', type: "button", class: "cancel-btn", onClick: () => this.cancel.emit() }, "Cancel"), h("button", { key: '8011e51d4579a0e6ddd88cd8c83708524551d801', type: "submit", class: "save-btn" }, "Save Recipe"))));
|
|
84
114
|
}
|
|
85
115
|
static get is() { return "recipe-form"; }
|
|
86
116
|
static get encapsulation() { return "shadow"; }
|
|
@@ -105,7 +135,7 @@ export class RecipeForm {
|
|
|
105
135
|
"references": {
|
|
106
136
|
"RecipeFormData": {
|
|
107
137
|
"location": "local",
|
|
108
|
-
"path": "C:/Users/gurpi/
|
|
138
|
+
"path": "C:/Users/gurpi/source/repos/Recipe-Finder/packages/recipe-ui/src/components/recipe-form/recipe-form.tsx",
|
|
109
139
|
"id": "src/components/recipe-form/recipe-form.tsx::RecipeFormData"
|
|
110
140
|
}
|
|
111
141
|
}
|
|
@@ -114,12 +144,48 @@ export class RecipeForm {
|
|
|
114
144
|
"optional": false,
|
|
115
145
|
"docs": {
|
|
116
146
|
"tags": [],
|
|
117
|
-
"text": "
|
|
147
|
+
"text": ""
|
|
118
148
|
},
|
|
119
149
|
"getter": false,
|
|
120
150
|
"setter": false,
|
|
121
151
|
"reflect": false,
|
|
122
152
|
"attribute": "initial-data"
|
|
153
|
+
},
|
|
154
|
+
"areas": {
|
|
155
|
+
"type": "unknown",
|
|
156
|
+
"mutable": false,
|
|
157
|
+
"complexType": {
|
|
158
|
+
"original": "string[]",
|
|
159
|
+
"resolved": "string[]",
|
|
160
|
+
"references": {}
|
|
161
|
+
},
|
|
162
|
+
"required": false,
|
|
163
|
+
"optional": false,
|
|
164
|
+
"docs": {
|
|
165
|
+
"tags": [],
|
|
166
|
+
"text": "Full override of the cuisine dropdown options"
|
|
167
|
+
},
|
|
168
|
+
"getter": false,
|
|
169
|
+
"setter": false,
|
|
170
|
+
"defaultValue": "[\n 'American', 'British', 'Chinese', 'Croatian', 'Dutch', 'Egyptian',\n 'Filipino', 'French', 'Greek', 'Indian', 'Irish', 'Italian', 'Jamaican',\n 'Japanese', 'Kenyan', 'Malaysian', 'Mexican', 'Moroccan', 'Polish',\n 'Portuguese', 'Russian', 'Spanish', 'Thai', 'Tunisian', 'Turkish',\n 'Vietnamese', 'Other',\n]"
|
|
171
|
+
},
|
|
172
|
+
"extraAreas": {
|
|
173
|
+
"type": "unknown",
|
|
174
|
+
"mutable": false,
|
|
175
|
+
"complexType": {
|
|
176
|
+
"original": "string[]",
|
|
177
|
+
"resolved": "string[]",
|
|
178
|
+
"references": {}
|
|
179
|
+
},
|
|
180
|
+
"required": false,
|
|
181
|
+
"optional": false,
|
|
182
|
+
"docs": {
|
|
183
|
+
"tags": [],
|
|
184
|
+
"text": "Additional cuisine options merged in before \"Other\""
|
|
185
|
+
},
|
|
186
|
+
"getter": false,
|
|
187
|
+
"setter": false,
|
|
188
|
+
"defaultValue": "[]"
|
|
123
189
|
}
|
|
124
190
|
};
|
|
125
191
|
}
|
|
@@ -128,6 +194,8 @@ export class RecipeForm {
|
|
|
128
194
|
"title": {},
|
|
129
195
|
"image": {},
|
|
130
196
|
"category": {},
|
|
197
|
+
"area": {},
|
|
198
|
+
"customArea": {},
|
|
131
199
|
"ingredients": {},
|
|
132
200
|
"instructions": {},
|
|
133
201
|
"errors": {}
|
|
@@ -150,7 +218,7 @@ export class RecipeForm {
|
|
|
150
218
|
"references": {
|
|
151
219
|
"RecipeFormData": {
|
|
152
220
|
"location": "local",
|
|
153
|
-
"path": "C:/Users/gurpi/
|
|
221
|
+
"path": "C:/Users/gurpi/source/repos/Recipe-Finder/packages/recipe-ui/src/components/recipe-form/recipe-form.tsx",
|
|
154
222
|
"id": "src/components/recipe-form/recipe-form.tsx::RecipeFormData"
|
|
155
223
|
}
|
|
156
224
|
}
|
|
@@ -8,7 +8,7 @@ export class RecipeRating {
|
|
|
8
8
|
}
|
|
9
9
|
render() {
|
|
10
10
|
const stars = Array.from({ length: this.max }, (_, i) => i + 1);
|
|
11
|
-
return (h("div", { key: '
|
|
11
|
+
return (h("div", { key: '9e67a7c471e6b20bbc2bc0164a5346c8cd5f10dc', class: "wrap", role: this.readonly ? undefined : 'radiogroup' }, stars.map((s) => (h("span", { class: { star: true, filled: s <= this.value, clickable: !this.readonly }, onClick: () => !this.readonly && this.ratingChange.emit({ value: s }) }, "\u2605")))));
|
|
12
12
|
}
|
|
13
13
|
static get is() { return "recipe-rating"; }
|
|
14
14
|
static get encapsulation() { return "shadow"; }
|
|
@@ -30,7 +30,7 @@ export class RecipeSearchBar {
|
|
|
30
30
|
this.internalValue = newVal;
|
|
31
31
|
}
|
|
32
32
|
render() {
|
|
33
|
-
return (h("div", { key: '
|
|
33
|
+
return (h("div", { key: '7fa4a3ce06ef9b7e68b968a0bf29cce896cc7db0', class: "wrap" }, h("input", { key: 'ae2e528fafd1f342de8a88c14f0651857bc0486d', type: "search", placeholder: this.placeholder, value: this.internalValue, onInput: this.onInput, onKeyDown: this.onKeyDown }), h("button", { key: 'c9a369dca794014f17cd64cfaa4b7b9f0e06d171', onClick: () => this.search.emit({ value: this.internalValue }), "aria-label": "Search" }, "\uD83D\uDD0D")));
|
|
34
34
|
}
|
|
35
35
|
static get is() { return "recipe-search-bar"; }
|
|
36
36
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as o,d as s}from"./p-
|
|
1
|
+
import{A as o,d as s}from"./p-BzvqJQ_R.js";const p=o,r=s;export{p as AppToast,r as defineCustomElement}
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{g as getAssetPath,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions}from"./p-BJU3HdRm.js";export{R as RecipeCard}from"./p-
|
|
1
|
+
export{g as getAssetPath,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions}from"./p-BJU3HdRm.js";export{R as RecipeCard}from"./p-Cn_qfIvv.js";export{R as RecipeSearchBar}from"./p-K-btCLSj.js";export{R as RecipeFilterBar}from"./p-B92NkO3p.js";export{R as RecipeRating}from"./p-mY_lBX8M.js";export{R as RecipeForm}from"./p-u-o4onHp.js";export{M as MealPlanDay}from"./p-S4266va_.js";export{A as AppModal}from"./p-Dp1sKtrN.js";export{A as AppToast}from"./p-BzvqJQ_R.js";
|