coveragebook_components 0.8.8 → 0.9.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 +292 -245
- data/app/assets/build/coco/app.js +64 -34
- data/app/assets/build/coco/book.css +67 -18
- data/app/assets/build/coco/book.js +50 -21
- data/app/assets/js/libs/alpine/directives/dropdown.js +5 -2
- data/app/components/coco/app/elements/alert/alert.css +1 -1
- data/app/components/coco/app/elements/button/button.css +38 -58
- data/app/components/coco/app/elements/button/button.rb +2 -3
- data/app/components/coco/app/elements/button_group/button_group.css +7 -2
- data/app/components/coco/app/elements/button_group/button_group.html.erb +2 -1
- data/app/components/coco/app/elements/button_group/button_group.js +28 -14
- data/app/components/coco/app/elements/button_to/button_to.css +4 -8
- data/app/components/coco/app/elements/color_picker_button/color_picker_button.css +1 -2
- data/app/components/coco/app/elements/image_picker_button/image_picker_button.css +1 -2
- data/app/components/coco/app/elements/layout_picker_button/layout_picker_button.css +1 -2
- data/app/components/coco/app/elements/menu/menu.css +7 -5
- data/app/components/coco/app/elements/menu_button/menu_button.css +1 -2
- data/app/components/coco/app/elements/snackbar/snackbar.css +3 -3
- data/app/components/coco/base/button/button.css +9 -9
- data/app/components/coco/base/button/button.html.erb +16 -18
- data/app/components/coco/base/button/button.js +6 -18
- data/app/components/coco/base/button/button.rb +38 -58
- data/app/components/coco/base/button/button_dropdown.js +27 -0
- data/app/components/coco/base/modal/modal.css +12 -0
- data/app/components/coco/base/modal/modal.html.erb +11 -1
- data/app/components/coco/base/modal/modal.rb +4 -1
- data/app/components/coco/base/modal_dialog/modal_dialog.css +6 -2
- data/app/components/coco/base/panel/panel.css +19 -0
- data/app/components/coco/base/panel/panel.html.erb +5 -0
- data/app/components/coco/base/panel/panel.rb +4 -0
- data/app/helpers/coco/app_helper.rb +4 -0
- data/lib/coco.rb +1 -1
- metadata +6 -2
@@ -14044,7 +14044,7 @@
|
|
14044
14044
|
var package_default = {
|
14045
14045
|
name: "coveragebook-components",
|
14046
14046
|
type: "module",
|
14047
|
-
version: "0.
|
14047
|
+
version: "0.9.0",
|
14048
14048
|
main: "index.js",
|
14049
14049
|
repository: "git@github.com:coveragebook/coco.git",
|
14050
14050
|
author: "Mark Perkins <mark@coveragebook.com>",
|
@@ -23835,10 +23835,11 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
23835
23835
|
const settings = tippyModifiers(modifiers);
|
23836
23836
|
const result = expression ? evaluate2(expression) : {};
|
23837
23837
|
const directiveConfig = isObject2(result) ? result : {};
|
23838
|
-
let _a = directiveConfig, { triggerTarget, contentTarget } = _a, config = __objRest(_a, ["triggerTarget", "contentTarget"]);
|
23838
|
+
let _a = directiveConfig, { triggerTarget, contentTarget, anchorTarget } = _a, config = __objRest(_a, ["triggerTarget", "contentTarget", "anchorTarget"]);
|
23839
23839
|
contentTarget = contentTarget || el.querySelector("[x-dropdown\\:content]");
|
23840
23840
|
content = isNode(contentTarget) ? contentTarget.firstElementChild : contentTarget;
|
23841
23841
|
triggerTarget = triggerTarget || el.querySelector("[x-dropdown\\:trigger]") || el;
|
23842
|
+
anchorTarget = anchorTarget || el.querySelector("[x-dropdown\\:anchor]") || el;
|
23842
23843
|
if (!el.__x_dropdown) {
|
23843
23844
|
const mixin = Alpine3.reactive({
|
23844
23845
|
dropdown: {
|
@@ -23854,7 +23855,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
23854
23855
|
}
|
23855
23856
|
});
|
23856
23857
|
setData(el, mixin);
|
23857
|
-
const dropdown = el.__x_dropdown = tippy_default(
|
23858
|
+
const dropdown = el.__x_dropdown = tippy_default(anchorTarget, __spreadValues(__spreadValues({
|
23858
23859
|
theme: "coco-app-dropdown",
|
23859
23860
|
placement: "bottom-start",
|
23860
23861
|
offset: [0, 0],
|
@@ -24074,11 +24075,13 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
24074
24075
|
confirmed: true,
|
24075
24076
|
lastState: null,
|
24076
24077
|
stateTooltips: data2.tooltips || {},
|
24077
|
-
tooltipText: null
|
24078
|
-
dropdown: null
|
24078
|
+
tooltipText: null
|
24079
24079
|
}, data2.props || {}), {
|
24080
24080
|
init() {
|
24081
24081
|
this.lastState = this.state;
|
24082
|
+
this.checkConfirmation = this.checkConfirmation.bind(this);
|
24083
|
+
this.approveAndRun = this.approveAndRun.bind(this);
|
24084
|
+
this.shouldShowTooltip = this.shouldShowTooltip.bind(this);
|
24082
24085
|
this.$nextTick(() => {
|
24083
24086
|
if (this.$options.confirm) {
|
24084
24087
|
this.confirmed = false;
|
@@ -24106,7 +24109,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
24106
24109
|
this.tooltipText = tooltipForState || defaultContent;
|
24107
24110
|
}
|
24108
24111
|
},
|
24109
|
-
|
24112
|
+
shouldShowTooltip() {
|
24110
24113
|
return !!this.tooltipText;
|
24111
24114
|
},
|
24112
24115
|
get disabled() {
|
@@ -24115,16 +24118,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
24115
24118
|
set disabled(value) {
|
24116
24119
|
this.$options.disabled = value;
|
24117
24120
|
},
|
24118
|
-
|
24119
|
-
|
24120
|
-
if (this.dropdown) {
|
24121
|
-
this.dropdown.hide();
|
24122
|
-
}
|
24123
|
-
},
|
24124
|
-
showDropdown() {
|
24125
|
-
if (this.dropdown) {
|
24126
|
-
this.dropdown.show();
|
24127
|
-
}
|
24121
|
+
get tippyInstance() {
|
24122
|
+
return this.$root.__x_tippy;
|
24128
24123
|
},
|
24129
24124
|
/* confirmation */
|
24130
24125
|
checkConfirmation(event) {
|
@@ -24204,15 +24199,38 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
24204
24199
|
root: {
|
24205
24200
|
"x-options": "options",
|
24206
24201
|
"x-tooltip": "tooltipText",
|
24207
|
-
"x-effect": "setTooltipText"
|
24208
|
-
"@confirmation:confirm": "approveAndRun",
|
24209
|
-
"@confirmation:cancel": "cancelConfirmation",
|
24210
|
-
"@dropdown:show": "setState('active')",
|
24211
|
-
"@dropdown:hide": "resetState()"
|
24202
|
+
"x-effect": "setTooltipText"
|
24212
24203
|
}
|
24213
24204
|
});
|
24214
24205
|
});
|
24215
24206
|
|
24207
|
+
// ../../components/coco/base/button/button_dropdown.js
|
24208
|
+
var button_dropdown_exports = {};
|
24209
|
+
__export(button_dropdown_exports, {
|
24210
|
+
default: () => button_dropdown_default
|
24211
|
+
});
|
24212
|
+
var button_dropdown_default = CocoComponent("buttonDropdown", (data2 = {}) => {
|
24213
|
+
return {
|
24214
|
+
dropdown: null,
|
24215
|
+
button: null,
|
24216
|
+
init() {
|
24217
|
+
this.$nextTick(() => {
|
24218
|
+
this.button = getComponent(this.$el.querySelector(".coco-button"));
|
24219
|
+
});
|
24220
|
+
},
|
24221
|
+
hideDropdown() {
|
24222
|
+
if (this.dropdown) {
|
24223
|
+
this.dropdown.hide();
|
24224
|
+
}
|
24225
|
+
},
|
24226
|
+
showDropdown() {
|
24227
|
+
if (this.dropdown) {
|
24228
|
+
this.dropdown.show();
|
24229
|
+
}
|
24230
|
+
}
|
24231
|
+
};
|
24232
|
+
});
|
24233
|
+
|
24216
24234
|
// ../../components/coco/base/dropdown/dropdown.js
|
24217
24235
|
var dropdown_exports = {};
|
24218
24236
|
__export(dropdown_exports, {
|
@@ -24544,7 +24562,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
24544
24562
|
}
|
24545
24563
|
|
24546
24564
|
// import-glob:/Users/mark/Code/coveragebook/coco/app/assets/js/base|@baseComponents/**/*.js
|
24547
|
-
var modules = [button_exports, dropdown_exports, icon_exports, image_uploader_exports, modal_exports, modal_dialog_exports, modal_lightbox_exports, poll_controller_exports];
|
24565
|
+
var modules = [button_exports, button_dropdown_exports, dropdown_exports, icon_exports, image_uploader_exports, modal_exports, modal_dialog_exports, modal_lightbox_exports, poll_controller_exports];
|
24548
24566
|
var __default = modules;
|
24549
24567
|
|
24550
24568
|
// base/components.js
|
@@ -25072,10 +25090,12 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
25072
25090
|
var button_group_default = CocoComponent("appButtonGroup", () => {
|
25073
25091
|
return {
|
25074
25092
|
options: ["collapsible"],
|
25093
|
+
ready: false,
|
25075
25094
|
containerWidth: 0,
|
25076
25095
|
contentWidth: 0,
|
25077
25096
|
collapsed: false,
|
25078
|
-
|
25097
|
+
singletonTooltip: null,
|
25098
|
+
tooltipInstances: [],
|
25079
25099
|
get collapsible() {
|
25080
25100
|
return this.$options.collapsible !== false;
|
25081
25101
|
},
|
@@ -25083,7 +25103,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
25083
25103
|
const buttonElements = this.$el.querySelectorAll(
|
25084
25104
|
"[data-component='app-button']"
|
25085
25105
|
);
|
25086
|
-
return Array.from(buttonElements).map((el) =>
|
25106
|
+
return Array.from(buttonElements).map((el) => getComponent(el));
|
25087
25107
|
},
|
25088
25108
|
get parent() {
|
25089
25109
|
return this.$root.parentElement;
|
@@ -25092,24 +25112,34 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
25092
25112
|
this.$nextTick(() => {
|
25093
25113
|
if (!this.collapsible)
|
25094
25114
|
return;
|
25095
|
-
this.
|
25115
|
+
this.ready = true;
|
25096
25116
|
this.onResize();
|
25117
|
+
this.createSingletonTooltip();
|
25097
25118
|
});
|
25098
25119
|
this.$watch("collapsed", (value) => {
|
25099
25120
|
this.buttons.forEach((button) => {
|
25100
25121
|
button.isCollapsed = value;
|
25101
25122
|
});
|
25123
|
+
this.$nextTick(() => this.createSingletonTooltip());
|
25102
25124
|
});
|
25103
25125
|
},
|
25104
|
-
|
25105
|
-
|
25106
|
-
|
25107
|
-
|
25108
|
-
this.tooltip = createSingleton(tippys, {
|
25126
|
+
createSingletonTooltip() {
|
25127
|
+
this.destroySingletonTooltip();
|
25128
|
+
this.tooltipInstances = this.buttons.map((button) => button.shouldShowTooltip() && button.tippyInstance).filter((t3) => t3);
|
25129
|
+
this.singletonTooltip = createSingleton(this.tooltipInstances, {
|
25109
25130
|
theme: "coco-tooltip",
|
25110
|
-
|
25131
|
+
delay: 100,
|
25132
|
+
moveTransition: "transform 0.1s ease-out"
|
25111
25133
|
});
|
25112
25134
|
},
|
25135
|
+
destroySingletonTooltip() {
|
25136
|
+
if (this.singletonTooltip && this.singletonTooltip.destroy) {
|
25137
|
+
this.singletonTooltip.destroy();
|
25138
|
+
this.singletonTooltip = null;
|
25139
|
+
this.tooltipInstances.forEach((tooltip) => tooltip.destroy());
|
25140
|
+
this.tooltipInstances = [];
|
25141
|
+
}
|
25142
|
+
},
|
25113
25143
|
onResize() {
|
25114
25144
|
if (!this.collapsible)
|
25115
25145
|
return;
|
@@ -25128,9 +25158,9 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
25128
25158
|
}
|
25129
25159
|
},
|
25130
25160
|
destroy() {
|
25131
|
-
if (this.
|
25132
|
-
this.
|
25133
|
-
this.
|
25161
|
+
if (this.singletonTooltip) {
|
25162
|
+
this.singletonTooltip.destroy();
|
25163
|
+
this.singletonTooltip = null;
|
25134
25164
|
}
|
25135
25165
|
}
|
25136
25166
|
};
|
@@ -777,6 +777,9 @@ select {
|
|
777
777
|
height: 2rem;
|
778
778
|
width: 2rem;
|
779
779
|
}
|
780
|
+
.coco-button-wrapper {
|
781
|
+
display: contents !important;
|
782
|
+
}
|
780
783
|
[data-coco].coco-button {
|
781
784
|
display: flex;
|
782
785
|
width: auto;
|
@@ -788,22 +791,20 @@ select {
|
|
788
791
|
border-color: transparent;
|
789
792
|
background-color: transparent;
|
790
793
|
color: currentColor;
|
791
|
-
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
|
792
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
793
|
-
transition-duration: 150ms;
|
794
|
-
width: -moz-min-content;
|
795
|
-
width: min-content;
|
796
|
-
}
|
797
|
-
[data-coco].coco-button .button-element {
|
798
|
-
display: inline-flex;
|
799
|
-
width: 100%;
|
800
794
|
text-decoration-line: none;
|
801
795
|
outline: 2px solid transparent;
|
802
796
|
outline-offset: 2px;
|
797
|
+
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
|
798
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
799
|
+
transition-duration: 150ms;
|
803
800
|
}
|
804
|
-
[data-coco].coco-button
|
801
|
+
[data-coco].coco-button:focus-visible {
|
805
802
|
outline-width: 0px;
|
806
803
|
}
|
804
|
+
[data-coco].coco-button {
|
805
|
+
width: -moz-min-content;
|
806
|
+
width: min-content;
|
807
|
+
}
|
807
808
|
[data-coco].coco-button .button-inner {
|
808
809
|
margin-left: auto;
|
809
810
|
margin-right: auto;
|
@@ -838,7 +839,7 @@ select {
|
|
838
839
|
order: 3;
|
839
840
|
}
|
840
841
|
/* disabled */
|
841
|
-
[data-coco].coco-button[data-disabled="true"]
|
842
|
+
[data-coco].coco-button[data-disabled="true"] {
|
842
843
|
pointer-events: none;
|
843
844
|
cursor: not-allowed;
|
844
845
|
}
|
@@ -849,7 +850,7 @@ select {
|
|
849
850
|
transform: rotate(360deg);
|
850
851
|
}
|
851
852
|
}
|
852
|
-
[data-coco].coco-button[data-state="loading"]
|
853
|
+
[data-coco].coco-button[data-state="loading"] .button-icon {
|
853
854
|
animation: spin 1.5s linear infinite;
|
854
855
|
}
|
855
856
|
/* Fit */
|
@@ -857,16 +858,16 @@ select {
|
|
857
858
|
width: 100%;
|
858
859
|
}
|
859
860
|
/* Icons */
|
860
|
-
[data-coco].coco-button[data-icon-position="end"]
|
861
|
+
[data-coco].coco-button[data-icon-position="end"] .button-content {
|
861
862
|
order: 1;
|
862
863
|
}
|
863
|
-
[data-coco].coco-button[data-icon-position="end"]
|
864
|
+
[data-coco].coco-button[data-icon-position="end"] .button-icon {
|
864
865
|
order: 2;
|
865
866
|
}
|
866
|
-
[data-coco].coco-button[data-icon-position="end"]
|
867
|
+
[data-coco].coco-button[data-icon-position="end"] .button-toggle {
|
867
868
|
order: 3;
|
868
869
|
}
|
869
|
-
[data-coco].coco-button.with-icon[data-collapsed="true"]
|
870
|
+
[data-coco].coco-button.with-icon[data-collapsed="true"] .button-content {
|
870
871
|
display: none;
|
871
872
|
}
|
872
873
|
[data-coco][data-component="dropdown"] {
|
@@ -1128,15 +1129,34 @@ select {
|
|
1128
1129
|
.modal-frame {
|
1129
1130
|
display: contents;
|
1130
1131
|
}
|
1132
|
+
/*
|
1133
|
+
Limit the size of modal content when rendered in the
|
1134
|
+
host page rather than displayed as a modal.
|
1135
|
+
*/
|
1136
|
+
[data-role="inline-modal-content"] {
|
1137
|
+
margin-left: auto;
|
1138
|
+
margin-right: auto;
|
1139
|
+
max-width: 42rem;
|
1140
|
+
}
|
1141
|
+
[data-role="inline-modal-content"] [data-component="modal-dialog"] {
|
1142
|
+
border-radius: 0.75rem;
|
1143
|
+
border-width: 1px;
|
1144
|
+
--tw-border-opacity: 1;
|
1145
|
+
border-color: rgb(209 213 219 / var(--tw-border-opacity));
|
1146
|
+
--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
|
1147
|
+
--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);
|
1148
|
+
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
1149
|
+
}
|
1131
1150
|
[data-coco][data-component="modal-dialog"] {
|
1132
1151
|
width: 100%;
|
1133
1152
|
border-radius: 0.75rem;
|
1153
|
+
}
|
1154
|
+
.modal-frame [data-coco][data-component="modal-dialog"] {
|
1134
1155
|
--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
|
1135
1156
|
--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);
|
1136
1157
|
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
1137
|
-
max-width: 42rem;
|
1158
|
+
max-width: 42rem; /* temp until sizes added */
|
1138
1159
|
}
|
1139
|
-
/* temp until sizes added */
|
1140
1160
|
[data-coco][data-component="modal-dialog"] .modal-dialog-header {
|
1141
1161
|
position: relative;
|
1142
1162
|
display: flex;
|
@@ -1360,6 +1380,29 @@ select {
|
|
1360
1380
|
[data-coco][data-component="pager-link"][data-direction="next"] .coco-icon {
|
1361
1381
|
margin-right: -0.25rem;
|
1362
1382
|
}
|
1383
|
+
[data-coco][data-component="panel"] {
|
1384
|
+
display: contents;
|
1385
|
+
}
|
1386
|
+
[data-coco][data-component="panel"] .panel-content {
|
1387
|
+
display: contents;
|
1388
|
+
}
|
1389
|
+
/* Only style Coco panels that are not rendered inside legacy panel components */
|
1390
|
+
[data-coco][data-component="panel"]:not([data-component="panel"] [data-component="panel"]) {
|
1391
|
+
display: block;
|
1392
|
+
border-radius: 0.75rem;
|
1393
|
+
border-width: 1px;
|
1394
|
+
--tw-border-opacity: 1;
|
1395
|
+
border-color: rgb(209 213 219 / var(--tw-border-opacity));
|
1396
|
+
--tw-bg-opacity: 1;
|
1397
|
+
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
1398
|
+
--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
|
1399
|
+
--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);
|
1400
|
+
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
1401
|
+
}
|
1402
|
+
[data-coco][data-component="panel"]:not([data-component="panel"] [data-component="panel"]) .panel-content {
|
1403
|
+
display: block;
|
1404
|
+
padding: max(min(5%, 2rem), 1rem);
|
1405
|
+
}
|
1363
1406
|
[data-coco][data-component="placeholder"] {
|
1364
1407
|
padding: 1rem;
|
1365
1408
|
}
|
@@ -1896,6 +1939,9 @@ select {
|
|
1896
1939
|
.hidden {
|
1897
1940
|
display: none;
|
1898
1941
|
}
|
1942
|
+
.transform {
|
1943
|
+
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));
|
1944
|
+
}
|
1899
1945
|
.resize {
|
1900
1946
|
resize: both;
|
1901
1947
|
}
|
@@ -1924,6 +1970,9 @@ select {
|
|
1924
1970
|
.filter {
|
1925
1971
|
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
1926
1972
|
}
|
1973
|
+
.ease-out {
|
1974
|
+
transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
|
1975
|
+
}
|
1927
1976
|
/* Transparent gray blend-mode background utilities */
|
1928
1977
|
.\!icon {
|
1929
1978
|
}
|
@@ -11815,6 +11815,17 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
11815
11815
|
});
|
11816
11816
|
return components;
|
11817
11817
|
}
|
11818
|
+
function getComponent(el, throwOnError = false) {
|
11819
|
+
try {
|
11820
|
+
return Alpine.$data(el);
|
11821
|
+
} catch (error2) {
|
11822
|
+
if (throwOnError) {
|
11823
|
+
throw error2;
|
11824
|
+
} else {
|
11825
|
+
return null;
|
11826
|
+
}
|
11827
|
+
}
|
11828
|
+
}
|
11818
11829
|
function getData(el) {
|
11819
11830
|
const root = Alpine.closestRoot(el);
|
11820
11831
|
return root ? Alpine.$data(root) : null;
|
@@ -15061,10 +15072,11 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
15061
15072
|
const settings = tippyModifiers(modifiers);
|
15062
15073
|
const result = expression ? evaluate2(expression) : {};
|
15063
15074
|
const directiveConfig = isObject2(result) ? result : {};
|
15064
|
-
let _a = directiveConfig, { triggerTarget, contentTarget } = _a, config = __objRest(_a, ["triggerTarget", "contentTarget"]);
|
15075
|
+
let _a = directiveConfig, { triggerTarget, contentTarget, anchorTarget } = _a, config = __objRest(_a, ["triggerTarget", "contentTarget", "anchorTarget"]);
|
15065
15076
|
contentTarget = contentTarget || el.querySelector("[x-dropdown\\:content]");
|
15066
15077
|
content = isNode(contentTarget) ? contentTarget.firstElementChild : contentTarget;
|
15067
15078
|
triggerTarget = triggerTarget || el.querySelector("[x-dropdown\\:trigger]") || el;
|
15079
|
+
anchorTarget = anchorTarget || el.querySelector("[x-dropdown\\:anchor]") || el;
|
15068
15080
|
if (!el.__x_dropdown) {
|
15069
15081
|
const mixin = Alpine3.reactive({
|
15070
15082
|
dropdown: {
|
@@ -15080,7 +15092,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
15080
15092
|
}
|
15081
15093
|
});
|
15082
15094
|
setData(el, mixin);
|
15083
|
-
const dropdown = el.__x_dropdown = tippy_default(
|
15095
|
+
const dropdown = el.__x_dropdown = tippy_default(anchorTarget, __spreadValues(__spreadValues({
|
15084
15096
|
theme: "coco-app-dropdown",
|
15085
15097
|
placement: "bottom-start",
|
15086
15098
|
offset: [0, 0],
|
@@ -15272,11 +15284,13 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
15272
15284
|
confirmed: true,
|
15273
15285
|
lastState: null,
|
15274
15286
|
stateTooltips: data2.tooltips || {},
|
15275
|
-
tooltipText: null
|
15276
|
-
dropdown: null
|
15287
|
+
tooltipText: null
|
15277
15288
|
}, data2.props || {}), {
|
15278
15289
|
init() {
|
15279
15290
|
this.lastState = this.state;
|
15291
|
+
this.checkConfirmation = this.checkConfirmation.bind(this);
|
15292
|
+
this.approveAndRun = this.approveAndRun.bind(this);
|
15293
|
+
this.shouldShowTooltip = this.shouldShowTooltip.bind(this);
|
15280
15294
|
this.$nextTick(() => {
|
15281
15295
|
if (this.$options.confirm) {
|
15282
15296
|
this.confirmed = false;
|
@@ -15304,7 +15318,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
15304
15318
|
this.tooltipText = tooltipForState || defaultContent;
|
15305
15319
|
}
|
15306
15320
|
},
|
15307
|
-
|
15321
|
+
shouldShowTooltip() {
|
15308
15322
|
return !!this.tooltipText;
|
15309
15323
|
},
|
15310
15324
|
get disabled() {
|
@@ -15313,16 +15327,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
15313
15327
|
set disabled(value) {
|
15314
15328
|
this.$options.disabled = value;
|
15315
15329
|
},
|
15316
|
-
|
15317
|
-
|
15318
|
-
if (this.dropdown) {
|
15319
|
-
this.dropdown.hide();
|
15320
|
-
}
|
15321
|
-
},
|
15322
|
-
showDropdown() {
|
15323
|
-
if (this.dropdown) {
|
15324
|
-
this.dropdown.show();
|
15325
|
-
}
|
15330
|
+
get tippyInstance() {
|
15331
|
+
return this.$root.__x_tippy;
|
15326
15332
|
},
|
15327
15333
|
/* confirmation */
|
15328
15334
|
checkConfirmation(event) {
|
@@ -15402,15 +15408,38 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
15402
15408
|
root: {
|
15403
15409
|
"x-options": "options",
|
15404
15410
|
"x-tooltip": "tooltipText",
|
15405
|
-
"x-effect": "setTooltipText"
|
15406
|
-
"@confirmation:confirm": "approveAndRun",
|
15407
|
-
"@confirmation:cancel": "cancelConfirmation",
|
15408
|
-
"@dropdown:show": "setState('active')",
|
15409
|
-
"@dropdown:hide": "resetState()"
|
15411
|
+
"x-effect": "setTooltipText"
|
15410
15412
|
}
|
15411
15413
|
});
|
15412
15414
|
});
|
15413
15415
|
|
15416
|
+
// ../../components/coco/base/button/button_dropdown.js
|
15417
|
+
var button_dropdown_exports = {};
|
15418
|
+
__export(button_dropdown_exports, {
|
15419
|
+
default: () => button_dropdown_default
|
15420
|
+
});
|
15421
|
+
var button_dropdown_default = CocoComponent("buttonDropdown", (data2 = {}) => {
|
15422
|
+
return {
|
15423
|
+
dropdown: null,
|
15424
|
+
button: null,
|
15425
|
+
init() {
|
15426
|
+
this.$nextTick(() => {
|
15427
|
+
this.button = getComponent(this.$el.querySelector(".coco-button"));
|
15428
|
+
});
|
15429
|
+
},
|
15430
|
+
hideDropdown() {
|
15431
|
+
if (this.dropdown) {
|
15432
|
+
this.dropdown.hide();
|
15433
|
+
}
|
15434
|
+
},
|
15435
|
+
showDropdown() {
|
15436
|
+
if (this.dropdown) {
|
15437
|
+
this.dropdown.show();
|
15438
|
+
}
|
15439
|
+
}
|
15440
|
+
};
|
15441
|
+
});
|
15442
|
+
|
15414
15443
|
// ../../components/coco/base/dropdown/dropdown.js
|
15415
15444
|
var dropdown_exports = {};
|
15416
15445
|
__export(dropdown_exports, {
|
@@ -15755,7 +15784,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
|
|
15755
15784
|
}
|
15756
15785
|
|
15757
15786
|
// import-glob:/Users/mark/Code/coveragebook/coco/app/assets/js/base|@baseComponents/**/*.js
|
15758
|
-
var modules = [button_exports, dropdown_exports, icon_exports, image_uploader_exports, modal_exports, modal_dialog_exports, modal_lightbox_exports, poll_controller_exports];
|
15787
|
+
var modules = [button_exports, button_dropdown_exports, dropdown_exports, icon_exports, image_uploader_exports, modal_exports, modal_dialog_exports, modal_lightbox_exports, poll_controller_exports];
|
15759
15788
|
var __default = modules;
|
15760
15789
|
|
15761
15790
|
// base/components.js
|
@@ -16,7 +16,8 @@ export default function (Alpine) {
|
|
16
16
|
const settings = buildConfig(modifiers);
|
17
17
|
const result = expression ? evaluate(expression) : {};
|
18
18
|
const directiveConfig = isObject(result) ? result : {};
|
19
|
-
let { triggerTarget, contentTarget, ...config } =
|
19
|
+
let { triggerTarget, contentTarget, anchorTarget, ...config } =
|
20
|
+
directiveConfig;
|
20
21
|
|
21
22
|
contentTarget =
|
22
23
|
contentTarget || el.querySelector("[x-dropdown\\:content]");
|
@@ -25,6 +26,8 @@ export default function (Alpine) {
|
|
25
26
|
: contentTarget;
|
26
27
|
triggerTarget =
|
27
28
|
triggerTarget || el.querySelector("[x-dropdown\\:trigger]") || el;
|
29
|
+
anchorTarget =
|
30
|
+
anchorTarget || el.querySelector("[x-dropdown\\:anchor]") || el;
|
28
31
|
|
29
32
|
// Initialize the dropdown
|
30
33
|
|
@@ -50,7 +53,7 @@ export default function (Alpine) {
|
|
50
53
|
|
51
54
|
setData(el, mixin);
|
52
55
|
|
53
|
-
const dropdown = (el.__x_dropdown = tippy(
|
56
|
+
const dropdown = (el.__x_dropdown = tippy(anchorTarget, {
|
54
57
|
theme: "coco-app-dropdown",
|
55
58
|
placement: "bottom-start",
|
56
59
|
offset: [0, 0],
|