coveragebook_components 0.6.5 → 0.7.0
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 +88 -3
- data/app/assets/build/coco/app.js +185 -102
- data/app/assets/build/coco/book.css +100 -2
- data/app/assets/build/coco/book.js +168 -85
- data/app/components/coco/app/elements/snackbar/snackbar.css +1 -1
- data/app/components/coco/base/button/button.css +1 -1
- data/app/components/coco/base/icon/icon.css +1 -1
- data/app/components/coco/base/modal/modal.css +21 -0
- data/app/components/coco/base/modal/modal.html.erb +25 -0
- data/app/components/coco/base/modal/modal.js +54 -0
- data/app/components/coco/base/modal/modal.rb +52 -0
- data/app/components/coco/base/modal_dialog/modal_dialog.css +28 -0
- data/app/components/coco/base/modal_dialog/modal_dialog.html.erb +19 -0
- data/app/components/coco/base/modal_dialog/modal_dialog.js +36 -0
- data/app/components/coco/base/modal_dialog/modal_dialog.rb +27 -0
- data/app/helpers/coco/base_helper.rb +39 -12
- data/lib/coco/engine.rb +1 -0
- data/lib/coco.rb +1 -1
- metadata +24 -2
@@ -14032,7 +14032,7 @@
|
|
14032
14032
|
var package_default = {
|
14033
14033
|
name: "coveragebook-components",
|
14034
14034
|
type: "module",
|
14035
|
-
version: "0.
|
14035
|
+
version: "0.7.0",
|
14036
14036
|
main: "index.js",
|
14037
14037
|
repository: "git@github.com:coveragebook/coco.git",
|
14038
14038
|
author: "Mark Perkins <mark@coveragebook.com>",
|
@@ -17960,15 +17960,15 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
17960
17960
|
};
|
17961
17961
|
directive("ignore", handler);
|
17962
17962
|
directive("effect", (el, { expression }, { effect: effect32 }) => effect32(evaluateLater(el, expression)));
|
17963
|
-
function on(el,
|
17963
|
+
function on(el, event2, modifiers, callback) {
|
17964
17964
|
let listenerTarget = el;
|
17965
17965
|
let handler3 = (e3) => callback(e3);
|
17966
17966
|
let options = {};
|
17967
17967
|
let wrapHandler = (callback2, wrapper) => (e3) => wrapper(callback2, e3);
|
17968
17968
|
if (modifiers.includes("dot"))
|
17969
|
-
|
17969
|
+
event2 = dotSyntax(event2);
|
17970
17970
|
if (modifiers.includes("camel"))
|
17971
|
-
|
17971
|
+
event2 = camelCase2(event2);
|
17972
17972
|
if (modifiers.includes("passive"))
|
17973
17973
|
options.passive = true;
|
17974
17974
|
if (modifiers.includes("capture"))
|
@@ -18018,20 +18018,20 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
18018
18018
|
if (modifiers.includes("once")) {
|
18019
18019
|
handler3 = wrapHandler(handler3, (next, e3) => {
|
18020
18020
|
next(e3);
|
18021
|
-
listenerTarget.removeEventListener(
|
18021
|
+
listenerTarget.removeEventListener(event2, handler3, options);
|
18022
18022
|
});
|
18023
18023
|
}
|
18024
18024
|
handler3 = wrapHandler(handler3, (next, e3) => {
|
18025
|
-
if (isKeyEvent(
|
18025
|
+
if (isKeyEvent(event2)) {
|
18026
18026
|
if (isListeningForASpecificKeyThatHasntBeenPressed(e3, modifiers)) {
|
18027
18027
|
return;
|
18028
18028
|
}
|
18029
18029
|
}
|
18030
18030
|
next(e3);
|
18031
18031
|
});
|
18032
|
-
listenerTarget.addEventListener(
|
18032
|
+
listenerTarget.addEventListener(event2, handler3, options);
|
18033
18033
|
return () => {
|
18034
|
-
listenerTarget.removeEventListener(
|
18034
|
+
listenerTarget.removeEventListener(event2, handler3, options);
|
18035
18035
|
};
|
18036
18036
|
}
|
18037
18037
|
function dotSyntax(subject) {
|
@@ -18048,8 +18048,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
18048
18048
|
return subject;
|
18049
18049
|
return subject.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[_\s]/, "-").toLowerCase();
|
18050
18050
|
}
|
18051
|
-
function isKeyEvent(
|
18052
|
-
return ["keydown", "keyup"].includes(
|
18051
|
+
function isKeyEvent(event2) {
|
18052
|
+
return ["keydown", "keyup"].includes(event2);
|
18053
18053
|
}
|
18054
18054
|
function isListeningForASpecificKeyThatHasntBeenPressed(e3, modifiers) {
|
18055
18055
|
let keyModifiers = modifiers.filter((i3) => {
|
@@ -18147,13 +18147,13 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
18147
18147
|
el.setAttribute("name", expression);
|
18148
18148
|
});
|
18149
18149
|
}
|
18150
|
-
var
|
18150
|
+
var event2 = el.tagName.toLowerCase() === "select" || ["checkbox", "radio"].includes(el.type) || modifiers.includes("lazy") ? "change" : "input";
|
18151
18151
|
let removeListener = isCloning ? () => {
|
18152
|
-
} : on(el,
|
18152
|
+
} : on(el, event2, modifiers, (e3) => {
|
18153
18153
|
setValue(getInputValue(el, modifiers, e3, getValue()));
|
18154
18154
|
});
|
18155
18155
|
if (modifiers.includes("fill") && [null, ""].includes(getValue())) {
|
18156
|
-
el.dispatchEvent(new Event(
|
18156
|
+
el.dispatchEvent(new Event(event2, {}));
|
18157
18157
|
}
|
18158
18158
|
if (!el._x_removeModelListeners)
|
18159
18159
|
el._x_removeModelListeners = {};
|
@@ -18188,27 +18188,27 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
18188
18188
|
el._x_forceModelUpdate(value);
|
18189
18189
|
});
|
18190
18190
|
});
|
18191
|
-
function getInputValue(el, modifiers,
|
18191
|
+
function getInputValue(el, modifiers, event2, currentValue) {
|
18192
18192
|
return mutateDom(() => {
|
18193
18193
|
var _a;
|
18194
|
-
if (
|
18195
|
-
return (_a =
|
18194
|
+
if (event2 instanceof CustomEvent && event2.detail !== void 0)
|
18195
|
+
return (_a = event2.detail) != null ? _a : event2.target.value;
|
18196
18196
|
else if (el.type === "checkbox") {
|
18197
18197
|
if (Array.isArray(currentValue)) {
|
18198
|
-
let newValue = modifiers.includes("number") ? safeParseNumber(
|
18199
|
-
return
|
18198
|
+
let newValue = modifiers.includes("number") ? safeParseNumber(event2.target.value) : event2.target.value;
|
18199
|
+
return event2.target.checked ? currentValue.concat([newValue]) : currentValue.filter((el2) => !checkedAttrLooseCompare2(el2, newValue));
|
18200
18200
|
} else {
|
18201
|
-
return
|
18201
|
+
return event2.target.checked;
|
18202
18202
|
}
|
18203
18203
|
} else if (el.tagName.toLowerCase() === "select" && el.multiple) {
|
18204
|
-
return modifiers.includes("number") ? Array.from(
|
18204
|
+
return modifiers.includes("number") ? Array.from(event2.target.selectedOptions).map((option) => {
|
18205
18205
|
let rawValue = option.value || option.text;
|
18206
18206
|
return safeParseNumber(rawValue);
|
18207
|
-
}) : Array.from(
|
18207
|
+
}) : Array.from(event2.target.selectedOptions).map((option) => {
|
18208
18208
|
return option.value || option.text;
|
18209
18209
|
});
|
18210
18210
|
} else {
|
18211
|
-
let rawValue =
|
18211
|
+
let rawValue = event2.target.value;
|
18212
18212
|
return modifiers.includes("number") ? safeParseNumber(rawValue) : modifiers.includes("trim") ? rawValue.trim() : rawValue;
|
18213
18213
|
}
|
18214
18214
|
});
|
@@ -21810,8 +21810,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
21810
21810
|
var _normalizeToArray = normalizeToArray(elementOrElements), element = _normalizeToArray[0];
|
21811
21811
|
return element != null && (_element$ownerDocumen = element.ownerDocument) != null && _element$ownerDocumen.body ? element.ownerDocument : document;
|
21812
21812
|
}
|
21813
|
-
function isCursorOutsideInteractiveBorder(popperTreeData,
|
21814
|
-
var clientX =
|
21813
|
+
function isCursorOutsideInteractiveBorder(popperTreeData, event2) {
|
21814
|
+
var clientX = event2.clientX, clientY = event2.clientY;
|
21815
21815
|
return popperTreeData.every(function(_ref) {
|
21816
21816
|
var popperRect = _ref.popperRect, popperState = _ref.popperState, props = _ref.props;
|
21817
21817
|
var interactiveBorder = props.interactiveBorder;
|
@@ -21833,8 +21833,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
21833
21833
|
}
|
21834
21834
|
function updateTransitionEndListener(box, action, listener) {
|
21835
21835
|
var method = action + "EventListener";
|
21836
|
-
["transitionend", "webkitTransitionEnd"].forEach(function(
|
21837
|
-
box[method](
|
21836
|
+
["transitionend", "webkitTransitionEnd"].forEach(function(event2) {
|
21837
|
+
box[method](event2, listener);
|
21838
21838
|
});
|
21839
21839
|
}
|
21840
21840
|
function actualContains(parent, child) {
|
@@ -22358,13 +22358,13 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
22358
22358
|
return listener !== debouncedOnMouseMove;
|
22359
22359
|
});
|
22360
22360
|
}
|
22361
|
-
function onDocumentPress(
|
22361
|
+
function onDocumentPress(event2) {
|
22362
22362
|
if (currentInput.isTouch) {
|
22363
|
-
if (didTouchMove ||
|
22363
|
+
if (didTouchMove || event2.type === "mousedown") {
|
22364
22364
|
return;
|
22365
22365
|
}
|
22366
22366
|
}
|
22367
|
-
var actualTarget =
|
22367
|
+
var actualTarget = event2.composedPath && event2.composedPath()[0] || event2.target;
|
22368
22368
|
if (instance.props.interactive && actualContains(popper2, actualTarget)) {
|
22369
22369
|
return;
|
22370
22370
|
}
|
@@ -22378,7 +22378,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
22378
22378
|
return;
|
22379
22379
|
}
|
22380
22380
|
} else {
|
22381
|
-
invokeHook("onClickOutside", [instance,
|
22381
|
+
invokeHook("onClickOutside", [instance, event2]);
|
22382
22382
|
}
|
22383
22383
|
if (instance.props.hideOnClick === true) {
|
22384
22384
|
instance.clearDelayTimeouts();
|
@@ -22424,8 +22424,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
22424
22424
|
}
|
22425
22425
|
function onTransitionEnd(duration, callback) {
|
22426
22426
|
var box = getDefaultTemplateChildren().box;
|
22427
|
-
function listener(
|
22428
|
-
if (
|
22427
|
+
function listener(event2) {
|
22428
|
+
if (event2.target === box) {
|
22429
22429
|
updateTransitionEndListener(box, "remove", listener);
|
22430
22430
|
callback();
|
22431
22431
|
}
|
@@ -22486,37 +22486,37 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
22486
22486
|
});
|
22487
22487
|
listeners = [];
|
22488
22488
|
}
|
22489
|
-
function onTrigger2(
|
22489
|
+
function onTrigger2(event2) {
|
22490
22490
|
var _lastTriggerEvent;
|
22491
22491
|
var shouldScheduleClickHide = false;
|
22492
|
-
if (!instance.state.isEnabled || isEventListenerStopped(
|
22492
|
+
if (!instance.state.isEnabled || isEventListenerStopped(event2) || didHideDueToDocumentMouseDown) {
|
22493
22493
|
return;
|
22494
22494
|
}
|
22495
22495
|
var wasFocused = ((_lastTriggerEvent = lastTriggerEvent) == null ? void 0 : _lastTriggerEvent.type) === "focus";
|
22496
|
-
lastTriggerEvent =
|
22497
|
-
currentTarget =
|
22496
|
+
lastTriggerEvent = event2;
|
22497
|
+
currentTarget = event2.currentTarget;
|
22498
22498
|
handleAriaExpandedAttribute();
|
22499
|
-
if (!instance.state.isVisible && isMouseEvent(
|
22499
|
+
if (!instance.state.isVisible && isMouseEvent(event2)) {
|
22500
22500
|
mouseMoveListeners.forEach(function(listener) {
|
22501
|
-
return listener(
|
22501
|
+
return listener(event2);
|
22502
22502
|
});
|
22503
22503
|
}
|
22504
|
-
if (
|
22504
|
+
if (event2.type === "click" && (instance.props.trigger.indexOf("mouseenter") < 0 || isVisibleFromClick) && instance.props.hideOnClick !== false && instance.state.isVisible) {
|
22505
22505
|
shouldScheduleClickHide = true;
|
22506
22506
|
} else {
|
22507
|
-
scheduleShow(
|
22507
|
+
scheduleShow(event2);
|
22508
22508
|
}
|
22509
|
-
if (
|
22509
|
+
if (event2.type === "click") {
|
22510
22510
|
isVisibleFromClick = !shouldScheduleClickHide;
|
22511
22511
|
}
|
22512
22512
|
if (shouldScheduleClickHide && !wasFocused) {
|
22513
|
-
scheduleHide(
|
22513
|
+
scheduleHide(event2);
|
22514
22514
|
}
|
22515
22515
|
}
|
22516
|
-
function onMouseMove(
|
22517
|
-
var target =
|
22516
|
+
function onMouseMove(event2) {
|
22517
|
+
var target = event2.target;
|
22518
22518
|
var isCursorOverReferenceOrPopper = getCurrentTarget().contains(target) || popper2.contains(target);
|
22519
|
-
if (
|
22519
|
+
if (event2.type === "mousemove" && isCursorOverReferenceOrPopper) {
|
22520
22520
|
return;
|
22521
22521
|
}
|
22522
22522
|
var popperTreeData = getNestedPopperTree().concat(popper2).map(function(popper3) {
|
@@ -22532,33 +22532,33 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
22532
22532
|
}
|
22533
22533
|
return null;
|
22534
22534
|
}).filter(Boolean);
|
22535
|
-
if (isCursorOutsideInteractiveBorder(popperTreeData,
|
22535
|
+
if (isCursorOutsideInteractiveBorder(popperTreeData, event2)) {
|
22536
22536
|
cleanupInteractiveMouseListeners();
|
22537
|
-
scheduleHide(
|
22537
|
+
scheduleHide(event2);
|
22538
22538
|
}
|
22539
22539
|
}
|
22540
|
-
function onMouseLeave(
|
22541
|
-
var shouldBail = isEventListenerStopped(
|
22540
|
+
function onMouseLeave(event2) {
|
22541
|
+
var shouldBail = isEventListenerStopped(event2) || instance.props.trigger.indexOf("click") >= 0 && isVisibleFromClick;
|
22542
22542
|
if (shouldBail) {
|
22543
22543
|
return;
|
22544
22544
|
}
|
22545
22545
|
if (instance.props.interactive) {
|
22546
|
-
instance.hideWithInteractivity(
|
22546
|
+
instance.hideWithInteractivity(event2);
|
22547
22547
|
return;
|
22548
22548
|
}
|
22549
|
-
scheduleHide(
|
22549
|
+
scheduleHide(event2);
|
22550
22550
|
}
|
22551
|
-
function onBlurOrFocusOut(
|
22552
|
-
if (instance.props.trigger.indexOf("focusin") < 0 &&
|
22551
|
+
function onBlurOrFocusOut(event2) {
|
22552
|
+
if (instance.props.trigger.indexOf("focusin") < 0 && event2.target !== getCurrentTarget()) {
|
22553
22553
|
return;
|
22554
22554
|
}
|
22555
|
-
if (instance.props.interactive &&
|
22555
|
+
if (instance.props.interactive && event2.relatedTarget && popper2.contains(event2.relatedTarget)) {
|
22556
22556
|
return;
|
22557
22557
|
}
|
22558
|
-
scheduleHide(
|
22558
|
+
scheduleHide(event2);
|
22559
22559
|
}
|
22560
|
-
function isEventListenerStopped(
|
22561
|
-
return currentInput.isTouch ? getIsCustomTouchBehavior() !==
|
22560
|
+
function isEventListenerStopped(event2) {
|
22561
|
+
return currentInput.isTouch ? getIsCustomTouchBehavior() !== event2.type.indexOf("touch") >= 0 : false;
|
22562
22562
|
}
|
22563
22563
|
function createPopperInstance() {
|
22564
22564
|
destroyPopperInstance();
|
@@ -22661,10 +22661,10 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
22661
22661
|
function getNestedPopperTree() {
|
22662
22662
|
return arrayFrom(popper2.querySelectorAll("[data-tippy-root]"));
|
22663
22663
|
}
|
22664
|
-
function scheduleShow(
|
22664
|
+
function scheduleShow(event2) {
|
22665
22665
|
instance.clearDelayTimeouts();
|
22666
|
-
if (
|
22667
|
-
invokeHook("onTrigger", [instance,
|
22666
|
+
if (event2) {
|
22667
|
+
invokeHook("onTrigger", [instance, event2]);
|
22668
22668
|
}
|
22669
22669
|
addDocumentPress();
|
22670
22670
|
var delay3 = getDelay(true);
|
@@ -22680,14 +22680,14 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
22680
22680
|
instance.show();
|
22681
22681
|
}
|
22682
22682
|
}
|
22683
|
-
function scheduleHide(
|
22683
|
+
function scheduleHide(event2) {
|
22684
22684
|
instance.clearDelayTimeouts();
|
22685
|
-
invokeHook("onUntrigger", [instance,
|
22685
|
+
invokeHook("onUntrigger", [instance, event2]);
|
22686
22686
|
if (!instance.state.isVisible) {
|
22687
22687
|
removeDocumentPress();
|
22688
22688
|
return;
|
22689
22689
|
}
|
22690
|
-
if (instance.props.trigger.indexOf("mouseenter") >= 0 && instance.props.trigger.indexOf("click") >= 0 && ["mouseleave", "mousemove"].indexOf(
|
22690
|
+
if (instance.props.trigger.indexOf("mouseenter") >= 0 && instance.props.trigger.indexOf("click") >= 0 && ["mouseleave", "mousemove"].indexOf(event2.type) >= 0 && isVisibleFromClick) {
|
22691
22691
|
return;
|
22692
22692
|
}
|
22693
22693
|
var delay3 = getDelay(false);
|
@@ -22860,13 +22860,13 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
22860
22860
|
instance.unmount();
|
22861
22861
|
}
|
22862
22862
|
}
|
22863
|
-
function hideWithInteractivity(
|
22863
|
+
function hideWithInteractivity(event2) {
|
22864
22864
|
if (true) {
|
22865
22865
|
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("hideWithInteractivity"));
|
22866
22866
|
}
|
22867
22867
|
getDocument().addEventListener("mousemove", debouncedOnMouseMove);
|
22868
22868
|
pushIfUnique(mouseMoveListeners, debouncedOnMouseMove);
|
22869
|
-
debouncedOnMouseMove(
|
22869
|
+
debouncedOnMouseMove(event2);
|
22870
22870
|
}
|
22871
22871
|
function unmount() {
|
22872
22872
|
if (true) {
|
@@ -23050,8 +23050,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
23050
23050
|
prepareInstance(instance, references[0]);
|
23051
23051
|
}
|
23052
23052
|
},
|
23053
|
-
onTrigger: function onTrigger2(instance,
|
23054
|
-
prepareInstance(instance,
|
23053
|
+
onTrigger: function onTrigger2(instance, event2) {
|
23054
|
+
prepareInstance(instance, event2.currentTarget);
|
23055
23055
|
}
|
23056
23056
|
};
|
23057
23057
|
}
|
@@ -23166,10 +23166,10 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
23166
23166
|
});
|
23167
23167
|
isInternalUpdate = false;
|
23168
23168
|
}
|
23169
|
-
function onMouseMove(
|
23170
|
-
var isCursorOverReference =
|
23169
|
+
function onMouseMove(event2) {
|
23170
|
+
var isCursorOverReference = event2.target ? reference2.contains(event2.target) : true;
|
23171
23171
|
var followCursor2 = instance.props.followCursor;
|
23172
|
-
var clientX =
|
23172
|
+
var clientX = event2.clientX, clientY = event2.clientY;
|
23173
23173
|
var rect = reference2.getBoundingClientRect();
|
23174
23174
|
var relativeX = clientX - rect.left;
|
23175
23175
|
var relativeY = clientY - rect.top;
|
@@ -23254,14 +23254,14 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
23254
23254
|
}
|
23255
23255
|
}
|
23256
23256
|
},
|
23257
|
-
onTrigger: function onTrigger2(_3,
|
23258
|
-
if (isMouseEvent(
|
23257
|
+
onTrigger: function onTrigger2(_3, event2) {
|
23258
|
+
if (isMouseEvent(event2)) {
|
23259
23259
|
mouseCoords = {
|
23260
|
-
clientX:
|
23261
|
-
clientY:
|
23260
|
+
clientX: event2.clientX,
|
23261
|
+
clientY: event2.clientY
|
23262
23262
|
};
|
23263
23263
|
}
|
23264
|
-
wasFocusEvent =
|
23264
|
+
wasFocusEvent = event2.type === "focus";
|
23265
23265
|
},
|
23266
23266
|
onHidden: function onHidden2() {
|
23267
23267
|
if (instance.props.followCursor) {
|
@@ -23283,8 +23283,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
23283
23283
|
name: "hideOnEsc",
|
23284
23284
|
defaultValue: true,
|
23285
23285
|
fn({ hide: hide2 }) {
|
23286
|
-
function onKeyDown(
|
23287
|
-
if (
|
23286
|
+
function onKeyDown(event2) {
|
23287
|
+
if (event2.keyCode === 27) {
|
23288
23288
|
hide2();
|
23289
23289
|
}
|
23290
23290
|
}
|
@@ -23565,8 +23565,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
23565
23565
|
clearAutoDismiss() {
|
23566
23566
|
clearTimeout(notification.dismissTimer);
|
23567
23567
|
},
|
23568
|
-
clearFromQueue(
|
23569
|
-
if (notification.type ===
|
23568
|
+
clearFromQueue(event2) {
|
23569
|
+
if (notification.type === event2.detail.type && notification.position === "fixed" && notification.id !== event2.detail.id && notification.queuePosition < event2.detail.queuePosition) {
|
23570
23570
|
notification.dismiss();
|
23571
23571
|
}
|
23572
23572
|
}
|
@@ -23912,15 +23912,15 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
23912
23912
|
}
|
23913
23913
|
},
|
23914
23914
|
/* confirmation */
|
23915
|
-
checkConfirmation(
|
23915
|
+
checkConfirmation(event2) {
|
23916
23916
|
if (!this.confirmed) {
|
23917
23917
|
this.approving = true;
|
23918
|
-
|
23918
|
+
event2.preventDefault();
|
23919
23919
|
}
|
23920
23920
|
},
|
23921
|
-
approveAndRun(
|
23921
|
+
approveAndRun(event2) {
|
23922
23922
|
if (this.approving) {
|
23923
|
-
|
23923
|
+
event2.stopPropagation();
|
23924
23924
|
this.confirmed = true;
|
23925
23925
|
this.dropdown.trigger.click();
|
23926
23926
|
this.dropdown.hide();
|
@@ -23928,9 +23928,9 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
23928
23928
|
this.approving = false;
|
23929
23929
|
}
|
23930
23930
|
},
|
23931
|
-
cancelConfirmation(
|
23931
|
+
cancelConfirmation(event2) {
|
23932
23932
|
if (this.approving) {
|
23933
|
-
|
23933
|
+
event2.stopPropagation();
|
23934
23934
|
this.approving = false;
|
23935
23935
|
this.dropdown.hide();
|
23936
23936
|
}
|
@@ -24080,8 +24080,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
24080
24080
|
this.file = null;
|
24081
24081
|
this.$dispatch("image-uploader:clear");
|
24082
24082
|
},
|
24083
|
-
handleDrop(
|
24084
|
-
const files =
|
24083
|
+
handleDrop(event2) {
|
24084
|
+
const files = event2.detail.files || event2.dataTransfer.files;
|
24085
24085
|
this.handleFiles(files);
|
24086
24086
|
},
|
24087
24087
|
handleFiles(files) {
|
@@ -24107,8 +24107,91 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
24107
24107
|
};
|
24108
24108
|
});
|
24109
24109
|
|
24110
|
+
// ../../components/coco/base/modal/modal.js
|
24111
|
+
var modal_exports = {};
|
24112
|
+
__export(modal_exports, {
|
24113
|
+
default: () => modal_default
|
24114
|
+
});
|
24115
|
+
var modal_default = CocoComponent("modal", () => {
|
24116
|
+
return {
|
24117
|
+
open: false,
|
24118
|
+
frame: null,
|
24119
|
+
options: ["dismissable", "closeOnSubmit"],
|
24120
|
+
init() {
|
24121
|
+
this.onFrameSubmitEnd = this.onFrameSubmitEnd.bind(this);
|
24122
|
+
this.frame = this.$el.closest("turbo-frame");
|
24123
|
+
this.frame.addEventListener("turbo:submit-end", this.onFrameSubmitEnd);
|
24124
|
+
this.$nextTick(() => this.show());
|
24125
|
+
},
|
24126
|
+
show() {
|
24127
|
+
this.open = true;
|
24128
|
+
},
|
24129
|
+
hide() {
|
24130
|
+
this.open = false;
|
24131
|
+
setTimeout(() => this.clearFrame(), 100);
|
24132
|
+
},
|
24133
|
+
dismiss(event2) {
|
24134
|
+
if (this.$options.dismissable)
|
24135
|
+
this.hide();
|
24136
|
+
},
|
24137
|
+
clearFrame() {
|
24138
|
+
this.frame.removeAttribute("src");
|
24139
|
+
this.frame.removeAttribute("complete");
|
24140
|
+
this.frame.innerHTML = "";
|
24141
|
+
},
|
24142
|
+
onFrameSubmitEnd() {
|
24143
|
+
if (this.$options.closeOnSubmit && event.detail.success) {
|
24144
|
+
this.hide();
|
24145
|
+
}
|
24146
|
+
},
|
24147
|
+
destroy() {
|
24148
|
+
this.frame.removeEventListener("turbo:submit-end", this.onFrameSubmitEnd);
|
24149
|
+
},
|
24150
|
+
root: {
|
24151
|
+
"x-options": "options",
|
24152
|
+
"x-show": "open",
|
24153
|
+
"@keydown.escape.document": "dismiss",
|
24154
|
+
"@modal:hide.document": "hide"
|
24155
|
+
}
|
24156
|
+
};
|
24157
|
+
});
|
24158
|
+
|
24159
|
+
// ../../components/coco/base/modal_dialog/modal_dialog.js
|
24160
|
+
var modal_dialog_exports = {};
|
24161
|
+
__export(modal_dialog_exports, {
|
24162
|
+
default: () => modal_dialog_default
|
24163
|
+
});
|
24164
|
+
var modal_dialog_default = CocoComponent("modalDialog", () => {
|
24165
|
+
return {
|
24166
|
+
frame: null,
|
24167
|
+
init() {
|
24168
|
+
this.onFrameLoad = this.onFrameLoad.bind(this);
|
24169
|
+
this.frame = this.$el.closest("turbo-frame");
|
24170
|
+
if (this.frame) {
|
24171
|
+
this.frame.addEventListener("turbo:frame-load", this.onFrameLoad);
|
24172
|
+
}
|
24173
|
+
},
|
24174
|
+
close() {
|
24175
|
+
this.$dispatch("modal:hide");
|
24176
|
+
},
|
24177
|
+
onFrameLoad() {
|
24178
|
+
this.$focus.focus(this.firstInput);
|
24179
|
+
},
|
24180
|
+
destroy() {
|
24181
|
+
if (this.frame) {
|
24182
|
+
this.frame.removeEventListener("turbo:frame-load", this.onFrameLoad);
|
24183
|
+
}
|
24184
|
+
},
|
24185
|
+
get firstInput() {
|
24186
|
+
return this.$root.querySelector(
|
24187
|
+
"input:not([type=hidden]), textarea, select"
|
24188
|
+
);
|
24189
|
+
}
|
24190
|
+
};
|
24191
|
+
});
|
24192
|
+
|
24110
24193
|
// import-glob:/Users/mark/Code/coveragebook/coco/app/assets/js/base|@baseComponents/**/*.js
|
24111
|
-
var modules = [button_exports, dropdown_exports, icon_exports, image_uploader_exports];
|
24194
|
+
var modules = [button_exports, dropdown_exports, icon_exports, image_uploader_exports, modal_exports, modal_dialog_exports];
|
24112
24195
|
var __default = modules;
|
24113
24196
|
|
24114
24197
|
// base/components.js
|
@@ -24247,8 +24330,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
24247
24330
|
}
|
24248
24331
|
|
24249
24332
|
// helpers/turbo_events.js
|
24250
|
-
function wasSuccessful(
|
24251
|
-
return getEventDetail(
|
24333
|
+
function wasSuccessful(event2) {
|
24334
|
+
return getEventDetail(event2).success;
|
24252
24335
|
}
|
24253
24336
|
function getEventDetail(obj) {
|
24254
24337
|
return obj instanceof CustomEvent ? obj.detail : obj;
|
@@ -24331,12 +24414,12 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
24331
24414
|
setLayout(layout) {
|
24332
24415
|
this.layout = layout;
|
24333
24416
|
},
|
24334
|
-
handleImageDrop(
|
24417
|
+
handleImageDrop(event2) {
|
24335
24418
|
this.dragging = false;
|
24336
24419
|
if (this.bgImagePicker) {
|
24337
|
-
this.bgImagePicker.handleExternalDrop(
|
24420
|
+
this.bgImagePicker.handleExternalDrop(event2);
|
24338
24421
|
} else {
|
24339
|
-
|
24422
|
+
event2.preventDefault();
|
24340
24423
|
}
|
24341
24424
|
},
|
24342
24425
|
async save() {
|
@@ -24398,9 +24481,9 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
24398
24481
|
}
|
24399
24482
|
input.files = dataTransfer.files;
|
24400
24483
|
},
|
24401
|
-
handleSlideClick(
|
24402
|
-
if (Array.from(
|
24403
|
-
|
24484
|
+
handleSlideClick(event2) {
|
24485
|
+
if (Array.from(event2.target.classList).includes("slide-text")) {
|
24486
|
+
event2.target.querySelector("textarea").focus();
|
24404
24487
|
}
|
24405
24488
|
},
|
24406
24489
|
get blankTextAreasList() {
|
@@ -25790,8 +25873,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
25790
25873
|
/* Start */
|
25791
25874
|
);
|
25792
25875
|
if (result !== false) {
|
25793
|
-
SECONDARY_EVENTS.forEach(function(
|
25794
|
-
document.addEventListener(
|
25876
|
+
SECONDARY_EVENTS.forEach(function(event2) {
|
25877
|
+
document.addEventListener(event2, this$1, { passive: false });
|
25795
25878
|
});
|
25796
25879
|
}
|
25797
25880
|
break;
|
@@ -25812,8 +25895,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
25812
25895
|
2
|
25813
25896
|
/* End */
|
25814
25897
|
);
|
25815
|
-
SECONDARY_EVENTS.forEach(function(
|
25816
|
-
document.removeEventListener(
|
25898
|
+
SECONDARY_EVENTS.forEach(function(event2) {
|
25899
|
+
document.removeEventListener(event2, this$1, { passive: false });
|
25817
25900
|
});
|
25818
25901
|
break;
|
25819
25902
|
}
|
@@ -26479,8 +26562,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
26479
26562
|
this.$root.querySelector("[data-role='image-picker'").firstElementChild
|
26480
26563
|
);
|
26481
26564
|
},
|
26482
|
-
handleExternalDrop(
|
26483
|
-
this.readFile(
|
26565
|
+
handleExternalDrop(event2) {
|
26566
|
+
this.readFile(event2.dataTransfer.files[0]);
|
26484
26567
|
},
|
26485
26568
|
readFile(file) {
|
26486
26569
|
const reader = new FileReader();
|