@pathscale/ui 0.0.46 → 0.0.48
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.
- package/dist/index.js +15 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7618,7 +7618,7 @@ function ModalLegacy(props) {
|
|
|
7618
7618
|
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.delegateEvents)([
|
|
7619
7619
|
"click"
|
|
7620
7620
|
]);
|
|
7621
|
-
var Modal_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<dialog><div>"), Modal_tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<form method=dialog class=modal-backdrop><button type=submit>
|
|
7621
|
+
var Modal_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<dialog><div>"), Modal_tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<form method=dialog class=modal-backdrop><button type=submit class=sr-only>Close");
|
|
7622
7622
|
function Modal(props) {
|
|
7623
7623
|
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
7624
7624
|
"children",
|
|
@@ -7632,7 +7632,9 @@ function Modal(props) {
|
|
|
7632
7632
|
"className",
|
|
7633
7633
|
"onClose",
|
|
7634
7634
|
"tabindex",
|
|
7635
|
-
"tabIndex"
|
|
7635
|
+
"tabIndex",
|
|
7636
|
+
"closeOnEsc",
|
|
7637
|
+
"closeOnOutsideClick"
|
|
7636
7638
|
]);
|
|
7637
7639
|
const resolvedChildren = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.children)(()=>local.children);
|
|
7638
7640
|
let dialogRef;
|
|
@@ -7647,14 +7649,22 @@ function Modal(props) {
|
|
|
7647
7649
|
local.onClose?.();
|
|
7648
7650
|
};
|
|
7649
7651
|
const handleCancel = (event)=>{
|
|
7650
|
-
event.preventDefault();
|
|
7651
|
-
local.onClose?.();
|
|
7652
|
+
if (false === local.closeOnEsc) event.preventDefault();
|
|
7653
|
+
else local.onClose?.();
|
|
7654
|
+
};
|
|
7655
|
+
const handleClick = (event)=>{
|
|
7656
|
+
if (false === local.closeOnOutsideClick) return;
|
|
7657
|
+
const target = event.target;
|
|
7658
|
+
if (!dialogRef) return;
|
|
7659
|
+
if (target === dialogRef || target.closest(".modal-backdrop")) local.onClose?.();
|
|
7652
7660
|
};
|
|
7653
7661
|
dialogRef.addEventListener("close", handleClose);
|
|
7654
7662
|
dialogRef.addEventListener("cancel", handleCancel);
|
|
7663
|
+
dialogRef.addEventListener("click", handleClick);
|
|
7655
7664
|
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onCleanup)(()=>{
|
|
7656
7665
|
dialogRef?.removeEventListener("close", handleClose);
|
|
7657
7666
|
dialogRef?.removeEventListener("cancel", handleCancel);
|
|
7667
|
+
dialogRef?.removeEventListener("click", handleClick);
|
|
7658
7668
|
});
|
|
7659
7669
|
});
|
|
7660
7670
|
const containerClasses = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>twMerge("modal", dist_clsx({
|
|
@@ -9274,7 +9284,7 @@ const TableRow = (props)=>{
|
|
|
9274
9284
|
"noCell"
|
|
9275
9285
|
]);
|
|
9276
9286
|
const classAttr = ()=>twMerge(dist_clsx(local.class, {
|
|
9277
|
-
|
|
9287
|
+
"bg-primary text-primary-content": local.active
|
|
9278
9288
|
}));
|
|
9279
9289
|
const resolved = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.children)(()=>local.children);
|
|
9280
9290
|
return (()=>{
|