@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260704091052 → 0.8.1-dev.20260706110649
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/CopyButton-UPJPMJUB.mjs +57 -0
- package/dist/DateTimeViewClient-R3M6ISVK.mjs +16 -0
- package/dist/DateViewClient-VLTRN47D.mjs +9 -0
- package/dist/{chunk-SDNYBQSI.mjs → HlsPlayer-57543DTW.mjs} +3 -2
- package/dist/HlsPlayer-5AWFZ2P6.mjs +601 -0
- package/dist/IframeClient-RGJFZ5P2.mjs +98 -0
- package/dist/InputControlClient-NJV6B65M.mjs +604 -0
- package/dist/InputControlClient-OQDLYA4S.mjs +604 -0
- package/dist/InputControlClient-TW664WIJ.mjs +602 -0
- package/dist/{LinkNodeButton-WDDPNYWI.mjs → LinkNodeButton-FUL3J5HR.mjs} +6 -5
- package/dist/LinkNodeButton-IGJOGOKI.mjs +362 -0
- package/dist/LinkNodeButton-ZONM74OO.mjs +174 -0
- package/dist/Pagination-6OFACRMQ.mjs +229 -0
- package/dist/Pagination-FSYLYKUA.mjs +181 -0
- package/dist/Pagination-YCD5CU2L.mjs +183 -0
- package/dist/Slider-554BKC7N.mjs +322 -0
- package/dist/Slider-PEIVH6A5.mjs +320 -0
- package/dist/chunk-2GSYECIS.mjs +109 -0
- package/dist/chunk-3GWLDT7C.mjs +204 -0
- package/dist/chunk-3R4VVVNK.mjs +903 -0
- package/dist/chunk-47HD7QP7.mjs +199 -0
- package/dist/chunk-56HSDML5.mjs +22 -0
- package/dist/chunk-67IG5NBU.mjs +200 -0
- package/dist/chunk-7ZFZLN56.mjs +903 -0
- package/dist/chunk-CM7LUGCH.mjs +107 -0
- package/dist/chunk-IKIXEQPV.mjs +198 -0
- package/dist/chunk-IMNQO57B.mjs +25 -0
- package/dist/chunk-R2HV35IB.mjs +201 -0
- package/dist/chunk-SPRVN5IM.mjs +118 -0
- package/dist/chunk-TVL6KVD5.mjs +229 -0
- package/dist/chunk-WEV5U33G.mjs +207 -0
- package/dist/chunk-YG6FKKQJ.mjs +900 -0
- package/dist/index.d.mts +57 -170
- package/dist/index.d.ts +57 -170
- package/dist/index.js +3938 -3807
- package/dist/index.mjs +588 -2922
- package/dist/server.d.mts +72 -0
- package/dist/server.d.ts +72 -0
- package/dist/server.js +5126 -0
- package/dist/server.mjs +2698 -0
- package/package.json +18 -4
- package/dist/HlsPlayer-DZNDKG2P.mjs +0 -7
- package/dist/chunk-DOKQUUH3.mjs +0 -414
|
@@ -0,0 +1,903 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
// src/components/controls/edit/MultilineTextInput.tsx
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
var MultilineTextInput = (props) => {
|
|
8
|
+
const textChangeHandler = (event) => {
|
|
9
|
+
const text = event.target.value;
|
|
10
|
+
if (props.callback !== void 0) {
|
|
11
|
+
props.callback(
|
|
12
|
+
{
|
|
13
|
+
name: props.name,
|
|
14
|
+
value: text,
|
|
15
|
+
index: props.index,
|
|
16
|
+
groupKey: props.groupKey
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
let value = "";
|
|
22
|
+
if (props.value !== void 0 && props.value !== null) {
|
|
23
|
+
value = props.value;
|
|
24
|
+
}
|
|
25
|
+
return /* @__PURE__ */ jsx(React.Fragment, { children: /* @__PURE__ */ jsxs("label", { className: "block mb-1", children: [
|
|
26
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
27
|
+
" ",
|
|
28
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ jsx("span", { className: "bg-error-weak", children: "*" }),
|
|
29
|
+
/* @__PURE__ */ jsx(
|
|
30
|
+
"textarea",
|
|
31
|
+
{
|
|
32
|
+
name: props.name,
|
|
33
|
+
id: props.name,
|
|
34
|
+
value,
|
|
35
|
+
onChange: textChangeHandler,
|
|
36
|
+
onBlur: props?.onBlur,
|
|
37
|
+
rows: 4,
|
|
38
|
+
required: props?.attributes?.required,
|
|
39
|
+
placeholder: props?.attributes?.placeholder,
|
|
40
|
+
maxLength: props?.attributes?.maxLength,
|
|
41
|
+
disabled: props?.attributes?.readOnly,
|
|
42
|
+
minLength: props?.attributes?.minLength,
|
|
43
|
+
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm input"
|
|
44
|
+
}
|
|
45
|
+
),
|
|
46
|
+
/* @__PURE__ */ jsx("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
47
|
+
] }) });
|
|
48
|
+
};
|
|
49
|
+
var MultilineTextInput_default = MultilineTextInput;
|
|
50
|
+
|
|
51
|
+
// src/components/controls/edit/LineTextInput.tsx
|
|
52
|
+
import React2 from "react";
|
|
53
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
54
|
+
var LineTextInput = (props) => {
|
|
55
|
+
const textChangeHandler = (event) => {
|
|
56
|
+
const text = event.target.value;
|
|
57
|
+
if (props.callback !== void 0) {
|
|
58
|
+
props.callback(
|
|
59
|
+
{
|
|
60
|
+
name: props.name,
|
|
61
|
+
value: text,
|
|
62
|
+
index: props.index,
|
|
63
|
+
groupKey: props.groupKey
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
let value = "";
|
|
69
|
+
if (props.value !== void 0 && props.value !== null) {
|
|
70
|
+
value = props.value;
|
|
71
|
+
}
|
|
72
|
+
return /* @__PURE__ */ jsx2(React2.Fragment, { children: /* @__PURE__ */ jsxs2("label", { className: "block", children: [
|
|
73
|
+
props?.attributes?.label && /* @__PURE__ */ jsx2("span", { className: "text-sm inline-block pb-1 font-medium ", children: props?.attributes?.label }),
|
|
74
|
+
" ",
|
|
75
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ jsx2("span", { className: "bg-error-weak !bg-transparent", children: "*" }),
|
|
76
|
+
/* @__PURE__ */ jsx2(
|
|
77
|
+
"input",
|
|
78
|
+
{
|
|
79
|
+
type: "text",
|
|
80
|
+
name: props.name,
|
|
81
|
+
id: props.name,
|
|
82
|
+
value,
|
|
83
|
+
onChange: textChangeHandler,
|
|
84
|
+
onBlur: props?.onBlur,
|
|
85
|
+
required: props?.attributes?.required,
|
|
86
|
+
placeholder: props?.attributes?.placeholder,
|
|
87
|
+
maxLength: props?.attributes?.maxLength,
|
|
88
|
+
pattern: props?.attributes?.pattern,
|
|
89
|
+
disabled: props?.attributes?.readOnly,
|
|
90
|
+
minLength: props?.attributes?.minLength,
|
|
91
|
+
className: `peer input mt-1 py-1.5 block w-full rounded shadow-sm transition-all duration-500 ease-in-out
|
|
92
|
+
${props?.inputClasses ? props.inputClasses : ``}
|
|
93
|
+
`
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
/* @__PURE__ */ jsx2("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
97
|
+
] }) });
|
|
98
|
+
};
|
|
99
|
+
var LineTextInput_default = LineTextInput;
|
|
100
|
+
|
|
101
|
+
// src/components/controls/edit/MoneyInput.tsx
|
|
102
|
+
import React3 from "react";
|
|
103
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
104
|
+
var MoneyInput = (props) => {
|
|
105
|
+
const textChangeHandler = (event) => {
|
|
106
|
+
const rawValue = event.target.value;
|
|
107
|
+
const numericValue = parseFloat(rawValue);
|
|
108
|
+
if (rawValue === "" || !isNaN(numericValue) && numericValue >= 0) {
|
|
109
|
+
if (props.callback !== void 0) {
|
|
110
|
+
props.callback({
|
|
111
|
+
name: props.name,
|
|
112
|
+
value: rawValue,
|
|
113
|
+
index: props.index,
|
|
114
|
+
groupKey: props.groupKey
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
const handleWheel = (event) => {
|
|
120
|
+
event.preventDefault();
|
|
121
|
+
event.target.blur();
|
|
122
|
+
};
|
|
123
|
+
let value;
|
|
124
|
+
if (props.value !== void 0 && props.value !== null) {
|
|
125
|
+
value = props.value;
|
|
126
|
+
}
|
|
127
|
+
const preventNegative = (e) => {
|
|
128
|
+
if (e.key === "-") {
|
|
129
|
+
e.preventDefault();
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
return /* @__PURE__ */ jsx3(React3.Fragment, { children: /* @__PURE__ */ jsxs3("label", { className: "block mb-1", children: [
|
|
133
|
+
/* @__PURE__ */ jsx3("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
134
|
+
" ",
|
|
135
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ jsx3("span", { className: "bg-error-weak", children: "*" }),
|
|
136
|
+
/* @__PURE__ */ jsx3(
|
|
137
|
+
"input",
|
|
138
|
+
{
|
|
139
|
+
type: "number",
|
|
140
|
+
name: props.name,
|
|
141
|
+
id: props.name,
|
|
142
|
+
value,
|
|
143
|
+
min: 0,
|
|
144
|
+
onChange: textChangeHandler,
|
|
145
|
+
onWheel: handleWheel,
|
|
146
|
+
onKeyDown: preventNegative,
|
|
147
|
+
required: props?.attributes?.required,
|
|
148
|
+
placeholder: props?.attributes?.placeholder,
|
|
149
|
+
maxLength: props?.attributes?.maxLength,
|
|
150
|
+
pattern: props?.attributes?.pattern,
|
|
151
|
+
disabled: props?.attributes?.readOnly,
|
|
152
|
+
minLength: props?.attributes?.minLength,
|
|
153
|
+
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm number-input"
|
|
154
|
+
}
|
|
155
|
+
),
|
|
156
|
+
/* @__PURE__ */ jsx3("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
157
|
+
] }) });
|
|
158
|
+
};
|
|
159
|
+
var MoneyInput_default = MoneyInput;
|
|
160
|
+
|
|
161
|
+
// src/components/controls/edit/PercentageInput.tsx
|
|
162
|
+
import React4 from "react";
|
|
163
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
164
|
+
var PercentageInput = (props) => {
|
|
165
|
+
const textChangeHandler = (event) => {
|
|
166
|
+
const rawValue = event.target.value;
|
|
167
|
+
const numericValue = parseFloat(rawValue);
|
|
168
|
+
if (rawValue === "" || !isNaN(numericValue) && numericValue >= 0) {
|
|
169
|
+
if (props.callback !== void 0) {
|
|
170
|
+
props.callback({
|
|
171
|
+
name: props.name,
|
|
172
|
+
value: rawValue,
|
|
173
|
+
index: props.index,
|
|
174
|
+
groupKey: props.groupKey
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
const handleWheel = (event) => {
|
|
180
|
+
event.preventDefault();
|
|
181
|
+
event.target.blur();
|
|
182
|
+
};
|
|
183
|
+
let value;
|
|
184
|
+
if (props.value !== void 0 && props.value !== null) {
|
|
185
|
+
value = props.value;
|
|
186
|
+
}
|
|
187
|
+
const preventNegative = (e) => {
|
|
188
|
+
if (e.key === "-") {
|
|
189
|
+
e.preventDefault();
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
return /* @__PURE__ */ jsx4(React4.Fragment, { children: /* @__PURE__ */ jsxs4("label", { className: "block mb-1", children: [
|
|
193
|
+
/* @__PURE__ */ jsx4("span", { className: "text-sm font-medium ", children: props?.attributes?.label ? props?.attributes?.label + " %" : "" }),
|
|
194
|
+
" ",
|
|
195
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ jsx4("span", { className: "bg-error-weak", children: "*" }),
|
|
196
|
+
/* @__PURE__ */ jsx4(
|
|
197
|
+
"input",
|
|
198
|
+
{
|
|
199
|
+
type: "number",
|
|
200
|
+
name: props.name,
|
|
201
|
+
id: props.name,
|
|
202
|
+
value,
|
|
203
|
+
min: 0,
|
|
204
|
+
onChange: textChangeHandler,
|
|
205
|
+
onKeyDown: preventNegative,
|
|
206
|
+
onWheel: handleWheel,
|
|
207
|
+
required: props?.attributes?.required,
|
|
208
|
+
placeholder: props?.attributes?.placeholder,
|
|
209
|
+
pattern: props?.attributes?.pattern,
|
|
210
|
+
disabled: props?.attributes?.readOnly,
|
|
211
|
+
max: "100",
|
|
212
|
+
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm number-input"
|
|
213
|
+
}
|
|
214
|
+
),
|
|
215
|
+
/* @__PURE__ */ jsx4("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
216
|
+
] }) });
|
|
217
|
+
};
|
|
218
|
+
var PercentageInput_default = PercentageInput;
|
|
219
|
+
|
|
220
|
+
// src/components/controls/edit/PhoneInput.tsx
|
|
221
|
+
import React5 from "react";
|
|
222
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
223
|
+
var PhoneInput = (props) => {
|
|
224
|
+
const textChangeHandler = (event) => {
|
|
225
|
+
const text = event.target.value;
|
|
226
|
+
if (props.callback !== void 0) {
|
|
227
|
+
props.callback(
|
|
228
|
+
{
|
|
229
|
+
name: props.name,
|
|
230
|
+
value: text,
|
|
231
|
+
index: props.index,
|
|
232
|
+
groupKey: props.groupKey
|
|
233
|
+
}
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
let value = "";
|
|
238
|
+
if (props.value !== void 0 && props.value !== null) {
|
|
239
|
+
value = props.value;
|
|
240
|
+
}
|
|
241
|
+
return /* @__PURE__ */ jsx5(React5.Fragment, { children: /* @__PURE__ */ jsxs5("label", { className: "block mb-1", children: [
|
|
242
|
+
/* @__PURE__ */ jsx5("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
243
|
+
" ",
|
|
244
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ jsx5("span", { className: "bg-error-weak", children: "*" }),
|
|
245
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center rounded border ", children: [
|
|
246
|
+
/* @__PURE__ */ jsx5("span", { className: "px-3", children: props.prefix }),
|
|
247
|
+
/* @__PURE__ */ jsx5(
|
|
248
|
+
"input",
|
|
249
|
+
{
|
|
250
|
+
type: "text",
|
|
251
|
+
name: props.name,
|
|
252
|
+
id: props.name,
|
|
253
|
+
value,
|
|
254
|
+
onChange: textChangeHandler,
|
|
255
|
+
required: props?.attributes?.required,
|
|
256
|
+
placeholder: props?.attributes?.placeholder,
|
|
257
|
+
maxLength: props?.attributes?.maxLength,
|
|
258
|
+
pattern: props?.attributes?.pattern,
|
|
259
|
+
disabled: props?.attributes?.readOnly,
|
|
260
|
+
minLength: props?.attributes?.minLength,
|
|
261
|
+
className: "py-1.5 block w-full outline-none border-0 mr-0.5"
|
|
262
|
+
}
|
|
263
|
+
)
|
|
264
|
+
] }),
|
|
265
|
+
/* @__PURE__ */ jsx5("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
266
|
+
] }) });
|
|
267
|
+
};
|
|
268
|
+
var PhoneInput_default = PhoneInput;
|
|
269
|
+
|
|
270
|
+
// src/components/controls/edit/NumberInput.tsx
|
|
271
|
+
import React6 from "react";
|
|
272
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
273
|
+
var NumberInput = (props) => {
|
|
274
|
+
const textChangeHandler = (event) => {
|
|
275
|
+
const text = event.target.value;
|
|
276
|
+
if (props.callback !== void 0) {
|
|
277
|
+
props.callback(
|
|
278
|
+
{
|
|
279
|
+
name: props.name,
|
|
280
|
+
value: text,
|
|
281
|
+
index: props.index,
|
|
282
|
+
groupKey: props.groupKey
|
|
283
|
+
}
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
const handleWheel = (event) => {
|
|
288
|
+
event.preventDefault();
|
|
289
|
+
event.target.blur();
|
|
290
|
+
};
|
|
291
|
+
let value;
|
|
292
|
+
if (props.value !== void 0 && props.value !== null) {
|
|
293
|
+
value = props.value;
|
|
294
|
+
}
|
|
295
|
+
return /* @__PURE__ */ jsx6(React6.Fragment, { children: /* @__PURE__ */ jsxs6("label", { className: "block", children: [
|
|
296
|
+
props?.attributes?.label && /* @__PURE__ */ jsx6("span", { className: "text-sm inline-block pb-1 font-medium ", children: props?.attributes?.label }),
|
|
297
|
+
" ",
|
|
298
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ jsx6("span", { className: "bg-error-weak", children: "*" }),
|
|
299
|
+
/* @__PURE__ */ jsx6(
|
|
300
|
+
"input",
|
|
301
|
+
{
|
|
302
|
+
type: "number",
|
|
303
|
+
name: props.name,
|
|
304
|
+
id: props.name,
|
|
305
|
+
value,
|
|
306
|
+
onChange: textChangeHandler,
|
|
307
|
+
onWheel: handleWheel,
|
|
308
|
+
required: props?.attributes?.required,
|
|
309
|
+
placeholder: props?.attributes?.placeholder,
|
|
310
|
+
onBlur: props?.onBlur,
|
|
311
|
+
pattern: props?.attributes?.pattern,
|
|
312
|
+
disabled: props?.attributes?.readOnly,
|
|
313
|
+
max: props?.attributes?.maxValue,
|
|
314
|
+
min: props?.attributes?.minValue,
|
|
315
|
+
className: "peer py-1.5 block w-full rounded shadow-sm number-input input\n disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none\n "
|
|
316
|
+
}
|
|
317
|
+
),
|
|
318
|
+
/* @__PURE__ */ jsx6("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
319
|
+
] }) });
|
|
320
|
+
};
|
|
321
|
+
var NumberInput_default = NumberInput;
|
|
322
|
+
|
|
323
|
+
// src/components/controls/edit/CheckboxInput.tsx
|
|
324
|
+
import React7 from "react";
|
|
325
|
+
import { Fragment, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
326
|
+
var CheckboxInput = (props) => {
|
|
327
|
+
const textChangeHandler = (event) => {
|
|
328
|
+
let text = event.target.checked;
|
|
329
|
+
if (props.callback !== void 0) {
|
|
330
|
+
props.callback({
|
|
331
|
+
name: props.name,
|
|
332
|
+
value: text,
|
|
333
|
+
index: props.index,
|
|
334
|
+
groupKey: props.groupKey
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
let value = false;
|
|
339
|
+
if (props.value != void 0 && props.value != null && props.value != "" && (props.value == "true" || props.value.toString() == "true")) {
|
|
340
|
+
value = true;
|
|
341
|
+
}
|
|
342
|
+
return /* @__PURE__ */ jsx7(React7.Fragment, { children: /* @__PURE__ */ jsxs7("div", { className: "mb-1", children: [
|
|
343
|
+
props?.attributes?.label && /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
344
|
+
/* @__PURE__ */ jsx7(
|
|
345
|
+
"label",
|
|
346
|
+
{
|
|
347
|
+
htmlFor: props.name,
|
|
348
|
+
className: "inline-block text-sm font-medium",
|
|
349
|
+
children: props.attributes.label
|
|
350
|
+
}
|
|
351
|
+
),
|
|
352
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ jsx7("span", { className: "bg-error-weak", children: "*" })
|
|
353
|
+
] }),
|
|
354
|
+
/* @__PURE__ */ jsx7(
|
|
355
|
+
"input",
|
|
356
|
+
{
|
|
357
|
+
type: "checkbox",
|
|
358
|
+
name: props.name,
|
|
359
|
+
id: props.name,
|
|
360
|
+
checked: value,
|
|
361
|
+
onChange: textChangeHandler,
|
|
362
|
+
required: props?.attributes?.required,
|
|
363
|
+
placeholder: props?.attributes?.placeholder,
|
|
364
|
+
maxLength: props?.attributes?.maxLength,
|
|
365
|
+
pattern: props?.attributes?.pattern,
|
|
366
|
+
disabled: props?.attributes?.readOnly,
|
|
367
|
+
minLength: props?.attributes?.minLength,
|
|
368
|
+
className: "peer mt-1 py-1.5 block rounded shadow-sm\n disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none\n "
|
|
369
|
+
}
|
|
370
|
+
),
|
|
371
|
+
/* @__PURE__ */ jsx7("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage || "" })
|
|
372
|
+
] }) });
|
|
373
|
+
};
|
|
374
|
+
var CheckboxInput_default = CheckboxInput;
|
|
375
|
+
|
|
376
|
+
// src/components/controls/edit/OtpInput.tsx
|
|
377
|
+
import React8 from "react";
|
|
378
|
+
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
379
|
+
var OtpInput = (props) => {
|
|
380
|
+
const textChangeHandler = (event) => {
|
|
381
|
+
const text = event.target.value;
|
|
382
|
+
if (props.callback !== void 0) {
|
|
383
|
+
props.callback(
|
|
384
|
+
{
|
|
385
|
+
name: props.name,
|
|
386
|
+
value: text,
|
|
387
|
+
index: props.index,
|
|
388
|
+
groupKey: props.groupKey
|
|
389
|
+
}
|
|
390
|
+
);
|
|
391
|
+
}
|
|
392
|
+
};
|
|
393
|
+
const handleWheel = (event) => {
|
|
394
|
+
event.preventDefault();
|
|
395
|
+
};
|
|
396
|
+
let value;
|
|
397
|
+
if (props.value !== void 0 && props.value !== null) {
|
|
398
|
+
value = props.value;
|
|
399
|
+
}
|
|
400
|
+
return /* @__PURE__ */ jsx8(React8.Fragment, { children: /* @__PURE__ */ jsxs8("label", { htmlFor: props.name, className: "block mb-1 w-full", children: [
|
|
401
|
+
/* @__PURE__ */ jsx8("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
402
|
+
" ",
|
|
403
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ jsx8("span", { className: "bg-error-weak", children: "*" }),
|
|
404
|
+
/* @__PURE__ */ jsx8(
|
|
405
|
+
"input",
|
|
406
|
+
{
|
|
407
|
+
type: "text",
|
|
408
|
+
name: props.name,
|
|
409
|
+
id: props.name,
|
|
410
|
+
value,
|
|
411
|
+
onChange: textChangeHandler,
|
|
412
|
+
autoComplete: "off",
|
|
413
|
+
required: props?.attributes?.required,
|
|
414
|
+
placeholder: props?.attributes?.placeholder,
|
|
415
|
+
maxLength: 4,
|
|
416
|
+
pattern: props?.attributes?.pattern,
|
|
417
|
+
disabled: props?.attributes?.readOnly,
|
|
418
|
+
minLength: props?.attributes?.minLength,
|
|
419
|
+
autoFocus: props?.attributes?.autoFocus,
|
|
420
|
+
onWheel: handleWheel,
|
|
421
|
+
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm tracking-[1.25em] text-center"
|
|
422
|
+
}
|
|
423
|
+
),
|
|
424
|
+
/* @__PURE__ */ jsx8("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
425
|
+
] }) });
|
|
426
|
+
};
|
|
427
|
+
var OtpInput_default = OtpInput;
|
|
428
|
+
|
|
429
|
+
// src/components/controls/edit/DateTimeInput.tsx
|
|
430
|
+
import React9 from "react";
|
|
431
|
+
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
432
|
+
var DateTimeInput = (props) => {
|
|
433
|
+
const textChangeHandler = (event) => {
|
|
434
|
+
const localDate = new Date(event.target.value);
|
|
435
|
+
if (props.callback !== void 0) {
|
|
436
|
+
const utcISOString = localDate.toISOString();
|
|
437
|
+
props.callback({
|
|
438
|
+
name: props.name,
|
|
439
|
+
value: utcISOString,
|
|
440
|
+
index: props.index,
|
|
441
|
+
groupKey: props.groupKey
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
};
|
|
445
|
+
let value;
|
|
446
|
+
let localvalue;
|
|
447
|
+
let timeZoneAbbr;
|
|
448
|
+
if (props.value !== void 0 && props.value !== null) {
|
|
449
|
+
value = props.value;
|
|
450
|
+
const now = /* @__PURE__ */ new Date();
|
|
451
|
+
const offsetMinutes = now.getTimezoneOffset();
|
|
452
|
+
const offsetMilliseconds = offsetMinutes * 60 * 1e3;
|
|
453
|
+
const valDate = value.toString().includes("Z") ? new Date(value) : /* @__PURE__ */ new Date(value + "Z");
|
|
454
|
+
const localDate = new Date(valDate.getTime() - offsetMilliseconds);
|
|
455
|
+
timeZoneAbbr = now.toLocaleTimeString("en", { timeZoneName: "short" }).split(" ")[2];
|
|
456
|
+
localvalue = localDate?.toISOString()?.slice(0, 16);
|
|
457
|
+
}
|
|
458
|
+
const handleKeyDown = (e) => {
|
|
459
|
+
if (e.key === "Backspace") {
|
|
460
|
+
e.preventDefault();
|
|
461
|
+
}
|
|
462
|
+
};
|
|
463
|
+
return /* @__PURE__ */ jsx9(React9.Fragment, { children: /* @__PURE__ */ jsxs9("label", { className: "block mb-1", children: [
|
|
464
|
+
/* @__PURE__ */ jsx9("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
465
|
+
" ",
|
|
466
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ jsx9("span", { className: "bg-error-weak", children: "*" }),
|
|
467
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-2", children: [
|
|
468
|
+
/* @__PURE__ */ jsx9(
|
|
469
|
+
"input",
|
|
470
|
+
{
|
|
471
|
+
type: "datetime-local",
|
|
472
|
+
name: props.name,
|
|
473
|
+
id: props.name,
|
|
474
|
+
value: localvalue,
|
|
475
|
+
onChange: textChangeHandler,
|
|
476
|
+
onKeyDown: handleKeyDown,
|
|
477
|
+
required: props?.attributes?.required,
|
|
478
|
+
placeholder: props?.attributes?.placeholder,
|
|
479
|
+
maxLength: props?.attributes?.maxLength,
|
|
480
|
+
pattern: props?.attributes?.pattern,
|
|
481
|
+
disabled: props?.attributes?.readOnly,
|
|
482
|
+
minLength: props?.attributes?.minLength,
|
|
483
|
+
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm\n disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none\n "
|
|
484
|
+
}
|
|
485
|
+
),
|
|
486
|
+
/* @__PURE__ */ jsx9("span", { children: timeZoneAbbr })
|
|
487
|
+
] }),
|
|
488
|
+
/* @__PURE__ */ jsx9("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
489
|
+
] }) });
|
|
490
|
+
};
|
|
491
|
+
var DateTimeInput_default = DateTimeInput;
|
|
492
|
+
|
|
493
|
+
// src/components/controls/edit/ColorInput.tsx
|
|
494
|
+
import React10, { useEffect } from "react";
|
|
495
|
+
import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
496
|
+
var ColorInput = (props) => {
|
|
497
|
+
const [color, setColor] = React10.useState("#3b82f6");
|
|
498
|
+
useEffect(() => {
|
|
499
|
+
if (props.value !== void 0 && props.value !== null) {
|
|
500
|
+
if (typeof props.value === "string") {
|
|
501
|
+
setColor(props.value);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
}, [props.value]);
|
|
505
|
+
const handleColorChange = (event) => {
|
|
506
|
+
const newColor = event.target.value;
|
|
507
|
+
setColor(newColor);
|
|
508
|
+
if (props.callback) {
|
|
509
|
+
props.callback({
|
|
510
|
+
name: props.name,
|
|
511
|
+
value: newColor,
|
|
512
|
+
index: props.index,
|
|
513
|
+
groupKey: props.groupKey
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
};
|
|
517
|
+
return /* @__PURE__ */ jsxs10("label", { className: "block mb-1", children: [
|
|
518
|
+
/* @__PURE__ */ jsx10("span", { className: "text-sm font-medium", children: props?.attributes?.label }),
|
|
519
|
+
" ",
|
|
520
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ jsx10("span", { className: "bg-error-weak", children: "*" }),
|
|
521
|
+
/* @__PURE__ */ jsx10(
|
|
522
|
+
"input",
|
|
523
|
+
{
|
|
524
|
+
type: "color",
|
|
525
|
+
name: props.name,
|
|
526
|
+
title: color,
|
|
527
|
+
id: props.name,
|
|
528
|
+
value: color,
|
|
529
|
+
onChange: handleColorChange,
|
|
530
|
+
required: props?.attributes?.required,
|
|
531
|
+
className: `w-[78px] h-12 block cursor-pointer`
|
|
532
|
+
}
|
|
533
|
+
),
|
|
534
|
+
props?.attributes?.errorMessage && /* @__PURE__ */ jsx10("p", { className: "mt-1 bg-error-weak text-sm", children: props.attributes.errorMessage })
|
|
535
|
+
] });
|
|
536
|
+
};
|
|
537
|
+
var ColorInput_default = ColorInput;
|
|
538
|
+
|
|
539
|
+
// src/components/controls/edit/SelectWithSearchInput.tsx
|
|
540
|
+
import { useEffect as useEffect2, useRef, useState } from "react";
|
|
541
|
+
import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
542
|
+
var SelectWithSearchInput = (props) => {
|
|
543
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
544
|
+
const [searchTerm, setSearchTerm] = useState("");
|
|
545
|
+
const [highlightedIndex, setHighlightedIndex] = useState(-1);
|
|
546
|
+
const [selectedItem, setSelectedItem] = useState(null);
|
|
547
|
+
const [list, setList] = useState([]);
|
|
548
|
+
useEffect2(() => {
|
|
549
|
+
async function fetchData() {
|
|
550
|
+
if (props.dataset) {
|
|
551
|
+
setList(props.dataset);
|
|
552
|
+
} else if (props.dataSource && props.serviceClient) {
|
|
553
|
+
let dataSource = props.dataSource;
|
|
554
|
+
if (props.dataSourceDependsOn && props.dependentValue) {
|
|
555
|
+
dataSource = dataSource.replace(
|
|
556
|
+
`{${props.dataSourceDependsOn}}`,
|
|
557
|
+
props.dependentValue
|
|
558
|
+
);
|
|
559
|
+
}
|
|
560
|
+
const response = await props.serviceClient.get(dataSource);
|
|
561
|
+
if (response?.result) setList(response.result);
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
fetchData();
|
|
565
|
+
}, [
|
|
566
|
+
props.dataSource,
|
|
567
|
+
props.dependentValue,
|
|
568
|
+
props.dataset,
|
|
569
|
+
props.dataSourceDependsOn
|
|
570
|
+
]);
|
|
571
|
+
const filteredItems = list?.filter(
|
|
572
|
+
(item) => item[props?.dataTextFieldName]?.toLowerCase().includes(searchTerm.toLowerCase())
|
|
573
|
+
);
|
|
574
|
+
const handleSelect = (event, item) => {
|
|
575
|
+
event.preventDefault();
|
|
576
|
+
setSearchTerm(item[props.dataTextFieldName]);
|
|
577
|
+
setSelectedItem(item);
|
|
578
|
+
setIsOpen(false);
|
|
579
|
+
setHighlightedIndex(-1);
|
|
580
|
+
if (props.callback) {
|
|
581
|
+
props.callback({
|
|
582
|
+
name: props.name,
|
|
583
|
+
value: item[props.dataKeyFieldName],
|
|
584
|
+
index: props.index,
|
|
585
|
+
groupKey: props.groupKey
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
};
|
|
589
|
+
const handleKeyDown = (e) => {
|
|
590
|
+
if (e.key === "ArrowDown") {
|
|
591
|
+
setHighlightedIndex(
|
|
592
|
+
(prev) => prev < filteredItems.length - 1 ? prev + 1 : 0
|
|
593
|
+
);
|
|
594
|
+
} else if (e.key === "ArrowUp") {
|
|
595
|
+
setHighlightedIndex(
|
|
596
|
+
(prev) => prev > 0 ? prev - 1 : filteredItems.length - 1
|
|
597
|
+
);
|
|
598
|
+
} else if (e.key === "Enter" && highlightedIndex >= 0) {
|
|
599
|
+
handleSelect(e, filteredItems[highlightedIndex]);
|
|
600
|
+
}
|
|
601
|
+
};
|
|
602
|
+
const dropdownRef = useRef(null);
|
|
603
|
+
useEffect2(() => {
|
|
604
|
+
if (highlightedIndex >= 0 && dropdownRef.current) {
|
|
605
|
+
const highlightedItem = dropdownRef.current.children[highlightedIndex];
|
|
606
|
+
highlightedItem?.scrollIntoView({
|
|
607
|
+
behavior: "smooth",
|
|
608
|
+
block: "nearest"
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
}, [highlightedIndex]);
|
|
612
|
+
return /* @__PURE__ */ jsxs11("div", { className: "relative", children: [
|
|
613
|
+
/* @__PURE__ */ jsxs11("label", { children: [
|
|
614
|
+
props.attributes?.label,
|
|
615
|
+
" ",
|
|
616
|
+
" ",
|
|
617
|
+
props?.attributes?.required && /* @__PURE__ */ jsx11("span", { className: "bg-error-weak", children: "*" })
|
|
618
|
+
] }),
|
|
619
|
+
/* @__PURE__ */ jsxs11("div", { className: "relative", children: [
|
|
620
|
+
/* @__PURE__ */ jsx11(
|
|
621
|
+
"input",
|
|
622
|
+
{
|
|
623
|
+
type: "text",
|
|
624
|
+
value: searchTerm,
|
|
625
|
+
onChange: (e) => {
|
|
626
|
+
setSearchTerm(e.target.value);
|
|
627
|
+
setIsOpen(true);
|
|
628
|
+
setHighlightedIndex(-1);
|
|
629
|
+
},
|
|
630
|
+
onFocus: () => setIsOpen(true),
|
|
631
|
+
onKeyDown: handleKeyDown,
|
|
632
|
+
placeholder: "Select or search for a name",
|
|
633
|
+
className: "peer py-1.5 select block w-full text-black rounded border-gray-300 shadow-sm\n focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50\n disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none\n "
|
|
634
|
+
}
|
|
635
|
+
),
|
|
636
|
+
/* @__PURE__ */ jsx11(
|
|
637
|
+
"button",
|
|
638
|
+
{
|
|
639
|
+
type: "button",
|
|
640
|
+
onClick: () => setIsOpen(!isOpen),
|
|
641
|
+
className: "absolute right-2 top-3 h-5 w-5 text-gray-500 focus:outline-none",
|
|
642
|
+
children: /* @__PURE__ */ jsx11(
|
|
643
|
+
"svg",
|
|
644
|
+
{
|
|
645
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
646
|
+
fill: "none",
|
|
647
|
+
viewBox: "0 0 24 24",
|
|
648
|
+
strokeWidth: 1.5,
|
|
649
|
+
stroke: "currentColor",
|
|
650
|
+
className: "w-full h-full",
|
|
651
|
+
children: /* @__PURE__ */ jsx11(
|
|
652
|
+
"path",
|
|
653
|
+
{
|
|
654
|
+
strokeLinecap: "round",
|
|
655
|
+
strokeLinejoin: "round",
|
|
656
|
+
d: "M19.5 8.25l-7.5 7.5-7.5-7.5"
|
|
657
|
+
}
|
|
658
|
+
)
|
|
659
|
+
}
|
|
660
|
+
)
|
|
661
|
+
}
|
|
662
|
+
)
|
|
663
|
+
] }),
|
|
664
|
+
isOpen && /* @__PURE__ */ jsx11(
|
|
665
|
+
"div",
|
|
666
|
+
{
|
|
667
|
+
ref: dropdownRef,
|
|
668
|
+
className: "absolute z-10 mt-2 w-full bg-white border border-gray-200 rounded-md shadow-lg max-h-48 overflow-y-auto",
|
|
669
|
+
children: filteredItems.length > 0 ? filteredItems.map((item, index) => /* @__PURE__ */ jsx11(
|
|
670
|
+
"button",
|
|
671
|
+
{
|
|
672
|
+
onClick: (e) => handleSelect(e, item),
|
|
673
|
+
className: `w-full px-4 py-2 flex items-center space-x-2 text-left ${index === highlightedIndex ? "bg-gray-200" : "hover:bg-gray-100"}`,
|
|
674
|
+
role: "option",
|
|
675
|
+
tabIndex: -1,
|
|
676
|
+
onMouseEnter: () => setHighlightedIndex(index),
|
|
677
|
+
children: /* @__PURE__ */ jsx11("span", { children: item[props.dataTextFieldName] })
|
|
678
|
+
},
|
|
679
|
+
item[props.dataKeyFieldName]
|
|
680
|
+
)) : /* @__PURE__ */ jsx11("div", { className: "px-4 py-2 text-gray-500", children: "No results found" })
|
|
681
|
+
}
|
|
682
|
+
)
|
|
683
|
+
] });
|
|
684
|
+
};
|
|
685
|
+
var SelectWithSearchInput_default = SelectWithSearchInput;
|
|
686
|
+
|
|
687
|
+
// src/components/controls/edit/BooleanSelect.tsx
|
|
688
|
+
import React12, {
|
|
689
|
+
useState as useState2,
|
|
690
|
+
useEffect as useEffect3
|
|
691
|
+
} from "react";
|
|
692
|
+
import { jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
693
|
+
var BooleanSelect = (props) => {
|
|
694
|
+
const [list, setList] = useState2();
|
|
695
|
+
const textChangeHandler = (event) => {
|
|
696
|
+
const text = event.target.value;
|
|
697
|
+
const boolValue = text?.toLowerCase() === "true" || text === "1";
|
|
698
|
+
if (props.callback !== void 0) {
|
|
699
|
+
props.callback({
|
|
700
|
+
name: props.name,
|
|
701
|
+
value: boolValue,
|
|
702
|
+
index: props.index,
|
|
703
|
+
groupKey: props.groupKey
|
|
704
|
+
});
|
|
705
|
+
}
|
|
706
|
+
};
|
|
707
|
+
useEffect3(() => {
|
|
708
|
+
async function fetchData() {
|
|
709
|
+
console.log("in select");
|
|
710
|
+
if (props.dataset) {
|
|
711
|
+
setList(props.dataset);
|
|
712
|
+
} else if (props.dataSource && props.dataSource != "" && props.serviceClient) {
|
|
713
|
+
let dataSource = props.dataSource;
|
|
714
|
+
let response;
|
|
715
|
+
if (props.dataSourceDependsOn) {
|
|
716
|
+
if (props.dependentValue) {
|
|
717
|
+
dataSource = dataSource.replace(
|
|
718
|
+
`{${props.dataSourceDependsOn}}`,
|
|
719
|
+
props.dependentValue
|
|
720
|
+
);
|
|
721
|
+
response = await props.serviceClient.get(dataSource);
|
|
722
|
+
setList(response.result);
|
|
723
|
+
}
|
|
724
|
+
} else {
|
|
725
|
+
response = await props.serviceClient.get(dataSource);
|
|
726
|
+
setList(response.result);
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
fetchData();
|
|
731
|
+
}, [
|
|
732
|
+
props.dataSource,
|
|
733
|
+
props.dependentValue,
|
|
734
|
+
props.dataset,
|
|
735
|
+
props.dataSourceDependsOn
|
|
736
|
+
]);
|
|
737
|
+
let value;
|
|
738
|
+
if (props.value !== void 0 && props.value !== null) {
|
|
739
|
+
value = props.value;
|
|
740
|
+
}
|
|
741
|
+
return /* @__PURE__ */ jsx12(React12.Fragment, { children: /* @__PURE__ */ jsxs12("label", { className: "block", children: [
|
|
742
|
+
/* @__PURE__ */ jsx12("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
743
|
+
" ",
|
|
744
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ jsx12("span", { className: "bg-error-weak", children: "*" }),
|
|
745
|
+
/* @__PURE__ */ jsxs12(
|
|
746
|
+
"select",
|
|
747
|
+
{
|
|
748
|
+
name: props.name,
|
|
749
|
+
id: props.name,
|
|
750
|
+
value,
|
|
751
|
+
onChange: textChangeHandler,
|
|
752
|
+
required: props?.attributes?.required,
|
|
753
|
+
placeholder: props?.attributes?.placeholder,
|
|
754
|
+
disabled: props?.attributes?.readOnly,
|
|
755
|
+
className: "peer mt-1 py-1.5 block w-full text-black rounded shadow-sm\n disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none\n ",
|
|
756
|
+
children: [
|
|
757
|
+
/* @__PURE__ */ jsx12("option", { className: "", value: "", children: props.attributes?.placeholder || "Select" }),
|
|
758
|
+
list && list.map((item, i) => {
|
|
759
|
+
return /* @__PURE__ */ jsx12(
|
|
760
|
+
"option",
|
|
761
|
+
{
|
|
762
|
+
className: "fac-select-option",
|
|
763
|
+
value: item[props.dataKeyFieldName],
|
|
764
|
+
children: item[props.dataTextFieldName]
|
|
765
|
+
},
|
|
766
|
+
item[props.dataKeyFieldName]
|
|
767
|
+
);
|
|
768
|
+
})
|
|
769
|
+
]
|
|
770
|
+
}
|
|
771
|
+
),
|
|
772
|
+
/* @__PURE__ */ jsx12("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
773
|
+
] }) });
|
|
774
|
+
};
|
|
775
|
+
var BooleanSelect_default = BooleanSelect;
|
|
776
|
+
|
|
777
|
+
// src/components/controls/edit/EmailInput.tsx
|
|
778
|
+
import React13 from "react";
|
|
779
|
+
import { jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
780
|
+
var EmailInput = (props) => {
|
|
781
|
+
const textChangeHandler = (event) => {
|
|
782
|
+
const text = event.target.value;
|
|
783
|
+
if (text) {
|
|
784
|
+
const atIndex = text.indexOf("@");
|
|
785
|
+
const dotIndex = text.indexOf(".", atIndex);
|
|
786
|
+
if (dotIndex < atIndex || text.length - dotIndex <= 2) {
|
|
787
|
+
event.target.setCustomValidity("invaild-value");
|
|
788
|
+
} else {
|
|
789
|
+
event.target.setCustomValidity("");
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
if (props.callback !== void 0) {
|
|
793
|
+
props.callback({
|
|
794
|
+
name: props.name,
|
|
795
|
+
value: text,
|
|
796
|
+
index: props.index
|
|
797
|
+
});
|
|
798
|
+
}
|
|
799
|
+
};
|
|
800
|
+
let value = "";
|
|
801
|
+
if (props.value !== void 0 && props.value !== null) {
|
|
802
|
+
value = props.value;
|
|
803
|
+
}
|
|
804
|
+
return /* @__PURE__ */ jsx13(React13.Fragment, { children: /* @__PURE__ */ jsxs13("label", { className: "block mb-1", children: [
|
|
805
|
+
/* @__PURE__ */ jsx13("span", { className: "text-sm font-medium text-slate-700", children: props?.attributes?.label }),
|
|
806
|
+
" ",
|
|
807
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ jsx13("span", { className: "bg-error-weak", children: "*" }),
|
|
808
|
+
/* @__PURE__ */ jsx13(
|
|
809
|
+
"input",
|
|
810
|
+
{
|
|
811
|
+
type: "email",
|
|
812
|
+
name: props.name,
|
|
813
|
+
id: props.name,
|
|
814
|
+
value,
|
|
815
|
+
onChange: textChangeHandler,
|
|
816
|
+
required: props?.attributes?.required,
|
|
817
|
+
placeholder: props?.attributes?.placeholder,
|
|
818
|
+
maxLength: props?.attributes?.maxLength,
|
|
819
|
+
disabled: props?.attributes?.readOnly,
|
|
820
|
+
minLength: props?.attributes?.minLength,
|
|
821
|
+
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm\n transition-all duration-500 ease-in-out"
|
|
822
|
+
}
|
|
823
|
+
),
|
|
824
|
+
/* @__PURE__ */ jsx13("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 mb-0 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
825
|
+
] }) });
|
|
826
|
+
};
|
|
827
|
+
var EmailInput_default = EmailInput;
|
|
828
|
+
|
|
829
|
+
// src/components/controls/edit/TimeInput.tsx
|
|
830
|
+
import React14 from "react";
|
|
831
|
+
import { jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
832
|
+
var TimeInput = (props) => {
|
|
833
|
+
const timeChangeHandler = (event) => {
|
|
834
|
+
const timeValue = event.target.value;
|
|
835
|
+
if (props.callback) {
|
|
836
|
+
props.callback({
|
|
837
|
+
name: props.name,
|
|
838
|
+
value: timeValue,
|
|
839
|
+
index: props.index,
|
|
840
|
+
groupKey: props.groupKey
|
|
841
|
+
});
|
|
842
|
+
}
|
|
843
|
+
};
|
|
844
|
+
return /* @__PURE__ */ jsx14(React14.Fragment, { children: /* @__PURE__ */ jsxs14("label", { className: "block mb-1", children: [
|
|
845
|
+
/* @__PURE__ */ jsx14("span", { className: "text-sm font-medium", children: props?.attributes?.label }),
|
|
846
|
+
" ",
|
|
847
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ jsx14("span", { className: "bg-error-weak", children: "*" }),
|
|
848
|
+
/* @__PURE__ */ jsx14("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx14(
|
|
849
|
+
"input",
|
|
850
|
+
{
|
|
851
|
+
type: "time",
|
|
852
|
+
name: props.name,
|
|
853
|
+
id: props.name,
|
|
854
|
+
value: typeof props.value === "boolean" ? "" : props.value ?? "",
|
|
855
|
+
onChange: timeChangeHandler,
|
|
856
|
+
required: props?.attributes?.required,
|
|
857
|
+
disabled: props?.attributes?.readOnly,
|
|
858
|
+
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm\n disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none"
|
|
859
|
+
}
|
|
860
|
+
) }),
|
|
861
|
+
/* @__PURE__ */ jsx14("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ?? "" })
|
|
862
|
+
] }) });
|
|
863
|
+
};
|
|
864
|
+
var TimeInput_default = TimeInput;
|
|
865
|
+
|
|
866
|
+
// src/components/utilities/AssetUtility.tsx
|
|
867
|
+
var AssetUtility = class {
|
|
868
|
+
constructor() {
|
|
869
|
+
}
|
|
870
|
+
static resolveUrl(assetBaseUrl, url) {
|
|
871
|
+
if (!url) return void 0;
|
|
872
|
+
if (url.startsWith("http")) return url;
|
|
873
|
+
if (!assetBaseUrl) return url;
|
|
874
|
+
return `${assetBaseUrl}/${url}`;
|
|
875
|
+
}
|
|
876
|
+
// // static getAssetUrl(apiBaseUrl: string) {
|
|
877
|
+
// // let domainName = apiBaseUrl.replace("https://", "");
|
|
878
|
+
// // return `https://cdn.g-assets.com/${domainName}`;
|
|
879
|
+
// // }
|
|
880
|
+
// static getAssetFullPath(apiBaseUrl: string, relativePath: string) {
|
|
881
|
+
// const domainName = apiBaseUrl.replace("https://", "");
|
|
882
|
+
// return `https://cdn.g-assets.com/${domainName}/${relativePath}`;
|
|
883
|
+
// }
|
|
884
|
+
};
|
|
885
|
+
var AssetUtility_default = AssetUtility;
|
|
886
|
+
|
|
887
|
+
export {
|
|
888
|
+
AssetUtility_default,
|
|
889
|
+
MultilineTextInput_default,
|
|
890
|
+
LineTextInput_default,
|
|
891
|
+
MoneyInput_default,
|
|
892
|
+
PercentageInput_default,
|
|
893
|
+
PhoneInput_default,
|
|
894
|
+
NumberInput_default,
|
|
895
|
+
CheckboxInput_default,
|
|
896
|
+
OtpInput_default,
|
|
897
|
+
DateTimeInput_default,
|
|
898
|
+
ColorInput_default,
|
|
899
|
+
SelectWithSearchInput_default,
|
|
900
|
+
BooleanSelect_default,
|
|
901
|
+
EmailInput_default,
|
|
902
|
+
TimeInput_default
|
|
903
|
+
};
|