@datatechsolutions/ui 3.15.0 → 3.15.1
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.
|
@@ -4166,7 +4166,7 @@ var CATEGORY_COLOR = {
|
|
|
4166
4166
|
keyvalue: "red",
|
|
4167
4167
|
search: "amber"
|
|
4168
4168
|
};
|
|
4169
|
-
var TOTAL_STEPS2 =
|
|
4169
|
+
var TOTAL_STEPS2 = 5;
|
|
4170
4170
|
function DatasourceNewWizardPageView({
|
|
4171
4171
|
labels,
|
|
4172
4172
|
initialStep,
|
|
@@ -4178,6 +4178,11 @@ function DatasourceNewWizardPageView({
|
|
|
4178
4178
|
const clampedInitial = Math.min(TOTAL_STEPS2, Math.max(1, initialStep ?? 1));
|
|
4179
4179
|
const [step, setStep] = useState(clampedInitial);
|
|
4180
4180
|
const [dialect, setDialect] = useState("");
|
|
4181
|
+
const [categoryId, setCategoryId] = useState(() => {
|
|
4182
|
+
if (!dialect) return "";
|
|
4183
|
+
const found = DIALECT_CATEGORIES.find((c) => c.dialects.some((d) => d.value === dialect));
|
|
4184
|
+
return found?.id ?? "";
|
|
4185
|
+
});
|
|
4181
4186
|
const [name, setName] = useState("");
|
|
4182
4187
|
const [host, setHost] = useState("");
|
|
4183
4188
|
const [port, setPort] = useState("");
|
|
@@ -4237,8 +4242,9 @@ function DatasourceNewWizardPageView({
|
|
|
4237
4242
|
onStepChange?.(clamped);
|
|
4238
4243
|
}, [onStepChange]);
|
|
4239
4244
|
function canAdvance(from) {
|
|
4240
|
-
if (from === 1) return Boolean(
|
|
4241
|
-
if (from === 2) return
|
|
4245
|
+
if (from === 1) return Boolean(categoryId);
|
|
4246
|
+
if (from === 2) return Boolean(dialect);
|
|
4247
|
+
if (from === 3) return name.trim().length > 0;
|
|
4242
4248
|
return true;
|
|
4243
4249
|
}
|
|
4244
4250
|
const goNext = useCallback(() => {
|
|
@@ -4326,12 +4332,14 @@ function DatasourceNewWizardPageView({
|
|
|
4326
4332
|
return () => window.removeEventListener("keydown", onKey);
|
|
4327
4333
|
}, [step, dialect, name, touched]);
|
|
4328
4334
|
const stepTitles = [
|
|
4329
|
-
labels.wizardStep1Title
|
|
4335
|
+
`${labels.wizardStep1Title} \xB7 1/2`,
|
|
4336
|
+
`${labels.wizardStep1Title} \xB7 2/2`,
|
|
4330
4337
|
labels.wizardStep2Title,
|
|
4331
4338
|
labels.wizardStep3Title,
|
|
4332
4339
|
labels.wizardStep4Title
|
|
4333
4340
|
];
|
|
4334
4341
|
const stepSubtitles = [
|
|
4342
|
+
labels.wizardStep1Subtitle,
|
|
4335
4343
|
labels.wizardStep1Subtitle,
|
|
4336
4344
|
labels.wizardStep2Subtitle,
|
|
4337
4345
|
labels.wizardStep3Subtitle,
|
|
@@ -4370,44 +4378,77 @@ function DatasourceNewWizardPageView({
|
|
|
4370
4378
|
)
|
|
4371
4379
|
}
|
|
4372
4380
|
);
|
|
4381
|
+
function renderStepCategory() {
|
|
4382
|
+
return /* @__PURE__ */ jsx(
|
|
4383
|
+
"div",
|
|
4384
|
+
{
|
|
4385
|
+
role: "radiogroup",
|
|
4386
|
+
"aria-label": labels.wizardStep1Title,
|
|
4387
|
+
className: "grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4",
|
|
4388
|
+
children: DIALECT_CATEGORIES.map((cat) => {
|
|
4389
|
+
const color = CATEGORY_COLOR[cat.id] ?? "slate";
|
|
4390
|
+
const categoryLabel = labels[cat.labelKey] ?? cat.id;
|
|
4391
|
+
const selected = cat.id === categoryId;
|
|
4392
|
+
return /* @__PURE__ */ jsx(
|
|
4393
|
+
FilterTileButton,
|
|
4394
|
+
{
|
|
4395
|
+
isActive: selected,
|
|
4396
|
+
color,
|
|
4397
|
+
icon: /* @__PURE__ */ jsx(cat.icon, { className: "h-5 w-5" }),
|
|
4398
|
+
label: categoryLabel,
|
|
4399
|
+
count: `${cat.dialects.length}`,
|
|
4400
|
+
onClick: () => {
|
|
4401
|
+
setCategoryId(cat.id);
|
|
4402
|
+
if (dialect && !cat.dialects.some((d) => d.value === dialect)) {
|
|
4403
|
+
setDialect("");
|
|
4404
|
+
}
|
|
4405
|
+
markTouched();
|
|
4406
|
+
}
|
|
4407
|
+
},
|
|
4408
|
+
cat.id
|
|
4409
|
+
);
|
|
4410
|
+
})
|
|
4411
|
+
}
|
|
4412
|
+
);
|
|
4413
|
+
}
|
|
4373
4414
|
function renderStep1() {
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
}
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
}
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4415
|
+
const cat = DIALECT_CATEGORIES.find((c) => c.id === categoryId);
|
|
4416
|
+
if (!cat) return null;
|
|
4417
|
+
const color = CATEGORY_COLOR[cat.id] ?? "slate";
|
|
4418
|
+
const categoryLabel = labels[cat.labelKey] ?? cat.id;
|
|
4419
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
4420
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: [
|
|
4421
|
+
/* @__PURE__ */ jsx(cat.icon, { className: "h-3.5 w-3.5" }),
|
|
4422
|
+
categoryLabel
|
|
4423
|
+
] }),
|
|
4424
|
+
/* @__PURE__ */ jsx(
|
|
4425
|
+
"div",
|
|
4426
|
+
{
|
|
4427
|
+
role: "radiogroup",
|
|
4428
|
+
"aria-label": categoryLabel,
|
|
4429
|
+
className: "grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4",
|
|
4430
|
+
children: cat.dialects.map((opt) => {
|
|
4431
|
+
const selected = opt.value === dialect;
|
|
4432
|
+
const logoSrc = DIALECT_LOGO_SRC[opt.value.toLowerCase()];
|
|
4433
|
+
return /* @__PURE__ */ jsx(
|
|
4434
|
+
FilterTileButton,
|
|
4435
|
+
{
|
|
4436
|
+
isActive: selected,
|
|
4437
|
+
color,
|
|
4438
|
+
icon: logoSrc ? /* @__PURE__ */ jsx("img", { src: logoSrc, alt: opt.label, className: "h-5 w-5 object-contain" }) : /* @__PURE__ */ jsx(CircleStackIcon, { className: "h-5 w-5" }),
|
|
4439
|
+
label: opt.label,
|
|
4440
|
+
count: opt.formType.replace("-", " "),
|
|
4441
|
+
onClick: () => {
|
|
4442
|
+
setDialect(opt.value);
|
|
4443
|
+
markTouched();
|
|
4444
|
+
}
|
|
4445
|
+
},
|
|
4446
|
+
opt.value
|
|
4447
|
+
);
|
|
4448
|
+
})
|
|
4449
|
+
}
|
|
4450
|
+
)
|
|
4451
|
+
] });
|
|
4411
4452
|
}
|
|
4412
4453
|
function renderConnectionFields() {
|
|
4413
4454
|
if (!dialectOption) return null;
|
|
@@ -4938,10 +4979,19 @@ function DatasourceNewWizardPageView({
|
|
|
4938
4979
|
)
|
|
4939
4980
|
] });
|
|
4940
4981
|
}
|
|
4941
|
-
const stepBody = step === 1 ?
|
|
4982
|
+
const stepBody = step === 1 ? renderStepCategory() : step === 2 ? renderStep1() : (
|
|
4983
|
+
// dialect picker — original step 1
|
|
4984
|
+
step === 3 ? renderStep2() : (
|
|
4985
|
+
// connection — original step 2
|
|
4986
|
+
step === 4 ? renderStep3() : (
|
|
4987
|
+
// governance — original step 3
|
|
4988
|
+
renderStep4()
|
|
4989
|
+
)
|
|
4990
|
+
)
|
|
4991
|
+
);
|
|
4942
4992
|
const advanceDisabled = !canAdvance(step);
|
|
4943
4993
|
const isLast = step === TOTAL_STEPS2;
|
|
4944
|
-
const scrollableStep = step ===
|
|
4994
|
+
const scrollableStep = step === TOTAL_STEPS2;
|
|
4945
4995
|
const bodyClass = scrollableStep ? "p-5 pt-5 sm:p-8 sm:pt-8 max-h-[60vh] overflow-y-auto" : "p-5 pt-5 sm:p-8 sm:pt-8";
|
|
4946
4996
|
const footer = /* @__PURE__ */ jsxs("div", { className: "liquid-divider flex items-center justify-between border-t pt-4", children: [
|
|
4947
4997
|
/* @__PURE__ */ jsx(Button, { type: "button", outline: true, onClick: step === 1 ? cancelWithConfirm : goBack, disabled: submitting, children: step === 1 ? labels.wizardCancel : labels.wizardBack }),
|