@acoustte-digital-services/digitalstore-controls 0.12.3 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +4 -6
- package/dist/index.d.ts +4 -6
- package/dist/index.js +21 -69
- package/dist/index.mjs +20 -68
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
interface
|
|
3
|
+
interface ViewControlProps {
|
|
4
4
|
value?: any;
|
|
5
5
|
controlType: string;
|
|
6
6
|
format?: string;
|
|
@@ -9,9 +9,9 @@ interface ViewControlPropsView {
|
|
|
9
9
|
customProps?: Record<string, any>;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
declare const ViewControl: React.FC<
|
|
12
|
+
declare const ViewControl: React.FC<ViewControlProps>;
|
|
13
13
|
|
|
14
|
-
declare const
|
|
14
|
+
declare const ViewControlTypes: {
|
|
15
15
|
lineTextView: string;
|
|
16
16
|
emailTextView: string;
|
|
17
17
|
multilineTextBulletsView: string;
|
|
@@ -21,9 +21,7 @@ declare const ViewControlTypesView: {
|
|
|
21
21
|
statusView: string;
|
|
22
22
|
statusBgView: string;
|
|
23
23
|
multilineTextView: string;
|
|
24
|
-
booleanView: string;
|
|
25
|
-
checkboxInputView: string;
|
|
26
24
|
text: string;
|
|
27
25
|
};
|
|
28
26
|
|
|
29
|
-
export { ViewControl,
|
|
27
|
+
export { ViewControl, ViewControlTypes };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
interface
|
|
3
|
+
interface ViewControlProps {
|
|
4
4
|
value?: any;
|
|
5
5
|
controlType: string;
|
|
6
6
|
format?: string;
|
|
@@ -9,9 +9,9 @@ interface ViewControlPropsView {
|
|
|
9
9
|
customProps?: Record<string, any>;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
declare const ViewControl: React.FC<
|
|
12
|
+
declare const ViewControl: React.FC<ViewControlProps>;
|
|
13
13
|
|
|
14
|
-
declare const
|
|
14
|
+
declare const ViewControlTypes: {
|
|
15
15
|
lineTextView: string;
|
|
16
16
|
emailTextView: string;
|
|
17
17
|
multilineTextBulletsView: string;
|
|
@@ -21,9 +21,7 @@ declare const ViewControlTypesView: {
|
|
|
21
21
|
statusView: string;
|
|
22
22
|
statusBgView: string;
|
|
23
23
|
multilineTextView: string;
|
|
24
|
-
booleanView: string;
|
|
25
|
-
checkboxInputView: string;
|
|
26
24
|
text: string;
|
|
27
25
|
};
|
|
28
26
|
|
|
29
|
-
export { ViewControl,
|
|
27
|
+
export { ViewControl, ViewControlTypes };
|
package/dist/index.js
CHANGED
|
@@ -44,13 +44,13 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
44
44
|
// src/index.ts
|
|
45
45
|
var index_exports = {};
|
|
46
46
|
__export(index_exports, {
|
|
47
|
-
ViewControl: () =>
|
|
48
|
-
|
|
47
|
+
ViewControl: () => ViewControl_default,
|
|
48
|
+
ViewControlTypes: () => ViewControlTypes_default
|
|
49
49
|
});
|
|
50
50
|
module.exports = __toCommonJS(index_exports);
|
|
51
51
|
|
|
52
|
-
// src/controls/view/
|
|
53
|
-
var
|
|
52
|
+
// src/controls/view/ViewControl.tsx
|
|
53
|
+
var import_react10 = __toESM(require("react"));
|
|
54
54
|
|
|
55
55
|
// src/controls/view/LineTextView.tsx
|
|
56
56
|
var import_react = __toESM(require("react"));
|
|
@@ -171,8 +171,8 @@ var MultilinetextView = (props) => {
|
|
|
171
171
|
};
|
|
172
172
|
var MultilineTextView_default = MultilinetextView;
|
|
173
173
|
|
|
174
|
-
// src/controls/view/
|
|
175
|
-
var
|
|
174
|
+
// src/controls/view/ViewControlTypes.tsx
|
|
175
|
+
var ViewControlTypes = {
|
|
176
176
|
lineTextView: "lineTextView",
|
|
177
177
|
emailTextView: "emailTextView",
|
|
178
178
|
multilineTextBulletsView: "multilineTextBulletsView",
|
|
@@ -182,79 +182,31 @@ var ViewControlTypesView = {
|
|
|
182
182
|
statusView: "statusView",
|
|
183
183
|
statusBgView: "statusBgView",
|
|
184
184
|
multilineTextView: "multilineTextView",
|
|
185
|
-
booleanView: "booleanView",
|
|
186
|
-
checkboxInputView: "booleanView",
|
|
187
185
|
text: "text"
|
|
188
|
-
// booleanView: "booleanView"
|
|
189
186
|
};
|
|
190
|
-
var
|
|
187
|
+
var ViewControlTypes_default = ViewControlTypes;
|
|
191
188
|
|
|
192
|
-
// src/controls/view/
|
|
193
|
-
var import_react10 = __toESM(require("react"));
|
|
189
|
+
// src/controls/view/ViewControl.tsx
|
|
194
190
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
195
|
-
var booleanView = (props) => {
|
|
196
|
-
const { value, customProps } = props;
|
|
197
|
-
const showOnlyTrueIcon = customProps == null ? void 0 : customProps.showOnlyTrueIcon;
|
|
198
|
-
console.log("BooleanView Debug:", {
|
|
199
|
-
value,
|
|
200
|
-
type: typeof value,
|
|
201
|
-
customProps,
|
|
202
|
-
showOnlyTrueIcon
|
|
203
|
-
});
|
|
204
|
-
const booleanValue = import_react10.default.useMemo(() => {
|
|
205
|
-
if (typeof value === "boolean") return value;
|
|
206
|
-
if (typeof value === "string") {
|
|
207
|
-
return value.toLowerCase() === "true";
|
|
208
|
-
}
|
|
209
|
-
if (typeof value === "number") {
|
|
210
|
-
return value === 1;
|
|
211
|
-
}
|
|
212
|
-
return false;
|
|
213
|
-
}, [value]);
|
|
214
|
-
if (showOnlyTrueIcon) {
|
|
215
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react10.default.Fragment, { children: booleanValue === true && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
216
|
-
"svg",
|
|
217
|
-
{
|
|
218
|
-
className: "w-15 h-8 textView-green-600",
|
|
219
|
-
fill: "currentColor",
|
|
220
|
-
viewBox: "0 0 20 20",
|
|
221
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
222
|
-
"path",
|
|
223
|
-
{
|
|
224
|
-
fillRule: "evenodd",
|
|
225
|
-
d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
|
|
226
|
-
clipRule: "evenodd"
|
|
227
|
-
}
|
|
228
|
-
)
|
|
229
|
-
}
|
|
230
|
-
) });
|
|
231
|
-
}
|
|
232
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react10.default.Fragment, { children: booleanValue ? "true" : "false" });
|
|
233
|
-
};
|
|
234
|
-
var BooleanView_default = booleanView;
|
|
235
|
-
|
|
236
|
-
// src/controls/view/ViewControlView.tsx
|
|
237
|
-
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
238
191
|
var ViewControl = (props) => {
|
|
239
192
|
const ControlComponents = {
|
|
240
|
-
[
|
|
241
|
-
[
|
|
242
|
-
[
|
|
243
|
-
[
|
|
244
|
-
[
|
|
245
|
-
[
|
|
246
|
-
[
|
|
247
|
-
[
|
|
248
|
-
[
|
|
249
|
-
[
|
|
250
|
-
[ViewControlTypesView_default.lineTextView]: LineTextView_default
|
|
193
|
+
[ViewControlTypes_default.lineTextView]: LineTextView_default,
|
|
194
|
+
[ViewControlTypes_default.emailTextView]: EmailTextView_default,
|
|
195
|
+
[ViewControlTypes_default.multilineTextBulletsView]: MultilineTextBulletsView_default,
|
|
196
|
+
[ViewControlTypes_default.moneyView]: MoneyView_default,
|
|
197
|
+
[ViewControlTypes_default.numberView]: NumberView_default,
|
|
198
|
+
[ViewControlTypes_default.dateView]: DateView_default,
|
|
199
|
+
[ViewControlTypes_default.statusView]: StatusView_default,
|
|
200
|
+
[ViewControlTypes_default.statusBgView]: StatusBgView_default,
|
|
201
|
+
[ViewControlTypes_default.multilineTextView]: MultilineTextView_default,
|
|
202
|
+
[ViewControlTypes_default.lineTextView]: LineTextView_default
|
|
251
203
|
};
|
|
252
204
|
const SelectedControlComponent = ControlComponents[props.controlType];
|
|
253
|
-
return /* @__PURE__ */ (0,
|
|
205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react10.default.Fragment, { children: SelectedControlComponent ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SelectedControlComponent, __spreadValues({}, props)) : "Control not found" });
|
|
254
206
|
};
|
|
255
|
-
var
|
|
207
|
+
var ViewControl_default = ViewControl;
|
|
256
208
|
// Annotate the CommonJS export names for ESM import in node:
|
|
257
209
|
0 && (module.exports = {
|
|
258
210
|
ViewControl,
|
|
259
|
-
|
|
211
|
+
ViewControlTypes
|
|
260
212
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -15,8 +15,8 @@ var __spreadValues = (a, b) => {
|
|
|
15
15
|
return a;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
// src/controls/view/
|
|
19
|
-
import
|
|
18
|
+
// src/controls/view/ViewControl.tsx
|
|
19
|
+
import React10 from "react";
|
|
20
20
|
|
|
21
21
|
// src/controls/view/LineTextView.tsx
|
|
22
22
|
import React from "react";
|
|
@@ -137,8 +137,8 @@ var MultilinetextView = (props) => {
|
|
|
137
137
|
};
|
|
138
138
|
var MultilineTextView_default = MultilinetextView;
|
|
139
139
|
|
|
140
|
-
// src/controls/view/
|
|
141
|
-
var
|
|
140
|
+
// src/controls/view/ViewControlTypes.tsx
|
|
141
|
+
var ViewControlTypes = {
|
|
142
142
|
lineTextView: "lineTextView",
|
|
143
143
|
emailTextView: "emailTextView",
|
|
144
144
|
multilineTextBulletsView: "multilineTextBulletsView",
|
|
@@ -148,78 +148,30 @@ var ViewControlTypesView = {
|
|
|
148
148
|
statusView: "statusView",
|
|
149
149
|
statusBgView: "statusBgView",
|
|
150
150
|
multilineTextView: "multilineTextView",
|
|
151
|
-
booleanView: "booleanView",
|
|
152
|
-
checkboxInputView: "booleanView",
|
|
153
151
|
text: "text"
|
|
154
|
-
// booleanView: "booleanView"
|
|
155
152
|
};
|
|
156
|
-
var
|
|
153
|
+
var ViewControlTypes_default = ViewControlTypes;
|
|
157
154
|
|
|
158
|
-
// src/controls/view/
|
|
159
|
-
import React10 from "react";
|
|
155
|
+
// src/controls/view/ViewControl.tsx
|
|
160
156
|
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
161
|
-
var booleanView = (props) => {
|
|
162
|
-
const { value, customProps } = props;
|
|
163
|
-
const showOnlyTrueIcon = customProps == null ? void 0 : customProps.showOnlyTrueIcon;
|
|
164
|
-
console.log("BooleanView Debug:", {
|
|
165
|
-
value,
|
|
166
|
-
type: typeof value,
|
|
167
|
-
customProps,
|
|
168
|
-
showOnlyTrueIcon
|
|
169
|
-
});
|
|
170
|
-
const booleanValue = React10.useMemo(() => {
|
|
171
|
-
if (typeof value === "boolean") return value;
|
|
172
|
-
if (typeof value === "string") {
|
|
173
|
-
return value.toLowerCase() === "true";
|
|
174
|
-
}
|
|
175
|
-
if (typeof value === "number") {
|
|
176
|
-
return value === 1;
|
|
177
|
-
}
|
|
178
|
-
return false;
|
|
179
|
-
}, [value]);
|
|
180
|
-
if (showOnlyTrueIcon) {
|
|
181
|
-
return /* @__PURE__ */ jsx10(React10.Fragment, { children: booleanValue === true && /* @__PURE__ */ jsx10(
|
|
182
|
-
"svg",
|
|
183
|
-
{
|
|
184
|
-
className: "w-15 h-8 textView-green-600",
|
|
185
|
-
fill: "currentColor",
|
|
186
|
-
viewBox: "0 0 20 20",
|
|
187
|
-
children: /* @__PURE__ */ jsx10(
|
|
188
|
-
"path",
|
|
189
|
-
{
|
|
190
|
-
fillRule: "evenodd",
|
|
191
|
-
d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
|
|
192
|
-
clipRule: "evenodd"
|
|
193
|
-
}
|
|
194
|
-
)
|
|
195
|
-
}
|
|
196
|
-
) });
|
|
197
|
-
}
|
|
198
|
-
return /* @__PURE__ */ jsx10(React10.Fragment, { children: booleanValue ? "true" : "false" });
|
|
199
|
-
};
|
|
200
|
-
var BooleanView_default = booleanView;
|
|
201
|
-
|
|
202
|
-
// src/controls/view/ViewControlView.tsx
|
|
203
|
-
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
204
157
|
var ViewControl = (props) => {
|
|
205
158
|
const ControlComponents = {
|
|
206
|
-
[
|
|
207
|
-
[
|
|
208
|
-
[
|
|
209
|
-
[
|
|
210
|
-
[
|
|
211
|
-
[
|
|
212
|
-
[
|
|
213
|
-
[
|
|
214
|
-
[
|
|
215
|
-
[
|
|
216
|
-
[ViewControlTypesView_default.lineTextView]: LineTextView_default
|
|
159
|
+
[ViewControlTypes_default.lineTextView]: LineTextView_default,
|
|
160
|
+
[ViewControlTypes_default.emailTextView]: EmailTextView_default,
|
|
161
|
+
[ViewControlTypes_default.multilineTextBulletsView]: MultilineTextBulletsView_default,
|
|
162
|
+
[ViewControlTypes_default.moneyView]: MoneyView_default,
|
|
163
|
+
[ViewControlTypes_default.numberView]: NumberView_default,
|
|
164
|
+
[ViewControlTypes_default.dateView]: DateView_default,
|
|
165
|
+
[ViewControlTypes_default.statusView]: StatusView_default,
|
|
166
|
+
[ViewControlTypes_default.statusBgView]: StatusBgView_default,
|
|
167
|
+
[ViewControlTypes_default.multilineTextView]: MultilineTextView_default,
|
|
168
|
+
[ViewControlTypes_default.lineTextView]: LineTextView_default
|
|
217
169
|
};
|
|
218
170
|
const SelectedControlComponent = ControlComponents[props.controlType];
|
|
219
|
-
return /* @__PURE__ */
|
|
171
|
+
return /* @__PURE__ */ jsx10(React10.Fragment, { children: SelectedControlComponent ? /* @__PURE__ */ jsx10(SelectedControlComponent, __spreadValues({}, props)) : "Control not found" });
|
|
220
172
|
};
|
|
221
|
-
var
|
|
173
|
+
var ViewControl_default = ViewControl;
|
|
222
174
|
export {
|
|
223
|
-
|
|
224
|
-
|
|
175
|
+
ViewControl_default as ViewControl,
|
|
176
|
+
ViewControlTypes_default as ViewControlTypes
|
|
225
177
|
};
|