@limetech/lime-elements 37.56.5 → 37.56.7

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 (29) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +1 -1
  3. package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js.map +1 -1
  4. package/dist/cjs/limel-table.cjs.entry.js +1 -1
  5. package/dist/cjs/limel-table.cjs.entry.js.map +1 -1
  6. package/dist/cjs/limel-text-editor.cjs.entry.js +2 -2
  7. package/dist/cjs/limel-text-editor.cjs.entry.js.map +1 -1
  8. package/dist/collection/components/table/table.js +1 -1
  9. package/dist/collection/components/table/table.js.map +1 -1
  10. package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.css +5 -3
  11. package/dist/collection/components/text-editor/text-editor.css +1 -0
  12. package/dist/collection/components/text-editor/text-editor.js +1 -1
  13. package/dist/collection/components/text-editor/text-editor.js.map +1 -1
  14. package/dist/esm/limel-prosemirror-adapter.entry.js +1 -1
  15. package/dist/esm/limel-prosemirror-adapter.entry.js.map +1 -1
  16. package/dist/esm/limel-table.entry.js +1 -1
  17. package/dist/esm/limel-table.entry.js.map +1 -1
  18. package/dist/esm/limel-text-editor.entry.js +2 -2
  19. package/dist/esm/limel-text-editor.entry.js.map +1 -1
  20. package/dist/lime-elements/lime-elements.esm.js +1 -1
  21. package/dist/lime-elements/{p-b0f74976.entry.js → p-0a1016fa.entry.js} +2 -2
  22. package/dist/lime-elements/{p-b0f74976.entry.js.map → p-0a1016fa.entry.js.map} +1 -1
  23. package/dist/lime-elements/p-848df158.entry.js +2 -0
  24. package/dist/lime-elements/p-848df158.entry.js.map +1 -0
  25. package/dist/lime-elements/{p-178bbeb4.entry.js → p-dab818a1.entry.js} +2 -2
  26. package/dist/lime-elements/{p-178bbeb4.entry.js.map → p-dab818a1.entry.js.map} +1 -1
  27. package/package.json +1 -1
  28. package/dist/lime-elements/p-8e3475dc.entry.js +0 -2
  29. package/dist/lime-elements/p-8e3475dc.entry.js.map +0 -1
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-d1052409.js');
6
6
  const randomString = require('./random-string-c8445652.js');
7
7
 
8
- const textEditorCss = "@charset \"UTF-8\";:host{--mdc-theme-primary:var(\n --lime-primary-color,\n rgb(var(--color-teal-default))\n );--mdc-theme-secondary:var(\n --lime-secondary-color,\n rgb(var(--contrast-1100))\n );--mdc-theme-on-primary:var(\n --lime-on-primary-color,\n rgb(var(--contrast-100))\n );--mdc-theme-on-secondary:var(\n --lime-on-secondary-color,\n rgb(var(--contrast-100))\n );--mdc-theme-text-disabled-on-background:var(\n --lime-text-disabled-on-background-color,\n rgba(var(--contrast-1700), 0.38)\n );--mdc-theme-text-primary-on-background:var(\n --lime-text-primary-on-background-color,\n rgba(var(--contrast-1700), 0.87)\n );--mdc-theme-text-secondary-on-background:var(\n --lime-text-secondary-on-background-color,\n rgba(var(--contrast-1700), 0.54)\n );--mdc-theme-error:var(\n --lime-error-background-color,\n rgb(var(--color-red-dark))\n );--lime-error-text-color:rgb(var(--color-red-darker));--mdc-theme-surface:var(\n --lime-surface-background-color,\n rgb(var(--contrast-100))\n );--mdc-theme-on-surface:var(\n --lime-on-surface-color,\n rgb(var(--contrast-1500))\n )}.lime-looks-like-input-value{line-height:1.75rem;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:rgba(var(--contrast-1400), 1);font-size:0.875rem;font-weight:400;letter-spacing:0.009375em}.mdc-text-field--disabled .lime-looks-like-input-value{cursor:not-allowed;opacity:0.4}.lime-looks-like-input-value{padding:var(--limel-text-editor-padding)}*{box-sizing:border-box}:host(limel-text-editor){--limel-text-editor-outline-color:rgba(var(--contrast-700), 0.65);--limel-text-editor-background-color:rgba(var(--contrast-200), 0.5);--limel-text-editor-label-color:rgba(var(--contrast-1200), 1);--limel-text-editor-padding:0.75rem 1rem;--limel-prosemirror-adapter-toolbar-opacity:0.6;--limel-prosemirror-adapter-toolbar-transition-timing-function:cubic-bezier(\n 0.19,\n 0.23,\n 0.26,\n 0.89\n );position:relative;isolation:isolate;display:flex;flex-direction:column;width:100%;min-width:5rem;min-height:5rem;height:100%;max-height:var(--text-editor-max-height, calc(100vh - (env(safe-area-inset-top) + env(safe-area-inset-bottom)) - 4rem))}:host(limel-text-editor:focus-within),:host(limel-text-editor:hover){--limel-prosemirror-adapter-toolbar-opacity:1}:host(limel-text-editor:hover){--limel-text-editor-outline-color:rgba(var(--contrast-700), 1)}:host(limel-text-editor:focus-within){--limel-text-editor-outline-color:var(--mdc-theme-primary)}:host(limel-text-editor[disabled]:not([disabled=false])){cursor:not-allowed;opacity:0.4}:host(limel-text-editor[disabled]:not([disabled=false])) limel-prosemirror-adapter{pointer-events:none}:host(limel-text-editor[invalid]:not([invalid=false])){--limel-text-editor-outline-color:var(--lime-error-text-color)}:host(limel-text-editor[readonly]:not([readonly=false])){--limel-text-editor-placeholder-top:0;--limel-text-editor-outline-color:transparent;--limel-text-editor-background-color:transparent}:host(limel-text-editor[readonly]:not([readonly=false])) limel-markdown{display:block;padding:var(--limel-text-editor-padding);overflow-y:auto}:host(limel-text-editor[readonly]:not([readonly=false])) limel-markdown:before,:host(limel-text-editor[readonly]:not([readonly=false])) limel-markdown:after{z-index:1;pointer-events:none;content:\"\";display:block;position:absolute;width:100%}:host(limel-text-editor[readonly]:not([readonly=false])) limel-markdown:after{height:1.75rem;top:0;background:linear-gradient(var(--text-editor-fade-out-background-color, rgb(var(--contrast-100))), transparent)}:host(limel-text-editor[readonly]:not([readonly=false])) limel-markdown:before{height:2rem;bottom:-0.25rem;background:linear-gradient(transparent, var(--text-editor-fade-out-background-color, rgb(var(--contrast-100))))}.notched-outline{transition:bottom var(--limel-h-l-grid-template-rows-transition-speed, 0.46s) cubic-bezier(1, 0.09, 0, 0.89);pointer-events:none;position:absolute;inset:0;bottom:var(--limel-text-editor-notched-outline-bottom, 0);display:flex;background-color:var(--limel-text-editor-background-color)}.leading-outline,.notch,.trailing-outline{transition:border-color 0.2s ease;border-width:1px;border-style:solid;border-color:var(--limel-text-editor-outline-color)}.leading-outline{flex-shrink:0;width:0.75rem;border-right-width:0;border-top-left-radius:0.25rem;border-bottom-left-radius:0.25rem}.notch{flex-shrink:0;position:relative;z-index:2;border-top-width:0;border-right-width:0;border-left-width:0;max-width:calc(100% - 1.5rem)}.trailing-outline{flex-grow:1;border-left-width:0;border-top-right-radius:0.25rem;border-bottom-right-radius:0.25rem}label{transform:translateY(-50%);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display:block;padding:0 0.25rem;color:var(--limel-text-editor-label-color);font-size:0.65rem;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, 0.009375em)}:host(limel-text-editor[required]) label::after{content:\"*\"}.placeholder{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;pointer-events:none;position:absolute;top:var(--limel-text-editor-placeholder-top, 2.25rem);left:0;right:0;padding:var(--limel-text-editor-padding);font-style:italic;font-size:0.875rem;color:rgb(var(--contrast-900))}limel-prosemirror-adapter{flex-grow:1;min-width:0;min-height:0;height:100%;overflow:hidden auto}:host(limel-text-editor:focus),:host(limel-text-editor:focus-visible),:host(limel-text-editor:focus-within),:host(limel-text-editor[invalid]:not([invalid=false])),:host(limel-text-editor[invalid=true]){--limel-h-l-grid-template-rows-transition-speed:0.46s;--limel-h-l-grid-template-rows:1fr}:host(limel-text-editor){--limel-h-l-grid-template-rows-transition-speed:0.3s;--limel-h-l-grid-template-rows:0fr}:host(limel-text-editor:focus) limel-helper-line,:host(limel-text-editor:focus-visible) limel-helper-line,:host(limel-text-editor:focus-within) limel-helper-line,:host(limel-text-editor:hover) limel-helper-line{will-change:grid-template-rows}:host(limel-text-editor.has-helper-text:focus-within) .notched-outline,:host(limel-text-editor.has-helper-text[invalid]:not([invalid=false])) .notched-outline{--limel-text-editor-notched-outline-bottom:1rem}:host(limel-text-editor[allow-resize]) limel-prosemirror-adapter{resize:vertical}";
8
+ const textEditorCss = "@charset \"UTF-8\";:host{--mdc-theme-primary:var(\n --lime-primary-color,\n rgb(var(--color-teal-default))\n );--mdc-theme-secondary:var(\n --lime-secondary-color,\n rgb(var(--contrast-1100))\n );--mdc-theme-on-primary:var(\n --lime-on-primary-color,\n rgb(var(--contrast-100))\n );--mdc-theme-on-secondary:var(\n --lime-on-secondary-color,\n rgb(var(--contrast-100))\n );--mdc-theme-text-disabled-on-background:var(\n --lime-text-disabled-on-background-color,\n rgba(var(--contrast-1700), 0.38)\n );--mdc-theme-text-primary-on-background:var(\n --lime-text-primary-on-background-color,\n rgba(var(--contrast-1700), 0.87)\n );--mdc-theme-text-secondary-on-background:var(\n --lime-text-secondary-on-background-color,\n rgba(var(--contrast-1700), 0.54)\n );--mdc-theme-error:var(\n --lime-error-background-color,\n rgb(var(--color-red-dark))\n );--lime-error-text-color:rgb(var(--color-red-darker));--mdc-theme-surface:var(\n --lime-surface-background-color,\n rgb(var(--contrast-100))\n );--mdc-theme-on-surface:var(\n --lime-on-surface-color,\n rgb(var(--contrast-1500))\n )}.lime-looks-like-input-value{line-height:1.75rem;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:rgba(var(--contrast-1400), 1);font-size:0.875rem;font-weight:400;letter-spacing:0.009375em}.mdc-text-field--disabled .lime-looks-like-input-value{cursor:not-allowed;opacity:0.4}.lime-looks-like-input-value{padding:var(--limel-text-editor-padding)}*{box-sizing:border-box}:host(limel-text-editor){--limel-text-editor-outline-color:rgba(var(--contrast-700), 0.65);--limel-text-editor-background-color:rgba(var(--contrast-200), 0.5);--limel-text-editor-label-color:rgba(var(--contrast-1200), 1);--limel-text-editor-padding:0.75rem 1rem;--limel-prosemirror-adapter-toolbar-opacity:0.6;--limel-prosemirror-adapter-toolbar-transition-timing-function:cubic-bezier(\n 0.19,\n 0.23,\n 0.26,\n 0.89\n );position:relative;isolation:isolate;display:flex;flex-direction:column;width:100%;min-width:5rem;min-height:5rem;height:100%;max-height:var(--text-editor-max-height, calc(100vh - (env(safe-area-inset-top) + env(safe-area-inset-bottom)) - 4rem));padding:1px}:host(limel-text-editor:focus-within),:host(limel-text-editor:hover){--limel-prosemirror-adapter-toolbar-opacity:1}:host(limel-text-editor:hover){--limel-text-editor-outline-color:rgba(var(--contrast-700), 1)}:host(limel-text-editor:focus-within){--limel-text-editor-outline-color:var(--mdc-theme-primary)}:host(limel-text-editor[disabled]:not([disabled=false])){cursor:not-allowed;opacity:0.4}:host(limel-text-editor[disabled]:not([disabled=false])) limel-prosemirror-adapter{pointer-events:none}:host(limel-text-editor[invalid]:not([invalid=false])){--limel-text-editor-outline-color:var(--lime-error-text-color)}:host(limel-text-editor[readonly]:not([readonly=false])){--limel-text-editor-placeholder-top:0;--limel-text-editor-outline-color:transparent;--limel-text-editor-background-color:transparent}:host(limel-text-editor[readonly]:not([readonly=false])) limel-markdown{display:block;padding:var(--limel-text-editor-padding);overflow-y:auto}:host(limel-text-editor[readonly]:not([readonly=false])) limel-markdown:before,:host(limel-text-editor[readonly]:not([readonly=false])) limel-markdown:after{z-index:1;pointer-events:none;content:\"\";display:block;position:absolute;width:100%}:host(limel-text-editor[readonly]:not([readonly=false])) limel-markdown:after{height:1.75rem;top:0;background:linear-gradient(var(--text-editor-fade-out-background-color, rgb(var(--contrast-100))), transparent)}:host(limel-text-editor[readonly]:not([readonly=false])) limel-markdown:before{height:2rem;bottom:-0.25rem;background:linear-gradient(transparent, var(--text-editor-fade-out-background-color, rgb(var(--contrast-100))))}.notched-outline{transition:bottom var(--limel-h-l-grid-template-rows-transition-speed, 0.46s) cubic-bezier(1, 0.09, 0, 0.89);pointer-events:none;position:absolute;inset:0;bottom:var(--limel-text-editor-notched-outline-bottom, 0);display:flex;background-color:var(--limel-text-editor-background-color)}.leading-outline,.notch,.trailing-outline{transition:border-color 0.2s ease;border-width:1px;border-style:solid;border-color:var(--limel-text-editor-outline-color)}.leading-outline{flex-shrink:0;width:0.75rem;border-right-width:0;border-top-left-radius:0.25rem;border-bottom-left-radius:0.25rem}.notch{flex-shrink:0;position:relative;z-index:2;border-top-width:0;border-right-width:0;border-left-width:0;max-width:calc(100% - 1.5rem)}.trailing-outline{flex-grow:1;border-left-width:0;border-top-right-radius:0.25rem;border-bottom-right-radius:0.25rem}label{transform:translateY(-50%);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display:block;padding:0 0.25rem;color:var(--limel-text-editor-label-color);font-size:0.65rem;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, 0.009375em)}:host(limel-text-editor[required]) label::after{content:\"*\"}.placeholder{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;pointer-events:none;position:absolute;top:var(--limel-text-editor-placeholder-top, 2.25rem);left:0;right:0;padding:var(--limel-text-editor-padding);font-style:italic;font-size:0.875rem;color:rgb(var(--contrast-900))}limel-prosemirror-adapter{flex-grow:1;min-width:0;min-height:0;height:100%;overflow:hidden auto}:host(limel-text-editor:focus),:host(limel-text-editor:focus-visible),:host(limel-text-editor:focus-within),:host(limel-text-editor[invalid]:not([invalid=false])),:host(limel-text-editor[invalid=true]){--limel-h-l-grid-template-rows-transition-speed:0.46s;--limel-h-l-grid-template-rows:1fr}:host(limel-text-editor){--limel-h-l-grid-template-rows-transition-speed:0.3s;--limel-h-l-grid-template-rows:0fr}:host(limel-text-editor:focus) limel-helper-line,:host(limel-text-editor:focus-visible) limel-helper-line,:host(limel-text-editor:focus-within) limel-helper-line,:host(limel-text-editor:hover) limel-helper-line{will-change:grid-template-rows}:host(limel-text-editor.has-helper-text:focus-within) .notched-outline,:host(limel-text-editor.has-helper-text[invalid]:not([invalid=false])) .notched-outline{--limel-text-editor-notched-outline-bottom:1rem}:host(limel-text-editor[allow-resize]) limel-prosemirror-adapter{resize:vertical}";
9
9
 
10
10
  const TextEditor = class {
11
11
  constructor(hostRef) {
@@ -64,7 +64,7 @@ const TextEditor = class {
64
64
  ];
65
65
  }
66
66
  return [
67
- index.h("limel-prosemirror-adapter", { "aria-placeholder": this.placeholder, contentType: this.contentType, onChange: this.handleChange, value: this.value, "aria-controls": this.helperTextId, id: this.editorId, tabindex: this.disabled ? -1 : 0, "aria-disabled": this.disabled, language: this.language }),
67
+ index.h("limel-prosemirror-adapter", { "aria-placeholder": this.placeholder, contentType: this.contentType, onChange: this.handleChange, value: this.value, "aria-controls": this.helperTextId, id: this.editorId, tabindex: this.disabled ? -1 : undefined, "aria-disabled": this.disabled, language: this.language }),
68
68
  this.renderPlaceholder(),
69
69
  this.renderHelperLine(),
70
70
  ];
@@ -1 +1 @@
1
- {"file":"limel-text-editor.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,aAAa,GAAG,8uMAA8uM;;MC2BvvM,UAAU;EA+FnB;;;IAmFQ,qBAAgB,GAAG;MACvB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;QAClB,OAAO;OACV;MAED,QACIA,+BACI,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,YAAY,EAAE,IAAI,CAAC,YAAY,EAC/B,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,GAC3B,EACJ;KACL,CAAC;IAEM,cAAS,GAAG;MAChB,IAAI,IAAI,CAAC,QAAQ,EAAE;;QAEf,OAAO,KAAK,CAAC;OAChB;MAED,IAAI,IAAI,CAAC,OAAO,EAAE;QACd,OAAO,IAAI,CAAC;OACf;KACJ,CAAC;IAEM,iBAAY,GAAG,MAAM,CAAC,KAA0B;MACpD,KAAK,CAAC,eAAe,EAAE,CAAC;MACxB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;KAClC,CAAC;uBAxMwC,UAAU;oBAMvB,IAAI;oBASL,KAAK;oBAYL,KAAK;;;;mBA0BN,KAAK;;oBAkBJ,KAAK;uBAOH,IAAI;IAY9B,IAAI,CAAC,YAAY,GAAGC,+BAAkB,EAAE,CAAC;IACzC,IAAI,CAAC,QAAQ,GAAGA,+BAAkB,EAAE,CAAC;G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;KACV;IAED,QACIA,kBAAM,KAAK,EAAC,OAAO,IACfA,mBAAO,OAAO,EAAE,IAAI,CAAC,QAAQ,IAAG,IAAI,CAAC,KAAK,CAAS,CAChD,EACT;GACL;EAEO,iBAAiB;IACrB,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,KAAK,EAAE;MACjC,OAAO;KACV;IAED,QACIA,kBAAM,KAAK,EAAC,aAAa,iBAAa,MAAM,IACvC,IAAI,CAAC,WAAW,CACd,EACT;GACL;;;;;;","names":["h","createRandomString","Host"],"sources":["./src/components/text-editor/text-editor.scss?tag=limel-text-editor&encapsulation=shadow","./src/components/text-editor/text-editor.tsx"],"sourcesContent":["@use '../../style/internal/shared_input-select-picker';\n@use '../../style/mixins.scss';\n\n/**\n * @prop --text-editor-max-height: the tallest height the text editor can become when auto-resizing itself. Defaults to `calc(100vh - (env(safe-area-inset-top) + env(safe-area-inset-bottom)) - 4rem)`.\n * @prop --text-editor-fade-out-background-color: the color of the fade-out effect at the top and bottom of the text editor, when the text-editor is in readonly state. Defaults to rgb(var(--contrast-100)).\n */\n\n@include shared_input-select-picker.lime-looks-like-input-value;\n.lime-looks-like-input-value {\n padding: var(--limel-text-editor-padding);\n}\n\n* {\n box-sizing: border-box;\n}\n\n:host(limel-text-editor) {\n --limel-text-editor-outline-color: #{shared_input-select-picker.$lime-text-field-outline-color};\n --limel-text-editor-background-color: #{shared_input-select-picker.$background-color-normal};\n --limel-text-editor-label-color: #{shared_input-select-picker.$label-color};\n --limel-text-editor-padding: 0.75rem 1rem;\n --limel-prosemirror-adapter-toolbar-opacity: 0.6;\n --limel-prosemirror-adapter-toolbar-transition-timing-function: cubic-bezier(\n 0.19,\n 0.23,\n 0.26,\n 0.89\n );\n\n position: relative;\n isolation: isolate;\n display: flex;\n flex-direction: column;\n\n width: 100%;\n min-width: 5rem;\n min-height: 5rem;\n height: 100%;\n max-height: var(\n --text-editor-max-height,\n calc(\n 100vh - (env(safe-area-inset-top) + env(safe-area-inset-bottom)) -\n 4rem\n )\n );\n}\n\n:host(limel-text-editor:focus-within),\n:host(limel-text-editor:hover) {\n --limel-prosemirror-adapter-toolbar-opacity: 1;\n}\n\n:host(limel-text-editor:hover) {\n --limel-text-editor-outline-color: #{shared_input-select-picker.$lime-text-field-outline-color--hovered};\n}\n\n:host(limel-text-editor:focus-within) {\n --limel-text-editor-outline-color: #{shared_input-select-picker.$lime-text-field-outline-color--focused};\n}\n\n:host(limel-text-editor[disabled]:not([disabled='false'])) {\n @include shared_input-select-picker.looks-disabled;\n\n limel-prosemirror-adapter {\n pointer-events: none;\n }\n}\n\n:host(limel-text-editor[invalid]:not([invalid='false'])) {\n --limel-text-editor-outline-color: var(--lime-error-text-color);\n}\n\n:host(limel-text-editor[readonly]:not([readonly='false'])) {\n --limel-text-editor-placeholder-top: 0;\n --limel-text-editor-outline-color: transparent;\n --limel-text-editor-background-color: transparent;\n\n limel-markdown {\n // displayed when `readonly` instead of the adapter\n display: block;\n padding: var(--limel-text-editor-padding);\n overflow-y: auto;\n\n &:before,\n &:after {\n z-index: 1;\n pointer-events: none;\n content: '';\n display: block;\n position: absolute;\n width: 100%;\n }\n &:after {\n height: 1.75rem;\n top: 0;\n background: linear-gradient(\n var(\n --text-editor-fade-out-background-color,\n rgb(var(--contrast-100))\n ),\n transparent\n );\n }\n\n &:before {\n height: 2rem;\n bottom: -0.25rem;\n background: linear-gradient(\n transparent,\n var(\n --text-editor-fade-out-background-color,\n rgb(var(--contrast-100))\n )\n );\n }\n }\n}\n\n.notched-outline {\n transition: bottom\n var(--limel-h-l-grid-template-rows-transition-speed, 0.46s)\n cubic-bezier(1, 0.09, 0, 0.89);\n pointer-events: none;\n position: absolute;\n inset: 0;\n bottom: var(--limel-text-editor-notched-outline-bottom, 0);\n\n display: flex;\n background-color: var(--limel-text-editor-background-color);\n}\n\n.leading-outline,\n.notch,\n.trailing-outline {\n transition: border-color 0.2s ease;\n border-width: 1px;\n border-style: solid;\n border-color: var(--limel-text-editor-outline-color);\n}\n\n.leading-outline {\n flex-shrink: 0;\n width: 0.75rem;\n border-right-width: 0;\n border-top-left-radius: 0.25rem;\n border-bottom-left-radius: 0.25rem;\n}\n\n.notch {\n flex-shrink: 0;\n\n position: relative;\n z-index: 2;\n\n border-top-width: 0;\n border-right-width: 0;\n border-left-width: 0;\n\n max-width: calc(100% - 1.5rem);\n}\n\n.trailing-outline {\n flex-grow: 1;\n border-left-width: 0;\n border-top-right-radius: 0.25rem;\n border-bottom-right-radius: 0.25rem;\n}\n\nlabel {\n transform: translateY(-50%);\n\n @include mixins.truncate-text;\n display: block;\n padding: 0 0.25rem;\n\n color: var(--limel-text-editor-label-color);\n font-size: 0.65rem; // `10.4px` similar to MDC's floating label\n letter-spacing: var(--mdc-typography-subtitle1-letter-spacing, 0.009375em);\n\n :host(limel-text-editor[required]) & {\n &::after {\n content: '*';\n }\n }\n}\n\n.placeholder {\n @include mixins.truncate-text;\n pointer-events: none;\n position: absolute;\n top: var(--limel-text-editor-placeholder-top, 2.25rem);\n left: 0;\n right: 0;\n\n padding: var(--limel-text-editor-padding);\n font-style: italic;\n font-size: 0.875rem;\n color: shared_input-select-picker.$input-placeholder-color;\n}\n\nlimel-prosemirror-adapter {\n flex-grow: 1;\n\n min-width: 0;\n min-height: 0;\n height: 100%;\n overflow: hidden auto;\n}\n\n@include mixins.hide-helper-line-when-not-needed(limel-text-editor);\n:host(limel-text-editor.has-helper-text:focus-within),\n:host(limel-text-editor.has-helper-text[invalid]:not([invalid='false'])) {\n .notched-outline {\n --limel-text-editor-notched-outline-bottom: 1rem;\n }\n}\n\n:host(limel-text-editor[allow-resize]) {\n limel-prosemirror-adapter {\n resize: vertical;\n }\n}\n","import { Component, Event, EventEmitter, Host, Prop, h } from '@stencil/core';\nimport { FormComponent } from '../form/form.types';\nimport { Languages } from '../date-picker/date.types';\nimport { createRandomString } from '../../util/random-string';\n/**\n * A rich text editor that offers a rich text editing experience with markdown support,\n * in the sense that you can easily type markdown syntax and see the rendered\n * result as rich text in real-time. For instance, you can type `# Hello, world!`\n * and see it directly turning to a heading 1 (an `<h1>` HTML element).\n *\n * Naturally, you can use standard keyboard hotkeys such as <kbd>Ctrl</kbd> + <kbd>B</kbd>\n * to toggle bold text, <kbd>Ctrl</kbd> + <kbd>I</kbd> to toggle italic text, and so on.\n *\n * @exampleComponent limel-example-text-editor-basic\n * @exampleComponent limel-example-text-editor-as-form-component\n * @exampleComponent limel-example-text-editor-with-markdown\n * @exampleComponent limel-example-text-editor-with-html\n * @exampleComponent limel-example-text-editor-allow-resize\n * @exampleComponent limel-example-text-editor-size\n * @exampleComponent limel-example-text-editor-composite\n * @beta\n */\n@Component({\n tag: 'limel-text-editor',\n shadow: true,\n styleUrl: 'text-editor.scss',\n})\nexport class TextEditor implements FormComponent<string> {\n /** The type of content that the editor should handle and emit, defaults to `markdown`\n *\n * Assumed to be set only once, so not reactive to changes\n */\n @Prop()\n public contentType: 'markdown' | 'html' = 'markdown';\n\n /**\n * Defines the language for translations.\n */\n @Prop({ reflect: true })\n public language: Languages = 'en';\n\n /**\n * Set to `true` to disable the field.\n * Use `disabled` to indicate that the field can normally be interacted\n * with, but is currently disabled. This tells the user that if certain\n * requirements are met, the field may become enabled again.\n */\n @Prop({ reflect: true })\n public disabled?: boolean = false;\n\n /**\n * Set to `true` to make the component read-only.\n * Use `readonly` when the field is only there to present the data it holds,\n * and will not become possible for the current user to edit.\n * :::note\n * Consider that it might be better to use `limel-markdown`\n * instead of `limel-text-editor` when the goal is visualizing data.\n * :::\n */\n @Prop({ reflect: true })\n public readonly?: boolean = false;\n\n /**\n * Optional helper text to display below the input field when it has focus\n */\n @Prop({ reflect: true })\n public helperText?: string;\n\n /**\n * The placeholder text shown inside the input field,\n * when the field is empty.\n */\n @Prop({ reflect: true })\n public placeholder?: string;\n\n /**\n * The label of the editor\n */\n @Prop({ reflect: true })\n public label?: string;\n\n /**\n * Set to `true` to indicate that the current value of the editor is\n * invalid.\n */\n @Prop({ reflect: true })\n public invalid?: boolean = false;\n\n /**\n * Description of the text inside the editor as markdown\n */\n @Prop({ reflect: true })\n public value: string;\n\n /**\n * Set to `true` to indicate that the field is required.\n *\n * :::important\n * An empty but required field is not automatically considered invalid.\n * You must make sure to check the validity of the field on your own,\n * and properly handle the `invalid` state.\n * :::\n */\n @Prop({ reflect: true })\n public required?: boolean = false;\n\n /**\n * Set to `true` to allow the user to vertically resize the editor.\n * Set to `false` to disable the resize functionality.\n */\n @Prop({ reflect: true })\n public allowResize: boolean = true;\n\n /**\n * Dispatched when a change is made to the editor\n */\n @Event()\n public change: EventEmitter<string>;\n\n private helperTextId: string;\n private editorId: string;\n\n public constructor() {\n this.helperTextId = createRandomString();\n this.editorId = createRandomString();\n }\n\n public render() {\n return (\n <Host\n class={{\n 'has-helper-text': !!this.helperText,\n }}\n >\n <span class=\"notched-outline\">\n <span class=\"leading-outline\" />\n {this.renderLabel()}\n <span class=\"trailing-outline\" />\n </span>\n {this.renderEditor()}\n </Host>\n );\n }\n\n private renderEditor() {\n if (this.readonly && !this.value) {\n return [\n <span class=\"lime-looks-like-input-value\">–</span>,\n this.renderHelperLine(),\n ];\n }\n\n if (this.readonly) {\n return [\n <limel-markdown\n value={this.value}\n aria-controls={this.helperTextId}\n id={this.editorId}\n />,\n this.renderPlaceholder(),\n this.renderHelperLine(),\n ];\n }\n\n return [\n <limel-prosemirror-adapter\n aria-placeholder={this.placeholder}\n contentType={this.contentType}\n onChange={this.handleChange}\n value={this.value}\n aria-controls={this.helperTextId}\n id={this.editorId}\n tabindex={this.disabled ? -1 : 0}\n aria-disabled={this.disabled}\n language={this.language}\n />,\n this.renderPlaceholder(),\n this.renderHelperLine(),\n ];\n }\n\n private renderLabel() {\n if (!this.label) {\n return;\n }\n\n return (\n <span class=\"notch\">\n <label htmlFor={this.editorId}>{this.label}</label>\n </span>\n );\n }\n\n private renderPlaceholder() {\n if (!this.placeholder || this.value) {\n return;\n }\n\n return (\n <span class=\"placeholder\" aria-hidden=\"true\">\n {this.placeholder}\n </span>\n );\n }\n\n private renderHelperLine = () => {\n if (!this.helperText) {\n return;\n }\n\n return (\n <limel-helper-line\n helperText={this.helperText}\n helperTextId={this.helperTextId}\n invalid={this.isInvalid()}\n />\n );\n };\n\n private isInvalid = () => {\n if (this.readonly) {\n // A readonly field can never be invalid.\n return false;\n }\n\n if (this.invalid) {\n return true;\n }\n };\n\n private handleChange = () => (event: CustomEvent<string>) => {\n event.stopPropagation();\n this.change.emit(event.detail);\n };\n}\n"],"version":3}
1
+ {"file":"limel-text-editor.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,aAAa,GAAG,0vMAA0vM;;MC2BnwM,UAAU;EA+FnB;;;IAmFQ,qBAAgB,GAAG;MACvB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;QAClB,OAAO;OACV;MAED,QACIA,+BACI,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,YAAY,EAAE,IAAI,CAAC,YAAY,EAC/B,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,GAC3B,EACJ;KACL,CAAC;IAEM,cAAS,GAAG;MAChB,IAAI,IAAI,CAAC,QAAQ,EAAE;;QAEf,OAAO,KAAK,CAAC;OAChB;MAED,IAAI,IAAI,CAAC,OAAO,EAAE;QACd,OAAO,IAAI,CAAC;OACf;KACJ,CAAC;IAEM,iBAAY,GAAG,MAAM,CAAC,KAA0B;MACpD,KAAK,CAAC,eAAe,EAAE,CAAC;MACxB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;KAClC,CAAC;uBAxMwC,UAAU;oBAMvB,IAAI;oBASL,KAAK;oBAYL,KAAK;;;;mBA0BN,KAAK;;oBAkBJ,KAAK;uBAOH,IAAI;IAY9B,IAAI,CAAC,YAAY,GAAGC,+BAAkB,EAAE,CAAC;IACzC,IAAI,CAAC,QAAQ,GAAGA,+BAAkB,EAAE,CAAC;GACxC;EAEM,MAAM;IACT,QACID,QAACE,UAAI,IACD,KAAK,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BAAO,OAAO,EAAE,IAAI,CAAC,QAAQ,IAAG,IAAI,CAAC,KAAK,CAAS,CAChD,EACT;GACL;EAEO,iBAAiB;IACrB,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,KAAK,EAAE;MACjC,OAAO;KACV;IAED,QACIA,kBAAM,KAAK,EAAC,aAAa,iBAAa,MAAM,IACvC,IAAI,CAAC,WAAW,CACd,EACT;GACL;;;;;;","names":["h","createRandomString","Host"],"sources":["./src/components/text-editor/text-editor.scss?tag=limel-text-editor&encapsulation=shadow","./src/components/text-editor/text-editor.tsx"],"sourcesContent":["@use '../../style/internal/shared_input-select-picker';\n@use '../../style/mixins.scss';\n\n/**\n * @prop --text-editor-max-height: the tallest height the text editor can become when auto-resizing itself. Defaults to `calc(100vh - (env(safe-area-inset-top) + env(safe-area-inset-bottom)) - 4rem)`.\n * @prop --text-editor-fade-out-background-color: the color of the fade-out effect at the top and bottom of the text editor, when the text-editor is in readonly state. Defaults to rgb(var(--contrast-100)).\n */\n\n@include shared_input-select-picker.lime-looks-like-input-value;\n.lime-looks-like-input-value {\n padding: var(--limel-text-editor-padding);\n}\n\n* {\n box-sizing: border-box;\n}\n\n:host(limel-text-editor) {\n --limel-text-editor-outline-color: #{shared_input-select-picker.$lime-text-field-outline-color};\n --limel-text-editor-background-color: #{shared_input-select-picker.$background-color-normal};\n --limel-text-editor-label-color: #{shared_input-select-picker.$label-color};\n --limel-text-editor-padding: 0.75rem 1rem;\n --limel-prosemirror-adapter-toolbar-opacity: 0.6;\n --limel-prosemirror-adapter-toolbar-transition-timing-function: cubic-bezier(\n 0.19,\n 0.23,\n 0.26,\n 0.89\n );\n\n position: relative;\n isolation: isolate;\n display: flex;\n flex-direction: column;\n\n width: 100%;\n min-width: 5rem;\n min-height: 5rem;\n height: 100%;\n max-height: var(\n --text-editor-max-height,\n calc(\n 100vh - (env(safe-area-inset-top) + env(safe-area-inset-bottom)) -\n 4rem\n )\n );\n padding: 1px; // prevents visual defects that can appear due to the backdrop-filter and closeness to borders\n}\n\n:host(limel-text-editor:focus-within),\n:host(limel-text-editor:hover) {\n --limel-prosemirror-adapter-toolbar-opacity: 1;\n}\n\n:host(limel-text-editor:hover) {\n --limel-text-editor-outline-color: #{shared_input-select-picker.$lime-text-field-outline-color--hovered};\n}\n\n:host(limel-text-editor:focus-within) {\n --limel-text-editor-outline-color: #{shared_input-select-picker.$lime-text-field-outline-color--focused};\n}\n\n:host(limel-text-editor[disabled]:not([disabled='false'])) {\n @include shared_input-select-picker.looks-disabled;\n\n limel-prosemirror-adapter {\n pointer-events: none;\n }\n}\n\n:host(limel-text-editor[invalid]:not([invalid='false'])) {\n --limel-text-editor-outline-color: var(--lime-error-text-color);\n}\n\n:host(limel-text-editor[readonly]:not([readonly='false'])) {\n --limel-text-editor-placeholder-top: 0;\n --limel-text-editor-outline-color: transparent;\n --limel-text-editor-background-color: transparent;\n\n limel-markdown {\n // displayed when `readonly` instead of the adapter\n display: block;\n padding: var(--limel-text-editor-padding);\n overflow-y: auto;\n\n &:before,\n &:after {\n z-index: 1;\n pointer-events: none;\n content: '';\n display: block;\n position: absolute;\n width: 100%;\n }\n &:after {\n height: 1.75rem;\n top: 0;\n background: linear-gradient(\n var(\n --text-editor-fade-out-background-color,\n rgb(var(--contrast-100))\n ),\n transparent\n );\n }\n\n &:before {\n height: 2rem;\n bottom: -0.25rem;\n background: linear-gradient(\n transparent,\n var(\n --text-editor-fade-out-background-color,\n rgb(var(--contrast-100))\n )\n );\n }\n }\n}\n\n.notched-outline {\n transition: bottom\n var(--limel-h-l-grid-template-rows-transition-speed, 0.46s)\n cubic-bezier(1, 0.09, 0, 0.89);\n pointer-events: none;\n position: absolute;\n inset: 0;\n bottom: var(--limel-text-editor-notched-outline-bottom, 0);\n\n display: flex;\n background-color: var(--limel-text-editor-background-color);\n}\n\n.leading-outline,\n.notch,\n.trailing-outline {\n transition: border-color 0.2s ease;\n border-width: 1px;\n border-style: solid;\n border-color: var(--limel-text-editor-outline-color);\n}\n\n.leading-outline {\n flex-shrink: 0;\n width: 0.75rem;\n border-right-width: 0;\n border-top-left-radius: 0.25rem;\n border-bottom-left-radius: 0.25rem;\n}\n\n.notch {\n flex-shrink: 0;\n\n position: relative;\n z-index: 2;\n\n border-top-width: 0;\n border-right-width: 0;\n border-left-width: 0;\n\n max-width: calc(100% - 1.5rem);\n}\n\n.trailing-outline {\n flex-grow: 1;\n border-left-width: 0;\n border-top-right-radius: 0.25rem;\n border-bottom-right-radius: 0.25rem;\n}\n\nlabel {\n transform: translateY(-50%);\n\n @include mixins.truncate-text;\n display: block;\n padding: 0 0.25rem;\n\n color: var(--limel-text-editor-label-color);\n font-size: 0.65rem; // `10.4px` similar to MDC's floating label\n letter-spacing: var(--mdc-typography-subtitle1-letter-spacing, 0.009375em);\n\n :host(limel-text-editor[required]) & {\n &::after {\n content: '*';\n }\n }\n}\n\n.placeholder {\n @include mixins.truncate-text;\n pointer-events: none;\n position: absolute;\n top: var(--limel-text-editor-placeholder-top, 2.25rem);\n left: 0;\n right: 0;\n\n padding: var(--limel-text-editor-padding);\n font-style: italic;\n font-size: 0.875rem;\n color: shared_input-select-picker.$input-placeholder-color;\n}\n\nlimel-prosemirror-adapter {\n flex-grow: 1;\n\n min-width: 0;\n min-height: 0;\n height: 100%;\n overflow: hidden auto;\n}\n\n@include mixins.hide-helper-line-when-not-needed(limel-text-editor);\n:host(limel-text-editor.has-helper-text:focus-within),\n:host(limel-text-editor.has-helper-text[invalid]:not([invalid='false'])) {\n .notched-outline {\n --limel-text-editor-notched-outline-bottom: 1rem;\n }\n}\n\n:host(limel-text-editor[allow-resize]) {\n limel-prosemirror-adapter {\n resize: vertical;\n }\n}\n","import { Component, Event, EventEmitter, Host, Prop, h } from '@stencil/core';\nimport { FormComponent } from '../form/form.types';\nimport { Languages } from '../date-picker/date.types';\nimport { createRandomString } from '../../util/random-string';\n/**\n * A rich text editor that offers a rich text editing experience with markdown support,\n * in the sense that you can easily type markdown syntax and see the rendered\n * result as rich text in real-time. For instance, you can type `# Hello, world!`\n * and see it directly turning to a heading 1 (an `<h1>` HTML element).\n *\n * Naturally, you can use standard keyboard hotkeys such as <kbd>Ctrl</kbd> + <kbd>B</kbd>\n * to toggle bold text, <kbd>Ctrl</kbd> + <kbd>I</kbd> to toggle italic text, and so on.\n *\n * @exampleComponent limel-example-text-editor-basic\n * @exampleComponent limel-example-text-editor-as-form-component\n * @exampleComponent limel-example-text-editor-with-markdown\n * @exampleComponent limel-example-text-editor-with-html\n * @exampleComponent limel-example-text-editor-allow-resize\n * @exampleComponent limel-example-text-editor-size\n * @exampleComponent limel-example-text-editor-composite\n * @beta\n */\n@Component({\n tag: 'limel-text-editor',\n shadow: true,\n styleUrl: 'text-editor.scss',\n})\nexport class TextEditor implements FormComponent<string> {\n /** The type of content that the editor should handle and emit, defaults to `markdown`\n *\n * Assumed to be set only once, so not reactive to changes\n */\n @Prop()\n public contentType: 'markdown' | 'html' = 'markdown';\n\n /**\n * Defines the language for translations.\n */\n @Prop({ reflect: true })\n public language: Languages = 'en';\n\n /**\n * Set to `true` to disable the field.\n * Use `disabled` to indicate that the field can normally be interacted\n * with, but is currently disabled. This tells the user that if certain\n * requirements are met, the field may become enabled again.\n */\n @Prop({ reflect: true })\n public disabled?: boolean = false;\n\n /**\n * Set to `true` to make the component read-only.\n * Use `readonly` when the field is only there to present the data it holds,\n * and will not become possible for the current user to edit.\n * :::note\n * Consider that it might be better to use `limel-markdown`\n * instead of `limel-text-editor` when the goal is visualizing data.\n * :::\n */\n @Prop({ reflect: true })\n public readonly?: boolean = false;\n\n /**\n * Optional helper text to display below the input field when it has focus\n */\n @Prop({ reflect: true })\n public helperText?: string;\n\n /**\n * The placeholder text shown inside the input field,\n * when the field is empty.\n */\n @Prop({ reflect: true })\n public placeholder?: string;\n\n /**\n * The label of the editor\n */\n @Prop({ reflect: true })\n public label?: string;\n\n /**\n * Set to `true` to indicate that the current value of the editor is\n * invalid.\n */\n @Prop({ reflect: true })\n public invalid?: boolean = false;\n\n /**\n * Description of the text inside the editor as markdown\n */\n @Prop({ reflect: true })\n public value: string;\n\n /**\n * Set to `true` to indicate that the field is required.\n *\n * :::important\n * An empty but required field is not automatically considered invalid.\n * You must make sure to check the validity of the field on your own,\n * and properly handle the `invalid` state.\n * :::\n */\n @Prop({ reflect: true })\n public required?: boolean = false;\n\n /**\n * Set to `true` to allow the user to vertically resize the editor.\n * Set to `false` to disable the resize functionality.\n */\n @Prop({ reflect: true })\n public allowResize: boolean = true;\n\n /**\n * Dispatched when a change is made to the editor\n */\n @Event()\n public change: EventEmitter<string>;\n\n private helperTextId: string;\n private editorId: string;\n\n public constructor() {\n this.helperTextId = createRandomString();\n this.editorId = createRandomString();\n }\n\n public render() {\n return (\n <Host\n class={{\n 'has-helper-text': !!this.helperText,\n }}\n >\n <span class=\"notched-outline\">\n <span class=\"leading-outline\" />\n {this.renderLabel()}\n <span class=\"trailing-outline\" />\n </span>\n {this.renderEditor()}\n </Host>\n );\n }\n\n private renderEditor() {\n if (this.readonly && !this.value) {\n return [\n <span class=\"lime-looks-like-input-value\">–</span>,\n this.renderHelperLine(),\n ];\n }\n\n if (this.readonly) {\n return [\n <limel-markdown\n value={this.value}\n aria-controls={this.helperTextId}\n id={this.editorId}\n />,\n this.renderPlaceholder(),\n this.renderHelperLine(),\n ];\n }\n\n return [\n <limel-prosemirror-adapter\n aria-placeholder={this.placeholder}\n contentType={this.contentType}\n onChange={this.handleChange}\n value={this.value}\n aria-controls={this.helperTextId}\n id={this.editorId}\n tabindex={this.disabled ? -1 : undefined}\n aria-disabled={this.disabled}\n language={this.language}\n />,\n this.renderPlaceholder(),\n this.renderHelperLine(),\n ];\n }\n\n private renderLabel() {\n if (!this.label) {\n return;\n }\n\n return (\n <span class=\"notch\">\n <label htmlFor={this.editorId}>{this.label}</label>\n </span>\n );\n }\n\n private renderPlaceholder() {\n if (!this.placeholder || this.value) {\n return;\n }\n\n return (\n <span class=\"placeholder\" aria-hidden=\"true\">\n {this.placeholder}\n </span>\n );\n }\n\n private renderHelperLine = () => {\n if (!this.helperText) {\n return;\n }\n\n return (\n <limel-helper-line\n helperText={this.helperText}\n helperTextId={this.helperTextId}\n invalid={this.isInvalid()}\n />\n );\n };\n\n private isInvalid = () => {\n if (this.readonly) {\n // A readonly field can never be invalid.\n return false;\n }\n\n if (this.invalid) {\n return true;\n }\n };\n\n private handleChange = () => (event: CustomEvent<string>) => {\n event.stopPropagation();\n this.change.emit(event.detail);\n };\n}\n"],"version":3}
@@ -126,13 +126,13 @@ export class Table {
126
126
  this.formatRows();
127
127
  }
128
128
  updateData(newData = [], oldData = []) {
129
- this.pool.releaseAll();
130
129
  const shouldReplace = this.shouldReplaceData(newData, oldData);
131
130
  setTimeout(() => {
132
131
  if (!this.tabulator) {
133
132
  return;
134
133
  }
135
134
  if (shouldReplace) {
135
+ this.pool.releaseAll();
136
136
  this.tabulator.replaceData(newData);
137
137
  this.setSelection();
138
138
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"table.js","sourceRoot":"","sources":["../../../src/components/table/table.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,CAAC,EACD,IAAI,EACJ,OAAO,EACP,KAAK,EAEL,KAAK,EACL,IAAI,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAQ9C,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAU,MAAM,UAAU,CAAC;AAE7C,MAAM,UAAU,GAAG,CAAC,CAAC;AAErB;;;;;;;;;;;;;;;;GAgBG;AAMH,MAAM,OAAO,KAAK;EA2Jd;IAkfQ,kBAAa,GAAmC,GAAG,E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CAAC;EAEO,kBAAkB;IACtB,MAAM,gBAAgB,GAClB,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,YAAY,CAAC;IAE5D,OAAO,CACH,WACI,EAAE,EAAC,sBAAsB,EACzB,KAAK,EAAE,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE;MAEtD,gBAAO,IAAI,CAAC,YAAY,CAAQ,CAC9B,CACT,CAAC;EACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import {\n Component,\n h,\n Prop,\n Element,\n Watch,\n EventEmitter,\n Event,\n Host,\n} from '@stencil/core';\nimport TabulatorTable from 'tabulator-tables';\nimport {\n Column,\n TableParams,\n ColumnSorter,\n ColumnAggregate,\n RowData,\n} from './table.types';\nimport { ColumnDefinitionFactory, createColumnSorter } from './columns';\nimport { isEqual, has } from 'lodash-es';\nimport { ElementPool } from './element-pool';\nimport { TableSelection } from './table-selection';\nimport { mapLayout, Layout } from './layout';\n\nconst FIRST_PAGE = 1;\n\n/**\n * @exampleComponent limel-example-table\n * @exampleComponent limel-example-table-custom-components\n * @exampleComponent limel-example-table-header-menu\n * @exampleComponent limel-example-table-movable-columns\n * @exampleComponent limel-example-table-sorting-disabled\n * @exampleComponent limel-example-table-local\n * @exampleComponent limel-example-table-remote\n * @exampleComponent limel-example-table-activate-row\n * @exampleComponent limel-example-table-selectable-rows\n * @exampleComponent limel-example-table-default-sorted\n * @exampleComponent limel-example-table-layout-default\n * @exampleComponent limel-example-table-layout-stretch-last-column\n * @exampleComponent limel-example-table-layout-stretch-columns\n * @exampleComponent limel-example-table-layout-low-density\n * @exampleComponent limel-example-table-interactive-rows\n */\n@Component({\n tag: 'limel-table',\n styleUrl: 'table.scss',\n shadow: true,\n})\nexport class Table {\n /**\n * Data to be displayed in the table\n */\n @Prop()\n public data: object[] = [];\n\n /**\n * Columns used to display the data\n */\n @Prop()\n public columns: Column[] = [];\n\n /**\n * Set to either `local` or `remote` to change how the table handles the\n * loaded data. When in `local` mode, all sorting and pagination will be\n * done locally with the data given. When in `remote` mode, the consumer\n * is responsible to give the table new data when a `load` event occurs\n */\n @Prop()\n public mode: 'local' | 'remote' = 'local';\n\n /**\n * Defines the layout of the table, based on how width of the columns are calculated.\n *\n * - `default`: makes columns as wide as their contents.\n * - `stretchLastColumn`: makes columns as wide as their contents, stretch the last column to fill up the remaining table width.\n * - `stretchColumns`: stretches all columns to fill the available width when possible.\n * - `lowDensity`: makes columns as wide as their contents, and creates a low density and airy layout.\n */\n @Prop()\n public layout: Layout;\n\n /**\n * Number of rows per page\n */\n @Prop()\n public pageSize: number;\n\n /**\n * The number of total rows available for the data\n */\n @Prop()\n public totalRows: number;\n\n /**\n * The initial sorted columns\n */\n @Prop()\n public sorting: ColumnSorter[] = [];\n\n /**\n * Active row in the table\n */\n @Prop({ mutable: true })\n public activeRow: RowData;\n\n /**\n * Set to `true` to enable reordering of the columns by dragging them\n */\n @Prop()\n public movableColumns: boolean;\n\n /**\n * Set to `true` to trigger loading animation\n */\n @Prop()\n public loading: boolean = false;\n\n /**\n * The page to show\n */\n @Prop()\n public page: number = FIRST_PAGE;\n\n /**\n * Emitted when `mode` is `local` the data is sorted\n */\n @Event()\n public sort: EventEmitter<ColumnSorter[]>;\n\n /**\n * Emitted when a new page has been set\n */\n @Event()\n public changePage: EventEmitter<number>;\n\n /**\n * A message to display when the table has no data\n */\n @Prop()\n public emptyMessage: string;\n\n /**\n * Column aggregates to be displayed in the table\n */\n @Prop()\n public aggregates: ColumnAggregate[];\n\n /**\n * Enables row selection\n */\n @Prop()\n public selectable: boolean;\n\n /**\n * Selected data. Requires `selectable` to be true.\n */\n @Prop()\n public selection: object[];\n\n /**\n * Emitted when `mode` is `remote` and the table is loading new data. The\n * consumer is responsible for giving the table new data\n */\n @Event()\n public load: EventEmitter<TableParams>;\n\n /**\n * Emitted when a row is activated\n */\n @Event()\n public activate: EventEmitter<object>;\n\n /**\n * Emitted when the columns have been changed\n */\n @Event()\n public changeColumns: EventEmitter<Column[]>;\n\n /**\n * Emitted when the row selection has been changed\n */\n @Event()\n public select: EventEmitter<object[]>;\n\n /**\n * Emitted when the select all rows state is toggled\n */\n @Event()\n public selectAll: EventEmitter<boolean>;\n\n @Element()\n private host: HTMLLimelTableElement;\n\n private currentLoad: { page: number; sorters: ColumnSorter[] };\n\n private tabulator: Tabulator;\n\n private pool: ElementPool;\n private columnFactory: ColumnDefinitionFactory;\n private firstRequest: boolean;\n private currentSorting: ColumnSorter[];\n private tableSelection: TableSelection;\n\n constructor() {\n this.handleDataSorting = this.handleDataSorting.bind(this);\n this.handlePageLoaded = this.handlePageLoaded.bind(this);\n this.handleAjaxRequesting = this.handleAjaxRequesting.bind(this);\n this.requestData = this.requestData.bind(this);\n this.onClickRow = this.onClickRow.bind(this);\n this.formatRow = this.formatRow.bind(this);\n this.formatRows = this.formatRows.bind(this);\n this.updateMaxPage = this.updateMaxPage.bind(this);\n this.initTabulatorComponent = this.initTabulatorComponent.bind(this);\n this.setSelection = this.setSelection.bind(this);\n this.addColumnAggregator = this.addColumnAggregator.bind(this);\n this.pool = new ElementPool(document);\n this.columnFactory = new ColumnDefinitionFactory(this.pool);\n }\n\n public componentWillLoad() {\n this.firstRequest = this.mode === 'remote';\n this.initTableSelection();\n }\n\n public componentDidLoad() {\n this.init();\n }\n\n public disconnectedCallback() {\n this.pool.clear();\n }\n\n @Watch('totalRows')\n protected totalRowsChanged() {\n this.updateMaxPage();\n }\n\n @Watch('pageSize')\n protected pageSizeChanged() {\n this.updateMaxPage();\n }\n\n @Watch('page')\n protected pageChanged() {\n if (!this.tabulator) {\n return;\n }\n\n if (this.tabulator.getPage() === this.page) {\n return;\n }\n\n this.tabulator.setPage(this.page);\n }\n\n @Watch('activeRow')\n protected activeRowChanged() {\n if (!this.tabulator) {\n return;\n }\n\n this.formatRows();\n }\n\n @Watch('data')\n protected updateData(newData: RowData[] = [], oldData: RowData[] = []) {\n this.pool.releaseAll();\n\n const shouldReplace = this.shouldReplaceData(newData, oldData);\n\n setTimeout(() => {\n if (!this.tabulator) {\n return;\n }\n\n if (shouldReplace) {\n this.tabulator.replaceData(newData);\n this.setSelection();\n\n return;\n }\n\n this.tabulator.updateOrAddData(newData);\n });\n }\n\n @Watch('columns')\n protected updateColumns(newColumns: Column[], oldColumns: Column[]) {\n if (!this.tabulator) {\n return;\n }\n\n if (this.areSameColumns(newColumns, oldColumns)) {\n return;\n }\n\n const columnsInTable = this.tabulator\n .getColumns()\n .filter((c) => c.getField());\n\n const oldColumnsInTable = columnsInTable.map((c) =>\n oldColumns.find((old) => old.field === c.getField()),\n );\n\n if (this.areSameColumns(newColumns, oldColumnsInTable)) {\n return;\n }\n\n // Updating columns requires a reinitialization otherwise sorting will not work\n // afterwards\n this.init();\n }\n\n @Watch('aggregates')\n protected updateAggregates(\n newAggregates: ColumnAggregate[],\n oldAggregates: ColumnAggregate[],\n ) {\n if (!this.tabulator) {\n return;\n }\n\n if (isEqual(newAggregates, oldAggregates)) {\n return;\n }\n\n if (!this.haveSameAggregateFields(newAggregates, oldAggregates)) {\n this.init();\n\n return;\n }\n\n this.tabulator.recalc();\n this.tabulator.rowManager.redraw();\n }\n\n @Watch('selection')\n protected updateSelection(newSelection: any[]) {\n if (!this.tableSelection) {\n return;\n }\n\n this.tableSelection.setSelection(newSelection);\n }\n\n @Watch('selectable')\n protected updateSelectable() {\n if (this.tableSelection && !this.selectable) {\n this.tableSelection = null;\n }\n\n this.initTableSelection();\n this.init();\n }\n\n @Watch('sorting')\n protected updateSorting(\n newValue: ColumnSorter[],\n oldValue: ColumnSorter[],\n ) {\n const newSorting = this.getColumnSorter(newValue);\n const oldSorting = this.getColumnSorter(oldValue);\n if (isEqual(newSorting, oldSorting)) {\n return;\n }\n\n this.tabulator.setSort(newSorting);\n }\n\n private shouldReplaceData(newData: RowData[], oldData: RowData[]) {\n const newIds = newData.map((item) => item.id ?? item) as Array<\n string | number\n >;\n const oldIds = oldData.map((item) => item.id ?? item) as Array<\n string | number\n >;\n\n return (\n !this.areEqualIds(newIds, oldIds) ||\n !this.isSameOrder(newIds, oldIds)\n );\n }\n\n private areEqualIds(\n newIds: Array<string | number>,\n oldIds: Array<string | number>,\n ): boolean {\n const newIdSet = new Set(newIds);\n const oldIdSet = new Set(oldIds);\n\n return (\n newIdSet.size === oldIdSet.size &&\n newIds.every((id) => oldIdSet.has(id))\n );\n }\n\n private isSameOrder(\n newIds: Array<string | number>,\n oldIds: Array<string | number>,\n ): boolean {\n return newIds.every((id, index) => id === oldIds[index]);\n }\n\n private areSameColumns(newColumns: Column[], oldColumns: Column[]) {\n return (\n newColumns.length === oldColumns.length &&\n newColumns.every((column) => oldColumns.includes(column))\n );\n }\n\n private haveSameAggregateFields(\n newAggregates: ColumnAggregate[],\n oldAggregates: ColumnAggregate[],\n ) {\n const oldAggregateFields = oldAggregates?.map((a) => a.field) || [];\n\n return (\n newAggregates?.length === oldAggregates?.length &&\n !!newAggregates?.every((a) => oldAggregateFields.includes(a.field))\n );\n }\n\n private init() {\n if (this.tabulator) {\n this.pool.releaseAll();\n this.tabulator.destroy();\n }\n\n const table: HTMLElement =\n this.host.shadowRoot.querySelector('#tabulator-table');\n this.initTabulatorComponent(table);\n }\n\n /*\n * Tabulator requires that the html element it's rendered inside\n * has a size before it's created, otherwise it doesn't consider\n * it self renderedy completely. (the callback \"renderComplete\"\n * is never run).\n *\n * @param table {HTMLElement}\n *\n */\n private initTabulatorComponent(table: HTMLElement) {\n // Some browsers do not implement the ResizeObserver API...\n // If that's the case lets just create the table no\n // matter if its rendered or not.\n if (!('ResizeObserver' in window)) {\n this.tabulator = new TabulatorTable(table, this.getOptions());\n this.setSelection();\n\n return;\n }\n\n const observer = new ResizeObserver(() => {\n this.tabulator = new TabulatorTable(table, this.getOptions());\n this.setSelection();\n observer.unobserve(table);\n });\n observer.observe(table);\n }\n\n private initTableSelection() {\n if (this.selectable) {\n this.tableSelection = new TableSelection(\n () => this.tabulator,\n this.pool,\n this.select,\n );\n this.tableSelection.setSelection(this.selection);\n }\n }\n\n private setSelection() {\n if (!(this.tabulator && this.tableSelection)) {\n return;\n }\n\n this.tableSelection.setSelection(this.selection);\n }\n\n private updateMaxPage() {\n this.tabulator?.setMaxPage(this.calculatePageCount());\n }\n\n private getOptions(): Tabulator.Options {\n const ajaxOptions = this.getAjaxOptions();\n const paginationOptions = this.getPaginationOptions();\n const columnOptions = this.getColumnOptions();\n\n return {\n data: this.data,\n layout: mapLayout(this.layout),\n columns: this.getColumnDefinitions(),\n dataSorting: this.handleDataSorting,\n pageLoaded: this.handlePageLoaded,\n ...ajaxOptions,\n ...paginationOptions,\n rowClick: this.onClickRow,\n rowFormatter: this.formatRow,\n initialSort: this.getInitialSorting(),\n nestedFieldSeparator: false,\n ...columnOptions,\n };\n }\n\n private getInitialSorting(): Tabulator.Sorter[] {\n if (this.currentSorting && this.currentSorting.length) {\n return this.getColumnSorter(this.currentSorting);\n }\n\n return this.getColumnSorter(this.sorting);\n }\n\n private getColumnSorter(sorting: ColumnSorter[]): Tabulator.Sorter[] {\n return sorting.map((sorter: ColumnSorter) => {\n return {\n column: String(sorter.column.field),\n dir: sorter.direction.toLocaleLowerCase() as Tabulator.SortDirection,\n };\n });\n }\n\n private getColumnDefinitions(): Tabulator.ColumnDefinition[] {\n const columnDefinitions = this.columns\n .map(this.addColumnAggregator)\n .map(this.columnFactory.create);\n\n if (this.tableSelection) {\n return this.tableSelection.getColumnDefinitions(columnDefinitions);\n }\n\n return columnDefinitions;\n }\n\n private addColumnAggregator(column: Column<any>): Column<any> {\n if (!this.aggregates?.length || column.aggregator) {\n return column;\n }\n\n const aggregate = this.aggregates.find((a) => a.field === column.field);\n if (aggregate) {\n column.aggregator = (\n col?: Column,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _values?: any[],\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _data?: any[],\n ) => {\n if (!col) {\n return undefined;\n }\n\n const value = this.aggregates.find(\n (a) => a.field === col.field,\n )?.value;\n\n if (col.formatter) {\n return col.formatter(value);\n }\n\n return value;\n };\n }\n\n return column;\n }\n\n private getAjaxOptions(): Tabulator.OptionsData {\n if (!this.isRemoteMode()) {\n return {};\n }\n\n // Tabulator needs a URL to be set, even though this one will never be\n // used since we have our own custom `ajaxRequestFunc`\n const remoteUrl = 'https://localhost';\n\n return {\n ajaxSorting: true,\n ajaxURL: remoteUrl,\n ajaxRequestFunc: this.requestData,\n ajaxRequesting: this.handleAjaxRequesting,\n };\n }\n\n /*\n * The ajaxRequesting callback is triggered when ever an ajax request is made.\n *\n * Tabulator is requesting data with an AJAX request even though it has been\n * given data when it was created.\n *\n * It seems unnecessary for us to emit the `load` event as well when this\n * happens, since we can just initialize the table with the data that has been\n * given to us. Therefore, we abort the request if:\n *\n * * its the first time this method is called and,\n * * data has been sent in to the component as a prop\n *\n */\n private handleAjaxRequesting() {\n const abortRequest = this.firstRequest && !!this.data?.length;\n this.firstRequest = false;\n\n if (abortRequest) {\n setTimeout(() => {\n this.updateMaxPage();\n this.tabulator.replaceData(this.data);\n });\n\n return false;\n }\n\n return true;\n }\n\n private getPaginationOptions(): Tabulator.OptionsPagination {\n if (!this.pageSize) {\n return {};\n }\n\n return {\n pagination: this.isRemoteMode() ? 'remote' : 'local',\n paginationSize: this.pageSize,\n paginationInitialPage: this.page,\n };\n }\n\n private requestData(_, __, params: any): Promise<object> {\n const sorters = params.sorters;\n const currentPage = params.page;\n\n if (this.page !== currentPage) {\n this.changePage.emit(currentPage);\n }\n\n const columnSorters = sorters.map(createColumnSorter(this.columns));\n\n const load = {\n page: currentPage,\n sorters: columnSorters,\n };\n\n // In order to make limel-table behave more like a controlled component,\n // we always return the existing data from this function, therefore\n // relying on the consumer component to handle the loading\n // state via the loading prop, if it actually decides to load new data.\n const resolveExistingData = Promise.resolve({\n last_page: this.calculatePageCount(), // eslint-disable-line camelcase\n data: this.data,\n });\n\n if (isEqual(this.currentLoad, load)) {\n return resolveExistingData;\n }\n\n this.currentSorting = columnSorters;\n this.currentLoad = load;\n this.load.emit(load);\n\n return resolveExistingData;\n }\n\n private isRemoteMode(): boolean {\n return this.mode === 'remote';\n }\n\n private handleDataSorting(sorters: Tabulator.Sorter[]): void {\n if (this.isRemoteMode()) {\n return;\n }\n\n const columnSorters = sorters.map(createColumnSorter(this.columns));\n if (columnSorters.length === 0) {\n return;\n }\n\n this.sort.emit(columnSorters);\n }\n\n private handlePageLoaded(page: number): void {\n if (this.isRemoteMode()) {\n return;\n }\n\n this.changePage.emit(page);\n }\n\n private onClickRow(_ev, row: Tabulator.RowComponent): void {\n if (typeof row.getPosition === 'undefined') {\n // Not a data row, probably a CalcComponent\n return;\n }\n\n if (this.isActiveRow(row)) {\n this.activeRow = null;\n } else {\n this.activeRow = row.getData();\n }\n\n this.activate.emit(this.activeRow);\n }\n\n private getActiveRows: () => Tabulator.RowComponent[] = () => {\n if (!this.tabulator) {\n return [];\n }\n\n return this.tabulator.getRows('active');\n };\n\n private getActiveRowsData: () => object[] = () => {\n // Note: Tabulator.getData() creates copies of each data object\n // and will break this.selection.has checks, hence why this function\n // intentionally retrieves the data using the row components\n return this.getActiveRows().map((row) => row.getData());\n };\n\n private selectAllOnChange = (ev: CustomEvent<boolean>) => {\n const selectAll = ev.detail;\n\n ev.stopPropagation();\n ev.preventDefault();\n\n const newSelection = selectAll ? this.getActiveRowsData() : [];\n this.select.emit(newSelection);\n this.tableSelection.setSelection(newSelection);\n this.selectAll.emit(selectAll);\n };\n\n private formatRows() {\n this.tabulator.getRows().forEach(this.formatRow);\n }\n\n private formatRow(row: Tabulator.RowComponent) {\n if (this.isActiveRow(row)) {\n row.getElement().classList.add('active');\n } else {\n row.getElement().classList.remove('active');\n }\n\n const interactiveFeedbackElement = row\n .getElement()\n .getElementsByClassName('interactive-feedback');\n if (interactiveFeedbackElement.length === 0) {\n const element = row.getElement().ownerDocument.createElement('div');\n element.classList.add('interactive-feedback');\n row.getElement().prepend(element);\n }\n }\n\n private isActiveRow(row: Tabulator.RowComponent) {\n if (!this.activeRow) {\n return false;\n }\n\n const activeRowId = this.activeRow.id ?? null;\n\n if (activeRowId !== null) {\n return activeRowId === row.getData().id;\n }\n\n return this.activeRow === row.getData();\n }\n\n private calculatePageCount(): number {\n let total = this.totalRows;\n if (!total) {\n total = this.data.length;\n }\n\n return Math.ceil(total / this.pageSize);\n }\n\n private hasAggregation(columns: Column[]): boolean {\n return columns.some((column) => has(column, 'aggregator'));\n }\n\n private getColumnOptions = (): Tabulator.OptionsColumns => {\n if (!this.movableColumns) {\n return {};\n }\n\n return {\n movableColumns: true,\n columnMoved: this.handleMoveColumn,\n };\n };\n\n private handleMoveColumn = (_, components: Tabulator.ColumnComponent[]) => {\n const columns = components.map(this.findColumn).filter((c) => c);\n this.changeColumns.emit(columns);\n };\n\n private findColumn = (component: Tabulator.ColumnComponent): Column => {\n return this.columns.find((column) => {\n return (\n column.field === component.getField() &&\n column.title === component.getDefinition().title\n );\n });\n };\n\n render() {\n return (\n <Host\n class={{\n 'has-low-density': this.layout === 'lowDensity',\n }}\n >\n <div\n id=\"tabulator-container\"\n class={{\n 'has-pagination': this.totalRows > this.pageSize,\n 'has-aggregation': this.hasAggregation(this.columns),\n 'has-movable-columns': this.movableColumns,\n 'has-rowselector': this.selectable,\n 'has-selection': this.tableSelection?.hasSelection,\n }}\n >\n {/* Toggle style instead of removing the loader\n because removing the element will cause a rerender, breaking the\n tabulator table */}\n <div\n id=\"tabulator-loader\"\n style={{ display: this.loading ? 'flex' : 'none' }}\n >\n <limel-spinner size=\"large\" />\n </div>\n {this.renderEmptyMessage()}\n {this.renderSelectAll()}\n <div id=\"tabulator-table\" />\n </div>\n </Host>\n );\n }\n\n private renderSelectAll() {\n if (!this.selectable) {\n return;\n }\n\n const showSelectAll = !this.loading && this.tableSelection;\n\n return (\n <div\n class=\"select-all\"\n style={{ display: showSelectAll ? 'inline-block' : 'none' }}\n >\n <limel-checkbox\n onChange={this.selectAllOnChange}\n disabled={!this.data.length}\n checked={this.tableSelection?.hasSelection}\n indeterminate={\n this.tableSelection?.hasSelection &&\n this.selection?.length < this.data.length\n }\n />\n </div>\n );\n }\n\n private renderEmptyMessage() {\n const showEmptyMessage =\n !this.loading && !this.data.length && this.emptyMessage;\n\n return (\n <div\n id=\"tabulator-empty-text\"\n style={{ display: showEmptyMessage ? 'flex' : 'none' }}\n >\n <span>{this.emptyMessage}</span>\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"table.js","sourceRoot":"","sources":["../../../src/components/table/table.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,CAAC,EACD,IAAI,EACJ,OAAO,EACP,KAAK,EAEL,KAAK,EACL,IAAI,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAQ9C,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO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AAE,MAAA,IAAI,CAAC,cAAc,0CAAE,YAAY,EAC1C,aAAa,EACT,CAAA,MAAA,IAAI,CAAC,cAAc,0CAAE,YAAY;UACjC,CAAA,MAAA,IAAI,CAAC,SAAS,0CAAE,MAAM,IAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAE/C,CACA,CACT,CAAC;EACN,CAAC;EAEO,kBAAkB;IACtB,MAAM,gBAAgB,GAClB,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,YAAY,CAAC;IAE5D,OAAO,CACH,WACI,EAAE,EAAC,sBAAsB,EACzB,KAAK,EAAE,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE;MAEtD,gBAAO,IAAI,CAAC,YAAY,CAAQ,CAC9B,CACT,CAAC;EACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import {\n Component,\n h,\n Prop,\n Element,\n Watch,\n EventEmitter,\n Event,\n Host,\n} from '@stencil/core';\nimport TabulatorTable from 'tabulator-tables';\nimport {\n Column,\n TableParams,\n ColumnSorter,\n ColumnAggregate,\n RowData,\n} from './table.types';\nimport { ColumnDefinitionFactory, createColumnSorter } from './columns';\nimport { isEqual, has } from 'lodash-es';\nimport { ElementPool } from './element-pool';\nimport { TableSelection } from './table-selection';\nimport { mapLayout, Layout } from './layout';\n\nconst FIRST_PAGE = 1;\n\n/**\n * @exampleComponent limel-example-table\n * @exampleComponent limel-example-table-custom-components\n * @exampleComponent limel-example-table-header-menu\n * @exampleComponent limel-example-table-movable-columns\n * @exampleComponent limel-example-table-sorting-disabled\n * @exampleComponent limel-example-table-local\n * @exampleComponent limel-example-table-remote\n * @exampleComponent limel-example-table-activate-row\n * @exampleComponent limel-example-table-selectable-rows\n * @exampleComponent limel-example-table-default-sorted\n * @exampleComponent limel-example-table-layout-default\n * @exampleComponent limel-example-table-layout-stretch-last-column\n * @exampleComponent limel-example-table-layout-stretch-columns\n * @exampleComponent limel-example-table-layout-low-density\n * @exampleComponent limel-example-table-interactive-rows\n */\n@Component({\n tag: 'limel-table',\n styleUrl: 'table.scss',\n shadow: true,\n})\nexport class Table {\n /**\n * Data to be displayed in the table\n */\n @Prop()\n public data: object[] = [];\n\n /**\n * Columns used to display the data\n */\n @Prop()\n public columns: Column[] = [];\n\n /**\n * Set to either `local` or `remote` to change how the table handles the\n * loaded data. When in `local` mode, all sorting and pagination will be\n * done locally with the data given. When in `remote` mode, the consumer\n * is responsible to give the table new data when a `load` event occurs\n */\n @Prop()\n public mode: 'local' | 'remote' = 'local';\n\n /**\n * Defines the layout of the table, based on how width of the columns are calculated.\n *\n * - `default`: makes columns as wide as their contents.\n * - `stretchLastColumn`: makes columns as wide as their contents, stretch the last column to fill up the remaining table width.\n * - `stretchColumns`: stretches all columns to fill the available width when possible.\n * - `lowDensity`: makes columns as wide as their contents, and creates a low density and airy layout.\n */\n @Prop()\n public layout: Layout;\n\n /**\n * Number of rows per page\n */\n @Prop()\n public pageSize: number;\n\n /**\n * The number of total rows available for the data\n */\n @Prop()\n public totalRows: number;\n\n /**\n * The initial sorted columns\n */\n @Prop()\n public sorting: ColumnSorter[] = [];\n\n /**\n * Active row in the table\n */\n @Prop({ mutable: true })\n public activeRow: RowData;\n\n /**\n * Set to `true` to enable reordering of the columns by dragging them\n */\n @Prop()\n public movableColumns: boolean;\n\n /**\n * Set to `true` to trigger loading animation\n */\n @Prop()\n public loading: boolean = false;\n\n /**\n * The page to show\n */\n @Prop()\n public page: number = FIRST_PAGE;\n\n /**\n * Emitted when `mode` is `local` the data is sorted\n */\n @Event()\n public sort: EventEmitter<ColumnSorter[]>;\n\n /**\n * Emitted when a new page has been set\n */\n @Event()\n public changePage: EventEmitter<number>;\n\n /**\n * A message to display when the table has no data\n */\n @Prop()\n public emptyMessage: string;\n\n /**\n * Column aggregates to be displayed in the table\n */\n @Prop()\n public aggregates: ColumnAggregate[];\n\n /**\n * Enables row selection\n */\n @Prop()\n public selectable: boolean;\n\n /**\n * Selected data. Requires `selectable` to be true.\n */\n @Prop()\n public selection: object[];\n\n /**\n * Emitted when `mode` is `remote` and the table is loading new data. The\n * consumer is responsible for giving the table new data\n */\n @Event()\n public load: EventEmitter<TableParams>;\n\n /**\n * Emitted when a row is activated\n */\n @Event()\n public activate: EventEmitter<object>;\n\n /**\n * Emitted when the columns have been changed\n */\n @Event()\n public changeColumns: EventEmitter<Column[]>;\n\n /**\n * Emitted when the row selection has been changed\n */\n @Event()\n public select: EventEmitter<object[]>;\n\n /**\n * Emitted when the select all rows state is toggled\n */\n @Event()\n public selectAll: EventEmitter<boolean>;\n\n @Element()\n private host: HTMLLimelTableElement;\n\n private currentLoad: { page: number; sorters: ColumnSorter[] };\n\n private tabulator: Tabulator;\n\n private pool: ElementPool;\n private columnFactory: ColumnDefinitionFactory;\n private firstRequest: boolean;\n private currentSorting: ColumnSorter[];\n private tableSelection: TableSelection;\n\n constructor() {\n this.handleDataSorting = this.handleDataSorting.bind(this);\n this.handlePageLoaded = this.handlePageLoaded.bind(this);\n this.handleAjaxRequesting = this.handleAjaxRequesting.bind(this);\n this.requestData = this.requestData.bind(this);\n this.onClickRow = this.onClickRow.bind(this);\n this.formatRow = this.formatRow.bind(this);\n this.formatRows = this.formatRows.bind(this);\n this.updateMaxPage = this.updateMaxPage.bind(this);\n this.initTabulatorComponent = this.initTabulatorComponent.bind(this);\n this.setSelection = this.setSelection.bind(this);\n this.addColumnAggregator = this.addColumnAggregator.bind(this);\n this.pool = new ElementPool(document);\n this.columnFactory = new ColumnDefinitionFactory(this.pool);\n }\n\n public componentWillLoad() {\n this.firstRequest = this.mode === 'remote';\n this.initTableSelection();\n }\n\n public componentDidLoad() {\n this.init();\n }\n\n public disconnectedCallback() {\n this.pool.clear();\n }\n\n @Watch('totalRows')\n protected totalRowsChanged() {\n this.updateMaxPage();\n }\n\n @Watch('pageSize')\n protected pageSizeChanged() {\n this.updateMaxPage();\n }\n\n @Watch('page')\n protected pageChanged() {\n if (!this.tabulator) {\n return;\n }\n\n if (this.tabulator.getPage() === this.page) {\n return;\n }\n\n this.tabulator.setPage(this.page);\n }\n\n @Watch('activeRow')\n protected activeRowChanged() {\n if (!this.tabulator) {\n return;\n }\n\n this.formatRows();\n }\n\n @Watch('data')\n protected updateData(newData: RowData[] = [], oldData: RowData[] = []) {\n const shouldReplace = this.shouldReplaceData(newData, oldData);\n\n setTimeout(() => {\n if (!this.tabulator) {\n return;\n }\n\n if (shouldReplace) {\n this.pool.releaseAll();\n this.tabulator.replaceData(newData);\n this.setSelection();\n\n return;\n }\n\n this.tabulator.updateOrAddData(newData);\n });\n }\n\n @Watch('columns')\n protected updateColumns(newColumns: Column[], oldColumns: Column[]) {\n if (!this.tabulator) {\n return;\n }\n\n if (this.areSameColumns(newColumns, oldColumns)) {\n return;\n }\n\n const columnsInTable = this.tabulator\n .getColumns()\n .filter((c) => c.getField());\n\n const oldColumnsInTable = columnsInTable.map((c) =>\n oldColumns.find((old) => old.field === c.getField()),\n );\n\n if (this.areSameColumns(newColumns, oldColumnsInTable)) {\n return;\n }\n\n // Updating columns requires a reinitialization otherwise sorting will not work\n // afterwards\n this.init();\n }\n\n @Watch('aggregates')\n protected updateAggregates(\n newAggregates: ColumnAggregate[],\n oldAggregates: ColumnAggregate[],\n ) {\n if (!this.tabulator) {\n return;\n }\n\n if (isEqual(newAggregates, oldAggregates)) {\n return;\n }\n\n if (!this.haveSameAggregateFields(newAggregates, oldAggregates)) {\n this.init();\n\n return;\n }\n\n this.tabulator.recalc();\n this.tabulator.rowManager.redraw();\n }\n\n @Watch('selection')\n protected updateSelection(newSelection: any[]) {\n if (!this.tableSelection) {\n return;\n }\n\n this.tableSelection.setSelection(newSelection);\n }\n\n @Watch('selectable')\n protected updateSelectable() {\n if (this.tableSelection && !this.selectable) {\n this.tableSelection = null;\n }\n\n this.initTableSelection();\n this.init();\n }\n\n @Watch('sorting')\n protected updateSorting(\n newValue: ColumnSorter[],\n oldValue: ColumnSorter[],\n ) {\n const newSorting = this.getColumnSorter(newValue);\n const oldSorting = this.getColumnSorter(oldValue);\n if (isEqual(newSorting, oldSorting)) {\n return;\n }\n\n this.tabulator.setSort(newSorting);\n }\n\n private shouldReplaceData(newData: RowData[], oldData: RowData[]) {\n const newIds = newData.map((item) => item.id ?? item) as Array<\n string | number\n >;\n const oldIds = oldData.map((item) => item.id ?? item) as Array<\n string | number\n >;\n\n return (\n !this.areEqualIds(newIds, oldIds) ||\n !this.isSameOrder(newIds, oldIds)\n );\n }\n\n private areEqualIds(\n newIds: Array<string | number>,\n oldIds: Array<string | number>,\n ): boolean {\n const newIdSet = new Set(newIds);\n const oldIdSet = new Set(oldIds);\n\n return (\n newIdSet.size === oldIdSet.size &&\n newIds.every((id) => oldIdSet.has(id))\n );\n }\n\n private isSameOrder(\n newIds: Array<string | number>,\n oldIds: Array<string | number>,\n ): boolean {\n return newIds.every((id, index) => id === oldIds[index]);\n }\n\n private areSameColumns(newColumns: Column[], oldColumns: Column[]) {\n return (\n newColumns.length === oldColumns.length &&\n newColumns.every((column) => oldColumns.includes(column))\n );\n }\n\n private haveSameAggregateFields(\n newAggregates: ColumnAggregate[],\n oldAggregates: ColumnAggregate[],\n ) {\n const oldAggregateFields = oldAggregates?.map((a) => a.field) || [];\n\n return (\n newAggregates?.length === oldAggregates?.length &&\n !!newAggregates?.every((a) => oldAggregateFields.includes(a.field))\n );\n }\n\n private init() {\n if (this.tabulator) {\n this.pool.releaseAll();\n this.tabulator.destroy();\n }\n\n const table: HTMLElement =\n this.host.shadowRoot.querySelector('#tabulator-table');\n this.initTabulatorComponent(table);\n }\n\n /*\n * Tabulator requires that the html element it's rendered inside\n * has a size before it's created, otherwise it doesn't consider\n * it self renderedy completely. (the callback \"renderComplete\"\n * is never run).\n *\n * @param table {HTMLElement}\n *\n */\n private initTabulatorComponent(table: HTMLElement) {\n // Some browsers do not implement the ResizeObserver API...\n // If that's the case lets just create the table no\n // matter if its rendered or not.\n if (!('ResizeObserver' in window)) {\n this.tabulator = new TabulatorTable(table, this.getOptions());\n this.setSelection();\n\n return;\n }\n\n const observer = new ResizeObserver(() => {\n this.tabulator = new TabulatorTable(table, this.getOptions());\n this.setSelection();\n observer.unobserve(table);\n });\n observer.observe(table);\n }\n\n private initTableSelection() {\n if (this.selectable) {\n this.tableSelection = new TableSelection(\n () => this.tabulator,\n this.pool,\n this.select,\n );\n this.tableSelection.setSelection(this.selection);\n }\n }\n\n private setSelection() {\n if (!(this.tabulator && this.tableSelection)) {\n return;\n }\n\n this.tableSelection.setSelection(this.selection);\n }\n\n private updateMaxPage() {\n this.tabulator?.setMaxPage(this.calculatePageCount());\n }\n\n private getOptions(): Tabulator.Options {\n const ajaxOptions = this.getAjaxOptions();\n const paginationOptions = this.getPaginationOptions();\n const columnOptions = this.getColumnOptions();\n\n return {\n data: this.data,\n layout: mapLayout(this.layout),\n columns: this.getColumnDefinitions(),\n dataSorting: this.handleDataSorting,\n pageLoaded: this.handlePageLoaded,\n ...ajaxOptions,\n ...paginationOptions,\n rowClick: this.onClickRow,\n rowFormatter: this.formatRow,\n initialSort: this.getInitialSorting(),\n nestedFieldSeparator: false,\n ...columnOptions,\n };\n }\n\n private getInitialSorting(): Tabulator.Sorter[] {\n if (this.currentSorting && this.currentSorting.length) {\n return this.getColumnSorter(this.currentSorting);\n }\n\n return this.getColumnSorter(this.sorting);\n }\n\n private getColumnSorter(sorting: ColumnSorter[]): Tabulator.Sorter[] {\n return sorting.map((sorter: ColumnSorter) => {\n return {\n column: String(sorter.column.field),\n dir: sorter.direction.toLocaleLowerCase() as Tabulator.SortDirection,\n };\n });\n }\n\n private getColumnDefinitions(): Tabulator.ColumnDefinition[] {\n const columnDefinitions = this.columns\n .map(this.addColumnAggregator)\n .map(this.columnFactory.create);\n\n if (this.tableSelection) {\n return this.tableSelection.getColumnDefinitions(columnDefinitions);\n }\n\n return columnDefinitions;\n }\n\n private addColumnAggregator(column: Column<any>): Column<any> {\n if (!this.aggregates?.length || column.aggregator) {\n return column;\n }\n\n const aggregate = this.aggregates.find((a) => a.field === column.field);\n if (aggregate) {\n column.aggregator = (\n col?: Column,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _values?: any[],\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _data?: any[],\n ) => {\n if (!col) {\n return undefined;\n }\n\n const value = this.aggregates.find(\n (a) => a.field === col.field,\n )?.value;\n\n if (col.formatter) {\n return col.formatter(value);\n }\n\n return value;\n };\n }\n\n return column;\n }\n\n private getAjaxOptions(): Tabulator.OptionsData {\n if (!this.isRemoteMode()) {\n return {};\n }\n\n // Tabulator needs a URL to be set, even though this one will never be\n // used since we have our own custom `ajaxRequestFunc`\n const remoteUrl = 'https://localhost';\n\n return {\n ajaxSorting: true,\n ajaxURL: remoteUrl,\n ajaxRequestFunc: this.requestData,\n ajaxRequesting: this.handleAjaxRequesting,\n };\n }\n\n /*\n * The ajaxRequesting callback is triggered when ever an ajax request is made.\n *\n * Tabulator is requesting data with an AJAX request even though it has been\n * given data when it was created.\n *\n * It seems unnecessary for us to emit the `load` event as well when this\n * happens, since we can just initialize the table with the data that has been\n * given to us. Therefore, we abort the request if:\n *\n * * its the first time this method is called and,\n * * data has been sent in to the component as a prop\n *\n */\n private handleAjaxRequesting() {\n const abortRequest = this.firstRequest && !!this.data?.length;\n this.firstRequest = false;\n\n if (abortRequest) {\n setTimeout(() => {\n this.updateMaxPage();\n this.tabulator.replaceData(this.data);\n });\n\n return false;\n }\n\n return true;\n }\n\n private getPaginationOptions(): Tabulator.OptionsPagination {\n if (!this.pageSize) {\n return {};\n }\n\n return {\n pagination: this.isRemoteMode() ? 'remote' : 'local',\n paginationSize: this.pageSize,\n paginationInitialPage: this.page,\n };\n }\n\n private requestData(_, __, params: any): Promise<object> {\n const sorters = params.sorters;\n const currentPage = params.page;\n\n if (this.page !== currentPage) {\n this.changePage.emit(currentPage);\n }\n\n const columnSorters = sorters.map(createColumnSorter(this.columns));\n\n const load = {\n page: currentPage,\n sorters: columnSorters,\n };\n\n // In order to make limel-table behave more like a controlled component,\n // we always return the existing data from this function, therefore\n // relying on the consumer component to handle the loading\n // state via the loading prop, if it actually decides to load new data.\n const resolveExistingData = Promise.resolve({\n last_page: this.calculatePageCount(), // eslint-disable-line camelcase\n data: this.data,\n });\n\n if (isEqual(this.currentLoad, load)) {\n return resolveExistingData;\n }\n\n this.currentSorting = columnSorters;\n this.currentLoad = load;\n this.load.emit(load);\n\n return resolveExistingData;\n }\n\n private isRemoteMode(): boolean {\n return this.mode === 'remote';\n }\n\n private handleDataSorting(sorters: Tabulator.Sorter[]): void {\n if (this.isRemoteMode()) {\n return;\n }\n\n const columnSorters = sorters.map(createColumnSorter(this.columns));\n if (columnSorters.length === 0) {\n return;\n }\n\n this.sort.emit(columnSorters);\n }\n\n private handlePageLoaded(page: number): void {\n if (this.isRemoteMode()) {\n return;\n }\n\n this.changePage.emit(page);\n }\n\n private onClickRow(_ev, row: Tabulator.RowComponent): void {\n if (typeof row.getPosition === 'undefined') {\n // Not a data row, probably a CalcComponent\n return;\n }\n\n if (this.isActiveRow(row)) {\n this.activeRow = null;\n } else {\n this.activeRow = row.getData();\n }\n\n this.activate.emit(this.activeRow);\n }\n\n private getActiveRows: () => Tabulator.RowComponent[] = () => {\n if (!this.tabulator) {\n return [];\n }\n\n return this.tabulator.getRows('active');\n };\n\n private getActiveRowsData: () => object[] = () => {\n // Note: Tabulator.getData() creates copies of each data object\n // and will break this.selection.has checks, hence why this function\n // intentionally retrieves the data using the row components\n return this.getActiveRows().map((row) => row.getData());\n };\n\n private selectAllOnChange = (ev: CustomEvent<boolean>) => {\n const selectAll = ev.detail;\n\n ev.stopPropagation();\n ev.preventDefault();\n\n const newSelection = selectAll ? this.getActiveRowsData() : [];\n this.select.emit(newSelection);\n this.tableSelection.setSelection(newSelection);\n this.selectAll.emit(selectAll);\n };\n\n private formatRows() {\n this.tabulator.getRows().forEach(this.formatRow);\n }\n\n private formatRow(row: Tabulator.RowComponent) {\n if (this.isActiveRow(row)) {\n row.getElement().classList.add('active');\n } else {\n row.getElement().classList.remove('active');\n }\n\n const interactiveFeedbackElement = row\n .getElement()\n .getElementsByClassName('interactive-feedback');\n if (interactiveFeedbackElement.length === 0) {\n const element = row.getElement().ownerDocument.createElement('div');\n element.classList.add('interactive-feedback');\n row.getElement().prepend(element);\n }\n }\n\n private isActiveRow(row: Tabulator.RowComponent) {\n if (!this.activeRow) {\n return false;\n }\n\n const activeRowId = this.activeRow.id ?? null;\n\n if (activeRowId !== null) {\n return activeRowId === row.getData().id;\n }\n\n return this.activeRow === row.getData();\n }\n\n private calculatePageCount(): number {\n let total = this.totalRows;\n if (!total) {\n total = this.data.length;\n }\n\n return Math.ceil(total / this.pageSize);\n }\n\n private hasAggregation(columns: Column[]): boolean {\n return columns.some((column) => has(column, 'aggregator'));\n }\n\n private getColumnOptions = (): Tabulator.OptionsColumns => {\n if (!this.movableColumns) {\n return {};\n }\n\n return {\n movableColumns: true,\n columnMoved: this.handleMoveColumn,\n };\n };\n\n private handleMoveColumn = (_, components: Tabulator.ColumnComponent[]) => {\n const columns = components.map(this.findColumn).filter((c) => c);\n this.changeColumns.emit(columns);\n };\n\n private findColumn = (component: Tabulator.ColumnComponent): Column => {\n return this.columns.find((column) => {\n return (\n column.field === component.getField() &&\n column.title === component.getDefinition().title\n );\n });\n };\n\n render() {\n return (\n <Host\n class={{\n 'has-low-density': this.layout === 'lowDensity',\n }}\n >\n <div\n id=\"tabulator-container\"\n class={{\n 'has-pagination': this.totalRows > this.pageSize,\n 'has-aggregation': this.hasAggregation(this.columns),\n 'has-movable-columns': this.movableColumns,\n 'has-rowselector': this.selectable,\n 'has-selection': this.tableSelection?.hasSelection,\n }}\n >\n {/* Toggle style instead of removing the loader\n because removing the element will cause a rerender, breaking the\n tabulator table */}\n <div\n id=\"tabulator-loader\"\n style={{ display: this.loading ? 'flex' : 'none' }}\n >\n <limel-spinner size=\"large\" />\n </div>\n {this.renderEmptyMessage()}\n {this.renderSelectAll()}\n <div id=\"tabulator-table\" />\n </div>\n </Host>\n );\n }\n\n private renderSelectAll() {\n if (!this.selectable) {\n return;\n }\n\n const showSelectAll = !this.loading && this.tableSelection;\n\n return (\n <div\n class=\"select-all\"\n style={{ display: showSelectAll ? 'inline-block' : 'none' }}\n >\n <limel-checkbox\n onChange={this.selectAllOnChange}\n disabled={!this.data.length}\n checked={this.tableSelection?.hasSelection}\n indeterminate={\n this.tableSelection?.hasSelection &&\n this.selection?.length < this.data.length\n }\n />\n </div>\n );\n }\n\n private renderEmptyMessage() {\n const showEmptyMessage =\n !this.loading && !this.data.length && this.emptyMessage;\n\n return (\n <div\n id=\"tabulator-empty-text\"\n style={{ display: showEmptyMessage ? 'flex' : 'none' }}\n >\n <span>{this.emptyMessage}</span>\n </div>\n );\n }\n}\n"]}
@@ -77,6 +77,9 @@
77
77
  height: 100%;
78
78
  flex-grow: 1;
79
79
  }
80
+ :host(limel-prosemirror-adapter) div[contenteditable=true] {
81
+ height: 100%;
82
+ }
80
83
 
81
84
  * {
82
85
  box-sizing: border-box;
@@ -103,9 +106,8 @@
103
106
  flex-shrink: 0;
104
107
  position: sticky;
105
108
  z-index: 1;
106
- top: 1px;
107
- margin: 0 1px;
108
- width: calc(100% - 2px);
109
+ top: 0;
110
+ width: 100%;
109
111
  background-color: rgba(var(--contrast-200), 0.5);
110
112
  backdrop-filter: blur(0.5rem);
111
113
  -webkit-backdrop-filter: blur(0.5rem);
@@ -165,6 +165,7 @@
165
165
  min-height: 5rem;
166
166
  height: 100%;
167
167
  max-height: var(--text-editor-max-height, calc(100vh - (env(safe-area-inset-top) + env(safe-area-inset-bottom)) - 4rem));
168
+ padding: 1px;
168
169
  }
169
170
 
170
171
  :host(limel-text-editor:focus-within),
@@ -73,7 +73,7 @@ export class TextEditor {
73
73
  ];
74
74
  }
75
75
  return [
76
- h("limel-prosemirror-adapter", { "aria-placeholder": this.placeholder, contentType: this.contentType, onChange: this.handleChange, value: this.value, "aria-controls": this.helperTextId, id: this.editorId, tabindex: this.disabled ? -1 : 0, "aria-disabled": this.disabled, language: this.language }),
76
+ h("limel-prosemirror-adapter", { "aria-placeholder": this.placeholder, contentType: this.contentType, onChange: this.handleChange, value: this.value, "aria-controls": this.helperTextId, id: this.editorId, tabindex: this.disabled ? -1 : undefined, "aria-disabled": this.disabled, language: this.language }),
77
77
  this.renderPlaceholder(),
78
78
  this.renderHelperLine(),
79
79
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"text-editor.js","sourceRoot":"","sources":["../../../src/components/text-editor/text-editor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAG9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D;;;;;;;;;;;;;;;;;GAiBG;AAMH,MAAM,OAAO,UAAU;EA+FnB;IAmFQ,qBAAgB,GAAG,GAAG,EAAE;MAC5B,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;QAClB,OAAO;OACV;MAED,OAAO,CACH,yBACI,UAAU,EAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BJ","sourcesContent":["import { Component, Event, EventEmitter, Host, Prop, h } from '@stencil/core';\nimport { FormComponent } from '../form/form.types';\nimport { Languages } from '../date-picker/date.types';\nimport { createRandomString } from '../../util/random-string';\n/**\n * A rich text editor that offers a rich text editing experience with markdown support,\n * in the sense that you can easily type markdown syntax and see the rendered\n * result as rich text in real-time. For instance, you can type `# Hello, world!`\n * and see it directly turning to a heading 1 (an `<h1>` HTML element).\n *\n * Naturally, you can use standard keyboard hotkeys such as <kbd>Ctrl</kbd> + <kbd>B</kbd>\n * to toggle bold text, <kbd>Ctrl</kbd> + <kbd>I</kbd> to toggle italic text, and so on.\n *\n * @exampleComponent limel-example-text-editor-basic\n * @exampleComponent limel-example-text-editor-as-form-component\n * @exampleComponent limel-example-text-editor-with-markdown\n * @exampleComponent limel-example-text-editor-with-html\n * @exampleComponent limel-example-text-editor-allow-resize\n * @exampleComponent limel-example-text-editor-size\n * @exampleComponent limel-example-text-editor-composite\n * @beta\n */\n@Component({\n tag: 'limel-text-editor',\n shadow: true,\n styleUrl: 'text-editor.scss',\n})\nexport class TextEditor implements FormComponent<string> {\n /** The type of content that the editor should handle and emit, defaults to `markdown`\n *\n * Assumed to be set only once, so not reactive to changes\n */\n @Prop()\n public contentType: 'markdown' | 'html' = 'markdown';\n\n /**\n * Defines the language for translations.\n */\n @Prop({ reflect: true })\n public language: Languages = 'en';\n\n /**\n * Set to `true` to disable the field.\n * Use `disabled` to indicate that the field can normally be interacted\n * with, but is currently disabled. This tells the user that if certain\n * requirements are met, the field may become enabled again.\n */\n @Prop({ reflect: true })\n public disabled?: boolean = false;\n\n /**\n * Set to `true` to make the component read-only.\n * Use `readonly` when the field is only there to present the data it holds,\n * and will not become possible for the current user to edit.\n * :::note\n * Consider that it might be better to use `limel-markdown`\n * instead of `limel-text-editor` when the goal is visualizing data.\n * :::\n */\n @Prop({ reflect: true })\n public readonly?: boolean = false;\n\n /**\n * Optional helper text to display below the input field when it has focus\n */\n @Prop({ reflect: true })\n public helperText?: string;\n\n /**\n * The placeholder text shown inside the input field,\n * when the field is empty.\n */\n @Prop({ reflect: true })\n public placeholder?: string;\n\n /**\n * The label of the editor\n */\n @Prop({ reflect: true })\n public label?: string;\n\n /**\n * Set to `true` to indicate that the current value of the editor is\n * invalid.\n */\n @Prop({ reflect: true })\n public invalid?: boolean = false;\n\n /**\n * Description of the text inside the editor as markdown\n */\n @Prop({ reflect: true })\n public value: string;\n\n /**\n * Set to `true` to indicate that the field is required.\n *\n * :::important\n * An empty but required field is not automatically considered invalid.\n * You must make sure to check the validity of the field on your own,\n * and properly handle the `invalid` state.\n * :::\n */\n @Prop({ reflect: true })\n public required?: boolean = false;\n\n /**\n * Set to `true` to allow the user to vertically resize the editor.\n * Set to `false` to disable the resize functionality.\n */\n @Prop({ reflect: true })\n public allowResize: boolean = true;\n\n /**\n * Dispatched when a change is made to the editor\n */\n @Event()\n public change: EventEmitter<string>;\n\n private helperTextId: string;\n private editorId: string;\n\n public constructor() {\n this.helperTextId = createRandomString();\n this.editorId = createRandomString();\n }\n\n public render() {\n return (\n <Host\n class={{\n 'has-helper-text': !!this.helperText,\n }}\n >\n <span class=\"notched-outline\">\n <span class=\"leading-outline\" />\n {this.renderLabel()}\n <span class=\"trailing-outline\" />\n </span>\n {this.renderEditor()}\n </Host>\n );\n }\n\n private renderEditor() {\n if (this.readonly && !this.value) {\n return [\n <span class=\"lime-looks-like-input-value\">–</span>,\n this.renderHelperLine(),\n ];\n }\n\n if (this.readonly) {\n return [\n <limel-markdown\n value={this.value}\n aria-controls={this.helperTextId}\n id={this.editorId}\n />,\n this.renderPlaceholder(),\n this.renderHelperLine(),\n ];\n }\n\n return [\n <limel-prosemirror-adapter\n aria-placeholder={this.placeholder}\n contentType={this.contentType}\n onChange={this.handleChange}\n value={this.value}\n aria-controls={this.helperTextId}\n id={this.editorId}\n tabindex={this.disabled ? -1 : 0}\n aria-disabled={this.disabled}\n language={this.language}\n />,\n this.renderPlaceholder(),\n this.renderHelperLine(),\n ];\n }\n\n private renderLabel() {\n if (!this.label) {\n return;\n }\n\n return (\n <span class=\"notch\">\n <label htmlFor={this.editorId}>{this.label}</label>\n </span>\n );\n }\n\n private renderPlaceholder() {\n if (!this.placeholder || this.value) {\n return;\n }\n\n return (\n <span class=\"placeholder\" aria-hidden=\"true\">\n {this.placeholder}\n </span>\n );\n }\n\n private renderHelperLine = () => {\n if (!this.helperText) {\n return;\n }\n\n return (\n <limel-helper-line\n helperText={this.helperText}\n helperTextId={this.helperTextId}\n invalid={this.isInvalid()}\n />\n );\n };\n\n private isInvalid = () => {\n if (this.readonly) {\n // A readonly field can never be invalid.\n return false;\n }\n\n if (this.invalid) {\n return true;\n }\n };\n\n private handleChange = () => (event: CustomEvent<string>) => {\n event.stopPropagation();\n this.change.emit(event.detail);\n };\n}\n"]}
1
+ {"version":3,"file":"text-editor.js","sourceRoot":"","sources":["../../../src/components/text-editor/text-editor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAG9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D;;;;;;;;;;;;;;;;;GAiBG;AAMH,MAAM,OAAO,UAAU;EA+FnB;IAmFQ,qBAAgB,GAAG,GAAG,EAAE;MAC5B,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;QAClB,OAAO;OACV;MAED,OAAO,CACH,yBACI,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,YAAY,EAAE,IAAI,CAAC,YAAY,EAC/B,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,GAC3B,CACL,CAAC;IACN,CAAC,CAAC;IAEM,cAAS,GAAG,GAAG,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["import { Component, Event, EventEmitter, Host, Prop, h } from '@stencil/core';\nimport { FormComponent } from '../form/form.types';\nimport { Languages } from '../date-picker/date.types';\nimport { createRandomString } from '../../util/random-string';\n/**\n * A rich text editor that offers a rich text editing experience with markdown support,\n * in the sense that you can easily type markdown syntax and see the rendered\n * result as rich text in real-time. For instance, you can type `# Hello, world!`\n * and see it directly turning to a heading 1 (an `<h1>` HTML element).\n *\n * Naturally, you can use standard keyboard hotkeys such as <kbd>Ctrl</kbd> + <kbd>B</kbd>\n * to toggle bold text, <kbd>Ctrl</kbd> + <kbd>I</kbd> to toggle italic text, and so on.\n *\n * @exampleComponent limel-example-text-editor-basic\n * @exampleComponent limel-example-text-editor-as-form-component\n * @exampleComponent limel-example-text-editor-with-markdown\n * @exampleComponent limel-example-text-editor-with-html\n * @exampleComponent limel-example-text-editor-allow-resize\n * @exampleComponent limel-example-text-editor-size\n * @exampleComponent limel-example-text-editor-composite\n * @beta\n */\n@Component({\n tag: 'limel-text-editor',\n shadow: true,\n styleUrl: 'text-editor.scss',\n})\nexport class TextEditor implements FormComponent<string> {\n /** The type of content that the editor should handle and emit, defaults to `markdown`\n *\n * Assumed to be set only once, so not reactive to changes\n */\n @Prop()\n public contentType: 'markdown' | 'html' = 'markdown';\n\n /**\n * Defines the language for translations.\n */\n @Prop({ reflect: true })\n public language: Languages = 'en';\n\n /**\n * Set to `true` to disable the field.\n * Use `disabled` to indicate that the field can normally be interacted\n * with, but is currently disabled. This tells the user that if certain\n * requirements are met, the field may become enabled again.\n */\n @Prop({ reflect: true })\n public disabled?: boolean = false;\n\n /**\n * Set to `true` to make the component read-only.\n * Use `readonly` when the field is only there to present the data it holds,\n * and will not become possible for the current user to edit.\n * :::note\n * Consider that it might be better to use `limel-markdown`\n * instead of `limel-text-editor` when the goal is visualizing data.\n * :::\n */\n @Prop({ reflect: true })\n public readonly?: boolean = false;\n\n /**\n * Optional helper text to display below the input field when it has focus\n */\n @Prop({ reflect: true })\n public helperText?: string;\n\n /**\n * The placeholder text shown inside the input field,\n * when the field is empty.\n */\n @Prop({ reflect: true })\n public placeholder?: string;\n\n /**\n * The label of the editor\n */\n @Prop({ reflect: true })\n public label?: string;\n\n /**\n * Set to `true` to indicate that the current value of the editor is\n * invalid.\n */\n @Prop({ reflect: true })\n public invalid?: boolean = false;\n\n /**\n * Description of the text inside the editor as markdown\n */\n @Prop({ reflect: true })\n public value: string;\n\n /**\n * Set to `true` to indicate that the field is required.\n *\n * :::important\n * An empty but required field is not automatically considered invalid.\n * You must make sure to check the validity of the field on your own,\n * and properly handle the `invalid` state.\n * :::\n */\n @Prop({ reflect: true })\n public required?: boolean = false;\n\n /**\n * Set to `true` to allow the user to vertically resize the editor.\n * Set to `false` to disable the resize functionality.\n */\n @Prop({ reflect: true })\n public allowResize: boolean = true;\n\n /**\n * Dispatched when a change is made to the editor\n */\n @Event()\n public change: EventEmitter<string>;\n\n private helperTextId: string;\n private editorId: string;\n\n public constructor() {\n this.helperTextId = createRandomString();\n this.editorId = createRandomString();\n }\n\n public render() {\n return (\n <Host\n class={{\n 'has-helper-text': !!this.helperText,\n }}\n >\n <span class=\"notched-outline\">\n <span class=\"leading-outline\" />\n {this.renderLabel()}\n <span class=\"trailing-outline\" />\n </span>\n {this.renderEditor()}\n </Host>\n );\n }\n\n private renderEditor() {\n if (this.readonly && !this.value) {\n return [\n <span class=\"lime-looks-like-input-value\">–</span>,\n this.renderHelperLine(),\n ];\n }\n\n if (this.readonly) {\n return [\n <limel-markdown\n value={this.value}\n aria-controls={this.helperTextId}\n id={this.editorId}\n />,\n this.renderPlaceholder(),\n this.renderHelperLine(),\n ];\n }\n\n return [\n <limel-prosemirror-adapter\n aria-placeholder={this.placeholder}\n contentType={this.contentType}\n onChange={this.handleChange}\n value={this.value}\n aria-controls={this.helperTextId}\n id={this.editorId}\n tabindex={this.disabled ? -1 : undefined}\n aria-disabled={this.disabled}\n language={this.language}\n />,\n this.renderPlaceholder(),\n this.renderHelperLine(),\n ];\n }\n\n private renderLabel() {\n if (!this.label) {\n return;\n }\n\n return (\n <span class=\"notch\">\n <label htmlFor={this.editorId}>{this.label}</label>\n </span>\n );\n }\n\n private renderPlaceholder() {\n if (!this.placeholder || this.value) {\n return;\n }\n\n return (\n <span class=\"placeholder\" aria-hidden=\"true\">\n {this.placeholder}\n </span>\n );\n }\n\n private renderHelperLine = () => {\n if (!this.helperText) {\n return;\n }\n\n return (\n <limel-helper-line\n helperText={this.helperText}\n helperTextId={this.helperTextId}\n invalid={this.isInvalid()}\n />\n );\n };\n\n private isInvalid = () => {\n if (this.readonly) {\n // A readonly field can never be invalid.\n return false;\n }\n\n if (this.invalid) {\n return true;\n }\n };\n\n private handleChange = () => (event: CustomEvent<string>) => {\n event.stopPropagation();\n this.change.emit(event.detail);\n };\n}\n"]}
@@ -26070,7 +26070,7 @@ const createActionBarInteractionPlugin = (menuCommandFactory) => {
26070
26070
  });
26071
26071
  };
26072
26072
 
26073
- const prosemirrorAdapterCss = "@charset \"UTF-8\";:host{--mdc-theme-primary:var(\n --lime-primary-color,\n rgb(var(--color-teal-default))\n );--mdc-theme-secondary:var(\n --lime-secondary-color,\n rgb(var(--contrast-1100))\n );--mdc-theme-on-primary:var(\n --lime-on-primary-color,\n rgb(var(--contrast-100))\n );--mdc-theme-on-secondary:var(\n --lime-on-secondary-color,\n rgb(var(--contrast-100))\n );--mdc-theme-text-disabled-on-background:var(\n --lime-text-disabled-on-background-color,\n rgba(var(--contrast-1700), 0.38)\n );--mdc-theme-text-primary-on-background:var(\n --lime-text-primary-on-background-color,\n rgba(var(--contrast-1700), 0.87)\n );--mdc-theme-text-secondary-on-background:var(\n --lime-text-secondary-on-background-color,\n rgba(var(--contrast-1700), 0.54)\n );--mdc-theme-error:var(\n --lime-error-background-color,\n rgb(var(--color-red-dark))\n );--lime-error-text-color:rgb(var(--color-red-darker));--mdc-theme-surface:var(\n --lime-surface-background-color,\n rgb(var(--contrast-100))\n );--mdc-theme-on-surface:var(\n --lime-on-surface-color,\n rgb(var(--contrast-1500))\n )}:host(limel-prosemirror-adapter){display:flex;flex-direction:column}:host(limel-prosemirror-adapter) .toolbar{order:1}:host(limel-prosemirror-adapter) div#editor{order:2;height:100%;flex-grow:1}*{box-sizing:border-box}.ProseMirror-menubar-wrapper{display:grid;grid-template-rows:auto 1fr}.ProseMirror-textblock-dropdown{min-width:3em}.ProseMirror-tooltip .ProseMirror-menu{width:-webkit-fit-content;width:fit-content;white-space:pre}.toolbar{--action-bar-border-radius:0.25rem;border-radius:var(--action-bar-border-radius);flex-shrink:0;position:sticky;z-index:1;top:1px;margin:0 1px;width:calc(100% - 2px);background-color:rgba(var(--contrast-200), 0.5);backdrop-filter:blur(0.5rem);-webkit-backdrop-filter:blur(0.5rem)}limel-action-bar{min-width:0;opacity:var(--limel-prosemirror-adapter-toolbar-opacity);transition:opacity;transition-duration:0.3s;transition-timing-function:var(--limel-prosemirror-adapter-toolbar-transition-timing-function);padding:0.125rem 0.25rem;background-color:transparent}.ProseMirror{position:relative;word-wrap:break-word;white-space:pre-wrap;white-space:break-spaces;-webkit-font-variant-ligatures:none;font-variant-ligatures:none;font-feature-settings:\"liga\" 0;padding:var(--limel-text-editor-padding)}.ProseMirror [draggable][contenteditable=false]{user-select:text}.ProseMirror:focus-visible{outline:none}.ProseMirror-hideselection{caret-color:transparent}.ProseMirror-hideselection *::selection{background:transparent}.ProseMirror-hideselection *::-moz-selection{background:transparent}.ProseMirror-selectednode{outline:0.125rem solid rgb(var(--color-sky-light))}li.ProseMirror-selectednode{outline:none}li.ProseMirror-selectednode:after{content:\"\";position:absolute;left:-2rem;right:-0.125rem;top:-0.125rem;bottom:-0.125rem;border:0.125rem solid rgb(var(--color-sky-light));pointer-events:none}img.ProseMirror-separator{display:inline !important;border:none !important;margin:0 !important}limel-portal{width:25rem}blockquote{position:relative;font-weight:100;font-size:0.875rem;max-width:100%;line-height:1.4;margin:0;padding:0.5rem 1.25rem;border-radius:0.05rem 0.75rem;background-color:rgb(var(--contrast-300))}blockquote:before,blockquote:after{position:absolute;font-size:2.75rem;opacity:0.4}blockquote:before{content:\"“\";left:0;top:-0.75rem}blockquote:after{content:\"”\";right:0;bottom:-2rem}:host(limel-markdown.truncate-paragraphs) p{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}p,li{font-size:0.875rem;word-break:break-word;hyphens:auto;-webkit-hyphens:auto}a{word-break:break-all}p{margin-top:0;margin-bottom:0.5rem}p:only-child{margin-bottom:0}a{transition:color 0.2s ease;color:var(--markdown-hyperlink-color, rgb(var(--color-blue-dark)));text-decoration:none}a:hover{color:var(--markdown-hyperlink-color--hovered, rgb(var(--color-blue-default)))}hr{margin:1.75rem 0 2rem 0;border-width:0;border-top:1px solid rgb(var(--contrast-500))}dl{display:grid;grid-template-columns:1fr 2fr;grid-template-rows:1fr;margin-bottom:2rem;border:1px solid rgb(var(--contrast-400));border-radius:0.375rem;background-color:rgb(var(--contrast-200))}dl dt,dl dd{padding:0.375rem 0.5rem;font-size:0.875rem;margin:0}dl dt:nth-of-type(even),dl dd:nth-of-type(even){background-color:rgb(var(--contrast-300))}dl dt:first-child{border-top-left-radius:0.375rem}dl dt:last-child{border-bottom-left-radius:0.375rem}dl dd:first-child{border-top-right-radius:0.375rem}dl dd:last-child{border-bottom-right-radius:0.375rem}h1{font-size:1.5rem}h2{font-size:1.25rem}h3{font-size:1.125rem}h4{font-size:1rem}h5{font-size:0.875rem}h6{font-size:0.75rem}h1,h2{margin-top:0.5rem;margin-bottom:0.5rem;letter-spacing:-0.03125rem;font-weight:500}h3,h4{margin-top:0.75rem;margin-bottom:0.25rem;font-weight:600}h5,h6{margin-top:0.5rem;margin-bottom:0.125rem;font-weight:600}h1,h2,h3,h4,h5,h6{word-break:break-word;hyphens:auto;-webkit-hyphens:auto}:not([contenteditable=true]) h1,:not([contenteditable=true]) h2,:not([contenteditable=true]) h3,:not([contenteditable=true]) h4,:not([contenteditable=true]) h5,:not([contenteditable=true]) h6{text-wrap:balance}[contenteditable=true] h1,[contenteditable=true] h2,[contenteditable=true] h3,[contenteditable=true] h4,[contenteditable=true] h5,[contenteditable=true] h6{text-wrap:initial}ul{list-style:none}ul li{position:relative;margin-left:0.75rem}ul li:before{content:\"\";position:absolute;left:-0.5rem;top:0.5rem;width:0.25rem;height:0.25rem;border-radius:50%;background-color:rgb(var(--contrast-700));display:block}ol{margin-top:0.25rem;padding-left:1rem}ul{margin-top:0.25rem;padding-left:0}ul ul,ul ol,ol ol,ol ul{margin-left:0}li{margin-bottom:0.25rem}code{font-family:ui-monospace, \"Cascadia Code\", \"Source Code Pro\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace;font-size:0.8125rem;letter-spacing:-0.0125rem;color:rgb(var(--contrast-1300));-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;display:inline-block;border-radius:0.25rem;padding:0.03125rem 0.25rem;background-color:rgb(var(--contrast-600))}pre>code{display:block;margin:0.5rem 0;padding:0.5rem 0.75rem;overflow:auto;white-space:pre-wrap}:host(limel-markdown:not(.no-table-styles)) table{table-layout:auto;min-width:100%;border-collapse:collapse;border-spacing:0;background:transparent;margin:0.75rem 0;border:1px solid rgb(var(--contrast-400))}:host(limel-markdown:not(.no-table-styles)) th,:host(limel-markdown:not(.no-table-styles)) td{text-align:left;vertical-align:top;transition:background-color 0.2s ease;font-size:0.875rem}:host(limel-markdown:not(.no-table-styles)) td{padding:0.5rem 0.375rem 0.75rem 0.375rem}:host(limel-markdown:not(.no-table-styles)) tr th{background-color:rgb(var(--contrast-400));padding:0.25rem 0.375rem;font-weight:normal}:host(limel-markdown:not(.no-table-styles)) tr th:only-child{text-align:center}:host(limel-markdown:not(.no-table-styles)) tbody tr:nth-child(odd) td{background-color:rgb(var(--contrast-200))}:host(limel-markdown:not(.no-table-styles)) tbody tr:hover td{background-color:rgb(var(--contrast-300))}";
26073
+ const prosemirrorAdapterCss = "@charset \"UTF-8\";:host{--mdc-theme-primary:var(\n --lime-primary-color,\n rgb(var(--color-teal-default))\n );--mdc-theme-secondary:var(\n --lime-secondary-color,\n rgb(var(--contrast-1100))\n );--mdc-theme-on-primary:var(\n --lime-on-primary-color,\n rgb(var(--contrast-100))\n );--mdc-theme-on-secondary:var(\n --lime-on-secondary-color,\n rgb(var(--contrast-100))\n );--mdc-theme-text-disabled-on-background:var(\n --lime-text-disabled-on-background-color,\n rgba(var(--contrast-1700), 0.38)\n );--mdc-theme-text-primary-on-background:var(\n --lime-text-primary-on-background-color,\n rgba(var(--contrast-1700), 0.87)\n );--mdc-theme-text-secondary-on-background:var(\n --lime-text-secondary-on-background-color,\n rgba(var(--contrast-1700), 0.54)\n );--mdc-theme-error:var(\n --lime-error-background-color,\n rgb(var(--color-red-dark))\n );--lime-error-text-color:rgb(var(--color-red-darker));--mdc-theme-surface:var(\n --lime-surface-background-color,\n rgb(var(--contrast-100))\n );--mdc-theme-on-surface:var(\n --lime-on-surface-color,\n rgb(var(--contrast-1500))\n )}:host(limel-prosemirror-adapter){display:flex;flex-direction:column}:host(limel-prosemirror-adapter) .toolbar{order:1}:host(limel-prosemirror-adapter) div#editor{order:2;height:100%;flex-grow:1}:host(limel-prosemirror-adapter) div[contenteditable=true]{height:100%}*{box-sizing:border-box}.ProseMirror-menubar-wrapper{display:grid;grid-template-rows:auto 1fr}.ProseMirror-textblock-dropdown{min-width:3em}.ProseMirror-tooltip .ProseMirror-menu{width:-webkit-fit-content;width:fit-content;white-space:pre}.toolbar{--action-bar-border-radius:0.25rem;border-radius:var(--action-bar-border-radius);flex-shrink:0;position:sticky;z-index:1;top:0;width:100%;background-color:rgba(var(--contrast-200), 0.5);backdrop-filter:blur(0.5rem);-webkit-backdrop-filter:blur(0.5rem)}limel-action-bar{min-width:0;opacity:var(--limel-prosemirror-adapter-toolbar-opacity);transition:opacity;transition-duration:0.3s;transition-timing-function:var(--limel-prosemirror-adapter-toolbar-transition-timing-function);padding:0.125rem 0.25rem;background-color:transparent}.ProseMirror{position:relative;word-wrap:break-word;white-space:pre-wrap;white-space:break-spaces;-webkit-font-variant-ligatures:none;font-variant-ligatures:none;font-feature-settings:\"liga\" 0;padding:var(--limel-text-editor-padding)}.ProseMirror [draggable][contenteditable=false]{user-select:text}.ProseMirror:focus-visible{outline:none}.ProseMirror-hideselection{caret-color:transparent}.ProseMirror-hideselection *::selection{background:transparent}.ProseMirror-hideselection *::-moz-selection{background:transparent}.ProseMirror-selectednode{outline:0.125rem solid rgb(var(--color-sky-light))}li.ProseMirror-selectednode{outline:none}li.ProseMirror-selectednode:after{content:\"\";position:absolute;left:-2rem;right:-0.125rem;top:-0.125rem;bottom:-0.125rem;border:0.125rem solid rgb(var(--color-sky-light));pointer-events:none}img.ProseMirror-separator{display:inline !important;border:none !important;margin:0 !important}limel-portal{width:25rem}blockquote{position:relative;font-weight:100;font-size:0.875rem;max-width:100%;line-height:1.4;margin:0;padding:0.5rem 1.25rem;border-radius:0.05rem 0.75rem;background-color:rgb(var(--contrast-300))}blockquote:before,blockquote:after{position:absolute;font-size:2.75rem;opacity:0.4}blockquote:before{content:\"“\";left:0;top:-0.75rem}blockquote:after{content:\"”\";right:0;bottom:-2rem}:host(limel-markdown.truncate-paragraphs) p{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}p,li{font-size:0.875rem;word-break:break-word;hyphens:auto;-webkit-hyphens:auto}a{word-break:break-all}p{margin-top:0;margin-bottom:0.5rem}p:only-child{margin-bottom:0}a{transition:color 0.2s ease;color:var(--markdown-hyperlink-color, rgb(var(--color-blue-dark)));text-decoration:none}a:hover{color:var(--markdown-hyperlink-color--hovered, rgb(var(--color-blue-default)))}hr{margin:1.75rem 0 2rem 0;border-width:0;border-top:1px solid rgb(var(--contrast-500))}dl{display:grid;grid-template-columns:1fr 2fr;grid-template-rows:1fr;margin-bottom:2rem;border:1px solid rgb(var(--contrast-400));border-radius:0.375rem;background-color:rgb(var(--contrast-200))}dl dt,dl dd{padding:0.375rem 0.5rem;font-size:0.875rem;margin:0}dl dt:nth-of-type(even),dl dd:nth-of-type(even){background-color:rgb(var(--contrast-300))}dl dt:first-child{border-top-left-radius:0.375rem}dl dt:last-child{border-bottom-left-radius:0.375rem}dl dd:first-child{border-top-right-radius:0.375rem}dl dd:last-child{border-bottom-right-radius:0.375rem}h1{font-size:1.5rem}h2{font-size:1.25rem}h3{font-size:1.125rem}h4{font-size:1rem}h5{font-size:0.875rem}h6{font-size:0.75rem}h1,h2{margin-top:0.5rem;margin-bottom:0.5rem;letter-spacing:-0.03125rem;font-weight:500}h3,h4{margin-top:0.75rem;margin-bottom:0.25rem;font-weight:600}h5,h6{margin-top:0.5rem;margin-bottom:0.125rem;font-weight:600}h1,h2,h3,h4,h5,h6{word-break:break-word;hyphens:auto;-webkit-hyphens:auto}:not([contenteditable=true]) h1,:not([contenteditable=true]) h2,:not([contenteditable=true]) h3,:not([contenteditable=true]) h4,:not([contenteditable=true]) h5,:not([contenteditable=true]) h6{text-wrap:balance}[contenteditable=true] h1,[contenteditable=true] h2,[contenteditable=true] h3,[contenteditable=true] h4,[contenteditable=true] h5,[contenteditable=true] h6{text-wrap:initial}ul{list-style:none}ul li{position:relative;margin-left:0.75rem}ul li:before{content:\"\";position:absolute;left:-0.5rem;top:0.5rem;width:0.25rem;height:0.25rem;border-radius:50%;background-color:rgb(var(--contrast-700));display:block}ol{margin-top:0.25rem;padding-left:1rem}ul{margin-top:0.25rem;padding-left:0}ul ul,ul ol,ol ol,ol ul{margin-left:0}li{margin-bottom:0.25rem}code{font-family:ui-monospace, \"Cascadia Code\", \"Source Code Pro\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace;font-size:0.8125rem;letter-spacing:-0.0125rem;color:rgb(var(--contrast-1300));-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;display:inline-block;border-radius:0.25rem;padding:0.03125rem 0.25rem;background-color:rgb(var(--contrast-600))}pre>code{display:block;margin:0.5rem 0;padding:0.5rem 0.75rem;overflow:auto;white-space:pre-wrap}:host(limel-markdown:not(.no-table-styles)) table{table-layout:auto;min-width:100%;border-collapse:collapse;border-spacing:0;background:transparent;margin:0.75rem 0;border:1px solid rgb(var(--contrast-400))}:host(limel-markdown:not(.no-table-styles)) th,:host(limel-markdown:not(.no-table-styles)) td{text-align:left;vertical-align:top;transition:background-color 0.2s ease;font-size:0.875rem}:host(limel-markdown:not(.no-table-styles)) td{padding:0.5rem 0.375rem 0.75rem 0.375rem}:host(limel-markdown:not(.no-table-styles)) tr th{background-color:rgb(var(--contrast-400));padding:0.25rem 0.375rem;font-weight:normal}:host(limel-markdown:not(.no-table-styles)) tr th:only-child{text-align:center}:host(limel-markdown:not(.no-table-styles)) tbody tr:nth-child(odd) td{background-color:rgb(var(--contrast-200))}:host(limel-markdown:not(.no-table-styles)) tbody tr:hover td{background-color:rgb(var(--contrast-300))}";
26074
26074
 
26075
26075
  const ProsemirrorAdapter = class {
26076
26076
  constructor(hostRef) {