From 48ab225d364771a5dea5420da7ffc3c313f3237c Mon Sep 17 00:00:00 2001 From: Jack Hsu Date: Wed, 27 Sep 2023 13:11:22 -0400 Subject: [PATCH] Rebuilt dist files. --- dist/data-grid.css | 12 +++++++++++- dist/data-grid.css.map | 2 +- dist/data-grid.js | 7 +++++-- dist/data-grid.js.map | 4 ++-- dist/data-grid.min.css | 4 ++-- dist/data-grid.min.css.map | 2 +- dist/data-grid.min.js | 6 +++--- dist/data-grid.min.js.map | 6 +++--- 8 files changed, 28 insertions(+), 15 deletions(-) diff --git a/dist/data-grid.css b/dist/data-grid.css index fb113f9..411ac58 100644 --- a/dist/data-grid.css +++ b/dist/data-grid.css @@ -310,20 +310,30 @@ data-grid.dg-empty tbody:before { overflow: hidden; width: 90%; } +data-grid.dg-empty tr.dg-fake-row { + height: 4rem; + border: none; +} data-grid.dg-empty.dg-network-error table { color: #842029; background-color: #f8d7da; border: 1px solid #f5c2c7; } data-grid.dg-empty.dg-network-error tbody { - height: 8rem; + height: auto; } data-grid.dg-empty.dg-network-error tbody:before { font-size: 2rem; + top: auto; + transform: translate(-50%); } data-grid.dg-empty.dg-network-error tbody tr:not(.dg-fake-row) { display: none; } +data-grid.dg-empty:not(.dg-network-error) tbody:before { + top: auto; + transform: translate(-50%, 30%); +} data-grid tbody tr { border-bottom: solid 1px var(--row-border-color); } diff --git a/dist/data-grid.css.map b/dist/data-grid.css.map index 69e222e..e6402ab 100644 --- a/dist/data-grid.css.map +++ b/dist/data-grid.css.map @@ -1 +1 @@ -{"version":3,"sources":["../scss/_core.scss","data-grid.css","../scss/_rtl.scss","../scss/_menu.scss","../scss/_actions.scss","../scss/_resizer.scss","../scss/_responsive.scss"],"names":[],"mappings":"AAAA;;;EAAA;AAKA;EACE;IACE,UAAA;ECAF;EDGA;IACE,YAAA;ECDF;AACF;ADIA;EACE,iBAAA;EACA,oBAAA;EACA,mBAAA;EACA,2BAAA;EACA,wCAAA;EACA,gDAAA;EACA,8BAAA;EAEA,0BAAA;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gBJ;EK5gBE;IACE,uBAAA;EL8gBJ;EK5gBE;IACE,yBAAA;EL8gBJ;AACF","file":"data-grid.css","sourcesContent":["/**\n * Data Grid Web component \n * https://github.com/lekoala/data-grid\n */\n\n@keyframes dataGridShow {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0.5;\n }\n}\n\ndata-grid {\n --padding: 0.5rem;\n --padding-x: 0.75rem;\n --padding-y: 0.5rem;\n --padding-y-header: 0.75rem;\n --padding-half: calc(var(--padding) / 2);\n --color-rgb: var(--bs-primary-rgb, 13, 110, 253);\n --color: rgb(var(--color-rgb));\n\n --highlight-color: #fffcee;\n --header-background: var(--bs-gray-200, #e9ecef);\n --header-color: var(--bs-dark, #212529);\n --input-background: var(--bs-body-bg, #ffffff);\n --input-border-color: var(--bs-border-color, #e9ecef);\n --btn-background: var(--bs-body-bg, #ffffff);\n --btn-color: var(--color);\n --btn-border-color: var(--bs-border-color, #e9ecef);\n --body-bg: var(--bs-body-bg, #212529);\n --body-color: var(--bs-body-color, #212529);\n --icon-scale: 1;\n --border-radius: 0.25rem;\n --row-border-color: #f2f2f2;\n --responsive-width: 60%;\n\n --black: var(--bs-black, #000);\n --white: var(--bs-white, #fff);\n --gray: var(--bs-gray, #6c757d);\n --gray-dark: var(--bs-gray-dark, #343a40);\n --gray-100: var(--bs-gray-100, #f8f9fa);\n --gray-200: var(--bs-gray-200, #e9ecef);\n --gray-300: var(--bs-gray-300, #dee2e6);\n --gray-400: var(--bs-gray-400, #ced4da);\n --gray-500: var(--bs-gray-500, #adb5bd);\n --gray-600: var(--bs-gray-600, #6c757d);\n --gray-700: var(--bs-gray-700, #495057);\n --gray-800: var(--bs-gray-800, #343a40);\n --gray-900: var(--bs-gray-900, #212529);\n\n display: block;\n min-height: 6rem;\n position: relative;\n\n // When used with fixed height, have a nice scrollbar\n & {\n --scroller-color: 0, 0%;\n --scroller-color-lightness: 80%;\n --scroller-hover-factor: 0.8;\n --scroller-thumb: hsl(var(--scroller-color), var(--scroller-color-lightness));\n /* Replicate hover for webkit */\n --scroller-thumb-hover: hsl(var(--scroller-color), calc(var(--scroller-color-lightness) * var(--scroller-hover-factor)));\n --scroller-background: transparent;\n scrollbar-color: var(--scroller-thumb) var(--scroller-background);\n scrollbar-width: thin;\n\n &::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n }\n\n &::-webkit-scrollbar-track {\n background: transparent;\n }\n\n &::-webkit-scrollbar-thumb {\n background: var(--scroller-thumb);\n }\n\n &::-webkit-scrollbar-thumb:hover {\n background: var(--scroller-thumb-hover);\n }\n }\n\n img {\n border: none;\n height: auto;\n max-width: 100%;\n vertical-align: middle;\n }\n\n [hidden] {\n display: none;\n }\n\n table {\n display: table;\n // Table and column widths are set by the widths of table and col elements\n // or by the width of the first row of cells. Cells in subsequent rows do not affect column widths.\n table-layout: fixed;\n width: 100%;\n max-width: 100%;\n white-space: normal;\n // Background needs to be on the table, not on the component in case the table overflows the component\n background: var(--header-background);\n }\n\n thead,\n tfoot {\n background-color: var(--header-background);\n color: var(--header-color);\n }\n\n &.dg-loading {\n &:not(.dg-initialized) {\n\n thead,\n tfoot {\n background: none;\n }\n }\n\n tbody {\n animation-name: dataGridShow;\n animation-timing-function: ease-in;\n animation-fill-mode: forwards;\n animation-duration: 0.3s; // only triggers after 300ms\n pointer-events: none; // disable clicks while loading\n }\n }\n\n tr {\n position: relative;\n }\n\n th,\n td {\n empty-cells: show;\n padding: var(--padding-y) var(--padding-x);\n text-align: left;\n\n &[tabindex] {\n outline: none;\n word-break: normal;\n }\n }\n\n th {\n font-weight: bold;\n padding: var(--padding-y-header) var(--padding-x);\n }\n\n // Prevent overflow on headers and cells\n th,\n td {\n position: relative;\n overflow: hidden;\n text-align: left;\n // These two properties keep content on one line\n text-overflow: ellipsis;\n white-space: nowrap;\n\n // Use this to allow content to flow over multiple lines\n &.dg-wrap {\n white-space: normal;\n word-break: break-all;\n }\n }\n\n // Expand on multiple lines on row click\n .dg-expandable {\n cursor: pointer;\n\n &.dg-expanded td {\n white-space: normal;\n word-break: break-all;\n }\n }\n\n .dg-clickable-cell {\n margin: 0;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n // Stick headers\n // https://css-tricks.com/making-tables-with-sticky-header-and-footers-got-a-bit-easier/\n &[sticky] table {\n\n thead,\n tfoot {\n z-index: 2;\n position: sticky;\n margin: 0;\n border: 0;\n }\n\n // Use silly value to prevent sub pixel alignment issue\n thead {\n inset-block-start: -1px;\n }\n\n tfoot {\n inset-block-end: -1px;\n }\n }\n\n // Pagination icons\n .dg-nav-icon,\n .dg-skip-icon {\n width: 22px;\n height: 22px;\n box-sizing: border-box;\n position: absolute;\n display: block;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%) scale(var(--icon-scale, 1));\n\n &:before,\n &:after {\n content: \"\";\n display: block;\n box-sizing: border-box;\n position: absolute;\n }\n }\n\n .dg-nav-icon::before {\n width: 0;\n height: 10px;\n border-top: 5px solid transparent;\n border-bottom: 5px solid transparent;\n border-left: 6px solid;\n top: 6px;\n left: 9px;\n }\n\n .dg-skip-icon {\n &::before {\n width: 3px;\n height: 10px;\n background: currentColor;\n top: 6px;\n left: 14px;\n }\n\n &::after {\n width: 0;\n height: 10px;\n border-top: 5px solid transparent;\n border-bottom: 5px solid transparent;\n border-left: 6px solid;\n top: 6px;\n left: 7px;\n }\n }\n\n .dg-rotate {\n transform: rotate(-180deg);\n }\n\n // Default actions buttons\n button {\n background-color: var(--btn-background);\n border: solid 1px var(--btn-border-color);\n border-radius: var(--border-radius);\n color: var(--body-color);\n height: 2rem;\n margin: 0 0.2rem;\n padding: 0 0.5rem;\n pointer-events: all;\n text-align: center;\n cursor: pointer;\n\n &:hover {\n opacity: 0.7;\n }\n\n &:disabled:hover {\n background-color: inherit;\n border-color: inherit;\n }\n }\n\n // Form elements\n input[type=\"checkbox\"] {\n margin: 0;\n }\n\n input:not([type=\"checkbox\"]),\n select {\n background-color: var(--input-background, \"#fff\");\n color: currentColor;\n box-sizing: border-box;\n border: 1px solid var(--input-border-color, \"#f0f0f0\");\n border-radius: var(--border-radius);\n height: 2rem;\n margin: 0 0.2rem;\n padding: 0 var(--padding);\n max-width: none;\n }\n\n input:not([type=\"checkbox\"]),\n select,\n button {\n &:focus {\n box-shadow: 0 0 0 var(--padding-half) rgba(var(--color-rgb), 0.25);\n outline: 0;\n }\n\n &[disabled],\n &:disabled {\n opacity: 0.35;\n pointer-events: none;\n }\n }\n\n // Filters (2nd header row)\n thead tr:nth-child(2) th {\n padding: 0;\n background-color: transparent;\n\n input {\n width: 100%;\n border-radius: 0;\n margin: 0;\n\n &:focus {\n box-shadow: inset 0px 0px 0px 1px var(--color);\n }\n }\n }\n\n // Editable\n tbody td.dg-editable-col {\n padding: 0;\n height: 0; // it needs a height for height 100%\n }\n\n tbody td input.dg-editable {\n width: 100%;\n background: transparent;\n border: 0;\n border-radius: 0;\n margin: 0;\n box-shadow: none;\n height: 100%;\n\n &:focus {\n box-shadow: inset 0px 0px 0px 1px var(--color);\n }\n }\n\n // Empty table or error message (don't use :empty as it would create fouc on load)\n &.dg-empty {\n tbody {\n height: 4rem;\n position: relative;\n\n &:before {\n position: absolute;\n top: 50%;\n left: 50%;\n content: attr(data-empty);\n transform: translate(-50%, -50%);\n opacity: 0.5;\n font-size: 1.5rem;\n text-align: center;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n width: 90%;\n }\n }\n\n &.dg-network-error {\n table {\n color: #842029;\n background-color: #f8d7da;\n border: 1px solid #f5c2c7;\n }\n\n tbody {\n height: 8rem;\n\n &:before {\n font-size: 2rem;\n }\n\n tr:not(.dg-fake-row) {\n display: none;\n }\n }\n }\n }\n\n // Zebra rows\n tbody tr {\n &:nth-child(even) {\n background-color: var(--bs-table-striped-bg, #f8f9fa);\n }\n\n border-bottom: solid 1px var(--row-border-color);\n\n &:hover {\n background-color: var(--highlight-color) !important;\n }\n\n &:focus {\n background-color: var(--highlight-color) !important;\n border-bottom-color: var(--highlight-color) !important;\n outline: none;\n }\n }\n\n // Meta footer\n tfoot {\n min-width: 280px;\n\n td {\n padding: var(--padding-y-header) var(--padding-x);\n }\n\n .dg-page-nav {\n display: flex;\n align-items: center;\n min-width: 160px;\n }\n\n .dg-input-page {\n width: 4rem;\n }\n\n .dg-footer {\n display: flex;\n align-items: center;\n flex-direction: row;\n justify-content: space-between;\n }\n\n .dg-pagination {\n display: flex;\n text-align: center;\n\n button {\n // Fix icon inside button\n position: relative;\n width: 2rem;\n }\n }\n\n .dg-meta {\n // Prevent layout from jumping around\n min-width: 160px;\n text-align: right;\n }\n\n &.dg-footer-compact {\n .dg-meta {\n display: none;\n }\n\n .dg-input-page {\n display: none;\n }\n }\n }\n\n // Pagination in header\n [aria-sort] {\n cursor: pointer;\n padding-right: 1.5rem;\n }\n\n [aria-sort=\"none\"]:after,\n [aria-sort=\"none\"]:before,\n [aria-sort=\"ascending\"]:before,\n [aria-sort=\"descending\"]:after {\n right: 0.5rem;\n top: calc(50% - 0.5rem);\n border: solid transparent;\n content: \" \";\n height: 0;\n width: 0;\n position: absolute;\n border-color: rgba(0, 0, 0, 0);\n border-width: 0.25rem;\n margin-left: -0.25rem;\n }\n\n [aria-sort=\"none\"] {\n &:before {\n border-bottom-color: currentColor;\n opacity: 0.25;\n top: calc(50% - 0.6rem);\n }\n\n &:after {\n border-top-color: currentColor;\n opacity: 0.25;\n bottom: calc(50% - 0.5rem);\n top: auto;\n }\n }\n\n [aria-sort=\"ascending\"]:before {\n border-bottom-color: var(--body-color);\n opacity: 0.75;\n }\n\n [aria-sort=\"descending\"]:after {\n border-top-color: var(--body-color);\n opacity: 0.75;\n bottom: calc(50% - 0.5rem);\n top: auto;\n }\n}\n\n[data-bs-theme=\"dark\"] data-grid {\n --scroller-color-lightness: 20%;\n --highlight-color: #43423e;\n --header-background: var(--bs-gray-800, #34373b);\n --header-color: var(--bs-light, #e9ecef);\n --body-color: var(--bs-body-color, #494e53);\n --row-border-color: var(--bs-gray-900, #212325);\n\n tbody tr {\n &:nth-child(even) {\n background-color: var(--bs-table-striped-bg, #2c3034);\n }\n }\n}","/**\n * Data Grid Web component \n * https://github.com/lekoala/data-grid\n */\n@keyframes dataGridShow {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0.5;\n }\n}\ndata-grid {\n --padding: 0.5rem;\n --padding-x: 0.75rem;\n --padding-y: 0.5rem;\n --padding-y-header: 0.75rem;\n --padding-half: calc(var(--padding) / 2);\n --color-rgb: var(--bs-primary-rgb, 13, 110, 253);\n --color: rgb(var(--color-rgb));\n --highlight-color: #fffcee;\n --header-background: var(--bs-gray-200, #e9ecef);\n --header-color: var(--bs-dark, #212529);\n --input-background: var(--bs-body-bg, #ffffff);\n --input-border-color: var(--bs-border-color, #e9ecef);\n --btn-background: var(--bs-body-bg, #ffffff);\n --btn-color: var(--color);\n --btn-border-color: var(--bs-border-color, #e9ecef);\n --body-bg: var(--bs-body-bg, #212529);\n --body-color: var(--bs-body-color, #212529);\n --icon-scale: 1;\n --border-radius: 0.25rem;\n --row-border-color: #f2f2f2;\n --responsive-width: 60%;\n --black: var(--bs-black, #000);\n --white: var(--bs-white, #fff);\n --gray: var(--bs-gray, #6c757d);\n --gray-dark: var(--bs-gray-dark, #343a40);\n --gray-100: var(--bs-gray-100, #f8f9fa);\n --gray-200: var(--bs-gray-200, #e9ecef);\n --gray-300: var(--bs-gray-300, #dee2e6);\n --gray-400: var(--bs-gray-400, #ced4da);\n --gray-500: var(--bs-gray-500, #adb5bd);\n --gray-600: var(--bs-gray-600, #6c757d);\n --gray-700: var(--bs-gray-700, #495057);\n --gray-800: var(--bs-gray-800, #343a40);\n --gray-900: var(--bs-gray-900, #212529);\n display: block;\n min-height: 6rem;\n position: relative;\n}\ndata-grid {\n --scroller-color: 0, 0%;\n --scroller-color-lightness: 80%;\n --scroller-hover-factor: 0.8;\n --scroller-thumb: hsl(var(--scroller-color), var(--scroller-color-lightness));\n /* Replicate hover for webkit */\n --scroller-thumb-hover: hsl(var(--scroller-color), calc(var(--scroller-color-lightness) * var(--scroller-hover-factor)));\n --scroller-background: transparent;\n scrollbar-color: var(--scroller-thumb) var(--scroller-background);\n scrollbar-width: thin;\n}\ndata-grid::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n}\ndata-grid::-webkit-scrollbar-track {\n background: transparent;\n}\ndata-grid::-webkit-scrollbar-thumb {\n background: var(--scroller-thumb);\n}\ndata-grid::-webkit-scrollbar-thumb:hover {\n background: var(--scroller-thumb-hover);\n}\ndata-grid img {\n border: none;\n height: auto;\n max-width: 100%;\n vertical-align: middle;\n}\ndata-grid [hidden] {\n display: none;\n}\ndata-grid table {\n display: table;\n table-layout: fixed;\n width: 100%;\n max-width: 100%;\n white-space: normal;\n background: var(--header-background);\n}\ndata-grid thead,\ndata-grid tfoot {\n background-color: var(--header-background);\n color: var(--header-color);\n}\ndata-grid.dg-loading:not(.dg-initialized) thead,\ndata-grid.dg-loading:not(.dg-initialized) tfoot {\n background: none;\n}\ndata-grid.dg-loading tbody {\n animation-name: dataGridShow;\n animation-timing-function: ease-in;\n animation-fill-mode: forwards;\n animation-duration: 0.3s;\n pointer-events: none;\n}\ndata-grid tr {\n position: relative;\n}\ndata-grid th,\ndata-grid td {\n empty-cells: show;\n padding: var(--padding-y) var(--padding-x);\n text-align: left;\n}\ndata-grid th[tabindex],\ndata-grid td[tabindex] {\n outline: none;\n word-break: normal;\n}\ndata-grid th {\n font-weight: bold;\n padding: var(--padding-y-header) var(--padding-x);\n}\ndata-grid th,\ndata-grid td {\n position: relative;\n overflow: hidden;\n text-align: left;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\ndata-grid th.dg-wrap,\ndata-grid td.dg-wrap {\n white-space: normal;\n word-break: break-all;\n}\ndata-grid .dg-expandable {\n cursor: pointer;\n}\ndata-grid .dg-expandable.dg-expanded td {\n white-space: normal;\n word-break: break-all;\n}\ndata-grid .dg-clickable-cell {\n margin: 0;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n}\ndata-grid[sticky] table thead,\ndata-grid[sticky] table tfoot {\n z-index: 2;\n position: sticky;\n margin: 0;\n border: 0;\n}\ndata-grid[sticky] table thead {\n inset-block-start: -1px;\n}\ndata-grid[sticky] table tfoot {\n inset-block-end: -1px;\n}\ndata-grid .dg-nav-icon,\ndata-grid .dg-skip-icon {\n width: 22px;\n height: 22px;\n box-sizing: border-box;\n position: absolute;\n display: block;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%) scale(var(--icon-scale, 1));\n}\ndata-grid .dg-nav-icon:before, data-grid .dg-nav-icon:after,\ndata-grid .dg-skip-icon:before,\ndata-grid .dg-skip-icon:after {\n content: \"\";\n display: block;\n box-sizing: border-box;\n position: absolute;\n}\ndata-grid .dg-nav-icon::before {\n width: 0;\n height: 10px;\n border-top: 5px solid transparent;\n border-bottom: 5px solid transparent;\n border-left: 6px solid;\n top: 6px;\n left: 9px;\n}\ndata-grid .dg-skip-icon::before {\n width: 3px;\n height: 10px;\n background: currentColor;\n top: 6px;\n left: 14px;\n}\ndata-grid .dg-skip-icon::after {\n width: 0;\n height: 10px;\n border-top: 5px solid transparent;\n border-bottom: 5px solid transparent;\n border-left: 6px solid;\n top: 6px;\n left: 7px;\n}\ndata-grid .dg-rotate {\n transform: rotate(-180deg);\n}\ndata-grid button {\n background-color: var(--btn-background);\n border: solid 1px var(--btn-border-color);\n border-radius: var(--border-radius);\n color: var(--body-color);\n height: 2rem;\n margin: 0 0.2rem;\n padding: 0 0.5rem;\n pointer-events: all;\n text-align: center;\n cursor: pointer;\n}\ndata-grid button:hover {\n opacity: 0.7;\n}\ndata-grid button:disabled:hover {\n background-color: inherit;\n border-color: inherit;\n}\ndata-grid input[type=checkbox] {\n margin: 0;\n}\ndata-grid input:not([type=checkbox]),\ndata-grid select {\n background-color: var(--input-background, \"#fff\");\n color: currentColor;\n box-sizing: border-box;\n border: 1px solid var(--input-border-color, \"#f0f0f0\");\n border-radius: var(--border-radius);\n height: 2rem;\n margin: 0 0.2rem;\n padding: 0 var(--padding);\n max-width: none;\n}\ndata-grid input:not([type=checkbox]):focus,\ndata-grid select:focus,\ndata-grid button:focus {\n box-shadow: 0 0 0 var(--padding-half) rgba(var(--color-rgb), 0.25);\n outline: 0;\n}\ndata-grid input:not([type=checkbox])[disabled], data-grid input:not([type=checkbox]):disabled,\ndata-grid select[disabled],\ndata-grid select:disabled,\ndata-grid button[disabled],\ndata-grid button:disabled {\n opacity: 0.35;\n pointer-events: none;\n}\ndata-grid thead tr:nth-child(2) th {\n padding: 0;\n background-color: transparent;\n}\ndata-grid thead tr:nth-child(2) th input {\n width: 100%;\n border-radius: 0;\n margin: 0;\n}\ndata-grid thead tr:nth-child(2) th input:focus {\n box-shadow: inset 0px 0px 0px 1px var(--color);\n}\ndata-grid tbody td.dg-editable-col {\n padding: 0;\n height: 0;\n}\ndata-grid tbody td input.dg-editable {\n width: 100%;\n background: transparent;\n border: 0;\n border-radius: 0;\n margin: 0;\n box-shadow: none;\n height: 100%;\n}\ndata-grid tbody td input.dg-editable:focus {\n box-shadow: inset 0px 0px 0px 1px var(--color);\n}\ndata-grid.dg-empty tbody {\n height: 4rem;\n position: relative;\n}\ndata-grid.dg-empty tbody:before {\n position: absolute;\n top: 50%;\n left: 50%;\n content: attr(data-empty);\n transform: translate(-50%, -50%);\n opacity: 0.5;\n font-size: 1.5rem;\n text-align: center;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n width: 90%;\n}\ndata-grid.dg-empty.dg-network-error table {\n color: #842029;\n background-color: #f8d7da;\n border: 1px solid #f5c2c7;\n}\ndata-grid.dg-empty.dg-network-error tbody {\n height: 8rem;\n}\ndata-grid.dg-empty.dg-network-error tbody:before {\n font-size: 2rem;\n}\ndata-grid.dg-empty.dg-network-error tbody tr:not(.dg-fake-row) {\n display: none;\n}\ndata-grid tbody tr {\n border-bottom: solid 1px var(--row-border-color);\n}\ndata-grid tbody tr:nth-child(even) {\n background-color: var(--bs-table-striped-bg, #f8f9fa);\n}\ndata-grid tbody tr:hover {\n background-color: var(--highlight-color) !important;\n}\ndata-grid tbody tr:focus {\n background-color: var(--highlight-color) !important;\n border-bottom-color: var(--highlight-color) !important;\n outline: none;\n}\ndata-grid tfoot {\n min-width: 280px;\n}\ndata-grid tfoot td {\n padding: var(--padding-y-header) var(--padding-x);\n}\ndata-grid tfoot .dg-page-nav {\n display: flex;\n align-items: center;\n min-width: 160px;\n}\ndata-grid tfoot .dg-input-page {\n width: 4rem;\n}\ndata-grid tfoot .dg-footer {\n display: flex;\n align-items: center;\n flex-direction: row;\n justify-content: space-between;\n}\ndata-grid tfoot .dg-pagination {\n display: flex;\n text-align: center;\n}\ndata-grid tfoot .dg-pagination button {\n position: relative;\n width: 2rem;\n}\ndata-grid tfoot .dg-meta {\n min-width: 160px;\n text-align: right;\n}\ndata-grid tfoot.dg-footer-compact .dg-meta {\n display: none;\n}\ndata-grid tfoot.dg-footer-compact .dg-input-page {\n display: none;\n}\ndata-grid [aria-sort] {\n cursor: pointer;\n padding-right: 1.5rem;\n}\ndata-grid [aria-sort=none]:after,\ndata-grid [aria-sort=none]:before,\ndata-grid [aria-sort=ascending]:before,\ndata-grid [aria-sort=descending]:after {\n right: 0.5rem;\n top: calc(50% - 0.5rem);\n border: solid transparent;\n content: \" \";\n height: 0;\n width: 0;\n position: absolute;\n border-color: rgba(0, 0, 0, 0);\n border-width: 0.25rem;\n margin-left: -0.25rem;\n}\ndata-grid [aria-sort=none]:before {\n border-bottom-color: currentColor;\n opacity: 0.25;\n top: calc(50% - 0.6rem);\n}\ndata-grid [aria-sort=none]:after {\n border-top-color: currentColor;\n opacity: 0.25;\n bottom: calc(50% - 0.5rem);\n top: auto;\n}\ndata-grid [aria-sort=ascending]:before {\n border-bottom-color: var(--body-color);\n opacity: 0.75;\n}\ndata-grid [aria-sort=descending]:after {\n border-top-color: var(--body-color);\n opacity: 0.75;\n bottom: calc(50% - 0.5rem);\n top: auto;\n}\n\n[data-bs-theme=dark] data-grid {\n --scroller-color-lightness: 20%;\n --highlight-color: #43423e;\n --header-background: var(--bs-gray-800, #34373b);\n --header-color: var(--bs-light, #e9ecef);\n --body-color: var(--bs-body-color, #494e53);\n --row-border-color: var(--bs-gray-900, #212325);\n}\n[data-bs-theme=dark] data-grid tbody tr:nth-child(even) {\n background-color: var(--bs-table-striped-bg, #2c3034);\n}\n\ndata-grid[dir=rtl] th,\ndata-grid[dir=rtl] td {\n text-align: right;\n}\ndata-grid[dir=rtl] [aria-sort] {\n padding-left: 1rem;\n padding-right: 0.5rem;\n}\ndata-grid[dir=rtl] [aria-sort=none]:after,\ndata-grid[dir=rtl] [aria-sort=none]:before,\ndata-grid[dir=rtl] [aria-sort=ascending]:before,\ndata-grid[dir=rtl] [aria-sort=descending]:after {\n left: 0.75rem;\n right: auto;\n}\ndata-grid[dir=rtl] tfoot .dg-meta {\n text-align: left;\n}\n\ndata-grid .dg-menu {\n position: absolute;\n z-index: 3;\n background: var(--body-bg);\n list-style: none;\n max-width: 150px;\n margin: 0;\n padding: var(--padding);\n box-shadow: 0 0 1rem rgba(0, 0, 0, 0.25);\n border-radius: var(--border-radius);\n}\ndata-grid .dg-menu li {\n margin: 0;\n padding: 0;\n}\ndata-grid .dg-menu label {\n display: flex;\n align-items: center;\n margin-bottom: 0.25em;\n}\ndata-grid .dg-menu input {\n margin-right: 0.5em;\n}\n\ndata-grid .dg-actions {\n text-overflow: initial;\n width: 100px;\n text-align: right;\n white-space: nowrap !important;\n}\ndata-grid .dg-actions button {\n margin: 0;\n}\ndata-grid .dg-actions button + button {\n margin-left: 0.5rem;\n}\ndata-grid .dg-actions .dg-actions-toggle {\n display: none;\n width: calc(100px - var(--padding-x) * 2);\n}\ndata-grid .dg-actions.dg-actions-1 {\n width: 100%;\n}\ndata-grid .dg-actions.dg-actions-2 button {\n width: calc(50% - 0.25rem);\n}\ndata-grid .dg-actions.dg-actions-more button {\n display: none;\n}\ndata-grid .dg-actions.dg-actions-more button.dg-actions-toggle {\n display: inline-block;\n}\ndata-grid .dg-actions.dg-actions-expand {\n position: absolute;\n right: 0;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n width: 100%;\n height: 100%;\n}\ndata-grid .dg-actions.dg-actions-expand.dg-actions-more {\n width: 100%;\n}\ndata-grid .dg-actions.dg-actions-expand.dg-actions-more button {\n display: inline-block;\n}\ndata-grid tr.dg-actionable {\n cursor: pointer;\n}\ndata-grid tr.dg-actionable:hover td {\n background-color: var(--highlight-color);\n}\n\ndata-grid .dg-resizer {\n position: absolute;\n top: 0;\n right: 0;\n width: 6px;\n z-index: 2;\n cursor: col-resize;\n user-select: none;\n}\ndata-grid .dg-resizer:before {\n content: \"\";\n display: block;\n position: absolute;\n top: var(--padding-y-header);\n height: 1.5rem;\n right: 0;\n width: 2px;\n background: var(--body-color);\n opacity: 0.2;\n}\ndata-grid .dg-resizer:hover:before {\n opacity: 0.6;\n}\ndata-grid .dg-resizer.dg-resizer-active {\n border-right: 1px dashed var(--color);\n}\ndata-grid .dg-resizer.dg-resizer-active:before {\n opacity: 0.6;\n}\n\ndata-grid .dg-responsive-toggle {\n padding: 0;\n text-align: center;\n}\ndata-grid .dg-responsive-child-row > td {\n padding: 0;\n}\ndata-grid .dg-responsive-table {\n table-layout: auto;\n border: 0;\n}\ndata-grid .dg-responsive-table td,\ndata-grid .dg-responsive-table th {\n white-space: normal;\n}\ndata-grid .dg-responsive-table th {\n max-width: 40%;\n}\n\n@media only screen and (max-width: 767px) {\n data-grid[responsive] .dg-resizer {\n display: none;\n }\n data-grid[responsive] .dg-meta {\n display: none;\n }\n data-grid[responsive] .dg-input-page {\n display: none;\n }\n data-grid[responsive] table,\n data-grid[responsive] tbody,\n data-grid[responsive] tfoot,\n data-grid[responsive] th,\n data-grid[responsive] td,\n data-grid[responsive] tr:not([hidden]) {\n display: block;\n }\n data-grid[responsive] thead {\n display: flex;\n border-bottom: 2px solid var(--header-background);\n }\n data-grid[responsive] thead > tr {\n flex-grow: 1;\n }\n data-grid[responsive] thead th {\n width: auto;\n }\n data-grid[responsive] tbody tr {\n padding: 0;\n border: 1px solid var(--header-background);\n }\n data-grid[responsive] tbody td {\n border: none;\n border-bottom: 1px solid var(--row-border-color);\n position: relative;\n padding-left: calc(100% - var(--responsive-width) - var(--padding) * 2);\n }\n data-grid[responsive] tbody td:last-child {\n border: 0;\n }\n data-grid[responsive] tbody td:before {\n position: absolute;\n top: 0;\n left: 0;\n padding: var(--padding);\n width: calc(100% - var(--responsive-width) - var(--padding) * 4);\n white-space: nowrap;\n content: attr(data-name);\n display: block;\n font-weight: bold;\n background-color: var(--header-background);\n }\n data-grid[responsive] tbody td[role=gridcell] {\n padding-left: calc(100% - var(--responsive-width) - var(--padding) * 4 + 0.5rem);\n }\n data-grid[responsive] .dg-selectable {\n height: 28px;\n margin: 2px 1px 2px;\n }\n data-grid[responsive] td.dg-selectable::before, data-grid[responsive] td.dg-actions::before {\n padding: 0;\n }\n data-grid[responsive] td.dg-selectable label {\n padding: 5px;\n }\n data-grid[responsive] td[role=gridcell] {\n min-height: 35px;\n width: auto;\n }\n data-grid[responsive] td[data-name]::before {\n height: 100%;\n }\n data-grid[responsive] td.dg-actions {\n padding-left: inherit;\n width: inherit;\n }\n data-grid[responsive] .dg-actions button {\n width: inherit !important;\n }\n data-grid[responsive] tr.dg-head-columns {\n padding: 0;\n width: calc(100% - var(--responsive-width) - var(--padding) * 4);\n }\n data-grid[responsive] tr.dg-head-columns th[role=\"columnheader button\"] {\n padding: 0.36em 1.3em 0.36em 0.75em;\n }\n data-grid[responsive] tr.dg-head-filters {\n background: transparent;\n vertical-align: top;\n padding: 0;\n width: calc(100% - (100% - var(--responsive-width) - var(--padding) * 4));\n }\n data-grid[responsive] .dg-head-filters th input:not([type=checkbox], [type=radio]) {\n height: 2.25em;\n }\n data-grid[responsive] .dg-head-filters th.dg-selectable {\n background: transparent;\n }\n data-grid[responsive] .dg-head-filters th.dg-selectable label::before {\n content: \"Column Filters\";\n }\n}\n\n/*# sourceMappingURL=data-grid.css.map */\n","data-grid {\r\n &[dir=\"rtl\"] {\r\n th,\r\n td {\r\n text-align: right;\r\n }\r\n [aria-sort] {\r\n padding-left: 1rem;\r\n padding-right: 0.5rem;\r\n }\r\n [aria-sort=\"none\"]:after,\r\n [aria-sort=\"none\"]:before,\r\n [aria-sort=\"ascending\"]:before,\r\n [aria-sort=\"descending\"]:after {\r\n left: 0.75rem;\r\n right: auto;\r\n }\r\n tfoot .dg-meta {\r\n text-align: left;\r\n }\r\n }\r\n}\r\n","data-grid {\r\n .dg-menu {\r\n position: absolute;\r\n z-index: 3;\r\n background: var(--body-bg);\r\n list-style: none;\r\n max-width: 150px;\r\n margin: 0;\r\n padding: var(--padding);\r\n box-shadow: 0 0 1rem rgba(0, 0, 0, 0.25);\r\n border-radius: var(--border-radius);\r\n\r\n li {\r\n margin: 0;\r\n padding: 0;\r\n }\r\n label {\r\n display: flex;\r\n align-items: center;\r\n margin-bottom: 0.25em;\r\n }\r\n input {\r\n margin-right: 0.5em;\r\n }\r\n }\r\n}\r\n","data-grid {\r\n .dg-actions {\r\n text-overflow: initial;\r\n width: 100px;\r\n text-align: right;\r\n white-space: nowrap !important;\r\n\r\n button {\r\n margin: 0;\r\n\r\n + button {\r\n margin-left: 0.5rem;\r\n }\r\n }\r\n .dg-actions-toggle {\r\n display: none;\r\n width: calc(100px - var(--padding-x) * 2);\r\n }\r\n &.dg-actions-1 {\r\n width: 100%;\r\n }\r\n // This needs icons to work\r\n &.dg-actions-2 button {\r\n width: calc(50% - 0.25rem);\r\n }\r\n &.dg-actions-more button {\r\n display: none;\r\n\r\n &.dg-actions-toggle {\r\n display: inline-block;\r\n }\r\n }\r\n &.dg-actions-expand {\r\n position: absolute;\r\n right: 0;\r\n display: flex;\r\n align-items: center;\r\n justify-content: flex-end;\r\n width: 100%;\r\n height: 100%;\r\n }\r\n &.dg-actions-expand.dg-actions-more {\r\n width: 100%;\r\n\r\n button {\r\n display: inline-block;\r\n }\r\n }\r\n }\r\n tr.dg-actionable {\r\n cursor: pointer;\r\n\r\n &:hover td {\r\n background-color: var(--highlight-color);\r\n }\r\n }\r\n}\r\n","data-grid {\r\n .dg-resizer {\r\n position: absolute;\r\n top: 0;\r\n right: 0;\r\n width: 6px; // clickable zone\r\n z-index: 2;\r\n cursor: col-resize;\r\n user-select: none;\r\n\r\n &:before {\r\n content: \"\";\r\n display: block;\r\n position: absolute;\r\n top: var(--padding-y-header);\r\n height: 1.5rem;\r\n right: 0;\r\n width: 2px;\r\n background: var(--body-color);\r\n opacity: 0.2;\r\n }\r\n &:hover:before {\r\n opacity: 0.6;\r\n }\r\n &.dg-resizer-active {\r\n border-right: 1px dashed var(--color);\r\n\r\n &:before {\r\n opacity: 0.6;\r\n }\r\n }\r\n }\r\n}\r\n","data-grid {\n .dg-responsive-toggle {\n padding: 0;\n text-align: center;\n }\n .dg-responsive-child-row > td {\n padding: 0;\n }\n .dg-responsive-table {\n table-layout: auto;\n border: 0;\n\n td,\n th {\n white-space: normal;\n }\n\n th {\n max-width: 40%;\n }\n }\n}\n\n// CSS Only responsive\n@media only screen and (max-width: 767px) {\n data-grid[responsive] {\n // Doesn't make any sense to resize\n .dg-resizer {\n display: none;\n }\n\n // more compact footer\n .dg-meta {\n display: none;\n }\n .dg-input-page {\n display: none;\n }\n\n // everything as blocks\n table,\n tbody,\n tfoot,\n th,\n td,\n tr:not([hidden]) {\n display: block;\n }\n\n // use flex for thead\n thead {\n display: flex;\n\n > tr {\n flex-grow: 1;\n }\n th {\n width: auto;\n }\n\n border-bottom: 2px solid var(--header-background);\n }\n\n // use pseudo element to display column name\n tbody {\n tr {\n padding: 0;\n border: 1px solid var(--header-background);\n }\n td {\n border: none;\n border-bottom: 1px solid var(--row-border-color);\n position: relative;\n padding-left: calc(100% - var(--responsive-width) - var(--padding) * 2);\n\n &:last-child {\n border: 0;\n }\n &:before {\n position: absolute;\n top: 0;\n left: 0;\n padding: var(--padding);\n width: calc(100% - var(--responsive-width) - var(--padding) * 4);\n white-space: nowrap;\n content: attr(data-name);\n display: block;\n font-weight: bold;\n background-color: var(--header-background);\n }\n &[role=\"gridcell\"] {\n padding-left: calc(100% - var(--responsive-width) - var(--padding) * 4 + 0.5rem);\n }\n }\n }\n\n // give selectable some room\n .dg-selectable {\n height: 28px;\n margin: 2px 1px 2px;\n }\n\n td {\n &.dg-selectable::before,\n &.dg-actions::before {\n padding: 0;\n }\n &.dg-selectable label {\n padding: 5px;\n }\n &[role=\"gridcell\"] {\n min-height: 35px;\n width: auto;\n }\n &[data-name]::before {\n height: 100%;\n }\n &.dg-actions {\n padding-left: inherit;\n width: inherit;\n }\n }\n .dg-actions button {\n width: inherit !important;\n }\n tr {\n &.dg-head-columns {\n padding: 0;\n width: calc(100% - var(--responsive-width) - var(--padding) * 4);\n\n th[role=\"columnheader button\"] {\n padding: 0.36em 1.3em 0.36em 0.75em;\n }\n }\n &.dg-head-filters {\n background: transparent;\n vertical-align: top;\n padding: 0;\n width: calc(100% - (100% - var(--responsive-width) - var(--padding) * 4));\n }\n }\n .dg-head-filters th input:not([type=\"checkbox\"], [type=\"radio\"]) {\n height: 2.25em;\n }\n .dg-head-filters th.dg-selectable {\n background: transparent;\n }\n .dg-head-filters th.dg-selectable label::before {\n content: \"Column Filters\";\n }\n }\n}\n"]} \ No newline at end of file +{"version":3,"sources":["../scss/_core.scss","data-grid.css","../scss/_rtl.scss","../scss/_menu.scss","../scss/_actions.scss","../scss/_resizer.scss","../scss/_responsive.scss"],"names":[],"mappings":"AAAA;;;EAAA;AAKA;EACE;IACE,UAAA;ECAF;EDGA;IACE,YAAA;ECDF;AACF;ADIA;EACE,iBAAA;EACA,oBAAA;EACA,mBAAA;EACA,2BAAA;EACA,wCAAA;EACA,gDAAA;EACA,8BAAA;EAEA,0BAAA;EACA,gDAAA;EACA,uCAAA;EACA,8CAAA;EACA,qDAAA;EACA,4CAAA;EACA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cAAA;ELwhBJ;EKthBE;IACE,uBAAA;ELwhBJ;EKthBE;IACE,yBAAA;ELwhBJ;AACF","file":"data-grid.css","sourcesContent":["/**\r\n * Data Grid Web component \r\n * https://github.com/lekoala/data-grid\r\n */\r\n\r\n@keyframes dataGridShow {\r\n 0% {\r\n opacity: 1;\r\n }\r\n\r\n 100% {\r\n opacity: 0.5;\r\n }\r\n}\r\n\r\ndata-grid {\r\n --padding: 0.5rem;\r\n --padding-x: 0.75rem;\r\n --padding-y: 0.5rem;\r\n --padding-y-header: 0.75rem;\r\n --padding-half: calc(var(--padding) / 2);\r\n --color-rgb: var(--bs-primary-rgb, 13, 110, 253);\r\n --color: rgb(var(--color-rgb));\r\n\r\n --highlight-color: #fffcee;\r\n --header-background: var(--bs-gray-200, #e9ecef);\r\n --header-color: var(--bs-dark, #212529);\r\n --input-background: var(--bs-body-bg, #ffffff);\r\n --input-border-color: var(--bs-border-color, #e9ecef);\r\n --btn-background: var(--bs-body-bg, #ffffff);\r\n --btn-color: var(--color);\r\n --btn-border-color: var(--bs-border-color, #e9ecef);\r\n --body-bg: var(--bs-body-bg, #212529);\r\n --body-color: var(--bs-body-color, #212529);\r\n --icon-scale: 1;\r\n --border-radius: 0.25rem;\r\n --row-border-color: #f2f2f2;\r\n --responsive-width: 60%;\r\n\r\n --black: var(--bs-black, #000);\r\n --white: var(--bs-white, #fff);\r\n --gray: var(--bs-gray, #6c757d);\r\n --gray-dark: var(--bs-gray-dark, #343a40);\r\n --gray-100: var(--bs-gray-100, #f8f9fa);\r\n --gray-200: var(--bs-gray-200, #e9ecef);\r\n --gray-300: var(--bs-gray-300, #dee2e6);\r\n --gray-400: var(--bs-gray-400, #ced4da);\r\n --gray-500: var(--bs-gray-500, #adb5bd);\r\n --gray-600: var(--bs-gray-600, #6c757d);\r\n --gray-700: var(--bs-gray-700, #495057);\r\n --gray-800: var(--bs-gray-800, #343a40);\r\n --gray-900: var(--bs-gray-900, #212529);\r\n\r\n display: block;\r\n min-height: 6rem;\r\n position: relative;\r\n\r\n // When used with fixed height, have a nice scrollbar\r\n & {\r\n --scroller-color: 0, 0%;\r\n --scroller-color-lightness: 80%;\r\n --scroller-hover-factor: 0.8;\r\n --scroller-thumb: hsl(var(--scroller-color), var(--scroller-color-lightness));\r\n /* Replicate hover for webkit */\r\n --scroller-thumb-hover: hsl(var(--scroller-color), calc(var(--scroller-color-lightness) * var(--scroller-hover-factor)));\r\n --scroller-background: transparent;\r\n scrollbar-color: var(--scroller-thumb) var(--scroller-background);\r\n scrollbar-width: thin;\r\n\r\n &::-webkit-scrollbar {\r\n width: 8px;\r\n height: 8px;\r\n }\r\n\r\n &::-webkit-scrollbar-track {\r\n background: transparent;\r\n }\r\n\r\n &::-webkit-scrollbar-thumb {\r\n background: var(--scroller-thumb);\r\n }\r\n\r\n &::-webkit-scrollbar-thumb:hover {\r\n background: var(--scroller-thumb-hover);\r\n }\r\n }\r\n\r\n img {\r\n border: none;\r\n height: auto;\r\n max-width: 100%;\r\n vertical-align: middle;\r\n }\r\n\r\n [hidden] {\r\n display: none;\r\n }\r\n\r\n table {\r\n display: table;\r\n // Table and column widths are set by the widths of table and col elements\r\n // or by the width of the first row of cells. Cells in subsequent rows do not affect column widths.\r\n table-layout: fixed;\r\n width: 100%;\r\n max-width: 100%;\r\n white-space: normal;\r\n // Background needs to be on the table, not on the component in case the table overflows the component\r\n background: var(--header-background);\r\n }\r\n\r\n thead,\r\n tfoot {\r\n background-color: var(--header-background);\r\n color: var(--header-color);\r\n }\r\n\r\n &.dg-loading {\r\n &:not(.dg-initialized) {\r\n\r\n thead,\r\n tfoot {\r\n background: none;\r\n }\r\n }\r\n\r\n tbody {\r\n animation-name: dataGridShow;\r\n animation-timing-function: ease-in;\r\n animation-fill-mode: forwards;\r\n animation-duration: 0.3s; // only triggers after 300ms\r\n pointer-events: none; // disable clicks while loading\r\n }\r\n }\r\n\r\n tr {\r\n position: relative;\r\n }\r\n\r\n th,\r\n td {\r\n empty-cells: show;\r\n padding: var(--padding-y) var(--padding-x);\r\n text-align: left;\r\n\r\n &[tabindex] {\r\n outline: none;\r\n word-break: normal;\r\n }\r\n }\r\n\r\n th {\r\n font-weight: bold;\r\n padding: var(--padding-y-header) var(--padding-x);\r\n }\r\n\r\n // Prevent overflow on headers and cells\r\n th,\r\n td {\r\n position: relative;\r\n overflow: hidden;\r\n text-align: left;\r\n // These two properties keep content on one line\r\n text-overflow: ellipsis;\r\n white-space: nowrap;\r\n\r\n // Use this to allow content to flow over multiple lines\r\n &.dg-wrap {\r\n white-space: normal;\r\n word-break: break-all;\r\n }\r\n }\r\n\r\n // Expand on multiple lines on row click\r\n .dg-expandable {\r\n cursor: pointer;\r\n\r\n &.dg-expanded td {\r\n white-space: normal;\r\n word-break: break-all;\r\n }\r\n }\r\n\r\n .dg-clickable-cell {\r\n margin: 0;\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n cursor: pointer;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n }\r\n\r\n // Stick headers\r\n // https://css-tricks.com/making-tables-with-sticky-header-and-footers-got-a-bit-easier/\r\n &[sticky] table {\r\n\r\n thead,\r\n tfoot {\r\n z-index: 2;\r\n position: sticky;\r\n margin: 0;\r\n border: 0;\r\n }\r\n\r\n // Use silly value to prevent sub pixel alignment issue\r\n thead {\r\n inset-block-start: -1px;\r\n }\r\n\r\n tfoot {\r\n inset-block-end: -1px;\r\n }\r\n }\r\n\r\n // Pagination icons\r\n .dg-nav-icon,\r\n .dg-skip-icon {\r\n width: 22px;\r\n height: 22px;\r\n box-sizing: border-box;\r\n position: absolute;\r\n display: block;\r\n top: 50%;\r\n left: 50%;\r\n transform: translate(-50%, -50%) scale(var(--icon-scale, 1));\r\n\r\n &:before,\r\n &:after {\r\n content: \"\";\r\n display: block;\r\n box-sizing: border-box;\r\n position: absolute;\r\n }\r\n }\r\n\r\n .dg-nav-icon::before {\r\n width: 0;\r\n height: 10px;\r\n border-top: 5px solid transparent;\r\n border-bottom: 5px solid transparent;\r\n border-left: 6px solid;\r\n top: 6px;\r\n left: 9px;\r\n }\r\n\r\n .dg-skip-icon {\r\n &::before {\r\n width: 3px;\r\n height: 10px;\r\n background: currentColor;\r\n top: 6px;\r\n left: 14px;\r\n }\r\n\r\n &::after {\r\n width: 0;\r\n height: 10px;\r\n border-top: 5px solid transparent;\r\n border-bottom: 5px solid transparent;\r\n border-left: 6px solid;\r\n top: 6px;\r\n left: 7px;\r\n }\r\n }\r\n\r\n .dg-rotate {\r\n transform: rotate(-180deg);\r\n }\r\n\r\n // Default actions buttons\r\n button {\r\n background-color: var(--btn-background);\r\n border: solid 1px var(--btn-border-color);\r\n border-radius: var(--border-radius);\r\n color: var(--body-color);\r\n height: 2rem;\r\n margin: 0 0.2rem;\r\n padding: 0 0.5rem;\r\n pointer-events: all;\r\n text-align: center;\r\n cursor: pointer;\r\n\r\n &:hover {\r\n opacity: 0.7;\r\n }\r\n\r\n &:disabled:hover {\r\n background-color: inherit;\r\n border-color: inherit;\r\n }\r\n }\r\n\r\n // Form elements\r\n input[type=\"checkbox\"] {\r\n margin: 0;\r\n }\r\n\r\n input:not([type=\"checkbox\"]),\r\n select {\r\n background-color: var(--input-background, \"#fff\");\r\n color: currentColor;\r\n box-sizing: border-box;\r\n border: 1px solid var(--input-border-color, \"#f0f0f0\");\r\n border-radius: var(--border-radius);\r\n height: 2rem;\r\n margin: 0 0.2rem;\r\n padding: 0 var(--padding);\r\n max-width: none;\r\n }\r\n\r\n input:not([type=\"checkbox\"]),\r\n select,\r\n button {\r\n &:focus {\r\n box-shadow: 0 0 0 var(--padding-half) rgba(var(--color-rgb), 0.25);\r\n outline: 0;\r\n }\r\n\r\n &[disabled],\r\n &:disabled {\r\n opacity: 0.35;\r\n pointer-events: none;\r\n }\r\n }\r\n\r\n // Filters (2nd header row)\r\n thead tr:nth-child(2) th {\r\n padding: 0;\r\n background-color: transparent;\r\n\r\n input {\r\n width: 100%;\r\n border-radius: 0;\r\n margin: 0;\r\n\r\n &:focus {\r\n box-shadow: inset 0px 0px 0px 1px var(--color);\r\n }\r\n }\r\n }\r\n\r\n // Editable\r\n tbody td.dg-editable-col {\r\n padding: 0;\r\n height: 0; // it needs a height for height 100%\r\n }\r\n\r\n tbody td input.dg-editable {\r\n width: 100%;\r\n background: transparent;\r\n border: 0;\r\n border-radius: 0;\r\n margin: 0;\r\n box-shadow: none;\r\n height: 100%;\r\n\r\n &:focus {\r\n box-shadow: inset 0px 0px 0px 1px var(--color);\r\n }\r\n }\r\n\r\n // Empty table or error message (don't use :empty as it would create fouc on load)\r\n &.dg-empty {\r\n tbody {\r\n height: 4rem;\r\n position: relative;\r\n\r\n &:before {\r\n position: absolute;\r\n top: 50%;\r\n left: 50%;\r\n content: attr(data-empty);\r\n transform: translate(-50%, -50%);\r\n opacity: 0.5;\r\n font-size: 1.5rem;\r\n text-align: center;\r\n white-space: nowrap;\r\n text-overflow: ellipsis;\r\n overflow: hidden;\r\n width: 90%;\r\n }\r\n }\r\n\r\n tr {\r\n &.dg-fake-row {\r\n height: 4rem;\r\n border: none;\r\n }\r\n }\r\n\r\n &.dg-network-error {\r\n table {\r\n color: #842029;\r\n background-color: #f8d7da;\r\n border: 1px solid #f5c2c7;\r\n }\r\n\r\n tbody {\r\n height: auto;\r\n\r\n &:before {\r\n font-size: 2rem;\r\n top: auto;\r\n transform: translate(-50%);\r\n }\r\n\r\n tr:not(.dg-fake-row) {\r\n display: none;\r\n }\r\n }\r\n }\r\n\r\n &:not(.dg-network-error) {\r\n tbody {\r\n &:before {\r\n top: auto;\r\n transform: translate(-50%, 30%);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Zebra rows\r\n tbody tr {\r\n &:nth-child(even) {\r\n background-color: var(--bs-table-striped-bg, #f8f9fa);\r\n }\r\n\r\n border-bottom: solid 1px var(--row-border-color);\r\n\r\n &:hover {\r\n background-color: var(--highlight-color) !important;\r\n }\r\n\r\n &:focus {\r\n background-color: var(--highlight-color) !important;\r\n border-bottom-color: var(--highlight-color) !important;\r\n outline: none;\r\n }\r\n }\r\n\r\n // Meta footer\r\n tfoot {\r\n min-width: 280px;\r\n\r\n td {\r\n padding: var(--padding-y-header) var(--padding-x);\r\n }\r\n\r\n .dg-page-nav {\r\n display: flex;\r\n align-items: center;\r\n min-width: 160px;\r\n }\r\n\r\n .dg-input-page {\r\n width: 4rem;\r\n }\r\n\r\n .dg-footer {\r\n display: flex;\r\n align-items: center;\r\n flex-direction: row;\r\n justify-content: space-between;\r\n }\r\n\r\n .dg-pagination {\r\n display: flex;\r\n text-align: center;\r\n\r\n button {\r\n // Fix icon inside button\r\n position: relative;\r\n width: 2rem;\r\n }\r\n }\r\n\r\n .dg-meta {\r\n // Prevent layout from jumping around\r\n min-width: 160px;\r\n text-align: right;\r\n }\r\n\r\n &.dg-footer-compact {\r\n .dg-meta {\r\n display: none;\r\n }\r\n\r\n .dg-input-page {\r\n display: none;\r\n }\r\n }\r\n }\r\n\r\n // Pagination in header\r\n [aria-sort] {\r\n cursor: pointer;\r\n padding-right: 1.5rem;\r\n }\r\n\r\n [aria-sort=\"none\"]:after,\r\n [aria-sort=\"none\"]:before,\r\n [aria-sort=\"ascending\"]:before,\r\n [aria-sort=\"descending\"]:after {\r\n right: 0.5rem;\r\n top: calc(50% - 0.5rem);\r\n border: solid transparent;\r\n content: \" \";\r\n height: 0;\r\n width: 0;\r\n position: absolute;\r\n border-color: rgba(0, 0, 0, 0);\r\n border-width: 0.25rem;\r\n margin-left: -0.25rem;\r\n }\r\n\r\n [aria-sort=\"none\"] {\r\n &:before {\r\n border-bottom-color: currentColor;\r\n opacity: 0.25;\r\n top: calc(50% - 0.6rem);\r\n }\r\n\r\n &:after {\r\n border-top-color: currentColor;\r\n opacity: 0.25;\r\n bottom: calc(50% - 0.5rem);\r\n top: auto;\r\n }\r\n }\r\n\r\n [aria-sort=\"ascending\"]:before {\r\n border-bottom-color: var(--body-color);\r\n opacity: 0.75;\r\n }\r\n\r\n [aria-sort=\"descending\"]:after {\r\n border-top-color: var(--body-color);\r\n opacity: 0.75;\r\n bottom: calc(50% - 0.5rem);\r\n top: auto;\r\n }\r\n}\r\n\r\n[data-bs-theme=\"dark\"] data-grid {\r\n --scroller-color-lightness: 20%;\r\n --highlight-color: #43423e;\r\n --header-background: var(--bs-gray-800, #34373b);\r\n --header-color: var(--bs-light, #e9ecef);\r\n --body-color: var(--bs-body-color, #494e53);\r\n --row-border-color: var(--bs-gray-900, #212325);\r\n\r\n tbody tr {\r\n &:nth-child(even) {\r\n background-color: var(--bs-table-striped-bg, #2c3034);\r\n }\r\n }\r\n}","/**\n * Data Grid Web component \n * https://github.com/lekoala/data-grid\n */\n@keyframes dataGridShow {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0.5;\n }\n}\ndata-grid {\n --padding: 0.5rem;\n --padding-x: 0.75rem;\n --padding-y: 0.5rem;\n --padding-y-header: 0.75rem;\n --padding-half: calc(var(--padding) / 2);\n --color-rgb: var(--bs-primary-rgb, 13, 110, 253);\n --color: rgb(var(--color-rgb));\n --highlight-color: #fffcee;\n --header-background: var(--bs-gray-200, #e9ecef);\n --header-color: var(--bs-dark, #212529);\n --input-background: var(--bs-body-bg, #ffffff);\n --input-border-color: var(--bs-border-color, #e9ecef);\n --btn-background: var(--bs-body-bg, #ffffff);\n --btn-color: var(--color);\n --btn-border-color: var(--bs-border-color, #e9ecef);\n --body-bg: var(--bs-body-bg, #212529);\n --body-color: var(--bs-body-color, #212529);\n --icon-scale: 1;\n --border-radius: 0.25rem;\n --row-border-color: #f2f2f2;\n --responsive-width: 60%;\n --black: var(--bs-black, #000);\n --white: var(--bs-white, #fff);\n --gray: var(--bs-gray, #6c757d);\n --gray-dark: var(--bs-gray-dark, #343a40);\n --gray-100: var(--bs-gray-100, #f8f9fa);\n --gray-200: var(--bs-gray-200, #e9ecef);\n --gray-300: var(--bs-gray-300, #dee2e6);\n --gray-400: var(--bs-gray-400, #ced4da);\n --gray-500: var(--bs-gray-500, #adb5bd);\n --gray-600: var(--bs-gray-600, #6c757d);\n --gray-700: var(--bs-gray-700, #495057);\n --gray-800: var(--bs-gray-800, #343a40);\n --gray-900: var(--bs-gray-900, #212529);\n display: block;\n min-height: 6rem;\n position: relative;\n}\ndata-grid {\n --scroller-color: 0, 0%;\n --scroller-color-lightness: 80%;\n --scroller-hover-factor: 0.8;\n --scroller-thumb: hsl(var(--scroller-color), var(--scroller-color-lightness));\n /* Replicate hover for webkit */\n --scroller-thumb-hover: hsl(var(--scroller-color), calc(var(--scroller-color-lightness) * var(--scroller-hover-factor)));\n --scroller-background: transparent;\n scrollbar-color: var(--scroller-thumb) var(--scroller-background);\n scrollbar-width: thin;\n}\ndata-grid::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n}\ndata-grid::-webkit-scrollbar-track {\n background: transparent;\n}\ndata-grid::-webkit-scrollbar-thumb {\n background: var(--scroller-thumb);\n}\ndata-grid::-webkit-scrollbar-thumb:hover {\n background: var(--scroller-thumb-hover);\n}\ndata-grid img {\n border: none;\n height: auto;\n max-width: 100%;\n vertical-align: middle;\n}\ndata-grid [hidden] {\n display: none;\n}\ndata-grid table {\n display: table;\n table-layout: fixed;\n width: 100%;\n max-width: 100%;\n white-space: normal;\n background: var(--header-background);\n}\ndata-grid thead,\ndata-grid tfoot {\n background-color: var(--header-background);\n color: var(--header-color);\n}\ndata-grid.dg-loading:not(.dg-initialized) thead,\ndata-grid.dg-loading:not(.dg-initialized) tfoot {\n background: none;\n}\ndata-grid.dg-loading tbody {\n animation-name: dataGridShow;\n animation-timing-function: ease-in;\n animation-fill-mode: forwards;\n animation-duration: 0.3s;\n pointer-events: none;\n}\ndata-grid tr {\n position: relative;\n}\ndata-grid th,\ndata-grid td {\n empty-cells: show;\n padding: var(--padding-y) var(--padding-x);\n text-align: left;\n}\ndata-grid th[tabindex],\ndata-grid td[tabindex] {\n outline: none;\n word-break: normal;\n}\ndata-grid th {\n font-weight: bold;\n padding: var(--padding-y-header) var(--padding-x);\n}\ndata-grid th,\ndata-grid td {\n position: relative;\n overflow: hidden;\n text-align: left;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\ndata-grid th.dg-wrap,\ndata-grid td.dg-wrap {\n white-space: normal;\n word-break: break-all;\n}\ndata-grid .dg-expandable {\n cursor: pointer;\n}\ndata-grid .dg-expandable.dg-expanded td {\n white-space: normal;\n word-break: break-all;\n}\ndata-grid .dg-clickable-cell {\n margin: 0;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n}\ndata-grid[sticky] table thead,\ndata-grid[sticky] table tfoot {\n z-index: 2;\n position: sticky;\n margin: 0;\n border: 0;\n}\ndata-grid[sticky] table thead {\n inset-block-start: -1px;\n}\ndata-grid[sticky] table tfoot {\n inset-block-end: -1px;\n}\ndata-grid .dg-nav-icon,\ndata-grid .dg-skip-icon {\n width: 22px;\n height: 22px;\n box-sizing: border-box;\n position: absolute;\n display: block;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%) scale(var(--icon-scale, 1));\n}\ndata-grid .dg-nav-icon:before, data-grid .dg-nav-icon:after,\ndata-grid .dg-skip-icon:before,\ndata-grid .dg-skip-icon:after {\n content: \"\";\n display: block;\n box-sizing: border-box;\n position: absolute;\n}\ndata-grid .dg-nav-icon::before {\n width: 0;\n height: 10px;\n border-top: 5px solid transparent;\n border-bottom: 5px solid transparent;\n border-left: 6px solid;\n top: 6px;\n left: 9px;\n}\ndata-grid .dg-skip-icon::before {\n width: 3px;\n height: 10px;\n background: currentColor;\n top: 6px;\n left: 14px;\n}\ndata-grid .dg-skip-icon::after {\n width: 0;\n height: 10px;\n border-top: 5px solid transparent;\n border-bottom: 5px solid transparent;\n border-left: 6px solid;\n top: 6px;\n left: 7px;\n}\ndata-grid .dg-rotate {\n transform: rotate(-180deg);\n}\ndata-grid button {\n background-color: var(--btn-background);\n border: solid 1px var(--btn-border-color);\n border-radius: var(--border-radius);\n color: var(--body-color);\n height: 2rem;\n margin: 0 0.2rem;\n padding: 0 0.5rem;\n pointer-events: all;\n text-align: center;\n cursor: pointer;\n}\ndata-grid button:hover {\n opacity: 0.7;\n}\ndata-grid button:disabled:hover {\n background-color: inherit;\n border-color: inherit;\n}\ndata-grid input[type=checkbox] {\n margin: 0;\n}\ndata-grid input:not([type=checkbox]),\ndata-grid select {\n background-color: var(--input-background, \"#fff\");\n color: currentColor;\n box-sizing: border-box;\n border: 1px solid var(--input-border-color, \"#f0f0f0\");\n border-radius: var(--border-radius);\n height: 2rem;\n margin: 0 0.2rem;\n padding: 0 var(--padding);\n max-width: none;\n}\ndata-grid input:not([type=checkbox]):focus,\ndata-grid select:focus,\ndata-grid button:focus {\n box-shadow: 0 0 0 var(--padding-half) rgba(var(--color-rgb), 0.25);\n outline: 0;\n}\ndata-grid input:not([type=checkbox])[disabled], data-grid input:not([type=checkbox]):disabled,\ndata-grid select[disabled],\ndata-grid select:disabled,\ndata-grid button[disabled],\ndata-grid button:disabled {\n opacity: 0.35;\n pointer-events: none;\n}\ndata-grid thead tr:nth-child(2) th {\n padding: 0;\n background-color: transparent;\n}\ndata-grid thead tr:nth-child(2) th input {\n width: 100%;\n border-radius: 0;\n margin: 0;\n}\ndata-grid thead tr:nth-child(2) th input:focus {\n box-shadow: inset 0px 0px 0px 1px var(--color);\n}\ndata-grid tbody td.dg-editable-col {\n padding: 0;\n height: 0;\n}\ndata-grid tbody td input.dg-editable {\n width: 100%;\n background: transparent;\n border: 0;\n border-radius: 0;\n margin: 0;\n box-shadow: none;\n height: 100%;\n}\ndata-grid tbody td input.dg-editable:focus {\n box-shadow: inset 0px 0px 0px 1px var(--color);\n}\ndata-grid.dg-empty tbody {\n height: 4rem;\n position: relative;\n}\ndata-grid.dg-empty tbody:before {\n position: absolute;\n top: 50%;\n left: 50%;\n content: attr(data-empty);\n transform: translate(-50%, -50%);\n opacity: 0.5;\n font-size: 1.5rem;\n text-align: center;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n width: 90%;\n}\ndata-grid.dg-empty tr.dg-fake-row {\n height: 4rem;\n border: none;\n}\ndata-grid.dg-empty.dg-network-error table {\n color: #842029;\n background-color: #f8d7da;\n border: 1px solid #f5c2c7;\n}\ndata-grid.dg-empty.dg-network-error tbody {\n height: auto;\n}\ndata-grid.dg-empty.dg-network-error tbody:before {\n font-size: 2rem;\n top: auto;\n transform: translate(-50%);\n}\ndata-grid.dg-empty.dg-network-error tbody tr:not(.dg-fake-row) {\n display: none;\n}\ndata-grid.dg-empty:not(.dg-network-error) tbody:before {\n top: auto;\n transform: translate(-50%, 30%);\n}\ndata-grid tbody tr {\n border-bottom: solid 1px var(--row-border-color);\n}\ndata-grid tbody tr:nth-child(even) {\n background-color: var(--bs-table-striped-bg, #f8f9fa);\n}\ndata-grid tbody tr:hover {\n background-color: var(--highlight-color) !important;\n}\ndata-grid tbody tr:focus {\n background-color: var(--highlight-color) !important;\n border-bottom-color: var(--highlight-color) !important;\n outline: none;\n}\ndata-grid tfoot {\n min-width: 280px;\n}\ndata-grid tfoot td {\n padding: var(--padding-y-header) var(--padding-x);\n}\ndata-grid tfoot .dg-page-nav {\n display: flex;\n align-items: center;\n min-width: 160px;\n}\ndata-grid tfoot .dg-input-page {\n width: 4rem;\n}\ndata-grid tfoot .dg-footer {\n display: flex;\n align-items: center;\n flex-direction: row;\n justify-content: space-between;\n}\ndata-grid tfoot .dg-pagination {\n display: flex;\n text-align: center;\n}\ndata-grid tfoot .dg-pagination button {\n position: relative;\n width: 2rem;\n}\ndata-grid tfoot .dg-meta {\n min-width: 160px;\n text-align: right;\n}\ndata-grid tfoot.dg-footer-compact .dg-meta {\n display: none;\n}\ndata-grid tfoot.dg-footer-compact .dg-input-page {\n display: none;\n}\ndata-grid [aria-sort] {\n cursor: pointer;\n padding-right: 1.5rem;\n}\ndata-grid [aria-sort=none]:after,\ndata-grid [aria-sort=none]:before,\ndata-grid [aria-sort=ascending]:before,\ndata-grid [aria-sort=descending]:after {\n right: 0.5rem;\n top: calc(50% - 0.5rem);\n border: solid transparent;\n content: \" \";\n height: 0;\n width: 0;\n position: absolute;\n border-color: rgba(0, 0, 0, 0);\n border-width: 0.25rem;\n margin-left: -0.25rem;\n}\ndata-grid [aria-sort=none]:before {\n border-bottom-color: currentColor;\n opacity: 0.25;\n top: calc(50% - 0.6rem);\n}\ndata-grid [aria-sort=none]:after {\n border-top-color: currentColor;\n opacity: 0.25;\n bottom: calc(50% - 0.5rem);\n top: auto;\n}\ndata-grid [aria-sort=ascending]:before {\n border-bottom-color: var(--body-color);\n opacity: 0.75;\n}\ndata-grid [aria-sort=descending]:after {\n border-top-color: var(--body-color);\n opacity: 0.75;\n bottom: calc(50% - 0.5rem);\n top: auto;\n}\n\n[data-bs-theme=dark] data-grid {\n --scroller-color-lightness: 20%;\n --highlight-color: #43423e;\n --header-background: var(--bs-gray-800, #34373b);\n --header-color: var(--bs-light, #e9ecef);\n --body-color: var(--bs-body-color, #494e53);\n --row-border-color: var(--bs-gray-900, #212325);\n}\n[data-bs-theme=dark] data-grid tbody tr:nth-child(even) {\n background-color: var(--bs-table-striped-bg, #2c3034);\n}\n\ndata-grid[dir=rtl] th,\ndata-grid[dir=rtl] td {\n text-align: right;\n}\ndata-grid[dir=rtl] [aria-sort] {\n padding-left: 1rem;\n padding-right: 0.5rem;\n}\ndata-grid[dir=rtl] [aria-sort=none]:after,\ndata-grid[dir=rtl] [aria-sort=none]:before,\ndata-grid[dir=rtl] [aria-sort=ascending]:before,\ndata-grid[dir=rtl] [aria-sort=descending]:after {\n left: 0.75rem;\n right: auto;\n}\ndata-grid[dir=rtl] tfoot .dg-meta {\n text-align: left;\n}\n\ndata-grid .dg-menu {\n position: absolute;\n z-index: 3;\n background: var(--body-bg);\n list-style: none;\n max-width: 150px;\n margin: 0;\n padding: var(--padding);\n box-shadow: 0 0 1rem rgba(0, 0, 0, 0.25);\n border-radius: var(--border-radius);\n}\ndata-grid .dg-menu li {\n margin: 0;\n padding: 0;\n}\ndata-grid .dg-menu label {\n display: flex;\n align-items: center;\n margin-bottom: 0.25em;\n}\ndata-grid .dg-menu input {\n margin-right: 0.5em;\n}\n\ndata-grid .dg-actions {\n text-overflow: initial;\n width: 100px;\n text-align: right;\n white-space: nowrap !important;\n}\ndata-grid .dg-actions button {\n margin: 0;\n}\ndata-grid .dg-actions button + button {\n margin-left: 0.5rem;\n}\ndata-grid .dg-actions .dg-actions-toggle {\n display: none;\n width: calc(100px - var(--padding-x) * 2);\n}\ndata-grid .dg-actions.dg-actions-1 {\n width: 100%;\n}\ndata-grid .dg-actions.dg-actions-2 button {\n width: calc(50% - 0.25rem);\n}\ndata-grid .dg-actions.dg-actions-more button {\n display: none;\n}\ndata-grid .dg-actions.dg-actions-more button.dg-actions-toggle {\n display: inline-block;\n}\ndata-grid .dg-actions.dg-actions-expand {\n position: absolute;\n right: 0;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n width: 100%;\n height: 100%;\n}\ndata-grid .dg-actions.dg-actions-expand.dg-actions-more {\n width: 100%;\n}\ndata-grid .dg-actions.dg-actions-expand.dg-actions-more button {\n display: inline-block;\n}\ndata-grid tr.dg-actionable {\n cursor: pointer;\n}\ndata-grid tr.dg-actionable:hover td {\n background-color: var(--highlight-color);\n}\n\ndata-grid .dg-resizer {\n position: absolute;\n top: 0;\n right: 0;\n width: 6px;\n z-index: 2;\n cursor: col-resize;\n user-select: none;\n}\ndata-grid .dg-resizer:before {\n content: \"\";\n display: block;\n position: absolute;\n top: var(--padding-y-header);\n height: 1.5rem;\n right: 0;\n width: 2px;\n background: var(--body-color);\n opacity: 0.2;\n}\ndata-grid .dg-resizer:hover:before {\n opacity: 0.6;\n}\ndata-grid .dg-resizer.dg-resizer-active {\n border-right: 1px dashed var(--color);\n}\ndata-grid .dg-resizer.dg-resizer-active:before {\n opacity: 0.6;\n}\n\ndata-grid .dg-responsive-toggle {\n padding: 0;\n text-align: center;\n}\ndata-grid .dg-responsive-child-row > td {\n padding: 0;\n}\ndata-grid .dg-responsive-table {\n table-layout: auto;\n border: 0;\n}\ndata-grid .dg-responsive-table td,\ndata-grid .dg-responsive-table th {\n white-space: normal;\n}\ndata-grid .dg-responsive-table th {\n max-width: 40%;\n}\n\n@media only screen and (max-width: 767px) {\n data-grid[responsive] .dg-resizer {\n display: none;\n }\n data-grid[responsive] .dg-meta {\n display: none;\n }\n data-grid[responsive] .dg-input-page {\n display: none;\n }\n data-grid[responsive] table,\n data-grid[responsive] tbody,\n data-grid[responsive] tfoot,\n data-grid[responsive] th,\n data-grid[responsive] td,\n data-grid[responsive] tr:not([hidden]) {\n display: block;\n }\n data-grid[responsive] thead {\n display: flex;\n border-bottom: 2px solid var(--header-background);\n }\n data-grid[responsive] thead > tr {\n flex-grow: 1;\n }\n data-grid[responsive] thead th {\n width: auto;\n }\n data-grid[responsive] tbody tr {\n padding: 0;\n border: 1px solid var(--header-background);\n }\n data-grid[responsive] tbody td {\n border: none;\n border-bottom: 1px solid var(--row-border-color);\n position: relative;\n padding-left: calc(100% - var(--responsive-width) - var(--padding) * 2);\n }\n data-grid[responsive] tbody td:last-child {\n border: 0;\n }\n data-grid[responsive] tbody td:before {\n position: absolute;\n top: 0;\n left: 0;\n padding: var(--padding);\n width: calc(100% - var(--responsive-width) - var(--padding) * 4);\n white-space: nowrap;\n content: attr(data-name);\n display: block;\n font-weight: bold;\n background-color: var(--header-background);\n }\n data-grid[responsive] tbody td[role=gridcell] {\n padding-left: calc(100% - var(--responsive-width) - var(--padding) * 4 + 0.5rem);\n }\n data-grid[responsive] .dg-selectable {\n height: 28px;\n margin: 2px 1px 2px;\n }\n data-grid[responsive] td.dg-selectable::before, data-grid[responsive] td.dg-actions::before {\n padding: 0;\n }\n data-grid[responsive] td.dg-selectable label {\n padding: 5px;\n }\n data-grid[responsive] td[role=gridcell] {\n min-height: 35px;\n width: auto;\n }\n data-grid[responsive] td[data-name]::before {\n height: 100%;\n }\n data-grid[responsive] td.dg-actions {\n padding-left: inherit;\n width: inherit;\n }\n data-grid[responsive] .dg-actions button {\n width: inherit !important;\n }\n data-grid[responsive] tr.dg-head-columns {\n padding: 0;\n width: calc(100% - var(--responsive-width) - var(--padding) * 4);\n }\n data-grid[responsive] tr.dg-head-columns th[role=\"columnheader button\"] {\n padding: 0.36em 1.3em 0.36em 0.75em;\n }\n data-grid[responsive] tr.dg-head-filters {\n background: transparent;\n vertical-align: top;\n padding: 0;\n width: calc(100% - (100% - var(--responsive-width) - var(--padding) * 4));\n }\n data-grid[responsive] .dg-head-filters th input:not([type=checkbox], [type=radio]) {\n height: 2.25em;\n }\n data-grid[responsive] .dg-head-filters th.dg-selectable {\n background: transparent;\n }\n data-grid[responsive] .dg-head-filters th.dg-selectable label::before {\n content: \"Column Filters\";\n }\n}\n\n/*# sourceMappingURL=data-grid.css.map */\n","data-grid {\r\n &[dir=\"rtl\"] {\r\n th,\r\n td {\r\n text-align: right;\r\n }\r\n [aria-sort] {\r\n padding-left: 1rem;\r\n padding-right: 0.5rem;\r\n }\r\n [aria-sort=\"none\"]:after,\r\n [aria-sort=\"none\"]:before,\r\n [aria-sort=\"ascending\"]:before,\r\n [aria-sort=\"descending\"]:after {\r\n left: 0.75rem;\r\n right: auto;\r\n }\r\n tfoot .dg-meta {\r\n text-align: left;\r\n }\r\n }\r\n}\r\n","data-grid {\r\n .dg-menu {\r\n position: absolute;\r\n z-index: 3;\r\n background: var(--body-bg);\r\n list-style: none;\r\n max-width: 150px;\r\n margin: 0;\r\n padding: var(--padding);\r\n box-shadow: 0 0 1rem rgba(0, 0, 0, 0.25);\r\n border-radius: var(--border-radius);\r\n\r\n li {\r\n margin: 0;\r\n padding: 0;\r\n }\r\n label {\r\n display: flex;\r\n align-items: center;\r\n margin-bottom: 0.25em;\r\n }\r\n input {\r\n margin-right: 0.5em;\r\n }\r\n }\r\n}\r\n","data-grid {\r\n .dg-actions {\r\n text-overflow: initial;\r\n width: 100px;\r\n text-align: right;\r\n white-space: nowrap !important;\r\n\r\n button {\r\n margin: 0;\r\n\r\n + button {\r\n margin-left: 0.5rem;\r\n }\r\n }\r\n .dg-actions-toggle {\r\n display: none;\r\n width: calc(100px - var(--padding-x) * 2);\r\n }\r\n &.dg-actions-1 {\r\n width: 100%;\r\n }\r\n // This needs icons to work\r\n &.dg-actions-2 button {\r\n width: calc(50% - 0.25rem);\r\n }\r\n &.dg-actions-more button {\r\n display: none;\r\n\r\n &.dg-actions-toggle {\r\n display: inline-block;\r\n }\r\n }\r\n &.dg-actions-expand {\r\n position: absolute;\r\n right: 0;\r\n display: flex;\r\n align-items: center;\r\n justify-content: flex-end;\r\n width: 100%;\r\n height: 100%;\r\n }\r\n &.dg-actions-expand.dg-actions-more {\r\n width: 100%;\r\n\r\n button {\r\n display: inline-block;\r\n }\r\n }\r\n }\r\n tr.dg-actionable {\r\n cursor: pointer;\r\n\r\n &:hover td {\r\n background-color: var(--highlight-color);\r\n }\r\n }\r\n}\r\n","data-grid {\r\n .dg-resizer {\r\n position: absolute;\r\n top: 0;\r\n right: 0;\r\n width: 6px; // clickable zone\r\n z-index: 2;\r\n cursor: col-resize;\r\n user-select: none;\r\n\r\n &:before {\r\n content: \"\";\r\n display: block;\r\n position: absolute;\r\n top: var(--padding-y-header);\r\n height: 1.5rem;\r\n right: 0;\r\n width: 2px;\r\n background: var(--body-color);\r\n opacity: 0.2;\r\n }\r\n &:hover:before {\r\n opacity: 0.6;\r\n }\r\n &.dg-resizer-active {\r\n border-right: 1px dashed var(--color);\r\n\r\n &:before {\r\n opacity: 0.6;\r\n }\r\n }\r\n }\r\n}\r\n","data-grid {\r\n .dg-responsive-toggle {\r\n padding: 0;\r\n text-align: center;\r\n }\r\n .dg-responsive-child-row > td {\r\n padding: 0;\r\n }\r\n .dg-responsive-table {\r\n table-layout: auto;\r\n border: 0;\r\n\r\n td,\r\n th {\r\n white-space: normal;\r\n }\r\n\r\n th {\r\n max-width: 40%;\r\n }\r\n }\r\n}\r\n\r\n// CSS Only responsive\r\n@media only screen and (max-width: 767px) {\r\n data-grid[responsive] {\r\n // Doesn't make any sense to resize\r\n .dg-resizer {\r\n display: none;\r\n }\r\n\r\n // more compact footer\r\n .dg-meta {\r\n display: none;\r\n }\r\n .dg-input-page {\r\n display: none;\r\n }\r\n\r\n // everything as blocks\r\n table,\r\n tbody,\r\n tfoot,\r\n th,\r\n td,\r\n tr:not([hidden]) {\r\n display: block;\r\n }\r\n\r\n // use flex for thead\r\n thead {\r\n display: flex;\r\n\r\n > tr {\r\n flex-grow: 1;\r\n }\r\n th {\r\n width: auto;\r\n }\r\n\r\n border-bottom: 2px solid var(--header-background);\r\n }\r\n\r\n // use pseudo element to display column name\r\n tbody {\r\n tr {\r\n padding: 0;\r\n border: 1px solid var(--header-background);\r\n }\r\n td {\r\n border: none;\r\n border-bottom: 1px solid var(--row-border-color);\r\n position: relative;\r\n padding-left: calc(100% - var(--responsive-width) - var(--padding) * 2);\r\n\r\n &:last-child {\r\n border: 0;\r\n }\r\n &:before {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n padding: var(--padding);\r\n width: calc(100% - var(--responsive-width) - var(--padding) * 4);\r\n white-space: nowrap;\r\n content: attr(data-name);\r\n display: block;\r\n font-weight: bold;\r\n background-color: var(--header-background);\r\n }\r\n &[role=\"gridcell\"] {\r\n padding-left: calc(100% - var(--responsive-width) - var(--padding) * 4 + 0.5rem);\r\n }\r\n }\r\n }\r\n\r\n // give selectable some room\r\n .dg-selectable {\r\n height: 28px;\r\n margin: 2px 1px 2px;\r\n }\r\n\r\n td {\r\n &.dg-selectable::before,\r\n &.dg-actions::before {\r\n padding: 0;\r\n }\r\n &.dg-selectable label {\r\n padding: 5px;\r\n }\r\n &[role=\"gridcell\"] {\r\n min-height: 35px;\r\n width: auto;\r\n }\r\n &[data-name]::before {\r\n height: 100%;\r\n }\r\n &.dg-actions {\r\n padding-left: inherit;\r\n width: inherit;\r\n }\r\n }\r\n .dg-actions button {\r\n width: inherit !important;\r\n }\r\n tr {\r\n &.dg-head-columns {\r\n padding: 0;\r\n width: calc(100% - var(--responsive-width) - var(--padding) * 4);\r\n\r\n th[role=\"columnheader button\"] {\r\n padding: 0.36em 1.3em 0.36em 0.75em;\r\n }\r\n }\r\n &.dg-head-filters {\r\n background: transparent;\r\n vertical-align: top;\r\n padding: 0;\r\n width: calc(100% - (100% - var(--responsive-width) - var(--padding) * 4));\r\n }\r\n }\r\n .dg-head-filters th input:not([type=\"checkbox\"], [type=\"radio\"]) {\r\n height: 2.25em;\r\n }\r\n .dg-head-filters th.dg-selectable {\r\n background: transparent;\r\n }\r\n .dg-head-filters th.dg-selectable label::before {\r\n content: \"Column Filters\";\r\n }\r\n }\r\n}\r\n"]} \ No newline at end of file diff --git a/dist/data-grid.js b/dist/data-grid.js index d6fca0a..e72e88c 100644 --- a/dist/data-grid.js +++ b/dist/data-grid.js @@ -982,7 +982,7 @@ var DataGrid = class extends base_element_default { * @returns {Promise} */ loadData() { - const flagEmpty = () => !this.data.length && this.classList.add("dg-empty"); + const flagEmpty = () => !this.data.length && this.classList.add("dg-empty"), tbody = this.querySelector("tbody"); if (this.meta || this.originalData || this.classList.contains("dg-initialized")) { if (!this.options.server || this.options.server && !this.fireEvents) { this.log("skip loadData"); @@ -1019,11 +1019,14 @@ var DataGrid = class extends base_element_default { }).catch((err) => { this.log(err); if (err.message) { - this.querySelector("tbody").setAttribute("data-empty", err.message.replace(/^\s+|\r\n|\n|\r$/g, "")); + tbody.setAttribute("data-empty", err.message.replace(/^\s+|\r\n|\n|\r$/g, "")); } this.classList.add("dg-empty", "dg-network-error"); }).finally(() => { flagEmpty(); + if (!this.classList.contains("dg-network-error") && tbody.getAttribute("data-empty") != this.labels.noData) { + tbody.setAttribute("data-empty", this.labels.noData); + } this.classList.remove("dg-loading"); this.loading = false; }); diff --git a/dist/data-grid.js.map b/dist/data-grid.js.map index 27ce6c1..d86944e 100644 --- a/dist/data-grid.js.map +++ b/dist/data-grid.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../src/utils/camelize.js", "../src/utils/normalizeData.js", "../src/utils/shortcuts.js", "../src/core/base-element.js", "../src/utils/addSelectOption.js", "../src/utils/appendParamsToUrl.js", "../src/utils/convertArray.js", "../src/utils/elementOffset.js", "../src/utils/interpolate.js", "../src/utils/getTextWidth.js", "../src/utils/randstr.js", "../src/data-grid.js", "../src/core/base-plugin.js", "../src/plugins/column-resizer.js", "../src/utils/getParentElement.js", "../src/plugins/context-menu.js", "../src/plugins/draggable-headers.js", "../src/plugins/touch-support.js", "../src/plugins/selectable-rows.js", "../src/plugins/fixed-height.js", "../src/plugins/autosize-column.js", "../src/utils/debounce.js", "../src/plugins/responsive-grid.js", "../src/plugins/row-actions.js", "../src/plugins/editable-column.js", "../data-grid.js"], - "sourcesContent": ["/**\r\n * @param {String} str\r\n * @returns {String}\r\n */\r\nexport default function camelize(str) {\r\n return str.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g, (m, chr) => chr.toUpperCase());\r\n}\r\n", "/**\r\n * Parse data attribute and return properly typed data\r\n * @param {String} v\r\n * @returns {any}\r\n */\r\nexport default function normalizeData(v) {\r\n // Bool\r\n if (v === \"true\") {\r\n return true;\r\n }\r\n if (v === \"false\") {\r\n return false;\r\n }\r\n // Null or empty\r\n if (v === \"\" || v === \"null\") {\r\n return null;\r\n }\r\n // Numeric attributes\r\n if (v === Number(v).toString()) {\r\n return Number(v);\r\n }\r\n // Only attempt json parsing for array or objects\r\n if (v && [\"[\", \"{\"].includes(v.substring(0, 1))) {\r\n try {\r\n // In case we have only single quoted values, like ['one', 'two', 'three']\r\n if (v.indexOf('\"') === -1) {\r\n v = v.replace(/'/g, '\"');\r\n }\r\n return JSON.parse(decodeURIComponent(v));\r\n } catch {\r\n console.error(\"Failed to parse \" + v);\r\n return {};\r\n }\r\n }\r\n return v;\r\n}\r\n", "/**\r\n * @typedef FlexibleHTMLProps\r\n * @property {boolean} [checked] (HTMLInputElement)\r\n * @property {string} [value] (HTMLInputElement)\r\n * @property {number} [rowHeight] (HTMLTableRowElement)\r\n *\r\n * A flexible type HTMLElement type that does not require using instanceof all over the place\r\n * Make sure that your selector is indeed valid\r\n * Only includes most commons props\r\n * @typedef {HTMLElement & FlexibleHTMLProps} FlexibleHTMLElement\r\n */\r\n\r\n/**\r\n * Keep this as reference for easy documentation\r\n * @typedef {HTMLElement&HTMLInputElement&HTMLTableRowElement} MixedHTMLElement\r\n */\r\n\r\n/**\r\n * @typedef FlexibleEventProps\r\n * @property {FlexibleHTMLElement} target\r\n * @property {FlexibleHTMLElement} currentTarget\r\n * @property {DataTransfer} [dataTransfer] (DragEvent)\r\n * @property {number} [clientX] (MouseEvent)\r\n * @property {number} [clientY] (MouseEvent)\r\n *\r\n * @typedef {Event & FlexibleEventProps} FlexibleEvent\r\n */\r\n\r\n/**\r\n * Keep this as reference for easy documentation\r\n * @typedef {Event&MouseEvent&InputEvent&DragEvent&FocusEvent&KeyboardEvent&PointerEvent} MixedEvent\r\n */\r\n\r\n/**\r\n * @callback FlexibleListener\r\n * @param {FlexibleEvent} event\r\n */\r\n\r\nclass FlexibleEventListenerObject {\r\n /**\r\n * @param {FlexibleEvent} e\r\n */\r\n handleEvent(e) {}\r\n}\r\n\r\nconst supportedPassiveTypes = [\r\n \"scroll\",\r\n \"wheel\",\r\n \"touchstart\",\r\n \"touchmove\",\r\n \"touchenter\",\r\n \"touchend\",\r\n \"touchleave\",\r\n \"mouseout\",\r\n \"mouseleave\",\r\n \"mouseup\",\r\n \"mousedown\",\r\n \"mousemove\",\r\n \"mouseenter\",\r\n \"mousewheel\",\r\n \"mouseover\",\r\n];\r\n\r\n/**\r\n * Automatically set passive options based on type\r\n * @param {string} type\r\n * @returns {AddEventListenerOptions}\r\n */\r\nfunction passiveOpts(type) {\r\n if (supportedPassiveTypes.includes(type)) {\r\n return { passive: true };\r\n }\r\n return {};\r\n}\r\n\r\n/**\r\n * @param {Element} el\r\n * @param {String} name\r\n * @returns {any}\r\n */\r\nexport function getAttribute(el, name) {\r\n return el.getAttribute(name);\r\n}\r\n\r\n/**\r\n * @param {Element} el\r\n * @param {String} name\r\n * @returns {Boolean}\r\n */\r\nexport function hasAttribute(el, name) {\r\n return el.hasAttribute(name);\r\n}\r\n\r\n/**\r\n * @param {Element} el\r\n * @param {String} name\r\n * @param {any} v\r\n * @param {Boolean} check Prevent setting if attribute is already there\r\n */\r\nexport function setAttribute(el, name, v = \"\", check = false) {\r\n if (check && hasAttribute(el, name)) return;\r\n el.setAttribute(name, \"\" + v);\r\n}\r\n\r\n/**\r\n * @param {Element} el\r\n * @param {String} name\r\n */\r\nexport function removeAttribute(el, name) {\r\n if (hasAttribute(el, name)) {\r\n el.removeAttribute(name);\r\n }\r\n}\r\n\r\n/**\r\n * @param {EventTarget} el\r\n * @param {String} type\r\n * @param {EventListenerObject|FlexibleListener} listener\r\n */\r\nexport function on(el, type, listener) {\r\n el.addEventListener(type, listener, passiveOpts(type));\r\n}\r\n\r\n/**\r\n * @param {EventTarget} el\r\n * @param {String} type\r\n * @param {EventListenerObject|FlexibleListener} listener\r\n */\r\nexport function off(el, type, listener) {\r\n el.removeEventListener(type, listener, passiveOpts(type));\r\n}\r\n\r\n/**\r\n * @param {EventTarget} el\r\n * @param {String} type\r\n * @param {EventListenerObject|FlexibleListener} listener\r\n */\r\nexport function one(el, type, listener) {\r\n el.addEventListener(type, listener, {\r\n once: true,\r\n });\r\n}\r\n\r\n/**\r\n * @param {HTMLElement} el\r\n * @param {String} name\r\n * @param {any} data\r\n * @param {Boolean} bubbles\r\n */\r\nexport function dispatch(el, name, data = {}, bubbles = false) {\r\n let opts = {};\r\n if (bubbles) {\r\n opts.bubbles = true;\r\n }\r\n if (data) {\r\n opts.detail = data;\r\n }\r\n el.dispatchEvent(new CustomEvent(name, opts));\r\n}\r\n\r\n/**\r\n * @param {Element} el\r\n * @param {String} name\r\n * @returns {Boolean}\r\n */\r\nexport function hasClass(el, name) {\r\n return el.classList.contains(name);\r\n}\r\n\r\n/**\r\n * @param {Element} el\r\n * @param {String} name\r\n */\r\nexport function addClass(el, name) {\r\n el.classList.add(...name.split(\" \"));\r\n}\r\n\r\n/**\r\n * @param {Element} el\r\n * @param {String} name\r\n */\r\nexport function removeClass(el, name) {\r\n el.classList.remove(...name.split(\" \"));\r\n}\r\n\r\n/**\r\n * @param {Element} el\r\n * @param {String} name\r\n */\r\nexport function toggleClass(el, name) {\r\n el.classList.toggle(name);\r\n}\r\n\r\n/**\r\n * @param {String|HTMLElement} selector\r\n * @param {HTMLElement|Document} base\r\n * @returns {FlexibleHTMLElement|null}\r\n */\r\nexport function $(selector, base = document) {\r\n if (selector instanceof HTMLElement) {\r\n return selector;\r\n }\r\n return base.querySelector(selector);\r\n}\r\n\r\n/**\r\n * @param {String} selector\r\n * @param {Element|Document} base\r\n * @returns {Array}\r\n */\r\nexport function $$(selector, base = document) {\r\n return Array.from(base.querySelectorAll(selector));\r\n}\r\n\r\n/**\r\n * Easily retrieve untyped element\r\n * For actual type, prefer use of el.querySelector\r\n * @param {HTMLElement} el\r\n * @param {String|HTMLElement} selector\r\n * @returns {FlexibleHTMLElement}\r\n */\r\nexport function find(el, selector) {\r\n return $(selector, el);\r\n}\r\n\r\n/**\r\n * Easily retrieve untyped elements\r\n * For actual type, prefer use of el.querySelectorAll\r\n * @param {Element} el\r\n * @param {String} selector\r\n * @returns {Array}\r\n */\r\nexport function findAll(el, selector) {\r\n return $$(selector, el);\r\n}\r\n\r\n/**\r\n * @param {*} el\r\n * @returns {FlexibleHTMLElement}\r\n */\r\nexport function el(el) {\r\n return el;\r\n}\r\n\r\n/**\r\n * @template {keyof HTMLElementTagNameMap} K\r\n * @param {K} tagName\r\n * @param {HTMLElement} parent\r\n * @returns {HTMLElementTagNameMap[K]}\r\n */\r\nexport function ce(tagName, parent = null) {\r\n const el = document.createElement(tagName);\r\n if (parent) {\r\n parent.appendChild(el);\r\n }\r\n return el;\r\n}\r\n\r\n/**\r\n * @param {HTMLElement} newNode\r\n * @param {HTMLElement} existingNode\r\n */\r\nexport function insertAfter(newNode, existingNode) {\r\n existingNode.parentNode.insertBefore(newNode, existingNode.nextSibling);\r\n}\r\n", "import camelize from \"../utils/camelize.js\";\r\nimport normalizeData from \"../utils/normalizeData.js\";\r\nimport { dispatch, getAttribute, setAttribute } from \"../utils/shortcuts.js\";\r\n\r\n/**\r\n * Base element that does not contain any specific logic\r\n * related to this project but makes HTMLElemnt usable\r\n */\r\nclass BaseElement extends HTMLElement {\r\n /**\r\n * @param {Object} options\r\n */\r\n constructor(options = {}) {\r\n super();\r\n this.options = Object.assign({}, this.defaultOptions, this.normalizedDataset, options);\r\n\r\n this.log(\"constructor\");\r\n\r\n this.fireEvents = true;\r\n this._ready();\r\n\r\n this.log(\"ready\");\r\n }\r\n\r\n get defaultOptions() {\r\n return {};\r\n }\r\n\r\n /**\r\n * @param {String} opt\r\n * @returns {any}\r\n */\r\n getOption(opt) {\r\n return this.options[opt];\r\n }\r\n\r\n /**\r\n * @param {String} opt\r\n * @param {any} v\r\n */\r\n setOption(opt, v) {\r\n setAttribute(this, `data-${opt}`, v);\r\n }\r\n\r\n /**\r\n * @param {String} opt\r\n */\r\n toggleOption(opt) {\r\n setAttribute(this, `data-${opt}`, !this.getOption(opt));\r\n }\r\n\r\n get normalizedDataset() {\r\n let jsonConfig = this.dataset.config ? JSON.parse(this.dataset.config) : {};\r\n let data = { ...this.dataset };\r\n for (var key in data) {\r\n if (key == \"config\") {\r\n continue;\r\n }\r\n data[key] = normalizeData(data[key]);\r\n }\r\n // Once normalized, merge into json config\r\n Object.assign(data, jsonConfig);\r\n return data;\r\n }\r\n\r\n /**\r\n * @returns {String}\r\n */\r\n static template() {\r\n return \"\";\r\n }\r\n\r\n /**\r\n * This is called at the end of constructor. Extend in subclass if needed.\r\n */\r\n _ready() {}\r\n\r\n /**\r\n * @param {String|Error} message\r\n */\r\n log(message) {\r\n if (this.options.debug) {\r\n console.log(\"[\" + getAttribute(this, \"id\") + \"] \" + message);\r\n }\r\n }\r\n\r\n /**\r\n * Handle events within the component\r\n * @link https://gist.github.com/WebReflection/ec9f6687842aa385477c4afca625bbf4#handling-events\r\n * @param {Event} event\r\n */\r\n handleEvent(event) {\r\n if (this[`on${event.type}`]) {\r\n this[`on${event.type}`](event);\r\n }\r\n }\r\n\r\n /**\r\n * This is called when connected. Extend in subclass if needed.\r\n */\r\n _connected() {}\r\n\r\n connectedCallback() {\r\n // ensure whenDefined callbacks run first\r\n setTimeout(() => {\r\n this.log(\"connectedCallback\");\r\n\r\n // Append only when labels had the opportunity to be set\r\n // Don't use shadow dom as it makes theming super hard\r\n const template = document.createElement(\"template\");\r\n // @ts-ignore\r\n template.innerHTML = this.constructor.template();\r\n this.appendChild(template.content.cloneNode(true));\r\n\r\n this._connected();\r\n // @link https://gist.github.com/WebReflection/ec9f6687842aa385477c4afca625bbf4#life-cycle-events\r\n dispatch(this, \"connected\");\r\n }, 0);\r\n }\r\n\r\n /**\r\n * This is called when disconnected. Extend in subclass if needed.\r\n */\r\n _disconnected() {}\r\n\r\n disconnectedCallback() {\r\n this.log(\"disconnectedCallback\");\r\n this._disconnected();\r\n // @link https://gist.github.com/WebReflection/ec9f6687842aa385477c4afca625bbf4#life-cycle-events\r\n dispatch(this, \"disconnected\");\r\n }\r\n\r\n /**\r\n * @link https://gist.github.com/WebReflection/ec9f6687842aa385477c4afca625bbf4#a-props-like-accessor\r\n * @returns {Object}\r\n */\r\n get transformAttributes() {\r\n return {};\r\n }\r\n\r\n /**\r\n * This is only meant to work with data attributes\r\n * This allows us to have properties that reflect automatically in the component\r\n * @link https://gist.github.com/WebReflection/ec9f6687842aa385477c4afca625bbf4#reflected-dataset-attributes\r\n * @param {String} attributeName\r\n * @param {String} oldValue\r\n * @param {String} newValue\r\n */\r\n attributeChangedCallback(attributeName, oldValue, newValue) {\r\n // It didn't change\r\n if (oldValue === newValue) {\r\n return;\r\n }\r\n\r\n this.log(\"attributeChangedCallback: \" + attributeName);\r\n\r\n let isOption = false;\r\n const transformer = this.transformAttributes[attributeName] ?? normalizeData;\r\n\r\n // Data attributes are mapped to options while other attributes are mapped as properties\r\n if (attributeName.indexOf(\"data-\") === 0) {\r\n attributeName = attributeName.slice(5);\r\n isOption = true;\r\n }\r\n attributeName = camelize(attributeName);\r\n if (isOption) {\r\n this.options[attributeName] = transformer(newValue);\r\n } else {\r\n this[attributeName] = transformer(newValue);\r\n }\r\n\r\n // Fire internal event\r\n if (this.fireEvents && this[`${attributeName}Changed`]) {\r\n this[`${attributeName}Changed`]();\r\n }\r\n }\r\n}\r\n\r\nexport default BaseElement;\r\n", "/**\r\n * @param {HTMLSelectElement} el\r\n * @param {String} value\r\n * @param {String} label\r\n * @param {Boolean} checked\r\n */\r\nexport default function addSelectOption(el, value, label, checked = false) {\r\n let opt = document.createElement(\"option\");\r\n opt.value = \"\" + value;\r\n if (checked) {\r\n opt.selected = true;\r\n }\r\n opt.label = label;\r\n el.appendChild(opt);\r\n}\r\n", "/**\r\n * @param {URL} url\r\n * @param {Object} params\r\n */\r\nexport default function appendParamsToUrl(url, params = {}) {\r\n Object.keys(params).forEach((key) => {\r\n if (Array.isArray(params[key])) {\r\n // @ts-ignore\r\n Object.keys(params[key]).forEach((k) => url.searchParams.append(isNaN(k) ? `${key}[${k}]` : key, params[key][k]));\r\n } else {\r\n url.searchParams.append(key, params[key]);\r\n }\r\n });\r\n}\r\n", "/**\r\n * Force value as arrays\r\n * @param {String|Array} v\r\n * @returns {Array}\r\n */\r\nexport default function convertArray(v) {\r\n if (typeof v === \"string\") {\r\n if (v[0] === \"[\") {\r\n // \"['my', 'value']\" would fail as a json\r\n if (v.indexOf('\"') === -1) {\r\n v = v.replace(/'/g, '\"');\r\n }\r\n return JSON.parse(v);\r\n }\r\n\r\n return v.split(\",\");\r\n }\r\n if (!Array.isArray(v)) {\r\n console.error(\"Invalid array\", v);\r\n return [];\r\n }\r\n return v;\r\n}\r\n", "/**\r\n * @param {HTMLElement} el\r\n * @returns {Object}\r\n */\r\nexport default function elementOffset(el) {\r\n var rect = el.getBoundingClientRect(),\r\n scrollLeft = window.pageXOffset || document.documentElement.scrollLeft,\r\n scrollTop = window.pageYOffset || document.documentElement.scrollTop;\r\n return { top: rect.top + scrollTop, left: rect.left + scrollLeft };\r\n}\r\n", "/**\r\n * Replace element within {} by their data value\r\n * @param {String} str\r\n * @param {Object} data\r\n * @returns {String}\r\n */\r\nexport default function interpolate(str, data) {\r\n return str.replace(/\\{([^}]+)?\\}/g, function ($1, $2) {\r\n return data[$2];\r\n });\r\n}\r\n", "/**\r\n * Uses canvas.measureText to compute and return the width of the given text of given font in pixels.\r\n * Getting computed styles only works for dom that are added in the dom\r\n * @see https://stackoverflow.com/questions/118241/calculate-text-width-with-javascript/21015393#21015393\r\n * @param {String} text The text to be rendered.\r\n * @param {Element} el Target element (defaults to body)\r\n * @param {Boolean} withPadding Include padding on element\r\n * @returns {Number}\r\n */\r\nexport default function getTextWidth(text, el = document.body, withPadding = false) {\r\n if (!el) {\r\n el = document.createElement(\"div\");\r\n }\r\n const styles = window.getComputedStyle(el);\r\n const fontWeight = styles.getPropertyValue(\"font-weight\") || \"normal\";\r\n const fontSize = styles.getPropertyValue(\"font-size\") || \"1rem\";\r\n const fontFamily = styles.getPropertyValue(\"font-family\") || \"Arial\";\r\n\r\n let padding = 0;\r\n if (withPadding) {\r\n const paddingLeft = styles.getPropertyValue(\"padding-left\") || \"0\";\r\n const paddingRight = styles.getPropertyValue(\"padding-right\") || \"0\";\r\n padding = parseInt(paddingLeft) + parseInt(paddingRight);\r\n }\r\n\r\n // re-use canvas object for better performance\r\n // @ts-ignore\r\n const canvas = getTextWidth.canvas || (getTextWidth.canvas = document.createElement(\"canvas\"));\r\n const context = canvas.getContext(\"2d\");\r\n context.font = `${fontWeight} ${fontSize} ${fontFamily}`;\r\n const metrics = context.measureText(text);\r\n return parseInt(metrics.width) + padding;\r\n}\r\n", "/**\r\n * @param {String} prefix\r\n * @returns {String}\r\n */\r\nexport default function randstr(prefix) {\r\n return Math.random()\r\n .toString(36)\r\n .replace(\"0.\", prefix || \"\");\r\n}\r\n", "/**\n * Data Grid Web component\n *\n * Credits for inspiration\n * @link https://github.com/riverside/zino-grid\n */\n\"use strict\";\n\nimport BaseElement from \"./core/base-element.js\";\nimport addSelectOption from \"./utils/addSelectOption.js\";\nimport appendParamsToUrl from \"./utils/appendParamsToUrl.js\";\nimport camelize from \"./utils/camelize.js\";\nimport convertArray from \"./utils/convertArray.js\";\nimport elementOffset from \"./utils/elementOffset.js\";\nimport interpolate from \"./utils/interpolate.js\";\nimport getTextWidth from \"./utils/getTextWidth.js\";\nimport randstr from \"./utils/randstr.js\";\nimport {\n dispatch,\n find,\n findAll,\n hasClass,\n removeAttribute,\n getAttribute,\n setAttribute,\n addClass,\n toggleClass,\n on,\n ce,\n} from \"./utils/shortcuts.js\";\n\n/**\n * Column definition\n * @typedef Column\n * @property {String} field - the key in the data\n * @property {String} title - the title to display in the header (defaults to \"field\" if not set)\n * @property {Number} [width] - the width of the column (auto otherwise)\n * @property {String} [class] - class to set on the column (target body or header with th.class or td.class)\n * @property {String} [attr] - don't render the column and set a matching attribute on the row with the value of the field\n * @property {Boolean} [hidden] - hide the column\n * @property {Boolean} [noSort] - allow disabling sort for a given column\n * @property {String | Function} [format] - custom data formatting\n * @property {String} [defaultFormatValue] - default value to use for formatting\n * @property {String} [transform] - custom value transformation\n * @property {Boolean} [editable] - replace with input (EditableColumn module)\n * @property {String} [editableType] - type of input (EditableColumn module)\n * @property {Number} [responsive] - the higher the value, the sooner it will be hidden, disable with 0 (ResponsiveGrid module)\n * @property {Boolean} [responsiveHidden] - hidden through responsive module (ResponsiveGrid module)\n */\n\n/**\n * Row action\n * @typedef Action\n * @property {String} title - the title of the button\n * @property {String} name - the name of the action\n * @property {String} class - the class for the button\n * @property {String} url - link for the action\n * @property {String} html - custom button data\n * @property {Boolean} [confirm] - needs confirmation\n * @property {Boolean} default - is the default row action\n */\n\n/** @typedef {import('./plugins/autosize-column').default} AutosizeColumn */\n/** @typedef {import('./plugins/column-resizer').default} ColumnResizer */\n/** @typedef {import('./plugins/context-menu').default} ContextMenu */\n/** @typedef {import('./plugins/draggable-headers').default} DraggableHeaders */\n/** @typedef {import('./plugins/editable-column').default} EditableColumn */\n/** @typedef {import('./plugins/fixed-height').default} FixedHeight */\n/** @typedef {import('./plugins/responsive-grid').default} ResponsiveGrid */\n/** @typedef {import('./plugins/row-actions').default} RowActions */\n/** @typedef {import('./plugins/selectable-rows').default} SelectableRows */\n/** @typedef {import('./plugins/touch-support').default} TouchSupport */\n\n/**\n * These plugins are all optional\n * @typedef {Object} Plugins\n * @property {ColumnResizer} [ColumnResizer] resize handlers in the headers\n * @property {ContextMenu} [ContextMenu] menu to show/hide columns\n * @property {DraggableHeaders} [DraggableHeaders] draggable headers columns\n * @property {EditableColumn} [EditableColumn] draggable headers columns\n * @property {TouchSupport} [TouchSupport] touch swipe\n * @property {SelectableRows} [SelectableRows] create a column with checkboxes to select rows\n * @property {FixedHeight} [FixedHeight] allows having fixed height tables\n * @property {AutosizeColumn} [AutosizeColumn] compute ideal width based on column content\n * @property {ResponsiveGrid} [ResponsiveGrid] hide/show column on the fly\n * @property {RowActions} [RowActions] add action on rows\n */\n\n/**\n * Parameters to pass along or receive from the server\n * @typedef ServerParams\n * @property {String} serverParams.start\n * @property {String} serverParams.length\n * @property {String} serverParams.search\n * @property {String} serverParams.sort\n * @property {String} serverParams.sortDir\n * @property {String} serverParams.dataKey\n * @property {String} serverParams.metaKey\n * @property {String} serverParams.metaTotalKey\n * @property {String} serverParams.metaFilteredKey\n * @property {String} serverParams.optionsKey\n * @property {String} serverParams.paramsKey\n */\n\n/**\n * Available data grid options, plugins included\n * @typedef Options\n * @property {?String} id Custom id for the grid\n * @property {?String} url An URL with data to display in JSON format\n * @property {Boolean} debug Log actions in DevTools console\n * @property {Boolean} filter Allows a filtering functionality\n * @property {Boolean} sort Allows a sort by column functionality\n * @property {String} defaultSort Default sort field if sorting is enabled\n * @property {Boolean} server Is a server side powered grid\n * @property {ServerParams} serverParams Describe keys passed to the server backend\n * @property {String} dir Dir\n * @property {Array} perPageValues Available per page options\n * @property {Boolean} hidePerPage Hides the page size select element\n * @property {Column[]} columns Available columns\n * @property {Number} defaultPage Starting page\n * @property {Number} perPage Number of records displayed per page (page size)\n * @property {Boolean} expand Allow cell content to spawn over multiple lines\n * @property {Action[]} actions Row actions (RowActions module)\n * @property {Boolean} collapseActions Group actions (RowActions module)\n * @property {Boolean} resizable Make columns resizable (ColumnResizer module)\n * @property {Boolean} selectable Allow selecting rows with a checkbox (SelectableRows module)\n * @property {Boolean} selectVisibleOnly Select all only selects visible rows (SelectableRows module)\n * @property {Boolean} autosize Compute column sizes based on given data (Autosize module)\n * @property {Boolean} autoheight Adjust height so that it matches table size (FixedHeight module)\n * @property {Boolean} autohidePager auto-hides the pager when number of records falls below the selected page size\n * @property {Boolean} menu Right click menu on column headers (ContextMenu module)\n * @property {Boolean} reorder Allows a column reordering functionality (DraggableHeaders module)\n * @property {Boolean} responsive Change display mode on small screens (ResponsiveGrid module)\n * @property {Boolean} responsiveToggle Show toggle column (ResponsiveGrid module)\n */\n\n/**\n * Available labels that can be translated\n * @typedef Labels\n * @property {String} itemsPerPage\n * @property {String} gotoPage\n * @property {String} gotoFirstPage\n * @property {String} gotoPrevPage\n * @property {String} gotoNextPage\n * @property {String} gotoLastPage\n * @property {String} of\n * @property {String} items\n * @property {String} resizeColumn\n * @property {String} noData\n * @property {String} areYouSure\n * @property {String} networkError\n */\n\n/**\n * List of registered plugins\n * @type {Plugins}\n */\nlet plugins = {};\n\n/**\n * @type {Labels}\n */\nlet labels = {\n itemsPerPage: \"Items per page\",\n gotoPage: \"Go to page\",\n gotoFirstPage: \"Go to first page\",\n gotoPrevPage: \"Go to previous page\",\n gotoNextPage: \"Go to next page\",\n gotoLastPage: \"Go to last page\",\n of: \"of\",\n items: \"items\",\n resizeColumn: \"Resize column\",\n noData: \"No data\",\n areYouSure: \"Are you sure?\",\n networkError: \"Network response error\",\n};\n\n/**\n * Column definition will update some props on the html element\n * @param {HTMLElement} el\n * @param {Column} column\n */\nfunction applyColumnDefinition(el, column) {\n if (column.width) {\n setAttribute(el, \"width\", column.width);\n }\n if (column.class) {\n addClass(el, column.class);\n }\n if (column.hidden) {\n setAttribute(el, \"hidden\", \"\");\n if (column.responsiveHidden) {\n addClass(el, \"dg-responsive-hidden\");\n }\n }\n}\n\n/**\n */\nclass DataGrid extends BaseElement {\n _ready() {\n setAttribute(this, \"id\", this.options.id ?? randstr(\"el-\"), true);\n\n /**\n * The grid displays that data\n * @type {Array}\n */\n this.data = [];\n /**\n * We store the original data in this\n * @type {Array}\n */\n this.originalData; // declared uninitialized to allow data preloading before fetch.\n\n // Make the IDE happy\n /**\n * @type {Options}\n */\n this.options = this.options || this.defaultOptions;\n\n // Init values\n this.fireEvents = false;\n this.page = this.options.defaultPage || 1;\n this.pages = 0;\n this.meta; // declared uninitialized to allow data preloading before fetch.\n /**\n * @type {Plugins}\n */\n this.plugins = {};\n // Init plugins\n for (const [pluginName, pluginClass] of Object.entries(plugins)) {\n // @ts-ignore until we can set typeof import ...\n this.plugins[pluginName] = new pluginClass(this);\n }\n\n // Expose options as observed attributes in the dom\n // Do it when fireEvents is disabled to avoid firing change callbacks\n for (const attr of DataGrid.observedAttributes) {\n if (attr.indexOf(\"data-\") === 0) {\n setAttribute(this, attr, this.options[camelize(attr.slice(5))]);\n }\n }\n }\n\n static template() {\n return `\n\n \n \n \n \n \n \n \n \n \n \n \n
\n`;\n }\n\n /**\n * @returns {Labels}\n */\n get labels() {\n return labels;\n }\n\n /**\n * @returns {Labels}\n */\n static getLabels() {\n return labels;\n }\n\n /**\n * @param {Object} v\n */\n static setLabels(v) {\n labels = Object.assign(labels, v);\n }\n\n /**\n * @returns {Column}\n */\n get defaultColumn() {\n return {\n field: \"\",\n title: \"\",\n width: 0,\n class: \"\",\n attr: \"\",\n hidden: false,\n editable: false,\n noSort: false,\n responsive: 1,\n responsiveHidden: false,\n format: \"\",\n transform: \"\",\n };\n }\n\n /**\n * @returns {Options}\n */\n get defaultOptions() {\n return {\n id: null,\n url: null,\n perPage: 10,\n debug: false,\n filter: false,\n menu: false,\n sort: false,\n server: false,\n serverParams: {\n start: \"start\",\n length: \"length\",\n search: \"search\",\n sort: \"sort\",\n sortDir: \"sortDir\",\n dataKey: \"data\",\n metaKey: \"meta\",\n metaTotalKey: \"total\",\n metaFilteredKey: \"filtered\",\n optionsKey: \"options\",\n paramsKey: \"params\",\n },\n defaultSort: \"\",\n reorder: false,\n dir: \"ltr\",\n perPageValues: [10, 25, 50, 100, 250],\n hidePerPage: false,\n columns: [],\n actions: [],\n collapseActions: false,\n selectable: false,\n selectVisibleOnly: true,\n defaultPage: 1,\n resizable: false,\n autosize: true,\n expand: false,\n autoheight: true,\n autohidePager: false,\n responsive: false,\n responsiveToggle: true,\n };\n }\n\n /**\n * @param {Plugins} list\n */\n static registerPlugins(list) {\n plugins = list;\n }\n\n /**\n * @param {String} plugin\n */\n static unregisterPlugins(plugin = null) {\n if (plugin === null) {\n plugins = {};\n } else {\n delete plugins[plugin];\n }\n }\n\n /**\n * @returns {Plugins}\n */\n static registeredPlugins() {\n return plugins;\n }\n\n /**\n * @param {Object|Array} columns\n * @returns {Column[]}\n */\n convertColumns(columns) {\n let cols = [];\n // Convert key:value objects to actual columns\n if (typeof columns === \"object\" && !Array.isArray(columns)) {\n Object.keys(columns).forEach((key) => {\n let col = Object.assign({}, this.defaultColumn);\n col.title = columns[key];\n col.field = key;\n cols.push(col);\n });\n } else {\n columns.forEach((item) => {\n let col = Object.assign({}, this.defaultColumn);\n if (typeof item === \"string\") {\n col.title = item;\n col.field = item;\n } else if (typeof item === \"object\") {\n col = Object.assign(col, item);\n if (!col.field) {\n console.error(\"Invalid column definition\", item);\n }\n if (!col.title) {\n col.title = col.field;\n }\n } else {\n console.error(\"Column definition must be a string or an object\");\n }\n cols.push(col);\n });\n }\n return cols;\n }\n\n /**\n * @link https://gist.github.com/WebReflection/ec9f6687842aa385477c4afca625bbf4#reflected-dom-attributes\n * @returns {Array}\n */\n static get observedAttributes() {\n return [\n \"page\",\n \"data-filter\",\n \"data-sort\",\n \"data-debug\",\n \"data-reorder\",\n \"data-menu\",\n \"data-selectable\",\n \"data-url\",\n \"data-per-page\",\n \"data-responsive\",\n ];\n }\n\n get transformAttributes() {\n return {\n columns: (v) => this.convertColumns(convertArray(v)),\n actions: (v) => convertArray(v),\n defaultPage: (v) => parseInt(v),\n perPage: (v) => parseInt(v),\n };\n }\n\n get page() {\n return parseInt(this.getAttribute(\"page\"));\n }\n\n set page(val) {\n setAttribute(this, \"page\", this.constrainPageValue(val));\n }\n\n urlChanged() {\n this.loadData().then(() => {\n this.configureUi();\n });\n }\n\n constrainPageValue(v) {\n if (this.pages < v) {\n v = this.pages;\n }\n if (v < 1 || !v) {\n v = 1;\n }\n return v;\n }\n\n fixPage() {\n this.pages = this.totalPages();\n this.page = this.constrainPageValue(this.page);\n\n // Show current page in input\n setAttribute(this.inputPage, \"max\", this.pages);\n this.inputPage.value = \"\" + this.page;\n this.inputPage.disabled = this.pages < 2;\n }\n\n pageChanged() {\n this.reload();\n }\n\n responsiveChanged() {\n if (!this.plugins.ResponsiveGrid) {\n return;\n }\n if (this.options.responsive) {\n this.plugins.ResponsiveGrid.observe();\n } else {\n this.plugins.ResponsiveGrid.unobserve();\n }\n }\n\n menuChanged() {\n this.renderHeader();\n }\n\n /**\n * This is the callback for the select control\n */\n changePerPage() {\n this.options.perPage = parseInt(this.selectPerPage.options[this.selectPerPage.selectedIndex].value);\n this.perPageChanged();\n }\n\n /**\n * This is the actual event triggered on attribute change\n */\n perPageChanged() {\n // Refresh UI\n if (this.options.perPage !== parseInt(this.selectPerPage.options[this.selectPerPage.selectedIndex].value)) {\n this.perPageValuesChanged();\n }\n // Make sure current page is still valid\n let updatePage = this.page;\n while (updatePage > 1 && this.page * this.options.perPage > this.totalRecords()) {\n updatePage--;\n }\n if (updatePage != this.page) {\n // Triggers pageChanged, which will trigger reload\n this.page = updatePage;\n } else {\n // Simply reload current page\n this.reload(() => {\n // Preserve distance between top of page and select control if no fixed height\n if (!this.plugins.FixedHeight || !this.plugins.FixedHeight.hasFixedHeight) {\n this.selectPerPage.scrollIntoView();\n }\n });\n }\n }\n\n dirChanged() {\n setAttribute(this, \"dir\", this.options.dir);\n }\n\n defaultSortChanged() {\n this.sortChanged();\n }\n\n /**\n * Populate the select dropdown according to options\n */\n perPageValuesChanged() {\n if (!this.selectPerPage) {\n return;\n }\n while (this.selectPerPage.lastChild) {\n this.selectPerPage.removeChild(this.selectPerPage.lastChild);\n }\n this.options.perPageValues.forEach((v) => {\n addSelectOption(this.selectPerPage, v, v, v === this.options.perPage);\n });\n }\n\n _connected() {\n /**\n * @type {HTMLTableElement}\n */\n this.table = this.querySelector(\"table\");\n /**\n * @type {HTMLInputElement}\n */\n this.btnFirst = this.querySelector(\".dg-btn-first\");\n /**\n * @type {HTMLInputElement}\n */\n this.btnPrev = this.querySelector(\".dg-btn-prev\");\n /**\n * @type {HTMLInputElement}\n */\n this.btnNext = this.querySelector(\".dg-btn-next\");\n /**\n * @type {HTMLInputElement}\n */\n this.btnLast = this.querySelector(\".dg-btn-last\");\n /**\n * @type {HTMLSelectElement}\n */\n this.selectPerPage = this.querySelector(\".dg-select-per-page\");\n /**\n * @type {HTMLInputElement}\n */\n this.inputPage = this.querySelector(\".dg-input-page\");\n\n this.getFirst = this.getFirst.bind(this);\n this.getPrev = this.getPrev.bind(this);\n this.getNext = this.getNext.bind(this);\n this.getLast = this.getLast.bind(this);\n this.changePerPage = this.changePerPage.bind(this);\n this.gotoPage = this.gotoPage.bind(this);\n\n this.btnFirst.addEventListener(\"click\", this.getFirst);\n this.btnPrev.addEventListener(\"click\", this.getPrev);\n this.btnNext.addEventListener(\"click\", this.getNext);\n this.btnLast.addEventListener(\"click\", this.getLast);\n this.selectPerPage.addEventListener(\"change\", this.changePerPage);\n this.selectPerPage.toggleAttribute(\"hidden\", this.options.hidePerPage);\n this.inputPage.addEventListener(\"input\", this.gotoPage);\n\n Object.values(this.plugins).forEach((plugin) => {\n plugin.connected();\n });\n\n // Display even if we don't have data\n this.dirChanged();\n this.perPageValuesChanged();\n\n // @ts-ignore\n this.loadData().finally(() => {\n this.configureUi();\n\n this.sortChanged();\n this.classList.add(\"dg-initialized\"); //acts as a flag to prevent unnecessary server calls down the chain.\n\n this.filterChanged();\n this.reorderChanged();\n\n this.dirChanged();\n this.perPageValuesChanged();\n this.pageChanged();\n\n this.fireEvents = true; // We can now fire attributeChangedCallback events\n\n this.log(\"initialized\");\n });\n }\n\n _disconnected() {\n this.btnFirst.removeEventListener(\"click\", this.getFirst);\n this.btnPrev.removeEventListener(\"click\", this.getPrev);\n this.btnNext.removeEventListener(\"click\", this.getNext);\n this.btnLast.removeEventListener(\"click\", this.getLast);\n this.selectPerPage.removeEventListener(\"change\", this.changePerPage);\n this.inputPage.removeEventListener(\"input\", this.gotoPage);\n\n Object.values(this.plugins).forEach((plugin) => {\n plugin.disconnected();\n });\n }\n\n /**\n * @param {string} field\n * @returns {Column}\n */\n getCol(field) {\n let found = null;\n this.options.columns.forEach((col) => {\n if (col.field == field) {\n found = col;\n }\n });\n return found;\n }\n\n getColProp(field, prop) {\n const c = this.getCol(field);\n return c ? c[prop] : null;\n }\n\n setColProp(field, prop, val) {\n const c = this.getCol(field);\n if (c) {\n c[prop] = val;\n }\n }\n\n visibleColumns() {\n return this.options.columns.filter((col) => {\n return !col.hidden;\n });\n }\n\n hiddenColumns() {\n return this.options.columns.filter((col) => {\n return col.hidden === true;\n });\n }\n\n showColumn(field, render = true) {\n this.setColProp(field, \"hidden\", false);\n\n // We need to render the whole table otherwise layout fixed won't do its job\n if (render) this.renderTable();\n\n dispatch(this, \"columnVisibility\", {\n col: field,\n visibility: \"visible\",\n });\n }\n\n hideColumn(field, render = true) {\n this.setColProp(field, \"hidden\", true);\n\n // We need to render the whole table otherwise layout fixed won't do its job\n if (render) this.renderTable();\n\n dispatch(this, \"columnVisibility\", {\n col: field,\n visibility: \"hidden\",\n });\n }\n\n /**\n * Returns the starting index of actual data\n * @returns {Number}\n */\n startColIndex() {\n let start = 1;\n if (this.options.selectable && this.plugins.SelectableRows) {\n start++;\n }\n if (this.options.responsive && this.plugins.ResponsiveGrid && this.plugins.ResponsiveGrid.hasHiddenColumns()) {\n start++;\n }\n return start;\n }\n\n /**\n * @returns {Boolean}\n */\n isSticky() {\n return this.hasAttribute(\"sticky\");\n }\n\n /**\n * @param {Boolean} visibleOnly\n * @returns {Number}\n */\n columnsLength(visibleOnly = false) {\n let len = 0;\n // One column per (visible) column\n this.options.columns.forEach((col) => {\n if (visibleOnly && col.hidden) {\n return;\n }\n if (!col.attr) {\n len++;\n }\n });\n // Add one col for selectable checkbox at the beginning\n if (this.options.selectable && this.plugins.SelectableRows) {\n len++;\n }\n // Add one col for actions at the end\n if (this.options.actions.length && this.plugins.RowActions) {\n len++;\n }\n // Add one col for the responsive toggle\n if (this.options.responsive && this.plugins.ResponsiveGrid && this.plugins.ResponsiveGrid.hasHiddenColumns()) {\n len++;\n }\n return len;\n }\n\n /**\n * Global configuration and renderTable\n * This should be called after your data has been loaded\n */\n configureUi() {\n setAttribute(this.querySelector(\"table\"), \"aria-rowcount\", this.data.length);\n\n this.table.style.visibility = \"hidden\";\n this.renderTable();\n if (this.options.responsive && this.plugins.ResponsiveGrid) {\n // Let the observer make the table visible\n } else {\n this.table.style.visibility = \"visible\";\n }\n\n // Store row height for later usage\n if (!this.rowHeight) {\n const tr = find(this, \"tbody tr\") || find(this, \"table tr\");\n if (tr) {\n this.rowHeight = tr.offsetHeight;\n }\n }\n }\n\n filterChanged() {\n const row = this.querySelector(\"thead tr.dg-head-filters\");\n if (this.options.filter) {\n removeAttribute(row, \"hidden\");\n } else {\n this.clearFilters();\n setAttribute(row, \"hidden\", \"\");\n }\n }\n\n reorderChanged() {\n const headers = findAll(this, \"thead tr.dg-head-columns th\");\n headers.forEach((th) => {\n if (th.classList.contains(\"dg-selectable\") || th.classList.contains(\"dg-actions\")) {\n return;\n }\n if (this.options.reorder && this.plugins.DraggableHeaders) {\n th.draggable = true;\n } else {\n th.removeAttribute(\"draggable\");\n }\n });\n }\n\n sortChanged() {\n this.log(\"toggle sort\");\n\n this.querySelectorAll(\"thead tr.dg-head-columns th\").forEach((th) => {\n const fieldName = th.getAttribute(\"field\");\n if (th.classList.contains(\"dg-not-sortable\") || (!this.fireEvents && fieldName == this.options.defaultSort)) {\n return;\n }\n if (this.options.sort && !this.getColProp(fieldName, \"noSort\")) {\n setAttribute(th, \"aria-sort\", \"none\");\n } else {\n removeAttribute(th, \"aria-sort\");\n }\n });\n }\n\n selectableChanged() {\n this.renderTable();\n }\n\n addRow(row) {\n if (!Array.isArray(this.originalData)) return;\n this.log(\"Add row\");\n this.originalData.push(row);\n this.data = this.originalData.slice();\n this.sortData();\n }\n\n /**\n * @param {any} value Value to remove. Defaults to last row.\n * @param {String} key The key of the item to remove. Defaults to first column\n */\n removeRow(value = null, key = null) {\n if (!Array.isArray(this.originalData)) return;\n if (key === null) {\n key = this.options.columns[0][\"field\"];\n }\n if (value === null) {\n value = this.originalData[this.originalData.length - 1][key];\n }\n this.log(\"Removing \" + key + \":\" + value);\n for (let i = 0; i < this.originalData.length; i++) {\n if (this.originalData[i][key] === value) {\n this.originalData.splice(i, 1);\n break;\n }\n }\n this.data = this.originalData.slice();\n this.sortData();\n }\n\n /**\n * @param {String} key Return a specific key (eg: id) instead of the whole row\n * @returns {Array}\n */\n getSelection(key = null) {\n if (!this.plugins.SelectableRows) {\n return [];\n }\n return this.plugins.SelectableRows.getSelection(key);\n }\n\n getData() {\n return this.originalData;\n }\n\n clearData() {\n // Already empty\n if (this.data.length === 0) {\n return;\n }\n this.data = this.originalData = [];\n this.renderBody();\n }\n\n /**\n * Preloads the data intended to bypass the initial fetch operation, allowing for faster intial page load time.\n * Subsequent grid actions after initialization will operate as normal.\n * @param {Object} data - an object with meta ({total, filtered, start}) and data (array of objects) properties.\n */\n preload(data) {\n const metaKey = this.options.serverParams.metaKey,\n dataKey = this.options.serverParams.dataKey;\n if (data?.[metaKey]) this.meta = data[metaKey];\n if (data?.[dataKey]) this.data = this.originalData = data[dataKey];\n }\n\n refresh(cb = null) {\n this.data = this.originalData = [];\n return this.reload(cb);\n }\n\n reload(cb = null) {\n this.log(\"reload\");\n\n // If the data was cleared, we need to render again\n const needRender = !this.originalData?.length;\n this.fixPage();\n // @ts-ignore\n this.loadData().finally(() => {\n // If we load data from the server, we redraw the table body\n // Otherwise, we just need to paginate\n this.options.server || needRender ? this.renderBody() : this.paginate();\n if (cb) {\n cb();\n }\n });\n }\n\n /**\n * @returns {Promise}\n */\n loadData() {\n const flagEmpty = () => !this.data.length && this.classList.add(\"dg-empty\");\n // We already have some data\n if (this.meta || this.originalData || this.classList.contains(\"dg-initialized\")) {\n // We don't use server side data\n if (!this.options.server || (this.options.server && !this.fireEvents)) {\n this.log(\"skip loadData\");\n flagEmpty();\n return new Promise((resolve) => {\n resolve();\n });\n }\n }\n this.log(\"loadData\");\n this.loading = true;\n this.classList.add(\"dg-loading\");\n this.classList.remove(\"dg-empty\", \"dg-network-error\");\n return (\n this.fetchData()\n .then((response) => {\n // We can get a straight array or an object\n if (Array.isArray(response)) {\n this.data = response;\n } else {\n // Object must contain data key\n if (!response[this.options.serverParams.dataKey]) {\n console.error(\"Invalid response, it should contain a data key with an array or be a plain array\", response);\n this.options.url = null;\n return;\n }\n\n // We may have a config object\n this.options = Object.assign(this.options, response[this.options.serverParams.optionsKey] ?? {});\n // It should return meta data (see metaFilteredKey)\n this.meta = response[this.options.serverParams.metaKey] ?? {};\n this.data = response[this.options.serverParams.dataKey];\n }\n this.originalData = this.data.slice();\n this.fixPage();\n\n // Make sure we have a proper set of columns\n if (this.options.columns.length === 0 && this.originalData.length) {\n this.options.columns = this.convertColumns(Object.keys(this.originalData[0]));\n } else {\n this.options.columns = this.convertColumns(this.options.columns);\n }\n })\n .catch((err) => {\n this.log(err);\n if (err.message) {\n this.querySelector(\"tbody\").setAttribute(\"data-empty\", err.message.replace(/^\\s+|\\r\\n|\\n|\\r$/g, \"\"));\n }\n this.classList.add(\"dg-empty\", \"dg-network-error\");\n })\n // @ts-ignore\n .finally(() => {\n flagEmpty();\n this.classList.remove(\"dg-loading\");\n this.loading = false;\n })\n );\n }\n\n getFirst() {\n if (this.loading) {\n return;\n }\n this.page = 1;\n }\n\n getLast() {\n if (this.loading) {\n return;\n }\n this.page = this.pages;\n }\n\n getPrev() {\n if (this.loading) {\n return;\n }\n this.page = this.page - 1;\n }\n\n getNext() {\n if (this.loading) {\n return;\n }\n this.page = this.page + 1;\n }\n\n gotoPage(event) {\n if (event.type === \"keypress\") {\n const key = event.keyCode || event.key;\n if (key === 13 || key === \"Enter\") {\n event.preventDefault();\n } else {\n return;\n }\n }\n this.page = parseInt(this.inputPage.value);\n }\n\n getSort() {\n let col = this.querySelector(\"thead tr.dg-head-columns th[aria-sort$='scending']\");\n if (col) {\n return col.getAttribute(\"field\");\n }\n return this.options.defaultSort;\n }\n\n getSortDir() {\n let col = this.querySelector(\"thead tr.dg-head-columns th[aria-sort$='scending']\");\n if (col) {\n return col.getAttribute(\"aria-sort\") || \"\";\n }\n return \"\";\n }\n\n getFilters() {\n let filters = [];\n const inputs = findAll(this, \"thead tr.dg-head-filters input\");\n inputs.forEach((input) => {\n filters[input.dataset.name] = input.value;\n });\n return filters;\n }\n\n clearFilters() {\n const inputs = findAll(this, \"thead tr.dg-head-filters input\");\n inputs.forEach((input) => {\n input.value = \"\";\n });\n this.filterData();\n }\n\n filterData() {\n this.log(\"filter data\");\n\n this.page = 1;\n\n if (this.options.server) {\n this.reload();\n } else {\n this.data = this.originalData?.slice() ?? [];\n\n // Look for rows matching the filters\n const inputs = findAll(this, \"thead tr.dg-head-filters input\");\n inputs.forEach((input) => {\n let value = input.value;\n if (value) {\n let name = input.dataset.name;\n this.data = this.data.filter((item) => {\n let str = item[name] + \"\";\n return str.toLowerCase().indexOf(value.toLowerCase()) !== -1;\n });\n }\n });\n this.pageChanged();\n\n let col = this.querySelector(\"thead tr.dg-head-columns th[aria-sort$='scending']\");\n if (this.options.sort && col) {\n this.sortData();\n } else {\n this.renderBody();\n }\n }\n }\n\n /**\n * Data will be sorted then rendered using renderBody\n * @param {Element} col The column that was clicked or null to use current sort\n */\n sortData(col = null) {\n this.log(\"sort data\");\n\n // Early exit\n if (col && this.getColProp(col.getAttribute(\"field\"), \"noSort\")) {\n this.log(\"sorting prevented because column is not sortable\");\n return;\n }\n if (this.plugins.ColumnResizer && this.plugins.ColumnResizer.isResizing) {\n this.log(\"sorting prevented because resizing\");\n return;\n }\n if (this.loading) {\n this.log(\"sorting prevented because loading\");\n return;\n }\n\n // We clicked on a column, update sort state\n if (col !== null) {\n // Remove active sort if any\n const haveClasses = (c) => [\"dg-selectable\", \"dg-actions\", \"dg-responsive-toggle\"].includes(c);\n this.querySelectorAll(\"thead tr:first-child th\").forEach((th) => {\n // @ts-ignore\n if ([...th.classList].some(haveClasses)) {\n return;\n }\n if (th !== col) {\n th.setAttribute(\"aria-sort\", \"none\");\n }\n });\n\n // Set tristate col\n if (!col.hasAttribute(\"aria-sort\") || col.getAttribute(\"aria-sort\") === \"none\") {\n col.setAttribute(\"aria-sort\", \"ascending\");\n } else if (col.getAttribute(\"aria-sort\") === \"ascending\") {\n col.setAttribute(\"aria-sort\", \"descending\");\n } else if (col.getAttribute(\"aria-sort\") === \"descending\") {\n col.setAttribute(\"aria-sort\", \"none\");\n }\n } else {\n // Or fetch current sort\n col = this.querySelector(\"thead tr.dg-head-columns th[aria-sort$='scending']\");\n }\n\n if (this.options.server) {\n // Reload data with updated sort\n this.loadData().finally(() => {\n this.renderBody();\n });\n } else {\n const sort = col ? col.getAttribute(\"aria-sort\") : \"none\";\n if (sort === \"none\") {\n let stack = [];\n\n // Restore order while keeping filters\n this.originalData?.some((itemA) => {\n this.data.some((itemB) => {\n if (JSON.stringify(itemA) === JSON.stringify(itemB)) {\n stack.push(itemB);\n return true;\n }\n return false;\n });\n return stack.length === this.data.length;\n });\n\n this.data = stack;\n } else {\n const field = col.getAttribute(\"field\");\n this.data.sort((a, b) => {\n if (!isNaN(a[field]) && !isNaN(b[field])) {\n return sort === \"ascending\" ? a[field] - b[field] : b[field] - a[field];\n }\n const valA = sort === \"ascending\" ? a[field].toUpperCase() : b[field].toUpperCase();\n const valB = sort === \"ascending\" ? b[field].toUpperCase() : a[field].toUpperCase();\n\n switch (true) {\n case valA > valB:\n return 1;\n case valA < valB:\n return -1;\n case valA === valB:\n return 0;\n }\n });\n }\n this.renderBody();\n }\n }\n\n fetchData() {\n if (!this.options.url) {\n return new Promise((resolve, reject) => reject(\"No url set\"));\n }\n\n let base = window.location.href;\n // Fix trailing slash if no extension is present\n if (!base.split(\"/\").pop().includes(\".\")) {\n base += base.endsWith(\"/\") ? \"\" : \"/\";\n }\n let url = new URL(this.options.url, base);\n let params = {\n r: Date.now(),\n };\n if (this.options.server) {\n // 0 based\n params[this.options.serverParams.start] = this.page - 1;\n params[this.options.serverParams.length] = this.options.perPage;\n if (this.options.filter) params[this.options.serverParams.search] = this.getFilters();\n params[this.options.serverParams.sort] = this.getSort() || \"\";\n params[this.options.serverParams.sortDir] = this.getSortDir();\n\n // extra params ?\n if (this.meta?.[this.options.serverParams.paramsKey]) {\n params = Object.assign(params, this.meta[this.options.serverParams.paramsKey]);\n }\n }\n\n appendParamsToUrl(url, params);\n\n return fetch(url).then((response) => {\n if (!response.ok) {\n throw new Error(response.statusText || labels.networkError);\n }\n return response.json();\n });\n }\n\n renderTable() {\n this.log(\"render table\");\n\n if (this.options.menu && this.plugins.ContextMenu) {\n this.plugins.ContextMenu.createMenu();\n }\n\n let sortedColumn;\n\n this.renderHeader();\n if (this.options.defaultSort) {\n // We can have a default sort even with sort disabled\n sortedColumn = this.querySelector(\"thead tr.dg-head-columns th[field='\" + this.options.defaultSort + \"']\");\n }\n\n if (sortedColumn) {\n this.sortData(sortedColumn);\n } else {\n this.renderBody();\n }\n\n this.renderFooter();\n }\n\n /**\n * Create table header\n * - One row for the column headers\n * - One row for the filters\n */\n renderHeader() {\n this.log(\"render header\");\n\n const thead = this.querySelector(\"thead\");\n this.createColumnHeaders(thead);\n this.createColumnFilters(thead);\n\n if (this.options.resizable && this.plugins.ColumnResizer) {\n this.plugins.ColumnResizer.renderResizer(labels.resizeColumn);\n }\n\n dispatch(this, \"headerRendered\");\n }\n\n renderFooter() {\n this.log(\"render footer\");\n\n const tfoot = this.querySelector(\"tfoot\");\n const td = tfoot.querySelector(\"td\");\n tfoot.removeAttribute(\"hidden\");\n setAttribute(td, \"colspan\", this.columnsLength(true));\n tfoot.style.display = \"\";\n }\n\n /**\n * Create the column headers based on column definitions and set options\n * @param {HTMLTableSectionElement} thead\n */\n createColumnHeaders(thead) {\n // @link https://stackoverflow.com/questions/21064101/understanding-offsetwidth-clientwidth-scrollwidth-and-height-respectively\n const availableWidth = this.clientWidth;\n const colMaxWidth = Math.round((availableWidth / this.columnsLength(true)) * 2);\n\n let idx = 0;\n let tr;\n\n // Create row\n tr = ce(\"tr\");\n this.headerRow = tr;\n tr.setAttribute(\"role\", \"row\");\n tr.setAttribute(\"aria-rowindex\", \"1\");\n tr.setAttribute(\"class\", \"dg-head-columns\");\n\n // We need a real th from the dom to compute the size\n let sampleTh = thead.querySelector(\"tr.dg-head-columns th\");\n if (!sampleTh) {\n sampleTh = ce(\"th\");\n thead.querySelector(\"tr\").appendChild(sampleTh);\n }\n\n if (this.options.selectable && this.plugins.SelectableRows) {\n this.plugins.SelectableRows.createHeaderCol(tr);\n }\n if (this.options.responsive && this.plugins.ResponsiveGrid && this.plugins.ResponsiveGrid.hasHiddenColumns()) {\n this.plugins.ResponsiveGrid.createHeaderCol(tr);\n }\n\n // Create columns\n idx = 0;\n let totalWidth = 0;\n this.options.columns.forEach((column) => {\n if (column.attr) {\n return;\n }\n const colIdx = idx + this.startColIndex();\n let th = ce(\"th\");\n th.setAttribute(\"scope\", \"col\");\n th.setAttribute(\"role\", \"columnheader button\");\n th.setAttribute(\"aria-colindex\", \"\" + colIdx);\n th.setAttribute(\"id\", randstr(\"dg-col-\"));\n if (this.options.sort) {\n th.setAttribute(\"aria-sort\", \"none\");\n }\n th.setAttribute(\"field\", column.field);\n if (this.plugins.ResponsiveGrid && this.options.responsive) {\n setAttribute(th, \"data-responsive\", column.responsive || \"\");\n }\n // Make sure the header fits (+ add some room for sort icon if necessary)\n const computedWidth = getTextWidth(column.title, sampleTh, true) + 20;\n th.dataset.minWidth = \"\" + computedWidth;\n applyColumnDefinition(th, column);\n th.tabIndex = 0;\n th.textContent = column.title;\n\n let w = 0;\n // Autosize small based on first/last row ?\n // Take into account minWidth of the header and max available size based on col numbers\n if (this.options.autosize && this.plugins.AutosizeColumn) {\n const colAvailableWidth = Math.min(availableWidth - totalWidth, colMaxWidth);\n w = this.plugins.AutosizeColumn.computeSize(th, column, parseInt(th.dataset.minWidth), colAvailableWidth);\n } else {\n w = Math.max(parseInt(th.dataset.minWidth), parseInt(th.getAttribute(\"width\")));\n }\n\n setAttribute(th, \"width\", w);\n if (column.hidden) {\n th.setAttribute(\"hidden\", \"\");\n } else {\n totalWidth += w;\n }\n\n // Reorder columns with drag/drop\n if (this.options.reorder && this.plugins.DraggableHeaders) {\n this.plugins.DraggableHeaders.makeHeaderDraggable(th);\n }\n\n tr.appendChild(th);\n idx++;\n });\n\n // There is too much available width, and we want to avoid fixed layout to split remaining amount\n if (totalWidth < availableWidth) {\n const visibleCols = findAll(tr, \"th:not([hidden],.dg-not-resizable)\");\n if (visibleCols.length) {\n const lastCol = visibleCols[visibleCols.length - 1];\n removeAttribute(lastCol, \"width\");\n }\n }\n\n // Actions\n if (this.options.actions.length && this.plugins.RowActions) {\n this.plugins.RowActions.makeActionHeader(tr);\n }\n\n thead.replaceChild(tr, thead.querySelector(\"tr.dg-head-columns\"));\n\n // Once columns are inserted, we have an actual dom to query\n if (thead.offsetWidth > availableWidth) {\n this.log(`adjust width to fix size, ${thead.offsetWidth} > ${availableWidth}`);\n const scrollbarWidth = this.offsetWidth - this.clientWidth;\n let diff = thead.offsetWidth - availableWidth - scrollbarWidth;\n if (this.options.responsive && this.plugins.ResponsiveGrid) {\n diff += scrollbarWidth;\n }\n // Remove diff for columns that can afford it\n const thWithWidth = findAll(tr, \"th[width]\");\n thWithWidth.forEach((th) => {\n if (hasClass(th, \"dg-not-resizable\")) {\n return;\n }\n if (diff <= 0) {\n return;\n }\n const actualWidth = parseInt(th.getAttribute(\"width\"));\n const minWidth = th.dataset.minWidth ? parseInt(th.dataset.minWidth) : 0;\n if (actualWidth > minWidth) {\n let newWidth = actualWidth - diff;\n if (newWidth < minWidth) {\n newWidth = minWidth;\n }\n diff -= actualWidth - newWidth;\n setAttribute(th, \"width\", newWidth);\n }\n });\n }\n\n // Context menu\n if (this.options.menu && this.plugins.ContextMenu) {\n this.plugins.ContextMenu.attachContextMenu();\n }\n\n // Sort col on click\n tr.querySelectorAll(\"[aria-sort]\").forEach((sortableRow) => {\n sortableRow.addEventListener(\"click\", () => this.sortData(sortableRow));\n });\n\n setAttribute(this.querySelector(\"table\"), \"aria-colcount\", this.columnsLength(true));\n }\n\n createColumnFilters(thead) {\n let idx = 0;\n let tr;\n\n // Create row for filters\n tr = ce(\"tr\");\n this.filterRow = tr;\n tr.setAttribute(\"role\", \"row\");\n tr.setAttribute(\"aria-rowindex\", \"2\");\n tr.setAttribute(\"class\", \"dg-head-filters\");\n if (!this.options.filter) {\n tr.setAttribute(\"hidden\", \"\");\n }\n\n if (this.options.selectable && this.plugins.SelectableRows) {\n this.plugins.SelectableRows.createFilterCol(tr);\n }\n if (this.options.responsive && this.plugins.ResponsiveGrid && this.plugins.ResponsiveGrid.hasHiddenColumns()) {\n this.plugins.ResponsiveGrid.createFilterCol(tr);\n }\n\n this.options.columns.forEach((column) => {\n if (column.attr) {\n return;\n }\n const colIdx = idx + this.startColIndex();\n let relatedTh = thead.querySelector(\"tr.dg-head-columns th[aria-colindex='\" + colIdx + \"']\");\n if (!relatedTh) {\n console.warn(\"Related th not found\", colIdx);\n return;\n }\n let th = ce(\"th\");\n th.setAttribute(\"aria-colindex\", \"\" + colIdx);\n\n let input = ce(\"input\");\n input.type = \"text\";\n input.inputMode = \"search\";\n input.autocomplete = \"off\";\n input.spellcheck = false;\n // Allows binding filter to this column\n input.dataset.name = column.field;\n input.id = randstr(\"dg-filter-\");\n // Don't use aria-label as it triggers autocomplete\n input.setAttribute(\"aria-labelledby\", relatedTh.getAttribute(\"id\"));\n if (!this.options.filter) {\n th.tabIndex = 0;\n } else {\n input.tabIndex = 0;\n }\n\n if (column.hidden) {\n th.setAttribute(\"hidden\", \"\");\n }\n\n th.appendChild(input);\n tr.appendChild(th);\n idx++;\n });\n\n // Actions\n if (this.options.actions.length && this.plugins.RowActions) {\n this.plugins.RowActions.makeActionFilter(tr);\n }\n\n thead.replaceChild(tr, thead.querySelector(\"tr.dg-head-filters\"));\n\n // Filter content on enter\n tr.querySelectorAll(\"input\").forEach((input) => {\n input.addEventListener(\"keypress\", (e) => {\n const key = e.keyCode || e.key;\n if (key === 13 || key === \"Enter\") {\n this.filterData.call(this);\n }\n });\n });\n }\n\n /**\n * Render the data as rows in tbody\n * It will call paginate() at the end\n */\n renderBody() {\n this.log(\"render body\");\n let tr;\n let td;\n let idx;\n let tbody = ce(\"tbody\");\n\n this.data.forEach((item, i) => {\n tr = ce(\"tr\");\n setAttribute(tr, \"role\", \"row\");\n setAttribute(tr, \"hidden\", \"\");\n setAttribute(tr, \"aria-rowindex\", i + 1);\n tr.tabIndex = 0;\n\n if (this.options.selectable && this.plugins.SelectableRows) {\n this.plugins.SelectableRows.createDataCol(tr);\n }\n if (this.options.responsive && this.plugins.ResponsiveGrid && this.plugins.ResponsiveGrid.hasHiddenColumns()) {\n this.plugins.ResponsiveGrid.createDataCol(tr);\n }\n\n // Expandable\n if (this.options.expand) {\n tr.classList.add(\"dg-expandable\");\n\n on(tr, \"click\", (ev) => {\n if (this.plugins.ResponsiveGrid) {\n this.plugins.ResponsiveGrid.blockObserver();\n }\n toggleClass(ev.currentTarget, \"dg-expanded\");\n if (this.plugins.ResponsiveGrid) {\n this.plugins.ResponsiveGrid.unblockObserver();\n }\n });\n }\n\n idx = 0;\n this.options.columns.forEach((column) => {\n if (!column) {\n console.error(\"Empty column found!\", this.options.columns);\n }\n // It should be applied as an attr of the row\n if (column.attr) {\n if (item[column.field]) {\n // Special case if we try to write over the class attr\n if (column.attr === \"class\") {\n addClass(tr, item[column.field]);\n } else {\n tr.setAttribute(column.attr, item[column.field]);\n }\n }\n return;\n }\n td = ce(\"td\");\n td.setAttribute(\"role\", \"gridcell\");\n td.setAttribute(\"aria-colindex\", idx + this.startColIndex());\n applyColumnDefinition(td, column);\n // This is required for pure css responsive layout\n td.setAttribute(\"data-name\", column.title);\n td.tabIndex = -1;\n\n // Inline editing ...\n if (column.editable && this.plugins.EditableColumn) {\n addClass(td, \"dg-editable-col\");\n this.plugins.EditableColumn.makeEditableInput(td, column, item, i);\n } else {\n // ... or formatting\n const v = item[column.field] ?? \"\";\n let tv;\n // TODO: make this modular\n switch (column.transform) {\n case \"uppercase\":\n tv = v.toUpperCase();\n break;\n case \"lowercase\":\n tv = v.toLowerCase();\n break;\n default:\n tv = v;\n break;\n }\n if (column.format) {\n // Only use formatting with values or if defaultFormatValue is set\n if (column.defaultFormatValue != undefined && (tv === \"\" || tv === null)) {\n tv = column.defaultFormatValue + \"\";\n }\n if (typeof column.format === \"string\" && tv) {\n td.innerHTML = interpolate(\n // @ts-ignore\n column.format,\n Object.assign(\n {\n _v: v,\n _tv: tv,\n },\n item\n )\n );\n } else if (column.format instanceof Function) {\n const val = column.format.call(this, { column, rowData: item, cellData: tv, td, tr });\n td.innerHTML = val || tv || v;\n }\n } else {\n td.textContent = tv;\n }\n }\n tr.appendChild(td);\n idx++;\n });\n\n // Actions\n if (this.options.actions.length && this.plugins.RowActions) {\n this.plugins.RowActions.makeActionRow(tr, item);\n }\n\n tbody.appendChild(tr);\n });\n\n tbody.setAttribute(\"role\", \"rowgroup\");\n\n // Keep data empty message\n const prev = this.querySelector(\"tbody\");\n tbody.setAttribute(\"data-empty\", prev.getAttribute(\"data-empty\"));\n this.querySelector(\"table\").replaceChild(tbody, prev);\n\n if (this.plugins.FixedHeight) {\n this.plugins.FixedHeight.createFakeRow();\n }\n\n this.paginate();\n\n if (this.plugins.SelectableRows) {\n this.plugins.SelectableRows.shouldSelectAll(tbody);\n }\n\n dispatch(this, \"bodyRendered\");\n }\n\n paginate() {\n this.log(\"paginate\");\n\n const total = this.totalRecords();\n const p = this.page || 1;\n\n let index;\n let high = p * this.options.perPage;\n let low = high - this.options.perPage + 1;\n const tbody = this.querySelector(\"tbody\");\n const tfoot = this.querySelector(\"tfoot\");\n\n if (high > total) {\n high = total;\n }\n if (!total) {\n low = 0;\n }\n\n // Display all rows within the set indexes\n // For server side paginated grids, we display everything\n // since the server is taking care of actual pagination\n tbody.querySelectorAll(\"tr\").forEach((tr) => {\n if (this.options.server) {\n removeAttribute(tr, \"hidden\");\n return;\n }\n index = Number(getAttribute(tr, \"aria-rowindex\"));\n if (index > high || index < low) {\n setAttribute(tr, \"hidden\", \"\");\n } else {\n removeAttribute(tr, \"hidden\");\n }\n });\n\n if (this.options.selectable && this.plugins.SelectableRows) {\n this.plugins.SelectableRows.clearCheckboxes(tbody);\n }\n\n // Store default height and update styles if needed\n if (this.plugins.FixedHeight) {\n this.plugins.FixedHeight.updateFakeRow();\n }\n\n // Enable/disable buttons if shown\n if (this.btnFirst) {\n this.btnFirst.disabled = this.page <= 1;\n this.btnPrev.disabled = this.page <= 1;\n this.btnNext.disabled = this.page >= this.pages;\n this.btnLast.disabled = this.page >= this.pages;\n }\n tfoot.querySelector(\".dg-low\").textContent = low.toString();\n tfoot.querySelector(\".dg-high\").textContent = high.toString();\n tfoot.querySelector(\".dg-total\").textContent = \"\" + this.totalRecords();\n tfoot.toggleAttribute(\"hidden\", this.options.autohidePager && this.options.perPage > this.totalRecords());\n }\n\n /**\n * @returns {number}\n */\n totalPages() {\n return Math.ceil(this.totalRecords() / this.options.perPage);\n }\n\n /**\n * @returns {number}\n */\n totalRecords() {\n if (this.options.server) {\n return this.meta?.[this.options.serverParams.metaFilteredKey] || 0;\n }\n return this.data.length;\n }\n}\n\nexport default DataGrid;\n", "/** @typedef {import(\"../data-grid\").default} DataGrid */\r\n\r\nclass BasePlugin {\r\n /**\r\n * @param {DataGrid} grid\r\n */\r\n constructor(grid) {\r\n this.grid = grid;\r\n }\r\n\r\n connected() {}\r\n\r\n disconnected() {}\r\n\r\n /**\r\n * Handle events within the plugin\r\n * @link https://gist.github.com/WebReflection/ec9f6687842aa385477c4afca625bbf4#handling-events\r\n * @param {Event} event\r\n */\r\n handleEvent(event) {\r\n if (this[`on${event.type}`]) {\r\n this[`on${event.type}`](event);\r\n }\r\n }\r\n}\r\n\r\nexport default BasePlugin;\r\n", "import BasePlugin from \"../core/base-plugin.js\";\r\nimport elementOffset from \"../utils/elementOffset.js\";\r\nimport {\r\n addClass,\r\n dispatch,\r\n findAll,\r\n getAttribute,\r\n hasClass,\r\n off,\r\n on,\r\n removeAttribute,\r\n removeClass,\r\n setAttribute,\r\n} from \"../utils/shortcuts.js\";\r\n\r\n/**\r\n * Allows to resize columns\r\n */\r\nclass ColumnResizer extends BasePlugin {\r\n constructor(grid) {\r\n super(grid);\r\n this.isResizing = false;\r\n }\r\n\r\n /**\r\n * @param {String} resizeLabel\r\n */\r\n renderResizer(resizeLabel) {\r\n const grid = this.grid;\r\n const table = grid.table;\r\n const cols = findAll(grid, \"thead tr.dg-head-columns th\");\r\n\r\n cols.forEach((col) => {\r\n if (hasClass(col, \"dg-not-resizable\")) {\r\n return;\r\n }\r\n // Create a resizer element\r\n const resizer = document.createElement(\"div\");\r\n addClass(resizer, \"dg-resizer\");\r\n resizer.ariaLabel = resizeLabel;\r\n\r\n // Add a resizer element to the column\r\n col.appendChild(resizer);\r\n\r\n // Handle resizing\r\n let startX = 0;\r\n let startW = 0;\r\n let remainingSpace = 0;\r\n let max = 0;\r\n\r\n const mouseMoveHandler = (e) => {\r\n if (e.clientX > max) {\r\n return;\r\n }\r\n const newWidth = startW + (e.clientX - startX);\r\n if (col.dataset.minWidth && newWidth > parseInt(col.dataset.minWidth)) {\r\n setAttribute(col, \"width\", newWidth);\r\n }\r\n };\r\n\r\n // When user releases the mouse, remove the existing event listeners\r\n const mouseUpHandler = () => {\r\n grid.log(\"resized column\");\r\n\r\n // Prevent accidental sorting if mouse is not over resize handler\r\n setTimeout(() => {\r\n this.isResizing = false;\r\n }, 0);\r\n\r\n removeClass(resizer, \"dg-resizer-active\");\r\n if (grid.options.reorder) {\r\n col.draggable = true;\r\n }\r\n col.style.overflow = \"hidden\";\r\n\r\n // Remove handlers\r\n off(document, \"mousemove\", mouseMoveHandler);\r\n off(document, \"mouseup\", mouseUpHandler);\r\n\r\n dispatch(grid, \"columnResized\", {\r\n col: getAttribute(col, \"field\"),\r\n width: getAttribute(col, \"width\"),\r\n });\r\n };\r\n\r\n // Otherwise it could sort the col\r\n on(resizer, \"click\", (e) => {\r\n e.stopPropagation();\r\n });\r\n\r\n on(resizer, \"mousedown\", (e) => {\r\n e.stopPropagation();\r\n\r\n this.isResizing = true;\r\n\r\n const target = e.target;\r\n const currentCols = findAll(grid, \"dg-head-columns th\");\r\n const visibleCols = currentCols.filter((col) => {\r\n return !col.hasAttribute(\"hidden\");\r\n });\r\n const columnIndex = visibleCols.findIndex((column) => column == target.parentNode);\r\n grid.log(\"resize column\");\r\n\r\n addClass(resizer, \"dg-resizer-active\");\r\n\r\n // Make sure we don't drag it\r\n removeAttribute(col, \"draggable\");\r\n\r\n // Allow overflow when resizing\r\n col.style.overflow = \"visible\";\r\n\r\n // Show full column height (-1 to avoid scrollbar)\r\n resizer.style.height = table.offsetHeight - 1 + \"px\";\r\n\r\n // Register initial data\r\n startX = e.clientX;\r\n startW = col.offsetWidth;\r\n\r\n remainingSpace = (visibleCols.length - columnIndex) * 30;\r\n max = elementOffset(target).left + grid.offsetWidth - remainingSpace;\r\n\r\n // Remove width from next columns to allow auto layout\r\n setAttribute(col, \"width\", startW);\r\n for (let j = 0; j < visibleCols.length; j++) {\r\n if (j > columnIndex) {\r\n removeAttribute(cols[j], \"width\");\r\n }\r\n }\r\n\r\n // Attach handlers\r\n on(document, \"mousemove\", mouseMoveHandler);\r\n on(document, \"mouseup\", mouseUpHandler);\r\n });\r\n });\r\n }\r\n}\r\n\r\nexport default ColumnResizer;\r\n", "/**\r\n * @param {HTMLElement} el\r\n * @param {String} type\r\n * @param {String} prop\r\n * @returns {HTMLElement}\r\n */\r\nexport default function getParentElement(el, type, prop = \"nodeName\") {\r\n let parent = el;\r\n while (parent[prop] != type) {\r\n parent = parent.parentElement;\r\n }\r\n return parent;\r\n}\r\n", "import BasePlugin from \"../core/base-plugin.js\";\r\nimport getParentElement from \"../utils/getParentElement.js\";\r\nimport { find, off, on, removeAttribute, setAttribute } from \"../utils/shortcuts.js\";\r\n\r\n/**\r\n * Create a right click menu on the headers\r\n */\r\nclass ContextMenu extends BasePlugin {\r\n connected() {\r\n /**\r\n * @type {HTMLUListElement}\r\n */\r\n this.menu = this.grid.querySelector(\".dg-menu\");\r\n }\r\n disconnected() {\r\n if (this.grid.headerRow) {\r\n off(this.grid.headerRow, \"contextmenu\", this);\r\n }\r\n }\r\n\r\n attachContextMenu() {\r\n const grid = this.grid;\r\n on(grid.headerRow, \"contextmenu\", this);\r\n }\r\n\r\n onchange(e) {\r\n const grid = this.grid;\r\n const t = e.target;\r\n const field = t.dataset.name;\r\n if (t.checked) {\r\n grid.showColumn(field);\r\n } else {\r\n // Prevent hidding last\r\n if (grid.visibleColumns().length <= 1) {\r\n // Restore checkbox value\r\n t.checked = true;\r\n return;\r\n }\r\n grid.hideColumn(field);\r\n }\r\n }\r\n\r\n oncontextmenu(e) {\r\n e.preventDefault();\r\n const grid = this.grid;\r\n const target = getParentElement(e.target, \"THEAD\");\r\n const menu = this.menu;\r\n const rect = target.getBoundingClientRect();\r\n let x = e.clientX - rect.left;\r\n const y = e.clientY - rect.top;\r\n\r\n menu.style.top = `${y}px`;\r\n menu.style.left = `${x}px`;\r\n\r\n removeAttribute(menu, \"hidden\");\r\n if (x + 150 > rect.width) {\r\n x -= menu.offsetWidth;\r\n menu.style.left = `${x}px`;\r\n }\r\n\r\n const documentClickHandler = (e) => {\r\n if (!menu.contains(e.target)) {\r\n setAttribute(menu, \"hidden\", \"\");\r\n off(document, \"click\", documentClickHandler);\r\n }\r\n };\r\n on(document, \"click\", documentClickHandler);\r\n }\r\n createMenu() {\r\n const grid = this.grid;\r\n const menu = this.menu;\r\n while (menu.lastChild) {\r\n menu.removeChild(menu.lastChild);\r\n }\r\n menu.addEventListener(\"change\", this);\r\n grid.options.columns.forEach((col) => {\r\n if (col.attr) {\r\n return;\r\n }\r\n const li = document.createElement(\"li\");\r\n const label = document.createElement(\"label\");\r\n const checkbox = document.createElement(\"input\");\r\n setAttribute(checkbox, \"type\", \"checkbox\");\r\n setAttribute(checkbox, \"data-name\", col.field);\r\n if (!col.hidden) {\r\n checkbox.checked = true;\r\n }\r\n const text = document.createTextNode(col.title);\r\n\r\n label.appendChild(checkbox);\r\n label.appendChild(text);\r\n\r\n li.appendChild(label);\r\n menu.appendChild(li);\r\n });\r\n }\r\n}\r\n\r\nexport default ContextMenu;\r\n", "import BasePlugin from \"../core/base-plugin.js\";\nimport getParentElement from \"../utils/getParentElement.js\";\nimport { dispatch, findAll, getAttribute, on, setAttribute } from \"../utils/shortcuts.js\";\n\n/**\n * Allows to move headers\n */\nclass DraggableHeaders extends BasePlugin {\n /**\n * @param {HTMLTableCellElement} th\n */\n makeHeaderDraggable(th) {\n const grid = this.grid;\n th.draggable = true;\n on(th, \"dragstart\", (e) => {\n if (grid.plugins.ColumnResizer && grid.plugins.ColumnResizer.isResizing && e.preventDefault) {\n e.preventDefault();\n return;\n }\n grid.log(\"reorder col\");\n e.dataTransfer.effectAllowed = \"move\";\n e.dataTransfer.setData(\"text/plain\", e.target.getAttribute(\"aria-colindex\"));\n });\n on(th, \"dragover\", (e) => {\n if (e.preventDefault) {\n e.preventDefault();\n }\n e.dataTransfer.dropEffect = \"move\";\n return false;\n });\n on(th, \"drop\", (e) => {\n if (e.stopPropagation) {\n e.stopPropagation();\n }\n const t = e.target;\n const target = getParentElement(t, \"TH\");\n const index = parseInt(e.dataTransfer.getData(\"text/plain\"));\n const targetIndex = parseInt(target.getAttribute(\"aria-colindex\"));\n\n if (index === targetIndex) {\n grid.log(\"reordered col stayed the same\");\n return;\n }\n grid.log(\"reordered col from \" + index + \" to \" + targetIndex);\n\n const offset = grid.startColIndex();\n const tmp = grid.options.columns[index - offset];\n grid.options.columns[index - offset] = grid.options.columns[targetIndex - offset];\n grid.options.columns[targetIndex - offset] = tmp;\n\n const swapNodes = (selector, el1) => {\n const rowIndex = el1.parentNode.getAttribute(\"aria-rowindex\");\n const el2 = grid.querySelector(selector + \" tr[aria-rowindex='\" + rowIndex + \"'] [aria-colindex='\" + targetIndex + \"']\");\n setAttribute(el1, \"aria-colindex\", targetIndex);\n setAttribute(el2, \"aria-colindex\", index);\n const newNode = document.createElement(\"th\");\n el1.parentNode.insertBefore(newNode, el1);\n el2.parentNode.replaceChild(el1, el2);\n newNode.parentNode.replaceChild(el2, newNode);\n };\n\n // Swap all rows in header and body\n findAll(grid, \"thead th[aria-colindex='\" + index + \"']\").forEach((el1) => {\n swapNodes(\"thead\", el1);\n });\n findAll(grid, 'tbody td[aria-colindex=\"' + index + '\"]').forEach((el1) => {\n swapNodes(\"tbody\", el1);\n });\n\n // Updates the columns\n grid.options.columns = findAll(grid, \"thead tr.dg-head-columns th[field]\").map((th) =>\n grid.options.columns.find((c) => c.field == getAttribute(th, \"field\"))\n );\n\n dispatch(grid, \"columnReordered\", {\n col: tmp.field,\n from: index,\n to: targetIndex,\n });\n return false;\n });\n }\n}\n\nexport default DraggableHeaders;\n", "import BasePlugin from \"../core/base-plugin.js\";\r\n\r\n/**\r\n * Allows to paginate with horizontal swipe motions\r\n */\r\nclass TouchSupport extends BasePlugin {\r\n constructor(grid) {\r\n super(grid);\r\n this.touch = null;\r\n }\r\n connected() {\r\n const grid = this.grid;\r\n grid.addEventListener(\"touchstart\", this, { passive: true });\r\n grid.addEventListener(\"touchmove\", this, { passive: true });\r\n }\r\n\r\n disconnected() {\r\n const grid = this.grid;\r\n grid.removeEventListener(\"touchstart\", this);\r\n grid.removeEventListener(\"touchmove\", this);\r\n }\r\n\r\n ontouchstart(e) {\r\n this.touch = e.touches[0];\r\n }\r\n\r\n ontouchmove(e) {\r\n if (!this.touch) {\r\n return;\r\n }\r\n const grid = this.grid;\r\n const xDiff = this.touch.clientX - e.touches[0].clientX;\r\n const yDiff = this.touch.clientY - e.touches[0].clientY;\r\n\r\n if (Math.abs(xDiff) > Math.abs(yDiff)) {\r\n if (xDiff > 0) {\r\n grid.getNext();\r\n } else {\r\n grid.getPrev();\r\n }\r\n }\r\n this.touch = null;\r\n }\r\n}\r\n\r\nexport default TouchSupport;\r\n", "import BasePlugin from \"../core/base-plugin.js\";\nimport { dispatch, findAll, hasClass, setAttribute } from \"../utils/shortcuts.js\";\n\nconst SELECTABLE_CLASS = \"dg-selectable\";\nconst SELECT_ALL_CLASS = \"dg-select-all\";\nconst CHECKBOX_CLASS = \"form-check-input\"; //bs5\n\n/**\n * Allows to select rows\n */\nclass SelectableRows extends BasePlugin {\n disconnected() {\n if (this.selectAll) {\n this.selectAll.removeEventListener(\"change\", this);\n }\n }\n\n /**\n * @param {String} key Return a specific key (eg: id) instead of the whole row\n * @returns {Array}\n */\n getSelection(key = null) {\n const grid = this.grid;\n let selectedData = [];\n\n const inputs = findAll(grid, `tbody .${SELECTABLE_CLASS} input:checked`);\n inputs.forEach((checkbox) => {\n const idx = parseInt(checkbox.dataset.id);\n const item = grid.data[idx - 1];\n if (!item) {\n console.warn(`Item ${idx} not found`);\n }\n if (key) {\n selectedData.push(item[key]);\n } else {\n selectedData.push(item);\n }\n });\n return selectedData;\n }\n\n /**\n * Uncheck box if hidden and visible only\n * @param {HTMLTableSectionElement} tbody\n */\n clearCheckboxes(tbody) {\n const grid = this.grid;\n if (!grid.options.selectVisibleOnly) {\n return;\n }\n const inputs = findAll(tbody, `tr[hidden] .${SELECTABLE_CLASS} input`);\n inputs.forEach((input) => {\n input.checked = false;\n });\n this.selectAll.checked = false;\n }\n\n colIndex() {\n return this.grid.startColIndex() - 2;\n }\n\n /**\n * @param {HTMLTableRowElement} tr\n */\n createHeaderCol(tr) {\n let th = document.createElement(\"th\");\n setAttribute(th, \"scope\", \"col\");\n setAttribute(th, \"role\", \"columnheader button\");\n setAttribute(th, \"aria-colindex\", this.colIndex());\n th.classList.add(...[SELECTABLE_CLASS, \"dg-not-resizable\", \"dg-not-sortable\"]);\n th.tabIndex = 0;\n\n this.selectAll = document.createElement(\"input\");\n this.selectAll.type = \"checkbox\";\n this.selectAll.classList.add(SELECT_ALL_CLASS);\n this.selectAll.classList.add(CHECKBOX_CLASS);\n this.selectAll.addEventListener(\"change\", this);\n\n let label = document.createElement(\"label\");\n label.appendChild(this.selectAll);\n\n th.appendChild(label);\n\n th.setAttribute(\"width\", \"40\");\n tr.appendChild(th);\n }\n\n /**\n * @param {HTMLTableRowElement} tr\n */\n createFilterCol(tr) {\n let th = document.createElement(\"th\");\n setAttribute(th, \"role\", \"columnheader button\");\n setAttribute(th, \"aria-colindex\", this.colIndex());\n th.classList.add(SELECTABLE_CLASS);\n th.tabIndex = 0;\n\n tr.appendChild(th);\n }\n\n /**\n * Handles the selectAll checkbox when any other .dg-selectable checkbox is checked on table body.\n * It should check selectAll if all is checked\n * It should uncheck selectAll if any is unchecked\n * @param {HTMLTableSectionElement} tbody\n */\n shouldSelectAll(tbody) {\n if (!this.selectAll) {\n return;\n }\n // Delegate listener for change events on input checkboxes\n tbody.addEventListener(\"change\", this);\n // Make sure state is up to date\n tbody.dispatchEvent(new Event(\"change\"));\n }\n\n /**\n * @param {HTMLTableRowElement} tr\n */\n createDataCol(tr) {\n // Create col\n let td = document.createElement(\"td\");\n setAttribute(td, \"role\", \"gridcell button\");\n setAttribute(td, \"aria-colindex\", this.colIndex());\n td.classList.add(SELECTABLE_CLASS);\n\n // Create input\n let selectOne = document.createElement(\"input\");\n // Alias row id for easy retrieval in getSelection\n selectOne.dataset.id = tr.getAttribute(\"aria-rowindex\");\n selectOne.type = \"checkbox\";\n selectOne.classList.add(CHECKBOX_CLASS);\n // Label need to take full space thanks to css to make the whole cell clickable\n let label = document.createElement(\"label\");\n label.classList.add(\"dg-clickable-cell\");\n label.appendChild(selectOne);\n td.appendChild(label);\n\n // Prevent unwanted click behaviour on row\n label.addEventListener(\"click\", this);\n\n tr.appendChild(td);\n }\n\n /**\n * @param {Event} e\n */\n onclick(e) {\n e.stopPropagation();\n }\n\n /**\n * Handle change event on select all or any select checkbox in the table body\n * @param {import(\"../utils/shortcuts.js\").FlexibleEvent} e\n */\n onchange(e) {\n const grid = this.grid;\n if (hasClass(e.target, SELECT_ALL_CLASS)) {\n const visibleOnly = grid.options.selectVisibleOnly;\n const inputs = findAll(grid, `tbody .${SELECTABLE_CLASS} input`);\n inputs.forEach((cb) => {\n if (visibleOnly && !cb.offsetWidth) {\n return;\n }\n cb.checked = this.selectAll.checked;\n });\n\n dispatch(grid, \"rowsSelected\", {\n selection: this.getSelection(),\n });\n } else {\n if (!e.target.closest(`.${SELECTABLE_CLASS}`)) {\n return;\n }\n const totalCheckboxes = findAll(grid, `tbody .${SELECTABLE_CLASS} input[type=checkbox]`);\n // @ts-ignore\n const totalChecked = totalCheckboxes.filter((n) => n.checked);\n this.selectAll.checked = totalChecked.length == totalCheckboxes.length;\n\n dispatch(grid, \"rowsSelected\", {\n selection: grid.getSelection(),\n });\n }\n }\n}\n\nexport default SelectableRows;\n", "import BasePlugin from \"../core/base-plugin.js\";\nimport { setAttribute } from \"../utils/shortcuts.js\";\n\n/**\n * Support for fixed table height\n *\n * We should add a fake row to push the footer down in case we don't have enough rows\n */\nclass FixedHeight extends BasePlugin {\n constructor(grid) {\n super(grid);\n\n this.hasFixedHeight = false;\n // If we have a fixed height, make sure we have overflowY set\n if (grid.style.height) {\n grid.style.overflowY = \"auto\";\n this.hasFixedHeight = true;\n }\n }\n\n /**\n */\n createFakeRow() {\n const grid = this.grid;\n const tbody = grid.querySelector(\"tbody\");\n let tr = document.createElement(\"tr\");\n setAttribute(tr, \"role\", \"row\");\n setAttribute(tr, \"hidden\", \"\");\n tr.classList.add(\"dg-fake-row\");\n tr.tabIndex = 0;\n tbody.appendChild(tr);\n }\n\n get fakeRow() {\n return this.grid.querySelector(\".dg-fake-row\");\n }\n\n /**\n * On last page, use a fake row to push footer down\n */\n updateFakeRow() {\n const grid = this.grid;\n const fakeRow = this.fakeRow;\n if (!fakeRow) {\n return;\n }\n\n // We don't need a fake row if we display everything\n if (grid.options.perPage > grid.totalRecords()) {\n return;\n }\n // We are not on last page\n if (grid.page !== grid.totalPages()) {\n return;\n }\n if (!grid.options.autoheight) {\n return;\n }\n // Find remaining missing height\n const max = grid.options.perPage * grid.rowHeight;\n const visibleRows = grid.querySelectorAll(\"tbody tr:not([hidden])\").length;\n const fakeHeight = visibleRows > 1 ? max - visibleRows * grid.rowHeight : max;\n if (fakeHeight > 0) {\n setAttribute(fakeRow, \"height\", fakeHeight);\n fakeRow.removeAttribute(\"hidden\");\n } else {\n fakeRow.removeAttribute(\"height\");\n }\n }\n}\n\nexport default FixedHeight;\n", "import BasePlugin from \"../core/base-plugin.js\";\nimport getTextWidth from \"../utils/getTextWidth.js\";\nimport { getAttribute, hasAttribute, setAttribute } from \"../utils/shortcuts.js\";\n\n/**\n * Allows to resize columns\n */\nclass AutosizeColumn extends BasePlugin {\n /**\n * Autosize col based on column data\n * @param {HTMLTableCellElement} th\n * @param {import(\"../data-grid\").Column} column\n * @param {Number} min\n * @param {Number} max\n * @returns {Number}\n */\n computeSize(th, column, min, max) {\n const grid = this.grid;\n if (hasAttribute(th, \"width\")) {\n return getAttribute(th, \"width\");\n }\n if (!grid.data.length) {\n return;\n }\n const firstVal = grid.data[0];\n const lastVal = grid.data[grid.data.length - 1];\n let v = firstVal[column.field] ? firstVal[column.field].toString() : \"\";\n let v2 = lastVal[column.field] ? lastVal[column.field].toString() : \"\";\n if (v2.length > v.length) {\n v = v2;\n }\n let width = 0;\n if (v.length <= 6) {\n width = min;\n } else if (v.length > 50) {\n width = max;\n } else {\n // Add some extra room to have some spare space\n width = getTextWidth(v + \"0000\", th);\n }\n if (width > max) {\n width = max;\n }\n if (width < min) {\n width = min;\n }\n setAttribute(th, \"width\", width);\n return width;\n }\n}\n\nexport default AutosizeColumn;\n", "/**\r\n * Define a function that can be happily passed to addEventListener\r\n * @typedef {Function & EventListenerOrEventListenerObject} ExtendedFunction\r\n */\r\n\r\n/**\r\n * @param {Function} handler\r\n * @param {Number} timeout\r\n * @returns {ExtendedFunction}\r\n */\r\nexport default function debounce(handler, timeout = 300) {\r\n let timer = null;\r\n return (...args) => {\r\n clearTimeout(timer);\r\n timer = setTimeout(() => {\r\n timer = null;\r\n handler(...args);\r\n }, timeout);\r\n };\r\n}\r\n", "import BasePlugin from \"../core/base-plugin.js\";\nimport debounce from \"../utils/debounce.js\";\nimport { addClass, ce, find, findAll, hasClass, insertAfter, removeAttribute, removeClass, setAttribute } from \"../utils/shortcuts.js\";\n\nconst RESPONSIVE_CLASS = \"dg-responsive\";\n\nlet obsTo;\n\n/**\n * @param {Array} list\n * @returns {Array}\n */\nfunction sortByPriority(list) {\n return list.sort((a, b) => {\n const v1 = parseInt(a.dataset.responsive) || 1;\n const v2 = parseInt(b.dataset.responsive) || 1;\n return v2 - v1;\n });\n}\n\n/**\n * @type {ResizeObserverCallback}\n */\n//@ts-ignore\nconst callback = debounce((entries) => {\n for (const entry of entries) {\n /**\n * @type {import(\"../data-grid\").default}\n */\n // @ts-ignore\n const grid = entry.target;\n const table = grid.table;\n if (grid.plugins.ResponsiveGrid.observerBlocked) {\n return;\n }\n // check inlineSize (width) and not blockSize (height)\n const contentBoxSize = Array.isArray(entry.contentBoxSize) ? entry.contentBoxSize[0] : entry.contentBoxSize;\n const size = parseInt(contentBoxSize.inlineSize);\n const tableWidth = table.offsetWidth;\n const realTableWidth = findAll(grid.headerRow, \"th\").reduce((result, th) => {\n return result + th.offsetWidth;\n }, 0);\n const diff = (realTableWidth || tableWidth) - size - 1;\n const minWidth = 50;\n const prevAction = grid.plugins.ResponsiveGrid.prevAction;\n // We have an array with the columns to show/hide are in order, most important first\n const headerCols = sortByPriority(\n findAll(grid.headerRow, \"th[field]\")\n .reverse() // Order takes precedence if no priority is set\n .filter((col) => {\n // Leave out unresponsive columns\n return col.dataset.responsive !== \"0\";\n })\n );\n let changed = false;\n\n grid.log(`table is ${tableWidth}/${realTableWidth} and available size is ${size}. Diff: ${diff}`);\n\n // The table is too big when diff has a high value, otherwise it will be like -1 or -2\n if (diff > 0) {\n if (prevAction === \"show\") {\n return;\n }\n grid.plugins.ResponsiveGrid.prevAction = \"hide\";\n let remaining = diff;\n let cols = headerCols.filter((col) => {\n return !col.hasAttribute(\"hidden\") && col.hasAttribute(\"data-responsive\");\n });\n if (cols.length === 0) {\n cols = headerCols.filter((col) => {\n return !col.hasAttribute(\"hidden\");\n });\n // Always keep one column\n if (cols.length === 1) {\n return;\n }\n }\n cols.forEach((col) => {\n if (remaining < 0) {\n return;\n }\n\n const colWidth = col.offsetWidth;\n const field = col.getAttribute(\"field\");\n if (!field) {\n return;\n }\n col.dataset.baseWidth = \"\" + col.offsetWidth;\n\n grid.hideColumn(field, false);\n grid.setColProp(field, \"responsiveHidden\", true);\n changed = true;\n\n remaining -= colWidth;\n remaining = Math.round(remaining);\n });\n } else {\n if (prevAction === \"hide\") {\n return;\n }\n grid.plugins.ResponsiveGrid.prevAction = \"show\";\n\n const requiredWidth =\n headerCols\n .filter((col) => {\n return !col.hasAttribute(\"hidden\");\n })\n .reduce((result, col) => {\n const width = col.dataset.minWidth ? parseInt(col.dataset.minWidth) : col.offsetWidth;\n return result + width;\n }, 0) + minWidth; // Add an offset so that inserting column is smoother\n\n // Compute available width to insert columns\n let remaining = size - requiredWidth;\n // Do we have any hidden column that we can restore ?\n headerCols\n .slice()\n .reverse() // Reverse the array to restore the columns in the proper order\n .filter((col) => {\n return col.hasAttribute(\"hidden\");\n })\n .forEach((col) => {\n if (remaining < minWidth) {\n return;\n }\n const colWidth = parseInt(col.dataset.minWidth);\n\n // We need to have enough space to restore it\n if (colWidth > remaining) {\n remaining = -1; // break loop to keep restoring in order\n return;\n }\n\n const field = col.getAttribute(\"field\");\n if (!field) {\n return;\n }\n\n grid.showColumn(field, false);\n grid.setColProp(field, \"responsiveHidden\", false);\n changed = true;\n\n remaining -= colWidth;\n remaining = Math.round(remaining);\n });\n }\n\n // Check footer\n const footer = find(grid.table, \"tfoot\");\n const realFooterWidth = findAll(grid.table, \".dg-footer > div\").reduce((result, div) => {\n return result + div.offsetWidth;\n }, 0);\n const availableFooterWidth = footer.offsetWidth - realFooterWidth;\n if (realFooterWidth > size) {\n addClass(footer, \"dg-footer-compact\");\n } else if (availableFooterWidth > 250) {\n removeClass(footer, \"dg-footer-compact\");\n }\n if (changed) {\n grid.renderTable();\n }\n // Prevent resize loop\n setTimeout(() => {\n grid.plugins.ResponsiveGrid.prevAction = null;\n }, 1000);\n grid.table.style.visibility = \"visible\";\n }\n}, 100);\nconst resizeObserver = new ResizeObserver(callback);\n\n/**\n * Responsive data grid\n */\nclass ResponsiveGrid extends BasePlugin {\n constructor(grid) {\n super(grid);\n\n this.observerBlocked = false;\n this.prevAction = null;\n }\n\n connected() {\n if (this.grid.options.responsive) {\n this.observe();\n }\n }\n\n disconnected() {\n this.unobserve();\n }\n\n observe() {\n if (!this.grid.options.responsive) {\n return;\n }\n resizeObserver.observe(this.grid);\n this.grid.style.display = \"block\"; // Otherwise resize doesn't happen\n this.grid.style.overflowX = \"hidden\"; // Prevent scrollbars from appearing\n }\n\n unobserve() {\n resizeObserver.unobserve(this.grid);\n this.grid.style.display = \"unset\";\n this.grid.style.overflowX = \"unset\";\n }\n\n blockObserver() {\n this.observerBlocked = true;\n if (obsTo) {\n clearTimeout(obsTo);\n }\n }\n\n unblockObserver() {\n obsTo = setTimeout(() => {\n this.observerBlocked = false;\n }, 200); // more than debounce\n }\n\n /**\n * @returns {Boolean}\n */\n hasHiddenColumns() {\n let flag = false;\n this.grid.options.columns.forEach((col) => {\n if (col.responsiveHidden) {\n flag = true;\n }\n });\n return flag;\n }\n\n colIndex() {\n return this.grid.startColIndex() - 1;\n }\n\n /**\n * @param {HTMLTableRowElement} tr\n */\n createHeaderCol(tr) {\n if (!this.grid.options.responsiveToggle) {\n return;\n }\n let th = ce(\"th\", tr);\n setAttribute(th, \"scope\", \"col\");\n setAttribute(th, \"role\", \"columnheader button\");\n setAttribute(th, \"aria-colindex\", this.colIndex());\n setAttribute(th, \"width\", \"40\");\n th.classList.add(...[`${RESPONSIVE_CLASS}-toggle`, \"dg-not-resizable\", \"dg-not-sortable\"]);\n th.tabIndex = 0;\n }\n\n /**\n * @param {HTMLTableRowElement} tr\n */\n createFilterCol(tr) {\n if (!this.grid.options.responsiveToggle) {\n return;\n }\n let th = ce(\"th\", tr);\n setAttribute(th, \"role\", \"columnheader button\");\n setAttribute(th, \"aria-colindex\", this.colIndex());\n th.classList.add(`${RESPONSIVE_CLASS}-toggle`);\n th.tabIndex = 0;\n }\n\n /**\n * @param {HTMLTableRowElement} tr\n */\n createDataCol(tr) {\n if (!this.grid.options.responsiveToggle) {\n return;\n }\n // Create col\n let td = document.createElement(\"td\");\n setAttribute(td, \"role\", \"gridcell button\");\n setAttribute(td, \"aria-colindex\", this.colIndex());\n td.classList.add(`${RESPONSIVE_CLASS}-toggle`);\n\n // Create icon\n td.innerHTML = `
\n \n \n\n\n \n
`;\n tr.appendChild(td);\n\n td.addEventListener(\"click\", this);\n td.addEventListener(\"mousedown\", this);\n }\n\n computeLabelWidth() {\n let idealWidth = 0;\n let consideredCol = 0;\n while (idealWidth < 120) {\n consideredCol++;\n const hCol = find(this.grid, `.dg-head-columns th[aria-colindex=\"${consideredCol}\"]`);\n if (hCol) {\n idealWidth += hCol.offsetWidth;\n } else {\n break;\n }\n }\n return idealWidth;\n }\n\n /**\n * @param {Event} ev\n */\n onmousedown(ev) {\n // Avoid selection through double click\n ev.preventDefault();\n }\n\n /**\n * @param {Event} ev\n */\n onclick(ev) {\n // Prevent expandable\n ev.stopPropagation();\n\n // target is the element that triggered the event (e.g., the user clicked on)\n // currentTarget is the element that the event listener is attached to.\n\n /**\n * @type {HTMLTableRowElement}\n */\n //@ts-ignore\n const td = ev.currentTarget;\n const tr = td.parentElement;\n const open = find(td, `.${RESPONSIVE_CLASS}-open`);\n const close = find(td, `.${RESPONSIVE_CLASS}-close`);\n\n this.blockObserver();\n\n const isExpanded = hasClass(tr, `${RESPONSIVE_CLASS}-expanded`);\n if (isExpanded) {\n removeClass(tr, `${RESPONSIVE_CLASS}-expanded`);\n open.style.display = \"unset\";\n close.style.display = \"none\";\n\n // Move back rows and cleanup row\n const childRow = tr.nextElementSibling;\n const hiddenCols = findAll(childRow, `.${RESPONSIVE_CLASS}-hidden`);\n hiddenCols.forEach((col) => {\n // We don't really need to care where we insert them since we are going to redraw anyway\n tr.appendChild(col);\n setAttribute(col, \"hidden\");\n });\n\n childRow.parentElement.removeChild(childRow);\n } else {\n addClass(tr, `${RESPONSIVE_CLASS}-expanded`);\n open.style.display = \"none\";\n close.style.display = \"unset\";\n\n // Create a child row and move rows into it\n const childRow = ce(\"tr\");\n insertAfter(childRow, tr);\n addClass(childRow, `${RESPONSIVE_CLASS}-child-row`);\n\n const childRowTd = ce(\"td\", childRow);\n setAttribute(childRowTd, \"colspan\", this.grid.columnsLength(true));\n\n const childTable = ce(\"table\", childRowTd);\n addClass(childTable, `${RESPONSIVE_CLASS}-table`);\n\n const hiddenCols = findAll(tr, `.${RESPONSIVE_CLASS}-hidden`);\n const idealWidth = this.computeLabelWidth();\n hiddenCols.forEach((col) => {\n const childTableRow = ce(\"tr\", childTable);\n\n // Add label\n const label = col.dataset.name;\n const labelCol = ce(\"th\", childTableRow);\n // It looks much better when aligned with an actual col\n labelCol.style.width = `${idealWidth}px`;\n labelCol.innerHTML = label;\n\n // Add actual row\n childTableRow.appendChild(col);\n removeAttribute(col, \"hidden\");\n });\n }\n\n this.unblockObserver();\n }\n}\n\nexport default ResponsiveGrid;\n", "import BasePlugin from \"../core/base-plugin.js\";\r\nimport interpolate from \"../utils/interpolate.js\";\r\nimport { dispatch, on, setAttribute } from \"../utils/shortcuts.js\";\r\n\r\n/**\r\n * Add action on rows\r\n */\r\nclass RowActions extends BasePlugin {\r\n /**\r\n * @returns {Boolean}\r\n */\r\n hasActions() {\r\n return this.grid.options.actions.length > 0;\r\n }\r\n\r\n /**\r\n *\r\n * @param {HTMLTableRowElement} tr\r\n */\r\n makeActionHeader(tr) {\r\n let actionsTh = document.createElement(\"th\");\r\n setAttribute(actionsTh, \"role\", \"columnheader button\");\r\n setAttribute(actionsTh, \"aria-colindex\", this.grid.columnsLength(true));\r\n actionsTh.classList.add(...[\"dg-actions\", \"dg-not-sortable\", \"dg-not-resizable\", this.actionClass]);\r\n actionsTh.tabIndex = 0;\r\n tr.appendChild(actionsTh);\r\n }\r\n\r\n /**\r\n *\r\n * @param {HTMLTableRowElement} tr\r\n */\r\n makeActionFilter(tr) {\r\n let actionsTh = document.createElement(\"th\");\r\n actionsTh.setAttribute(\"role\", \"columnheader button\");\r\n actionsTh.setAttribute(\"aria-colindex\", \"\" + this.grid.columnsLength(true));\r\n actionsTh.classList.add(...[\"dg-actions\", this.actionClass]);\r\n actionsTh.tabIndex = 0;\r\n tr.appendChild(actionsTh);\r\n }\r\n\r\n /**\r\n * @param {HTMLTableRowElement} tr\r\n * @param {Object} item\r\n */\r\n makeActionRow(tr, item) {\r\n const labels = this.grid.labels;\r\n const td = document.createElement(\"td\");\r\n setAttribute(td, \"role\", \"gridcell\");\r\n setAttribute(td, \"aria-colindex\", this.grid.columnsLength(true));\r\n td.classList.add(...[\"dg-actions\", this.actionClass]);\r\n td.tabIndex = 0;\r\n\r\n // Add menu toggle\r\n let actionsToggle = document.createElement(\"button\");\r\n actionsToggle.classList.add(\"dg-actions-toggle\");\r\n actionsToggle.innerHTML = \"\u2630\";\r\n td.appendChild(actionsToggle);\r\n on(actionsToggle, \"click\", (ev) => {\r\n ev.stopPropagation();\r\n ev.target.parentElement.classList.toggle(\"dg-actions-expand\");\r\n });\r\n\r\n this.grid.options.actions.forEach((action) => {\r\n let button = document.createElement(\"button\");\r\n if (action.html) {\r\n button.innerHTML = action.html;\r\n } else {\r\n button.innerText = action.title ?? action.name;\r\n }\r\n if (action.title) {\r\n button.title = action.title;\r\n }\r\n if (action.url) {\r\n button.type = \"submit\";\r\n button.formAction = interpolate(action.url, item);\r\n }\r\n if (action.class) {\r\n button.classList.add(...action.class.split(\" \"));\r\n }\r\n const actionHandler = (ev) => {\r\n ev.stopPropagation();\r\n if (action.confirm) {\r\n let c = confirm(labels.areYouSure);\r\n if (!c) {\r\n ev.preventDefault();\r\n return;\r\n }\r\n }\r\n dispatch(this.grid, \"action\", {\r\n data: item,\r\n action: action.name,\r\n });\r\n };\r\n button.addEventListener(\"click\", actionHandler);\r\n td.appendChild(button);\r\n\r\n // Row action\r\n if (action.default) {\r\n tr.classList.add(\"dg-actionable\");\r\n tr.addEventListener(\"click\", actionHandler);\r\n }\r\n });\r\n\r\n tr.appendChild(td);\r\n }\r\n\r\n get actionClass() {\r\n if (this.grid.options.actions.length < 3 && !this.grid.options.collapseActions) {\r\n return \"dg-actions-\" + this.grid.options.actions.length;\r\n }\r\n return \"dg-actions-more\";\r\n }\r\n}\r\n\r\nexport default RowActions;\r\n", "import BasePlugin from \"../core/base-plugin.js\";\r\nimport { dispatch } from \"../utils/shortcuts.js\";\r\n\r\n/**\r\n * Make editable inputs in rows\r\n */\r\nclass EditableColumn extends BasePlugin {\r\n /**\r\n *\r\n * @param {HTMLTableCellElement} td\r\n * @param {import(\"../data-grid\").Column} column\r\n * @param {Object} item\r\n * @param {number} i\r\n */\r\n makeEditableInput(td, column, item, i) {\r\n const gridId = this.grid.getAttribute(\"id\");\r\n let input = document.createElement(\"input\");\r\n input.type = column.editableType || \"text\";\r\n if (input.type == \"email\") {\r\n input.inputMode = \"email\";\r\n }\r\n if (input.type == \"decimal\") {\r\n input.type = \"text\";\r\n input.inputMode = \"decimal\";\r\n }\r\n input.autocomplete = \"off\";\r\n input.spellcheck = false;\r\n input.tabIndex = 0;\r\n input.classList.add(\"dg-editable\");\r\n input.name = gridId.replace(\"-\", \"_\") + \"[\" + (i + 1) + \"]\" + \"[\" + column.field + \"]\";\r\n input.value = item[column.field];\r\n input.dataset.field = column.field;\r\n\r\n // Prevent row action\r\n input.addEventListener(\"click\", (ev) => ev.stopPropagation());\r\n // Enter validates edit\r\n input.addEventListener(\"keypress\", (ev) => {\r\n if (ev.type === \"keypress\") {\r\n const key = ev.keyCode || ev.key;\r\n if (key === 13 || key === \"Enter\") {\r\n input.blur();\r\n ev.preventDefault();\r\n }\r\n }\r\n });\r\n // Save on blur\r\n input.addEventListener(\"blur\", () => {\r\n // Only fire on update\r\n if (input.value == item[input.dataset.field]) {\r\n return;\r\n }\r\n // Update underlying data\r\n item[input.dataset.field] = input.value;\r\n // Notify\r\n dispatch(this.grid, \"edit\", {\r\n data: item,\r\n value: input.value,\r\n });\r\n });\r\n td.appendChild(input);\r\n }\r\n}\r\n\r\nexport default EditableColumn;\r\n", "import DataGrid from \"./src/data-grid.js\";\n// Optional plugins\nimport ColumnResizer from \"./src/plugins/column-resizer.js\";\nimport ContextMenu from \"./src/plugins/context-menu.js\";\nimport DraggableHeaders from \"./src/plugins/draggable-headers.js\";\nimport TouchSupport from \"./src/plugins/touch-support.js\";\nimport SelectableRows from \"./src/plugins/selectable-rows.js\";\nimport FixedHeight from \"./src/plugins/fixed-height.js\";\nimport AutosizeColumn from \"./src/plugins/autosize-column.js\";\nimport ResponsiveGrid from \"./src/plugins/responsive-grid.js\";\nimport RowActions from \"./src/plugins/row-actions.js\";\nimport EditableColumn from \"./src/plugins/editable-column.js\";\n\n// Using shorthand property names\n// This make them reserved and keys will be preserved\n// Actual class names are renamed\nDataGrid.registerPlugins({\n ColumnResizer,\n ContextMenu,\n DraggableHeaders,\n TouchSupport,\n SelectableRows,\n FixedHeight,\n AutosizeColumn,\n ResponsiveGrid,\n RowActions,\n EditableColumn,\n});\n\n// Prevent errors if included multiple times\nif (!customElements.get(\"data-grid\")) {\n customElements.define(\"data-grid\", DataGrid);\n}\n\nexport default DataGrid;\n"], - "mappings": ";;;AAIe,SAAR,SAA0B,KAAK;AACpC,SAAO,IAAI,YAAY,EAAE,QAAQ,qBAAqB,CAAC,GAAG,QAAQ,IAAI,YAAY,CAAC;AACrF;;;ACDe,SAAR,cAA+B,GAAG;AAEvC,MAAI,MAAM,QAAQ;AAChB,WAAO;AAAA,EACT;AACA,MAAI,MAAM,SAAS;AACjB,WAAO;AAAA,EACT;AAEA,MAAI,MAAM,MAAM,MAAM,QAAQ;AAC5B,WAAO;AAAA,EACT;AAEA,MAAI,MAAM,OAAO,CAAC,EAAE,SAAS,GAAG;AAC9B,WAAO,OAAO,CAAC;AAAA,EACjB;AAEA,MAAI,KAAK,CAAC,KAAK,GAAG,EAAE,SAAS,EAAE,UAAU,GAAG,CAAC,CAAC,GAAG;AAC/C,QAAI;AAEF,UAAI,EAAE,QAAQ,GAAG,MAAM,IAAI;AACzB,YAAI,EAAE,QAAQ,MAAM,GAAG;AAAA,MACzB;AACA,aAAO,KAAK,MAAM,mBAAmB,CAAC,CAAC;AAAA,IACzC,QAAE;AACA,cAAQ,MAAM,qBAAqB,CAAC;AACpC,aAAO,CAAC;AAAA,IACV;AAAA,EACF;AACA,SAAO;AACT;;;ACUA,IAAM,wBAAwB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAOA,SAAS,YAAY,MAAM;AACzB,M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AA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAGD,IAAI,CAAC,eAAe,IAAI,WAAW,GAAG;AACpC,iBAAe,OAAO,aAAa,iBAAQ;AAC7C;AAEA,IAAOC,qBAAQ;", + "sourcesContent": ["/**\r\n * @param {String} str\r\n * @returns {String}\r\n */\r\nexport default function camelize(str) {\r\n return str.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g, (m, chr) => chr.toUpperCase());\r\n}\r\n", "/**\r\n * Parse data attribute and return properly typed data\r\n * @param {String} v\r\n * @returns {any}\r\n */\r\nexport default function normalizeData(v) {\r\n // Bool\r\n if (v === \"true\") {\r\n return true;\r\n }\r\n if (v === \"false\") {\r\n return false;\r\n }\r\n // Null or empty\r\n if (v === \"\" || v === \"null\") {\r\n return null;\r\n }\r\n // Numeric attributes\r\n if (v === Number(v).toString()) {\r\n return Number(v);\r\n }\r\n // Only attempt json parsing for array or objects\r\n if (v && [\"[\", \"{\"].includes(v.substring(0, 1))) {\r\n try {\r\n // In case we have only single quoted values, like ['one', 'two', 'three']\r\n if (v.indexOf('\"') === -1) {\r\n v = v.replace(/'/g, '\"');\r\n }\r\n return JSON.parse(decodeURIComponent(v));\r\n } catch {\r\n console.error(\"Failed to parse \" + v);\r\n return {};\r\n }\r\n }\r\n return v;\r\n}\r\n", "/**\r\n * @typedef FlexibleHTMLProps\r\n * @property {boolean} [checked] (HTMLInputElement)\r\n * @property {string} [value] (HTMLInputElement)\r\n * @property {number} [rowHeight] (HTMLTableRowElement)\r\n *\r\n * A flexible type HTMLElement type that does not require using instanceof all over the place\r\n * Make sure that your selector is indeed valid\r\n * Only includes most commons props\r\n * @typedef {HTMLElement & FlexibleHTMLProps} FlexibleHTMLElement\r\n */\r\n\r\n/**\r\n * Keep this as reference for easy documentation\r\n * @typedef {HTMLElement&HTMLInputElement&HTMLTableRowElement} MixedHTMLElement\r\n */\r\n\r\n/**\r\n * @typedef FlexibleEventProps\r\n * @property {FlexibleHTMLElement} target\r\n * @property {FlexibleHTMLElement} currentTarget\r\n * @property {DataTransfer} [dataTransfer] (DragEvent)\r\n * @property {number} [clientX] (MouseEvent)\r\n * @property {number} [clientY] (MouseEvent)\r\n *\r\n * @typedef {Event & FlexibleEventProps} FlexibleEvent\r\n */\r\n\r\n/**\r\n * Keep this as reference for easy documentation\r\n * @typedef {Event&MouseEvent&InputEvent&DragEvent&FocusEvent&KeyboardEvent&PointerEvent} MixedEvent\r\n */\r\n\r\n/**\r\n * @callback FlexibleListener\r\n * @param {FlexibleEvent} event\r\n */\r\n\r\nclass FlexibleEventListenerObject {\r\n /**\r\n * @param {FlexibleEvent} e\r\n */\r\n handleEvent(e) {}\r\n}\r\n\r\nconst supportedPassiveTypes = [\r\n \"scroll\",\r\n \"wheel\",\r\n \"touchstart\",\r\n \"touchmove\",\r\n \"touchenter\",\r\n \"touchend\",\r\n \"touchleave\",\r\n \"mouseout\",\r\n \"mouseleave\",\r\n \"mouseup\",\r\n \"mousedown\",\r\n \"mousemove\",\r\n \"mouseenter\",\r\n \"mousewheel\",\r\n \"mouseover\",\r\n];\r\n\r\n/**\r\n * Automatically set passive options based on type\r\n * @param {string} type\r\n * @returns {AddEventListenerOptions}\r\n */\r\nfunction passiveOpts(type) {\r\n if (supportedPassiveTypes.includes(type)) {\r\n return { passive: true };\r\n }\r\n return {};\r\n}\r\n\r\n/**\r\n * @param {Element} el\r\n * @param {String} name\r\n * @returns {any}\r\n */\r\nexport function getAttribute(el, name) {\r\n return el.getAttribute(name);\r\n}\r\n\r\n/**\r\n * @param {Element} el\r\n * @param {String} name\r\n * @returns {Boolean}\r\n */\r\nexport function hasAttribute(el, name) {\r\n return el.hasAttribute(name);\r\n}\r\n\r\n/**\r\n * @param {Element} el\r\n * @param {String} name\r\n * @param {any} v\r\n * @param {Boolean} check Prevent setting if attribute is already there\r\n */\r\nexport function setAttribute(el, name, v = \"\", check = false) {\r\n if (check && hasAttribute(el, name)) return;\r\n el.setAttribute(name, \"\" + v);\r\n}\r\n\r\n/**\r\n * @param {Element} el\r\n * @param {String} name\r\n */\r\nexport function removeAttribute(el, name) {\r\n if (hasAttribute(el, name)) {\r\n el.removeAttribute(name);\r\n }\r\n}\r\n\r\n/**\r\n * @param {EventTarget} el\r\n * @param {String} type\r\n * @param {EventListenerObject|FlexibleListener} listener\r\n */\r\nexport function on(el, type, listener) {\r\n el.addEventListener(type, listener, passiveOpts(type));\r\n}\r\n\r\n/**\r\n * @param {EventTarget} el\r\n * @param {String} type\r\n * @param {EventListenerObject|FlexibleListener} listener\r\n */\r\nexport function off(el, type, listener) {\r\n el.removeEventListener(type, listener, passiveOpts(type));\r\n}\r\n\r\n/**\r\n * @param {EventTarget} el\r\n * @param {String} type\r\n * @param {EventListenerObject|FlexibleListener} listener\r\n */\r\nexport function one(el, type, listener) {\r\n el.addEventListener(type, listener, {\r\n once: true,\r\n });\r\n}\r\n\r\n/**\r\n * @param {HTMLElement} el\r\n * @param {String} name\r\n * @param {any} data\r\n * @param {Boolean} bubbles\r\n */\r\nexport function dispatch(el, name, data = {}, bubbles = false) {\r\n let opts = {};\r\n if (bubbles) {\r\n opts.bubbles = true;\r\n }\r\n if (data) {\r\n opts.detail = data;\r\n }\r\n el.dispatchEvent(new CustomEvent(name, opts));\r\n}\r\n\r\n/**\r\n * @param {Element} el\r\n * @param {String} name\r\n * @returns {Boolean}\r\n */\r\nexport function hasClass(el, name) {\r\n return el.classList.contains(name);\r\n}\r\n\r\n/**\r\n * @param {Element} el\r\n * @param {String} name\r\n */\r\nexport function addClass(el, name) {\r\n el.classList.add(...name.split(\" \"));\r\n}\r\n\r\n/**\r\n * @param {Element} el\r\n * @param {String} name\r\n */\r\nexport function removeClass(el, name) {\r\n el.classList.remove(...name.split(\" \"));\r\n}\r\n\r\n/**\r\n * @param {Element} el\r\n * @param {String} name\r\n */\r\nexport function toggleClass(el, name) {\r\n el.classList.toggle(name);\r\n}\r\n\r\n/**\r\n * @param {String|HTMLElement} selector\r\n * @param {HTMLElement|Document} base\r\n * @returns {FlexibleHTMLElement|null}\r\n */\r\nexport function $(selector, base = document) {\r\n if (selector instanceof HTMLElement) {\r\n return selector;\r\n }\r\n return base.querySelector(selector);\r\n}\r\n\r\n/**\r\n * @param {String} selector\r\n * @param {Element|Document} base\r\n * @returns {Array}\r\n */\r\nexport function $$(selector, base = document) {\r\n return Array.from(base.querySelectorAll(selector));\r\n}\r\n\r\n/**\r\n * Easily retrieve untyped element\r\n * For actual type, prefer use of el.querySelector\r\n * @param {HTMLElement} el\r\n * @param {String|HTMLElement} selector\r\n * @returns {FlexibleHTMLElement}\r\n */\r\nexport function find(el, selector) {\r\n return $(selector, el);\r\n}\r\n\r\n/**\r\n * Easily retrieve untyped elements\r\n * For actual type, prefer use of el.querySelectorAll\r\n * @param {Element} el\r\n * @param {String} selector\r\n * @returns {Array}\r\n */\r\nexport function findAll(el, selector) {\r\n return $$(selector, el);\r\n}\r\n\r\n/**\r\n * @param {*} el\r\n * @returns {FlexibleHTMLElement}\r\n */\r\nexport function el(el) {\r\n return el;\r\n}\r\n\r\n/**\r\n * @template {keyof HTMLElementTagNameMap} K\r\n * @param {K} tagName\r\n * @param {HTMLElement} parent\r\n * @returns {HTMLElementTagNameMap[K]}\r\n */\r\nexport function ce(tagName, parent = null) {\r\n const el = document.createElement(tagName);\r\n if (parent) {\r\n parent.appendChild(el);\r\n }\r\n return el;\r\n}\r\n\r\n/**\r\n * @param {HTMLElement} newNode\r\n * @param {HTMLElement} existingNode\r\n */\r\nexport function insertAfter(newNode, existingNode) {\r\n existingNode.parentNode.insertBefore(newNode, existingNode.nextSibling);\r\n}\r\n", "import camelize from \"../utils/camelize.js\";\r\nimport normalizeData from \"../utils/normalizeData.js\";\r\nimport { dispatch, getAttribute, setAttribute } from \"../utils/shortcuts.js\";\r\n\r\n/**\r\n * Base element that does not contain any specific logic\r\n * related to this project but makes HTMLElemnt usable\r\n */\r\nclass BaseElement extends HTMLElement {\r\n /**\r\n * @param {Object} options\r\n */\r\n constructor(options = {}) {\r\n super();\r\n this.options = Object.assign({}, this.defaultOptions, this.normalizedDataset, options);\r\n\r\n this.log(\"constructor\");\r\n\r\n this.fireEvents = true;\r\n this._ready();\r\n\r\n this.log(\"ready\");\r\n }\r\n\r\n get defaultOptions() {\r\n return {};\r\n }\r\n\r\n /**\r\n * @param {String} opt\r\n * @returns {any}\r\n */\r\n getOption(opt) {\r\n return this.options[opt];\r\n }\r\n\r\n /**\r\n * @param {String} opt\r\n * @param {any} v\r\n */\r\n setOption(opt, v) {\r\n setAttribute(this, `data-${opt}`, v);\r\n }\r\n\r\n /**\r\n * @param {String} opt\r\n */\r\n toggleOption(opt) {\r\n setAttribute(this, `data-${opt}`, !this.getOption(opt));\r\n }\r\n\r\n get normalizedDataset() {\r\n let jsonConfig = this.dataset.config ? JSON.parse(this.dataset.config) : {};\r\n let data = { ...this.dataset };\r\n for (var key in data) {\r\n if (key == \"config\") {\r\n continue;\r\n }\r\n data[key] = normalizeData(data[key]);\r\n }\r\n // Once normalized, merge into json config\r\n Object.assign(data, jsonConfig);\r\n return data;\r\n }\r\n\r\n /**\r\n * @returns {String}\r\n */\r\n static template() {\r\n return \"\";\r\n }\r\n\r\n /**\r\n * This is called at the end of constructor. Extend in subclass if needed.\r\n */\r\n _ready() {}\r\n\r\n /**\r\n * @param {String|Error} message\r\n */\r\n log(message) {\r\n if (this.options.debug) {\r\n console.log(\"[\" + getAttribute(this, \"id\") + \"] \" + message);\r\n }\r\n }\r\n\r\n /**\r\n * Handle events within the component\r\n * @link https://gist.github.com/WebReflection/ec9f6687842aa385477c4afca625bbf4#handling-events\r\n * @param {Event} event\r\n */\r\n handleEvent(event) {\r\n if (this[`on${event.type}`]) {\r\n this[`on${event.type}`](event);\r\n }\r\n }\r\n\r\n /**\r\n * This is called when connected. Extend in subclass if needed.\r\n */\r\n _connected() {}\r\n\r\n connectedCallback() {\r\n // ensure whenDefined callbacks run first\r\n setTimeout(() => {\r\n this.log(\"connectedCallback\");\r\n\r\n // Append only when labels had the opportunity to be set\r\n // Don't use shadow dom as it makes theming super hard\r\n const template = document.createElement(\"template\");\r\n // @ts-ignore\r\n template.innerHTML = this.constructor.template();\r\n this.appendChild(template.content.cloneNode(true));\r\n\r\n this._connected();\r\n // @link https://gist.github.com/WebReflection/ec9f6687842aa385477c4afca625bbf4#life-cycle-events\r\n dispatch(this, \"connected\");\r\n }, 0);\r\n }\r\n\r\n /**\r\n * This is called when disconnected. Extend in subclass if needed.\r\n */\r\n _disconnected() {}\r\n\r\n disconnectedCallback() {\r\n this.log(\"disconnectedCallback\");\r\n this._disconnected();\r\n // @link https://gist.github.com/WebReflection/ec9f6687842aa385477c4afca625bbf4#life-cycle-events\r\n dispatch(this, \"disconnected\");\r\n }\r\n\r\n /**\r\n * @link https://gist.github.com/WebReflection/ec9f6687842aa385477c4afca625bbf4#a-props-like-accessor\r\n * @returns {Object}\r\n */\r\n get transformAttributes() {\r\n return {};\r\n }\r\n\r\n /**\r\n * This is only meant to work with data attributes\r\n * This allows us to have properties that reflect automatically in the component\r\n * @link https://gist.github.com/WebReflection/ec9f6687842aa385477c4afca625bbf4#reflected-dataset-attributes\r\n * @param {String} attributeName\r\n * @param {String} oldValue\r\n * @param {String} newValue\r\n */\r\n attributeChangedCallback(attributeName, oldValue, newValue) {\r\n // It didn't change\r\n if (oldValue === newValue) {\r\n return;\r\n }\r\n\r\n this.log(\"attributeChangedCallback: \" + attributeName);\r\n\r\n let isOption = false;\r\n const transformer = this.transformAttributes[attributeName] ?? normalizeData;\r\n\r\n // Data attributes are mapped to options while other attributes are mapped as properties\r\n if (attributeName.indexOf(\"data-\") === 0) {\r\n attributeName = attributeName.slice(5);\r\n isOption = true;\r\n }\r\n attributeName = camelize(attributeName);\r\n if (isOption) {\r\n this.options[attributeName] = transformer(newValue);\r\n } else {\r\n this[attributeName] = transformer(newValue);\r\n }\r\n\r\n // Fire internal event\r\n if (this.fireEvents && this[`${attributeName}Changed`]) {\r\n this[`${attributeName}Changed`]();\r\n }\r\n }\r\n}\r\n\r\nexport default BaseElement;\r\n", "/**\r\n * @param {HTMLSelectElement} el\r\n * @param {String} value\r\n * @param {String} label\r\n * @param {Boolean} checked\r\n */\r\nexport default function addSelectOption(el, value, label, checked = false) {\r\n let opt = document.createElement(\"option\");\r\n opt.value = \"\" + value;\r\n if (checked) {\r\n opt.selected = true;\r\n }\r\n opt.label = label;\r\n el.appendChild(opt);\r\n}\r\n", "/**\r\n * @param {URL} url\r\n * @param {Object} params\r\n */\r\nexport default function appendParamsToUrl(url, params = {}) {\r\n Object.keys(params).forEach((key) => {\r\n if (Array.isArray(params[key])) {\r\n // @ts-ignore\r\n Object.keys(params[key]).forEach((k) => url.searchParams.append(isNaN(k) ? `${key}[${k}]` : key, params[key][k]));\r\n } else {\r\n url.searchParams.append(key, params[key]);\r\n }\r\n });\r\n}\r\n", "/**\r\n * Force value as arrays\r\n * @param {String|Array} v\r\n * @returns {Array}\r\n */\r\nexport default function convertArray(v) {\r\n if (typeof v === \"string\") {\r\n if (v[0] === \"[\") {\r\n // \"['my', 'value']\" would fail as a json\r\n if (v.indexOf('\"') === -1) {\r\n v = v.replace(/'/g, '\"');\r\n }\r\n return JSON.parse(v);\r\n }\r\n\r\n return v.split(\",\");\r\n }\r\n if (!Array.isArray(v)) {\r\n console.error(\"Invalid array\", v);\r\n return [];\r\n }\r\n return v;\r\n}\r\n", "/**\r\n * @param {HTMLElement} el\r\n * @returns {Object}\r\n */\r\nexport default function elementOffset(el) {\r\n var rect = el.getBoundingClientRect(),\r\n scrollLeft = window.pageXOffset || document.documentElement.scrollLeft,\r\n scrollTop = window.pageYOffset || document.documentElement.scrollTop;\r\n return { top: rect.top + scrollTop, left: rect.left + scrollLeft };\r\n}\r\n", "/**\r\n * Replace element within {} by their data value\r\n * @param {String} str\r\n * @param {Object} data\r\n * @returns {String}\r\n */\r\nexport default function interpolate(str, data) {\r\n return str.replace(/\\{([^}]+)?\\}/g, function ($1, $2) {\r\n return data[$2];\r\n });\r\n}\r\n", "/**\r\n * Uses canvas.measureText to compute and return the width of the given text of given font in pixels.\r\n * Getting computed styles only works for dom that are added in the dom\r\n * @see https://stackoverflow.com/questions/118241/calculate-text-width-with-javascript/21015393#21015393\r\n * @param {String} text The text to be rendered.\r\n * @param {Element} el Target element (defaults to body)\r\n * @param {Boolean} withPadding Include padding on element\r\n * @returns {Number}\r\n */\r\nexport default function getTextWidth(text, el = document.body, withPadding = false) {\r\n if (!el) {\r\n el = document.createElement(\"div\");\r\n }\r\n const styles = window.getComputedStyle(el);\r\n const fontWeight = styles.getPropertyValue(\"font-weight\") || \"normal\";\r\n const fontSize = styles.getPropertyValue(\"font-size\") || \"1rem\";\r\n const fontFamily = styles.getPropertyValue(\"font-family\") || \"Arial\";\r\n\r\n let padding = 0;\r\n if (withPadding) {\r\n const paddingLeft = styles.getPropertyValue(\"padding-left\") || \"0\";\r\n const paddingRight = styles.getPropertyValue(\"padding-right\") || \"0\";\r\n padding = parseInt(paddingLeft) + parseInt(paddingRight);\r\n }\r\n\r\n // re-use canvas object for better performance\r\n // @ts-ignore\r\n const canvas = getTextWidth.canvas || (getTextWidth.canvas = document.createElement(\"canvas\"));\r\n const context = canvas.getContext(\"2d\");\r\n context.font = `${fontWeight} ${fontSize} ${fontFamily}`;\r\n const metrics = context.measureText(text);\r\n return parseInt(metrics.width) + padding;\r\n}\r\n", "/**\r\n * @param {String} prefix\r\n * @returns {String}\r\n */\r\nexport default function randstr(prefix) {\r\n return Math.random()\r\n .toString(36)\r\n .replace(\"0.\", prefix || \"\");\r\n}\r\n", "/**\r\n * Data Grid Web component\r\n *\r\n * Credits for inspiration\r\n * @link https://github.com/riverside/zino-grid\r\n */\r\n\"use strict\";\r\n\r\nimport BaseElement from \"./core/base-element.js\";\r\nimport addSelectOption from \"./utils/addSelectOption.js\";\r\nimport appendParamsToUrl from \"./utils/appendParamsToUrl.js\";\r\nimport camelize from \"./utils/camelize.js\";\r\nimport convertArray from \"./utils/convertArray.js\";\r\nimport elementOffset from \"./utils/elementOffset.js\";\r\nimport interpolate from \"./utils/interpolate.js\";\r\nimport getTextWidth from \"./utils/getTextWidth.js\";\r\nimport randstr from \"./utils/randstr.js\";\r\nimport {\r\n dispatch,\r\n find,\r\n findAll,\r\n hasClass,\r\n removeAttribute,\r\n getAttribute,\r\n setAttribute,\r\n addClass,\r\n toggleClass,\r\n on,\r\n ce,\r\n} from \"./utils/shortcuts.js\";\r\n\r\n/**\r\n * Column definition\r\n * @typedef Column\r\n * @property {String} field - the key in the data\r\n * @property {String} title - the title to display in the header (defaults to \"field\" if not set)\r\n * @property {Number} [width] - the width of the column (auto otherwise)\r\n * @property {String} [class] - class to set on the column (target body or header with th.class or td.class)\r\n * @property {String} [attr] - don't render the column and set a matching attribute on the row with the value of the field\r\n * @property {Boolean} [hidden] - hide the column\r\n * @property {Boolean} [noSort] - allow disabling sort for a given column\r\n * @property {String | Function} [format] - custom data formatting\r\n * @property {String} [defaultFormatValue] - default value to use for formatting\r\n * @property {String} [transform] - custom value transformation\r\n * @property {Boolean} [editable] - replace with input (EditableColumn module)\r\n * @property {String} [editableType] - type of input (EditableColumn module)\r\n * @property {Number} [responsive] - the higher the value, the sooner it will be hidden, disable with 0 (ResponsiveGrid module)\r\n * @property {Boolean} [responsiveHidden] - hidden through responsive module (ResponsiveGrid module)\r\n */\r\n\r\n/**\r\n * Row action\r\n * @typedef Action\r\n * @property {String} title - the title of the button\r\n * @property {String} name - the name of the action\r\n * @property {String} class - the class for the button\r\n * @property {String} url - link for the action\r\n * @property {String} html - custom button data\r\n * @property {Boolean} [confirm] - needs confirmation\r\n * @property {Boolean} default - is the default row action\r\n */\r\n\r\n/** @typedef {import('./plugins/autosize-column').default} AutosizeColumn */\r\n/** @typedef {import('./plugins/column-resizer').default} ColumnResizer */\r\n/** @typedef {import('./plugins/context-menu').default} ContextMenu */\r\n/** @typedef {import('./plugins/draggable-headers').default} DraggableHeaders */\r\n/** @typedef {import('./plugins/editable-column').default} EditableColumn */\r\n/** @typedef {import('./plugins/fixed-height').default} FixedHeight */\r\n/** @typedef {import('./plugins/responsive-grid').default} ResponsiveGrid */\r\n/** @typedef {import('./plugins/row-actions').default} RowActions */\r\n/** @typedef {import('./plugins/selectable-rows').default} SelectableRows */\r\n/** @typedef {import('./plugins/touch-support').default} TouchSupport */\r\n\r\n/**\r\n * These plugins are all optional\r\n * @typedef {Object} Plugins\r\n * @property {ColumnResizer} [ColumnResizer] resize handlers in the headers\r\n * @property {ContextMenu} [ContextMenu] menu to show/hide columns\r\n * @property {DraggableHeaders} [DraggableHeaders] draggable headers columns\r\n * @property {EditableColumn} [EditableColumn] draggable headers columns\r\n * @property {TouchSupport} [TouchSupport] touch swipe\r\n * @property {SelectableRows} [SelectableRows] create a column with checkboxes to select rows\r\n * @property {FixedHeight} [FixedHeight] allows having fixed height tables\r\n * @property {AutosizeColumn} [AutosizeColumn] compute ideal width based on column content\r\n * @property {ResponsiveGrid} [ResponsiveGrid] hide/show column on the fly\r\n * @property {RowActions} [RowActions] add action on rows\r\n */\r\n\r\n/**\r\n * Parameters to pass along or receive from the server\r\n * @typedef ServerParams\r\n * @property {String} serverParams.start\r\n * @property {String} serverParams.length\r\n * @property {String} serverParams.search\r\n * @property {String} serverParams.sort\r\n * @property {String} serverParams.sortDir\r\n * @property {String} serverParams.dataKey\r\n * @property {String} serverParams.metaKey\r\n * @property {String} serverParams.metaTotalKey\r\n * @property {String} serverParams.metaFilteredKey\r\n * @property {String} serverParams.optionsKey\r\n * @property {String} serverParams.paramsKey\r\n */\r\n\r\n/**\r\n * Available data grid options, plugins included\r\n * @typedef Options\r\n * @property {?String} id Custom id for the grid\r\n * @property {?String} url An URL with data to display in JSON format\r\n * @property {Boolean} debug Log actions in DevTools console\r\n * @property {Boolean} filter Allows a filtering functionality\r\n * @property {Boolean} sort Allows a sort by column functionality\r\n * @property {String} defaultSort Default sort field if sorting is enabled\r\n * @property {Boolean} server Is a server side powered grid\r\n * @property {ServerParams} serverParams Describe keys passed to the server backend\r\n * @property {String} dir Dir\r\n * @property {Array} perPageValues Available per page options\r\n * @property {Boolean} hidePerPage Hides the page size select element\r\n * @property {Column[]} columns Available columns\r\n * @property {Number} defaultPage Starting page\r\n * @property {Number} perPage Number of records displayed per page (page size)\r\n * @property {Boolean} expand Allow cell content to spawn over multiple lines\r\n * @property {Action[]} actions Row actions (RowActions module)\r\n * @property {Boolean} collapseActions Group actions (RowActions module)\r\n * @property {Boolean} resizable Make columns resizable (ColumnResizer module)\r\n * @property {Boolean} selectable Allow selecting rows with a checkbox (SelectableRows module)\r\n * @property {Boolean} selectVisibleOnly Select all only selects visible rows (SelectableRows module)\r\n * @property {Boolean} autosize Compute column sizes based on given data (Autosize module)\r\n * @property {Boolean} autoheight Adjust height so that it matches table size (FixedHeight module)\r\n * @property {Boolean} autohidePager auto-hides the pager when number of records falls below the selected page size\r\n * @property {Boolean} menu Right click menu on column headers (ContextMenu module)\r\n * @property {Boolean} reorder Allows a column reordering functionality (DraggableHeaders module)\r\n * @property {Boolean} responsive Change display mode on small screens (ResponsiveGrid module)\r\n * @property {Boolean} responsiveToggle Show toggle column (ResponsiveGrid module)\r\n */\r\n\r\n/**\r\n * Available labels that can be translated\r\n * @typedef Labels\r\n * @property {String} itemsPerPage\r\n * @property {String} gotoPage\r\n * @property {String} gotoFirstPage\r\n * @property {String} gotoPrevPage\r\n * @property {String} gotoNextPage\r\n * @property {String} gotoLastPage\r\n * @property {String} of\r\n * @property {String} items\r\n * @property {String} resizeColumn\r\n * @property {String} noData\r\n * @property {String} areYouSure\r\n * @property {String} networkError\r\n */\r\n\r\n/**\r\n * List of registered plugins\r\n * @type {Plugins}\r\n */\r\nlet plugins = {};\r\n\r\n/**\r\n * @type {Labels}\r\n */\r\nlet labels = {\r\n itemsPerPage: \"Items per page\",\r\n gotoPage: \"Go to page\",\r\n gotoFirstPage: \"Go to first page\",\r\n gotoPrevPage: \"Go to previous page\",\r\n gotoNextPage: \"Go to next page\",\r\n gotoLastPage: \"Go to last page\",\r\n of: \"of\",\r\n items: \"items\",\r\n resizeColumn: \"Resize column\",\r\n noData: \"No data\",\r\n areYouSure: \"Are you sure?\",\r\n networkError: \"Network response error\",\r\n};\r\n\r\n/**\r\n * Column definition will update some props on the html element\r\n * @param {HTMLElement} el\r\n * @param {Column} column\r\n */\r\nfunction applyColumnDefinition(el, column) {\r\n if (column.width) {\r\n setAttribute(el, \"width\", column.width);\r\n }\r\n if (column.class) {\r\n addClass(el, column.class);\r\n }\r\n if (column.hidden) {\r\n setAttribute(el, \"hidden\", \"\");\r\n if (column.responsiveHidden) {\r\n addClass(el, \"dg-responsive-hidden\");\r\n }\r\n }\r\n}\r\n\r\n/**\r\n */\r\nclass DataGrid extends BaseElement {\r\n _ready() {\r\n setAttribute(this, \"id\", this.options.id ?? randstr(\"el-\"), true);\r\n\r\n /**\r\n * The grid displays that data\r\n * @type {Array}\r\n */\r\n this.data = [];\r\n /**\r\n * We store the original data in this\r\n * @type {Array}\r\n */\r\n this.originalData; // declared uninitialized to allow data preloading before fetch.\r\n\r\n // Make the IDE happy\r\n /**\r\n * @type {Options}\r\n */\r\n this.options = this.options || this.defaultOptions;\r\n\r\n // Init values\r\n this.fireEvents = false;\r\n this.page = this.options.defaultPage || 1;\r\n this.pages = 0;\r\n this.meta; // declared uninitialized to allow data preloading before fetch.\r\n /**\r\n * @type {Plugins}\r\n */\r\n this.plugins = {};\r\n // Init plugins\r\n for (const [pluginName, pluginClass] of Object.entries(plugins)) {\r\n // @ts-ignore until we can set typeof import ...\r\n this.plugins[pluginName] = new pluginClass(this);\r\n }\r\n\r\n // Expose options as observed attributes in the dom\r\n // Do it when fireEvents is disabled to avoid firing change callbacks\r\n for (const attr of DataGrid.observedAttributes) {\r\n if (attr.indexOf(\"data-\") === 0) {\r\n setAttribute(this, attr, this.options[camelize(attr.slice(5))]);\r\n }\r\n }\r\n }\r\n\r\n static template() {\r\n return `\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n`;\r\n }\r\n\r\n /**\r\n * @returns {Labels}\r\n */\r\n get labels() {\r\n return labels;\r\n }\r\n\r\n /**\r\n * @returns {Labels}\r\n */\r\n static getLabels() {\r\n return labels;\r\n }\r\n\r\n /**\r\n * @param {Object} v\r\n */\r\n static setLabels(v) {\r\n labels = Object.assign(labels, v);\r\n }\r\n\r\n /**\r\n * @returns {Column}\r\n */\r\n get defaultColumn() {\r\n return {\r\n field: \"\",\r\n title: \"\",\r\n width: 0,\r\n class: \"\",\r\n attr: \"\",\r\n hidden: false,\r\n editable: false,\r\n noSort: false,\r\n responsive: 1,\r\n responsiveHidden: false,\r\n format: \"\",\r\n transform: \"\",\r\n };\r\n }\r\n\r\n /**\r\n * @returns {Options}\r\n */\r\n get defaultOptions() {\r\n return {\r\n id: null,\r\n url: null,\r\n perPage: 10,\r\n debug: false,\r\n filter: false,\r\n menu: false,\r\n sort: false,\r\n server: false,\r\n serverParams: {\r\n start: \"start\",\r\n length: \"length\",\r\n search: \"search\",\r\n sort: \"sort\",\r\n sortDir: \"sortDir\",\r\n dataKey: \"data\",\r\n metaKey: \"meta\",\r\n metaTotalKey: \"total\",\r\n metaFilteredKey: \"filtered\",\r\n optionsKey: \"options\",\r\n paramsKey: \"params\",\r\n },\r\n defaultSort: \"\",\r\n reorder: false,\r\n dir: \"ltr\",\r\n perPageValues: [10, 25, 50, 100, 250],\r\n hidePerPage: false,\r\n columns: [],\r\n actions: [],\r\n collapseActions: false,\r\n selectable: false,\r\n selectVisibleOnly: true,\r\n defaultPage: 1,\r\n resizable: false,\r\n autosize: true,\r\n expand: false,\r\n autoheight: true,\r\n autohidePager: false,\r\n responsive: false,\r\n responsiveToggle: true,\r\n };\r\n }\r\n\r\n /**\r\n * @param {Plugins} list\r\n */\r\n static registerPlugins(list) {\r\n plugins = list;\r\n }\r\n\r\n /**\r\n * @param {String} plugin\r\n */\r\n static unregisterPlugins(plugin = null) {\r\n if (plugin === null) {\r\n plugins = {};\r\n } else {\r\n delete plugins[plugin];\r\n }\r\n }\r\n\r\n /**\r\n * @returns {Plugins}\r\n */\r\n static registeredPlugins() {\r\n return plugins;\r\n }\r\n\r\n /**\r\n * @param {Object|Array} columns\r\n * @returns {Column[]}\r\n */\r\n convertColumns(columns) {\r\n let cols = [];\r\n // Convert key:value objects to actual columns\r\n if (typeof columns === \"object\" && !Array.isArray(columns)) {\r\n Object.keys(columns).forEach((key) => {\r\n let col = Object.assign({}, this.defaultColumn);\r\n col.title = columns[key];\r\n col.field = key;\r\n cols.push(col);\r\n });\r\n } else {\r\n columns.forEach((item) => {\r\n let col = Object.assign({}, this.defaultColumn);\r\n if (typeof item === \"string\") {\r\n col.title = item;\r\n col.field = item;\r\n } else if (typeof item === \"object\") {\r\n col = Object.assign(col, item);\r\n if (!col.field) {\r\n console.error(\"Invalid column definition\", item);\r\n }\r\n if (!col.title) {\r\n col.title = col.field;\r\n }\r\n } else {\r\n console.error(\"Column definition must be a string or an object\");\r\n }\r\n cols.push(col);\r\n });\r\n }\r\n return cols;\r\n }\r\n\r\n /**\r\n * @link https://gist.github.com/WebReflection/ec9f6687842aa385477c4afca625bbf4#reflected-dom-attributes\r\n * @returns {Array}\r\n */\r\n static get observedAttributes() {\r\n return [\r\n \"page\",\r\n \"data-filter\",\r\n \"data-sort\",\r\n \"data-debug\",\r\n \"data-reorder\",\r\n \"data-menu\",\r\n \"data-selectable\",\r\n \"data-url\",\r\n \"data-per-page\",\r\n \"data-responsive\",\r\n ];\r\n }\r\n\r\n get transformAttributes() {\r\n return {\r\n columns: (v) => this.convertColumns(convertArray(v)),\r\n actions: (v) => convertArray(v),\r\n defaultPage: (v) => parseInt(v),\r\n perPage: (v) => parseInt(v),\r\n };\r\n }\r\n\r\n get page() {\r\n return parseInt(this.getAttribute(\"page\"));\r\n }\r\n\r\n set page(val) {\r\n setAttribute(this, \"page\", this.constrainPageValue(val));\r\n }\r\n\r\n urlChanged() {\r\n this.loadData().then(() => {\r\n this.configureUi();\r\n });\r\n }\r\n\r\n constrainPageValue(v) {\r\n if (this.pages < v) {\r\n v = this.pages;\r\n }\r\n if (v < 1 || !v) {\r\n v = 1;\r\n }\r\n return v;\r\n }\r\n\r\n fixPage() {\r\n this.pages = this.totalPages();\r\n this.page = this.constrainPageValue(this.page);\r\n\r\n // Show current page in input\r\n setAttribute(this.inputPage, \"max\", this.pages);\r\n this.inputPage.value = \"\" + this.page;\r\n this.inputPage.disabled = this.pages < 2;\r\n }\r\n\r\n pageChanged() {\r\n this.reload();\r\n }\r\n\r\n responsiveChanged() {\r\n if (!this.plugins.ResponsiveGrid) {\r\n return;\r\n }\r\n if (this.options.responsive) {\r\n this.plugins.ResponsiveGrid.observe();\r\n } else {\r\n this.plugins.ResponsiveGrid.unobserve();\r\n }\r\n }\r\n\r\n menuChanged() {\r\n this.renderHeader();\r\n }\r\n\r\n /**\r\n * This is the callback for the select control\r\n */\r\n changePerPage() {\r\n this.options.perPage = parseInt(this.selectPerPage.options[this.selectPerPage.selectedIndex].value);\r\n this.perPageChanged();\r\n }\r\n\r\n /**\r\n * This is the actual event triggered on attribute change\r\n */\r\n perPageChanged() {\r\n // Refresh UI\r\n if (this.options.perPage !== parseInt(this.selectPerPage.options[this.selectPerPage.selectedIndex].value)) {\r\n this.perPageValuesChanged();\r\n }\r\n // Make sure current page is still valid\r\n let updatePage = this.page;\r\n while (updatePage > 1 && this.page * this.options.perPage > this.totalRecords()) {\r\n updatePage--;\r\n }\r\n if (updatePage != this.page) {\r\n // Triggers pageChanged, which will trigger reload\r\n this.page = updatePage;\r\n } else {\r\n // Simply reload current page\r\n this.reload(() => {\r\n // Preserve distance between top of page and select control if no fixed height\r\n if (!this.plugins.FixedHeight || !this.plugins.FixedHeight.hasFixedHeight) {\r\n this.selectPerPage.scrollIntoView();\r\n }\r\n });\r\n }\r\n }\r\n\r\n dirChanged() {\r\n setAttribute(this, \"dir\", this.options.dir);\r\n }\r\n\r\n defaultSortChanged() {\r\n this.sortChanged();\r\n }\r\n\r\n /**\r\n * Populate the select dropdown according to options\r\n */\r\n perPageValuesChanged() {\r\n if (!this.selectPerPage) {\r\n return;\r\n }\r\n while (this.selectPerPage.lastChild) {\r\n this.selectPerPage.removeChild(this.selectPerPage.lastChild);\r\n }\r\n this.options.perPageValues.forEach((v) => {\r\n addSelectOption(this.selectPerPage, v, v, v === this.options.perPage);\r\n });\r\n }\r\n\r\n _connected() {\r\n /**\r\n * @type {HTMLTableElement}\r\n */\r\n this.table = this.querySelector(\"table\");\r\n /**\r\n * @type {HTMLInputElement}\r\n */\r\n this.btnFirst = this.querySelector(\".dg-btn-first\");\r\n /**\r\n * @type {HTMLInputElement}\r\n */\r\n this.btnPrev = this.querySelector(\".dg-btn-prev\");\r\n /**\r\n * @type {HTMLInputElement}\r\n */\r\n this.btnNext = this.querySelector(\".dg-btn-next\");\r\n /**\r\n * @type {HTMLInputElement}\r\n */\r\n this.btnLast = this.querySelector(\".dg-btn-last\");\r\n /**\r\n * @type {HTMLSelectElement}\r\n */\r\n this.selectPerPage = this.querySelector(\".dg-select-per-page\");\r\n /**\r\n * @type {HTMLInputElement}\r\n */\r\n this.inputPage = this.querySelector(\".dg-input-page\");\r\n\r\n this.getFirst = this.getFirst.bind(this);\r\n this.getPrev = this.getPrev.bind(this);\r\n this.getNext = this.getNext.bind(this);\r\n this.getLast = this.getLast.bind(this);\r\n this.changePerPage = this.changePerPage.bind(this);\r\n this.gotoPage = this.gotoPage.bind(this);\r\n\r\n this.btnFirst.addEventListener(\"click\", this.getFirst);\r\n this.btnPrev.addEventListener(\"click\", this.getPrev);\r\n this.btnNext.addEventListener(\"click\", this.getNext);\r\n this.btnLast.addEventListener(\"click\", this.getLast);\r\n this.selectPerPage.addEventListener(\"change\", this.changePerPage);\r\n this.selectPerPage.toggleAttribute(\"hidden\", this.options.hidePerPage);\r\n this.inputPage.addEventListener(\"input\", this.gotoPage);\r\n\r\n Object.values(this.plugins).forEach((plugin) => {\r\n plugin.connected();\r\n });\r\n\r\n // Display even if we don't have data\r\n this.dirChanged();\r\n this.perPageValuesChanged();\r\n\r\n // @ts-ignore\r\n this.loadData().finally(() => {\r\n this.configureUi();\r\n\r\n this.sortChanged();\r\n this.classList.add(\"dg-initialized\"); //acts as a flag to prevent unnecessary server calls down the chain.\r\n\r\n this.filterChanged();\r\n this.reorderChanged();\r\n\r\n this.dirChanged();\r\n this.perPageValuesChanged();\r\n this.pageChanged();\r\n\r\n this.fireEvents = true; // We can now fire attributeChangedCallback events\r\n\r\n this.log(\"initialized\");\r\n });\r\n }\r\n\r\n _disconnected() {\r\n this.btnFirst.removeEventListener(\"click\", this.getFirst);\r\n this.btnPrev.removeEventListener(\"click\", this.getPrev);\r\n this.btnNext.removeEventListener(\"click\", this.getNext);\r\n this.btnLast.removeEventListener(\"click\", this.getLast);\r\n this.selectPerPage.removeEventListener(\"change\", this.changePerPage);\r\n this.inputPage.removeEventListener(\"input\", this.gotoPage);\r\n\r\n Object.values(this.plugins).forEach((plugin) => {\r\n plugin.disconnected();\r\n });\r\n }\r\n\r\n /**\r\n * @param {string} field\r\n * @returns {Column}\r\n */\r\n getCol(field) {\r\n let found = null;\r\n this.options.columns.forEach((col) => {\r\n if (col.field == field) {\r\n found = col;\r\n }\r\n });\r\n return found;\r\n }\r\n\r\n getColProp(field, prop) {\r\n const c = this.getCol(field);\r\n return c ? c[prop] : null;\r\n }\r\n\r\n setColProp(field, prop, val) {\r\n const c = this.getCol(field);\r\n if (c) {\r\n c[prop] = val;\r\n }\r\n }\r\n\r\n visibleColumns() {\r\n return this.options.columns.filter((col) => {\r\n return !col.hidden;\r\n });\r\n }\r\n\r\n hiddenColumns() {\r\n return this.options.columns.filter((col) => {\r\n return col.hidden === true;\r\n });\r\n }\r\n\r\n showColumn(field, render = true) {\r\n this.setColProp(field, \"hidden\", false);\r\n\r\n // We need to render the whole table otherwise layout fixed won't do its job\r\n if (render) this.renderTable();\r\n\r\n dispatch(this, \"columnVisibility\", {\r\n col: field,\r\n visibility: \"visible\",\r\n });\r\n }\r\n\r\n hideColumn(field, render = true) {\r\n this.setColProp(field, \"hidden\", true);\r\n\r\n // We need to render the whole table otherwise layout fixed won't do its job\r\n if (render) this.renderTable();\r\n\r\n dispatch(this, \"columnVisibility\", {\r\n col: field,\r\n visibility: \"hidden\",\r\n });\r\n }\r\n\r\n /**\r\n * Returns the starting index of actual data\r\n * @returns {Number}\r\n */\r\n startColIndex() {\r\n let start = 1;\r\n if (this.options.selectable && this.plugins.SelectableRows) {\r\n start++;\r\n }\r\n if (this.options.responsive && this.plugins.ResponsiveGrid && this.plugins.ResponsiveGrid.hasHiddenColumns()) {\r\n start++;\r\n }\r\n return start;\r\n }\r\n\r\n /**\r\n * @returns {Boolean}\r\n */\r\n isSticky() {\r\n return this.hasAttribute(\"sticky\");\r\n }\r\n\r\n /**\r\n * @param {Boolean} visibleOnly\r\n * @returns {Number}\r\n */\r\n columnsLength(visibleOnly = false) {\r\n let len = 0;\r\n // One column per (visible) column\r\n this.options.columns.forEach((col) => {\r\n if (visibleOnly && col.hidden) {\r\n return;\r\n }\r\n if (!col.attr) {\r\n len++;\r\n }\r\n });\r\n // Add one col for selectable checkbox at the beginning\r\n if (this.options.selectable && this.plugins.SelectableRows) {\r\n len++;\r\n }\r\n // Add one col for actions at the end\r\n if (this.options.actions.length && this.plugins.RowActions) {\r\n len++;\r\n }\r\n // Add one col for the responsive toggle\r\n if (this.options.responsive && this.plugins.ResponsiveGrid && this.plugins.ResponsiveGrid.hasHiddenColumns()) {\r\n len++;\r\n }\r\n return len;\r\n }\r\n\r\n /**\r\n * Global configuration and renderTable\r\n * This should be called after your data has been loaded\r\n */\r\n configureUi() {\r\n setAttribute(this.querySelector(\"table\"), \"aria-rowcount\", this.data.length);\r\n\r\n this.table.style.visibility = \"hidden\";\r\n this.renderTable();\r\n if (this.options.responsive && this.plugins.ResponsiveGrid) {\r\n // Let the observer make the table visible\r\n } else {\r\n this.table.style.visibility = \"visible\";\r\n }\r\n\r\n // Store row height for later usage\r\n if (!this.rowHeight) {\r\n const tr = find(this, \"tbody tr\") || find(this, \"table tr\");\r\n if (tr) {\r\n this.rowHeight = tr.offsetHeight;\r\n }\r\n }\r\n }\r\n\r\n filterChanged() {\r\n const row = this.querySelector(\"thead tr.dg-head-filters\");\r\n if (this.options.filter) {\r\n removeAttribute(row, \"hidden\");\r\n } else {\r\n this.clearFilters();\r\n setAttribute(row, \"hidden\", \"\");\r\n }\r\n }\r\n\r\n reorderChanged() {\r\n const headers = findAll(this, \"thead tr.dg-head-columns th\");\r\n headers.forEach((th) => {\r\n if (th.classList.contains(\"dg-selectable\") || th.classList.contains(\"dg-actions\")) {\r\n return;\r\n }\r\n if (this.options.reorder && this.plugins.DraggableHeaders) {\r\n th.draggable = true;\r\n } else {\r\n th.removeAttribute(\"draggable\");\r\n }\r\n });\r\n }\r\n\r\n sortChanged() {\r\n this.log(\"toggle sort\");\r\n\r\n this.querySelectorAll(\"thead tr.dg-head-columns th\").forEach((th) => {\r\n const fieldName = th.getAttribute(\"field\");\r\n if (th.classList.contains(\"dg-not-sortable\") || (!this.fireEvents && fieldName == this.options.defaultSort)) {\r\n return;\r\n }\r\n if (this.options.sort && !this.getColProp(fieldName, \"noSort\")) {\r\n setAttribute(th, \"aria-sort\", \"none\");\r\n } else {\r\n removeAttribute(th, \"aria-sort\");\r\n }\r\n });\r\n }\r\n\r\n selectableChanged() {\r\n this.renderTable();\r\n }\r\n\r\n addRow(row) {\r\n if (!Array.isArray(this.originalData)) return;\r\n this.log(\"Add row\");\r\n this.originalData.push(row);\r\n this.data = this.originalData.slice();\r\n this.sortData();\r\n }\r\n\r\n /**\r\n * @param {any} value Value to remove. Defaults to last row.\r\n * @param {String} key The key of the item to remove. Defaults to first column\r\n */\r\n removeRow(value = null, key = null) {\r\n if (!Array.isArray(this.originalData)) return;\r\n if (key === null) {\r\n key = this.options.columns[0][\"field\"];\r\n }\r\n if (value === null) {\r\n value = this.originalData[this.originalData.length - 1][key];\r\n }\r\n this.log(\"Removing \" + key + \":\" + value);\r\n for (let i = 0; i < this.originalData.length; i++) {\r\n if (this.originalData[i][key] === value) {\r\n this.originalData.splice(i, 1);\r\n break;\r\n }\r\n }\r\n this.data = this.originalData.slice();\r\n this.sortData();\r\n }\r\n\r\n /**\r\n * @param {String} key Return a specific key (eg: id) instead of the whole row\r\n * @returns {Array}\r\n */\r\n getSelection(key = null) {\r\n if (!this.plugins.SelectableRows) {\r\n return [];\r\n }\r\n return this.plugins.SelectableRows.getSelection(key);\r\n }\r\n\r\n getData() {\r\n return this.originalData;\r\n }\r\n\r\n clearData() {\r\n // Already empty\r\n if (this.data.length === 0) {\r\n return;\r\n }\r\n this.data = this.originalData = [];\r\n this.renderBody();\r\n }\r\n\r\n /**\r\n * Preloads the data intended to bypass the initial fetch operation, allowing for faster intial page load time.\r\n * Subsequent grid actions after initialization will operate as normal.\r\n * @param {Object} data - an object with meta ({total, filtered, start}) and data (array of objects) properties.\r\n */\r\n preload(data) {\r\n const metaKey = this.options.serverParams.metaKey,\r\n dataKey = this.options.serverParams.dataKey;\r\n if (data?.[metaKey]) this.meta = data[metaKey];\r\n if (data?.[dataKey]) this.data = this.originalData = data[dataKey];\r\n }\r\n\r\n refresh(cb = null) {\r\n this.data = this.originalData = [];\r\n return this.reload(cb);\r\n }\r\n\r\n reload(cb = null) {\r\n this.log(\"reload\");\r\n\r\n // If the data was cleared, we need to render again\r\n const needRender = !this.originalData?.length;\r\n this.fixPage();\r\n // @ts-ignore\r\n this.loadData().finally(() => {\r\n // If we load data from the server, we redraw the table body\r\n // Otherwise, we just need to paginate\r\n this.options.server || needRender ? this.renderBody() : this.paginate();\r\n if (cb) {\r\n cb();\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * @returns {Promise}\r\n */\r\n loadData() {\r\n const flagEmpty = () => !this.data.length && this.classList.add(\"dg-empty\"),\r\n tbody = this.querySelector(\"tbody\");\r\n // We already have some data\r\n if (this.meta || this.originalData || this.classList.contains(\"dg-initialized\")) {\r\n // We don't use server side data\r\n if (!this.options.server || (this.options.server && !this.fireEvents)) {\r\n this.log(\"skip loadData\");\r\n flagEmpty();\r\n return new Promise((resolve) => {\r\n resolve();\r\n });\r\n }\r\n }\r\n this.log(\"loadData\");\r\n this.loading = true;\r\n this.classList.add(\"dg-loading\");\r\n this.classList.remove(\"dg-empty\", \"dg-network-error\");\r\n return (\r\n this.fetchData()\r\n .then((response) => {\r\n // We can get a straight array or an object\r\n if (Array.isArray(response)) {\r\n this.data = response;\r\n } else {\r\n // Object must contain data key\r\n if (!response[this.options.serverParams.dataKey]) {\r\n console.error(\"Invalid response, it should contain a data key with an array or be a plain array\", response);\r\n this.options.url = null;\r\n return;\r\n }\r\n\r\n // We may have a config object\r\n this.options = Object.assign(this.options, response[this.options.serverParams.optionsKey] ?? {});\r\n // It should return meta data (see metaFilteredKey)\r\n this.meta = response[this.options.serverParams.metaKey] ?? {};\r\n this.data = response[this.options.serverParams.dataKey];\r\n }\r\n this.originalData = this.data.slice();\r\n this.fixPage();\r\n\r\n // Make sure we have a proper set of columns\r\n if (this.options.columns.length === 0 && this.originalData.length) {\r\n this.options.columns = this.convertColumns(Object.keys(this.originalData[0]));\r\n } else {\r\n this.options.columns = this.convertColumns(this.options.columns);\r\n }\r\n })\r\n .catch((err) => {\r\n this.log(err);\r\n if (err.message) {\r\n tbody.setAttribute(\"data-empty\", err.message.replace(/^\\s+|\\r\\n|\\n|\\r$/g, \"\"));\r\n }\r\n this.classList.add(\"dg-empty\", \"dg-network-error\");\r\n })\r\n // @ts-ignore\r\n .finally(() => {\r\n flagEmpty();\r\n if (!this.classList.contains(\"dg-network-error\") && tbody.getAttribute(\"data-empty\") != this.labels.noData) {\r\n tbody.setAttribute(\"data-empty\", this.labels.noData);\r\n }\r\n this.classList.remove(\"dg-loading\");\r\n this.loading = false;\r\n })\r\n );\r\n }\r\n\r\n getFirst() {\r\n if (this.loading) {\r\n return;\r\n }\r\n this.page = 1;\r\n }\r\n\r\n getLast() {\r\n if (this.loading) {\r\n return;\r\n }\r\n this.page = this.pages;\r\n }\r\n\r\n getPrev() {\r\n if (this.loading) {\r\n return;\r\n }\r\n this.page = this.page - 1;\r\n }\r\n\r\n getNext() {\r\n if (this.loading) {\r\n return;\r\n }\r\n this.page = this.page + 1;\r\n }\r\n\r\n gotoPage(event) {\r\n if (event.type === \"keypress\") {\r\n const key = event.keyCode || event.key;\r\n if (key === 13 || key === \"Enter\") {\r\n event.preventDefault();\r\n } else {\r\n return;\r\n }\r\n }\r\n this.page = parseInt(this.inputPage.value);\r\n }\r\n\r\n getSort() {\r\n let col = this.querySelector(\"thead tr.dg-head-columns th[aria-sort$='scending']\");\r\n if (col) {\r\n return col.getAttribute(\"field\");\r\n }\r\n return this.options.defaultSort;\r\n }\r\n\r\n getSortDir() {\r\n let col = this.querySelector(\"thead tr.dg-head-columns th[aria-sort$='scending']\");\r\n if (col) {\r\n return col.getAttribute(\"aria-sort\") || \"\";\r\n }\r\n return \"\";\r\n }\r\n\r\n getFilters() {\r\n let filters = [];\r\n const inputs = findAll(this, \"thead tr.dg-head-filters input\");\r\n inputs.forEach((input) => {\r\n filters[input.dataset.name] = input.value;\r\n });\r\n return filters;\r\n }\r\n\r\n clearFilters() {\r\n const inputs = findAll(this, \"thead tr.dg-head-filters input\");\r\n inputs.forEach((input) => {\r\n input.value = \"\";\r\n });\r\n this.filterData();\r\n }\r\n\r\n filterData() {\r\n this.log(\"filter data\");\r\n\r\n this.page = 1;\r\n\r\n if (this.options.server) {\r\n this.reload();\r\n } else {\r\n this.data = this.originalData?.slice() ?? [];\r\n\r\n // Look for rows matching the filters\r\n const inputs = findAll(this, \"thead tr.dg-head-filters input\");\r\n inputs.forEach((input) => {\r\n let value = input.value;\r\n if (value) {\r\n let name = input.dataset.name;\r\n this.data = this.data.filter((item) => {\r\n let str = item[name] + \"\";\r\n return str.toLowerCase().indexOf(value.toLowerCase()) !== -1;\r\n });\r\n }\r\n });\r\n this.pageChanged();\r\n\r\n let col = this.querySelector(\"thead tr.dg-head-columns th[aria-sort$='scending']\");\r\n if (this.options.sort && col) {\r\n this.sortData();\r\n } else {\r\n this.renderBody();\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Data will be sorted then rendered using renderBody\r\n * @param {Element} col The column that was clicked or null to use current sort\r\n */\r\n sortData(col = null) {\r\n this.log(\"sort data\");\r\n\r\n // Early exit\r\n if (col && this.getColProp(col.getAttribute(\"field\"), \"noSort\")) {\r\n this.log(\"sorting prevented because column is not sortable\");\r\n return;\r\n }\r\n if (this.plugins.ColumnResizer && this.plugins.ColumnResizer.isResizing) {\r\n this.log(\"sorting prevented because resizing\");\r\n return;\r\n }\r\n if (this.loading) {\r\n this.log(\"sorting prevented because loading\");\r\n return;\r\n }\r\n\r\n // We clicked on a column, update sort state\r\n if (col !== null) {\r\n // Remove active sort if any\r\n const haveClasses = (c) => [\"dg-selectable\", \"dg-actions\", \"dg-responsive-toggle\"].includes(c);\r\n this.querySelectorAll(\"thead tr:first-child th\").forEach((th) => {\r\n // @ts-ignore\r\n if ([...th.classList].some(haveClasses)) {\r\n return;\r\n }\r\n if (th !== col) {\r\n th.setAttribute(\"aria-sort\", \"none\");\r\n }\r\n });\r\n\r\n // Set tristate col\r\n if (!col.hasAttribute(\"aria-sort\") || col.getAttribute(\"aria-sort\") === \"none\") {\r\n col.setAttribute(\"aria-sort\", \"ascending\");\r\n } else if (col.getAttribute(\"aria-sort\") === \"ascending\") {\r\n col.setAttribute(\"aria-sort\", \"descending\");\r\n } else if (col.getAttribute(\"aria-sort\") === \"descending\") {\r\n col.setAttribute(\"aria-sort\", \"none\");\r\n }\r\n } else {\r\n // Or fetch current sort\r\n col = this.querySelector(\"thead tr.dg-head-columns th[aria-sort$='scending']\");\r\n }\r\n\r\n if (this.options.server) {\r\n // Reload data with updated sort\r\n this.loadData().finally(() => {\r\n this.renderBody();\r\n });\r\n } else {\r\n const sort = col ? col.getAttribute(\"aria-sort\") : \"none\";\r\n if (sort === \"none\") {\r\n let stack = [];\r\n\r\n // Restore order while keeping filters\r\n this.originalData?.some((itemA) => {\r\n this.data.some((itemB) => {\r\n if (JSON.stringify(itemA) === JSON.stringify(itemB)) {\r\n stack.push(itemB);\r\n return true;\r\n }\r\n return false;\r\n });\r\n return stack.length === this.data.length;\r\n });\r\n\r\n this.data = stack;\r\n } else {\r\n const field = col.getAttribute(\"field\");\r\n this.data.sort((a, b) => {\r\n if (!isNaN(a[field]) && !isNaN(b[field])) {\r\n return sort === \"ascending\" ? a[field] - b[field] : b[field] - a[field];\r\n }\r\n const valA = sort === \"ascending\" ? a[field].toUpperCase() : b[field].toUpperCase();\r\n const valB = sort === \"ascending\" ? b[field].toUpperCase() : a[field].toUpperCase();\r\n\r\n switch (true) {\r\n case valA > valB:\r\n return 1;\r\n case valA < valB:\r\n return -1;\r\n case valA === valB:\r\n return 0;\r\n }\r\n });\r\n }\r\n this.renderBody();\r\n }\r\n }\r\n\r\n fetchData() {\r\n if (!this.options.url) {\r\n return new Promise((resolve, reject) => reject(\"No url set\"));\r\n }\r\n\r\n let base = window.location.href;\r\n // Fix trailing slash if no extension is present\r\n if (!base.split(\"/\").pop().includes(\".\")) {\r\n base += base.endsWith(\"/\") ? \"\" : \"/\";\r\n }\r\n let url = new URL(this.options.url, base);\r\n let params = {\r\n r: Date.now(),\r\n };\r\n if (this.options.server) {\r\n // 0 based\r\n params[this.options.serverParams.start] = this.page - 1;\r\n params[this.options.serverParams.length] = this.options.perPage;\r\n if (this.options.filter) params[this.options.serverParams.search] = this.getFilters();\r\n params[this.options.serverParams.sort] = this.getSort() || \"\";\r\n params[this.options.serverParams.sortDir] = this.getSortDir();\r\n\r\n // extra params ?\r\n if (this.meta?.[this.options.serverParams.paramsKey]) {\r\n params = Object.assign(params, this.meta[this.options.serverParams.paramsKey]);\r\n }\r\n }\r\n\r\n appendParamsToUrl(url, params);\r\n\r\n return fetch(url).then((response) => {\r\n if (!response.ok) {\r\n throw new Error(response.statusText || labels.networkError);\r\n }\r\n return response.json();\r\n });\r\n }\r\n\r\n renderTable() {\r\n this.log(\"render table\");\r\n\r\n if (this.options.menu && this.plugins.ContextMenu) {\r\n this.plugins.ContextMenu.createMenu();\r\n }\r\n\r\n let sortedColumn;\r\n\r\n this.renderHeader();\r\n if (this.options.defaultSort) {\r\n // We can have a default sort even with sort disabled\r\n sortedColumn = this.querySelector(\"thead tr.dg-head-columns th[field='\" + this.options.defaultSort + \"']\");\r\n }\r\n\r\n if (sortedColumn) {\r\n this.sortData(sortedColumn);\r\n } else {\r\n this.renderBody();\r\n }\r\n\r\n this.renderFooter();\r\n }\r\n\r\n /**\r\n * Create table header\r\n * - One row for the column headers\r\n * - One row for the filters\r\n */\r\n renderHeader() {\r\n this.log(\"render header\");\r\n\r\n const thead = this.querySelector(\"thead\");\r\n this.createColumnHeaders(thead);\r\n this.createColumnFilters(thead);\r\n\r\n if (this.options.resizable && this.plugins.ColumnResizer) {\r\n this.plugins.ColumnResizer.renderResizer(labels.resizeColumn);\r\n }\r\n\r\n dispatch(this, \"headerRendered\");\r\n }\r\n\r\n renderFooter() {\r\n this.log(\"render footer\");\r\n\r\n const tfoot = this.querySelector(\"tfoot\");\r\n const td = tfoot.querySelector(\"td\");\r\n tfoot.removeAttribute(\"hidden\");\r\n setAttribute(td, \"colspan\", this.columnsLength(true));\r\n tfoot.style.display = \"\";\r\n }\r\n\r\n /**\r\n * Create the column headers based on column definitions and set options\r\n * @param {HTMLTableSectionElement} thead\r\n */\r\n createColumnHeaders(thead) {\r\n // @link https://stackoverflow.com/questions/21064101/understanding-offsetwidth-clientwidth-scrollwidth-and-height-respectively\r\n const availableWidth = this.clientWidth;\r\n const colMaxWidth = Math.round((availableWidth / this.columnsLength(true)) * 2);\r\n\r\n let idx = 0;\r\n let tr;\r\n\r\n // Create row\r\n tr = ce(\"tr\");\r\n this.headerRow = tr;\r\n tr.setAttribute(\"role\", \"row\");\r\n tr.setAttribute(\"aria-rowindex\", \"1\");\r\n tr.setAttribute(\"class\", \"dg-head-columns\");\r\n\r\n // We need a real th from the dom to compute the size\r\n let sampleTh = thead.querySelector(\"tr.dg-head-columns th\");\r\n if (!sampleTh) {\r\n sampleTh = ce(\"th\");\r\n thead.querySelector(\"tr\").appendChild(sampleTh);\r\n }\r\n\r\n if (this.options.selectable && this.plugins.SelectableRows) {\r\n this.plugins.SelectableRows.createHeaderCol(tr);\r\n }\r\n if (this.options.responsive && this.plugins.ResponsiveGrid && this.plugins.ResponsiveGrid.hasHiddenColumns()) {\r\n this.plugins.ResponsiveGrid.createHeaderCol(tr);\r\n }\r\n\r\n // Create columns\r\n idx = 0;\r\n let totalWidth = 0;\r\n this.options.columns.forEach((column) => {\r\n if (column.attr) {\r\n return;\r\n }\r\n const colIdx = idx + this.startColIndex();\r\n let th = ce(\"th\");\r\n th.setAttribute(\"scope\", \"col\");\r\n th.setAttribute(\"role\", \"columnheader button\");\r\n th.setAttribute(\"aria-colindex\", \"\" + colIdx);\r\n th.setAttribute(\"id\", randstr(\"dg-col-\"));\r\n if (this.options.sort) {\r\n th.setAttribute(\"aria-sort\", \"none\");\r\n }\r\n th.setAttribute(\"field\", column.field);\r\n if (this.plugins.ResponsiveGrid && this.options.responsive) {\r\n setAttribute(th, \"data-responsive\", column.responsive || \"\");\r\n }\r\n // Make sure the header fits (+ add some room for sort icon if necessary)\r\n const computedWidth = getTextWidth(column.title, sampleTh, true) + 20;\r\n th.dataset.minWidth = \"\" + computedWidth;\r\n applyColumnDefinition(th, column);\r\n th.tabIndex = 0;\r\n th.textContent = column.title;\r\n\r\n let w = 0;\r\n // Autosize small based on first/last row ?\r\n // Take into account minWidth of the header and max available size based on col numbers\r\n if (this.options.autosize && this.plugins.AutosizeColumn) {\r\n const colAvailableWidth = Math.min(availableWidth - totalWidth, colMaxWidth);\r\n w = this.plugins.AutosizeColumn.computeSize(th, column, parseInt(th.dataset.minWidth), colAvailableWidth);\r\n } else {\r\n w = Math.max(parseInt(th.dataset.minWidth), parseInt(th.getAttribute(\"width\")));\r\n }\r\n\r\n setAttribute(th, \"width\", w);\r\n if (column.hidden) {\r\n th.setAttribute(\"hidden\", \"\");\r\n } else {\r\n totalWidth += w;\r\n }\r\n\r\n // Reorder columns with drag/drop\r\n if (this.options.reorder && this.plugins.DraggableHeaders) {\r\n this.plugins.DraggableHeaders.makeHeaderDraggable(th);\r\n }\r\n\r\n tr.appendChild(th);\r\n idx++;\r\n });\r\n\r\n // There is too much available width, and we want to avoid fixed layout to split remaining amount\r\n if (totalWidth < availableWidth) {\r\n const visibleCols = findAll(tr, \"th:not([hidden],.dg-not-resizable)\");\r\n if (visibleCols.length) {\r\n const lastCol = visibleCols[visibleCols.length - 1];\r\n removeAttribute(lastCol, \"width\");\r\n }\r\n }\r\n\r\n // Actions\r\n if (this.options.actions.length && this.plugins.RowActions) {\r\n this.plugins.RowActions.makeActionHeader(tr);\r\n }\r\n\r\n thead.replaceChild(tr, thead.querySelector(\"tr.dg-head-columns\"));\r\n\r\n // Once columns are inserted, we have an actual dom to query\r\n if (thead.offsetWidth > availableWidth) {\r\n this.log(`adjust width to fix size, ${thead.offsetWidth} > ${availableWidth}`);\r\n const scrollbarWidth = this.offsetWidth - this.clientWidth;\r\n let diff = thead.offsetWidth - availableWidth - scrollbarWidth;\r\n if (this.options.responsive && this.plugins.ResponsiveGrid) {\r\n diff += scrollbarWidth;\r\n }\r\n // Remove diff for columns that can afford it\r\n const thWithWidth = findAll(tr, \"th[width]\");\r\n thWithWidth.forEach((th) => {\r\n if (hasClass(th, \"dg-not-resizable\")) {\r\n return;\r\n }\r\n if (diff <= 0) {\r\n return;\r\n }\r\n const actualWidth = parseInt(th.getAttribute(\"width\"));\r\n const minWidth = th.dataset.minWidth ? parseInt(th.dataset.minWidth) : 0;\r\n if (actualWidth > minWidth) {\r\n let newWidth = actualWidth - diff;\r\n if (newWidth < minWidth) {\r\n newWidth = minWidth;\r\n }\r\n diff -= actualWidth - newWidth;\r\n setAttribute(th, \"width\", newWidth);\r\n }\r\n });\r\n }\r\n\r\n // Context menu\r\n if (this.options.menu && this.plugins.ContextMenu) {\r\n this.plugins.ContextMenu.attachContextMenu();\r\n }\r\n\r\n // Sort col on click\r\n tr.querySelectorAll(\"[aria-sort]\").forEach((sortableRow) => {\r\n sortableRow.addEventListener(\"click\", () => this.sortData(sortableRow));\r\n });\r\n\r\n setAttribute(this.querySelector(\"table\"), \"aria-colcount\", this.columnsLength(true));\r\n }\r\n\r\n createColumnFilters(thead) {\r\n let idx = 0;\r\n let tr;\r\n\r\n // Create row for filters\r\n tr = ce(\"tr\");\r\n this.filterRow = tr;\r\n tr.setAttribute(\"role\", \"row\");\r\n tr.setAttribute(\"aria-rowindex\", \"2\");\r\n tr.setAttribute(\"class\", \"dg-head-filters\");\r\n if (!this.options.filter) {\r\n tr.setAttribute(\"hidden\", \"\");\r\n }\r\n\r\n if (this.options.selectable && this.plugins.SelectableRows) {\r\n this.plugins.SelectableRows.createFilterCol(tr);\r\n }\r\n if (this.options.responsive && this.plugins.ResponsiveGrid && this.plugins.ResponsiveGrid.hasHiddenColumns()) {\r\n this.plugins.ResponsiveGrid.createFilterCol(tr);\r\n }\r\n\r\n this.options.columns.forEach((column) => {\r\n if (column.attr) {\r\n return;\r\n }\r\n const colIdx = idx + this.startColIndex();\r\n let relatedTh = thead.querySelector(\"tr.dg-head-columns th[aria-colindex='\" + colIdx + \"']\");\r\n if (!relatedTh) {\r\n console.warn(\"Related th not found\", colIdx);\r\n return;\r\n }\r\n let th = ce(\"th\");\r\n th.setAttribute(\"aria-colindex\", \"\" + colIdx);\r\n\r\n let input = ce(\"input\");\r\n input.type = \"text\";\r\n input.inputMode = \"search\";\r\n input.autocomplete = \"off\";\r\n input.spellcheck = false;\r\n // Allows binding filter to this column\r\n input.dataset.name = column.field;\r\n input.id = randstr(\"dg-filter-\");\r\n // Don't use aria-label as it triggers autocomplete\r\n input.setAttribute(\"aria-labelledby\", relatedTh.getAttribute(\"id\"));\r\n if (!this.options.filter) {\r\n th.tabIndex = 0;\r\n } else {\r\n input.tabIndex = 0;\r\n }\r\n\r\n if (column.hidden) {\r\n th.setAttribute(\"hidden\", \"\");\r\n }\r\n\r\n th.appendChild(input);\r\n tr.appendChild(th);\r\n idx++;\r\n });\r\n\r\n // Actions\r\n if (this.options.actions.length && this.plugins.RowActions) {\r\n this.plugins.RowActions.makeActionFilter(tr);\r\n }\r\n\r\n thead.replaceChild(tr, thead.querySelector(\"tr.dg-head-filters\"));\r\n\r\n // Filter content on enter\r\n tr.querySelectorAll(\"input\").forEach((input) => {\r\n input.addEventListener(\"keypress\", (e) => {\r\n const key = e.keyCode || e.key;\r\n if (key === 13 || key === \"Enter\") {\r\n this.filterData.call(this);\r\n }\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Render the data as rows in tbody\r\n * It will call paginate() at the end\r\n */\r\n renderBody() {\r\n this.log(\"render body\");\r\n let tr;\r\n let td;\r\n let idx;\r\n let tbody = ce(\"tbody\");\r\n\r\n this.data.forEach((item, i) => {\r\n tr = ce(\"tr\");\r\n setAttribute(tr, \"role\", \"row\");\r\n setAttribute(tr, \"hidden\", \"\");\r\n setAttribute(tr, \"aria-rowindex\", i + 1);\r\n tr.tabIndex = 0;\r\n\r\n if (this.options.selectable && this.plugins.SelectableRows) {\r\n this.plugins.SelectableRows.createDataCol(tr);\r\n }\r\n if (this.options.responsive && this.plugins.ResponsiveGrid && this.plugins.ResponsiveGrid.hasHiddenColumns()) {\r\n this.plugins.ResponsiveGrid.createDataCol(tr);\r\n }\r\n\r\n // Expandable\r\n if (this.options.expand) {\r\n tr.classList.add(\"dg-expandable\");\r\n\r\n on(tr, \"click\", (ev) => {\r\n if (this.plugins.ResponsiveGrid) {\r\n this.plugins.ResponsiveGrid.blockObserver();\r\n }\r\n toggleClass(ev.currentTarget, \"dg-expanded\");\r\n if (this.plugins.ResponsiveGrid) {\r\n this.plugins.ResponsiveGrid.unblockObserver();\r\n }\r\n });\r\n }\r\n\r\n idx = 0;\r\n this.options.columns.forEach((column) => {\r\n if (!column) {\r\n console.error(\"Empty column found!\", this.options.columns);\r\n }\r\n // It should be applied as an attr of the row\r\n if (column.attr) {\r\n if (item[column.field]) {\r\n // Special case if we try to write over the class attr\r\n if (column.attr === \"class\") {\r\n addClass(tr, item[column.field]);\r\n } else {\r\n tr.setAttribute(column.attr, item[column.field]);\r\n }\r\n }\r\n return;\r\n }\r\n td = ce(\"td\");\r\n td.setAttribute(\"role\", \"gridcell\");\r\n td.setAttribute(\"aria-colindex\", idx + this.startColIndex());\r\n applyColumnDefinition(td, column);\r\n // This is required for pure css responsive layout\r\n td.setAttribute(\"data-name\", column.title);\r\n td.tabIndex = -1;\r\n\r\n // Inline editing ...\r\n if (column.editable && this.plugins.EditableColumn) {\r\n addClass(td, \"dg-editable-col\");\r\n this.plugins.EditableColumn.makeEditableInput(td, column, item, i);\r\n } else {\r\n // ... or formatting\r\n const v = item[column.field] ?? \"\";\r\n let tv;\r\n // TODO: make this modular\r\n switch (column.transform) {\r\n case \"uppercase\":\r\n tv = v.toUpperCase();\r\n break;\r\n case \"lowercase\":\r\n tv = v.toLowerCase();\r\n break;\r\n default:\r\n tv = v;\r\n break;\r\n }\r\n if (column.format) {\r\n // Only use formatting with values or if defaultFormatValue is set\r\n if (column.defaultFormatValue != undefined && (tv === \"\" || tv === null)) {\r\n tv = column.defaultFormatValue + \"\";\r\n }\r\n if (typeof column.format === \"string\" && tv) {\r\n td.innerHTML = interpolate(\r\n // @ts-ignore\r\n column.format,\r\n Object.assign(\r\n {\r\n _v: v,\r\n _tv: tv,\r\n },\r\n item\r\n )\r\n );\r\n } else if (column.format instanceof Function) {\r\n const val = column.format.call(this, { column, rowData: item, cellData: tv, td, tr });\r\n td.innerHTML = val || tv || v;\r\n }\r\n } else {\r\n td.textContent = tv;\r\n }\r\n }\r\n tr.appendChild(td);\r\n idx++;\r\n });\r\n\r\n // Actions\r\n if (this.options.actions.length && this.plugins.RowActions) {\r\n this.plugins.RowActions.makeActionRow(tr, item);\r\n }\r\n\r\n tbody.appendChild(tr);\r\n });\r\n\r\n tbody.setAttribute(\"role\", \"rowgroup\");\r\n\r\n // Keep data empty message\r\n const prev = this.querySelector(\"tbody\");\r\n tbody.setAttribute(\"data-empty\", prev.getAttribute(\"data-empty\"));\r\n this.querySelector(\"table\").replaceChild(tbody, prev);\r\n\r\n if (this.plugins.FixedHeight) {\r\n this.plugins.FixedHeight.createFakeRow();\r\n }\r\n\r\n this.paginate();\r\n\r\n if (this.plugins.SelectableRows) {\r\n this.plugins.SelectableRows.shouldSelectAll(tbody);\r\n }\r\n\r\n dispatch(this, \"bodyRendered\");\r\n }\r\n\r\n paginate() {\r\n this.log(\"paginate\");\r\n\r\n const total = this.totalRecords();\r\n const p = this.page || 1;\r\n\r\n let index;\r\n let high = p * this.options.perPage;\r\n let low = high - this.options.perPage + 1;\r\n const tbody = this.querySelector(\"tbody\");\r\n const tfoot = this.querySelector(\"tfoot\");\r\n\r\n if (high > total) {\r\n high = total;\r\n }\r\n if (!total) {\r\n low = 0;\r\n }\r\n\r\n // Display all rows within the set indexes\r\n // For server side paginated grids, we display everything\r\n // since the server is taking care of actual pagination\r\n tbody.querySelectorAll(\"tr\").forEach((tr) => {\r\n if (this.options.server) {\r\n removeAttribute(tr, \"hidden\");\r\n return;\r\n }\r\n index = Number(getAttribute(tr, \"aria-rowindex\"));\r\n if (index > high || index < low) {\r\n setAttribute(tr, \"hidden\", \"\");\r\n } else {\r\n removeAttribute(tr, \"hidden\");\r\n }\r\n });\r\n\r\n if (this.options.selectable && this.plugins.SelectableRows) {\r\n this.plugins.SelectableRows.clearCheckboxes(tbody);\r\n }\r\n\r\n // Store default height and update styles if needed\r\n if (this.plugins.FixedHeight) {\r\n this.plugins.FixedHeight.updateFakeRow();\r\n }\r\n\r\n // Enable/disable buttons if shown\r\n if (this.btnFirst) {\r\n this.btnFirst.disabled = this.page <= 1;\r\n this.btnPrev.disabled = this.page <= 1;\r\n this.btnNext.disabled = this.page >= this.pages;\r\n this.btnLast.disabled = this.page >= this.pages;\r\n }\r\n tfoot.querySelector(\".dg-low\").textContent = low.toString();\r\n tfoot.querySelector(\".dg-high\").textContent = high.toString();\r\n tfoot.querySelector(\".dg-total\").textContent = \"\" + this.totalRecords();\r\n tfoot.toggleAttribute(\"hidden\", this.options.autohidePager && this.options.perPage > this.totalRecords());\r\n }\r\n\r\n /**\r\n * @returns {number}\r\n */\r\n totalPages() {\r\n return Math.ceil(this.totalRecords() / this.options.perPage);\r\n }\r\n\r\n /**\r\n * @returns {number}\r\n */\r\n totalRecords() {\r\n if (this.options.server) {\r\n return this.meta?.[this.options.serverParams.metaFilteredKey] || 0;\r\n }\r\n return this.data.length;\r\n }\r\n}\r\n\r\nexport default DataGrid;\r\n", "/** @typedef {import(\"../data-grid\").default} DataGrid */\r\n\r\nclass BasePlugin {\r\n /**\r\n * @param {DataGrid} grid\r\n */\r\n constructor(grid) {\r\n this.grid = grid;\r\n }\r\n\r\n connected() {}\r\n\r\n disconnected() {}\r\n\r\n /**\r\n * Handle events within the plugin\r\n * @link https://gist.github.com/WebReflection/ec9f6687842aa385477c4afca625bbf4#handling-events\r\n * @param {Event} event\r\n */\r\n handleEvent(event) {\r\n if (this[`on${event.type}`]) {\r\n this[`on${event.type}`](event);\r\n }\r\n }\r\n}\r\n\r\nexport default BasePlugin;\r\n", "import BasePlugin from \"../core/base-plugin.js\";\r\nimport elementOffset from \"../utils/elementOffset.js\";\r\nimport {\r\n addClass,\r\n dispatch,\r\n findAll,\r\n getAttribute,\r\n hasClass,\r\n off,\r\n on,\r\n removeAttribute,\r\n removeClass,\r\n setAttribute,\r\n} from \"../utils/shortcuts.js\";\r\n\r\n/**\r\n * Allows to resize columns\r\n */\r\nclass ColumnResizer extends BasePlugin {\r\n constructor(grid) {\r\n super(grid);\r\n this.isResizing = false;\r\n }\r\n\r\n /**\r\n * @param {String} resizeLabel\r\n */\r\n renderResizer(resizeLabel) {\r\n const grid = this.grid;\r\n const table = grid.table;\r\n const cols = findAll(grid, \"thead tr.dg-head-columns th\");\r\n\r\n cols.forEach((col) => {\r\n if (hasClass(col, \"dg-not-resizable\")) {\r\n return;\r\n }\r\n // Create a resizer element\r\n const resizer = document.createElement(\"div\");\r\n addClass(resizer, \"dg-resizer\");\r\n resizer.ariaLabel = resizeLabel;\r\n\r\n // Add a resizer element to the column\r\n col.appendChild(resizer);\r\n\r\n // Handle resizing\r\n let startX = 0;\r\n let startW = 0;\r\n let remainingSpace = 0;\r\n let max = 0;\r\n\r\n const mouseMoveHandler = (e) => {\r\n if (e.clientX > max) {\r\n return;\r\n }\r\n const newWidth = startW + (e.clientX - startX);\r\n if (col.dataset.minWidth && newWidth > parseInt(col.dataset.minWidth)) {\r\n setAttribute(col, \"width\", newWidth);\r\n }\r\n };\r\n\r\n // When user releases the mouse, remove the existing event listeners\r\n const mouseUpHandler = () => {\r\n grid.log(\"resized column\");\r\n\r\n // Prevent accidental sorting if mouse is not over resize handler\r\n setTimeout(() => {\r\n this.isResizing = false;\r\n }, 0);\r\n\r\n removeClass(resizer, \"dg-resizer-active\");\r\n if (grid.options.reorder) {\r\n col.draggable = true;\r\n }\r\n col.style.overflow = \"hidden\";\r\n\r\n // Remove handlers\r\n off(document, \"mousemove\", mouseMoveHandler);\r\n off(document, \"mouseup\", mouseUpHandler);\r\n\r\n dispatch(grid, \"columnResized\", {\r\n col: getAttribute(col, \"field\"),\r\n width: getAttribute(col, \"width\"),\r\n });\r\n };\r\n\r\n // Otherwise it could sort the col\r\n on(resizer, \"click\", (e) => {\r\n e.stopPropagation();\r\n });\r\n\r\n on(resizer, \"mousedown\", (e) => {\r\n e.stopPropagation();\r\n\r\n this.isResizing = true;\r\n\r\n const target = e.target;\r\n const currentCols = findAll(grid, \"dg-head-columns th\");\r\n const visibleCols = currentCols.filter((col) => {\r\n return !col.hasAttribute(\"hidden\");\r\n });\r\n const columnIndex = visibleCols.findIndex((column) => column == target.parentNode);\r\n grid.log(\"resize column\");\r\n\r\n addClass(resizer, \"dg-resizer-active\");\r\n\r\n // Make sure we don't drag it\r\n removeAttribute(col, \"draggable\");\r\n\r\n // Allow overflow when resizing\r\n col.style.overflow = \"visible\";\r\n\r\n // Show full column height (-1 to avoid scrollbar)\r\n resizer.style.height = table.offsetHeight - 1 + \"px\";\r\n\r\n // Register initial data\r\n startX = e.clientX;\r\n startW = col.offsetWidth;\r\n\r\n remainingSpace = (visibleCols.length - columnIndex) * 30;\r\n max = elementOffset(target).left + grid.offsetWidth - remainingSpace;\r\n\r\n // Remove width from next columns to allow auto layout\r\n setAttribute(col, \"width\", startW);\r\n for (let j = 0; j < visibleCols.length; j++) {\r\n if (j > columnIndex) {\r\n removeAttribute(cols[j], \"width\");\r\n }\r\n }\r\n\r\n // Attach handlers\r\n on(document, \"mousemove\", mouseMoveHandler);\r\n on(document, \"mouseup\", mouseUpHandler);\r\n });\r\n });\r\n }\r\n}\r\n\r\nexport default ColumnResizer;\r\n", "/**\r\n * @param {HTMLElement} el\r\n * @param {String} type\r\n * @param {String} prop\r\n * @returns {HTMLElement}\r\n */\r\nexport default function getParentElement(el, type, prop = \"nodeName\") {\r\n let parent = el;\r\n while (parent[prop] != type) {\r\n parent = parent.parentElement;\r\n }\r\n return parent;\r\n}\r\n", "import BasePlugin from \"../core/base-plugin.js\";\r\nimport getParentElement from \"../utils/getParentElement.js\";\r\nimport { find, off, on, removeAttribute, setAttribute } from \"../utils/shortcuts.js\";\r\n\r\n/**\r\n * Create a right click menu on the headers\r\n */\r\nclass ContextMenu extends BasePlugin {\r\n connected() {\r\n /**\r\n * @type {HTMLUListElement}\r\n */\r\n this.menu = this.grid.querySelector(\".dg-menu\");\r\n }\r\n disconnected() {\r\n if (this.grid.headerRow) {\r\n off(this.grid.headerRow, \"contextmenu\", this);\r\n }\r\n }\r\n\r\n attachContextMenu() {\r\n const grid = this.grid;\r\n on(grid.headerRow, \"contextmenu\", this);\r\n }\r\n\r\n onchange(e) {\r\n const grid = this.grid;\r\n const t = e.target;\r\n const field = t.dataset.name;\r\n if (t.checked) {\r\n grid.showColumn(field);\r\n } else {\r\n // Prevent hidding last\r\n if (grid.visibleColumns().length <= 1) {\r\n // Restore checkbox value\r\n t.checked = true;\r\n return;\r\n }\r\n grid.hideColumn(field);\r\n }\r\n }\r\n\r\n oncontextmenu(e) {\r\n e.preventDefault();\r\n const grid = this.grid;\r\n const target = getParentElement(e.target, \"THEAD\");\r\n const menu = this.menu;\r\n const rect = target.getBoundingClientRect();\r\n let x = e.clientX - rect.left;\r\n const y = e.clientY - rect.top;\r\n\r\n menu.style.top = `${y}px`;\r\n menu.style.left = `${x}px`;\r\n\r\n removeAttribute(menu, \"hidden\");\r\n if (x + 150 > rect.width) {\r\n x -= menu.offsetWidth;\r\n menu.style.left = `${x}px`;\r\n }\r\n\r\n const documentClickHandler = (e) => {\r\n if (!menu.contains(e.target)) {\r\n setAttribute(menu, \"hidden\", \"\");\r\n off(document, \"click\", documentClickHandler);\r\n }\r\n };\r\n on(document, \"click\", documentClickHandler);\r\n }\r\n createMenu() {\r\n const grid = this.grid;\r\n const menu = this.menu;\r\n while (menu.lastChild) {\r\n menu.removeChild(menu.lastChild);\r\n }\r\n menu.addEventListener(\"change\", this);\r\n grid.options.columns.forEach((col) => {\r\n if (col.attr) {\r\n return;\r\n }\r\n const li = document.createElement(\"li\");\r\n const label = document.createElement(\"label\");\r\n const checkbox = document.createElement(\"input\");\r\n setAttribute(checkbox, \"type\", \"checkbox\");\r\n setAttribute(checkbox, \"data-name\", col.field);\r\n if (!col.hidden) {\r\n checkbox.checked = true;\r\n }\r\n const text = document.createTextNode(col.title);\r\n\r\n label.appendChild(checkbox);\r\n label.appendChild(text);\r\n\r\n li.appendChild(label);\r\n menu.appendChild(li);\r\n });\r\n }\r\n}\r\n\r\nexport default ContextMenu;\r\n", "import BasePlugin from \"../core/base-plugin.js\";\r\nimport getParentElement from \"../utils/getParentElement.js\";\r\nimport { dispatch, findAll, getAttribute, on, setAttribute } from \"../utils/shortcuts.js\";\r\n\r\n/**\r\n * Allows to move headers\r\n */\r\nclass DraggableHeaders extends BasePlugin {\r\n /**\r\n * @param {HTMLTableCellElement} th\r\n */\r\n makeHeaderDraggable(th) {\r\n const grid = this.grid;\r\n th.draggable = true;\r\n on(th, \"dragstart\", (e) => {\r\n if (grid.plugins.ColumnResizer && grid.plugins.ColumnResizer.isResizing && e.preventDefault) {\r\n e.preventDefault();\r\n return;\r\n }\r\n grid.log(\"reorder col\");\r\n e.dataTransfer.effectAllowed = \"move\";\r\n e.dataTransfer.setData(\"text/plain\", e.target.getAttribute(\"aria-colindex\"));\r\n });\r\n on(th, \"dragover\", (e) => {\r\n if (e.preventDefault) {\r\n e.preventDefault();\r\n }\r\n e.dataTransfer.dropEffect = \"move\";\r\n return false;\r\n });\r\n on(th, \"drop\", (e) => {\r\n if (e.stopPropagation) {\r\n e.stopPropagation();\r\n }\r\n const t = e.target;\r\n const target = getParentElement(t, \"TH\");\r\n const index = parseInt(e.dataTransfer.getData(\"text/plain\"));\r\n const targetIndex = parseInt(target.getAttribute(\"aria-colindex\"));\r\n\r\n if (index === targetIndex) {\r\n grid.log(\"reordered col stayed the same\");\r\n return;\r\n }\r\n grid.log(\"reordered col from \" + index + \" to \" + targetIndex);\r\n\r\n const offset = grid.startColIndex();\r\n const tmp = grid.options.columns[index - offset];\r\n grid.options.columns[index - offset] = grid.options.columns[targetIndex - offset];\r\n grid.options.columns[targetIndex - offset] = tmp;\r\n\r\n const swapNodes = (selector, el1) => {\r\n const rowIndex = el1.parentNode.getAttribute(\"aria-rowindex\");\r\n const el2 = grid.querySelector(selector + \" tr[aria-rowindex='\" + rowIndex + \"'] [aria-colindex='\" + targetIndex + \"']\");\r\n setAttribute(el1, \"aria-colindex\", targetIndex);\r\n setAttribute(el2, \"aria-colindex\", index);\r\n const newNode = document.createElement(\"th\");\r\n el1.parentNode.insertBefore(newNode, el1);\r\n el2.parentNode.replaceChild(el1, el2);\r\n newNode.parentNode.replaceChild(el2, newNode);\r\n };\r\n\r\n // Swap all rows in header and body\r\n findAll(grid, \"thead th[aria-colindex='\" + index + \"']\").forEach((el1) => {\r\n swapNodes(\"thead\", el1);\r\n });\r\n findAll(grid, 'tbody td[aria-colindex=\"' + index + '\"]').forEach((el1) => {\r\n swapNodes(\"tbody\", el1);\r\n });\r\n\r\n // Updates the columns\r\n grid.options.columns = findAll(grid, \"thead tr.dg-head-columns th[field]\").map((th) =>\r\n grid.options.columns.find((c) => c.field == getAttribute(th, \"field\"))\r\n );\r\n\r\n dispatch(grid, \"columnReordered\", {\r\n col: tmp.field,\r\n from: index,\r\n to: targetIndex,\r\n });\r\n return false;\r\n });\r\n }\r\n}\r\n\r\nexport default DraggableHeaders;\r\n", "import BasePlugin from \"../core/base-plugin.js\";\r\n\r\n/**\r\n * Allows to paginate with horizontal swipe motions\r\n */\r\nclass TouchSupport extends BasePlugin {\r\n constructor(grid) {\r\n super(grid);\r\n this.touch = null;\r\n }\r\n connected() {\r\n const grid = this.grid;\r\n grid.addEventListener(\"touchstart\", this, { passive: true });\r\n grid.addEventListener(\"touchmove\", this, { passive: true });\r\n }\r\n\r\n disconnected() {\r\n const grid = this.grid;\r\n grid.removeEventListener(\"touchstart\", this);\r\n grid.removeEventListener(\"touchmove\", this);\r\n }\r\n\r\n ontouchstart(e) {\r\n this.touch = e.touches[0];\r\n }\r\n\r\n ontouchmove(e) {\r\n if (!this.touch) {\r\n return;\r\n }\r\n const grid = this.grid;\r\n const xDiff = this.touch.clientX - e.touches[0].clientX;\r\n const yDiff = this.touch.clientY - e.touches[0].clientY;\r\n\r\n if (Math.abs(xDiff) > Math.abs(yDiff)) {\r\n if (xDiff > 0) {\r\n grid.getNext();\r\n } else {\r\n grid.getPrev();\r\n }\r\n }\r\n this.touch = null;\r\n }\r\n}\r\n\r\nexport default TouchSupport;\r\n", "import BasePlugin from \"../core/base-plugin.js\";\r\nimport { dispatch, findAll, hasClass, setAttribute } from \"../utils/shortcuts.js\";\r\n\r\nconst SELECTABLE_CLASS = \"dg-selectable\";\r\nconst SELECT_ALL_CLASS = \"dg-select-all\";\r\nconst CHECKBOX_CLASS = \"form-check-input\"; //bs5\r\n\r\n/**\r\n * Allows to select rows\r\n */\r\nclass SelectableRows extends BasePlugin {\r\n disconnected() {\r\n if (this.selectAll) {\r\n this.selectAll.removeEventListener(\"change\", this);\r\n }\r\n }\r\n\r\n /**\r\n * @param {String} key Return a specific key (eg: id) instead of the whole row\r\n * @returns {Array}\r\n */\r\n getSelection(key = null) {\r\n const grid = this.grid;\r\n let selectedData = [];\r\n\r\n const inputs = findAll(grid, `tbody .${SELECTABLE_CLASS} input:checked`);\r\n inputs.forEach((checkbox) => {\r\n const idx = parseInt(checkbox.dataset.id);\r\n const item = grid.data[idx - 1];\r\n if (!item) {\r\n console.warn(`Item ${idx} not found`);\r\n }\r\n if (key) {\r\n selectedData.push(item[key]);\r\n } else {\r\n selectedData.push(item);\r\n }\r\n });\r\n return selectedData;\r\n }\r\n\r\n /**\r\n * Uncheck box if hidden and visible only\r\n * @param {HTMLTableSectionElement} tbody\r\n */\r\n clearCheckboxes(tbody) {\r\n const grid = this.grid;\r\n if (!grid.options.selectVisibleOnly) {\r\n return;\r\n }\r\n const inputs = findAll(tbody, `tr[hidden] .${SELECTABLE_CLASS} input`);\r\n inputs.forEach((input) => {\r\n input.checked = false;\r\n });\r\n this.selectAll.checked = false;\r\n }\r\n\r\n colIndex() {\r\n return this.grid.startColIndex() - 2;\r\n }\r\n\r\n /**\r\n * @param {HTMLTableRowElement} tr\r\n */\r\n createHeaderCol(tr) {\r\n let th = document.createElement(\"th\");\r\n setAttribute(th, \"scope\", \"col\");\r\n setAttribute(th, \"role\", \"columnheader button\");\r\n setAttribute(th, \"aria-colindex\", this.colIndex());\r\n th.classList.add(...[SELECTABLE_CLASS, \"dg-not-resizable\", \"dg-not-sortable\"]);\r\n th.tabIndex = 0;\r\n\r\n this.selectAll = document.createElement(\"input\");\r\n this.selectAll.type = \"checkbox\";\r\n this.selectAll.classList.add(SELECT_ALL_CLASS);\r\n this.selectAll.classList.add(CHECKBOX_CLASS);\r\n this.selectAll.addEventListener(\"change\", this);\r\n\r\n let label = document.createElement(\"label\");\r\n label.appendChild(this.selectAll);\r\n\r\n th.appendChild(label);\r\n\r\n th.setAttribute(\"width\", \"40\");\r\n tr.appendChild(th);\r\n }\r\n\r\n /**\r\n * @param {HTMLTableRowElement} tr\r\n */\r\n createFilterCol(tr) {\r\n let th = document.createElement(\"th\");\r\n setAttribute(th, \"role\", \"columnheader button\");\r\n setAttribute(th, \"aria-colindex\", this.colIndex());\r\n th.classList.add(SELECTABLE_CLASS);\r\n th.tabIndex = 0;\r\n\r\n tr.appendChild(th);\r\n }\r\n\r\n /**\r\n * Handles the selectAll checkbox when any other .dg-selectable checkbox is checked on table body.\r\n * It should check selectAll if all is checked\r\n * It should uncheck selectAll if any is unchecked\r\n * @param {HTMLTableSectionElement} tbody\r\n */\r\n shouldSelectAll(tbody) {\r\n if (!this.selectAll) {\r\n return;\r\n }\r\n // Delegate listener for change events on input checkboxes\r\n tbody.addEventListener(\"change\", this);\r\n // Make sure state is up to date\r\n tbody.dispatchEvent(new Event(\"change\"));\r\n }\r\n\r\n /**\r\n * @param {HTMLTableRowElement} tr\r\n */\r\n createDataCol(tr) {\r\n // Create col\r\n let td = document.createElement(\"td\");\r\n setAttribute(td, \"role\", \"gridcell button\");\r\n setAttribute(td, \"aria-colindex\", this.colIndex());\r\n td.classList.add(SELECTABLE_CLASS);\r\n\r\n // Create input\r\n let selectOne = document.createElement(\"input\");\r\n // Alias row id for easy retrieval in getSelection\r\n selectOne.dataset.id = tr.getAttribute(\"aria-rowindex\");\r\n selectOne.type = \"checkbox\";\r\n selectOne.classList.add(CHECKBOX_CLASS);\r\n // Label need to take full space thanks to css to make the whole cell clickable\r\n let label = document.createElement(\"label\");\r\n label.classList.add(\"dg-clickable-cell\");\r\n label.appendChild(selectOne);\r\n td.appendChild(label);\r\n\r\n // Prevent unwanted click behaviour on row\r\n label.addEventListener(\"click\", this);\r\n\r\n tr.appendChild(td);\r\n }\r\n\r\n /**\r\n * @param {Event} e\r\n */\r\n onclick(e) {\r\n e.stopPropagation();\r\n }\r\n\r\n /**\r\n * Handle change event on select all or any select checkbox in the table body\r\n * @param {import(\"../utils/shortcuts.js\").FlexibleEvent} e\r\n */\r\n onchange(e) {\r\n const grid = this.grid;\r\n if (hasClass(e.target, SELECT_ALL_CLASS)) {\r\n const visibleOnly = grid.options.selectVisibleOnly;\r\n const inputs = findAll(grid, `tbody .${SELECTABLE_CLASS} input`);\r\n inputs.forEach((cb) => {\r\n if (visibleOnly && !cb.offsetWidth) {\r\n return;\r\n }\r\n cb.checked = this.selectAll.checked;\r\n });\r\n\r\n dispatch(grid, \"rowsSelected\", {\r\n selection: this.getSelection(),\r\n });\r\n } else {\r\n if (!e.target.closest(`.${SELECTABLE_CLASS}`)) {\r\n return;\r\n }\r\n const totalCheckboxes = findAll(grid, `tbody .${SELECTABLE_CLASS} input[type=checkbox]`);\r\n // @ts-ignore\r\n const totalChecked = totalCheckboxes.filter((n) => n.checked);\r\n this.selectAll.checked = totalChecked.length == totalCheckboxes.length;\r\n\r\n dispatch(grid, \"rowsSelected\", {\r\n selection: grid.getSelection(),\r\n });\r\n }\r\n }\r\n}\r\n\r\nexport default SelectableRows;\r\n", "import BasePlugin from \"../core/base-plugin.js\";\r\nimport { setAttribute } from \"../utils/shortcuts.js\";\r\n\r\n/**\r\n * Support for fixed table height\r\n *\r\n * We should add a fake row to push the footer down in case we don't have enough rows\r\n */\r\nclass FixedHeight extends BasePlugin {\r\n constructor(grid) {\r\n super(grid);\r\n\r\n this.hasFixedHeight = false;\r\n // If we have a fixed height, make sure we have overflowY set\r\n if (grid.style.height) {\r\n grid.style.overflowY = \"auto\";\r\n this.hasFixedHeight = true;\r\n }\r\n }\r\n\r\n /**\r\n */\r\n createFakeRow() {\r\n const grid = this.grid;\r\n const tbody = grid.querySelector(\"tbody\");\r\n let tr = document.createElement(\"tr\");\r\n setAttribute(tr, \"role\", \"row\");\r\n setAttribute(tr, \"hidden\", \"\");\r\n tr.classList.add(\"dg-fake-row\");\r\n tr.tabIndex = 0;\r\n tbody.appendChild(tr);\r\n }\r\n\r\n get fakeRow() {\r\n return this.grid.querySelector(\".dg-fake-row\");\r\n }\r\n\r\n /**\r\n * On last page, use a fake row to push footer down\r\n */\r\n updateFakeRow() {\r\n const grid = this.grid;\r\n const fakeRow = this.fakeRow;\r\n if (!fakeRow) {\r\n return;\r\n }\r\n\r\n // We don't need a fake row if we display everything\r\n if (grid.options.perPage > grid.totalRecords()) {\r\n return;\r\n }\r\n // We are not on last page\r\n if (grid.page !== grid.totalPages()) {\r\n return;\r\n }\r\n if (!grid.options.autoheight) {\r\n return;\r\n }\r\n // Find remaining missing height\r\n const max = grid.options.perPage * grid.rowHeight;\r\n const visibleRows = grid.querySelectorAll(\"tbody tr:not([hidden])\").length;\r\n const fakeHeight = visibleRows > 1 ? max - visibleRows * grid.rowHeight : max;\r\n if (fakeHeight > 0) {\r\n setAttribute(fakeRow, \"height\", fakeHeight);\r\n fakeRow.removeAttribute(\"hidden\");\r\n } else {\r\n fakeRow.removeAttribute(\"height\");\r\n }\r\n }\r\n}\r\n\r\nexport default FixedHeight;\r\n", "import BasePlugin from \"../core/base-plugin.js\";\r\nimport getTextWidth from \"../utils/getTextWidth.js\";\r\nimport { getAttribute, hasAttribute, setAttribute } from \"../utils/shortcuts.js\";\r\n\r\n/**\r\n * Allows to resize columns\r\n */\r\nclass AutosizeColumn extends BasePlugin {\r\n /**\r\n * Autosize col based on column data\r\n * @param {HTMLTableCellElement} th\r\n * @param {import(\"../data-grid\").Column} column\r\n * @param {Number} min\r\n * @param {Number} max\r\n * @returns {Number}\r\n */\r\n computeSize(th, column, min, max) {\r\n const grid = this.grid;\r\n if (hasAttribute(th, \"width\")) {\r\n return getAttribute(th, \"width\");\r\n }\r\n if (!grid.data.length) {\r\n return;\r\n }\r\n const firstVal = grid.data[0];\r\n const lastVal = grid.data[grid.data.length - 1];\r\n let v = firstVal[column.field] ? firstVal[column.field].toString() : \"\";\r\n let v2 = lastVal[column.field] ? lastVal[column.field].toString() : \"\";\r\n if (v2.length > v.length) {\r\n v = v2;\r\n }\r\n let width = 0;\r\n if (v.length <= 6) {\r\n width = min;\r\n } else if (v.length > 50) {\r\n width = max;\r\n } else {\r\n // Add some extra room to have some spare space\r\n width = getTextWidth(v + \"0000\", th);\r\n }\r\n if (width > max) {\r\n width = max;\r\n }\r\n if (width < min) {\r\n width = min;\r\n }\r\n setAttribute(th, \"width\", width);\r\n return width;\r\n }\r\n}\r\n\r\nexport default AutosizeColumn;\r\n", "/**\r\n * Define a function that can be happily passed to addEventListener\r\n * @typedef {Function & EventListenerOrEventListenerObject} ExtendedFunction\r\n */\r\n\r\n/**\r\n * @param {Function} handler\r\n * @param {Number} timeout\r\n * @returns {ExtendedFunction}\r\n */\r\nexport default function debounce(handler, timeout = 300) {\r\n let timer = null;\r\n return (...args) => {\r\n clearTimeout(timer);\r\n timer = setTimeout(() => {\r\n timer = null;\r\n handler(...args);\r\n }, timeout);\r\n };\r\n}\r\n", "import BasePlugin from \"../core/base-plugin.js\";\r\nimport debounce from \"../utils/debounce.js\";\r\nimport { addClass, ce, find, findAll, hasClass, insertAfter, removeAttribute, removeClass, setAttribute } from \"../utils/shortcuts.js\";\r\n\r\nconst RESPONSIVE_CLASS = \"dg-responsive\";\r\n\r\nlet obsTo;\r\n\r\n/**\r\n * @param {Array} list\r\n * @returns {Array}\r\n */\r\nfunction sortByPriority(list) {\r\n return list.sort((a, b) => {\r\n const v1 = parseInt(a.dataset.responsive) || 1;\r\n const v2 = parseInt(b.dataset.responsive) || 1;\r\n return v2 - v1;\r\n });\r\n}\r\n\r\n/**\r\n * @type {ResizeObserverCallback}\r\n */\r\n//@ts-ignore\r\nconst callback = debounce((entries) => {\r\n for (const entry of entries) {\r\n /**\r\n * @type {import(\"../data-grid\").default}\r\n */\r\n // @ts-ignore\r\n const grid = entry.target;\r\n const table = grid.table;\r\n if (grid.plugins.ResponsiveGrid.observerBlocked) {\r\n return;\r\n }\r\n // check inlineSize (width) and not blockSize (height)\r\n const contentBoxSize = Array.isArray(entry.contentBoxSize) ? entry.contentBoxSize[0] : entry.contentBoxSize;\r\n const size = parseInt(contentBoxSize.inlineSize);\r\n const tableWidth = table.offsetWidth;\r\n const realTableWidth = findAll(grid.headerRow, \"th\").reduce((result, th) => {\r\n return result + th.offsetWidth;\r\n }, 0);\r\n const diff = (realTableWidth || tableWidth) - size - 1;\r\n const minWidth = 50;\r\n const prevAction = grid.plugins.ResponsiveGrid.prevAction;\r\n // We have an array with the columns to show/hide are in order, most important first\r\n const headerCols = sortByPriority(\r\n findAll(grid.headerRow, \"th[field]\")\r\n .reverse() // Order takes precedence if no priority is set\r\n .filter((col) => {\r\n // Leave out unresponsive columns\r\n return col.dataset.responsive !== \"0\";\r\n })\r\n );\r\n let changed = false;\r\n\r\n grid.log(`table is ${tableWidth}/${realTableWidth} and available size is ${size}. Diff: ${diff}`);\r\n\r\n // The table is too big when diff has a high value, otherwise it will be like -1 or -2\r\n if (diff > 0) {\r\n if (prevAction === \"show\") {\r\n return;\r\n }\r\n grid.plugins.ResponsiveGrid.prevAction = \"hide\";\r\n let remaining = diff;\r\n let cols = headerCols.filter((col) => {\r\n return !col.hasAttribute(\"hidden\") && col.hasAttribute(\"data-responsive\");\r\n });\r\n if (cols.length === 0) {\r\n cols = headerCols.filter((col) => {\r\n return !col.hasAttribute(\"hidden\");\r\n });\r\n // Always keep one column\r\n if (cols.length === 1) {\r\n return;\r\n }\r\n }\r\n cols.forEach((col) => {\r\n if (remaining < 0) {\r\n return;\r\n }\r\n\r\n const colWidth = col.offsetWidth;\r\n const field = col.getAttribute(\"field\");\r\n if (!field) {\r\n return;\r\n }\r\n col.dataset.baseWidth = \"\" + col.offsetWidth;\r\n\r\n grid.hideColumn(field, false);\r\n grid.setColProp(field, \"responsiveHidden\", true);\r\n changed = true;\r\n\r\n remaining -= colWidth;\r\n remaining = Math.round(remaining);\r\n });\r\n } else {\r\n if (prevAction === \"hide\") {\r\n return;\r\n }\r\n grid.plugins.ResponsiveGrid.prevAction = \"show\";\r\n\r\n const requiredWidth =\r\n headerCols\r\n .filter((col) => {\r\n return !col.hasAttribute(\"hidden\");\r\n })\r\n .reduce((result, col) => {\r\n const width = col.dataset.minWidth ? parseInt(col.dataset.minWidth) : col.offsetWidth;\r\n return result + width;\r\n }, 0) + minWidth; // Add an offset so that inserting column is smoother\r\n\r\n // Compute available width to insert columns\r\n let remaining = size - requiredWidth;\r\n // Do we have any hidden column that we can restore ?\r\n headerCols\r\n .slice()\r\n .reverse() // Reverse the array to restore the columns in the proper order\r\n .filter((col) => {\r\n return col.hasAttribute(\"hidden\");\r\n })\r\n .forEach((col) => {\r\n if (remaining < minWidth) {\r\n return;\r\n }\r\n const colWidth = parseInt(col.dataset.minWidth);\r\n\r\n // We need to have enough space to restore it\r\n if (colWidth > remaining) {\r\n remaining = -1; // break loop to keep restoring in order\r\n return;\r\n }\r\n\r\n const field = col.getAttribute(\"field\");\r\n if (!field) {\r\n return;\r\n }\r\n\r\n grid.showColumn(field, false);\r\n grid.setColProp(field, \"responsiveHidden\", false);\r\n changed = true;\r\n\r\n remaining -= colWidth;\r\n remaining = Math.round(remaining);\r\n });\r\n }\r\n\r\n // Check footer\r\n const footer = find(grid.table, \"tfoot\");\r\n const realFooterWidth = findAll(grid.table, \".dg-footer > div\").reduce((result, div) => {\r\n return result + div.offsetWidth;\r\n }, 0);\r\n const availableFooterWidth = footer.offsetWidth - realFooterWidth;\r\n if (realFooterWidth > size) {\r\n addClass(footer, \"dg-footer-compact\");\r\n } else if (availableFooterWidth > 250) {\r\n removeClass(footer, \"dg-footer-compact\");\r\n }\r\n if (changed) {\r\n grid.renderTable();\r\n }\r\n // Prevent resize loop\r\n setTimeout(() => {\r\n grid.plugins.ResponsiveGrid.prevAction = null;\r\n }, 1000);\r\n grid.table.style.visibility = \"visible\";\r\n }\r\n}, 100);\r\nconst resizeObserver = new ResizeObserver(callback);\r\n\r\n/**\r\n * Responsive data grid\r\n */\r\nclass ResponsiveGrid extends BasePlugin {\r\n constructor(grid) {\r\n super(grid);\r\n\r\n this.observerBlocked = false;\r\n this.prevAction = null;\r\n }\r\n\r\n connected() {\r\n if (this.grid.options.responsive) {\r\n this.observe();\r\n }\r\n }\r\n\r\n disconnected() {\r\n this.unobserve();\r\n }\r\n\r\n observe() {\r\n if (!this.grid.options.responsive) {\r\n return;\r\n }\r\n resizeObserver.observe(this.grid);\r\n this.grid.style.display = \"block\"; // Otherwise resize doesn't happen\r\n this.grid.style.overflowX = \"hidden\"; // Prevent scrollbars from appearing\r\n }\r\n\r\n unobserve() {\r\n resizeObserver.unobserve(this.grid);\r\n this.grid.style.display = \"unset\";\r\n this.grid.style.overflowX = \"unset\";\r\n }\r\n\r\n blockObserver() {\r\n this.observerBlocked = true;\r\n if (obsTo) {\r\n clearTimeout(obsTo);\r\n }\r\n }\r\n\r\n unblockObserver() {\r\n obsTo = setTimeout(() => {\r\n this.observerBlocked = false;\r\n }, 200); // more than debounce\r\n }\r\n\r\n /**\r\n * @returns {Boolean}\r\n */\r\n hasHiddenColumns() {\r\n let flag = false;\r\n this.grid.options.columns.forEach((col) => {\r\n if (col.responsiveHidden) {\r\n flag = true;\r\n }\r\n });\r\n return flag;\r\n }\r\n\r\n colIndex() {\r\n return this.grid.startColIndex() - 1;\r\n }\r\n\r\n /**\r\n * @param {HTMLTableRowElement} tr\r\n */\r\n createHeaderCol(tr) {\r\n if (!this.grid.options.responsiveToggle) {\r\n return;\r\n }\r\n let th = ce(\"th\", tr);\r\n setAttribute(th, \"scope\", \"col\");\r\n setAttribute(th, \"role\", \"columnheader button\");\r\n setAttribute(th, \"aria-colindex\", this.colIndex());\r\n setAttribute(th, \"width\", \"40\");\r\n th.classList.add(...[`${RESPONSIVE_CLASS}-toggle`, \"dg-not-resizable\", \"dg-not-sortable\"]);\r\n th.tabIndex = 0;\r\n }\r\n\r\n /**\r\n * @param {HTMLTableRowElement} tr\r\n */\r\n createFilterCol(tr) {\r\n if (!this.grid.options.responsiveToggle) {\r\n return;\r\n }\r\n let th = ce(\"th\", tr);\r\n setAttribute(th, \"role\", \"columnheader button\");\r\n setAttribute(th, \"aria-colindex\", this.colIndex());\r\n th.classList.add(`${RESPONSIVE_CLASS}-toggle`);\r\n th.tabIndex = 0;\r\n }\r\n\r\n /**\r\n * @param {HTMLTableRowElement} tr\r\n */\r\n createDataCol(tr) {\r\n if (!this.grid.options.responsiveToggle) {\r\n return;\r\n }\r\n // Create col\r\n let td = document.createElement(\"td\");\r\n setAttribute(td, \"role\", \"gridcell button\");\r\n setAttribute(td, \"aria-colindex\", this.colIndex());\r\n td.classList.add(`${RESPONSIVE_CLASS}-toggle`);\r\n\r\n // Create icon\r\n td.innerHTML = `
\r\n \r\n \r\n\r\n\r\n \r\n
`;\r\n tr.appendChild(td);\r\n\r\n td.addEventListener(\"click\", this);\r\n td.addEventListener(\"mousedown\", this);\r\n }\r\n\r\n computeLabelWidth() {\r\n let idealWidth = 0;\r\n let consideredCol = 0;\r\n while (idealWidth < 120) {\r\n consideredCol++;\r\n const hCol = find(this.grid, `.dg-head-columns th[aria-colindex=\"${consideredCol}\"]`);\r\n if (hCol) {\r\n idealWidth += hCol.offsetWidth;\r\n } else {\r\n break;\r\n }\r\n }\r\n return idealWidth;\r\n }\r\n\r\n /**\r\n * @param {Event} ev\r\n */\r\n onmousedown(ev) {\r\n // Avoid selection through double click\r\n ev.preventDefault();\r\n }\r\n\r\n /**\r\n * @param {Event} ev\r\n */\r\n onclick(ev) {\r\n // Prevent expandable\r\n ev.stopPropagation();\r\n\r\n // target is the element that triggered the event (e.g., the user clicked on)\r\n // currentTarget is the element that the event listener is attached to.\r\n\r\n /**\r\n * @type {HTMLTableRowElement}\r\n */\r\n //@ts-ignore\r\n const td = ev.currentTarget;\r\n const tr = td.parentElement;\r\n const open = find(td, `.${RESPONSIVE_CLASS}-open`);\r\n const close = find(td, `.${RESPONSIVE_CLASS}-close`);\r\n\r\n this.blockObserver();\r\n\r\n const isExpanded = hasClass(tr, `${RESPONSIVE_CLASS}-expanded`);\r\n if (isExpanded) {\r\n removeClass(tr, `${RESPONSIVE_CLASS}-expanded`);\r\n open.style.display = \"unset\";\r\n close.style.display = \"none\";\r\n\r\n // Move back rows and cleanup row\r\n const childRow = tr.nextElementSibling;\r\n const hiddenCols = findAll(childRow, `.${RESPONSIVE_CLASS}-hidden`);\r\n hiddenCols.forEach((col) => {\r\n // We don't really need to care where we insert them since we are going to redraw anyway\r\n tr.appendChild(col);\r\n setAttribute(col, \"hidden\");\r\n });\r\n\r\n childRow.parentElement.removeChild(childRow);\r\n } else {\r\n addClass(tr, `${RESPONSIVE_CLASS}-expanded`);\r\n open.style.display = \"none\";\r\n close.style.display = \"unset\";\r\n\r\n // Create a child row and move rows into it\r\n const childRow = ce(\"tr\");\r\n insertAfter(childRow, tr);\r\n addClass(childRow, `${RESPONSIVE_CLASS}-child-row`);\r\n\r\n const childRowTd = ce(\"td\", childRow);\r\n setAttribute(childRowTd, \"colspan\", this.grid.columnsLength(true));\r\n\r\n const childTable = ce(\"table\", childRowTd);\r\n addClass(childTable, `${RESPONSIVE_CLASS}-table`);\r\n\r\n const hiddenCols = findAll(tr, `.${RESPONSIVE_CLASS}-hidden`);\r\n const idealWidth = this.computeLabelWidth();\r\n hiddenCols.forEach((col) => {\r\n const childTableRow = ce(\"tr\", childTable);\r\n\r\n // Add label\r\n const label = col.dataset.name;\r\n const labelCol = ce(\"th\", childTableRow);\r\n // It looks much better when aligned with an actual col\r\n labelCol.style.width = `${idealWidth}px`;\r\n labelCol.innerHTML = label;\r\n\r\n // Add actual row\r\n childTableRow.appendChild(col);\r\n removeAttribute(col, \"hidden\");\r\n });\r\n }\r\n\r\n this.unblockObserver();\r\n }\r\n}\r\n\r\nexport default ResponsiveGrid;\r\n", "import BasePlugin from \"../core/base-plugin.js\";\r\nimport interpolate from \"../utils/interpolate.js\";\r\nimport { dispatch, on, setAttribute } from \"../utils/shortcuts.js\";\r\n\r\n/**\r\n * Add action on rows\r\n */\r\nclass RowActions extends BasePlugin {\r\n /**\r\n * @returns {Boolean}\r\n */\r\n hasActions() {\r\n return this.grid.options.actions.length > 0;\r\n }\r\n\r\n /**\r\n *\r\n * @param {HTMLTableRowElement} tr\r\n */\r\n makeActionHeader(tr) {\r\n let actionsTh = document.createElement(\"th\");\r\n setAttribute(actionsTh, \"role\", \"columnheader button\");\r\n setAttribute(actionsTh, \"aria-colindex\", this.grid.columnsLength(true));\r\n actionsTh.classList.add(...[\"dg-actions\", \"dg-not-sortable\", \"dg-not-resizable\", this.actionClass]);\r\n actionsTh.tabIndex = 0;\r\n tr.appendChild(actionsTh);\r\n }\r\n\r\n /**\r\n *\r\n * @param {HTMLTableRowElement} tr\r\n */\r\n makeActionFilter(tr) {\r\n let actionsTh = document.createElement(\"th\");\r\n actionsTh.setAttribute(\"role\", \"columnheader button\");\r\n actionsTh.setAttribute(\"aria-colindex\", \"\" + this.grid.columnsLength(true));\r\n actionsTh.classList.add(...[\"dg-actions\", this.actionClass]);\r\n actionsTh.tabIndex = 0;\r\n tr.appendChild(actionsTh);\r\n }\r\n\r\n /**\r\n * @param {HTMLTableRowElement} tr\r\n * @param {Object} item\r\n */\r\n makeActionRow(tr, item) {\r\n const labels = this.grid.labels;\r\n const td = document.createElement(\"td\");\r\n setAttribute(td, \"role\", \"gridcell\");\r\n setAttribute(td, \"aria-colindex\", this.grid.columnsLength(true));\r\n td.classList.add(...[\"dg-actions\", this.actionClass]);\r\n td.tabIndex = 0;\r\n\r\n // Add menu toggle\r\n let actionsToggle = document.createElement(\"button\");\r\n actionsToggle.classList.add(\"dg-actions-toggle\");\r\n actionsToggle.innerHTML = \"\u2630\";\r\n td.appendChild(actionsToggle);\r\n on(actionsToggle, \"click\", (ev) => {\r\n ev.stopPropagation();\r\n ev.target.parentElement.classList.toggle(\"dg-actions-expand\");\r\n });\r\n\r\n this.grid.options.actions.forEach((action) => {\r\n let button = document.createElement(\"button\");\r\n if (action.html) {\r\n button.innerHTML = action.html;\r\n } else {\r\n button.innerText = action.title ?? action.name;\r\n }\r\n if (action.title) {\r\n button.title = action.title;\r\n }\r\n if (action.url) {\r\n button.type = \"submit\";\r\n button.formAction = interpolate(action.url, item);\r\n }\r\n if (action.class) {\r\n button.classList.add(...action.class.split(\" \"));\r\n }\r\n const actionHandler = (ev) => {\r\n ev.stopPropagation();\r\n if (action.confirm) {\r\n let c = confirm(labels.areYouSure);\r\n if (!c) {\r\n ev.preventDefault();\r\n return;\r\n }\r\n }\r\n dispatch(this.grid, \"action\", {\r\n data: item,\r\n action: action.name,\r\n });\r\n };\r\n button.addEventListener(\"click\", actionHandler);\r\n td.appendChild(button);\r\n\r\n // Row action\r\n if (action.default) {\r\n tr.classList.add(\"dg-actionable\");\r\n tr.addEventListener(\"click\", actionHandler);\r\n }\r\n });\r\n\r\n tr.appendChild(td);\r\n }\r\n\r\n get actionClass() {\r\n if (this.grid.options.actions.length < 3 && !this.grid.options.collapseActions) {\r\n return \"dg-actions-\" + this.grid.options.actions.length;\r\n }\r\n return \"dg-actions-more\";\r\n }\r\n}\r\n\r\nexport default RowActions;\r\n", "import BasePlugin from \"../core/base-plugin.js\";\r\nimport { dispatch } from \"../utils/shortcuts.js\";\r\n\r\n/**\r\n * Make editable inputs in rows\r\n */\r\nclass EditableColumn extends BasePlugin {\r\n /**\r\n *\r\n * @param {HTMLTableCellElement} td\r\n * @param {import(\"../data-grid\").Column} column\r\n * @param {Object} item\r\n * @param {number} i\r\n */\r\n makeEditableInput(td, column, item, i) {\r\n const gridId = this.grid.getAttribute(\"id\");\r\n let input = document.createElement(\"input\");\r\n input.type = column.editableType || \"text\";\r\n if (input.type == \"email\") {\r\n input.inputMode = \"email\";\r\n }\r\n if (input.type == \"decimal\") {\r\n input.type = \"text\";\r\n input.inputMode = \"decimal\";\r\n }\r\n input.autocomplete = \"off\";\r\n input.spellcheck = false;\r\n input.tabIndex = 0;\r\n input.classList.add(\"dg-editable\");\r\n input.name = gridId.replace(\"-\", \"_\") + \"[\" + (i + 1) + \"]\" + \"[\" + column.field + \"]\";\r\n input.value = item[column.field];\r\n input.dataset.field = column.field;\r\n\r\n // Prevent row action\r\n input.addEventListener(\"click\", (ev) => ev.stopPropagation());\r\n // Enter validates edit\r\n input.addEventListener(\"keypress\", (ev) => {\r\n if (ev.type === \"keypress\") {\r\n const key = ev.keyCode || ev.key;\r\n if (key === 13 || key === \"Enter\") {\r\n input.blur();\r\n ev.preventDefault();\r\n }\r\n }\r\n });\r\n // Save on blur\r\n input.addEventListener(\"blur\", () => {\r\n // Only fire on update\r\n if (input.value == item[input.dataset.field]) {\r\n return;\r\n }\r\n // Update underlying data\r\n item[input.dataset.field] = input.value;\r\n // Notify\r\n dispatch(this.grid, \"edit\", {\r\n data: item,\r\n value: input.value,\r\n });\r\n });\r\n td.appendChild(input);\r\n }\r\n}\r\n\r\nexport default EditableColumn;\r\n", "import DataGrid from \"./src/data-grid.js\";\r\n// Optional plugins\r\nimport ColumnResizer from \"./src/plugins/column-resizer.js\";\r\nimport ContextMenu from \"./src/plugins/context-menu.js\";\r\nimport DraggableHeaders from \"./src/plugins/draggable-headers.js\";\r\nimport TouchSupport from \"./src/plugins/touch-support.js\";\r\nimport SelectableRows from \"./src/plugins/selectable-rows.js\";\r\nimport FixedHeight from \"./src/plugins/fixed-height.js\";\r\nimport AutosizeColumn from \"./src/plugins/autosize-column.js\";\r\nimport ResponsiveGrid from \"./src/plugins/responsive-grid.js\";\r\nimport RowActions from \"./src/plugins/row-actions.js\";\r\nimport EditableColumn from \"./src/plugins/editable-column.js\";\r\n\r\n// Using shorthand property names\r\n// This make them reserved and keys will be preserved\r\n// Actual class names are renamed\r\nDataGrid.registerPlugins({\r\n ColumnResizer,\r\n ContextMenu,\r\n DraggableHeaders,\r\n TouchSupport,\r\n SelectableRows,\r\n FixedHeight,\r\n AutosizeColumn,\r\n ResponsiveGrid,\r\n RowActions,\r\n EditableColumn,\r\n});\r\n\r\n// Prevent errors if included multiple times\r\nif (!customElements.get(\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A;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAGD,IAAI,CAAC,eAAe,IAAI,WAAW,GAAG;AACpC,iBAAe,OAAO,aAAa,iBAAQ;AAC7C;AAEA,IAAOC,qBAAQ;", "names": ["col", "e", "th", "labels", "data_grid_default"] } diff --git a/dist/data-grid.min.css b/dist/data-grid.min.css index e292ca3..1e8c77c 100644 --- a/dist/data-grid.min.css +++ b/dist/data-grid.min.css @@ -1,3 +1,3 @@ -@keyframes dataGridShow{0%{opacity:1}100%{opacity:.5}}data-grid{--padding: 0.5rem;--padding-x: 0.75rem;--padding-y: 0.5rem;--padding-y-header: 0.75rem;--padding-half: calc(var(--padding) / 2);--color-rgb: var(--bs-primary-rgb, 13, 110, 253);--color: rgb(var(--color-rgb));--highlight-color: #fffcee;--header-background: var(--bs-gray-200, #e9ecef);--header-color: var(--bs-dark, #212529);--input-background: var(--bs-body-bg, #ffffff);--input-border-color: var(--bs-border-color, #e9ecef);--btn-background: var(--bs-body-bg, #ffffff);--btn-color: var(--color);--btn-border-color: var(--bs-border-color, #e9ecef);--body-bg: var(--bs-body-bg, #212529);--body-color: var(--bs-body-color, #212529);--icon-scale: 1;--border-radius: 0.25rem;--row-border-color: #f2f2f2;--responsive-width: 60%;--black: var(--bs-black, #000);--white: var(--bs-white, #fff);--gray: var(--bs-gray, #6c757d);--gray-dark: var(--bs-gray-dark, #343a40);--gray-100: var(--bs-gray-100, #f8f9fa);--gray-200: var(--bs-gray-200, #e9ecef);--gray-300: var(--bs-gray-300, #dee2e6);--gray-400: var(--bs-gray-400, #ced4da);--gray-500: var(--bs-gray-500, #adb5bd);--gray-600: var(--bs-gray-600, #6c757d);--gray-700: var(--bs-gray-700, #495057);--gray-800: var(--bs-gray-800, #343a40);--gray-900: var(--bs-gray-900, #212529);display:block;min-height:6rem;position:relative}data-grid{--scroller-color: 0, 0%;--scroller-color-lightness: 80%;--scroller-hover-factor: 0.8;--scroller-thumb: hsl(var(--scroller-color), var(--scroller-color-lightness));--scroller-thumb-hover: hsl(var(--scroller-color), calc(var(--scroller-color-lightness) * var(--scroller-hover-factor)));--scroller-background: transparent;scrollbar-color:var(--scroller-thumb) var(--scroller-background);scrollbar-width:thin}data-grid::-webkit-scrollbar{width:8px;height:8px}data-grid::-webkit-scrollbar-track{background:rgba(0,0,0,0)}data-grid::-webkit-scrollbar-thumb{background:var(--scroller-thumb)}data-grid::-webkit-scrollbar-thumb:hover{background:var(--scroller-thumb-hover)}data-grid img{border:none;height:auto;max-width:100%;vertical-align:middle}data-grid [hidden]{display:none}data-grid table{display:table;table-layout:fixed;width:100%;max-width:100%;white-space:normal;background:var(--header-background)}data-grid thead,data-grid tfoot{background-color:var(--header-background);color:var(--header-color)}data-grid.dg-loading:not(.dg-initialized) thead,data-grid.dg-loading:not(.dg-initialized) tfoot{background:none}data-grid.dg-loading tbody{animation-name:dataGridShow;animation-timing-function:ease-in;animation-fill-mode:forwards;animation-duration:.3s;pointer-events:none}data-grid tr{position:relative}data-grid th,data-grid td{empty-cells:show;padding:var(--padding-y) var(--padding-x);text-align:left}data-grid th[tabindex],data-grid td[tabindex]{outline:none;word-break:normal}data-grid th{font-weight:bold;padding:var(--padding-y-header) var(--padding-x)}data-grid th,data-grid td{position:relative;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap}data-grid th.dg-wrap,data-grid td.dg-wrap{white-space:normal;word-break:break-all}data-grid .dg-expandable{cursor:pointer}data-grid .dg-expandable.dg-expanded td{white-space:normal;word-break:break-all}data-grid .dg-clickable-cell{margin:0;position:absolute;top:0;left:0;width:100%;height:100%;cursor:pointer;display:flex;align-items:center;justify-content:center}data-grid[sticky] table thead,data-grid[sticky] table tfoot{z-index:2;position:sticky;margin:0;border:0}data-grid[sticky] table thead{inset-block-start:-1px}data-grid[sticky] table tfoot{inset-block-end:-1px}data-grid .dg-nav-icon,data-grid .dg-skip-icon{width:22px;height:22px;box-sizing:border-box;position:absolute;display:block;top:50%;left:50%;transform:translate(-50%, -50%) scale(var(--icon-scale, 1))}data-grid .dg-nav-icon:before,data-grid .dg-nav-icon:after,data-grid .dg-skip-icon:before,data-grid .dg-skip-icon:after{content:"";display:block;box-sizing:border-box;position:absolute}data-grid .dg-nav-icon::before{width:0;height:10px;border-top:5px solid rgba(0,0,0,0);border-bottom:5px solid rgba(0,0,0,0);border-left:6px solid;top:6px;left:9px}data-grid .dg-skip-icon::before{width:3px;height:10px;background:currentColor;top:6px;left:14px}data-grid .dg-skip-icon::after{width:0;height:10px;border-top:5px solid rgba(0,0,0,0);border-bottom:5px solid rgba(0,0,0,0);border-left:6px solid;top:6px;left:7px}data-grid .dg-rotate{transform:rotate(-180deg)}data-grid button{background-color:var(--btn-background);border:solid 1px var(--btn-border-color);border-radius:var(--border-radius);color:var(--body-color);height:2rem;margin:0 .2rem;padding:0 .5rem;pointer-events:all;text-align:center;cursor:pointer}data-grid button:hover{opacity:.7}data-grid button:disabled:hover{background-color:inherit;border-color:inherit}data-grid input[type=checkbox]{margin:0}data-grid input:not([type=checkbox]),data-grid select{background-color:var(--input-background, "#fff");color:currentColor;box-sizing:border-box;border:1px solid var(--input-border-color, "#f0f0f0");border-radius:var(--border-radius);height:2rem;margin:0 .2rem;padding:0 var(--padding);max-width:none}data-grid input:not([type=checkbox]):focus,data-grid select:focus,data-grid button:focus{box-shadow:0 0 0 var(--padding-half) rgba(var(--color-rgb), 0.25);outline:0}data-grid input:not([type=checkbox])[disabled],data-grid input:not([type=checkbox]):disabled,data-grid select[disabled],data-grid select:disabled,data-grid button[disabled],data-grid button:disabled{opacity:.35;pointer-events:none}data-grid thead tr:nth-child(2) th{padding:0;background-color:rgba(0,0,0,0)}data-grid thead tr:nth-child(2) th input{width:100%;border-radius:0;margin:0}data-grid thead tr:nth-child(2) th input:focus{box-shadow:inset 0px 0px 0px 1px var(--color)}data-grid tbody td.dg-editable-col{padding:0;height:0}data-grid tbody td input.dg-editable{width:100%;background:rgba(0,0,0,0);border:0;border-radius:0;margin:0;box-shadow:none;height:100%}data-grid tbody td input.dg-editable:focus{box-shadow:inset 0px 0px 0px 1px var(--color)}data-grid.dg-empty tbody{height:4rem;position:relative}data-grid.dg-empty tbody:before{position:absolute;top:50%;left:50%;content:attr(data-empty);transform:translate(-50%, -50%);opacity:.5;font-size:1.5rem;text-align:center;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;width:90%}data-grid.dg-empty.dg-network-error table{color:#842029;background-color:#f8d7da;border:1px solid #f5c2c7}data-grid.dg-empty.dg-network-error tbody{height:8rem}data-grid.dg-empty.dg-network-error tbody:before{font-size:2rem}data-grid.dg-empty.dg-network-error tbody tr:not(.dg-fake-row){display:none}data-grid tbody tr{border-bottom:solid 1px var(--row-border-color)}data-grid tbody tr:nth-child(even){background-color:var(--bs-table-striped-bg, #f8f9fa)}data-grid tbody tr:hover{background-color:var(--highlight-color) !important}data-grid tbody tr:focus{background-color:var(--highlight-color) !important;border-bottom-color:var(--highlight-color) !important;outline:none}data-grid tfoot{min-width:280px}data-grid tfoot td{padding:var(--padding-y-header) var(--padding-x)}data-grid tfoot .dg-page-nav{display:flex;align-items:center;min-width:160px}data-grid tfoot .dg-input-page{width:4rem}data-grid tfoot .dg-footer{display:flex;align-items:center;flex-direction:row;justify-content:space-between}data-grid tfoot .dg-pagination{display:flex;text-align:center}data-grid tfoot .dg-pagination button{position:relative;width:2rem}data-grid tfoot .dg-meta{min-width:160px;text-align:right}data-grid tfoot.dg-footer-compact .dg-meta{display:none}data-grid tfoot.dg-footer-compact .dg-input-page{display:none}data-grid [aria-sort]{cursor:pointer;padding-right:1.5rem}data-grid [aria-sort=none]:after,data-grid [aria-sort=none]:before,data-grid [aria-sort=ascending]:before,data-grid [aria-sort=descending]:after{right:.5rem;top:calc(50% - .5rem);border:solid rgba(0,0,0,0);content:" ";height:0;width:0;position:absolute;border-color:rgba(0,0,0,0);border-width:.25rem;margin-left:-0.25rem}data-grid [aria-sort=none]:before{border-bottom-color:currentColor;opacity:.25;top:calc(50% - .6rem)}data-grid [aria-sort=none]:after{border-top-color:currentColor;opacity:.25;bottom:calc(50% - .5rem);top:auto}data-grid [aria-sort=ascending]:before{border-bottom-color:var(--body-color);opacity:.75}data-grid [aria-sort=descending]:after{border-top-color:var(--body-color);opacity:.75;bottom:calc(50% - .5rem);top:auto}[data-bs-theme=dark] data-grid{--scroller-color-lightness: 20%;--highlight-color: #43423e;--header-background: var(--bs-gray-800, #34373b);--header-color: var(--bs-light, #e9ecef);--body-color: var(--bs-body-color, #494e53);--row-border-color: var(--bs-gray-900, #212325)}[data-bs-theme=dark] data-grid tbody tr:nth-child(even){background-color:var(--bs-table-striped-bg, #2c3034)}data-grid[dir=rtl] th,data-grid[dir=rtl] td{text-align:right}data-grid[dir=rtl] [aria-sort]{padding-left:1rem;padding-right:.5rem}data-grid[dir=rtl] [aria-sort=none]:after,data-grid[dir=rtl] [aria-sort=none]:before,data-grid[dir=rtl] [aria-sort=ascending]:before,data-grid[dir=rtl] [aria-sort=descending]:after{left:.75rem;right:auto}data-grid[dir=rtl] tfoot .dg-meta{text-align:left}data-grid .dg-menu{position:absolute;z-index:3;background:var(--body-bg);list-style:none;max-width:150px;margin:0;padding:var(--padding);box-shadow:0 0 1rem rgba(0,0,0,.25);border-radius:var(--border-radius)}data-grid .dg-menu li{margin:0;padding:0}data-grid .dg-menu label{display:flex;align-items:center;margin-bottom:.25em}data-grid .dg-menu input{margin-right:.5em}data-grid .dg-actions{text-overflow:initial;width:100px;text-align:right;white-space:nowrap !important}data-grid .dg-actions button{margin:0}data-grid .dg-actions button+button{margin-left:.5rem}data-grid .dg-actions .dg-actions-toggle{display:none;width:calc(100px - var(--padding-x)*2)}data-grid .dg-actions.dg-actions-1{width:100%}data-grid .dg-actions.dg-actions-2 button{width:calc(50% - .25rem)}data-grid .dg-actions.dg-actions-more button{display:none}data-grid .dg-actions.dg-actions-more button.dg-actions-toggle{display:inline-block}data-grid .dg-actions.dg-actions-expand{position:absolute;right:0;display:flex;align-items:center;justify-content:flex-end;width:100%;height:100%}data-grid .dg-actions.dg-actions-expand.dg-actions-more{width:100%}data-grid .dg-actions.dg-actions-expand.dg-actions-more button{display:inline-block}data-grid tr.dg-actionable{cursor:pointer}data-grid tr.dg-actionable:hover td{background-color:var(--highlight-color)}data-grid .dg-resizer{position:absolute;top:0;right:0;width:6px;z-index:2;cursor:col-resize;-webkit-user-select:none;-moz-user-select:none;user-select:none}data-grid .dg-resizer:before{content:"";display:block;position:absolute;top:var(--padding-y-header);height:1.5rem;right:0;width:2px;background:var(--body-color);opacity:.2}data-grid .dg-resizer:hover:before{opacity:.6}data-grid .dg-resizer.dg-resizer-active{border-right:1px dashed var(--color)}data-grid .dg-resizer.dg-resizer-active:before{opacity:.6}data-grid .dg-responsive-toggle{padding:0;text-align:center}data-grid .dg-responsive-child-row>td{padding:0}data-grid .dg-responsive-table{table-layout:auto;border:0}data-grid .dg-responsive-table td,data-grid .dg-responsive-table th{white-space:normal}data-grid .dg-responsive-table th{max-width:40%}@media only screen and (max-width: 767px){data-grid[responsive] .dg-resizer{display:none}data-grid[responsive] .dg-meta{display:none}data-grid[responsive] .dg-input-page{display:none}data-grid[responsive] table,data-grid[responsive] tbody,data-grid[responsive] tfoot,data-grid[responsive] th,data-grid[responsive] td,data-grid[responsive] tr:not([hidden]){display:block}data-grid[responsive] thead{display:flex;border-bottom:2px solid var(--header-background)}data-grid[responsive] thead>tr{flex-grow:1}data-grid[responsive] thead th{width:auto}data-grid[responsive] tbody tr{padding:0;border:1px solid var(--header-background)}data-grid[responsive] tbody td{border:none;border-bottom:1px solid var(--row-border-color);position:relative;padding-left:calc(100% - var(--responsive-width) - var(--padding)*2)}data-grid[responsive] tbody td:last-child{border:0}data-grid[responsive] tbody td:before{position:absolute;top:0;left:0;padding:var(--padding);width:calc(100% - var(--responsive-width) - var(--padding)*4);white-space:nowrap;content:attr(data-name);display:block;font-weight:bold;background-color:var(--header-background)}data-grid[responsive] tbody td[role=gridcell]{padding-left:calc(100% - var(--responsive-width) - var(--padding)*4 + .5rem)}data-grid[responsive] .dg-selectable{height:28px;margin:2px 1px 2px}data-grid[responsive] td.dg-selectable::before,data-grid[responsive] td.dg-actions::before{padding:0}data-grid[responsive] td.dg-selectable label{padding:5px}data-grid[responsive] td[role=gridcell]{min-height:35px;width:auto}data-grid[responsive] td[data-name]::before{height:100%}data-grid[responsive] td.dg-actions{padding-left:inherit;width:inherit}data-grid[responsive] .dg-actions button{width:inherit !important}data-grid[responsive] tr.dg-head-columns{padding:0;width:calc(100% - var(--responsive-width) - var(--padding)*4)}data-grid[responsive] tr.dg-head-columns th[role="columnheader button"]{padding:.36em 1.3em .36em .75em}data-grid[responsive] tr.dg-head-filters{background:rgba(0,0,0,0);vertical-align:top;padding:0;width:calc(100% - (100% - var(--responsive-width) - var(--padding)*4))}data-grid[responsive] .dg-head-filters th input:not([type=checkbox],[type=radio]){height:2.25em}data-grid[responsive] .dg-head-filters th.dg-selectable{background:rgba(0,0,0,0)}data-grid[responsive] .dg-head-filters th.dg-selectable label::before{content:"Column Filters"}} +@keyframes dataGridShow{0%{opacity:1}100%{opacity:.5}}data-grid{--padding: 0.5rem;--padding-x: 0.75rem;--padding-y: 0.5rem;--padding-y-header: 0.75rem;--padding-half: calc(var(--padding) / 2);--color-rgb: var(--bs-primary-rgb, 13, 110, 253);--color: rgb(var(--color-rgb));--highlight-color: #fffcee;--header-background: var(--bs-gray-200, #e9ecef);--header-color: var(--bs-dark, #212529);--input-background: var(--bs-body-bg, #ffffff);--input-border-color: var(--bs-border-color, #e9ecef);--btn-background: var(--bs-body-bg, #ffffff);--btn-color: var(--color);--btn-border-color: var(--bs-border-color, #e9ecef);--body-bg: var(--bs-body-bg, #212529);--body-color: var(--bs-body-color, #212529);--icon-scale: 1;--border-radius: 0.25rem;--row-border-color: #f2f2f2;--responsive-width: 60%;--black: var(--bs-black, #000);--white: var(--bs-white, #fff);--gray: var(--bs-gray, #6c757d);--gray-dark: var(--bs-gray-dark, #343a40);--gray-100: var(--bs-gray-100, #f8f9fa);--gray-200: var(--bs-gray-200, #e9ecef);--gray-300: var(--bs-gray-300, #dee2e6);--gray-400: var(--bs-gray-400, #ced4da);--gray-500: var(--bs-gray-500, #adb5bd);--gray-600: var(--bs-gray-600, #6c757d);--gray-700: var(--bs-gray-700, #495057);--gray-800: var(--bs-gray-800, #343a40);--gray-900: var(--bs-gray-900, #212529);display:block;min-height:6rem;position:relative}data-grid{--scroller-color: 0, 0%;--scroller-color-lightness: 80%;--scroller-hover-factor: 0.8;--scroller-thumb: hsl(var(--scroller-color), var(--scroller-color-lightness));--scroller-thumb-hover: hsl(var(--scroller-color), calc(var(--scroller-color-lightness) * var(--scroller-hover-factor)));--scroller-background: transparent;scrollbar-color:var(--scroller-thumb) var(--scroller-background);scrollbar-width:thin}data-grid::-webkit-scrollbar{width:8px;height:8px}data-grid::-webkit-scrollbar-track{background:rgba(0,0,0,0)}data-grid::-webkit-scrollbar-thumb{background:var(--scroller-thumb)}data-grid::-webkit-scrollbar-thumb:hover{background:var(--scroller-thumb-hover)}data-grid img{border:none;height:auto;max-width:100%;vertical-align:middle}data-grid [hidden]{display:none}data-grid table{display:table;table-layout:fixed;width:100%;max-width:100%;white-space:normal;background:var(--header-background)}data-grid thead,data-grid tfoot{background-color:var(--header-background);color:var(--header-color)}data-grid.dg-loading:not(.dg-initialized) thead,data-grid.dg-loading:not(.dg-initialized) tfoot{background:none}data-grid.dg-loading tbody{animation-name:dataGridShow;animation-timing-function:ease-in;animation-fill-mode:forwards;animation-duration:.3s;pointer-events:none}data-grid tr{position:relative}data-grid th,data-grid td{empty-cells:show;padding:var(--padding-y) var(--padding-x);text-align:left}data-grid th[tabindex],data-grid td[tabindex]{outline:none;word-break:normal}data-grid th{font-weight:bold;padding:var(--padding-y-header) var(--padding-x)}data-grid th,data-grid td{position:relative;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap}data-grid th.dg-wrap,data-grid td.dg-wrap{white-space:normal;word-break:break-all}data-grid .dg-expandable{cursor:pointer}data-grid .dg-expandable.dg-expanded td{white-space:normal;word-break:break-all}data-grid .dg-clickable-cell{margin:0;position:absolute;top:0;left:0;width:100%;height:100%;cursor:pointer;display:flex;align-items:center;justify-content:center}data-grid[sticky] table thead,data-grid[sticky] table tfoot{z-index:2;position:sticky;margin:0;border:0}data-grid[sticky] table thead{inset-block-start:-1px}data-grid[sticky] table tfoot{inset-block-end:-1px}data-grid .dg-nav-icon,data-grid .dg-skip-icon{width:22px;height:22px;box-sizing:border-box;position:absolute;display:block;top:50%;left:50%;transform:translate(-50%, -50%) scale(var(--icon-scale, 1))}data-grid .dg-nav-icon:before,data-grid .dg-nav-icon:after,data-grid .dg-skip-icon:before,data-grid .dg-skip-icon:after{content:"";display:block;box-sizing:border-box;position:absolute}data-grid .dg-nav-icon::before{width:0;height:10px;border-top:5px solid rgba(0,0,0,0);border-bottom:5px solid rgba(0,0,0,0);border-left:6px solid;top:6px;left:9px}data-grid .dg-skip-icon::before{width:3px;height:10px;background:currentColor;top:6px;left:14px}data-grid .dg-skip-icon::after{width:0;height:10px;border-top:5px solid rgba(0,0,0,0);border-bottom:5px solid rgba(0,0,0,0);border-left:6px solid;top:6px;left:7px}data-grid .dg-rotate{transform:rotate(-180deg)}data-grid button{background-color:var(--btn-background);border:solid 1px var(--btn-border-color);border-radius:var(--border-radius);color:var(--body-color);height:2rem;margin:0 .2rem;padding:0 .5rem;pointer-events:all;text-align:center;cursor:pointer}data-grid button:hover{opacity:.7}data-grid button:disabled:hover{background-color:inherit;border-color:inherit}data-grid input[type=checkbox]{margin:0}data-grid input:not([type=checkbox]),data-grid select{background-color:var(--input-background, "#fff");color:currentColor;box-sizing:border-box;border:1px solid var(--input-border-color, "#f0f0f0");border-radius:var(--border-radius);height:2rem;margin:0 .2rem;padding:0 var(--padding);max-width:none}data-grid input:not([type=checkbox]):focus,data-grid select:focus,data-grid button:focus{box-shadow:0 0 0 var(--padding-half) rgba(var(--color-rgb), 0.25);outline:0}data-grid input:not([type=checkbox])[disabled],data-grid input:not([type=checkbox]):disabled,data-grid select[disabled],data-grid select:disabled,data-grid button[disabled],data-grid button:disabled{opacity:.35;pointer-events:none}data-grid thead tr:nth-child(2) th{padding:0;background-color:rgba(0,0,0,0)}data-grid thead tr:nth-child(2) th input{width:100%;border-radius:0;margin:0}data-grid thead tr:nth-child(2) th input:focus{box-shadow:inset 0px 0px 0px 1px var(--color)}data-grid tbody td.dg-editable-col{padding:0;height:0}data-grid tbody td input.dg-editable{width:100%;background:rgba(0,0,0,0);border:0;border-radius:0;margin:0;box-shadow:none;height:100%}data-grid tbody td input.dg-editable:focus{box-shadow:inset 0px 0px 0px 1px var(--color)}data-grid.dg-empty tbody{height:4rem;position:relative}data-grid.dg-empty tbody:before{position:absolute;top:50%;left:50%;content:attr(data-empty);transform:translate(-50%, -50%);opacity:.5;font-size:1.5rem;text-align:center;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;width:90%}data-grid.dg-empty tr.dg-fake-row{height:4rem;border:none}data-grid.dg-empty.dg-network-error table{color:#842029;background-color:#f8d7da;border:1px solid #f5c2c7}data-grid.dg-empty.dg-network-error tbody{height:auto}data-grid.dg-empty.dg-network-error tbody:before{font-size:2rem;top:auto;transform:translate(-50%)}data-grid.dg-empty.dg-network-error tbody tr:not(.dg-fake-row){display:none}data-grid.dg-empty:not(.dg-network-error) tbody:before{top:auto;transform:translate(-50%, 30%)}data-grid tbody tr{border-bottom:solid 1px var(--row-border-color)}data-grid tbody tr:nth-child(even){background-color:var(--bs-table-striped-bg, #f8f9fa)}data-grid tbody tr:hover{background-color:var(--highlight-color) !important}data-grid tbody tr:focus{background-color:var(--highlight-color) !important;border-bottom-color:var(--highlight-color) !important;outline:none}data-grid tfoot{min-width:280px}data-grid tfoot td{padding:var(--padding-y-header) var(--padding-x)}data-grid tfoot .dg-page-nav{display:flex;align-items:center;min-width:160px}data-grid tfoot .dg-input-page{width:4rem}data-grid tfoot .dg-footer{display:flex;align-items:center;flex-direction:row;justify-content:space-between}data-grid tfoot .dg-pagination{display:flex;text-align:center}data-grid tfoot .dg-pagination button{position:relative;width:2rem}data-grid tfoot .dg-meta{min-width:160px;text-align:right}data-grid tfoot.dg-footer-compact .dg-meta{display:none}data-grid tfoot.dg-footer-compact .dg-input-page{display:none}data-grid [aria-sort]{cursor:pointer;padding-right:1.5rem}data-grid [aria-sort=none]:after,data-grid [aria-sort=none]:before,data-grid [aria-sort=ascending]:before,data-grid [aria-sort=descending]:after{right:.5rem;top:calc(50% - .5rem);border:solid rgba(0,0,0,0);content:" ";height:0;width:0;position:absolute;border-color:rgba(0,0,0,0);border-width:.25rem;margin-left:-0.25rem}data-grid [aria-sort=none]:before{border-bottom-color:currentColor;opacity:.25;top:calc(50% - .6rem)}data-grid [aria-sort=none]:after{border-top-color:currentColor;opacity:.25;bottom:calc(50% - .5rem);top:auto}data-grid [aria-sort=ascending]:before{border-bottom-color:var(--body-color);opacity:.75}data-grid [aria-sort=descending]:after{border-top-color:var(--body-color);opacity:.75;bottom:calc(50% - .5rem);top:auto}[data-bs-theme=dark] data-grid{--scroller-color-lightness: 20%;--highlight-color: #43423e;--header-background: var(--bs-gray-800, #34373b);--header-color: var(--bs-light, #e9ecef);--body-color: var(--bs-body-color, #494e53);--row-border-color: var(--bs-gray-900, #212325)}[data-bs-theme=dark] data-grid tbody tr:nth-child(even){background-color:var(--bs-table-striped-bg, #2c3034)}data-grid[dir=rtl] th,data-grid[dir=rtl] td{text-align:right}data-grid[dir=rtl] [aria-sort]{padding-left:1rem;padding-right:.5rem}data-grid[dir=rtl] [aria-sort=none]:after,data-grid[dir=rtl] [aria-sort=none]:before,data-grid[dir=rtl] [aria-sort=ascending]:before,data-grid[dir=rtl] [aria-sort=descending]:after{left:.75rem;right:auto}data-grid[dir=rtl] tfoot .dg-meta{text-align:left}data-grid .dg-menu{position:absolute;z-index:3;background:var(--body-bg);list-style:none;max-width:150px;margin:0;padding:var(--padding);box-shadow:0 0 1rem rgba(0,0,0,.25);border-radius:var(--border-radius)}data-grid .dg-menu li{margin:0;padding:0}data-grid .dg-menu label{display:flex;align-items:center;margin-bottom:.25em}data-grid .dg-menu input{margin-right:.5em}data-grid .dg-actions{text-overflow:initial;width:100px;text-align:right;white-space:nowrap !important}data-grid .dg-actions button{margin:0}data-grid .dg-actions button+button{margin-left:.5rem}data-grid .dg-actions .dg-actions-toggle{display:none;width:calc(100px - var(--padding-x)*2)}data-grid .dg-actions.dg-actions-1{width:100%}data-grid .dg-actions.dg-actions-2 button{width:calc(50% - .25rem)}data-grid .dg-actions.dg-actions-more button{display:none}data-grid .dg-actions.dg-actions-more button.dg-actions-toggle{display:inline-block}data-grid .dg-actions.dg-actions-expand{position:absolute;right:0;display:flex;align-items:center;justify-content:flex-end;width:100%;height:100%}data-grid .dg-actions.dg-actions-expand.dg-actions-more{width:100%}data-grid .dg-actions.dg-actions-expand.dg-actions-more button{display:inline-block}data-grid tr.dg-actionable{cursor:pointer}data-grid tr.dg-actionable:hover td{background-color:var(--highlight-color)}data-grid .dg-resizer{position:absolute;top:0;right:0;width:6px;z-index:2;cursor:col-resize;-webkit-user-select:none;-moz-user-select:none;user-select:none}data-grid .dg-resizer:before{content:"";display:block;position:absolute;top:var(--padding-y-header);height:1.5rem;right:0;width:2px;background:var(--body-color);opacity:.2}data-grid .dg-resizer:hover:before{opacity:.6}data-grid .dg-resizer.dg-resizer-active{border-right:1px dashed var(--color)}data-grid .dg-resizer.dg-resizer-active:before{opacity:.6}data-grid .dg-responsive-toggle{padding:0;text-align:center}data-grid .dg-responsive-child-row>td{padding:0}data-grid .dg-responsive-table{table-layout:auto;border:0}data-grid .dg-responsive-table td,data-grid .dg-responsive-table th{white-space:normal}data-grid .dg-responsive-table th{max-width:40%}@media only screen and (max-width: 767px){data-grid[responsive] .dg-resizer{display:none}data-grid[responsive] .dg-meta{display:none}data-grid[responsive] .dg-input-page{display:none}data-grid[responsive] table,data-grid[responsive] tbody,data-grid[responsive] tfoot,data-grid[responsive] th,data-grid[responsive] td,data-grid[responsive] tr:not([hidden]){display:block}data-grid[responsive] thead{display:flex;border-bottom:2px solid var(--header-background)}data-grid[responsive] thead>tr{flex-grow:1}data-grid[responsive] thead th{width:auto}data-grid[responsive] tbody tr{padding:0;border:1px solid var(--header-background)}data-grid[responsive] tbody td{border:none;border-bottom:1px solid var(--row-border-color);position:relative;padding-left:calc(100% - var(--responsive-width) - var(--padding)*2)}data-grid[responsive] tbody td:last-child{border:0}data-grid[responsive] tbody td:before{position:absolute;top:0;left:0;padding:var(--padding);width:calc(100% - var(--responsive-width) - var(--padding)*4);white-space:nowrap;content:attr(data-name);display:block;font-weight:bold;background-color:var(--header-background)}data-grid[responsive] tbody td[role=gridcell]{padding-left:calc(100% - var(--responsive-width) - var(--padding)*4 + .5rem)}data-grid[responsive] .dg-selectable{height:28px;margin:2px 1px 2px}data-grid[responsive] td.dg-selectable::before,data-grid[responsive] td.dg-actions::before{padding:0}data-grid[responsive] td.dg-selectable label{padding:5px}data-grid[responsive] td[role=gridcell]{min-height:35px;width:auto}data-grid[responsive] td[data-name]::before{height:100%}data-grid[responsive] td.dg-actions{padding-left:inherit;width:inherit}data-grid[responsive] .dg-actions button{width:inherit !important}data-grid[responsive] tr.dg-head-columns{padding:0;width:calc(100% - var(--responsive-width) - var(--padding)*4)}data-grid[responsive] tr.dg-head-columns th[role="columnheader button"]{padding:.36em 1.3em .36em .75em}data-grid[responsive] tr.dg-head-filters{background:rgba(0,0,0,0);vertical-align:top;padding:0;width:calc(100% - (100% - var(--responsive-width) - var(--padding)*4))}data-grid[responsive] .dg-head-filters th input:not([type=checkbox],[type=radio]){height:2.25em}data-grid[responsive] .dg-head-filters th.dg-selectable{background:rgba(0,0,0,0)}data-grid[responsive] .dg-head-filters th.dg-selectable label::before{content:"Column Filters"}} -/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3Njc3MvX2NvcmUuc2NzcyIsIi4uL3Njc3MvX3J0bC5zY3NzIiwiLi4vc2Nzcy9fbWVud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UNBLGtCQUFBLENBQ0EsU0FBQSxDQUNBLHNFQUFBLENBR0osa0ZBQ0UsYUFBQSxDQUVGLHdEQUNFLHdCQUFBLENBRUYsc0VBQ0Usd0JBQUEsQ0FBQSIsImZpbGUiOiJkYXRhLWdyaWQubWluLmNzcyJ9 */ \ No newline at end of file diff --git a/dist/data-grid.min.css.map b/dist/data-grid.min.css.map index a9ce5bc..2b3be75 100644 --- a/dist/data-grid.min.css.map +++ b/dist/data-grid.min.css.map @@ -1 +1 @@ -{"version":3,"sourceRoot":"","sources":["../scss/_core.scss","../scss/_rtl.scss","../scss/_menu.scss","../scss/_actions.scss","../scss/_resizer.scss","../scss/_responsive.scss"],"names":[],"mappings":"AAKA,wBACE,GACE,UAGF,KACE,YAIJ,UACE,kBACA,qBACA,oBACA,4BACA,yCACA,iDACA,+BAEA,2BACA,iDACA,wCACA,+CACA,sDACA,6CACA,0BACA,oDACA,sCACA,4CACA,gBACA,yBACA,4BACA,wBAEA,+BACA,+BACA,gCACA,0CACA,wCACA,wCACA,wCACA,wCACA,wCACA,wCACA,wCACA,wCACA,wCAEA,cACA,gBACA,kBAGA,UACE,wBACA,gCACA,6BACA,8EAEA,yHACA,mCACA,iEACA,qBAEA,6BACE,UACA,WAGF,mCACE,yBAGF,mCACE,iCAGF,yCACE,uCAIJ,cACE,YACA,YACA,eACA,sBAGF,mBACE,aAGF,gBACE,cAGA,mBACA,WACA,eACA,mBAEA,oCAGF,gCAEE,0CACA,0BAME,gGAEE,gBAIJ,2BACE,4BACA,kCACA,6BACA,uBACA,oBAIJ,aACE,kBAGF,0BAEE,iBACA,0CACA,gBAEA,8CACE,aACA,kBAIJ,aACE,iBACA,iDAIF,0BAEE,kBACA,gBACA,gBAEA,uBACA,mBAGA,0CACE,mBACA,qBAKJ,yBACE,eAEA,wCACE,mBACA,qBAIJ,6BACE,SACA,kBACA,MACA,OACA,WACA,YACA,eACA,aACA,mBACA,uBAOA,4DAEE,UACA,gBACA,SACA,SAIF,8BACE,uBAGF,8BACE,qBAKJ,+CAEE,WACA,YACA,sBACA,kBACA,cACA,QACA,SACA,4DAEA,wHAEE,WACA,cACA,sBACA,kBAIJ,+BACE,QACA,YACA,mCACA,sCACA,sBACA,QACA,SAIA,gCACE,UACA,YACA,wBACA,QACA,UAGF,+BACE,QACA,YACA,mCACA,sCACA,sBACA,QACA,SAIJ,qBACE,0BAIF,iBACE,uCACA,yCACA,mCACA,wBACA,YACA,eACA,gBACA,mBACA,kBACA,eAEA,uBACE,WAGF,gCACE,yBACA,qBAKJ,+BACE,SAGF,sDAEE,iDACA,mBACA,sBACA,sDACA,mCACA,YACA,eACA,yBACA,eAMA,yFACE,kEACA,UAGF,uMAEE,YACA,oBAKJ,mCACE,UACA,+BAEA,yCACE,WACA,gBACA,SAEA,+CACE,8CAMN,mCACE,UACA,SAGF,qCACE,WACA,yBACA,SACA,gBACA,SACA,gBACA,YAEA,2CACE,8CAMF,yBACE,YACA,kBAEA,gCACE,kBACA,QACA,SACA,yBACA,gCACA,WACA,iBACA,kBACA,mBACA,uBACA,gBACA,UAKF,0CACE,cACA,yBACA,yBAGF,0CACE,YAEA,iDACE,eAGF,+DACE,aAOR,mBAKE,gDAJA,mCACE,qDAKF,yBACE,mDAGF,yBACE,mDACA,sDACA,aAKJ,gBACE,gBAEA,mBACE,iDAGF,6BACE,aACA,mBACA,gBAGF,+BACE,WAGF,2BACE,aACA,mBACA,mBACA,8BAGF,+BACE,aACA,kBAEA,sCAEE,kBACA,WAIJ,yBAEE,gBACA,iBAIA,2CACE,aAGF,iDACE,aAMN,sBACE,eACA,qBAGF,iJAIE,YACA,sBACA,2BACA,YACA,SACA,QACA,kBACA,2BACA,oBACA,qBAIA,kCACE,iCACA,YACA,sBAGF,iCACE,8BACA,YACA,yBACA,SAIJ,uCACE,sCACA,YAGF,uCACE,mCACA,YACA,yBACA,SAIJ,+BACE,gCACA,2BACA,iDACA,yCACA,4CACA,gDAGE,wDACE,qDCzhBF,4CAEE,iBAEF,+BACE,kBACA,oBAEF,qLAIE,YACA,WAEF,kCACE,gBCjBJ,mBACE,kBACA,UACA,0BACA,gBACA,gBACA,SACA,uBACA,oCACA,mCAEA,sBACE,SACA,UAEF,yBACE,aACA,mBACA,oBAEF,yBACE,kBCrBJ,sBACE,sBACA,YACA,iBACA,8BAEA,6BACE,SAEA,oCACE,kBAGJ,yCACE,aACA,uCAEF,mCACE,WAGF,0CACE,yBAEF,6CACE,aAEA,+DACE,qBAGJ,wCACE,kBACA,QACA,aACA,mBACA,yBACA,WACA,YAEF,wDACE,WAEA,+DACE,qBAIN,2BACE,eAEA,oCACE,wCCpDJ,sBACE,kBACA,MACA,QACA,UACA,UACA,kBACA,iBAEA,6BACE,WACA,cACA,kBACA,4BACA,cACA,QACA,UACA,6BACA,WAEF,mCACE,WAEF,wCACE,qCAEA,+CACE,WC3BN,gCACE,UACA,kBAEF,sCACE,UAEF,+BACE,kBACA,SAEA,oEAEE,mBAGF,kCACE,cAMN,0CAGI,kCACE,aAIF,+BACE,aAEF,qCACE,aAIF,6KAME,cAIF,4BACE,aASA,iDAPA,+BACE,YAEF,+BACE,WAQF,+BACE,UACA,0CAEF,+BACE,YACA,gDACA,kBACA,qEAEA,0CACE,SAEF,sCACE,kBACA,MACA,OACA,uBACA,8DACA,mBACA,wBACA,cACA,iBACA,0CAEF,8CACE,6EAMN,qCACE,YACA,mBAIA,2FAEE,UAEF,6CACE,YAEF,wCACE,gBACA,WAEF,4CACE,YAEF,oCACE,qBACA,cAGJ,yCACE,yBAGA,yCACE,UACA,8DAEA,wEACE,gCAGJ,yCACE,yBACA,mBACA,UACA,uEAGJ,kFACE,cAEF,wDACE,yBAEF,sEACE","file":"data-grid.min.css"} \ No newline at end of file +{"version":3,"sourceRoot":"","sources":["../scss/_core.scss","../scss/_rtl.scss","../scss/_menu.scss","../scss/_actions.scss","../scss/_resizer.scss","../scss/_responsive.scss"],"names":[],"mappings":"AAKA,wBACE,GACE,UAGF,KACE,YAIJ,UACE,kBACA,qBACA,oBACA,4BACA,yCACA,iDACA,+BAEA,2BACA,iDACA,wCACA,+CACA,sDACA,6CACA,0BACA,oDACA,sCACA,4CACA,gBACA,yBACA,4BACA,wBAEA,+BACA,+BACA,gCACA,0CACA,wCACA,wCACA,wCACA,wCACA,wCACA,wCACA,wCACA,wCACA,wCAEA,cACA,gBACA,kBAGA,UACE,wBACA,gCACA,6BACA,8EAEA,yHACA,mCACA,iEACA,qBAEA,6BACE,UACA,WAGF,mCACE,yBAGF,mCACE,iCAGF,yCACE,uCAIJ,cACE,YACA,YACA,eACA,sBAGF,mBACE,aAGF,gBACE,cAGA,mBACA,WACA,eACA,mBAEA,oCAGF,gCAEE,0CACA,0BAME,gGAEE,gBAIJ,2BACE,4BACA,kCACA,6BACA,uBACA,oBAIJ,aACE,kBAGF,0BAEE,iBACA,0CACA,gBAEA,8CACE,aACA,kBAIJ,aACE,iBACA,iDAIF,0BAEE,kBACA,gBACA,gBAEA,uBACA,mBAGA,0CACE,mBACA,qBAKJ,yBACE,eAEA,wCACE,mBACA,qBAIJ,6BACE,SACA,kBACA,MACA,OACA,WACA,YACA,eACA,aACA,mBACA,uBAOA,4DAEE,UACA,gBACA,SACA,SAIF,8BACE,uBAGF,8BACE,qBAKJ,+CAEE,WACA,YACA,sBACA,kBACA,cACA,QACA,SACA,4DAEA,wHAEE,WACA,cACA,sBACA,kBAIJ,+BACE,QACA,YACA,mCACA,sCACA,sBACA,QACA,SAIA,gCACE,UACA,YACA,wBACA,QACA,UAGF,+BACE,QACA,YACA,mCACA,sCACA,sBACA,QACA,SAIJ,qBACE,0BAIF,iBACE,uCACA,yCACA,mCACA,wBACA,YACA,eACA,gBACA,mBACA,kBACA,eAEA,uBACE,WAGF,gCACE,yBACA,qBAKJ,+BACE,SAGF,sDAEE,iDACA,mBACA,sBACA,sDACA,mCACA,YACA,eACA,yBACA,eAMA,yFACE,kEACA,UAGF,uMAEE,YACA,oBAKJ,mCACE,UACA,+BAEA,yCACE,WACA,gBACA,SAEA,+CACE,8CAMN,mCACE,UACA,SAGF,qCACE,WACA,yBACA,SACA,gBACA,SACA,gBACA,YAEA,2CACE,8CAMF,yBACE,YACA,kBAEA,gCACE,kBACA,QACA,SACA,yBACA,gCACA,WACA,iBACA,kBACA,mBACA,uBACA,gBACA,UAKF,kCACE,YACA,YAKF,0CACE,cACA,yBACA,yBAGF,0CACE,YAEA,iDACE,eACA,SACA,0BAGF,+DACE,aAOF,uDACE,SACA,+BAOR,mBAKE,gDAJA,mCACE,qDAKF,yBACE,mDAGF,yBACE,mDACA,sDACA,aAKJ,gBACE,gBAEA,mBACE,iDAGF,6BACE,aACA,mBACA,gBAGF,+BACE,WAGF,2BACE,aACA,mBACA,mBACA,8BAGF,+BACE,aACA,kBAEA,sCAEE,kBACA,WAIJ,yBAEE,gBACA,iBAIA,2CACE,aAGF,iDACE,aAMN,sBACE,eACA,qBAGF,iJAIE,YACA,sBACA,2BACA,YACA,SACA,QACA,kBACA,2BACA,oBACA,qBAIA,kCACE,iCACA,YACA,sBAGF,iCACE,8BACA,YACA,yBACA,SAIJ,uCACE,sCACA,YAGF,uCACE,mCACA,YACA,yBACA,SAIJ,+BACE,gCACA,2BACA,iDACA,yCACA,4CACA,gDAGE,wDACE,qDC3iBF,4CAEE,iBAEF,+BACE,kBACA,oBAEF,qLAIE,YACA,WAEF,kCACE,gBCjBJ,mBACE,kBACA,UACA,0BACA,gBACA,gBACA,SACA,uBACA,oCACA,mCAEA,sBACE,SACA,UAEF,yBACE,aACA,mBACA,oBAEF,yBACE,kBCrBJ,sBACE,sBACA,YACA,iBACA,8BAEA,6BACE,SAEA,oCACE,kBAGJ,yCACE,aACA,uCAEF,mCACE,WAGF,0CACE,yBAEF,6CACE,aAEA,+DACE,qBAGJ,wCACE,kBACA,QACA,aACA,mBACA,yBACA,WACA,YAEF,wDACE,WAEA,+DACE,qBAIN,2BACE,eAEA,oCACE,wCCpDJ,sBACE,kBACA,MACA,QACA,UACA,UACA,kBACA,iBAEA,6BACE,WACA,cACA,kBACA,4BACA,cACA,QACA,UACA,6BACA,WAEF,mCACE,WAEF,wCACE,qCAEA,+CACE,WC3BN,gCACE,UACA,kBAEF,sCACE,UAEF,+BACE,kBACA,SAEA,oEAEE,mBAGF,kCACE,cAMN,0CAGI,kCACE,aAIF,+BACE,aAEF,qCACE,aAIF,6KAME,cAIF,4BACE,aASA,iDAPA,+BACE,YAEF,+BACE,WAQF,+BACE,UACA,0CAEF,+BACE,YACA,gDACA,kBACA,qEAEA,0CACE,SAEF,sCACE,kBACA,MACA,OACA,uBACA,8DACA,mBACA,wBACA,cACA,iBACA,0CAEF,8CACE,6EAMN,qCACE,YACA,mBAIA,2FAEE,UAEF,6CACE,YAEF,wCACE,gBACA,WAEF,4CACE,YAEF,oCACE,qBACA,cAGJ,yCACE,yBAGA,yCACE,UACA,8DAEA,wEACE,gCAGJ,yCACE,yBACA,mBACA,UACA,uEAGJ,kFACE,cAEF,wDACE,yBAEF,sEACE","file":"data-grid.min.css"} \ No newline at end of file diff --git a/dist/data-grid.min.js b/dist/data-grid.min.js index 2c8f971..14d384f 100644 --- a/dist/data-grid.min.js +++ b/dist/data-grid.min.js @@ -1,4 +1,4 @@ -function O(n){return n.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(t,e)=>e.toUpperCase())}function V(n){if(n==="true")return!0;if(n==="false")return!1;if(n===""||n==="null")return null;if(n===Number(n).toString())return Number(n);if(n&&["[","{"].includes(n.substring(0,1)))try{return n.indexOf('"')===-1&&(n=n.replace(/'/g,'"')),JSON.parse(decodeURIComponent(n))}catch{return console.error("Failed to parse "+n),{}}return n}var Rt=["scroll","wheel","touchstart","touchmove","touchenter","touchend","touchleave","mouseout","mouseleave","mouseup","mousedown","mousemove","mouseenter","mousewheel","mouseover"];function ct(n){return Rt.includes(n)?{passive:!0}:{}}function k(n,t){return n.getAttribute(t)}function j(n,t){return n.hasAttribute(t)}function d(n,t,e="",i=!1){i&&j(n,t)||n.setAttribute(t,""+e)}function S(n,t){j(n,t)&&n.removeAttribute(t)}function w(n,t,e){n.addEventListener(t,e,ct(t))}function H(n,t,e){n.removeEventListener(t,e,ct(t))}function x(n,t,e={},i=!1){let s={};i&&(s.bubbles=!0),e&&(s.detail=e),n.dispatchEvent(new CustomEvent(t,s))}function $(n,t){return n.classList.contains(t)}function L(n,t){n.classList.add(...t.split(" "))}function F(n,t){n.classList.remove(...t.split(" "))}function ut(n,t){n.classList.toggle(t)}function Dt(n,t=document){return n instanceof HTMLElement?n:t.querySelector(n)}function It(n,t=document){return Array.from(t.querySelectorAll(n))}function W(n,t){return Dt(t,n)}function f(n,t){return It(t,n)}function A(n,t=null){let e=document.createElement(n);return t&&t.appendChild(e),e}function gt(n,t){t.parentNode.insertBefore(n,t.nextSibling)}var U=class extends HTMLElement{constructor(t={}){super(),this.options=Object.assign({},this.defaultOptions,this.normalizedDataset,t),this.log("constructor"),this.fireEvents=!0,this._ready(),this.log("ready")}get defaultOptions(){return{}}getOption(t){return this.options[t]}setOption(t,e){d(this,`data-${t}`,e)}toggleOption(t){d(this,`data-${t}`,!this.getOption(t))}get normalizedDataset(){let t=this.dataset.config?JSON.parse(this.dataset.config):{},e={...this.dataset};for(var i in e)i!="config"&&(e[i]=V(e[i]));return Object.assign(e,t),e}static template(){return""}_ready(){}log(t){this.options.debug&&console.log("["+k(this,"id")+"] "+t)}handleEvent(t){this[`on${t.type}`]&&this[`on${t.type}`](t)}_connected(){}connectedCallback(){setTimeout(()=>{this.log("connectedCallback");let t=document.createElement("template");t.innerHTML=this.constructor.template(),this.appendChild(t.content.cloneNode(!0)),this._connected(),x(this,"connected")},0)}_disconnected(){}disconnectedCallback(){this.log("disconnectedCallback"),this._disconnected(),x(this,"disconnected")}get transformAttributes(){return{}}attributeChangedCallback(t,e,i){if(e===i)return;this.log("attributeChangedCallback: "+t);let s=!1,o=this.transformAttributes[t]??V;t.indexOf("data-")===0&&(t=t.slice(5),s=!0),t=O(t),s?this.options[t]=o(i):this[t]=o(i),this.fireEvents&&this[`${t}Changed`]&&this[`${t}Changed`]()}},pt=U;function X(n,t,e,i=!1){let s=document.createElement("option");s.value=""+t,i&&(s.selected=!0),s.label=e,n.appendChild(s)}function Y(n,t={}){Object.keys(t).forEach(e=>{Array.isArray(t[e])?Object.keys(t[e]).forEach(i=>n.searchParams.append(isNaN(i)?`${e}[${i}]`:e,t[e][i])):n.searchParams.append(e,t[e])})}function K(n){return typeof n=="string"?n[0]==="["?(n.indexOf('"')===-1&&(n=n.replace(/'/g,'"')),JSON.parse(n)):n.split(","):Array.isArray(n)?n:(console.error("Invalid array",n),[])}function J(n){var t=n.getBoundingClientRect(),e=window.pageXOffset||document.documentElement.scrollLeft,i=window.pageYOffset||document.documentElement.scrollTop;return{top:t.top+i,left:t.left+e}}function q(n,t){return n.replace(/\{([^}]+)?\}/g,function(e,i){return t[i]})}function T(n,t=document.body,e=!1){t||(t=document.createElement("div"));let i=window.getComputedStyle(t),s=i.getPropertyValue("font-weight")||"normal",o=i.getPropertyValue("font-size")||"1rem",r=i.getPropertyValue("font-family")||"Arial",l=0;if(e){let u=i.getPropertyValue("padding-left")||"0",g=i.getPropertyValue("padding-right")||"0";l=parseInt(u)+parseInt(g)}let c=(T.canvas||(T.canvas=document.createElement("canvas"))).getContext("2d");c.font=`${s} ${o} ${r}`;let h=c.measureText(n);return parseInt(h.width)+l}function N(n){return Math.random().toString(36).replace("0.",n||"")}var G={},C={itemsPerPage:"Items per page",gotoPage:"Go to page",gotoFirstPage:"Go to first page",gotoPrevPage:"Go to previous page",gotoNextPage:"Go to next page",gotoLastPage:"Go to last page",of:"of",items:"items",resizeColumn:"Resize column",noData:"No data",areYouSure:"Are you sure?",networkError:"Network response error"};function ft(n,t){t.width&&d(n,"width",t.width),t.class&&L(n,t.class),t.hidden&&(d(n,"hidden",""),t.responsiveHidden&&L(n,"dg-responsive-hidden"))}var B=class extends pt{_ready(){d(this,"id",this.options.id??N("el-"),!0),this.data=[],this.originalData,this.options=this.options||this.defaultOptions,this.fireEvents=!1,this.page=this.options.defaultPage||1,this.pages=0,this.meta,this.plugins={};for(let[t,e]of Object.entries(G))this.plugins[t]=new e(this);for(let t of B.observedAttributes)t.indexOf("data-")===0&&d(this,t,this.options[O(t.slice(5))])}static template(){return` +function O(n){return n.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(t,e)=>e.toUpperCase())}function V(n){if(n==="true")return!0;if(n==="false")return!1;if(n===""||n==="null")return null;if(n===Number(n).toString())return Number(n);if(n&&["[","{"].includes(n.substring(0,1)))try{return n.indexOf('"')===-1&&(n=n.replace(/'/g,'"')),JSON.parse(decodeURIComponent(n))}catch{return console.error("Failed to parse "+n),{}}return n}var Rt=["scroll","wheel","touchstart","touchmove","touchenter","touchend","touchleave","mouseout","mouseleave","mouseup","mousedown","mousemove","mouseenter","mousewheel","mouseover"];function ct(n){return Rt.includes(n)?{passive:!0}:{}}function k(n,t){return n.getAttribute(t)}function j(n,t){return n.hasAttribute(t)}function d(n,t,e="",i=!1){i&&j(n,t)||n.setAttribute(t,""+e)}function L(n,t){j(n,t)&&n.removeAttribute(t)}function w(n,t,e){n.addEventListener(t,e,ct(t))}function H(n,t,e){n.removeEventListener(t,e,ct(t))}function x(n,t,e={},i=!1){let s={};i&&(s.bubbles=!0),e&&(s.detail=e),n.dispatchEvent(new CustomEvent(t,s))}function $(n,t){return n.classList.contains(t)}function S(n,t){n.classList.add(...t.split(" "))}function F(n,t){n.classList.remove(...t.split(" "))}function ut(n,t){n.classList.toggle(t)}function Dt(n,t=document){return n instanceof HTMLElement?n:t.querySelector(n)}function It(n,t=document){return Array.from(t.querySelectorAll(n))}function W(n,t){return Dt(t,n)}function f(n,t){return It(t,n)}function A(n,t=null){let e=document.createElement(n);return t&&t.appendChild(e),e}function gt(n,t){t.parentNode.insertBefore(n,t.nextSibling)}var U=class extends HTMLElement{constructor(t={}){super(),this.options=Object.assign({},this.defaultOptions,this.normalizedDataset,t),this.log("constructor"),this.fireEvents=!0,this._ready(),this.log("ready")}get defaultOptions(){return{}}getOption(t){return this.options[t]}setOption(t,e){d(this,`data-${t}`,e)}toggleOption(t){d(this,`data-${t}`,!this.getOption(t))}get normalizedDataset(){let t=this.dataset.config?JSON.parse(this.dataset.config):{},e={...this.dataset};for(var i in e)i!="config"&&(e[i]=V(e[i]));return Object.assign(e,t),e}static template(){return""}_ready(){}log(t){this.options.debug&&console.log("["+k(this,"id")+"] "+t)}handleEvent(t){this[`on${t.type}`]&&this[`on${t.type}`](t)}_connected(){}connectedCallback(){setTimeout(()=>{this.log("connectedCallback");let t=document.createElement("template");t.innerHTML=this.constructor.template(),this.appendChild(t.content.cloneNode(!0)),this._connected(),x(this,"connected")},0)}_disconnected(){}disconnectedCallback(){this.log("disconnectedCallback"),this._disconnected(),x(this,"disconnected")}get transformAttributes(){return{}}attributeChangedCallback(t,e,i){if(e===i)return;this.log("attributeChangedCallback: "+t);let s=!1,o=this.transformAttributes[t]??V;t.indexOf("data-")===0&&(t=t.slice(5),s=!0),t=O(t),s?this.options[t]=o(i):this[t]=o(i),this.fireEvents&&this[`${t}Changed`]&&this[`${t}Changed`]()}},pt=U;function X(n,t,e,i=!1){let s=document.createElement("option");s.value=""+t,i&&(s.selected=!0),s.label=e,n.appendChild(s)}function Y(n,t={}){Object.keys(t).forEach(e=>{Array.isArray(t[e])?Object.keys(t[e]).forEach(i=>n.searchParams.append(isNaN(i)?`${e}[${i}]`:e,t[e][i])):n.searchParams.append(e,t[e])})}function K(n){return typeof n=="string"?n[0]==="["?(n.indexOf('"')===-1&&(n=n.replace(/'/g,'"')),JSON.parse(n)):n.split(","):Array.isArray(n)?n:(console.error("Invalid array",n),[])}function J(n){var t=n.getBoundingClientRect(),e=window.pageXOffset||document.documentElement.scrollLeft,i=window.pageYOffset||document.documentElement.scrollTop;return{top:t.top+i,left:t.left+e}}function q(n,t){return n.replace(/\{([^}]+)?\}/g,function(e,i){return t[i]})}function T(n,t=document.body,e=!1){t||(t=document.createElement("div"));let i=window.getComputedStyle(t),s=i.getPropertyValue("font-weight")||"normal",o=i.getPropertyValue("font-size")||"1rem",r=i.getPropertyValue("font-family")||"Arial",l=0;if(e){let u=i.getPropertyValue("padding-left")||"0",g=i.getPropertyValue("padding-right")||"0";l=parseInt(u)+parseInt(g)}let c=(T.canvas||(T.canvas=document.createElement("canvas"))).getContext("2d");c.font=`${s} ${o} ${r}`;let h=c.measureText(n);return parseInt(h.width)+l}function N(n){return Math.random().toString(36).replace("0.",n||"")}var G={},C={itemsPerPage:"Items per page",gotoPage:"Go to page",gotoFirstPage:"Go to first page",gotoPrevPage:"Go to previous page",gotoNextPage:"Go to next page",gotoLastPage:"Go to last page",of:"of",items:"items",resizeColumn:"Resize column",noData:"No data",areYouSure:"Are you sure?",networkError:"Network response error"};function ft(n,t){t.width&&d(n,"width",t.width),t.class&&S(n,t.class),t.hidden&&(d(n,"hidden",""),t.responsiveHidden&&S(n,"dg-responsive-hidden"))}var B=class extends pt{_ready(){d(this,"id",this.options.id??N("el-"),!0),this.data=[],this.originalData,this.options=this.options||this.defaultOptions,this.fireEvents=!1,this.page=this.options.defaultPage||1,this.pages=0,this.meta,this.plugins={};for(let[t,e]of Object.entries(G))this.plugins[t]=new e(this);for(let t of B.observedAttributes)t.indexOf("data-")===0&&d(this,t,this.options[O(t.slice(5))])}static template(){return` @@ -36,11 +36,11 @@ function O(n){return n.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(t,e)=>e.toUppe
-`}get labels(){return C}static getLabels(){return C}static setLabels(t){C=Object.assign(C,t)}get defaultColumn(){return{field:"",title:"",width:0,class:"",attr:"",hidden:!1,editable:!1,noSort:!1,responsive:1,responsiveHidden:!1,format:"",transform:""}}get defaultOptions(){return{id:null,url:null,perPage:10,debug:!1,filter:!1,menu:!1,sort:!1,server:!1,serverParams:{start:"start",length:"length",search:"search",sort:"sort",sortDir:"sortDir",dataKey:"data",metaKey:"meta",metaTotalKey:"total",metaFilteredKey:"filtered",optionsKey:"options",paramsKey:"params"},defaultSort:"",reorder:!1,dir:"ltr",perPageValues:[10,25,50,100,250],hidePerPage:!1,columns:[],actions:[],collapseActions:!1,selectable:!1,selectVisibleOnly:!0,defaultPage:1,resizable:!1,autosize:!0,expand:!1,autoheight:!0,autohidePager:!1,responsive:!1,responsiveToggle:!0}}static registerPlugins(t){G=t}static unregisterPlugins(t=null){t===null?G={}:delete G[t]}static registeredPlugins(){return G}convertColumns(t){let e=[];return typeof t=="object"&&!Array.isArray(t)?Object.keys(t).forEach(i=>{let s=Object.assign({},this.defaultColumn);s.title=t[i],s.field=i,e.push(s)}):t.forEach(i=>{let s=Object.assign({},this.defaultColumn);typeof i=="string"?(s.title=i,s.field=i):typeof i=="object"?(s=Object.assign(s,i),s.field||console.error("Invalid column definition",i),s.title||(s.title=s.field)):console.error("Column definition must be a string or an object"),e.push(s)}),e}static get observedAttributes(){return["page","data-filter","data-sort","data-debug","data-reorder","data-menu","data-selectable","data-url","data-per-page","data-responsive"]}get transformAttributes(){return{columns:t=>this.convertColumns(K(t)),actions:t=>K(t),defaultPage:t=>parseInt(t),perPage:t=>parseInt(t)}}get page(){return parseInt(this.getAttribute("page"))}set page(t){d(this,"page",this.constrainPageValue(t))}urlChanged(){this.loadData().then(()=>{this.configureUi()})}constrainPageValue(t){return this.pages1&&this.page*this.options.perPage>this.totalRecords();)t--;t!=this.page?this.page=t:this.reload(()=>{(!this.plugins.FixedHeight||!this.plugins.FixedHeight.hasFixedHeight)&&this.selectPerPage.scrollIntoView()})}dirChanged(){d(this,"dir",this.options.dir)}defaultSortChanged(){this.sortChanged()}perPageValuesChanged(){if(this.selectPerPage){for(;this.selectPerPage.lastChild;)this.selectPerPage.removeChild(this.selectPerPage.lastChild);this.options.perPageValues.forEach(t=>{X(this.selectPerPage,t,t,t===this.options.perPage)})}}_connected(){this.table=this.querySelector("table"),this.btnFirst=this.querySelector(".dg-btn-first"),this.btnPrev=this.querySelector(".dg-btn-prev"),this.btnNext=this.querySelector(".dg-btn-next"),this.btnLast=this.querySelector(".dg-btn-last"),this.selectPerPage=this.querySelector(".dg-select-per-page"),this.inputPage=this.querySelector(".dg-input-page"),this.getFirst=this.getFirst.bind(this),this.getPrev=this.getPrev.bind(this),this.getNext=this.getNext.bind(this),this.getLast=this.getLast.bind(this),this.changePerPage=this.changePerPage.bind(this),this.gotoPage=this.gotoPage.bind(this),this.btnFirst.addEventListener("click",this.getFirst),this.btnPrev.addEventListener("click",this.getPrev),this.btnNext.addEventListener("click",this.getNext),this.btnLast.addEventListener("click",this.getLast),this.selectPerPage.addEventListener("change",this.changePerPage),this.selectPerPage.toggleAttribute("hidden",this.options.hidePerPage),this.inputPage.addEventListener("input",this.gotoPage),Object.values(this.plugins).forEach(t=>{t.connected()}),this.dirChanged(),this.perPageValuesChanged(),this.loadData().finally(()=>{this.configureUi(),this.sortChanged(),this.classList.add("dg-initialized"),this.filterChanged(),this.reorderChanged(),this.dirChanged(),this.perPageValuesChanged(),this.pageChanged(),this.fireEvents=!0,this.log("initialized")})}_disconnected(){this.btnFirst.removeEventListener("click",this.getFirst),this.btnPrev.removeEventListener("click",this.getPrev),this.btnNext.removeEventListener("click",this.getNext),this.btnLast.removeEventListener("click",this.getLast),this.selectPerPage.removeEventListener("change",this.changePerPage),this.inputPage.removeEventListener("input",this.gotoPage),Object.values(this.plugins).forEach(t=>{t.disconnected()})}getCol(t){let e=null;return this.options.columns.forEach(i=>{i.field==t&&(e=i)}),e}getColProp(t,e){let i=this.getCol(t);return i?i[e]:null}setColProp(t,e,i){let s=this.getCol(t);s&&(s[e]=i)}visibleColumns(){return this.options.columns.filter(t=>!t.hidden)}hiddenColumns(){return this.options.columns.filter(t=>t.hidden===!0)}showColumn(t,e=!0){this.setColProp(t,"hidden",!1),e&&this.renderTable(),x(this,"columnVisibility",{col:t,visibility:"visible"})}hideColumn(t,e=!0){this.setColProp(t,"hidden",!0),e&&this.renderTable(),x(this,"columnVisibility",{col:t,visibility:"hidden"})}startColIndex(){let t=1;return this.options.selectable&&this.plugins.SelectableRows&&t++,this.options.responsive&&this.plugins.ResponsiveGrid&&this.plugins.ResponsiveGrid.hasHiddenColumns()&&t++,t}isSticky(){return this.hasAttribute("sticky")}columnsLength(t=!1){let e=0;return this.options.columns.forEach(i=>{t&&i.hidden||i.attr||e++}),this.options.selectable&&this.plugins.SelectableRows&&e++,this.options.actions.length&&this.plugins.RowActions&&e++,this.options.responsive&&this.plugins.ResponsiveGrid&&this.plugins.ResponsiveGrid.hasHiddenColumns()&&e++,e}configureUi(){if(d(this.querySelector("table"),"aria-rowcount",this.data.length),this.table.style.visibility="hidden",this.renderTable(),this.options.responsive&&this.plugins.ResponsiveGrid||(this.table.style.visibility="visible"),!this.rowHeight){let t=W(this,"tbody tr")||W(this,"table tr");t&&(this.rowHeight=t.offsetHeight)}}filterChanged(){let t=this.querySelector("thead tr.dg-head-filters");this.options.filter?S(t,"hidden"):(this.clearFilters(),d(t,"hidden",""))}reorderChanged(){f(this,"thead tr.dg-head-columns th").forEach(e=>{e.classList.contains("dg-selectable")||e.classList.contains("dg-actions")||(this.options.reorder&&this.plugins.DraggableHeaders?e.draggable=!0:e.removeAttribute("draggable"))})}sortChanged(){this.log("toggle sort"),this.querySelectorAll("thead tr.dg-head-columns th").forEach(t=>{let e=t.getAttribute("field");t.classList.contains("dg-not-sortable")||!this.fireEvents&&e==this.options.defaultSort||(this.options.sort&&!this.getColProp(e,"noSort")?d(t,"aria-sort","none"):S(t,"aria-sort"))})}selectableChanged(){this.renderTable()}addRow(t){Array.isArray(this.originalData)&&(this.log("Add row"),this.originalData.push(t),this.data=this.originalData.slice(),this.sortData())}removeRow(t=null,e=null){if(Array.isArray(this.originalData)){e===null&&(e=this.options.columns[0].field),t===null&&(t=this.originalData[this.originalData.length-1][e]),this.log("Removing "+e+":"+t);for(let i=0;i{this.options.server||e?this.renderBody():this.paginate(),t&&t()})}loadData(){let t=()=>!this.data.length&&this.classList.add("dg-empty");return(this.meta||this.originalData||this.classList.contains("dg-initialized"))&&(!this.options.server||this.options.server&&!this.fireEvents)?(this.log("skip loadData"),t(),new Promise(e=>{e()})):(this.log("loadData"),this.loading=!0,this.classList.add("dg-loading"),this.classList.remove("dg-empty","dg-network-error"),this.fetchData().then(e=>{if(Array.isArray(e))this.data=e;else{if(!e[this.options.serverParams.dataKey]){console.error("Invalid response, it should contain a data key with an array or be a plain array",e),this.options.url=null;return}this.options=Object.assign(this.options,e[this.options.serverParams.optionsKey]??{}),this.meta=e[this.options.serverParams.metaKey]??{},this.data=e[this.options.serverParams.dataKey]}this.originalData=this.data.slice(),this.fixPage(),this.options.columns.length===0&&this.originalData.length?this.options.columns=this.convertColumns(Object.keys(this.originalData[0])):this.options.columns=this.convertColumns(this.options.columns)}).catch(e=>{this.log(e),e.message&&this.querySelector("tbody").setAttribute("data-empty",e.message.replace(/^\s+|\r\n|\n|\r$/g,"")),this.classList.add("dg-empty","dg-network-error")}).finally(()=>{t(),this.classList.remove("dg-loading"),this.loading=!1}))}getFirst(){this.loading||(this.page=1)}getLast(){this.loading||(this.page=this.pages)}getPrev(){this.loading||(this.page=this.page-1)}getNext(){this.loading||(this.page=this.page+1)}gotoPage(t){if(t.type==="keypress"){let e=t.keyCode||t.key;if(e===13||e==="Enter")t.preventDefault();else return}this.page=parseInt(this.inputPage.value)}getSort(){let t=this.querySelector("thead tr.dg-head-columns th[aria-sort$='scending']");return t?t.getAttribute("field"):this.options.defaultSort}getSortDir(){let t=this.querySelector("thead tr.dg-head-columns th[aria-sort$='scending']");return t&&t.getAttribute("aria-sort")||""}getFilters(){let t=[];return f(this,"thead tr.dg-head-filters input").forEach(i=>{t[i.dataset.name]=i.value}),t}clearFilters(){f(this,"thead tr.dg-head-filters input").forEach(e=>{e.value=""}),this.filterData()}filterData(){if(this.log("filter data"),this.page=1,this.options.server)this.reload();else{this.data=this.originalData?.slice()??[],f(this,"thead tr.dg-head-filters input").forEach(i=>{let s=i.value;if(s){let o=i.dataset.name;this.data=this.data.filter(r=>(r[o]+"").toLowerCase().indexOf(s.toLowerCase())!==-1)}}),this.pageChanged();let e=this.querySelector("thead tr.dg-head-columns th[aria-sort$='scending']");this.options.sort&&e?this.sortData():this.renderBody()}}sortData(t=null){if(this.log("sort data"),t&&this.getColProp(t.getAttribute("field"),"noSort")){this.log("sorting prevented because column is not sortable");return}if(this.plugins.ColumnResizer&&this.plugins.ColumnResizer.isResizing){this.log("sorting prevented because resizing");return}if(this.loading){this.log("sorting prevented because loading");return}if(t!==null){let e=i=>["dg-selectable","dg-actions","dg-responsive-toggle"].includes(i);this.querySelectorAll("thead tr:first-child th").forEach(i=>{[...i.classList].some(e)||i!==t&&i.setAttribute("aria-sort","none")}),!t.hasAttribute("aria-sort")||t.getAttribute("aria-sort")==="none"?t.setAttribute("aria-sort","ascending"):t.getAttribute("aria-sort")==="ascending"?t.setAttribute("aria-sort","descending"):t.getAttribute("aria-sort")==="descending"&&t.setAttribute("aria-sort","none")}else t=this.querySelector("thead tr.dg-head-columns th[aria-sort$='scending']");if(this.options.server)this.loadData().finally(()=>{this.renderBody()});else{let e=t?t.getAttribute("aria-sort"):"none";if(e==="none"){let i=[];this.originalData?.some(s=>(this.data.some(o=>JSON.stringify(s)===JSON.stringify(o)?(i.push(o),!0):!1),i.length===this.data.length)),this.data=i}else{let i=t.getAttribute("field");this.data.sort((s,o)=>{if(!isNaN(s[i])&&!isNaN(o[i]))return e==="ascending"?s[i]-o[i]:o[i]-s[i];let r=e==="ascending"?s[i].toUpperCase():o[i].toUpperCase(),l=e==="ascending"?o[i].toUpperCase():s[i].toUpperCase();switch(!0){case r>l:return 1;case ro("No url set"));let t=window.location.href;t.split("/").pop().includes(".")||(t+=t.endsWith("/")?"":"/");let e=new URL(this.options.url,t),i={r:Date.now()};return this.options.server&&(i[this.options.serverParams.start]=this.page-1,i[this.options.serverParams.length]=this.options.perPage,this.options.filter&&(i[this.options.serverParams.search]=this.getFilters()),i[this.options.serverParams.sort]=this.getSort()||"",i[this.options.serverParams.sortDir]=this.getSortDir(),this.meta?.[this.options.serverParams.paramsKey]&&(i=Object.assign(i,this.meta[this.options.serverParams.paramsKey]))),Y(e,i),fetch(e).then(s=>{if(!s.ok)throw new Error(s.statusText||C.networkError);return s.json()})}renderTable(){this.log("render table"),this.options.menu&&this.plugins.ContextMenu&&this.plugins.ContextMenu.createMenu();let t;this.renderHeader(),this.options.defaultSort&&(t=this.querySelector("thead tr.dg-head-columns th[field='"+this.options.defaultSort+"']")),t?this.sortData(t):this.renderBody(),this.renderFooter()}renderHeader(){this.log("render header");let t=this.querySelector("thead");this.createColumnHeaders(t),this.createColumnFilters(t),this.options.resizable&&this.plugins.ColumnResizer&&this.plugins.ColumnResizer.renderResizer(C.resizeColumn),x(this,"headerRendered")}renderFooter(){this.log("render footer");let t=this.querySelector("tfoot"),e=t.querySelector("td");t.removeAttribute("hidden"),d(e,"colspan",this.columnsLength(!0)),t.style.display=""}createColumnHeaders(t){let e=this.clientWidth,i=Math.round(e/this.columnsLength(!0)*2),s=0,o;o=A("tr"),this.headerRow=o,o.setAttribute("role","row"),o.setAttribute("aria-rowindex","1"),o.setAttribute("class","dg-head-columns");let r=t.querySelector("tr.dg-head-columns th");r||(r=A("th"),t.querySelector("tr").appendChild(r)),this.options.selectable&&this.plugins.SelectableRows&&this.plugins.SelectableRows.createHeaderCol(o),this.options.responsive&&this.plugins.ResponsiveGrid&&this.plugins.ResponsiveGrid.hasHiddenColumns()&&this.plugins.ResponsiveGrid.createHeaderCol(o),s=0;let l=0;if(this.options.columns.forEach(a=>{if(a.attr)return;let c=s+this.startColIndex(),h=A("th");h.setAttribute("scope","col"),h.setAttribute("role","columnheader button"),h.setAttribute("aria-colindex",""+c),h.setAttribute("id",N("dg-col-")),this.options.sort&&h.setAttribute("aria-sort","none"),h.setAttribute("field",a.field),this.plugins.ResponsiveGrid&&this.options.responsive&&d(h,"data-responsive",a.responsive||"");let u=T(a.title,r,!0)+20;h.dataset.minWidth=""+u,ft(h,a),h.tabIndex=0,h.textContent=a.title;let g=0;if(this.options.autosize&&this.plugins.AutosizeColumn){let m=Math.min(e-l,i);g=this.plugins.AutosizeColumn.computeSize(h,a,parseInt(h.dataset.minWidth),m)}else g=Math.max(parseInt(h.dataset.minWidth),parseInt(h.getAttribute("width")));d(h,"width",g),a.hidden?h.setAttribute("hidden",""):l+=g,this.options.reorder&&this.plugins.DraggableHeaders&&this.plugins.DraggableHeaders.makeHeaderDraggable(h),o.appendChild(h),s++}),le){this.log(`adjust width to fix size, ${t.offsetWidth} > ${e}`);let a=this.offsetWidth-this.clientWidth,c=t.offsetWidth-e-a;this.options.responsive&&this.plugins.ResponsiveGrid&&(c+=a),f(o,"th[width]").forEach(u=>{if($(u,"dg-not-resizable")||c<=0)return;let g=parseInt(u.getAttribute("width")),m=u.dataset.minWidth?parseInt(u.dataset.minWidth):0;if(g>m){let b=g-c;b{a.addEventListener("click",()=>this.sortData(a))}),d(this.querySelector("table"),"aria-colcount",this.columnsLength(!0))}createColumnFilters(t){let e=0,i;i=A("tr"),this.filterRow=i,i.setAttribute("role","row"),i.setAttribute("aria-rowindex","2"),i.setAttribute("class","dg-head-filters"),this.options.filter||i.setAttribute("hidden",""),this.options.selectable&&this.plugins.SelectableRows&&this.plugins.SelectableRows.createFilterCol(i),this.options.responsive&&this.plugins.ResponsiveGrid&&this.plugins.ResponsiveGrid.hasHiddenColumns()&&this.plugins.ResponsiveGrid.createFilterCol(i),this.options.columns.forEach(s=>{if(s.attr)return;let o=e+this.startColIndex(),r=t.querySelector("tr.dg-head-columns th[aria-colindex='"+o+"']");if(!r){console.warn("Related th not found",o);return}let l=A("th");l.setAttribute("aria-colindex",""+o);let a=A("input");a.type="text",a.inputMode="search",a.autocomplete="off",a.spellcheck=!1,a.dataset.name=s.field,a.id=N("dg-filter-"),a.setAttribute("aria-labelledby",r.getAttribute("id")),this.options.filter?a.tabIndex=0:l.tabIndex=0,s.hidden&&l.setAttribute("hidden",""),l.appendChild(a),i.appendChild(l),e++}),this.options.actions.length&&this.plugins.RowActions&&this.plugins.RowActions.makeActionFilter(i),t.replaceChild(i,t.querySelector("tr.dg-head-filters")),i.querySelectorAll("input").forEach(s=>{s.addEventListener("keypress",o=>{let r=o.keyCode||o.key;(r===13||r==="Enter")&&this.filterData.call(this)})})}renderBody(){this.log("render body");let t,e,i,s=A("tbody");this.data.forEach((r,l)=>{t=A("tr"),d(t,"role","row"),d(t,"hidden",""),d(t,"aria-rowindex",l+1),t.tabIndex=0,this.options.selectable&&this.plugins.SelectableRows&&this.plugins.SelectableRows.createDataCol(t),this.options.responsive&&this.plugins.ResponsiveGrid&&this.plugins.ResponsiveGrid.hasHiddenColumns()&&this.plugins.ResponsiveGrid.createDataCol(t),this.options.expand&&(t.classList.add("dg-expandable"),w(t,"click",a=>{this.plugins.ResponsiveGrid&&this.plugins.ResponsiveGrid.blockObserver(),ut(a.currentTarget,"dg-expanded"),this.plugins.ResponsiveGrid&&this.plugins.ResponsiveGrid.unblockObserver()})),i=0,this.options.columns.forEach(a=>{if(a||console.error("Empty column found!",this.options.columns),a.attr){r[a.field]&&(a.attr==="class"?L(t,r[a.field]):t.setAttribute(a.attr,r[a.field]));return}if(e=A("td"),e.setAttribute("role","gridcell"),e.setAttribute("aria-colindex",i+this.startColIndex()),ft(e,a),e.setAttribute("data-name",a.title),e.tabIndex=-1,a.editable&&this.plugins.EditableColumn)L(e,"dg-editable-col"),this.plugins.EditableColumn.makeEditableInput(e,a,r,l);else{let c=r[a.field]??"",h;switch(a.transform){case"uppercase":h=c.toUpperCase();break;case"lowercase":h=c.toLowerCase();break;default:h=c;break}if(a.format){if(a.defaultFormatValue!=null&&(h===""||h===null)&&(h=a.defaultFormatValue+""),typeof a.format=="string"&&h)e.innerHTML=q(a.format,Object.assign({_v:c,_tv:h},r));else if(a.format instanceof Function){let u=a.format.call(this,{column:a,rowData:r,cellData:h,td:e,tr:t});e.innerHTML=u||h||c}}else e.textContent=h}t.appendChild(e),i++}),this.options.actions.length&&this.plugins.RowActions&&this.plugins.RowActions.makeActionRow(t,r),s.appendChild(t)}),s.setAttribute("role","rowgroup");let o=this.querySelector("tbody");s.setAttribute("data-empty",o.getAttribute("data-empty")),this.querySelector("table").replaceChild(s,o),this.plugins.FixedHeight&&this.plugins.FixedHeight.createFakeRow(),this.paginate(),this.plugins.SelectableRows&&this.plugins.SelectableRows.shouldSelectAll(s),x(this,"bodyRendered")}paginate(){this.log("paginate");let t=this.totalRecords(),e=this.page||1,i,s=e*this.options.perPage,o=s-this.options.perPage+1,r=this.querySelector("tbody"),l=this.querySelector("tfoot");s>t&&(s=t),t||(o=0),r.querySelectorAll("tr").forEach(a=>{if(this.options.server){S(a,"hidden");return}i=Number(k(a,"aria-rowindex")),i>s||i=this.pages,this.btnLast.disabled=this.page>=this.pages),l.querySelector(".dg-low").textContent=o.toString(),l.querySelector(".dg-high").textContent=s.toString(),l.querySelector(".dg-total").textContent=""+this.totalRecords(),l.toggleAttribute("hidden",this.options.autohidePager&&this.options.perPage>this.totalRecords())}totalPages(){return Math.ceil(this.totalRecords()/this.options.perPage)}totalRecords(){return this.options.server?this.meta?.[this.options.serverParams.metaFilteredKey]||0:this.data.length}},_=B;var Z=class{constructor(t){this.grid=t}connected(){}disconnected(){}handleEvent(t){this[`on${t.type}`]&&this[`on${t.type}`](t)}},v=Z;var Q=class extends v{constructor(t){super(t),this.isResizing=!1}renderResizer(t){let e=this.grid,i=e.table,s=f(e,"thead tr.dg-head-columns th");s.forEach(o=>{if($(o,"dg-not-resizable"))return;let r=document.createElement("div");L(r,"dg-resizer"),r.ariaLabel=t,o.appendChild(r);let l=0,a=0,c=0,h=0,u=m=>{if(m.clientX>h)return;let b=a+(m.clientX-l);o.dataset.minWidth&&b>parseInt(o.dataset.minWidth)&&d(o,"width",b)},g=()=>{e.log("resized column"),setTimeout(()=>{this.isResizing=!1},0),F(r,"dg-resizer-active"),e.options.reorder&&(o.draggable=!0),o.style.overflow="hidden",H(document,"mousemove",u),H(document,"mouseup",g),x(e,"columnResized",{col:k(o,"field"),width:k(o,"width")})};w(r,"click",m=>{m.stopPropagation()}),w(r,"mousedown",m=>{m.stopPropagation(),this.isResizing=!0;let b=m.target,P=f(e,"dg-head-columns th").filter(p=>!p.hasAttribute("hidden")),y=P.findIndex(p=>p==b.parentNode);e.log("resize column"),L(r,"dg-resizer-active"),S(o,"draggable"),o.style.overflow="visible",r.style.height=i.offsetHeight-1+"px",l=m.clientX,a=o.offsetWidth,c=(P.length-y)*30,h=J(b).left+e.offsetWidth-c,d(o,"width",a);for(let p=0;py&&S(s[p],"width");w(document,"mousemove",u),w(document,"mouseup",g)})})}},mt=Q;function M(n,t,e="nodeName"){let i=n;for(;i[e]!=t;)i=i.parentElement;return i}var tt=class extends v{connected(){this.menu=this.grid.querySelector(".dg-menu")}disconnected(){this.grid.headerRow&&H(this.grid.headerRow,"contextmenu",this)}attachContextMenu(){let t=this.grid;w(t.headerRow,"contextmenu",this)}onchange(t){let e=this.grid,i=t.target,s=i.dataset.name;if(i.checked)e.showColumn(s);else{if(e.visibleColumns().length<=1){i.checked=!0;return}e.hideColumn(s)}}oncontextmenu(t){t.preventDefault();let e=this.grid,i=M(t.target,"THEAD"),s=this.menu,o=i.getBoundingClientRect(),r=t.clientX-o.left,l=t.clientY-o.top;s.style.top=`${l}px`,s.style.left=`${r}px`,S(s,"hidden"),r+150>o.width&&(r-=s.offsetWidth,s.style.left=`${r}px`);let a=c=>{s.contains(c.target)||(d(s,"hidden",""),H(document,"click",a))};w(document,"click",a)}createMenu(){let t=this.grid,e=this.menu;for(;e.lastChild;)e.removeChild(e.lastChild);e.addEventListener("change",this),t.options.columns.forEach(i=>{if(i.attr)return;let s=document.createElement("li"),o=document.createElement("label"),r=document.createElement("input");d(r,"type","checkbox"),d(r,"data-name",i.field),i.hidden||(r.checked=!0);let l=document.createTextNode(i.title);o.appendChild(r),o.appendChild(l),s.appendChild(o),e.appendChild(s)})}},bt=tt;var et=class extends v{makeHeaderDraggable(t){let e=this.grid;t.draggable=!0,w(t,"dragstart",i=>{if(e.plugins.ColumnResizer&&e.plugins.ColumnResizer.isResizing&&i.preventDefault){i.preventDefault();return}e.log("reorder col"),i.dataTransfer.effectAllowed="move",i.dataTransfer.setData("text/plain",i.target.getAttribute("aria-colindex"))}),w(t,"dragover",i=>(i.preventDefault&&i.preventDefault(),i.dataTransfer.dropEffect="move",!1)),w(t,"drop",i=>{i.stopPropagation&&i.stopPropagation();let s=i.target,o=M(s,"TH"),r=parseInt(i.dataTransfer.getData("text/plain")),l=parseInt(o.getAttribute("aria-colindex"));if(r===l){e.log("reordered col stayed the same");return}e.log("reordered col from "+r+" to "+l);let a=e.startColIndex(),c=e.options.columns[r-a];e.options.columns[r-a]=e.options.columns[l-a],e.options.columns[l-a]=c;let h=(u,g)=>{let m=g.parentNode.getAttribute("aria-rowindex"),b=e.querySelector(u+" tr[aria-rowindex='"+m+"'] [aria-colindex='"+l+"']");d(g,"aria-colindex",l),d(b,"aria-colindex",r);let R=document.createElement("th");g.parentNode.insertBefore(R,g),b.parentNode.replaceChild(g,b),R.parentNode.replaceChild(b,R)};return f(e,"thead th[aria-colindex='"+r+"']").forEach(u=>{h("thead",u)}),f(e,'tbody td[aria-colindex="'+r+'"]').forEach(u=>{h("tbody",u)}),e.options.columns=f(e,"thead tr.dg-head-columns th[field]").map(u=>e.options.columns.find(g=>g.field==k(u,"field"))),x(e,"columnReordered",{col:c.field,from:r,to:l}),!1})}},vt=et;var it=class extends v{constructor(t){super(t),this.touch=null}connected(){let t=this.grid;t.addEventListener("touchstart",this,{passive:!0}),t.addEventListener("touchmove",this,{passive:!0})}disconnected(){let t=this.grid;t.removeEventListener("touchstart",this),t.removeEventListener("touchmove",this)}ontouchstart(t){this.touch=t.touches[0]}ontouchmove(t){if(!this.touch)return;let e=this.grid,i=this.touch.clientX-t.touches[0].clientX,s=this.touch.clientY-t.touches[0].clientY;Math.abs(i)>Math.abs(s)&&(i>0?e.getNext():e.getPrev()),this.touch=null}},xt=it;var z="dg-selectable",Ct="dg-select-all",yt="form-check-input",st=class extends v{disconnected(){this.selectAll&&this.selectAll.removeEventListener("change",this)}getSelection(t=null){let e=this.grid,i=[];return f(e,`tbody .${z} input:checked`).forEach(o=>{let r=parseInt(o.dataset.id),l=e.data[r-1];l||console.warn(`Item ${r} not found`),t?i.push(l[t]):i.push(l)}),i}clearCheckboxes(t){if(!this.grid.options.selectVisibleOnly)return;f(t,`tr[hidden] .${z} input`).forEach(s=>{s.checked=!1}),this.selectAll.checked=!1}colIndex(){return this.grid.startColIndex()-2}createHeaderCol(t){let e=document.createElement("th");d(e,"scope","col"),d(e,"role","columnheader button"),d(e,"aria-colindex",this.colIndex()),e.classList.add(z,"dg-not-resizable","dg-not-sortable"),e.tabIndex=0,this.selectAll=document.createElement("input"),this.selectAll.type="checkbox",this.selectAll.classList.add(Ct),this.selectAll.classList.add(yt),this.selectAll.addEventListener("change",this);let i=document.createElement("label");i.appendChild(this.selectAll),e.appendChild(i),e.setAttribute("width","40"),t.appendChild(e)}createFilterCol(t){let e=document.createElement("th");d(e,"role","columnheader button"),d(e,"aria-colindex",this.colIndex()),e.classList.add(z),e.tabIndex=0,t.appendChild(e)}shouldSelectAll(t){this.selectAll&&(t.addEventListener("change",this),t.dispatchEvent(new Event("change")))}createDataCol(t){let e=document.createElement("td");d(e,"role","gridcell button"),d(e,"aria-colindex",this.colIndex()),e.classList.add(z);let i=document.createElement("input");i.dataset.id=t.getAttribute("aria-rowindex"),i.type="checkbox",i.classList.add(yt);let s=document.createElement("label");s.classList.add("dg-clickable-cell"),s.appendChild(i),e.appendChild(s),s.addEventListener("click",this),t.appendChild(e)}onclick(t){t.stopPropagation()}onchange(t){let e=this.grid;if($(t.target,Ct)){let i=e.options.selectVisibleOnly;f(e,`tbody .${z} input`).forEach(o=>{i&&!o.offsetWidth||(o.checked=this.selectAll.checked)}),x(e,"rowsSelected",{selection:this.getSelection()})}else{if(!t.target.closest(`.${z}`))return;let i=f(e,`tbody .${z} input[type=checkbox]`),s=i.filter(o=>o.checked);this.selectAll.checked=s.length==i.length,x(e,"rowsSelected",{selection:e.getSelection()})}}},At=st;var rt=class extends v{constructor(t){super(t),this.hasFixedHeight=!1,t.style.height&&(t.style.overflowY="auto",this.hasFixedHeight=!0)}createFakeRow(){let e=this.grid.querySelector("tbody"),i=document.createElement("tr");d(i,"role","row"),d(i,"hidden",""),i.classList.add("dg-fake-row"),i.tabIndex=0,e.appendChild(i)}get fakeRow(){return this.grid.querySelector(".dg-fake-row")}updateFakeRow(){let t=this.grid,e=this.fakeRow;if(!e||t.options.perPage>t.totalRecords()||t.page!==t.totalPages()||!t.options.autoheight)return;let i=t.options.perPage*t.rowHeight,s=t.querySelectorAll("tbody tr:not([hidden])").length,o=s>1?i-s*t.rowHeight:i;o>0?(d(e,"height",o),e.removeAttribute("hidden")):e.removeAttribute("height")}},Pt=rt;var nt=class extends v{computeSize(t,e,i,s){let o=this.grid;if(j(t,"width"))return k(t,"width");if(!o.data.length)return;let r=o.data[0],l=o.data[o.data.length-1],a=r[e.field]?r[e.field].toString():"",c=l[e.field]?l[e.field].toString():"";c.length>a.length&&(a=c);let h=0;return a.length<=6?h=i:a.length>50?h=s:h=T(a+"0000",t),h>s&&(h=s),h{clearTimeout(e),e=setTimeout(()=>{e=null,n(...i)},t)}}var E="dg-responsive",at;function $t(n){return n.sort((t,e)=>{let i=parseInt(t.dataset.responsive)||1;return(parseInt(e.dataset.responsive)||1)-i})}var Wt=ot(n=>{for(let t of n){let e=t.target,i=e.table;if(e.plugins.ResponsiveGrid.observerBlocked)return;let s=Array.isArray(t.contentBoxSize)?t.contentBoxSize[0]:t.contentBoxSize,o=parseInt(s.inlineSize),r=i.offsetWidth,l=f(e.headerRow,"th").reduce((P,y)=>P+y.offsetWidth,0),a=(l||r)-o-1,c=50,h=e.plugins.ResponsiveGrid.prevAction,u=$t(f(e.headerRow,"th[field]").reverse().filter(P=>P.dataset.responsive!=="0")),g=!1;if(e.log(`table is ${r}/${l} and available size is ${o}. Diff: ${a}`),a>0){if(h==="show")return;e.plugins.ResponsiveGrid.prevAction="hide";let P=a,y=u.filter(p=>!p.hasAttribute("hidden")&&p.hasAttribute("data-responsive"));if(y.length===0&&(y=u.filter(p=>!p.hasAttribute("hidden")),y.length===1))return;y.forEach(p=>{if(P<0)return;let I=p.offsetWidth,D=p.getAttribute("field");D&&(p.dataset.baseWidth=""+p.offsetWidth,e.hideColumn(D,!1),e.setColProp(D,"responsiveHidden",!0),g=!0,P-=I,P=Math.round(P))})}else{if(h==="hide")return;e.plugins.ResponsiveGrid.prevAction="show";let P=u.filter(p=>!p.hasAttribute("hidden")).reduce((p,I)=>{let D=I.dataset.minWidth?parseInt(I.dataset.minWidth):I.offsetWidth;return p+D},0)+c,y=o-P;u.slice().reverse().filter(p=>p.hasAttribute("hidden")).forEach(p=>{if(yy){y=-1;return}let D=p.getAttribute("field");D&&(e.showColumn(D,!1),e.setColProp(D,"responsiveHidden",!1),g=!0,y-=I,y=Math.round(y))})}let m=W(e.table,"tfoot"),b=f(e.table,".dg-footer > div").reduce((P,y)=>P+y.offsetWidth,0),R=m.offsetWidth-b;b>o?L(m,"dg-footer-compact"):R>250&&F(m,"dg-footer-compact"),g&&e.renderTable(),setTimeout(()=>{e.plugins.ResponsiveGrid.prevAction=null},1e3),e.table.style.visibility="visible"}},100),Et=new ResizeObserver(Wt),lt=class extends v{constructor(t){super(t),this.observerBlocked=!1,this.prevAction=null}connected(){this.grid.options.responsive&&this.observe()}disconnected(){this.unobserve()}observe(){this.grid.options.responsive&&(Et.observe(this.grid),this.grid.style.display="block",this.grid.style.overflowX="hidden")}unobserve(){Et.unobserve(this.grid),this.grid.style.display="unset",this.grid.style.overflowX="unset"}blockObserver(){this.observerBlocked=!0,at&&clearTimeout(at)}unblockObserver(){at=setTimeout(()=>{this.observerBlocked=!1},200)}hasHiddenColumns(){let t=!1;return this.grid.options.columns.forEach(e=>{e.responsiveHidden&&(t=!0)}),t}colIndex(){return this.grid.startColIndex()-1}createHeaderCol(t){if(!this.grid.options.responsiveToggle)return;let e=A("th",t);d(e,"scope","col"),d(e,"role","columnheader button"),d(e,"aria-colindex",this.colIndex()),d(e,"width","40"),e.classList.add(`${E}-toggle`,"dg-not-resizable","dg-not-sortable"),e.tabIndex=0}createFilterCol(t){if(!this.grid.options.responsiveToggle)return;let e=A("th",t);d(e,"role","columnheader button"),d(e,"aria-colindex",this.colIndex()),e.classList.add(`${E}-toggle`),e.tabIndex=0}createDataCol(t){if(!this.grid.options.responsiveToggle)return;let e=document.createElement("td");d(e,"role","gridcell button"),d(e,"aria-colindex",this.colIndex()),e.classList.add(`${E}-toggle`),e.innerHTML=`
+`}get labels(){return C}static getLabels(){return C}static setLabels(t){C=Object.assign(C,t)}get defaultColumn(){return{field:"",title:"",width:0,class:"",attr:"",hidden:!1,editable:!1,noSort:!1,responsive:1,responsiveHidden:!1,format:"",transform:""}}get defaultOptions(){return{id:null,url:null,perPage:10,debug:!1,filter:!1,menu:!1,sort:!1,server:!1,serverParams:{start:"start",length:"length",search:"search",sort:"sort",sortDir:"sortDir",dataKey:"data",metaKey:"meta",metaTotalKey:"total",metaFilteredKey:"filtered",optionsKey:"options",paramsKey:"params"},defaultSort:"",reorder:!1,dir:"ltr",perPageValues:[10,25,50,100,250],hidePerPage:!1,columns:[],actions:[],collapseActions:!1,selectable:!1,selectVisibleOnly:!0,defaultPage:1,resizable:!1,autosize:!0,expand:!1,autoheight:!0,autohidePager:!1,responsive:!1,responsiveToggle:!0}}static registerPlugins(t){G=t}static unregisterPlugins(t=null){t===null?G={}:delete G[t]}static registeredPlugins(){return G}convertColumns(t){let e=[];return typeof t=="object"&&!Array.isArray(t)?Object.keys(t).forEach(i=>{let s=Object.assign({},this.defaultColumn);s.title=t[i],s.field=i,e.push(s)}):t.forEach(i=>{let s=Object.assign({},this.defaultColumn);typeof i=="string"?(s.title=i,s.field=i):typeof i=="object"?(s=Object.assign(s,i),s.field||console.error("Invalid column definition",i),s.title||(s.title=s.field)):console.error("Column definition must be a string or an object"),e.push(s)}),e}static get observedAttributes(){return["page","data-filter","data-sort","data-debug","data-reorder","data-menu","data-selectable","data-url","data-per-page","data-responsive"]}get transformAttributes(){return{columns:t=>this.convertColumns(K(t)),actions:t=>K(t),defaultPage:t=>parseInt(t),perPage:t=>parseInt(t)}}get page(){return parseInt(this.getAttribute("page"))}set page(t){d(this,"page",this.constrainPageValue(t))}urlChanged(){this.loadData().then(()=>{this.configureUi()})}constrainPageValue(t){return this.pages1&&this.page*this.options.perPage>this.totalRecords();)t--;t!=this.page?this.page=t:this.reload(()=>{(!this.plugins.FixedHeight||!this.plugins.FixedHeight.hasFixedHeight)&&this.selectPerPage.scrollIntoView()})}dirChanged(){d(this,"dir",this.options.dir)}defaultSortChanged(){this.sortChanged()}perPageValuesChanged(){if(this.selectPerPage){for(;this.selectPerPage.lastChild;)this.selectPerPage.removeChild(this.selectPerPage.lastChild);this.options.perPageValues.forEach(t=>{X(this.selectPerPage,t,t,t===this.options.perPage)})}}_connected(){this.table=this.querySelector("table"),this.btnFirst=this.querySelector(".dg-btn-first"),this.btnPrev=this.querySelector(".dg-btn-prev"),this.btnNext=this.querySelector(".dg-btn-next"),this.btnLast=this.querySelector(".dg-btn-last"),this.selectPerPage=this.querySelector(".dg-select-per-page"),this.inputPage=this.querySelector(".dg-input-page"),this.getFirst=this.getFirst.bind(this),this.getPrev=this.getPrev.bind(this),this.getNext=this.getNext.bind(this),this.getLast=this.getLast.bind(this),this.changePerPage=this.changePerPage.bind(this),this.gotoPage=this.gotoPage.bind(this),this.btnFirst.addEventListener("click",this.getFirst),this.btnPrev.addEventListener("click",this.getPrev),this.btnNext.addEventListener("click",this.getNext),this.btnLast.addEventListener("click",this.getLast),this.selectPerPage.addEventListener("change",this.changePerPage),this.selectPerPage.toggleAttribute("hidden",this.options.hidePerPage),this.inputPage.addEventListener("input",this.gotoPage),Object.values(this.plugins).forEach(t=>{t.connected()}),this.dirChanged(),this.perPageValuesChanged(),this.loadData().finally(()=>{this.configureUi(),this.sortChanged(),this.classList.add("dg-initialized"),this.filterChanged(),this.reorderChanged(),this.dirChanged(),this.perPageValuesChanged(),this.pageChanged(),this.fireEvents=!0,this.log("initialized")})}_disconnected(){this.btnFirst.removeEventListener("click",this.getFirst),this.btnPrev.removeEventListener("click",this.getPrev),this.btnNext.removeEventListener("click",this.getNext),this.btnLast.removeEventListener("click",this.getLast),this.selectPerPage.removeEventListener("change",this.changePerPage),this.inputPage.removeEventListener("input",this.gotoPage),Object.values(this.plugins).forEach(t=>{t.disconnected()})}getCol(t){let e=null;return this.options.columns.forEach(i=>{i.field==t&&(e=i)}),e}getColProp(t,e){let i=this.getCol(t);return i?i[e]:null}setColProp(t,e,i){let s=this.getCol(t);s&&(s[e]=i)}visibleColumns(){return this.options.columns.filter(t=>!t.hidden)}hiddenColumns(){return this.options.columns.filter(t=>t.hidden===!0)}showColumn(t,e=!0){this.setColProp(t,"hidden",!1),e&&this.renderTable(),x(this,"columnVisibility",{col:t,visibility:"visible"})}hideColumn(t,e=!0){this.setColProp(t,"hidden",!0),e&&this.renderTable(),x(this,"columnVisibility",{col:t,visibility:"hidden"})}startColIndex(){let t=1;return this.options.selectable&&this.plugins.SelectableRows&&t++,this.options.responsive&&this.plugins.ResponsiveGrid&&this.plugins.ResponsiveGrid.hasHiddenColumns()&&t++,t}isSticky(){return this.hasAttribute("sticky")}columnsLength(t=!1){let e=0;return this.options.columns.forEach(i=>{t&&i.hidden||i.attr||e++}),this.options.selectable&&this.plugins.SelectableRows&&e++,this.options.actions.length&&this.plugins.RowActions&&e++,this.options.responsive&&this.plugins.ResponsiveGrid&&this.plugins.ResponsiveGrid.hasHiddenColumns()&&e++,e}configureUi(){if(d(this.querySelector("table"),"aria-rowcount",this.data.length),this.table.style.visibility="hidden",this.renderTable(),this.options.responsive&&this.plugins.ResponsiveGrid||(this.table.style.visibility="visible"),!this.rowHeight){let t=W(this,"tbody tr")||W(this,"table tr");t&&(this.rowHeight=t.offsetHeight)}}filterChanged(){let t=this.querySelector("thead tr.dg-head-filters");this.options.filter?L(t,"hidden"):(this.clearFilters(),d(t,"hidden",""))}reorderChanged(){f(this,"thead tr.dg-head-columns th").forEach(e=>{e.classList.contains("dg-selectable")||e.classList.contains("dg-actions")||(this.options.reorder&&this.plugins.DraggableHeaders?e.draggable=!0:e.removeAttribute("draggable"))})}sortChanged(){this.log("toggle sort"),this.querySelectorAll("thead tr.dg-head-columns th").forEach(t=>{let e=t.getAttribute("field");t.classList.contains("dg-not-sortable")||!this.fireEvents&&e==this.options.defaultSort||(this.options.sort&&!this.getColProp(e,"noSort")?d(t,"aria-sort","none"):L(t,"aria-sort"))})}selectableChanged(){this.renderTable()}addRow(t){Array.isArray(this.originalData)&&(this.log("Add row"),this.originalData.push(t),this.data=this.originalData.slice(),this.sortData())}removeRow(t=null,e=null){if(Array.isArray(this.originalData)){e===null&&(e=this.options.columns[0].field),t===null&&(t=this.originalData[this.originalData.length-1][e]),this.log("Removing "+e+":"+t);for(let i=0;i{this.options.server||e?this.renderBody():this.paginate(),t&&t()})}loadData(){let t=()=>!this.data.length&&this.classList.add("dg-empty"),e=this.querySelector("tbody");return(this.meta||this.originalData||this.classList.contains("dg-initialized"))&&(!this.options.server||this.options.server&&!this.fireEvents)?(this.log("skip loadData"),t(),new Promise(i=>{i()})):(this.log("loadData"),this.loading=!0,this.classList.add("dg-loading"),this.classList.remove("dg-empty","dg-network-error"),this.fetchData().then(i=>{if(Array.isArray(i))this.data=i;else{if(!i[this.options.serverParams.dataKey]){console.error("Invalid response, it should contain a data key with an array or be a plain array",i),this.options.url=null;return}this.options=Object.assign(this.options,i[this.options.serverParams.optionsKey]??{}),this.meta=i[this.options.serverParams.metaKey]??{},this.data=i[this.options.serverParams.dataKey]}this.originalData=this.data.slice(),this.fixPage(),this.options.columns.length===0&&this.originalData.length?this.options.columns=this.convertColumns(Object.keys(this.originalData[0])):this.options.columns=this.convertColumns(this.options.columns)}).catch(i=>{this.log(i),i.message&&e.setAttribute("data-empty",i.message.replace(/^\s+|\r\n|\n|\r$/g,"")),this.classList.add("dg-empty","dg-network-error")}).finally(()=>{t(),!this.classList.contains("dg-network-error")&&e.getAttribute("data-empty")!=this.labels.noData&&e.setAttribute("data-empty",this.labels.noData),this.classList.remove("dg-loading"),this.loading=!1}))}getFirst(){this.loading||(this.page=1)}getLast(){this.loading||(this.page=this.pages)}getPrev(){this.loading||(this.page=this.page-1)}getNext(){this.loading||(this.page=this.page+1)}gotoPage(t){if(t.type==="keypress"){let e=t.keyCode||t.key;if(e===13||e==="Enter")t.preventDefault();else return}this.page=parseInt(this.inputPage.value)}getSort(){let t=this.querySelector("thead tr.dg-head-columns th[aria-sort$='scending']");return t?t.getAttribute("field"):this.options.defaultSort}getSortDir(){let t=this.querySelector("thead tr.dg-head-columns th[aria-sort$='scending']");return t&&t.getAttribute("aria-sort")||""}getFilters(){let t=[];return f(this,"thead tr.dg-head-filters input").forEach(i=>{t[i.dataset.name]=i.value}),t}clearFilters(){f(this,"thead tr.dg-head-filters input").forEach(e=>{e.value=""}),this.filterData()}filterData(){if(this.log("filter data"),this.page=1,this.options.server)this.reload();else{this.data=this.originalData?.slice()??[],f(this,"thead tr.dg-head-filters input").forEach(i=>{let s=i.value;if(s){let o=i.dataset.name;this.data=this.data.filter(r=>(r[o]+"").toLowerCase().indexOf(s.toLowerCase())!==-1)}}),this.pageChanged();let e=this.querySelector("thead tr.dg-head-columns th[aria-sort$='scending']");this.options.sort&&e?this.sortData():this.renderBody()}}sortData(t=null){if(this.log("sort data"),t&&this.getColProp(t.getAttribute("field"),"noSort")){this.log("sorting prevented because column is not sortable");return}if(this.plugins.ColumnResizer&&this.plugins.ColumnResizer.isResizing){this.log("sorting prevented because resizing");return}if(this.loading){this.log("sorting prevented because loading");return}if(t!==null){let e=i=>["dg-selectable","dg-actions","dg-responsive-toggle"].includes(i);this.querySelectorAll("thead tr:first-child th").forEach(i=>{[...i.classList].some(e)||i!==t&&i.setAttribute("aria-sort","none")}),!t.hasAttribute("aria-sort")||t.getAttribute("aria-sort")==="none"?t.setAttribute("aria-sort","ascending"):t.getAttribute("aria-sort")==="ascending"?t.setAttribute("aria-sort","descending"):t.getAttribute("aria-sort")==="descending"&&t.setAttribute("aria-sort","none")}else t=this.querySelector("thead tr.dg-head-columns th[aria-sort$='scending']");if(this.options.server)this.loadData().finally(()=>{this.renderBody()});else{let e=t?t.getAttribute("aria-sort"):"none";if(e==="none"){let i=[];this.originalData?.some(s=>(this.data.some(o=>JSON.stringify(s)===JSON.stringify(o)?(i.push(o),!0):!1),i.length===this.data.length)),this.data=i}else{let i=t.getAttribute("field");this.data.sort((s,o)=>{if(!isNaN(s[i])&&!isNaN(o[i]))return e==="ascending"?s[i]-o[i]:o[i]-s[i];let r=e==="ascending"?s[i].toUpperCase():o[i].toUpperCase(),l=e==="ascending"?o[i].toUpperCase():s[i].toUpperCase();switch(!0){case r>l:return 1;case ro("No url set"));let t=window.location.href;t.split("/").pop().includes(".")||(t+=t.endsWith("/")?"":"/");let e=new URL(this.options.url,t),i={r:Date.now()};return this.options.server&&(i[this.options.serverParams.start]=this.page-1,i[this.options.serverParams.length]=this.options.perPage,this.options.filter&&(i[this.options.serverParams.search]=this.getFilters()),i[this.options.serverParams.sort]=this.getSort()||"",i[this.options.serverParams.sortDir]=this.getSortDir(),this.meta?.[this.options.serverParams.paramsKey]&&(i=Object.assign(i,this.meta[this.options.serverParams.paramsKey]))),Y(e,i),fetch(e).then(s=>{if(!s.ok)throw new Error(s.statusText||C.networkError);return s.json()})}renderTable(){this.log("render table"),this.options.menu&&this.plugins.ContextMenu&&this.plugins.ContextMenu.createMenu();let t;this.renderHeader(),this.options.defaultSort&&(t=this.querySelector("thead tr.dg-head-columns th[field='"+this.options.defaultSort+"']")),t?this.sortData(t):this.renderBody(),this.renderFooter()}renderHeader(){this.log("render header");let t=this.querySelector("thead");this.createColumnHeaders(t),this.createColumnFilters(t),this.options.resizable&&this.plugins.ColumnResizer&&this.plugins.ColumnResizer.renderResizer(C.resizeColumn),x(this,"headerRendered")}renderFooter(){this.log("render footer");let t=this.querySelector("tfoot"),e=t.querySelector("td");t.removeAttribute("hidden"),d(e,"colspan",this.columnsLength(!0)),t.style.display=""}createColumnHeaders(t){let e=this.clientWidth,i=Math.round(e/this.columnsLength(!0)*2),s=0,o;o=A("tr"),this.headerRow=o,o.setAttribute("role","row"),o.setAttribute("aria-rowindex","1"),o.setAttribute("class","dg-head-columns");let r=t.querySelector("tr.dg-head-columns th");r||(r=A("th"),t.querySelector("tr").appendChild(r)),this.options.selectable&&this.plugins.SelectableRows&&this.plugins.SelectableRows.createHeaderCol(o),this.options.responsive&&this.plugins.ResponsiveGrid&&this.plugins.ResponsiveGrid.hasHiddenColumns()&&this.plugins.ResponsiveGrid.createHeaderCol(o),s=0;let l=0;if(this.options.columns.forEach(a=>{if(a.attr)return;let c=s+this.startColIndex(),h=A("th");h.setAttribute("scope","col"),h.setAttribute("role","columnheader button"),h.setAttribute("aria-colindex",""+c),h.setAttribute("id",N("dg-col-")),this.options.sort&&h.setAttribute("aria-sort","none"),h.setAttribute("field",a.field),this.plugins.ResponsiveGrid&&this.options.responsive&&d(h,"data-responsive",a.responsive||"");let u=T(a.title,r,!0)+20;h.dataset.minWidth=""+u,ft(h,a),h.tabIndex=0,h.textContent=a.title;let g=0;if(this.options.autosize&&this.plugins.AutosizeColumn){let m=Math.min(e-l,i);g=this.plugins.AutosizeColumn.computeSize(h,a,parseInt(h.dataset.minWidth),m)}else g=Math.max(parseInt(h.dataset.minWidth),parseInt(h.getAttribute("width")));d(h,"width",g),a.hidden?h.setAttribute("hidden",""):l+=g,this.options.reorder&&this.plugins.DraggableHeaders&&this.plugins.DraggableHeaders.makeHeaderDraggable(h),o.appendChild(h),s++}),le){this.log(`adjust width to fix size, ${t.offsetWidth} > ${e}`);let a=this.offsetWidth-this.clientWidth,c=t.offsetWidth-e-a;this.options.responsive&&this.plugins.ResponsiveGrid&&(c+=a),f(o,"th[width]").forEach(u=>{if($(u,"dg-not-resizable")||c<=0)return;let g=parseInt(u.getAttribute("width")),m=u.dataset.minWidth?parseInt(u.dataset.minWidth):0;if(g>m){let b=g-c;b{a.addEventListener("click",()=>this.sortData(a))}),d(this.querySelector("table"),"aria-colcount",this.columnsLength(!0))}createColumnFilters(t){let e=0,i;i=A("tr"),this.filterRow=i,i.setAttribute("role","row"),i.setAttribute("aria-rowindex","2"),i.setAttribute("class","dg-head-filters"),this.options.filter||i.setAttribute("hidden",""),this.options.selectable&&this.plugins.SelectableRows&&this.plugins.SelectableRows.createFilterCol(i),this.options.responsive&&this.plugins.ResponsiveGrid&&this.plugins.ResponsiveGrid.hasHiddenColumns()&&this.plugins.ResponsiveGrid.createFilterCol(i),this.options.columns.forEach(s=>{if(s.attr)return;let o=e+this.startColIndex(),r=t.querySelector("tr.dg-head-columns th[aria-colindex='"+o+"']");if(!r){console.warn("Related th not found",o);return}let l=A("th");l.setAttribute("aria-colindex",""+o);let a=A("input");a.type="text",a.inputMode="search",a.autocomplete="off",a.spellcheck=!1,a.dataset.name=s.field,a.id=N("dg-filter-"),a.setAttribute("aria-labelledby",r.getAttribute("id")),this.options.filter?a.tabIndex=0:l.tabIndex=0,s.hidden&&l.setAttribute("hidden",""),l.appendChild(a),i.appendChild(l),e++}),this.options.actions.length&&this.plugins.RowActions&&this.plugins.RowActions.makeActionFilter(i),t.replaceChild(i,t.querySelector("tr.dg-head-filters")),i.querySelectorAll("input").forEach(s=>{s.addEventListener("keypress",o=>{let r=o.keyCode||o.key;(r===13||r==="Enter")&&this.filterData.call(this)})})}renderBody(){this.log("render body");let t,e,i,s=A("tbody");this.data.forEach((r,l)=>{t=A("tr"),d(t,"role","row"),d(t,"hidden",""),d(t,"aria-rowindex",l+1),t.tabIndex=0,this.options.selectable&&this.plugins.SelectableRows&&this.plugins.SelectableRows.createDataCol(t),this.options.responsive&&this.plugins.ResponsiveGrid&&this.plugins.ResponsiveGrid.hasHiddenColumns()&&this.plugins.ResponsiveGrid.createDataCol(t),this.options.expand&&(t.classList.add("dg-expandable"),w(t,"click",a=>{this.plugins.ResponsiveGrid&&this.plugins.ResponsiveGrid.blockObserver(),ut(a.currentTarget,"dg-expanded"),this.plugins.ResponsiveGrid&&this.plugins.ResponsiveGrid.unblockObserver()})),i=0,this.options.columns.forEach(a=>{if(a||console.error("Empty column found!",this.options.columns),a.attr){r[a.field]&&(a.attr==="class"?S(t,r[a.field]):t.setAttribute(a.attr,r[a.field]));return}if(e=A("td"),e.setAttribute("role","gridcell"),e.setAttribute("aria-colindex",i+this.startColIndex()),ft(e,a),e.setAttribute("data-name",a.title),e.tabIndex=-1,a.editable&&this.plugins.EditableColumn)S(e,"dg-editable-col"),this.plugins.EditableColumn.makeEditableInput(e,a,r,l);else{let c=r[a.field]??"",h;switch(a.transform){case"uppercase":h=c.toUpperCase();break;case"lowercase":h=c.toLowerCase();break;default:h=c;break}if(a.format){if(a.defaultFormatValue!=null&&(h===""||h===null)&&(h=a.defaultFormatValue+""),typeof a.format=="string"&&h)e.innerHTML=q(a.format,Object.assign({_v:c,_tv:h},r));else if(a.format instanceof Function){let u=a.format.call(this,{column:a,rowData:r,cellData:h,td:e,tr:t});e.innerHTML=u||h||c}}else e.textContent=h}t.appendChild(e),i++}),this.options.actions.length&&this.plugins.RowActions&&this.plugins.RowActions.makeActionRow(t,r),s.appendChild(t)}),s.setAttribute("role","rowgroup");let o=this.querySelector("tbody");s.setAttribute("data-empty",o.getAttribute("data-empty")),this.querySelector("table").replaceChild(s,o),this.plugins.FixedHeight&&this.plugins.FixedHeight.createFakeRow(),this.paginate(),this.plugins.SelectableRows&&this.plugins.SelectableRows.shouldSelectAll(s),x(this,"bodyRendered")}paginate(){this.log("paginate");let t=this.totalRecords(),e=this.page||1,i,s=e*this.options.perPage,o=s-this.options.perPage+1,r=this.querySelector("tbody"),l=this.querySelector("tfoot");s>t&&(s=t),t||(o=0),r.querySelectorAll("tr").forEach(a=>{if(this.options.server){L(a,"hidden");return}i=Number(k(a,"aria-rowindex")),i>s||i=this.pages,this.btnLast.disabled=this.page>=this.pages),l.querySelector(".dg-low").textContent=o.toString(),l.querySelector(".dg-high").textContent=s.toString(),l.querySelector(".dg-total").textContent=""+this.totalRecords(),l.toggleAttribute("hidden",this.options.autohidePager&&this.options.perPage>this.totalRecords())}totalPages(){return Math.ceil(this.totalRecords()/this.options.perPage)}totalRecords(){return this.options.server?this.meta?.[this.options.serverParams.metaFilteredKey]||0:this.data.length}},_=B;var Z=class{constructor(t){this.grid=t}connected(){}disconnected(){}handleEvent(t){this[`on${t.type}`]&&this[`on${t.type}`](t)}},v=Z;var Q=class extends v{constructor(t){super(t),this.isResizing=!1}renderResizer(t){let e=this.grid,i=e.table,s=f(e,"thead tr.dg-head-columns th");s.forEach(o=>{if($(o,"dg-not-resizable"))return;let r=document.createElement("div");S(r,"dg-resizer"),r.ariaLabel=t,o.appendChild(r);let l=0,a=0,c=0,h=0,u=m=>{if(m.clientX>h)return;let b=a+(m.clientX-l);o.dataset.minWidth&&b>parseInt(o.dataset.minWidth)&&d(o,"width",b)},g=()=>{e.log("resized column"),setTimeout(()=>{this.isResizing=!1},0),F(r,"dg-resizer-active"),e.options.reorder&&(o.draggable=!0),o.style.overflow="hidden",H(document,"mousemove",u),H(document,"mouseup",g),x(e,"columnResized",{col:k(o,"field"),width:k(o,"width")})};w(r,"click",m=>{m.stopPropagation()}),w(r,"mousedown",m=>{m.stopPropagation(),this.isResizing=!0;let b=m.target,P=f(e,"dg-head-columns th").filter(p=>!p.hasAttribute("hidden")),y=P.findIndex(p=>p==b.parentNode);e.log("resize column"),S(r,"dg-resizer-active"),L(o,"draggable"),o.style.overflow="visible",r.style.height=i.offsetHeight-1+"px",l=m.clientX,a=o.offsetWidth,c=(P.length-y)*30,h=J(b).left+e.offsetWidth-c,d(o,"width",a);for(let p=0;py&&L(s[p],"width");w(document,"mousemove",u),w(document,"mouseup",g)})})}},mt=Q;function M(n,t,e="nodeName"){let i=n;for(;i[e]!=t;)i=i.parentElement;return i}var tt=class extends v{connected(){this.menu=this.grid.querySelector(".dg-menu")}disconnected(){this.grid.headerRow&&H(this.grid.headerRow,"contextmenu",this)}attachContextMenu(){let t=this.grid;w(t.headerRow,"contextmenu",this)}onchange(t){let e=this.grid,i=t.target,s=i.dataset.name;if(i.checked)e.showColumn(s);else{if(e.visibleColumns().length<=1){i.checked=!0;return}e.hideColumn(s)}}oncontextmenu(t){t.preventDefault();let e=this.grid,i=M(t.target,"THEAD"),s=this.menu,o=i.getBoundingClientRect(),r=t.clientX-o.left,l=t.clientY-o.top;s.style.top=`${l}px`,s.style.left=`${r}px`,L(s,"hidden"),r+150>o.width&&(r-=s.offsetWidth,s.style.left=`${r}px`);let a=c=>{s.contains(c.target)||(d(s,"hidden",""),H(document,"click",a))};w(document,"click",a)}createMenu(){let t=this.grid,e=this.menu;for(;e.lastChild;)e.removeChild(e.lastChild);e.addEventListener("change",this),t.options.columns.forEach(i=>{if(i.attr)return;let s=document.createElement("li"),o=document.createElement("label"),r=document.createElement("input");d(r,"type","checkbox"),d(r,"data-name",i.field),i.hidden||(r.checked=!0);let l=document.createTextNode(i.title);o.appendChild(r),o.appendChild(l),s.appendChild(o),e.appendChild(s)})}},bt=tt;var et=class extends v{makeHeaderDraggable(t){let e=this.grid;t.draggable=!0,w(t,"dragstart",i=>{if(e.plugins.ColumnResizer&&e.plugins.ColumnResizer.isResizing&&i.preventDefault){i.preventDefault();return}e.log("reorder col"),i.dataTransfer.effectAllowed="move",i.dataTransfer.setData("text/plain",i.target.getAttribute("aria-colindex"))}),w(t,"dragover",i=>(i.preventDefault&&i.preventDefault(),i.dataTransfer.dropEffect="move",!1)),w(t,"drop",i=>{i.stopPropagation&&i.stopPropagation();let s=i.target,o=M(s,"TH"),r=parseInt(i.dataTransfer.getData("text/plain")),l=parseInt(o.getAttribute("aria-colindex"));if(r===l){e.log("reordered col stayed the same");return}e.log("reordered col from "+r+" to "+l);let a=e.startColIndex(),c=e.options.columns[r-a];e.options.columns[r-a]=e.options.columns[l-a],e.options.columns[l-a]=c;let h=(u,g)=>{let m=g.parentNode.getAttribute("aria-rowindex"),b=e.querySelector(u+" tr[aria-rowindex='"+m+"'] [aria-colindex='"+l+"']");d(g,"aria-colindex",l),d(b,"aria-colindex",r);let R=document.createElement("th");g.parentNode.insertBefore(R,g),b.parentNode.replaceChild(g,b),R.parentNode.replaceChild(b,R)};return f(e,"thead th[aria-colindex='"+r+"']").forEach(u=>{h("thead",u)}),f(e,'tbody td[aria-colindex="'+r+'"]').forEach(u=>{h("tbody",u)}),e.options.columns=f(e,"thead tr.dg-head-columns th[field]").map(u=>e.options.columns.find(g=>g.field==k(u,"field"))),x(e,"columnReordered",{col:c.field,from:r,to:l}),!1})}},vt=et;var it=class extends v{constructor(t){super(t),this.touch=null}connected(){let t=this.grid;t.addEventListener("touchstart",this,{passive:!0}),t.addEventListener("touchmove",this,{passive:!0})}disconnected(){let t=this.grid;t.removeEventListener("touchstart",this),t.removeEventListener("touchmove",this)}ontouchstart(t){this.touch=t.touches[0]}ontouchmove(t){if(!this.touch)return;let e=this.grid,i=this.touch.clientX-t.touches[0].clientX,s=this.touch.clientY-t.touches[0].clientY;Math.abs(i)>Math.abs(s)&&(i>0?e.getNext():e.getPrev()),this.touch=null}},xt=it;var z="dg-selectable",Ct="dg-select-all",yt="form-check-input",st=class extends v{disconnected(){this.selectAll&&this.selectAll.removeEventListener("change",this)}getSelection(t=null){let e=this.grid,i=[];return f(e,`tbody .${z} input:checked`).forEach(o=>{let r=parseInt(o.dataset.id),l=e.data[r-1];l||console.warn(`Item ${r} not found`),t?i.push(l[t]):i.push(l)}),i}clearCheckboxes(t){if(!this.grid.options.selectVisibleOnly)return;f(t,`tr[hidden] .${z} input`).forEach(s=>{s.checked=!1}),this.selectAll.checked=!1}colIndex(){return this.grid.startColIndex()-2}createHeaderCol(t){let e=document.createElement("th");d(e,"scope","col"),d(e,"role","columnheader button"),d(e,"aria-colindex",this.colIndex()),e.classList.add(z,"dg-not-resizable","dg-not-sortable"),e.tabIndex=0,this.selectAll=document.createElement("input"),this.selectAll.type="checkbox",this.selectAll.classList.add(Ct),this.selectAll.classList.add(yt),this.selectAll.addEventListener("change",this);let i=document.createElement("label");i.appendChild(this.selectAll),e.appendChild(i),e.setAttribute("width","40"),t.appendChild(e)}createFilterCol(t){let e=document.createElement("th");d(e,"role","columnheader button"),d(e,"aria-colindex",this.colIndex()),e.classList.add(z),e.tabIndex=0,t.appendChild(e)}shouldSelectAll(t){this.selectAll&&(t.addEventListener("change",this),t.dispatchEvent(new Event("change")))}createDataCol(t){let e=document.createElement("td");d(e,"role","gridcell button"),d(e,"aria-colindex",this.colIndex()),e.classList.add(z);let i=document.createElement("input");i.dataset.id=t.getAttribute("aria-rowindex"),i.type="checkbox",i.classList.add(yt);let s=document.createElement("label");s.classList.add("dg-clickable-cell"),s.appendChild(i),e.appendChild(s),s.addEventListener("click",this),t.appendChild(e)}onclick(t){t.stopPropagation()}onchange(t){let e=this.grid;if($(t.target,Ct)){let i=e.options.selectVisibleOnly;f(e,`tbody .${z} input`).forEach(o=>{i&&!o.offsetWidth||(o.checked=this.selectAll.checked)}),x(e,"rowsSelected",{selection:this.getSelection()})}else{if(!t.target.closest(`.${z}`))return;let i=f(e,`tbody .${z} input[type=checkbox]`),s=i.filter(o=>o.checked);this.selectAll.checked=s.length==i.length,x(e,"rowsSelected",{selection:e.getSelection()})}}},At=st;var rt=class extends v{constructor(t){super(t),this.hasFixedHeight=!1,t.style.height&&(t.style.overflowY="auto",this.hasFixedHeight=!0)}createFakeRow(){let e=this.grid.querySelector("tbody"),i=document.createElement("tr");d(i,"role","row"),d(i,"hidden",""),i.classList.add("dg-fake-row"),i.tabIndex=0,e.appendChild(i)}get fakeRow(){return this.grid.querySelector(".dg-fake-row")}updateFakeRow(){let t=this.grid,e=this.fakeRow;if(!e||t.options.perPage>t.totalRecords()||t.page!==t.totalPages()||!t.options.autoheight)return;let i=t.options.perPage*t.rowHeight,s=t.querySelectorAll("tbody tr:not([hidden])").length,o=s>1?i-s*t.rowHeight:i;o>0?(d(e,"height",o),e.removeAttribute("hidden")):e.removeAttribute("height")}},Pt=rt;var nt=class extends v{computeSize(t,e,i,s){let o=this.grid;if(j(t,"width"))return k(t,"width");if(!o.data.length)return;let r=o.data[0],l=o.data[o.data.length-1],a=r[e.field]?r[e.field].toString():"",c=l[e.field]?l[e.field].toString():"";c.length>a.length&&(a=c);let h=0;return a.length<=6?h=i:a.length>50?h=s:h=T(a+"0000",t),h>s&&(h=s),h{clearTimeout(e),e=setTimeout(()=>{e=null,n(...i)},t)}}var E="dg-responsive",at;function $t(n){return n.sort((t,e)=>{let i=parseInt(t.dataset.responsive)||1;return(parseInt(e.dataset.responsive)||1)-i})}var Wt=ot(n=>{for(let t of n){let e=t.target,i=e.table;if(e.plugins.ResponsiveGrid.observerBlocked)return;let s=Array.isArray(t.contentBoxSize)?t.contentBoxSize[0]:t.contentBoxSize,o=parseInt(s.inlineSize),r=i.offsetWidth,l=f(e.headerRow,"th").reduce((P,y)=>P+y.offsetWidth,0),a=(l||r)-o-1,c=50,h=e.plugins.ResponsiveGrid.prevAction,u=$t(f(e.headerRow,"th[field]").reverse().filter(P=>P.dataset.responsive!=="0")),g=!1;if(e.log(`table is ${r}/${l} and available size is ${o}. Diff: ${a}`),a>0){if(h==="show")return;e.plugins.ResponsiveGrid.prevAction="hide";let P=a,y=u.filter(p=>!p.hasAttribute("hidden")&&p.hasAttribute("data-responsive"));if(y.length===0&&(y=u.filter(p=>!p.hasAttribute("hidden")),y.length===1))return;y.forEach(p=>{if(P<0)return;let I=p.offsetWidth,D=p.getAttribute("field");D&&(p.dataset.baseWidth=""+p.offsetWidth,e.hideColumn(D,!1),e.setColProp(D,"responsiveHidden",!0),g=!0,P-=I,P=Math.round(P))})}else{if(h==="hide")return;e.plugins.ResponsiveGrid.prevAction="show";let P=u.filter(p=>!p.hasAttribute("hidden")).reduce((p,I)=>{let D=I.dataset.minWidth?parseInt(I.dataset.minWidth):I.offsetWidth;return p+D},0)+c,y=o-P;u.slice().reverse().filter(p=>p.hasAttribute("hidden")).forEach(p=>{if(yy){y=-1;return}let D=p.getAttribute("field");D&&(e.showColumn(D,!1),e.setColProp(D,"responsiveHidden",!1),g=!0,y-=I,y=Math.round(y))})}let m=W(e.table,"tfoot"),b=f(e.table,".dg-footer > div").reduce((P,y)=>P+y.offsetWidth,0),R=m.offsetWidth-b;b>o?S(m,"dg-footer-compact"):R>250&&F(m,"dg-footer-compact"),g&&e.renderTable(),setTimeout(()=>{e.plugins.ResponsiveGrid.prevAction=null},1e3),e.table.style.visibility="visible"}},100),Et=new ResizeObserver(Wt),lt=class extends v{constructor(t){super(t),this.observerBlocked=!1,this.prevAction=null}connected(){this.grid.options.responsive&&this.observe()}disconnected(){this.unobserve()}observe(){this.grid.options.responsive&&(Et.observe(this.grid),this.grid.style.display="block",this.grid.style.overflowX="hidden")}unobserve(){Et.unobserve(this.grid),this.grid.style.display="unset",this.grid.style.overflowX="unset"}blockObserver(){this.observerBlocked=!0,at&&clearTimeout(at)}unblockObserver(){at=setTimeout(()=>{this.observerBlocked=!1},200)}hasHiddenColumns(){let t=!1;return this.grid.options.columns.forEach(e=>{e.responsiveHidden&&(t=!0)}),t}colIndex(){return this.grid.startColIndex()-1}createHeaderCol(t){if(!this.grid.options.responsiveToggle)return;let e=A("th",t);d(e,"scope","col"),d(e,"role","columnheader button"),d(e,"aria-colindex",this.colIndex()),d(e,"width","40"),e.classList.add(`${E}-toggle`,"dg-not-resizable","dg-not-sortable"),e.tabIndex=0}createFilterCol(t){if(!this.grid.options.responsiveToggle)return;let e=A("th",t);d(e,"role","columnheader button"),d(e,"aria-colindex",this.colIndex()),e.classList.add(`${E}-toggle`),e.tabIndex=0}createDataCol(t){if(!this.grid.options.responsiveToggle)return;let e=document.createElement("td");d(e,"role","gridcell button"),d(e,"aria-colindex",this.colIndex()),e.classList.add(`${E}-toggle`),e.innerHTML=`
`,t.appendChild(e),e.addEventListener("click",this),e.addEventListener("mousedown",this)}computeLabelWidth(){let t=0,e=0;for(;t<120;){e++;let i=W(this.grid,`.dg-head-columns th[aria-colindex="${e}"]`);if(i)t+=i.offsetWidth;else break}return t}onmousedown(t){t.preventDefault()}onclick(t){t.stopPropagation();let e=t.currentTarget,i=e.parentElement,s=W(e,`.${E}-open`),o=W(e,`.${E}-close`);if(this.blockObserver(),$(i,`${E}-expanded`)){F(i,`${E}-expanded`),s.style.display="unset",o.style.display="none";let l=i.nextElementSibling;f(l,`.${E}-hidden`).forEach(c=>{i.appendChild(c),d(c,"hidden")}),l.parentElement.removeChild(l)}else{L(i,`${E}-expanded`),s.style.display="none",o.style.display="unset";let l=A("tr");gt(l,i),L(l,`${E}-child-row`);let a=A("td",l);d(a,"colspan",this.grid.columnsLength(!0));let c=A("table",a);L(c,`${E}-table`);let h=f(i,`.${E}-hidden`),u=this.computeLabelWidth();h.forEach(g=>{let m=A("tr",c),b=g.dataset.name,R=A("th",m);R.style.width=`${u}px`,R.innerHTML=b,m.appendChild(g),S(g,"hidden")})}this.unblockObserver()}},St=lt;var dt=class extends v{hasActions(){return this.grid.options.actions.length>0}makeActionHeader(t){let e=document.createElement("th");d(e,"role","columnheader button"),d(e,"aria-colindex",this.grid.columnsLength(!0)),e.classList.add("dg-actions","dg-not-sortable","dg-not-resizable",this.actionClass),e.tabIndex=0,t.appendChild(e)}makeActionFilter(t){let e=document.createElement("th");e.setAttribute("role","columnheader button"),e.setAttribute("aria-colindex",""+this.grid.columnsLength(!0)),e.classList.add("dg-actions",this.actionClass),e.tabIndex=0,t.appendChild(e)}makeActionRow(t,e){let i=this.grid.labels,s=document.createElement("td");d(s,"role","gridcell"),d(s,"aria-colindex",this.grid.columnsLength(!0)),s.classList.add("dg-actions",this.actionClass),s.tabIndex=0;let o=document.createElement("button");o.classList.add("dg-actions-toggle"),o.innerHTML="\u2630",s.appendChild(o),w(o,"click",r=>{r.stopPropagation(),r.target.parentElement.classList.toggle("dg-actions-expand")}),this.grid.options.actions.forEach(r=>{let l=document.createElement("button");r.html?l.innerHTML=r.html:l.innerText=r.title??r.name,r.title&&(l.title=r.title),r.url&&(l.type="submit",l.formAction=q(r.url,e)),r.class&&l.classList.add(...r.class.split(" "));let a=c=>{if(c.stopPropagation(),r.confirm&&!confirm(i.areYouSure)){c.preventDefault();return}x(this.grid,"action",{data:e,action:r.name})};l.addEventListener("click",a),s.appendChild(l),r.default&&(t.classList.add("dg-actionable"),t.addEventListener("click",a))}),t.appendChild(s)}get actionClass(){return this.grid.options.actions.length<3&&!this.grid.options.collapseActions?"dg-actions-"+this.grid.options.actions.length:"dg-actions-more"}},Lt=dt;var ht=class extends v{makeEditableInput(t,e,i,s){let o=this.grid.getAttribute("id"),r=document.createElement("input");r.type=e.editableType||"text",r.type=="email"&&(r.inputMode="email"),r.type=="decimal"&&(r.type="text",r.inputMode="decimal"),r.autocomplete="off",r.spellcheck=!1,r.tabIndex=0,r.classList.add("dg-editable"),r.name=o.replace("-","_")+"["+(s+1)+"]["+e.field+"]",r.value=i[e.field],r.dataset.field=e.field,r.addEventListener("click",l=>l.stopPropagation()),r.addEventListener("keypress",l=>{if(l.type==="keypress"){let a=l.keyCode||l.key;(a===13||a==="Enter")&&(r.blur(),l.preventDefault())}}),r.addEventListener("blur",()=>{r.value!=i[r.dataset.field]&&(i[r.dataset.field]=r.value,x(this.grid,"edit",{data:i,value:r.value}))}),t.appendChild(r)}},kt=ht;_.registerPlugins({ColumnResizer:mt,ContextMenu:bt,DraggableHeaders:vt,TouchSupport:xt,SelectableRows:At,FixedHeight:Pt,AutosizeColumn:wt,ResponsiveGrid:St,RowActions:Lt,EditableColumn:kt});customElements.get("data-grid")||customElements.define("data-grid",_);var ii=_;export{ii as default}; +
`,t.appendChild(e),e.addEventListener("click",this),e.addEventListener("mousedown",this)}computeLabelWidth(){let t=0,e=0;for(;t<120;){e++;let i=W(this.grid,`.dg-head-columns th[aria-colindex="${e}"]`);if(i)t+=i.offsetWidth;else break}return t}onmousedown(t){t.preventDefault()}onclick(t){t.stopPropagation();let e=t.currentTarget,i=e.parentElement,s=W(e,`.${E}-open`),o=W(e,`.${E}-close`);if(this.blockObserver(),$(i,`${E}-expanded`)){F(i,`${E}-expanded`),s.style.display="unset",o.style.display="none";let l=i.nextElementSibling;f(l,`.${E}-hidden`).forEach(c=>{i.appendChild(c),d(c,"hidden")}),l.parentElement.removeChild(l)}else{S(i,`${E}-expanded`),s.style.display="none",o.style.display="unset";let l=A("tr");gt(l,i),S(l,`${E}-child-row`);let a=A("td",l);d(a,"colspan",this.grid.columnsLength(!0));let c=A("table",a);S(c,`${E}-table`);let h=f(i,`.${E}-hidden`),u=this.computeLabelWidth();h.forEach(g=>{let m=A("tr",c),b=g.dataset.name,R=A("th",m);R.style.width=`${u}px`,R.innerHTML=b,m.appendChild(g),L(g,"hidden")})}this.unblockObserver()}},Lt=lt;var dt=class extends v{hasActions(){return this.grid.options.actions.length>0}makeActionHeader(t){let e=document.createElement("th");d(e,"role","columnheader button"),d(e,"aria-colindex",this.grid.columnsLength(!0)),e.classList.add("dg-actions","dg-not-sortable","dg-not-resizable",this.actionClass),e.tabIndex=0,t.appendChild(e)}makeActionFilter(t){let e=document.createElement("th");e.setAttribute("role","columnheader button"),e.setAttribute("aria-colindex",""+this.grid.columnsLength(!0)),e.classList.add("dg-actions",this.actionClass),e.tabIndex=0,t.appendChild(e)}makeActionRow(t,e){let i=this.grid.labels,s=document.createElement("td");d(s,"role","gridcell"),d(s,"aria-colindex",this.grid.columnsLength(!0)),s.classList.add("dg-actions",this.actionClass),s.tabIndex=0;let o=document.createElement("button");o.classList.add("dg-actions-toggle"),o.innerHTML="\u2630",s.appendChild(o),w(o,"click",r=>{r.stopPropagation(),r.target.parentElement.classList.toggle("dg-actions-expand")}),this.grid.options.actions.forEach(r=>{let l=document.createElement("button");r.html?l.innerHTML=r.html:l.innerText=r.title??r.name,r.title&&(l.title=r.title),r.url&&(l.type="submit",l.formAction=q(r.url,e)),r.class&&l.classList.add(...r.class.split(" "));let a=c=>{if(c.stopPropagation(),r.confirm&&!confirm(i.areYouSure)){c.preventDefault();return}x(this.grid,"action",{data:e,action:r.name})};l.addEventListener("click",a),s.appendChild(l),r.default&&(t.classList.add("dg-actionable"),t.addEventListener("click",a))}),t.appendChild(s)}get actionClass(){return this.grid.options.actions.length<3&&!this.grid.options.collapseActions?"dg-actions-"+this.grid.options.actions.length:"dg-actions-more"}},St=dt;var ht=class extends v{makeEditableInput(t,e,i,s){let o=this.grid.getAttribute("id"),r=document.createElement("input");r.type=e.editableType||"text",r.type=="email"&&(r.inputMode="email"),r.type=="decimal"&&(r.type="text",r.inputMode="decimal"),r.autocomplete="off",r.spellcheck=!1,r.tabIndex=0,r.classList.add("dg-editable"),r.name=o.replace("-","_")+"["+(s+1)+"]["+e.field+"]",r.value=i[e.field],r.dataset.field=e.field,r.addEventListener("click",l=>l.stopPropagation()),r.addEventListener("keypress",l=>{if(l.type==="keypress"){let a=l.keyCode||l.key;(a===13||a==="Enter")&&(r.blur(),l.preventDefault())}}),r.addEventListener("blur",()=>{r.value!=i[r.dataset.field]&&(i[r.dataset.field]=r.value,x(this.grid,"edit",{data:i,value:r.value}))}),t.appendChild(r)}},kt=ht;_.registerPlugins({ColumnResizer:mt,ContextMenu:bt,DraggableHeaders:vt,TouchSupport:xt,SelectableRows:At,FixedHeight:Pt,AutosizeColumn:wt,ResponsiveGrid:Lt,RowActions:St,EditableColumn:kt});customElements.get("data-grid")||customElements.define("data-grid",_);var ii=_;export{ii as default}; //# sourceMappingURL=data-grid.min.js.map diff --git a/dist/data-grid.min.js.map b/dist/data-grid.min.js.map index 3c83707..c81eff7 100644 --- a/dist/data-grid.min.js.map +++ b/dist/data-grid.min.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../src/utils/camelize.js", "../src/utils/normalizeData.js", "../src/utils/shortcuts.js", "../src/core/base-element.js", "../src/utils/addSelectOption.js", "../src/utils/appendParamsToUrl.js", "../src/utils/convertArray.js", "../src/utils/elementOffset.js", "../src/utils/interpolate.js", "../src/utils/getTextWidth.js", "../src/utils/randstr.js", "../src/data-grid.js", "../src/core/base-plugin.js", "../src/plugins/column-resizer.js", "../src/utils/getParentElement.js", "../src/plugins/context-menu.js", "../src/plugins/draggable-headers.js", "../src/plugins/touch-support.js", "../src/plugins/selectable-rows.js", "../src/plugins/fixed-height.js", "../src/plugins/autosize-column.js", "../src/utils/debounce.js", "../src/plugins/responsive-grid.js", "../src/plugins/row-actions.js", "../src/plugins/editable-column.js", "../data-grid.js"], - "sourcesContent": ["/**\r\n * @param {String} str\r\n * @returns {String}\r\n */\r\nexport default function camelize(str) {\r\n return str.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g, (m, chr) => chr.toUpperCase());\r\n}\r\n", "/**\r\n * Parse data attribute and return properly typed data\r\n * @param {String} v\r\n * @returns {any}\r\n */\r\nexport default function normalizeData(v) {\r\n // Bool\r\n if (v === \"true\") {\r\n return true;\r\n }\r\n if (v === \"false\") {\r\n return false;\r\n }\r\n // Null or empty\r\n if (v === \"\" || v === \"null\") {\r\n return null;\r\n }\r\n // Numeric attributes\r\n if (v === Number(v).toString()) {\r\n return Number(v);\r\n }\r\n // Only attempt json parsing for array or objects\r\n if (v && [\"[\", \"{\"].includes(v.substring(0, 1))) {\r\n try {\r\n // In case we have only single quoted values, like ['one', 'two', 'three']\r\n if (v.indexOf('\"') === -1) {\r\n v = v.replace(/'/g, '\"');\r\n }\r\n return JSON.parse(decodeURIComponent(v));\r\n } catch {\r\n console.error(\"Failed to parse \" + v);\r\n return {};\r\n }\r\n }\r\n return v;\r\n}\r\n", "/**\r\n * @typedef FlexibleHTMLProps\r\n * @property {boolean} [checked] (HTMLInputElement)\r\n * @property {string} [value] (HTMLInputElement)\r\n * @property {number} [rowHeight] (HTMLTableRowElement)\r\n *\r\n * A flexible type HTMLElement type that does not require using instanceof all over the place\r\n * Make sure that your selector is indeed valid\r\n * Only includes most commons props\r\n * @typedef {HTMLElement & FlexibleHTMLProps} FlexibleHTMLElement\r\n */\r\n\r\n/**\r\n * Keep this as reference for easy documentation\r\n * @typedef {HTMLElement&HTMLInputElement&HTMLTableRowElement} MixedHTMLElement\r\n */\r\n\r\n/**\r\n * @typedef FlexibleEventProps\r\n * @property {FlexibleHTMLElement} target\r\n * @property {FlexibleHTMLElement} currentTarget\r\n * @property {DataTransfer} [dataTransfer] (DragEvent)\r\n * @property {number} [clientX] (MouseEvent)\r\n * @property {number} [clientY] (MouseEvent)\r\n *\r\n * @typedef {Event & FlexibleEventProps} FlexibleEvent\r\n */\r\n\r\n/**\r\n * Keep this as reference for easy documentation\r\n * @typedef {Event&MouseEvent&InputEvent&DragEvent&FocusEvent&KeyboardEvent&PointerEvent} MixedEvent\r\n */\r\n\r\n/**\r\n * @callback FlexibleListener\r\n * @param {FlexibleEvent} event\r\n */\r\n\r\nclass FlexibleEventListenerObject {\r\n /**\r\n * @param {FlexibleEvent} e\r\n */\r\n handleEvent(e) {}\r\n}\r\n\r\nconst supportedPassiveTypes = [\r\n \"scroll\",\r\n \"wheel\",\r\n \"touchstart\",\r\n \"touchmove\",\r\n \"touchenter\",\r\n \"touchend\",\r\n \"touchleave\",\r\n \"mouseout\",\r\n \"mouseleave\",\r\n \"mouseup\",\r\n \"mousedown\",\r\n \"mousemove\",\r\n \"mouseenter\",\r\n \"mousewheel\",\r\n \"mouseover\",\r\n];\r\n\r\n/**\r\n * Automatically set passive options based on type\r\n * @param {string} type\r\n * @returns {AddEventListenerOptions}\r\n */\r\nfunction passiveOpts(type) {\r\n if (supportedPassiveTypes.includes(type)) {\r\n return { passive: true };\r\n }\r\n return {};\r\n}\r\n\r\n/**\r\n * @param {Element} el\r\n * @param {String} name\r\n * @returns {any}\r\n */\r\nexport function getAttribute(el, name) {\r\n return el.getAttribute(name);\r\n}\r\n\r\n/**\r\n * @param {Element} el\r\n * @param {String} name\r\n * @returns {Boolean}\r\n */\r\nexport function hasAttribute(el, name) {\r\n return el.hasAttribute(name);\r\n}\r\n\r\n/**\r\n * @param {Element} el\r\n * @param {String} name\r\n * @param {any} v\r\n * @param {Boolean} check Prevent setting if attribute is already there\r\n */\r\nexport function setAttribute(el, name, v = \"\", check = false) {\r\n if (check && hasAttribute(el, name)) return;\r\n el.setAttribute(name, \"\" + v);\r\n}\r\n\r\n/**\r\n * @param {Element} el\r\n * @param {String} name\r\n */\r\nexport function removeAttribute(el, name) {\r\n if (hasAttribute(el, name)) {\r\n el.removeAttribute(name);\r\n }\r\n}\r\n\r\n/**\r\n * @param {EventTarget} el\r\n * @param {String} type\r\n * @param {EventListenerObject|FlexibleListener} listener\r\n */\r\nexport function on(el, type, listener) {\r\n el.addEventListener(type, listener, passiveOpts(type));\r\n}\r\n\r\n/**\r\n * @param {EventTarget} el\r\n * @param {String} type\r\n * @param {EventListenerObject|FlexibleListener} listener\r\n */\r\nexport function off(el, type, listener) {\r\n el.removeEventListener(type, listener, passiveOpts(type));\r\n}\r\n\r\n/**\r\n * @param {EventTarget} el\r\n * @param {String} type\r\n * @param {EventListenerObject|FlexibleListener} listener\r\n */\r\nexport function one(el, type, listener) {\r\n el.addEventListener(type, listener, {\r\n once: true,\r\n });\r\n}\r\n\r\n/**\r\n * @param {HTMLElement} el\r\n * @param {String} name\r\n * @param {any} data\r\n * @param {Boolean} bubbles\r\n */\r\nexport function dispatch(el, name, data = {}, bubbles = false) {\r\n let opts = {};\r\n if (bubbles) {\r\n opts.bubbles = true;\r\n }\r\n if (data) {\r\n opts.detail = data;\r\n }\r\n el.dispatchEvent(new CustomEvent(name, opts));\r\n}\r\n\r\n/**\r\n * @param {Element} el\r\n * @param {String} name\r\n * @returns {Boolean}\r\n */\r\nexport function hasClass(el, name) {\r\n return el.classList.contains(name);\r\n}\r\n\r\n/**\r\n * @param {Element} el\r\n * @param {String} name\r\n */\r\nexport function addClass(el, name) {\r\n el.classList.add(...name.split(\" \"));\r\n}\r\n\r\n/**\r\n * @param {Element} el\r\n * @param {String} name\r\n */\r\nexport function removeClass(el, name) {\r\n el.classList.remove(...name.split(\" \"));\r\n}\r\n\r\n/**\r\n * @param {Element} el\r\n * @param {String} name\r\n */\r\nexport function toggleClass(el, name) {\r\n el.classList.toggle(name);\r\n}\r\n\r\n/**\r\n * @param {String|HTMLElement} selector\r\n * @param {HTMLElement|Document} base\r\n * @returns {FlexibleHTMLElement|null}\r\n */\r\nexport function $(selector, base = document) {\r\n if (selector instanceof HTMLElement) {\r\n return selector;\r\n }\r\n return base.querySelector(selector);\r\n}\r\n\r\n/**\r\n * @param {String} selector\r\n * @param {Element|Document} base\r\n * @returns {Array}\r\n */\r\nexport function $$(selector, base = document) {\r\n return Array.from(base.querySelectorAll(selector));\r\n}\r\n\r\n/**\r\n * Easily retrieve untyped element\r\n * For actual type, prefer use of el.querySelector\r\n * @param {HTMLElement} el\r\n * @param {String|HTMLElement} selector\r\n * @returns {FlexibleHTMLElement}\r\n */\r\nexport function find(el, selector) {\r\n return $(selector, el);\r\n}\r\n\r\n/**\r\n * Easily retrieve untyped elements\r\n * For actual type, prefer use of el.querySelectorAll\r\n * @param {Element} el\r\n * @param {String} selector\r\n * @returns {Array}\r\n */\r\nexport function findAll(el, selector) {\r\n return $$(selector, el);\r\n}\r\n\r\n/**\r\n * @param {*} el\r\n * @returns {FlexibleHTMLElement}\r\n */\r\nexport function el(el) {\r\n return el;\r\n}\r\n\r\n/**\r\n * @template {keyof HTMLElementTagNameMap} K\r\n * @param {K} tagName\r\n * @param {HTMLElement} parent\r\n * @returns {HTMLElementTagNameMap[K]}\r\n */\r\nexport function ce(tagName, parent = null) {\r\n const el = document.createElement(tagName);\r\n if (parent) {\r\n parent.appendChild(el);\r\n }\r\n return el;\r\n}\r\n\r\n/**\r\n * @param {HTMLElement} newNode\r\n * @param {HTMLElement} existingNode\r\n */\r\nexport function insertAfter(newNode, existingNode) {\r\n existingNode.parentNode.insertBefore(newNode, existingNode.nextSibling);\r\n}\r\n", "import camelize from \"../utils/camelize.js\";\r\nimport normalizeData from \"../utils/normalizeData.js\";\r\nimport { dispatch, getAttribute, setAttribute } from \"../utils/shortcuts.js\";\r\n\r\n/**\r\n * Base element that does not contain any specific logic\r\n * related to this project but makes HTMLElemnt usable\r\n */\r\nclass BaseElement extends HTMLElement {\r\n /**\r\n * @param {Object} options\r\n */\r\n constructor(options = {}) {\r\n super();\r\n this.options = Object.assign({}, this.defaultOptions, this.normalizedDataset, options);\r\n\r\n this.log(\"constructor\");\r\n\r\n this.fireEvents = true;\r\n this._ready();\r\n\r\n this.log(\"ready\");\r\n }\r\n\r\n get defaultOptions() {\r\n return {};\r\n }\r\n\r\n /**\r\n * @param {String} opt\r\n * @returns {any}\r\n */\r\n getOption(opt) {\r\n return this.options[opt];\r\n }\r\n\r\n /**\r\n * @param {String} opt\r\n * @param {any} v\r\n */\r\n setOption(opt, v) {\r\n setAttribute(this, `data-${opt}`, v);\r\n }\r\n\r\n /**\r\n * @param {String} opt\r\n */\r\n toggleOption(opt) {\r\n setAttribute(this, `data-${opt}`, !this.getOption(opt));\r\n }\r\n\r\n get normalizedDataset() {\r\n let jsonConfig = this.dataset.config ? JSON.parse(this.dataset.config) : {};\r\n let data = { ...this.dataset };\r\n for (var key in data) {\r\n if (key == \"config\") {\r\n continue;\r\n }\r\n data[key] = normalizeData(data[key]);\r\n }\r\n // Once normalized, merge into json config\r\n Object.assign(data, jsonConfig);\r\n return data;\r\n }\r\n\r\n /**\r\n * @returns {String}\r\n */\r\n static template() {\r\n return \"\";\r\n }\r\n\r\n /**\r\n * This is called at the end of constructor. Extend in subclass if needed.\r\n */\r\n _ready() {}\r\n\r\n /**\r\n * @param {String|Error} message\r\n */\r\n log(message) {\r\n if (this.options.debug) {\r\n console.log(\"[\" + getAttribute(this, \"id\") + \"] \" + message);\r\n }\r\n }\r\n\r\n /**\r\n * Handle events within the component\r\n * @link https://gist.github.com/WebReflection/ec9f6687842aa385477c4afca625bbf4#handling-events\r\n * @param {Event} event\r\n */\r\n handleEvent(event) {\r\n if (this[`on${event.type}`]) {\r\n this[`on${event.type}`](event);\r\n }\r\n }\r\n\r\n /**\r\n * This is called when connected. Extend in subclass if needed.\r\n */\r\n _connected() {}\r\n\r\n connectedCallback() {\r\n // ensure whenDefined callbacks run first\r\n setTimeout(() => {\r\n this.log(\"connectedCallback\");\r\n\r\n // Append only when labels had the opportunity to be set\r\n // Don't use shadow dom as it makes theming super hard\r\n const template = document.createElement(\"template\");\r\n // @ts-ignore\r\n template.innerHTML = this.constructor.template();\r\n this.appendChild(template.content.cloneNode(true));\r\n\r\n this._connected();\r\n // @link https://gist.github.com/WebReflection/ec9f6687842aa385477c4afca625bbf4#life-cycle-events\r\n dispatch(this, \"connected\");\r\n }, 0);\r\n }\r\n\r\n /**\r\n * This is called when disconnected. Extend in subclass if needed.\r\n */\r\n _disconnected() {}\r\n\r\n disconnectedCallback() {\r\n this.log(\"disconnectedCallback\");\r\n this._disconnected();\r\n // @link https://gist.github.com/WebReflection/ec9f6687842aa385477c4afca625bbf4#life-cycle-events\r\n dispatch(this, \"disconnected\");\r\n }\r\n\r\n /**\r\n * @link https://gist.github.com/WebReflection/ec9f6687842aa385477c4afca625bbf4#a-props-like-accessor\r\n * @returns {Object}\r\n */\r\n get transformAttributes() {\r\n return {};\r\n }\r\n\r\n /**\r\n * This is only meant to work with data attributes\r\n * This allows us to have properties that reflect automatically in the component\r\n * @link https://gist.github.com/WebReflection/ec9f6687842aa385477c4afca625bbf4#reflected-dataset-attributes\r\n * @param {String} attributeName\r\n * @param {String} oldValue\r\n * @param {String} newValue\r\n */\r\n attributeChangedCallback(attributeName, oldValue, newValue) {\r\n // It didn't change\r\n if (oldValue === newValue) {\r\n return;\r\n }\r\n\r\n this.log(\"attributeChangedCallback: \" + attributeName);\r\n\r\n let isOption = false;\r\n const transformer = this.transformAttributes[attributeName] ?? normalizeData;\r\n\r\n // Data attributes are mapped to options while other attributes are mapped as properties\r\n if (attributeName.indexOf(\"data-\") === 0) {\r\n attributeName = attributeName.slice(5);\r\n isOption = true;\r\n }\r\n attributeName = camelize(attributeName);\r\n if (isOption) {\r\n this.options[attributeName] = transformer(newValue);\r\n } else {\r\n this[attributeName] = transformer(newValue);\r\n }\r\n\r\n // Fire internal event\r\n if (this.fireEvents && this[`${attributeName}Changed`]) {\r\n this[`${attributeName}Changed`]();\r\n }\r\n }\r\n}\r\n\r\nexport default BaseElement;\r\n", "/**\r\n * @param {HTMLSelectElement} el\r\n * @param {String} value\r\n * @param {String} label\r\n * @param {Boolean} checked\r\n */\r\nexport default function addSelectOption(el, value, label, checked = false) {\r\n let opt = document.createElement(\"option\");\r\n opt.value = \"\" + value;\r\n if (checked) {\r\n opt.selected = true;\r\n }\r\n opt.label = label;\r\n el.appendChild(opt);\r\n}\r\n", "/**\r\n * @param {URL} url\r\n * @param {Object} params\r\n */\r\nexport default function appendParamsToUrl(url, params = {}) {\r\n Object.keys(params).forEach((key) => {\r\n if (Array.isArray(params[key])) {\r\n // @ts-ignore\r\n Object.keys(params[key]).forEach((k) => url.searchParams.append(isNaN(k) ? `${key}[${k}]` : key, params[key][k]));\r\n } else {\r\n url.searchParams.append(key, params[key]);\r\n }\r\n });\r\n}\r\n", "/**\r\n * Force value as arrays\r\n * @param {String|Array} v\r\n * @returns {Array}\r\n */\r\nexport default function convertArray(v) {\r\n if (typeof v === \"string\") {\r\n if (v[0] === \"[\") {\r\n // \"['my', 'value']\" would fail as a json\r\n if (v.indexOf('\"') === -1) {\r\n v = v.replace(/'/g, '\"');\r\n }\r\n return JSON.parse(v);\r\n }\r\n\r\n return v.split(\",\");\r\n }\r\n if (!Array.isArray(v)) {\r\n console.error(\"Invalid array\", v);\r\n return [];\r\n }\r\n return v;\r\n}\r\n", "/**\r\n * @param {HTMLElement} el\r\n * @returns {Object}\r\n */\r\nexport default function elementOffset(el) {\r\n var rect = el.getBoundingClientRect(),\r\n scrollLeft = window.pageXOffset || document.documentElement.scrollLeft,\r\n scrollTop = window.pageYOffset || document.documentElement.scrollTop;\r\n return { top: rect.top + scrollTop, left: rect.left + scrollLeft };\r\n}\r\n", "/**\r\n * Replace element within {} by their data value\r\n * @param {String} str\r\n * @param {Object} data\r\n * @returns {String}\r\n */\r\nexport default function interpolate(str, data) {\r\n return str.replace(/\\{([^}]+)?\\}/g, function ($1, $2) {\r\n return data[$2];\r\n });\r\n}\r\n", "/**\r\n * Uses canvas.measureText to compute and return the width of the given text of given font in pixels.\r\n * Getting computed styles only works for dom that are added in the dom\r\n * @see https://stackoverflow.com/questions/118241/calculate-text-width-with-javascript/21015393#21015393\r\n * @param {String} text The text to be rendered.\r\n * @param {Element} el Target element (defaults to body)\r\n * @param {Boolean} withPadding Include padding on element\r\n * @returns {Number}\r\n */\r\nexport default function getTextWidth(text, el = document.body, withPadding = false) {\r\n if (!el) {\r\n el = document.createElement(\"div\");\r\n }\r\n const styles = window.getComputedStyle(el);\r\n const fontWeight = styles.getPropertyValue(\"font-weight\") || \"normal\";\r\n const fontSize = styles.getPropertyValue(\"font-size\") || \"1rem\";\r\n const fontFamily = styles.getPropertyValue(\"font-family\") || \"Arial\";\r\n\r\n let padding = 0;\r\n if (withPadding) {\r\n const paddingLeft = styles.getPropertyValue(\"padding-left\") || \"0\";\r\n const paddingRight = styles.getPropertyValue(\"padding-right\") || \"0\";\r\n padding = parseInt(paddingLeft) + parseInt(paddingRight);\r\n }\r\n\r\n // re-use canvas object for better performance\r\n // @ts-ignore\r\n const canvas = getTextWidth.canvas || (getTextWidth.canvas = document.createElement(\"canvas\"));\r\n const context = canvas.getContext(\"2d\");\r\n context.font = `${fontWeight} ${fontSize} ${fontFamily}`;\r\n const metrics = context.measureText(text);\r\n return parseInt(metrics.width) + padding;\r\n}\r\n", "/**\r\n * @param {String} prefix\r\n * @returns {String}\r\n */\r\nexport default function randstr(prefix) {\r\n return Math.random()\r\n .toString(36)\r\n .replace(\"0.\", prefix || \"\");\r\n}\r\n", "/**\n * Data Grid Web component\n *\n * Credits for inspiration\n * @link https://github.com/riverside/zino-grid\n */\n\"use strict\";\n\nimport BaseElement from \"./core/base-element.js\";\nimport addSelectOption from \"./utils/addSelectOption.js\";\nimport appendParamsToUrl from \"./utils/appendParamsToUrl.js\";\nimport camelize from \"./utils/camelize.js\";\nimport convertArray from \"./utils/convertArray.js\";\nimport elementOffset from \"./utils/elementOffset.js\";\nimport interpolate from \"./utils/interpolate.js\";\nimport getTextWidth from \"./utils/getTextWidth.js\";\nimport randstr from \"./utils/randstr.js\";\nimport {\n dispatch,\n find,\n findAll,\n hasClass,\n removeAttribute,\n getAttribute,\n setAttribute,\n addClass,\n toggleClass,\n on,\n ce,\n} from \"./utils/shortcuts.js\";\n\n/**\n * Column definition\n * @typedef Column\n * @property {String} field - the key in the data\n * @property {String} title - the title to display in the header (defaults to \"field\" if not set)\n * @property {Number} [width] - the width of the column (auto otherwise)\n * @property {String} [class] - class to set on the column (target body or header with th.class or td.class)\n * @property {String} [attr] - don't render the column and set a matching attribute on the row with the value of the field\n * @property {Boolean} [hidden] - hide the column\n * @property {Boolean} [noSort] - allow disabling sort for a given column\n * @property {String | Function} [format] - custom data formatting\n * @property {String} [defaultFormatValue] - default value to use for formatting\n * @property {String} [transform] - custom value transformation\n * @property {Boolean} [editable] - replace with input (EditableColumn module)\n * @property {String} [editableType] - type of input (EditableColumn module)\n * @property {Number} [responsive] - the higher the value, the sooner it will be hidden, disable with 0 (ResponsiveGrid module)\n * @property {Boolean} [responsiveHidden] - hidden through responsive module (ResponsiveGrid module)\n */\n\n/**\n * Row action\n * @typedef Action\n * @property {String} title - the title of the button\n * @property {String} name - the name of the action\n * @property {String} class - the class for the button\n * @property {String} url - link for the action\n * @property {String} html - custom button data\n * @property {Boolean} [confirm] - needs confirmation\n * @property {Boolean} default - is the default row action\n */\n\n/** @typedef {import('./plugins/autosize-column').default} AutosizeColumn */\n/** @typedef {import('./plugins/column-resizer').default} ColumnResizer */\n/** @typedef {import('./plugins/context-menu').default} ContextMenu */\n/** @typedef {import('./plugins/draggable-headers').default} DraggableHeaders */\n/** @typedef {import('./plugins/editable-column').default} EditableColumn */\n/** @typedef {import('./plugins/fixed-height').default} FixedHeight */\n/** @typedef {import('./plugins/responsive-grid').default} ResponsiveGrid */\n/** @typedef {import('./plugins/row-actions').default} RowActions */\n/** @typedef {import('./plugins/selectable-rows').default} SelectableRows */\n/** @typedef {import('./plugins/touch-support').default} TouchSupport */\n\n/**\n * These plugins are all optional\n * @typedef {Object} Plugins\n * @property {ColumnResizer} [ColumnResizer] resize handlers in the headers\n * @property {ContextMenu} [ContextMenu] menu to show/hide columns\n * @property {DraggableHeaders} [DraggableHeaders] draggable headers columns\n * @property {EditableColumn} [EditableColumn] draggable headers columns\n * @property {TouchSupport} [TouchSupport] touch swipe\n * @property {SelectableRows} [SelectableRows] create a column with checkboxes to select rows\n * @property {FixedHeight} [FixedHeight] allows having fixed height tables\n * @property {AutosizeColumn} [AutosizeColumn] compute ideal width based on column content\n * @property {ResponsiveGrid} [ResponsiveGrid] hide/show column on the fly\n * @property {RowActions} [RowActions] add action on rows\n */\n\n/**\n * Parameters to pass along or receive from the server\n * @typedef ServerParams\n * @property {String} serverParams.start\n * @property {String} serverParams.length\n * @property {String} serverParams.search\n * @property {String} serverParams.sort\n * @property {String} serverParams.sortDir\n * @property {String} serverParams.dataKey\n * @property {String} serverParams.metaKey\n * @property {String} serverParams.metaTotalKey\n * @property {String} serverParams.metaFilteredKey\n * @property {String} serverParams.optionsKey\n * @property {String} serverParams.paramsKey\n */\n\n/**\n * Available data grid options, plugins included\n * @typedef Options\n * @property {?String} id Custom id for the grid\n * @property {?String} url An URL with data to display in JSON format\n * @property {Boolean} debug Log actions in DevTools console\n * @property {Boolean} filter Allows a filtering functionality\n * @property {Boolean} sort Allows a sort by column functionality\n * @property {String} defaultSort Default sort field if sorting is enabled\n * @property {Boolean} server Is a server side powered grid\n * @property {ServerParams} serverParams Describe keys passed to the server backend\n * @property {String} dir Dir\n * @property {Array} perPageValues Available per page options\n * @property {Boolean} hidePerPage Hides the page size select element\n * @property {Column[]} columns Available columns\n * @property {Number} defaultPage Starting page\n * @property {Number} perPage Number of records displayed per page (page size)\n * @property {Boolean} expand Allow cell content to spawn over multiple lines\n * @property {Action[]} actions Row actions (RowActions module)\n * @property {Boolean} collapseActions Group actions (RowActions module)\n * @property {Boolean} resizable Make columns resizable (ColumnResizer module)\n * @property {Boolean} selectable Allow selecting rows with a checkbox (SelectableRows module)\n * @property {Boolean} selectVisibleOnly Select all only selects visible rows (SelectableRows module)\n * @property {Boolean} autosize Compute column sizes based on given data (Autosize module)\n * @property {Boolean} autoheight Adjust height so that it matches table size (FixedHeight module)\n * @property {Boolean} autohidePager auto-hides the pager when number of records falls below the selected page size\n * @property {Boolean} menu Right click menu on column headers (ContextMenu module)\n * @property {Boolean} reorder Allows a column reordering functionality (DraggableHeaders module)\n * @property {Boolean} responsive Change display mode on small screens (ResponsiveGrid module)\n * @property {Boolean} responsiveToggle Show toggle column (ResponsiveGrid module)\n */\n\n/**\n * Available labels that can be translated\n * @typedef Labels\n * @property {String} itemsPerPage\n * @property {String} gotoPage\n * @property {String} gotoFirstPage\n * @property {String} gotoPrevPage\n * @property {String} gotoNextPage\n * @property {String} gotoLastPage\n * @property {String} of\n * @property {String} items\n * @property {String} resizeColumn\n * @property {String} noData\n * @property {String} areYouSure\n * @property {String} networkError\n */\n\n/**\n * List of registered plugins\n * @type {Plugins}\n */\nlet plugins = {};\n\n/**\n * @type {Labels}\n */\nlet labels = {\n itemsPerPage: \"Items per page\",\n gotoPage: \"Go to page\",\n gotoFirstPage: \"Go to first page\",\n gotoPrevPage: \"Go to previous page\",\n gotoNextPage: \"Go to next page\",\n gotoLastPage: \"Go to last page\",\n of: \"of\",\n items: \"items\",\n resizeColumn: \"Resize column\",\n noData: \"No data\",\n areYouSure: \"Are you sure?\",\n networkError: \"Network response error\",\n};\n\n/**\n * Column definition will update some props on the html element\n * @param {HTMLElement} el\n * @param {Column} column\n */\nfunction applyColumnDefinition(el, column) {\n if (column.width) {\n setAttribute(el, \"width\", column.width);\n }\n if (column.class) {\n addClass(el, column.class);\n }\n if (column.hidden) {\n setAttribute(el, \"hidden\", \"\");\n if (column.responsiveHidden) {\n addClass(el, \"dg-responsive-hidden\");\n }\n }\n}\n\n/**\n */\nclass DataGrid extends BaseElement {\n _ready() {\n setAttribute(this, \"id\", this.options.id ?? randstr(\"el-\"), true);\n\n /**\n * The grid displays that data\n * @type {Array}\n */\n this.data = [];\n /**\n * We store the original data in this\n * @type {Array}\n */\n this.originalData; // declared uninitialized to allow data preloading before fetch.\n\n // Make the IDE happy\n /**\n * @type {Options}\n */\n this.options = this.options || this.defaultOptions;\n\n // Init values\n this.fireEvents = false;\n this.page = this.options.defaultPage || 1;\n this.pages = 0;\n this.meta; // declared uninitialized to allow data preloading before fetch.\n /**\n * @type {Plugins}\n */\n this.plugins = {};\n // Init plugins\n for (const [pluginName, pluginClass] of Object.entries(plugins)) {\n // @ts-ignore until we can set typeof import ...\n this.plugins[pluginName] = new pluginClass(this);\n }\n\n // Expose options as observed attributes in the dom\n // Do it when fireEvents is disabled to avoid firing change callbacks\n for (const attr of DataGrid.observedAttributes) {\n if (attr.indexOf(\"data-\") === 0) {\n setAttribute(this, attr, this.options[camelize(attr.slice(5))]);\n }\n }\n }\n\n static template() {\n return `\n\n \n \n \n \n \n \n \n \n \n \n \n
\n`;\n }\n\n /**\n * @returns {Labels}\n */\n get labels() {\n return labels;\n }\n\n /**\n * @returns {Labels}\n */\n static getLabels() {\n return labels;\n }\n\n /**\n * @param {Object} v\n */\n static setLabels(v) {\n labels = Object.assign(labels, v);\n }\n\n /**\n * @returns {Column}\n */\n get defaultColumn() {\n return {\n field: \"\",\n title: \"\",\n width: 0,\n class: \"\",\n attr: \"\",\n hidden: false,\n editable: false,\n noSort: false,\n responsive: 1,\n responsiveHidden: false,\n format: \"\",\n transform: \"\",\n };\n }\n\n /**\n * @returns {Options}\n */\n get defaultOptions() {\n return {\n id: null,\n url: null,\n perPage: 10,\n debug: false,\n filter: false,\n menu: false,\n sort: false,\n server: false,\n serverParams: {\n start: \"start\",\n length: \"length\",\n search: \"search\",\n sort: \"sort\",\n sortDir: \"sortDir\",\n dataKey: \"data\",\n metaKey: \"meta\",\n metaTotalKey: \"total\",\n metaFilteredKey: \"filtered\",\n optionsKey: \"options\",\n paramsKey: \"params\",\n },\n defaultSort: \"\",\n reorder: false,\n dir: \"ltr\",\n perPageValues: [10, 25, 50, 100, 250],\n hidePerPage: false,\n columns: [],\n actions: [],\n collapseActions: false,\n selectable: false,\n selectVisibleOnly: true,\n defaultPage: 1,\n resizable: false,\n autosize: true,\n expand: false,\n autoheight: true,\n autohidePager: false,\n responsive: false,\n responsiveToggle: true,\n };\n }\n\n /**\n * @param {Plugins} list\n */\n static registerPlugins(list) {\n plugins = list;\n }\n\n /**\n * @param {String} plugin\n */\n static unregisterPlugins(plugin = null) {\n if (plugin === null) {\n plugins = {};\n } else {\n delete plugins[plugin];\n }\n }\n\n /**\n * @returns {Plugins}\n */\n static registeredPlugins() {\n return plugins;\n }\n\n /**\n * @param {Object|Array} columns\n * @returns {Column[]}\n */\n convertColumns(columns) {\n let cols = [];\n // Convert key:value objects to actual columns\n if (typeof columns === \"object\" && !Array.isArray(columns)) {\n Object.keys(columns).forEach((key) => {\n let col = Object.assign({}, this.defaultColumn);\n col.title = columns[key];\n col.field = key;\n cols.push(col);\n });\n } else {\n columns.forEach((item) => {\n let col = Object.assign({}, this.defaultColumn);\n if (typeof item === \"string\") {\n col.title = item;\n col.field = item;\n } else if (typeof item === \"object\") {\n col = Object.assign(col, item);\n if (!col.field) {\n console.error(\"Invalid column definition\", item);\n }\n if (!col.title) {\n col.title = col.field;\n }\n } else {\n console.error(\"Column definition must be a string or an object\");\n }\n cols.push(col);\n });\n }\n return cols;\n }\n\n /**\n * @link https://gist.github.com/WebReflection/ec9f6687842aa385477c4afca625bbf4#reflected-dom-attributes\n * @returns {Array}\n */\n static get observedAttributes() {\n return [\n \"page\",\n \"data-filter\",\n \"data-sort\",\n \"data-debug\",\n \"data-reorder\",\n \"data-menu\",\n \"data-selectable\",\n \"data-url\",\n \"data-per-page\",\n \"data-responsive\",\n ];\n }\n\n get transformAttributes() {\n return {\n columns: (v) => this.convertColumns(convertArray(v)),\n actions: (v) => convertArray(v),\n defaultPage: (v) => parseInt(v),\n perPage: (v) => parseInt(v),\n };\n }\n\n get page() {\n return parseInt(this.getAttribute(\"page\"));\n }\n\n set page(val) {\n setAttribute(this, \"page\", this.constrainPageValue(val));\n }\n\n urlChanged() {\n this.loadData().then(() => {\n this.configureUi();\n });\n }\n\n constrainPageValue(v) {\n if (this.pages < v) {\n v = this.pages;\n }\n if (v < 1 || !v) {\n v = 1;\n }\n return v;\n }\n\n fixPage() {\n this.pages = this.totalPages();\n this.page = this.constrainPageValue(this.page);\n\n // Show current page in input\n setAttribute(this.inputPage, \"max\", this.pages);\n this.inputPage.value = \"\" + this.page;\n this.inputPage.disabled = this.pages < 2;\n }\n\n pageChanged() {\n this.reload();\n }\n\n responsiveChanged() {\n if (!this.plugins.ResponsiveGrid) {\n return;\n }\n if (this.options.responsive) {\n this.plugins.ResponsiveGrid.observe();\n } else {\n this.plugins.ResponsiveGrid.unobserve();\n }\n }\n\n menuChanged() {\n this.renderHeader();\n }\n\n /**\n * This is the callback for the select control\n */\n changePerPage() {\n this.options.perPage = parseInt(this.selectPerPage.options[this.selectPerPage.selectedIndex].value);\n this.perPageChanged();\n }\n\n /**\n * This is the actual event triggered on attribute change\n */\n perPageChanged() {\n // Refresh UI\n if (this.options.perPage !== parseInt(this.selectPerPage.options[this.selectPerPage.selectedIndex].value)) {\n this.perPageValuesChanged();\n }\n // Make sure current page is still valid\n let updatePage = this.page;\n while (updatePage > 1 && this.page * this.options.perPage > this.totalRecords()) {\n updatePage--;\n }\n if (updatePage != this.page) {\n // Triggers pageChanged, which will trigger reload\n this.page = updatePage;\n } else {\n // Simply reload current page\n this.reload(() => {\n // Preserve distance between top of page and select control if no fixed height\n if (!this.plugins.FixedHeight || !this.plugins.FixedHeight.hasFixedHeight) {\n this.selectPerPage.scrollIntoView();\n }\n });\n }\n }\n\n dirChanged() {\n setAttribute(this, \"dir\", this.options.dir);\n }\n\n defaultSortChanged() {\n this.sortChanged();\n }\n\n /**\n * Populate the select dropdown according to options\n */\n perPageValuesChanged() {\n if (!this.selectPerPage) {\n return;\n }\n while (this.selectPerPage.lastChild) {\n this.selectPerPage.removeChild(this.selectPerPage.lastChild);\n }\n this.options.perPageValues.forEach((v) => {\n addSelectOption(this.selectPerPage, v, v, v === this.options.perPage);\n });\n }\n\n _connected() {\n /**\n * @type {HTMLTableElement}\n */\n this.table = this.querySelector(\"table\");\n /**\n * @type {HTMLInputElement}\n */\n this.btnFirst = this.querySelector(\".dg-btn-first\");\n /**\n * @type {HTMLInputElement}\n */\n this.btnPrev = this.querySelector(\".dg-btn-prev\");\n /**\n * @type {HTMLInputElement}\n */\n this.btnNext = this.querySelector(\".dg-btn-next\");\n /**\n * @type {HTMLInputElement}\n */\n this.btnLast = this.querySelector(\".dg-btn-last\");\n /**\n * @type {HTMLSelectElement}\n */\n this.selectPerPage = this.querySelector(\".dg-select-per-page\");\n /**\n * @type {HTMLInputElement}\n */\n this.inputPage = this.querySelector(\".dg-input-page\");\n\n this.getFirst = this.getFirst.bind(this);\n this.getPrev = this.getPrev.bind(this);\n this.getNext = this.getNext.bind(this);\n this.getLast = this.getLast.bind(this);\n this.changePerPage = this.changePerPage.bind(this);\n this.gotoPage = this.gotoPage.bind(this);\n\n this.btnFirst.addEventListener(\"click\", this.getFirst);\n this.btnPrev.addEventListener(\"click\", this.getPrev);\n this.btnNext.addEventListener(\"click\", this.getNext);\n this.btnLast.addEventListener(\"click\", this.getLast);\n this.selectPerPage.addEventListener(\"change\", this.changePerPage);\n this.selectPerPage.toggleAttribute(\"hidden\", this.options.hidePerPage);\n this.inputPage.addEventListener(\"input\", this.gotoPage);\n\n Object.values(this.plugins).forEach((plugin) => {\n plugin.connected();\n });\n\n // Display even if we don't have data\n this.dirChanged();\n this.perPageValuesChanged();\n\n // @ts-ignore\n this.loadData().finally(() => {\n this.configureUi();\n\n this.sortChanged();\n this.classList.add(\"dg-initialized\"); //acts as a flag to prevent unnecessary server calls down the chain.\n\n this.filterChanged();\n this.reorderChanged();\n\n this.dirChanged();\n this.perPageValuesChanged();\n this.pageChanged();\n\n this.fireEvents = true; // We can now fire attributeChangedCallback events\n\n this.log(\"initialized\");\n });\n }\n\n _disconnected() {\n this.btnFirst.removeEventListener(\"click\", this.getFirst);\n this.btnPrev.removeEventListener(\"click\", this.getPrev);\n this.btnNext.removeEventListener(\"click\", this.getNext);\n this.btnLast.removeEventListener(\"click\", this.getLast);\n this.selectPerPage.removeEventListener(\"change\", this.changePerPage);\n this.inputPage.removeEventListener(\"input\", this.gotoPage);\n\n Object.values(this.plugins).forEach((plugin) => {\n plugin.disconnected();\n });\n }\n\n /**\n * @param {string} field\n * @returns {Column}\n */\n getCol(field) {\n let found = null;\n this.options.columns.forEach((col) => {\n if (col.field == field) {\n found = col;\n }\n });\n return found;\n }\n\n getColProp(field, prop) {\n const c = this.getCol(field);\n return c ? c[prop] : null;\n }\n\n setColProp(field, prop, val) {\n const c = this.getCol(field);\n if (c) {\n c[prop] = val;\n }\n }\n\n visibleColumns() {\n return this.options.columns.filter((col) => {\n return !col.hidden;\n });\n }\n\n hiddenColumns() {\n return this.options.columns.filter((col) => {\n return col.hidden === true;\n });\n }\n\n showColumn(field, render = true) {\n this.setColProp(field, \"hidden\", false);\n\n // We need to render the whole table otherwise layout fixed won't do its job\n if (render) this.renderTable();\n\n dispatch(this, \"columnVisibility\", {\n col: field,\n visibility: \"visible\",\n });\n }\n\n hideColumn(field, render = true) {\n this.setColProp(field, \"hidden\", true);\n\n // We need to render the whole table otherwise layout fixed won't do its job\n if (render) this.renderTable();\n\n dispatch(this, \"columnVisibility\", {\n col: field,\n visibility: \"hidden\",\n });\n }\n\n /**\n * Returns the starting index of actual data\n * @returns {Number}\n */\n startColIndex() {\n let start = 1;\n if (this.options.selectable && this.plugins.SelectableRows) {\n start++;\n }\n if (this.options.responsive && this.plugins.ResponsiveGrid && this.plugins.ResponsiveGrid.hasHiddenColumns()) {\n start++;\n }\n return start;\n }\n\n /**\n * @returns {Boolean}\n */\n isSticky() {\n return this.hasAttribute(\"sticky\");\n }\n\n /**\n * @param {Boolean} visibleOnly\n * @returns {Number}\n */\n columnsLength(visibleOnly = false) {\n let len = 0;\n // One column per (visible) column\n this.options.columns.forEach((col) => {\n if (visibleOnly && col.hidden) {\n return;\n }\n if (!col.attr) {\n len++;\n }\n });\n // Add one col for selectable checkbox at the beginning\n if (this.options.selectable && this.plugins.SelectableRows) {\n len++;\n }\n // Add one col for actions at the end\n if (this.options.actions.length && this.plugins.RowActions) {\n len++;\n }\n // Add one col for the responsive toggle\n if (this.options.responsive && this.plugins.ResponsiveGrid && this.plugins.ResponsiveGrid.hasHiddenColumns()) {\n len++;\n }\n return len;\n }\n\n /**\n * Global configuration and renderTable\n * This should be called after your data has been loaded\n */\n configureUi() {\n setAttribute(this.querySelector(\"table\"), \"aria-rowcount\", this.data.length);\n\n this.table.style.visibility = \"hidden\";\n this.renderTable();\n if (this.options.responsive && this.plugins.ResponsiveGrid) {\n // Let the observer make the table visible\n } else {\n this.table.style.visibility = \"visible\";\n }\n\n // Store row height for later usage\n if (!this.rowHeight) {\n const tr = find(this, \"tbody tr\") || find(this, \"table tr\");\n if (tr) {\n this.rowHeight = tr.offsetHeight;\n }\n }\n }\n\n filterChanged() {\n const row = this.querySelector(\"thead tr.dg-head-filters\");\n if (this.options.filter) {\n removeAttribute(row, \"hidden\");\n } else {\n this.clearFilters();\n setAttribute(row, \"hidden\", \"\");\n }\n }\n\n reorderChanged() {\n const headers = findAll(this, \"thead tr.dg-head-columns th\");\n headers.forEach((th) => {\n if (th.classList.contains(\"dg-selectable\") || th.classList.contains(\"dg-actions\")) {\n return;\n }\n if (this.options.reorder && this.plugins.DraggableHeaders) {\n th.draggable = true;\n } else {\n th.removeAttribute(\"draggable\");\n }\n });\n }\n\n sortChanged() {\n this.log(\"toggle sort\");\n\n this.querySelectorAll(\"thead tr.dg-head-columns th\").forEach((th) => {\n const fieldName = th.getAttribute(\"field\");\n if (th.classList.contains(\"dg-not-sortable\") || (!this.fireEvents && fieldName == this.options.defaultSort)) {\n return;\n }\n if (this.options.sort && !this.getColProp(fieldName, \"noSort\")) {\n setAttribute(th, \"aria-sort\", \"none\");\n } else {\n removeAttribute(th, \"aria-sort\");\n }\n });\n }\n\n selectableChanged() {\n this.renderTable();\n }\n\n addRow(row) {\n if (!Array.isArray(this.originalData)) return;\n this.log(\"Add row\");\n this.originalData.push(row);\n this.data = this.originalData.slice();\n this.sortData();\n }\n\n /**\n * @param {any} value Value to remove. Defaults to last row.\n * @param {String} key The key of the item to remove. Defaults to first column\n */\n removeRow(value = null, key = null) {\n if (!Array.isArray(this.originalData)) return;\n if (key === null) {\n key = this.options.columns[0][\"field\"];\n }\n if (value === null) {\n value = this.originalData[this.originalData.length - 1][key];\n }\n this.log(\"Removing \" + key + \":\" + value);\n for (let i = 0; i < this.originalData.length; i++) {\n if (this.originalData[i][key] === value) {\n this.originalData.splice(i, 1);\n break;\n }\n }\n this.data = this.originalData.slice();\n this.sortData();\n }\n\n /**\n * @param {String} key Return a specific key (eg: id) instead of the whole row\n * @returns {Array}\n */\n getSelection(key = null) {\n if (!this.plugins.SelectableRows) {\n return [];\n }\n return this.plugins.SelectableRows.getSelection(key);\n }\n\n getData() {\n return this.originalData;\n }\n\n clearData() {\n // Already empty\n if (this.data.length === 0) {\n return;\n }\n this.data = this.originalData = [];\n this.renderBody();\n }\n\n /**\n * Preloads the data intended to bypass the initial fetch operation, allowing for faster intial page load time.\n * Subsequent grid actions after initialization will operate as normal.\n * @param {Object} data - an object with meta ({total, filtered, start}) and data (array of objects) properties.\n */\n preload(data) {\n const metaKey = this.options.serverParams.metaKey,\n dataKey = this.options.serverParams.dataKey;\n if (data?.[metaKey]) this.meta = data[metaKey];\n if (data?.[dataKey]) this.data = this.originalData = data[dataKey];\n }\n\n refresh(cb = null) {\n this.data = this.originalData = [];\n return this.reload(cb);\n }\n\n reload(cb = null) {\n this.log(\"reload\");\n\n // If the data was cleared, we need to render again\n const needRender = !this.originalData?.length;\n this.fixPage();\n // @ts-ignore\n this.loadData().finally(() => {\n // If we load data from the server, we redraw the table body\n // Otherwise, we just need to paginate\n this.options.server || needRender ? this.renderBody() : this.paginate();\n if (cb) {\n cb();\n }\n });\n }\n\n /**\n * @returns {Promise}\n */\n loadData() {\n const flagEmpty = () => !this.data.length && this.classList.add(\"dg-empty\");\n // We already have some data\n if (this.meta || this.originalData || this.classList.contains(\"dg-initialized\")) {\n // We don't use server side data\n if (!this.options.server || (this.options.server && !this.fireEvents)) {\n this.log(\"skip loadData\");\n flagEmpty();\n return new Promise((resolve) => {\n resolve();\n });\n }\n }\n this.log(\"loadData\");\n this.loading = true;\n this.classList.add(\"dg-loading\");\n this.classList.remove(\"dg-empty\", \"dg-network-error\");\n return (\n this.fetchData()\n .then((response) => {\n // We can get a straight array or an object\n if (Array.isArray(response)) {\n this.data = response;\n } else {\n // Object must contain data key\n if (!response[this.options.serverParams.dataKey]) {\n console.error(\"Invalid response, it should contain a data key with an array or be a plain array\", response);\n this.options.url = null;\n return;\n }\n\n // We may have a config object\n this.options = Object.assign(this.options, response[this.options.serverParams.optionsKey] ?? {});\n // It should return meta data (see metaFilteredKey)\n this.meta = response[this.options.serverParams.metaKey] ?? {};\n this.data = response[this.options.serverParams.dataKey];\n }\n this.originalData = this.data.slice();\n this.fixPage();\n\n // Make sure we have a proper set of columns\n if (this.options.columns.length === 0 && this.originalData.length) {\n this.options.columns = this.convertColumns(Object.keys(this.originalData[0]));\n } else {\n this.options.columns = this.convertColumns(this.options.columns);\n }\n })\n .catch((err) => {\n this.log(err);\n if (err.message) {\n this.querySelector(\"tbody\").setAttribute(\"data-empty\", err.message.replace(/^\\s+|\\r\\n|\\n|\\r$/g, \"\"));\n }\n this.classList.add(\"dg-empty\", \"dg-network-error\");\n })\n // @ts-ignore\n .finally(() => {\n flagEmpty();\n this.classList.remove(\"dg-loading\");\n this.loading = false;\n })\n );\n }\n\n getFirst() {\n if (this.loading) {\n return;\n }\n this.page = 1;\n }\n\n getLast() {\n if (this.loading) {\n return;\n }\n this.page = this.pages;\n }\n\n getPrev() {\n if (this.loading) {\n return;\n }\n this.page = this.page - 1;\n }\n\n getNext() {\n if (this.loading) {\n return;\n }\n this.page = this.page + 1;\n }\n\n gotoPage(event) {\n if (event.type === \"keypress\") {\n const key = event.keyCode || event.key;\n if (key === 13 || key === \"Enter\") {\n event.preventDefault();\n } else {\n return;\n }\n }\n this.page = parseInt(this.inputPage.value);\n }\n\n getSort() {\n let col = this.querySelector(\"thead tr.dg-head-columns th[aria-sort$='scending']\");\n if (col) {\n return col.getAttribute(\"field\");\n }\n return this.options.defaultSort;\n }\n\n getSortDir() {\n let col = this.querySelector(\"thead tr.dg-head-columns th[aria-sort$='scending']\");\n if (col) {\n return col.getAttribute(\"aria-sort\") || \"\";\n }\n return \"\";\n }\n\n getFilters() {\n let filters = [];\n const inputs = findAll(this, \"thead tr.dg-head-filters input\");\n inputs.forEach((input) => {\n filters[input.dataset.name] = input.value;\n });\n return filters;\n }\n\n clearFilters() {\n const inputs = findAll(this, \"thead tr.dg-head-filters input\");\n inputs.forEach((input) => {\n input.value = \"\";\n });\n this.filterData();\n }\n\n filterData() {\n this.log(\"filter data\");\n\n this.page = 1;\n\n if (this.options.server) {\n this.reload();\n } else {\n this.data = this.originalData?.slice() ?? [];\n\n // Look for rows matching the filters\n const inputs = findAll(this, \"thead tr.dg-head-filters input\");\n inputs.forEach((input) => {\n let value = input.value;\n if (value) {\n let name = input.dataset.name;\n this.data = this.data.filter((item) => {\n let str = item[name] + \"\";\n return str.toLowerCase().indexOf(value.toLowerCase()) !== -1;\n });\n }\n });\n this.pageChanged();\n\n let col = this.querySelector(\"thead tr.dg-head-columns th[aria-sort$='scending']\");\n if (this.options.sort && col) {\n this.sortData();\n } else {\n this.renderBody();\n }\n }\n }\n\n /**\n * Data will be sorted then rendered using renderBody\n * @param {Element} col The column that was clicked or null to use current sort\n */\n sortData(col = null) {\n this.log(\"sort data\");\n\n // Early exit\n if (col && this.getColProp(col.getAttribute(\"field\"), \"noSort\")) {\n this.log(\"sorting prevented because column is not sortable\");\n return;\n }\n if (this.plugins.ColumnResizer && this.plugins.ColumnResizer.isResizing) {\n this.log(\"sorting prevented because resizing\");\n return;\n }\n if (this.loading) {\n this.log(\"sorting prevented because loading\");\n return;\n }\n\n // We clicked on a column, update sort state\n if (col !== null) {\n // Remove active sort if any\n const haveClasses = (c) => [\"dg-selectable\", \"dg-actions\", \"dg-responsive-toggle\"].includes(c);\n this.querySelectorAll(\"thead tr:first-child th\").forEach((th) => {\n // @ts-ignore\n if ([...th.classList].some(haveClasses)) {\n return;\n }\n if (th !== col) {\n th.setAttribute(\"aria-sort\", \"none\");\n }\n });\n\n // Set tristate col\n if (!col.hasAttribute(\"aria-sort\") || col.getAttribute(\"aria-sort\") === \"none\") {\n col.setAttribute(\"aria-sort\", \"ascending\");\n } else if (col.getAttribute(\"aria-sort\") === \"ascending\") {\n col.setAttribute(\"aria-sort\", \"descending\");\n } else if (col.getAttribute(\"aria-sort\") === \"descending\") {\n col.setAttribute(\"aria-sort\", \"none\");\n }\n } else {\n // Or fetch current sort\n col = this.querySelector(\"thead tr.dg-head-columns th[aria-sort$='scending']\");\n }\n\n if (this.options.server) {\n // Reload data with updated sort\n this.loadData().finally(() => {\n this.renderBody();\n });\n } else {\n const sort = col ? col.getAttribute(\"aria-sort\") : \"none\";\n if (sort === \"none\") {\n let stack = [];\n\n // Restore order while keeping filters\n this.originalData?.some((itemA) => {\n this.data.some((itemB) => {\n if (JSON.stringify(itemA) === JSON.stringify(itemB)) {\n stack.push(itemB);\n return true;\n }\n return false;\n });\n return stack.length === this.data.length;\n });\n\n this.data = stack;\n } else {\n const field = col.getAttribute(\"field\");\n this.data.sort((a, b) => {\n if (!isNaN(a[field]) && !isNaN(b[field])) {\n return sort === \"ascending\" ? a[field] - b[field] : b[field] - a[field];\n }\n const valA = sort === \"ascending\" ? a[field].toUpperCase() : b[field].toUpperCase();\n const valB = sort === \"ascending\" ? b[field].toUpperCase() : a[field].toUpperCase();\n\n switch (true) {\n case valA > valB:\n return 1;\n case valA < valB:\n return -1;\n case valA === valB:\n return 0;\n }\n });\n }\n this.renderBody();\n }\n }\n\n fetchData() {\n if (!this.options.url) {\n return new Promise((resolve, reject) => reject(\"No url set\"));\n }\n\n let base = window.location.href;\n // Fix trailing slash if no extension is present\n if (!base.split(\"/\").pop().includes(\".\")) {\n base += base.endsWith(\"/\") ? \"\" : \"/\";\n }\n let url = new URL(this.options.url, base);\n let params = {\n r: Date.now(),\n };\n if (this.options.server) {\n // 0 based\n params[this.options.serverParams.start] = this.page - 1;\n params[this.options.serverParams.length] = this.options.perPage;\n if (this.options.filter) params[this.options.serverParams.search] = this.getFilters();\n params[this.options.serverParams.sort] = this.getSort() || \"\";\n params[this.options.serverParams.sortDir] = this.getSortDir();\n\n // extra params ?\n if (this.meta?.[this.options.serverParams.paramsKey]) {\n params = Object.assign(params, this.meta[this.options.serverParams.paramsKey]);\n }\n }\n\n appendParamsToUrl(url, params);\n\n return fetch(url).then((response) => {\n if (!response.ok) {\n throw new Error(response.statusText || labels.networkError);\n }\n return response.json();\n });\n }\n\n renderTable() {\n this.log(\"render table\");\n\n if (this.options.menu && this.plugins.ContextMenu) {\n this.plugins.ContextMenu.createMenu();\n }\n\n let sortedColumn;\n\n this.renderHeader();\n if (this.options.defaultSort) {\n // We can have a default sort even with sort disabled\n sortedColumn = this.querySelector(\"thead tr.dg-head-columns th[field='\" + this.options.defaultSort + \"']\");\n }\n\n if (sortedColumn) {\n this.sortData(sortedColumn);\n } else {\n this.renderBody();\n }\n\n this.renderFooter();\n }\n\n /**\n * Create table header\n * - One row for the column headers\n * - One row for the filters\n */\n renderHeader() {\n this.log(\"render header\");\n\n const thead = this.querySelector(\"thead\");\n this.createColumnHeaders(thead);\n this.createColumnFilters(thead);\n\n if (this.options.resizable && this.plugins.ColumnResizer) {\n this.plugins.ColumnResizer.renderResizer(labels.resizeColumn);\n }\n\n dispatch(this, \"headerRendered\");\n }\n\n renderFooter() {\n this.log(\"render footer\");\n\n const tfoot = this.querySelector(\"tfoot\");\n const td = tfoot.querySelector(\"td\");\n tfoot.removeAttribute(\"hidden\");\n setAttribute(td, \"colspan\", this.columnsLength(true));\n tfoot.style.display = \"\";\n }\n\n /**\n * Create the column headers based on column definitions and set options\n * @param {HTMLTableSectionElement} thead\n */\n createColumnHeaders(thead) {\n // @link https://stackoverflow.com/questions/21064101/understanding-offsetwidth-clientwidth-scrollwidth-and-height-respectively\n const availableWidth = this.clientWidth;\n const colMaxWidth = Math.round((availableWidth / this.columnsLength(true)) * 2);\n\n let idx = 0;\n let tr;\n\n // Create row\n tr = ce(\"tr\");\n this.headerRow = tr;\n tr.setAttribute(\"role\", \"row\");\n tr.setAttribute(\"aria-rowindex\", \"1\");\n tr.setAttribute(\"class\", \"dg-head-columns\");\n\n // We need a real th from the dom to compute the size\n let sampleTh = thead.querySelector(\"tr.dg-head-columns th\");\n if (!sampleTh) {\n sampleTh = ce(\"th\");\n thead.querySelector(\"tr\").appendChild(sampleTh);\n }\n\n if (this.options.selectable && this.plugins.SelectableRows) {\n this.plugins.SelectableRows.createHeaderCol(tr);\n }\n if (this.options.responsive && this.plugins.ResponsiveGrid && this.plugins.ResponsiveGrid.hasHiddenColumns()) {\n this.plugins.ResponsiveGrid.createHeaderCol(tr);\n }\n\n // Create columns\n idx = 0;\n let totalWidth = 0;\n this.options.columns.forEach((column) => {\n if (column.attr) {\n return;\n }\n const colIdx = idx + this.startColIndex();\n let th = ce(\"th\");\n th.setAttribute(\"scope\", \"col\");\n th.setAttribute(\"role\", \"columnheader button\");\n th.setAttribute(\"aria-colindex\", \"\" + colIdx);\n th.setAttribute(\"id\", randstr(\"dg-col-\"));\n if (this.options.sort) {\n th.setAttribute(\"aria-sort\", \"none\");\n }\n th.setAttribute(\"field\", column.field);\n if (this.plugins.ResponsiveGrid && this.options.responsive) {\n setAttribute(th, \"data-responsive\", column.responsive || \"\");\n }\n // Make sure the header fits (+ add some room for sort icon if necessary)\n const computedWidth = getTextWidth(column.title, sampleTh, true) + 20;\n th.dataset.minWidth = \"\" + computedWidth;\n applyColumnDefinition(th, column);\n th.tabIndex = 0;\n th.textContent = column.title;\n\n let w = 0;\n // Autosize small based on first/last row ?\n // Take into account minWidth of the header and max available size based on col numbers\n if (this.options.autosize && this.plugins.AutosizeColumn) {\n const colAvailableWidth = Math.min(availableWidth - totalWidth, colMaxWidth);\n w = this.plugins.AutosizeColumn.computeSize(th, column, parseInt(th.dataset.minWidth), colAvailableWidth);\n } else {\n w = Math.max(parseInt(th.dataset.minWidth), parseInt(th.getAttribute(\"width\")));\n }\n\n setAttribute(th, \"width\", w);\n if (column.hidden) {\n th.setAttribute(\"hidden\", \"\");\n } else {\n totalWidth += w;\n }\n\n // Reorder columns with drag/drop\n if (this.options.reorder && this.plugins.DraggableHeaders) {\n this.plugins.DraggableHeaders.makeHeaderDraggable(th);\n }\n\n tr.appendChild(th);\n idx++;\n });\n\n // There is too much available width, and we want to avoid fixed layout to split remaining amount\n if (totalWidth < availableWidth) {\n const visibleCols = findAll(tr, \"th:not([hidden],.dg-not-resizable)\");\n if (visibleCols.length) {\n const lastCol = visibleCols[visibleCols.length - 1];\n removeAttribute(lastCol, \"width\");\n }\n }\n\n // Actions\n if (this.options.actions.length && this.plugins.RowActions) {\n this.plugins.RowActions.makeActionHeader(tr);\n }\n\n thead.replaceChild(tr, thead.querySelector(\"tr.dg-head-columns\"));\n\n // Once columns are inserted, we have an actual dom to query\n if (thead.offsetWidth > availableWidth) {\n this.log(`adjust width to fix size, ${thead.offsetWidth} > ${availableWidth}`);\n const scrollbarWidth = this.offsetWidth - this.clientWidth;\n let diff = thead.offsetWidth - availableWidth - scrollbarWidth;\n if (this.options.responsive && this.plugins.ResponsiveGrid) {\n diff += scrollbarWidth;\n }\n // Remove diff for columns that can afford it\n const thWithWidth = findAll(tr, \"th[width]\");\n thWithWidth.forEach((th) => {\n if (hasClass(th, \"dg-not-resizable\")) {\n return;\n }\n if (diff <= 0) {\n return;\n }\n const actualWidth = parseInt(th.getAttribute(\"width\"));\n const minWidth = th.dataset.minWidth ? parseInt(th.dataset.minWidth) : 0;\n if (actualWidth > minWidth) {\n let newWidth = actualWidth - diff;\n if (newWidth < minWidth) {\n newWidth = minWidth;\n }\n diff -= actualWidth - newWidth;\n setAttribute(th, \"width\", newWidth);\n }\n });\n }\n\n // Context menu\n if (this.options.menu && this.plugins.ContextMenu) {\n this.plugins.ContextMenu.attachContextMenu();\n }\n\n // Sort col on click\n tr.querySelectorAll(\"[aria-sort]\").forEach((sortableRow) => {\n sortableRow.addEventListener(\"click\", () => this.sortData(sortableRow));\n });\n\n setAttribute(this.querySelector(\"table\"), \"aria-colcount\", this.columnsLength(true));\n }\n\n createColumnFilters(thead) {\n let idx = 0;\n let tr;\n\n // Create row for filters\n tr = ce(\"tr\");\n this.filterRow = tr;\n tr.setAttribute(\"role\", \"row\");\n tr.setAttribute(\"aria-rowindex\", \"2\");\n tr.setAttribute(\"class\", \"dg-head-filters\");\n if (!this.options.filter) {\n tr.setAttribute(\"hidden\", \"\");\n }\n\n if (this.options.selectable && this.plugins.SelectableRows) {\n this.plugins.SelectableRows.createFilterCol(tr);\n }\n if (this.options.responsive && this.plugins.ResponsiveGrid && this.plugins.ResponsiveGrid.hasHiddenColumns()) {\n this.plugins.ResponsiveGrid.createFilterCol(tr);\n }\n\n this.options.columns.forEach((column) => {\n if (column.attr) {\n return;\n }\n const colIdx = idx + this.startColIndex();\n let relatedTh = thead.querySelector(\"tr.dg-head-columns th[aria-colindex='\" + colIdx + \"']\");\n if (!relatedTh) {\n console.warn(\"Related th not found\", colIdx);\n return;\n }\n let th = ce(\"th\");\n th.setAttribute(\"aria-colindex\", \"\" + colIdx);\n\n let input = ce(\"input\");\n input.type = \"text\";\n input.inputMode = \"search\";\n input.autocomplete = \"off\";\n input.spellcheck = false;\n // Allows binding filter to this column\n input.dataset.name = column.field;\n input.id = randstr(\"dg-filter-\");\n // Don't use aria-label as it triggers autocomplete\n input.setAttribute(\"aria-labelledby\", relatedTh.getAttribute(\"id\"));\n if (!this.options.filter) {\n th.tabIndex = 0;\n } else {\n input.tabIndex = 0;\n }\n\n if (column.hidden) {\n th.setAttribute(\"hidden\", \"\");\n }\n\n th.appendChild(input);\n tr.appendChild(th);\n idx++;\n });\n\n // Actions\n if (this.options.actions.length && this.plugins.RowActions) {\n this.plugins.RowActions.makeActionFilter(tr);\n }\n\n thead.replaceChild(tr, thead.querySelector(\"tr.dg-head-filters\"));\n\n // Filter content on enter\n tr.querySelectorAll(\"input\").forEach((input) => {\n input.addEventListener(\"keypress\", (e) => {\n const key = e.keyCode || e.key;\n if (key === 13 || key === \"Enter\") {\n this.filterData.call(this);\n }\n });\n });\n }\n\n /**\n * Render the data as rows in tbody\n * It will call paginate() at the end\n */\n renderBody() {\n this.log(\"render body\");\n let tr;\n let td;\n let idx;\n let tbody = ce(\"tbody\");\n\n this.data.forEach((item, i) => {\n tr = ce(\"tr\");\n setAttribute(tr, \"role\", \"row\");\n setAttribute(tr, \"hidden\", \"\");\n setAttribute(tr, \"aria-rowindex\", i + 1);\n tr.tabIndex = 0;\n\n if (this.options.selectable && this.plugins.SelectableRows) {\n this.plugins.SelectableRows.createDataCol(tr);\n }\n if (this.options.responsive && this.plugins.ResponsiveGrid && this.plugins.ResponsiveGrid.hasHiddenColumns()) {\n this.plugins.ResponsiveGrid.createDataCol(tr);\n }\n\n // Expandable\n if (this.options.expand) {\n tr.classList.add(\"dg-expandable\");\n\n on(tr, \"click\", (ev) => {\n if (this.plugins.ResponsiveGrid) {\n this.plugins.ResponsiveGrid.blockObserver();\n }\n toggleClass(ev.currentTarget, \"dg-expanded\");\n if (this.plugins.ResponsiveGrid) {\n this.plugins.ResponsiveGrid.unblockObserver();\n }\n });\n }\n\n idx = 0;\n this.options.columns.forEach((column) => {\n if (!column) {\n console.error(\"Empty column found!\", this.options.columns);\n }\n // It should be applied as an attr of the row\n if (column.attr) {\n if (item[column.field]) {\n // Special case if we try to write over the class attr\n if (column.attr === \"class\") {\n addClass(tr, item[column.field]);\n } else {\n tr.setAttribute(column.attr, item[column.field]);\n }\n }\n return;\n }\n td = ce(\"td\");\n td.setAttribute(\"role\", \"gridcell\");\n td.setAttribute(\"aria-colindex\", idx + this.startColIndex());\n applyColumnDefinition(td, column);\n // This is required for pure css responsive layout\n td.setAttribute(\"data-name\", column.title);\n td.tabIndex = -1;\n\n // Inline editing ...\n if (column.editable && this.plugins.EditableColumn) {\n addClass(td, \"dg-editable-col\");\n this.plugins.EditableColumn.makeEditableInput(td, column, item, i);\n } else {\n // ... or formatting\n const v = item[column.field] ?? \"\";\n let tv;\n // TODO: make this modular\n switch (column.transform) {\n case \"uppercase\":\n tv = v.toUpperCase();\n break;\n case \"lowercase\":\n tv = v.toLowerCase();\n break;\n default:\n tv = v;\n break;\n }\n if (column.format) {\n // Only use formatting with values or if defaultFormatValue is set\n if (column.defaultFormatValue != undefined && (tv === \"\" || tv === null)) {\n tv = column.defaultFormatValue + \"\";\n }\n if (typeof column.format === \"string\" && tv) {\n td.innerHTML = interpolate(\n // @ts-ignore\n column.format,\n Object.assign(\n {\n _v: v,\n _tv: tv,\n },\n item\n )\n );\n } else if (column.format instanceof Function) {\n const val = column.format.call(this, { column, rowData: item, cellData: tv, td, tr });\n td.innerHTML = val || tv || v;\n }\n } else {\n td.textContent = tv;\n }\n }\n tr.appendChild(td);\n idx++;\n });\n\n // Actions\n if (this.options.actions.length && this.plugins.RowActions) {\n this.plugins.RowActions.makeActionRow(tr, item);\n }\n\n tbody.appendChild(tr);\n });\n\n tbody.setAttribute(\"role\", \"rowgroup\");\n\n // Keep data empty message\n const prev = this.querySelector(\"tbody\");\n tbody.setAttribute(\"data-empty\", prev.getAttribute(\"data-empty\"));\n this.querySelector(\"table\").replaceChild(tbody, prev);\n\n if (this.plugins.FixedHeight) {\n this.plugins.FixedHeight.createFakeRow();\n }\n\n this.paginate();\n\n if (this.plugins.SelectableRows) {\n this.plugins.SelectableRows.shouldSelectAll(tbody);\n }\n\n dispatch(this, \"bodyRendered\");\n }\n\n paginate() {\n this.log(\"paginate\");\n\n const total = this.totalRecords();\n const p = this.page || 1;\n\n let index;\n let high = p * this.options.perPage;\n let low = high - this.options.perPage + 1;\n const tbody = this.querySelector(\"tbody\");\n const tfoot = this.querySelector(\"tfoot\");\n\n if (high > total) {\n high = total;\n }\n if (!total) {\n low = 0;\n }\n\n // Display all rows within the set indexes\n // For server side paginated grids, we display everything\n // since the server is taking care of actual pagination\n tbody.querySelectorAll(\"tr\").forEach((tr) => {\n if (this.options.server) {\n removeAttribute(tr, \"hidden\");\n return;\n }\n index = Number(getAttribute(tr, \"aria-rowindex\"));\n if (index > high || index < low) {\n setAttribute(tr, \"hidden\", \"\");\n } else {\n removeAttribute(tr, \"hidden\");\n }\n });\n\n if (this.options.selectable && this.plugins.SelectableRows) {\n this.plugins.SelectableRows.clearCheckboxes(tbody);\n }\n\n // Store default height and update styles if needed\n if (this.plugins.FixedHeight) {\n this.plugins.FixedHeight.updateFakeRow();\n }\n\n // Enable/disable buttons if shown\n if (this.btnFirst) {\n this.btnFirst.disabled = this.page <= 1;\n this.btnPrev.disabled = this.page <= 1;\n this.btnNext.disabled = this.page >= this.pages;\n this.btnLast.disabled = this.page >= this.pages;\n }\n tfoot.querySelector(\".dg-low\").textContent = low.toString();\n tfoot.querySelector(\".dg-high\").textContent = high.toString();\n tfoot.querySelector(\".dg-total\").textContent = \"\" + this.totalRecords();\n tfoot.toggleAttribute(\"hidden\", this.options.autohidePager && this.options.perPage > this.totalRecords());\n }\n\n /**\n * @returns {number}\n */\n totalPages() {\n return Math.ceil(this.totalRecords() / this.options.perPage);\n }\n\n /**\n * @returns {number}\n */\n totalRecords() {\n if (this.options.server) {\n return this.meta?.[this.options.serverParams.metaFilteredKey] || 0;\n }\n return this.data.length;\n }\n}\n\nexport default DataGrid;\n", "/** @typedef {import(\"../data-grid\").default} DataGrid */\r\n\r\nclass BasePlugin {\r\n /**\r\n * @param {DataGrid} grid\r\n */\r\n constructor(grid) {\r\n this.grid = grid;\r\n }\r\n\r\n connected() {}\r\n\r\n disconnected() {}\r\n\r\n /**\r\n * Handle events within the plugin\r\n * @link https://gist.github.com/WebReflection/ec9f6687842aa385477c4afca625bbf4#handling-events\r\n * @param {Event} event\r\n */\r\n handleEvent(event) {\r\n if (this[`on${event.type}`]) {\r\n this[`on${event.type}`](event);\r\n }\r\n }\r\n}\r\n\r\nexport default BasePlugin;\r\n", "import BasePlugin from \"../core/base-plugin.js\";\r\nimport elementOffset from \"../utils/elementOffset.js\";\r\nimport {\r\n addClass,\r\n dispatch,\r\n findAll,\r\n getAttribute,\r\n hasClass,\r\n off,\r\n on,\r\n removeAttribute,\r\n removeClass,\r\n setAttribute,\r\n} from \"../utils/shortcuts.js\";\r\n\r\n/**\r\n * Allows to resize columns\r\n */\r\nclass ColumnResizer extends BasePlugin {\r\n constructor(grid) {\r\n super(grid);\r\n this.isResizing = false;\r\n }\r\n\r\n /**\r\n * @param {String} resizeLabel\r\n */\r\n renderResizer(resizeLabel) {\r\n const grid = this.grid;\r\n const table = grid.table;\r\n const cols = findAll(grid, \"thead tr.dg-head-columns th\");\r\n\r\n cols.forEach((col) => {\r\n if (hasClass(col, \"dg-not-resizable\")) {\r\n return;\r\n }\r\n // Create a resizer element\r\n const resizer = document.createElement(\"div\");\r\n addClass(resizer, \"dg-resizer\");\r\n resizer.ariaLabel = resizeLabel;\r\n\r\n // Add a resizer element to the column\r\n col.appendChild(resizer);\r\n\r\n // Handle resizing\r\n let startX = 0;\r\n let startW = 0;\r\n let remainingSpace = 0;\r\n let max = 0;\r\n\r\n const mouseMoveHandler = (e) => {\r\n if (e.clientX > max) {\r\n return;\r\n }\r\n const newWidth = startW + (e.clientX - startX);\r\n if (col.dataset.minWidth && newWidth > parseInt(col.dataset.minWidth)) {\r\n setAttribute(col, \"width\", newWidth);\r\n }\r\n };\r\n\r\n // When user releases the mouse, remove the existing event listeners\r\n const mouseUpHandler = () => {\r\n grid.log(\"resized column\");\r\n\r\n // Prevent accidental sorting if mouse is not over resize handler\r\n setTimeout(() => {\r\n this.isResizing = false;\r\n }, 0);\r\n\r\n removeClass(resizer, \"dg-resizer-active\");\r\n if (grid.options.reorder) {\r\n col.draggable = true;\r\n }\r\n col.style.overflow = \"hidden\";\r\n\r\n // Remove handlers\r\n off(document, \"mousemove\", mouseMoveHandler);\r\n off(document, \"mouseup\", mouseUpHandler);\r\n\r\n dispatch(grid, \"columnResized\", {\r\n col: getAttribute(col, \"field\"),\r\n width: getAttribute(col, \"width\"),\r\n });\r\n };\r\n\r\n // Otherwise it could sort the col\r\n on(resizer, \"click\", (e) => {\r\n e.stopPropagation();\r\n });\r\n\r\n on(resizer, \"mousedown\", (e) => {\r\n e.stopPropagation();\r\n\r\n this.isResizing = true;\r\n\r\n const target = e.target;\r\n const currentCols = findAll(grid, \"dg-head-columns th\");\r\n const visibleCols = currentCols.filter((col) => {\r\n return !col.hasAttribute(\"hidden\");\r\n });\r\n const columnIndex = visibleCols.findIndex((column) => column == target.parentNode);\r\n grid.log(\"resize column\");\r\n\r\n addClass(resizer, \"dg-resizer-active\");\r\n\r\n // Make sure we don't drag it\r\n removeAttribute(col, \"draggable\");\r\n\r\n // Allow overflow when resizing\r\n col.style.overflow = \"visible\";\r\n\r\n // Show full column height (-1 to avoid scrollbar)\r\n resizer.style.height = table.offsetHeight - 1 + \"px\";\r\n\r\n // Register initial data\r\n startX = e.clientX;\r\n startW = col.offsetWidth;\r\n\r\n remainingSpace = (visibleCols.length - columnIndex) * 30;\r\n max = elementOffset(target).left + grid.offsetWidth - remainingSpace;\r\n\r\n // Remove width from next columns to allow auto layout\r\n setAttribute(col, \"width\", startW);\r\n for (let j = 0; j < visibleCols.length; j++) {\r\n if (j > columnIndex) {\r\n removeAttribute(cols[j], \"width\");\r\n }\r\n }\r\n\r\n // Attach handlers\r\n on(document, \"mousemove\", mouseMoveHandler);\r\n on(document, \"mouseup\", mouseUpHandler);\r\n });\r\n });\r\n }\r\n}\r\n\r\nexport default ColumnResizer;\r\n", "/**\r\n * @param {HTMLElement} el\r\n * @param {String} type\r\n * @param {String} prop\r\n * @returns {HTMLElement}\r\n */\r\nexport default function getParentElement(el, type, prop = \"nodeName\") {\r\n let parent = el;\r\n while (parent[prop] != type) {\r\n parent = parent.parentElement;\r\n }\r\n return parent;\r\n}\r\n", "import BasePlugin from \"../core/base-plugin.js\";\r\nimport getParentElement from \"../utils/getParentElement.js\";\r\nimport { find, off, on, removeAttribute, setAttribute } from \"../utils/shortcuts.js\";\r\n\r\n/**\r\n * Create a right click menu on the headers\r\n */\r\nclass ContextMenu extends BasePlugin {\r\n connected() {\r\n /**\r\n * @type {HTMLUListElement}\r\n */\r\n this.menu = this.grid.querySelector(\".dg-menu\");\r\n }\r\n disconnected() {\r\n if (this.grid.headerRow) {\r\n off(this.grid.headerRow, \"contextmenu\", this);\r\n }\r\n }\r\n\r\n attachContextMenu() {\r\n const grid = this.grid;\r\n on(grid.headerRow, \"contextmenu\", this);\r\n }\r\n\r\n onchange(e) {\r\n const grid = this.grid;\r\n const t = e.target;\r\n const field = t.dataset.name;\r\n if (t.checked) {\r\n grid.showColumn(field);\r\n } else {\r\n // Prevent hidding last\r\n if (grid.visibleColumns().length <= 1) {\r\n // Restore checkbox value\r\n t.checked = true;\r\n return;\r\n }\r\n grid.hideColumn(field);\r\n }\r\n }\r\n\r\n oncontextmenu(e) {\r\n e.preventDefault();\r\n const grid = this.grid;\r\n const target = getParentElement(e.target, \"THEAD\");\r\n const menu = this.menu;\r\n const rect = target.getBoundingClientRect();\r\n let x = e.clientX - rect.left;\r\n const y = e.clientY - rect.top;\r\n\r\n menu.style.top = `${y}px`;\r\n menu.style.left = `${x}px`;\r\n\r\n removeAttribute(menu, \"hidden\");\r\n if (x + 150 > rect.width) {\r\n x -= menu.offsetWidth;\r\n menu.style.left = `${x}px`;\r\n }\r\n\r\n const documentClickHandler = (e) => {\r\n if (!menu.contains(e.target)) {\r\n setAttribute(menu, \"hidden\", \"\");\r\n off(document, \"click\", documentClickHandler);\r\n }\r\n };\r\n on(document, \"click\", documentClickHandler);\r\n }\r\n createMenu() {\r\n const grid = this.grid;\r\n const menu = this.menu;\r\n while (menu.lastChild) {\r\n menu.removeChild(menu.lastChild);\r\n }\r\n menu.addEventListener(\"change\", this);\r\n grid.options.columns.forEach((col) => {\r\n if (col.attr) {\r\n return;\r\n }\r\n const li = document.createElement(\"li\");\r\n const label = document.createElement(\"label\");\r\n const checkbox = document.createElement(\"input\");\r\n setAttribute(checkbox, \"type\", \"checkbox\");\r\n setAttribute(checkbox, \"data-name\", col.field);\r\n if (!col.hidden) {\r\n checkbox.checked = true;\r\n }\r\n const text = document.createTextNode(col.title);\r\n\r\n label.appendChild(checkbox);\r\n label.appendChild(text);\r\n\r\n li.appendChild(label);\r\n menu.appendChild(li);\r\n });\r\n }\r\n}\r\n\r\nexport default ContextMenu;\r\n", "import BasePlugin from \"../core/base-plugin.js\";\nimport getParentElement from \"../utils/getParentElement.js\";\nimport { dispatch, findAll, getAttribute, on, setAttribute } from \"../utils/shortcuts.js\";\n\n/**\n * Allows to move headers\n */\nclass DraggableHeaders extends BasePlugin {\n /**\n * @param {HTMLTableCellElement} th\n */\n makeHeaderDraggable(th) {\n const grid = this.grid;\n th.draggable = true;\n on(th, \"dragstart\", (e) => {\n if (grid.plugins.ColumnResizer && grid.plugins.ColumnResizer.isResizing && e.preventDefault) {\n e.preventDefault();\n return;\n }\n grid.log(\"reorder col\");\n e.dataTransfer.effectAllowed = \"move\";\n e.dataTransfer.setData(\"text/plain\", e.target.getAttribute(\"aria-colindex\"));\n });\n on(th, \"dragover\", (e) => {\n if (e.preventDefault) {\n e.preventDefault();\n }\n e.dataTransfer.dropEffect = \"move\";\n return false;\n });\n on(th, \"drop\", (e) => {\n if (e.stopPropagation) {\n e.stopPropagation();\n }\n const t = e.target;\n const target = getParentElement(t, \"TH\");\n const index = parseInt(e.dataTransfer.getData(\"text/plain\"));\n const targetIndex = parseInt(target.getAttribute(\"aria-colindex\"));\n\n if (index === targetIndex) {\n grid.log(\"reordered col stayed the same\");\n return;\n }\n grid.log(\"reordered col from \" + index + \" to \" + targetIndex);\n\n const offset = grid.startColIndex();\n const tmp = grid.options.columns[index - offset];\n grid.options.columns[index - offset] = grid.options.columns[targetIndex - offset];\n grid.options.columns[targetIndex - offset] = tmp;\n\n const swapNodes = (selector, el1) => {\n const rowIndex = el1.parentNode.getAttribute(\"aria-rowindex\");\n const el2 = grid.querySelector(selector + \" tr[aria-rowindex='\" + rowIndex + \"'] [aria-colindex='\" + targetIndex + \"']\");\n setAttribute(el1, \"aria-colindex\", targetIndex);\n setAttribute(el2, \"aria-colindex\", index);\n const newNode = document.createElement(\"th\");\n el1.parentNode.insertBefore(newNode, el1);\n el2.parentNode.replaceChild(el1, el2);\n newNode.parentNode.replaceChild(el2, newNode);\n };\n\n // Swap all rows in header and body\n findAll(grid, \"thead th[aria-colindex='\" + index + \"']\").forEach((el1) => {\n swapNodes(\"thead\", el1);\n });\n findAll(grid, 'tbody td[aria-colindex=\"' + index + '\"]').forEach((el1) => {\n swapNodes(\"tbody\", el1);\n });\n\n // Updates the columns\n grid.options.columns = findAll(grid, \"thead tr.dg-head-columns th[field]\").map((th) =>\n grid.options.columns.find((c) => c.field == getAttribute(th, \"field\"))\n );\n\n dispatch(grid, \"columnReordered\", {\n col: tmp.field,\n from: index,\n to: targetIndex,\n });\n return false;\n });\n }\n}\n\nexport default DraggableHeaders;\n", "import BasePlugin from \"../core/base-plugin.js\";\r\n\r\n/**\r\n * Allows to paginate with horizontal swipe motions\r\n */\r\nclass TouchSupport extends BasePlugin {\r\n constructor(grid) {\r\n super(grid);\r\n this.touch = null;\r\n }\r\n connected() {\r\n const grid = this.grid;\r\n grid.addEventListener(\"touchstart\", this, { passive: true });\r\n grid.addEventListener(\"touchmove\", this, { passive: true });\r\n }\r\n\r\n disconnected() {\r\n const grid = this.grid;\r\n grid.removeEventListener(\"touchstart\", this);\r\n grid.removeEventListener(\"touchmove\", this);\r\n }\r\n\r\n ontouchstart(e) {\r\n this.touch = e.touches[0];\r\n }\r\n\r\n ontouchmove(e) {\r\n if (!this.touch) {\r\n return;\r\n }\r\n const grid = this.grid;\r\n const xDiff = this.touch.clientX - e.touches[0].clientX;\r\n const yDiff = this.touch.clientY - e.touches[0].clientY;\r\n\r\n if (Math.abs(xDiff) > Math.abs(yDiff)) {\r\n if (xDiff > 0) {\r\n grid.getNext();\r\n } else {\r\n grid.getPrev();\r\n }\r\n }\r\n this.touch = null;\r\n }\r\n}\r\n\r\nexport default TouchSupport;\r\n", "import BasePlugin from \"../core/base-plugin.js\";\nimport { dispatch, findAll, hasClass, setAttribute } from \"../utils/shortcuts.js\";\n\nconst SELECTABLE_CLASS = \"dg-selectable\";\nconst SELECT_ALL_CLASS = \"dg-select-all\";\nconst CHECKBOX_CLASS = \"form-check-input\"; //bs5\n\n/**\n * Allows to select rows\n */\nclass SelectableRows extends BasePlugin {\n disconnected() {\n if (this.selectAll) {\n this.selectAll.removeEventListener(\"change\", this);\n }\n }\n\n /**\n * @param {String} key Return a specific key (eg: id) instead of the whole row\n * @returns {Array}\n */\n getSelection(key = null) {\n const grid = this.grid;\n let selectedData = [];\n\n const inputs = findAll(grid, `tbody .${SELECTABLE_CLASS} input:checked`);\n inputs.forEach((checkbox) => {\n const idx = parseInt(checkbox.dataset.id);\n const item = grid.data[idx - 1];\n if (!item) {\n console.warn(`Item ${idx} not found`);\n }\n if (key) {\n selectedData.push(item[key]);\n } else {\n selectedData.push(item);\n }\n });\n return selectedData;\n }\n\n /**\n * Uncheck box if hidden and visible only\n * @param {HTMLTableSectionElement} tbody\n */\n clearCheckboxes(tbody) {\n const grid = this.grid;\n if (!grid.options.selectVisibleOnly) {\n return;\n }\n const inputs = findAll(tbody, `tr[hidden] .${SELECTABLE_CLASS} input`);\n inputs.forEach((input) => {\n input.checked = false;\n });\n this.selectAll.checked = false;\n }\n\n colIndex() {\n return this.grid.startColIndex() - 2;\n }\n\n /**\n * @param {HTMLTableRowElement} tr\n */\n createHeaderCol(tr) {\n let th = document.createElement(\"th\");\n setAttribute(th, \"scope\", \"col\");\n setAttribute(th, \"role\", \"columnheader button\");\n setAttribute(th, \"aria-colindex\", this.colIndex());\n th.classList.add(...[SELECTABLE_CLASS, \"dg-not-resizable\", \"dg-not-sortable\"]);\n th.tabIndex = 0;\n\n this.selectAll = document.createElement(\"input\");\n this.selectAll.type = \"checkbox\";\n this.selectAll.classList.add(SELECT_ALL_CLASS);\n this.selectAll.classList.add(CHECKBOX_CLASS);\n this.selectAll.addEventListener(\"change\", this);\n\n let label = document.createElement(\"label\");\n label.appendChild(this.selectAll);\n\n th.appendChild(label);\n\n th.setAttribute(\"width\", \"40\");\n tr.appendChild(th);\n }\n\n /**\n * @param {HTMLTableRowElement} tr\n */\n createFilterCol(tr) {\n let th = document.createElement(\"th\");\n setAttribute(th, \"role\", \"columnheader button\");\n setAttribute(th, \"aria-colindex\", this.colIndex());\n th.classList.add(SELECTABLE_CLASS);\n th.tabIndex = 0;\n\n tr.appendChild(th);\n }\n\n /**\n * Handles the selectAll checkbox when any other .dg-selectable checkbox is checked on table body.\n * It should check selectAll if all is checked\n * It should uncheck selectAll if any is unchecked\n * @param {HTMLTableSectionElement} tbody\n */\n shouldSelectAll(tbody) {\n if (!this.selectAll) {\n return;\n }\n // Delegate listener for change events on input checkboxes\n tbody.addEventListener(\"change\", this);\n // Make sure state is up to date\n tbody.dispatchEvent(new Event(\"change\"));\n }\n\n /**\n * @param {HTMLTableRowElement} tr\n */\n createDataCol(tr) {\n // Create col\n let td = document.createElement(\"td\");\n setAttribute(td, \"role\", \"gridcell button\");\n setAttribute(td, \"aria-colindex\", this.colIndex());\n td.classList.add(SELECTABLE_CLASS);\n\n // Create input\n let selectOne = document.createElement(\"input\");\n // Alias row id for easy retrieval in getSelection\n selectOne.dataset.id = tr.getAttribute(\"aria-rowindex\");\n selectOne.type = \"checkbox\";\n selectOne.classList.add(CHECKBOX_CLASS);\n // Label need to take full space thanks to css to make the whole cell clickable\n let label = document.createElement(\"label\");\n label.classList.add(\"dg-clickable-cell\");\n label.appendChild(selectOne);\n td.appendChild(label);\n\n // Prevent unwanted click behaviour on row\n label.addEventListener(\"click\", this);\n\n tr.appendChild(td);\n }\n\n /**\n * @param {Event} e\n */\n onclick(e) {\n e.stopPropagation();\n }\n\n /**\n * Handle change event on select all or any select checkbox in the table body\n * @param {import(\"../utils/shortcuts.js\").FlexibleEvent} e\n */\n onchange(e) {\n const grid = this.grid;\n if (hasClass(e.target, SELECT_ALL_CLASS)) {\n const visibleOnly = grid.options.selectVisibleOnly;\n const inputs = findAll(grid, `tbody .${SELECTABLE_CLASS} input`);\n inputs.forEach((cb) => {\n if (visibleOnly && !cb.offsetWidth) {\n return;\n }\n cb.checked = this.selectAll.checked;\n });\n\n dispatch(grid, \"rowsSelected\", {\n selection: this.getSelection(),\n });\n } else {\n if (!e.target.closest(`.${SELECTABLE_CLASS}`)) {\n return;\n }\n const totalCheckboxes = findAll(grid, `tbody .${SELECTABLE_CLASS} input[type=checkbox]`);\n // @ts-ignore\n const totalChecked = totalCheckboxes.filter((n) => n.checked);\n this.selectAll.checked = totalChecked.length == totalCheckboxes.length;\n\n dispatch(grid, \"rowsSelected\", {\n selection: grid.getSelection(),\n });\n }\n }\n}\n\nexport default SelectableRows;\n", "import BasePlugin from \"../core/base-plugin.js\";\nimport { setAttribute } from \"../utils/shortcuts.js\";\n\n/**\n * Support for fixed table height\n *\n * We should add a fake row to push the footer down in case we don't have enough rows\n */\nclass FixedHeight extends BasePlugin {\n constructor(grid) {\n super(grid);\n\n this.hasFixedHeight = false;\n // If we have a fixed height, make sure we have overflowY set\n if (grid.style.height) {\n grid.style.overflowY = \"auto\";\n this.hasFixedHeight = true;\n }\n }\n\n /**\n */\n createFakeRow() {\n const grid = this.grid;\n const tbody = grid.querySelector(\"tbody\");\n let tr = document.createElement(\"tr\");\n setAttribute(tr, \"role\", \"row\");\n setAttribute(tr, \"hidden\", \"\");\n tr.classList.add(\"dg-fake-row\");\n tr.tabIndex = 0;\n tbody.appendChild(tr);\n }\n\n get fakeRow() {\n return this.grid.querySelector(\".dg-fake-row\");\n }\n\n /**\n * On last page, use a fake row to push footer down\n */\n updateFakeRow() {\n const grid = this.grid;\n const fakeRow = this.fakeRow;\n if (!fakeRow) {\n return;\n }\n\n // We don't need a fake row if we display everything\n if (grid.options.perPage > grid.totalRecords()) {\n return;\n }\n // We are not on last page\n if (grid.page !== grid.totalPages()) {\n return;\n }\n if (!grid.options.autoheight) {\n return;\n }\n // Find remaining missing height\n const max = grid.options.perPage * grid.rowHeight;\n const visibleRows = grid.querySelectorAll(\"tbody tr:not([hidden])\").length;\n const fakeHeight = visibleRows > 1 ? max - visibleRows * grid.rowHeight : max;\n if (fakeHeight > 0) {\n setAttribute(fakeRow, \"height\", fakeHeight);\n fakeRow.removeAttribute(\"hidden\");\n } else {\n fakeRow.removeAttribute(\"height\");\n }\n }\n}\n\nexport default FixedHeight;\n", "import BasePlugin from \"../core/base-plugin.js\";\nimport getTextWidth from \"../utils/getTextWidth.js\";\nimport { getAttribute, hasAttribute, setAttribute } from \"../utils/shortcuts.js\";\n\n/**\n * Allows to resize columns\n */\nclass AutosizeColumn extends BasePlugin {\n /**\n * Autosize col based on column data\n * @param {HTMLTableCellElement} th\n * @param {import(\"../data-grid\").Column} column\n * @param {Number} min\n * @param {Number} max\n * @returns {Number}\n */\n computeSize(th, column, min, max) {\n const grid = this.grid;\n if (hasAttribute(th, \"width\")) {\n return getAttribute(th, \"width\");\n }\n if (!grid.data.length) {\n return;\n }\n const firstVal = grid.data[0];\n const lastVal = grid.data[grid.data.length - 1];\n let v = firstVal[column.field] ? firstVal[column.field].toString() : \"\";\n let v2 = lastVal[column.field] ? lastVal[column.field].toString() : \"\";\n if (v2.length > v.length) {\n v = v2;\n }\n let width = 0;\n if (v.length <= 6) {\n width = min;\n } else if (v.length > 50) {\n width = max;\n } else {\n // Add some extra room to have some spare space\n width = getTextWidth(v + \"0000\", th);\n }\n if (width > max) {\n width = max;\n }\n if (width < min) {\n width = min;\n }\n setAttribute(th, \"width\", width);\n return width;\n }\n}\n\nexport default AutosizeColumn;\n", "/**\r\n * Define a function that can be happily passed to addEventListener\r\n * @typedef {Function & EventListenerOrEventListenerObject} ExtendedFunction\r\n */\r\n\r\n/**\r\n * @param {Function} handler\r\n * @param {Number} timeout\r\n * @returns {ExtendedFunction}\r\n */\r\nexport default function debounce(handler, timeout = 300) {\r\n let timer = null;\r\n return (...args) => {\r\n clearTimeout(timer);\r\n timer = setTimeout(() => {\r\n timer = null;\r\n handler(...args);\r\n }, timeout);\r\n };\r\n}\r\n", "import BasePlugin from \"../core/base-plugin.js\";\nimport debounce from \"../utils/debounce.js\";\nimport { addClass, ce, find, findAll, hasClass, insertAfter, removeAttribute, removeClass, setAttribute } from \"../utils/shortcuts.js\";\n\nconst RESPONSIVE_CLASS = \"dg-responsive\";\n\nlet obsTo;\n\n/**\n * @param {Array} list\n * @returns {Array}\n */\nfunction sortByPriority(list) {\n return list.sort((a, b) => {\n const v1 = parseInt(a.dataset.responsive) || 1;\n const v2 = parseInt(b.dataset.responsive) || 1;\n return v2 - v1;\n });\n}\n\n/**\n * @type {ResizeObserverCallback}\n */\n//@ts-ignore\nconst callback = debounce((entries) => {\n for (const entry of entries) {\n /**\n * @type {import(\"../data-grid\").default}\n */\n // @ts-ignore\n const grid = entry.target;\n const table = grid.table;\n if (grid.plugins.ResponsiveGrid.observerBlocked) {\n return;\n }\n // check inlineSize (width) and not blockSize (height)\n const contentBoxSize = Array.isArray(entry.contentBoxSize) ? entry.contentBoxSize[0] : entry.contentBoxSize;\n const size = parseInt(contentBoxSize.inlineSize);\n const tableWidth = table.offsetWidth;\n const realTableWidth = findAll(grid.headerRow, \"th\").reduce((result, th) => {\n return result + th.offsetWidth;\n }, 0);\n const diff = (realTableWidth || tableWidth) - size - 1;\n const minWidth = 50;\n const prevAction = grid.plugins.ResponsiveGrid.prevAction;\n // We have an array with the columns to show/hide are in order, most important first\n const headerCols = sortByPriority(\n findAll(grid.headerRow, \"th[field]\")\n .reverse() // Order takes precedence if no priority is set\n .filter((col) => {\n // Leave out unresponsive columns\n return col.dataset.responsive !== \"0\";\n })\n );\n let changed = false;\n\n grid.log(`table is ${tableWidth}/${realTableWidth} and available size is ${size}. Diff: ${diff}`);\n\n // The table is too big when diff has a high value, otherwise it will be like -1 or -2\n if (diff > 0) {\n if (prevAction === \"show\") {\n return;\n }\n grid.plugins.ResponsiveGrid.prevAction = \"hide\";\n let remaining = diff;\n let cols = headerCols.filter((col) => {\n return !col.hasAttribute(\"hidden\") && col.hasAttribute(\"data-responsive\");\n });\n if (cols.length === 0) {\n cols = headerCols.filter((col) => {\n return !col.hasAttribute(\"hidden\");\n });\n // Always keep one column\n if (cols.length === 1) {\n return;\n }\n }\n cols.forEach((col) => {\n if (remaining < 0) {\n return;\n }\n\n const colWidth = col.offsetWidth;\n const field = col.getAttribute(\"field\");\n if (!field) {\n return;\n }\n col.dataset.baseWidth = \"\" + col.offsetWidth;\n\n grid.hideColumn(field, false);\n grid.setColProp(field, \"responsiveHidden\", true);\n changed = true;\n\n remaining -= colWidth;\n remaining = Math.round(remaining);\n });\n } else {\n if (prevAction === \"hide\") {\n return;\n }\n grid.plugins.ResponsiveGrid.prevAction = \"show\";\n\n const requiredWidth =\n headerCols\n .filter((col) => {\n return !col.hasAttribute(\"hidden\");\n })\n .reduce((result, col) => {\n const width = col.dataset.minWidth ? parseInt(col.dataset.minWidth) : col.offsetWidth;\n return result + width;\n }, 0) + minWidth; // Add an offset so that inserting column is smoother\n\n // Compute available width to insert columns\n let remaining = size - requiredWidth;\n // Do we have any hidden column that we can restore ?\n headerCols\n .slice()\n .reverse() // Reverse the array to restore the columns in the proper order\n .filter((col) => {\n return col.hasAttribute(\"hidden\");\n })\n .forEach((col) => {\n if (remaining < minWidth) {\n return;\n }\n const colWidth = parseInt(col.dataset.minWidth);\n\n // We need to have enough space to restore it\n if (colWidth > remaining) {\n remaining = -1; // break loop to keep restoring in order\n return;\n }\n\n const field = col.getAttribute(\"field\");\n if (!field) {\n return;\n }\n\n grid.showColumn(field, false);\n grid.setColProp(field, \"responsiveHidden\", false);\n changed = true;\n\n remaining -= colWidth;\n remaining = Math.round(remaining);\n });\n }\n\n // Check footer\n const footer = find(grid.table, \"tfoot\");\n const realFooterWidth = findAll(grid.table, \".dg-footer > div\").reduce((result, div) => {\n return result + div.offsetWidth;\n }, 0);\n const availableFooterWidth = footer.offsetWidth - realFooterWidth;\n if (realFooterWidth > size) {\n addClass(footer, \"dg-footer-compact\");\n } else if (availableFooterWidth > 250) {\n removeClass(footer, \"dg-footer-compact\");\n }\n if (changed) {\n grid.renderTable();\n }\n // Prevent resize loop\n setTimeout(() => {\n grid.plugins.ResponsiveGrid.prevAction = null;\n }, 1000);\n grid.table.style.visibility = \"visible\";\n }\n}, 100);\nconst resizeObserver = new ResizeObserver(callback);\n\n/**\n * Responsive data grid\n */\nclass ResponsiveGrid extends BasePlugin {\n constructor(grid) {\n super(grid);\n\n this.observerBlocked = false;\n this.prevAction = null;\n }\n\n connected() {\n if (this.grid.options.responsive) {\n this.observe();\n }\n }\n\n disconnected() {\n this.unobserve();\n }\n\n observe() {\n if (!this.grid.options.responsive) {\n return;\n }\n resizeObserver.observe(this.grid);\n this.grid.style.display = \"block\"; // Otherwise resize doesn't happen\n this.grid.style.overflowX = \"hidden\"; // Prevent scrollbars from appearing\n }\n\n unobserve() {\n resizeObserver.unobserve(this.grid);\n this.grid.style.display = \"unset\";\n this.grid.style.overflowX = \"unset\";\n }\n\n blockObserver() {\n this.observerBlocked = true;\n if (obsTo) {\n clearTimeout(obsTo);\n }\n }\n\n unblockObserver() {\n obsTo = setTimeout(() => {\n this.observerBlocked = false;\n }, 200); // more than debounce\n }\n\n /**\n * @returns {Boolean}\n */\n hasHiddenColumns() {\n let flag = false;\n this.grid.options.columns.forEach((col) => {\n if (col.responsiveHidden) {\n flag = true;\n }\n });\n return flag;\n }\n\n colIndex() {\n return this.grid.startColIndex() - 1;\n }\n\n /**\n * @param {HTMLTableRowElement} tr\n */\n createHeaderCol(tr) {\n if (!this.grid.options.responsiveToggle) {\n return;\n }\n let th = ce(\"th\", tr);\n setAttribute(th, \"scope\", \"col\");\n setAttribute(th, \"role\", \"columnheader button\");\n setAttribute(th, \"aria-colindex\", this.colIndex());\n setAttribute(th, \"width\", \"40\");\n th.classList.add(...[`${RESPONSIVE_CLASS}-toggle`, \"dg-not-resizable\", \"dg-not-sortable\"]);\n th.tabIndex = 0;\n }\n\n /**\n * @param {HTMLTableRowElement} tr\n */\n createFilterCol(tr) {\n if (!this.grid.options.responsiveToggle) {\n return;\n }\n let th = ce(\"th\", tr);\n setAttribute(th, \"role\", \"columnheader button\");\n setAttribute(th, \"aria-colindex\", this.colIndex());\n th.classList.add(`${RESPONSIVE_CLASS}-toggle`);\n th.tabIndex = 0;\n }\n\n /**\n * @param {HTMLTableRowElement} tr\n */\n createDataCol(tr) {\n if (!this.grid.options.responsiveToggle) {\n return;\n }\n // Create col\n let td = document.createElement(\"td\");\n setAttribute(td, \"role\", \"gridcell button\");\n setAttribute(td, \"aria-colindex\", this.colIndex());\n td.classList.add(`${RESPONSIVE_CLASS}-toggle`);\n\n // Create icon\n td.innerHTML = `
\n \n \n\n\n \n
`;\n tr.appendChild(td);\n\n td.addEventListener(\"click\", this);\n td.addEventListener(\"mousedown\", this);\n }\n\n computeLabelWidth() {\n let idealWidth = 0;\n let consideredCol = 0;\n while (idealWidth < 120) {\n consideredCol++;\n const hCol = find(this.grid, `.dg-head-columns th[aria-colindex=\"${consideredCol}\"]`);\n if (hCol) {\n idealWidth += hCol.offsetWidth;\n } else {\n break;\n }\n }\n return idealWidth;\n }\n\n /**\n * @param {Event} ev\n */\n onmousedown(ev) {\n // Avoid selection through double click\n ev.preventDefault();\n }\n\n /**\n * @param {Event} ev\n */\n onclick(ev) {\n // Prevent expandable\n ev.stopPropagation();\n\n // target is the element that triggered the event (e.g., the user clicked on)\n // currentTarget is the element that the event listener is attached to.\n\n /**\n * @type {HTMLTableRowElement}\n */\n //@ts-ignore\n const td = ev.currentTarget;\n const tr = td.parentElement;\n const open = find(td, `.${RESPONSIVE_CLASS}-open`);\n const close = find(td, `.${RESPONSIVE_CLASS}-close`);\n\n this.blockObserver();\n\n const isExpanded = hasClass(tr, `${RESPONSIVE_CLASS}-expanded`);\n if (isExpanded) {\n removeClass(tr, `${RESPONSIVE_CLASS}-expanded`);\n open.style.display = \"unset\";\n close.style.display = \"none\";\n\n // Move back rows and cleanup row\n const childRow = tr.nextElementSibling;\n const hiddenCols = findAll(childRow, `.${RESPONSIVE_CLASS}-hidden`);\n hiddenCols.forEach((col) => {\n // We don't really need to care where we insert them since we are going to redraw anyway\n tr.appendChild(col);\n setAttribute(col, \"hidden\");\n });\n\n childRow.parentElement.removeChild(childRow);\n } else {\n addClass(tr, `${RESPONSIVE_CLASS}-expanded`);\n open.style.display = \"none\";\n close.style.display = \"unset\";\n\n // Create a child row and move rows into it\n const childRow = ce(\"tr\");\n insertAfter(childRow, tr);\n addClass(childRow, `${RESPONSIVE_CLASS}-child-row`);\n\n const childRowTd = ce(\"td\", childRow);\n setAttribute(childRowTd, \"colspan\", this.grid.columnsLength(true));\n\n const childTable = ce(\"table\", childRowTd);\n addClass(childTable, `${RESPONSIVE_CLASS}-table`);\n\n const hiddenCols = findAll(tr, `.${RESPONSIVE_CLASS}-hidden`);\n const idealWidth = this.computeLabelWidth();\n hiddenCols.forEach((col) => {\n const childTableRow = ce(\"tr\", childTable);\n\n // Add label\n const label = col.dataset.name;\n const labelCol = ce(\"th\", childTableRow);\n // It looks much better when aligned with an actual col\n labelCol.style.width = `${idealWidth}px`;\n labelCol.innerHTML = label;\n\n // Add actual row\n childTableRow.appendChild(col);\n removeAttribute(col, \"hidden\");\n });\n }\n\n this.unblockObserver();\n }\n}\n\nexport default ResponsiveGrid;\n", "import BasePlugin from \"../core/base-plugin.js\";\r\nimport interpolate from \"../utils/interpolate.js\";\r\nimport { dispatch, on, setAttribute } from \"../utils/shortcuts.js\";\r\n\r\n/**\r\n * Add action on rows\r\n */\r\nclass RowActions extends BasePlugin {\r\n /**\r\n * @returns {Boolean}\r\n */\r\n hasActions() {\r\n return this.grid.options.actions.length > 0;\r\n }\r\n\r\n /**\r\n *\r\n * @param {HTMLTableRowElement} tr\r\n */\r\n makeActionHeader(tr) {\r\n let actionsTh = document.createElement(\"th\");\r\n setAttribute(actionsTh, \"role\", \"columnheader button\");\r\n setAttribute(actionsTh, \"aria-colindex\", this.grid.columnsLength(true));\r\n actionsTh.classList.add(...[\"dg-actions\", \"dg-not-sortable\", \"dg-not-resizable\", this.actionClass]);\r\n actionsTh.tabIndex = 0;\r\n tr.appendChild(actionsTh);\r\n }\r\n\r\n /**\r\n *\r\n * @param {HTMLTableRowElement} tr\r\n */\r\n makeActionFilter(tr) {\r\n let actionsTh = document.createElement(\"th\");\r\n actionsTh.setAttribute(\"role\", \"columnheader button\");\r\n actionsTh.setAttribute(\"aria-colindex\", \"\" + this.grid.columnsLength(true));\r\n actionsTh.classList.add(...[\"dg-actions\", this.actionClass]);\r\n actionsTh.tabIndex = 0;\r\n tr.appendChild(actionsTh);\r\n }\r\n\r\n /**\r\n * @param {HTMLTableRowElement} tr\r\n * @param {Object} item\r\n */\r\n makeActionRow(tr, item) {\r\n const labels = this.grid.labels;\r\n const td = document.createElement(\"td\");\r\n setAttribute(td, \"role\", \"gridcell\");\r\n setAttribute(td, \"aria-colindex\", this.grid.columnsLength(true));\r\n td.classList.add(...[\"dg-actions\", this.actionClass]);\r\n td.tabIndex = 0;\r\n\r\n // Add menu toggle\r\n let actionsToggle = document.createElement(\"button\");\r\n actionsToggle.classList.add(\"dg-actions-toggle\");\r\n actionsToggle.innerHTML = \"\u2630\";\r\n td.appendChild(actionsToggle);\r\n on(actionsToggle, \"click\", (ev) => {\r\n ev.stopPropagation();\r\n ev.target.parentElement.classList.toggle(\"dg-actions-expand\");\r\n });\r\n\r\n this.grid.options.actions.forEach((action) => {\r\n let button = document.createElement(\"button\");\r\n if (action.html) {\r\n button.innerHTML = action.html;\r\n } else {\r\n button.innerText = action.title ?? action.name;\r\n }\r\n if (action.title) {\r\n button.title = action.title;\r\n }\r\n if (action.url) {\r\n button.type = \"submit\";\r\n button.formAction = interpolate(action.url, item);\r\n }\r\n if (action.class) {\r\n button.classList.add(...action.class.split(\" \"));\r\n }\r\n const actionHandler = (ev) => {\r\n ev.stopPropagation();\r\n if (action.confirm) {\r\n let c = confirm(labels.areYouSure);\r\n if (!c) {\r\n ev.preventDefault();\r\n return;\r\n }\r\n }\r\n dispatch(this.grid, \"action\", {\r\n data: item,\r\n action: action.name,\r\n });\r\n };\r\n button.addEventListener(\"click\", actionHandler);\r\n td.appendChild(button);\r\n\r\n // Row action\r\n if (action.default) {\r\n tr.classList.add(\"dg-actionable\");\r\n tr.addEventListener(\"click\", actionHandler);\r\n }\r\n });\r\n\r\n tr.appendChild(td);\r\n }\r\n\r\n get actionClass() {\r\n if (this.grid.options.actions.length < 3 && !this.grid.options.collapseActions) {\r\n return \"dg-actions-\" + this.grid.options.actions.length;\r\n }\r\n return \"dg-actions-more\";\r\n }\r\n}\r\n\r\nexport default RowActions;\r\n", "import BasePlugin from \"../core/base-plugin.js\";\r\nimport { dispatch } from \"../utils/shortcuts.js\";\r\n\r\n/**\r\n * Make editable inputs in rows\r\n */\r\nclass EditableColumn extends BasePlugin {\r\n /**\r\n *\r\n * @param {HTMLTableCellElement} td\r\n * @param {import(\"../data-grid\").Column} column\r\n * @param {Object} item\r\n * @param {number} i\r\n */\r\n makeEditableInput(td, column, item, i) {\r\n const gridId = this.grid.getAttribute(\"id\");\r\n let input = document.createElement(\"input\");\r\n input.type = column.editableType || \"text\";\r\n if (input.type == \"email\") {\r\n input.inputMode = \"email\";\r\n }\r\n if (input.type == \"decimal\") {\r\n input.type = \"text\";\r\n input.inputMode = \"decimal\";\r\n }\r\n input.autocomplete = \"off\";\r\n input.spellcheck = false;\r\n input.tabIndex = 0;\r\n input.classList.add(\"dg-editable\");\r\n input.name = gridId.replace(\"-\", \"_\") + \"[\" + (i + 1) + \"]\" + \"[\" + column.field + \"]\";\r\n input.value = item[column.field];\r\n input.dataset.field = column.field;\r\n\r\n // Prevent row action\r\n input.addEventListener(\"click\", (ev) => ev.stopPropagation());\r\n // Enter validates edit\r\n input.addEventListener(\"keypress\", (ev) => {\r\n if (ev.type === \"keypress\") {\r\n const key = ev.keyCode || ev.key;\r\n if (key === 13 || key === \"Enter\") {\r\n input.blur();\r\n ev.preventDefault();\r\n }\r\n }\r\n });\r\n // Save on blur\r\n input.addEventListener(\"blur\", () => {\r\n // Only fire on update\r\n if (input.value == item[input.dataset.field]) {\r\n return;\r\n }\r\n // Update underlying data\r\n item[input.dataset.field] = input.value;\r\n // Notify\r\n dispatch(this.grid, \"edit\", {\r\n data: item,\r\n value: input.value,\r\n });\r\n });\r\n td.appendChild(input);\r\n }\r\n}\r\n\r\nexport default EditableColumn;\r\n", "import DataGrid from \"./src/data-grid.js\";\n// Optional plugins\nimport ColumnResizer from \"./src/plugins/column-resizer.js\";\nimport ContextMenu from \"./src/plugins/context-menu.js\";\nimport DraggableHeaders from \"./src/plugins/draggable-headers.js\";\nimport TouchSupport from \"./src/plugins/touch-support.js\";\nimport SelectableRows from \"./src/plugins/selectable-rows.js\";\nimport FixedHeight from \"./src/plugins/fixed-height.js\";\nimport AutosizeColumn from \"./src/plugins/autosize-column.js\";\nimport ResponsiveGrid from \"./src/plugins/responsive-grid.js\";\nimport RowActions from \"./src/plugins/row-actions.js\";\nimport EditableColumn from \"./src/plugins/editable-column.js\";\n\n// Using shorthand property names\n// This make them reserved and keys will be preserved\n// Actual class names are renamed\nDataGrid.registerPlugins({\n ColumnResizer,\n ContextMenu,\n DraggableHeaders,\n TouchSupport,\n SelectableRows,\n FixedHeight,\n AutosizeColumn,\n ResponsiveGrid,\n RowActions,\n EditableColumn,\n});\n\n// Prevent errors if included multiple times\nif (!customElements.get(\"data-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AAQ,IAAK,GAAG,EAAI,KAAOD,EAAI,GAAK,KAAYF,EAAO,MAAQ,IACnFI,EAAM,MAAQH,EAAKD,EAAO,KAAK,EAC/BI,EAAM,QAAQ,MAAQJ,EAAO,MAG7BI,EAAM,iBAAiB,QAAUC,GAAOA,EAAG,gBAAgB,CAAC,EAE5DD,EAAM,iBAAiB,WAAaC,GAAO,CACzC,GAAIA,EAAG,OAAS,WAAY,CAC1B,IAAMC,EAAMD,EAAG,SAAWA,EAAG,KACzBC,IAAQ,IAAMA,IAAQ,WACxBF,EAAM,KAAK,EACXC,EAAG,eAAe,GAGxB,CAAC,EAEDD,EAAM,iBAAiB,OAAQ,IAAM,CAE/BA,EAAM,OAASH,EAAKG,EAAM,QAAQ,KAAK,IAI3CH,EAAKG,EAAM,QAAQ,KAAK,EAAIA,EAAM,MAElCG,EAAS,KAAK,KAAM,OAAQ,CAC1B,KAAMN,EACN,MAAOG,EAAM,KACf,CAAC,EACH,CAAC,EACDL,EAAG,YAAYK,CAAK,CACtB,CACF,EAEOI,GAAQX,GC/CfY,EAAS,gBAAgB,CACvB,cAAAC,GACA,YAAAC,GACA,iBAAAC,GACA,aAAAC,GACA,eAAAC,GACA,YAAAC,GACA,eAAAC,GACA,eAAAC,GACA,WAAAC,GACA,eAAAC,EACF,CAAC,EAGI,eAAe,IAAI,WAAW,GACjC,eAAe,OAAO,YAAaV,CAAQ,EAG7C,IAAOA,GAAQA", - "names": ["camelize", "str", "m", "chr", "normalizeData", "v", "supportedPassiveTypes", "passiveOpts", "type", "getAttribute", "el", "name", "hasAttribute", "setAttribute", "v", "check", "removeAttribute", "on", "listener", "off", "dispatch", "el", "name", "data", "bubbles", "opts", "hasClass", "addClass", "removeClass", "toggleClass", "$", "selector", "base", "$$", "find", "findAll", "ce", "tagName", "parent", "el", "insertAfter", "newNode", "existingNode", "BaseElement", "options", "opt", "v", "setAttribute", "jsonConfig", "data", "key", "normalizeData", "message", "getAttribute", "event", "template", "dispatch", "attributeName", "oldValue", "newValue", "isOption", "transformer", "camelize", "base_element_default", "addSelectOption", "el", "value", "label", "checked", "opt", "appendParamsToUrl", "url", "params", "key", "k", "convertArray", "v", "elementOffset", "el", "rect", "scrollLeft", "scrollTop", "interpolate", "str", "data", "$1", "$2", "getTextWidth", "text", "el", "withPadding", "styles", "fontWeight", "fontSize", "fontFamily", "padding", "paddingLeft", "paddingRight", "context", "metrics", "randstr", "prefix", "plugins", "labels", "applyColumnDefinition", "el", "column", "setAttribute", "addClass", "DataGrid", "base_element_default", "randstr", "pluginName", "pluginClass", "attr", "camelize", "v", "list", "plugin", "columns", "cols", "key", "col", "item", "convertArray", "val", "updatePage", "addSelectOption", "field", "found", "prop", "c", "render", "dispatch", "start", "visibleOnly", "len", "tr", "find", "row", "removeAttribute", "findAll", "th", "fieldName", "value", "data", "metaKey", "dataKey", "cb", "needRender", "flagEmpty", "resolve", "response", "err", "event", "filters", "input", "name", "haveClasses", "sort", "stack", "itemA", "itemB", "a", "b", "valA", "valB", "reject", "base", "url", "params", "appendParamsToUrl", "sortedColumn", "thead", "tfoot", "td", "availableWidth", "colMaxWidth", "idx", "ce", "sampleTh", "totalWidth", "colIdx", "computedWidth", "getTextWidth", "w", "colAvailableWidth", "visibleCols", "lastCol", "scrollbarWidth", "diff", "hasClass", "actualWidth", "minWidth", "newWidth", "sortableRow", "relatedTh", "e", "tbody", "i", "on", "ev", "toggleClass", "tv", "interpolate", "prev", "total", "p", "index", "high", "low", "getAttribute", "data_grid_default", "BasePlugin", "grid", "event", "base_plugin_default", "ColumnResizer", "base_plugin_default", "grid", "resizeLabel", "table", "cols", "findAll", "col", "hasClass", "resizer", "addClass", "startX", "startW", "remainingSpace", "max", "mouseMoveHandler", "e", "newWidth", "setAttribute", "mouseUpHandler", "removeClass", "off", "dispatch", "getAttribute", "on", "target", "visibleCols", "columnIndex", "column", "removeAttribute", "elementOffset", "j", "column_resizer_default", "getParentElement", "el", "type", "prop", "parent", "ContextMenu", "base_plugin_default", "off", "grid", "on", "e", "t", "field", "target", "getParentElement", "menu", "rect", "x", "y", "removeAttribute", "documentClickHandler", "setAttribute", "col", "li", "label", "checkbox", "text", "context_menu_default", "DraggableHeaders", "base_plugin_default", "th", "grid", "on", "e", "t", "target", "getParentElement", "index", "targetIndex", "offset", "tmp", "swapNodes", "selector", "el1", "rowIndex", "el2", "setAttribute", "newNode", "findAll", "c", "getAttribute", "dispatch", "draggable_headers_default", "TouchSupport", "base_plugin_default", "grid", "e", "xDiff", "yDiff", "touch_support_default", "SELECTABLE_CLASS", "SELECT_ALL_CLASS", "CHECKBOX_CLASS", "SelectableRows", "base_plugin_default", "key", "grid", "selectedData", "findAll", "checkbox", "idx", "item", "tbody", "input", "tr", "th", "setAttribute", "label", "td", "selectOne", "e", "hasClass", "visibleOnly", "cb", "dispatch", "totalCheckboxes", "totalChecked", "n", "selectable_rows_default", "FixedHeight", "base_plugin_default", "grid", "tbody", "tr", "setAttribute", "fakeRow", "max", "visibleRows", "fakeHeight", "fixed_height_default", "AutosizeColumn", "base_plugin_default", "th", "column", "min", "max", "grid", "hasAttribute", "getAttribute", "firstVal", "lastVal", "v", "v2", "width", "getTextWidth", "setAttribute", "autosize_column_default", "debounce", "handler", "timeout", "timer", "args", "RESPONSIVE_CLASS", "obsTo", "sortByPriority", "list", "a", "b", "v1", "callback", "debounce", "entries", "entry", "grid", "table", "contentBoxSize", "size", "tableWidth", "realTableWidth", "findAll", "result", "th", "diff", "minWidth", "prevAction", "headerCols", "col", "changed", "remaining", "cols", "colWidth", "field", "requiredWidth", "width", "footer", "find", "realFooterWidth", "div", "availableFooterWidth", "addClass", "removeClass", "resizeObserver", "ResponsiveGrid", "base_plugin_default", "flag", "tr", "ce", "setAttribute", "td", "idealWidth", "consideredCol", "hCol", "ev", "open", "close", "hasClass", "childRow", "insertAfter", "childRowTd", "childTable", "hiddenCols", "childTableRow", "label", "labelCol", "removeAttribute", "responsive_grid_default", "RowActions", "base_plugin_default", "tr", "actionsTh", "setAttribute", "item", "labels", "td", "actionsToggle", "on", "ev", "action", "button", "interpolate", "actionHandler", "dispatch", "row_actions_default", "EditableColumn", "base_plugin_default", "td", "column", "item", "i", "gridId", "input", "ev", "key", "dispatch", "editable_column_default", "data_grid_default", "column_resizer_default", "context_menu_default", "draggable_headers_default", "touch_support_default", "selectable_rows_default", "fixed_height_default", "autosize_column_default", "responsive_grid_default", "row_actions_default", "editable_column_default"] + "sourcesContent": ["/**\r\n * @param {String} str\r\n * @returns {String}\r\n */\r\nexport default function camelize(str) {\r\n return str.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g, (m, chr) => chr.toUpperCase());\r\n}\r\n", "/**\r\n * Parse data attribute and return properly typed data\r\n * @param {String} v\r\n * @returns {any}\r\n */\r\nexport default function normalizeData(v) {\r\n // Bool\r\n if (v === \"true\") {\r\n return true;\r\n }\r\n if (v === \"false\") {\r\n return false;\r\n }\r\n // Null or empty\r\n if (v === \"\" || v === \"null\") {\r\n return null;\r\n }\r\n // Numeric attributes\r\n if (v === Number(v).toString()) {\r\n return Number(v);\r\n }\r\n // Only attempt json parsing for array or objects\r\n if (v && [\"[\", \"{\"].includes(v.substring(0, 1))) {\r\n try {\r\n // In case we have only single quoted values, like ['one', 'two', 'three']\r\n if (v.indexOf('\"') === -1) {\r\n v = v.replace(/'/g, '\"');\r\n }\r\n return JSON.parse(decodeURIComponent(v));\r\n } catch {\r\n console.error(\"Failed to parse \" + v);\r\n return {};\r\n }\r\n }\r\n return v;\r\n}\r\n", "/**\r\n * @typedef FlexibleHTMLProps\r\n * @property {boolean} [checked] (HTMLInputElement)\r\n * @property {string} [value] (HTMLInputElement)\r\n * @property {number} [rowHeight] (HTMLTableRowElement)\r\n *\r\n * A flexible type HTMLElement type that does not require using instanceof all over the place\r\n * Make sure that your selector is indeed valid\r\n * Only includes most commons props\r\n * @typedef {HTMLElement & FlexibleHTMLProps} FlexibleHTMLElement\r\n */\r\n\r\n/**\r\n * Keep this as reference for easy documentation\r\n * @typedef {HTMLElement&HTMLInputElement&HTMLTableRowElement} MixedHTMLElement\r\n */\r\n\r\n/**\r\n * @typedef FlexibleEventProps\r\n * @property {FlexibleHTMLElement} target\r\n * @property {FlexibleHTMLElement} currentTarget\r\n * @property {DataTransfer} [dataTransfer] (DragEvent)\r\n * @property {number} [clientX] (MouseEvent)\r\n * @property {number} [clientY] (MouseEvent)\r\n *\r\n * @typedef {Event & FlexibleEventProps} FlexibleEvent\r\n */\r\n\r\n/**\r\n * Keep this as reference for easy documentation\r\n * @typedef {Event&MouseEvent&InputEvent&DragEvent&FocusEvent&KeyboardEvent&PointerEvent} MixedEvent\r\n */\r\n\r\n/**\r\n * @callback FlexibleListener\r\n * @param {FlexibleEvent} event\r\n */\r\n\r\nclass FlexibleEventListenerObject {\r\n /**\r\n * @param {FlexibleEvent} e\r\n */\r\n handleEvent(e) {}\r\n}\r\n\r\nconst supportedPassiveTypes = [\r\n \"scroll\",\r\n \"wheel\",\r\n \"touchstart\",\r\n \"touchmove\",\r\n \"touchenter\",\r\n \"touchend\",\r\n \"touchleave\",\r\n \"mouseout\",\r\n \"mouseleave\",\r\n \"mouseup\",\r\n \"mousedown\",\r\n \"mousemove\",\r\n \"mouseenter\",\r\n \"mousewheel\",\r\n \"mouseover\",\r\n];\r\n\r\n/**\r\n * Automatically set passive options based on type\r\n * @param {string} type\r\n * @returns {AddEventListenerOptions}\r\n */\r\nfunction passiveOpts(type) {\r\n if (supportedPassiveTypes.includes(type)) {\r\n return { passive: true };\r\n }\r\n return {};\r\n}\r\n\r\n/**\r\n * @param {Element} el\r\n * @param {String} name\r\n * @returns {any}\r\n */\r\nexport function getAttribute(el, name) {\r\n return el.getAttribute(name);\r\n}\r\n\r\n/**\r\n * @param {Element} el\r\n * @param {String} name\r\n * @returns {Boolean}\r\n */\r\nexport function hasAttribute(el, name) {\r\n return el.hasAttribute(name);\r\n}\r\n\r\n/**\r\n * @param {Element} el\r\n * @param {String} name\r\n * @param {any} v\r\n * @param {Boolean} check Prevent setting if attribute is already there\r\n */\r\nexport function setAttribute(el, name, v = \"\", check = false) {\r\n if (check && hasAttribute(el, name)) return;\r\n el.setAttribute(name, \"\" + v);\r\n}\r\n\r\n/**\r\n * @param {Element} el\r\n * @param {String} name\r\n */\r\nexport function removeAttribute(el, name) {\r\n if (hasAttribute(el, name)) {\r\n el.removeAttribute(name);\r\n }\r\n}\r\n\r\n/**\r\n * @param {EventTarget} el\r\n * @param {String} type\r\n * @param {EventListenerObject|FlexibleListener} listener\r\n */\r\nexport function on(el, type, listener) {\r\n el.addEventListener(type, listener, passiveOpts(type));\r\n}\r\n\r\n/**\r\n * @param {EventTarget} el\r\n * @param {String} type\r\n * @param {EventListenerObject|FlexibleListener} listener\r\n */\r\nexport function off(el, type, listener) {\r\n el.removeEventListener(type, listener, passiveOpts(type));\r\n}\r\n\r\n/**\r\n * @param {EventTarget} el\r\n * @param {String} type\r\n * @param {EventListenerObject|FlexibleListener} listener\r\n */\r\nexport function one(el, type, listener) {\r\n el.addEventListener(type, listener, {\r\n once: true,\r\n });\r\n}\r\n\r\n/**\r\n * @param {HTMLElement} el\r\n * @param {String} name\r\n * @param {any} data\r\n * @param {Boolean} bubbles\r\n */\r\nexport function dispatch(el, name, data = {}, bubbles = false) {\r\n let opts = {};\r\n if (bubbles) {\r\n opts.bubbles = true;\r\n }\r\n if (data) {\r\n opts.detail = data;\r\n }\r\n el.dispatchEvent(new CustomEvent(name, opts));\r\n}\r\n\r\n/**\r\n * @param {Element} el\r\n * @param {String} name\r\n * @returns {Boolean}\r\n */\r\nexport function hasClass(el, name) {\r\n return el.classList.contains(name);\r\n}\r\n\r\n/**\r\n * @param {Element} el\r\n * @param {String} name\r\n */\r\nexport function addClass(el, name) {\r\n el.classList.add(...name.split(\" \"));\r\n}\r\n\r\n/**\r\n * @param {Element} el\r\n * @param {String} name\r\n */\r\nexport function removeClass(el, name) {\r\n el.classList.remove(...name.split(\" \"));\r\n}\r\n\r\n/**\r\n * @param {Element} el\r\n * @param {String} name\r\n */\r\nexport function toggleClass(el, name) {\r\n el.classList.toggle(name);\r\n}\r\n\r\n/**\r\n * @param {String|HTMLElement} selector\r\n * @param {HTMLElement|Document} base\r\n * @returns {FlexibleHTMLElement|null}\r\n */\r\nexport function $(selector, base = document) {\r\n if (selector instanceof HTMLElement) {\r\n return selector;\r\n }\r\n return base.querySelector(selector);\r\n}\r\n\r\n/**\r\n * @param {String} selector\r\n * @param {Element|Document} base\r\n * @returns {Array}\r\n */\r\nexport function $$(selector, base = document) {\r\n return Array.from(base.querySelectorAll(selector));\r\n}\r\n\r\n/**\r\n * Easily retrieve untyped element\r\n * For actual type, prefer use of el.querySelector\r\n * @param {HTMLElement} el\r\n * @param {String|HTMLElement} selector\r\n * @returns {FlexibleHTMLElement}\r\n */\r\nexport function find(el, selector) {\r\n return $(selector, el);\r\n}\r\n\r\n/**\r\n * Easily retrieve untyped elements\r\n * For actual type, prefer use of el.querySelectorAll\r\n * @param {Element} el\r\n * @param {String} selector\r\n * @returns {Array}\r\n */\r\nexport function findAll(el, selector) {\r\n return $$(selector, el);\r\n}\r\n\r\n/**\r\n * @param {*} el\r\n * @returns {FlexibleHTMLElement}\r\n */\r\nexport function el(el) {\r\n return el;\r\n}\r\n\r\n/**\r\n * @template {keyof HTMLElementTagNameMap} K\r\n * @param {K} tagName\r\n * @param {HTMLElement} parent\r\n * @returns {HTMLElementTagNameMap[K]}\r\n */\r\nexport function ce(tagName, parent = null) {\r\n const el = document.createElement(tagName);\r\n if (parent) {\r\n parent.appendChild(el);\r\n }\r\n return el;\r\n}\r\n\r\n/**\r\n * @param {HTMLElement} newNode\r\n * @param {HTMLElement} existingNode\r\n */\r\nexport function insertAfter(newNode, existingNode) {\r\n existingNode.parentNode.insertBefore(newNode, existingNode.nextSibling);\r\n}\r\n", "import camelize from \"../utils/camelize.js\";\r\nimport normalizeData from \"../utils/normalizeData.js\";\r\nimport { dispatch, getAttribute, setAttribute } from \"../utils/shortcuts.js\";\r\n\r\n/**\r\n * Base element that does not contain any specific logic\r\n * related to this project but makes HTMLElemnt usable\r\n */\r\nclass BaseElement extends HTMLElement {\r\n /**\r\n * @param {Object} options\r\n */\r\n constructor(options = {}) {\r\n super();\r\n this.options = Object.assign({}, this.defaultOptions, this.normalizedDataset, options);\r\n\r\n this.log(\"constructor\");\r\n\r\n this.fireEvents = true;\r\n this._ready();\r\n\r\n this.log(\"ready\");\r\n }\r\n\r\n get defaultOptions() {\r\n return {};\r\n }\r\n\r\n /**\r\n * @param {String} opt\r\n * @returns {any}\r\n */\r\n getOption(opt) {\r\n return this.options[opt];\r\n }\r\n\r\n /**\r\n * @param {String} opt\r\n * @param {any} v\r\n */\r\n setOption(opt, v) {\r\n setAttribute(this, `data-${opt}`, v);\r\n }\r\n\r\n /**\r\n * @param {String} opt\r\n */\r\n toggleOption(opt) {\r\n setAttribute(this, `data-${opt}`, !this.getOption(opt));\r\n }\r\n\r\n get normalizedDataset() {\r\n let jsonConfig = this.dataset.config ? JSON.parse(this.dataset.config) : {};\r\n let data = { ...this.dataset };\r\n for (var key in data) {\r\n if (key == \"config\") {\r\n continue;\r\n }\r\n data[key] = normalizeData(data[key]);\r\n }\r\n // Once normalized, merge into json config\r\n Object.assign(data, jsonConfig);\r\n return data;\r\n }\r\n\r\n /**\r\n * @returns {String}\r\n */\r\n static template() {\r\n return \"\";\r\n }\r\n\r\n /**\r\n * This is called at the end of constructor. Extend in subclass if needed.\r\n */\r\n _ready() {}\r\n\r\n /**\r\n * @param {String|Error} message\r\n */\r\n log(message) {\r\n if (this.options.debug) {\r\n console.log(\"[\" + getAttribute(this, \"id\") + \"] \" + message);\r\n }\r\n }\r\n\r\n /**\r\n * Handle events within the component\r\n * @link https://gist.github.com/WebReflection/ec9f6687842aa385477c4afca625bbf4#handling-events\r\n * @param {Event} event\r\n */\r\n handleEvent(event) {\r\n if (this[`on${event.type}`]) {\r\n this[`on${event.type}`](event);\r\n }\r\n }\r\n\r\n /**\r\n * This is called when connected. Extend in subclass if needed.\r\n */\r\n _connected() {}\r\n\r\n connectedCallback() {\r\n // ensure whenDefined callbacks run first\r\n setTimeout(() => {\r\n this.log(\"connectedCallback\");\r\n\r\n // Append only when labels had the opportunity to be set\r\n // Don't use shadow dom as it makes theming super hard\r\n const template = document.createElement(\"template\");\r\n // @ts-ignore\r\n template.innerHTML = this.constructor.template();\r\n this.appendChild(template.content.cloneNode(true));\r\n\r\n this._connected();\r\n // @link https://gist.github.com/WebReflection/ec9f6687842aa385477c4afca625bbf4#life-cycle-events\r\n dispatch(this, \"connected\");\r\n }, 0);\r\n }\r\n\r\n /**\r\n * This is called when disconnected. Extend in subclass if needed.\r\n */\r\n _disconnected() {}\r\n\r\n disconnectedCallback() {\r\n this.log(\"disconnectedCallback\");\r\n this._disconnected();\r\n // @link https://gist.github.com/WebReflection/ec9f6687842aa385477c4afca625bbf4#life-cycle-events\r\n dispatch(this, \"disconnected\");\r\n }\r\n\r\n /**\r\n * @link https://gist.github.com/WebReflection/ec9f6687842aa385477c4afca625bbf4#a-props-like-accessor\r\n * @returns {Object}\r\n */\r\n get transformAttributes() {\r\n return {};\r\n }\r\n\r\n /**\r\n * This is only meant to work with data attributes\r\n * This allows us to have properties that reflect automatically in the component\r\n * @link https://gist.github.com/WebReflection/ec9f6687842aa385477c4afca625bbf4#reflected-dataset-attributes\r\n * @param {String} attributeName\r\n * @param {String} oldValue\r\n * @param {String} newValue\r\n */\r\n attributeChangedCallback(attributeName, oldValue, newValue) {\r\n // It didn't change\r\n if (oldValue === newValue) {\r\n return;\r\n }\r\n\r\n this.log(\"attributeChangedCallback: \" + attributeName);\r\n\r\n let isOption = false;\r\n const transformer = this.transformAttributes[attributeName] ?? normalizeData;\r\n\r\n // Data attributes are mapped to options while other attributes are mapped as properties\r\n if (attributeName.indexOf(\"data-\") === 0) {\r\n attributeName = attributeName.slice(5);\r\n isOption = true;\r\n }\r\n attributeName = camelize(attributeName);\r\n if (isOption) {\r\n this.options[attributeName] = transformer(newValue);\r\n } else {\r\n this[attributeName] = transformer(newValue);\r\n }\r\n\r\n // Fire internal event\r\n if (this.fireEvents && this[`${attributeName}Changed`]) {\r\n this[`${attributeName}Changed`]();\r\n }\r\n }\r\n}\r\n\r\nexport default BaseElement;\r\n", "/**\r\n * @param {HTMLSelectElement} el\r\n * @param {String} value\r\n * @param {String} label\r\n * @param {Boolean} checked\r\n */\r\nexport default function addSelectOption(el, value, label, checked = false) {\r\n let opt = document.createElement(\"option\");\r\n opt.value = \"\" + value;\r\n if (checked) {\r\n opt.selected = true;\r\n }\r\n opt.label = label;\r\n el.appendChild(opt);\r\n}\r\n", "/**\r\n * @param {URL} url\r\n * @param {Object} params\r\n */\r\nexport default function appendParamsToUrl(url, params = {}) {\r\n Object.keys(params).forEach((key) => {\r\n if (Array.isArray(params[key])) {\r\n // @ts-ignore\r\n Object.keys(params[key]).forEach((k) => url.searchParams.append(isNaN(k) ? `${key}[${k}]` : key, params[key][k]));\r\n } else {\r\n url.searchParams.append(key, params[key]);\r\n }\r\n });\r\n}\r\n", "/**\r\n * Force value as arrays\r\n * @param {String|Array} v\r\n * @returns {Array}\r\n */\r\nexport default function convertArray(v) {\r\n if (typeof v === \"string\") {\r\n if (v[0] === \"[\") {\r\n // \"['my', 'value']\" would fail as a json\r\n if (v.indexOf('\"') === -1) {\r\n v = v.replace(/'/g, '\"');\r\n }\r\n return JSON.parse(v);\r\n }\r\n\r\n return v.split(\",\");\r\n }\r\n if (!Array.isArray(v)) {\r\n console.error(\"Invalid array\", v);\r\n return [];\r\n }\r\n return v;\r\n}\r\n", "/**\r\n * @param {HTMLElement} el\r\n * @returns {Object}\r\n */\r\nexport default function elementOffset(el) {\r\n var rect = el.getBoundingClientRect(),\r\n scrollLeft = window.pageXOffset || document.documentElement.scrollLeft,\r\n scrollTop = window.pageYOffset || document.documentElement.scrollTop;\r\n return { top: rect.top + scrollTop, left: rect.left + scrollLeft };\r\n}\r\n", "/**\r\n * Replace element within {} by their data value\r\n * @param {String} str\r\n * @param {Object} data\r\n * @returns {String}\r\n */\r\nexport default function interpolate(str, data) {\r\n return str.replace(/\\{([^}]+)?\\}/g, function ($1, $2) {\r\n return data[$2];\r\n });\r\n}\r\n", "/**\r\n * Uses canvas.measureText to compute and return the width of the given text of given font in pixels.\r\n * Getting computed styles only works for dom that are added in the dom\r\n * @see https://stackoverflow.com/questions/118241/calculate-text-width-with-javascript/21015393#21015393\r\n * @param {String} text The text to be rendered.\r\n * @param {Element} el Target element (defaults to body)\r\n * @param {Boolean} withPadding Include padding on element\r\n * @returns {Number}\r\n */\r\nexport default function getTextWidth(text, el = document.body, withPadding = false) {\r\n if (!el) {\r\n el = document.createElement(\"div\");\r\n }\r\n const styles = window.getComputedStyle(el);\r\n const fontWeight = styles.getPropertyValue(\"font-weight\") || \"normal\";\r\n const fontSize = styles.getPropertyValue(\"font-size\") || \"1rem\";\r\n const fontFamily = styles.getPropertyValue(\"font-family\") || \"Arial\";\r\n\r\n let padding = 0;\r\n if (withPadding) {\r\n const paddingLeft = styles.getPropertyValue(\"padding-left\") || \"0\";\r\n const paddingRight = styles.getPropertyValue(\"padding-right\") || \"0\";\r\n padding = parseInt(paddingLeft) + parseInt(paddingRight);\r\n }\r\n\r\n // re-use canvas object for better performance\r\n // @ts-ignore\r\n const canvas = getTextWidth.canvas || (getTextWidth.canvas = document.createElement(\"canvas\"));\r\n const context = canvas.getContext(\"2d\");\r\n context.font = `${fontWeight} ${fontSize} ${fontFamily}`;\r\n const metrics = context.measureText(text);\r\n return parseInt(metrics.width) + padding;\r\n}\r\n", "/**\r\n * @param {String} prefix\r\n * @returns {String}\r\n */\r\nexport default function randstr(prefix) {\r\n return Math.random()\r\n .toString(36)\r\n .replace(\"0.\", prefix || \"\");\r\n}\r\n", "/**\r\n * Data Grid Web component\r\n *\r\n * Credits for inspiration\r\n * @link https://github.com/riverside/zino-grid\r\n */\r\n\"use strict\";\r\n\r\nimport BaseElement from \"./core/base-element.js\";\r\nimport addSelectOption from \"./utils/addSelectOption.js\";\r\nimport appendParamsToUrl from \"./utils/appendParamsToUrl.js\";\r\nimport camelize from \"./utils/camelize.js\";\r\nimport convertArray from \"./utils/convertArray.js\";\r\nimport elementOffset from \"./utils/elementOffset.js\";\r\nimport interpolate from \"./utils/interpolate.js\";\r\nimport getTextWidth from \"./utils/getTextWidth.js\";\r\nimport randstr from \"./utils/randstr.js\";\r\nimport {\r\n dispatch,\r\n find,\r\n findAll,\r\n hasClass,\r\n removeAttribute,\r\n getAttribute,\r\n setAttribute,\r\n addClass,\r\n toggleClass,\r\n on,\r\n ce,\r\n} from \"./utils/shortcuts.js\";\r\n\r\n/**\r\n * Column definition\r\n * @typedef Column\r\n * @property {String} field - the key in the data\r\n * @property {String} title - the title to display in the header (defaults to \"field\" if not set)\r\n * @property {Number} [width] - the width of the column (auto otherwise)\r\n * @property {String} [class] - class to set on the column (target body or header with th.class or td.class)\r\n * @property {String} [attr] - don't render the column and set a matching attribute on the row with the value of the field\r\n * @property {Boolean} [hidden] - hide the column\r\n * @property {Boolean} [noSort] - allow disabling sort for a given column\r\n * @property {String | Function} [format] - custom data formatting\r\n * @property {String} [defaultFormatValue] - default value to use for formatting\r\n * @property {String} [transform] - custom value transformation\r\n * @property {Boolean} [editable] - replace with input (EditableColumn module)\r\n * @property {String} [editableType] - type of input (EditableColumn module)\r\n * @property {Number} [responsive] - the higher the value, the sooner it will be hidden, disable with 0 (ResponsiveGrid module)\r\n * @property {Boolean} [responsiveHidden] - hidden through responsive module (ResponsiveGrid module)\r\n */\r\n\r\n/**\r\n * Row action\r\n * @typedef Action\r\n * @property {String} title - the title of the button\r\n * @property {String} name - the name of the action\r\n * @property {String} class - the class for the button\r\n * @property {String} url - link for the action\r\n * @property {String} html - custom button data\r\n * @property {Boolean} [confirm] - needs confirmation\r\n * @property {Boolean} default - is the default row action\r\n */\r\n\r\n/** @typedef {import('./plugins/autosize-column').default} AutosizeColumn */\r\n/** @typedef {import('./plugins/column-resizer').default} ColumnResizer */\r\n/** @typedef {import('./plugins/context-menu').default} ContextMenu */\r\n/** @typedef {import('./plugins/draggable-headers').default} DraggableHeaders */\r\n/** @typedef {import('./plugins/editable-column').default} EditableColumn */\r\n/** @typedef {import('./plugins/fixed-height').default} FixedHeight */\r\n/** @typedef {import('./plugins/responsive-grid').default} ResponsiveGrid */\r\n/** @typedef {import('./plugins/row-actions').default} RowActions */\r\n/** @typedef {import('./plugins/selectable-rows').default} SelectableRows */\r\n/** @typedef {import('./plugins/touch-support').default} TouchSupport */\r\n\r\n/**\r\n * These plugins are all optional\r\n * @typedef {Object} Plugins\r\n * @property {ColumnResizer} [ColumnResizer] resize handlers in the headers\r\n * @property {ContextMenu} [ContextMenu] menu to show/hide columns\r\n * @property {DraggableHeaders} [DraggableHeaders] draggable headers columns\r\n * @property {EditableColumn} [EditableColumn] draggable headers columns\r\n * @property {TouchSupport} [TouchSupport] touch swipe\r\n * @property {SelectableRows} [SelectableRows] create a column with checkboxes to select rows\r\n * @property {FixedHeight} [FixedHeight] allows having fixed height tables\r\n * @property {AutosizeColumn} [AutosizeColumn] compute ideal width based on column content\r\n * @property {ResponsiveGrid} [ResponsiveGrid] hide/show column on the fly\r\n * @property {RowActions} [RowActions] add action on rows\r\n */\r\n\r\n/**\r\n * Parameters to pass along or receive from the server\r\n * @typedef ServerParams\r\n * @property {String} serverParams.start\r\n * @property {String} serverParams.length\r\n * @property {String} serverParams.search\r\n * @property {String} serverParams.sort\r\n * @property {String} serverParams.sortDir\r\n * @property {String} serverParams.dataKey\r\n * @property {String} serverParams.metaKey\r\n * @property {String} serverParams.metaTotalKey\r\n * @property {String} serverParams.metaFilteredKey\r\n * @property {String} serverParams.optionsKey\r\n * @property {String} serverParams.paramsKey\r\n */\r\n\r\n/**\r\n * Available data grid options, plugins included\r\n * @typedef Options\r\n * @property {?String} id Custom id for the grid\r\n * @property {?String} url An URL with data to display in JSON format\r\n * @property {Boolean} debug Log actions in DevTools console\r\n * @property {Boolean} filter Allows a filtering functionality\r\n * @property {Boolean} sort Allows a sort by column functionality\r\n * @property {String} defaultSort Default sort field if sorting is enabled\r\n * @property {Boolean} server Is a server side powered grid\r\n * @property {ServerParams} serverParams Describe keys passed to the server backend\r\n * @property {String} dir Dir\r\n * @property {Array} perPageValues Available per page options\r\n * @property {Boolean} hidePerPage Hides the page size select element\r\n * @property {Column[]} columns Available columns\r\n * @property {Number} defaultPage Starting page\r\n * @property {Number} perPage Number of records displayed per page (page size)\r\n * @property {Boolean} expand Allow cell content to spawn over multiple lines\r\n * @property {Action[]} actions Row actions (RowActions module)\r\n * @property {Boolean} collapseActions Group actions (RowActions module)\r\n * @property {Boolean} resizable Make columns resizable (ColumnResizer module)\r\n * @property {Boolean} selectable Allow selecting rows with a checkbox (SelectableRows module)\r\n * @property {Boolean} selectVisibleOnly Select all only selects visible rows (SelectableRows module)\r\n * @property {Boolean} autosize Compute column sizes based on given data (Autosize module)\r\n * @property {Boolean} autoheight Adjust height so that it matches table size (FixedHeight module)\r\n * @property {Boolean} autohidePager auto-hides the pager when number of records falls below the selected page size\r\n * @property {Boolean} menu Right click menu on column headers (ContextMenu module)\r\n * @property {Boolean} reorder Allows a column reordering functionality (DraggableHeaders module)\r\n * @property {Boolean} responsive Change display mode on small screens (ResponsiveGrid module)\r\n * @property {Boolean} responsiveToggle Show toggle column (ResponsiveGrid module)\r\n */\r\n\r\n/**\r\n * Available labels that can be translated\r\n * @typedef Labels\r\n * @property {String} itemsPerPage\r\n * @property {String} gotoPage\r\n * @property {String} gotoFirstPage\r\n * @property {String} gotoPrevPage\r\n * @property {String} gotoNextPage\r\n * @property {String} gotoLastPage\r\n * @property {String} of\r\n * @property {String} items\r\n * @property {String} resizeColumn\r\n * @property {String} noData\r\n * @property {String} areYouSure\r\n * @property {String} networkError\r\n */\r\n\r\n/**\r\n * List of registered plugins\r\n * @type {Plugins}\r\n */\r\nlet plugins = {};\r\n\r\n/**\r\n * @type {Labels}\r\n */\r\nlet labels = {\r\n itemsPerPage: \"Items per page\",\r\n gotoPage: \"Go to page\",\r\n gotoFirstPage: \"Go to first page\",\r\n gotoPrevPage: \"Go to previous page\",\r\n gotoNextPage: \"Go to next page\",\r\n gotoLastPage: \"Go to last page\",\r\n of: \"of\",\r\n items: \"items\",\r\n resizeColumn: \"Resize column\",\r\n noData: \"No data\",\r\n areYouSure: \"Are you sure?\",\r\n networkError: \"Network response error\",\r\n};\r\n\r\n/**\r\n * Column definition will update some props on the html element\r\n * @param {HTMLElement} el\r\n * @param {Column} column\r\n */\r\nfunction applyColumnDefinition(el, column) {\r\n if (column.width) {\r\n setAttribute(el, \"width\", column.width);\r\n }\r\n if (column.class) {\r\n addClass(el, column.class);\r\n }\r\n if (column.hidden) {\r\n setAttribute(el, \"hidden\", \"\");\r\n if (column.responsiveHidden) {\r\n addClass(el, \"dg-responsive-hidden\");\r\n }\r\n }\r\n}\r\n\r\n/**\r\n */\r\nclass DataGrid extends BaseElement {\r\n _ready() {\r\n setAttribute(this, \"id\", this.options.id ?? randstr(\"el-\"), true);\r\n\r\n /**\r\n * The grid displays that data\r\n * @type {Array}\r\n */\r\n this.data = [];\r\n /**\r\n * We store the original data in this\r\n * @type {Array}\r\n */\r\n this.originalData; // declared uninitialized to allow data preloading before fetch.\r\n\r\n // Make the IDE happy\r\n /**\r\n * @type {Options}\r\n */\r\n this.options = this.options || this.defaultOptions;\r\n\r\n // Init values\r\n this.fireEvents = false;\r\n this.page = this.options.defaultPage || 1;\r\n this.pages = 0;\r\n this.meta; // declared uninitialized to allow data preloading before fetch.\r\n /**\r\n * @type {Plugins}\r\n */\r\n this.plugins = {};\r\n // Init plugins\r\n for (const [pluginName, pluginClass] of Object.entries(plugins)) {\r\n // @ts-ignore until we can set typeof import ...\r\n this.plugins[pluginName] = new pluginClass(this);\r\n }\r\n\r\n // Expose options as observed attributes in the dom\r\n // Do it when fireEvents is disabled to avoid firing change callbacks\r\n for (const attr of DataGrid.observedAttributes) {\r\n if (attr.indexOf(\"data-\") === 0) {\r\n setAttribute(this, attr, this.options[camelize(attr.slice(5))]);\r\n }\r\n }\r\n }\r\n\r\n static template() {\r\n return `\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n`;\r\n }\r\n\r\n /**\r\n * @returns {Labels}\r\n */\r\n get labels() {\r\n return labels;\r\n }\r\n\r\n /**\r\n * @returns {Labels}\r\n */\r\n static getLabels() {\r\n return labels;\r\n }\r\n\r\n /**\r\n * @param {Object} v\r\n */\r\n static setLabels(v) {\r\n labels = Object.assign(labels, v);\r\n }\r\n\r\n /**\r\n * @returns {Column}\r\n */\r\n get defaultColumn() {\r\n return {\r\n field: \"\",\r\n title: \"\",\r\n width: 0,\r\n class: \"\",\r\n attr: \"\",\r\n hidden: false,\r\n editable: false,\r\n noSort: false,\r\n responsive: 1,\r\n responsiveHidden: false,\r\n format: \"\",\r\n transform: \"\",\r\n };\r\n }\r\n\r\n /**\r\n * @returns {Options}\r\n */\r\n get defaultOptions() {\r\n return {\r\n id: null,\r\n url: null,\r\n perPage: 10,\r\n debug: false,\r\n filter: false,\r\n menu: false,\r\n sort: false,\r\n server: false,\r\n serverParams: {\r\n start: \"start\",\r\n length: \"length\",\r\n search: \"search\",\r\n sort: \"sort\",\r\n sortDir: \"sortDir\",\r\n dataKey: \"data\",\r\n metaKey: \"meta\",\r\n metaTotalKey: \"total\",\r\n metaFilteredKey: \"filtered\",\r\n optionsKey: \"options\",\r\n paramsKey: \"params\",\r\n },\r\n defaultSort: \"\",\r\n reorder: false,\r\n dir: \"ltr\",\r\n perPageValues: [10, 25, 50, 100, 250],\r\n hidePerPage: false,\r\n columns: [],\r\n actions: [],\r\n collapseActions: false,\r\n selectable: false,\r\n selectVisibleOnly: true,\r\n defaultPage: 1,\r\n resizable: false,\r\n autosize: true,\r\n expand: false,\r\n autoheight: true,\r\n autohidePager: false,\r\n responsive: false,\r\n responsiveToggle: true,\r\n };\r\n }\r\n\r\n /**\r\n * @param {Plugins} list\r\n */\r\n static registerPlugins(list) {\r\n plugins = list;\r\n }\r\n\r\n /**\r\n * @param {String} plugin\r\n */\r\n static unregisterPlugins(plugin = null) {\r\n if (plugin === null) {\r\n plugins = {};\r\n } else {\r\n delete plugins[plugin];\r\n }\r\n }\r\n\r\n /**\r\n * @returns {Plugins}\r\n */\r\n static registeredPlugins() {\r\n return plugins;\r\n }\r\n\r\n /**\r\n * @param {Object|Array} columns\r\n * @returns {Column[]}\r\n */\r\n convertColumns(columns) {\r\n let cols = [];\r\n // Convert key:value objects to actual columns\r\n if (typeof columns === \"object\" && !Array.isArray(columns)) {\r\n Object.keys(columns).forEach((key) => {\r\n let col = Object.assign({}, this.defaultColumn);\r\n col.title = columns[key];\r\n col.field = key;\r\n cols.push(col);\r\n });\r\n } else {\r\n columns.forEach((item) => {\r\n let col = Object.assign({}, this.defaultColumn);\r\n if (typeof item === \"string\") {\r\n col.title = item;\r\n col.field = item;\r\n } else if (typeof item === \"object\") {\r\n col = Object.assign(col, item);\r\n if (!col.field) {\r\n console.error(\"Invalid column definition\", item);\r\n }\r\n if (!col.title) {\r\n col.title = col.field;\r\n }\r\n } else {\r\n console.error(\"Column definition must be a string or an object\");\r\n }\r\n cols.push(col);\r\n });\r\n }\r\n return cols;\r\n }\r\n\r\n /**\r\n * @link https://gist.github.com/WebReflection/ec9f6687842aa385477c4afca625bbf4#reflected-dom-attributes\r\n * @returns {Array}\r\n */\r\n static get observedAttributes() {\r\n return [\r\n \"page\",\r\n \"data-filter\",\r\n \"data-sort\",\r\n \"data-debug\",\r\n \"data-reorder\",\r\n \"data-menu\",\r\n \"data-selectable\",\r\n \"data-url\",\r\n \"data-per-page\",\r\n \"data-responsive\",\r\n ];\r\n }\r\n\r\n get transformAttributes() {\r\n return {\r\n columns: (v) => this.convertColumns(convertArray(v)),\r\n actions: (v) => convertArray(v),\r\n defaultPage: (v) => parseInt(v),\r\n perPage: (v) => parseInt(v),\r\n };\r\n }\r\n\r\n get page() {\r\n return parseInt(this.getAttribute(\"page\"));\r\n }\r\n\r\n set page(val) {\r\n setAttribute(this, \"page\", this.constrainPageValue(val));\r\n }\r\n\r\n urlChanged() {\r\n this.loadData().then(() => {\r\n this.configureUi();\r\n });\r\n }\r\n\r\n constrainPageValue(v) {\r\n if (this.pages < v) {\r\n v = this.pages;\r\n }\r\n if (v < 1 || !v) {\r\n v = 1;\r\n }\r\n return v;\r\n }\r\n\r\n fixPage() {\r\n this.pages = this.totalPages();\r\n this.page = this.constrainPageValue(this.page);\r\n\r\n // Show current page in input\r\n setAttribute(this.inputPage, \"max\", this.pages);\r\n this.inputPage.value = \"\" + this.page;\r\n this.inputPage.disabled = this.pages < 2;\r\n }\r\n\r\n pageChanged() {\r\n this.reload();\r\n }\r\n\r\n responsiveChanged() {\r\n if (!this.plugins.ResponsiveGrid) {\r\n return;\r\n }\r\n if (this.options.responsive) {\r\n this.plugins.ResponsiveGrid.observe();\r\n } else {\r\n this.plugins.ResponsiveGrid.unobserve();\r\n }\r\n }\r\n\r\n menuChanged() {\r\n this.renderHeader();\r\n }\r\n\r\n /**\r\n * This is the callback for the select control\r\n */\r\n changePerPage() {\r\n this.options.perPage = parseInt(this.selectPerPage.options[this.selectPerPage.selectedIndex].value);\r\n this.perPageChanged();\r\n }\r\n\r\n /**\r\n * This is the actual event triggered on attribute change\r\n */\r\n perPageChanged() {\r\n // Refresh UI\r\n if (this.options.perPage !== parseInt(this.selectPerPage.options[this.selectPerPage.selectedIndex].value)) {\r\n this.perPageValuesChanged();\r\n }\r\n // Make sure current page is still valid\r\n let updatePage = this.page;\r\n while (updatePage > 1 && this.page * this.options.perPage > this.totalRecords()) {\r\n updatePage--;\r\n }\r\n if (updatePage != this.page) {\r\n // Triggers pageChanged, which will trigger reload\r\n this.page = updatePage;\r\n } else {\r\n // Simply reload current page\r\n this.reload(() => {\r\n // Preserve distance between top of page and select control if no fixed height\r\n if (!this.plugins.FixedHeight || !this.plugins.FixedHeight.hasFixedHeight) {\r\n this.selectPerPage.scrollIntoView();\r\n }\r\n });\r\n }\r\n }\r\n\r\n dirChanged() {\r\n setAttribute(this, \"dir\", this.options.dir);\r\n }\r\n\r\n defaultSortChanged() {\r\n this.sortChanged();\r\n }\r\n\r\n /**\r\n * Populate the select dropdown according to options\r\n */\r\n perPageValuesChanged() {\r\n if (!this.selectPerPage) {\r\n return;\r\n }\r\n while (this.selectPerPage.lastChild) {\r\n this.selectPerPage.removeChild(this.selectPerPage.lastChild);\r\n }\r\n this.options.perPageValues.forEach((v) => {\r\n addSelectOption(this.selectPerPage, v, v, v === this.options.perPage);\r\n });\r\n }\r\n\r\n _connected() {\r\n /**\r\n * @type {HTMLTableElement}\r\n */\r\n this.table = this.querySelector(\"table\");\r\n /**\r\n * @type {HTMLInputElement}\r\n */\r\n this.btnFirst = this.querySelector(\".dg-btn-first\");\r\n /**\r\n * @type {HTMLInputElement}\r\n */\r\n this.btnPrev = this.querySelector(\".dg-btn-prev\");\r\n /**\r\n * @type {HTMLInputElement}\r\n */\r\n this.btnNext = this.querySelector(\".dg-btn-next\");\r\n /**\r\n * @type {HTMLInputElement}\r\n */\r\n this.btnLast = this.querySelector(\".dg-btn-last\");\r\n /**\r\n * @type {HTMLSelectElement}\r\n */\r\n this.selectPerPage = this.querySelector(\".dg-select-per-page\");\r\n /**\r\n * @type {HTMLInputElement}\r\n */\r\n this.inputPage = this.querySelector(\".dg-input-page\");\r\n\r\n this.getFirst = this.getFirst.bind(this);\r\n this.getPrev = this.getPrev.bind(this);\r\n this.getNext = this.getNext.bind(this);\r\n this.getLast = this.getLast.bind(this);\r\n this.changePerPage = this.changePerPage.bind(this);\r\n this.gotoPage = this.gotoPage.bind(this);\r\n\r\n this.btnFirst.addEventListener(\"click\", this.getFirst);\r\n this.btnPrev.addEventListener(\"click\", this.getPrev);\r\n this.btnNext.addEventListener(\"click\", this.getNext);\r\n this.btnLast.addEventListener(\"click\", this.getLast);\r\n this.selectPerPage.addEventListener(\"change\", this.changePerPage);\r\n this.selectPerPage.toggleAttribute(\"hidden\", this.options.hidePerPage);\r\n this.inputPage.addEventListener(\"input\", this.gotoPage);\r\n\r\n Object.values(this.plugins).forEach((plugin) => {\r\n plugin.connected();\r\n });\r\n\r\n // Display even if we don't have data\r\n this.dirChanged();\r\n this.perPageValuesChanged();\r\n\r\n // @ts-ignore\r\n this.loadData().finally(() => {\r\n this.configureUi();\r\n\r\n this.sortChanged();\r\n this.classList.add(\"dg-initialized\"); //acts as a flag to prevent unnecessary server calls down the chain.\r\n\r\n this.filterChanged();\r\n this.reorderChanged();\r\n\r\n this.dirChanged();\r\n this.perPageValuesChanged();\r\n this.pageChanged();\r\n\r\n this.fireEvents = true; // We can now fire attributeChangedCallback events\r\n\r\n this.log(\"initialized\");\r\n });\r\n }\r\n\r\n _disconnected() {\r\n this.btnFirst.removeEventListener(\"click\", this.getFirst);\r\n this.btnPrev.removeEventListener(\"click\", this.getPrev);\r\n this.btnNext.removeEventListener(\"click\", this.getNext);\r\n this.btnLast.removeEventListener(\"click\", this.getLast);\r\n this.selectPerPage.removeEventListener(\"change\", this.changePerPage);\r\n this.inputPage.removeEventListener(\"input\", this.gotoPage);\r\n\r\n Object.values(this.plugins).forEach((plugin) => {\r\n plugin.disconnected();\r\n });\r\n }\r\n\r\n /**\r\n * @param {string} field\r\n * @returns {Column}\r\n */\r\n getCol(field) {\r\n let found = null;\r\n this.options.columns.forEach((col) => {\r\n if (col.field == field) {\r\n found = col;\r\n }\r\n });\r\n return found;\r\n }\r\n\r\n getColProp(field, prop) {\r\n const c = this.getCol(field);\r\n return c ? c[prop] : null;\r\n }\r\n\r\n setColProp(field, prop, val) {\r\n const c = this.getCol(field);\r\n if (c) {\r\n c[prop] = val;\r\n }\r\n }\r\n\r\n visibleColumns() {\r\n return this.options.columns.filter((col) => {\r\n return !col.hidden;\r\n });\r\n }\r\n\r\n hiddenColumns() {\r\n return this.options.columns.filter((col) => {\r\n return col.hidden === true;\r\n });\r\n }\r\n\r\n showColumn(field, render = true) {\r\n this.setColProp(field, \"hidden\", false);\r\n\r\n // We need to render the whole table otherwise layout fixed won't do its job\r\n if (render) this.renderTable();\r\n\r\n dispatch(this, \"columnVisibility\", {\r\n col: field,\r\n visibility: \"visible\",\r\n });\r\n }\r\n\r\n hideColumn(field, render = true) {\r\n this.setColProp(field, \"hidden\", true);\r\n\r\n // We need to render the whole table otherwise layout fixed won't do its job\r\n if (render) this.renderTable();\r\n\r\n dispatch(this, \"columnVisibility\", {\r\n col: field,\r\n visibility: \"hidden\",\r\n });\r\n }\r\n\r\n /**\r\n * Returns the starting index of actual data\r\n * @returns {Number}\r\n */\r\n startColIndex() {\r\n let start = 1;\r\n if (this.options.selectable && this.plugins.SelectableRows) {\r\n start++;\r\n }\r\n if (this.options.responsive && this.plugins.ResponsiveGrid && this.plugins.ResponsiveGrid.hasHiddenColumns()) {\r\n start++;\r\n }\r\n return start;\r\n }\r\n\r\n /**\r\n * @returns {Boolean}\r\n */\r\n isSticky() {\r\n return this.hasAttribute(\"sticky\");\r\n }\r\n\r\n /**\r\n * @param {Boolean} visibleOnly\r\n * @returns {Number}\r\n */\r\n columnsLength(visibleOnly = false) {\r\n let len = 0;\r\n // One column per (visible) column\r\n this.options.columns.forEach((col) => {\r\n if (visibleOnly && col.hidden) {\r\n return;\r\n }\r\n if (!col.attr) {\r\n len++;\r\n }\r\n });\r\n // Add one col for selectable checkbox at the beginning\r\n if (this.options.selectable && this.plugins.SelectableRows) {\r\n len++;\r\n }\r\n // Add one col for actions at the end\r\n if (this.options.actions.length && this.plugins.RowActions) {\r\n len++;\r\n }\r\n // Add one col for the responsive toggle\r\n if (this.options.responsive && this.plugins.ResponsiveGrid && this.plugins.ResponsiveGrid.hasHiddenColumns()) {\r\n len++;\r\n }\r\n return len;\r\n }\r\n\r\n /**\r\n * Global configuration and renderTable\r\n * This should be called after your data has been loaded\r\n */\r\n configureUi() {\r\n setAttribute(this.querySelector(\"table\"), \"aria-rowcount\", this.data.length);\r\n\r\n this.table.style.visibility = \"hidden\";\r\n this.renderTable();\r\n if (this.options.responsive && this.plugins.ResponsiveGrid) {\r\n // Let the observer make the table visible\r\n } else {\r\n this.table.style.visibility = \"visible\";\r\n }\r\n\r\n // Store row height for later usage\r\n if (!this.rowHeight) {\r\n const tr = find(this, \"tbody tr\") || find(this, \"table tr\");\r\n if (tr) {\r\n this.rowHeight = tr.offsetHeight;\r\n }\r\n }\r\n }\r\n\r\n filterChanged() {\r\n const row = this.querySelector(\"thead tr.dg-head-filters\");\r\n if (this.options.filter) {\r\n removeAttribute(row, \"hidden\");\r\n } else {\r\n this.clearFilters();\r\n setAttribute(row, \"hidden\", \"\");\r\n }\r\n }\r\n\r\n reorderChanged() {\r\n const headers = findAll(this, \"thead tr.dg-head-columns th\");\r\n headers.forEach((th) => {\r\n if (th.classList.contains(\"dg-selectable\") || th.classList.contains(\"dg-actions\")) {\r\n return;\r\n }\r\n if (this.options.reorder && this.plugins.DraggableHeaders) {\r\n th.draggable = true;\r\n } else {\r\n th.removeAttribute(\"draggable\");\r\n }\r\n });\r\n }\r\n\r\n sortChanged() {\r\n this.log(\"toggle sort\");\r\n\r\n this.querySelectorAll(\"thead tr.dg-head-columns th\").forEach((th) => {\r\n const fieldName = th.getAttribute(\"field\");\r\n if (th.classList.contains(\"dg-not-sortable\") || (!this.fireEvents && fieldName == this.options.defaultSort)) {\r\n return;\r\n }\r\n if (this.options.sort && !this.getColProp(fieldName, \"noSort\")) {\r\n setAttribute(th, \"aria-sort\", \"none\");\r\n } else {\r\n removeAttribute(th, \"aria-sort\");\r\n }\r\n });\r\n }\r\n\r\n selectableChanged() {\r\n this.renderTable();\r\n }\r\n\r\n addRow(row) {\r\n if (!Array.isArray(this.originalData)) return;\r\n this.log(\"Add row\");\r\n this.originalData.push(row);\r\n this.data = this.originalData.slice();\r\n this.sortData();\r\n }\r\n\r\n /**\r\n * @param {any} value Value to remove. Defaults to last row.\r\n * @param {String} key The key of the item to remove. Defaults to first column\r\n */\r\n removeRow(value = null, key = null) {\r\n if (!Array.isArray(this.originalData)) return;\r\n if (key === null) {\r\n key = this.options.columns[0][\"field\"];\r\n }\r\n if (value === null) {\r\n value = this.originalData[this.originalData.length - 1][key];\r\n }\r\n this.log(\"Removing \" + key + \":\" + value);\r\n for (let i = 0; i < this.originalData.length; i++) {\r\n if (this.originalData[i][key] === value) {\r\n this.originalData.splice(i, 1);\r\n break;\r\n }\r\n }\r\n this.data = this.originalData.slice();\r\n this.sortData();\r\n }\r\n\r\n /**\r\n * @param {String} key Return a specific key (eg: id) instead of the whole row\r\n * @returns {Array}\r\n */\r\n getSelection(key = null) {\r\n if (!this.plugins.SelectableRows) {\r\n return [];\r\n }\r\n return this.plugins.SelectableRows.getSelection(key);\r\n }\r\n\r\n getData() {\r\n return this.originalData;\r\n }\r\n\r\n clearData() {\r\n // Already empty\r\n if (this.data.length === 0) {\r\n return;\r\n }\r\n this.data = this.originalData = [];\r\n this.renderBody();\r\n }\r\n\r\n /**\r\n * Preloads the data intended to bypass the initial fetch operation, allowing for faster intial page load time.\r\n * Subsequent grid actions after initialization will operate as normal.\r\n * @param {Object} data - an object with meta ({total, filtered, start}) and data (array of objects) properties.\r\n */\r\n preload(data) {\r\n const metaKey = this.options.serverParams.metaKey,\r\n dataKey = this.options.serverParams.dataKey;\r\n if (data?.[metaKey]) this.meta = data[metaKey];\r\n if (data?.[dataKey]) this.data = this.originalData = data[dataKey];\r\n }\r\n\r\n refresh(cb = null) {\r\n this.data = this.originalData = [];\r\n return this.reload(cb);\r\n }\r\n\r\n reload(cb = null) {\r\n this.log(\"reload\");\r\n\r\n // If the data was cleared, we need to render again\r\n const needRender = !this.originalData?.length;\r\n this.fixPage();\r\n // @ts-ignore\r\n this.loadData().finally(() => {\r\n // If we load data from the server, we redraw the table body\r\n // Otherwise, we just need to paginate\r\n this.options.server || needRender ? this.renderBody() : this.paginate();\r\n if (cb) {\r\n cb();\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * @returns {Promise}\r\n */\r\n loadData() {\r\n const flagEmpty = () => !this.data.length && this.classList.add(\"dg-empty\"),\r\n tbody = this.querySelector(\"tbody\");\r\n // We already have some data\r\n if (this.meta || this.originalData || this.classList.contains(\"dg-initialized\")) {\r\n // We don't use server side data\r\n if (!this.options.server || (this.options.server && !this.fireEvents)) {\r\n this.log(\"skip loadData\");\r\n flagEmpty();\r\n return new Promise((resolve) => {\r\n resolve();\r\n });\r\n }\r\n }\r\n this.log(\"loadData\");\r\n this.loading = true;\r\n this.classList.add(\"dg-loading\");\r\n this.classList.remove(\"dg-empty\", \"dg-network-error\");\r\n return (\r\n this.fetchData()\r\n .then((response) => {\r\n // We can get a straight array or an object\r\n if (Array.isArray(response)) {\r\n this.data = response;\r\n } else {\r\n // Object must contain data key\r\n if (!response[this.options.serverParams.dataKey]) {\r\n console.error(\"Invalid response, it should contain a data key with an array or be a plain array\", response);\r\n this.options.url = null;\r\n return;\r\n }\r\n\r\n // We may have a config object\r\n this.options = Object.assign(this.options, response[this.options.serverParams.optionsKey] ?? {});\r\n // It should return meta data (see metaFilteredKey)\r\n this.meta = response[this.options.serverParams.metaKey] ?? {};\r\n this.data = response[this.options.serverParams.dataKey];\r\n }\r\n this.originalData = this.data.slice();\r\n this.fixPage();\r\n\r\n // Make sure we have a proper set of columns\r\n if (this.options.columns.length === 0 && this.originalData.length) {\r\n this.options.columns = this.convertColumns(Object.keys(this.originalData[0]));\r\n } else {\r\n this.options.columns = this.convertColumns(this.options.columns);\r\n }\r\n })\r\n .catch((err) => {\r\n this.log(err);\r\n if (err.message) {\r\n tbody.setAttribute(\"data-empty\", err.message.replace(/^\\s+|\\r\\n|\\n|\\r$/g, \"\"));\r\n }\r\n this.classList.add(\"dg-empty\", \"dg-network-error\");\r\n })\r\n // @ts-ignore\r\n .finally(() => {\r\n flagEmpty();\r\n if (!this.classList.contains(\"dg-network-error\") && tbody.getAttribute(\"data-empty\") != this.labels.noData) {\r\n tbody.setAttribute(\"data-empty\", this.labels.noData);\r\n }\r\n this.classList.remove(\"dg-loading\");\r\n this.loading = false;\r\n })\r\n );\r\n }\r\n\r\n getFirst() {\r\n if (this.loading) {\r\n return;\r\n }\r\n this.page = 1;\r\n }\r\n\r\n getLast() {\r\n if (this.loading) {\r\n return;\r\n }\r\n this.page = this.pages;\r\n }\r\n\r\n getPrev() {\r\n if (this.loading) {\r\n return;\r\n }\r\n this.page = this.page - 1;\r\n }\r\n\r\n getNext() {\r\n if (this.loading) {\r\n return;\r\n }\r\n this.page = this.page + 1;\r\n }\r\n\r\n gotoPage(event) {\r\n if (event.type === \"keypress\") {\r\n const key = event.keyCode || event.key;\r\n if (key === 13 || key === \"Enter\") {\r\n event.preventDefault();\r\n } else {\r\n return;\r\n }\r\n }\r\n this.page = parseInt(this.inputPage.value);\r\n }\r\n\r\n getSort() {\r\n let col = this.querySelector(\"thead tr.dg-head-columns th[aria-sort$='scending']\");\r\n if (col) {\r\n return col.getAttribute(\"field\");\r\n }\r\n return this.options.defaultSort;\r\n }\r\n\r\n getSortDir() {\r\n let col = this.querySelector(\"thead tr.dg-head-columns th[aria-sort$='scending']\");\r\n if (col) {\r\n return col.getAttribute(\"aria-sort\") || \"\";\r\n }\r\n return \"\";\r\n }\r\n\r\n getFilters() {\r\n let filters = [];\r\n const inputs = findAll(this, \"thead tr.dg-head-filters input\");\r\n inputs.forEach((input) => {\r\n filters[input.dataset.name] = input.value;\r\n });\r\n return filters;\r\n }\r\n\r\n clearFilters() {\r\n const inputs = findAll(this, \"thead tr.dg-head-filters input\");\r\n inputs.forEach((input) => {\r\n input.value = \"\";\r\n });\r\n this.filterData();\r\n }\r\n\r\n filterData() {\r\n this.log(\"filter data\");\r\n\r\n this.page = 1;\r\n\r\n if (this.options.server) {\r\n this.reload();\r\n } else {\r\n this.data = this.originalData?.slice() ?? [];\r\n\r\n // Look for rows matching the filters\r\n const inputs = findAll(this, \"thead tr.dg-head-filters input\");\r\n inputs.forEach((input) => {\r\n let value = input.value;\r\n if (value) {\r\n let name = input.dataset.name;\r\n this.data = this.data.filter((item) => {\r\n let str = item[name] + \"\";\r\n return str.toLowerCase().indexOf(value.toLowerCase()) !== -1;\r\n });\r\n }\r\n });\r\n this.pageChanged();\r\n\r\n let col = this.querySelector(\"thead tr.dg-head-columns th[aria-sort$='scending']\");\r\n if (this.options.sort && col) {\r\n this.sortData();\r\n } else {\r\n this.renderBody();\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Data will be sorted then rendered using renderBody\r\n * @param {Element} col The column that was clicked or null to use current sort\r\n */\r\n sortData(col = null) {\r\n this.log(\"sort data\");\r\n\r\n // Early exit\r\n if (col && this.getColProp(col.getAttribute(\"field\"), \"noSort\")) {\r\n this.log(\"sorting prevented because column is not sortable\");\r\n return;\r\n }\r\n if (this.plugins.ColumnResizer && this.plugins.ColumnResizer.isResizing) {\r\n this.log(\"sorting prevented because resizing\");\r\n return;\r\n }\r\n if (this.loading) {\r\n this.log(\"sorting prevented because loading\");\r\n return;\r\n }\r\n\r\n // We clicked on a column, update sort state\r\n if (col !== null) {\r\n // Remove active sort if any\r\n const haveClasses = (c) => [\"dg-selectable\", \"dg-actions\", \"dg-responsive-toggle\"].includes(c);\r\n this.querySelectorAll(\"thead tr:first-child th\").forEach((th) => {\r\n // @ts-ignore\r\n if ([...th.classList].some(haveClasses)) {\r\n return;\r\n }\r\n if (th !== col) {\r\n th.setAttribute(\"aria-sort\", \"none\");\r\n }\r\n });\r\n\r\n // Set tristate col\r\n if (!col.hasAttribute(\"aria-sort\") || col.getAttribute(\"aria-sort\") === \"none\") {\r\n col.setAttribute(\"aria-sort\", \"ascending\");\r\n } else if (col.getAttribute(\"aria-sort\") === \"ascending\") {\r\n col.setAttribute(\"aria-sort\", \"descending\");\r\n } else if (col.getAttribute(\"aria-sort\") === \"descending\") {\r\n col.setAttribute(\"aria-sort\", \"none\");\r\n }\r\n } else {\r\n // Or fetch current sort\r\n col = this.querySelector(\"thead tr.dg-head-columns th[aria-sort$='scending']\");\r\n }\r\n\r\n if (this.options.server) {\r\n // Reload data with updated sort\r\n this.loadData().finally(() => {\r\n this.renderBody();\r\n });\r\n } else {\r\n const sort = col ? col.getAttribute(\"aria-sort\") : \"none\";\r\n if (sort === \"none\") {\r\n let stack = [];\r\n\r\n // Restore order while keeping filters\r\n this.originalData?.some((itemA) => {\r\n this.data.some((itemB) => {\r\n if (JSON.stringify(itemA) === JSON.stringify(itemB)) {\r\n stack.push(itemB);\r\n return true;\r\n }\r\n return false;\r\n });\r\n return stack.length === this.data.length;\r\n });\r\n\r\n this.data = stack;\r\n } else {\r\n const field = col.getAttribute(\"field\");\r\n this.data.sort((a, b) => {\r\n if (!isNaN(a[field]) && !isNaN(b[field])) {\r\n return sort === \"ascending\" ? a[field] - b[field] : b[field] - a[field];\r\n }\r\n const valA = sort === \"ascending\" ? a[field].toUpperCase() : b[field].toUpperCase();\r\n const valB = sort === \"ascending\" ? b[field].toUpperCase() : a[field].toUpperCase();\r\n\r\n switch (true) {\r\n case valA > valB:\r\n return 1;\r\n case valA < valB:\r\n return -1;\r\n case valA === valB:\r\n return 0;\r\n }\r\n });\r\n }\r\n this.renderBody();\r\n }\r\n }\r\n\r\n fetchData() {\r\n if (!this.options.url) {\r\n return new Promise((resolve, reject) => reject(\"No url set\"));\r\n }\r\n\r\n let base = window.location.href;\r\n // Fix trailing slash if no extension is present\r\n if (!base.split(\"/\").pop().includes(\".\")) {\r\n base += base.endsWith(\"/\") ? \"\" : \"/\";\r\n }\r\n let url = new URL(this.options.url, base);\r\n let params = {\r\n r: Date.now(),\r\n };\r\n if (this.options.server) {\r\n // 0 based\r\n params[this.options.serverParams.start] = this.page - 1;\r\n params[this.options.serverParams.length] = this.options.perPage;\r\n if (this.options.filter) params[this.options.serverParams.search] = this.getFilters();\r\n params[this.options.serverParams.sort] = this.getSort() || \"\";\r\n params[this.options.serverParams.sortDir] = this.getSortDir();\r\n\r\n // extra params ?\r\n if (this.meta?.[this.options.serverParams.paramsKey]) {\r\n params = Object.assign(params, this.meta[this.options.serverParams.paramsKey]);\r\n }\r\n }\r\n\r\n appendParamsToUrl(url, params);\r\n\r\n return fetch(url).then((response) => {\r\n if (!response.ok) {\r\n throw new Error(response.statusText || labels.networkError);\r\n }\r\n return response.json();\r\n });\r\n }\r\n\r\n renderTable() {\r\n this.log(\"render table\");\r\n\r\n if (this.options.menu && this.plugins.ContextMenu) {\r\n this.plugins.ContextMenu.createMenu();\r\n }\r\n\r\n let sortedColumn;\r\n\r\n this.renderHeader();\r\n if (this.options.defaultSort) {\r\n // We can have a default sort even with sort disabled\r\n sortedColumn = this.querySelector(\"thead tr.dg-head-columns th[field='\" + this.options.defaultSort + \"']\");\r\n }\r\n\r\n if (sortedColumn) {\r\n this.sortData(sortedColumn);\r\n } else {\r\n this.renderBody();\r\n }\r\n\r\n this.renderFooter();\r\n }\r\n\r\n /**\r\n * Create table header\r\n * - One row for the column headers\r\n * - One row for the filters\r\n */\r\n renderHeader() {\r\n this.log(\"render header\");\r\n\r\n const thead = this.querySelector(\"thead\");\r\n this.createColumnHeaders(thead);\r\n this.createColumnFilters(thead);\r\n\r\n if (this.options.resizable && this.plugins.ColumnResizer) {\r\n this.plugins.ColumnResizer.renderResizer(labels.resizeColumn);\r\n }\r\n\r\n dispatch(this, \"headerRendered\");\r\n }\r\n\r\n renderFooter() {\r\n this.log(\"render footer\");\r\n\r\n const tfoot = this.querySelector(\"tfoot\");\r\n const td = tfoot.querySelector(\"td\");\r\n tfoot.removeAttribute(\"hidden\");\r\n setAttribute(td, \"colspan\", this.columnsLength(true));\r\n tfoot.style.display = \"\";\r\n }\r\n\r\n /**\r\n * Create the column headers based on column definitions and set options\r\n * @param {HTMLTableSectionElement} thead\r\n */\r\n createColumnHeaders(thead) {\r\n // @link https://stackoverflow.com/questions/21064101/understanding-offsetwidth-clientwidth-scrollwidth-and-height-respectively\r\n const availableWidth = this.clientWidth;\r\n const colMaxWidth = Math.round((availableWidth / this.columnsLength(true)) * 2);\r\n\r\n let idx = 0;\r\n let tr;\r\n\r\n // Create row\r\n tr = ce(\"tr\");\r\n this.headerRow = tr;\r\n tr.setAttribute(\"role\", \"row\");\r\n tr.setAttribute(\"aria-rowindex\", \"1\");\r\n tr.setAttribute(\"class\", \"dg-head-columns\");\r\n\r\n // We need a real th from the dom to compute the size\r\n let sampleTh = thead.querySelector(\"tr.dg-head-columns th\");\r\n if (!sampleTh) {\r\n sampleTh = ce(\"th\");\r\n thead.querySelector(\"tr\").appendChild(sampleTh);\r\n }\r\n\r\n if (this.options.selectable && this.plugins.SelectableRows) {\r\n this.plugins.SelectableRows.createHeaderCol(tr);\r\n }\r\n if (this.options.responsive && this.plugins.ResponsiveGrid && this.plugins.ResponsiveGrid.hasHiddenColumns()) {\r\n this.plugins.ResponsiveGrid.createHeaderCol(tr);\r\n }\r\n\r\n // Create columns\r\n idx = 0;\r\n let totalWidth = 0;\r\n this.options.columns.forEach((column) => {\r\n if (column.attr) {\r\n return;\r\n }\r\n const colIdx = idx + this.startColIndex();\r\n let th = ce(\"th\");\r\n th.setAttribute(\"scope\", \"col\");\r\n th.setAttribute(\"role\", \"columnheader button\");\r\n th.setAttribute(\"aria-colindex\", \"\" + colIdx);\r\n th.setAttribute(\"id\", randstr(\"dg-col-\"));\r\n if (this.options.sort) {\r\n th.setAttribute(\"aria-sort\", \"none\");\r\n }\r\n th.setAttribute(\"field\", column.field);\r\n if (this.plugins.ResponsiveGrid && this.options.responsive) {\r\n setAttribute(th, \"data-responsive\", column.responsive || \"\");\r\n }\r\n // Make sure the header fits (+ add some room for sort icon if necessary)\r\n const computedWidth = getTextWidth(column.title, sampleTh, true) + 20;\r\n th.dataset.minWidth = \"\" + computedWidth;\r\n applyColumnDefinition(th, column);\r\n th.tabIndex = 0;\r\n th.textContent = column.title;\r\n\r\n let w = 0;\r\n // Autosize small based on first/last row ?\r\n // Take into account minWidth of the header and max available size based on col numbers\r\n if (this.options.autosize && this.plugins.AutosizeColumn) {\r\n const colAvailableWidth = Math.min(availableWidth - totalWidth, colMaxWidth);\r\n w = this.plugins.AutosizeColumn.computeSize(th, column, parseInt(th.dataset.minWidth), colAvailableWidth);\r\n } else {\r\n w = Math.max(parseInt(th.dataset.minWidth), parseInt(th.getAttribute(\"width\")));\r\n }\r\n\r\n setAttribute(th, \"width\", w);\r\n if (column.hidden) {\r\n th.setAttribute(\"hidden\", \"\");\r\n } else {\r\n totalWidth += w;\r\n }\r\n\r\n // Reorder columns with drag/drop\r\n if (this.options.reorder && this.plugins.DraggableHeaders) {\r\n this.plugins.DraggableHeaders.makeHeaderDraggable(th);\r\n }\r\n\r\n tr.appendChild(th);\r\n idx++;\r\n });\r\n\r\n // There is too much available width, and we want to avoid fixed layout to split remaining amount\r\n if (totalWidth < availableWidth) {\r\n const visibleCols = findAll(tr, \"th:not([hidden],.dg-not-resizable)\");\r\n if (visibleCols.length) {\r\n const lastCol = visibleCols[visibleCols.length - 1];\r\n removeAttribute(lastCol, \"width\");\r\n }\r\n }\r\n\r\n // Actions\r\n if (this.options.actions.length && this.plugins.RowActions) {\r\n this.plugins.RowActions.makeActionHeader(tr);\r\n }\r\n\r\n thead.replaceChild(tr, thead.querySelector(\"tr.dg-head-columns\"));\r\n\r\n // Once columns are inserted, we have an actual dom to query\r\n if (thead.offsetWidth > availableWidth) {\r\n this.log(`adjust width to fix size, ${thead.offsetWidth} > ${availableWidth}`);\r\n const scrollbarWidth = this.offsetWidth - this.clientWidth;\r\n let diff = thead.offsetWidth - availableWidth - scrollbarWidth;\r\n if (this.options.responsive && this.plugins.ResponsiveGrid) {\r\n diff += scrollbarWidth;\r\n }\r\n // Remove diff for columns that can afford it\r\n const thWithWidth = findAll(tr, \"th[width]\");\r\n thWithWidth.forEach((th) => {\r\n if (hasClass(th, \"dg-not-resizable\")) {\r\n return;\r\n }\r\n if (diff <= 0) {\r\n return;\r\n }\r\n const actualWidth = parseInt(th.getAttribute(\"width\"));\r\n const minWidth = th.dataset.minWidth ? parseInt(th.dataset.minWidth) : 0;\r\n if (actualWidth > minWidth) {\r\n let newWidth = actualWidth - diff;\r\n if (newWidth < minWidth) {\r\n newWidth = minWidth;\r\n }\r\n diff -= actualWidth - newWidth;\r\n setAttribute(th, \"width\", newWidth);\r\n }\r\n });\r\n }\r\n\r\n // Context menu\r\n if (this.options.menu && this.plugins.ContextMenu) {\r\n this.plugins.ContextMenu.attachContextMenu();\r\n }\r\n\r\n // Sort col on click\r\n tr.querySelectorAll(\"[aria-sort]\").forEach((sortableRow) => {\r\n sortableRow.addEventListener(\"click\", () => this.sortData(sortableRow));\r\n });\r\n\r\n setAttribute(this.querySelector(\"table\"), \"aria-colcount\", this.columnsLength(true));\r\n }\r\n\r\n createColumnFilters(thead) {\r\n let idx = 0;\r\n let tr;\r\n\r\n // Create row for filters\r\n tr = ce(\"tr\");\r\n this.filterRow = tr;\r\n tr.setAttribute(\"role\", \"row\");\r\n tr.setAttribute(\"aria-rowindex\", \"2\");\r\n tr.setAttribute(\"class\", \"dg-head-filters\");\r\n if (!this.options.filter) {\r\n tr.setAttribute(\"hidden\", \"\");\r\n }\r\n\r\n if (this.options.selectable && this.plugins.SelectableRows) {\r\n this.plugins.SelectableRows.createFilterCol(tr);\r\n }\r\n if (this.options.responsive && this.plugins.ResponsiveGrid && this.plugins.ResponsiveGrid.hasHiddenColumns()) {\r\n this.plugins.ResponsiveGrid.createFilterCol(tr);\r\n }\r\n\r\n this.options.columns.forEach((column) => {\r\n if (column.attr) {\r\n return;\r\n }\r\n const colIdx = idx + this.startColIndex();\r\n let relatedTh = thead.querySelector(\"tr.dg-head-columns th[aria-colindex='\" + colIdx + \"']\");\r\n if (!relatedTh) {\r\n console.warn(\"Related th not found\", colIdx);\r\n return;\r\n }\r\n let th = ce(\"th\");\r\n th.setAttribute(\"aria-colindex\", \"\" + colIdx);\r\n\r\n let input = ce(\"input\");\r\n input.type = \"text\";\r\n input.inputMode = \"search\";\r\n input.autocomplete = \"off\";\r\n input.spellcheck = false;\r\n // Allows binding filter to this column\r\n input.dataset.name = column.field;\r\n input.id = randstr(\"dg-filter-\");\r\n // Don't use aria-label as it triggers autocomplete\r\n input.setAttribute(\"aria-labelledby\", relatedTh.getAttribute(\"id\"));\r\n if (!this.options.filter) {\r\n th.tabIndex = 0;\r\n } else {\r\n input.tabIndex = 0;\r\n }\r\n\r\n if (column.hidden) {\r\n th.setAttribute(\"hidden\", \"\");\r\n }\r\n\r\n th.appendChild(input);\r\n tr.appendChild(th);\r\n idx++;\r\n });\r\n\r\n // Actions\r\n if (this.options.actions.length && this.plugins.RowActions) {\r\n this.plugins.RowActions.makeActionFilter(tr);\r\n }\r\n\r\n thead.replaceChild(tr, thead.querySelector(\"tr.dg-head-filters\"));\r\n\r\n // Filter content on enter\r\n tr.querySelectorAll(\"input\").forEach((input) => {\r\n input.addEventListener(\"keypress\", (e) => {\r\n const key = e.keyCode || e.key;\r\n if (key === 13 || key === \"Enter\") {\r\n this.filterData.call(this);\r\n }\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Render the data as rows in tbody\r\n * It will call paginate() at the end\r\n */\r\n renderBody() {\r\n this.log(\"render body\");\r\n let tr;\r\n let td;\r\n let idx;\r\n let tbody = ce(\"tbody\");\r\n\r\n this.data.forEach((item, i) => {\r\n tr = ce(\"tr\");\r\n setAttribute(tr, \"role\", \"row\");\r\n setAttribute(tr, \"hidden\", \"\");\r\n setAttribute(tr, \"aria-rowindex\", i + 1);\r\n tr.tabIndex = 0;\r\n\r\n if (this.options.selectable && this.plugins.SelectableRows) {\r\n this.plugins.SelectableRows.createDataCol(tr);\r\n }\r\n if (this.options.responsive && this.plugins.ResponsiveGrid && this.plugins.ResponsiveGrid.hasHiddenColumns()) {\r\n this.plugins.ResponsiveGrid.createDataCol(tr);\r\n }\r\n\r\n // Expandable\r\n if (this.options.expand) {\r\n tr.classList.add(\"dg-expandable\");\r\n\r\n on(tr, \"click\", (ev) => {\r\n if (this.plugins.ResponsiveGrid) {\r\n this.plugins.ResponsiveGrid.blockObserver();\r\n }\r\n toggleClass(ev.currentTarget, \"dg-expanded\");\r\n if (this.plugins.ResponsiveGrid) {\r\n this.plugins.ResponsiveGrid.unblockObserver();\r\n }\r\n });\r\n }\r\n\r\n idx = 0;\r\n this.options.columns.forEach((column) => {\r\n if (!column) {\r\n console.error(\"Empty column found!\", this.options.columns);\r\n }\r\n // It should be applied as an attr of the row\r\n if (column.attr) {\r\n if (item[column.field]) {\r\n // Special case if we try to write over the class attr\r\n if (column.attr === \"class\") {\r\n addClass(tr, item[column.field]);\r\n } else {\r\n tr.setAttribute(column.attr, item[column.field]);\r\n }\r\n }\r\n return;\r\n }\r\n td = ce(\"td\");\r\n td.setAttribute(\"role\", \"gridcell\");\r\n td.setAttribute(\"aria-colindex\", idx + this.startColIndex());\r\n applyColumnDefinition(td, column);\r\n // This is required for pure css responsive layout\r\n td.setAttribute(\"data-name\", column.title);\r\n td.tabIndex = -1;\r\n\r\n // Inline editing ...\r\n if (column.editable && this.plugins.EditableColumn) {\r\n addClass(td, \"dg-editable-col\");\r\n this.plugins.EditableColumn.makeEditableInput(td, column, item, i);\r\n } else {\r\n // ... or formatting\r\n const v = item[column.field] ?? \"\";\r\n let tv;\r\n // TODO: make this modular\r\n switch (column.transform) {\r\n case \"uppercase\":\r\n tv = v.toUpperCase();\r\n break;\r\n case \"lowercase\":\r\n tv = v.toLowerCase();\r\n break;\r\n default:\r\n tv = v;\r\n break;\r\n }\r\n if (column.format) {\r\n // Only use formatting with values or if defaultFormatValue is set\r\n if (column.defaultFormatValue != undefined && (tv === \"\" || tv === null)) {\r\n tv = column.defaultFormatValue + \"\";\r\n }\r\n if (typeof column.format === \"string\" && tv) {\r\n td.innerHTML = interpolate(\r\n // @ts-ignore\r\n column.format,\r\n Object.assign(\r\n {\r\n _v: v,\r\n _tv: tv,\r\n },\r\n item\r\n )\r\n );\r\n } else if (column.format instanceof Function) {\r\n const val = column.format.call(this, { column, rowData: item, cellData: tv, td, tr });\r\n td.innerHTML = val || tv || v;\r\n }\r\n } else {\r\n td.textContent = tv;\r\n }\r\n }\r\n tr.appendChild(td);\r\n idx++;\r\n });\r\n\r\n // Actions\r\n if (this.options.actions.length && this.plugins.RowActions) {\r\n this.plugins.RowActions.makeActionRow(tr, item);\r\n }\r\n\r\n tbody.appendChild(tr);\r\n });\r\n\r\n tbody.setAttribute(\"role\", \"rowgroup\");\r\n\r\n // Keep data empty message\r\n const prev = this.querySelector(\"tbody\");\r\n tbody.setAttribute(\"data-empty\", prev.getAttribute(\"data-empty\"));\r\n this.querySelector(\"table\").replaceChild(tbody, prev);\r\n\r\n if (this.plugins.FixedHeight) {\r\n this.plugins.FixedHeight.createFakeRow();\r\n }\r\n\r\n this.paginate();\r\n\r\n if (this.plugins.SelectableRows) {\r\n this.plugins.SelectableRows.shouldSelectAll(tbody);\r\n }\r\n\r\n dispatch(this, \"bodyRendered\");\r\n }\r\n\r\n paginate() {\r\n this.log(\"paginate\");\r\n\r\n const total = this.totalRecords();\r\n const p = this.page || 1;\r\n\r\n let index;\r\n let high = p * this.options.perPage;\r\n let low = high - this.options.perPage + 1;\r\n const tbody = this.querySelector(\"tbody\");\r\n const tfoot = this.querySelector(\"tfoot\");\r\n\r\n if (high > total) {\r\n high = total;\r\n }\r\n if (!total) {\r\n low = 0;\r\n }\r\n\r\n // Display all rows within the set indexes\r\n // For server side paginated grids, we display everything\r\n // since the server is taking care of actual pagination\r\n tbody.querySelectorAll(\"tr\").forEach((tr) => {\r\n if (this.options.server) {\r\n removeAttribute(tr, \"hidden\");\r\n return;\r\n }\r\n index = Number(getAttribute(tr, \"aria-rowindex\"));\r\n if (index > high || index < low) {\r\n setAttribute(tr, \"hidden\", \"\");\r\n } else {\r\n removeAttribute(tr, \"hidden\");\r\n }\r\n });\r\n\r\n if (this.options.selectable && this.plugins.SelectableRows) {\r\n this.plugins.SelectableRows.clearCheckboxes(tbody);\r\n }\r\n\r\n // Store default height and update styles if needed\r\n if (this.plugins.FixedHeight) {\r\n this.plugins.FixedHeight.updateFakeRow();\r\n }\r\n\r\n // Enable/disable buttons if shown\r\n if (this.btnFirst) {\r\n this.btnFirst.disabled = this.page <= 1;\r\n this.btnPrev.disabled = this.page <= 1;\r\n this.btnNext.disabled = this.page >= this.pages;\r\n this.btnLast.disabled = this.page >= this.pages;\r\n }\r\n tfoot.querySelector(\".dg-low\").textContent = low.toString();\r\n tfoot.querySelector(\".dg-high\").textContent = high.toString();\r\n tfoot.querySelector(\".dg-total\").textContent = \"\" + this.totalRecords();\r\n tfoot.toggleAttribute(\"hidden\", this.options.autohidePager && this.options.perPage > this.totalRecords());\r\n }\r\n\r\n /**\r\n * @returns {number}\r\n */\r\n totalPages() {\r\n return Math.ceil(this.totalRecords() / this.options.perPage);\r\n }\r\n\r\n /**\r\n * @returns {number}\r\n */\r\n totalRecords() {\r\n if (this.options.server) {\r\n return this.meta?.[this.options.serverParams.metaFilteredKey] || 0;\r\n }\r\n return this.data.length;\r\n }\r\n}\r\n\r\nexport default DataGrid;\r\n", "/** @typedef {import(\"../data-grid\").default} DataGrid */\r\n\r\nclass BasePlugin {\r\n /**\r\n * @param {DataGrid} grid\r\n */\r\n constructor(grid) {\r\n this.grid = grid;\r\n }\r\n\r\n connected() {}\r\n\r\n disconnected() {}\r\n\r\n /**\r\n * Handle events within the plugin\r\n * @link https://gist.github.com/WebReflection/ec9f6687842aa385477c4afca625bbf4#handling-events\r\n * @param {Event} event\r\n */\r\n handleEvent(event) {\r\n if (this[`on${event.type}`]) {\r\n this[`on${event.type}`](event);\r\n }\r\n }\r\n}\r\n\r\nexport default BasePlugin;\r\n", "import BasePlugin from \"../core/base-plugin.js\";\r\nimport elementOffset from \"../utils/elementOffset.js\";\r\nimport {\r\n addClass,\r\n dispatch,\r\n findAll,\r\n getAttribute,\r\n hasClass,\r\n off,\r\n on,\r\n removeAttribute,\r\n removeClass,\r\n setAttribute,\r\n} from \"../utils/shortcuts.js\";\r\n\r\n/**\r\n * Allows to resize columns\r\n */\r\nclass ColumnResizer extends BasePlugin {\r\n constructor(grid) {\r\n super(grid);\r\n this.isResizing = false;\r\n }\r\n\r\n /**\r\n * @param {String} resizeLabel\r\n */\r\n renderResizer(resizeLabel) {\r\n const grid = this.grid;\r\n const table = grid.table;\r\n const cols = findAll(grid, \"thead tr.dg-head-columns th\");\r\n\r\n cols.forEach((col) => {\r\n if (hasClass(col, \"dg-not-resizable\")) {\r\n return;\r\n }\r\n // Create a resizer element\r\n const resizer = document.createElement(\"div\");\r\n addClass(resizer, \"dg-resizer\");\r\n resizer.ariaLabel = resizeLabel;\r\n\r\n // Add a resizer element to the column\r\n col.appendChild(resizer);\r\n\r\n // Handle resizing\r\n let startX = 0;\r\n let startW = 0;\r\n let remainingSpace = 0;\r\n let max = 0;\r\n\r\n const mouseMoveHandler = (e) => {\r\n if (e.clientX > max) {\r\n return;\r\n }\r\n const newWidth = startW + (e.clientX - startX);\r\n if (col.dataset.minWidth && newWidth > parseInt(col.dataset.minWidth)) {\r\n setAttribute(col, \"width\", newWidth);\r\n }\r\n };\r\n\r\n // When user releases the mouse, remove the existing event listeners\r\n const mouseUpHandler = () => {\r\n grid.log(\"resized column\");\r\n\r\n // Prevent accidental sorting if mouse is not over resize handler\r\n setTimeout(() => {\r\n this.isResizing = false;\r\n }, 0);\r\n\r\n removeClass(resizer, \"dg-resizer-active\");\r\n if (grid.options.reorder) {\r\n col.draggable = true;\r\n }\r\n col.style.overflow = \"hidden\";\r\n\r\n // Remove handlers\r\n off(document, \"mousemove\", mouseMoveHandler);\r\n off(document, \"mouseup\", mouseUpHandler);\r\n\r\n dispatch(grid, \"columnResized\", {\r\n col: getAttribute(col, \"field\"),\r\n width: getAttribute(col, \"width\"),\r\n });\r\n };\r\n\r\n // Otherwise it could sort the col\r\n on(resizer, \"click\", (e) => {\r\n e.stopPropagation();\r\n });\r\n\r\n on(resizer, \"mousedown\", (e) => {\r\n e.stopPropagation();\r\n\r\n this.isResizing = true;\r\n\r\n const target = e.target;\r\n const currentCols = findAll(grid, \"dg-head-columns th\");\r\n const visibleCols = currentCols.filter((col) => {\r\n return !col.hasAttribute(\"hidden\");\r\n });\r\n const columnIndex = visibleCols.findIndex((column) => column == target.parentNode);\r\n grid.log(\"resize column\");\r\n\r\n addClass(resizer, \"dg-resizer-active\");\r\n\r\n // Make sure we don't drag it\r\n removeAttribute(col, \"draggable\");\r\n\r\n // Allow overflow when resizing\r\n col.style.overflow = \"visible\";\r\n\r\n // Show full column height (-1 to avoid scrollbar)\r\n resizer.style.height = table.offsetHeight - 1 + \"px\";\r\n\r\n // Register initial data\r\n startX = e.clientX;\r\n startW = col.offsetWidth;\r\n\r\n remainingSpace = (visibleCols.length - columnIndex) * 30;\r\n max = elementOffset(target).left + grid.offsetWidth - remainingSpace;\r\n\r\n // Remove width from next columns to allow auto layout\r\n setAttribute(col, \"width\", startW);\r\n for (let j = 0; j < visibleCols.length; j++) {\r\n if (j > columnIndex) {\r\n removeAttribute(cols[j], \"width\");\r\n }\r\n }\r\n\r\n // Attach handlers\r\n on(document, \"mousemove\", mouseMoveHandler);\r\n on(document, \"mouseup\", mouseUpHandler);\r\n });\r\n });\r\n }\r\n}\r\n\r\nexport default ColumnResizer;\r\n", "/**\r\n * @param {HTMLElement} el\r\n * @param {String} type\r\n * @param {String} prop\r\n * @returns {HTMLElement}\r\n */\r\nexport default function getParentElement(el, type, prop = \"nodeName\") {\r\n let parent = el;\r\n while (parent[prop] != type) {\r\n parent = parent.parentElement;\r\n }\r\n return parent;\r\n}\r\n", "import BasePlugin from \"../core/base-plugin.js\";\r\nimport getParentElement from \"../utils/getParentElement.js\";\r\nimport { find, off, on, removeAttribute, setAttribute } from \"../utils/shortcuts.js\";\r\n\r\n/**\r\n * Create a right click menu on the headers\r\n */\r\nclass ContextMenu extends BasePlugin {\r\n connected() {\r\n /**\r\n * @type {HTMLUListElement}\r\n */\r\n this.menu = this.grid.querySelector(\".dg-menu\");\r\n }\r\n disconnected() {\r\n if (this.grid.headerRow) {\r\n off(this.grid.headerRow, \"contextmenu\", this);\r\n }\r\n }\r\n\r\n attachContextMenu() {\r\n const grid = this.grid;\r\n on(grid.headerRow, \"contextmenu\", this);\r\n }\r\n\r\n onchange(e) {\r\n const grid = this.grid;\r\n const t = e.target;\r\n const field = t.dataset.name;\r\n if (t.checked) {\r\n grid.showColumn(field);\r\n } else {\r\n // Prevent hidding last\r\n if (grid.visibleColumns().length <= 1) {\r\n // Restore checkbox value\r\n t.checked = true;\r\n return;\r\n }\r\n grid.hideColumn(field);\r\n }\r\n }\r\n\r\n oncontextmenu(e) {\r\n e.preventDefault();\r\n const grid = this.grid;\r\n const target = getParentElement(e.target, \"THEAD\");\r\n const menu = this.menu;\r\n const rect = target.getBoundingClientRect();\r\n let x = e.clientX - rect.left;\r\n const y = e.clientY - rect.top;\r\n\r\n menu.style.top = `${y}px`;\r\n menu.style.left = `${x}px`;\r\n\r\n removeAttribute(menu, \"hidden\");\r\n if (x + 150 > rect.width) {\r\n x -= menu.offsetWidth;\r\n menu.style.left = `${x}px`;\r\n }\r\n\r\n const documentClickHandler = (e) => {\r\n if (!menu.contains(e.target)) {\r\n setAttribute(menu, \"hidden\", \"\");\r\n off(document, \"click\", documentClickHandler);\r\n }\r\n };\r\n on(document, \"click\", documentClickHandler);\r\n }\r\n createMenu() {\r\n const grid = this.grid;\r\n const menu = this.menu;\r\n while (menu.lastChild) {\r\n menu.removeChild(menu.lastChild);\r\n }\r\n menu.addEventListener(\"change\", this);\r\n grid.options.columns.forEach((col) => {\r\n if (col.attr) {\r\n return;\r\n }\r\n const li = document.createElement(\"li\");\r\n const label = document.createElement(\"label\");\r\n const checkbox = document.createElement(\"input\");\r\n setAttribute(checkbox, \"type\", \"checkbox\");\r\n setAttribute(checkbox, \"data-name\", col.field);\r\n if (!col.hidden) {\r\n checkbox.checked = true;\r\n }\r\n const text = document.createTextNode(col.title);\r\n\r\n label.appendChild(checkbox);\r\n label.appendChild(text);\r\n\r\n li.appendChild(label);\r\n menu.appendChild(li);\r\n });\r\n }\r\n}\r\n\r\nexport default ContextMenu;\r\n", "import BasePlugin from \"../core/base-plugin.js\";\r\nimport getParentElement from \"../utils/getParentElement.js\";\r\nimport { dispatch, findAll, getAttribute, on, setAttribute } from \"../utils/shortcuts.js\";\r\n\r\n/**\r\n * Allows to move headers\r\n */\r\nclass DraggableHeaders extends BasePlugin {\r\n /**\r\n * @param {HTMLTableCellElement} th\r\n */\r\n makeHeaderDraggable(th) {\r\n const grid = this.grid;\r\n th.draggable = true;\r\n on(th, \"dragstart\", (e) => {\r\n if (grid.plugins.ColumnResizer && grid.plugins.ColumnResizer.isResizing && e.preventDefault) {\r\n e.preventDefault();\r\n return;\r\n }\r\n grid.log(\"reorder col\");\r\n e.dataTransfer.effectAllowed = \"move\";\r\n e.dataTransfer.setData(\"text/plain\", e.target.getAttribute(\"aria-colindex\"));\r\n });\r\n on(th, \"dragover\", (e) => {\r\n if (e.preventDefault) {\r\n e.preventDefault();\r\n }\r\n e.dataTransfer.dropEffect = \"move\";\r\n return false;\r\n });\r\n on(th, \"drop\", (e) => {\r\n if (e.stopPropagation) {\r\n e.stopPropagation();\r\n }\r\n const t = e.target;\r\n const target = getParentElement(t, \"TH\");\r\n const index = parseInt(e.dataTransfer.getData(\"text/plain\"));\r\n const targetIndex = parseInt(target.getAttribute(\"aria-colindex\"));\r\n\r\n if (index === targetIndex) {\r\n grid.log(\"reordered col stayed the same\");\r\n return;\r\n }\r\n grid.log(\"reordered col from \" + index + \" to \" + targetIndex);\r\n\r\n const offset = grid.startColIndex();\r\n const tmp = grid.options.columns[index - offset];\r\n grid.options.columns[index - offset] = grid.options.columns[targetIndex - offset];\r\n grid.options.columns[targetIndex - offset] = tmp;\r\n\r\n const swapNodes = (selector, el1) => {\r\n const rowIndex = el1.parentNode.getAttribute(\"aria-rowindex\");\r\n const el2 = grid.querySelector(selector + \" tr[aria-rowindex='\" + rowIndex + \"'] [aria-colindex='\" + targetIndex + \"']\");\r\n setAttribute(el1, \"aria-colindex\", targetIndex);\r\n setAttribute(el2, \"aria-colindex\", index);\r\n const newNode = document.createElement(\"th\");\r\n el1.parentNode.insertBefore(newNode, el1);\r\n el2.parentNode.replaceChild(el1, el2);\r\n newNode.parentNode.replaceChild(el2, newNode);\r\n };\r\n\r\n // Swap all rows in header and body\r\n findAll(grid, \"thead th[aria-colindex='\" + index + \"']\").forEach((el1) => {\r\n swapNodes(\"thead\", el1);\r\n });\r\n findAll(grid, 'tbody td[aria-colindex=\"' + index + '\"]').forEach((el1) => {\r\n swapNodes(\"tbody\", el1);\r\n });\r\n\r\n // Updates the columns\r\n grid.options.columns = findAll(grid, \"thead tr.dg-head-columns th[field]\").map((th) =>\r\n grid.options.columns.find((c) => c.field == getAttribute(th, \"field\"))\r\n );\r\n\r\n dispatch(grid, \"columnReordered\", {\r\n col: tmp.field,\r\n from: index,\r\n to: targetIndex,\r\n });\r\n return false;\r\n });\r\n }\r\n}\r\n\r\nexport default DraggableHeaders;\r\n", "import BasePlugin from \"../core/base-plugin.js\";\r\n\r\n/**\r\n * Allows to paginate with horizontal swipe motions\r\n */\r\nclass TouchSupport extends BasePlugin {\r\n constructor(grid) {\r\n super(grid);\r\n this.touch = null;\r\n }\r\n connected() {\r\n const grid = this.grid;\r\n grid.addEventListener(\"touchstart\", this, { passive: true });\r\n grid.addEventListener(\"touchmove\", this, { passive: true });\r\n }\r\n\r\n disconnected() {\r\n const grid = this.grid;\r\n grid.removeEventListener(\"touchstart\", this);\r\n grid.removeEventListener(\"touchmove\", this);\r\n }\r\n\r\n ontouchstart(e) {\r\n this.touch = e.touches[0];\r\n }\r\n\r\n ontouchmove(e) {\r\n if (!this.touch) {\r\n return;\r\n }\r\n const grid = this.grid;\r\n const xDiff = this.touch.clientX - e.touches[0].clientX;\r\n const yDiff = this.touch.clientY - e.touches[0].clientY;\r\n\r\n if (Math.abs(xDiff) > Math.abs(yDiff)) {\r\n if (xDiff > 0) {\r\n grid.getNext();\r\n } else {\r\n grid.getPrev();\r\n }\r\n }\r\n this.touch = null;\r\n }\r\n}\r\n\r\nexport default TouchSupport;\r\n", "import BasePlugin from \"../core/base-plugin.js\";\r\nimport { dispatch, findAll, hasClass, setAttribute } from \"../utils/shortcuts.js\";\r\n\r\nconst SELECTABLE_CLASS = \"dg-selectable\";\r\nconst SELECT_ALL_CLASS = \"dg-select-all\";\r\nconst CHECKBOX_CLASS = \"form-check-input\"; //bs5\r\n\r\n/**\r\n * Allows to select rows\r\n */\r\nclass SelectableRows extends BasePlugin {\r\n disconnected() {\r\n if (this.selectAll) {\r\n this.selectAll.removeEventListener(\"change\", this);\r\n }\r\n }\r\n\r\n /**\r\n * @param {String} key Return a specific key (eg: id) instead of the whole row\r\n * @returns {Array}\r\n */\r\n getSelection(key = null) {\r\n const grid = this.grid;\r\n let selectedData = [];\r\n\r\n const inputs = findAll(grid, `tbody .${SELECTABLE_CLASS} input:checked`);\r\n inputs.forEach((checkbox) => {\r\n const idx = parseInt(checkbox.dataset.id);\r\n const item = grid.data[idx - 1];\r\n if (!item) {\r\n console.warn(`Item ${idx} not found`);\r\n }\r\n if (key) {\r\n selectedData.push(item[key]);\r\n } else {\r\n selectedData.push(item);\r\n }\r\n });\r\n return selectedData;\r\n }\r\n\r\n /**\r\n * Uncheck box if hidden and visible only\r\n * @param {HTMLTableSectionElement} tbody\r\n */\r\n clearCheckboxes(tbody) {\r\n const grid = this.grid;\r\n if (!grid.options.selectVisibleOnly) {\r\n return;\r\n }\r\n const inputs = findAll(tbody, `tr[hidden] .${SELECTABLE_CLASS} input`);\r\n inputs.forEach((input) => {\r\n input.checked = false;\r\n });\r\n this.selectAll.checked = false;\r\n }\r\n\r\n colIndex() {\r\n return this.grid.startColIndex() - 2;\r\n }\r\n\r\n /**\r\n * @param {HTMLTableRowElement} tr\r\n */\r\n createHeaderCol(tr) {\r\n let th = document.createElement(\"th\");\r\n setAttribute(th, \"scope\", \"col\");\r\n setAttribute(th, \"role\", \"columnheader button\");\r\n setAttribute(th, \"aria-colindex\", this.colIndex());\r\n th.classList.add(...[SELECTABLE_CLASS, \"dg-not-resizable\", \"dg-not-sortable\"]);\r\n th.tabIndex = 0;\r\n\r\n this.selectAll = document.createElement(\"input\");\r\n this.selectAll.type = \"checkbox\";\r\n this.selectAll.classList.add(SELECT_ALL_CLASS);\r\n this.selectAll.classList.add(CHECKBOX_CLASS);\r\n this.selectAll.addEventListener(\"change\", this);\r\n\r\n let label = document.createElement(\"label\");\r\n label.appendChild(this.selectAll);\r\n\r\n th.appendChild(label);\r\n\r\n th.setAttribute(\"width\", \"40\");\r\n tr.appendChild(th);\r\n }\r\n\r\n /**\r\n * @param {HTMLTableRowElement} tr\r\n */\r\n createFilterCol(tr) {\r\n let th = document.createElement(\"th\");\r\n setAttribute(th, \"role\", \"columnheader button\");\r\n setAttribute(th, \"aria-colindex\", this.colIndex());\r\n th.classList.add(SELECTABLE_CLASS);\r\n th.tabIndex = 0;\r\n\r\n tr.appendChild(th);\r\n }\r\n\r\n /**\r\n * Handles the selectAll checkbox when any other .dg-selectable checkbox is checked on table body.\r\n * It should check selectAll if all is checked\r\n * It should uncheck selectAll if any is unchecked\r\n * @param {HTMLTableSectionElement} tbody\r\n */\r\n shouldSelectAll(tbody) {\r\n if (!this.selectAll) {\r\n return;\r\n }\r\n // Delegate listener for change events on input checkboxes\r\n tbody.addEventListener(\"change\", this);\r\n // Make sure state is up to date\r\n tbody.dispatchEvent(new Event(\"change\"));\r\n }\r\n\r\n /**\r\n * @param {HTMLTableRowElement} tr\r\n */\r\n createDataCol(tr) {\r\n // Create col\r\n let td = document.createElement(\"td\");\r\n setAttribute(td, \"role\", \"gridcell button\");\r\n setAttribute(td, \"aria-colindex\", this.colIndex());\r\n td.classList.add(SELECTABLE_CLASS);\r\n\r\n // Create input\r\n let selectOne = document.createElement(\"input\");\r\n // Alias row id for easy retrieval in getSelection\r\n selectOne.dataset.id = tr.getAttribute(\"aria-rowindex\");\r\n selectOne.type = \"checkbox\";\r\n selectOne.classList.add(CHECKBOX_CLASS);\r\n // Label need to take full space thanks to css to make the whole cell clickable\r\n let label = document.createElement(\"label\");\r\n label.classList.add(\"dg-clickable-cell\");\r\n label.appendChild(selectOne);\r\n td.appendChild(label);\r\n\r\n // Prevent unwanted click behaviour on row\r\n label.addEventListener(\"click\", this);\r\n\r\n tr.appendChild(td);\r\n }\r\n\r\n /**\r\n * @param {Event} e\r\n */\r\n onclick(e) {\r\n e.stopPropagation();\r\n }\r\n\r\n /**\r\n * Handle change event on select all or any select checkbox in the table body\r\n * @param {import(\"../utils/shortcuts.js\").FlexibleEvent} e\r\n */\r\n onchange(e) {\r\n const grid = this.grid;\r\n if (hasClass(e.target, SELECT_ALL_CLASS)) {\r\n const visibleOnly = grid.options.selectVisibleOnly;\r\n const inputs = findAll(grid, `tbody .${SELECTABLE_CLASS} input`);\r\n inputs.forEach((cb) => {\r\n if (visibleOnly && !cb.offsetWidth) {\r\n return;\r\n }\r\n cb.checked = this.selectAll.checked;\r\n });\r\n\r\n dispatch(grid, \"rowsSelected\", {\r\n selection: this.getSelection(),\r\n });\r\n } else {\r\n if (!e.target.closest(`.${SELECTABLE_CLASS}`)) {\r\n return;\r\n }\r\n const totalCheckboxes = findAll(grid, `tbody .${SELECTABLE_CLASS} input[type=checkbox]`);\r\n // @ts-ignore\r\n const totalChecked = totalCheckboxes.filter((n) => n.checked);\r\n this.selectAll.checked = totalChecked.length == totalCheckboxes.length;\r\n\r\n dispatch(grid, \"rowsSelected\", {\r\n selection: grid.getSelection(),\r\n });\r\n }\r\n }\r\n}\r\n\r\nexport default SelectableRows;\r\n", "import BasePlugin from \"../core/base-plugin.js\";\r\nimport { setAttribute } from \"../utils/shortcuts.js\";\r\n\r\n/**\r\n * Support for fixed table height\r\n *\r\n * We should add a fake row to push the footer down in case we don't have enough rows\r\n */\r\nclass FixedHeight extends BasePlugin {\r\n constructor(grid) {\r\n super(grid);\r\n\r\n this.hasFixedHeight = false;\r\n // If we have a fixed height, make sure we have overflowY set\r\n if (grid.style.height) {\r\n grid.style.overflowY = \"auto\";\r\n this.hasFixedHeight = true;\r\n }\r\n }\r\n\r\n /**\r\n */\r\n createFakeRow() {\r\n const grid = this.grid;\r\n const tbody = grid.querySelector(\"tbody\");\r\n let tr = document.createElement(\"tr\");\r\n setAttribute(tr, \"role\", \"row\");\r\n setAttribute(tr, \"hidden\", \"\");\r\n tr.classList.add(\"dg-fake-row\");\r\n tr.tabIndex = 0;\r\n tbody.appendChild(tr);\r\n }\r\n\r\n get fakeRow() {\r\n return this.grid.querySelector(\".dg-fake-row\");\r\n }\r\n\r\n /**\r\n * On last page, use a fake row to push footer down\r\n */\r\n updateFakeRow() {\r\n const grid = this.grid;\r\n const fakeRow = this.fakeRow;\r\n if (!fakeRow) {\r\n return;\r\n }\r\n\r\n // We don't need a fake row if we display everything\r\n if (grid.options.perPage > grid.totalRecords()) {\r\n return;\r\n }\r\n // We are not on last page\r\n if (grid.page !== grid.totalPages()) {\r\n return;\r\n }\r\n if (!grid.options.autoheight) {\r\n return;\r\n }\r\n // Find remaining missing height\r\n const max = grid.options.perPage * grid.rowHeight;\r\n const visibleRows = grid.querySelectorAll(\"tbody tr:not([hidden])\").length;\r\n const fakeHeight = visibleRows > 1 ? max - visibleRows * grid.rowHeight : max;\r\n if (fakeHeight > 0) {\r\n setAttribute(fakeRow, \"height\", fakeHeight);\r\n fakeRow.removeAttribute(\"hidden\");\r\n } else {\r\n fakeRow.removeAttribute(\"height\");\r\n }\r\n }\r\n}\r\n\r\nexport default FixedHeight;\r\n", "import BasePlugin from \"../core/base-plugin.js\";\r\nimport getTextWidth from \"../utils/getTextWidth.js\";\r\nimport { getAttribute, hasAttribute, setAttribute } from \"../utils/shortcuts.js\";\r\n\r\n/**\r\n * Allows to resize columns\r\n */\r\nclass AutosizeColumn extends BasePlugin {\r\n /**\r\n * Autosize col based on column data\r\n * @param {HTMLTableCellElement} th\r\n * @param {import(\"../data-grid\").Column} column\r\n * @param {Number} min\r\n * @param {Number} max\r\n * @returns {Number}\r\n */\r\n computeSize(th, column, min, max) {\r\n const grid = this.grid;\r\n if (hasAttribute(th, \"width\")) {\r\n return getAttribute(th, \"width\");\r\n }\r\n if (!grid.data.length) {\r\n return;\r\n }\r\n const firstVal = grid.data[0];\r\n const lastVal = grid.data[grid.data.length - 1];\r\n let v = firstVal[column.field] ? firstVal[column.field].toString() : \"\";\r\n let v2 = lastVal[column.field] ? lastVal[column.field].toString() : \"\";\r\n if (v2.length > v.length) {\r\n v = v2;\r\n }\r\n let width = 0;\r\n if (v.length <= 6) {\r\n width = min;\r\n } else if (v.length > 50) {\r\n width = max;\r\n } else {\r\n // Add some extra room to have some spare space\r\n width = getTextWidth(v + \"0000\", th);\r\n }\r\n if (width > max) {\r\n width = max;\r\n }\r\n if (width < min) {\r\n width = min;\r\n }\r\n setAttribute(th, \"width\", width);\r\n return width;\r\n }\r\n}\r\n\r\nexport default AutosizeColumn;\r\n", "/**\r\n * Define a function that can be happily passed to addEventListener\r\n * @typedef {Function & EventListenerOrEventListenerObject} ExtendedFunction\r\n */\r\n\r\n/**\r\n * @param {Function} handler\r\n * @param {Number} timeout\r\n * @returns {ExtendedFunction}\r\n */\r\nexport default function debounce(handler, timeout = 300) {\r\n let timer = null;\r\n return (...args) => {\r\n clearTimeout(timer);\r\n timer = setTimeout(() => {\r\n timer = null;\r\n handler(...args);\r\n }, timeout);\r\n };\r\n}\r\n", "import BasePlugin from \"../core/base-plugin.js\";\r\nimport debounce from \"../utils/debounce.js\";\r\nimport { addClass, ce, find, findAll, hasClass, insertAfter, removeAttribute, removeClass, setAttribute } from \"../utils/shortcuts.js\";\r\n\r\nconst RESPONSIVE_CLASS = \"dg-responsive\";\r\n\r\nlet obsTo;\r\n\r\n/**\r\n * @param {Array} list\r\n * @returns {Array}\r\n */\r\nfunction sortByPriority(list) {\r\n return list.sort((a, b) => {\r\n const v1 = parseInt(a.dataset.responsive) || 1;\r\n const v2 = parseInt(b.dataset.responsive) || 1;\r\n return v2 - v1;\r\n });\r\n}\r\n\r\n/**\r\n * @type {ResizeObserverCallback}\r\n */\r\n//@ts-ignore\r\nconst callback = debounce((entries) => {\r\n for (const entry of entries) {\r\n /**\r\n * @type {import(\"../data-grid\").default}\r\n */\r\n // @ts-ignore\r\n const grid = entry.target;\r\n const table = grid.table;\r\n if (grid.plugins.ResponsiveGrid.observerBlocked) {\r\n return;\r\n }\r\n // check inlineSize (width) and not blockSize (height)\r\n const contentBoxSize = Array.isArray(entry.contentBoxSize) ? entry.contentBoxSize[0] : entry.contentBoxSize;\r\n const size = parseInt(contentBoxSize.inlineSize);\r\n const tableWidth = table.offsetWidth;\r\n const realTableWidth = findAll(grid.headerRow, \"th\").reduce((result, th) => {\r\n return result + th.offsetWidth;\r\n }, 0);\r\n const diff = (realTableWidth || tableWidth) - size - 1;\r\n const minWidth = 50;\r\n const prevAction = grid.plugins.ResponsiveGrid.prevAction;\r\n // We have an array with the columns to show/hide are in order, most important first\r\n const headerCols = sortByPriority(\r\n findAll(grid.headerRow, \"th[field]\")\r\n .reverse() // Order takes precedence if no priority is set\r\n .filter((col) => {\r\n // Leave out unresponsive columns\r\n return col.dataset.responsive !== \"0\";\r\n })\r\n );\r\n let changed = false;\r\n\r\n grid.log(`table is ${tableWidth}/${realTableWidth} and available size is ${size}. Diff: ${diff}`);\r\n\r\n // The table is too big when diff has a high value, otherwise it will be like -1 or -2\r\n if (diff > 0) {\r\n if (prevAction === \"show\") {\r\n return;\r\n }\r\n grid.plugins.ResponsiveGrid.prevAction = \"hide\";\r\n let remaining = diff;\r\n let cols = headerCols.filter((col) => {\r\n return !col.hasAttribute(\"hidden\") && col.hasAttribute(\"data-responsive\");\r\n });\r\n if (cols.length === 0) {\r\n cols = headerCols.filter((col) => {\r\n return !col.hasAttribute(\"hidden\");\r\n });\r\n // Always keep one column\r\n if (cols.length === 1) {\r\n return;\r\n }\r\n }\r\n cols.forEach((col) => {\r\n if (remaining < 0) {\r\n return;\r\n }\r\n\r\n const colWidth = col.offsetWidth;\r\n const field = col.getAttribute(\"field\");\r\n if (!field) {\r\n return;\r\n }\r\n col.dataset.baseWidth = \"\" + col.offsetWidth;\r\n\r\n grid.hideColumn(field, false);\r\n grid.setColProp(field, \"responsiveHidden\", true);\r\n changed = true;\r\n\r\n remaining -= colWidth;\r\n remaining = Math.round(remaining);\r\n });\r\n } else {\r\n if (prevAction === \"hide\") {\r\n return;\r\n }\r\n grid.plugins.ResponsiveGrid.prevAction = \"show\";\r\n\r\n const requiredWidth =\r\n headerCols\r\n .filter((col) => {\r\n return !col.hasAttribute(\"hidden\");\r\n })\r\n .reduce((result, col) => {\r\n const width = col.dataset.minWidth ? parseInt(col.dataset.minWidth) : col.offsetWidth;\r\n return result + width;\r\n }, 0) + minWidth; // Add an offset so that inserting column is smoother\r\n\r\n // Compute available width to insert columns\r\n let remaining = size - requiredWidth;\r\n // Do we have any hidden column that we can restore ?\r\n headerCols\r\n .slice()\r\n .reverse() // Reverse the array to restore the columns in the proper order\r\n .filter((col) => {\r\n return col.hasAttribute(\"hidden\");\r\n })\r\n .forEach((col) => {\r\n if (remaining < minWidth) {\r\n return;\r\n }\r\n const colWidth = parseInt(col.dataset.minWidth);\r\n\r\n // We need to have enough space to restore it\r\n if (colWidth > remaining) {\r\n remaining = -1; // break loop to keep restoring in order\r\n return;\r\n }\r\n\r\n const field = col.getAttribute(\"field\");\r\n if (!field) {\r\n return;\r\n }\r\n\r\n grid.showColumn(field, false);\r\n grid.setColProp(field, \"responsiveHidden\", false);\r\n changed = true;\r\n\r\n remaining -= colWidth;\r\n remaining = Math.round(remaining);\r\n });\r\n }\r\n\r\n // Check footer\r\n const footer = find(grid.table, \"tfoot\");\r\n const realFooterWidth = findAll(grid.table, \".dg-footer > div\").reduce((result, div) => {\r\n return result + div.offsetWidth;\r\n }, 0);\r\n const availableFooterWidth = footer.offsetWidth - realFooterWidth;\r\n if (realFooterWidth > size) {\r\n addClass(footer, \"dg-footer-compact\");\r\n } else if (availableFooterWidth > 250) {\r\n removeClass(footer, \"dg-footer-compact\");\r\n }\r\n if (changed) {\r\n grid.renderTable();\r\n }\r\n // Prevent resize loop\r\n setTimeout(() => {\r\n grid.plugins.ResponsiveGrid.prevAction = null;\r\n }, 1000);\r\n grid.table.style.visibility = \"visible\";\r\n }\r\n}, 100);\r\nconst resizeObserver = new ResizeObserver(callback);\r\n\r\n/**\r\n * Responsive data grid\r\n */\r\nclass ResponsiveGrid extends BasePlugin {\r\n constructor(grid) {\r\n super(grid);\r\n\r\n this.observerBlocked = false;\r\n this.prevAction = null;\r\n }\r\n\r\n connected() {\r\n if (this.grid.options.responsive) {\r\n this.observe();\r\n }\r\n }\r\n\r\n disconnected() {\r\n this.unobserve();\r\n }\r\n\r\n observe() {\r\n if (!this.grid.options.responsive) {\r\n return;\r\n }\r\n resizeObserver.observe(this.grid);\r\n this.grid.style.display = \"block\"; // Otherwise resize doesn't happen\r\n this.grid.style.overflowX = \"hidden\"; // Prevent scrollbars from appearing\r\n }\r\n\r\n unobserve() {\r\n resizeObserver.unobserve(this.grid);\r\n this.grid.style.display = \"unset\";\r\n this.grid.style.overflowX = \"unset\";\r\n }\r\n\r\n blockObserver() {\r\n this.observerBlocked = true;\r\n if (obsTo) {\r\n clearTimeout(obsTo);\r\n }\r\n }\r\n\r\n unblockObserver() {\r\n obsTo = setTimeout(() => {\r\n this.observerBlocked = false;\r\n }, 200); // more than debounce\r\n }\r\n\r\n /**\r\n * @returns {Boolean}\r\n */\r\n hasHiddenColumns() {\r\n let flag = false;\r\n this.grid.options.columns.forEach((col) => {\r\n if (col.responsiveHidden) {\r\n flag = true;\r\n }\r\n });\r\n return flag;\r\n }\r\n\r\n colIndex() {\r\n return this.grid.startColIndex() - 1;\r\n }\r\n\r\n /**\r\n * @param {HTMLTableRowElement} tr\r\n */\r\n createHeaderCol(tr) {\r\n if (!this.grid.options.responsiveToggle) {\r\n return;\r\n }\r\n let th = ce(\"th\", tr);\r\n setAttribute(th, \"scope\", \"col\");\r\n setAttribute(th, \"role\", \"columnheader button\");\r\n setAttribute(th, \"aria-colindex\", this.colIndex());\r\n setAttribute(th, \"width\", \"40\");\r\n th.classList.add(...[`${RESPONSIVE_CLASS}-toggle`, \"dg-not-resizable\", \"dg-not-sortable\"]);\r\n th.tabIndex = 0;\r\n }\r\n\r\n /**\r\n * @param {HTMLTableRowElement} tr\r\n */\r\n createFilterCol(tr) {\r\n if (!this.grid.options.responsiveToggle) {\r\n return;\r\n }\r\n let th = ce(\"th\", tr);\r\n setAttribute(th, \"role\", \"columnheader button\");\r\n setAttribute(th, \"aria-colindex\", this.colIndex());\r\n th.classList.add(`${RESPONSIVE_CLASS}-toggle`);\r\n th.tabIndex = 0;\r\n }\r\n\r\n /**\r\n * @param {HTMLTableRowElement} tr\r\n */\r\n createDataCol(tr) {\r\n if (!this.grid.options.responsiveToggle) {\r\n return;\r\n }\r\n // Create col\r\n let td = document.createElement(\"td\");\r\n setAttribute(td, \"role\", \"gridcell button\");\r\n setAttribute(td, \"aria-colindex\", this.colIndex());\r\n td.classList.add(`${RESPONSIVE_CLASS}-toggle`);\r\n\r\n // Create icon\r\n td.innerHTML = `
\r\n \r\n \r\n\r\n\r\n \r\n
`;\r\n tr.appendChild(td);\r\n\r\n td.addEventListener(\"click\", this);\r\n td.addEventListener(\"mousedown\", this);\r\n }\r\n\r\n computeLabelWidth() {\r\n let idealWidth = 0;\r\n let consideredCol = 0;\r\n while (idealWidth < 120) {\r\n consideredCol++;\r\n const hCol = find(this.grid, `.dg-head-columns th[aria-colindex=\"${consideredCol}\"]`);\r\n if (hCol) {\r\n idealWidth += hCol.offsetWidth;\r\n } else {\r\n break;\r\n }\r\n }\r\n return idealWidth;\r\n }\r\n\r\n /**\r\n * @param {Event} ev\r\n */\r\n onmousedown(ev) {\r\n // Avoid selection through double click\r\n ev.preventDefault();\r\n }\r\n\r\n /**\r\n * @param {Event} ev\r\n */\r\n onclick(ev) {\r\n // Prevent expandable\r\n ev.stopPropagation();\r\n\r\n // target is the element that triggered the event (e.g., the user clicked on)\r\n // currentTarget is the element that the event listener is attached to.\r\n\r\n /**\r\n * @type {HTMLTableRowElement}\r\n */\r\n //@ts-ignore\r\n const td = ev.currentTarget;\r\n const tr = td.parentElement;\r\n const open = find(td, `.${RESPONSIVE_CLASS}-open`);\r\n const close = find(td, `.${RESPONSIVE_CLASS}-close`);\r\n\r\n this.blockObserver();\r\n\r\n const isExpanded = hasClass(tr, `${RESPONSIVE_CLASS}-expanded`);\r\n if (isExpanded) {\r\n removeClass(tr, `${RESPONSIVE_CLASS}-expanded`);\r\n open.style.display = \"unset\";\r\n close.style.display = \"none\";\r\n\r\n // Move back rows and cleanup row\r\n const childRow = tr.nextElementSibling;\r\n const hiddenCols = findAll(childRow, `.${RESPONSIVE_CLASS}-hidden`);\r\n hiddenCols.forEach((col) => {\r\n // We don't really need to care where we insert them since we are going to redraw anyway\r\n tr.appendChild(col);\r\n setAttribute(col, \"hidden\");\r\n });\r\n\r\n childRow.parentElement.removeChild(childRow);\r\n } else {\r\n addClass(tr, `${RESPONSIVE_CLASS}-expanded`);\r\n open.style.display = \"none\";\r\n close.style.display = \"unset\";\r\n\r\n // Create a child row and move rows into it\r\n const childRow = ce(\"tr\");\r\n insertAfter(childRow, tr);\r\n addClass(childRow, `${RESPONSIVE_CLASS}-child-row`);\r\n\r\n const childRowTd = ce(\"td\", childRow);\r\n setAttribute(childRowTd, \"colspan\", this.grid.columnsLength(true));\r\n\r\n const childTable = ce(\"table\", childRowTd);\r\n addClass(childTable, `${RESPONSIVE_CLASS}-table`);\r\n\r\n const hiddenCols = findAll(tr, `.${RESPONSIVE_CLASS}-hidden`);\r\n const idealWidth = this.computeLabelWidth();\r\n hiddenCols.forEach((col) => {\r\n const childTableRow = ce(\"tr\", childTable);\r\n\r\n // Add label\r\n const label = col.dataset.name;\r\n const labelCol = ce(\"th\", childTableRow);\r\n // It looks much better when aligned with an actual col\r\n labelCol.style.width = `${idealWidth}px`;\r\n labelCol.innerHTML = label;\r\n\r\n // Add actual row\r\n childTableRow.appendChild(col);\r\n removeAttribute(col, \"hidden\");\r\n });\r\n }\r\n\r\n this.unblockObserver();\r\n }\r\n}\r\n\r\nexport default ResponsiveGrid;\r\n", "import BasePlugin from \"../core/base-plugin.js\";\r\nimport interpolate from \"../utils/interpolate.js\";\r\nimport { dispatch, on, setAttribute } from \"../utils/shortcuts.js\";\r\n\r\n/**\r\n * Add action on rows\r\n */\r\nclass RowActions extends BasePlugin {\r\n /**\r\n * @returns {Boolean}\r\n */\r\n hasActions() {\r\n return this.grid.options.actions.length > 0;\r\n }\r\n\r\n /**\r\n *\r\n * @param {HTMLTableRowElement} tr\r\n */\r\n makeActionHeader(tr) {\r\n let actionsTh = document.createElement(\"th\");\r\n setAttribute(actionsTh, \"role\", \"columnheader button\");\r\n setAttribute(actionsTh, \"aria-colindex\", this.grid.columnsLength(true));\r\n actionsTh.classList.add(...[\"dg-actions\", \"dg-not-sortable\", \"dg-not-resizable\", this.actionClass]);\r\n actionsTh.tabIndex = 0;\r\n tr.appendChild(actionsTh);\r\n }\r\n\r\n /**\r\n *\r\n * @param {HTMLTableRowElement} tr\r\n */\r\n makeActionFilter(tr) {\r\n let actionsTh = document.createElement(\"th\");\r\n actionsTh.setAttribute(\"role\", \"columnheader button\");\r\n actionsTh.setAttribute(\"aria-colindex\", \"\" + this.grid.columnsLength(true));\r\n actionsTh.classList.add(...[\"dg-actions\", this.actionClass]);\r\n actionsTh.tabIndex = 0;\r\n tr.appendChild(actionsTh);\r\n }\r\n\r\n /**\r\n * @param {HTMLTableRowElement} tr\r\n * @param {Object} item\r\n */\r\n makeActionRow(tr, item) {\r\n const labels = this.grid.labels;\r\n const td = document.createElement(\"td\");\r\n setAttribute(td, \"role\", \"gridcell\");\r\n setAttribute(td, \"aria-colindex\", this.grid.columnsLength(true));\r\n td.classList.add(...[\"dg-actions\", this.actionClass]);\r\n td.tabIndex = 0;\r\n\r\n // Add menu toggle\r\n let actionsToggle = document.createElement(\"button\");\r\n actionsToggle.classList.add(\"dg-actions-toggle\");\r\n actionsToggle.innerHTML = \"\u2630\";\r\n td.appendChild(actionsToggle);\r\n on(actionsToggle, \"click\", (ev) => {\r\n ev.stopPropagation();\r\n ev.target.parentElement.classList.toggle(\"dg-actions-expand\");\r\n });\r\n\r\n this.grid.options.actions.forEach((action) => {\r\n let button = document.createElement(\"button\");\r\n if (action.html) {\r\n button.innerHTML = action.html;\r\n } else {\r\n button.innerText = action.title ?? action.name;\r\n }\r\n if (action.title) {\r\n button.title = action.title;\r\n }\r\n if (action.url) {\r\n button.type = \"submit\";\r\n button.formAction = interpolate(action.url, item);\r\n }\r\n if (action.class) {\r\n button.classList.add(...action.class.split(\" \"));\r\n }\r\n const actionHandler = (ev) => {\r\n ev.stopPropagation();\r\n if (action.confirm) {\r\n let c = confirm(labels.areYouSure);\r\n if (!c) {\r\n ev.preventDefault();\r\n return;\r\n }\r\n }\r\n dispatch(this.grid, \"action\", {\r\n data: item,\r\n action: action.name,\r\n });\r\n };\r\n button.addEventListener(\"click\", actionHandler);\r\n td.appendChild(button);\r\n\r\n // Row action\r\n if (action.default) {\r\n tr.classList.add(\"dg-actionable\");\r\n tr.addEventListener(\"click\", actionHandler);\r\n }\r\n });\r\n\r\n tr.appendChild(td);\r\n }\r\n\r\n get actionClass() {\r\n if (this.grid.options.actions.length < 3 && !this.grid.options.collapseActions) {\r\n return \"dg-actions-\" + this.grid.options.actions.length;\r\n }\r\n return \"dg-actions-more\";\r\n }\r\n}\r\n\r\nexport default RowActions;\r\n", "import BasePlugin from \"../core/base-plugin.js\";\r\nimport { dispatch } from \"../utils/shortcuts.js\";\r\n\r\n/**\r\n * Make editable inputs in rows\r\n */\r\nclass EditableColumn extends BasePlugin {\r\n /**\r\n *\r\n * @param {HTMLTableCellElement} td\r\n * @param {import(\"../data-grid\").Column} column\r\n * @param {Object} item\r\n * @param {number} i\r\n */\r\n makeEditableInput(td, column, item, i) {\r\n const gridId = this.grid.getAttribute(\"id\");\r\n let input = document.createElement(\"input\");\r\n input.type = column.editableType || \"text\";\r\n if (input.type == \"email\") {\r\n input.inputMode = \"email\";\r\n }\r\n if (input.type == \"decimal\") {\r\n input.type = \"text\";\r\n input.inputMode = \"decimal\";\r\n }\r\n input.autocomplete = \"off\";\r\n input.spellcheck = false;\r\n input.tabIndex = 0;\r\n input.classList.add(\"dg-editable\");\r\n input.name = gridId.replace(\"-\", \"_\") + \"[\" + (i + 1) + \"]\" + \"[\" + column.field + \"]\";\r\n input.value = item[column.field];\r\n input.dataset.field = column.field;\r\n\r\n // Prevent row action\r\n input.addEventListener(\"click\", (ev) => ev.stopPropagation());\r\n // Enter validates edit\r\n input.addEventListener(\"keypress\", (ev) => {\r\n if (ev.type === \"keypress\") {\r\n const key = ev.keyCode || ev.key;\r\n if (key === 13 || key === \"Enter\") {\r\n input.blur();\r\n ev.preventDefault();\r\n }\r\n }\r\n });\r\n // Save on blur\r\n input.addEventListener(\"blur\", () => {\r\n // Only fire on update\r\n if (input.value == item[input.dataset.field]) {\r\n return;\r\n }\r\n // Update underlying data\r\n item[input.dataset.field] = input.value;\r\n // Notify\r\n dispatch(this.grid, \"edit\", {\r\n data: item,\r\n value: input.value,\r\n });\r\n });\r\n td.appendChild(input);\r\n }\r\n}\r\n\r\nexport default EditableColumn;\r\n", "import DataGrid from \"./src/data-grid.js\";\r\n// Optional plugins\r\nimport ColumnResizer from \"./src/plugins/column-resizer.js\";\r\nimport ContextMenu from \"./src/plugins/context-menu.js\";\r\nimport DraggableHeaders from \"./src/plugins/draggable-headers.js\";\r\nimport TouchSupport from \"./src/plugins/touch-support.js\";\r\nimport SelectableRows from \"./src/plugins/selectable-rows.js\";\r\nimport FixedHeight from \"./src/plugins/fixed-height.js\";\r\nimport AutosizeColumn from \"./src/plugins/autosize-column.js\";\r\nimport ResponsiveGrid from \"./src/plugins/responsive-grid.js\";\r\nimport RowActions from \"./src/plugins/row-actions.js\";\r\nimport EditableColumn from \"./src/plugins/editable-column.js\";\r\n\r\n// Using shorthand property names\r\n// This make them reserved and keys will be preserved\r\n// Actual class names are renamed\r\nDataGrid.registerPlugins({\r\n ColumnResizer,\r\n ContextMenu,\r\n DraggableHeaders,\r\n TouchSupport,\r\n SelectableRows,\r\n FixedHeight,\r\n AutosizeColumn,\r\n ResponsiveGrid,\r\n RowActions,\r\n EditableColumn,\r\n});\r\n\r\n// Prevent errors if included multiple times\r\nif (!customElements.get(\"data-grid\")) {\r\n customElements.define(\"data-grid\", DataGrid);\r\n}\r\n\r\nexport default DataGrid;\r\n"], + "mappings": "AAIe,SAARA,EAA0BC,EAAK,CACpC,OAAOA,EAAI,YAAY,EAAE,QAAQ,oBAAqB,CAACC,EAAGC,IAAQA,EAAI,YAAY,CAAC,CACrF,CCDe,SAARC,EAA+BC,EAAG,CAEvC,GAAIA,IAAM,OACR,MAAO,GAET,GAAIA,IAAM,QACR,MAAO,GAGT,GAAIA,IAAM,IAAMA,IAAM,OACpB,OAAO,KAGT,GAAIA,IAAM,OAAOA,CAAC,EAAE,SAAS,EAC3B,OAAO,OAAOA,CAAC,EAGjB,GAAIA,GAAK,CAAC,IAAK,GAAG,EAAE,SAASA,EAAE,UAAU,EAAG,CAAC,CAAC,EAC5C,GAAI,CAEF,OAAIA,EAAE,QAAQ,GAAG,IAAM,KACrBA,EAAIA,EAAE,QAAQ,KAAM,GAAG,GAElB,KAAK,MAAM,mBAAmBA,CAAC,CAAC,CACzC,MAAE,CACA,eAAQ,MAAM,mBAAqBA,CAAC,EAC7B,CAAC,CACV,CAEF,OAAOA,CACT,CCUA,IAAMC,GAAwB,CAC5B,SACA,QACA,aACA,YACA,aACA,WACA,aACA,WACA,aACA,UACA,YACA,YACA,aACA,aACA,WACF,EAOA,SAASC,GAAYC,EAAM,CACzB,OAAIF,GAAsB,SAASE,CAAI,EAC9B,CAAE,QAAS,EAAK,EAElB,CAAC,CACV,CAOO,SAASC,EAAaC,EAAIC,EAAM,CACrC,OAAOD,EAAG,aAAaC,CAAI,CAC7B,CAOO,SAASC,EAAaF,EAAIC,EAAM,CACrC,OAAOD,EAAG,aAAaC,CAAI,CAC7B,CAQO,SAASE,EAAaH,EAAIC,EAAMG,EAAI,GAAIC,EAAQ,GAAO,CACxDA,GAASH,EAAaF,EAAIC,CAAI,GAClCD,EAAG,aAAaC,EAAM,GAAKG,CAAC,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AChCI,EAAM,MAAQ,UAChBA,EAAM,UAAY,SAEhBA,EAAM,MAAQ,YAChBA,EAAM,KAAO,OACbA,EAAM,UAAY,WAEpBA,EAAM,aAAe,MACrBA,EAAM,WAAa,GACnBA,EAAM,SAAW,EACjBA,EAAM,UAAU,IAAI,aAAa,EACjCA,EAAM,KAAOD,EAAO,QAAQ,IAAK,GAAG,EAAI,KAAOD,EAAI,GAAK,KAAYF,EAAO,MAAQ,IACnFI,EAAM,MAAQH,EAAKD,EAAO,KAAK,EAC/BI,EAAM,QAAQ,MAAQJ,EAAO,MAG7BI,EAAM,iBAAiB,QAAUC,GAAOA,EAAG,gBAAgB,CAAC,EAE5DD,EAAM,iBAAiB,WAAaC,GAAO,CACzC,GAAIA,EAAG,OAAS,WAAY,CAC1B,IAAMC,EAAMD,EAAG,SAAWA,EAAG,KACzBC,IAAQ,IAAMA,IAAQ,WACxBF,EAAM,KAAK,EACXC,EAAG,eAAe,GAGxB,CAAC,EAEDD,EAAM,iBAAiB,OAAQ,IAAM,CAE/BA,EAAM,OAASH,EAAKG,EAAM,QAAQ,KAAK,IAI3CH,EAAKG,EAAM,QAAQ,KAAK,EAAIA,EAAM,MAElCG,EAAS,KAAK,KAAM,OAAQ,CAC1B,KAAMN,EACN,MAAOG,EAAM,KACf,CAAC,EACH,CAAC,EACDL,EAAG,YAAYK,CAAK,CACtB,CACF,EAEOI,GAAQX,GC/CfY,EAAS,gBAAgB,CACvB,cAAAC,GACA,YAAAC,GACA,iBAAAC,GACA,aAAAC,GACA,eAAAC,GACA,YAAAC,GACA,eAAAC,GACA,eAAAC,GACA,WAAAC,GACA,eAAAC,EACF,CAAC,EAGI,eAAe,IAAI,WAAW,GACjC,eAAe,OAAO,YAAaV,CAAQ,EAG7C,IAAOA,GAAQA", + "names": ["camelize", "str", "m", "chr", "normalizeData", "v", "supportedPassiveTypes", "passiveOpts", "type", "getAttribute", "el", "name", "hasAttribute", "setAttribute", "v", "check", "removeAttribute", "on", "listener", "off", "dispatch", "el", "name", "data", "bubbles", "opts", "hasClass", "addClass", "removeClass", "toggleClass", "$", "selector", "base", "$$", "find", "findAll", "ce", "tagName", "parent", "el", "insertAfter", "newNode", "existingNode", "BaseElement", "options", "opt", "v", "setAttribute", "jsonConfig", "data", "key", "normalizeData", "message", "getAttribute", "event", "template", "dispatch", "attributeName", "oldValue", "newValue", "isOption", "transformer", "camelize", "base_element_default", "addSelectOption", "el", "value", "label", "checked", "opt", "appendParamsToUrl", "url", "params", "key", "k", "convertArray", "v", "elementOffset", "el", "rect", "scrollLeft", "scrollTop", "interpolate", "str", "data", "$1", "$2", "getTextWidth", "text", "el", "withPadding", "styles", "fontWeight", "fontSize", "fontFamily", "padding", "paddingLeft", "paddingRight", "context", "metrics", "randstr", "prefix", "plugins", "labels", "applyColumnDefinition", "el", "column", "setAttribute", "addClass", "DataGrid", "base_element_default", "randstr", "pluginName", "pluginClass", "attr", "camelize", "v", "list", "plugin", "columns", "cols", "key", "col", "item", "convertArray", "val", "updatePage", "addSelectOption", "field", "found", "prop", "c", "render", "dispatch", "start", "visibleOnly", "len", "tr", "find", "row", "removeAttribute", "findAll", "th", "fieldName", "value", "data", "metaKey", "dataKey", "cb", "needRender", "flagEmpty", "tbody", "resolve", "response", "err", "event", "filters", "input", "name", "haveClasses", "sort", "stack", "itemA", "itemB", "a", "b", "valA", "valB", "reject", "base", "url", "params", "appendParamsToUrl", "sortedColumn", "thead", "tfoot", "td", "availableWidth", "colMaxWidth", "idx", "ce", "sampleTh", "totalWidth", "colIdx", "computedWidth", "getTextWidth", "w", "colAvailableWidth", "visibleCols", "lastCol", "scrollbarWidth", "diff", "hasClass", "actualWidth", "minWidth", "newWidth", "sortableRow", "relatedTh", "e", "i", "on", "ev", "toggleClass", "tv", "interpolate", "prev", "total", "p", "index", "high", "low", "getAttribute", "data_grid_default", "BasePlugin", "grid", "event", "base_plugin_default", "ColumnResizer", "base_plugin_default", "grid", "resizeLabel", "table", "cols", "findAll", "col", "hasClass", "resizer", "addClass", "startX", "startW", "remainingSpace", "max", "mouseMoveHandler", "e", "newWidth", "setAttribute", "mouseUpHandler", "removeClass", "off", "dispatch", "getAttribute", "on", "target", "visibleCols", "columnIndex", "column", "removeAttribute", "elementOffset", "j", "column_resizer_default", "getParentElement", "el", "type", "prop", "parent", "ContextMenu", "base_plugin_default", "off", "grid", "on", "e", "t", "field", "target", "getParentElement", "menu", "rect", "x", "y", "removeAttribute", "documentClickHandler", "setAttribute", "col", "li", "label", "checkbox", "text", "context_menu_default", "DraggableHeaders", "base_plugin_default", "th", "grid", "on", "e", "t", "target", "getParentElement", "index", "targetIndex", "offset", "tmp", "swapNodes", "selector", "el1", "rowIndex", "el2", "setAttribute", "newNode", "findAll", "c", "getAttribute", "dispatch", "draggable_headers_default", "TouchSupport", "base_plugin_default", "grid", "e", "xDiff", "yDiff", "touch_support_default", "SELECTABLE_CLASS", "SELECT_ALL_CLASS", "CHECKBOX_CLASS", "SelectableRows", "base_plugin_default", "key", "grid", "selectedData", "findAll", "checkbox", "idx", "item", "tbody", "input", "tr", "th", "setAttribute", "label", "td", "selectOne", "e", "hasClass", "visibleOnly", "cb", "dispatch", "totalCheckboxes", "totalChecked", "n", "selectable_rows_default", "FixedHeight", "base_plugin_default", "grid", "tbody", "tr", "setAttribute", "fakeRow", "max", "visibleRows", "fakeHeight", "fixed_height_default", "AutosizeColumn", "base_plugin_default", "th", "column", "min", "max", "grid", "hasAttribute", "getAttribute", "firstVal", "lastVal", "v", "v2", "width", "getTextWidth", "setAttribute", "autosize_column_default", "debounce", "handler", "timeout", "timer", "args", "RESPONSIVE_CLASS", "obsTo", "sortByPriority", "list", "a", "b", "v1", "callback", "debounce", "entries", "entry", "grid", "table", "contentBoxSize", "size", "tableWidth", "realTableWidth", "findAll", "result", "th", "diff", "minWidth", "prevAction", "headerCols", "col", "changed", "remaining", "cols", "colWidth", "field", "requiredWidth", "width", "footer", "find", "realFooterWidth", "div", "availableFooterWidth", "addClass", "removeClass", "resizeObserver", "ResponsiveGrid", "base_plugin_default", "flag", "tr", "ce", "setAttribute", "td", "idealWidth", "consideredCol", "hCol", "ev", "open", "close", "hasClass", "childRow", "insertAfter", "childRowTd", "childTable", "hiddenCols", "childTableRow", "label", "labelCol", "removeAttribute", "responsive_grid_default", "RowActions", "base_plugin_default", "tr", "actionsTh", "setAttribute", "item", "labels", "td", "actionsToggle", "on", "ev", "action", "button", "interpolate", "actionHandler", "dispatch", "row_actions_default", "EditableColumn", "base_plugin_default", "td", "column", "item", "i", "gridId", "input", "ev", "key", "dispatch", "editable_column_default", "data_grid_default", "column_resizer_default", "context_menu_default", "draggable_headers_default", "touch_support_default", "selectable_rows_default", "fixed_height_default", "autosize_column_default", "responsive_grid_default", "row_actions_default", "editable_column_default"] }