coveragebook_components 0.7.4 → 0.7.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/build/coco/app.css +133 -2
- data/app/assets/build/coco/app.js +179 -109
- data/app/assets/build/coco/book.css +164 -1
- data/app/assets/build/coco/book.js +160 -89
- data/app/assets/css/libs/tippy.css +4 -0
- data/app/components/coco/base/modal/modal.css +55 -1
- data/app/components/coco/base/modal/modal.html.erb +2 -2
- data/app/components/coco/base/modal/modal.js +43 -2
- data/app/components/coco/base/modal/modal.rb +14 -8
- data/app/components/coco/base/modal_dialog/modal_dialog.css +1 -1
- data/app/components/coco/base/modal_dialog/modal_dialog.js +1 -1
- data/app/components/coco/base/modal_lightbox/modal_lightbox.css +35 -0
- data/app/components/coco/base/modal_lightbox/modal_lightbox.html.erb +13 -0
- data/app/components/coco/base/modal_lightbox/modal_lightbox.js +35 -0
- data/app/components/coco/base/modal_lightbox/modal_lightbox.rb +19 -0
- data/app/helpers/coco/base_helper.rb +7 -1
- data/lib/coco.rb +1 -1
- metadata +6 -2
@@ -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,
|
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
|
-
|
9379
|
+
event = dotSyntax(event);
|
9380
9380
|
if (modifiers.includes("camel"))
|
9381
|
-
|
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(
|
9431
|
+
listenerTarget.removeEventListener(event, handler3, options);
|
9432
9432
|
});
|
9433
9433
|
}
|
9434
9434
|
handler3 = wrapHandler(handler3, (next, e2) => {
|
9435
|
-
if (isKeyEvent(
|
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(
|
9442
|
+
listenerTarget.addEventListener(event, handler3, options);
|
9443
9443
|
return () => {
|
9444
|
-
listenerTarget.removeEventListener(
|
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(
|
9462
|
-
return ["keydown", "keyup"].includes(
|
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
|
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,
|
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(
|
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,
|
9601
|
+
function getInputValue(el, modifiers, event, currentValue) {
|
9602
9602
|
return mutateDom(() => {
|
9603
9603
|
var _a;
|
9604
|
-
if (
|
9605
|
-
return (_a =
|
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(
|
9609
|
-
return
|
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
|
9611
|
+
return event.target.checked;
|
9612
9612
|
}
|
9613
9613
|
} else if (el.tagName.toLowerCase() === "select" && el.multiple) {
|
9614
|
-
return modifiers.includes("number") ? Array.from(
|
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(
|
9617
|
+
}) : Array.from(event.target.selectedOptions).map((option) => {
|
9618
9618
|
return option.value || option.text;
|
9619
9619
|
});
|
9620
9620
|
} else {
|
9621
|
-
let rawValue =
|
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,
|
13272
|
-
var clientX =
|
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(
|
13295
|
-
box[method](
|
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(
|
13819
|
+
function onDocumentPress(event) {
|
13820
13820
|
if (currentInput.isTouch) {
|
13821
|
-
if (didTouchMove ||
|
13821
|
+
if (didTouchMove || event.type === "mousedown") {
|
13822
13822
|
return;
|
13823
13823
|
}
|
13824
13824
|
}
|
13825
|
-
var actualTarget =
|
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,
|
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(
|
13886
|
-
if (
|
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(
|
13947
|
+
function onTrigger2(event) {
|
13948
13948
|
var _lastTriggerEvent;
|
13949
13949
|
var shouldScheduleClickHide = false;
|
13950
|
-
if (!instance.state.isEnabled || isEventListenerStopped(
|
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 =
|
13955
|
-
currentTarget =
|
13954
|
+
lastTriggerEvent = event;
|
13955
|
+
currentTarget = event.currentTarget;
|
13956
13956
|
handleAriaExpandedAttribute();
|
13957
|
-
if (!instance.state.isVisible && isMouseEvent(
|
13957
|
+
if (!instance.state.isVisible && isMouseEvent(event)) {
|
13958
13958
|
mouseMoveListeners.forEach(function(listener) {
|
13959
|
-
return listener(
|
13959
|
+
return listener(event);
|
13960
13960
|
});
|
13961
13961
|
}
|
13962
|
-
if (
|
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(
|
13965
|
+
scheduleShow(event);
|
13966
13966
|
}
|
13967
|
-
if (
|
13967
|
+
if (event.type === "click") {
|
13968
13968
|
isVisibleFromClick = !shouldScheduleClickHide;
|
13969
13969
|
}
|
13970
13970
|
if (shouldScheduleClickHide && !wasFocused) {
|
13971
|
-
scheduleHide(
|
13971
|
+
scheduleHide(event);
|
13972
13972
|
}
|
13973
13973
|
}
|
13974
|
-
function onMouseMove(
|
13975
|
-
var target =
|
13974
|
+
function onMouseMove(event) {
|
13975
|
+
var target = event.target;
|
13976
13976
|
var isCursorOverReferenceOrPopper = getCurrentTarget().contains(target) || popper2.contains(target);
|
13977
|
-
if (
|
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,
|
13993
|
+
if (isCursorOutsideInteractiveBorder(popperTreeData, event)) {
|
13994
13994
|
cleanupInteractiveMouseListeners();
|
13995
|
-
scheduleHide(
|
13995
|
+
scheduleHide(event);
|
13996
13996
|
}
|
13997
13997
|
}
|
13998
|
-
function onMouseLeave(
|
13999
|
-
var shouldBail = isEventListenerStopped(
|
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(
|
14004
|
+
instance.hideWithInteractivity(event);
|
14005
14005
|
return;
|
14006
14006
|
}
|
14007
|
-
scheduleHide(
|
14007
|
+
scheduleHide(event);
|
14008
14008
|
}
|
14009
|
-
function onBlurOrFocusOut(
|
14010
|
-
if (instance.props.trigger.indexOf("focusin") < 0 &&
|
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 &&
|
14013
|
+
if (instance.props.interactive && event.relatedTarget && popper2.contains(event.relatedTarget)) {
|
14014
14014
|
return;
|
14015
14015
|
}
|
14016
|
-
scheduleHide(
|
14016
|
+
scheduleHide(event);
|
14017
14017
|
}
|
14018
|
-
function isEventListenerStopped(
|
14019
|
-
return currentInput.isTouch ? getIsCustomTouchBehavior() !==
|
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(
|
14122
|
+
function scheduleShow(event) {
|
14123
14123
|
instance.clearDelayTimeouts();
|
14124
|
-
if (
|
14125
|
-
invokeHook("onTrigger", [instance,
|
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(
|
14141
|
+
function scheduleHide(event) {
|
14142
14142
|
instance.clearDelayTimeouts();
|
14143
|
-
invokeHook("onUntrigger", [instance,
|
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(
|
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(
|
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(
|
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(
|
14465
|
-
var isCursorOverReference =
|
14464
|
+
function onMouseMove(event) {
|
14465
|
+
var isCursorOverReference = event.target ? reference2.contains(event.target) : true;
|
14466
14466
|
var followCursor2 = instance.props.followCursor;
|
14467
|
-
var clientX =
|
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,
|
14553
|
-
if (isMouseEvent(
|
14552
|
+
onTrigger: function onTrigger2(_2, event) {
|
14553
|
+
if (isMouseEvent(event)) {
|
14554
14554
|
mouseCoords = {
|
14555
|
-
clientX:
|
14556
|
-
clientY:
|
14555
|
+
clientX: event.clientX,
|
14556
|
+
clientY: event.clientY
|
14557
14557
|
};
|
14558
14558
|
}
|
14559
|
-
wasFocusEvent =
|
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(
|
14582
|
-
if (
|
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(
|
14864
|
-
if (notification.type ===
|
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(
|
14978
|
+
checkConfirmation(event) {
|
14979
14979
|
if (!this.confirmed) {
|
14980
14980
|
this.approving = true;
|
14981
|
-
|
14981
|
+
event.preventDefault();
|
14982
14982
|
}
|
14983
14983
|
},
|
14984
|
-
approveAndRun(
|
14984
|
+
approveAndRun(event) {
|
14985
14985
|
if (this.approving) {
|
14986
|
-
|
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(
|
14994
|
+
cancelConfirmation(event) {
|
14995
14995
|
if (this.approving) {
|
14996
|
-
|
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(
|
15145
|
-
const 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,32 @@ ${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(() =>
|
15197
|
+
setTimeout(() => {
|
15198
|
+
this.clearFrame();
|
15199
|
+
this.$dispatch("modal:hidden");
|
15200
|
+
}, 200);
|
15193
15201
|
},
|
15194
|
-
dismiss(
|
15202
|
+
dismiss(event) {
|
15195
15203
|
if (this.$options.dismissable)
|
15196
15204
|
this.hide();
|
15197
15205
|
},
|
15206
|
+
scrollTo(pos) {
|
15207
|
+
setTimeout(() => {
|
15208
|
+
this.$root.scrollTop = pos + this.contentOffsetTop;
|
15209
|
+
}, 10);
|
15210
|
+
},
|
15198
15211
|
clearFrame() {
|
15199
15212
|
this.frame.removeAttribute("src");
|
15200
15213
|
this.frame.removeAttribute("complete");
|
15201
15214
|
this.frame.innerHTML = "";
|
15202
15215
|
},
|
15203
|
-
onFrameSubmitEnd() {
|
15216
|
+
onFrameSubmitEnd(event) {
|
15204
15217
|
if (this.$options.closeOnSubmit && event.detail.success) {
|
15205
15218
|
this.hide();
|
15206
15219
|
}
|
@@ -15208,11 +15221,35 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
15208
15221
|
destroy() {
|
15209
15222
|
this.frame.removeEventListener("turbo:submit-end", this.onFrameSubmitEnd);
|
15210
15223
|
},
|
15224
|
+
get contentOffsetTop() {
|
15225
|
+
return parseInt(
|
15226
|
+
window.getComputedStyle(this.$refs.container).paddingTop,
|
15227
|
+
10
|
15228
|
+
);
|
15229
|
+
},
|
15211
15230
|
root: {
|
15212
15231
|
"x-options": "options",
|
15213
15232
|
"x-show": "open",
|
15214
15233
|
"@keydown.escape.document": "dismiss",
|
15215
15234
|
"@modal:hide.document": "hide"
|
15235
|
+
},
|
15236
|
+
overlay: {
|
15237
|
+
"x-show": "open",
|
15238
|
+
"x-transition:enter": "overlay-enter",
|
15239
|
+
"x-transition:enter-start": "overlay-enter-start",
|
15240
|
+
"x-transition:enter-end": "overlay-enter-end",
|
15241
|
+
"x-transition:leave": "overlay-leave",
|
15242
|
+
"x-transition:leave-start": "overlay-leave-start",
|
15243
|
+
"x-transition:leave-end": "overlay-leave-end"
|
15244
|
+
},
|
15245
|
+
container: {
|
15246
|
+
"x-show": "open",
|
15247
|
+
"x-transition:enter": "container-enter",
|
15248
|
+
"x-transition:enter-start": "container-enter-start",
|
15249
|
+
"x-transition:enter-end": "container-enter-end",
|
15250
|
+
"x-transition:leave": "container-leave",
|
15251
|
+
"x-transition:leave-start": "container-leave-start",
|
15252
|
+
"x-transition:leave-end": "container-leave-end"
|
15216
15253
|
}
|
15217
15254
|
};
|
15218
15255
|
});
|
@@ -15233,7 +15270,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
15233
15270
|
}
|
15234
15271
|
},
|
15235
15272
|
close() {
|
15236
|
-
this
|
15273
|
+
this.modal.hide();
|
15237
15274
|
},
|
15238
15275
|
onFrameLoad() {
|
15239
15276
|
this.$focus.focus(this.firstInput);
|
@@ -15251,8 +15288,42 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
15251
15288
|
};
|
15252
15289
|
});
|
15253
15290
|
|
15291
|
+
// ../../components/coco/base/modal_lightbox/modal_lightbox.js
|
15292
|
+
var modal_lightbox_exports = {};
|
15293
|
+
__export(modal_lightbox_exports, {
|
15294
|
+
default: () => modal_lightbox_default
|
15295
|
+
});
|
15296
|
+
var modal_lightbox_default = CocoComponent("modalLightbox", () => {
|
15297
|
+
return {
|
15298
|
+
loaded: false,
|
15299
|
+
init() {
|
15300
|
+
if (this.img.complete && this.img.naturalHeight !== 0) {
|
15301
|
+
this.imageLoaded();
|
15302
|
+
}
|
15303
|
+
},
|
15304
|
+
close() {
|
15305
|
+
this.modal.hide();
|
15306
|
+
},
|
15307
|
+
imageLoaded() {
|
15308
|
+
this.loaded = true;
|
15309
|
+
this.$nextTick(() => {
|
15310
|
+
const scrollTop = parseInt(this.img.dataset.scrollTop, 10);
|
15311
|
+
if (!isNaN(scrollTop) && scrollTop !== 0) {
|
15312
|
+
this.modal.scrollTo(scrollTop);
|
15313
|
+
}
|
15314
|
+
});
|
15315
|
+
},
|
15316
|
+
get img() {
|
15317
|
+
return this.$refs.media.querySelector("img");
|
15318
|
+
},
|
15319
|
+
root: {
|
15320
|
+
":class": "{loaded}"
|
15321
|
+
}
|
15322
|
+
};
|
15323
|
+
});
|
15324
|
+
|
15254
15325
|
// 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];
|
15326
|
+
var modules = [button_exports, dropdown_exports, icon_exports, image_uploader_exports, modal_exports, modal_dialog_exports, modal_lightbox_exports];
|
15256
15327
|
var __default = modules;
|
15257
15328
|
|
15258
15329
|
// base/components.js
|
@@ -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-
|
15
|
-
<div class="modal-container"
|
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>
|