@yuneta/gobj-ui 7.10.0 → 7.10.2

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.
@@ -18483,54 +18483,43 @@ function ac_show_schema(gobj, event, kw, src) {
18483
18483
  function build_delete_question(gobj, records) {
18484
18484
  let desc = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "desc");
18485
18485
  let impact = delete_impact(desc, records);
18486
+ const ROW = "display:flex; align-items:baseline; gap:.35rem; flex-wrap:wrap;";
18486
18487
  let lines = [];
18487
18488
  let pkey = desc && desc.pkey || "id";
18488
18489
  let one = impact.records === 1 && Array.isArray(records) ? records[0] : impact.records === 1 ? records : null;
18489
18490
  if (one && one[pkey] !== void 0 && one[pkey] !== null) lines.push([
18490
18491
  "p",
18491
- { class: "DELETE_ASK_WHAT" },
18492
- [
18493
- [
18494
- "span",
18495
- { i18n: "delete" },
18496
- (0, i18next.t)("delete")
18497
- ],
18498
- [
18499
- "span",
18500
- {},
18501
- " "
18502
- ],
18503
- [
18504
- "strong",
18505
- {},
18506
- String(one[pkey])
18507
- ]
18508
- ]
18492
+ {
18493
+ class: "DELETE_ASK_WHAT",
18494
+ style: ROW
18495
+ },
18496
+ [[
18497
+ "span",
18498
+ { i18n: "delete" },
18499
+ (0, i18next.t)("delete")
18500
+ ], [
18501
+ "strong",
18502
+ {},
18503
+ String(one[pkey])
18504
+ ]]
18509
18505
  ]);
18510
18506
  else lines.push([
18511
18507
  "p",
18512
- { class: "DELETE_ASK_WHAT" },
18508
+ {
18509
+ class: "DELETE_ASK_WHAT",
18510
+ style: ROW
18511
+ },
18513
18512
  [
18514
18513
  [
18515
18514
  "span",
18516
18515
  { i18n: "delete" },
18517
18516
  (0, i18next.t)("delete")
18518
18517
  ],
18519
- [
18520
- "span",
18521
- {},
18522
- " "
18523
- ],
18524
18518
  [
18525
18519
  "strong",
18526
18520
  {},
18527
18521
  String(impact.records)
18528
18522
  ],
18529
- [
18530
- "span",
18531
- {},
18532
- " "
18533
- ],
18534
18523
  [
18535
18524
  "span",
18536
18525
  { i18n: "records" },
@@ -18540,53 +18529,41 @@ function build_delete_question(gobj, records) {
18540
18529
  ]);
18541
18530
  if (impact.children > 0) lines.push([
18542
18531
  "p",
18543
- { class: "DELETE_ASK_CHILDREN has-text-weight-semibold" },
18544
- [
18545
- [
18546
- "strong",
18547
- {},
18548
- String(impact.children)
18549
- ],
18550
- [
18551
- "span",
18552
- {},
18553
- " "
18554
- ],
18555
- [
18556
- "span",
18557
- { i18n: "children will be unlinked, not deleted" },
18558
- (0, i18next.t)("children will be unlinked, not deleted")
18559
- ]
18560
- ]
18532
+ {
18533
+ class: "DELETE_ASK_CHILDREN has-text-weight-semibold",
18534
+ style: ROW
18535
+ },
18536
+ [[
18537
+ "strong",
18538
+ {},
18539
+ String(impact.children)
18540
+ ], [
18541
+ "span",
18542
+ { i18n: "children will be unlinked, not deleted" },
18543
+ (0, i18next.t)("children will be unlinked, not deleted", { count: impact.children })
18544
+ ]]
18561
18545
  ]);
18562
18546
  if (impact.parents > 0) lines.push([
18563
18547
  "p",
18564
- { class: "DELETE_ASK_PARENTS" },
18548
+ {
18549
+ class: "DELETE_ASK_PARENTS",
18550
+ style: ROW
18551
+ },
18565
18552
  [
18566
18553
  [
18567
18554
  "span",
18568
18555
  { i18n: "it will be detached from" },
18569
18556
  (0, i18next.t)("it will be detached from")
18570
18557
  ],
18571
- [
18572
- "span",
18573
- {},
18574
- " "
18575
- ],
18576
18558
  [
18577
18559
  "strong",
18578
18560
  {},
18579
18561
  String(impact.parents)
18580
18562
  ],
18581
- [
18582
- "span",
18583
- {},
18584
- " "
18585
- ],
18586
18563
  [
18587
18564
  "span",
18588
18565
  { i18n: "parents" },
18589
- (0, i18next.t)("parents")
18566
+ (0, i18next.t)("parents", { count: impact.parents })
18590
18567
  ]
18591
18568
  ]
18592
18569
  ]);
@@ -56669,8 +56646,8 @@ function show_delete_confirm(gobj, nodeData) {
56669
56646
  let topic_name = nodeData.data.desc.topic_name;
56670
56647
  let impact = delete_impact(nodeData.data.desc, record);
56671
56648
  let question = (0, i18next.t)("delete") + " " + topic_name + ": " + record.id + "?";
56672
- if (impact.children > 0) question += "\n" + impact.children + " " + (0, i18next.t)("children will be unlinked, not deleted");
56673
- if (impact.parents > 0) question += "\n" + (0, i18next.t)("it will be detached from") + " " + impact.parents + " " + (0, i18next.t)("parents");
56649
+ if (impact.children > 0) question += "\n" + impact.children + " " + (0, i18next.t)("children will be unlinked, not deleted", { count: impact.children });
56650
+ if (impact.parents > 0) question += "\n" + (0, i18next.t)("it will be detached from") + " " + impact.parents + " " + (0, i18next.t)("parents", { count: impact.parents });
56674
56651
  show_confirm_popover(gobj, priv._node_delete_el, question, "delete", "#ff4d4f", () => execute_delete_node(gobj, nodeData), "_delete_confirm_el");
56675
56652
  }
56676
56653
  function hide_delete_confirm(gobj) {
@@ -18478,54 +18478,43 @@ function ac_show_schema(gobj, event, kw, src) {
18478
18478
  function build_delete_question(gobj, records) {
18479
18479
  let desc = gobj_read_attr(gobj, "desc");
18480
18480
  let impact = delete_impact(desc, records);
18481
+ const ROW = "display:flex; align-items:baseline; gap:.35rem; flex-wrap:wrap;";
18481
18482
  let lines = [];
18482
18483
  let pkey = desc && desc.pkey || "id";
18483
18484
  let one = impact.records === 1 && Array.isArray(records) ? records[0] : impact.records === 1 ? records : null;
18484
18485
  if (one && one[pkey] !== void 0 && one[pkey] !== null) lines.push([
18485
18486
  "p",
18486
- { class: "DELETE_ASK_WHAT" },
18487
- [
18488
- [
18489
- "span",
18490
- { i18n: "delete" },
18491
- t("delete")
18492
- ],
18493
- [
18494
- "span",
18495
- {},
18496
- " "
18497
- ],
18498
- [
18499
- "strong",
18500
- {},
18501
- String(one[pkey])
18502
- ]
18503
- ]
18487
+ {
18488
+ class: "DELETE_ASK_WHAT",
18489
+ style: ROW
18490
+ },
18491
+ [[
18492
+ "span",
18493
+ { i18n: "delete" },
18494
+ t("delete")
18495
+ ], [
18496
+ "strong",
18497
+ {},
18498
+ String(one[pkey])
18499
+ ]]
18504
18500
  ]);
18505
18501
  else lines.push([
18506
18502
  "p",
18507
- { class: "DELETE_ASK_WHAT" },
18503
+ {
18504
+ class: "DELETE_ASK_WHAT",
18505
+ style: ROW
18506
+ },
18508
18507
  [
18509
18508
  [
18510
18509
  "span",
18511
18510
  { i18n: "delete" },
18512
18511
  t("delete")
18513
18512
  ],
18514
- [
18515
- "span",
18516
- {},
18517
- " "
18518
- ],
18519
18513
  [
18520
18514
  "strong",
18521
18515
  {},
18522
18516
  String(impact.records)
18523
18517
  ],
18524
- [
18525
- "span",
18526
- {},
18527
- " "
18528
- ],
18529
18518
  [
18530
18519
  "span",
18531
18520
  { i18n: "records" },
@@ -18535,53 +18524,41 @@ function build_delete_question(gobj, records) {
18535
18524
  ]);
18536
18525
  if (impact.children > 0) lines.push([
18537
18526
  "p",
18538
- { class: "DELETE_ASK_CHILDREN has-text-weight-semibold" },
18539
- [
18540
- [
18541
- "strong",
18542
- {},
18543
- String(impact.children)
18544
- ],
18545
- [
18546
- "span",
18547
- {},
18548
- " "
18549
- ],
18550
- [
18551
- "span",
18552
- { i18n: "children will be unlinked, not deleted" },
18553
- t("children will be unlinked, not deleted")
18554
- ]
18555
- ]
18527
+ {
18528
+ class: "DELETE_ASK_CHILDREN has-text-weight-semibold",
18529
+ style: ROW
18530
+ },
18531
+ [[
18532
+ "strong",
18533
+ {},
18534
+ String(impact.children)
18535
+ ], [
18536
+ "span",
18537
+ { i18n: "children will be unlinked, not deleted" },
18538
+ t("children will be unlinked, not deleted", { count: impact.children })
18539
+ ]]
18556
18540
  ]);
18557
18541
  if (impact.parents > 0) lines.push([
18558
18542
  "p",
18559
- { class: "DELETE_ASK_PARENTS" },
18543
+ {
18544
+ class: "DELETE_ASK_PARENTS",
18545
+ style: ROW
18546
+ },
18560
18547
  [
18561
18548
  [
18562
18549
  "span",
18563
18550
  { i18n: "it will be detached from" },
18564
18551
  t("it will be detached from")
18565
18552
  ],
18566
- [
18567
- "span",
18568
- {},
18569
- " "
18570
- ],
18571
18553
  [
18572
18554
  "strong",
18573
18555
  {},
18574
18556
  String(impact.parents)
18575
18557
  ],
18576
- [
18577
- "span",
18578
- {},
18579
- " "
18580
- ],
18581
18558
  [
18582
18559
  "span",
18583
18560
  { i18n: "parents" },
18584
- t("parents")
18561
+ t("parents", { count: impact.parents })
18585
18562
  ]
18586
18563
  ]
18587
18564
  ]);
@@ -56656,8 +56633,8 @@ function show_delete_confirm(gobj, nodeData) {
56656
56633
  let topic_name = nodeData.data.desc.topic_name;
56657
56634
  let impact = delete_impact(nodeData.data.desc, record);
56658
56635
  let question = t("delete") + " " + topic_name + ": " + record.id + "?";
56659
- if (impact.children > 0) question += "\n" + impact.children + " " + t("children will be unlinked, not deleted");
56660
- if (impact.parents > 0) question += "\n" + t("it will be detached from") + " " + impact.parents + " " + t("parents");
56636
+ if (impact.children > 0) question += "\n" + impact.children + " " + t("children will be unlinked, not deleted", { count: impact.children });
56637
+ if (impact.parents > 0) question += "\n" + t("it will be detached from") + " " + impact.parents + " " + t("parents", { count: impact.parents });
56661
56638
  show_confirm_popover(gobj, priv._node_delete_el, question, "delete", "#ff4d4f", () => execute_delete_node(gobj, nodeData), "_delete_confirm_el");
56662
56639
  }
56663
56640
  function hide_delete_confirm(gobj) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuneta/gobj-ui",
3
- "version": "7.10.0",
3
+ "version": "7.10.2",
4
4
  "type": "module",
5
5
  "main": "dist/gobj-ui.cjs.js",
6
6
  "module": "dist/gobj-ui.es.js",
@@ -5012,11 +5012,11 @@ function show_delete_confirm(gobj, nodeData)
5012
5012
  let question = t('delete') + ' ' + topic_name + ': ' + record.id + '?';
5013
5013
  if(impact.children > 0) {
5014
5014
  question += '\n' + impact.children + ' ' +
5015
- t('children will be unlinked, not deleted');
5015
+ t('children will be unlinked, not deleted', {count: impact.children});
5016
5016
  }
5017
5017
  if(impact.parents > 0) {
5018
5018
  question += '\n' + t('it will be detached from') + ' ' +
5019
- impact.parents + ' ' + t('parents');
5019
+ impact.parents + ' ' + t('parents', {count: impact.parents});
5020
5020
  }
5021
5021
 
5022
5022
  show_confirm_popover(gobj, priv._node_delete_el,
@@ -3040,6 +3040,11 @@ function build_delete_question(gobj, records)
3040
3040
  let desc = gobj_read_attr(gobj, "desc");
3041
3041
  let impact = delete_impact(desc, records);
3042
3042
 
3043
+ /* Every line is a flex row with a GAP, and the words carry no spaces of
3044
+ * their own: `createElement2` TRIMS text nodes, so a `["span", {}, " "]`
3045
+ * separator vanishes and the question reads "BorrarDeveloper". Spacing
3046
+ * is CSS here, as it has to be anywhere text is composed from keys. */
3047
+ const ROW = "display:flex; align-items:baseline; gap:.35rem; flex-wrap:wrap;";
3043
3048
  let lines = [];
3044
3049
 
3045
3050
  /* What is being deleted: one named record, or how many. */
@@ -3047,17 +3052,14 @@ function build_delete_question(gobj, records)
3047
3052
  let one = (impact.records === 1 && Array.isArray(records))? records[0] :
3048
3053
  (impact.records === 1? records : null);
3049
3054
  if(one && one[pkey] !== undefined && one[pkey] !== null) {
3050
- lines.push(["p", {class: "DELETE_ASK_WHAT"}, [
3055
+ lines.push(["p", {class: "DELETE_ASK_WHAT", style: ROW}, [
3051
3056
  ["span", {i18n: "delete"}, t("delete")],
3052
- ["span", {}, " "],
3053
3057
  ["strong", {}, String(one[pkey])]
3054
3058
  ]]);
3055
3059
  } else {
3056
- lines.push(["p", {class: "DELETE_ASK_WHAT"}, [
3060
+ lines.push(["p", {class: "DELETE_ASK_WHAT", style: ROW}, [
3057
3061
  ["span", {i18n: "delete"}, t("delete")],
3058
- ["span", {}, " "],
3059
3062
  ["strong", {}, String(impact.records)],
3060
- ["span", {}, " "],
3061
3063
  ["span", {i18n: "records"}, t("records")]
3062
3064
  ]]);
3063
3065
  }
@@ -3065,20 +3067,23 @@ function build_delete_question(gobj, records)
3065
3067
  /* What goes with it. Said only when there IS something: a loose
3066
3068
  * record must not be dressed up as a dangerous one. */
3067
3069
  if(impact.children > 0) {
3068
- lines.push(["p", {class: "DELETE_ASK_CHILDREN has-text-weight-semibold"}, [
3070
+ lines.push(["p", {class: "DELETE_ASK_CHILDREN has-text-weight-semibold",
3071
+ style: ROW}, [
3069
3072
  ["strong", {}, String(impact.children)],
3070
- ["span", {}, " "],
3073
+ /* `count` picks the singular: i18next looks for the `_one`
3074
+ * variant and falls back to the base key for the plural, so
3075
+ * the validator still sees a key it can find. Safe against a
3076
+ * language switch because this is a MODAL — a dialog with a
3077
+ * backdrop never sees one; the language button is behind it. */
3071
3078
  ["span", {i18n: "children will be unlinked, not deleted"},
3072
- t("children will be unlinked, not deleted")]
3079
+ t("children will be unlinked, not deleted", {count: impact.children})]
3073
3080
  ]]);
3074
3081
  }
3075
3082
  if(impact.parents > 0) {
3076
- lines.push(["p", {class: "DELETE_ASK_PARENTS"}, [
3083
+ lines.push(["p", {class: "DELETE_ASK_PARENTS", style: ROW}, [
3077
3084
  ["span", {i18n: "it will be detached from"}, t("it will be detached from")],
3078
- ["span", {}, " "],
3079
3085
  ["strong", {}, String(impact.parents)],
3080
- ["span", {}, " "],
3081
- ["span", {i18n: "parents"}, t("parents")]
3086
+ ["span", {i18n: "parents"}, t("parents", {count: impact.parents})]
3082
3087
  ]]);
3083
3088
  }
3084
3089