@acoustte-digital-services/digitalstore-controls 0.12.1 → 0.12.3
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.js +45 -46
- package/dist/index.mjs +45 -46
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -151,10 +151,48 @@ 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
|
|
157
|
+
var multilineTextBulletsView = (props) => {
|
|
158
|
+
var _a;
|
|
159
|
+
const lines = (_a = props.value) == null ? void 0 : _a.split("\\n");
|
|
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);
|
|
162
|
+
}) }) });
|
|
163
|
+
};
|
|
164
|
+
var MultilineTextBulletsView_default = multilineTextBulletsView;
|
|
165
|
+
|
|
166
|
+
// src/controls/view/MultilineTextView.tsx
|
|
167
|
+
var import_react9 = __toESM(require("react"));
|
|
168
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
169
|
+
var MultilinetextView = (props) => {
|
|
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 }) });
|
|
171
|
+
};
|
|
172
|
+
var MultilineTextView_default = MultilinetextView;
|
|
173
|
+
|
|
174
|
+
// src/controls/view/ViewControlTypesView.tsx
|
|
175
|
+
var ViewControlTypesView = {
|
|
176
|
+
lineTextView: "lineTextView",
|
|
177
|
+
emailTextView: "emailTextView",
|
|
178
|
+
multilineTextBulletsView: "multilineTextBulletsView",
|
|
179
|
+
moneyView: "moneyView",
|
|
180
|
+
numberView: "numberView",
|
|
181
|
+
dateView: "dateView",
|
|
182
|
+
statusView: "statusView",
|
|
183
|
+
statusBgView: "statusBgView",
|
|
184
|
+
multilineTextView: "multilineTextView",
|
|
185
|
+
booleanView: "booleanView",
|
|
186
|
+
checkboxInputView: "booleanView",
|
|
187
|
+
text: "text"
|
|
188
|
+
// booleanView: "booleanView"
|
|
189
|
+
};
|
|
190
|
+
var ViewControlTypesView_default = ViewControlTypesView;
|
|
191
|
+
|
|
192
|
+
// src/controls/view/BooleanView.tsx
|
|
193
|
+
var import_react10 = __toESM(require("react"));
|
|
194
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
195
|
+
var booleanView = (props) => {
|
|
158
196
|
const { value, customProps } = props;
|
|
159
197
|
const showOnlyTrueIcon = customProps == null ? void 0 : customProps.showOnlyTrueIcon;
|
|
160
198
|
console.log("BooleanView Debug:", {
|
|
@@ -163,7 +201,7 @@ var booleanViewView = (props) => {
|
|
|
163
201
|
customProps,
|
|
164
202
|
showOnlyTrueIcon
|
|
165
203
|
});
|
|
166
|
-
const booleanValue =
|
|
204
|
+
const booleanValue = import_react10.default.useMemo(() => {
|
|
167
205
|
if (typeof value === "boolean") return value;
|
|
168
206
|
if (typeof value === "string") {
|
|
169
207
|
return value.toLowerCase() === "true";
|
|
@@ -174,13 +212,13 @@ var booleanViewView = (props) => {
|
|
|
174
212
|
return false;
|
|
175
213
|
}, [value]);
|
|
176
214
|
if (showOnlyTrueIcon) {
|
|
177
|
-
return /* @__PURE__ */ (0,
|
|
215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react10.default.Fragment, { children: booleanValue === true && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
178
216
|
"svg",
|
|
179
217
|
{
|
|
180
218
|
className: "w-15 h-8 textView-green-600",
|
|
181
219
|
fill: "currentColor",
|
|
182
220
|
viewBox: "0 0 20 20",
|
|
183
|
-
children: /* @__PURE__ */ (0,
|
|
221
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
184
222
|
"path",
|
|
185
223
|
{
|
|
186
224
|
fillRule: "evenodd",
|
|
@@ -191,47 +229,9 @@ var booleanViewView = (props) => {
|
|
|
191
229
|
}
|
|
192
230
|
) });
|
|
193
231
|
}
|
|
194
|
-
return /* @__PURE__ */ (0,
|
|
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
|
-
var multilineTextBulletsView = (props) => {
|
|
202
|
-
var _a;
|
|
203
|
-
const lines = (_a = props.value) == null ? void 0 : _a.split("\\n");
|
|
204
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react9.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("ul", { className: "list-disc", children: lines && lines.map((line, index) => {
|
|
205
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("li", { children: line }, index);
|
|
206
|
-
}) }) });
|
|
207
|
-
};
|
|
208
|
-
var MultilineTextBulletsView_default = multilineTextBulletsView;
|
|
209
|
-
|
|
210
|
-
// src/controls/view/MultilineTextView.tsx
|
|
211
|
-
var import_react10 = __toESM(require("react"));
|
|
212
|
-
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
213
|
-
var MultilinetextView = (props) => {
|
|
214
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react10.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "whitespace-pre-line", children: props.value }) });
|
|
215
|
-
};
|
|
216
|
-
var MultilineTextView_default = MultilinetextView;
|
|
217
|
-
|
|
218
|
-
// src/controls/view/ViewControlTypesView.tsx
|
|
219
|
-
var ViewControlTypesView = {
|
|
220
|
-
lineTextView: "lineTextView",
|
|
221
|
-
emailTextView: "emailTextView",
|
|
222
|
-
multilineTextBulletsView: "multilineTextBulletsView",
|
|
223
|
-
moneyView: "moneyView",
|
|
224
|
-
numberView: "numberView",
|
|
225
|
-
dateView: "dateView",
|
|
226
|
-
statusView: "statusView",
|
|
227
|
-
statusBgView: "statusBgView",
|
|
228
|
-
multilineTextView: "multilineTextView",
|
|
229
|
-
booleanView: "booleanView",
|
|
230
|
-
checkboxInputView: "booleanView",
|
|
231
|
-
text: "text"
|
|
232
|
-
// booleanView: "booleanView"
|
|
232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react10.default.Fragment, { children: booleanValue ? "true" : "false" });
|
|
233
233
|
};
|
|
234
|
-
var
|
|
234
|
+
var BooleanView_default = booleanView;
|
|
235
235
|
|
|
236
236
|
// src/controls/view/ViewControlView.tsx
|
|
237
237
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
@@ -248,7 +248,6 @@ var ViewControl = (props) => {
|
|
|
248
248
|
[ViewControlTypesView_default.multilineTextView]: MultilineTextView_default,
|
|
249
249
|
[ViewControlTypesView_default.booleanView]: BooleanView_default,
|
|
250
250
|
[ViewControlTypesView_default.lineTextView]: LineTextView_default
|
|
251
|
-
// [ViewControlTypes.booleanView]: booleanViewView
|
|
252
251
|
};
|
|
253
252
|
const SelectedControlComponent = ControlComponents[props.controlType];
|
|
254
253
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react11.default.Fragment, { children: SelectedControlComponent ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SelectedControlComponent, __spreadValues({}, props)) : "Control not found" });
|
package/dist/index.mjs
CHANGED
|
@@ -117,10 +117,48 @@ 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
|
|
123
|
+
var multilineTextBulletsView = (props) => {
|
|
124
|
+
var _a;
|
|
125
|
+
const lines = (_a = props.value) == null ? void 0 : _a.split("\\n");
|
|
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);
|
|
128
|
+
}) }) });
|
|
129
|
+
};
|
|
130
|
+
var MultilineTextBulletsView_default = multilineTextBulletsView;
|
|
131
|
+
|
|
132
|
+
// src/controls/view/MultilineTextView.tsx
|
|
133
|
+
import React9 from "react";
|
|
134
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
135
|
+
var MultilinetextView = (props) => {
|
|
136
|
+
return /* @__PURE__ */ jsx9(React9.Fragment, { children: /* @__PURE__ */ jsx9("span", { className: "whitespace-pre-line", children: props.value }) });
|
|
137
|
+
};
|
|
138
|
+
var MultilineTextView_default = MultilinetextView;
|
|
139
|
+
|
|
140
|
+
// src/controls/view/ViewControlTypesView.tsx
|
|
141
|
+
var ViewControlTypesView = {
|
|
142
|
+
lineTextView: "lineTextView",
|
|
143
|
+
emailTextView: "emailTextView",
|
|
144
|
+
multilineTextBulletsView: "multilineTextBulletsView",
|
|
145
|
+
moneyView: "moneyView",
|
|
146
|
+
numberView: "numberView",
|
|
147
|
+
dateView: "dateView",
|
|
148
|
+
statusView: "statusView",
|
|
149
|
+
statusBgView: "statusBgView",
|
|
150
|
+
multilineTextView: "multilineTextView",
|
|
151
|
+
booleanView: "booleanView",
|
|
152
|
+
checkboxInputView: "booleanView",
|
|
153
|
+
text: "text"
|
|
154
|
+
// booleanView: "booleanView"
|
|
155
|
+
};
|
|
156
|
+
var ViewControlTypesView_default = ViewControlTypesView;
|
|
157
|
+
|
|
158
|
+
// src/controls/view/BooleanView.tsx
|
|
159
|
+
import React10 from "react";
|
|
160
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
161
|
+
var booleanView = (props) => {
|
|
124
162
|
const { value, customProps } = props;
|
|
125
163
|
const showOnlyTrueIcon = customProps == null ? void 0 : customProps.showOnlyTrueIcon;
|
|
126
164
|
console.log("BooleanView Debug:", {
|
|
@@ -129,7 +167,7 @@ var booleanViewView = (props) => {
|
|
|
129
167
|
customProps,
|
|
130
168
|
showOnlyTrueIcon
|
|
131
169
|
});
|
|
132
|
-
const booleanValue =
|
|
170
|
+
const booleanValue = React10.useMemo(() => {
|
|
133
171
|
if (typeof value === "boolean") return value;
|
|
134
172
|
if (typeof value === "string") {
|
|
135
173
|
return value.toLowerCase() === "true";
|
|
@@ -140,13 +178,13 @@ var booleanViewView = (props) => {
|
|
|
140
178
|
return false;
|
|
141
179
|
}, [value]);
|
|
142
180
|
if (showOnlyTrueIcon) {
|
|
143
|
-
return /* @__PURE__ */
|
|
181
|
+
return /* @__PURE__ */ jsx10(React10.Fragment, { children: booleanValue === true && /* @__PURE__ */ jsx10(
|
|
144
182
|
"svg",
|
|
145
183
|
{
|
|
146
184
|
className: "w-15 h-8 textView-green-600",
|
|
147
185
|
fill: "currentColor",
|
|
148
186
|
viewBox: "0 0 20 20",
|
|
149
|
-
children: /* @__PURE__ */
|
|
187
|
+
children: /* @__PURE__ */ jsx10(
|
|
150
188
|
"path",
|
|
151
189
|
{
|
|
152
190
|
fillRule: "evenodd",
|
|
@@ -157,47 +195,9 @@ var booleanViewView = (props) => {
|
|
|
157
195
|
}
|
|
158
196
|
) });
|
|
159
197
|
}
|
|
160
|
-
return /* @__PURE__ */
|
|
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
|
-
var multilineTextBulletsView = (props) => {
|
|
168
|
-
var _a;
|
|
169
|
-
const lines = (_a = props.value) == null ? void 0 : _a.split("\\n");
|
|
170
|
-
return /* @__PURE__ */ jsx9(React9.Fragment, { children: /* @__PURE__ */ jsx9("ul", { className: "list-disc", children: lines && lines.map((line, index) => {
|
|
171
|
-
return /* @__PURE__ */ jsx9("li", { children: line }, index);
|
|
172
|
-
}) }) });
|
|
173
|
-
};
|
|
174
|
-
var MultilineTextBulletsView_default = multilineTextBulletsView;
|
|
175
|
-
|
|
176
|
-
// src/controls/view/MultilineTextView.tsx
|
|
177
|
-
import React10 from "react";
|
|
178
|
-
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
179
|
-
var MultilinetextView = (props) => {
|
|
180
|
-
return /* @__PURE__ */ jsx10(React10.Fragment, { children: /* @__PURE__ */ jsx10("span", { className: "whitespace-pre-line", children: props.value }) });
|
|
181
|
-
};
|
|
182
|
-
var MultilineTextView_default = MultilinetextView;
|
|
183
|
-
|
|
184
|
-
// src/controls/view/ViewControlTypesView.tsx
|
|
185
|
-
var ViewControlTypesView = {
|
|
186
|
-
lineTextView: "lineTextView",
|
|
187
|
-
emailTextView: "emailTextView",
|
|
188
|
-
multilineTextBulletsView: "multilineTextBulletsView",
|
|
189
|
-
moneyView: "moneyView",
|
|
190
|
-
numberView: "numberView",
|
|
191
|
-
dateView: "dateView",
|
|
192
|
-
statusView: "statusView",
|
|
193
|
-
statusBgView: "statusBgView",
|
|
194
|
-
multilineTextView: "multilineTextView",
|
|
195
|
-
booleanView: "booleanView",
|
|
196
|
-
checkboxInputView: "booleanView",
|
|
197
|
-
text: "text"
|
|
198
|
-
// booleanView: "booleanView"
|
|
198
|
+
return /* @__PURE__ */ jsx10(React10.Fragment, { children: booleanValue ? "true" : "false" });
|
|
199
199
|
};
|
|
200
|
-
var
|
|
200
|
+
var BooleanView_default = booleanView;
|
|
201
201
|
|
|
202
202
|
// src/controls/view/ViewControlView.tsx
|
|
203
203
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
@@ -214,7 +214,6 @@ var ViewControl = (props) => {
|
|
|
214
214
|
[ViewControlTypesView_default.multilineTextView]: MultilineTextView_default,
|
|
215
215
|
[ViewControlTypesView_default.booleanView]: BooleanView_default,
|
|
216
216
|
[ViewControlTypesView_default.lineTextView]: LineTextView_default
|
|
217
|
-
// [ViewControlTypes.booleanView]: booleanViewView
|
|
218
217
|
};
|
|
219
218
|
const SelectedControlComponent = ControlComponents[props.controlType];
|
|
220
219
|
return /* @__PURE__ */ jsx11(React11.Fragment, { children: SelectedControlComponent ? /* @__PURE__ */ jsx11(SelectedControlComponent, __spreadValues({}, props)) : "Control not found" });
|