@clyrex-digital/clyrex-controls-dev 0.8.1-dev.20260724042342 → 0.8.1-dev.20260724091414
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/{InputControlClient-TE33BZ6U.mjs → InputControlClient-7JD36O2O.mjs} +39 -6
- package/dist/{Pagination-BETIPTVF.mjs → Pagination-Y7PNQUJ2.mjs} +2 -2
- package/dist/{chunk-HAGCF2RO.mjs → chunk-6F7QBX3H.mjs} +1 -1
- package/dist/{chunk-TMVO22U3.mjs → chunk-6MHIZOLR.mjs} +1 -1
- package/dist/{chunk-BAGK3UOE.mjs → chunk-GFVCUX6O.mjs} +6 -6
- package/dist/index.js +43 -10
- package/dist/index.mjs +5 -5
- package/package.json +1 -1
|
@@ -20,12 +20,12 @@ import {
|
|
|
20
20
|
SelectWithSearchInput_default,
|
|
21
21
|
Switcher_default,
|
|
22
22
|
TimeInput_default
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-6F7QBX3H.mjs";
|
|
24
24
|
import {
|
|
25
25
|
Hyperlink,
|
|
26
26
|
Icon_default,
|
|
27
27
|
InputControlType_default
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-GFVCUX6O.mjs";
|
|
29
29
|
import {
|
|
30
30
|
Button_default,
|
|
31
31
|
ClientButton_default
|
|
@@ -39,7 +39,7 @@ import React5 from "react";
|
|
|
39
39
|
import { useState, useEffect } from "react";
|
|
40
40
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
41
41
|
var Select = (props) => {
|
|
42
|
-
const [list, setList] = useState(
|
|
42
|
+
const [list, setList] = useState();
|
|
43
43
|
const getSafeValue = (val) => {
|
|
44
44
|
if (val === null || val === void 0) return "";
|
|
45
45
|
if (typeof val === "boolean") return val ? "1" : "0";
|
|
@@ -68,6 +68,14 @@ var Select = (props) => {
|
|
|
68
68
|
groupKey: props.groupKey
|
|
69
69
|
});
|
|
70
70
|
};
|
|
71
|
+
const inputChangeHandler = (event) => {
|
|
72
|
+
props.callback?.({
|
|
73
|
+
name: props.name,
|
|
74
|
+
value: event.target.value,
|
|
75
|
+
index: props.index,
|
|
76
|
+
groupKey: props.groupKey
|
|
77
|
+
});
|
|
78
|
+
};
|
|
71
79
|
useEffect(() => {
|
|
72
80
|
async function fetchData() {
|
|
73
81
|
if (props.dataset) {
|
|
@@ -77,7 +85,11 @@ var Select = (props) => {
|
|
|
77
85
|
if (props.dataSource && props.serviceClient) {
|
|
78
86
|
let dataSource = props.dataSource;
|
|
79
87
|
let response;
|
|
80
|
-
if (props.dataSourceDependsOn
|
|
88
|
+
if (props.dataSourceDependsOn) {
|
|
89
|
+
if (!props.dependentValue) {
|
|
90
|
+
setList([]);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
81
93
|
dataSource = dataSource.replace(
|
|
82
94
|
`{${props.dataSourceDependsOn}}`,
|
|
83
95
|
props.dependentValue
|
|
@@ -85,7 +97,9 @@ var Select = (props) => {
|
|
|
85
97
|
}
|
|
86
98
|
response = await props.serviceClient.get(dataSource);
|
|
87
99
|
setList(response.result ?? []);
|
|
100
|
+
return;
|
|
88
101
|
}
|
|
102
|
+
setList([]);
|
|
89
103
|
}
|
|
90
104
|
fetchData();
|
|
91
105
|
}, [
|
|
@@ -99,7 +113,24 @@ var Select = (props) => {
|
|
|
99
113
|
props.attributes?.label && /* @__PURE__ */ jsx("span", { className: "text-sm font-medium inline-block pb-1", children: props.attributes?.label }),
|
|
100
114
|
" ",
|
|
101
115
|
props.attributes?.label && props.attributes?.required && /* @__PURE__ */ jsx("span", { className: "bg-error-weak", children: "*" }),
|
|
102
|
-
/* @__PURE__ */
|
|
116
|
+
list && list.length === 0 && /* @__PURE__ */ jsx(
|
|
117
|
+
"input",
|
|
118
|
+
{
|
|
119
|
+
type: "text",
|
|
120
|
+
name: props.name,
|
|
121
|
+
id: props.name,
|
|
122
|
+
value,
|
|
123
|
+
onChange: inputChangeHandler,
|
|
124
|
+
required: props.attributes?.required,
|
|
125
|
+
placeholder: props.attributes?.placeholder,
|
|
126
|
+
maxLength: props.attributes?.maxLength,
|
|
127
|
+
pattern: props.attributes?.pattern,
|
|
128
|
+
disabled: props.attributes?.readOnly,
|
|
129
|
+
minLength: props.attributes?.minLength,
|
|
130
|
+
className: `peer input select mt-1 py-1.5 block w-full rounded shadow-sm ${props.inputClasses ?? ""}`
|
|
131
|
+
}
|
|
132
|
+
),
|
|
133
|
+
list && list.length > 0 && /* @__PURE__ */ jsxs(
|
|
103
134
|
"select",
|
|
104
135
|
{
|
|
105
136
|
name: props.name,
|
|
@@ -108,7 +139,9 @@ var Select = (props) => {
|
|
|
108
139
|
onChange: textChangeHandler,
|
|
109
140
|
required: props.attributes?.required,
|
|
110
141
|
disabled: props.attributes?.readOnly,
|
|
111
|
-
className:
|
|
142
|
+
className: `peer select py-1.5 block w-full text-black rounded border-gray-300 shadow-sm
|
|
143
|
+
focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50
|
|
144
|
+
disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none ${props.inputClasses ?? ""}`,
|
|
112
145
|
children: [
|
|
113
146
|
/* @__PURE__ */ jsx("option", { value: "", children: props.attributes?.placeholder || "Select" }),
|
|
114
147
|
list.map((item, index) => {
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
import {
|
|
5
5
|
OdataBuilder
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-6MHIZOLR.mjs";
|
|
7
7
|
import {
|
|
8
8
|
Constants,
|
|
9
9
|
Hyperlink,
|
|
10
10
|
Icon_default
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-GFVCUX6O.mjs";
|
|
12
12
|
import "./chunk-IMNQO57B.mjs";
|
|
13
13
|
|
|
14
14
|
// src/components/Pagination.tsx
|
|
@@ -9,19 +9,19 @@ var Constants = {
|
|
|
9
9
|
pagesize: 10
|
|
10
10
|
};
|
|
11
11
|
var InputControlType = {
|
|
12
|
-
lineTextInput: "
|
|
13
|
-
multilineTextInput: "
|
|
14
|
-
emailInput: "
|
|
12
|
+
lineTextInput: "lineTextInput",
|
|
13
|
+
multilineTextInput: "multilineTextInput",
|
|
14
|
+
emailInput: "emailInput",
|
|
15
15
|
moneyInput: "money",
|
|
16
16
|
select: "select",
|
|
17
17
|
percentageInput: "percentage",
|
|
18
18
|
asset: "asset",
|
|
19
19
|
assetUpload: "assetUpload",
|
|
20
20
|
phoneInput: "phone",
|
|
21
|
-
numberInput: "
|
|
22
|
-
checkboxInput: "
|
|
21
|
+
numberInput: "numberInput",
|
|
22
|
+
checkboxInput: "checkboxInput",
|
|
23
23
|
otpInput: "otp",
|
|
24
|
-
datetimeInput: "
|
|
24
|
+
datetimeInput: "datetimeInput",
|
|
25
25
|
timeInput: "time",
|
|
26
26
|
colorInput: "colorInput",
|
|
27
27
|
selectWithSearchInput: "selectWithSearchInput",
|
package/dist/index.js
CHANGED
|
@@ -996,19 +996,19 @@ var init_InputControlType = __esm({
|
|
|
996
996
|
pagesize: 10
|
|
997
997
|
};
|
|
998
998
|
InputControlType = {
|
|
999
|
-
lineTextInput: "
|
|
1000
|
-
multilineTextInput: "
|
|
1001
|
-
emailInput: "
|
|
999
|
+
lineTextInput: "lineTextInput",
|
|
1000
|
+
multilineTextInput: "multilineTextInput",
|
|
1001
|
+
emailInput: "emailInput",
|
|
1002
1002
|
moneyInput: "money",
|
|
1003
1003
|
select: "select",
|
|
1004
1004
|
percentageInput: "percentage",
|
|
1005
1005
|
asset: "asset",
|
|
1006
1006
|
assetUpload: "assetUpload",
|
|
1007
1007
|
phoneInput: "phone",
|
|
1008
|
-
numberInput: "
|
|
1009
|
-
checkboxInput: "
|
|
1008
|
+
numberInput: "numberInput",
|
|
1009
|
+
checkboxInput: "checkboxInput",
|
|
1010
1010
|
otpInput: "otp",
|
|
1011
|
-
datetimeInput: "
|
|
1011
|
+
datetimeInput: "datetimeInput",
|
|
1012
1012
|
timeInput: "time",
|
|
1013
1013
|
colorInput: "colorInput",
|
|
1014
1014
|
selectWithSearchInput: "selectWithSearchInput",
|
|
@@ -1032,7 +1032,7 @@ var init_Select = __esm({
|
|
|
1032
1032
|
import_react19 = require("react");
|
|
1033
1033
|
import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1034
1034
|
Select = (props) => {
|
|
1035
|
-
const [list, setList] = (0, import_react19.useState)(
|
|
1035
|
+
const [list, setList] = (0, import_react19.useState)();
|
|
1036
1036
|
const getSafeValue = (val) => {
|
|
1037
1037
|
if (val === null || val === void 0) return "";
|
|
1038
1038
|
if (typeof val === "boolean") return val ? "1" : "0";
|
|
@@ -1061,6 +1061,14 @@ var init_Select = __esm({
|
|
|
1061
1061
|
groupKey: props.groupKey
|
|
1062
1062
|
});
|
|
1063
1063
|
};
|
|
1064
|
+
const inputChangeHandler = (event) => {
|
|
1065
|
+
props.callback?.({
|
|
1066
|
+
name: props.name,
|
|
1067
|
+
value: event.target.value,
|
|
1068
|
+
index: props.index,
|
|
1069
|
+
groupKey: props.groupKey
|
|
1070
|
+
});
|
|
1071
|
+
};
|
|
1064
1072
|
(0, import_react19.useEffect)(() => {
|
|
1065
1073
|
async function fetchData() {
|
|
1066
1074
|
if (props.dataset) {
|
|
@@ -1070,7 +1078,11 @@ var init_Select = __esm({
|
|
|
1070
1078
|
if (props.dataSource && props.serviceClient) {
|
|
1071
1079
|
let dataSource = props.dataSource;
|
|
1072
1080
|
let response;
|
|
1073
|
-
if (props.dataSourceDependsOn
|
|
1081
|
+
if (props.dataSourceDependsOn) {
|
|
1082
|
+
if (!props.dependentValue) {
|
|
1083
|
+
setList([]);
|
|
1084
|
+
return;
|
|
1085
|
+
}
|
|
1074
1086
|
dataSource = dataSource.replace(
|
|
1075
1087
|
`{${props.dataSourceDependsOn}}`,
|
|
1076
1088
|
props.dependentValue
|
|
@@ -1078,7 +1090,9 @@ var init_Select = __esm({
|
|
|
1078
1090
|
}
|
|
1079
1091
|
response = await props.serviceClient.get(dataSource);
|
|
1080
1092
|
setList(response.result ?? []);
|
|
1093
|
+
return;
|
|
1081
1094
|
}
|
|
1095
|
+
setList([]);
|
|
1082
1096
|
}
|
|
1083
1097
|
fetchData();
|
|
1084
1098
|
}, [
|
|
@@ -1092,7 +1106,24 @@ var init_Select = __esm({
|
|
|
1092
1106
|
props.attributes?.label && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "text-sm font-medium inline-block pb-1", children: props.attributes?.label }),
|
|
1093
1107
|
" ",
|
|
1094
1108
|
props.attributes?.label && props.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
1095
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.
|
|
1109
|
+
list && list.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1110
|
+
"input",
|
|
1111
|
+
{
|
|
1112
|
+
type: "text",
|
|
1113
|
+
name: props.name,
|
|
1114
|
+
id: props.name,
|
|
1115
|
+
value,
|
|
1116
|
+
onChange: inputChangeHandler,
|
|
1117
|
+
required: props.attributes?.required,
|
|
1118
|
+
placeholder: props.attributes?.placeholder,
|
|
1119
|
+
maxLength: props.attributes?.maxLength,
|
|
1120
|
+
pattern: props.attributes?.pattern,
|
|
1121
|
+
disabled: props.attributes?.readOnly,
|
|
1122
|
+
minLength: props.attributes?.minLength,
|
|
1123
|
+
className: `peer input select mt-1 py-1.5 block w-full rounded shadow-sm ${props.inputClasses ?? ""}`
|
|
1124
|
+
}
|
|
1125
|
+
),
|
|
1126
|
+
list && list.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
1096
1127
|
"select",
|
|
1097
1128
|
{
|
|
1098
1129
|
name: props.name,
|
|
@@ -1101,7 +1132,9 @@ var init_Select = __esm({
|
|
|
1101
1132
|
onChange: textChangeHandler,
|
|
1102
1133
|
required: props.attributes?.required,
|
|
1103
1134
|
disabled: props.attributes?.readOnly,
|
|
1104
|
-
className:
|
|
1135
|
+
className: `peer select py-1.5 block w-full text-black rounded border-gray-300 shadow-sm
|
|
1136
|
+
focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50
|
|
1137
|
+
disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none ${props.inputClasses ?? ""}`,
|
|
1105
1138
|
children: [
|
|
1106
1139
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "", children: props.attributes?.placeholder || "Select" }),
|
|
1107
1140
|
list.map((item, index) => {
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
OdataBuilder
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-6MHIZOLR.mjs";
|
|
6
6
|
import {
|
|
7
7
|
AssetUtility_default,
|
|
8
8
|
BooleanSelect_default,
|
|
@@ -22,13 +22,13 @@ import {
|
|
|
22
22
|
SelectWithSearchInput_default,
|
|
23
23
|
Switcher_default,
|
|
24
24
|
TimeInput_default
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-6F7QBX3H.mjs";
|
|
26
26
|
import {
|
|
27
27
|
Constants,
|
|
28
28
|
Hyperlink,
|
|
29
29
|
Icon_default,
|
|
30
30
|
InputControlType_default
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-GFVCUX6O.mjs";
|
|
32
32
|
import {
|
|
33
33
|
ServiceClient_default
|
|
34
34
|
} from "./chunk-WEV5U33G.mjs";
|
|
@@ -412,7 +412,7 @@ var ViewControl_default = ViewControl;
|
|
|
412
412
|
|
|
413
413
|
// src/components/controls/edit/InputControl.tsx
|
|
414
414
|
import dynamic4 from "next/dynamic";
|
|
415
|
-
var InputControl = dynamic4(() => import("./InputControlClient-
|
|
415
|
+
var InputControl = dynamic4(() => import("./InputControlClient-7JD36O2O.mjs"), {
|
|
416
416
|
ssr: false
|
|
417
417
|
});
|
|
418
418
|
var InputControl_default = InputControl;
|
|
@@ -2245,7 +2245,7 @@ var DocumentNode_default = DocumentNode;
|
|
|
2245
2245
|
|
|
2246
2246
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
2247
2247
|
import { jsx as jsx34, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2248
|
-
var Pagination = dynamic10(() => import("./Pagination-
|
|
2248
|
+
var Pagination = dynamic10(() => import("./Pagination-Y7PNQUJ2.mjs"), { ssr: true });
|
|
2249
2249
|
var Slider = dynamic10(() => import("./Slider-554BKC7N.mjs"), {
|
|
2250
2250
|
ssr: false
|
|
2251
2251
|
});
|