coveragebook_components 0.7.4 → 0.7.5

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.
@@ -9370,15 +9370,15 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9370
9370
  };
9371
9371
  directive("ignore", handler);
9372
9372
  directive("effect", (el, { expression }, { effect: effect32 }) => effect32(evaluateLater(el, expression)));
9373
- function on(el, event2, modifiers, callback) {
9373
+ function on(el, event, modifiers, callback) {
9374
9374
  let listenerTarget = el;
9375
9375
  let handler3 = (e2) => callback(e2);
9376
9376
  let options = {};
9377
9377
  let wrapHandler = (callback2, wrapper) => (e2) => wrapper(callback2, e2);
9378
9378
  if (modifiers.includes("dot"))
9379
- event2 = dotSyntax(event2);
9379
+ event = dotSyntax(event);
9380
9380
  if (modifiers.includes("camel"))
9381
- event2 = camelCase2(event2);
9381
+ event = camelCase2(event);
9382
9382
  if (modifiers.includes("passive"))
9383
9383
  options.passive = true;
9384
9384
  if (modifiers.includes("capture"))
@@ -9428,20 +9428,20 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9428
9428
  if (modifiers.includes("once")) {
9429
9429
  handler3 = wrapHandler(handler3, (next, e2) => {
9430
9430
  next(e2);
9431
- listenerTarget.removeEventListener(event2, handler3, options);
9431
+ listenerTarget.removeEventListener(event, handler3, options);
9432
9432
  });
9433
9433
  }
9434
9434
  handler3 = wrapHandler(handler3, (next, e2) => {
9435
- if (isKeyEvent(event2)) {
9435
+ if (isKeyEvent(event)) {
9436
9436
  if (isListeningForASpecificKeyThatHasntBeenPressed(e2, modifiers)) {
9437
9437
  return;
9438
9438
  }
9439
9439
  }
9440
9440
  next(e2);
9441
9441
  });
9442
- listenerTarget.addEventListener(event2, handler3, options);
9442
+ listenerTarget.addEventListener(event, handler3, options);
9443
9443
  return () => {
9444
- listenerTarget.removeEventListener(event2, handler3, options);
9444
+ listenerTarget.removeEventListener(event, handler3, options);
9445
9445
  };
9446
9446
  }
9447
9447
  function dotSyntax(subject) {
@@ -9458,8 +9458,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9458
9458
  return subject;
9459
9459
  return subject.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[_\s]/, "-").toLowerCase();
9460
9460
  }
9461
- function isKeyEvent(event2) {
9462
- return ["keydown", "keyup"].includes(event2);
9461
+ function isKeyEvent(event) {
9462
+ return ["keydown", "keyup"].includes(event);
9463
9463
  }
9464
9464
  function isListeningForASpecificKeyThatHasntBeenPressed(e2, modifiers) {
9465
9465
  let keyModifiers = modifiers.filter((i2) => {
@@ -9557,13 +9557,13 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9557
9557
  el.setAttribute("name", expression);
9558
9558
  });
9559
9559
  }
9560
- var event2 = el.tagName.toLowerCase() === "select" || ["checkbox", "radio"].includes(el.type) || modifiers.includes("lazy") ? "change" : "input";
9560
+ var event = el.tagName.toLowerCase() === "select" || ["checkbox", "radio"].includes(el.type) || modifiers.includes("lazy") ? "change" : "input";
9561
9561
  let removeListener = isCloning ? () => {
9562
- } : on(el, event2, modifiers, (e2) => {
9562
+ } : on(el, event, modifiers, (e2) => {
9563
9563
  setValue(getInputValue(el, modifiers, e2, getValue()));
9564
9564
  });
9565
9565
  if (modifiers.includes("fill") && [null, ""].includes(getValue())) {
9566
- el.dispatchEvent(new Event(event2, {}));
9566
+ el.dispatchEvent(new Event(event, {}));
9567
9567
  }
9568
9568
  if (!el._x_removeModelListeners)
9569
9569
  el._x_removeModelListeners = {};
@@ -9598,27 +9598,27 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
9598
9598
  el._x_forceModelUpdate(value);
9599
9599
  });
9600
9600
  });
9601
- function getInputValue(el, modifiers, event2, currentValue) {
9601
+ function getInputValue(el, modifiers, event, currentValue) {
9602
9602
  return mutateDom(() => {
9603
9603
  var _a;
9604
- if (event2 instanceof CustomEvent && event2.detail !== void 0)
9605
- return (_a = event2.detail) != null ? _a : event2.target.value;
9604
+ if (event instanceof CustomEvent && event.detail !== void 0)
9605
+ return (_a = event.detail) != null ? _a : event.target.value;
9606
9606
  else if (el.type === "checkbox") {
9607
9607
  if (Array.isArray(currentValue)) {
9608
- let newValue = modifiers.includes("number") ? safeParseNumber(event2.target.value) : event2.target.value;
9609
- return event2.target.checked ? currentValue.concat([newValue]) : currentValue.filter((el2) => !checkedAttrLooseCompare2(el2, newValue));
9608
+ let newValue = modifiers.includes("number") ? safeParseNumber(event.target.value) : event.target.value;
9609
+ return event.target.checked ? currentValue.concat([newValue]) : currentValue.filter((el2) => !checkedAttrLooseCompare2(el2, newValue));
9610
9610
  } else {
9611
- return event2.target.checked;
9611
+ return event.target.checked;
9612
9612
  }
9613
9613
  } else if (el.tagName.toLowerCase() === "select" && el.multiple) {
9614
- return modifiers.includes("number") ? Array.from(event2.target.selectedOptions).map((option) => {
9614
+ return modifiers.includes("number") ? Array.from(event.target.selectedOptions).map((option) => {
9615
9615
  let rawValue = option.value || option.text;
9616
9616
  return safeParseNumber(rawValue);
9617
- }) : Array.from(event2.target.selectedOptions).map((option) => {
9617
+ }) : Array.from(event.target.selectedOptions).map((option) => {
9618
9618
  return option.value || option.text;
9619
9619
  });
9620
9620
  } else {
9621
- let rawValue = event2.target.value;
9621
+ let rawValue = event.target.value;
9622
9622
  return modifiers.includes("number") ? safeParseNumber(rawValue) : modifiers.includes("trim") ? rawValue.trim() : rawValue;
9623
9623
  }
9624
9624
  });
@@ -13268,8 +13268,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
13268
13268
  var _normalizeToArray = normalizeToArray(elementOrElements), element = _normalizeToArray[0];
13269
13269
  return element != null && (_element$ownerDocumen = element.ownerDocument) != null && _element$ownerDocumen.body ? element.ownerDocument : document;
13270
13270
  }
13271
- function isCursorOutsideInteractiveBorder(popperTreeData, event2) {
13272
- var clientX = event2.clientX, clientY = event2.clientY;
13271
+ function isCursorOutsideInteractiveBorder(popperTreeData, event) {
13272
+ var clientX = event.clientX, clientY = event.clientY;
13273
13273
  return popperTreeData.every(function(_ref) {
13274
13274
  var popperRect = _ref.popperRect, popperState = _ref.popperState, props = _ref.props;
13275
13275
  var interactiveBorder = props.interactiveBorder;
@@ -13291,8 +13291,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
13291
13291
  }
13292
13292
  function updateTransitionEndListener(box, action, listener) {
13293
13293
  var method = action + "EventListener";
13294
- ["transitionend", "webkitTransitionEnd"].forEach(function(event2) {
13295
- box[method](event2, listener);
13294
+ ["transitionend", "webkitTransitionEnd"].forEach(function(event) {
13295
+ box[method](event, listener);
13296
13296
  });
13297
13297
  }
13298
13298
  function actualContains(parent, child) {
@@ -13816,13 +13816,13 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
13816
13816
  return listener !== debouncedOnMouseMove;
13817
13817
  });
13818
13818
  }
13819
- function onDocumentPress(event2) {
13819
+ function onDocumentPress(event) {
13820
13820
  if (currentInput.isTouch) {
13821
- if (didTouchMove || event2.type === "mousedown") {
13821
+ if (didTouchMove || event.type === "mousedown") {
13822
13822
  return;
13823
13823
  }
13824
13824
  }
13825
- var actualTarget = event2.composedPath && event2.composedPath()[0] || event2.target;
13825
+ var actualTarget = event.composedPath && event.composedPath()[0] || event.target;
13826
13826
  if (instance.props.interactive && actualContains(popper2, actualTarget)) {
13827
13827
  return;
13828
13828
  }
@@ -13836,7 +13836,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
13836
13836
  return;
13837
13837
  }
13838
13838
  } else {
13839
- invokeHook("onClickOutside", [instance, event2]);
13839
+ invokeHook("onClickOutside", [instance, event]);
13840
13840
  }
13841
13841
  if (instance.props.hideOnClick === true) {
13842
13842
  instance.clearDelayTimeouts();
@@ -13882,8 +13882,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
13882
13882
  }
13883
13883
  function onTransitionEnd(duration, callback) {
13884
13884
  var box = getDefaultTemplateChildren().box;
13885
- function listener(event2) {
13886
- if (event2.target === box) {
13885
+ function listener(event) {
13886
+ if (event.target === box) {
13887
13887
  updateTransitionEndListener(box, "remove", listener);
13888
13888
  callback();
13889
13889
  }
@@ -13944,37 +13944,37 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
13944
13944
  });
13945
13945
  listeners = [];
13946
13946
  }
13947
- function onTrigger2(event2) {
13947
+ function onTrigger2(event) {
13948
13948
  var _lastTriggerEvent;
13949
13949
  var shouldScheduleClickHide = false;
13950
- if (!instance.state.isEnabled || isEventListenerStopped(event2) || didHideDueToDocumentMouseDown) {
13950
+ if (!instance.state.isEnabled || isEventListenerStopped(event) || didHideDueToDocumentMouseDown) {
13951
13951
  return;
13952
13952
  }
13953
13953
  var wasFocused = ((_lastTriggerEvent = lastTriggerEvent) == null ? void 0 : _lastTriggerEvent.type) === "focus";
13954
- lastTriggerEvent = event2;
13955
- currentTarget = event2.currentTarget;
13954
+ lastTriggerEvent = event;
13955
+ currentTarget = event.currentTarget;
13956
13956
  handleAriaExpandedAttribute();
13957
- if (!instance.state.isVisible && isMouseEvent(event2)) {
13957
+ if (!instance.state.isVisible && isMouseEvent(event)) {
13958
13958
  mouseMoveListeners.forEach(function(listener) {
13959
- return listener(event2);
13959
+ return listener(event);
13960
13960
  });
13961
13961
  }
13962
- if (event2.type === "click" && (instance.props.trigger.indexOf("mouseenter") < 0 || isVisibleFromClick) && instance.props.hideOnClick !== false && instance.state.isVisible) {
13962
+ if (event.type === "click" && (instance.props.trigger.indexOf("mouseenter") < 0 || isVisibleFromClick) && instance.props.hideOnClick !== false && instance.state.isVisible) {
13963
13963
  shouldScheduleClickHide = true;
13964
13964
  } else {
13965
- scheduleShow(event2);
13965
+ scheduleShow(event);
13966
13966
  }
13967
- if (event2.type === "click") {
13967
+ if (event.type === "click") {
13968
13968
  isVisibleFromClick = !shouldScheduleClickHide;
13969
13969
  }
13970
13970
  if (shouldScheduleClickHide && !wasFocused) {
13971
- scheduleHide(event2);
13971
+ scheduleHide(event);
13972
13972
  }
13973
13973
  }
13974
- function onMouseMove(event2) {
13975
- var target = event2.target;
13974
+ function onMouseMove(event) {
13975
+ var target = event.target;
13976
13976
  var isCursorOverReferenceOrPopper = getCurrentTarget().contains(target) || popper2.contains(target);
13977
- if (event2.type === "mousemove" && isCursorOverReferenceOrPopper) {
13977
+ if (event.type === "mousemove" && isCursorOverReferenceOrPopper) {
13978
13978
  return;
13979
13979
  }
13980
13980
  var popperTreeData = getNestedPopperTree().concat(popper2).map(function(popper3) {
@@ -13990,33 +13990,33 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
13990
13990
  }
13991
13991
  return null;
13992
13992
  }).filter(Boolean);
13993
- if (isCursorOutsideInteractiveBorder(popperTreeData, event2)) {
13993
+ if (isCursorOutsideInteractiveBorder(popperTreeData, event)) {
13994
13994
  cleanupInteractiveMouseListeners();
13995
- scheduleHide(event2);
13995
+ scheduleHide(event);
13996
13996
  }
13997
13997
  }
13998
- function onMouseLeave(event2) {
13999
- var shouldBail = isEventListenerStopped(event2) || instance.props.trigger.indexOf("click") >= 0 && isVisibleFromClick;
13998
+ function onMouseLeave(event) {
13999
+ var shouldBail = isEventListenerStopped(event) || instance.props.trigger.indexOf("click") >= 0 && isVisibleFromClick;
14000
14000
  if (shouldBail) {
14001
14001
  return;
14002
14002
  }
14003
14003
  if (instance.props.interactive) {
14004
- instance.hideWithInteractivity(event2);
14004
+ instance.hideWithInteractivity(event);
14005
14005
  return;
14006
14006
  }
14007
- scheduleHide(event2);
14007
+ scheduleHide(event);
14008
14008
  }
14009
- function onBlurOrFocusOut(event2) {
14010
- if (instance.props.trigger.indexOf("focusin") < 0 && event2.target !== getCurrentTarget()) {
14009
+ function onBlurOrFocusOut(event) {
14010
+ if (instance.props.trigger.indexOf("focusin") < 0 && event.target !== getCurrentTarget()) {
14011
14011
  return;
14012
14012
  }
14013
- if (instance.props.interactive && event2.relatedTarget && popper2.contains(event2.relatedTarget)) {
14013
+ if (instance.props.interactive && event.relatedTarget && popper2.contains(event.relatedTarget)) {
14014
14014
  return;
14015
14015
  }
14016
- scheduleHide(event2);
14016
+ scheduleHide(event);
14017
14017
  }
14018
- function isEventListenerStopped(event2) {
14019
- return currentInput.isTouch ? getIsCustomTouchBehavior() !== event2.type.indexOf("touch") >= 0 : false;
14018
+ function isEventListenerStopped(event) {
14019
+ return currentInput.isTouch ? getIsCustomTouchBehavior() !== event.type.indexOf("touch") >= 0 : false;
14020
14020
  }
14021
14021
  function createPopperInstance() {
14022
14022
  destroyPopperInstance();
@@ -14119,10 +14119,10 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
14119
14119
  function getNestedPopperTree() {
14120
14120
  return arrayFrom(popper2.querySelectorAll("[data-tippy-root]"));
14121
14121
  }
14122
- function scheduleShow(event2) {
14122
+ function scheduleShow(event) {
14123
14123
  instance.clearDelayTimeouts();
14124
- if (event2) {
14125
- invokeHook("onTrigger", [instance, event2]);
14124
+ if (event) {
14125
+ invokeHook("onTrigger", [instance, event]);
14126
14126
  }
14127
14127
  addDocumentPress();
14128
14128
  var delay3 = getDelay(true);
@@ -14138,14 +14138,14 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
14138
14138
  instance.show();
14139
14139
  }
14140
14140
  }
14141
- function scheduleHide(event2) {
14141
+ function scheduleHide(event) {
14142
14142
  instance.clearDelayTimeouts();
14143
- invokeHook("onUntrigger", [instance, event2]);
14143
+ invokeHook("onUntrigger", [instance, event]);
14144
14144
  if (!instance.state.isVisible) {
14145
14145
  removeDocumentPress();
14146
14146
  return;
14147
14147
  }
14148
- if (instance.props.trigger.indexOf("mouseenter") >= 0 && instance.props.trigger.indexOf("click") >= 0 && ["mouseleave", "mousemove"].indexOf(event2.type) >= 0 && isVisibleFromClick) {
14148
+ if (instance.props.trigger.indexOf("mouseenter") >= 0 && instance.props.trigger.indexOf("click") >= 0 && ["mouseleave", "mousemove"].indexOf(event.type) >= 0 && isVisibleFromClick) {
14149
14149
  return;
14150
14150
  }
14151
14151
  var delay3 = getDelay(false);
@@ -14318,13 +14318,13 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
14318
14318
  instance.unmount();
14319
14319
  }
14320
14320
  }
14321
- function hideWithInteractivity(event2) {
14321
+ function hideWithInteractivity(event) {
14322
14322
  if (true) {
14323
14323
  warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("hideWithInteractivity"));
14324
14324
  }
14325
14325
  getDocument().addEventListener("mousemove", debouncedOnMouseMove);
14326
14326
  pushIfUnique(mouseMoveListeners, debouncedOnMouseMove);
14327
- debouncedOnMouseMove(event2);
14327
+ debouncedOnMouseMove(event);
14328
14328
  }
14329
14329
  function unmount() {
14330
14330
  if (true) {
@@ -14461,10 +14461,10 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
14461
14461
  });
14462
14462
  isInternalUpdate = false;
14463
14463
  }
14464
- function onMouseMove(event2) {
14465
- var isCursorOverReference = event2.target ? reference2.contains(event2.target) : true;
14464
+ function onMouseMove(event) {
14465
+ var isCursorOverReference = event.target ? reference2.contains(event.target) : true;
14466
14466
  var followCursor2 = instance.props.followCursor;
14467
- var clientX = event2.clientX, clientY = event2.clientY;
14467
+ var clientX = event.clientX, clientY = event.clientY;
14468
14468
  var rect = reference2.getBoundingClientRect();
14469
14469
  var relativeX = clientX - rect.left;
14470
14470
  var relativeY = clientY - rect.top;
@@ -14549,14 +14549,14 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
14549
14549
  }
14550
14550
  }
14551
14551
  },
14552
- onTrigger: function onTrigger2(_2, event2) {
14553
- if (isMouseEvent(event2)) {
14552
+ onTrigger: function onTrigger2(_2, event) {
14553
+ if (isMouseEvent(event)) {
14554
14554
  mouseCoords = {
14555
- clientX: event2.clientX,
14556
- clientY: event2.clientY
14555
+ clientX: event.clientX,
14556
+ clientY: event.clientY
14557
14557
  };
14558
14558
  }
14559
- wasFocusEvent = event2.type === "focus";
14559
+ wasFocusEvent = event.type === "focus";
14560
14560
  },
14561
14561
  onHidden: function onHidden2() {
14562
14562
  if (instance.props.followCursor) {
@@ -14578,8 +14578,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
14578
14578
  name: "hideOnEsc",
14579
14579
  defaultValue: true,
14580
14580
  fn({ hide: hide2 }) {
14581
- function onKeyDown(event2) {
14582
- if (event2.keyCode === 27) {
14581
+ function onKeyDown(event) {
14582
+ if (event.keyCode === 27) {
14583
14583
  hide2();
14584
14584
  }
14585
14585
  }
@@ -14860,8 +14860,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
14860
14860
  clearAutoDismiss() {
14861
14861
  clearTimeout(notification.dismissTimer);
14862
14862
  },
14863
- clearFromQueue(event2) {
14864
- if (notification.type === event2.detail.type && notification.position === "fixed" && notification.id !== event2.detail.id && notification.queuePosition < event2.detail.queuePosition) {
14863
+ clearFromQueue(event) {
14864
+ if (notification.type === event.detail.type && notification.position === "fixed" && notification.id !== event.detail.id && notification.queuePosition < event.detail.queuePosition) {
14865
14865
  notification.dismiss();
14866
14866
  }
14867
14867
  }
@@ -14975,15 +14975,15 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
14975
14975
  }
14976
14976
  },
14977
14977
  /* confirmation */
14978
- checkConfirmation(event2) {
14978
+ checkConfirmation(event) {
14979
14979
  if (!this.confirmed) {
14980
14980
  this.approving = true;
14981
- event2.preventDefault();
14981
+ event.preventDefault();
14982
14982
  }
14983
14983
  },
14984
- approveAndRun(event2) {
14984
+ approveAndRun(event) {
14985
14985
  if (this.approving) {
14986
- event2.stopPropagation();
14986
+ event.stopPropagation();
14987
14987
  this.confirmed = true;
14988
14988
  this.dropdown.trigger.click();
14989
14989
  this.dropdown.hide();
@@ -14991,9 +14991,9 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
14991
14991
  this.approving = false;
14992
14992
  }
14993
14993
  },
14994
- cancelConfirmation(event2) {
14994
+ cancelConfirmation(event) {
14995
14995
  if (this.approving) {
14996
- event2.stopPropagation();
14996
+ event.stopPropagation();
14997
14997
  this.approving = false;
14998
14998
  this.dropdown.hide();
14999
14999
  }
@@ -15141,8 +15141,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
15141
15141
  this.file = null;
15142
15142
  this.$dispatch("image-uploader:clear");
15143
15143
  },
15144
- handleDrop(event2) {
15145
- const files = event2.detail.files || event2.dataTransfer.files;
15144
+ handleDrop(event) {
15145
+ const files = event.detail.files || event.dataTransfer.files;
15146
15146
  this.handleFiles(files);
15147
15147
  },
15148
15148
  handleFiles(files) {
@@ -15177,8 +15177,10 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
15177
15177
  return {
15178
15178
  open: false,
15179
15179
  frame: null,
15180
+ modal: null,
15180
15181
  options: ["dismissable", "closeOnSubmit"],
15181
15182
  init() {
15183
+ this.modal = this;
15182
15184
  this.onFrameSubmitEnd = this.onFrameSubmitEnd.bind(this);
15183
15185
  this.frame = this.$el.closest("turbo-frame");
15184
15186
  this.frame.addEventListener("turbo:submit-end", this.onFrameSubmitEnd);
@@ -15186,21 +15188,30 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
15186
15188
  },
15187
15189
  show() {
15188
15190
  this.open = true;
15191
+ setTimeout(() => {
15192
+ this.$dispatch("modal:shown");
15193
+ }, 400);
15189
15194
  },
15190
15195
  hide() {
15191
15196
  this.open = false;
15192
- setTimeout(() => this.clearFrame(), 100);
15197
+ setTimeout(() => {
15198
+ this.clearFrame();
15199
+ this.$dispatch("modal:hidden");
15200
+ }, 200);
15193
15201
  },
15194
- dismiss(event2) {
15202
+ dismiss(event) {
15195
15203
  if (this.$options.dismissable)
15196
15204
  this.hide();
15197
15205
  },
15206
+ scrollTo(pos) {
15207
+ this.$root.scrollTop = pos + this.contentOffsetTop;
15208
+ },
15198
15209
  clearFrame() {
15199
15210
  this.frame.removeAttribute("src");
15200
15211
  this.frame.removeAttribute("complete");
15201
15212
  this.frame.innerHTML = "";
15202
15213
  },
15203
- onFrameSubmitEnd() {
15214
+ onFrameSubmitEnd(event) {
15204
15215
  if (this.$options.closeOnSubmit && event.detail.success) {
15205
15216
  this.hide();
15206
15217
  }
@@ -15208,11 +15219,35 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
15208
15219
  destroy() {
15209
15220
  this.frame.removeEventListener("turbo:submit-end", this.onFrameSubmitEnd);
15210
15221
  },
15222
+ get contentOffsetTop() {
15223
+ return parseInt(
15224
+ window.getComputedStyle(this.$refs.container).paddingTop,
15225
+ 10
15226
+ );
15227
+ },
15211
15228
  root: {
15212
15229
  "x-options": "options",
15213
15230
  "x-show": "open",
15214
15231
  "@keydown.escape.document": "dismiss",
15215
15232
  "@modal:hide.document": "hide"
15233
+ },
15234
+ overlay: {
15235
+ "x-show": "open",
15236
+ "x-transition:enter": "overlay-enter",
15237
+ "x-transition:enter-start": "overlay-enter-start",
15238
+ "x-transition:enter-end": "overlay-enter-end",
15239
+ "x-transition:leave": "overlay-leave",
15240
+ "x-transition:leave-start": "overlay-leave-start",
15241
+ "x-transition:leave-end": "overlay-leave-end"
15242
+ },
15243
+ container: {
15244
+ "x-show": "open",
15245
+ "x-transition:enter": "container-enter",
15246
+ "x-transition:enter-start": "container-enter-start",
15247
+ "x-transition:enter-end": "container-enter-end",
15248
+ "x-transition:leave": "container-leave",
15249
+ "x-transition:leave-start": "container-leave-start",
15250
+ "x-transition:leave-end": "container-leave-end"
15216
15251
  }
15217
15252
  };
15218
15253
  });
@@ -15233,7 +15268,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
15233
15268
  }
15234
15269
  },
15235
15270
  close() {
15236
- this.$dispatch("modal:hide");
15271
+ this.modal.hide();
15237
15272
  },
15238
15273
  onFrameLoad() {
15239
15274
  this.$focus.focus(this.firstInput);
@@ -15251,8 +15286,42 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
15251
15286
  };
15252
15287
  });
15253
15288
 
15289
+ // ../../components/coco/base/modal_lightbox/modal_lightbox.js
15290
+ var modal_lightbox_exports = {};
15291
+ __export(modal_lightbox_exports, {
15292
+ default: () => modal_lightbox_default
15293
+ });
15294
+ var modal_lightbox_default = CocoComponent("modalLightbox", () => {
15295
+ return {
15296
+ loaded: false,
15297
+ init() {
15298
+ if (this.img.complete && this.img.naturalHeight !== 0) {
15299
+ this.imageLoaded();
15300
+ }
15301
+ },
15302
+ close() {
15303
+ this.modal.hide();
15304
+ },
15305
+ imageLoaded() {
15306
+ this.loaded = true;
15307
+ this.$nextTick(() => {
15308
+ const scrollTop = parseInt(this.img.dataset.scrollTop, 10);
15309
+ if (!isNaN(scrollTop) && scrollTop !== 0) {
15310
+ this.modal.scrollTo(scrollTop);
15311
+ }
15312
+ });
15313
+ },
15314
+ get img() {
15315
+ return this.$refs.media.querySelector("img");
15316
+ },
15317
+ root: {
15318
+ ":class": "{loaded}"
15319
+ }
15320
+ };
15321
+ });
15322
+
15254
15323
  // import-glob:/Users/mark/Code/coveragebook/coco/app/assets/js/base|@baseComponents/**/*.js
15255
- var modules = [button_exports, dropdown_exports, icon_exports, image_uploader_exports, modal_exports, modal_dialog_exports];
15324
+ var modules = [button_exports, dropdown_exports, icon_exports, image_uploader_exports, modal_exports, modal_dialog_exports, modal_lightbox_exports];
15256
15325
  var __default = modules;
15257
15326
 
15258
15327
  // base/components.js
@@ -3,6 +3,10 @@
3
3
  @import "tippy.js/dist/border.css";
4
4
 
5
5
  @layer components {
6
+ [data-tippy-root] {
7
+ @apply !z-[10010];
8
+ }
9
+
6
10
  [data-coco] .tippy-box {
7
11
  @apply bg-transparent text-gray-900 text-label-md whitespace-normal;
8
12
  }
@@ -1,6 +1,6 @@
1
1
  @layer components {
2
2
  [data-coco][data-component="modal"] {
3
- @apply fixed inset-0 z-[10000] overflow-y-auto;
3
+ @apply fixed inset-0 z-[10000] overflow-y-auto scroll-smooth;
4
4
 
5
5
  .modal-overlay {
6
6
  @apply fixed inset-0 bg-black bg-opacity-60;
@@ -13,6 +13,60 @@
13
13
  .modal-content {
14
14
  @apply contents;
15
15
  }
16
+
17
+ /* transitions */
18
+
19
+ .modal-overlay {
20
+ &.overlay-enter {
21
+ @apply ease-out duration-200;
22
+ }
23
+
24
+ &.overlay-enter-start {
25
+ @apply opacity-0;
26
+ }
27
+
28
+ &.overlay-enter-end {
29
+ @apply opacity-100;
30
+ }
31
+
32
+ &.overlay-leave {
33
+ @apply ease-in duration-150;
34
+ }
35
+
36
+ &.overlay-leave-start {
37
+ @apply opacity-100;
38
+ }
39
+
40
+ &.overlay-leave-end {
41
+ @apply opacity-0;
42
+ }
43
+ }
44
+
45
+ .modal-container {
46
+ &.container-enter {
47
+ @apply ease-out duration-[400ms];
48
+ }
49
+
50
+ &.container-enter-start {
51
+ @apply opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95;
52
+ }
53
+
54
+ &.container-enter-end {
55
+ @apply opacity-100 translate-y-0 sm:scale-100;
56
+ }
57
+
58
+ &.container-leave {
59
+ @apply ease-in duration-150;
60
+ }
61
+
62
+ &.container-leave-start {
63
+ @apply opacity-100 translate-y-0 sm:scale-100;
64
+ }
65
+
66
+ &.container-leave-end {
67
+ @apply opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95;
68
+ }
69
+ }
16
70
  }
17
71
 
18
72
  .modal-frame {
@@ -11,8 +11,8 @@
11
11
  cloak: true,
12
12
  },
13
13
  ) do %>
14
- <div class="modal-overlay" x-show="open" x-transition.opacity></div>
15
- <div class="modal-container" x-show="open" x-transition>
14
+ <div class="modal-overlay" x-bind="overlay"></div>
15
+ <div class="modal-container" x-bind="container" x-ref="container">
16
16
  <div class="modal-content" x-trap.noscroll.inert.noreturn="open">
17
17
  <%= modal_content %>
18
18
  </div>