@oiz/stzh-components 2.9.0-alpha → 2.9.0-beta

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 (138) hide show
  1. package/dist/cjs/{app-globals-15ef98d9.js → app-globals-51c074d3.js} +39 -10
  2. package/dist/cjs/app-globals-51c074d3.js.map +1 -0
  3. package/dist/cjs/index.cjs.js.map +1 -1
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/stzh-components.cjs.js +2 -2
  6. package/dist/cjs/stzh-datatable.cjs.entry.js +83 -8
  7. package/dist/cjs/stzh-datatable.cjs.entry.js.map +1 -1
  8. package/dist/cjs/stzh-message.cjs.entry.js.map +1 -1
  9. package/dist/cjs/stzh-richtext_2.cjs.entry.js +1 -1
  10. package/dist/cjs/stzh-richtext_2.cjs.entry.js.map +1 -1
  11. package/dist/cjs/stzh-skin-portal-mitwirken.cjs.entry.js +1 -1
  12. package/dist/cjs/stzh-skin-portal-mitwirken.cjs.entry.js.map +1 -1
  13. package/dist/cjs/stzh-skin-storybook-preview.cjs.entry.js +1 -1
  14. package/dist/cjs/stzh-skin-storybook-preview.cjs.entry.js.map +1 -1
  15. package/dist/cjs/stzh-table.cjs.entry.js +1 -1
  16. package/dist/cjs/stzh-table.cjs.entry.js.map +1 -1
  17. package/dist/cjs/stzh-toastbar.cjs.entry.js +1 -1
  18. package/dist/cjs/stzh-toastbar.cjs.entry.js.map +1 -1
  19. package/dist/collection/components/stzh-datatable/stzh-datatable.css +6 -3
  20. package/dist/collection/components/stzh-datatable/stzh-datatable.js +241 -9
  21. package/dist/collection/components/stzh-datatable/stzh-datatable.js.map +1 -1
  22. package/dist/collection/components/stzh-datatable/stzh-datatable.stories.js +16 -5
  23. package/dist/collection/components/stzh-message/stzh-message.js.map +1 -1
  24. package/dist/collection/components/stzh-richtext/stzh-richtext.css +4 -0
  25. package/dist/collection/components/stzh-skin-portal-mitwirken/stzh-skin-portal-mitwirken.css +8 -0
  26. package/dist/collection/components/stzh-skin-storybook-preview/stzh-skin-storybook-preview.css +5 -0
  27. package/dist/collection/components/stzh-table/stzh-table.css +6 -3
  28. package/dist/collection/components/stzh-toastbar/stzh-toastbar.css +2 -3
  29. package/dist/collection/global/js/helpers/utils.js +37 -8
  30. package/dist/collection/index.js.map +1 -1
  31. package/dist/components/index.js +38 -9
  32. package/dist/components/index.js.map +1 -1
  33. package/dist/components/index2.js.map +1 -1
  34. package/dist/components/stzh-datatable.js +86 -9
  35. package/dist/components/stzh-datatable.js.map +1 -1
  36. package/dist/components/stzh-message.js.map +1 -1
  37. package/dist/components/stzh-richtext2.js +1 -1
  38. package/dist/components/stzh-richtext2.js.map +1 -1
  39. package/dist/components/stzh-skin-portal-mitwirken.js +1 -1
  40. package/dist/components/stzh-skin-portal-mitwirken.js.map +1 -1
  41. package/dist/components/stzh-skin-storybook-preview.js +1 -1
  42. package/dist/components/stzh-skin-storybook-preview.js.map +1 -1
  43. package/dist/components/stzh-table.js +1 -1
  44. package/dist/components/stzh-table.js.map +1 -1
  45. package/dist/components/stzh-toastbar.js +1 -1
  46. package/dist/components/stzh-toastbar.js.map +1 -1
  47. package/dist/esm/{app-globals-664fb15a.js → app-globals-b350c01d.js} +39 -10
  48. package/dist/esm/app-globals-b350c01d.js.map +1 -0
  49. package/dist/esm/index.js.map +1 -1
  50. package/dist/esm/loader.js +2 -2
  51. package/dist/esm/stzh-components.js +2 -2
  52. package/dist/esm/stzh-datatable.entry.js +84 -9
  53. package/dist/esm/stzh-datatable.entry.js.map +1 -1
  54. package/dist/esm/stzh-message.entry.js.map +1 -1
  55. package/dist/esm/stzh-richtext_2.entry.js +1 -1
  56. package/dist/esm/stzh-richtext_2.entry.js.map +1 -1
  57. package/dist/esm/stzh-skin-portal-mitwirken.entry.js +1 -1
  58. package/dist/esm/stzh-skin-portal-mitwirken.entry.js.map +1 -1
  59. package/dist/esm/stzh-skin-storybook-preview.entry.js +1 -1
  60. package/dist/esm/stzh-skin-storybook-preview.entry.js.map +1 -1
  61. package/dist/esm/stzh-table.entry.js +1 -1
  62. package/dist/esm/stzh-table.entry.js.map +1 -1
  63. package/dist/esm/stzh-toastbar.entry.js +1 -1
  64. package/dist/esm/stzh-toastbar.entry.js.map +1 -1
  65. package/dist/esm-es5/{app-globals-664fb15a.js → app-globals-b350c01d.js} +2 -2
  66. package/dist/esm-es5/{app-globals-664fb15a.js.map → app-globals-b350c01d.js.map} +1 -1
  67. package/dist/esm-es5/index.js.map +1 -1
  68. package/dist/esm-es5/loader.js +1 -1
  69. package/dist/esm-es5/loader.js.map +1 -1
  70. package/dist/esm-es5/stzh-components.js +1 -1
  71. package/dist/esm-es5/stzh-components.js.map +1 -1
  72. package/dist/esm-es5/stzh-datatable.entry.js +2 -2
  73. package/dist/esm-es5/stzh-datatable.entry.js.map +1 -1
  74. package/dist/esm-es5/stzh-message.entry.js.map +1 -1
  75. package/dist/esm-es5/stzh-richtext_2.entry.js +1 -1
  76. package/dist/esm-es5/stzh-richtext_2.entry.js.map +1 -1
  77. package/dist/esm-es5/stzh-skin-portal-mitwirken.entry.js +1 -1
  78. package/dist/esm-es5/stzh-skin-portal-mitwirken.entry.js.map +1 -1
  79. package/dist/esm-es5/stzh-skin-storybook-preview.entry.js +1 -1
  80. package/dist/esm-es5/stzh-skin-storybook-preview.entry.js.map +1 -1
  81. package/dist/esm-es5/stzh-table.entry.js +1 -1
  82. package/dist/esm-es5/stzh-table.entry.js.map +1 -1
  83. package/dist/esm-es5/stzh-toastbar.entry.js +1 -1
  84. package/dist/esm-es5/stzh-toastbar.entry.js.map +1 -1
  85. package/dist/stzh-components/index.esm.js.map +1 -1
  86. package/dist/stzh-components/{p-46a1ed5a.system.js → p-0e061116.system.js} +2 -2
  87. package/dist/stzh-components/{p-46a1ed5a.system.js.map → p-0e061116.system.js.map} +1 -1
  88. package/dist/stzh-components/{p-cb387de2.entry.js → p-128a4694.entry.js} +2 -2
  89. package/dist/stzh-components/{p-cb387de2.entry.js.map → p-128a4694.entry.js.map} +1 -1
  90. package/dist/stzh-components/p-2b394f69.entry.js +2 -0
  91. package/dist/stzh-components/{p-1dd43a6c.entry.js.map → p-2b394f69.entry.js.map} +1 -1
  92. package/dist/stzh-components/{p-819e80c9.entry.js → p-2df0f259.entry.js} +2 -2
  93. package/dist/stzh-components/{p-819e80c9.entry.js.map → p-2df0f259.entry.js.map} +1 -1
  94. package/dist/stzh-components/p-35ec50a1.system.js +2 -0
  95. package/dist/stzh-components/{p-851bbc2e.system.js.map → p-35ec50a1.system.js.map} +1 -1
  96. package/dist/stzh-components/p-45d0b549.entry.js +2 -0
  97. package/dist/stzh-components/{p-3d4553f7.entry.js.map → p-45d0b549.entry.js.map} +1 -1
  98. package/dist/stzh-components/p-61b0e7da.system.entry.js.map +1 -1
  99. package/dist/stzh-components/p-9ee80bcc.entry.js +10 -0
  100. package/dist/stzh-components/p-9ee80bcc.entry.js.map +1 -0
  101. package/dist/stzh-components/{p-0c52518d.system.entry.js → p-a2b700d2.system.entry.js} +2 -2
  102. package/dist/stzh-components/p-a2b700d2.system.entry.js.map +1 -0
  103. package/dist/stzh-components/p-a43b5c3d.entry.js +2 -0
  104. package/dist/stzh-components/p-a43b5c3d.entry.js.map +1 -0
  105. package/dist/stzh-components/{p-b4860ba4.js → p-ace81cde.js} +2 -2
  106. package/dist/stzh-components/{p-b4860ba4.js.map → p-ace81cde.js.map} +1 -1
  107. package/dist/stzh-components/p-b5c456f5.system.entry.js +2 -0
  108. package/dist/stzh-components/{p-78669470.system.entry.js.map → p-b5c456f5.system.entry.js.map} +1 -1
  109. package/dist/stzh-components/p-be4e2975.system.entry.js +2 -0
  110. package/dist/stzh-components/{p-c003c90c.system.entry.js.map → p-be4e2975.system.entry.js.map} +1 -1
  111. package/dist/stzh-components/p-c250e795.entry.js.map +1 -1
  112. package/dist/stzh-components/{p-9343aec6.system.entry.js → p-d175949a.system.entry.js} +2 -2
  113. package/dist/stzh-components/{p-9343aec6.system.entry.js.map → p-d175949a.system.entry.js.map} +1 -1
  114. package/dist/stzh-components/{p-8523e488.system.entry.js → p-d93b1fcd.system.entry.js} +3 -3
  115. package/dist/stzh-components/p-d93b1fcd.system.entry.js.map +1 -0
  116. package/dist/stzh-components/p-eaa65f52.system.js.map +1 -1
  117. package/dist/stzh-components/{p-e611a738.system.entry.js → p-f40c7884.system.entry.js} +2 -2
  118. package/dist/stzh-components/{p-e611a738.system.entry.js.map → p-f40c7884.system.entry.js.map} +1 -1
  119. package/dist/stzh-components/stzh-components.esm.js +1 -1
  120. package/dist/stzh-components/stzh-components.esm.js.map +1 -1
  121. package/dist/stzh-components/stzh-components.js +1 -1
  122. package/dist/types/components.d.ts +44 -6
  123. package/dist/types/index.d.ts +34 -0
  124. package/dist/vscode-data.json +20 -4
  125. package/package.json +1 -1
  126. package/dist/cjs/app-globals-15ef98d9.js.map +0 -1
  127. package/dist/esm/app-globals-664fb15a.js.map +0 -1
  128. package/dist/stzh-components/p-0c52518d.system.entry.js.map +0 -1
  129. package/dist/stzh-components/p-1dd43a6c.entry.js +0 -2
  130. package/dist/stzh-components/p-3d4553f7.entry.js +0 -2
  131. package/dist/stzh-components/p-78669470.system.entry.js +0 -2
  132. package/dist/stzh-components/p-851bbc2e.system.js +0 -2
  133. package/dist/stzh-components/p-8523e488.system.entry.js.map +0 -1
  134. package/dist/stzh-components/p-b329c334.entry.js +0 -2
  135. package/dist/stzh-components/p-b329c334.entry.js.map +0 -1
  136. package/dist/stzh-components/p-c003c90c.system.entry.js +0 -2
  137. package/dist/stzh-components/p-e194091a.entry.js +0 -10
  138. package/dist/stzh-components/p-e194091a.entry.js.map +0 -1
@@ -41,11 +41,42 @@ t.set=function(a,b){this.store[a]=b;return this};t.searchCache=oa;t.export=funct
41
41
  t.import=function(a,b){if(b)switch(x(b)&&(b=JSON.parse(b)),a){case "tag":this.l=b;break;case "reg":this.m=!1;this.register=b;for(let d=0,e;d<this.h.length;d++)e=this.index[this.h[d]],e.register=b,e.m=!1;break;case "store":this.store=b;break;default:a=a.split(".");const c=a[0];a=a[1];c&&a&&this.index[c].import(a,b);}};la(Q.prototype);var Ba={encode:Aa,F:!1,G:""};const Ca=[F("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),"a",F("[\u00e8\u00e9\u00ea\u00eb]"),"e",F("[\u00ec\u00ed\u00ee\u00ef]"),"i",F("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",F("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",F("[\u00fd\u0177\u00ff]"),"y",F("\u00f1"),"n",F("[\u00e7c]"),"k",F("\u00df"),"s",F(" & ")," and "];function Aa(a){var b=a=""+a;b.normalize&&(b=b.normalize("NFD").replace(ea,""));return ca.call(this,b.toLowerCase(),!a.normalize&&Ca)}var Ea={encode:Da,F:!1,G:"strict"};const Fa=/[^a-z0-9]+/,Ga={b:"p",v:"f",w:"f",z:"s",x:"s","\u00df":"s",d:"t",n:"m",c:"k",g:"k",j:"k",q:"k",i:"e",y:"e",u:"o"};function Da(a){a=Aa.call(this,a).join(" ");const b=[];if(a){const c=a.split(Fa),d=c.length;for(let e=0,f,g=0;e<d;e++)if((a=c[e])&&(!this.filter||!this.filter[a])){f=a[0];let h=Ga[f]||f,k=h;for(let m=1;m<a.length;m++){f=a[m];const n=Ga[f]||f;n&&n!==k&&(h+=n,k=n);}b[g++]=h;}}return b}var Ia={encode:Ha,F:!1,G:""};const Ja=[F("ae"),"a",F("oe"),"o",F("sh"),"s",F("th"),"t",F("ph"),"f",F("pf"),"f",F("(?![aeo])h(?![aeo])"),"",F("(?!^[aeo])h(?!^[aeo])"),""];function Ha(a,b){a&&(a=Da.call(this,a).join(" "),2<a.length&&(a=E(a,Ja)),b||(1<a.length&&(a=ha(a)),a&&(a=a.split(" "))));return a||[]}var La={encode:Ka,F:!1,G:""};const Ma=F("(?!\\b)[aeo]");function Ka(a){a&&(a=Ha.call(this,a,!0),1<a.length&&(a=a.replace(Ma,"")),1<a.length&&(a=ha(a)),a&&(a=a.split(" ")));return a||[]}G["latin:default"]=ja;G["latin:simple"]=Ba;G["latin:balance"]=Ea;G["latin:advanced"]=Ia;G["latin:extra"]=La;const W=self;let Y;const Z={Index:K,Document:Q,Worker:O,registerCharset:function(a,b){G[a]=b;},registerLanguage:function(a,b){ka[a]=b;}};(Y=W.define)&&Y.amd?Y([],function(){return Z}):W.exports?W.exports=Z:W.FlexSearch=Z;}(_commonjsHelpers.commonjsGlobal));
42
42
  });
43
43
 
44
- const stzhDatatableCss = ":host{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block;}:host[hidden]{display:none}:host *,:host *::before,:host *::after{-webkit-box-sizing:border-box;box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness)}:host .has-focus{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.3125rem}:host .stzh-fylingfocus-focused{outline-style:none !important}:host .stzh-fylingfocus-focused::-moz-focus-inner{border:0 !important}stzh-datatable{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block;--max-height:var(--stzh-table-max-height);--min-width:var(--stzh-table-min-width);--cell-padding:var(--stzh-table-cell-padding);--search-input-width:var(--stzh-table-search-input-width)}stzh-datatable[hidden]{display:none}stzh-datatable *,stzh-datatable *::before,stzh-datatable *::after{-webkit-box-sizing:border-box;box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness)}stzh-datatable .has-focus{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.3125rem}stzh-datatable .stzh-fylingfocus-focused{outline-style:none !important}stzh-datatable .stzh-fylingfocus-focused::-moz-focus-inner{border:0 !important}stzh-datatable[disable-min-width]:not([disable-min-width=false]){--min-width:none}.stzh-datatable{}.stzh-datatable__header{border-bottom:0.0625rem solid var(--stzh-base-border-color);padding-bottom:var(--stzh-space-small);margin-bottom:var(--stzh-space-medium)}@media screen and (min-width: 1024px){.stzh-datatable__header{padding-bottom:var(--stzh-space-medium)}}@media screen and (min-width: 1260px){.stzh-datatable__header{padding-bottom:var(--stzh-space-large)}}@media screen and (min-width: 1024px){.stzh-datatable__header{margin-bottom:var(--stzh-space-large)}}@media screen and (min-width: 1260px){.stzh-datatable__header{margin-bottom:var(--stzh-space-xlarge)}}.stzh-datatable__sub-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}.stzh-datatable__heading{margin-bottom:var(--stzh-space-small)}.stzh-datatable__header .stzh-datatable__search{-ms-flex-positive:1;flex-grow:1}@media screen and (min-width: 600px){.stzh-datatable__header .stzh-datatable__search{width:var(--search-input-width);-ms-flex-positive:0;flex-grow:0}}.stzh-datatable__action-button{-ms-flex-negative:0;flex-shrink:0}.stzh-datatable__action-button:not(:empty){margin-left:var(--stzh-space-medium)}.stzh-datatable__outer-wrapper{position:relative}.stzh-datatable__outer-wrapper::before,.stzh-datatable__outer-wrapper::after{z-index:4;background:-webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.16)), to(rgba(0, 0, 0, 0)));background:linear-gradient(90deg, rgba(0, 0, 0, 0.16) 0%, rgba(0, 0, 0, 0) 100%);content:\"\";pointer-events:none;position:absolute;top:0;height:100%;width:0.375rem;-webkit-transition:opacity var(--stzh-base-transition-animation-speed);transition:opacity var(--stzh-base-transition-animation-speed);opacity:0}.stzh-datatable__outer-wrapper::before{left:0}.stzh-datatable__outer-wrapper::after{right:0;-webkit-transform:rotate(-180deg);transform:rotate(-180deg)}.stzh-datatable__wrapper{overflow-x:auto;max-height:var(--max-height)}.stzh-datatable__pagination-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end}.stzh-datatable__pagination-wrapper:not(:empty){margin-top:var(--stzh-space-medium)}.stzh-datatable__sort-button{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:normal;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;font-size:inherit;line-height:inherit;color:inherit;padding:var(--cell-padding)}.stzh-datatable__sort-button:hover,.stzh-datatable__sort-button:focus{color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark))}.stzh-datatable stzh-icon.stzh-datatable__sort-icon{display:none}.stzh-datatable__table{width:100%;border-spacing:0;min-width:var(--min-width)}.stzh-datatable__thead{position:-webkit-sticky;position:sticky;top:0;z-index:3}.stzh-datatable__row:hover .stzh-datatable__cell{background-color:var(--stzh-color-grey5)}.stzh-datatable__cell{font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);text-align:left;border:none;vertical-align:top;border:none;border-bottom:0.0625rem solid var(--stzh-base-border-color);background-color:var(--stzh-color-white);-webkit-transition:background-color var(--stzh-base-transition-animation-speed);transition:background-color var(--stzh-base-transition-animation-speed);padding:var(--cell-padding);}.stzh-datatable__cell a{color:var(--stzh-link-color);-webkit-transition:color var(--stzh-base-transition-animation-speed);transition:color var(--stzh-base-transition-animation-speed);border-radius:var(--stzh-button-border-radius)}.stzh-datatable__cell a:hover,.stzh-datatable__cell a:focus{color:var(--stzh-link-hover-color)}.stzh-datatable__cell b,.stzh-datatable__cell strong{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:normal}.stzh-datatable__cell i,.stzh-datatable__cell em{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal}.stzh-datatable__cell.align-left{text-align:left}.stzh-datatable__cell.align-right{text-align:right}.stzh-datatable__cell.align-center{text-align:center}.stzh-datatable__cell.valign-auto{vertical-align:auto}.stzh-datatable__cell.valign-middle{vertical-align:middle}.stzh-datatable__cell.valign-bottom{vertical-align:bottom}.stzh-datatable__cell.nowrap{white-space:nowrap}.stzh-datatable__cell.is-sticky-left,.stzh-datatable__cell.is-sticky-right{position:-webkit-sticky;position:sticky;z-index:1}.stzh-datatable__cell.has-sticked{z-index:2}.stzh-datatable__cell.is-sticky-left{left:0}.stzh-datatable__cell.is-sticky-right{right:0}.stzh-datatable__cell.is-sticky-left::after,.stzh-datatable__cell.is-sticky-right::after{background:-webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.16)), to(rgba(0, 0, 0, 0)));background:linear-gradient(90deg, rgba(0, 0, 0, 0.16) 0%, rgba(0, 0, 0, 0) 100%);content:\"\";pointer-events:none;position:absolute;top:0;height:100%;width:0.375rem;-webkit-transform:translate(100%);transform:translate(100%);opacity:0;-webkit-transition:opacity var(--stzh-base-transition-animation-speed);transition:opacity var(--stzh-base-transition-animation-speed)}.stzh-datatable__cell.is-sticky-left::after{right:0}.stzh-datatable__cell.is-sticky-right::after{left:0;-webkit-transform:rotate(-180deg) translate(100%);transform:rotate(-180deg) translate(100%)}.stzh-datatable__cell.has-sticked.is-sticky-left::after,.stzh-datatable__cell.has-sticked.is-sticky-right::after{opacity:1}.stzh-datatable__cell--head{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:normal;color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}.stzh-datatable__cell--head.is-sortable{padding:0}.stzh-datatable__cell.has-sorted .stzh-datatable__sort-icon{display:-ms-inline-flexbox;display:inline-flex}.stzh-datatable__cell.has-sorted-desc .stzh-datatable__sort-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.stzh-datatable.has-list .stzh-datatable__outer-wrapper{display:none}@media screen and (min-width: 600px){.stzh-datatable.has-list .stzh-datatable__outer-wrapper{display:block}}@media screen and (min-width: 600px){.stzh-datatable.has-list .stzh-datatable__list-wrapper{display:none}}.stzh-datatable.has-scroll-left-shadow .stzh-datatable__outer-wrapper::before,.stzh-datatable.has-scroll-right-shadow .stzh-datatable__outer-wrapper::after{opacity:1}";
44
+ const stzhDatatableCss = ":host{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block;}:host[hidden]{display:none}:host *,:host *::before,:host *::after{-webkit-box-sizing:border-box;box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness)}:host .has-focus{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.3125rem}:host .stzh-fylingfocus-focused{outline-style:none !important}:host .stzh-fylingfocus-focused::-moz-focus-inner{border:0 !important}stzh-datatable{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block;--max-height:var(--stzh-table-max-height);--min-width:var(--stzh-table-min-width);--cell-padding:var(--stzh-table-cell-padding);--search-input-width:var(--stzh-table-search-input-width)}stzh-datatable[hidden]{display:none}stzh-datatable *,stzh-datatable *::before,stzh-datatable *::after{-webkit-box-sizing:border-box;box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness)}stzh-datatable .has-focus{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.3125rem}stzh-datatable .stzh-fylingfocus-focused{outline-style:none !important}stzh-datatable .stzh-fylingfocus-focused::-moz-focus-inner{border:0 !important}stzh-datatable[disable-min-width]:not([disable-min-width=false]){--min-width:none}.stzh-datatable{}.stzh-datatable__header{border-bottom:0.0625rem solid var(--stzh-base-border-color);padding-bottom:var(--stzh-space-small);margin-bottom:var(--stzh-space-medium)}@media screen and (min-width: 1024px){.stzh-datatable__header{padding-bottom:var(--stzh-space-medium)}}@media screen and (min-width: 1260px){.stzh-datatable__header{padding-bottom:var(--stzh-space-large)}}@media screen and (min-width: 1024px){.stzh-datatable__header{margin-bottom:var(--stzh-space-large)}}@media screen and (min-width: 1260px){.stzh-datatable__header{margin-bottom:var(--stzh-space-xlarge)}}.stzh-datatable__sub-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}.stzh-datatable__heading{margin-bottom:var(--stzh-space-small)}.stzh-datatable__header .stzh-datatable__search{-ms-flex-positive:1;flex-grow:1;margin-right:var(--stzh-space-medium)}@media screen and (min-width: 600px){.stzh-datatable__header .stzh-datatable__search{width:var(--search-input-width);-ms-flex-positive:0;flex-grow:0}}.stzh-datatable__action-button{-ms-flex-negative:0;flex-shrink:0;margin-left:auto}.stzh-datatable__outer-wrapper{position:relative}.stzh-datatable__outer-wrapper::before,.stzh-datatable__outer-wrapper::after{z-index:4;background:-webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.16)), to(rgba(0, 0, 0, 0)));background:linear-gradient(90deg, rgba(0, 0, 0, 0.16) 0%, rgba(0, 0, 0, 0) 100%);content:\"\";pointer-events:none;position:absolute;top:0;height:100%;width:0.375rem;-webkit-transition:opacity var(--stzh-base-transition-animation-speed);transition:opacity var(--stzh-base-transition-animation-speed);opacity:0}.stzh-datatable__outer-wrapper::before{left:0}.stzh-datatable__outer-wrapper::after{right:0;-webkit-transform:rotate(-180deg);transform:rotate(-180deg)}.stzh-datatable__wrapper{overflow-x:auto;max-height:var(--max-height)}.stzh-datatable__pagination-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end}.stzh-datatable__pagination-wrapper:not(:empty){margin-top:var(--stzh-space-medium)}.stzh-datatable__sort-button{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:normal;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;font-size:inherit;line-height:inherit;color:inherit;padding:var(--cell-padding)}.stzh-datatable__sort-button:hover,.stzh-datatable__sort-button:focus{color:var(--stzh-color-primary-hover, var(--stzh-color-zueribluedark))}.stzh-datatable stzh-icon.stzh-datatable__sort-icon{display:none}.stzh-datatable__table{width:100%;border-spacing:0;min-width:var(--min-width);}.stzh-datatable__table.has-layout-fixed{table-layout:fixed}.stzh-datatable__thead{position:-webkit-sticky;position:sticky;top:0;z-index:3}.stzh-datatable__row:hover .stzh-datatable__cell{background-color:var(--stzh-color-grey5)}.stzh-datatable__cell{font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);text-align:left;border:none;vertical-align:top;border:none;border-bottom:0.0625rem solid var(--stzh-base-border-color);background-color:var(--stzh-color-white);-webkit-transition:background-color var(--stzh-base-transition-animation-speed);transition:background-color var(--stzh-base-transition-animation-speed);padding:var(--cell-padding);}.stzh-datatable__cell a{color:var(--stzh-link-color);-webkit-transition:color var(--stzh-base-transition-animation-speed);transition:color var(--stzh-base-transition-animation-speed);border-radius:var(--stzh-button-border-radius)}.stzh-datatable__cell a:hover,.stzh-datatable__cell a:focus{color:var(--stzh-link-hover-color)}.stzh-datatable__cell b,.stzh-datatable__cell strong{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:normal}.stzh-datatable__cell i,.stzh-datatable__cell em{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal}.stzh-datatable__cell.align-left{text-align:left}.stzh-datatable__cell.align-right{text-align:right}.stzh-datatable__cell.align-center{text-align:center}.stzh-datatable__cell.valign-auto{vertical-align:auto}.stzh-datatable__cell.valign-middle{vertical-align:middle}.stzh-datatable__cell.valign-bottom{vertical-align:bottom}.stzh-datatable__cell.nowrap{white-space:nowrap}.stzh-datatable__cell.is-sticky-left,.stzh-datatable__cell.is-sticky-right{position:-webkit-sticky;position:sticky;z-index:1}.stzh-datatable__cell.has-sticked{z-index:2}.stzh-datatable__cell.is-sticky-left{left:0}.stzh-datatable__cell.is-sticky-right{right:0}.stzh-datatable__cell.is-sticky-left::after,.stzh-datatable__cell.is-sticky-right::after{background:-webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.16)), to(rgba(0, 0, 0, 0)));background:linear-gradient(90deg, rgba(0, 0, 0, 0.16) 0%, rgba(0, 0, 0, 0) 100%);content:\"\";pointer-events:none;position:absolute;top:0;height:100%;width:0.375rem;-webkit-transform:translate(100%);transform:translate(100%);opacity:0;-webkit-transition:opacity var(--stzh-base-transition-animation-speed);transition:opacity var(--stzh-base-transition-animation-speed)}.stzh-datatable__cell.is-sticky-left::after{right:0}.stzh-datatable__cell.is-sticky-right::after{left:0;-webkit-transform:rotate(-180deg) translate(100%);transform:rotate(-180deg) translate(100%)}.stzh-datatable__cell.has-sticked.is-sticky-left::after,.stzh-datatable__cell.has-sticked.is-sticky-right::after{opacity:1}.stzh-datatable__cell--head{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:normal;color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}.stzh-datatable__cell--head.is-sortable{padding:0}.stzh-datatable__cell.has-sorted .stzh-datatable__sort-icon{display:-ms-inline-flexbox;display:inline-flex}.stzh-datatable__cell.has-sorted-desc .stzh-datatable__sort-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.stzh-datatable.has-list .stzh-datatable__outer-wrapper{display:none}@media screen and (min-width: 600px){.stzh-datatable.has-list .stzh-datatable__outer-wrapper{display:block}}@media screen and (min-width: 600px){.stzh-datatable.has-list .stzh-datatable__list-wrapper{display:none}}.stzh-datatable.has-scroll-left-shadow .stzh-datatable__outer-wrapper::before,.stzh-datatable.has-scroll-right-shadow .stzh-datatable__outer-wrapper::after{opacity:1}";
45
45
 
46
46
  const StzhDatatable = class {
47
47
  constructor(hostRef) {
48
48
  index.registerInstance(this, hostRef);
49
+ this.stzhRowClick = index.createEvent(this, "stzhRowClick", 7);
50
+ this.stzhCellClick = index.createEvent(this, "stzhCellClick", 7);
51
+ this.stzhHeadingCellClick = index.createEvent(this, "stzhHeadingCellClick", 7);
52
+ this.stzhSortClick = index.createEvent(this, "stzhSortClick", 7);
53
+ this.stzhSortByChange = index.createEvent(this, "stzhSortByChange", 7);
54
+ this.stzhSortDirectionChange = index.createEvent(this, "stzhSortDirectionChange", 7);
55
+ this.handleRowClick = (event, row) => {
56
+ this.stzhRowClick.emit({
57
+ component: "stzh-datatable",
58
+ row,
59
+ originalEvent: event
60
+ });
61
+ };
62
+ this.handleCellClick = (event, row, column, cellIndex, rowIndex) => {
63
+ this.stzhCellClick.emit({
64
+ component: "stzh-datatable",
65
+ row,
66
+ column,
67
+ cellIndex,
68
+ rowIndex,
69
+ originalEvent: event
70
+ });
71
+ };
72
+ this.handleSortClick = (event, column) => {
73
+ this.stzhSortClick.emit({
74
+ component: "stzh-datatable",
75
+ column,
76
+ originalEvent: event
77
+ });
78
+ this.toggleSort(column.key);
79
+ };
49
80
  this.updateScrollStates = () => {
50
81
  if (!this.tableWrapper) {
51
82
  return;
@@ -99,12 +130,14 @@ const StzhDatatable = class {
99
130
  this.page = event.detail.page;
100
131
  }
101
132
  };
133
+ this.tableLayout = "auto";
102
134
  this.localization = undefined;
103
135
  this.label = "";
104
136
  this.sortBy = "";
105
137
  this.sortDirection = "asc";
106
138
  this.tokenize = "forward";
107
139
  this.idField = "id";
140
+ this.hideSearch = false;
108
141
  this.showList = false;
109
142
  this.page = 1;
110
143
  this.pageSize = null;
@@ -147,6 +180,28 @@ const StzhDatatable = class {
147
180
  }
148
181
  this.buildSearchIndex();
149
182
  }
183
+ sortByWatcher(value, oldValue) {
184
+ this.stzhSortByChange.emit({
185
+ component: "stzh-datatable",
186
+ value,
187
+ oldValue
188
+ });
189
+ }
190
+ sortDirectionWatcher(value, oldValue) {
191
+ this.stzhSortDirectionChange.emit({
192
+ component: "stzh-datatable",
193
+ value,
194
+ oldValue
195
+ });
196
+ }
197
+ handleHeadingCellClick(event, column, index) {
198
+ this.stzhHeadingCellClick.emit({
199
+ component: "stzh-datatable",
200
+ column,
201
+ index,
202
+ originalEvent: event
203
+ });
204
+ }
150
205
  buildSearchIndex() {
151
206
  if (!this._rows || this._rows.length === 0
152
207
  || !this._columns || this._columns.length === 0) {
@@ -180,6 +235,7 @@ const StzhDatatable = class {
180
235
  this.updateScrollStates();
181
236
  }
182
237
  componentWillRender() {
238
+ var _a, _b;
183
239
  this._rowsShown = [];
184
240
  this._rowsFiltered = [];
185
241
  if (this.query) {
@@ -200,9 +256,22 @@ const StzhDatatable = class {
200
256
  this._rowsFiltered = [...this._rows];
201
257
  }
202
258
  if (this.sortBy) {
259
+ const columnConfig = this._columns.find((column) => column.key === this.sortBy);
260
+ const column = ((_a = columnConfig === null || columnConfig === void 0 ? void 0 : columnConfig.sort) === null || _a === void 0 ? void 0 : _a.field) || this.sortBy;
261
+ const type = (_b = columnConfig === null || columnConfig === void 0 ? void 0 : columnConfig.sort) === null || _b === void 0 ? void 0 : _b.type;
203
262
  this._rowsFiltered.sort((rowA, rowB) => {
204
- const comparison = rowA[this.sortBy].localeCompare(rowB[this.sortBy]);
205
- return this.sortDirection === "asc" ? comparison : comparison / -1;
263
+ if (type === "numerical") {
264
+ if (this.sortDirection === "asc") {
265
+ return Number(rowA[column]) - Number(rowB[column]);
266
+ }
267
+ else {
268
+ return Number(rowB[column]) - Number(rowA[column]);
269
+ }
270
+ }
271
+ else {
272
+ const comparison = rowA[column].localeCompare(rowB[column]);
273
+ return this.sortDirection === "asc" ? comparison : comparison / -1;
274
+ }
206
275
  });
207
276
  }
208
277
  if (this.pageSize !== null) {
@@ -233,7 +302,11 @@ const StzhDatatable = class {
233
302
  "has-list": this.showList,
234
303
  };
235
304
  const totalPages = Math.ceil(this._rowsFiltered.length / this.pageSize);
236
- return (index.h(index.Host, null, index.h("div", { class: classes }, index.h("div", { class: "stzh-datatable__header" }, index.h("div", { class: "stzh-datatable__heading" }, index.h("slot", { name: "heading" })), index.h("div", { class: "stzh-datatable__sub-header" }, index.h("stzh-input", { ref: (el) => (this.input = el), class: "stzh-datatable__search", size: "small", name: "stzh-datatable-search", onStzhChange: this.onInputChange, label: this.localization.searchLabel }), index.h("div", { class: "stzh-datatable__action-button" }, index.h("slot", { name: "action-button" })))), index.h("div", { class: "stzh-datatable__outer-wrapper" }, index.h("div", { ref: (el) => (this.tableWrapper = el), class: "stzh-datatable__wrapper", onScroll: this.handleScroll }, index.h("table", { class: "stzh-datatable__table" }, index.h("thead", { class: "stzh-datatable__thead" }, index.h("tr", { class: "stzh-datatable__row stzh-datatable__row--head" }, this._columns.map((column, index$1) => index.h("th", { class: {
305
+ return (index.h(index.Host, null, index.h("div", { class: classes }, index.h("div", { class: "stzh-datatable__header" }, index.h("div", { class: "stzh-datatable__heading" }, index.h("slot", { name: "heading" })), index.h("div", { class: "stzh-datatable__sub-header" }, !this.hideSearch &&
306
+ index.h("stzh-input", { ref: (el) => (this.input = el), class: "stzh-datatable__search", size: "small", name: "stzh-datatable-search", onStzhChange: this.onInputChange, label: this.localization.searchLabel }), index.h("div", { class: "stzh-datatable__action-button" }, index.h("slot", { name: "action-button" })))), index.h("div", { class: "stzh-datatable__outer-wrapper" }, index.h("div", { ref: (el) => (this.tableWrapper = el), class: "stzh-datatable__wrapper", onScroll: this.handleScroll }, index.h("table", { class: {
307
+ "stzh-datatable__table": true,
308
+ "has-layout-fixed": this.tableLayout === "fixed",
309
+ } }, index.h("thead", { class: "stzh-datatable__thead" }, index.h("tr", { class: "stzh-datatable__row stzh-datatable__row--head" }, this._columns.map((column, index$1) => index.h("th", { onClick: (event) => this.handleHeadingCellClick(event, column, index$1), style: column.style, class: {
237
310
  "stzh-datatable__cell stzh-datatable__cell--head": true,
238
311
  "is-sticky-left": column.fixed === "left",
239
312
  "is-sticky-right": column.fixed === "right",
@@ -245,11 +318,11 @@ const StzhDatatable = class {
245
318
  [`align-${column.align}`]: column.align,
246
319
  [`valign-${column.valign}`]: column.valign
247
320
  } }, column.sort ?
248
- index.h("button", { class: "stzh-datatable__sort-button", type: "button", onClick: () => this.toggleSort(column.key), "s-object-id": column.analyticsId || `${column.text} ${this.localization.columnSort}` }, index.h("span", null, column.text), index.h("stzh-icon", { name: "arrow-up", class: "stzh-datatable__sort-icon", a11yTitle: this.localization.columnSort }))
321
+ index.h("button", { class: "stzh-datatable__sort-button", type: "button", onClick: (event) => this.handleSortClick(event, column), "s-object-id": column.analyticsId || `${column.text} ${this.localization.columnSort}` }, index.h("span", null, column.text), index.h("stzh-icon", { name: "arrow-up", class: "stzh-datatable__sort-icon", a11yTitle: this.localization.columnSort }))
249
322
  :
250
- index.h("span", null, column.text))))), index.h("tbody", null, this._rowsShown.map((row) => index.h("tr", { class: "stzh-datatable__row stzh-datatable__row--body" }, this._columns.map((column, index$1) => {
323
+ index.h("span", null, column.text))))), index.h("tbody", null, this._rowsShown.map((row, rowIndex) => index.h("tr", { class: "stzh-datatable__row stzh-datatable__row--body", onClick: (event) => this.handleRowClick(event, row) }, this._columns.map((column, index$1) => {
251
324
  var _a, _b, _c, _d, _e;
252
- return index.h("td", { innerHTML: ((_a = row[column.key]) === null || _a === void 0 ? void 0 : _a.text) || row[column.key] || "", class: {
325
+ return index.h("td", { onClick: (event) => this.handleCellClick(event, row, column, index$1, rowIndex), innerHTML: ((_a = row[column.key]) === null || _a === void 0 ? void 0 : _a.text) || row[column.key] || "", style: column.style, class: {
253
326
  "stzh-datatable__cell stzh-datatable__cell--body": true,
254
327
  "is-sticky-left": column.fixed === "left",
255
328
  "is-sticky-right": column.fixed === "right",
@@ -271,7 +344,9 @@ const StzhDatatable = class {
271
344
  get element() { return index.getElement(this); }
272
345
  static get watchers() { return {
273
346
  "rows": ["rowsWatcher"],
274
- "columns": ["columnsWatcher"]
347
+ "columns": ["columnsWatcher"],
348
+ "sortBy": ["sortByWatcher"],
349
+ "sortDirection": ["sortDirectionWatcher"]
275
350
  }; }
276
351
  };
277
352
  StzhDatatable.style = stzhDatatableCss;