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.
- checksums.yaml +4 -4
- data/app/assets/build/coco/app.css +133 -2
- data/app/assets/build/coco/app.js +177 -109
- data/app/assets/build/coco/book.css +164 -1
- data/app/assets/build/coco/book.js +158 -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 +41 -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
@@ -14032,7 +14032,7 @@
|
|
14032
14032
|
var package_default = {
|
14033
14033
|
name: "coveragebook-components",
|
14034
14034
|
type: "module",
|
14035
|
-
version: "0.7.
|
14035
|
+
version: "0.7.5",
|
14036
14036
|
main: "index.js",
|
14037
14037
|
repository: "git@github.com:coveragebook/coco.git",
|
14038
14038
|
author: "Mark Perkins <mark@coveragebook.com>",
|
@@ -14115,14 +14115,13 @@
|
|
14115
14115
|
"before:init": [
|
14116
14116
|
"npm install",
|
14117
14117
|
"bundle install",
|
14118
|
-
"bundle exec rake test"
|
14119
|
-
"cd lookbook && bundle"
|
14118
|
+
"bundle exec rake test"
|
14120
14119
|
],
|
14121
14120
|
"after:bump": [
|
14122
14121
|
"npm run lint:fix",
|
14123
14122
|
"npm run build"
|
14124
14123
|
],
|
14125
|
-
"after:version:bump": "./bin/bump-version ${version} && bundle",
|
14124
|
+
"after:version:bump": "./bin/bump-version ${version} && bundle && cd lookbook && bundle",
|
14126
14125
|
"after:release": "./bin/build-gem ${version}"
|
14127
14126
|
}
|
14128
14127
|
}
|
@@ -17960,15 +17959,15 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
17960
17959
|
};
|
17961
17960
|
directive("ignore", handler);
|
17962
17961
|
directive("effect", (el, { expression }, { effect: effect32 }) => effect32(evaluateLater(el, expression)));
|
17963
|
-
function on(el,
|
17962
|
+
function on(el, event, modifiers, callback) {
|
17964
17963
|
let listenerTarget = el;
|
17965
17964
|
let handler3 = (e3) => callback(e3);
|
17966
17965
|
let options = {};
|
17967
17966
|
let wrapHandler = (callback2, wrapper) => (e3) => wrapper(callback2, e3);
|
17968
17967
|
if (modifiers.includes("dot"))
|
17969
|
-
|
17968
|
+
event = dotSyntax(event);
|
17970
17969
|
if (modifiers.includes("camel"))
|
17971
|
-
|
17970
|
+
event = camelCase2(event);
|
17972
17971
|
if (modifiers.includes("passive"))
|
17973
17972
|
options.passive = true;
|
17974
17973
|
if (modifiers.includes("capture"))
|
@@ -18018,20 +18017,20 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
18018
18017
|
if (modifiers.includes("once")) {
|
18019
18018
|
handler3 = wrapHandler(handler3, (next, e3) => {
|
18020
18019
|
next(e3);
|
18021
|
-
listenerTarget.removeEventListener(
|
18020
|
+
listenerTarget.removeEventListener(event, handler3, options);
|
18022
18021
|
});
|
18023
18022
|
}
|
18024
18023
|
handler3 = wrapHandler(handler3, (next, e3) => {
|
18025
|
-
if (isKeyEvent(
|
18024
|
+
if (isKeyEvent(event)) {
|
18026
18025
|
if (isListeningForASpecificKeyThatHasntBeenPressed(e3, modifiers)) {
|
18027
18026
|
return;
|
18028
18027
|
}
|
18029
18028
|
}
|
18030
18029
|
next(e3);
|
18031
18030
|
});
|
18032
|
-
listenerTarget.addEventListener(
|
18031
|
+
listenerTarget.addEventListener(event, handler3, options);
|
18033
18032
|
return () => {
|
18034
|
-
listenerTarget.removeEventListener(
|
18033
|
+
listenerTarget.removeEventListener(event, handler3, options);
|
18035
18034
|
};
|
18036
18035
|
}
|
18037
18036
|
function dotSyntax(subject) {
|
@@ -18048,8 +18047,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
18048
18047
|
return subject;
|
18049
18048
|
return subject.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[_\s]/, "-").toLowerCase();
|
18050
18049
|
}
|
18051
|
-
function isKeyEvent(
|
18052
|
-
return ["keydown", "keyup"].includes(
|
18050
|
+
function isKeyEvent(event) {
|
18051
|
+
return ["keydown", "keyup"].includes(event);
|
18053
18052
|
}
|
18054
18053
|
function isListeningForASpecificKeyThatHasntBeenPressed(e3, modifiers) {
|
18055
18054
|
let keyModifiers = modifiers.filter((i3) => {
|
@@ -18147,13 +18146,13 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
18147
18146
|
el.setAttribute("name", expression);
|
18148
18147
|
});
|
18149
18148
|
}
|
18150
|
-
var
|
18149
|
+
var event = el.tagName.toLowerCase() === "select" || ["checkbox", "radio"].includes(el.type) || modifiers.includes("lazy") ? "change" : "input";
|
18151
18150
|
let removeListener = isCloning ? () => {
|
18152
|
-
} : on(el,
|
18151
|
+
} : on(el, event, modifiers, (e3) => {
|
18153
18152
|
setValue(getInputValue(el, modifiers, e3, getValue()));
|
18154
18153
|
});
|
18155
18154
|
if (modifiers.includes("fill") && [null, ""].includes(getValue())) {
|
18156
|
-
el.dispatchEvent(new Event(
|
18155
|
+
el.dispatchEvent(new Event(event, {}));
|
18157
18156
|
}
|
18158
18157
|
if (!el._x_removeModelListeners)
|
18159
18158
|
el._x_removeModelListeners = {};
|
@@ -18188,27 +18187,27 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
18188
18187
|
el._x_forceModelUpdate(value);
|
18189
18188
|
});
|
18190
18189
|
});
|
18191
|
-
function getInputValue(el, modifiers,
|
18190
|
+
function getInputValue(el, modifiers, event, currentValue) {
|
18192
18191
|
return mutateDom(() => {
|
18193
18192
|
var _a;
|
18194
|
-
if (
|
18195
|
-
return (_a =
|
18193
|
+
if (event instanceof CustomEvent && event.detail !== void 0)
|
18194
|
+
return (_a = event.detail) != null ? _a : event.target.value;
|
18196
18195
|
else if (el.type === "checkbox") {
|
18197
18196
|
if (Array.isArray(currentValue)) {
|
18198
|
-
let newValue = modifiers.includes("number") ? safeParseNumber(
|
18199
|
-
return
|
18197
|
+
let newValue = modifiers.includes("number") ? safeParseNumber(event.target.value) : event.target.value;
|
18198
|
+
return event.target.checked ? currentValue.concat([newValue]) : currentValue.filter((el2) => !checkedAttrLooseCompare2(el2, newValue));
|
18200
18199
|
} else {
|
18201
|
-
return
|
18200
|
+
return event.target.checked;
|
18202
18201
|
}
|
18203
18202
|
} else if (el.tagName.toLowerCase() === "select" && el.multiple) {
|
18204
|
-
return modifiers.includes("number") ? Array.from(
|
18203
|
+
return modifiers.includes("number") ? Array.from(event.target.selectedOptions).map((option) => {
|
18205
18204
|
let rawValue = option.value || option.text;
|
18206
18205
|
return safeParseNumber(rawValue);
|
18207
|
-
}) : Array.from(
|
18206
|
+
}) : Array.from(event.target.selectedOptions).map((option) => {
|
18208
18207
|
return option.value || option.text;
|
18209
18208
|
});
|
18210
18209
|
} else {
|
18211
|
-
let rawValue =
|
18210
|
+
let rawValue = event.target.value;
|
18212
18211
|
return modifiers.includes("number") ? safeParseNumber(rawValue) : modifiers.includes("trim") ? rawValue.trim() : rawValue;
|
18213
18212
|
}
|
18214
18213
|
});
|
@@ -21880,8 +21879,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
21880
21879
|
var _normalizeToArray = normalizeToArray(elementOrElements), element = _normalizeToArray[0];
|
21881
21880
|
return element != null && (_element$ownerDocumen = element.ownerDocument) != null && _element$ownerDocumen.body ? element.ownerDocument : document;
|
21882
21881
|
}
|
21883
|
-
function isCursorOutsideInteractiveBorder(popperTreeData,
|
21884
|
-
var clientX =
|
21882
|
+
function isCursorOutsideInteractiveBorder(popperTreeData, event) {
|
21883
|
+
var clientX = event.clientX, clientY = event.clientY;
|
21885
21884
|
return popperTreeData.every(function(_ref) {
|
21886
21885
|
var popperRect = _ref.popperRect, popperState = _ref.popperState, props = _ref.props;
|
21887
21886
|
var interactiveBorder = props.interactiveBorder;
|
@@ -21903,8 +21902,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
21903
21902
|
}
|
21904
21903
|
function updateTransitionEndListener(box, action, listener) {
|
21905
21904
|
var method = action + "EventListener";
|
21906
|
-
["transitionend", "webkitTransitionEnd"].forEach(function(
|
21907
|
-
box[method](
|
21905
|
+
["transitionend", "webkitTransitionEnd"].forEach(function(event) {
|
21906
|
+
box[method](event, listener);
|
21908
21907
|
});
|
21909
21908
|
}
|
21910
21909
|
function actualContains(parent, child) {
|
@@ -22428,13 +22427,13 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
22428
22427
|
return listener !== debouncedOnMouseMove;
|
22429
22428
|
});
|
22430
22429
|
}
|
22431
|
-
function onDocumentPress(
|
22430
|
+
function onDocumentPress(event) {
|
22432
22431
|
if (currentInput.isTouch) {
|
22433
|
-
if (didTouchMove ||
|
22432
|
+
if (didTouchMove || event.type === "mousedown") {
|
22434
22433
|
return;
|
22435
22434
|
}
|
22436
22435
|
}
|
22437
|
-
var actualTarget =
|
22436
|
+
var actualTarget = event.composedPath && event.composedPath()[0] || event.target;
|
22438
22437
|
if (instance.props.interactive && actualContains(popper2, actualTarget)) {
|
22439
22438
|
return;
|
22440
22439
|
}
|
@@ -22448,7 +22447,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
22448
22447
|
return;
|
22449
22448
|
}
|
22450
22449
|
} else {
|
22451
|
-
invokeHook("onClickOutside", [instance,
|
22450
|
+
invokeHook("onClickOutside", [instance, event]);
|
22452
22451
|
}
|
22453
22452
|
if (instance.props.hideOnClick === true) {
|
22454
22453
|
instance.clearDelayTimeouts();
|
@@ -22494,8 +22493,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
22494
22493
|
}
|
22495
22494
|
function onTransitionEnd(duration, callback) {
|
22496
22495
|
var box = getDefaultTemplateChildren().box;
|
22497
|
-
function listener(
|
22498
|
-
if (
|
22496
|
+
function listener(event) {
|
22497
|
+
if (event.target === box) {
|
22499
22498
|
updateTransitionEndListener(box, "remove", listener);
|
22500
22499
|
callback();
|
22501
22500
|
}
|
@@ -22556,37 +22555,37 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
22556
22555
|
});
|
22557
22556
|
listeners = [];
|
22558
22557
|
}
|
22559
|
-
function onTrigger2(
|
22558
|
+
function onTrigger2(event) {
|
22560
22559
|
var _lastTriggerEvent;
|
22561
22560
|
var shouldScheduleClickHide = false;
|
22562
|
-
if (!instance.state.isEnabled || isEventListenerStopped(
|
22561
|
+
if (!instance.state.isEnabled || isEventListenerStopped(event) || didHideDueToDocumentMouseDown) {
|
22563
22562
|
return;
|
22564
22563
|
}
|
22565
22564
|
var wasFocused = ((_lastTriggerEvent = lastTriggerEvent) == null ? void 0 : _lastTriggerEvent.type) === "focus";
|
22566
|
-
lastTriggerEvent =
|
22567
|
-
currentTarget =
|
22565
|
+
lastTriggerEvent = event;
|
22566
|
+
currentTarget = event.currentTarget;
|
22568
22567
|
handleAriaExpandedAttribute();
|
22569
|
-
if (!instance.state.isVisible && isMouseEvent(
|
22568
|
+
if (!instance.state.isVisible && isMouseEvent(event)) {
|
22570
22569
|
mouseMoveListeners.forEach(function(listener) {
|
22571
|
-
return listener(
|
22570
|
+
return listener(event);
|
22572
22571
|
});
|
22573
22572
|
}
|
22574
|
-
if (
|
22573
|
+
if (event.type === "click" && (instance.props.trigger.indexOf("mouseenter") < 0 || isVisibleFromClick) && instance.props.hideOnClick !== false && instance.state.isVisible) {
|
22575
22574
|
shouldScheduleClickHide = true;
|
22576
22575
|
} else {
|
22577
|
-
scheduleShow(
|
22576
|
+
scheduleShow(event);
|
22578
22577
|
}
|
22579
|
-
if (
|
22578
|
+
if (event.type === "click") {
|
22580
22579
|
isVisibleFromClick = !shouldScheduleClickHide;
|
22581
22580
|
}
|
22582
22581
|
if (shouldScheduleClickHide && !wasFocused) {
|
22583
|
-
scheduleHide(
|
22582
|
+
scheduleHide(event);
|
22584
22583
|
}
|
22585
22584
|
}
|
22586
|
-
function onMouseMove(
|
22587
|
-
var target =
|
22585
|
+
function onMouseMove(event) {
|
22586
|
+
var target = event.target;
|
22588
22587
|
var isCursorOverReferenceOrPopper = getCurrentTarget().contains(target) || popper2.contains(target);
|
22589
|
-
if (
|
22588
|
+
if (event.type === "mousemove" && isCursorOverReferenceOrPopper) {
|
22590
22589
|
return;
|
22591
22590
|
}
|
22592
22591
|
var popperTreeData = getNestedPopperTree().concat(popper2).map(function(popper3) {
|
@@ -22602,33 +22601,33 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
22602
22601
|
}
|
22603
22602
|
return null;
|
22604
22603
|
}).filter(Boolean);
|
22605
|
-
if (isCursorOutsideInteractiveBorder(popperTreeData,
|
22604
|
+
if (isCursorOutsideInteractiveBorder(popperTreeData, event)) {
|
22606
22605
|
cleanupInteractiveMouseListeners();
|
22607
|
-
scheduleHide(
|
22606
|
+
scheduleHide(event);
|
22608
22607
|
}
|
22609
22608
|
}
|
22610
|
-
function onMouseLeave(
|
22611
|
-
var shouldBail = isEventListenerStopped(
|
22609
|
+
function onMouseLeave(event) {
|
22610
|
+
var shouldBail = isEventListenerStopped(event) || instance.props.trigger.indexOf("click") >= 0 && isVisibleFromClick;
|
22612
22611
|
if (shouldBail) {
|
22613
22612
|
return;
|
22614
22613
|
}
|
22615
22614
|
if (instance.props.interactive) {
|
22616
|
-
instance.hideWithInteractivity(
|
22615
|
+
instance.hideWithInteractivity(event);
|
22617
22616
|
return;
|
22618
22617
|
}
|
22619
|
-
scheduleHide(
|
22618
|
+
scheduleHide(event);
|
22620
22619
|
}
|
22621
|
-
function onBlurOrFocusOut(
|
22622
|
-
if (instance.props.trigger.indexOf("focusin") < 0 &&
|
22620
|
+
function onBlurOrFocusOut(event) {
|
22621
|
+
if (instance.props.trigger.indexOf("focusin") < 0 && event.target !== getCurrentTarget()) {
|
22623
22622
|
return;
|
22624
22623
|
}
|
22625
|
-
if (instance.props.interactive &&
|
22624
|
+
if (instance.props.interactive && event.relatedTarget && popper2.contains(event.relatedTarget)) {
|
22626
22625
|
return;
|
22627
22626
|
}
|
22628
|
-
scheduleHide(
|
22627
|
+
scheduleHide(event);
|
22629
22628
|
}
|
22630
|
-
function isEventListenerStopped(
|
22631
|
-
return currentInput.isTouch ? getIsCustomTouchBehavior() !==
|
22629
|
+
function isEventListenerStopped(event) {
|
22630
|
+
return currentInput.isTouch ? getIsCustomTouchBehavior() !== event.type.indexOf("touch") >= 0 : false;
|
22632
22631
|
}
|
22633
22632
|
function createPopperInstance() {
|
22634
22633
|
destroyPopperInstance();
|
@@ -22731,10 +22730,10 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
22731
22730
|
function getNestedPopperTree() {
|
22732
22731
|
return arrayFrom(popper2.querySelectorAll("[data-tippy-root]"));
|
22733
22732
|
}
|
22734
|
-
function scheduleShow(
|
22733
|
+
function scheduleShow(event) {
|
22735
22734
|
instance.clearDelayTimeouts();
|
22736
|
-
if (
|
22737
|
-
invokeHook("onTrigger", [instance,
|
22735
|
+
if (event) {
|
22736
|
+
invokeHook("onTrigger", [instance, event]);
|
22738
22737
|
}
|
22739
22738
|
addDocumentPress();
|
22740
22739
|
var delay3 = getDelay(true);
|
@@ -22750,14 +22749,14 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
22750
22749
|
instance.show();
|
22751
22750
|
}
|
22752
22751
|
}
|
22753
|
-
function scheduleHide(
|
22752
|
+
function scheduleHide(event) {
|
22754
22753
|
instance.clearDelayTimeouts();
|
22755
|
-
invokeHook("onUntrigger", [instance,
|
22754
|
+
invokeHook("onUntrigger", [instance, event]);
|
22756
22755
|
if (!instance.state.isVisible) {
|
22757
22756
|
removeDocumentPress();
|
22758
22757
|
return;
|
22759
22758
|
}
|
22760
|
-
if (instance.props.trigger.indexOf("mouseenter") >= 0 && instance.props.trigger.indexOf("click") >= 0 && ["mouseleave", "mousemove"].indexOf(
|
22759
|
+
if (instance.props.trigger.indexOf("mouseenter") >= 0 && instance.props.trigger.indexOf("click") >= 0 && ["mouseleave", "mousemove"].indexOf(event.type) >= 0 && isVisibleFromClick) {
|
22761
22760
|
return;
|
22762
22761
|
}
|
22763
22762
|
var delay3 = getDelay(false);
|
@@ -22930,13 +22929,13 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
22930
22929
|
instance.unmount();
|
22931
22930
|
}
|
22932
22931
|
}
|
22933
|
-
function hideWithInteractivity(
|
22932
|
+
function hideWithInteractivity(event) {
|
22934
22933
|
if (true) {
|
22935
22934
|
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("hideWithInteractivity"));
|
22936
22935
|
}
|
22937
22936
|
getDocument().addEventListener("mousemove", debouncedOnMouseMove);
|
22938
22937
|
pushIfUnique(mouseMoveListeners, debouncedOnMouseMove);
|
22939
|
-
debouncedOnMouseMove(
|
22938
|
+
debouncedOnMouseMove(event);
|
22940
22939
|
}
|
22941
22940
|
function unmount() {
|
22942
22941
|
if (true) {
|
@@ -23120,8 +23119,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
23120
23119
|
prepareInstance(instance, references[0]);
|
23121
23120
|
}
|
23122
23121
|
},
|
23123
|
-
onTrigger: function onTrigger2(instance,
|
23124
|
-
prepareInstance(instance,
|
23122
|
+
onTrigger: function onTrigger2(instance, event) {
|
23123
|
+
prepareInstance(instance, event.currentTarget);
|
23125
23124
|
}
|
23126
23125
|
};
|
23127
23126
|
}
|
@@ -23236,10 +23235,10 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
23236
23235
|
});
|
23237
23236
|
isInternalUpdate = false;
|
23238
23237
|
}
|
23239
|
-
function onMouseMove(
|
23240
|
-
var isCursorOverReference =
|
23238
|
+
function onMouseMove(event) {
|
23239
|
+
var isCursorOverReference = event.target ? reference2.contains(event.target) : true;
|
23241
23240
|
var followCursor2 = instance.props.followCursor;
|
23242
|
-
var clientX =
|
23241
|
+
var clientX = event.clientX, clientY = event.clientY;
|
23243
23242
|
var rect = reference2.getBoundingClientRect();
|
23244
23243
|
var relativeX = clientX - rect.left;
|
23245
23244
|
var relativeY = clientY - rect.top;
|
@@ -23324,14 +23323,14 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
23324
23323
|
}
|
23325
23324
|
}
|
23326
23325
|
},
|
23327
|
-
onTrigger: function onTrigger2(_3,
|
23328
|
-
if (isMouseEvent(
|
23326
|
+
onTrigger: function onTrigger2(_3, event) {
|
23327
|
+
if (isMouseEvent(event)) {
|
23329
23328
|
mouseCoords = {
|
23330
|
-
clientX:
|
23331
|
-
clientY:
|
23329
|
+
clientX: event.clientX,
|
23330
|
+
clientY: event.clientY
|
23332
23331
|
};
|
23333
23332
|
}
|
23334
|
-
wasFocusEvent =
|
23333
|
+
wasFocusEvent = event.type === "focus";
|
23335
23334
|
},
|
23336
23335
|
onHidden: function onHidden2() {
|
23337
23336
|
if (instance.props.followCursor) {
|
@@ -23353,8 +23352,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
23353
23352
|
name: "hideOnEsc",
|
23354
23353
|
defaultValue: true,
|
23355
23354
|
fn({ hide: hide2 }) {
|
23356
|
-
function onKeyDown(
|
23357
|
-
if (
|
23355
|
+
function onKeyDown(event) {
|
23356
|
+
if (event.keyCode === 27) {
|
23358
23357
|
hide2();
|
23359
23358
|
}
|
23360
23359
|
}
|
@@ -23635,8 +23634,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
23635
23634
|
clearAutoDismiss() {
|
23636
23635
|
clearTimeout(notification.dismissTimer);
|
23637
23636
|
},
|
23638
|
-
clearFromQueue(
|
23639
|
-
if (notification.type ===
|
23637
|
+
clearFromQueue(event) {
|
23638
|
+
if (notification.type === event.detail.type && notification.position === "fixed" && notification.id !== event.detail.id && notification.queuePosition < event.detail.queuePosition) {
|
23640
23639
|
notification.dismiss();
|
23641
23640
|
}
|
23642
23641
|
}
|
@@ -23750,15 +23749,15 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
23750
23749
|
}
|
23751
23750
|
},
|
23752
23751
|
/* confirmation */
|
23753
|
-
checkConfirmation(
|
23752
|
+
checkConfirmation(event) {
|
23754
23753
|
if (!this.confirmed) {
|
23755
23754
|
this.approving = true;
|
23756
|
-
|
23755
|
+
event.preventDefault();
|
23757
23756
|
}
|
23758
23757
|
},
|
23759
|
-
approveAndRun(
|
23758
|
+
approveAndRun(event) {
|
23760
23759
|
if (this.approving) {
|
23761
|
-
|
23760
|
+
event.stopPropagation();
|
23762
23761
|
this.confirmed = true;
|
23763
23762
|
this.dropdown.trigger.click();
|
23764
23763
|
this.dropdown.hide();
|
@@ -23766,9 +23765,9 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
23766
23765
|
this.approving = false;
|
23767
23766
|
}
|
23768
23767
|
},
|
23769
|
-
cancelConfirmation(
|
23768
|
+
cancelConfirmation(event) {
|
23770
23769
|
if (this.approving) {
|
23771
|
-
|
23770
|
+
event.stopPropagation();
|
23772
23771
|
this.approving = false;
|
23773
23772
|
this.dropdown.hide();
|
23774
23773
|
}
|
@@ -23916,8 +23915,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
23916
23915
|
this.file = null;
|
23917
23916
|
this.$dispatch("image-uploader:clear");
|
23918
23917
|
},
|
23919
|
-
handleDrop(
|
23920
|
-
const files =
|
23918
|
+
handleDrop(event) {
|
23919
|
+
const files = event.detail.files || event.dataTransfer.files;
|
23921
23920
|
this.handleFiles(files);
|
23922
23921
|
},
|
23923
23922
|
handleFiles(files) {
|
@@ -23952,8 +23951,10 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
23952
23951
|
return {
|
23953
23952
|
open: false,
|
23954
23953
|
frame: null,
|
23954
|
+
modal: null,
|
23955
23955
|
options: ["dismissable", "closeOnSubmit"],
|
23956
23956
|
init() {
|
23957
|
+
this.modal = this;
|
23957
23958
|
this.onFrameSubmitEnd = this.onFrameSubmitEnd.bind(this);
|
23958
23959
|
this.frame = this.$el.closest("turbo-frame");
|
23959
23960
|
this.frame.addEventListener("turbo:submit-end", this.onFrameSubmitEnd);
|
@@ -23961,21 +23962,30 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
23961
23962
|
},
|
23962
23963
|
show() {
|
23963
23964
|
this.open = true;
|
23965
|
+
setTimeout(() => {
|
23966
|
+
this.$dispatch("modal:shown");
|
23967
|
+
}, 400);
|
23964
23968
|
},
|
23965
23969
|
hide() {
|
23966
23970
|
this.open = false;
|
23967
|
-
setTimeout(() =>
|
23971
|
+
setTimeout(() => {
|
23972
|
+
this.clearFrame();
|
23973
|
+
this.$dispatch("modal:hidden");
|
23974
|
+
}, 200);
|
23968
23975
|
},
|
23969
|
-
dismiss(
|
23976
|
+
dismiss(event) {
|
23970
23977
|
if (this.$options.dismissable)
|
23971
23978
|
this.hide();
|
23972
23979
|
},
|
23980
|
+
scrollTo(pos) {
|
23981
|
+
this.$root.scrollTop = pos + this.contentOffsetTop;
|
23982
|
+
},
|
23973
23983
|
clearFrame() {
|
23974
23984
|
this.frame.removeAttribute("src");
|
23975
23985
|
this.frame.removeAttribute("complete");
|
23976
23986
|
this.frame.innerHTML = "";
|
23977
23987
|
},
|
23978
|
-
onFrameSubmitEnd() {
|
23988
|
+
onFrameSubmitEnd(event) {
|
23979
23989
|
if (this.$options.closeOnSubmit && event.detail.success) {
|
23980
23990
|
this.hide();
|
23981
23991
|
}
|
@@ -23983,11 +23993,35 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
23983
23993
|
destroy() {
|
23984
23994
|
this.frame.removeEventListener("turbo:submit-end", this.onFrameSubmitEnd);
|
23985
23995
|
},
|
23996
|
+
get contentOffsetTop() {
|
23997
|
+
return parseInt(
|
23998
|
+
window.getComputedStyle(this.$refs.container).paddingTop,
|
23999
|
+
10
|
24000
|
+
);
|
24001
|
+
},
|
23986
24002
|
root: {
|
23987
24003
|
"x-options": "options",
|
23988
24004
|
"x-show": "open",
|
23989
24005
|
"@keydown.escape.document": "dismiss",
|
23990
24006
|
"@modal:hide.document": "hide"
|
24007
|
+
},
|
24008
|
+
overlay: {
|
24009
|
+
"x-show": "open",
|
24010
|
+
"x-transition:enter": "overlay-enter",
|
24011
|
+
"x-transition:enter-start": "overlay-enter-start",
|
24012
|
+
"x-transition:enter-end": "overlay-enter-end",
|
24013
|
+
"x-transition:leave": "overlay-leave",
|
24014
|
+
"x-transition:leave-start": "overlay-leave-start",
|
24015
|
+
"x-transition:leave-end": "overlay-leave-end"
|
24016
|
+
},
|
24017
|
+
container: {
|
24018
|
+
"x-show": "open",
|
24019
|
+
"x-transition:enter": "container-enter",
|
24020
|
+
"x-transition:enter-start": "container-enter-start",
|
24021
|
+
"x-transition:enter-end": "container-enter-end",
|
24022
|
+
"x-transition:leave": "container-leave",
|
24023
|
+
"x-transition:leave-start": "container-leave-start",
|
24024
|
+
"x-transition:leave-end": "container-leave-end"
|
23991
24025
|
}
|
23992
24026
|
};
|
23993
24027
|
});
|
@@ -24008,7 +24042,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
24008
24042
|
}
|
24009
24043
|
},
|
24010
24044
|
close() {
|
24011
|
-
this
|
24045
|
+
this.modal.hide();
|
24012
24046
|
},
|
24013
24047
|
onFrameLoad() {
|
24014
24048
|
this.$focus.focus(this.firstInput);
|
@@ -24026,8 +24060,42 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
24026
24060
|
};
|
24027
24061
|
});
|
24028
24062
|
|
24063
|
+
// ../../components/coco/base/modal_lightbox/modal_lightbox.js
|
24064
|
+
var modal_lightbox_exports = {};
|
24065
|
+
__export(modal_lightbox_exports, {
|
24066
|
+
default: () => modal_lightbox_default
|
24067
|
+
});
|
24068
|
+
var modal_lightbox_default = CocoComponent("modalLightbox", () => {
|
24069
|
+
return {
|
24070
|
+
loaded: false,
|
24071
|
+
init() {
|
24072
|
+
if (this.img.complete && this.img.naturalHeight !== 0) {
|
24073
|
+
this.imageLoaded();
|
24074
|
+
}
|
24075
|
+
},
|
24076
|
+
close() {
|
24077
|
+
this.modal.hide();
|
24078
|
+
},
|
24079
|
+
imageLoaded() {
|
24080
|
+
this.loaded = true;
|
24081
|
+
this.$nextTick(() => {
|
24082
|
+
const scrollTop = parseInt(this.img.dataset.scrollTop, 10);
|
24083
|
+
if (!isNaN(scrollTop) && scrollTop !== 0) {
|
24084
|
+
this.modal.scrollTo(scrollTop);
|
24085
|
+
}
|
24086
|
+
});
|
24087
|
+
},
|
24088
|
+
get img() {
|
24089
|
+
return this.$refs.media.querySelector("img");
|
24090
|
+
},
|
24091
|
+
root: {
|
24092
|
+
":class": "{loaded}"
|
24093
|
+
}
|
24094
|
+
};
|
24095
|
+
});
|
24096
|
+
|
24029
24097
|
// import-glob:/Users/mark/Code/coveragebook/coco/app/assets/js/base|@baseComponents/**/*.js
|
24030
|
-
var modules = [button_exports, dropdown_exports, icon_exports, image_uploader_exports, modal_exports, modal_dialog_exports];
|
24098
|
+
var modules = [button_exports, dropdown_exports, icon_exports, image_uploader_exports, modal_exports, modal_dialog_exports, modal_lightbox_exports];
|
24031
24099
|
var __default = modules;
|
24032
24100
|
|
24033
24101
|
// base/components.js
|
@@ -24166,8 +24234,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
24166
24234
|
}
|
24167
24235
|
|
24168
24236
|
// helpers/turbo_events.js
|
24169
|
-
function wasSuccessful(
|
24170
|
-
return getEventDetail(
|
24237
|
+
function wasSuccessful(event) {
|
24238
|
+
return getEventDetail(event).success;
|
24171
24239
|
}
|
24172
24240
|
function getEventDetail(obj) {
|
24173
24241
|
return obj instanceof CustomEvent ? obj.detail : obj;
|
@@ -24248,12 +24316,12 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
24248
24316
|
setLayout(layout) {
|
24249
24317
|
this.layout = layout;
|
24250
24318
|
},
|
24251
|
-
handleImageDrop(
|
24319
|
+
handleImageDrop(event) {
|
24252
24320
|
this.dragging = false;
|
24253
24321
|
if (this.bgImagePicker) {
|
24254
|
-
this.bgImagePicker.handleExternalDrop(
|
24322
|
+
this.bgImagePicker.handleExternalDrop(event);
|
24255
24323
|
} else {
|
24256
|
-
|
24324
|
+
event.preventDefault();
|
24257
24325
|
}
|
24258
24326
|
},
|
24259
24327
|
async save() {
|
@@ -24315,9 +24383,9 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
24315
24383
|
}
|
24316
24384
|
input.files = dataTransfer.files;
|
24317
24385
|
},
|
24318
|
-
handleSlideClick(
|
24319
|
-
if (Array.from(
|
24320
|
-
|
24386
|
+
handleSlideClick(event) {
|
24387
|
+
if (Array.from(event.target.classList).includes("slide-text")) {
|
24388
|
+
event.target.querySelector("textarea").focus();
|
24321
24389
|
}
|
24322
24390
|
},
|
24323
24391
|
get blankTextAreasList() {
|
@@ -25707,8 +25775,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
25707
25775
|
/* Start */
|
25708
25776
|
);
|
25709
25777
|
if (result !== false) {
|
25710
|
-
SECONDARY_EVENTS.forEach(function(
|
25711
|
-
document.addEventListener(
|
25778
|
+
SECONDARY_EVENTS.forEach(function(event) {
|
25779
|
+
document.addEventListener(event, this$1, { passive: false });
|
25712
25780
|
});
|
25713
25781
|
}
|
25714
25782
|
break;
|
@@ -25729,8 +25797,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
25729
25797
|
2
|
25730
25798
|
/* End */
|
25731
25799
|
);
|
25732
|
-
SECONDARY_EVENTS.forEach(function(
|
25733
|
-
document.removeEventListener(
|
25800
|
+
SECONDARY_EVENTS.forEach(function(event) {
|
25801
|
+
document.removeEventListener(event, this$1, { passive: false });
|
25734
25802
|
});
|
25735
25803
|
break;
|
25736
25804
|
}
|
@@ -26394,8 +26462,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
26394
26462
|
this.$root.querySelector("[data-role='image-picker'").firstElementChild
|
26395
26463
|
);
|
26396
26464
|
},
|
26397
|
-
handleExternalDrop(
|
26398
|
-
this.readFile(
|
26465
|
+
handleExternalDrop(event) {
|
26466
|
+
this.readFile(event.dataTransfer.files[0]);
|
26399
26467
|
},
|
26400
26468
|
readFile(file) {
|
26401
26469
|
const reader = new FileReader();
|