@acoustte-digital-services/digitalstore-controls 0.12.2 → 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 +28 -77
- package/dist/index.mjs +27 -76
- 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"));
|
|
@@ -151,72 +151,28 @@ var statusBgView = (props) => {
|
|
|
151
151
|
};
|
|
152
152
|
var StatusBgView_default = statusBgView;
|
|
153
153
|
|
|
154
|
-
// src/controls/view/
|
|
154
|
+
// src/controls/view/MultilineTextBulletsView.tsx
|
|
155
155
|
var import_react8 = __toESM(require("react"));
|
|
156
156
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
157
|
-
var booleanViewView = (props) => {
|
|
158
|
-
const { value, customProps } = props;
|
|
159
|
-
const showOnlyTrueIcon = customProps == null ? void 0 : customProps.showOnlyTrueIcon;
|
|
160
|
-
console.log("BooleanView Debug:", {
|
|
161
|
-
value,
|
|
162
|
-
type: typeof value,
|
|
163
|
-
customProps,
|
|
164
|
-
showOnlyTrueIcon
|
|
165
|
-
});
|
|
166
|
-
const booleanValue = import_react8.default.useMemo(() => {
|
|
167
|
-
if (typeof value === "boolean") return value;
|
|
168
|
-
if (typeof value === "string") {
|
|
169
|
-
return value.toLowerCase() === "true";
|
|
170
|
-
}
|
|
171
|
-
if (typeof value === "number") {
|
|
172
|
-
return value === 1;
|
|
173
|
-
}
|
|
174
|
-
return false;
|
|
175
|
-
}, [value]);
|
|
176
|
-
if (showOnlyTrueIcon) {
|
|
177
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react8.default.Fragment, { children: booleanValue === true && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
178
|
-
"svg",
|
|
179
|
-
{
|
|
180
|
-
className: "w-15 h-8 textView-green-600",
|
|
181
|
-
fill: "currentColor",
|
|
182
|
-
viewBox: "0 0 20 20",
|
|
183
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
184
|
-
"path",
|
|
185
|
-
{
|
|
186
|
-
fillRule: "evenodd",
|
|
187
|
-
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",
|
|
188
|
-
clipRule: "evenodd"
|
|
189
|
-
}
|
|
190
|
-
)
|
|
191
|
-
}
|
|
192
|
-
) });
|
|
193
|
-
}
|
|
194
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react8.default.Fragment, { children: booleanValue ? "true" : "false" });
|
|
195
|
-
};
|
|
196
|
-
var BooleanView_default = booleanViewView;
|
|
197
|
-
|
|
198
|
-
// src/controls/view/MultilineTextBulletsView.tsx
|
|
199
|
-
var import_react9 = __toESM(require("react"));
|
|
200
|
-
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
201
157
|
var multilineTextBulletsView = (props) => {
|
|
202
158
|
var _a;
|
|
203
159
|
const lines = (_a = props.value) == null ? void 0 : _a.split("\\n");
|
|
204
|
-
return /* @__PURE__ */ (0,
|
|
205
|
-
return /* @__PURE__ */ (0,
|
|
160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react8.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("ul", { className: "list-disc", children: lines && lines.map((line, index) => {
|
|
161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("li", { children: line }, index);
|
|
206
162
|
}) }) });
|
|
207
163
|
};
|
|
208
164
|
var MultilineTextBulletsView_default = multilineTextBulletsView;
|
|
209
165
|
|
|
210
166
|
// src/controls/view/MultilineTextView.tsx
|
|
211
|
-
var
|
|
212
|
-
var
|
|
167
|
+
var import_react9 = __toESM(require("react"));
|
|
168
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
213
169
|
var MultilinetextView = (props) => {
|
|
214
|
-
return /* @__PURE__ */ (0,
|
|
170
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react9.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "whitespace-pre-line", children: props.value }) });
|
|
215
171
|
};
|
|
216
172
|
var MultilineTextView_default = MultilinetextView;
|
|
217
173
|
|
|
218
|
-
// src/controls/view/
|
|
219
|
-
var
|
|
174
|
+
// src/controls/view/ViewControlTypes.tsx
|
|
175
|
+
var ViewControlTypes = {
|
|
220
176
|
lineTextView: "lineTextView",
|
|
221
177
|
emailTextView: "emailTextView",
|
|
222
178
|
multilineTextBulletsView: "multilineTextBulletsView",
|
|
@@ -226,36 +182,31 @@ var ViewControlTypesView = {
|
|
|
226
182
|
statusView: "statusView",
|
|
227
183
|
statusBgView: "statusBgView",
|
|
228
184
|
multilineTextView: "multilineTextView",
|
|
229
|
-
booleanView: "booleanView",
|
|
230
|
-
checkboxInputView: "booleanView",
|
|
231
185
|
text: "text"
|
|
232
|
-
// booleanView: "booleanView"
|
|
233
186
|
};
|
|
234
|
-
var
|
|
187
|
+
var ViewControlTypes_default = ViewControlTypes;
|
|
235
188
|
|
|
236
|
-
// src/controls/view/
|
|
237
|
-
var
|
|
189
|
+
// src/controls/view/ViewControl.tsx
|
|
190
|
+
var import_jsx_runtime10 = 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
|
|
251
|
-
// [ViewControlTypes.booleanView]: booleanViewView
|
|
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
|
|
252
203
|
};
|
|
253
204
|
const SelectedControlComponent = ControlComponents[props.controlType];
|
|
254
|
-
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" });
|
|
255
206
|
};
|
|
256
|
-
var
|
|
207
|
+
var ViewControl_default = ViewControl;
|
|
257
208
|
// Annotate the CommonJS export names for ESM import in node:
|
|
258
209
|
0 && (module.exports = {
|
|
259
210
|
ViewControl,
|
|
260
|
-
|
|
211
|
+
ViewControlTypes
|
|
261
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";
|
|
@@ -117,72 +117,28 @@ var statusBgView = (props) => {
|
|
|
117
117
|
};
|
|
118
118
|
var StatusBgView_default = statusBgView;
|
|
119
119
|
|
|
120
|
-
// src/controls/view/
|
|
120
|
+
// src/controls/view/MultilineTextBulletsView.tsx
|
|
121
121
|
import React8 from "react";
|
|
122
122
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
123
|
-
var booleanViewView = (props) => {
|
|
124
|
-
const { value, customProps } = props;
|
|
125
|
-
const showOnlyTrueIcon = customProps == null ? void 0 : customProps.showOnlyTrueIcon;
|
|
126
|
-
console.log("BooleanView Debug:", {
|
|
127
|
-
value,
|
|
128
|
-
type: typeof value,
|
|
129
|
-
customProps,
|
|
130
|
-
showOnlyTrueIcon
|
|
131
|
-
});
|
|
132
|
-
const booleanValue = React8.useMemo(() => {
|
|
133
|
-
if (typeof value === "boolean") return value;
|
|
134
|
-
if (typeof value === "string") {
|
|
135
|
-
return value.toLowerCase() === "true";
|
|
136
|
-
}
|
|
137
|
-
if (typeof value === "number") {
|
|
138
|
-
return value === 1;
|
|
139
|
-
}
|
|
140
|
-
return false;
|
|
141
|
-
}, [value]);
|
|
142
|
-
if (showOnlyTrueIcon) {
|
|
143
|
-
return /* @__PURE__ */ jsx8(React8.Fragment, { children: booleanValue === true && /* @__PURE__ */ jsx8(
|
|
144
|
-
"svg",
|
|
145
|
-
{
|
|
146
|
-
className: "w-15 h-8 textView-green-600",
|
|
147
|
-
fill: "currentColor",
|
|
148
|
-
viewBox: "0 0 20 20",
|
|
149
|
-
children: /* @__PURE__ */ jsx8(
|
|
150
|
-
"path",
|
|
151
|
-
{
|
|
152
|
-
fillRule: "evenodd",
|
|
153
|
-
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",
|
|
154
|
-
clipRule: "evenodd"
|
|
155
|
-
}
|
|
156
|
-
)
|
|
157
|
-
}
|
|
158
|
-
) });
|
|
159
|
-
}
|
|
160
|
-
return /* @__PURE__ */ jsx8(React8.Fragment, { children: booleanValue ? "true" : "false" });
|
|
161
|
-
};
|
|
162
|
-
var BooleanView_default = booleanViewView;
|
|
163
|
-
|
|
164
|
-
// src/controls/view/MultilineTextBulletsView.tsx
|
|
165
|
-
import React9 from "react";
|
|
166
|
-
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
167
123
|
var multilineTextBulletsView = (props) => {
|
|
168
124
|
var _a;
|
|
169
125
|
const lines = (_a = props.value) == null ? void 0 : _a.split("\\n");
|
|
170
|
-
return /* @__PURE__ */
|
|
171
|
-
return /* @__PURE__ */
|
|
126
|
+
return /* @__PURE__ */ jsx8(React8.Fragment, { children: /* @__PURE__ */ jsx8("ul", { className: "list-disc", children: lines && lines.map((line, index) => {
|
|
127
|
+
return /* @__PURE__ */ jsx8("li", { children: line }, index);
|
|
172
128
|
}) }) });
|
|
173
129
|
};
|
|
174
130
|
var MultilineTextBulletsView_default = multilineTextBulletsView;
|
|
175
131
|
|
|
176
132
|
// src/controls/view/MultilineTextView.tsx
|
|
177
|
-
import
|
|
178
|
-
import { jsx as
|
|
133
|
+
import React9 from "react";
|
|
134
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
179
135
|
var MultilinetextView = (props) => {
|
|
180
|
-
return /* @__PURE__ */
|
|
136
|
+
return /* @__PURE__ */ jsx9(React9.Fragment, { children: /* @__PURE__ */ jsx9("span", { className: "whitespace-pre-line", children: props.value }) });
|
|
181
137
|
};
|
|
182
138
|
var MultilineTextView_default = MultilinetextView;
|
|
183
139
|
|
|
184
|
-
// src/controls/view/
|
|
185
|
-
var
|
|
140
|
+
// src/controls/view/ViewControlTypes.tsx
|
|
141
|
+
var ViewControlTypes = {
|
|
186
142
|
lineTextView: "lineTextView",
|
|
187
143
|
emailTextView: "emailTextView",
|
|
188
144
|
multilineTextBulletsView: "multilineTextBulletsView",
|
|
@@ -192,35 +148,30 @@ var ViewControlTypesView = {
|
|
|
192
148
|
statusView: "statusView",
|
|
193
149
|
statusBgView: "statusBgView",
|
|
194
150
|
multilineTextView: "multilineTextView",
|
|
195
|
-
booleanView: "booleanView",
|
|
196
|
-
checkboxInputView: "booleanView",
|
|
197
151
|
text: "text"
|
|
198
|
-
// booleanView: "booleanView"
|
|
199
152
|
};
|
|
200
|
-
var
|
|
153
|
+
var ViewControlTypes_default = ViewControlTypes;
|
|
201
154
|
|
|
202
|
-
// src/controls/view/
|
|
203
|
-
import { jsx as
|
|
155
|
+
// src/controls/view/ViewControl.tsx
|
|
156
|
+
import { jsx as jsx10 } 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
|
|
217
|
-
// [ViewControlTypes.booleanView]: booleanViewView
|
|
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
|
|
218
169
|
};
|
|
219
170
|
const SelectedControlComponent = ControlComponents[props.controlType];
|
|
220
|
-
return /* @__PURE__ */
|
|
171
|
+
return /* @__PURE__ */ jsx10(React10.Fragment, { children: SelectedControlComponent ? /* @__PURE__ */ jsx10(SelectedControlComponent, __spreadValues({}, props)) : "Control not found" });
|
|
221
172
|
};
|
|
222
|
-
var
|
|
173
|
+
var ViewControl_default = ViewControl;
|
|
223
174
|
export {
|
|
224
|
-
|
|
225
|
-
|
|
175
|
+
ViewControl_default as ViewControl,
|
|
176
|
+
ViewControlTypes_default as ViewControlTypes
|
|
226
177
|
};
|