@mapsindoors/map-template 1.95.1 → 1.95.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/{GoogleMapsMap-C5n6Bgtp.mjs → GoogleMapsMap-Dkn60-_e.mjs} +2 -2
  2. package/dist/{MapboxMap-UCqzt1AC.mjs → MapboxMap-B1oo7IUm.mjs} +2 -2
  3. package/dist/_commonjsHelpers-B85MJLTf.js +5 -0
  4. package/dist/app-globals-DQuL1Twl.js +3 -0
  5. package/dist/combo-box-item.entry.js +8 -10
  6. package/dist/icon-DT_sDkmK.js +11 -0
  7. package/dist/index-BZQHyS7V.js +1701 -0
  8. package/dist/loader.js +7 -14
  9. package/dist/mapsindoors-react.es.js +1 -1
  10. package/dist/mapsindoors-react.umd.js +175 -175
  11. package/dist/mapsindoors-webcomponent.es.js +2916 -2904
  12. package/dist/mi-card_2.entry.js +23 -18
  13. package/dist/mi-chip.entry.js +25 -16
  14. package/dist/mi-column.entry.js +47 -23
  15. package/dist/mi-combo-box.entry.js +412 -379
  16. package/dist/mi-components.js +15 -12
  17. package/dist/mi-data-table.entry.js +300 -278
  18. package/dist/mi-distance_2.entry.js +58 -56
  19. package/dist/mi-dropdown-item.entry.js +8 -10
  20. package/dist/mi-dropdown.entry.js +527 -481
  21. package/dist/mi-floor-selector.entry.js +187 -180
  22. package/dist/mi-keyboard.entry.js +209 -186
  23. package/dist/mi-list-item-category.entry.js +44 -41
  24. package/dist/mi-list-item-location.entry.js +168 -162
  25. package/dist/mi-list.entry.js +60 -48
  26. package/dist/mi-location-booking.entry.js +320 -295
  27. package/dist/mi-location-info.entry.js +61 -53
  28. package/dist/mi-map-googlemaps.entry.js +369 -324
  29. package/dist/mi-map-mapbox.entry.js +502 -439
  30. package/dist/mi-metric-card.entry.js +50 -37
  31. package/dist/mi-my-position.entry.js +2345 -874
  32. package/dist/mi-notification.entry.js +112 -102
  33. package/dist/mi-route-instructions-heading.entry.js +70 -65
  34. package/dist/mi-route-instructions-maneuver-legacy.entry.js +80 -76
  35. package/dist/mi-route-instructions-maneuver.entry.js +80 -76
  36. package/dist/mi-route-instructions-step-legacy.entry.js +296 -282
  37. package/dist/mi-route-instructions-step.entry.js +313 -292
  38. package/dist/mi-route-instructions.entry.js +169 -150
  39. package/dist/mi-scroll-buttons.entry.js +106 -98
  40. package/dist/mi-search.entry.js +378 -325
  41. package/dist/mi-share-sms.entry.js +84 -70
  42. package/dist/mi-step-switcher.entry.js +34 -25
  43. package/dist/mi-tab-panel.entry.js +18 -18
  44. package/dist/mi-tab.entry.js +5 -7
  45. package/dist/mi-tabs.entry.js +42 -40
  46. package/dist/mi-time.entry.js +49 -49
  47. package/dist/mi-variables-CDNvnTkH.js +5 -0
  48. package/dist/{reactcomponent-DQsjxRIN.mjs → reactcomponent-2Oa1vSiK.mjs} +8996 -8660
  49. package/dist/route-travel-mode.enum-BvqP1fpw.js +9 -0
  50. package/dist/sort-order.enum-jsLAbYWg.js +566 -0
  51. package/dist/{unit-system.enum-eaefb53e.js → unit-system.enum-BwPgAWqL.js} +2 -2
  52. package/dist/utils-DNHzysQ6.js +61 -0
  53. package/package.json +1 -1
  54. package/dist/_commonjsHelpers-ba3f0406.js +0 -21
  55. package/dist/icon-b8d01d6f.js +0 -24
  56. package/dist/index-7e9696f3.js +0 -1678
  57. package/dist/mi-variables-9a6c8d4d.js +0 -6
  58. package/dist/polyfills/core-js.js +0 -11
  59. package/dist/polyfills/css-shim.js +0 -1
  60. package/dist/polyfills/dom.js +0 -79
  61. package/dist/polyfills/es5-html-element.js +0 -1
  62. package/dist/polyfills/index.js +0 -34
  63. package/dist/polyfills/system.js +0 -6
  64. package/dist/route-travel-mode.enum-7f4ce9c7.js +0 -9
  65. package/dist/sort-order.enum-64ce8998.js +0 -552
  66. package/dist/utils-ae714467.js +0 -61
@@ -1,302 +1,324 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-7e9696f3.js';
2
- import { i as isNullOrUndefined, a as isNumber } from './utils-ae714467.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-BZQHyS7V.js';
2
+ import { i as isNullOrUndefined, a as isNumber } from './utils-DNHzysQ6.js';
3
3
 
4
- const dataTableCss = "a.mi-button{cursor:default}.mi-button{border-radius:4px;border-width:1px;border-style:solid;font-family:Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen, Ubuntu, Cantarell, \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-size:1rem;font-weight:500;padding-left:16px;padding-right:16px;padding-top:12px;padding-bottom:12px;display:inline-flex;align-items:center}.mi-button:disabled{opacity:0.48;cursor:not-allowed}.mi-button object{filter:invert(9%) sepia(13%) saturate(692%) hue-rotate(185deg) brightness(98%) contrast(91%);width:16px;height:16px}.mi-button--small{padding-left:12px;padding-right:12px;padding-top:8px;padding-bottom:8px;font-size:0.875rem;height:32px}.mi-button--small object{width:16px;height:16px}.mi-button--large{padding-left:16px;padding-right:16px;font-size:1.25rem}.mi-button--large object{width:20px;height:20px}.mi-button--full-width{width:100%;justify-content:center}.mi-button--icon-left{padding-left:12px}.mi-button--icon-left object{margin-right:8px}.mi-button--icon-right{padding-right:12px}.mi-button--icon-right object{margin-left:8px}.mi-button--icon-both{padding-top:12px;padding-bottom:12px}.mi-button--icon-both object:first-of-type{margin-right:8px}.mi-button--icon-both object:last-of-type{margin-left:8px}.mi-button--base{background:linear-gradient(#f5f7fa, #ebeff5);color:#1e2025;border-color:#c8d0e0}.mi-button--base:not(:disabled):hover{background:linear-gradient(#ebeff5, #dee3ed);border-color:#aeb9cb}.mi-button--base:not(:disabled):active{background:linear-gradient(#dee3ed, #ebeff5)}.mi-button--primary{color:#ffffff;border-color:#20693e;background:linear-gradient(#3ba064, #2a844e)}.mi-button--primary object{filter:invert(100%) sepia(93%) saturate(0%) hue-rotate(201deg) brightness(106%) contrast(106%)}.mi-button--primary:not(:disabled):hover{background:linear-gradient(#2a844e, #20693e)}.mi-button--primary:not(:disabled):active{background:linear-gradient(#20693e, #2a844e)}.mi-button--delete{background:linear-gradient(#f55151, #de1b1b);color:#ffffff;border-color:#ba0d0d}.mi-button--delete object{filter:invert(100%) sepia(93%) saturate(0%) hue-rotate(201deg) brightness(106%) contrast(106%)}.mi-button--delete:not(:disabled):hover{background:linear-gradient(#de1b1b, #ba0d0d)}.mi-button--delete:not(:disabled):active{background:linear-gradient(#ba0d0d, #de1b1b)}.mi-button--outline{color:#3071d9;border-color:#3071d9;background-color:transparent}.mi-button--outline object{filter:invert(38%) sepia(97%) saturate(742%) hue-rotate(188deg) brightness(86%) contrast(97%)}.mi-button--outline:not(:disabled):hover{color:#1d5bbf;border-color:#1d5bbf;background-color:#eef4fc}.mi-button--outline:not(:disabled):active{color:#1d5bbf;border-color:#1d5bbf;background-color:#cfe0fc}.mi-button--link{color:#3071d9;border-style:none;background-color:transparent;cursor:pointer}.mi-button--link object{filter:invert(38%) sepia(97%) saturate(742%) hue-rotate(188deg) brightness(86%) contrast(97%)}.mi-button--link:not(:disabled):hover{color:#1d5bbf;border-color:#1d5bbf;background-color:#eef4fc}.mi-button--link:disabled:hover{cursor:not-allowed}.mi-button--link:not(:disabled):active{color:#1d5bbf;border-color:#1d5bbf;background-color:#cfe0fc}.mi-input[type=text],.mi-input[type=search],.mi-input[type=number],.mi-input[type=password],.mi-input[type=tel]{font-size:1rem;padding:8px;border-style:solid;border-width:1px;border-color:#8d98aa;border-radius:4px}.mi-input[type=text],.mi-input[type=search],.mi-input[type=number],.mi-input[type=password],.mi-input[type=range],.mi-input[type=tel]{display:block}.mi-input[type=radio],.mi-input[type=checkbox]{margin:0px;transform:scale(1.2, 1.2)}.mi-input[type=search]{padding-left:32px;background:url(\"data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 24 22' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.6267 8.43836C14.6267 11.8561 11.8561 14.6267 8.43836 14.6267C5.02062 14.6267 2.25 11.8561 2.25 8.43836C2.25 5.02062 5.02062 2.25 8.43836 2.25C11.8561 2.25 14.6267 5.02062 14.6267 8.43836Z' stroke='%23aeb9cb' stroke-width='2.5'/%3E%3Crect x='15.0979' y='14.1614' width='7.34678' height='1.32449' rx='0.662244' transform='rotate(45 15.0979 14.1614)' fill='%23aeb9cb' stroke='%23aeb9cb'/%3E%3Crect x='13.7847' y='13.2916' width='1.05276' height='0.697347' transform='rotate(45 13.7847 13.2916)' stroke='%23aeb9cb' stroke-width='0.697346'/%3E%3C/svg%3E%0A\") no-repeat scroll 8px center, white}.mi-input:disabled{opacity:0.48;cursor:not-allowed}.mi-select{display:block;padding-top:8px;padding-bottom:8px;padding-left:8px;padding-right:32px;border-radius:4px;border-width:1px;border-style:solid;border-color:#c8d0e0;color:#1e2025;font-size:1rem;font-weight:500;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:url(\"data:image/svg+xml;base64,PHN2ZyBmaWxsPScjNDQ0QjU1JyBoZWlnaHQ9JzI0JyB2aWV3Qm94PScwIDAgMjQgMjQnIHdpZHRoPScyNCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJz4KPHBhdGggZD0nTTcgMTBsNSA1IDUtNXonLz4KPHBhdGggZD0nTTAgMGgyNHYyNEgweicgZmlsbD0nbm9uZScvPgo8L3N2Zz4=\") 96%/24px no-repeat, linear-gradient(#f5f7fa, #ebeff5)}.mi-select:disabled{opacity:0.48;cursor:not-allowed}.mi-select:not(:disabled):hover{background:url(\"data:image/svg+xml;base64,PHN2ZyBmaWxsPScjNDQ0QjU1JyBoZWlnaHQ9JzI0JyB2aWV3Qm94PScwIDAgMjQgMjQnIHdpZHRoPScyNCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJz4KPHBhdGggZD0nTTcgMTBsNSA1IDUtNXonLz4KPHBhdGggZD0nTTAgMGgyNHYyNEgweicgZmlsbD0nbm9uZScvPgo8L3N2Zz4=\") 96%/24px no-repeat, linear-gradient(#ebeff5, #dee3ed);border-color:#aeb9cb}.mi-select:not(:disabled):active{background:url(\"data:image/svg+xml;base64,PHN2ZyBmaWxsPScjNDQ0QjU1JyBoZWlnaHQ9JzI0JyB2aWV3Qm94PScwIDAgMjQgMjQnIHdpZHRoPScyNCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJz4KPHBhdGggZD0nTTcgMTBsNSA1IDUtNXonLz4KPHBhdGggZD0nTTAgMGgyNHYyNEgweicgZmlsbD0nbm9uZScvPgo8L3N2Zz4=\") 96%/24px no-repeat, linear-gradient(#dee3ed, #ebeff5)}.mi-toggle{margin:0}.mi-toggle:disabled{cursor:not-allowed}.mi-toggle+.mi-label{margin-left:8px}@supports (appearance: none) or (-moz-appearance: none) or (-webkit-appearance: none){.mi-toggle{padding:2px;box-sizing:border-box;appearance:none;-moz-appearance:none;-webkit-appearance:none;width:48px;height:24px;border-radius:9999px;background-color:#8d98aa;transition:background-color 300ms ease}.mi-toggle:disabled{opacity:0.48}.mi-toggle:checked{background-color:#2a844e}.mi-toggle::after{content:\"\";display:inline-block;width:20px;height:20px;transform:translateX(0px);border-radius:50%;background-color:#fcfcfc;box-shadow:0 1px 1px rgba(0, 0, 0, 0.125), 0 2px 2px rgba(0, 0, 0, 0.125);transition:300ms ease}.mi-toggle:checked::after{transform:translateX(24px)}}.width-none{width:0}.width-xxx-small{width:2px}.width-xx-small{width:4px}.width-x-small{width:8px}.width-small{width:12px}.width-medium{width:16px}.width-large{width:24px}.width-x-large{width:32px}.width-xx-large{width:40px}.width-xxx-large{width:48px}.width-xxxx-large{width:64px}.min-width-none{min-width:0}.min-width-xxx-small{min-width:2px}.min-width-xx-small{min-width:4px}.min-width-x-small{min-width:8px}.min-width-small{min-width:12px}.min-width-medium{min-width:16px}.min-width-large{min-width:24px}.min-width-x-large{min-width:32px}.min-width-xx-large{min-width:40px}.min-width-xxx-large{min-width:48px}.min-width-xxxx-large{min-width:64px}.max-width-none{max-width:0}.max-width-xxx-small{max-width:2px}.max-width-xx-small{max-width:4px}.max-width-x-small{max-width:8px}.max-width-small{max-width:12px}.max-width-medium{max-width:16px}.max-width-large{max-width:24px}.max-width-x-large{max-width:32px}.max-width-xx-large{max-width:40px}.max-width-xxx-large{max-width:48px}.max-width-xxxx-large{max-width:64px}.height-none{height:0}.height-xxx-small{height:2px}.height-xx-small{height:4px}.height-x-small{height:8px}.height-small{height:12px}.height-medium{height:16px}.height-large{height:24px}.height-x-large{height:32px}.height-xx-large{height:40px}.height-xxx-large{height:48px}.height-xxxx-large{height:64px}.min-height-none{min-height:0}.min-height-xxx-small{min-height:2px}.min-height-xx-small{min-height:4px}.min-height-x-small{min-height:8px}.min-height-small{min-height:12px}.min-height-medium{min-height:16px}.min-height-large{min-height:24px}.min-height-x-large{min-height:32px}.min-height-xx-large{min-height:40px}.min-height-xxx-large{min-height:48px}.min-height-xxxx-large{min-height:64px}.max-height-none{max-height:0}.max-height-xxx-small{max-height:2px}.max-height-xx-small{max-height:4px}.max-height-x-small{max-height:8px}.max-height-small{max-height:12px}.max-height-medium{max-height:16px}.max-height-large{max-height:24px}.max-height-x-large{max-height:32px}.max-height-xx-large{max-height:40px}.max-height-xxx-large{max-height:48px}.max-height-xxxx-large{max-height:64px}.debug *{outline:1px solid gold}.flex{display:flex;flex:1}.inline-flex{display:inline-flex}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.display-block{display:block}.display-inline-block{display:inline-block}.display-inline{display:inline}.display-none{display:none}.text-decoration-none{text-decoration:none}.text-right{text-align:right}.text-left{text-align:left}.text-center{text-align:center}.margin-auto{margin-left:auto;margin-right:auto}*{box-sizing:border-box}.table{width:100%;border-collapse:collapse;font-family:Figtree, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen, Ubuntu, Cantarell, \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";background-color:#ffffff;border-style:solid;border-width:1px;border-color:#d1d5db;border-top:none}.table__header-cell{position:relative;text-align:left;-webkit-user-select:none;-moz-user-select:none;user-select:none;min-width:48px;font-weight:500;font-size:1rem;line-height:1.25rem;color:#ffffff;background-color:#374151;padding-top:16px;padding-bottom:16px;padding-left:8px;padding-right:8px}.table__header-cell::before,.table__header-cell::after{content:\"\";display:block;position:absolute;right:16px;top:50%;border:7px solid transparent}.table__header-cell::before{border-bottom-color:#6b7280;margin-top:-15px}.table__header-cell::after{border-top-color:#6b7280;margin-top:3px}.table__header-cell.desc::after{border-top-color:#f9fafb}.table__header-cell.asc::before{border-bottom-color:#f9fafb}.table__header-cell--no-sort::before,.table__header-cell--no-sort::after{border:none}.table__header-cell:not(.table__header-cell--no-sort){padding-right:46px;cursor:pointer}.table__header-cell--fit-content{white-space:nowrap;width:1px}.table__header-cell--align-left{text-align:left}.table__header-cell--align-center{text-align:center}.table__header-cell--align-right{text-align:right}.table__header-cell--sticky{position:sticky;top:0;z-index:1}.table__row:nth-child(even):hover{background-color:#f3f4f6}.table__row:nth-child(odd){background-color:#f9fafb}.table__row:nth-child(odd):hover{background-color:#f3f4f6}.table__data{font-size:1rem;padding-left:8px;padding-right:8px;height:56px;border-right:1px solid #d1d5db}.table__data:last-child{border-right:none}.table__data--fit-content{white-space:nowrap;width:1px}.table__data--align-left{text-align:left}.table__data--align-center{text-align:center}.table__data--align-right{text-align:right}.table__data--monospace-font{font-family:Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, monospace}.empty-page{display:flex;align-items:center;flex-direction:column;margin-top:72px;height:345px}.empty-page>*{margin:0}.empty-page__header{font-size:2.25rem}.empty-page__subheader{margin-top:32px;font-size:1.5rem}";
4
+ const dataTableCss = () => `a.mi-button{cursor:default}.mi-button{border-radius:4px;border-width:1px;border-style:solid;font-family:Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1rem;font-weight:500;padding-left:16px;padding-right:16px;padding-top:12px;padding-bottom:12px;display:inline-flex;align-items:center}.mi-button:disabled{opacity:0.48;cursor:not-allowed}.mi-button object{filter:invert(9%) sepia(13%) saturate(692%) hue-rotate(185deg) brightness(98%) contrast(91%);width:16px;height:16px}.mi-button--small{padding-left:12px;padding-right:12px;padding-top:8px;padding-bottom:8px;font-size:0.875rem;height:32px}.mi-button--small object{width:16px;height:16px}.mi-button--large{padding-left:16px;padding-right:16px;font-size:1.25rem}.mi-button--large object{width:20px;height:20px}.mi-button--full-width{width:100%;justify-content:center}.mi-button--icon-left{padding-left:12px}.mi-button--icon-left object{margin-right:8px}.mi-button--icon-right{padding-right:12px}.mi-button--icon-right object{margin-left:8px}.mi-button--icon-both{padding-top:12px;padding-bottom:12px}.mi-button--icon-both object:first-of-type{margin-right:8px}.mi-button--icon-both object:last-of-type{margin-left:8px}.mi-button--base{background:linear-gradient(#f5f7fa, #ebeff5);color:#1e2025;border-color:#c8d0e0}.mi-button--base:not(:disabled):hover{background:linear-gradient(#ebeff5, #dee3ed);border-color:#aeb9cb}.mi-button--base:not(:disabled):active{background:linear-gradient(#dee3ed, #ebeff5)}.mi-button--primary{color:#ffffff;border-color:#20693e;background:linear-gradient(#3ba064, #2a844e)}.mi-button--primary object{filter:invert(100%) sepia(93%) saturate(0%) hue-rotate(201deg) brightness(106%) contrast(106%)}.mi-button--primary:not(:disabled):hover{background:linear-gradient(#2a844e, #20693e)}.mi-button--primary:not(:disabled):active{background:linear-gradient(#20693e, #2a844e)}.mi-button--delete{background:linear-gradient(#f55151, #de1b1b);color:#ffffff;border-color:#ba0d0d}.mi-button--delete object{filter:invert(100%) sepia(93%) saturate(0%) hue-rotate(201deg) brightness(106%) contrast(106%)}.mi-button--delete:not(:disabled):hover{background:linear-gradient(#de1b1b, #ba0d0d)}.mi-button--delete:not(:disabled):active{background:linear-gradient(#ba0d0d, #de1b1b)}.mi-button--outline{color:#3071d9;border-color:#3071d9;background-color:transparent}.mi-button--outline object{filter:invert(38%) sepia(97%) saturate(742%) hue-rotate(188deg) brightness(86%) contrast(97%)}.mi-button--outline:not(:disabled):hover{color:#1d5bbf;border-color:#1d5bbf;background-color:#eef4fc}.mi-button--outline:not(:disabled):active{color:#1d5bbf;border-color:#1d5bbf;background-color:#cfe0fc}.mi-button--link{color:#3071d9;border-style:none;background-color:transparent;cursor:pointer}.mi-button--link object{filter:invert(38%) sepia(97%) saturate(742%) hue-rotate(188deg) brightness(86%) contrast(97%)}.mi-button--link:not(:disabled):hover{color:#1d5bbf;border-color:#1d5bbf;background-color:#eef4fc}.mi-button--link:disabled:hover{cursor:not-allowed}.mi-button--link:not(:disabled):active{color:#1d5bbf;border-color:#1d5bbf;background-color:#cfe0fc}.mi-input[type=text],.mi-input[type=search],.mi-input[type=number],.mi-input[type=password],.mi-input[type=tel]{font-size:1rem;padding:8px;border-style:solid;border-width:1px;border-color:#8d98aa;border-radius:4px}.mi-input[type=text],.mi-input[type=search],.mi-input[type=number],.mi-input[type=password],.mi-input[type=range],.mi-input[type=tel]{display:block}.mi-input[type=radio],.mi-input[type=checkbox]{margin:0px;transform:scale(1.2, 1.2)}.mi-input[type=search]{padding-left:32px;background:url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 24 22' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.6267 8.43836C14.6267 11.8561 11.8561 14.6267 8.43836 14.6267C5.02062 14.6267 2.25 11.8561 2.25 8.43836C2.25 5.02062 5.02062 2.25 8.43836 2.25C11.8561 2.25 14.6267 5.02062 14.6267 8.43836Z' stroke='%23aeb9cb' stroke-width='2.5'/%3E%3Crect x='15.0979' y='14.1614' width='7.34678' height='1.32449' rx='0.662244' transform='rotate(45 15.0979 14.1614)' fill='%23aeb9cb' stroke='%23aeb9cb'/%3E%3Crect x='13.7847' y='13.2916' width='1.05276' height='0.697347' transform='rotate(45 13.7847 13.2916)' stroke='%23aeb9cb' stroke-width='0.697346'/%3E%3C/svg%3E%0A") no-repeat scroll 8px center, white}.mi-input:disabled{opacity:0.48;cursor:not-allowed}.mi-select{display:block;padding-top:8px;padding-bottom:8px;padding-left:8px;padding-right:32px;border-radius:4px;border-width:1px;border-style:solid;border-color:#c8d0e0;color:#1e2025;font-size:1rem;font-weight:500;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:url("data:image/svg+xml;base64,PHN2ZyBmaWxsPScjNDQ0QjU1JyBoZWlnaHQ9JzI0JyB2aWV3Qm94PScwIDAgMjQgMjQnIHdpZHRoPScyNCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJz4KPHBhdGggZD0nTTcgMTBsNSA1IDUtNXonLz4KPHBhdGggZD0nTTAgMGgyNHYyNEgweicgZmlsbD0nbm9uZScvPgo8L3N2Zz4=") 96%/24px no-repeat, linear-gradient(#f5f7fa, #ebeff5)}.mi-select:disabled{opacity:0.48;cursor:not-allowed}.mi-select:not(:disabled):hover{background:url("data:image/svg+xml;base64,PHN2ZyBmaWxsPScjNDQ0QjU1JyBoZWlnaHQ9JzI0JyB2aWV3Qm94PScwIDAgMjQgMjQnIHdpZHRoPScyNCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJz4KPHBhdGggZD0nTTcgMTBsNSA1IDUtNXonLz4KPHBhdGggZD0nTTAgMGgyNHYyNEgweicgZmlsbD0nbm9uZScvPgo8L3N2Zz4=") 96%/24px no-repeat, linear-gradient(#ebeff5, #dee3ed);border-color:#aeb9cb}.mi-select:not(:disabled):active{background:url("data:image/svg+xml;base64,PHN2ZyBmaWxsPScjNDQ0QjU1JyBoZWlnaHQ9JzI0JyB2aWV3Qm94PScwIDAgMjQgMjQnIHdpZHRoPScyNCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJz4KPHBhdGggZD0nTTcgMTBsNSA1IDUtNXonLz4KPHBhdGggZD0nTTAgMGgyNHYyNEgweicgZmlsbD0nbm9uZScvPgo8L3N2Zz4=") 96%/24px no-repeat, linear-gradient(#dee3ed, #ebeff5)}.mi-toggle{margin:0}.mi-toggle:disabled{cursor:not-allowed}.mi-toggle+.mi-label{margin-left:8px}@supports (appearance: none) or (-moz-appearance: none) or (-webkit-appearance: none){.mi-toggle{padding:2px;box-sizing:border-box;appearance:none;-moz-appearance:none;-webkit-appearance:none;width:48px;height:24px;border-radius:9999px;background-color:#8d98aa;transition:background-color 300ms ease}.mi-toggle:disabled{opacity:0.48}.mi-toggle:checked{background-color:#2a844e}.mi-toggle::after{content:"";display:inline-block;width:20px;height:20px;transform:translateX(0px);border-radius:50%;background-color:#fcfcfc;box-shadow:0 1px 1px rgba(0, 0, 0, 0.125), 0 2px 2px rgba(0, 0, 0, 0.125);transition:300ms ease}.mi-toggle:checked::after{transform:translateX(24px)}}.width-none{width:0}.width-xxx-small{width:2px}.width-xx-small{width:4px}.width-x-small{width:8px}.width-small{width:12px}.width-medium{width:16px}.width-large{width:24px}.width-x-large{width:32px}.width-xx-large{width:40px}.width-xxx-large{width:48px}.width-xxxx-large{width:64px}.min-width-none{min-width:0}.min-width-xxx-small{min-width:2px}.min-width-xx-small{min-width:4px}.min-width-x-small{min-width:8px}.min-width-small{min-width:12px}.min-width-medium{min-width:16px}.min-width-large{min-width:24px}.min-width-x-large{min-width:32px}.min-width-xx-large{min-width:40px}.min-width-xxx-large{min-width:48px}.min-width-xxxx-large{min-width:64px}.max-width-none{max-width:0}.max-width-xxx-small{max-width:2px}.max-width-xx-small{max-width:4px}.max-width-x-small{max-width:8px}.max-width-small{max-width:12px}.max-width-medium{max-width:16px}.max-width-large{max-width:24px}.max-width-x-large{max-width:32px}.max-width-xx-large{max-width:40px}.max-width-xxx-large{max-width:48px}.max-width-xxxx-large{max-width:64px}.height-none{height:0}.height-xxx-small{height:2px}.height-xx-small{height:4px}.height-x-small{height:8px}.height-small{height:12px}.height-medium{height:16px}.height-large{height:24px}.height-x-large{height:32px}.height-xx-large{height:40px}.height-xxx-large{height:48px}.height-xxxx-large{height:64px}.min-height-none{min-height:0}.min-height-xxx-small{min-height:2px}.min-height-xx-small{min-height:4px}.min-height-x-small{min-height:8px}.min-height-small{min-height:12px}.min-height-medium{min-height:16px}.min-height-large{min-height:24px}.min-height-x-large{min-height:32px}.min-height-xx-large{min-height:40px}.min-height-xxx-large{min-height:48px}.min-height-xxxx-large{min-height:64px}.max-height-none{max-height:0}.max-height-xxx-small{max-height:2px}.max-height-xx-small{max-height:4px}.max-height-x-small{max-height:8px}.max-height-small{max-height:12px}.max-height-medium{max-height:16px}.max-height-large{max-height:24px}.max-height-x-large{max-height:32px}.max-height-xx-large{max-height:40px}.max-height-xxx-large{max-height:48px}.max-height-xxxx-large{max-height:64px}.debug *{outline:1px solid gold}.flex{display:flex;flex:1}.inline-flex{display:inline-flex}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.display-block{display:block}.display-inline-block{display:inline-block}.display-inline{display:inline}.display-none{display:none}.text-decoration-none{text-decoration:none}.text-right{text-align:right}.text-left{text-align:left}.text-center{text-align:center}.margin-auto{margin-left:auto;margin-right:auto}*{box-sizing:border-box}.table{width:100%;border-collapse:collapse;font-family:Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";background-color:#ffffff;border-style:solid;border-width:1px;border-color:#d1d5db;border-top:none}.table__header-cell{position:relative;text-align:left;-webkit-user-select:none;-moz-user-select:none;user-select:none;min-width:48px;font-weight:500;font-size:1rem;line-height:1.25rem;color:#ffffff;background-color:#374151;padding-top:16px;padding-bottom:16px;padding-left:8px;padding-right:8px}.table__header-cell::before,.table__header-cell::after{content:"";display:block;position:absolute;right:16px;top:50%;border:7px solid transparent}.table__header-cell::before{border-bottom-color:#6b7280;margin-top:-15px}.table__header-cell::after{border-top-color:#6b7280;margin-top:3px}.table__header-cell.desc::after{border-top-color:#f9fafb}.table__header-cell.asc::before{border-bottom-color:#f9fafb}.table__header-cell--no-sort::before,.table__header-cell--no-sort::after{border:none}.table__header-cell:not(.table__header-cell--no-sort){padding-right:46px;cursor:pointer}.table__header-cell--fit-content{white-space:nowrap;width:1px}.table__header-cell--align-left{text-align:left}.table__header-cell--align-center{text-align:center}.table__header-cell--align-right{text-align:right}.table__header-cell--sticky{position:sticky;top:0;z-index:1}.table__row:nth-child(even):hover{background-color:#f3f4f6}.table__row:nth-child(odd){background-color:#f9fafb}.table__row:nth-child(odd):hover{background-color:#f3f4f6}.table__data{font-size:1rem;padding-left:8px;padding-right:8px;height:56px;border-right:1px solid #d1d5db}.table__data:last-child{border-right:none}.table__data--fit-content{white-space:nowrap;width:1px}.table__data--align-left{text-align:left}.table__data--align-center{text-align:center}.table__data--align-right{text-align:right}.table__data--monospace-font{font-family:Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, monospace}.empty-page{display:flex;align-items:center;flex-direction:column;margin-top:72px;height:345px}.empty-page>*{margin:0}.empty-page__header{font-size:2.25rem}.empty-page__subheader{margin-top:32px;font-size:1.5rem}`;
5
5
 
6
6
  const DataTable = class {
7
- constructor(hostRef) {
8
- registerInstance(this, hostRef);
9
- this.selectionChanged = createEvent(this, "selectionChanged", 7);
10
- this.columns = [];
11
- this.numberOfSelectedRows = undefined;
12
- this.rows = [];
13
- this.maxRows = undefined;
14
- this.page = undefined;
15
- this.selectable = false;
16
- this.selected = new Set();
17
- this.emptyPageHeader = 'No results found';
18
- this.emptyPageSubheader = undefined;
19
- this.isHeaderSticky = true;
20
- this.tableRows = [];
21
- this.currentPage = 1;
22
- this.sortByColumn = null;
23
- }
24
- onSelectionChangedHandler() {
25
- this.selectionChanged.emit(this.selected);
26
- }
27
- /**
28
- * When the rows is set from outside of the components the table sorting is reset and the rows are assigned to the internal tabelRows property.
29
- */
30
- onRowsChangedHandler() {
31
- this.tableRows = Array.from(this.rows);
32
- this.setHeaderCheckboxState();
33
- }
34
- /**
35
- * When the page is set from outside of the components the table needs to show the newly specified page of rows.
36
- */
37
- onPageChangedHandler() {
38
- this.currentPage = this.page;
39
- this.renderTableContent();
40
- }
41
- connectedCallback() {
42
- const miColumns = this.el.querySelectorAll('mi-column');
43
- this.columns = Array.from(miColumns).map((miColumn) => {
44
- const column = {
45
- alignContent: miColumn.alignContent,
46
- monospace: miColumn.monospace,
47
- label: !isNullOrUndefined(miColumn.label) ? miColumn.label : miColumn.binding,
48
- binding: miColumn.binding || null,
49
- sortable: miColumn.sortable,
50
- fitContent: !!miColumn.fitContent,
51
- /* All HTML comments are removed from the template to avoid the issues with the table not displaying any data in IE11 */
52
- template: miColumn.innerHTML.replace(/<!--[\s\S]*?-->/g, ''),
53
- columnElement: miColumn,
54
- width: miColumn.width
55
- };
56
- /* If the mi-column has the sort attribute, then the initial sort state is set. */
57
- if (miColumn.sort && !this.sortByColumn) {
58
- this.sortByColumn = { column: column, sortOrder: miColumn.sort === 'asc' ? 'asc' : 'desc' };
59
- }
60
- return column;
61
- });
62
- }
63
- /**
64
- * Column header click handler.
65
- * If the column is sortable the sort order is reversed.
66
- *
67
- * @private
68
- * @param {MouseEvent} event
69
- * @param {any} column
70
- */
71
- columnHeaderClickHandler(event, column) {
72
- var _a, _b;
73
- if (!isNullOrUndefined(column.sortable)) {
74
- let sortOrder = 'asc';
75
- if (column === ((_a = this.sortByColumn) === null || _a === void 0 ? void 0 : _a.column)) {
76
- // TODO: Use SortOrder enum in MICMS-1353
77
- sortOrder = ((_b = this.sortByColumn) === null || _b === void 0 ? void 0 : _b.sortOrder) === 'asc' ? 'desc' : 'asc';
78
- }
79
- /* When a column that is sortable is clicked then the sort state is updated. */
80
- this.sortByColumn = { column: column, sortOrder: sortOrder };
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ this.selectionChanged = createEvent(this, "selectionChanged", 7);
10
+ /**
11
+ * Array of objects for each row in the table.
12
+ */
13
+ this.rows = [];
14
+ /**
15
+ * The selectable attribute specifies whether the first column in the table should be checkboxes. The header will be a select all or none checkbox.
16
+ */
17
+ this.selectable = false;
18
+ /**
19
+ * The selected property contains a Set of all selected rows. This property is only relevant if the selectable attribute is present.
20
+ */
21
+ this.selected = new Set();
22
+ /**
23
+ * Guiding message when presented with a table that has no rows.
24
+ */
25
+ this.emptyPageHeader = 'No results found';
26
+ /**
27
+ * Whether or not the table header should be sticky.
28
+ */
29
+ this.isHeaderSticky = true;
30
+ this.tableRows = [];
31
+ this.currentPage = 1;
32
+ /**
33
+ * State to keep track of the table sorting.
34
+ */
35
+ this.sortByColumn = null;
36
+ this.columns = [];
81
37
  }
82
- }
83
- /**
84
- * Sorts table rows.
85
- *
86
- * @private
87
- * @return {Array<any>}
88
- */
89
- sortTableRows() {
90
- var _a, _b, _c;
91
- //Check if the table has any rows.
92
- if (this.tableRows.length > 0 && this.sortByColumn) {
93
- let sortMethod;
94
- const sortByColumn = (_a = this.sortByColumn) === null || _a === void 0 ? void 0 : _a.column;
95
- const sortOrder = (_b = this.sortByColumn) === null || _b === void 0 ? void 0 : _b.sortOrder;
96
- if (sortByColumn && sortOrder) {
97
- if (((_c = sortByColumn.sortable) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === 'date') {
98
- sortMethod = sortOrder === 'desc' ? dateDesc(sortByColumn.binding) : dateAsc(sortByColumn.binding);
38
+ onSelectionChangedHandler() {
39
+ this.selectionChanged.emit(this.selected);
40
+ }
41
+ /**
42
+ * When the rows is set from outside of the components the table sorting is reset and the rows are assigned to the internal tabelRows property.
43
+ */
44
+ onRowsChangedHandler() {
45
+ this.tableRows = Array.from(this.rows);
46
+ this.setHeaderCheckboxState();
47
+ }
48
+ /**
49
+ * When the page is set from outside of the components the table needs to show the newly specified page of rows.
50
+ */
51
+ onPageChangedHandler() {
52
+ this.currentPage = this.page;
53
+ this.renderTableContent();
54
+ }
55
+ connectedCallback() {
56
+ if (!this.rows)
57
+ return;
58
+ const miColumns = this.el.querySelectorAll('mi-column');
59
+ this.columns = Array.from(miColumns).map((miColumn) => {
60
+ const column = {
61
+ alignContent: miColumn.alignContent,
62
+ monospace: miColumn.monospace,
63
+ label: !isNullOrUndefined(miColumn.label) ? miColumn.label : miColumn.binding,
64
+ binding: miColumn.binding || null,
65
+ sortable: miColumn.sortable,
66
+ fitContent: !!miColumn.fitContent,
67
+ /* All HTML comments are removed from the template to avoid the issues with the table not displaying any data in IE11 */
68
+ template: miColumn.innerHTML.replace(/<!--[\s\S]*?-->/g, ''),
69
+ columnElement: miColumn,
70
+ width: miColumn.width
71
+ };
72
+ /* If the mi-column has the sort attribute, then the initial sort state is set. */
73
+ if (miColumn.sort && !this.sortByColumn) {
74
+ this.sortByColumn = { column: column, sortOrder: miColumn.sort === 'asc' ? 'asc' : 'desc' };
75
+ }
76
+ return column;
77
+ });
78
+ }
79
+ /**
80
+ * Column header click handler.
81
+ * If the column is sortable the sort order is reversed.
82
+ *
83
+ * @private
84
+ * @param {MouseEvent} event
85
+ * @param {any} column
86
+ */
87
+ columnHeaderClickHandler(event, column) {
88
+ var _a, _b;
89
+ if (!isNullOrUndefined(column.sortable)) {
90
+ let sortOrder = 'asc';
91
+ if (column === ((_a = this.sortByColumn) === null || _a === void 0 ? void 0 : _a.column)) {
92
+ // TODO: Use SortOrder enum in MICMS-1353
93
+ sortOrder = ((_b = this.sortByColumn) === null || _b === void 0 ? void 0 : _b.sortOrder) === 'asc' ? 'desc' : 'asc';
94
+ }
95
+ /* When a column that is sortable is clicked then the sort state is updated. */
96
+ this.sortByColumn = { column: column, sortOrder: sortOrder };
99
97
  }
100
- else {
101
- sortMethod = sortOrder === 'desc' ? desc(sortByColumn.binding) : asc(sortByColumn.binding);
98
+ }
99
+ /**
100
+ * Sorts table rows.
101
+ *
102
+ * @private
103
+ * @return {Array<any>}
104
+ */
105
+ sortTableRows() {
106
+ var _a, _b, _c;
107
+ //Check if the table has any rows.
108
+ if (this.tableRows.length > 0 && this.sortByColumn) {
109
+ let sortMethod;
110
+ const sortByColumn = (_a = this.sortByColumn) === null || _a === void 0 ? void 0 : _a.column;
111
+ const sortOrder = (_b = this.sortByColumn) === null || _b === void 0 ? void 0 : _b.sortOrder;
112
+ if (sortByColumn && sortOrder) {
113
+ if (((_c = sortByColumn.sortable) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === 'date') {
114
+ sortMethod = sortOrder === 'desc' ? dateDesc(sortByColumn.binding) : dateAsc(sortByColumn.binding);
115
+ }
116
+ else {
117
+ sortMethod = sortOrder === 'desc' ? desc(sortByColumn.binding) : asc(sortByColumn.binding);
118
+ }
119
+ return [...this.tableRows.sort(sortMethod)];
120
+ }
121
+ }
122
+ return this.tableRows;
123
+ }
124
+ /**
125
+ * Replace template variables (eg. "{id}") with the corresponding value from the data.
126
+ *
127
+ * @private
128
+ * @param {string} template
129
+ * @param {object} data
130
+ * @returns {string}
131
+ */
132
+ replaceVars(template, data) {
133
+ return template.replace(/\{(.*?)\}/g, (match, capture) => {
134
+ const path = capture.split('.');
135
+ // Traverse the input object until a given key is found.
136
+ return path.reduce((object, key) => {
137
+ return object ? object[key] : null;
138
+ }, data);
139
+ });
140
+ }
141
+ /**
142
+ * Remove boolean HTML attributes (eg. checked) that will have a false value based on data. This is necessary since
143
+ * the very presence of the attribute will give it a truthy value.
144
+ *
145
+ * @private
146
+ * @param {string} template
147
+ * @param {array} data
148
+ * @returns {string}
149
+ */
150
+ removeFalseBooleanAttributes(template, data) {
151
+ return template.replace(/ (checked|disabled|hidden|selected)="\{(.*?)\}"/, (match, attributeName, binding) => {
152
+ return data[binding] === false ? '' : attributeName;
153
+ });
154
+ }
155
+ /**
156
+ * React to clicks on table rows and emits the internal cellContentClicked event to
157
+ * the column component if clicked on content within a cell.
158
+ *
159
+ * @private
160
+ * @param {MouseEvent} event
161
+ * @param {any} tableRow
162
+ */
163
+ tableRowClicked(event, tableRow) {
164
+ var _a;
165
+ const element = event.target;
166
+ const cellIndex = element.closest('td').cellIndex;
167
+ const columnClickedIndex = this.selectable ? cellIndex - 1 : cellIndex;
168
+ if (element.tagName.toLowerCase() !== 'td' && this.columns[columnClickedIndex]) {
169
+ const eventPayload = { detail: tableRow };
170
+ (_a = this.columns[columnClickedIndex]) === null || _a === void 0 ? void 0 : _a.columnElement.dispatchEvent(new CustomEvent('cellContentClicked', eventPayload));
102
171
  }
103
- return [...this.tableRows.sort(sortMethod)];
104
- }
105
172
  }
106
- return this.tableRows;
107
- }
108
- /**
109
- * Replace template variables (eg. "{id}") with the corresponding value from the data.
110
- *
111
- * @private
112
- * @param {string} template
113
- * @param {object} data
114
- * @returns {string}
115
- */
116
- replaceVars(template, data) {
117
- return template.replace(/\{(.*?)\}/g, (match, capture) => {
118
- const path = capture.split('.');
119
- // Traverse the input object until a given key is found.
120
- return path.reduce((object, key) => {
121
- return object ? object[key] : null;
122
- }, data);
123
- });
124
- }
125
- /**
126
- * Remove boolean HTML attributes (eg. checked) that will have a false value based on data. This is necessary since
127
- * the very presence of the attribute will give it a truthy value.
128
- *
129
- * @private
130
- * @param {string} template
131
- * @param {array} data
132
- * @returns {string}
133
- */
134
- removeFalseBooleanAttributes(template, data) {
135
- return template.replace(/ (checked|disabled|hidden|selected)="\{(.*?)\}"/, (match, attributeName, binding) => {
136
- return data[binding] === false ? '' : attributeName;
137
- });
138
- }
139
- /**
140
- * React to clicks on table rows and emits the internal cellContentClicked event to
141
- * the column component if clicked on content within a cell.
142
- *
143
- * @private
144
- * @param {MouseEvent} event
145
- * @param {any} tableRow
146
- */
147
- tableRowClicked(event, tableRow) {
148
- var _a;
149
- const element = event.target;
150
- const cellIndex = element.closest('td').cellIndex;
151
- const columnClickedIndex = this.selectable ? cellIndex - 1 : cellIndex;
152
- if (element.tagName.toLowerCase() !== 'td' && this.columns[columnClickedIndex]) {
153
- const eventPayload = { detail: tableRow };
154
- (_a = this.columns[columnClickedIndex]) === null || _a === void 0 ? void 0 : _a.columnElement.dispatchEvent(new CustomEvent('cellContentClicked', eventPayload));
173
+ async componentWillLoad() {
174
+ if (this.rows.length > 0) {
175
+ this.tableRows = Array.from(this.rows);
176
+ }
177
+ }
178
+ render() {
179
+ return (h(Host, { key: 'fc96b149bc557f8d2ef6fd95bf89d2596e748bd3' }, h("table", { key: '9939b343c303eabb12b894487e7a2218d9f1cf7b', class: "table" }, h("thead", { key: '0198ecdcf36e13590187ca682a52f6216e0423c1' }, h("tr", { key: '1a6f6eb7c26b8d37b93c8189da6cf64360a32285' }, this.renderSelectHeader(), this.columns.map(column => {
180
+ var _a;
181
+ const width = !column.fitContent ? column.width || 'auto' : '';
182
+ const sortOrder = ((_a = this.sortByColumn) === null || _a === void 0 ? void 0 : _a.column) === column ? this.sortByColumn.sortOrder : null;
183
+ return h("th", { "data-binding": column.binding, style: { 'width': width, 'max-width': width, 'min-width': width }, onClick: (event) => this.columnHeaderClickHandler(event, column), class: `table__header-cell ${this.isHeaderSticky ? 'table__header-cell--sticky' : ''} ${isNullOrUndefined(column.sortable) ? 'table__header-cell--no-sort' : ''} ${isNullOrUndefined(sortOrder) ? '' : sortOrder} ${column.fitContent ? 'table__header-cell--fit-content' : ''}` }, column.label);
184
+ }))), h("tbody", { key: '5543ed9ff86b1f53220e1ec95b58b3131f1e3bbd' }, this.renderTableContent())), this.tableRows.length === 0 ? this.renderEmptyPage() : null));
155
185
  }
156
- }
157
- async componentWillLoad() {
158
- if (this.rows.length > 0) {
159
- this.tableRows = Array.from(this.rows);
186
+ /**
187
+ * If the table is selectable then renderSelectHeader will render the th element with the checkbox to check or uncheck all items in the table.
188
+ *
189
+ * @private
190
+ * @returns {JSX.Element}
191
+ */
192
+ renderSelectHeader() {
193
+ if (this.selectable) {
194
+ return (h("th", { class: `table__header-cell ${this.isHeaderSticky ? 'table__header-cell--sticky' : ''} table__header-cell--fit-content table__header-cell--no-sort table__header-cell--align-center` }, h("input", { type: "checkbox", class: "mi-input", ref: (el) => this.selectAllCheckbox = el, onChange: () => this.selectHeaderOnChangeHandler() })));
195
+ }
196
+ }
197
+ /**
198
+ * If the table is selectable then this method will render the td for each row in the item to select or unselect the row.
199
+ *
200
+ * @private
201
+ * @param {object} row
202
+ * @returns {JSX.Element}
203
+ */
204
+ renderSelectRow(row) {
205
+ if (this.selectable) {
206
+ return (h("td", { class: "table__data table__data--align-center" }, h("input", { class: "mi-input", type: "checkbox", checked: this.selected.has(row), onChange: event => this.selectOnChangeHandler(event, row) })));
207
+ }
160
208
  }
161
- }
162
- render() {
163
- return (h(Host, null, h("table", { class: "table" }, h("thead", null, h("tr", null, this.renderSelectHeader(), this.columns.map(column => {
164
- var _a;
165
- const width = !column.fitContent ? column.width || 'auto' : '';
166
- const sortOrder = ((_a = this.sortByColumn) === null || _a === void 0 ? void 0 : _a.column) === column ? this.sortByColumn.sortOrder : null;
167
- return h("th", { "data-binding": column.binding, style: { 'width': width, 'max-width': width, 'min-width': width }, onClick: (event) => this.columnHeaderClickHandler(event, column), class: `table__header-cell ${this.isHeaderSticky ? 'table__header-cell--sticky' : ''} ${isNullOrUndefined(column.sortable) ? 'table__header-cell--no-sort' : ''} ${isNullOrUndefined(sortOrder) ? '' : sortOrder} ${column.fitContent ? 'table__header-cell--fit-content' : ''}` }, column.label);
168
- }))), h("tbody", null, this.renderTableContent())), this.tableRows.length === 0 ? this.renderEmptyPage() : null));
169
- }
170
- /**
171
- * If the table is selectable then renderSelectHeader will render the th element with the checkbox to check or uncheck all items in the table.
172
- *
173
- * @private
174
- * @returns {JSX.Element}
175
- */
176
- renderSelectHeader() {
177
- if (this.selectable) {
178
- return (h("th", { class: `table__header-cell ${this.isHeaderSticky ? 'table__header-cell--sticky' : ''} table__header-cell--fit-content table__header-cell--no-sort table__header-cell--align-center` }, h("input", { type: "checkbox", class: "mi-input", ref: (el) => this.selectAllCheckbox = el, onChange: () => this.selectHeaderOnChangeHandler() })));
209
+ /**
210
+ * Helper method to render the tables content.
211
+ *
212
+ * @private
213
+ * @returns {[JSX.Element]}
214
+ */
215
+ renderTableContent() {
216
+ let tableRows = this.sortTableRows();
217
+ tableRows = isNumber(this.maxRows) && this.maxRows > 0 ?
218
+ tableRows.slice(this.maxRows * (this.currentPage - 1), this.maxRows * this.currentPage)
219
+ : tableRows;
220
+ return tableRows.map(row => this.renderTableRow(row));
179
221
  }
180
- }
181
- /**
182
- * If the table is selectable then this method will render the td for each row in the item to select or unselect the row.
183
- *
184
- * @private
185
- * @param {object} row
186
- * @returns {JSX.Element}
187
- */
188
- renderSelectRow(row) {
189
- if (this.selectable) {
190
- return (h("td", { class: "table__data table__data--align-center" }, h("input", { class: "mi-input", type: "checkbox", checked: this.selected.has(row), onChange: event => this.selectOnChangeHandler(event, row) })));
222
+ /**
223
+ * Helper method to render a table row.
224
+ *
225
+ * @private
226
+ * @param {*} tableRow
227
+ * @returns {JSX.Element}
228
+ */
229
+ renderTableRow(tableRow) {
230
+ const rowData = [];
231
+ for (const column of this.columns) {
232
+ let template = column.template;
233
+ if (template > '') {
234
+ template = this.removeFalseBooleanAttributes(template, tableRow);
235
+ template = this.replaceVars(template, tableRow);
236
+ rowData.push(template);
237
+ }
238
+ else {
239
+ rowData.push(tableRow[column.binding]);
240
+ }
241
+ }
242
+ return h("tr", { class: "table__row", onClick: e => this.tableRowClicked(e, tableRow) }, this.renderSelectRow(tableRow), rowData.map((cellContent, cellIndex) => h("td", { class: `table__data ${this.columns[cellIndex].fitContent ? 'table__data--fit-content' : ''} table__data--align-${this.columns[cellIndex].alignContent || 'left'} ${this.columns[cellIndex].monospace ? 'table__data--monospace-font' : ''}`, innerHTML: cellContent })));
191
243
  }
192
- }
193
- /**
194
- * Helper method to render the tables content.
195
- *
196
- * @private
197
- * @returns {[JSX.Element]}
198
- */
199
- renderTableContent() {
200
- let tableRows = this.sortTableRows();
201
- tableRows = isNumber(this.maxRows) && this.maxRows > 0 ?
202
- tableRows.slice(this.maxRows * (this.currentPage - 1), this.maxRows * this.currentPage)
203
- : tableRows;
204
- return tableRows.map(row => this.renderTableRow(row));
205
- }
206
- /**
207
- * Helper method to render a table row.
208
- *
209
- * @private
210
- * @param {*} tableRow
211
- * @returns {JSX.Element}
212
- */
213
- renderTableRow(tableRow) {
214
- const rowData = [];
215
- for (const column of this.columns) {
216
- let template = column.template;
217
- if (template > '') {
218
- template = this.removeFalseBooleanAttributes(template, tableRow);
219
- template = this.replaceVars(template, tableRow);
220
- rowData.push(template);
221
- }
222
- else {
223
- rowData.push(tableRow[column.binding]);
224
- }
244
+ /**
245
+ * Renders en empty page with error message when no table rows are available.
246
+ *
247
+ * @private
248
+ * @returns {JSX.Element}
249
+ */
250
+ renderEmptyPage() {
251
+ const emptyPage = (h("div", { class: "empty-page" }, h("p", { class: "empty-page__header" }, this.emptyPageHeader), h("p", { class: "empty-page__subheader" }, this.emptyPageSubheader)));
252
+ return emptyPage;
225
253
  }
226
- return h("tr", { class: "table__row", onClick: e => this.tableRowClicked(e, tableRow) }, this.renderSelectRow(tableRow), rowData.map((cellContent, cellIndex) => h("td", { class: `table__data ${this.columns[cellIndex].fitContent ? 'table__data--fit-content' : ''} table__data--align-${this.columns[cellIndex].alignContent || 'left'} ${this.columns[cellIndex].monospace ? 'table__data--monospace-font' : ''}`, innerHTML: cellContent })));
227
- }
228
- /**
229
- * Renders en empty page with error message when no table rows are available.
230
- *
231
- * @private
232
- * @returns {JSX.Element}
233
- */
234
- renderEmptyPage() {
235
- const emptyPage = (h("div", { class: "empty-page" }, h("p", { class: "empty-page__header" }, this.emptyPageHeader), h("p", { class: "empty-page__subheader" }, this.emptyPageSubheader)));
236
- return emptyPage;
237
- }
238
- /**
239
- * The event handler for the onchange event for the checkboxes in the selectable column.
240
- *
241
- * @private
242
- * @param {EventData} event
243
- * @param {object} row
244
- */
245
- selectOnChangeHandler(event, row) {
246
- event.target.checked ? this.selected.add(row) : this.selected.delete(row);
247
- this.setHeaderCheckboxState();
248
- //The selectedRows is updated to force a rerendering of the table with the correct state.
249
- this.numberOfSelectedRows = this.selected.size;
250
- event.stopPropagation();
251
- }
252
- /**
253
- * Set the state of the checkbox in the table header.
254
- * The state can be either checked, unchecked or indeterminate.
255
- */
256
- setHeaderCheckboxState() {
257
- if (this.selectAllCheckbox && this.selectable) {
258
- this.selectAllCheckbox.checked = this.selected.size === this.rows.length;
259
- this.selectAllCheckbox.indeterminate = this.selected.size > 0 && this.selected.size < this.rows.length;
254
+ /**
255
+ * The event handler for the onchange event for the checkboxes in the selectable column.
256
+ *
257
+ * @private
258
+ * @param {EventData} event
259
+ * @param {object} row
260
+ */
261
+ selectOnChangeHandler(event, row) {
262
+ event.target.checked ? this.selected.add(row) : this.selected.delete(row);
263
+ this.setHeaderCheckboxState();
264
+ //The selectedRows is updated to force a rerendering of the table with the correct state.
265
+ this.numberOfSelectedRows = this.selected.size;
266
+ event.stopPropagation();
260
267
  }
261
- }
262
- /**
263
- * The event handler for the onchange event for the checkbox in the selectable column header.
264
- *
265
- * @private
266
- * @param {EventData} event
267
- */
268
- selectHeaderOnChangeHandler() {
269
- if (this.selected.size > 0 && this.selected.size <= this.rows.length) {
270
- this.selected.clear();
271
- this.selectAllCheckbox.checked = false;
268
+ /**
269
+ * Set the state of the checkbox in the table header.
270
+ * The state can be either checked, unchecked or indeterminate.
271
+ */
272
+ setHeaderCheckboxState() {
273
+ if (this.selectAllCheckbox && this.selectable) {
274
+ this.selectAllCheckbox.checked = this.selected.size === this.rows.length;
275
+ this.selectAllCheckbox.indeterminate = this.selected.size > 0 && this.selected.size < this.rows.length;
276
+ }
272
277
  }
273
- else {
274
- this.rows.forEach(row => this.selected.add(row));
275
- this.selectAllCheckbox.checked = true;
278
+ /**
279
+ * The event handler for the onchange event for the checkbox in the selectable column header.
280
+ *
281
+ * @private
282
+ * @param {EventData} event
283
+ */
284
+ selectHeaderOnChangeHandler() {
285
+ if (this.selected.size > 0 && this.selected.size <= this.rows.length) {
286
+ this.selected.clear();
287
+ this.selectAllCheckbox.checked = false;
288
+ }
289
+ else {
290
+ this.rows.forEach(row => this.selected.add(row));
291
+ this.selectAllCheckbox.checked = true;
292
+ }
293
+ this.numberOfSelectedRows = this.selected.size;
276
294
  }
277
- this.numberOfSelectedRows = this.selected.size;
278
- }
279
- get el() { return getElement(this); }
280
- static get watchers() { return {
281
- "numberOfSelectedRows": ["onSelectionChangedHandler"],
282
- "rows": ["onRowsChangedHandler"],
283
- "page": ["onPageChangedHandler"]
284
- }; }
295
+ get el() { return getElement(this); }
296
+ static get watchers() { return {
297
+ "numberOfSelectedRows": [{
298
+ "onSelectionChangedHandler": 0
299
+ }],
300
+ "rows": [{
301
+ "onRowsChangedHandler": 0
302
+ }],
303
+ "page": [{
304
+ "onPageChangedHandler": 0
305
+ }]
306
+ }; }
285
307
  };
286
308
  const asc = (value) => (a, b) => `${a[value] || ''}`
287
- .localeCompare(`${(b[value] || '')}`.trimStart().toLowerCase(), undefined, { numeric: true });
309
+ .localeCompare(`${(b[value] || '')}`.trimStart().toLowerCase(), undefined, { numeric: true });
288
310
  const desc = (value) => (a, b) => `${b[value] || ''}`
289
- .localeCompare(`${(a[value] || '')}`.trimStart().toLowerCase(), undefined, { numeric: true });
311
+ .localeCompare(`${(a[value] || '')}`.trimStart().toLowerCase(), undefined, { numeric: true });
290
312
  const dateAsc = (value) => (a, b) => {
291
- const aAsDate = Date.parse(a[value]);
292
- const bAsDate = Date.parse(b[value]);
293
- return aAsDate > bAsDate ? 1 : aAsDate < bAsDate ? -1 : 0;
313
+ const aAsDate = Date.parse(a[value]);
314
+ const bAsDate = Date.parse(b[value]);
315
+ return aAsDate > bAsDate ? 1 : aAsDate < bAsDate ? -1 : 0;
294
316
  };
295
317
  const dateDesc = (value) => (b, a) => {
296
- const aAsDate = Date.parse(a[value]);
297
- const bAsDate = Date.parse(b[value]);
298
- return aAsDate > bAsDate ? 1 : aAsDate < bAsDate ? -1 : 0;
318
+ const aAsDate = Date.parse(a[value]);
319
+ const bAsDate = Date.parse(b[value]);
320
+ return aAsDate > bAsDate ? 1 : aAsDate < bAsDate ? -1 : 0;
299
321
  };
300
- DataTable.style = dataTableCss;
322
+ DataTable.style = dataTableCss();
301
323
 
302
324
  export { DataTable as mi_data_table };