@jirawatpyk/aura-react 5.41.0 → 5.43.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.
- package/README.md +21 -2
- package/dist/aura.bundle.js +671 -545
- package/dist/cjs/index.cjs +671 -545
- package/dist/esm/FilterBar.js +145 -48
- package/dist/esm/FilterDateRange.js +6 -2
- package/dist/esm/FilterSelect.js +13 -7
- package/dist/esm/Icon.js +1 -1
- package/dist/esm/icons.js +14 -1
- package/dist/esm/internal.js +2 -0
- package/dist/esm/strings.js +4 -0
- package/dist/esm/strings.sv.js +4 -0
- package/dist/esm/strings.th.js +4 -0
- package/dist/icons/index.cjs +14 -1
- package/dist/icons/index.d.cts +2 -1
- package/dist/icons/index.d.ts +2 -1
- package/dist/index.d.cts +15 -1
- package/dist/index.d.ts +15 -1
- package/dist/locales/sv.cjs +4 -0
- package/dist/locales/sv.d.cts +4 -0
- package/dist/locales/sv.d.ts +4 -0
- package/dist/locales/th.cjs +4 -0
- package/dist/locales/th.d.cts +4 -0
- package/dist/locales/th.d.ts +4 -0
- package/dist/server/index.cjs +13 -1
- package/dist/server/index.d.cts +5 -1
- package/dist/server/index.d.ts +5 -1
- package/dist/server/index.js +13 -1
- package/dist/styles.css +35 -3
- package/dist/styles.layer.css +35 -3
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -214,7 +214,7 @@ function shapesOf(el) {
|
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
// src/Icon.tsx
|
|
217
|
-
var map = { "check": [["path", { "d": "M20 6 9 17l-5-5" }]], "x": [["path", { "d": "M18 6 6 18" }], ["path", { "d": "m6 6 12 12" }]], "plus": [["path", { "d": "M5 12h14" }], ["path", { "d": "M12 5v14" }]], "minus": [["path", { "d": "M5 12h14" }]], "search": [["path", { "d": "m21 21-4.34-4.34" }], ["circle", { "cx": "11", "cy": "11", "r": "8" }]], "chevron-down": [["path", { "d": "m6 9 6 6 6-6" }]], "chevron-up": [["path", { "d": "m18 15-6-6-6 6" }]], "chevron-left": [["path", { "d": "m15 18-6-6 6-6" }]], "chevron-right": [["path", { "d": "m9 18 6-6-6-6" }]], "arrow-right": [["path", { "d": "M5 12h14" }], ["path", { "d": "m12 5 7 7-7 7" }]], "arrow-up-right": [["path", { "d": "M7 7h10v10" }], ["path", { "d": "M7 17 17 7" }]], "arrow-up-down": [["path", { "d": "m21 16-4 4-4-4" }], ["path", { "d": "M17 20V4" }], ["path", { "d": "m3 8 4-4 4 4" }], ["path", { "d": "M7 4v16" }]], "loader-circle": [["path", { "d": "M21 12a9 9 0 1 1-6.219-8.56" }]], "circle-alert": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["line", { "x1": "12", "x2": "12", "y1": "8", "y2": "12" }], ["line", { "x1": "12", "x2": "12.01", "y1": "16", "y2": "16" }]], "circle-check": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "m16 9-5.5 5.5L8 12" }]], "info": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "M12 16v-4" }], ["path", { "d": "M12 8h.01" }]], "triangle-alert": [["path", { "d": "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }], ["path", { "d": "M12 9v4" }], ["path", { "d": "M12 17h.01" }]], "settings": [["path", { "d": "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915" }], ["circle", { "cx": "12", "cy": "12", "r": "3" }]], "user": [["path", { "d": "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }], ["circle", { "cx": "12", "cy": "7", "r": "4" }]], "users": [["path", { "d": "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" }], ["path", { "d": "M16 3.128a4 4 0 0 1 0 7.744" }], ["path", { "d": "M22 21v-2a4 4 0 0 0-3-3.87" }], ["circle", { "cx": "9", "cy": "7", "r": "4" }]], "filter": [["path", { "d": "M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z" }]], "ellipsis": [["circle", { "cx": "12", "cy": "12", "r": "1" }], ["circle", { "cx": "19", "cy": "12", "r": "1" }], ["circle", { "cx": "5", "cy": "12", "r": "1" }]], "external-link": [["path", { "d": "M15 3h6v6" }], ["path", { "d": "M10 14 21 3" }], ["path", { "d": "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }]], "copy": [["rect", { "width": "14", "height": "14", "x": "8", "y": "8", "rx": "2", "ry": "2" }], ["path", { "d": "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" }]], "trash-2": [["path", { "d": "M10 11v6" }], ["path", { "d": "M14 11v6" }], ["path", { "d": "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" }], ["path", { "d": "M3 6h18" }], ["path", { "d": "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" }]], "pencil": [["path", { "d": "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" }], ["path", { "d": "m15 5 4 4" }]], "download": [["path", { "d": "M12 15V3" }], ["path", { "d": "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }], ["path", { "d": "m7 10 5 5 5-5" }]], "upload": [["path", { "d": "M12 3v12" }], ["path", { "d": "m17 8-5-5-5 5" }], ["path", { "d": "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }]], "calendar": [["path", { "d": "M8 2v3" }], ["path", { "d": "M16 2v3" }], ["rect", { "x": "3", "y": "3", "width": "18", "height": "18", "rx": "2" }], ["path", { "d": "M3 9h18" }]], "bell": [["path", { "d": "M10.268 21a2 2 0 0 0 3.464 0" }], ["path", { "d": "M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326" }]], "menu": [["path", { "d": "M4 5h16" }], ["path", { "d": "M4 12h16" }], ["path", { "d": "M4 19h16" }]], "eye": [["path", { "d": "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0" }], ["circle", { "cx": "12", "cy": "12", "r": "3" }]], "log-out": [["path", { "d": "m16 17 5-5-5-5" }], ["path", { "d": "M21 12H9" }], ["path", { "d": "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" }]], "circle": [["circle", { "cx": "12", "cy": "12", "r": "10" }]], "circle-dot-dashed": [["path", { "d": "M10.1 2.18a9.93 9.93 0 0 1 3.8 0" }], ["path", { "d": "M17.6 3.71a9.95 9.95 0 0 1 2.69 2.7" }], ["path", { "d": "M21.82 10.1a9.93 9.93 0 0 1 0 3.8" }], ["path", { "d": "M20.29 17.6a9.95 9.95 0 0 1-2.7 2.69" }], ["path", { "d": "M13.9 21.82a9.94 9.94 0 0 1-3.8 0" }], ["path", { "d": "M6.4 20.29a9.95 9.95 0 0 1-2.69-2.7" }], ["path", { "d": "M2.18 13.9a9.93 9.93 0 0 1 0-3.8" }], ["path", { "d": "M3.71 6.4a9.95 9.95 0 0 1 2.7-2.69" }], ["circle", { "cx": "12", "cy": "12", "r": "1" }]], "ban": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "M4.929 4.929 19.07 19.071" }]], "arrow-up": [["path", { "d": "m5 12 7-7 7 7" }], ["path", { "d": "M12 19V5" }]], "arrow-down": [["path", { "d": "M12 5v14" }], ["path", { "d": "m19 12-7 7-7-7" }]], "inbox": [["polyline", { "points": "22 12 16 12 14 15 10 15 8 12 2 12" }], ["path", { "d": "M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z" }]], "pin": [["path", { "d": "M12 17v5" }], ["path", { "d": "M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z" }]], "pin-off": [["path", { "d": "M12 17v5" }], ["path", { "d": "M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89" }], ["path", { "d": "m2 2 20 20" }], ["path", { "d": "M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11" }]], "eye-off": [["path", { "d": "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49" }], ["path", { "d": "M14.084 14.158a3 3 0 0 1-4.242-4.242" }], ["path", { "d": "M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143" }], ["path", { "d": "m2 2 20 20" }]], "columns-3": [["rect", { "width": "18", "height": "18", "x": "3", "y": "3", "rx": "2" }], ["path", { "d": "M9 3v18" }], ["path", { "d": "M15 3v18" }]], "arrow-left": [["path", { "d": "m12 19-7-7 7-7" }], ["path", { "d": "M19 12H5" }]], "rotate-ccw": [["path", { "d": "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }], ["path", { "d": "M3 3v5h5" }]], "house": [["path", { "d": "M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8" }], ["path", { "d": "M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" }]], "layout-dashboard": [["rect", { "width": "7", "height": "9", "x": "3", "y": "3", "rx": "1" }], ["rect", { "width": "7", "height": "5", "x": "14", "y": "3", "rx": "1" }], ["rect", { "width": "7", "height": "9", "x": "14", "y": "12", "rx": "1" }], ["rect", { "width": "7", "height": "5", "x": "3", "y": "16", "rx": "1" }]], "folder": [["path", { "d": "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z" }]], "chart-column": [["path", { "d": "M3 3v16a2 2 0 0 0 2 2h16" }], ["path", { "d": "M18 17V9" }], ["path", { "d": "M13 17V5" }], ["path", { "d": "M8 17v-3" }]], "file-text": [["path", { "d": "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" }], ["path", { "d": "M14 2v5a1 1 0 0 0 1 1h5" }], ["path", { "d": "M10 9H8" }], ["path", { "d": "M16 13H8" }], ["path", { "d": "M16 17H8" }]], "mail": [["path", { "d": "m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7" }], ["rect", { "x": "2", "y": "4", "width": "20", "height": "16", "rx": "2" }]], "lock": [["rect", { "width": "18", "height": "11", "x": "3", "y": "11", "rx": "2", "ry": "2" }], ["path", { "d": "M7 11V7a5 5 0 0 1 10 0v4" }]], "clock": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "M12 6v6l4 2" }]], "trending-up": [["path", { "d": "M16 7h6v6" }], ["path", { "d": "m22 7-8.5 8.5-5-5L2 17" }]], "trending-down": [["path", { "d": "M16 17h6v-6" }], ["path", { "d": "m22 17-8.5-8.5-5 5L2 7" }]], "image": [["rect", { "width": "18", "height": "18", "x": "3", "y": "3", "rx": "2", "ry": "2" }], ["circle", { "cx": "9", "cy": "9", "r": "2" }], ["path", { "d": "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" }]], "paperclip": [["path", { "d": "m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551" }]], "cloud-upload": [["path", { "d": "M12 13v8" }], ["path", { "d": "M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242" }], ["path", { "d": "m8 17 4-4 4 4" }]], "file": [["path", { "d": "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" }], ["path", { "d": "M14 2v5a1 1 0 0 0 1 1h5" }]], "sun": [["circle", { "cx": "12", "cy": "12", "r": "4" }], ["path", { "d": "M12 2v2" }], ["path", { "d": "M12 20v2" }], ["path", { "d": "m4.93 4.93 1.41 1.41" }], ["path", { "d": "m17.66 17.66 1.41 1.41" }], ["path", { "d": "M2 12h2" }], ["path", { "d": "M20 12h2" }], ["path", { "d": "m6.34 17.66-1.41 1.41" }], ["path", { "d": "m19.07 4.93-1.41 1.41" }]], "moon": [["path", { "d": "M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401" }]], "monitor": [["rect", { "width": "20", "height": "14", "x": "2", "y": "3", "rx": "2" }], ["line", { "x1": "8", "x2": "16", "y1": "21", "y2": "21" }], ["line", { "x1": "12", "x2": "12", "y1": "17", "y2": "21" }]], "panel-left-close": [["rect", { "width": "18", "height": "18", "x": "3", "y": "3", "rx": "2" }], ["path", { "d": "M9 3v18" }], ["path", { "d": "m16 15-3-3 3-3" }]], "panel-left-open": [["rect", { "width": "18", "height": "18", "x": "3", "y": "3", "rx": "2" }], ["path", { "d": "M9 3v18" }], ["path", { "d": "m14 9 3 3-3 3" }]], "server": [["rect", { "width": "20", "height": "8", "x": "2", "y": "2", "rx": "2", "ry": "2" }], ["rect", { "width": "20", "height": "8", "x": "2", "y": "14", "rx": "2", "ry": "2" }], ["line", { "x1": "6", "x2": "6.01", "y1": "6", "y2": "6" }], ["line", { "x1": "6", "x2": "6.01", "y1": "18", "y2": "18" }]], "globe": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20" }], ["path", { "d": "M2 12h20" }]], "activity": [["path", { "d": "M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2" }]], "shield-alert": [["path", { "d": "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" }], ["path", { "d": "M12 8v4" }], ["path", { "d": "M12 16h.01" }]], "phone": [["path", { "d": "M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384" }]], "wrench": [["path", { "d": "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z" }]] };
|
|
217
|
+
var map = { "check": [["path", { "d": "M20 6 9 17l-5-5" }]], "x": [["path", { "d": "M18 6 6 18" }], ["path", { "d": "m6 6 12 12" }]], "plus": [["path", { "d": "M5 12h14" }], ["path", { "d": "M12 5v14" }]], "minus": [["path", { "d": "M5 12h14" }]], "search": [["path", { "d": "m21 21-4.34-4.34" }], ["circle", { "cx": "11", "cy": "11", "r": "8" }]], "chevron-down": [["path", { "d": "m6 9 6 6 6-6" }]], "chevron-up": [["path", { "d": "m18 15-6-6-6 6" }]], "chevron-left": [["path", { "d": "m15 18-6-6 6-6" }]], "chevron-right": [["path", { "d": "m9 18 6-6-6-6" }]], "arrow-right": [["path", { "d": "M5 12h14" }], ["path", { "d": "m12 5 7 7-7 7" }]], "arrow-up-right": [["path", { "d": "M7 7h10v10" }], ["path", { "d": "M7 17 17 7" }]], "arrow-up-down": [["path", { "d": "m21 16-4 4-4-4" }], ["path", { "d": "M17 20V4" }], ["path", { "d": "m3 8 4-4 4 4" }], ["path", { "d": "M7 4v16" }]], "loader-circle": [["path", { "d": "M21 12a9 9 0 1 1-6.219-8.56" }]], "circle-alert": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["line", { "x1": "12", "x2": "12", "y1": "8", "y2": "12" }], ["line", { "x1": "12", "x2": "12.01", "y1": "16", "y2": "16" }]], "circle-check": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "m16 9-5.5 5.5L8 12" }]], "info": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "M12 16v-4" }], ["path", { "d": "M12 8h.01" }]], "triangle-alert": [["path", { "d": "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }], ["path", { "d": "M12 9v4" }], ["path", { "d": "M12 17h.01" }]], "settings": [["path", { "d": "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915" }], ["circle", { "cx": "12", "cy": "12", "r": "3" }]], "user": [["path", { "d": "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }], ["circle", { "cx": "12", "cy": "7", "r": "4" }]], "users": [["path", { "d": "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" }], ["path", { "d": "M16 3.128a4 4 0 0 1 0 7.744" }], ["path", { "d": "M22 21v-2a4 4 0 0 0-3-3.87" }], ["circle", { "cx": "9", "cy": "7", "r": "4" }]], "filter": [["path", { "d": "M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z" }]], "ellipsis": [["circle", { "cx": "12", "cy": "12", "r": "1" }], ["circle", { "cx": "19", "cy": "12", "r": "1" }], ["circle", { "cx": "5", "cy": "12", "r": "1" }]], "external-link": [["path", { "d": "M15 3h6v6" }], ["path", { "d": "M10 14 21 3" }], ["path", { "d": "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }]], "copy": [["rect", { "width": "14", "height": "14", "x": "8", "y": "8", "rx": "2", "ry": "2" }], ["path", { "d": "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" }]], "trash-2": [["path", { "d": "M10 11v6" }], ["path", { "d": "M14 11v6" }], ["path", { "d": "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" }], ["path", { "d": "M3 6h18" }], ["path", { "d": "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" }]], "pencil": [["path", { "d": "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" }], ["path", { "d": "m15 5 4 4" }]], "download": [["path", { "d": "M12 15V3" }], ["path", { "d": "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }], ["path", { "d": "m7 10 5 5 5-5" }]], "upload": [["path", { "d": "M12 3v12" }], ["path", { "d": "m17 8-5-5-5 5" }], ["path", { "d": "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }]], "calendar": [["path", { "d": "M8 2v3" }], ["path", { "d": "M16 2v3" }], ["rect", { "x": "3", "y": "3", "width": "18", "height": "18", "rx": "2" }], ["path", { "d": "M3 9h18" }]], "bell": [["path", { "d": "M10.268 21a2 2 0 0 0 3.464 0" }], ["path", { "d": "M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326" }]], "menu": [["path", { "d": "M4 5h16" }], ["path", { "d": "M4 12h16" }], ["path", { "d": "M4 19h16" }]], "eye": [["path", { "d": "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0" }], ["circle", { "cx": "12", "cy": "12", "r": "3" }]], "log-out": [["path", { "d": "m16 17 5-5-5-5" }], ["path", { "d": "M21 12H9" }], ["path", { "d": "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" }]], "circle": [["circle", { "cx": "12", "cy": "12", "r": "10" }]], "circle-dot-dashed": [["path", { "d": "M10.1 2.18a9.93 9.93 0 0 1 3.8 0" }], ["path", { "d": "M17.6 3.71a9.95 9.95 0 0 1 2.69 2.7" }], ["path", { "d": "M21.82 10.1a9.93 9.93 0 0 1 0 3.8" }], ["path", { "d": "M20.29 17.6a9.95 9.95 0 0 1-2.7 2.69" }], ["path", { "d": "M13.9 21.82a9.94 9.94 0 0 1-3.8 0" }], ["path", { "d": "M6.4 20.29a9.95 9.95 0 0 1-2.69-2.7" }], ["path", { "d": "M2.18 13.9a9.93 9.93 0 0 1 0-3.8" }], ["path", { "d": "M3.71 6.4a9.95 9.95 0 0 1 2.7-2.69" }], ["circle", { "cx": "12", "cy": "12", "r": "1" }]], "ban": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "M4.929 4.929 19.07 19.071" }]], "arrow-up": [["path", { "d": "m5 12 7-7 7 7" }], ["path", { "d": "M12 19V5" }]], "arrow-down": [["path", { "d": "M12 5v14" }], ["path", { "d": "m19 12-7 7-7-7" }]], "inbox": [["polyline", { "points": "22 12 16 12 14 15 10 15 8 12 2 12" }], ["path", { "d": "M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z" }]], "pin": [["path", { "d": "M12 17v5" }], ["path", { "d": "M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z" }]], "pin-off": [["path", { "d": "M12 17v5" }], ["path", { "d": "M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89" }], ["path", { "d": "m2 2 20 20" }], ["path", { "d": "M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11" }]], "eye-off": [["path", { "d": "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49" }], ["path", { "d": "M14.084 14.158a3 3 0 0 1-4.242-4.242" }], ["path", { "d": "M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143" }], ["path", { "d": "m2 2 20 20" }]], "columns-3": [["rect", { "width": "18", "height": "18", "x": "3", "y": "3", "rx": "2" }], ["path", { "d": "M9 3v18" }], ["path", { "d": "M15 3v18" }]], "arrow-left": [["path", { "d": "m12 19-7-7 7-7" }], ["path", { "d": "M19 12H5" }]], "rotate-ccw": [["path", { "d": "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }], ["path", { "d": "M3 3v5h5" }]], "house": [["path", { "d": "M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8" }], ["path", { "d": "M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" }]], "layout-dashboard": [["rect", { "width": "7", "height": "9", "x": "3", "y": "3", "rx": "1" }], ["rect", { "width": "7", "height": "5", "x": "14", "y": "3", "rx": "1" }], ["rect", { "width": "7", "height": "9", "x": "14", "y": "12", "rx": "1" }], ["rect", { "width": "7", "height": "5", "x": "3", "y": "16", "rx": "1" }]], "folder": [["path", { "d": "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z" }]], "chart-column": [["path", { "d": "M3 3v16a2 2 0 0 0 2 2h16" }], ["path", { "d": "M18 17V9" }], ["path", { "d": "M13 17V5" }], ["path", { "d": "M8 17v-3" }]], "file-text": [["path", { "d": "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" }], ["path", { "d": "M14 2v5a1 1 0 0 0 1 1h5" }], ["path", { "d": "M10 9H8" }], ["path", { "d": "M16 13H8" }], ["path", { "d": "M16 17H8" }]], "mail": [["path", { "d": "m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7" }], ["rect", { "x": "2", "y": "4", "width": "20", "height": "16", "rx": "2" }]], "lock": [["rect", { "width": "18", "height": "11", "x": "3", "y": "11", "rx": "2", "ry": "2" }], ["path", { "d": "M7 11V7a5 5 0 0 1 10 0v4" }]], "clock": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "M12 6v6l4 2" }]], "trending-up": [["path", { "d": "M16 7h6v6" }], ["path", { "d": "m22 7-8.5 8.5-5-5L2 17" }]], "trending-down": [["path", { "d": "M16 17h6v-6" }], ["path", { "d": "m22 17-8.5-8.5-5 5L2 7" }]], "image": [["rect", { "width": "18", "height": "18", "x": "3", "y": "3", "rx": "2", "ry": "2" }], ["circle", { "cx": "9", "cy": "9", "r": "2" }], ["path", { "d": "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" }]], "paperclip": [["path", { "d": "m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551" }]], "cloud-upload": [["path", { "d": "M12 13v8" }], ["path", { "d": "M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242" }], ["path", { "d": "m8 17 4-4 4 4" }]], "file": [["path", { "d": "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" }], ["path", { "d": "M14 2v5a1 1 0 0 0 1 1h5" }]], "sun": [["circle", { "cx": "12", "cy": "12", "r": "4" }], ["path", { "d": "M12 2v2" }], ["path", { "d": "M12 20v2" }], ["path", { "d": "m4.93 4.93 1.41 1.41" }], ["path", { "d": "m17.66 17.66 1.41 1.41" }], ["path", { "d": "M2 12h2" }], ["path", { "d": "M20 12h2" }], ["path", { "d": "m6.34 17.66-1.41 1.41" }], ["path", { "d": "m19.07 4.93-1.41 1.41" }]], "moon": [["path", { "d": "M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401" }]], "monitor": [["rect", { "width": "20", "height": "14", "x": "2", "y": "3", "rx": "2" }], ["line", { "x1": "8", "x2": "16", "y1": "21", "y2": "21" }], ["line", { "x1": "12", "x2": "12", "y1": "17", "y2": "21" }]], "panel-left-close": [["rect", { "width": "18", "height": "18", "x": "3", "y": "3", "rx": "2" }], ["path", { "d": "M9 3v18" }], ["path", { "d": "m16 15-3-3 3-3" }]], "panel-left-open": [["rect", { "width": "18", "height": "18", "x": "3", "y": "3", "rx": "2" }], ["path", { "d": "M9 3v18" }], ["path", { "d": "m14 9 3 3-3 3" }]], "server": [["rect", { "width": "20", "height": "8", "x": "2", "y": "2", "rx": "2", "ry": "2" }], ["rect", { "width": "20", "height": "8", "x": "2", "y": "14", "rx": "2", "ry": "2" }], ["line", { "x1": "6", "x2": "6.01", "y1": "6", "y2": "6" }], ["line", { "x1": "6", "x2": "6.01", "y1": "18", "y2": "18" }]], "globe": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20" }], ["path", { "d": "M2 12h20" }]], "activity": [["path", { "d": "M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2" }]], "shield-alert": [["path", { "d": "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" }], ["path", { "d": "M12 8v4" }], ["path", { "d": "M12 16h.01" }]], "phone": [["path", { "d": "M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384" }]], "wrench": [["path", { "d": "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z" }]], "sliders-horizontal": [["path", { "d": "M10 5H3" }], ["path", { "d": "M12 19H3" }], ["path", { "d": "M14 3v4" }], ["path", { "d": "M16 17v4" }], ["path", { "d": "M21 12h-9" }], ["path", { "d": "M21 19h-5" }], ["path", { "d": "M21 5h-7" }], ["path", { "d": "M8 10v4" }], ["path", { "d": "M8 12H3" }]] };
|
|
218
218
|
var ICONS = map;
|
|
219
219
|
var registered = {};
|
|
220
220
|
function registerIcons(icons) {
|
|
@@ -359,6 +359,7 @@ function useMergedRef(a, b) {
|
|
|
359
359
|
function plainClick(e) {
|
|
360
360
|
return !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey;
|
|
361
361
|
}
|
|
362
|
+
var FilterSheet = React3.createContext(false);
|
|
362
363
|
|
|
363
364
|
// src/display.tsx
|
|
364
365
|
var React4 = __toESM(require("react"), 1);
|
|
@@ -583,6 +584,17 @@ var IconWrench = /* @__PURE__ */ defineIcon("wrench", [
|
|
|
583
584
|
}
|
|
584
585
|
]
|
|
585
586
|
]);
|
|
587
|
+
var IconSlidersHorizontal = /* @__PURE__ */ defineIcon("sliders-horizontal", [
|
|
588
|
+
["path", { d: "M10 5H3" }],
|
|
589
|
+
["path", { d: "M12 19H3" }],
|
|
590
|
+
["path", { d: "M14 3v4" }],
|
|
591
|
+
["path", { d: "M16 17v4" }],
|
|
592
|
+
["path", { d: "M21 12h-9" }],
|
|
593
|
+
["path", { d: "M21 19h-5" }],
|
|
594
|
+
["path", { d: "M21 5h-7" }],
|
|
595
|
+
["path", { d: "M8 10v4" }],
|
|
596
|
+
["path", { d: "M8 12H3" }]
|
|
597
|
+
]);
|
|
586
598
|
|
|
587
599
|
// src/display.tsx
|
|
588
600
|
var h2 = React4.createElement;
|
|
@@ -933,6 +945,10 @@ var th = {
|
|
|
933
945
|
statusOk: "\u0E1B\u0E01\u0E15\u0E34",
|
|
934
946
|
statusUnknown: "\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E21\u0E35\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",
|
|
935
947
|
opensInNewTab: "\u0E40\u0E1B\u0E34\u0E14\u0E43\u0E19\u0E41\u0E17\u0E47\u0E1A\u0E43\u0E2B\u0E21\u0E48",
|
|
948
|
+
filtersApplied: function(n3) {
|
|
949
|
+
return "\u0E15\u0E31\u0E27\u0E01\u0E23\u0E2D\u0E07, \u0E43\u0E0A\u0E49\u0E2D\u0E22\u0E39\u0E48 " + n3.toLocaleString("en") + " \u0E23\u0E32\u0E22\u0E01\u0E32\u0E23";
|
|
950
|
+
},
|
|
951
|
+
done: "\u0E40\u0E2A\u0E23\u0E47\u0E08\u0E2A\u0E34\u0E49\u0E19",
|
|
936
952
|
accepts: function(list, max) {
|
|
937
953
|
return [list, max && "\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 " + max + " \u0E15\u0E48\u0E2D\u0E44\u0E1F\u0E25\u0E4C"].filter(Boolean).join(" \xB7 ");
|
|
938
954
|
}
|
|
@@ -1070,6 +1086,10 @@ var sv = {
|
|
|
1070
1086
|
statusOk: "OK",
|
|
1071
1087
|
statusUnknown: "Ingen data",
|
|
1072
1088
|
opensInNewTab: "\xF6ppnas i en ny flik",
|
|
1089
|
+
filtersApplied: function(n3) {
|
|
1090
|
+
return "Filter, " + n3.toLocaleString("sv-SE") + " aktiva";
|
|
1091
|
+
},
|
|
1092
|
+
done: "Klar",
|
|
1073
1093
|
accepts: function(list, max) {
|
|
1074
1094
|
return [list, max && "h\xF6gst " + max + " per fil"].filter(Boolean).join(", ");
|
|
1075
1095
|
}
|
|
@@ -1208,6 +1228,10 @@ var STRINGS = {
|
|
|
1208
1228
|
statusOk: "OK",
|
|
1209
1229
|
statusUnknown: "No data",
|
|
1210
1230
|
opensInNewTab: "opens in a new tab",
|
|
1231
|
+
filtersApplied: function(n3) {
|
|
1232
|
+
return "Filters, " + n3.toLocaleString("en") + " applied";
|
|
1233
|
+
},
|
|
1234
|
+
done: "Done",
|
|
1211
1235
|
accepts: function(list, max) {
|
|
1212
1236
|
return [list, max && "up to " + max + " each"].filter(Boolean).join(", ");
|
|
1213
1237
|
}
|
|
@@ -2709,12 +2733,18 @@ var Select = React16.forwardRef(function Select2(props, ref) {
|
|
|
2709
2733
|
var React17 = __toESM(require("react"), 1);
|
|
2710
2734
|
var FilterSelect = React17.forwardRef(function FilterSelect2(props, ref) {
|
|
2711
2735
|
const onChange = props.onChange;
|
|
2712
|
-
const
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2736
|
+
const inSheet = React17.useContext(FilterSheet);
|
|
2737
|
+
const pass = Object.assign(
|
|
2738
|
+
omit(props, ["label", "allLabel", "onChange"]),
|
|
2739
|
+
inSheet ? { label: props.label } : {
|
|
2740
|
+
[FILTER_KEY]: { name: props.label, allLabel: props.allLabel }
|
|
2741
|
+
},
|
|
2742
|
+
{
|
|
2743
|
+
onChange: onChange ? function(e) {
|
|
2744
|
+
onChange(e.target.value);
|
|
2745
|
+
} : void 0
|
|
2746
|
+
}
|
|
2747
|
+
);
|
|
2718
2748
|
return /* @__PURE__ */ React17.createElement(Select, { ...pass, ref });
|
|
2719
2749
|
});
|
|
2720
2750
|
|
|
@@ -3570,6 +3600,7 @@ var FilterDateRange = React19.forwardRef(
|
|
|
3570
3600
|
const anyLabel = props.anyLabel || dt.anyTime;
|
|
3571
3601
|
const value = v.start && v.end ? formatDateRange(v.start, v.end, { locale, calendar }) : anyLabel;
|
|
3572
3602
|
const setFace = useMergedRef(ref, faceRef);
|
|
3603
|
+
const inSheet = React19.useContext(FilterSheet);
|
|
3573
3604
|
const limits = {
|
|
3574
3605
|
min: props.min,
|
|
3575
3606
|
max: props.max,
|
|
@@ -3670,7 +3701,7 @@ var FilterDateRange = React19.forwardRef(
|
|
|
3670
3701
|
),
|
|
3671
3702
|
document.body
|
|
3672
3703
|
) : null;
|
|
3673
|
-
|
|
3704
|
+
const box = /* @__PURE__ */ React19.createElement(React19.Fragment, null, /* @__PURE__ */ React19.createElement(
|
|
3674
3705
|
"div",
|
|
3675
3706
|
{
|
|
3676
3707
|
ref: boxRef,
|
|
@@ -3678,6 +3709,7 @@ var FilterDateRange = React19.forwardRef(
|
|
|
3678
3709
|
"aura-filterselect",
|
|
3679
3710
|
pop.open && "is-open",
|
|
3680
3711
|
props.disabled && "is-disabled",
|
|
3712
|
+
inSheet && "aura-filterselect--sheet",
|
|
3681
3713
|
touchClass(props.touchHeight),
|
|
3682
3714
|
props.className
|
|
3683
3715
|
)
|
|
@@ -3706,6 +3738,8 @@ var FilterDateRange = React19.forwardRef(
|
|
|
3706
3738
|
/* @__PURE__ */ React19.createElement(Icon, { name: /* @__PURE__ */ React19.createElement(IconChevronDown, null), className: "aura-filterselect__chevron" })
|
|
3707
3739
|
)
|
|
3708
3740
|
), cal);
|
|
3741
|
+
if (!inSheet) return box;
|
|
3742
|
+
return /* @__PURE__ */ React19.createElement("div", { className: cx("aura-field", props.disabled && "is-disabled") }, /* @__PURE__ */ React19.createElement("span", { className: "aura-field__label", "aria-hidden": own ? void 0 : true }, props.label), box);
|
|
3709
3743
|
}
|
|
3710
3744
|
);
|
|
3711
3745
|
|
|
@@ -4696,162 +4730,439 @@ var FormErrorSummary = React26.forwardRef(
|
|
|
4696
4730
|
);
|
|
4697
4731
|
|
|
4698
4732
|
// src/FilterBar.tsx
|
|
4699
|
-
var
|
|
4733
|
+
var React31 = __toESM(require("react"), 1);
|
|
4700
4734
|
|
|
4701
|
-
// src/
|
|
4735
|
+
// src/Dialog.tsx
|
|
4702
4736
|
var React28 = __toESM(require("react"), 1);
|
|
4737
|
+
var import_react_dom7 = require("react-dom");
|
|
4703
4738
|
|
|
4704
|
-
// src/
|
|
4739
|
+
// src/useModal.tsx
|
|
4705
4740
|
var React27 = __toESM(require("react"), 1);
|
|
4706
|
-
var
|
|
4707
|
-
var
|
|
4708
|
-
|
|
4709
|
-
const
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
);
|
|
4719
|
-
}
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
if (!anchor.current || !tip2.current) return;
|
|
4737
|
-
const r2 = anchor.current.getBoundingClientRect(), t = tip2.current.getBoundingClientRect();
|
|
4738
|
-
const vw = window.innerWidth, vh = window.innerHeight, gap = 8, m = 8;
|
|
4739
|
-
let side = props.side || "top";
|
|
4740
|
-
if (side === "top" && r2.top - t.height - gap < m && r2.bottom + gap + t.height <= vh - m) side = "bottom";
|
|
4741
|
-
else if (side === "bottom" && r2.bottom + gap + t.height > vh - m && r2.top - t.height - gap >= m) side = "top";
|
|
4742
|
-
else if (side === "left" && r2.left - t.width - gap < m && r2.right + gap + t.width <= vw - m) side = "right";
|
|
4743
|
-
else if (side === "right" && r2.right + gap + t.width > vw - m && r2.left - t.width - gap >= m) side = "left";
|
|
4744
|
-
const clampX = function(x) {
|
|
4745
|
-
return Math.max(m, Math.min(x, vw - t.width - m));
|
|
4746
|
-
};
|
|
4747
|
-
const clampY = function(y) {
|
|
4748
|
-
return Math.max(m, Math.min(y, vh - t.height - m));
|
|
4749
|
-
};
|
|
4750
|
-
let top, left;
|
|
4751
|
-
if (side === "top" || side === "bottom") {
|
|
4752
|
-
top = clampY(side === "top" ? r2.top - t.height - gap : r2.bottom + gap);
|
|
4753
|
-
left = clampX(r2.left + r2.width / 2 - t.width / 2);
|
|
4754
|
-
} else {
|
|
4755
|
-
left = side === "left" ? r2.left - t.width - gap : r2.right + gap;
|
|
4756
|
-
left = clampX(left);
|
|
4757
|
-
top = clampY(r2.top + r2.height / 2 - t.height / 2);
|
|
4758
|
-
}
|
|
4759
|
-
pos[1]({ top, left });
|
|
4760
|
-
}
|
|
4761
|
-
useIsoLayoutEffect(
|
|
4762
|
-
function() {
|
|
4763
|
-
if (!open) return;
|
|
4764
|
-
place2();
|
|
4765
|
-
window.addEventListener("scroll", place2, true);
|
|
4766
|
-
window.addEventListener("resize", place2);
|
|
4767
|
-
return function() {
|
|
4768
|
-
window.removeEventListener("scroll", place2, true);
|
|
4769
|
-
window.removeEventListener("resize", place2);
|
|
4770
|
-
};
|
|
4771
|
-
},
|
|
4772
|
-
[open, mounted]
|
|
4773
|
-
);
|
|
4741
|
+
var locks = 0;
|
|
4742
|
+
var savedOverflow = "";
|
|
4743
|
+
function lockScroll() {
|
|
4744
|
+
const body = document.body;
|
|
4745
|
+
if (locks === 0) savedOverflow = body.style.overflow;
|
|
4746
|
+
locks++;
|
|
4747
|
+
body.style.overflow = "hidden";
|
|
4748
|
+
let done = false;
|
|
4749
|
+
return function() {
|
|
4750
|
+
if (done) return;
|
|
4751
|
+
done = true;
|
|
4752
|
+
locks--;
|
|
4753
|
+
if (locks === 0) body.style.overflow = savedOverflow;
|
|
4754
|
+
};
|
|
4755
|
+
}
|
|
4756
|
+
function tabbable(el) {
|
|
4757
|
+
const all = Array.prototype.filter.call(el.querySelectorAll(FOCUSABLE), function(c) {
|
|
4758
|
+
return c.tabIndex >= 0;
|
|
4759
|
+
});
|
|
4760
|
+
const shown = all.filter(function(c) {
|
|
4761
|
+
return c.getClientRects().length > 0;
|
|
4762
|
+
});
|
|
4763
|
+
return shown.length ? shown : all;
|
|
4764
|
+
}
|
|
4765
|
+
function useModal(open, ref, opts) {
|
|
4766
|
+
const mounted = useMounted();
|
|
4767
|
+
const prev = React27.useRef(null);
|
|
4768
|
+
const o = opts || {};
|
|
4769
|
+
const latest = React27.useRef(o);
|
|
4770
|
+
latest.current = o;
|
|
4774
4771
|
React27.useEffect(
|
|
4775
4772
|
function() {
|
|
4776
|
-
if (!open) return;
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4773
|
+
if (!open || !mounted) return;
|
|
4774
|
+
prev.current = document.activeElement;
|
|
4775
|
+
const unlock = lockScroll();
|
|
4776
|
+
const el = ref.current;
|
|
4777
|
+
const firstIn = function(scope) {
|
|
4778
|
+
if (!scope || !el) return null;
|
|
4779
|
+
const sel = FOCUSABLE.split(",").map(function(s) {
|
|
4780
|
+
return scope + " " + s;
|
|
4781
|
+
}).join(",");
|
|
4782
|
+
const list = el.querySelectorAll(sel);
|
|
4783
|
+
for (let i = 0; i < list.length; i++)
|
|
4784
|
+
if (list[i].tabIndex >= 0 && list[i].getClientRects().length > 0) return list[i];
|
|
4785
|
+
return null;
|
|
4786
|
+
};
|
|
4787
|
+
const target = el && (el.querySelector("[data-autofocus]") || firstIn(o.bodySelector) || firstIn(o.footSelector) || el);
|
|
4788
|
+
if (target && o.autoFocus !== false) target.focus();
|
|
4781
4789
|
return function() {
|
|
4782
|
-
|
|
4790
|
+
unlock();
|
|
4791
|
+
const l = latest.current;
|
|
4792
|
+
const ff = l.finalFocus;
|
|
4793
|
+
const to = ff ? typeof ff === "function" ? ff() : ff.current : null;
|
|
4794
|
+
const back = to && to.isConnected ? to : prev.current;
|
|
4795
|
+
if (back && back.focus) back.focus();
|
|
4796
|
+
if (l.onCloseComplete) l.onCloseComplete();
|
|
4783
4797
|
};
|
|
4784
4798
|
},
|
|
4785
|
-
[open]
|
|
4786
|
-
);
|
|
4787
|
-
const child = React27.Children.only(props.children);
|
|
4788
|
-
const trigger = /* @__PURE__ */ React27.createElement(
|
|
4789
|
-
"span",
|
|
4790
|
-
{
|
|
4791
|
-
ref: anchorMerged,
|
|
4792
|
-
className: "aura-tooltip-anchor",
|
|
4793
|
-
onMouseEnter: function() {
|
|
4794
|
-
show3(false);
|
|
4795
|
-
},
|
|
4796
|
-
onMouseLeave: hideSoon2,
|
|
4797
|
-
onFocus: function() {
|
|
4798
|
-
show3(true);
|
|
4799
|
-
},
|
|
4800
|
-
onBlur: hide2
|
|
4801
|
-
},
|
|
4802
|
-
React27.cloneElement(child, { "aria-describedby": open ? id : child.props["aria-describedby"] })
|
|
4799
|
+
[open, mounted]
|
|
4803
4800
|
);
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
function textOf2(node, all) {
|
|
4826
|
-
if (node == null || typeof node === "boolean") return "";
|
|
4827
|
-
if (typeof node === "string" || typeof node === "number") return String(node);
|
|
4828
|
-
if (Array.isArray(node))
|
|
4829
|
-
return node.map(function(n3) {
|
|
4830
|
-
return textOf2(n3, all);
|
|
4831
|
-
}).join("");
|
|
4832
|
-
if (React28.isValidElement(node)) {
|
|
4833
|
-
const p = node.props;
|
|
4834
|
-
return !all && (p["aria-hidden"] === true || p["aria-hidden"] === "true") ? "" : textOf2(p.children, all);
|
|
4801
|
+
function onKeyDown(e) {
|
|
4802
|
+
if (e.key === "Escape") {
|
|
4803
|
+
e.stopPropagation();
|
|
4804
|
+
if (o.onEscape) o.onEscape();
|
|
4805
|
+
return;
|
|
4806
|
+
}
|
|
4807
|
+
if (e.key !== "Tab" || !ref.current || e.defaultPrevented) return;
|
|
4808
|
+
if (!ref.current.contains(e.target)) return;
|
|
4809
|
+
const list = tabbable(ref.current);
|
|
4810
|
+
if (!list.length) {
|
|
4811
|
+
e.preventDefault();
|
|
4812
|
+
return;
|
|
4813
|
+
}
|
|
4814
|
+
const first = list[0], last = list[list.length - 1], active = document.activeElement, stray = active === ref.current;
|
|
4815
|
+
if (e.shiftKey && (active === first || stray)) {
|
|
4816
|
+
e.preventDefault();
|
|
4817
|
+
last.focus();
|
|
4818
|
+
} else if (!e.shiftKey && (active === last || stray)) {
|
|
4819
|
+
e.preventDefault();
|
|
4820
|
+
first.focus();
|
|
4821
|
+
}
|
|
4835
4822
|
}
|
|
4836
|
-
return
|
|
4823
|
+
return { ready: !!open && mounted, onKeyDown };
|
|
4824
|
+
}
|
|
4825
|
+
|
|
4826
|
+
// src/Dialog.tsx
|
|
4827
|
+
var DialogClose = React28.createContext(null);
|
|
4828
|
+
function useDialogClose() {
|
|
4829
|
+
return React28.useContext(DialogClose) || function() {
|
|
4830
|
+
};
|
|
4837
4831
|
}
|
|
4838
|
-
var
|
|
4832
|
+
var Dialog = React28.forwardRef(function Dialog2(props, ref) {
|
|
4839
4833
|
const t = useStrings();
|
|
4840
|
-
const
|
|
4834
|
+
const density = useDensity();
|
|
4835
|
+
const own = React28.useRef(null), merged = useMergedRef(ref, own), titleId = uid(), descId = uid();
|
|
4836
|
+
const openState = useMaybeControlled(props.open, false, null), open = openState[0];
|
|
4837
|
+
if (props.open === void 0 && !props.trigger)
|
|
4838
|
+
devWarnOnce("dialog-no-open", "Dialog has neither `open` nor `trigger`, so it can never open. Pass one of them.");
|
|
4839
|
+
const trigId = uid();
|
|
4840
|
+
function closeNow() {
|
|
4841
|
+
if (props.open === void 0) openState[1](false);
|
|
4842
|
+
if (props.onClose) props.onClose();
|
|
4843
|
+
}
|
|
4844
|
+
function close() {
|
|
4845
|
+
if (props.dismissible === false) return;
|
|
4846
|
+
closeNow();
|
|
4847
|
+
}
|
|
4848
|
+
const scrimCloses = props.dismissible !== false && (props.dismissOnScrim !== void 0 ? props.dismissOnScrim : props.role !== "alertdialog");
|
|
4849
|
+
const modal = useModal(open, own, {
|
|
4850
|
+
autoFocus: props.autoFocus,
|
|
4851
|
+
onEscape: close,
|
|
4852
|
+
bodySelector: ".aura-dialog__body",
|
|
4853
|
+
footSelector: ".aura-dialog__foot",
|
|
4854
|
+
/* With a trigger, focus goes back to it even where a click doesn't focus buttons (Safari). */
|
|
4855
|
+
finalFocus: props.trigger ? function() {
|
|
4856
|
+
const ff = props.finalFocus;
|
|
4857
|
+
const to = ff ? typeof ff === "function" ? ff() : ff.current : null;
|
|
4858
|
+
return to || document.querySelector('[data-aura-trigger="' + trigId + '"]');
|
|
4859
|
+
} : props.finalFocus,
|
|
4860
|
+
onCloseComplete: props.onCloseComplete
|
|
4861
|
+
});
|
|
4862
|
+
const trig = props.trigger;
|
|
4863
|
+
const trigger = trig && React28.isValidElement(trig) ? React28.cloneElement(trig, {
|
|
4864
|
+
"aria-haspopup": "dialog",
|
|
4865
|
+
"aria-expanded": open,
|
|
4866
|
+
"data-aura-trigger": trigId,
|
|
4867
|
+
onClick: function(e) {
|
|
4868
|
+
const own2 = trig.props.onClick;
|
|
4869
|
+
if (own2) own2(e);
|
|
4870
|
+
if (e.defaultPrevented) return;
|
|
4871
|
+
if (props.open === void 0) openState[1](true);
|
|
4872
|
+
if (props.onOpen) props.onOpen();
|
|
4873
|
+
}
|
|
4874
|
+
}) : null;
|
|
4875
|
+
if (!modal.ready) return trigger;
|
|
4841
4876
|
const rest = omit(props, [
|
|
4842
|
-
"
|
|
4843
|
-
"
|
|
4844
|
-
"
|
|
4845
|
-
"
|
|
4846
|
-
"children",
|
|
4847
|
-
"
|
|
4848
|
-
"
|
|
4877
|
+
"open",
|
|
4878
|
+
"onClose",
|
|
4879
|
+
"title",
|
|
4880
|
+
"description",
|
|
4881
|
+
"children",
|
|
4882
|
+
"footer",
|
|
4883
|
+
"size",
|
|
4884
|
+
"dismissible",
|
|
4885
|
+
"dismissOnScrim",
|
|
4886
|
+
"role",
|
|
4887
|
+
"autoFocus",
|
|
4888
|
+
"className",
|
|
4889
|
+
"trigger",
|
|
4890
|
+
"onOpen",
|
|
4891
|
+
"finalFocus",
|
|
4892
|
+
"onCloseComplete",
|
|
4893
|
+
"aria-labelledby",
|
|
4894
|
+
"aria-describedby",
|
|
4895
|
+
"aria-modal"
|
|
4896
|
+
]);
|
|
4897
|
+
const panel = (0, import_react_dom7.createPortal)(
|
|
4898
|
+
/* @__PURE__ */ React28.createElement("div", { className: "aura-dialog-layer", "data-density": density, onKeyDown: modal.onKeyDown }, /* @__PURE__ */ React28.createElement(
|
|
4899
|
+
"div",
|
|
4900
|
+
{
|
|
4901
|
+
className: "aura-scrim",
|
|
4902
|
+
onClick: scrimCloses ? close : void 0,
|
|
4903
|
+
onMouseDown: scrimCloses ? void 0 : function(e) {
|
|
4904
|
+
e.preventDefault();
|
|
4905
|
+
},
|
|
4906
|
+
"aria-hidden": true
|
|
4907
|
+
}
|
|
4908
|
+
), /* @__PURE__ */ React28.createElement(
|
|
4909
|
+
"div",
|
|
4910
|
+
{
|
|
4911
|
+
...rest,
|
|
4912
|
+
ref: merged,
|
|
4913
|
+
role: props.role || "dialog",
|
|
4914
|
+
"aria-modal": true,
|
|
4915
|
+
"aria-labelledby": titleId,
|
|
4916
|
+
"aria-describedby": cx(props.description ? descId : "", props["aria-describedby"]) || void 0,
|
|
4917
|
+
tabIndex: -1,
|
|
4918
|
+
className: cx("aura-dialog", "aura-dialog--" + (props.size || "md"), props.className)
|
|
4919
|
+
},
|
|
4920
|
+
/* @__PURE__ */ React28.createElement("div", { className: "aura-dialog__head" }, /* @__PURE__ */ React28.createElement("h2", { className: "aura-dialog__title", id: titleId }, props.title), props.dismissible !== false ? /* @__PURE__ */ React28.createElement(IconButton, { icon: /* @__PURE__ */ React28.createElement(IconX, null), label: t.close, className: "aura-dialog__close", onClick: close }) : null),
|
|
4921
|
+
props.description ? /* @__PURE__ */ React28.createElement("p", { className: "aura-dialog__desc", id: descId }, props.description) : null,
|
|
4922
|
+
/* @__PURE__ */ React28.createElement(DialogClose.Provider, { value: closeNow }, props.children ? /* @__PURE__ */ React28.createElement("div", { className: "aura-dialog__body" }, props.children) : null, props.footer ? /* @__PURE__ */ React28.createElement("div", { className: "aura-dialog__foot" }, props.footer) : null)
|
|
4923
|
+
)),
|
|
4924
|
+
document.body
|
|
4925
|
+
);
|
|
4926
|
+
return trigger ? /* @__PURE__ */ React28.createElement(React28.Fragment, null, trigger, panel) : panel;
|
|
4927
|
+
});
|
|
4928
|
+
var Drawer = React28.forwardRef(function Drawer2(props, ref) {
|
|
4929
|
+
const t = useStrings();
|
|
4930
|
+
const density = useDensity();
|
|
4931
|
+
const own = React28.useRef(null), merged = useMergedRef(ref, own), titleId = uid(), descId = uid();
|
|
4932
|
+
function close() {
|
|
4933
|
+
if (props.dismissible !== false && props.onClose) props.onClose();
|
|
4934
|
+
}
|
|
4935
|
+
const modal = useModal(props.open, own, {
|
|
4936
|
+
autoFocus: props.autoFocus,
|
|
4937
|
+
onEscape: close,
|
|
4938
|
+
bodySelector: ".aura-drawer__body",
|
|
4939
|
+
footSelector: ".aura-drawer__foot",
|
|
4940
|
+
finalFocus: props.finalFocus,
|
|
4941
|
+
onCloseComplete: props.onCloseComplete
|
|
4942
|
+
});
|
|
4943
|
+
if (!modal.ready) return null;
|
|
4944
|
+
const side = props.side === "left" ? "left" : "right";
|
|
4945
|
+
const rest = omit(props, [
|
|
4946
|
+
"open",
|
|
4947
|
+
"onClose",
|
|
4948
|
+
"side",
|
|
4949
|
+
"size",
|
|
4950
|
+
"title",
|
|
4951
|
+
"description",
|
|
4952
|
+
"children",
|
|
4953
|
+
"footer",
|
|
4954
|
+
"dismissible",
|
|
4955
|
+
"dismissOnScrim",
|
|
4956
|
+
"autoFocus",
|
|
4957
|
+
"aria-label",
|
|
4958
|
+
"aria-describedby",
|
|
4959
|
+
"aria-labelledby",
|
|
4960
|
+
"className",
|
|
4961
|
+
"closeLabel",
|
|
4962
|
+
"closeProps",
|
|
4963
|
+
"finalFocus",
|
|
4964
|
+
"onCloseComplete"
|
|
4965
|
+
]);
|
|
4966
|
+
const drawerScrimCloses = props.dismissible !== false && props.dismissOnScrim !== false;
|
|
4967
|
+
return (0, import_react_dom7.createPortal)(
|
|
4968
|
+
/* @__PURE__ */ React28.createElement("div", { className: "aura-dialog-layer aura-drawer-layer", "data-density": density, onKeyDown: modal.onKeyDown }, /* @__PURE__ */ React28.createElement(
|
|
4969
|
+
"div",
|
|
4970
|
+
{
|
|
4971
|
+
className: "aura-scrim",
|
|
4972
|
+
onClick: drawerScrimCloses ? close : void 0,
|
|
4973
|
+
onMouseDown: !drawerScrimCloses ? function(e) {
|
|
4974
|
+
e.preventDefault();
|
|
4975
|
+
} : void 0,
|
|
4976
|
+
"aria-hidden": true
|
|
4977
|
+
}
|
|
4978
|
+
), /* @__PURE__ */ React28.createElement(
|
|
4979
|
+
"div",
|
|
4980
|
+
{
|
|
4981
|
+
...rest,
|
|
4982
|
+
ref: merged,
|
|
4983
|
+
role: "dialog",
|
|
4984
|
+
"aria-modal": true,
|
|
4985
|
+
"aria-labelledby": props.title ? titleId : props["aria-labelledby"],
|
|
4986
|
+
"aria-label": props.title ? void 0 : props["aria-label"],
|
|
4987
|
+
"aria-describedby": cx(props.description ? descId : "", props["aria-describedby"]) || void 0,
|
|
4988
|
+
tabIndex: -1,
|
|
4989
|
+
className: cx("aura-drawer", "aura-drawer--" + side, "aura-drawer--" + (props.size || "md"), props.className)
|
|
4990
|
+
},
|
|
4991
|
+
props.title || props.dismissible !== false ? /* @__PURE__ */ React28.createElement("div", { className: "aura-drawer__head" }, props.title ? /* @__PURE__ */ React28.createElement("h2", { className: "aura-drawer__title", id: titleId }, props.title) : /* @__PURE__ */ React28.createElement("span", { style: { flex: 1 } }), props.dismissible !== false ? /* @__PURE__ */ React28.createElement(
|
|
4992
|
+
IconButton,
|
|
4993
|
+
{
|
|
4994
|
+
...props.closeProps,
|
|
4995
|
+
icon: /* @__PURE__ */ React28.createElement(IconX, null),
|
|
4996
|
+
label: props.closeLabel || t.close,
|
|
4997
|
+
onClick: function(e) {
|
|
4998
|
+
const own2 = props.closeProps && props.closeProps.onClick;
|
|
4999
|
+
if (own2) own2(e);
|
|
5000
|
+
if (!e.defaultPrevented) close();
|
|
5001
|
+
}
|
|
5002
|
+
}
|
|
5003
|
+
) : null) : null,
|
|
5004
|
+
props.description ? /* @__PURE__ */ React28.createElement("p", { className: "aura-drawer__desc", id: descId }, props.description) : null,
|
|
5005
|
+
/* @__PURE__ */ React28.createElement("div", { className: "aura-drawer__body" }, props.children),
|
|
5006
|
+
props.footer ? /* @__PURE__ */ React28.createElement("div", { className: "aura-drawer__foot" }, props.footer) : null
|
|
5007
|
+
)),
|
|
5008
|
+
document.body
|
|
5009
|
+
);
|
|
5010
|
+
});
|
|
5011
|
+
|
|
5012
|
+
// src/Tag.tsx
|
|
5013
|
+
var React30 = __toESM(require("react"), 1);
|
|
5014
|
+
|
|
5015
|
+
// src/Tooltip.tsx
|
|
5016
|
+
var React29 = __toESM(require("react"), 1);
|
|
5017
|
+
var import_react_dom8 = require("react-dom");
|
|
5018
|
+
var Tooltip = React29.forwardRef(function Tooltip2(props, ref) {
|
|
5019
|
+
const id = uid(), st = React29.useState(false), open = props.open !== void 0 ? props.open : st[0], set = st[1];
|
|
5020
|
+
const anchor = React29.useRef(null), anchorMerged = useMergedRef(ref, anchor), tip2 = React29.useRef(null), timer2 = React29.useRef(void 0);
|
|
5021
|
+
const pos = React29.useState(null), mounted = useMounted();
|
|
5022
|
+
function show3(now) {
|
|
5023
|
+
clearTimeout(timer2.current);
|
|
5024
|
+
timer2.current = setTimeout(
|
|
5025
|
+
function() {
|
|
5026
|
+
set(true);
|
|
5027
|
+
},
|
|
5028
|
+
now ? 0 : props.delay == null ? 400 : props.delay
|
|
5029
|
+
);
|
|
5030
|
+
}
|
|
5031
|
+
function hide2() {
|
|
5032
|
+
clearTimeout(timer2.current);
|
|
5033
|
+
set(false);
|
|
5034
|
+
}
|
|
5035
|
+
function hideSoon2() {
|
|
5036
|
+
clearTimeout(timer2.current);
|
|
5037
|
+
timer2.current = setTimeout(function() {
|
|
5038
|
+
set(false);
|
|
5039
|
+
}, 120);
|
|
5040
|
+
}
|
|
5041
|
+
React29.useEffect(function() {
|
|
5042
|
+
return function() {
|
|
5043
|
+
clearTimeout(timer2.current);
|
|
5044
|
+
};
|
|
5045
|
+
}, []);
|
|
5046
|
+
function place2() {
|
|
5047
|
+
if (!anchor.current || !tip2.current) return;
|
|
5048
|
+
const r2 = anchor.current.getBoundingClientRect(), t = tip2.current.getBoundingClientRect();
|
|
5049
|
+
const vw = window.innerWidth, vh = window.innerHeight, gap = 8, m = 8;
|
|
5050
|
+
let side = props.side || "top";
|
|
5051
|
+
if (side === "top" && r2.top - t.height - gap < m && r2.bottom + gap + t.height <= vh - m) side = "bottom";
|
|
5052
|
+
else if (side === "bottom" && r2.bottom + gap + t.height > vh - m && r2.top - t.height - gap >= m) side = "top";
|
|
5053
|
+
else if (side === "left" && r2.left - t.width - gap < m && r2.right + gap + t.width <= vw - m) side = "right";
|
|
5054
|
+
else if (side === "right" && r2.right + gap + t.width > vw - m && r2.left - t.width - gap >= m) side = "left";
|
|
5055
|
+
const clampX = function(x) {
|
|
5056
|
+
return Math.max(m, Math.min(x, vw - t.width - m));
|
|
5057
|
+
};
|
|
5058
|
+
const clampY = function(y) {
|
|
5059
|
+
return Math.max(m, Math.min(y, vh - t.height - m));
|
|
5060
|
+
};
|
|
5061
|
+
let top, left;
|
|
5062
|
+
if (side === "top" || side === "bottom") {
|
|
5063
|
+
top = clampY(side === "top" ? r2.top - t.height - gap : r2.bottom + gap);
|
|
5064
|
+
left = clampX(r2.left + r2.width / 2 - t.width / 2);
|
|
5065
|
+
} else {
|
|
5066
|
+
left = side === "left" ? r2.left - t.width - gap : r2.right + gap;
|
|
5067
|
+
left = clampX(left);
|
|
5068
|
+
top = clampY(r2.top + r2.height / 2 - t.height / 2);
|
|
5069
|
+
}
|
|
5070
|
+
pos[1]({ top, left });
|
|
5071
|
+
}
|
|
5072
|
+
useIsoLayoutEffect(
|
|
5073
|
+
function() {
|
|
5074
|
+
if (!open) return;
|
|
5075
|
+
place2();
|
|
5076
|
+
window.addEventListener("scroll", place2, true);
|
|
5077
|
+
window.addEventListener("resize", place2);
|
|
5078
|
+
return function() {
|
|
5079
|
+
window.removeEventListener("scroll", place2, true);
|
|
5080
|
+
window.removeEventListener("resize", place2);
|
|
5081
|
+
};
|
|
5082
|
+
},
|
|
5083
|
+
[open, mounted]
|
|
5084
|
+
);
|
|
5085
|
+
React29.useEffect(
|
|
5086
|
+
function() {
|
|
5087
|
+
if (!open) return;
|
|
5088
|
+
function esc(e) {
|
|
5089
|
+
if (e.key === "Escape") hide2();
|
|
5090
|
+
}
|
|
5091
|
+
document.addEventListener("keydown", esc);
|
|
5092
|
+
return function() {
|
|
5093
|
+
document.removeEventListener("keydown", esc);
|
|
5094
|
+
};
|
|
5095
|
+
},
|
|
5096
|
+
[open]
|
|
5097
|
+
);
|
|
5098
|
+
const child = React29.Children.only(props.children);
|
|
5099
|
+
const trigger = /* @__PURE__ */ React29.createElement(
|
|
5100
|
+
"span",
|
|
5101
|
+
{
|
|
5102
|
+
ref: anchorMerged,
|
|
5103
|
+
className: "aura-tooltip-anchor",
|
|
5104
|
+
onMouseEnter: function() {
|
|
5105
|
+
show3(false);
|
|
5106
|
+
},
|
|
5107
|
+
onMouseLeave: hideSoon2,
|
|
5108
|
+
onFocus: function() {
|
|
5109
|
+
show3(true);
|
|
5110
|
+
},
|
|
5111
|
+
onBlur: hide2
|
|
5112
|
+
},
|
|
5113
|
+
React29.cloneElement(child, { "aria-describedby": open ? id : child.props["aria-describedby"] })
|
|
5114
|
+
);
|
|
5115
|
+
return /* @__PURE__ */ React29.createElement(React29.Fragment, null, trigger, open && mounted ? (0, import_react_dom8.createPortal)(
|
|
5116
|
+
/* @__PURE__ */ React29.createElement(
|
|
5117
|
+
"div",
|
|
5118
|
+
{
|
|
5119
|
+
ref: tip2,
|
|
5120
|
+
id,
|
|
5121
|
+
role: "tooltip",
|
|
5122
|
+
onMouseEnter: function() {
|
|
5123
|
+
clearTimeout(timer2.current);
|
|
5124
|
+
},
|
|
5125
|
+
onMouseLeave: hideSoon2,
|
|
5126
|
+
className: "aura-tooltip aura-tooltip--hoverable",
|
|
5127
|
+
style: { top: pos[0] ? pos[0].top : -9999, left: pos[0] ? pos[0].left : -9999 }
|
|
5128
|
+
},
|
|
5129
|
+
props.content
|
|
5130
|
+
),
|
|
5131
|
+
document.body
|
|
5132
|
+
) : null);
|
|
5133
|
+
});
|
|
5134
|
+
|
|
5135
|
+
// src/Tag.tsx
|
|
5136
|
+
function textOf2(node, all) {
|
|
5137
|
+
if (node == null || typeof node === "boolean") return "";
|
|
5138
|
+
if (typeof node === "string" || typeof node === "number") return String(node);
|
|
5139
|
+
if (Array.isArray(node))
|
|
5140
|
+
return node.map(function(n3) {
|
|
5141
|
+
return textOf2(n3, all);
|
|
5142
|
+
}).join("");
|
|
5143
|
+
if (React30.isValidElement(node)) {
|
|
5144
|
+
const p = node.props;
|
|
5145
|
+
return !all && (p["aria-hidden"] === true || p["aria-hidden"] === "true") ? "" : textOf2(p.children, all);
|
|
5146
|
+
}
|
|
5147
|
+
return "";
|
|
5148
|
+
}
|
|
5149
|
+
var Tag = React30.forwardRef(function Tag2(props, ref) {
|
|
5150
|
+
const t = useStrings();
|
|
5151
|
+
const selectable = props.onClick != null || props.selected != null;
|
|
5152
|
+
const rest = omit(props, [
|
|
5153
|
+
"onRemove",
|
|
5154
|
+
"selected",
|
|
5155
|
+
"icon",
|
|
5156
|
+
"className",
|
|
5157
|
+
"children",
|
|
5158
|
+
"disabled",
|
|
5159
|
+
"removeLabel",
|
|
4849
5160
|
"touchHeight"
|
|
4850
5161
|
]);
|
|
4851
|
-
const textRef =
|
|
5162
|
+
const textRef = React30.useRef(null);
|
|
4852
5163
|
useAutoTip();
|
|
4853
|
-
const cutState =
|
|
4854
|
-
const check =
|
|
5164
|
+
const cutState = React30.useState(false), isCut = cutState[0];
|
|
5165
|
+
const check = React30.useCallback(function() {
|
|
4855
5166
|
const el = textRef.current;
|
|
4856
5167
|
if (el) cutState[1](el.scrollWidth > el.clientWidth + 1);
|
|
4857
5168
|
}, []);
|
|
@@ -4870,11 +5181,11 @@ var Tag = React28.forwardRef(function Tag2(props, ref) {
|
|
|
4870
5181
|
);
|
|
4871
5182
|
const fullText = isCut ? textOf2(props.children, true).replace(/\s+/g, " ").trim() : "";
|
|
4872
5183
|
const inner = [
|
|
4873
|
-
props.icon ? /* @__PURE__ */
|
|
4874
|
-
/* @__PURE__ */
|
|
5184
|
+
props.icon ? /* @__PURE__ */ React30.createElement(Icon, { key: "i", name: props.icon, size: 14 }) : null,
|
|
5185
|
+
/* @__PURE__ */ React30.createElement("span", { key: "t", ref: textRef, className: "aura-tag__text", "data-aura-tip": fullText || void 0 }, props.children)
|
|
4875
5186
|
];
|
|
4876
5187
|
if (selectable) {
|
|
4877
|
-
return /* @__PURE__ */
|
|
5188
|
+
return /* @__PURE__ */ React30.createElement(
|
|
4878
5189
|
"button",
|
|
4879
5190
|
{
|
|
4880
5191
|
...rest,
|
|
@@ -4889,7 +5200,7 @@ var Tag = React28.forwardRef(function Tag2(props, ref) {
|
|
|
4889
5200
|
props.className
|
|
4890
5201
|
)
|
|
4891
5202
|
},
|
|
4892
|
-
props.selected ? /* @__PURE__ */
|
|
5203
|
+
props.selected ? /* @__PURE__ */ React30.createElement(Icon, { name: /* @__PURE__ */ React30.createElement(IconCheck, null), size: 14 }) : inner[0],
|
|
4893
5204
|
inner[1]
|
|
4894
5205
|
);
|
|
4895
5206
|
}
|
|
@@ -4899,8 +5210,8 @@ var Tag = React28.forwardRef(function Tag2(props, ref) {
|
|
|
4899
5210
|
"tag-remove-label",
|
|
4900
5211
|
'Tag: the remove button has no name \u2014 its children have no text. Pass removeLabel (e.g. "Remove Acme AB").'
|
|
4901
5212
|
);
|
|
4902
|
-
return /* @__PURE__ */
|
|
4903
|
-
const btn = /* @__PURE__ */
|
|
5213
|
+
return /* @__PURE__ */ React30.createElement("span", { ...rest, ref, className: cx("aura-tag", props.disabled && "is-disabled", props.className) }, inner, props.onRemove && !props.disabled ? function() {
|
|
5214
|
+
const btn = /* @__PURE__ */ React30.createElement(
|
|
4904
5215
|
"button",
|
|
4905
5216
|
{
|
|
4906
5217
|
type: "button",
|
|
@@ -4908,23 +5219,41 @@ var Tag = React28.forwardRef(function Tag2(props, ref) {
|
|
|
4908
5219
|
"aria-label": props.removeLabel || t.remove(name),
|
|
4909
5220
|
onClick: props.onRemove
|
|
4910
5221
|
},
|
|
4911
|
-
/* @__PURE__ */
|
|
5222
|
+
/* @__PURE__ */ React30.createElement(Icon, { name: /* @__PURE__ */ React30.createElement(IconX, null), size: 14 })
|
|
4912
5223
|
);
|
|
4913
|
-
return /* @__PURE__ */
|
|
5224
|
+
return /* @__PURE__ */ React30.createElement(Tooltip, { content: fullText, open: fullText ? void 0 : false }, btn);
|
|
4914
5225
|
}() : null);
|
|
4915
5226
|
});
|
|
4916
5227
|
|
|
5228
|
+
// src/breakpoints.ts
|
|
5229
|
+
var breakpoints = { sm: 640, md: 768, lg: 1024, xl: 1280 };
|
|
5230
|
+
var ORDER = ["base", "sm", "md", "lg", "xl"];
|
|
5231
|
+
function respVars(prefix, value, map2) {
|
|
5232
|
+
const style = {};
|
|
5233
|
+
if (value == null) return style;
|
|
5234
|
+
if (typeof value !== "object") value = { base: value };
|
|
5235
|
+
let byBp = value, cur2;
|
|
5236
|
+
ORDER.forEach(function(k) {
|
|
5237
|
+
if (byBp[k] !== void 0) cur2 = map2 ? map2(byBp[k]) : byBp[k];
|
|
5238
|
+
if (cur2 !== void 0) style["--" + prefix + "-" + k] = cur2;
|
|
5239
|
+
});
|
|
5240
|
+
return style;
|
|
5241
|
+
}
|
|
5242
|
+
var space = function(v) {
|
|
5243
|
+
return typeof v === "number" ? "var(--aura-space-" + v + ")" : v;
|
|
5244
|
+
};
|
|
5245
|
+
|
|
4917
5246
|
// src/FilterBar.tsx
|
|
4918
|
-
var FilterBar =
|
|
5247
|
+
var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
4919
5248
|
const t = useStrings();
|
|
4920
5249
|
const id = uid();
|
|
4921
5250
|
const hasSearch = !!props.onSearchChange;
|
|
4922
|
-
const draft =
|
|
4923
|
-
const timer2 =
|
|
4924
|
-
const sent =
|
|
4925
|
-
const onChange =
|
|
5251
|
+
const draft = React31.useState(props.search || "");
|
|
5252
|
+
const timer2 = React31.useRef(null);
|
|
5253
|
+
const sent = React31.useRef(props.search || "");
|
|
5254
|
+
const onChange = React31.useRef(props.onSearchChange);
|
|
4926
5255
|
onChange.current = props.onSearchChange;
|
|
4927
|
-
|
|
5256
|
+
React31.useEffect(
|
|
4928
5257
|
function() {
|
|
4929
5258
|
if ((props.search || "") !== sent.current) {
|
|
4930
5259
|
sent.current = props.search || "";
|
|
@@ -4933,7 +5262,7 @@ var FilterBar = React29.forwardRef(function FilterBar2(props, ref) {
|
|
|
4933
5262
|
},
|
|
4934
5263
|
[props.search]
|
|
4935
5264
|
);
|
|
4936
|
-
|
|
5265
|
+
React31.useEffect(function() {
|
|
4937
5266
|
return function() {
|
|
4938
5267
|
if (timer2.current) clearTimeout(timer2.current);
|
|
4939
5268
|
};
|
|
@@ -4956,167 +5285,172 @@ var FilterBar = React29.forwardRef(function FilterBar2(props, ref) {
|
|
|
4956
5285
|
);
|
|
4957
5286
|
}
|
|
4958
5287
|
const filters = props.filters || [];
|
|
4959
|
-
const
|
|
4960
|
-
const
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
onChange: function(e) {
|
|
4986
|
-
type(e.target.value);
|
|
4987
|
-
},
|
|
4988
|
-
onKeyDown: function(e) {
|
|
4989
|
-
if (e.key === "Enter") send(draft[0]);
|
|
4990
|
-
if (e.key === "Escape" && draft[0]) {
|
|
4991
|
-
e.preventDefault();
|
|
4992
|
-
draft[1]("");
|
|
4993
|
-
send("");
|
|
4994
|
-
}
|
|
4995
|
-
}
|
|
4996
|
-
}
|
|
4997
|
-
), draft[0] ? /* @__PURE__ */ React29.createElement(
|
|
4998
|
-
IconButton,
|
|
4999
|
-
{
|
|
5000
|
-
icon: /* @__PURE__ */ React29.createElement(IconX, null),
|
|
5001
|
-
label: t.clear((props.searchLabel || t.search).toLowerCase()),
|
|
5002
|
-
className: "aura-filterbar__clear-search",
|
|
5003
|
-
onClick: function() {
|
|
5004
|
-
draft[1]("");
|
|
5005
|
-
send("");
|
|
5006
|
-
}
|
|
5007
|
-
}
|
|
5008
|
-
) : null) : null, props.children ? /* @__PURE__ */ React29.createElement("div", { className: "aura-filterbar__controls" }, props.children) : null, /* @__PURE__ */ React29.createElement("span", { className: "aura-filterbar__spacer" }), count != null ? /* @__PURE__ */ React29.createElement("span", { className: "aura-filterbar__count", "aria-live": "polite" }, count) : null, props.actions ? /* @__PURE__ */ React29.createElement("div", { className: "aura-filterbar__actions" }, props.actions) : null),
|
|
5009
|
-
filters.length || props.onClearAll && anything ? /* @__PURE__ */ React29.createElement("div", { className: "aura-filterbar__chips" }, filters.map(function(f) {
|
|
5010
|
-
return /* @__PURE__ */ React29.createElement(Tag, { key: f.id, onRemove: f.onRemove }, f.label);
|
|
5011
|
-
}), props.onClearAll && anything ? /* @__PURE__ */ React29.createElement(
|
|
5012
|
-
"button",
|
|
5013
|
-
{
|
|
5014
|
-
type: "button",
|
|
5015
|
-
className: "aura-filterbar__clear",
|
|
5016
|
-
onClick: function() {
|
|
5017
|
-
draft[1]("");
|
|
5018
|
-
sent.current = "";
|
|
5019
|
-
if (timer2.current) clearTimeout(timer2.current);
|
|
5020
|
-
props.onClearAll();
|
|
5021
|
-
}
|
|
5022
|
-
},
|
|
5023
|
-
t.clearFilters
|
|
5024
|
-
) : null) : null
|
|
5025
|
-
);
|
|
5026
|
-
});
|
|
5027
|
-
|
|
5028
|
-
// src/Command.tsx
|
|
5029
|
-
var React31 = __toESM(require("react"), 1);
|
|
5030
|
-
var import_react_dom8 = require("react-dom");
|
|
5031
|
-
|
|
5032
|
-
// src/useModal.tsx
|
|
5033
|
-
var React30 = __toESM(require("react"), 1);
|
|
5034
|
-
var locks = 0;
|
|
5035
|
-
var savedOverflow = "";
|
|
5036
|
-
function lockScroll() {
|
|
5037
|
-
const body = document.body;
|
|
5038
|
-
if (locks === 0) savedOverflow = body.style.overflow;
|
|
5039
|
-
locks++;
|
|
5040
|
-
body.style.overflow = "hidden";
|
|
5041
|
-
let done = false;
|
|
5042
|
-
return function() {
|
|
5043
|
-
if (done) return;
|
|
5044
|
-
done = true;
|
|
5045
|
-
locks--;
|
|
5046
|
-
if (locks === 0) body.style.overflow = savedOverflow;
|
|
5047
|
-
};
|
|
5048
|
-
}
|
|
5049
|
-
function tabbable(el) {
|
|
5050
|
-
const all = Array.prototype.filter.call(el.querySelectorAll(FOCUSABLE), function(c) {
|
|
5051
|
-
return c.tabIndex >= 0;
|
|
5052
|
-
});
|
|
5053
|
-
const shown = all.filter(function(c) {
|
|
5054
|
-
return c.getClientRects().length > 0;
|
|
5055
|
-
});
|
|
5056
|
-
return shown.length ? shown : all;
|
|
5057
|
-
}
|
|
5058
|
-
function useModal(open, ref, opts) {
|
|
5059
|
-
const mounted = useMounted();
|
|
5060
|
-
const prev = React30.useRef(null);
|
|
5061
|
-
const o = opts || {};
|
|
5062
|
-
const latest = React30.useRef(o);
|
|
5063
|
-
latest.current = o;
|
|
5064
|
-
React30.useEffect(
|
|
5288
|
+
const hasChildren = React31.Children.toArray(props.children).length > 0;
|
|
5289
|
+
const collapse = props.collapseBelow && hasChildren ? props.collapseBelow : null;
|
|
5290
|
+
const sheet = React31.useState(false), open = !!collapse && sheet[0];
|
|
5291
|
+
const sheetId = id + "-filters";
|
|
5292
|
+
const doneRef = React31.useRef(null), moreRef = React31.useRef(null), own = React31.useRef(null), rootRef = useMergedRef(ref, own);
|
|
5293
|
+
if (collapse)
|
|
5294
|
+
React31.Children.forEach(props.children, function(c) {
|
|
5295
|
+
if (!React31.isValidElement(c) || c.type === Button || c.type === IconButton) return;
|
|
5296
|
+
const p = c.props;
|
|
5297
|
+
if (p.defaultValue !== void 0 || p.defaultChecked !== void 0 || "label" in p && !("value" in p) && !("selected" in p) && !("checked" in p))
|
|
5298
|
+
devWarnOnce(
|
|
5299
|
+
"filterbar-uncontrolled",
|
|
5300
|
+
"FilterBar collapseBelow: a filter without `value` resets when the Filters sheet opens or closes (its children move there and back). Keep each filter's value with the page: `value` + `onChange`."
|
|
5301
|
+
);
|
|
5302
|
+
});
|
|
5303
|
+
function backTo() {
|
|
5304
|
+
const m = moreRef.current;
|
|
5305
|
+
if (m && m.getClientRects().length) return m;
|
|
5306
|
+
const bar = own.current;
|
|
5307
|
+
if (!bar) return null;
|
|
5308
|
+
return bar.querySelector(
|
|
5309
|
+
'.aura-filterbar__controls :is(button, input, select, [tabindex]):not([disabled]):not([tabindex="-1"])'
|
|
5310
|
+
) || bar.querySelector(".aura-filterbar__search input");
|
|
5311
|
+
}
|
|
5312
|
+
const applied = props.filterCount != null ? props.filterCount : filters.length;
|
|
5313
|
+
React31.useEffect(
|
|
5065
5314
|
function() {
|
|
5066
|
-
if (!open || !
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
}).join(",");
|
|
5075
|
-
const list = el.querySelectorAll(sel);
|
|
5076
|
-
for (let i = 0; i < list.length; i++)
|
|
5077
|
-
if (list[i].tabIndex >= 0 && list[i].getClientRects().length > 0) return list[i];
|
|
5078
|
-
return null;
|
|
5079
|
-
};
|
|
5080
|
-
const target = el && (el.querySelector("[data-autofocus]") || firstIn(o.bodySelector) || firstIn(o.footSelector) || el);
|
|
5081
|
-
if (target && o.autoFocus !== false) target.focus();
|
|
5315
|
+
if (!open || !collapse || typeof window.matchMedia !== "function") return;
|
|
5316
|
+
const mq = window.matchMedia("(min-width: " + breakpoints[collapse] + "px)");
|
|
5317
|
+
function check() {
|
|
5318
|
+
if (mq.matches) sheet[1](false);
|
|
5319
|
+
}
|
|
5320
|
+
check();
|
|
5321
|
+
if (mq.addEventListener) mq.addEventListener("change", check);
|
|
5322
|
+
else mq.addListener(check);
|
|
5082
5323
|
return function() {
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
const ff = l.finalFocus;
|
|
5086
|
-
const to = ff ? typeof ff === "function" ? ff() : ff.current : null;
|
|
5087
|
-
const back = to && to.isConnected ? to : prev.current;
|
|
5088
|
-
if (back && back.focus) back.focus();
|
|
5089
|
-
if (l.onCloseComplete) l.onCloseComplete();
|
|
5324
|
+
if (mq.removeEventListener) mq.removeEventListener("change", check);
|
|
5325
|
+
else mq.removeListener(check);
|
|
5090
5326
|
};
|
|
5091
5327
|
},
|
|
5092
|
-
[open,
|
|
5093
|
-
);
|
|
5094
|
-
function
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5328
|
+
[open, collapse]
|
|
5329
|
+
);
|
|
5330
|
+
function clearAll() {
|
|
5331
|
+
draft[1]("");
|
|
5332
|
+
sent.current = "";
|
|
5333
|
+
if (timer2.current) clearTimeout(timer2.current);
|
|
5334
|
+
props.onClearAll();
|
|
5335
|
+
}
|
|
5336
|
+
const anything = filters.length > 0 || !!(props.search || draft[0]);
|
|
5337
|
+
const count = props.resultCount == null ? null : typeof props.resultCount === "number" ? t.results(props.resultCount) : props.resultCount;
|
|
5338
|
+
const searchBox = hasSearch ? /* @__PURE__ */ React31.createElement("div", { className: "aura-input has-icon aura-filterbar__search" }, /* @__PURE__ */ React31.createElement(Icon, { name: /* @__PURE__ */ React31.createElement(IconSearch, null), className: "aura-input__icon" }), /* @__PURE__ */ React31.createElement(
|
|
5339
|
+
"input",
|
|
5340
|
+
{
|
|
5341
|
+
id,
|
|
5342
|
+
type: "search",
|
|
5343
|
+
className: "aura-input__control",
|
|
5344
|
+
"aria-label": props.searchLabel || t.search,
|
|
5345
|
+
placeholder: props.searchPlaceholder || props.searchLabel || t.search,
|
|
5346
|
+
value: draft[0],
|
|
5347
|
+
onChange: function(e) {
|
|
5348
|
+
type(e.target.value);
|
|
5349
|
+
},
|
|
5350
|
+
onKeyDown: function(e) {
|
|
5351
|
+
if (e.key === "Enter") send(draft[0]);
|
|
5352
|
+
if (e.key === "Escape" && draft[0]) {
|
|
5353
|
+
e.preventDefault();
|
|
5354
|
+
draft[1]("");
|
|
5355
|
+
send("");
|
|
5356
|
+
}
|
|
5357
|
+
}
|
|
5106
5358
|
}
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5359
|
+
), draft[0] ? /* @__PURE__ */ React31.createElement(
|
|
5360
|
+
IconButton,
|
|
5361
|
+
{
|
|
5362
|
+
icon: /* @__PURE__ */ React31.createElement(IconX, null),
|
|
5363
|
+
label: t.clear((props.searchLabel || t.search).toLowerCase()),
|
|
5364
|
+
className: "aura-filterbar__clear-search",
|
|
5365
|
+
onClick: function() {
|
|
5366
|
+
draft[1]("");
|
|
5367
|
+
send("");
|
|
5368
|
+
}
|
|
5114
5369
|
}
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5370
|
+
) : null) : null;
|
|
5371
|
+
const more = collapse ? /* @__PURE__ */ React31.createElement(
|
|
5372
|
+
Button,
|
|
5373
|
+
{
|
|
5374
|
+
ref: moreRef,
|
|
5375
|
+
variant: "secondary",
|
|
5376
|
+
icon: /* @__PURE__ */ React31.createElement(IconSlidersHorizontal, null),
|
|
5377
|
+
className: "aura-filterbar__more",
|
|
5378
|
+
"aria-haspopup": "dialog",
|
|
5379
|
+
"aria-expanded": open,
|
|
5380
|
+
"aria-controls": open ? sheetId : void 0,
|
|
5381
|
+
onClick: function() {
|
|
5382
|
+
sheet[1](true);
|
|
5383
|
+
}
|
|
5384
|
+
},
|
|
5385
|
+
applied > 0 ? /* @__PURE__ */ React31.createElement(React31.Fragment, null, /* @__PURE__ */ React31.createElement("span", { className: "aura-sr-only" }, t.filtersApplied(applied)), /* @__PURE__ */ React31.createElement("span", { "aria-hidden": true }, t.filters + " (" + applied + ")")) : t.filters
|
|
5386
|
+
) : null;
|
|
5387
|
+
return /* @__PURE__ */ React31.createElement(
|
|
5388
|
+
"div",
|
|
5389
|
+
{
|
|
5390
|
+
ref: rootRef,
|
|
5391
|
+
role: "region",
|
|
5392
|
+
"aria-label": props.label || t.filters,
|
|
5393
|
+
className: cx(
|
|
5394
|
+
"aura-filterbar",
|
|
5395
|
+
props.searchGrow && "aura-filterbar--grow",
|
|
5396
|
+
props.controlsLayout === "fill" && "aura-filterbar--fill",
|
|
5397
|
+
props.stackBelow === "lg" && "aura-filterbar--stack-lg",
|
|
5398
|
+
collapse && "aura-filterbar--collapse-" + collapse,
|
|
5399
|
+
touchClass(props.touchHeight),
|
|
5400
|
+
props.className
|
|
5401
|
+
)
|
|
5402
|
+
},
|
|
5403
|
+
/* @__PURE__ */ React31.createElement("div", { className: "aura-filterbar__row" }, collapse ? (
|
|
5404
|
+
/* 5.42: the search and the Filters button share a row of their own below the breakpoint (count and actions
|
|
5405
|
+
* wrap under them); from the breakpoint up this box is display: contents and the bar is as before. */
|
|
5406
|
+
/* @__PURE__ */ React31.createElement("div", { className: cx("aura-filterbar__lead", !hasSearch && "is-alone") }, searchBox, more)
|
|
5407
|
+
) : searchBox, hasChildren && !open ? /* @__PURE__ */ React31.createElement("div", { className: "aura-filterbar__controls" }, props.children) : null, /* @__PURE__ */ React31.createElement("span", { className: "aura-filterbar__spacer" }), count != null ? /* @__PURE__ */ React31.createElement("span", { className: "aura-filterbar__count", "aria-live": "polite" }, count) : null, props.actions ? /* @__PURE__ */ React31.createElement("div", { className: "aura-filterbar__actions" }, props.actions) : null),
|
|
5408
|
+
filters.length || props.onClearAll && anything ? /* @__PURE__ */ React31.createElement("div", { className: "aura-filterbar__chips" }, filters.map(function(f) {
|
|
5409
|
+
return /* @__PURE__ */ React31.createElement(Tag, { key: f.id, onRemove: f.onRemove }, f.label);
|
|
5410
|
+
}), props.onClearAll && anything ? /* @__PURE__ */ React31.createElement("button", { type: "button", className: "aura-filterbar__clear", onClick: clearAll }, t.clearFilters) : null) : null,
|
|
5411
|
+
collapse ? /* @__PURE__ */ React31.createElement(
|
|
5412
|
+
Dialog,
|
|
5413
|
+
{
|
|
5414
|
+
open,
|
|
5415
|
+
onClose: function() {
|
|
5416
|
+
sheet[1](false);
|
|
5417
|
+
},
|
|
5418
|
+
id: sheetId,
|
|
5419
|
+
finalFocus: backTo,
|
|
5420
|
+
title: t.filters,
|
|
5421
|
+
size: "sm",
|
|
5422
|
+
className: "aura-filterbar__sheet",
|
|
5423
|
+
footer: /* @__PURE__ */ React31.createElement(React31.Fragment, null, props.onClearAll && filters.length ? /* @__PURE__ */ React31.createElement(
|
|
5424
|
+
Button,
|
|
5425
|
+
{
|
|
5426
|
+
variant: "secondary",
|
|
5427
|
+
touchHeight: true,
|
|
5428
|
+
onClick: function() {
|
|
5429
|
+
clearAll();
|
|
5430
|
+
if (doneRef.current) doneRef.current.focus();
|
|
5431
|
+
}
|
|
5432
|
+
},
|
|
5433
|
+
t.clearFilters
|
|
5434
|
+
) : null, /* @__PURE__ */ React31.createElement(
|
|
5435
|
+
Button,
|
|
5436
|
+
{
|
|
5437
|
+
ref: doneRef,
|
|
5438
|
+
touchHeight: true,
|
|
5439
|
+
onClick: function() {
|
|
5440
|
+
sheet[1](false);
|
|
5441
|
+
}
|
|
5442
|
+
},
|
|
5443
|
+
t.done
|
|
5444
|
+
))
|
|
5445
|
+
},
|
|
5446
|
+
/* @__PURE__ */ React31.createElement(FilterSheet.Provider, { value: true }, /* @__PURE__ */ React31.createElement("div", { className: "aura-filterbar aura-filterbar--sheet is-touch-always" }, props.children))
|
|
5447
|
+
) : null
|
|
5448
|
+
);
|
|
5449
|
+
});
|
|
5118
5450
|
|
|
5119
5451
|
// src/Command.tsx
|
|
5452
|
+
var React32 = __toESM(require("react"), 1);
|
|
5453
|
+
var import_react_dom9 = require("react-dom");
|
|
5120
5454
|
function isMac() {
|
|
5121
5455
|
return typeof navigator !== "undefined" && /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent);
|
|
5122
5456
|
}
|
|
@@ -5124,21 +5458,21 @@ function Command(props) {
|
|
|
5124
5458
|
const t = useStrings();
|
|
5125
5459
|
const density = useDensity();
|
|
5126
5460
|
const id = uid(), listId = id + "-list";
|
|
5127
|
-
const box =
|
|
5128
|
-
const input =
|
|
5129
|
-
const qState =
|
|
5461
|
+
const box = React32.useRef(null);
|
|
5462
|
+
const input = React32.useRef(null);
|
|
5463
|
+
const qState = React32.useState(""), act = React32.useState(null);
|
|
5130
5464
|
const query = props.query !== void 0 ? props.query : qState[0];
|
|
5131
5465
|
function setQuery(v) {
|
|
5132
5466
|
if (props.query === void 0) qState[1](v);
|
|
5133
5467
|
if (props.onQueryChange) props.onQueryChange(v);
|
|
5134
5468
|
}
|
|
5135
|
-
const openRef =
|
|
5469
|
+
const openRef = React32.useRef(props.open);
|
|
5136
5470
|
openRef.current = props.open;
|
|
5137
5471
|
const close = function() {
|
|
5138
5472
|
props.onOpenChange(false);
|
|
5139
5473
|
};
|
|
5140
5474
|
const modal = useModal(props.open, box, { onEscape: close });
|
|
5141
|
-
|
|
5475
|
+
React32.useEffect(
|
|
5142
5476
|
function() {
|
|
5143
5477
|
if (props.hotkey === false) return;
|
|
5144
5478
|
function onKey2(e) {
|
|
@@ -5154,7 +5488,7 @@ function Command(props) {
|
|
|
5154
5488
|
},
|
|
5155
5489
|
[props.hotkey, props.onOpenChange]
|
|
5156
5490
|
);
|
|
5157
|
-
|
|
5491
|
+
React32.useEffect(
|
|
5158
5492
|
function() {
|
|
5159
5493
|
if (!props.open) {
|
|
5160
5494
|
if (query) setQuery("");
|
|
@@ -5194,7 +5528,7 @@ function Command(props) {
|
|
|
5194
5528
|
const optId = function(i2) {
|
|
5195
5529
|
return id + "-o" + i2;
|
|
5196
5530
|
};
|
|
5197
|
-
|
|
5531
|
+
React32.useEffect(
|
|
5198
5532
|
function() {
|
|
5199
5533
|
if (!box.current || active < 0) return;
|
|
5200
5534
|
const el = box.current.querySelector("#" + CSS.escape(optId(active)));
|
|
@@ -5238,8 +5572,8 @@ function Command(props) {
|
|
|
5238
5572
|
}
|
|
5239
5573
|
if (!modal.ready) return null;
|
|
5240
5574
|
let i = -1;
|
|
5241
|
-
return (0,
|
|
5242
|
-
/* @__PURE__ */
|
|
5575
|
+
return (0, import_react_dom9.createPortal)(
|
|
5576
|
+
/* @__PURE__ */ React32.createElement(
|
|
5243
5577
|
"div",
|
|
5244
5578
|
{
|
|
5245
5579
|
className: "aura-dialog-layer aura-command-layer",
|
|
@@ -5249,8 +5583,8 @@ function Command(props) {
|
|
|
5249
5583
|
e.stopPropagation();
|
|
5250
5584
|
}
|
|
5251
5585
|
},
|
|
5252
|
-
/* @__PURE__ */
|
|
5253
|
-
/* @__PURE__ */
|
|
5586
|
+
/* @__PURE__ */ React32.createElement("div", { className: "aura-scrim", onClick: close, "aria-hidden": true }),
|
|
5587
|
+
/* @__PURE__ */ React32.createElement(
|
|
5254
5588
|
"div",
|
|
5255
5589
|
{
|
|
5256
5590
|
ref: box,
|
|
@@ -5260,7 +5594,7 @@ function Command(props) {
|
|
|
5260
5594
|
tabIndex: -1,
|
|
5261
5595
|
className: cx("aura-command", props.className)
|
|
5262
5596
|
},
|
|
5263
|
-
/* @__PURE__ */
|
|
5597
|
+
/* @__PURE__ */ React32.createElement("div", { className: "aura-command__search" }, /* @__PURE__ */ React32.createElement(Icon, { name: /* @__PURE__ */ React32.createElement(IconSearch, null), className: "aura-command__search-icon" }), /* @__PURE__ */ React32.createElement(
|
|
5264
5598
|
"input",
|
|
5265
5599
|
{
|
|
5266
5600
|
ref: input,
|
|
@@ -5283,8 +5617,8 @@ function Command(props) {
|
|
|
5283
5617
|
},
|
|
5284
5618
|
onKeyDown: onKey
|
|
5285
5619
|
}
|
|
5286
|
-
), /* @__PURE__ */
|
|
5287
|
-
/* @__PURE__ */
|
|
5620
|
+
), /* @__PURE__ */ React32.createElement("kbd", { className: "aura-command__kbd" }, "Esc")),
|
|
5621
|
+
/* @__PURE__ */ React32.createElement("div", { className: "aura-command__list", "aria-busy": props.loading || void 0 }, props.loading ? /* @__PURE__ */ React32.createElement("div", { className: "aura-command__loading" }, /* @__PURE__ */ React32.createElement(Icon, { name: /* @__PURE__ */ React32.createElement(IconLoaderCircle, null), className: "aura-spin" }), t.searching) : null, !flat3.length ? props.loading ? null : /* @__PURE__ */ React32.createElement("div", { className: "aura-command__empty" }, props.empty != null ? props.empty : props.emptyText || t.noMatches) : /* @__PURE__ */ React32.createElement(
|
|
5288
5622
|
"div",
|
|
5289
5623
|
{
|
|
5290
5624
|
id: listId,
|
|
@@ -5294,7 +5628,7 @@ function Command(props) {
|
|
|
5294
5628
|
},
|
|
5295
5629
|
groups.map(function(g, gi) {
|
|
5296
5630
|
const gid = id + "-g" + gi;
|
|
5297
|
-
return /* @__PURE__ */
|
|
5631
|
+
return /* @__PURE__ */ React32.createElement(
|
|
5298
5632
|
"div",
|
|
5299
5633
|
{
|
|
5300
5634
|
key: g.name || gi,
|
|
@@ -5302,11 +5636,11 @@ function Command(props) {
|
|
|
5302
5636
|
"aria-labelledby": g.name ? gid : void 0,
|
|
5303
5637
|
className: "aura-command__group"
|
|
5304
5638
|
},
|
|
5305
|
-
g.name ? /* @__PURE__ */
|
|
5639
|
+
g.name ? /* @__PURE__ */ React32.createElement("div", { className: "aura-command__heading", id: gid, role: "presentation" }, g.name) : null,
|
|
5306
5640
|
g.items.map(function(it) {
|
|
5307
5641
|
i++;
|
|
5308
5642
|
const n3 = i;
|
|
5309
|
-
return /* @__PURE__ */
|
|
5643
|
+
return /* @__PURE__ */ React32.createElement(
|
|
5310
5644
|
"div",
|
|
5311
5645
|
{
|
|
5312
5646
|
key: it.id,
|
|
@@ -5330,210 +5664,22 @@ function Command(props) {
|
|
|
5330
5664
|
run(it);
|
|
5331
5665
|
}
|
|
5332
5666
|
},
|
|
5333
|
-
it.icon ? /* @__PURE__ */
|
|
5334
|
-
/* @__PURE__ */
|
|
5335
|
-
it.shortcut ? /* @__PURE__ */
|
|
5667
|
+
it.icon ? /* @__PURE__ */ React32.createElement(Icon, { name: it.icon }) : null,
|
|
5668
|
+
/* @__PURE__ */ React32.createElement("span", { className: "aura-command__text" }, /* @__PURE__ */ React32.createElement("span", { className: "aura-command__label", id: it.description ? optId(n3) + "-label" : void 0 }, it.label), it.description ? /* @__PURE__ */ React32.createElement("span", { className: "aura-command__desc", id: optId(n3) + "-desc", "aria-hidden": true }, it.description) : null),
|
|
5669
|
+
it.shortcut ? /* @__PURE__ */ React32.createElement("kbd", { className: "aura-command__kbd", id: it.description ? optId(n3) + "-kbd" : void 0 }, it.shortcut) : null
|
|
5336
5670
|
);
|
|
5337
5671
|
})
|
|
5338
5672
|
);
|
|
5339
5673
|
})
|
|
5340
5674
|
)),
|
|
5341
|
-
/* @__PURE__ */
|
|
5342
|
-
/* @__PURE__ */
|
|
5675
|
+
/* @__PURE__ */ React32.createElement("span", { className: "aura-sr-only", role: "status" }, props.loading ? t.searching : query && !flat3.length ? t.noMatches : props.loading === false && query ? t.results(flat3.length) : ""),
|
|
5676
|
+
/* @__PURE__ */ React32.createElement("div", { className: "aura-command__foot", "aria-hidden": true }, t.commandHint, /* @__PURE__ */ React32.createElement("span", { className: "aura-command__mod" }, isMac() ? "\u2318K" : "Ctrl K"))
|
|
5343
5677
|
)
|
|
5344
5678
|
),
|
|
5345
5679
|
document.body
|
|
5346
5680
|
);
|
|
5347
5681
|
}
|
|
5348
5682
|
|
|
5349
|
-
// src/Dialog.tsx
|
|
5350
|
-
var React32 = __toESM(require("react"), 1);
|
|
5351
|
-
var import_react_dom9 = require("react-dom");
|
|
5352
|
-
var DialogClose = React32.createContext(null);
|
|
5353
|
-
function useDialogClose() {
|
|
5354
|
-
return React32.useContext(DialogClose) || function() {
|
|
5355
|
-
};
|
|
5356
|
-
}
|
|
5357
|
-
var Dialog = React32.forwardRef(function Dialog2(props, ref) {
|
|
5358
|
-
const t = useStrings();
|
|
5359
|
-
const density = useDensity();
|
|
5360
|
-
const own = React32.useRef(null), merged = useMergedRef(ref, own), titleId = uid(), descId = uid();
|
|
5361
|
-
const openState = useMaybeControlled(props.open, false, null), open = openState[0];
|
|
5362
|
-
if (props.open === void 0 && !props.trigger)
|
|
5363
|
-
devWarnOnce("dialog-no-open", "Dialog has neither `open` nor `trigger`, so it can never open. Pass one of them.");
|
|
5364
|
-
const trigId = uid();
|
|
5365
|
-
function closeNow() {
|
|
5366
|
-
if (props.open === void 0) openState[1](false);
|
|
5367
|
-
if (props.onClose) props.onClose();
|
|
5368
|
-
}
|
|
5369
|
-
function close() {
|
|
5370
|
-
if (props.dismissible === false) return;
|
|
5371
|
-
closeNow();
|
|
5372
|
-
}
|
|
5373
|
-
const scrimCloses = props.dismissible !== false && (props.dismissOnScrim !== void 0 ? props.dismissOnScrim : props.role !== "alertdialog");
|
|
5374
|
-
const modal = useModal(open, own, {
|
|
5375
|
-
autoFocus: props.autoFocus,
|
|
5376
|
-
onEscape: close,
|
|
5377
|
-
bodySelector: ".aura-dialog__body",
|
|
5378
|
-
footSelector: ".aura-dialog__foot",
|
|
5379
|
-
/* With a trigger, focus goes back to it even where a click doesn't focus buttons (Safari). */
|
|
5380
|
-
finalFocus: props.trigger ? function() {
|
|
5381
|
-
const ff = props.finalFocus;
|
|
5382
|
-
const to = ff ? typeof ff === "function" ? ff() : ff.current : null;
|
|
5383
|
-
return to || document.querySelector('[data-aura-trigger="' + trigId + '"]');
|
|
5384
|
-
} : props.finalFocus,
|
|
5385
|
-
onCloseComplete: props.onCloseComplete
|
|
5386
|
-
});
|
|
5387
|
-
const trig = props.trigger;
|
|
5388
|
-
const trigger = trig && React32.isValidElement(trig) ? React32.cloneElement(trig, {
|
|
5389
|
-
"aria-haspopup": "dialog",
|
|
5390
|
-
"aria-expanded": open,
|
|
5391
|
-
"data-aura-trigger": trigId,
|
|
5392
|
-
onClick: function(e) {
|
|
5393
|
-
const own2 = trig.props.onClick;
|
|
5394
|
-
if (own2) own2(e);
|
|
5395
|
-
if (e.defaultPrevented) return;
|
|
5396
|
-
if (props.open === void 0) openState[1](true);
|
|
5397
|
-
if (props.onOpen) props.onOpen();
|
|
5398
|
-
}
|
|
5399
|
-
}) : null;
|
|
5400
|
-
if (!modal.ready) return trigger;
|
|
5401
|
-
const rest = omit(props, [
|
|
5402
|
-
"open",
|
|
5403
|
-
"onClose",
|
|
5404
|
-
"title",
|
|
5405
|
-
"description",
|
|
5406
|
-
"children",
|
|
5407
|
-
"footer",
|
|
5408
|
-
"size",
|
|
5409
|
-
"dismissible",
|
|
5410
|
-
"dismissOnScrim",
|
|
5411
|
-
"role",
|
|
5412
|
-
"autoFocus",
|
|
5413
|
-
"className",
|
|
5414
|
-
"trigger",
|
|
5415
|
-
"onOpen",
|
|
5416
|
-
"finalFocus",
|
|
5417
|
-
"onCloseComplete",
|
|
5418
|
-
"aria-labelledby",
|
|
5419
|
-
"aria-describedby",
|
|
5420
|
-
"aria-modal"
|
|
5421
|
-
]);
|
|
5422
|
-
const panel = (0, import_react_dom9.createPortal)(
|
|
5423
|
-
/* @__PURE__ */ React32.createElement("div", { className: "aura-dialog-layer", "data-density": density, onKeyDown: modal.onKeyDown }, /* @__PURE__ */ React32.createElement(
|
|
5424
|
-
"div",
|
|
5425
|
-
{
|
|
5426
|
-
className: "aura-scrim",
|
|
5427
|
-
onClick: scrimCloses ? close : void 0,
|
|
5428
|
-
onMouseDown: scrimCloses ? void 0 : function(e) {
|
|
5429
|
-
e.preventDefault();
|
|
5430
|
-
},
|
|
5431
|
-
"aria-hidden": true
|
|
5432
|
-
}
|
|
5433
|
-
), /* @__PURE__ */ React32.createElement(
|
|
5434
|
-
"div",
|
|
5435
|
-
{
|
|
5436
|
-
...rest,
|
|
5437
|
-
ref: merged,
|
|
5438
|
-
role: props.role || "dialog",
|
|
5439
|
-
"aria-modal": true,
|
|
5440
|
-
"aria-labelledby": titleId,
|
|
5441
|
-
"aria-describedby": cx(props.description ? descId : "", props["aria-describedby"]) || void 0,
|
|
5442
|
-
tabIndex: -1,
|
|
5443
|
-
className: cx("aura-dialog", "aura-dialog--" + (props.size || "md"), props.className)
|
|
5444
|
-
},
|
|
5445
|
-
/* @__PURE__ */ React32.createElement("div", { className: "aura-dialog__head" }, /* @__PURE__ */ React32.createElement("h2", { className: "aura-dialog__title", id: titleId }, props.title), props.dismissible !== false ? /* @__PURE__ */ React32.createElement(IconButton, { icon: /* @__PURE__ */ React32.createElement(IconX, null), label: t.close, className: "aura-dialog__close", onClick: close }) : null),
|
|
5446
|
-
props.description ? /* @__PURE__ */ React32.createElement("p", { className: "aura-dialog__desc", id: descId }, props.description) : null,
|
|
5447
|
-
/* @__PURE__ */ React32.createElement(DialogClose.Provider, { value: closeNow }, props.children ? /* @__PURE__ */ React32.createElement("div", { className: "aura-dialog__body" }, props.children) : null, props.footer ? /* @__PURE__ */ React32.createElement("div", { className: "aura-dialog__foot" }, props.footer) : null)
|
|
5448
|
-
)),
|
|
5449
|
-
document.body
|
|
5450
|
-
);
|
|
5451
|
-
return trigger ? /* @__PURE__ */ React32.createElement(React32.Fragment, null, trigger, panel) : panel;
|
|
5452
|
-
});
|
|
5453
|
-
var Drawer = React32.forwardRef(function Drawer2(props, ref) {
|
|
5454
|
-
const t = useStrings();
|
|
5455
|
-
const density = useDensity();
|
|
5456
|
-
const own = React32.useRef(null), merged = useMergedRef(ref, own), titleId = uid(), descId = uid();
|
|
5457
|
-
function close() {
|
|
5458
|
-
if (props.dismissible !== false && props.onClose) props.onClose();
|
|
5459
|
-
}
|
|
5460
|
-
const modal = useModal(props.open, own, {
|
|
5461
|
-
autoFocus: props.autoFocus,
|
|
5462
|
-
onEscape: close,
|
|
5463
|
-
bodySelector: ".aura-drawer__body",
|
|
5464
|
-
footSelector: ".aura-drawer__foot",
|
|
5465
|
-
finalFocus: props.finalFocus,
|
|
5466
|
-
onCloseComplete: props.onCloseComplete
|
|
5467
|
-
});
|
|
5468
|
-
if (!modal.ready) return null;
|
|
5469
|
-
const side = props.side === "left" ? "left" : "right";
|
|
5470
|
-
const rest = omit(props, [
|
|
5471
|
-
"open",
|
|
5472
|
-
"onClose",
|
|
5473
|
-
"side",
|
|
5474
|
-
"size",
|
|
5475
|
-
"title",
|
|
5476
|
-
"description",
|
|
5477
|
-
"children",
|
|
5478
|
-
"footer",
|
|
5479
|
-
"dismissible",
|
|
5480
|
-
"dismissOnScrim",
|
|
5481
|
-
"autoFocus",
|
|
5482
|
-
"aria-label",
|
|
5483
|
-
"aria-describedby",
|
|
5484
|
-
"aria-labelledby",
|
|
5485
|
-
"className",
|
|
5486
|
-
"closeLabel",
|
|
5487
|
-
"closeProps",
|
|
5488
|
-
"finalFocus",
|
|
5489
|
-
"onCloseComplete"
|
|
5490
|
-
]);
|
|
5491
|
-
const drawerScrimCloses = props.dismissible !== false && props.dismissOnScrim !== false;
|
|
5492
|
-
return (0, import_react_dom9.createPortal)(
|
|
5493
|
-
/* @__PURE__ */ React32.createElement("div", { className: "aura-dialog-layer aura-drawer-layer", "data-density": density, onKeyDown: modal.onKeyDown }, /* @__PURE__ */ React32.createElement(
|
|
5494
|
-
"div",
|
|
5495
|
-
{
|
|
5496
|
-
className: "aura-scrim",
|
|
5497
|
-
onClick: drawerScrimCloses ? close : void 0,
|
|
5498
|
-
onMouseDown: !drawerScrimCloses ? function(e) {
|
|
5499
|
-
e.preventDefault();
|
|
5500
|
-
} : void 0,
|
|
5501
|
-
"aria-hidden": true
|
|
5502
|
-
}
|
|
5503
|
-
), /* @__PURE__ */ React32.createElement(
|
|
5504
|
-
"div",
|
|
5505
|
-
{
|
|
5506
|
-
...rest,
|
|
5507
|
-
ref: merged,
|
|
5508
|
-
role: "dialog",
|
|
5509
|
-
"aria-modal": true,
|
|
5510
|
-
"aria-labelledby": props.title ? titleId : props["aria-labelledby"],
|
|
5511
|
-
"aria-label": props.title ? void 0 : props["aria-label"],
|
|
5512
|
-
"aria-describedby": cx(props.description ? descId : "", props["aria-describedby"]) || void 0,
|
|
5513
|
-
tabIndex: -1,
|
|
5514
|
-
className: cx("aura-drawer", "aura-drawer--" + side, "aura-drawer--" + (props.size || "md"), props.className)
|
|
5515
|
-
},
|
|
5516
|
-
props.title || props.dismissible !== false ? /* @__PURE__ */ React32.createElement("div", { className: "aura-drawer__head" }, props.title ? /* @__PURE__ */ React32.createElement("h2", { className: "aura-drawer__title", id: titleId }, props.title) : /* @__PURE__ */ React32.createElement("span", { style: { flex: 1 } }), props.dismissible !== false ? /* @__PURE__ */ React32.createElement(
|
|
5517
|
-
IconButton,
|
|
5518
|
-
{
|
|
5519
|
-
...props.closeProps,
|
|
5520
|
-
icon: /* @__PURE__ */ React32.createElement(IconX, null),
|
|
5521
|
-
label: props.closeLabel || t.close,
|
|
5522
|
-
onClick: function(e) {
|
|
5523
|
-
const own2 = props.closeProps && props.closeProps.onClick;
|
|
5524
|
-
if (own2) own2(e);
|
|
5525
|
-
if (!e.defaultPrevented) close();
|
|
5526
|
-
}
|
|
5527
|
-
}
|
|
5528
|
-
) : null) : null,
|
|
5529
|
-
props.description ? /* @__PURE__ */ React32.createElement("p", { className: "aura-drawer__desc", id: descId }, props.description) : null,
|
|
5530
|
-
/* @__PURE__ */ React32.createElement("div", { className: "aura-drawer__body" }, props.children),
|
|
5531
|
-
props.footer ? /* @__PURE__ */ React32.createElement("div", { className: "aura-drawer__foot" }, props.footer) : null
|
|
5532
|
-
)),
|
|
5533
|
-
document.body
|
|
5534
|
-
);
|
|
5535
|
-
});
|
|
5536
|
-
|
|
5537
5683
|
// src/DataTable.tsx
|
|
5538
5684
|
var React33 = __toESM(require("react"), 1);
|
|
5539
5685
|
var import_react_dom10 = require("react-dom");
|
|
@@ -7571,26 +7717,6 @@ var React40 = __toESM(require("react"), 1);
|
|
|
7571
7717
|
|
|
7572
7718
|
// src/responsive.tsx
|
|
7573
7719
|
var React39 = __toESM(require("react"), 1);
|
|
7574
|
-
|
|
7575
|
-
// src/breakpoints.ts
|
|
7576
|
-
var breakpoints = { sm: 640, md: 768, lg: 1024, xl: 1280 };
|
|
7577
|
-
var ORDER = ["base", "sm", "md", "lg", "xl"];
|
|
7578
|
-
function respVars(prefix, value, map2) {
|
|
7579
|
-
const style = {};
|
|
7580
|
-
if (value == null) return style;
|
|
7581
|
-
if (typeof value !== "object") value = { base: value };
|
|
7582
|
-
let byBp = value, cur2;
|
|
7583
|
-
ORDER.forEach(function(k) {
|
|
7584
|
-
if (byBp[k] !== void 0) cur2 = map2 ? map2(byBp[k]) : byBp[k];
|
|
7585
|
-
if (cur2 !== void 0) style["--" + prefix + "-" + k] = cur2;
|
|
7586
|
-
});
|
|
7587
|
-
return style;
|
|
7588
|
-
}
|
|
7589
|
-
var space = function(v) {
|
|
7590
|
-
return typeof v === "number" ? "var(--aura-space-" + v + ")" : v;
|
|
7591
|
-
};
|
|
7592
|
-
|
|
7593
|
-
// src/responsive.tsx
|
|
7594
7720
|
var ORDER2 = ["base", "sm", "md", "lg", "xl"];
|
|
7595
7721
|
function useBreakpoint() {
|
|
7596
7722
|
return React39.useSyncExternalStore(subscribe, current, function() {
|