@everchron/ec-shards 19.11.4 → 19.11.6

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/ec-shards.js CHANGED
@@ -3381,6 +3381,10 @@ var Vr = /*#__PURE__*/ V(zr, [["render", Br], ["__scopeId", "data-v-2f0cb806"]])
3381
3381
  },
3382
3382
  icon: String,
3383
3383
  badgeIcon: String,
3384
+ badge: {
3385
+ type: [Boolean, Object],
3386
+ default: !1
3387
+ },
3384
3388
  active: Boolean,
3385
3389
  highlighted: Boolean,
3386
3390
  loading: Boolean,
@@ -3422,6 +3426,75 @@ var Vr = /*#__PURE__*/ V(zr, [["render", Br], ["__scopeId", "data-v-2f0cb806"]])
3422
3426
  },
3423
3427
  badgeIconSize() {
3424
3428
  return this.size == "xsml" ? "8" : this.size == "sml" ? "10" : this.size == "md" ? "12" : this.size == "lg" ? "14" : "12";
3429
+ },
3430
+ badgeSize() {
3431
+ return this.size == "xsml" ? 4 : this.size == "sml" || this.size == "md" ? 6 : this.size == "lg" ? 8 : 6;
3432
+ },
3433
+ badgePosition() {
3434
+ let e = this.size || "md";
3435
+ return !this.iconOnly && this.icon ? {
3436
+ xsml: {
3437
+ top: 2,
3438
+ left: 12
3439
+ },
3440
+ sml: {
3441
+ top: 4,
3442
+ left: 14
3443
+ },
3444
+ md: {
3445
+ top: 6,
3446
+ left: 18
3447
+ },
3448
+ lg: {
3449
+ top: 8,
3450
+ left: 26
3451
+ }
3452
+ }[e] : this.iconOnly ? {
3453
+ xsml: {
3454
+ top: 1,
3455
+ right: 1
3456
+ },
3457
+ sml: {
3458
+ top: 4,
3459
+ right: 4
3460
+ },
3461
+ md: {
3462
+ top: 6,
3463
+ right: 6
3464
+ },
3465
+ lg: {
3466
+ top: 8,
3467
+ right: 8
3468
+ }
3469
+ }[e] : {
3470
+ xsml: {
3471
+ top: 1,
3472
+ right: 1
3473
+ },
3474
+ sml: {
3475
+ top: 1,
3476
+ right: 1
3477
+ },
3478
+ md: {
3479
+ top: 1,
3480
+ right: 1
3481
+ },
3482
+ lg: {
3483
+ top: 4,
3484
+ right: 4
3485
+ }
3486
+ }[e];
3487
+ },
3488
+ badgeStyle() {
3489
+ let e = `${this.badgeSize}px`, t = {
3490
+ width: e,
3491
+ height: e
3492
+ }, { top: n, left: r, right: i } = this.badgePosition;
3493
+ if (t.top = `${n}px`, r != null && (t.left = `${r}px`), i != null && (t.right = `${i}px`), this.badge && typeof this.badge == "object") {
3494
+ let { positionTop: e, positionRight: n, positionLeft: r, color: i } = this.badge;
3495
+ e != null && (t.top = e), r != null && (t.left = r, t.right = "auto"), n != null && (t.right = n, t.left = "auto"), i != null && (t.background = i);
3496
+ }
3497
+ return t;
3425
3498
  }
3426
3499
  },
3427
3500
  mounted() {
@@ -3481,6 +3554,11 @@ function Xr(e, t, n, r, i, a) {
3481
3554
  }, null, 8, ["type", "size"])) : s("", !0),
3482
3555
  n.iconOnly ? s("", !0) : k(e.$slots, "default", { key: 2 }, void 0, !0),
3483
3556
  n.shortcut && !n.iconOnly ? (T(), c("span", Kr, N(n.shortcut), 1)) : s("", !0),
3557
+ n.badge ? (T(), c("div", {
3558
+ key: 4,
3559
+ class: "badge",
3560
+ style: S(a.badgeStyle)
3561
+ }, null, 4)) : s("", !0),
3484
3562
  f(d, {
3485
3563
  inset: n.focusInset,
3486
3564
  danger: n.type == "danger" || n.type == "danger-vibrant"
@@ -3543,13 +3621,18 @@ function Xr(e, t, n, r, i, a) {
3543
3621
  }, null, 8, ["type", "size"])) : s("", !0),
3544
3622
  n.iconOnly ? s("", !0) : k(e.$slots, "default", { key: 2 }, void 0, !0),
3545
3623
  n.shortcut && !n.iconOnly ? (T(), c("span", Jr, N(n.shortcut), 1)) : s("", !0),
3624
+ n.badge ? (T(), c("div", {
3625
+ key: 4,
3626
+ class: "badge",
3627
+ style: S(a.badgeStyle)
3628
+ }, null, 4)) : s("", !0),
3546
3629
  f(d, {
3547
3630
  inset: n.focusInset,
3548
3631
  danger: n.type == "danger" || n.type == "danger-vibrant"
3549
3632
  }, null, 8, ["inset", "danger"])
3550
3633
  ], 42, qr));
3551
3634
  }
3552
- var X = /*#__PURE__*/ V(Wr, [["render", Xr], ["__scopeId", "data-v-b7e356a6"]]), Zr = {
3635
+ var X = /*#__PURE__*/ V(Wr, [["render", Xr], ["__scopeId", "data-v-c54b96de"]]), Zr = {
3553
3636
  name: "ecs-popover-list-item",
3554
3637
  emits: [
3555
3638
  "click",
@@ -7582,6 +7665,10 @@ var Nc = /*#__PURE__*/ V(vc, [["render", Mc]]), Pc = {
7582
7665
  preventUnusableColors: {
7583
7666
  type: Boolean,
7584
7667
  default: !1
7668
+ },
7669
+ noBackground: {
7670
+ type: Boolean,
7671
+ default: !1
7585
7672
  }
7586
7673
  },
7587
7674
  computed: {
@@ -7618,13 +7705,13 @@ function Fc(e, t, n, r, i, a) {
7618
7705
  "preventUnusableColors"
7619
7706
  ])]),
7620
7707
  default: I(() => [l("button", {
7621
- class: b(["ecs-color-picker-input-button", a.sizeClass]),
7708
+ class: b(["ecs-color-picker-input-button", [a.sizeClass, { "ecs-color-picker-input-button-no-background": n.noBackground }]]),
7622
7709
  style: S(a.selectedColorStyle)
7623
7710
  }, [l("span", null, N(a.selectedColorName), 1)], 6)]),
7624
7711
  _: 1
7625
7712
  });
7626
7713
  }
7627
- var Ic = /*#__PURE__*/ V(Pc, [["render", Fc], ["__scopeId", "data-v-08aaa823"]]), Lc = {
7714
+ var Ic = /*#__PURE__*/ V(Pc, [["render", Fc], ["__scopeId", "data-v-1eb48d38"]]), Lc = {
7628
7715
  name: "ecs-data-card",
7629
7716
  components: {
7630
7717
  EcsIcon: H,
@@ -13277,7 +13364,7 @@ var $p = /*#__PURE__*/ V(Zp, [["render", Qp], ["__scopeId", "data-v-f66945cb"]])
13277
13364
  name: "ecs-inline-edit",
13278
13365
  emits: [
13279
13366
  "save",
13280
- "cancel",
13367
+ "undo",
13281
13368
  "edit",
13282
13369
  "update:editing"
13283
13370
  ],
@@ -13307,6 +13394,10 @@ var $p = /*#__PURE__*/ V(Zp, [["render", Qp], ["__scopeId", "data-v-f66945cb"]])
13307
13394
  type: Boolean,
13308
13395
  default: !1
13309
13396
  },
13397
+ modified: {
13398
+ type: Boolean,
13399
+ default: !1
13400
+ },
13310
13401
  triggerOnClick: {
13311
13402
  type: Boolean,
13312
13403
  default: !0
@@ -13315,15 +13406,6 @@ var $p = /*#__PURE__*/ V(Zp, [["render", Qp], ["__scopeId", "data-v-f66945cb"]])
13315
13406
  type: Boolean,
13316
13407
  default: !0
13317
13408
  },
13318
- clickOutside: {
13319
- type: String,
13320
- default: "cancel",
13321
- validator: (e) => [
13322
- "cancel",
13323
- "save",
13324
- "none"
13325
- ].includes(e)
13326
- },
13327
13409
  align: {
13328
13410
  type: String,
13329
13411
  default: "right",
@@ -13341,6 +13423,9 @@ var $p = /*#__PURE__*/ V(Zp, [["render", Qp], ["__scopeId", "data-v-f66945cb"]])
13341
13423
  actionsLabel() {
13342
13424
  return "Edit actions";
13343
13425
  },
13426
+ showActions() {
13427
+ return this.isEditing && this.modified;
13428
+ },
13344
13429
  popperPlacement() {
13345
13430
  return this.align === "left" ? "bottom-start" : "bottom-end";
13346
13431
  }
@@ -13349,7 +13434,7 @@ var $p = /*#__PURE__*/ V(Zp, [["render", Qp], ["__scopeId", "data-v-f66945cb"]])
13349
13434
  editing(e) {
13350
13435
  this.isEditing = e;
13351
13436
  },
13352
- isEditing(e) {
13437
+ showActions(e) {
13353
13438
  e ? this.$nextTick(() => this.createActionsPopper()) : this.destroyActionsPopper();
13354
13439
  },
13355
13440
  align() {
@@ -13358,7 +13443,7 @@ var $p = /*#__PURE__*/ V(Zp, [["render", Qp], ["__scopeId", "data-v-f66945cb"]])
13358
13443
  },
13359
13444
  mounted() {
13360
13445
  this.isEditing && this.$nextTick(() => {
13361
- this.createActionsPopper(), this.focusFirstEditable();
13446
+ this.showActions && this.createActionsPopper(), this.focusFirstEditable();
13362
13447
  });
13363
13448
  },
13364
13449
  beforeUnmount() {
@@ -13373,11 +13458,11 @@ var $p = /*#__PURE__*/ V(Zp, [["render", Qp], ["__scopeId", "data-v-f66945cb"]])
13373
13458
  this.setEditing(!1);
13374
13459
  }, this.saveDelay)));
13375
13460
  },
13376
- cancel() {
13377
- this.disabled || (this.clearCloseTimeout(), this.$emit("cancel"), this.setEditing(!1));
13461
+ undo() {
13462
+ this.disabled || this.$emit("undo");
13378
13463
  },
13379
13464
  onClickOutside(e) {
13380
- !this.isEditing || this.disabled || this.loading || this.$refs.actionsEl && this.$refs.actionsEl.contains(e?.target) || (this.clickOutside === "cancel" ? this.cancel() : this.clickOutside === "save" && this.confirm());
13465
+ !this.isEditing || this.disabled || this.loading || this.$refs.actionsEl && this.$refs.actionsEl.contains(e?.target) || this.confirm();
13381
13466
  },
13382
13467
  setEditing(e) {
13383
13468
  this.isEditing = e, this.$emit("update:editing", e);
@@ -13431,7 +13516,7 @@ function im(e, n, i, a, u, d) {
13431
13516
  default: I(() => [u.isEditing ? (T(), c("div", {
13432
13517
  key: "edit",
13433
13518
  class: "ecs-inline-edit-edit",
13434
- onKeydown: n[0] ||= L(R((...e) => d.cancel && d.cancel(...e), ["stop"]), ["esc"])
13519
+ onKeydown: n[0] ||= L(R((...e) => d.undo && d.undo(...e), ["stop"]), ["esc"])
13435
13520
  }, [l("div", nm, [k(e.$slots, "edit", {}, void 0, !0)], 512)], 32)) : (T(), o(p, {
13436
13521
  key: "view",
13437
13522
  class: "ecs-inline-edit-view",
@@ -13448,39 +13533,24 @@ function im(e, n, i, a, u, d) {
13448
13533
  "onKeydown"
13449
13534
  ]))]),
13450
13535
  _: 3
13451
- }, 8, ["onAfterEnter"]), (T(), o(t, { to: "body" }, [u.isEditing ? (T(), c("div", {
13536
+ }, 8, ["onAfterEnter"]), (T(), o(t, { to: "body" }, [d.showActions ? (T(), c("div", {
13452
13537
  key: 0,
13453
13538
  ref: "actionsEl",
13454
13539
  class: "ecs-inline-edit-actions",
13455
13540
  role: "group",
13456
- "aria-label": d.actionsLabel,
13457
- onKeydown: n[1] ||= L(R((...e) => d.cancel && d.cancel(...e), ["stop"]), ["esc"])
13541
+ "aria-label": d.actionsLabel
13458
13542
  }, [f(m, {
13459
- onClick: d.confirm,
13543
+ onClick: R(d.undo, ["stop"]),
13460
13544
  type: "secondary",
13461
13545
  size: "sml",
13462
- icon: "check",
13546
+ icon: "undo",
13463
13547
  "icon-only": "",
13464
- loading: i.loading,
13465
13548
  disabled: i.disabled,
13466
- title: "Save",
13467
- "aria-label": "Save changes"
13468
- }, null, 8, [
13469
- "onClick",
13470
- "loading",
13471
- "disabled"
13472
- ]), f(m, {
13473
- onClick: R(d.cancel, ["stop"]),
13474
- type: "secondary",
13475
- size: "sml",
13476
- icon: "close",
13477
- "icon-only": "",
13478
- disabled: i.loading || i.disabled,
13479
- title: "Cancel",
13480
- "aria-label": "Revert changes"
13481
- }, null, 8, ["onClick", "disabled"])], 40, rm)) : s("", !0)]))], 2)), [[h, d.onClickOutside]]);
13549
+ title: "Undo",
13550
+ "aria-label": "Undo changes"
13551
+ }, null, 8, ["onClick", "disabled"])], 8, rm)) : s("", !0)]))], 2)), [[h, d.onClickOutside]]);
13482
13552
  }
13483
- var am = /*#__PURE__*/ V(tm, [["render", im], ["__scopeId", "data-v-ecc56dd7"]]), om = {
13553
+ var am = /*#__PURE__*/ V(tm, [["render", im], ["__scopeId", "data-v-00fa7dec"]]), om = {
13484
13554
  name: "ecs-input-group-addon",
13485
13555
  components: { EcsIcon: H },
13486
13556
  props: {