@ozguraltan/strapi-content-input 1.0.25 → 1.0.26
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/README.md +2 -0
- package/dist/admin/{AnalyticsHubPage-0fb7chuv.js → AnalyticsHubPage-CHlhvUIU.js} +2 -2
- package/dist/admin/{AnalyticsHubPage-BO6Lg1qh.mjs → AnalyticsHubPage-Crz4vv46.mjs} +2 -2
- package/dist/admin/{ContentInputField-C-fh5qGC.mjs → ContentInputField-BeKDx_bb.mjs} +2 -2
- package/dist/admin/{ContentInputField-CnVzTBNf.js → ContentInputField-CNWVLuRt.js} +2 -2
- package/dist/admin/{SurveyWidgetEditor-DNDtKbmo.js → SurveyWidgetEditor-BTipBBEU.js} +447 -103
- package/dist/admin/{SurveyWidgetEditor-DdZBpfbS.mjs → SurveyWidgetEditor-GKRT3eHj.mjs} +447 -103
- package/dist/admin/{index-BdrFmPg5.mjs → index-DSDcG4QW.mjs} +2 -2
- package/dist/admin/{index--fSIDKkt.js → index-DuJM60tO.js} +2 -2
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/components/widgets/SurveyWidgetEditor.d.ts +2 -0
- package/dist/server/index.js +129 -22
- package/dist/server/index.mjs +129 -22
- package/dist/server/src/index.d.ts +23 -0
- package/dist/server/src/services/ci-survey.d.ts +23 -0
- package/dist/server/src/services/index.d.ts +23 -0
- package/dist/server/src/utils/surveyEngine.d.ts +19 -0
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
3
3
|
const React = require("react");
|
|
4
4
|
const ReactDOM = require("react-dom");
|
|
5
5
|
const admin = require("@strapi/strapi/admin");
|
|
6
|
-
const index = require("./index
|
|
6
|
+
const index = require("./index-DuJM60tO.js");
|
|
7
7
|
const cloneDeep = require("lodash/cloneDeep");
|
|
8
8
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
9
9
|
const React__default = /* @__PURE__ */ _interopDefault(React);
|
|
@@ -8090,7 +8090,7 @@ const SurveyAnalyticsView = ({
|
|
|
8090
8090
|
style: {
|
|
8091
8091
|
width: `${Math.min(100, opt.percentage)}%`,
|
|
8092
8092
|
height: "100%",
|
|
8093
|
-
background: opt.id === "__other__" ? "#64748b" : "linear-gradient(90deg, #2563eb 0%, #3b82f6 100%)",
|
|
8093
|
+
background: opt.id === "__other__" ? "#64748b" : opt.id === "__na__" ? "#94a3b8" : "linear-gradient(90deg, #2563eb 0%, #3b82f6 100%)",
|
|
8094
8094
|
borderRadius: 5
|
|
8095
8095
|
}
|
|
8096
8096
|
}
|
|
@@ -8218,6 +8218,37 @@ const SurveyAnalyticsView = ({
|
|
|
8218
8218
|
")"
|
|
8219
8219
|
]
|
|
8220
8220
|
}
|
|
8221
|
+
),
|
|
8222
|
+
(qs.noOpinionCount > 0 || qs.allowNoOpinion) && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8223
|
+
"div",
|
|
8224
|
+
{
|
|
8225
|
+
style: {
|
|
8226
|
+
padding: "8px 14px",
|
|
8227
|
+
borderRadius: 8,
|
|
8228
|
+
background: "#f1f5f9",
|
|
8229
|
+
border: "1px dashed #94a3b8",
|
|
8230
|
+
fontSize: 11.5,
|
|
8231
|
+
color: "#334155",
|
|
8232
|
+
fontWeight: 700
|
|
8233
|
+
},
|
|
8234
|
+
children: [
|
|
8235
|
+
pickTextForLocale(
|
|
8236
|
+
qs.noOpinionLabels,
|
|
8237
|
+
uiLocale,
|
|
8238
|
+
tr ? "Fikrim yok" : "No idea"
|
|
8239
|
+
),
|
|
8240
|
+
": ",
|
|
8241
|
+
qs.noOpinionCount || 0,
|
|
8242
|
+
" (",
|
|
8243
|
+
qs.noOpinionPercentage || 0,
|
|
8244
|
+
"%)",
|
|
8245
|
+
" ",
|
|
8246
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontWeight: 500, color: "#64748b", fontSize: 10.5 }, children: [
|
|
8247
|
+
"• ",
|
|
8248
|
+
tr ? "ortalamaya katılmaz" : "excluded from avg"
|
|
8249
|
+
] })
|
|
8250
|
+
]
|
|
8251
|
+
}
|
|
8221
8252
|
)
|
|
8222
8253
|
]
|
|
8223
8254
|
}
|
|
@@ -8387,102 +8418,131 @@ const SurveyAnalyticsView = ({
|
|
|
8387
8418
|
]
|
|
8388
8419
|
}
|
|
8389
8420
|
) }),
|
|
8390
|
-
qs.type === "ranking" && Array.isArray(qs.rankingBreakdown) && /* @__PURE__ */ jsxRuntime.
|
|
8391
|
-
|
|
8392
|
-
1,
|
|
8393
|
-
...qs.rankingBreakdown.map((x) => x.bordaPoints || 0)
|
|
8394
|
-
);
|
|
8395
|
-
const pct = Math.round((rk.bordaPoints || 0) / maxBorda * 100);
|
|
8396
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8421
|
+
qs.type === "ranking" && Array.isArray(qs.rankingBreakdown) && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
8422
|
+
(qs.noOpinionCount > 0 || qs.allowNoOpinion) && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8397
8423
|
"div",
|
|
8398
8424
|
{
|
|
8399
8425
|
style: {
|
|
8400
|
-
|
|
8401
|
-
|
|
8402
|
-
|
|
8403
|
-
background:
|
|
8404
|
-
|
|
8405
|
-
|
|
8406
|
-
|
|
8407
|
-
|
|
8408
|
-
flexWrap: "wrap"
|
|
8426
|
+
alignSelf: "flex-start",
|
|
8427
|
+
padding: "5px 11px",
|
|
8428
|
+
borderRadius: 7,
|
|
8429
|
+
background: "#f1f5f9",
|
|
8430
|
+
border: "1px dashed #94a3b8",
|
|
8431
|
+
fontSize: 11,
|
|
8432
|
+
fontWeight: 700,
|
|
8433
|
+
color: "#334155"
|
|
8409
8434
|
},
|
|
8410
8435
|
children: [
|
|
8411
|
-
|
|
8412
|
-
|
|
8413
|
-
|
|
8414
|
-
|
|
8415
|
-
|
|
8416
|
-
|
|
8417
|
-
|
|
8418
|
-
|
|
8419
|
-
|
|
8420
|
-
|
|
8421
|
-
|
|
8422
|
-
|
|
8423
|
-
|
|
8424
|
-
|
|
8425
|
-
|
|
8426
|
-
|
|
8427
|
-
|
|
8428
|
-
|
|
8429
|
-
|
|
8430
|
-
|
|
8431
|
-
|
|
8432
|
-
|
|
8433
|
-
|
|
8434
|
-
|
|
8435
|
-
|
|
8436
|
-
|
|
8437
|
-
|
|
8438
|
-
|
|
8439
|
-
|
|
8440
|
-
|
|
8441
|
-
|
|
8442
|
-
|
|
8443
|
-
|
|
8444
|
-
|
|
8445
|
-
|
|
8446
|
-
|
|
8447
|
-
|
|
8436
|
+
pickTextForLocale(
|
|
8437
|
+
qs.noOpinionLabels,
|
|
8438
|
+
uiLocale,
|
|
8439
|
+
tr ? "Fikrim yok" : "No idea"
|
|
8440
|
+
),
|
|
8441
|
+
": ",
|
|
8442
|
+
qs.noOpinionCount || 0,
|
|
8443
|
+
" (",
|
|
8444
|
+
qs.noOpinionPercentage || 0,
|
|
8445
|
+
"%)"
|
|
8446
|
+
]
|
|
8447
|
+
}
|
|
8448
|
+
),
|
|
8449
|
+
qs.rankingBreakdown.map((rk, idx) => {
|
|
8450
|
+
const maxBorda = Math.max(
|
|
8451
|
+
1,
|
|
8452
|
+
...qs.rankingBreakdown.map((x) => x.bordaPoints || 0)
|
|
8453
|
+
);
|
|
8454
|
+
const pct = Math.round((rk.bordaPoints || 0) / maxBorda * 100);
|
|
8455
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8456
|
+
"div",
|
|
8457
|
+
{
|
|
8458
|
+
style: {
|
|
8459
|
+
padding: "10px 12px",
|
|
8460
|
+
borderRadius: 8,
|
|
8461
|
+
border: idx === 0 ? "1.5px solid #f59e0b" : "1px solid #e2e8f0",
|
|
8462
|
+
background: idx === 0 ? "#fffbeb" : "#f8fafc",
|
|
8463
|
+
display: "flex",
|
|
8464
|
+
alignItems: "center",
|
|
8465
|
+
justifyContent: "space-between",
|
|
8466
|
+
gap: 12,
|
|
8467
|
+
flexWrap: "wrap"
|
|
8468
|
+
},
|
|
8469
|
+
children: [
|
|
8470
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 10 }, children: [
|
|
8471
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
8472
|
+
"span",
|
|
8473
|
+
{
|
|
8474
|
+
style: {
|
|
8475
|
+
width: 26,
|
|
8476
|
+
height: 26,
|
|
8477
|
+
borderRadius: "50%",
|
|
8478
|
+
background: idx === 0 ? "#f59e0b" : idx === 1 ? "#64748b" : idx === 2 ? "#b45309" : "#cbd5e1",
|
|
8479
|
+
color: "#fff",
|
|
8480
|
+
fontWeight: 800,
|
|
8481
|
+
fontSize: 12,
|
|
8482
|
+
display: "inline-flex",
|
|
8483
|
+
alignItems: "center",
|
|
8484
|
+
justifyContent: "center"
|
|
8485
|
+
},
|
|
8486
|
+
children: [
|
|
8487
|
+
"#",
|
|
8488
|
+
idx + 1
|
|
8489
|
+
]
|
|
8490
|
+
}
|
|
8491
|
+
),
|
|
8492
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
8493
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 13, fontWeight: 700, color: "#0f172a" }, children: pickTextForLocale(rk.labels, uiLocale, rk.id) }),
|
|
8494
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: 11, color: "#64748b" }, children: [
|
|
8495
|
+
tr ? "Ort. Sıra:" : "Avg Rank:",
|
|
8496
|
+
" ",
|
|
8497
|
+
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: rk.averageRank ?? rk.avgRank ?? "-" }),
|
|
8498
|
+
" •",
|
|
8499
|
+
" ",
|
|
8500
|
+
tr ? "1. Sıra Tercihi:" : "#1 Votes:",
|
|
8501
|
+
" ",
|
|
8502
|
+
/* @__PURE__ */ jsxRuntime.jsxs("strong", { children: [
|
|
8503
|
+
rk.firstPlaceCount ?? rk.firstPlaceVotes ?? 0,
|
|
8504
|
+
" (",
|
|
8505
|
+
rk.firstPlacePercentage,
|
|
8506
|
+
"%)"
|
|
8507
|
+
] })
|
|
8448
8508
|
] })
|
|
8449
8509
|
] })
|
|
8450
|
-
] })
|
|
8451
|
-
] }),
|
|
8452
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { minWidth: 150, textAlign: "right" }, children: [
|
|
8453
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: 11, fontWeight: 700, color: "#1e3a8a" }, children: [
|
|
8454
|
-
rk.bordaPoints,
|
|
8455
|
-
" ",
|
|
8456
|
-
tr ? "Borda Puanı" : "Borda pts"
|
|
8457
8510
|
] }),
|
|
8458
|
-
/* @__PURE__ */ jsxRuntime.
|
|
8459
|
-
"div",
|
|
8460
|
-
|
|
8461
|
-
|
|
8462
|
-
|
|
8463
|
-
|
|
8464
|
-
|
|
8465
|
-
|
|
8466
|
-
|
|
8467
|
-
|
|
8468
|
-
|
|
8469
|
-
|
|
8470
|
-
|
|
8471
|
-
|
|
8472
|
-
|
|
8473
|
-
|
|
8474
|
-
|
|
8511
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { minWidth: 150, textAlign: "right" }, children: [
|
|
8512
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: 11, fontWeight: 700, color: "#1e3a8a" }, children: [
|
|
8513
|
+
rk.bordaPoints,
|
|
8514
|
+
" ",
|
|
8515
|
+
tr ? "Borda Puanı" : "Borda pts"
|
|
8516
|
+
] }),
|
|
8517
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8518
|
+
"div",
|
|
8519
|
+
{
|
|
8520
|
+
style: {
|
|
8521
|
+
height: 6,
|
|
8522
|
+
borderRadius: 4,
|
|
8523
|
+
background: "#e2e8f0",
|
|
8524
|
+
marginTop: 4,
|
|
8525
|
+
overflow: "hidden"
|
|
8526
|
+
},
|
|
8527
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8528
|
+
"div",
|
|
8529
|
+
{
|
|
8530
|
+
style: {
|
|
8531
|
+
width: `${pct}%`,
|
|
8532
|
+
height: "100%",
|
|
8533
|
+
background: "#2563eb"
|
|
8534
|
+
}
|
|
8475
8535
|
}
|
|
8476
|
-
|
|
8477
|
-
|
|
8478
|
-
|
|
8479
|
-
)
|
|
8480
|
-
]
|
|
8481
|
-
|
|
8482
|
-
|
|
8483
|
-
|
|
8484
|
-
)
|
|
8485
|
-
|
|
8536
|
+
)
|
|
8537
|
+
}
|
|
8538
|
+
)
|
|
8539
|
+
] })
|
|
8540
|
+
]
|
|
8541
|
+
},
|
|
8542
|
+
rk.id
|
|
8543
|
+
);
|
|
8544
|
+
})
|
|
8545
|
+
] }),
|
|
8486
8546
|
qs.type === "consent" && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 12 }, children: [
|
|
8487
8547
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8488
8548
|
"div",
|
|
@@ -8916,6 +8976,18 @@ const SurveyLivePreviewPane = ({
|
|
|
8916
8976
|
}
|
|
8917
8977
|
if (generalError) setGeneralError("");
|
|
8918
8978
|
};
|
|
8979
|
+
const getNoOpinionLabel = (q) => pickTextForLocale(q.noOpinionLabel, testLocale, trTest ? "Fikrim yok" : "No idea");
|
|
8980
|
+
const clearOptionalQuestionAnswer = (q) => {
|
|
8981
|
+
if (q.type === "multiple_choice" || q.type === "image_choice" && (q.maxSelections ?? 1) > 1) {
|
|
8982
|
+
setAnswer(q.key, []);
|
|
8983
|
+
} else if (q.type === "matrix_single") {
|
|
8984
|
+
setAnswer(q.key, {});
|
|
8985
|
+
} else if (q.type === "short_text" || q.type === "long_text") {
|
|
8986
|
+
setAnswer(q.key, "");
|
|
8987
|
+
} else {
|
|
8988
|
+
setAnswer(q.key, null);
|
|
8989
|
+
}
|
|
8990
|
+
};
|
|
8919
8991
|
const validateTargetQuestions = (qs) => {
|
|
8920
8992
|
const nextErrs = {};
|
|
8921
8993
|
for (const q of qs) {
|
|
@@ -8942,11 +9014,12 @@ const SurveyLivePreviewPane = ({
|
|
|
8942
9014
|
}
|
|
8943
9015
|
} else if (q.type === "multiple_choice" || q.type === "image_choice" && (q.maxSelections ?? 1) > 1) {
|
|
8944
9016
|
const arr = Array.isArray(val) ? val : [];
|
|
9017
|
+
const isExclusiveNoOp = Boolean(q.allowNoOpinion && arr.includes("__na__"));
|
|
8945
9018
|
if (q.required && arr.length === 0) {
|
|
8946
9019
|
qErrs.push(
|
|
8947
9020
|
trTest ? "Lütfen en az bir seçenek işaretleyiniz." : "Please select at least one option."
|
|
8948
9021
|
);
|
|
8949
|
-
} else if (arr.length > 0) {
|
|
9022
|
+
} else if (arr.length > 0 && !isExclusiveNoOp) {
|
|
8950
9023
|
if (q.minSelections && arr.length < q.minSelections) {
|
|
8951
9024
|
qErrs.push(
|
|
8952
9025
|
trTest ? `En az ${q.minSelections} seçenek işaretlemelisiniz.` : `Please select at least ${q.minSelections} options.`
|
|
@@ -8958,7 +9031,7 @@ const SurveyLivePreviewPane = ({
|
|
|
8958
9031
|
);
|
|
8959
9032
|
}
|
|
8960
9033
|
}
|
|
8961
|
-
if (q.allowOther && arr.includes("__other__") && !String(otherTexts[q.key] || "").trim()) {
|
|
9034
|
+
if (!isExclusiveNoOp && q.allowOther && arr.includes("__other__") && !String(otherTexts[q.key] || "").trim()) {
|
|
8962
9035
|
qErrs.push(
|
|
8963
9036
|
trTest ? 'Lütfen "Diğer" seçeneği için açıklama giriniz.' : 'Please specify your "Other" choice.'
|
|
8964
9037
|
);
|
|
@@ -9535,7 +9608,7 @@ const SurveyLivePreviewPane = ({
|
|
|
9535
9608
|
) : /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: 12, color: "#334155", marginTop: 4 }, children: [
|
|
9536
9609
|
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: trTest ? "Yanıtınız:" : "Your answer:" }),
|
|
9537
9610
|
" ",
|
|
9538
|
-
typeof ans === "object" ? JSON.stringify(ans) : String(ans ?? "—")
|
|
9611
|
+
ans === "__na__" || Array.isArray(ans) && ans[0] === "__na__" ? getNoOpinionLabel(q) : typeof ans === "object" ? JSON.stringify(ans) : String(ans ?? "—")
|
|
9539
9612
|
] })
|
|
9540
9613
|
]
|
|
9541
9614
|
},
|
|
@@ -9732,11 +9805,45 @@ const SurveyLivePreviewPane = ({
|
|
|
9732
9805
|
},
|
|
9733
9806
|
children: [
|
|
9734
9807
|
q.type !== "consent" && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginBottom: 10 }, children: [
|
|
9735
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
9736
|
-
|
|
9737
|
-
|
|
9738
|
-
|
|
9739
|
-
|
|
9808
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
9809
|
+
"div",
|
|
9810
|
+
{
|
|
9811
|
+
style: {
|
|
9812
|
+
display: "flex",
|
|
9813
|
+
alignItems: "center",
|
|
9814
|
+
justifyContent: "space-between",
|
|
9815
|
+
gap: 8
|
|
9816
|
+
},
|
|
9817
|
+
children: [
|
|
9818
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: 14.5, fontWeight: 700, color: "#0f172a" }, children: [
|
|
9819
|
+
qTitle,
|
|
9820
|
+
" ",
|
|
9821
|
+
q.required && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "#dc2626" }, children: "*" })
|
|
9822
|
+
] }),
|
|
9823
|
+
!q.required && q.type !== "ranking" && q.type !== "short_text" && q.type !== "long_text" && !isEmptyVal(val) && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9824
|
+
"button",
|
|
9825
|
+
{
|
|
9826
|
+
type: "button",
|
|
9827
|
+
onClick: () => clearOptionalQuestionAnswer(q),
|
|
9828
|
+
style: {
|
|
9829
|
+
border: "none",
|
|
9830
|
+
background: "transparent",
|
|
9831
|
+
color: "#64748b",
|
|
9832
|
+
fontSize: 11,
|
|
9833
|
+
fontWeight: 600,
|
|
9834
|
+
cursor: "pointer",
|
|
9835
|
+
padding: "2px 6px",
|
|
9836
|
+
flexShrink: 0
|
|
9837
|
+
},
|
|
9838
|
+
children: [
|
|
9839
|
+
"× ",
|
|
9840
|
+
trTest ? "Seçimi Temizle" : "Clear"
|
|
9841
|
+
]
|
|
9842
|
+
}
|
|
9843
|
+
)
|
|
9844
|
+
]
|
|
9845
|
+
}
|
|
9846
|
+
),
|
|
9740
9847
|
qDesc && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: "#64748b", marginTop: 3 }, children: qDesc })
|
|
9741
9848
|
] }),
|
|
9742
9849
|
q.type === "single_choice" && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
@@ -9817,6 +9924,36 @@ const SurveyLivePreviewPane = ({
|
|
|
9817
9924
|
) })
|
|
9818
9925
|
]
|
|
9819
9926
|
}
|
|
9927
|
+
),
|
|
9928
|
+
q.allowNoOpinion && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9929
|
+
"label",
|
|
9930
|
+
{
|
|
9931
|
+
style: {
|
|
9932
|
+
display: "inline-flex",
|
|
9933
|
+
alignItems: "center",
|
|
9934
|
+
gap: 9,
|
|
9935
|
+
padding: "9px 12px",
|
|
9936
|
+
borderRadius: 8,
|
|
9937
|
+
border: val === "__na__" ? "1.5px solid #475569" : "1px dashed #94a3b8",
|
|
9938
|
+
background: val === "__na__" ? "#f1f5f9" : "#ffffff",
|
|
9939
|
+
color: "#334155",
|
|
9940
|
+
fontSize: 13,
|
|
9941
|
+
fontWeight: val === "__na__" ? 700 : 500,
|
|
9942
|
+
cursor: "pointer"
|
|
9943
|
+
},
|
|
9944
|
+
children: [
|
|
9945
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9946
|
+
"input",
|
|
9947
|
+
{
|
|
9948
|
+
type: "radio",
|
|
9949
|
+
name: `prev-${q.key}`,
|
|
9950
|
+
checked: val === "__na__",
|
|
9951
|
+
onChange: () => setAnswer(q.key, "__na__")
|
|
9952
|
+
}
|
|
9953
|
+
),
|
|
9954
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: getNoOpinionLabel(q) })
|
|
9955
|
+
]
|
|
9956
|
+
}
|
|
9820
9957
|
)
|
|
9821
9958
|
]
|
|
9822
9959
|
}
|
|
@@ -9874,7 +10011,8 @@ const SurveyLivePreviewPane = ({
|
|
|
9874
10011
|
type: "checkbox",
|
|
9875
10012
|
checked,
|
|
9876
10013
|
onChange: () => {
|
|
9877
|
-
const
|
|
10014
|
+
const cleaned = arr.filter((x) => x !== "__na__");
|
|
10015
|
+
const next = checked ? cleaned.filter((x) => x !== opt.id) : [...cleaned, opt.id];
|
|
9878
10016
|
setAnswer(q.key, next);
|
|
9879
10017
|
}
|
|
9880
10018
|
}
|
|
@@ -9912,7 +10050,8 @@ const SurveyLivePreviewPane = ({
|
|
|
9912
10050
|
type: "checkbox",
|
|
9913
10051
|
checked,
|
|
9914
10052
|
onChange: () => {
|
|
9915
|
-
const
|
|
10053
|
+
const cleaned = arr.filter((x) => x !== "__na__");
|
|
10054
|
+
const next = checked ? cleaned.filter((x) => x !== "__other__") : [...cleaned, "__other__"];
|
|
9916
10055
|
setAnswer(q.key, next);
|
|
9917
10056
|
}
|
|
9918
10057
|
}
|
|
@@ -9947,6 +10086,39 @@ const SurveyLivePreviewPane = ({
|
|
|
9947
10086
|
}
|
|
9948
10087
|
)
|
|
9949
10088
|
] });
|
|
10089
|
+
})(),
|
|
10090
|
+
q.allowNoOpinion && (() => {
|
|
10091
|
+
const arr = Array.isArray(val) ? val : [];
|
|
10092
|
+
const checked = arr.includes("__na__");
|
|
10093
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10094
|
+
"label",
|
|
10095
|
+
{
|
|
10096
|
+
style: {
|
|
10097
|
+
display: "flex",
|
|
10098
|
+
alignItems: "center",
|
|
10099
|
+
gap: 9,
|
|
10100
|
+
padding: "9px 12px",
|
|
10101
|
+
borderRadius: 8,
|
|
10102
|
+
border: checked ? "1.5px solid #475569" : "1px dashed #94a3b8",
|
|
10103
|
+
background: checked ? "#f1f5f9" : "#ffffff",
|
|
10104
|
+
color: "#334155",
|
|
10105
|
+
fontSize: 13,
|
|
10106
|
+
fontWeight: checked ? 700 : 500,
|
|
10107
|
+
cursor: "pointer"
|
|
10108
|
+
},
|
|
10109
|
+
children: [
|
|
10110
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10111
|
+
"input",
|
|
10112
|
+
{
|
|
10113
|
+
type: "checkbox",
|
|
10114
|
+
checked,
|
|
10115
|
+
onChange: () => setAnswer(q.key, checked ? [] : ["__na__"])
|
|
10116
|
+
}
|
|
10117
|
+
),
|
|
10118
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: getNoOpinionLabel(q) })
|
|
10119
|
+
]
|
|
10120
|
+
}
|
|
10121
|
+
);
|
|
9950
10122
|
})()
|
|
9951
10123
|
] }),
|
|
9952
10124
|
q.type === "dropdown" && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
@@ -9971,7 +10143,8 @@ const SurveyLivePreviewPane = ({
|
|
|
9971
10143
|
q.otherLabel,
|
|
9972
10144
|
testLocale,
|
|
9973
10145
|
trTest ? "Diğer" : "Other"
|
|
9974
|
-
) })
|
|
10146
|
+
) }),
|
|
10147
|
+
q.allowNoOpinion && /* @__PURE__ */ jsxRuntime.jsx("option", { value: "__na__", children: getNoOpinionLabel(q) })
|
|
9975
10148
|
]
|
|
9976
10149
|
}
|
|
9977
10150
|
),
|
|
@@ -10015,7 +10188,7 @@ const SurveyLivePreviewPane = ({
|
|
|
10015
10188
|
{
|
|
10016
10189
|
onClick: () => {
|
|
10017
10190
|
if (isMultiImg) {
|
|
10018
|
-
const arr = Array.isArray(val) ? val : [];
|
|
10191
|
+
const arr = Array.isArray(val) ? val.filter((x) => x !== "__na__") : [];
|
|
10019
10192
|
const next = selected ? arr.filter((x) => x !== opt.id) : [...arr, opt.id];
|
|
10020
10193
|
setAnswer(q.key, next);
|
|
10021
10194
|
} else {
|
|
@@ -10179,7 +10352,7 @@ const SurveyLivePreviewPane = ({
|
|
|
10179
10352
|
starVal
|
|
10180
10353
|
);
|
|
10181
10354
|
}),
|
|
10182
|
-
val ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10355
|
+
typeof val === "number" && val > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10183
10356
|
"span",
|
|
10184
10357
|
{
|
|
10185
10358
|
style: {
|
|
@@ -10340,7 +10513,18 @@ const SurveyLivePreviewPane = ({
|
|
|
10340
10513
|
})(),
|
|
10341
10514
|
q.type === "matrix_single" && (() => {
|
|
10342
10515
|
const mRows = Array.isArray(q.matrixRows) ? q.matrixRows : [];
|
|
10343
|
-
const
|
|
10516
|
+
const baseCols = Array.isArray(q.matrixColumns) ? q.matrixColumns : [];
|
|
10517
|
+
const mCols = q.allowNoOpinion ? [
|
|
10518
|
+
...baseCols,
|
|
10519
|
+
{
|
|
10520
|
+
id: "__na__",
|
|
10521
|
+
labels: {
|
|
10522
|
+
tr: getNoOpinionLabel(q),
|
|
10523
|
+
en: getNoOpinionLabel(q),
|
|
10524
|
+
[testLocale]: getNoOpinionLabel(q)
|
|
10525
|
+
}
|
|
10526
|
+
}
|
|
10527
|
+
] : baseCols;
|
|
10344
10528
|
const matrixAns = val && typeof val === "object" && !Array.isArray(val) ? val : {};
|
|
10345
10529
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { overflowX: "auto" }, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10346
10530
|
"table",
|
|
@@ -10548,6 +10732,51 @@ const SurveyLivePreviewPane = ({
|
|
|
10548
10732
|
})
|
|
10549
10733
|
] });
|
|
10550
10734
|
})(),
|
|
10735
|
+
q.allowNoOpinion && ["nps", "star_rating", "likert_scale", "image_choice", "ranking"].includes(
|
|
10736
|
+
q.type
|
|
10737
|
+
) && (() => {
|
|
10738
|
+
const isMulti = q.type === "ranking" || q.type === "image_choice" && (q.maxSelections ?? 1) > 1;
|
|
10739
|
+
const isNoOpSelected = isMulti ? Array.isArray(val) && val.includes("__na__") : val === "__na__";
|
|
10740
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginTop: 10 }, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10741
|
+
"button",
|
|
10742
|
+
{
|
|
10743
|
+
type: "button",
|
|
10744
|
+
onClick: () => {
|
|
10745
|
+
if (isNoOpSelected) {
|
|
10746
|
+
if (q.type === "ranking") {
|
|
10747
|
+
setAnswer(
|
|
10748
|
+
q.key,
|
|
10749
|
+
(q.options || []).map((o) => o.id)
|
|
10750
|
+
);
|
|
10751
|
+
} else if (isMulti) {
|
|
10752
|
+
setAnswer(q.key, []);
|
|
10753
|
+
} else {
|
|
10754
|
+
setAnswer(q.key, null);
|
|
10755
|
+
}
|
|
10756
|
+
} else {
|
|
10757
|
+
setAnswer(q.key, isMulti ? ["__na__"] : "__na__");
|
|
10758
|
+
}
|
|
10759
|
+
},
|
|
10760
|
+
style: {
|
|
10761
|
+
padding: "6px 13px",
|
|
10762
|
+
borderRadius: 18,
|
|
10763
|
+
border: isNoOpSelected ? "1.5px solid #334155" : "1px dashed #94a3b8",
|
|
10764
|
+
background: isNoOpSelected ? "#334155" : "#f8fafc",
|
|
10765
|
+
color: isNoOpSelected ? "#ffffff" : "#475569",
|
|
10766
|
+
fontSize: 12,
|
|
10767
|
+
fontWeight: 700,
|
|
10768
|
+
cursor: "pointer",
|
|
10769
|
+
display: "inline-flex",
|
|
10770
|
+
alignItems: "center",
|
|
10771
|
+
gap: 6
|
|
10772
|
+
},
|
|
10773
|
+
children: [
|
|
10774
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: isNoOpSelected ? "✓" : "○" }),
|
|
10775
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: getNoOpinionLabel(q) })
|
|
10776
|
+
]
|
|
10777
|
+
}
|
|
10778
|
+
) });
|
|
10779
|
+
})(),
|
|
10551
10780
|
q.type === "short_text" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10552
10781
|
"input",
|
|
10553
10782
|
{
|
|
@@ -14671,6 +14900,121 @@ const SurveyStudioModal = ({
|
|
|
14671
14900
|
)
|
|
14672
14901
|
] });
|
|
14673
14902
|
})(),
|
|
14903
|
+
[
|
|
14904
|
+
"single_choice",
|
|
14905
|
+
"multiple_choice",
|
|
14906
|
+
"dropdown",
|
|
14907
|
+
"image_choice",
|
|
14908
|
+
"nps",
|
|
14909
|
+
"star_rating",
|
|
14910
|
+
"likert_scale",
|
|
14911
|
+
"matrix_single",
|
|
14912
|
+
"ranking"
|
|
14913
|
+
].includes(activeQ.type) && (() => {
|
|
14914
|
+
const noOpObj = normalizeLocalizedRecord(
|
|
14915
|
+
activeQ.noOpinionLabel,
|
|
14916
|
+
strapiLocales,
|
|
14917
|
+
{
|
|
14918
|
+
tr: "Fikrim yok",
|
|
14919
|
+
en: "No idea"
|
|
14920
|
+
}
|
|
14921
|
+
);
|
|
14922
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
14923
|
+
"div",
|
|
14924
|
+
{
|
|
14925
|
+
style: {
|
|
14926
|
+
padding: "10px 12px",
|
|
14927
|
+
borderRadius: 8,
|
|
14928
|
+
background: activeQ.allowNoOpinion ? "#f0fdf4" : "#f8fafc",
|
|
14929
|
+
border: activeQ.allowNoOpinion ? "1px solid #86efac" : "1px solid #e2e8f0",
|
|
14930
|
+
display: "flex",
|
|
14931
|
+
flexDirection: "column",
|
|
14932
|
+
gap: 8
|
|
14933
|
+
},
|
|
14934
|
+
children: [
|
|
14935
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
14936
|
+
"div",
|
|
14937
|
+
{
|
|
14938
|
+
style: {
|
|
14939
|
+
display: "flex",
|
|
14940
|
+
alignItems: "center",
|
|
14941
|
+
justifyContent: "space-between",
|
|
14942
|
+
flexWrap: "wrap",
|
|
14943
|
+
gap: 8
|
|
14944
|
+
},
|
|
14945
|
+
children: [
|
|
14946
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
14947
|
+
"label",
|
|
14948
|
+
{
|
|
14949
|
+
style: {
|
|
14950
|
+
display: "inline-flex",
|
|
14951
|
+
alignItems: "center",
|
|
14952
|
+
gap: 7,
|
|
14953
|
+
fontSize: 11.5,
|
|
14954
|
+
fontWeight: 700,
|
|
14955
|
+
color: "#0f172a",
|
|
14956
|
+
cursor: "pointer"
|
|
14957
|
+
},
|
|
14958
|
+
children: [
|
|
14959
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14960
|
+
"input",
|
|
14961
|
+
{
|
|
14962
|
+
type: "checkbox",
|
|
14963
|
+
checked: Boolean(activeQ.allowNoOpinion),
|
|
14964
|
+
onChange: (e) => {
|
|
14965
|
+
const enabled = e.target.checked;
|
|
14966
|
+
updateActiveQuestion({
|
|
14967
|
+
allowNoOpinion: enabled,
|
|
14968
|
+
...enabled && !activeQ.noOpinionLabel ? { noOpinionLabel: noOpObj } : {}
|
|
14969
|
+
});
|
|
14970
|
+
}
|
|
14971
|
+
}
|
|
14972
|
+
),
|
|
14973
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: tr ? '"Fikrim yok / Bilmiyorum" (No idea / N/A) Seçeneği Sun' : 'Allow "No idea / N/A" (No Opinion) Option' })
|
|
14974
|
+
]
|
|
14975
|
+
}
|
|
14976
|
+
),
|
|
14977
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 10.5, color: "#64748b" }, children: tr ? "Zorunlu soruyu geçer; ölçek/puan ortalamasını ve NPS skorunu bozmaz" : "Satisfies required rule without skewing score averages or NPS" })
|
|
14978
|
+
]
|
|
14979
|
+
}
|
|
14980
|
+
),
|
|
14981
|
+
activeQ.allowNoOpinion && /* @__PURE__ */ jsxRuntime.jsx(
|
|
14982
|
+
"div",
|
|
14983
|
+
{
|
|
14984
|
+
style: {
|
|
14985
|
+
display: "grid",
|
|
14986
|
+
gridTemplateColumns: localeGridCols,
|
|
14987
|
+
gap: 8
|
|
14988
|
+
},
|
|
14989
|
+
children: strapiLocales.map((loc) => /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
14990
|
+
/* @__PURE__ */ jsxRuntime.jsxs("label", { style: labelStyle, children: [
|
|
14991
|
+
tr ? "Boş / Fikrim Yok Etiketi" : "No-Opinion Label",
|
|
14992
|
+
" (",
|
|
14993
|
+
loc.code.toUpperCase(),
|
|
14994
|
+
")"
|
|
14995
|
+
] }),
|
|
14996
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14997
|
+
"input",
|
|
14998
|
+
{
|
|
14999
|
+
type: "text",
|
|
15000
|
+
value: noOpObj[loc.code] || "",
|
|
15001
|
+
onChange: (e) => updateActiveQuestion({
|
|
15002
|
+
noOpinionLabel: {
|
|
15003
|
+
...noOpObj,
|
|
15004
|
+
[loc.code]: e.target.value
|
|
15005
|
+
}
|
|
15006
|
+
}),
|
|
15007
|
+
placeholder: loc.code.toLowerCase().startsWith("tr") ? "Fikrim yok" : "No idea",
|
|
15008
|
+
style: inputStyle
|
|
15009
|
+
}
|
|
15010
|
+
)
|
|
15011
|
+
] }, `noop-${loc.code}`))
|
|
15012
|
+
}
|
|
15013
|
+
)
|
|
15014
|
+
]
|
|
15015
|
+
}
|
|
15016
|
+
);
|
|
15017
|
+
})(),
|
|
14674
15018
|
[
|
|
14675
15019
|
"single_choice",
|
|
14676
15020
|
"multiple_choice",
|