@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260715103126 → 0.8.1-dev.20260721123022

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,677 @@
1
+ "use client";
2
+
3
+ "use client";
4
+ import {
5
+ AssetUtility_default,
6
+ BooleanSelect_default,
7
+ CheckboxInput_default,
8
+ ColorInput_default,
9
+ DateTimeInput_default,
10
+ EmailInput_default,
11
+ LineTextInput_default,
12
+ MoneyInput_default,
13
+ MultilineTextInput_default,
14
+ NumberInput_default,
15
+ OtpInput_default,
16
+ PercentageInput_default,
17
+ PhoneInput_default,
18
+ SelectWithSearchInput_default,
19
+ TimeInput_default
20
+ } from "./chunk-3R4VVVNK.mjs";
21
+ import {
22
+ Hyperlink,
23
+ Icon_default,
24
+ InputControlType_default
25
+ } from "./chunk-5GHPW7SJ.mjs";
26
+ import {
27
+ Button_default,
28
+ ClientButton_default
29
+ } from "./chunk-JKP4XOZB.mjs";
30
+ import "./chunk-IMNQO57B.mjs";
31
+
32
+ // src/components/controls/edit/InputControlClient.tsx
33
+ import React5 from "react";
34
+
35
+ // src/components/controls/edit/Select.tsx
36
+ import { useState, useEffect } from "react";
37
+ import { jsx, jsxs } from "react/jsx-runtime";
38
+ var Select = (props) => {
39
+ const [list, setList] = useState([]);
40
+ const getSafeValue = (val) => {
41
+ if (val === null || val === void 0) return "";
42
+ if (typeof val === "boolean") return val ? "1" : "0";
43
+ return val;
44
+ };
45
+ const textChangeHandler = (event) => {
46
+ let rawValue = event.target.value;
47
+ if (rawValue === "") rawValue = null;
48
+ let finalValue = rawValue;
49
+ if (list && props.dataKeyFieldName) {
50
+ const key = props.dataKeyFieldName;
51
+ const selectedItem = list.find(
52
+ (item) => String(item[key]) === String(rawValue)
53
+ );
54
+ if (selectedItem) {
55
+ const keyValue = selectedItem[key];
56
+ if (typeof keyValue === "number") {
57
+ finalValue = Number(rawValue);
58
+ }
59
+ }
60
+ }
61
+ props.callback?.({
62
+ name: props.name,
63
+ value: finalValue,
64
+ index: props.index,
65
+ groupKey: props.groupKey
66
+ });
67
+ };
68
+ useEffect(() => {
69
+ async function fetchData() {
70
+ if (props.dataset) {
71
+ setList(props.dataset);
72
+ return;
73
+ }
74
+ if (props.dataSource && props.serviceClient) {
75
+ let dataSource = props.dataSource;
76
+ let response;
77
+ if (props.dataSourceDependsOn && props.dependentValue) {
78
+ dataSource = dataSource.replace(
79
+ `{${props.dataSourceDependsOn}}`,
80
+ props.dependentValue
81
+ );
82
+ }
83
+ response = await props.serviceClient.get(dataSource);
84
+ setList(response.result ?? []);
85
+ }
86
+ }
87
+ fetchData();
88
+ }, [
89
+ props.dataset,
90
+ props.dataSource,
91
+ props.dependentValue,
92
+ props.dataSourceDependsOn
93
+ ]);
94
+ const value = getSafeValue(props.value);
95
+ return /* @__PURE__ */ jsxs("label", { className: "block", children: [
96
+ props.attributes?.label && /* @__PURE__ */ jsx("span", { className: "text-sm font-medium inline-block pb-1", children: props.attributes?.label }),
97
+ " ",
98
+ props.attributes?.label && props.attributes?.required && /* @__PURE__ */ jsx("span", { className: "bg-error-weak", children: "*" }),
99
+ /* @__PURE__ */ jsxs(
100
+ "select",
101
+ {
102
+ name: props.name,
103
+ id: props.name,
104
+ value,
105
+ onChange: textChangeHandler,
106
+ required: props.attributes?.required,
107
+ disabled: props.attributes?.readOnly,
108
+ className: "peer select py-1.5 block w-full text-black rounded border-gray-300 shadow-sm\r\n focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50\r\n disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none",
109
+ children: [
110
+ /* @__PURE__ */ jsx("option", { value: "", children: props.attributes?.placeholder || "Select" }),
111
+ list.map((item, index) => {
112
+ const keyField = props.dataKeyFieldName;
113
+ const textField = props.dataTextFieldName;
114
+ return /* @__PURE__ */ jsx("option", { value: item[keyField], children: item[textField] }, index);
115
+ })
116
+ ]
117
+ }
118
+ ),
119
+ /* @__PURE__ */ jsx("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 text-alert text-sm", children: props.attributes?.errorMessage || "" })
120
+ ] });
121
+ };
122
+ var Select_default = Select;
123
+
124
+ // src/components/controls/edit/SelectWithSearchPanel.tsx
125
+ import React2, {
126
+ useEffect as useEffect2,
127
+ useRef,
128
+ useState as useState2,
129
+ useCallback
130
+ } from "react";
131
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
132
+ var SelectWithSearchPanel = (props) => {
133
+ const [isOpen, setIsOpen] = useState2(false);
134
+ const [searchTerm, setSearchTerm] = useState2("");
135
+ const [highlightedIndex, setHighlightedIndex] = useState2(0);
136
+ const [list, setList] = useState2([]);
137
+ const listRef = useRef(null);
138
+ const [isError, setIsError] = useState2(false);
139
+ const containerRef = useRef(null);
140
+ const [isCreateOpen, setIsCreateOpen] = useState2(false);
141
+ const [formData, setFormData] = useState2({});
142
+ const getNestedValue = (obj, path) => {
143
+ return path.split(".").reduce((acc, key) => acc?.[key], obj);
144
+ };
145
+ useEffect2(() => {
146
+ const handleClickOutside = (event) => {
147
+ if (containerRef.current && !containerRef.current.contains(event.target)) {
148
+ setIsOpen(false);
149
+ }
150
+ };
151
+ document.addEventListener("mousedown", handleClickOutside);
152
+ return () => {
153
+ document.removeEventListener("mousedown", handleClickOutside);
154
+ };
155
+ }, []);
156
+ useEffect2(() => {
157
+ async function fetchData() {
158
+ if (props.dataset) {
159
+ setList(props.dataset);
160
+ } else if (props.dataSource && props.serviceClient) {
161
+ let dataSource = props.dataSource;
162
+ if (props.dataSourceDependsOn && props.dependentValue) {
163
+ dataSource = dataSource.replace(
164
+ `{${props.dataSourceDependsOn}}`,
165
+ props.dependentValue
166
+ );
167
+ }
168
+ const response = await props.serviceClient.get(dataSource);
169
+ if (response?.result) setList(response.result);
170
+ }
171
+ }
172
+ fetchData();
173
+ }, [
174
+ props.dataSource,
175
+ props.dependentValue,
176
+ props.dataset,
177
+ props.dataSourceDependsOn
178
+ ]);
179
+ const filteredItems = list?.filter((item) => {
180
+ const value = getNestedValue(item, props.dataTextFieldName);
181
+ return value?.toLowerCase().includes(searchTerm?.toLowerCase());
182
+ });
183
+ const playBeep = () => {
184
+ const audioCtx = new (window.AudioContext || window.webkitAudioContext)();
185
+ const oscillator = audioCtx.createOscillator();
186
+ const gainNode = audioCtx.createGain();
187
+ oscillator.type = "square";
188
+ oscillator.frequency.setValueAtTime(300, audioCtx.currentTime);
189
+ gainNode.gain.setValueAtTime(0.02, audioCtx.currentTime);
190
+ oscillator.connect(gainNode);
191
+ gainNode.connect(audioCtx.destination);
192
+ oscillator.start();
193
+ setTimeout(() => {
194
+ oscillator.stop();
195
+ audioCtx.close();
196
+ }, 250);
197
+ };
198
+ useEffect2(() => {
199
+ const filteredItems2 = list?.filter(
200
+ (item) => item[props?.dataTextFieldName]?.toLowerCase().includes(searchTerm?.toLowerCase())
201
+ );
202
+ if (searchTerm.length > 0 && filteredItems2.length === 0) {
203
+ playBeep();
204
+ setIsError(true);
205
+ } else {
206
+ setIsError(false);
207
+ }
208
+ }, [searchTerm]);
209
+ const handleSelect = (event, item) => {
210
+ event.preventDefault();
211
+ setSearchTerm(getNestedValue(item, props.dataTextFieldName));
212
+ if (props.callback) {
213
+ const val = {};
214
+ props.callback({
215
+ name: props.name,
216
+ value: item[props.dataKeyFieldName],
217
+ index: props.index,
218
+ groupKey: props.groupKey
219
+ });
220
+ }
221
+ setHighlightedIndex(0);
222
+ setIsOpen(false);
223
+ };
224
+ const handleKeyDown = (e) => {
225
+ if (e.key === "Escape") {
226
+ setIsOpen(false);
227
+ setHighlightedIndex(-1);
228
+ } else if (e.key === "ArrowDown") {
229
+ e.preventDefault();
230
+ setHighlightedIndex((prev) => {
231
+ const nextIndex = prev < filteredItems.length - 1 ? prev + 1 : prev;
232
+ scrollIntoView(nextIndex);
233
+ return nextIndex;
234
+ });
235
+ } else if (e.key === "ArrowUp") {
236
+ e.preventDefault();
237
+ setHighlightedIndex((prev) => {
238
+ const prevIndex = prev > 0 ? prev - 1 : prev;
239
+ scrollIntoView(prevIndex);
240
+ return prevIndex;
241
+ });
242
+ } else if (e.key === "Enter" && highlightedIndex >= 0) {
243
+ handleSelect(e, filteredItems[highlightedIndex]);
244
+ }
245
+ };
246
+ const scrollIntoView = (index) => {
247
+ if (listRef.current) {
248
+ const item = listRef.current.children[index];
249
+ if (item) {
250
+ item.scrollIntoView();
251
+ }
252
+ }
253
+ };
254
+ const textChangeHandler = (event) => {
255
+ const newSearchTerm = event.target.value;
256
+ setSearchTerm(newSearchTerm);
257
+ setIsOpen(true);
258
+ setHighlightedIndex(0);
259
+ };
260
+ const handleInputChange = (event, field) => {
261
+ setFormData((prev) => ({ ...prev, [field]: event.target.value }));
262
+ };
263
+ const handleSaveModal = useCallback(async () => {
264
+ console.log("Form Data:", formData);
265
+ return formData;
266
+ }, []);
267
+ return /* @__PURE__ */ jsxs2("div", { className: "relative", children: [
268
+ /* @__PURE__ */ jsxs2("label", { className: "text-sm mb-1 font-medium", children: [
269
+ props.attributes?.label,
270
+ " ",
271
+ " ",
272
+ props?.attributes?.required && /* @__PURE__ */ jsx2("span", { className: "bg-error-weak", children: "*" })
273
+ ] }),
274
+ /* @__PURE__ */ jsx2("div", { children: /* @__PURE__ */ jsx2(
275
+ "input",
276
+ {
277
+ type: "text",
278
+ value: searchTerm,
279
+ onChange: textChangeHandler,
280
+ onFocus: () => setIsOpen(true),
281
+ onKeyDown: handleKeyDown,
282
+ placeholder: props.attributes?.placeholder,
283
+ className: `peer mt-1 py-1.5 block w-full text-black rounded border-gray-300 shadow-sm
284
+ ${isError ? "focus:border-red-300 focus:ring focus:ring-red-200 focus:ring-opacity-50" : "focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50"}
285
+ disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none`
286
+ }
287
+ ) }),
288
+ /* @__PURE__ */ jsx2("div", { ref: containerRef, children: isOpen && /* @__PURE__ */ jsxs2(React2.Fragment, { children: [
289
+ /* @__PURE__ */ jsxs2("div", { className: "fixed z-50 right-0 bg-white top-[62px] w-1/4 border-l border-gray-200", children: [
290
+ /* @__PURE__ */ jsx2("div", { className: "flex flex-col p-2 bg-accent-950 text-white", children: /* @__PURE__ */ jsxs2("h5", { className: "text-md text-white font-medium", children: [
291
+ "Select a",
292
+ " ",
293
+ props.attributes?.label || props.attributes?.heading
294
+ ] }) }),
295
+ /* @__PURE__ */ jsx2("div", { className: "flex justify-end px-4 border-b py-2 border-gray-200 h-10", children: props.createFields && props.createFields.length > 0 && /* @__PURE__ */ jsx2(
296
+ "button",
297
+ {
298
+ type: "button",
299
+ className: "text-primary hover:text-primary-800",
300
+ onMouseDown: (e) => {
301
+ e.preventDefault();
302
+ setIsCreateOpen(true);
303
+ },
304
+ children: "Create"
305
+ }
306
+ ) })
307
+ ] }),
308
+ isCreateOpen && /* @__PURE__ */ jsxs2("div", { className: "fixed right-0 w-1/4 h-full top-[62px] bg-white shadow-lg border-l border-gray-200 z-50", children: [
309
+ /* @__PURE__ */ jsx2("div", { className: "flex flex-col p-2 bg-accent-950", children: /* @__PURE__ */ jsxs2("h5", { className: "text-md font-medium text-white", children: [
310
+ "Create New ",
311
+ props.attributes?.label
312
+ ] }) }),
313
+ /* @__PURE__ */ jsx2("div", { className: "flex justify-end px-4 border-b py-2 border-gray-200", children: /* @__PURE__ */ jsx2(
314
+ "button",
315
+ {
316
+ type: "button",
317
+ onClick: () => setIsCreateOpen(false),
318
+ className: "text-red-600 hover:text-red-800",
319
+ children: "Close"
320
+ }
321
+ ) }),
322
+ /* @__PURE__ */ jsxs2("div", { className: "p-4", children: [
323
+ props.createFields?.map((field) => /* @__PURE__ */ jsxs2("div", { className: "mb-4", children: [
324
+ /* @__PURE__ */ jsx2("label", { className: "text-sm mb-1 font-medium block", children: field.label }),
325
+ /* @__PURE__ */ jsx2(
326
+ "input",
327
+ {
328
+ type: field.type,
329
+ value: formData[field.name] || "",
330
+ onChange: (e) => handleInputChange(e, field.name),
331
+ placeholder: field.placeholder,
332
+ required: field.required,
333
+ disabled: field.disabled,
334
+ pattern: field.pattern,
335
+ minLength: field.minLength,
336
+ maxLength: field.maxLength,
337
+ className: "peer mt-1 py-1.5 block w-full text-black rounded border-gray-300 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50"
338
+ }
339
+ )
340
+ ] }, field.name)),
341
+ /* @__PURE__ */ jsxs2(Button_default, { onClick: async () => {
342
+ handleSaveModal();
343
+ return { isSuccessful: true };
344
+ }, className: "w-full", children: [
345
+ "Save ",
346
+ props.attributes?.label
347
+ ] })
348
+ ] })
349
+ ] }),
350
+ /* @__PURE__ */ jsx2(
351
+ "div",
352
+ {
353
+ ref: listRef,
354
+ className: "fixed z-10 right-0 mt-[130px] top-0 w-1/4 bg-white border-l border-gray-200 shadow-lg overflow-y-auto",
355
+ style: { height: "calc(100vh - 130px)" },
356
+ children: filteredItems.length > 0 ? filteredItems.map((item, index) => /* @__PURE__ */ jsx2("div", { children: /* @__PURE__ */ jsx2(
357
+ "button",
358
+ {
359
+ onClick: (e) => {
360
+ handleSelect(e, item);
361
+ },
362
+ className: `w-full px-4 py-2 flex items-center space-x-2 text-left border-b border-gray-200 ${index === highlightedIndex ? "bg-gray-200" : "hover:bg-gray-100"}`,
363
+ role: "option",
364
+ tabIndex: -1,
365
+ onMouseEnter: () => setHighlightedIndex(index),
366
+ children: /* @__PURE__ */ jsx2("span", { children: getNestedValue(item, props.dataTextFieldName) })
367
+ }
368
+ ) }, item[props.dataKeyFieldName])) : /* @__PURE__ */ jsx2("div", { className: "px-4 py-2 text-gray-500", children: "No results found" })
369
+ }
370
+ )
371
+ ] }) })
372
+ ] });
373
+ };
374
+ var SelectWithSearchPanel_default = SelectWithSearchPanel;
375
+
376
+ // src/components/controls/edit/AssetUpload.tsx
377
+ import React3, { useEffect as useEffect3 } from "react";
378
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
379
+ var AssetUpload = (props) => {
380
+ const isDisabled = props.attributes?.disable ?? false;
381
+ let allValues = [];
382
+ if (props.value !== void 0 && props.value !== null && props.value !== "") {
383
+ try {
384
+ allValues = JSON.parse(props.value.toString());
385
+ } catch (error) {
386
+ }
387
+ }
388
+ const getInitialTab = () => {
389
+ if (allValues.length > 0) {
390
+ const asset = allValues[0];
391
+ if (asset.posterUrl) {
392
+ return "video";
393
+ } else if (asset.assetUrl) {
394
+ return "image";
395
+ }
396
+ }
397
+ return "image";
398
+ };
399
+ const [assetType, setAssetType] = React3.useState(getInitialTab);
400
+ useEffect3(() => {
401
+ setAssetType(getInitialTab());
402
+ }, [props.value]);
403
+ const assetUploadCallback = (newAsset) => {
404
+ if (isDisabled) return;
405
+ let updated = [];
406
+ updated.push({
407
+ assetUrl: newAsset.assetUrl,
408
+ title: newAsset.title,
409
+ posterUrl: newAsset.posterUrl,
410
+ intrinsicHeight: newAsset.intrinsicHeight,
411
+ intrinsicWidth: newAsset.intrinsicWidth
412
+ });
413
+ props.callback?.({
414
+ name: props.name,
415
+ value: JSON.stringify(updated),
416
+ index: props.index,
417
+ groupKey: props.groupKey
418
+ });
419
+ };
420
+ const deleteFile = (index) => {
421
+ if (isDisabled) return;
422
+ let existingValue = [];
423
+ if (props.value) {
424
+ try {
425
+ existingValue = JSON.parse(props.value.toString());
426
+ } catch (error) {
427
+ }
428
+ }
429
+ if (existingValue.length > index) {
430
+ existingValue.splice(index, 1);
431
+ props.callback?.({
432
+ name: props.name,
433
+ value: JSON.stringify(existingValue),
434
+ index: props.index,
435
+ groupKey: props.groupKey
436
+ });
437
+ }
438
+ };
439
+ const textChangeHandler = (index, event) => {
440
+ if (isDisabled) return;
441
+ let existingValue = [];
442
+ if (props.value) {
443
+ try {
444
+ existingValue = JSON.parse(props.value.toString());
445
+ } catch (error) {
446
+ }
447
+ }
448
+ const text = event.target.value;
449
+ if (existingValue.length > index) {
450
+ const updatedArray = [...existingValue];
451
+ updatedArray[index] = { ...updatedArray[index], title: text };
452
+ props.callback?.({
453
+ name: props.name,
454
+ value: JSON.stringify(updatedArray),
455
+ index: props.index,
456
+ groupKey: props.groupKey
457
+ });
458
+ }
459
+ };
460
+ const getAssetType = (asset) => {
461
+ if (asset.assetUrl?.endsWith(".m3u8") || asset.posterUrl) return "video";
462
+ return "image";
463
+ };
464
+ const shouldShowDetails = () => {
465
+ if (allValues.length === 0) return false;
466
+ const asset = allValues[0];
467
+ if (assetType === "video") {
468
+ return Boolean(asset.posterUrl && asset.assetUrl && asset.assetUrl.endsWith(".m3u8"));
469
+ }
470
+ if (assetType === "image") {
471
+ return Boolean(asset.assetUrl && !asset.assetUrl.endsWith(".m3u8"));
472
+ }
473
+ return false;
474
+ };
475
+ return /* @__PURE__ */ jsxs3(React3.Fragment, { children: [
476
+ /* @__PURE__ */ jsx3("label", { className: "block mb-1", children: /* @__PURE__ */ jsx3("span", { className: "text-sm font-medium", children: props?.attributes?.label }) }),
477
+ /* @__PURE__ */ jsxs3("div", { className: "flex gap-6 bg-neutral-100 rounded p-2", children: [
478
+ /* @__PURE__ */ jsx3(
479
+ ClientButton_default,
480
+ {
481
+ className: assetType === "image" ? "px-2 py-1 rounded bg-body-200 scale-95" : "text-neutral-700",
482
+ ButtonType: "Link" /* Link */,
483
+ onClick: () => setAssetType("image"),
484
+ disabled: isDisabled,
485
+ children: "Image Upload"
486
+ }
487
+ ),
488
+ /* @__PURE__ */ jsx3(
489
+ ClientButton_default,
490
+ {
491
+ className: assetType === "video" ? "bg-body-200 px-2 py-1 rounded-md scale-95" : "text-neutral-700",
492
+ ButtonType: "Link" /* Link */,
493
+ onClick: () => setAssetType("video"),
494
+ disabled: isDisabled,
495
+ children: "Video Upload"
496
+ }
497
+ )
498
+ ] }),
499
+ shouldShowDetails() && /* @__PURE__ */ jsxs3("div", { className: "relative mt-4 rounded-md p-4 border-2 border-dotted border-gray-300 bg-gray-50", children: [
500
+ /* @__PURE__ */ jsx3("span", { className: "absolute -top-2.5 left-3 bg-primary-600 text-white text-xs px-2 py-0.5 rounded-full", children: getAssetType(allValues[0]) === "video" ? "Video" : "Image" }),
501
+ /* @__PURE__ */ jsx3("div", { className: "flex flex-col gap-3", children: allValues.map((digitalAsset, index) => /* @__PURE__ */ jsxs3("div", { className: "flex justify-between items-start gap-5", children: [
502
+ /* @__PURE__ */ jsxs3("div", { className: "grid grid-cols-2 gap-x-8 gap-y-3 text-sm w-full", children: [
503
+ /* @__PURE__ */ jsxs3("div", { children: [
504
+ /* @__PURE__ */ jsx3("p", { className: "text-gray-500", children: "Title" }),
505
+ /* @__PURE__ */ jsx3(
506
+ "input",
507
+ {
508
+ type: "text",
509
+ value: digitalAsset.title,
510
+ onChange: (event) => textChangeHandler(index, event),
511
+ placeholder: "title",
512
+ disabled: isDisabled,
513
+ className: "w-full mt-1 py-1.5 block rounded border-gray-300 shadow-sm bg-white\r\n focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50\r\n disabled:bg-gray-100 disabled:text-gray-400 disabled:cursor-not-allowed"
514
+ }
515
+ )
516
+ ] }),
517
+ digitalAsset.intrinsicWidth && digitalAsset.intrinsicHeight && /* @__PURE__ */ jsxs3("div", { children: [
518
+ /* @__PURE__ */ jsx3("p", { className: "text-gray-500", children: "Resolution" }),
519
+ /* @__PURE__ */ jsxs3("p", { className: "font-medium text-gray-900 mt-3", children: [
520
+ digitalAsset.intrinsicWidth,
521
+ "\xD7",
522
+ digitalAsset.intrinsicHeight
523
+ ] })
524
+ ] }),
525
+ (digitalAsset.assetUrl || digitalAsset.posterUrl) && /* @__PURE__ */ jsxs3("div", { children: [
526
+ /* @__PURE__ */ jsx3("p", { className: "text-gray-500", children: "Image / Poster" }),
527
+ /* @__PURE__ */ jsxs3("div", { className: "flex-shrink-0 flex flex-col gap-3 mt-1", children: [
528
+ getAssetType(digitalAsset) === "video" && digitalAsset.posterUrl && /* @__PURE__ */ jsx3(
529
+ "img",
530
+ {
531
+ src: AssetUtility_default.resolveUrl(props.serviceClient?.baseUrl, digitalAsset.posterUrl),
532
+ alt: digitalAsset.title || "Video poster",
533
+ className: "w-32 h-auto object-cover rounded border p-1"
534
+ }
535
+ ),
536
+ getAssetType(digitalAsset) === "image" && digitalAsset.assetUrl && /* @__PURE__ */ jsx3(
537
+ "img",
538
+ {
539
+ src: AssetUtility_default.resolveUrl(props.serviceClient?.baseUrl, digitalAsset.assetUrl),
540
+ alt: digitalAsset.title || "Uploaded image",
541
+ className: "w-32 h-auto object-cover rounded border p-1"
542
+ }
543
+ )
544
+ ] })
545
+ ] }),
546
+ digitalAsset.assetUrl?.endsWith(".m3u8") && /* @__PURE__ */ jsxs3("div", { className: "col-span-2", children: [
547
+ /* @__PURE__ */ jsx3("p", { className: "text-gray-500", children: "HLS Link" }),
548
+ /* @__PURE__ */ jsx3(
549
+ Hyperlink,
550
+ {
551
+ href: digitalAsset.assetUrl,
552
+ className: "text-primary-600 underline mt-1 break-all",
553
+ title: digitalAsset.assetUrl,
554
+ children: digitalAsset.assetUrl
555
+ }
556
+ )
557
+ ] })
558
+ ] }),
559
+ /* @__PURE__ */ jsx3(
560
+ "span",
561
+ {
562
+ onClick: () => !isDisabled && deleteFile(index),
563
+ className: isDisabled ? "cursor-not-allowed opacity-50" : "cursor-pointer",
564
+ children: /* @__PURE__ */ jsx3(Icon_default, { className: "w-4 h-4 text-primary", name: "delete" })
565
+ }
566
+ )
567
+ ] }, index)) })
568
+ ] })
569
+ ] });
570
+ };
571
+ var AssetUpload_default = AssetUpload;
572
+
573
+ // src/components/controls/edit/SwitchInput.tsx
574
+ import React4 from "react";
575
+ import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
576
+ var SwitchInput = (props) => {
577
+ const textChangeHandler = (event) => {
578
+ let text = event.target.checked;
579
+ if (props.callback !== void 0) {
580
+ props.callback({
581
+ name: props.name,
582
+ value: text,
583
+ index: props.index,
584
+ groupKey: props.groupKey
585
+ });
586
+ }
587
+ };
588
+ let value = false;
589
+ if (props.value != void 0 && props.value != null && props.value != "" && (props.value == "true" || props.value.toString() == "true")) {
590
+ value = true;
591
+ }
592
+ return /* @__PURE__ */ jsx4(React4.Fragment, { children: /* @__PURE__ */ jsxs4("div", { className: "flex items-start justify-between gap-4 py-3", children: [
593
+ /* @__PURE__ */ jsxs4("div", { className: "min-w-0", children: [
594
+ props?.attributes?.label && /* @__PURE__ */ jsxs4(
595
+ "label",
596
+ {
597
+ htmlFor: props.name,
598
+ className: "inline-block text-sm font-semibold text-slate-800",
599
+ children: [
600
+ props.attributes.label,
601
+ props?.attributes?.required && /* @__PURE__ */ jsx4("span", { className: "bg-error-weak", children: "*" })
602
+ ]
603
+ }
604
+ ),
605
+ /* @__PURE__ */ jsx4("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage || "" })
606
+ ] }),
607
+ /* @__PURE__ */ jsxs4(
608
+ "label",
609
+ {
610
+ htmlFor: props.name,
611
+ className: "relative inline-flex shrink-0 cursor-pointer items-center peer-disabled:cursor-not-allowed",
612
+ children: [
613
+ /* @__PURE__ */ jsx4(
614
+ "input",
615
+ {
616
+ type: "checkbox",
617
+ name: props.name,
618
+ id: props.name,
619
+ checked: value,
620
+ onChange: textChangeHandler,
621
+ required: props?.attributes?.required,
622
+ disabled: props?.attributes?.readOnly,
623
+ className: "peer sr-only"
624
+ }
625
+ ),
626
+ /* @__PURE__ */ jsx4(
627
+ "div",
628
+ {
629
+ className: "h-6 w-11 rounded-full bg-slate-200 shadow-inner\r\n transition-colors duration-200 ease-in-out\r\n peer-checked:bg-blue-600\r\n peer-focus-visible:ring-2 peer-focus-visible:ring-blue-300 peer-focus-visible:ring-offset-2\r\n peer-disabled:bg-slate-100"
630
+ }
631
+ ),
632
+ /* @__PURE__ */ jsx4(
633
+ "div",
634
+ {
635
+ className: "absolute left-0.5 top-0.5 h-5 w-5 rounded-full bg-default shadow\r\n transition-transform duration-200 ease-in-out\r\n peer-checked:translate-x-5\r\n peer-disabled:bg-slate-50"
636
+ }
637
+ )
638
+ ]
639
+ }
640
+ )
641
+ ] }) });
642
+ };
643
+ var SwitchInput_default = SwitchInput;
644
+
645
+ // src/components/controls/edit/InputControlClient.tsx
646
+ import { jsx as jsx5 } from "react/jsx-runtime";
647
+ var ControlComponents = {
648
+ [InputControlType_default.lineTextInput]: LineTextInput_default,
649
+ [InputControlType_default.emailInput]: EmailInput_default,
650
+ [InputControlType_default.multilineTextInput]: MultilineTextInput_default,
651
+ [InputControlType_default.moneyInput]: MoneyInput_default,
652
+ [InputControlType_default.select]: Select_default,
653
+ [InputControlType_default.percentageInput]: PercentageInput_default,
654
+ [InputControlType_default.phoneInput]: PhoneInput_default,
655
+ [InputControlType_default.numberInput]: NumberInput_default,
656
+ [InputControlType_default.checkboxInput]: CheckboxInput_default,
657
+ [InputControlType_default.otpInput]: OtpInput_default,
658
+ [InputControlType_default.datetimeInput]: DateTimeInput_default,
659
+ [InputControlType_default.colorInput]: ColorInput_default,
660
+ [InputControlType_default.selectWithSearchInput]: SelectWithSearchInput_default,
661
+ [InputControlType_default.selectWithSearchPanel]: SelectWithSearchPanel_default,
662
+ [InputControlType_default.booleanSelect]: BooleanSelect_default,
663
+ [InputControlType_default.timeInput]: TimeInput_default,
664
+ [InputControlType_default.asset]: AssetUpload_default,
665
+ [InputControlType_default.switchInput]: SwitchInput_default
666
+ };
667
+ var InputControl = React5.memo(React5.forwardRef(
668
+ (props, ref) => {
669
+ const SelectedControlComponent = ControlComponents[props.controlType];
670
+ return /* @__PURE__ */ jsx5(React5.Fragment, { children: SelectedControlComponent ? /* @__PURE__ */ jsx5(SelectedControlComponent, { ...props }) : "Control not found" });
671
+ }
672
+ ));
673
+ InputControl.displayName = "InputControl";
674
+ var InputControlClient_default = InputControl;
675
+ export {
676
+ InputControlClient_default as default
677
+ };
@@ -642,32 +642,32 @@ var SwitchInput_default = SwitchInput;
642
642
 
643
643
  // src/components/controls/edit/InputControlClient.tsx
644
644
  import { jsx as jsx5 } from "react/jsx-runtime";
645
- var InputControl = React5.forwardRef(
645
+ var ControlComponents = {
646
+ [InputControlType_default.lineTextInput]: LineTextInput_default,
647
+ [InputControlType_default.emailInput]: EmailInput_default,
648
+ [InputControlType_default.multilineTextInput]: MultilineTextInput_default,
649
+ [InputControlType_default.moneyInput]: MoneyInput_default,
650
+ [InputControlType_default.select]: Select_default,
651
+ [InputControlType_default.percentageInput]: PercentageInput_default,
652
+ [InputControlType_default.phoneInput]: PhoneInput_default,
653
+ [InputControlType_default.numberInput]: NumberInput_default,
654
+ [InputControlType_default.checkboxInput]: CheckboxInput_default,
655
+ [InputControlType_default.otpInput]: OtpInput_default,
656
+ [InputControlType_default.datetimeInput]: DateTimeInput_default,
657
+ [InputControlType_default.colorInput]: ColorInput_default,
658
+ [InputControlType_default.selectWithSearchInput]: SelectWithSearchInput_default,
659
+ [InputControlType_default.selectWithSearchPanel]: SelectWithSearchPanel_default,
660
+ [InputControlType_default.booleanSelect]: BooleanSelect_default,
661
+ [InputControlType_default.timeInput]: TimeInput_default,
662
+ [InputControlType_default.asset]: AssetUpload_default,
663
+ [InputControlType_default.switchInput]: SwitchInput_default
664
+ };
665
+ var InputControl = React5.memo(React5.forwardRef(
646
666
  (props, ref) => {
647
- const ControlComponents = {
648
- [InputControlType_default.lineTextInput]: LineTextInput_default,
649
- [InputControlType_default.emailInput]: EmailInput_default,
650
- [InputControlType_default.multilineTextInput]: MultilineTextInput_default,
651
- [InputControlType_default.moneyInput]: MoneyInput_default,
652
- [InputControlType_default.select]: Select_default,
653
- [InputControlType_default.percentageInput]: PercentageInput_default,
654
- [InputControlType_default.phoneInput]: PhoneInput_default,
655
- [InputControlType_default.numberInput]: NumberInput_default,
656
- [InputControlType_default.checkboxInput]: CheckboxInput_default,
657
- [InputControlType_default.otpInput]: OtpInput_default,
658
- [InputControlType_default.datetimeInput]: DateTimeInput_default,
659
- [InputControlType_default.colorInput]: ColorInput_default,
660
- [InputControlType_default.selectWithSearchInput]: SelectWithSearchInput_default,
661
- [InputControlType_default.selectWithSearchPanel]: SelectWithSearchPanel_default,
662
- [InputControlType_default.booleanSelect]: BooleanSelect_default,
663
- [InputControlType_default.timeInput]: TimeInput_default,
664
- [InputControlType_default.asset]: AssetUpload_default,
665
- [InputControlType_default.switchInput]: SwitchInput_default
666
- };
667
667
  const SelectedControlComponent = ControlComponents[props.controlType];
668
668
  return /* @__PURE__ */ jsx5(React5.Fragment, { children: SelectedControlComponent ? /* @__PURE__ */ jsx5(SelectedControlComponent, { ...props }) : "Control not found" });
669
669
  }
670
- );
670
+ ));
671
671
  InputControl.displayName = "InputControl";
672
672
  var InputControlClient_default = InputControl;
673
673
  export {
@@ -644,32 +644,32 @@ var SwitchInput_default = SwitchInput;
644
644
 
645
645
  // src/components/controls/edit/InputControlClient.tsx
646
646
  import { jsx as jsx5 } from "react/jsx-runtime";
647
- var InputControl = React5.forwardRef(
647
+ var ControlComponents = {
648
+ [InputControlType_default.lineTextInput]: LineTextInput_default,
649
+ [InputControlType_default.emailInput]: EmailInput_default,
650
+ [InputControlType_default.multilineTextInput]: MultilineTextInput_default,
651
+ [InputControlType_default.moneyInput]: MoneyInput_default,
652
+ [InputControlType_default.select]: Select_default,
653
+ [InputControlType_default.percentageInput]: PercentageInput_default,
654
+ [InputControlType_default.phoneInput]: PhoneInput_default,
655
+ [InputControlType_default.numberInput]: NumberInput_default,
656
+ [InputControlType_default.checkboxInput]: CheckboxInput_default,
657
+ [InputControlType_default.otpInput]: OtpInput_default,
658
+ [InputControlType_default.datetimeInput]: DateTimeInput_default,
659
+ [InputControlType_default.colorInput]: ColorInput_default,
660
+ [InputControlType_default.selectWithSearchInput]: SelectWithSearchInput_default,
661
+ [InputControlType_default.selectWithSearchPanel]: SelectWithSearchPanel_default,
662
+ [InputControlType_default.booleanSelect]: BooleanSelect_default,
663
+ [InputControlType_default.timeInput]: TimeInput_default,
664
+ [InputControlType_default.asset]: AssetUpload_default,
665
+ [InputControlType_default.switchInput]: SwitchInput_default
666
+ };
667
+ var InputControl = React5.memo(React5.forwardRef(
648
668
  (props, ref) => {
649
- const ControlComponents = {
650
- [InputControlType_default.lineTextInput]: LineTextInput_default,
651
- [InputControlType_default.emailInput]: EmailInput_default,
652
- [InputControlType_default.multilineTextInput]: MultilineTextInput_default,
653
- [InputControlType_default.moneyInput]: MoneyInput_default,
654
- [InputControlType_default.select]: Select_default,
655
- [InputControlType_default.percentageInput]: PercentageInput_default,
656
- [InputControlType_default.phoneInput]: PhoneInput_default,
657
- [InputControlType_default.numberInput]: NumberInput_default,
658
- [InputControlType_default.checkboxInput]: CheckboxInput_default,
659
- [InputControlType_default.otpInput]: OtpInput_default,
660
- [InputControlType_default.datetimeInput]: DateTimeInput_default,
661
- [InputControlType_default.colorInput]: ColorInput_default,
662
- [InputControlType_default.selectWithSearchInput]: SelectWithSearchInput_default,
663
- [InputControlType_default.selectWithSearchPanel]: SelectWithSearchPanel_default,
664
- [InputControlType_default.booleanSelect]: BooleanSelect_default,
665
- [InputControlType_default.timeInput]: TimeInput_default,
666
- [InputControlType_default.asset]: AssetUpload_default,
667
- [InputControlType_default.switchInput]: SwitchInput_default
668
- };
669
669
  const SelectedControlComponent = ControlComponents[props.controlType];
670
670
  return /* @__PURE__ */ jsx5(React5.Fragment, { children: SelectedControlComponent ? /* @__PURE__ */ jsx5(SelectedControlComponent, { ...props }) : "Control not found" });
671
671
  }
672
- );
672
+ ));
673
673
  InputControl.displayName = "InputControl";
674
674
  var InputControlClient_default = InputControl;
675
675
  export {
package/dist/index.d.mts CHANGED
@@ -13,7 +13,7 @@ interface ViewControlProps {
13
13
  session?: any;
14
14
  }
15
15
 
16
- declare const ViewControl: (props: ViewControlProps) => React__default.JSX.Element;
16
+ declare const ViewControl: React__default.MemoExoticComponent<(props: ViewControlProps) => React__default.JSX.Element>;
17
17
 
18
18
  declare const ViewControlTypes: {
19
19
  lineText: string;
package/dist/index.d.ts CHANGED
@@ -13,7 +13,7 @@ interface ViewControlProps {
13
13
  session?: any;
14
14
  }
15
15
 
16
- declare const ViewControl: (props: ViewControlProps) => React__default.JSX.Element;
16
+ declare const ViewControl: React__default.MemoExoticComponent<(props: ViewControlProps) => React__default.JSX.Element>;
17
17
 
18
18
  declare const ViewControlTypes: {
19
19
  lineText: string;
package/dist/index.js CHANGED
@@ -2803,7 +2803,7 @@ var InputControlClient_exports = {};
2803
2803
  __export(InputControlClient_exports, {
2804
2804
  default: () => InputControlClient_default
2805
2805
  });
2806
- var import_react37, import_jsx_runtime46, InputControl, InputControlClient_default;
2806
+ var import_react37, import_jsx_runtime46, ControlComponents2, InputControl, InputControlClient_default;
2807
2807
  var init_InputControlClient = __esm({
2808
2808
  "src/components/controls/edit/InputControlClient.tsx"() {
2809
2809
  "use strict";
@@ -2829,32 +2829,32 @@ var init_InputControlClient = __esm({
2829
2829
  init_AssetUpload();
2830
2830
  init_SwitchInput();
2831
2831
  import_jsx_runtime46 = require("react/jsx-runtime");
2832
- InputControl = import_react37.default.forwardRef(
2832
+ ControlComponents2 = {
2833
+ [InputControlType_default.lineTextInput]: LineTextInput_default,
2834
+ [InputControlType_default.emailInput]: EmailInput_default,
2835
+ [InputControlType_default.multilineTextInput]: MultilineTextInput_default,
2836
+ [InputControlType_default.moneyInput]: MoneyInput_default,
2837
+ [InputControlType_default.select]: Select_default,
2838
+ [InputControlType_default.percentageInput]: PercentageInput_default,
2839
+ [InputControlType_default.phoneInput]: PhoneInput_default,
2840
+ [InputControlType_default.numberInput]: NumberInput_default,
2841
+ [InputControlType_default.checkboxInput]: CheckboxInput_default,
2842
+ [InputControlType_default.otpInput]: OtpInput_default,
2843
+ [InputControlType_default.datetimeInput]: DateTimeInput_default,
2844
+ [InputControlType_default.colorInput]: ColorInput_default,
2845
+ [InputControlType_default.selectWithSearchInput]: SelectWithSearchInput_default,
2846
+ [InputControlType_default.selectWithSearchPanel]: SelectWithSearchPanel_default,
2847
+ [InputControlType_default.booleanSelect]: BooleanSelect_default,
2848
+ [InputControlType_default.timeInput]: TimeInput_default,
2849
+ [InputControlType_default.asset]: AssetUpload_default,
2850
+ [InputControlType_default.switchInput]: SwitchInput_default
2851
+ };
2852
+ InputControl = import_react37.default.memo(import_react37.default.forwardRef(
2833
2853
  (props, ref) => {
2834
- const ControlComponents = {
2835
- [InputControlType_default.lineTextInput]: LineTextInput_default,
2836
- [InputControlType_default.emailInput]: EmailInput_default,
2837
- [InputControlType_default.multilineTextInput]: MultilineTextInput_default,
2838
- [InputControlType_default.moneyInput]: MoneyInput_default,
2839
- [InputControlType_default.select]: Select_default,
2840
- [InputControlType_default.percentageInput]: PercentageInput_default,
2841
- [InputControlType_default.phoneInput]: PhoneInput_default,
2842
- [InputControlType_default.numberInput]: NumberInput_default,
2843
- [InputControlType_default.checkboxInput]: CheckboxInput_default,
2844
- [InputControlType_default.otpInput]: OtpInput_default,
2845
- [InputControlType_default.datetimeInput]: DateTimeInput_default,
2846
- [InputControlType_default.colorInput]: ColorInput_default,
2847
- [InputControlType_default.selectWithSearchInput]: SelectWithSearchInput_default,
2848
- [InputControlType_default.selectWithSearchPanel]: SelectWithSearchPanel_default,
2849
- [InputControlType_default.booleanSelect]: BooleanSelect_default,
2850
- [InputControlType_default.timeInput]: TimeInput_default,
2851
- [InputControlType_default.asset]: AssetUpload_default,
2852
- [InputControlType_default.switchInput]: SwitchInput_default
2853
- };
2854
- const SelectedControlComponent = ControlComponents[props.controlType];
2854
+ const SelectedControlComponent = ControlComponents2[props.controlType];
2855
2855
  return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react37.default.Fragment, { children: SelectedControlComponent ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(SelectedControlComponent, { ...props }) : "Control not found" });
2856
2856
  }
2857
- );
2857
+ ));
2858
2858
  InputControl.displayName = "InputControl";
2859
2859
  InputControlClient_default = InputControl;
2860
2860
  }
@@ -4499,36 +4499,36 @@ var DateTimeVew_default = DateTimeView;
4499
4499
 
4500
4500
  // src/components/controls/view/ViewControl.tsx
4501
4501
  var import_jsx_runtime18 = require("react/jsx-runtime");
4502
- var ViewControl = (props) => {
4503
- const ControlComponents = {
4504
- [ViewControlTypes_default.lineText]: LineTextView_default,
4505
- [ViewControlTypes_default.emailText]: EmailTextView_default,
4506
- [ViewControlTypes_default.asset]: Asset_default,
4507
- [ViewControlTypes_default.multilineTextBullets]: MultilineTextBulletsView_default,
4508
- [ViewControlTypes_default.boolean]: BooleanView_default,
4509
- [ViewControlTypes_default.checkboxInput]: BooleanView_default,
4510
- // [ViewControlTypes.timeUntilStarts]: TimeUntilStarts,
4511
- [ViewControlTypes_default.money]: MoneyView_default,
4512
- [ViewControlTypes_default.date]: DateView_default,
4513
- [ViewControlTypes_default.time]: DateView_default,
4514
- [ViewControlTypes_default.datetime]: DateTimeVew_default,
4515
- [ViewControlTypes_default.number]: NumberView_default,
4516
- [ViewControlTypes_default.multilineText]: MultilineTextView_default,
4517
- [ViewControlTypes_default.multilinetext]: MultilineTextView_default,
4518
- [ViewControlTypes_default.moneyText]: MoneyView_default,
4519
- [ViewControlTypes_default.percentage]: PercentageView_default,
4520
- [ViewControlTypes_default.status]: StatusView_default,
4521
- [ViewControlTypes_default.statusBg]: StatusBgView_default,
4522
- [ViewControlTypes_default.progressIndicator]: ProgressIndicator_default,
4523
- // [ViewControlTypes.timeUntilStarts]: TimeUntilStarts,
4524
- // [ViewControlTypes.timeUntilStartsStyled]: TimeUntilStartsStyled,
4525
- [ViewControlTypes_default.aiGeneratedSummary]: AiGeneratedSummary_default,
4526
- [ViewControlTypes_default.booleanView]: BooleanView_default,
4527
- [ViewControlTypes_default.text]: LineTextView_default
4528
- };
4502
+ var ControlComponents = {
4503
+ [ViewControlTypes_default.lineText]: LineTextView_default,
4504
+ [ViewControlTypes_default.emailText]: EmailTextView_default,
4505
+ [ViewControlTypes_default.asset]: Asset_default,
4506
+ [ViewControlTypes_default.multilineTextBullets]: MultilineTextBulletsView_default,
4507
+ [ViewControlTypes_default.boolean]: BooleanView_default,
4508
+ [ViewControlTypes_default.checkboxInput]: BooleanView_default,
4509
+ // [ViewControlTypes.timeUntilStarts]: TimeUntilStarts,
4510
+ [ViewControlTypes_default.money]: MoneyView_default,
4511
+ [ViewControlTypes_default.date]: DateView_default,
4512
+ [ViewControlTypes_default.time]: DateView_default,
4513
+ [ViewControlTypes_default.datetime]: DateTimeVew_default,
4514
+ [ViewControlTypes_default.number]: NumberView_default,
4515
+ [ViewControlTypes_default.multilineText]: MultilineTextView_default,
4516
+ [ViewControlTypes_default.multilinetext]: MultilineTextView_default,
4517
+ [ViewControlTypes_default.moneyText]: MoneyView_default,
4518
+ [ViewControlTypes_default.percentage]: PercentageView_default,
4519
+ [ViewControlTypes_default.status]: StatusView_default,
4520
+ [ViewControlTypes_default.statusBg]: StatusBgView_default,
4521
+ [ViewControlTypes_default.progressIndicator]: ProgressIndicator_default,
4522
+ // [ViewControlTypes.timeUntilStarts]: TimeUntilStarts,
4523
+ // [ViewControlTypes.timeUntilStartsStyled]: TimeUntilStartsStyled,
4524
+ [ViewControlTypes_default.aiGeneratedSummary]: AiGeneratedSummary_default,
4525
+ [ViewControlTypes_default.booleanView]: BooleanView_default,
4526
+ [ViewControlTypes_default.text]: LineTextView_default
4527
+ };
4528
+ var ViewControl = import_react15.default.memo((props) => {
4529
4529
  const SelectedControlComponent = props.controlType ? ControlComponents[props.controlType] : void 0;
4530
4530
  return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react15.default.Fragment, { children: SelectedControlComponent ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SelectedControlComponent, { ...props }) : "Control not found:" + props.controlType });
4531
- };
4531
+ });
4532
4532
  var ViewControl_default = ViewControl;
4533
4533
 
4534
4534
  // src/components/controls/edit/InputControl.tsx
@@ -7188,7 +7188,6 @@ var DataList = (props) => {
7188
7188
  let orderBy = "";
7189
7189
  let activePageNumber = 0;
7190
7190
  let pages = 0;
7191
- console.log(props.addLinkText);
7192
7191
  const [isDataFound, setIsDataFound] = (0, import_react58.useState)(null);
7193
7192
  const [searchTerm, setSearchTerm] = (0, import_react58.useState)(props.query?.searchTerm ?? "");
7194
7193
  (0, import_react58.useEffect)(() => {
@@ -7239,7 +7238,6 @@ var DataList = (props) => {
7239
7238
  name: updatedValues.name,
7240
7239
  value: updatedValues.value
7241
7240
  });
7242
- console.log("ddddaaa", updatedValues.value);
7243
7241
  let builder2 = new OdataBuilder(props.path);
7244
7242
  builder2 = builder2.setQuery(props.query);
7245
7243
  if (updatedValues.value != "" && updatedValues.value != null) {
@@ -7540,12 +7538,10 @@ var DataList = (props) => {
7540
7538
  }) }) }),
7541
7539
  /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("tbody", { className: "divide-y divide-gray-200 ", children: props.dataset?.result?.map((dataitem, index) => {
7542
7540
  let validityClass = "";
7543
- console.log("dataitem", dataitem);
7544
7541
  if (props.recordValidityColumnName && getNestedProperty2(dataitem, props.recordValidityColumnName) == false) {
7545
7542
  validityClass = "bg-alert-200";
7546
7543
  }
7547
7544
  return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("tr", { className: validityClass, children: props?.columns?.map((column, colindex) => {
7548
- console.log("column", column);
7549
7545
  return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react58.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
7550
7546
  "td",
7551
7547
  {
package/dist/index.mjs CHANGED
@@ -1,8 +1,6 @@
1
- "use client";
2
-
3
1
  import {
4
2
  OdataBuilder
5
- } from "./chunk-X3YSXTD2.mjs";
3
+ } from "./chunk-UFKPTMM7.mjs";
6
4
  import {
7
5
  AssetUtility_default,
8
6
  BooleanSelect_default,
@@ -19,22 +17,22 @@ import {
19
17
  PhoneInput_default,
20
18
  SelectWithSearchInput_default,
21
19
  TimeInput_default
22
- } from "./chunk-7ZFZLN56.mjs";
20
+ } from "./chunk-YG6FKKQJ.mjs";
23
21
  import {
24
22
  Constants,
25
23
  Hyperlink,
26
24
  Icon_default,
27
25
  InputControlType_default
28
- } from "./chunk-5GHPW7SJ.mjs";
26
+ } from "./chunk-DBHUCH4B.mjs";
29
27
  import {
30
28
  ServiceClient_default
31
- } from "./chunk-WEV5U33G.mjs";
29
+ } from "./chunk-3GWLDT7C.mjs";
32
30
  import {
33
31
  Button_default,
34
32
  ClientButton_default,
35
33
  ToastService_default
36
- } from "./chunk-JKP4XOZB.mjs";
37
- import "./chunk-IMNQO57B.mjs";
34
+ } from "./chunk-YL6E76X2.mjs";
35
+ import "./chunk-56HSDML5.mjs";
38
36
 
39
37
  // src/components/controls/view/ViewControl.tsx
40
38
  import React13 from "react";
@@ -78,7 +76,7 @@ var NumberView_default = NumberView;
78
76
 
79
77
  // src/components/controls/view/DateView.tsx
80
78
  import dynamic from "next/dynamic";
81
- var DateView = dynamic(() => import("./DateViewClient-VLTRN47D.mjs"), {
79
+ var DateView = dynamic(() => import("./DateViewClient-ELEHLGWS.mjs"), {
82
80
  ssr: false
83
81
  });
84
82
  var DateView_default = DateView;
@@ -133,7 +131,7 @@ import React3 from "react";
133
131
  // src/components/DeviceAssetSelector.tsx
134
132
  import dynamic2 from "next/dynamic";
135
133
  import { jsx as jsx3 } from "react/jsx-runtime";
136
- var HlsPlayer = dynamic2(() => import("./HlsPlayer-5AWFZ2P6.mjs"), { ssr: false });
134
+ var HlsPlayer = dynamic2(() => import("./HlsPlayer-57543DTW.mjs"), { ssr: false });
137
135
  var FORMAT_CLASSES = {
138
136
  center: "justify-center",
139
137
  left: "justify-start",
@@ -368,48 +366,48 @@ var AiGeneratedSummary_default = AiGeneratedSummary;
368
366
 
369
367
  // src/components/controls/view/DateTimeVew.tsx
370
368
  import dynamic3 from "next/dynamic";
371
- var DateTimeView = dynamic3(() => import("./DateTimeViewClient-R3M6ISVK.mjs"), {
369
+ var DateTimeView = dynamic3(() => import("./DateTimeViewClient-22GW4AD7.mjs"), {
372
370
  ssr: false
373
371
  });
374
372
  var DateTimeVew_default = DateTimeView;
375
373
 
376
374
  // src/components/controls/view/ViewControl.tsx
377
375
  import { jsx as jsx14 } from "react/jsx-runtime";
378
- var ViewControl = (props) => {
379
- const ControlComponents = {
380
- [ViewControlTypes_default.lineText]: LineTextView_default,
381
- [ViewControlTypes_default.emailText]: EmailTextView_default,
382
- [ViewControlTypes_default.asset]: Asset_default,
383
- [ViewControlTypes_default.multilineTextBullets]: MultilineTextBulletsView_default,
384
- [ViewControlTypes_default.boolean]: BooleanView_default,
385
- [ViewControlTypes_default.checkboxInput]: BooleanView_default,
386
- // [ViewControlTypes.timeUntilStarts]: TimeUntilStarts,
387
- [ViewControlTypes_default.money]: MoneyView_default,
388
- [ViewControlTypes_default.date]: DateView_default,
389
- [ViewControlTypes_default.time]: DateView_default,
390
- [ViewControlTypes_default.datetime]: DateTimeVew_default,
391
- [ViewControlTypes_default.number]: NumberView_default,
392
- [ViewControlTypes_default.multilineText]: MultilineTextView_default,
393
- [ViewControlTypes_default.multilinetext]: MultilineTextView_default,
394
- [ViewControlTypes_default.moneyText]: MoneyView_default,
395
- [ViewControlTypes_default.percentage]: PercentageView_default,
396
- [ViewControlTypes_default.status]: StatusView_default,
397
- [ViewControlTypes_default.statusBg]: StatusBgView_default,
398
- [ViewControlTypes_default.progressIndicator]: ProgressIndicator_default,
399
- // [ViewControlTypes.timeUntilStarts]: TimeUntilStarts,
400
- // [ViewControlTypes.timeUntilStartsStyled]: TimeUntilStartsStyled,
401
- [ViewControlTypes_default.aiGeneratedSummary]: AiGeneratedSummary_default,
402
- [ViewControlTypes_default.booleanView]: BooleanView_default,
403
- [ViewControlTypes_default.text]: LineTextView_default
404
- };
376
+ var ControlComponents = {
377
+ [ViewControlTypes_default.lineText]: LineTextView_default,
378
+ [ViewControlTypes_default.emailText]: EmailTextView_default,
379
+ [ViewControlTypes_default.asset]: Asset_default,
380
+ [ViewControlTypes_default.multilineTextBullets]: MultilineTextBulletsView_default,
381
+ [ViewControlTypes_default.boolean]: BooleanView_default,
382
+ [ViewControlTypes_default.checkboxInput]: BooleanView_default,
383
+ // [ViewControlTypes.timeUntilStarts]: TimeUntilStarts,
384
+ [ViewControlTypes_default.money]: MoneyView_default,
385
+ [ViewControlTypes_default.date]: DateView_default,
386
+ [ViewControlTypes_default.time]: DateView_default,
387
+ [ViewControlTypes_default.datetime]: DateTimeVew_default,
388
+ [ViewControlTypes_default.number]: NumberView_default,
389
+ [ViewControlTypes_default.multilineText]: MultilineTextView_default,
390
+ [ViewControlTypes_default.multilinetext]: MultilineTextView_default,
391
+ [ViewControlTypes_default.moneyText]: MoneyView_default,
392
+ [ViewControlTypes_default.percentage]: PercentageView_default,
393
+ [ViewControlTypes_default.status]: StatusView_default,
394
+ [ViewControlTypes_default.statusBg]: StatusBgView_default,
395
+ [ViewControlTypes_default.progressIndicator]: ProgressIndicator_default,
396
+ // [ViewControlTypes.timeUntilStarts]: TimeUntilStarts,
397
+ // [ViewControlTypes.timeUntilStartsStyled]: TimeUntilStartsStyled,
398
+ [ViewControlTypes_default.aiGeneratedSummary]: AiGeneratedSummary_default,
399
+ [ViewControlTypes_default.booleanView]: BooleanView_default,
400
+ [ViewControlTypes_default.text]: LineTextView_default
401
+ };
402
+ var ViewControl = React13.memo((props) => {
405
403
  const SelectedControlComponent = props.controlType ? ControlComponents[props.controlType] : void 0;
406
404
  return /* @__PURE__ */ jsx14(React13.Fragment, { children: SelectedControlComponent ? /* @__PURE__ */ jsx14(SelectedControlComponent, { ...props }) : "Control not found:" + props.controlType });
407
- };
405
+ });
408
406
  var ViewControl_default = ViewControl;
409
407
 
410
408
  // src/components/controls/edit/InputControl.tsx
411
409
  import dynamic4 from "next/dynamic";
412
- var InputControl = dynamic4(() => import("./InputControlClient-QAZKQLFO.mjs"), {
410
+ var InputControl = dynamic4(() => import("./InputControlClient-VUPWEYGB.mjs"), {
413
411
  ssr: false
414
412
  });
415
413
  var InputControl_default = InputControl;
@@ -505,7 +503,7 @@ import React14 from "react";
505
503
  // src/components/pageRenderingEngine/nodes/ImageNode.tsx
506
504
  import dynamic5 from "next/dynamic";
507
505
  import { jsx as jsx17 } from "react/jsx-runtime";
508
- var HlsPlayer2 = dynamic5(() => import("./HlsPlayer-5AWFZ2P6.mjs"), { ssr: false });
506
+ var HlsPlayer2 = dynamic5(() => import("./HlsPlayer-57543DTW.mjs"), { ssr: false });
509
507
  var getNestedValue = (obj, path) => {
510
508
  if (!obj || !path) return void 0;
511
509
  return path.split(".").reduce((current, key) => {
@@ -613,7 +611,7 @@ var ImageNode_default = ImageNode;
613
611
  // src/components/pageRenderingEngine/nodes/LinkNode.tsx
614
612
  import dynamic6 from "next/dynamic";
615
613
  import { Fragment, jsx as jsx18, jsxs as jsxs6 } from "react/jsx-runtime";
616
- var LinkNodeButton = dynamic6(() => import("./LinkNodeButton-LX3KKGZY.mjs"), {
614
+ var LinkNodeButton = dynamic6(() => import("./LinkNodeButton-XA7Z5IDR.mjs"), {
617
615
  ssr: false
618
616
  });
619
617
  function getNestedValue2(obj, path) {
@@ -1048,7 +1046,7 @@ var QuoteNode_default = QuoteNode;
1048
1046
  import React20 from "react";
1049
1047
  import dynamic7 from "next/dynamic";
1050
1048
  import { jsx as jsx27, jsxs as jsxs9 } from "react/jsx-runtime";
1051
- var CopyButton = dynamic7(() => import("./CopyButton-UPJPMJUB.mjs"), {
1049
+ var CopyButton = dynamic7(() => import("./CopyButton-XONTQQW7.mjs"), {
1052
1050
  ssr: false,
1053
1051
  // optional: fallback UI while loading
1054
1052
  loading: () => /* @__PURE__ */ jsx27("span", { className: "text-gray-400 text-xs", children: "Copy" })
@@ -1191,7 +1189,7 @@ import React22 from "react";
1191
1189
  // src/components/pageRenderingEngine/nodes/EmbedNode.tsx
1192
1190
  import dynamic8 from "next/dynamic";
1193
1191
  import { jsx as jsx30 } from "react/jsx-runtime";
1194
- var IframeClient = dynamic8(() => import("./IframeClient-RGJFZ5P2.mjs"), {
1192
+ var IframeClient = dynamic8(() => import("./IframeClient-J22NMEVY.mjs"), {
1195
1193
  ssr: false
1196
1194
  });
1197
1195
  var EmbedNode = (props) => {
@@ -1427,7 +1425,7 @@ var NoDataFound_default = NoDataFound;
1427
1425
  // src/components/pageRenderingEngine/nodes/ImageGalleryNode.tsx
1428
1426
  import dynamic9 from "next/dynamic";
1429
1427
  import { Fragment as Fragment5, jsx as jsx32, jsxs as jsxs11 } from "react/jsx-runtime";
1430
- var HlsPlayer3 = dynamic9(() => import("./HlsPlayer-5AWFZ2P6.mjs"), { ssr: false });
1428
+ var HlsPlayer3 = dynamic9(() => import("./HlsPlayer-57543DTW.mjs"), { ssr: false });
1431
1429
  var deviceToMediaQuery = (device) => {
1432
1430
  switch (device) {
1433
1431
  case "lg":
@@ -2242,8 +2240,8 @@ var DocumentNode_default = DocumentNode;
2242
2240
 
2243
2241
  // src/components/pageRenderingEngine/nodes/DivContainer.tsx
2244
2242
  import { jsx as jsx34, jsxs as jsxs13 } from "react/jsx-runtime";
2245
- var Pagination = dynamic10(() => import("./Pagination-T7YN2OMV.mjs"), { ssr: true });
2246
- var Slider = dynamic10(() => import("./Slider-554BKC7N.mjs"), {
2243
+ var Pagination = dynamic10(() => import("./Pagination-NCJCOYHF.mjs"), { ssr: true });
2244
+ var Slider = dynamic10(() => import("./Slider-PEIVH6A5.mjs"), {
2247
2245
  ssr: false
2248
2246
  });
2249
2247
  function toCamelCase(str) {
@@ -3022,7 +3020,6 @@ var DataList = (props) => {
3022
3020
  let orderBy = "";
3023
3021
  let activePageNumber = 0;
3024
3022
  let pages = 0;
3025
- console.log(props.addLinkText);
3026
3023
  const [isDataFound, setIsDataFound] = useState2(null);
3027
3024
  const [searchTerm, setSearchTerm] = useState2(props.query?.searchTerm ?? "");
3028
3025
  useEffect3(() => {
@@ -3073,7 +3070,6 @@ var DataList = (props) => {
3073
3070
  name: updatedValues.name,
3074
3071
  value: updatedValues.value
3075
3072
  });
3076
- console.log("ddddaaa", updatedValues.value);
3077
3073
  let builder2 = new OdataBuilder(props.path);
3078
3074
  builder2 = builder2.setQuery(props.query);
3079
3075
  if (updatedValues.value != "" && updatedValues.value != null) {
@@ -3374,12 +3370,10 @@ var DataList = (props) => {
3374
3370
  }) }) }),
3375
3371
  /* @__PURE__ */ jsx40("tbody", { className: "divide-y divide-gray-200 ", children: props.dataset?.result?.map((dataitem, index) => {
3376
3372
  let validityClass = "";
3377
- console.log("dataitem", dataitem);
3378
3373
  if (props.recordValidityColumnName && getNestedProperty2(dataitem, props.recordValidityColumnName) == false) {
3379
3374
  validityClass = "bg-alert-200";
3380
3375
  }
3381
3376
  return /* @__PURE__ */ jsx40("tr", { className: validityClass, children: props?.columns?.map((column, colindex) => {
3382
- console.log("column", column);
3383
3377
  return /* @__PURE__ */ jsx40(React27.Fragment, { children: /* @__PURE__ */ jsx40(
3384
3378
  "td",
3385
3379
  {
@@ -4285,3 +4279,5 @@ export {
4285
4279
  ViewControl_default as ViewControl,
4286
4280
  ViewControlTypes_default as ViewControlTypes
4287
4281
  };
4282
+ ontrolTypes
4283
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acoustte-digital-services/digitalstore-controls-dev",
3
- "version": "0.8.1-dev.20260715103126",
3
+ "version": "0.8.1-dev.20260721123022",
4
4
  "description": "Reusable React components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -63,7 +63,6 @@
63
63
  "load-tsconfig": "^0.2.5",
64
64
  "magic-string": "^0.30.21",
65
65
  "mlly": "^1.8.0",
66
- "moment-timezone": "^0.6.2",
67
66
  "ms": "^2.1.3",
68
67
  "mz": "^2.7.0",
69
68
  "next": "^15.5.20",