@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 = 4;
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] = react.useState(clampedInitial);
4180
4180
  const [dialect, setDialect] = react.useState("");
4181
+ const [categoryId, setCategoryId] = react.useState(() => {
4182
+ if (!dialect) return "";
4183
+ const found = chunkPADXORD2_js.DIALECT_CATEGORIES.find((c) => c.dialects.some((d) => d.value === dialect));
4184
+ return found?.id ?? "";
4185
+ });
4181
4186
  const [name, setName] = react.useState("");
4182
4187
  const [host, setHost] = react.useState("");
4183
4188
  const [port, setPort] = react.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(dialect);
4241
- if (from === 2) return name.trim().length > 0;
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 = react.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__ */ jsxRuntime.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: chunkPADXORD2_js.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__ */ jsxRuntime.jsx(
4393
+ chunkKZDABEML_js.FilterTileButton,
4394
+ {
4395
+ isActive: selected,
4396
+ color,
4397
+ icon: /* @__PURE__ */ jsxRuntime.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
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-5", children: chunkPADXORD2_js.DIALECT_CATEGORIES.map((cat) => {
4375
- const color = CATEGORY_COLOR[cat.id] ?? "slate";
4376
- const categoryLabel = labels[cat.labelKey] ?? cat.id;
4377
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
4378
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-2 flex items-center gap-2 text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: [
4379
- /* @__PURE__ */ jsxRuntime.jsx(cat.icon, { className: "h-3.5 w-3.5" }),
4380
- categoryLabel
4381
- ] }),
4382
- /* @__PURE__ */ jsxRuntime.jsx(
4383
- "div",
4384
- {
4385
- role: "radiogroup",
4386
- "aria-label": categoryLabel,
4387
- className: "grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4",
4388
- children: cat.dialects.map((opt) => {
4389
- const selected = opt.value === dialect;
4390
- const logoSrc = DIALECT_LOGO_SRC[opt.value.toLowerCase()];
4391
- return /* @__PURE__ */ jsxRuntime.jsx(
4392
- chunkKZDABEML_js.FilterTileButton,
4393
- {
4394
- isActive: selected,
4395
- color,
4396
- icon: logoSrc ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: logoSrc, alt: opt.label, className: "h-5 w-5 object-contain" }) : /* @__PURE__ */ jsxRuntime.jsx(outline.CircleStackIcon, { className: "h-5 w-5" }),
4397
- label: opt.label,
4398
- count: opt.formType.replace("-", " "),
4399
- onClick: () => {
4400
- setDialect(opt.value);
4401
- markTouched();
4402
- }
4403
- },
4404
- opt.value
4405
- );
4406
- })
4407
- }
4408
- )
4409
- ] }, cat.id);
4410
- }) });
4415
+ const cat = chunkPADXORD2_js.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__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
4420
+ /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsx(cat.icon, { className: "h-3.5 w-3.5" }),
4422
+ categoryLabel
4423
+ ] }),
4424
+ /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsx(
4434
+ chunkKZDABEML_js.FilterTileButton,
4435
+ {
4436
+ isActive: selected,
4437
+ color,
4438
+ icon: logoSrc ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: logoSrc, alt: opt.label, className: "h-5 w-5 object-contain" }) : /* @__PURE__ */ jsxRuntime.jsx(outline.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 ? renderStep1() : step === 2 ? renderStep2() : step === 3 ? renderStep3() : renderStep4();
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 === 1 || step === 4;
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__ */ jsxRuntime.jsxs("div", { className: "liquid-divider flex items-center justify-between border-t pt-4", children: [
4947
4997
  /* @__PURE__ */ jsxRuntime.jsx(chunkMXQ2EYG2_js.Button, { type: "button", outline: true, onClick: step === 1 ? cancelWithConfirm : goBack, disabled: submitting, children: step === 1 ? labels.wizardCancel : labels.wizardBack }),