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
@@ -733,7 +733,7 @@ select {
|
|
733
733
|
font-family: proxima-nova, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
734
734
|
}
|
735
735
|
[data-coco].coco-button {
|
736
|
-
display:
|
736
|
+
display: flex;
|
737
737
|
width: auto;
|
738
738
|
flex: none;
|
739
739
|
-webkit-user-select: none;
|
@@ -857,7 +857,7 @@ select {
|
|
857
857
|
width: 100%;
|
858
858
|
}
|
859
859
|
[data-coco][data-component="icon"] {
|
860
|
-
display:
|
860
|
+
display: flex;
|
861
861
|
height: 1.5rem;
|
862
862
|
width: 1.5rem;
|
863
863
|
flex: none;
|
@@ -958,6 +958,104 @@ select {
|
|
958
958
|
[data-coco].coco-link[data-icon-position="end"] [data-component="icon"] {
|
959
959
|
order: 2;
|
960
960
|
}
|
961
|
+
[data-coco][data-component="modal"] {
|
962
|
+
position: fixed;
|
963
|
+
inset: 0px;
|
964
|
+
z-index: 10000;
|
965
|
+
overflow-y: auto;
|
966
|
+
}
|
967
|
+
[data-coco][data-component="modal"] .modal-overlay {
|
968
|
+
position: fixed;
|
969
|
+
inset: 0px;
|
970
|
+
background-color: rgb(0 0 0 / var(--tw-bg-opacity));
|
971
|
+
--tw-bg-opacity: 0.6;
|
972
|
+
}
|
973
|
+
[data-coco][data-component="modal"] .modal-container {
|
974
|
+
position: relative;
|
975
|
+
z-index: 10000;
|
976
|
+
display: flex;
|
977
|
+
min-height: 100vh;
|
978
|
+
align-items: center;
|
979
|
+
justify-content: center;
|
980
|
+
padding: 2rem;
|
981
|
+
}
|
982
|
+
[data-coco][data-component="modal"] .modal-content {
|
983
|
+
display: contents;
|
984
|
+
}
|
985
|
+
.modal-frame {
|
986
|
+
display: contents;
|
987
|
+
}
|
988
|
+
[data-coco][data-component="modal-dialog"] {
|
989
|
+
width: 100%;
|
990
|
+
border-radius: 0.75rem;
|
991
|
+
--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
|
992
|
+
--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);
|
993
|
+
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
994
|
+
max-width: 42rem;
|
995
|
+
}
|
996
|
+
/* temp until sizes added */
|
997
|
+
[data-coco][data-component="modal-dialog"] .modal-dialog-header {
|
998
|
+
position: relative;
|
999
|
+
display: flex;
|
1000
|
+
align-items: center;
|
1001
|
+
justify-content: center;
|
1002
|
+
height: 4rem;
|
1003
|
+
border-top-left-radius: 0.75rem;
|
1004
|
+
border-top-right-radius: 0.75rem;
|
1005
|
+
border-bottom-width: 1px;
|
1006
|
+
--tw-border-opacity: 1;
|
1007
|
+
border-color: rgb(209 213 219 / var(--tw-border-opacity));
|
1008
|
+
--tw-bg-opacity: 1;
|
1009
|
+
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
1010
|
+
padding-left: 2rem;
|
1011
|
+
padding-right: 2rem;
|
1012
|
+
}
|
1013
|
+
[data-coco][data-component="modal-dialog"] .modal-dialog-title {
|
1014
|
+
width: 100%;
|
1015
|
+
overflow: hidden;
|
1016
|
+
text-overflow: ellipsis;
|
1017
|
+
white-space: nowrap;
|
1018
|
+
padding-right: 1.5rem;
|
1019
|
+
font-size: 1.125rem;
|
1020
|
+
line-height: 1.75rem;
|
1021
|
+
font-weight: 600;
|
1022
|
+
}
|
1023
|
+
[data-coco][data-component="modal-dialog"] .modal-dialog-close {
|
1024
|
+
position: absolute;
|
1025
|
+
top: 50%;
|
1026
|
+
right: 0.75rem;
|
1027
|
+
display: block;
|
1028
|
+
flex: none;
|
1029
|
+
--tw-translate-y: -50%;
|
1030
|
+
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
1031
|
+
padding: 0.5rem;
|
1032
|
+
--tw-text-opacity: 1;
|
1033
|
+
color: rgb(156 163 175 / var(--tw-text-opacity));
|
1034
|
+
}
|
1035
|
+
[data-coco][data-component="modal-dialog"] .modal-dialog-close:hover {
|
1036
|
+
--tw-text-opacity: 1;
|
1037
|
+
color: rgb(31 41 55 / var(--tw-text-opacity));
|
1038
|
+
}
|
1039
|
+
[data-coco][data-component="modal-dialog"] .modal-dialog-close:focus {
|
1040
|
+
outline: 2px solid transparent;
|
1041
|
+
outline-offset: 2px;
|
1042
|
+
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
1043
|
+
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
1044
|
+
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
1045
|
+
}
|
1046
|
+
[data-coco][data-component="modal-dialog"] .modal-dialog-content {
|
1047
|
+
border-radius: 0.75rem;
|
1048
|
+
--tw-bg-opacity: 1;
|
1049
|
+
background-color: rgb(243 244 246 / var(--tw-bg-opacity));
|
1050
|
+
padding-left: 2rem;
|
1051
|
+
padding-right: 2rem;
|
1052
|
+
padding-top: 1.5rem;
|
1053
|
+
padding-bottom: 1.5rem;
|
1054
|
+
}
|
1055
|
+
[data-coco][data-component="modal-dialog"] .modal-dialog-header + .modal-dialog-content {
|
1056
|
+
border-top-left-radius: 0px;
|
1057
|
+
border-top-right-radius: 0px;
|
1058
|
+
}
|
961
1059
|
[data-coco][data-component="placeholder"] {
|
962
1060
|
border-width: 1px;
|
963
1061
|
border-style: dashed;
|
@@ -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, event2, 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
|
+
event2 = dotSyntax(event2);
|
9380
9380
|
if (modifiers.includes("camel"))
|
9381
|
-
|
9381
|
+
event2 = camelCase2(event2);
|
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(event2, handler3, options);
|
9432
9432
|
});
|
9433
9433
|
}
|
9434
9434
|
handler3 = wrapHandler(handler3, (next, e2) => {
|
9435
|
-
if (isKeyEvent(
|
9435
|
+
if (isKeyEvent(event2)) {
|
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(event2, handler3, options);
|
9443
9443
|
return () => {
|
9444
|
-
listenerTarget.removeEventListener(
|
9444
|
+
listenerTarget.removeEventListener(event2, 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(event2) {
|
9462
|
+
return ["keydown", "keyup"].includes(event2);
|
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 event2 = 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, event2, 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(event2, {}));
|
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, event2, currentValue) {
|
9602
9602
|
return mutateDom(() => {
|
9603
9603
|
var _a;
|
9604
|
-
if (
|
9605
|
-
return (_a =
|
9604
|
+
if (event2 instanceof CustomEvent && event2.detail !== void 0)
|
9605
|
+
return (_a = event2.detail) != null ? _a : event2.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(event2.target.value) : event2.target.value;
|
9609
|
+
return event2.target.checked ? currentValue.concat([newValue]) : currentValue.filter((el2) => !checkedAttrLooseCompare2(el2, newValue));
|
9610
9610
|
} else {
|
9611
|
-
return
|
9611
|
+
return event2.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(event2.target.selectedOptions).map((option) => {
|
9615
9615
|
let rawValue = option.value || option.text;
|
9616
9616
|
return safeParseNumber(rawValue);
|
9617
|
-
}) : Array.from(
|
9617
|
+
}) : Array.from(event2.target.selectedOptions).map((option) => {
|
9618
9618
|
return option.value || option.text;
|
9619
9619
|
});
|
9620
9620
|
} else {
|
9621
|
-
let rawValue =
|
9621
|
+
let rawValue = event2.target.value;
|
9622
9622
|
return modifiers.includes("number") ? safeParseNumber(rawValue) : modifiers.includes("trim") ? rawValue.trim() : rawValue;
|
9623
9623
|
}
|
9624
9624
|
});
|
@@ -13177,8 +13177,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
13177
13177
|
var _normalizeToArray = normalizeToArray(elementOrElements), element = _normalizeToArray[0];
|
13178
13178
|
return element != null && (_element$ownerDocumen = element.ownerDocument) != null && _element$ownerDocumen.body ? element.ownerDocument : document;
|
13179
13179
|
}
|
13180
|
-
function isCursorOutsideInteractiveBorder(popperTreeData,
|
13181
|
-
var clientX =
|
13180
|
+
function isCursorOutsideInteractiveBorder(popperTreeData, event2) {
|
13181
|
+
var clientX = event2.clientX, clientY = event2.clientY;
|
13182
13182
|
return popperTreeData.every(function(_ref) {
|
13183
13183
|
var popperRect = _ref.popperRect, popperState = _ref.popperState, props = _ref.props;
|
13184
13184
|
var interactiveBorder = props.interactiveBorder;
|
@@ -13200,8 +13200,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
13200
13200
|
}
|
13201
13201
|
function updateTransitionEndListener(box, action, listener) {
|
13202
13202
|
var method = action + "EventListener";
|
13203
|
-
["transitionend", "webkitTransitionEnd"].forEach(function(
|
13204
|
-
box[method](
|
13203
|
+
["transitionend", "webkitTransitionEnd"].forEach(function(event2) {
|
13204
|
+
box[method](event2, listener);
|
13205
13205
|
});
|
13206
13206
|
}
|
13207
13207
|
function actualContains(parent, child) {
|
@@ -13725,13 +13725,13 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
13725
13725
|
return listener !== debouncedOnMouseMove;
|
13726
13726
|
});
|
13727
13727
|
}
|
13728
|
-
function onDocumentPress(
|
13728
|
+
function onDocumentPress(event2) {
|
13729
13729
|
if (currentInput.isTouch) {
|
13730
|
-
if (didTouchMove ||
|
13730
|
+
if (didTouchMove || event2.type === "mousedown") {
|
13731
13731
|
return;
|
13732
13732
|
}
|
13733
13733
|
}
|
13734
|
-
var actualTarget =
|
13734
|
+
var actualTarget = event2.composedPath && event2.composedPath()[0] || event2.target;
|
13735
13735
|
if (instance.props.interactive && actualContains(popper2, actualTarget)) {
|
13736
13736
|
return;
|
13737
13737
|
}
|
@@ -13745,7 +13745,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
13745
13745
|
return;
|
13746
13746
|
}
|
13747
13747
|
} else {
|
13748
|
-
invokeHook("onClickOutside", [instance,
|
13748
|
+
invokeHook("onClickOutside", [instance, event2]);
|
13749
13749
|
}
|
13750
13750
|
if (instance.props.hideOnClick === true) {
|
13751
13751
|
instance.clearDelayTimeouts();
|
@@ -13791,8 +13791,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
13791
13791
|
}
|
13792
13792
|
function onTransitionEnd(duration, callback) {
|
13793
13793
|
var box = getDefaultTemplateChildren().box;
|
13794
|
-
function listener(
|
13795
|
-
if (
|
13794
|
+
function listener(event2) {
|
13795
|
+
if (event2.target === box) {
|
13796
13796
|
updateTransitionEndListener(box, "remove", listener);
|
13797
13797
|
callback();
|
13798
13798
|
}
|
@@ -13853,37 +13853,37 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
13853
13853
|
});
|
13854
13854
|
listeners = [];
|
13855
13855
|
}
|
13856
|
-
function onTrigger2(
|
13856
|
+
function onTrigger2(event2) {
|
13857
13857
|
var _lastTriggerEvent;
|
13858
13858
|
var shouldScheduleClickHide = false;
|
13859
|
-
if (!instance.state.isEnabled || isEventListenerStopped(
|
13859
|
+
if (!instance.state.isEnabled || isEventListenerStopped(event2) || didHideDueToDocumentMouseDown) {
|
13860
13860
|
return;
|
13861
13861
|
}
|
13862
13862
|
var wasFocused = ((_lastTriggerEvent = lastTriggerEvent) == null ? void 0 : _lastTriggerEvent.type) === "focus";
|
13863
|
-
lastTriggerEvent =
|
13864
|
-
currentTarget =
|
13863
|
+
lastTriggerEvent = event2;
|
13864
|
+
currentTarget = event2.currentTarget;
|
13865
13865
|
handleAriaExpandedAttribute();
|
13866
|
-
if (!instance.state.isVisible && isMouseEvent(
|
13866
|
+
if (!instance.state.isVisible && isMouseEvent(event2)) {
|
13867
13867
|
mouseMoveListeners.forEach(function(listener) {
|
13868
|
-
return listener(
|
13868
|
+
return listener(event2);
|
13869
13869
|
});
|
13870
13870
|
}
|
13871
|
-
if (
|
13871
|
+
if (event2.type === "click" && (instance.props.trigger.indexOf("mouseenter") < 0 || isVisibleFromClick) && instance.props.hideOnClick !== false && instance.state.isVisible) {
|
13872
13872
|
shouldScheduleClickHide = true;
|
13873
13873
|
} else {
|
13874
|
-
scheduleShow(
|
13874
|
+
scheduleShow(event2);
|
13875
13875
|
}
|
13876
|
-
if (
|
13876
|
+
if (event2.type === "click") {
|
13877
13877
|
isVisibleFromClick = !shouldScheduleClickHide;
|
13878
13878
|
}
|
13879
13879
|
if (shouldScheduleClickHide && !wasFocused) {
|
13880
|
-
scheduleHide(
|
13880
|
+
scheduleHide(event2);
|
13881
13881
|
}
|
13882
13882
|
}
|
13883
|
-
function onMouseMove(
|
13884
|
-
var target =
|
13883
|
+
function onMouseMove(event2) {
|
13884
|
+
var target = event2.target;
|
13885
13885
|
var isCursorOverReferenceOrPopper = getCurrentTarget().contains(target) || popper2.contains(target);
|
13886
|
-
if (
|
13886
|
+
if (event2.type === "mousemove" && isCursorOverReferenceOrPopper) {
|
13887
13887
|
return;
|
13888
13888
|
}
|
13889
13889
|
var popperTreeData = getNestedPopperTree().concat(popper2).map(function(popper3) {
|
@@ -13899,33 +13899,33 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
13899
13899
|
}
|
13900
13900
|
return null;
|
13901
13901
|
}).filter(Boolean);
|
13902
|
-
if (isCursorOutsideInteractiveBorder(popperTreeData,
|
13902
|
+
if (isCursorOutsideInteractiveBorder(popperTreeData, event2)) {
|
13903
13903
|
cleanupInteractiveMouseListeners();
|
13904
|
-
scheduleHide(
|
13904
|
+
scheduleHide(event2);
|
13905
13905
|
}
|
13906
13906
|
}
|
13907
|
-
function onMouseLeave(
|
13908
|
-
var shouldBail = isEventListenerStopped(
|
13907
|
+
function onMouseLeave(event2) {
|
13908
|
+
var shouldBail = isEventListenerStopped(event2) || instance.props.trigger.indexOf("click") >= 0 && isVisibleFromClick;
|
13909
13909
|
if (shouldBail) {
|
13910
13910
|
return;
|
13911
13911
|
}
|
13912
13912
|
if (instance.props.interactive) {
|
13913
|
-
instance.hideWithInteractivity(
|
13913
|
+
instance.hideWithInteractivity(event2);
|
13914
13914
|
return;
|
13915
13915
|
}
|
13916
|
-
scheduleHide(
|
13916
|
+
scheduleHide(event2);
|
13917
13917
|
}
|
13918
|
-
function onBlurOrFocusOut(
|
13919
|
-
if (instance.props.trigger.indexOf("focusin") < 0 &&
|
13918
|
+
function onBlurOrFocusOut(event2) {
|
13919
|
+
if (instance.props.trigger.indexOf("focusin") < 0 && event2.target !== getCurrentTarget()) {
|
13920
13920
|
return;
|
13921
13921
|
}
|
13922
|
-
if (instance.props.interactive &&
|
13922
|
+
if (instance.props.interactive && event2.relatedTarget && popper2.contains(event2.relatedTarget)) {
|
13923
13923
|
return;
|
13924
13924
|
}
|
13925
|
-
scheduleHide(
|
13925
|
+
scheduleHide(event2);
|
13926
13926
|
}
|
13927
|
-
function isEventListenerStopped(
|
13928
|
-
return currentInput.isTouch ? getIsCustomTouchBehavior() !==
|
13927
|
+
function isEventListenerStopped(event2) {
|
13928
|
+
return currentInput.isTouch ? getIsCustomTouchBehavior() !== event2.type.indexOf("touch") >= 0 : false;
|
13929
13929
|
}
|
13930
13930
|
function createPopperInstance() {
|
13931
13931
|
destroyPopperInstance();
|
@@ -14028,10 +14028,10 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
14028
14028
|
function getNestedPopperTree() {
|
14029
14029
|
return arrayFrom(popper2.querySelectorAll("[data-tippy-root]"));
|
14030
14030
|
}
|
14031
|
-
function scheduleShow(
|
14031
|
+
function scheduleShow(event2) {
|
14032
14032
|
instance.clearDelayTimeouts();
|
14033
|
-
if (
|
14034
|
-
invokeHook("onTrigger", [instance,
|
14033
|
+
if (event2) {
|
14034
|
+
invokeHook("onTrigger", [instance, event2]);
|
14035
14035
|
}
|
14036
14036
|
addDocumentPress();
|
14037
14037
|
var delay3 = getDelay(true);
|
@@ -14047,14 +14047,14 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
14047
14047
|
instance.show();
|
14048
14048
|
}
|
14049
14049
|
}
|
14050
|
-
function scheduleHide(
|
14050
|
+
function scheduleHide(event2) {
|
14051
14051
|
instance.clearDelayTimeouts();
|
14052
|
-
invokeHook("onUntrigger", [instance,
|
14052
|
+
invokeHook("onUntrigger", [instance, event2]);
|
14053
14053
|
if (!instance.state.isVisible) {
|
14054
14054
|
removeDocumentPress();
|
14055
14055
|
return;
|
14056
14056
|
}
|
14057
|
-
if (instance.props.trigger.indexOf("mouseenter") >= 0 && instance.props.trigger.indexOf("click") >= 0 && ["mouseleave", "mousemove"].indexOf(
|
14057
|
+
if (instance.props.trigger.indexOf("mouseenter") >= 0 && instance.props.trigger.indexOf("click") >= 0 && ["mouseleave", "mousemove"].indexOf(event2.type) >= 0 && isVisibleFromClick) {
|
14058
14058
|
return;
|
14059
14059
|
}
|
14060
14060
|
var delay3 = getDelay(false);
|
@@ -14227,13 +14227,13 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
14227
14227
|
instance.unmount();
|
14228
14228
|
}
|
14229
14229
|
}
|
14230
|
-
function hideWithInteractivity(
|
14230
|
+
function hideWithInteractivity(event2) {
|
14231
14231
|
if (true) {
|
14232
14232
|
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("hideWithInteractivity"));
|
14233
14233
|
}
|
14234
14234
|
getDocument().addEventListener("mousemove", debouncedOnMouseMove);
|
14235
14235
|
pushIfUnique(mouseMoveListeners, debouncedOnMouseMove);
|
14236
|
-
debouncedOnMouseMove(
|
14236
|
+
debouncedOnMouseMove(event2);
|
14237
14237
|
}
|
14238
14238
|
function unmount() {
|
14239
14239
|
if (true) {
|
@@ -14370,10 +14370,10 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
14370
14370
|
});
|
14371
14371
|
isInternalUpdate = false;
|
14372
14372
|
}
|
14373
|
-
function onMouseMove(
|
14374
|
-
var isCursorOverReference =
|
14373
|
+
function onMouseMove(event2) {
|
14374
|
+
var isCursorOverReference = event2.target ? reference2.contains(event2.target) : true;
|
14375
14375
|
var followCursor2 = instance.props.followCursor;
|
14376
|
-
var clientX =
|
14376
|
+
var clientX = event2.clientX, clientY = event2.clientY;
|
14377
14377
|
var rect = reference2.getBoundingClientRect();
|
14378
14378
|
var relativeX = clientX - rect.left;
|
14379
14379
|
var relativeY = clientY - rect.top;
|
@@ -14458,14 +14458,14 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
14458
14458
|
}
|
14459
14459
|
}
|
14460
14460
|
},
|
14461
|
-
onTrigger: function onTrigger2(_2,
|
14462
|
-
if (isMouseEvent(
|
14461
|
+
onTrigger: function onTrigger2(_2, event2) {
|
14462
|
+
if (isMouseEvent(event2)) {
|
14463
14463
|
mouseCoords = {
|
14464
|
-
clientX:
|
14465
|
-
clientY:
|
14464
|
+
clientX: event2.clientX,
|
14465
|
+
clientY: event2.clientY
|
14466
14466
|
};
|
14467
14467
|
}
|
14468
|
-
wasFocusEvent =
|
14468
|
+
wasFocusEvent = event2.type === "focus";
|
14469
14469
|
},
|
14470
14470
|
onHidden: function onHidden2() {
|
14471
14471
|
if (instance.props.followCursor) {
|
@@ -14487,8 +14487,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
14487
14487
|
name: "hideOnEsc",
|
14488
14488
|
defaultValue: true,
|
14489
14489
|
fn({ hide: hide2 }) {
|
14490
|
-
function onKeyDown(
|
14491
|
-
if (
|
14490
|
+
function onKeyDown(event2) {
|
14491
|
+
if (event2.keyCode === 27) {
|
14492
14492
|
hide2();
|
14493
14493
|
}
|
14494
14494
|
}
|
@@ -14769,8 +14769,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
14769
14769
|
clearAutoDismiss() {
|
14770
14770
|
clearTimeout(notification.dismissTimer);
|
14771
14771
|
},
|
14772
|
-
clearFromQueue(
|
14773
|
-
if (notification.type ===
|
14772
|
+
clearFromQueue(event2) {
|
14773
|
+
if (notification.type === event2.detail.type && notification.position === "fixed" && notification.id !== event2.detail.id && notification.queuePosition < event2.detail.queuePosition) {
|
14774
14774
|
notification.dismiss();
|
14775
14775
|
}
|
14776
14776
|
}
|
@@ -15015,15 +15015,15 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
15015
15015
|
}
|
15016
15016
|
},
|
15017
15017
|
/* confirmation */
|
15018
|
-
checkConfirmation(
|
15018
|
+
checkConfirmation(event2) {
|
15019
15019
|
if (!this.confirmed) {
|
15020
15020
|
this.approving = true;
|
15021
|
-
|
15021
|
+
event2.preventDefault();
|
15022
15022
|
}
|
15023
15023
|
},
|
15024
|
-
approveAndRun(
|
15024
|
+
approveAndRun(event2) {
|
15025
15025
|
if (this.approving) {
|
15026
|
-
|
15026
|
+
event2.stopPropagation();
|
15027
15027
|
this.confirmed = true;
|
15028
15028
|
this.dropdown.trigger.click();
|
15029
15029
|
this.dropdown.hide();
|
@@ -15031,9 +15031,9 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
15031
15031
|
this.approving = false;
|
15032
15032
|
}
|
15033
15033
|
},
|
15034
|
-
cancelConfirmation(
|
15034
|
+
cancelConfirmation(event2) {
|
15035
15035
|
if (this.approving) {
|
15036
|
-
|
15036
|
+
event2.stopPropagation();
|
15037
15037
|
this.approving = false;
|
15038
15038
|
this.dropdown.hide();
|
15039
15039
|
}
|
@@ -15183,8 +15183,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
15183
15183
|
this.file = null;
|
15184
15184
|
this.$dispatch("image-uploader:clear");
|
15185
15185
|
},
|
15186
|
-
handleDrop(
|
15187
|
-
const files =
|
15186
|
+
handleDrop(event2) {
|
15187
|
+
const files = event2.detail.files || event2.dataTransfer.files;
|
15188
15188
|
this.handleFiles(files);
|
15189
15189
|
},
|
15190
15190
|
handleFiles(files) {
|
@@ -15210,8 +15210,91 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
15210
15210
|
};
|
15211
15211
|
});
|
15212
15212
|
|
15213
|
+
// ../../components/coco/base/modal/modal.js
|
15214
|
+
var modal_exports = {};
|
15215
|
+
__export(modal_exports, {
|
15216
|
+
default: () => modal_default
|
15217
|
+
});
|
15218
|
+
var modal_default = CocoComponent("modal", () => {
|
15219
|
+
return {
|
15220
|
+
open: false,
|
15221
|
+
frame: null,
|
15222
|
+
options: ["dismissable", "closeOnSubmit"],
|
15223
|
+
init() {
|
15224
|
+
this.onFrameSubmitEnd = this.onFrameSubmitEnd.bind(this);
|
15225
|
+
this.frame = this.$el.closest("turbo-frame");
|
15226
|
+
this.frame.addEventListener("turbo:submit-end", this.onFrameSubmitEnd);
|
15227
|
+
this.$nextTick(() => this.show());
|
15228
|
+
},
|
15229
|
+
show() {
|
15230
|
+
this.open = true;
|
15231
|
+
},
|
15232
|
+
hide() {
|
15233
|
+
this.open = false;
|
15234
|
+
setTimeout(() => this.clearFrame(), 100);
|
15235
|
+
},
|
15236
|
+
dismiss(event2) {
|
15237
|
+
if (this.$options.dismissable)
|
15238
|
+
this.hide();
|
15239
|
+
},
|
15240
|
+
clearFrame() {
|
15241
|
+
this.frame.removeAttribute("src");
|
15242
|
+
this.frame.removeAttribute("complete");
|
15243
|
+
this.frame.innerHTML = "";
|
15244
|
+
},
|
15245
|
+
onFrameSubmitEnd() {
|
15246
|
+
if (this.$options.closeOnSubmit && event.detail.success) {
|
15247
|
+
this.hide();
|
15248
|
+
}
|
15249
|
+
},
|
15250
|
+
destroy() {
|
15251
|
+
this.frame.removeEventListener("turbo:submit-end", this.onFrameSubmitEnd);
|
15252
|
+
},
|
15253
|
+
root: {
|
15254
|
+
"x-options": "options",
|
15255
|
+
"x-show": "open",
|
15256
|
+
"@keydown.escape.document": "dismiss",
|
15257
|
+
"@modal:hide.document": "hide"
|
15258
|
+
}
|
15259
|
+
};
|
15260
|
+
});
|
15261
|
+
|
15262
|
+
// ../../components/coco/base/modal_dialog/modal_dialog.js
|
15263
|
+
var modal_dialog_exports = {};
|
15264
|
+
__export(modal_dialog_exports, {
|
15265
|
+
default: () => modal_dialog_default
|
15266
|
+
});
|
15267
|
+
var modal_dialog_default = CocoComponent("modalDialog", () => {
|
15268
|
+
return {
|
15269
|
+
frame: null,
|
15270
|
+
init() {
|
15271
|
+
this.onFrameLoad = this.onFrameLoad.bind(this);
|
15272
|
+
this.frame = this.$el.closest("turbo-frame");
|
15273
|
+
if (this.frame) {
|
15274
|
+
this.frame.addEventListener("turbo:frame-load", this.onFrameLoad);
|
15275
|
+
}
|
15276
|
+
},
|
15277
|
+
close() {
|
15278
|
+
this.$dispatch("modal:hide");
|
15279
|
+
},
|
15280
|
+
onFrameLoad() {
|
15281
|
+
this.$focus.focus(this.firstInput);
|
15282
|
+
},
|
15283
|
+
destroy() {
|
15284
|
+
if (this.frame) {
|
15285
|
+
this.frame.removeEventListener("turbo:frame-load", this.onFrameLoad);
|
15286
|
+
}
|
15287
|
+
},
|
15288
|
+
get firstInput() {
|
15289
|
+
return this.$root.querySelector(
|
15290
|
+
"input:not([type=hidden]), textarea, select"
|
15291
|
+
);
|
15292
|
+
}
|
15293
|
+
};
|
15294
|
+
});
|
15295
|
+
|
15213
15296
|
// import-glob:/Users/mark/Code/coveragebook/coco/app/assets/js/base|@baseComponents/**/*.js
|
15214
|
-
var modules = [button_exports, dropdown_exports, icon_exports, image_uploader_exports];
|
15297
|
+
var modules = [button_exports, dropdown_exports, icon_exports, image_uploader_exports, modal_exports, modal_dialog_exports];
|
15215
15298
|
var __default = modules;
|
15216
15299
|
|
15217
15300
|
// base/components.js
|
@@ -1,6 +1,6 @@
|
|
1
1
|
@layer components {
|
2
2
|
[data-coco].coco-button {
|
3
|
-
@apply
|
3
|
+
@apply flex transition-colors w-auto bg-transparent text-current border border-transparent select-none flex-none;
|
4
4
|
width: min-content;
|
5
5
|
|
6
6
|
.button-element {
|
@@ -0,0 +1,21 @@
|
|
1
|
+
@layer components {
|
2
|
+
[data-coco][data-component="modal"] {
|
3
|
+
@apply fixed inset-0 z-[10000] overflow-y-auto;
|
4
|
+
|
5
|
+
.modal-overlay {
|
6
|
+
@apply fixed inset-0 bg-black bg-opacity-60;
|
7
|
+
}
|
8
|
+
|
9
|
+
.modal-container {
|
10
|
+
@apply relative flex min-h-screen justify-center items-center z-[10000] p-8;
|
11
|
+
}
|
12
|
+
|
13
|
+
.modal-content {
|
14
|
+
@apply contents;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
.modal-frame {
|
19
|
+
@apply contents;
|
20
|
+
}
|
21
|
+
}
|