@limetech/lime-elements 38.33.7 → 38.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/{limel-breadcrumbs_8.cjs.entry.js → limel-breadcrumbs_7.cjs.entry.js} +1 -35
- package/dist/cjs/limel-breadcrumbs_7.cjs.entry.js.map +1 -0
- package/dist/cjs/limel-code-editor.cjs.entry.js +97 -5
- package/dist/cjs/limel-code-editor.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-helper-line_2.cjs.entry.js +79 -0
- package/dist/cjs/limel-helper-line_2.cjs.entry.js.map +1 -0
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +3 -0
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/code-editor/code-editor.css +29 -0
- package/dist/collection/components/code-editor/code-editor.js +202 -11
- package/dist/collection/components/code-editor/code-editor.js.map +1 -1
- package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js +3 -0
- package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js.map +1 -1
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/{limel-breadcrumbs_8.entry.js → limel-breadcrumbs_7.entry.js} +2 -35
- package/dist/esm/limel-breadcrumbs_7.entry.js.map +1 -0
- package/dist/esm/limel-code-editor.entry.js +98 -6
- package/dist/esm/limel-code-editor.entry.js.map +1 -1
- package/dist/esm/limel-helper-line_2.entry.js +74 -0
- package/dist/esm/limel-helper-line_2.entry.js.map +1 -0
- package/dist/esm/limel-prosemirror-adapter.entry.js +3 -0
- package/dist/esm/limel-prosemirror-adapter.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/lime-elements.esm.js.map +1 -1
- package/dist/lime-elements/{p-033a0aa9.entry.js → p-668e583c.entry.js} +11 -11
- package/dist/lime-elements/p-668e583c.entry.js.map +1 -0
- package/dist/lime-elements/p-93ea4214.entry.js +2 -0
- package/dist/lime-elements/p-93ea4214.entry.js.map +1 -0
- package/dist/lime-elements/{p-787be044.entry.js → p-df9bcace.entry.js} +2 -2
- package/dist/lime-elements/{p-787be044.entry.js.map → p-df9bcace.entry.js.map} +1 -1
- package/dist/lime-elements/p-f1ec1eeb.entry.js +2 -0
- package/dist/lime-elements/p-f1ec1eeb.entry.js.map +1 -0
- package/dist/types/components/code-editor/code-editor.d.ts +40 -1
- package/dist/types/components.d.ts +46 -2
- package/package.json +1 -1
- package/dist/cjs/limel-breadcrumbs_8.cjs.entry.js.map +0 -1
- package/dist/cjs/limel-helper-line.cjs.entry.js +0 -45
- package/dist/cjs/limel-helper-line.cjs.entry.js.map +0 -1
- package/dist/esm/limel-breadcrumbs_8.entry.js.map +0 -1
- package/dist/esm/limel-helper-line.entry.js +0 -41
- package/dist/esm/limel-helper-line.entry.js.map +0 -1
- package/dist/lime-elements/p-033a0aa9.entry.js.map +0 -1
- package/dist/lime-elements/p-2bf4fc20.entry.js +0 -2
- package/dist/lime-elements/p-2bf4fc20.entry.js.map +0 -1
- package/dist/lime-elements/p-e4bafb75.entry.js +0 -2
- package/dist/lime-elements/p-e4bafb75.entry.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e,h as l,H as t}from"./p-288f0842.js";const o=":host(limel-helper-line){transition:opacity 0.2s ease;box-sizing:border-box;display:grid;min-width:0;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-size:0.6875rem;line-height:normal;color:rgb(var(--contrast-1200))}div{display:flex;justify-content:space-between;gap:0.75rem;overflow:hidden;padding:0 1rem}:host(limel-helper-line.invalid){--limel-h-l-grid-template-rows-transition-speed:0.46s;--limel-h-l-grid-template-rows:1fr}:host(limel-helper-line.invalid) .helper-text{color:var(--limel-theme-error-color)}.counter{flex-shrink:0;margin-left:auto}.helper-text,.counter{padding-top:0.125rem}:host(limel-helper-line){transition:grid-template-rows var(--limel-h-l-grid-template-rows-transition-speed, 0.46s) cubic-bezier(1, 0.09, 0, 0.89);grid-template-rows:var(--limel-h-l-grid-template-rows, 1fr)}:host(limel-helper-line.hide){--limel-h-l-grid-template-rows-transition-speed:0.3s;--limel-h-l-grid-template-rows:0fr}";const i=class{constructor(t){e(this,t);this.hasContent=()=>!!(this.maxLength>0||this.helperText&&this.helperText.length>0);this.renderHelperText=()=>{if(!this.helperText){return}return l("span",{class:"helper-text",id:this.helperTextId},this.helperText)};this.renderCharacterCounter=()=>{const e=`${this.length} / ${this.maxLength}`;if(!this.maxLength){return}return l("span",{class:"counter"},e)};this.helperText=undefined;this.length=undefined;this.maxLength=undefined;this.invalid=false;this.helperTextId=undefined}render(){return l(t,{tabIndex:-1,class:{invalid:this.invalid},style:this.hasContent()?{}:{display:"none"},"aria-hidden":!this.hasContent()},l("div",null,this.renderHelperText(),this.renderCharacterCounter()))}};i.style=o;const n='@charset "UTF-8";*,*:before,*:after{box-sizing:border-box}limel-notched-outline{--limel-notched-outline-border-color:rgba(var(--contrast-700), 0.65);--limel-notched-outline-background-color:rgba(var(--contrast-200), 0.5);display:block;width:100%;height:fit-content}.limel-notched-outline{position:relative;width:100%;height:100%}.limel-notched-outline [slot=content]{background-color:var(--limel-notched-outline-background-color);border-radius:var(--limel-notched-outline-border-radius, 0.25rem)}.limel-notched-outline--outlines{pointer-events:none;position:absolute;inset:0;z-index:var(--limel-notched-outline-z-index, 0);display:flex}.limel-notched-outline--leading-outline,.limel-notched-outline--notch,.limel-notched-outline--trailing-outline{transition:border-color 0.2s ease;border-width:1px;border-style:solid;border-color:var(--limel-notched-outline-border-color)}.limel-notched-outline--leading-outline{flex-shrink:0;width:0.75rem;border-right-width:0;border-top-left-radius:var(--limel-notched-outline-border-radius, 0.25rem);border-bottom-left-radius:var(--limel-notched-outline-border-radius, 0.25rem)}.limel-notched-outline--notch{flex-shrink:0;position:relative;z-index:2;border-top-color:var(--limel-notched-outline-notch-border-top-color, var(--limel-notched-outline-border-color));border-right-width:0;border-left-width:0;max-width:calc(100% - 1.5rem)}.limel-notched-outline--notch label{all:unset;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;position:relative;transition:color 0.2s ease, font-size 0.2s ease, transform 0.12s cubic-bezier(0.4, 0, 0.2, 1);transform:translate3d(var(--limel-notched-outline-label-transform-x, 0), var(--limel-notched-outline-label-transform-y, 0.62rem), 0);display:block;padding:0 0.25rem;color:var(--limel-notched-outline-label-color, rgba(var(--contrast-1200), 1));font-size:var(--limel-notched-outline-label-font-size, var(--limel-theme-default-font-size));letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, 0.009375em);line-height:normal}.limel-notched-outline--notch label:after{position:absolute;right:0;padding:0 0.25rem}.limel-notched-outline--trailing-outline{flex-grow:1;border-left-width:0;border-top-right-radius:var(--limel-notched-outline-border-radius, 0.25rem);border-bottom-right-radius:var(--limel-notched-outline-border-radius, 0.25rem)}.limel-notched-outline--empty-readonly-value{position:absolute;top:0.62rem;left:1rem}.limel-notched-outline--empty-readonly-value .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:var(--limel-theme-default-font-size);font-weight:400;font-family:inherit;letter-spacing:0.009375em}.mdc-text-field--disabled .limel-notched-outline--empty-readonly-value .lime-looks-like-input-value{cursor:not-allowed;opacity:0.4}limel-notched-outline:not([disabled]:not([disabled=false])):hover{--limel-notched-outline-border-color:rgba(var(--contrast-700), 1);--limel-notched-outline-background-color:rgba(var(--contrast-200), 1)}limel-notched-outline:not([disabled]:not([disabled=false])):has([slot=content]:focus-visible),limel-notched-outline:not([disabled]:not([disabled=false])):has([slot=content]:focus-within){--limel-notched-outline-border-color:var(--lime-primary-color, var(--limel-theme-primary-color));--limel-notched-outline-background-color:rgba(var(--contrast-100), 0.8)}limel-notched-outline[disabled]:not([disabled=false]){--limel-notched-outline-label-color:rgba(var(--contrast-1200), 0.5)}limel-notched-outline[required]:not([required=false]) .limel-notched-outline--notch label{padding-right:0.75rem}limel-notched-outline[required]:not([required=false]) .limel-notched-outline--notch label:after{content:"*";scale:1.3}limel-notched-outline[invalid]:not([invalid=false]):not([disabled]:not([disabled=false])){--limel-notched-outline-border-color:var(\n --limel-theme-error-text-color\n )}limel-notched-outline[invalid]:not([invalid=false]):not([disabled]:not([disabled=false])):hover{--limel-notched-outline-border-color:var(\n --limel-theme-error-color\n )}limel-notched-outline[invalid]:not([invalid=false]) .limel-notched-outline--notch label:after{color:var(--limel-theme-error-text-color)}limel-notched-outline[readonly]:not([readonly=false]){--limel-notched-outline-border-color:transparent !important;--limel-notched-outline-background-color:transparent !important}limel-notched-outline[readonly]:not([readonly=false]) .limel-notched-outline--notch label{transition-duration:0s}limel-notched-outline[has-leading-icon]:not([has-leading-icon=false]):not([has-floating-label]):not([has-value]){--limel-notched-outline-label-transform-x:1.25rem}limel-notched-outline[has-leading-icon] .limel-notched-outline--empty-readonly-value{left:2.25rem}limel-notched-outline:not([disabled]:not([disabled=false])):hover label,limel-notched-outline:not([disabled]:not([disabled=false])):focus label,limel-notched-outline:not([disabled]:not([disabled=false])):focus-within label{will-change:color, transform, font-size}limel-notched-outline:not([disabled]:not([disabled=false])):has([slot=content]:focus-visible),limel-notched-outline:not([disabled]:not([disabled=false])):has([slot=content]:focus-within){--limel-notched-outline-label-font-size:0.65rem;--limel-notched-outline-label-transform-x:0;--limel-notched-outline-label-transform-y:calc(-50% - 0.09375rem);--limel-notched-outline-notch-border-top-color:transparent}limel-notched-outline[has-floating-label],limel-notched-outline[has-value]:not([has-value=false]),limel-notched-outline[readonly]:not([has-value]:not([has-value=true])){--limel-notched-outline-label-font-size:0.65rem;--limel-notched-outline-label-transform-x:0;--limel-notched-outline-label-transform-y:calc(-50% - 0.09375rem);--limel-notched-outline-notch-border-top-color:transparent}';const r=class{constructor(l){e(this,l);this.required=false;this.readonly=false;this.invalid=false;this.disabled=false;this.label=undefined;this.labelId=undefined;this.hasValue=false;this.hasLeadingIcon=false;this.hasFloatingLabel=false}render(){return l("div",{class:"limel-notched-outline"},l("slot",{name:"content"}),l("span",{class:"limel-notched-outline--outlines","aria-hidden":"true"},l("span",{class:"limel-notched-outline--leading-outline"}),this.renderLabel(),l("span",{class:"limel-notched-outline--trailing-outline"}),this.renderEmptyReadonlyValue()))}renderLabel(){if(!this.label){return}return l("span",{class:"limel-notched-outline--notch"},l("label",{htmlFor:this.labelId},this.label))}renderEmptyReadonlyValue(){if(!this.readonly||this.hasValue){return}return l("span",{class:"limel-notched-outline--empty-readonly-value","aria-hidden":"true"},"–")}};r.style=n;export{i as limel_helper_line,r as limel_notched_outline};
|
|
2
|
+
//# sourceMappingURL=p-f1ec1eeb.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["helperLineCss","HelperLine","this","hasContent","maxLength","helperText","length","renderHelperText","h","class","id","helperTextId","renderCharacterCounter","counter","render","Host","tabIndex","invalid","style","display","notchedOutlineCss","NotchedOutline","name","renderLabel","renderEmptyReadonlyValue","label","htmlFor","labelId","readonly","hasValue"],"sources":["./src/components/helper-line/helper-line.scss?tag=limel-helper-line&encapsulation=shadow","./src/components/helper-line/helper-line.tsx","./src/components/notched-outline/notched-outline.scss?tag=limel-notched-outline","./src/components/notched-outline/notched-outline.tsx"],"sourcesContent":[":host(limel-helper-line) {\n transition: opacity 0.2s ease;\n\n box-sizing: border-box;\n display: grid;\n\n min-width: 0; // prevents overflowing, if component is placed in flex containers\n\n -moz-osx-font-smoothing: grayscale;\n -webkit-font-smoothing: antialiased;\n font-size: 0.6875rem;\n line-height: normal;\n\n color: rgb(var(--contrast-1200));\n}\n\ndiv {\n display: flex;\n justify-content: space-between;\n gap: 0.75rem;\n overflow: hidden;\n padding: 0 1rem;\n}\n\n:host(limel-helper-line.invalid) {\n --limel-h-l-grid-template-rows-transition-speed: 0.46s;\n --limel-h-l-grid-template-rows: 1fr;\n\n .helper-text {\n color: var(--limel-theme-error-color);\n }\n}\n\n.counter {\n flex-shrink: 0;\n margin-left: auto;\n}\n\n.helper-text,\n.counter {\n padding-top: 0.125rem;\n}\n\n// This animates height of the helper line, from `0` to `auto`.\n// To get this animation effect, the consumer component should\n// add `hide` classed accordingly.\n:host(limel-helper-line) {\n transition: grid-template-rows\n var(--limel-h-l-grid-template-rows-transition-speed, 0.46s)\n cubic-bezier(1, 0.09, 0, 0.89);\n grid-template-rows: var(--limel-h-l-grid-template-rows, 1fr);\n}\n\n:host(limel-helper-line.hide) {\n --limel-h-l-grid-template-rows-transition-speed: 0.3s;\n --limel-h-l-grid-template-rows: 0fr;\n}\n// End: animating height\n","import { Component, Host, Prop, h } from '@stencil/core';\n\n/**\n * This is an internal and private component that many input fields\n * use to display a helper text, along with a character counter below the\n * input field.\n *\n * We created this to keep the visual styles the same everywhere\n * and to avoid importing styles separately.\n *\n * Also this enables us to open the helper line in limel-portal,\n * more easily without having to send the styles to the portal.\n *\n * @exampleComponent limel-example-helper-line\n * @exampleComponent limel-example-helper-line-invalid\n * @exampleComponent limel-example-helper-line-long-text\n * @exampleComponent limel-example-helper-line-long-text-no-counter\n * @exampleComponent limel-example-helper-line-character-counter\n * @exampleComponent limel-example-helper-line-empty\n * @exampleComponent limel-example-helper-line-animation\n * @private\n */\n@Component({\n tag: 'limel-helper-line',\n shadow: true,\n styleUrl: 'helper-line.scss',\n})\nexport class HelperLine {\n /**\n * The helper text that is displayed on the left side.\n */\n @Prop({ reflect: true })\n public helperText?: string;\n\n /**\n * Length of the current input value, coming from the parent component.\n * Used in the character counter section on the right side.\n */\n @Prop({ reflect: true })\n public length?: number;\n\n /**\n * Maximum length of the characters, defined on the parent component.\n * Used in the character counter section on the right side.\n */\n @Prop({ reflect: true })\n public maxLength?: number;\n\n /**\n * Turns `true`, when the parent component is invalid.\n * For example, when the parent component is `required` but is left empty.\n * Or when the input format is invalid.\n */\n @Prop({ reflect: true })\n public invalid?: boolean = false;\n\n /**\n * Used by `aria-controls` and `aria-describedby` in the parent component.\n */\n @Prop({ reflect: true })\n public helperTextId?: string;\n\n public render() {\n return (\n <Host\n tabIndex={-1}\n class={{\n invalid: this.invalid,\n }}\n style={this.hasContent() ? {} : { display: 'none' }}\n aria-hidden={!this.hasContent()}\n >\n <div>\n {this.renderHelperText()}\n {this.renderCharacterCounter()}\n </div>\n </Host>\n );\n }\n\n private hasContent = () => {\n return !!(\n this.maxLength > 0 ||\n (this.helperText && this.helperText.length > 0)\n );\n };\n\n private renderHelperText = () => {\n if (!this.helperText) {\n return;\n }\n\n return (\n <span class=\"helper-text\" id={this.helperTextId}>\n {this.helperText}\n </span>\n );\n };\n\n private renderCharacterCounter = () => {\n const counter = `${this.length} / ${this.maxLength}`;\n\n if (!this.maxLength) {\n return;\n }\n\n return <span class=\"counter\">{counter}</span>;\n };\n}\n","@use '../../style/mixins.scss';\n@use '../../style/internal/shared_input-select-picker';\n/**\n * @prop --limel-notched-outline-z-index: Defines the `z-index` of the outlines & the label, since they are absolutely positioned. Useful if there are other elements with z-indexes in the consumer.\n */\n\n$border-radius: 0.25rem;\n$value-top: 0.62rem;\n\n*,\n*:before,\n*:after {\n box-sizing: border-box;\n}\n\nlimel-notched-outline {\n --limel-notched-outline-border-color: #{shared_input-select-picker.$lime-text-field-outline-color};\n --limel-notched-outline-background-color: #{shared_input-select-picker.$background-color-normal};\n\n display: block;\n width: 100%;\n height: fit-content;\n}\n\n.limel-notched-outline {\n position: relative;\n width: 100%;\n height: 100%;\n\n [slot='content'] {\n background-color: var(--limel-notched-outline-background-color);\n border-radius: var(\n --limel-notched-outline-border-radius,\n $border-radius\n );\n }\n\n // Why is everything prefixed?\n // Because the component has `shadow: false;`\n // and this ensures that we are not inheriting styles.\n &--outlines {\n pointer-events: none;\n position: absolute;\n inset: 0;\n z-index: var(--limel-notched-outline-z-index, 0);\n display: flex;\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-notched-outline-border-color);\n }\n\n &--leading-outline {\n flex-shrink: 0;\n width: 0.75rem;\n border-right-width: 0;\n border-top-left-radius: var(\n --limel-notched-outline-border-radius,\n $border-radius\n );\n border-bottom-left-radius: var(\n --limel-notched-outline-border-radius,\n $border-radius\n );\n }\n\n &--notch {\n flex-shrink: 0;\n\n position: relative;\n z-index: 2;\n\n border-top-color: var(\n --limel-notched-outline-notch-border-top-color,\n var(--limel-notched-outline-border-color)\n );\n border-right-width: 0;\n border-left-width: 0;\n\n max-width: calc(100% - 1.5rem);\n\n label {\n all: unset;\n @include mixins.truncate-text;\n position: relative;\n transition:\n color 0.2s ease,\n font-size 0.2s ease,\n transform 0.12s cubic-bezier(0.4, 0, 0.2, 1);\n\n transform: translate3d(\n var(--limel-notched-outline-label-transform-x, 0),\n var(--limel-notched-outline-label-transform-y, $value-top),\n 0\n );\n display: block;\n padding: 0 0.25rem;\n\n color: var(\n --limel-notched-outline-label-color,\n #{shared_input-select-picker.$label-color}\n );\n font-size: var(\n --limel-notched-outline-label-font-size,\n var(--limel-theme-default-font-size)\n );\n letter-spacing: var(\n --mdc-typography-subtitle1-letter-spacing,\n 0.009375em\n );\n line-height: normal;\n\n &:after {\n position: absolute;\n right: 0;\n padding: 0 0.25rem;\n }\n }\n }\n\n &--trailing-outline {\n flex-grow: 1;\n border-left-width: 0;\n border-top-right-radius: var(\n --limel-notched-outline-border-radius,\n $border-radius\n );\n border-bottom-right-radius: var(\n --limel-notched-outline-border-radius,\n $border-radius\n );\n }\n\n &--empty-readonly-value {\n @include shared_input-select-picker.lime-looks-like-input-value;\n position: absolute;\n top: $value-top;\n left: 1rem;\n }\n}\n\nlimel-notched-outline {\n &:not([disabled]:not([disabled='false'])) {\n &:hover {\n --limel-notched-outline-border-color: #{shared_input-select-picker.$lime-text-field-outline-color--hovered};\n --limel-notched-outline-background-color: #{shared_input-select-picker.$background-color-hovered};\n }\n\n &:has([slot='content']:focus-visible),\n &:has([slot='content']:focus-within) {\n --limel-notched-outline-border-color: #{shared_input-select-picker.$lime-text-field-outline-color--focused};\n --limel-notched-outline-background-color: #{shared_input-select-picker.$background-color-focused};\n }\n }\n\n &[disabled]:not([disabled='false']) {\n --limel-notched-outline-label-color: #{shared_input-select-picker.$label-color-disabled};\n }\n\n &[required]:not([required='false']) {\n .limel-notched-outline--notch {\n label {\n padding-right: 0.75rem;\n\n &:after {\n content: '*';\n scale: 1.3;\n }\n }\n }\n }\n\n &[invalid]:not([invalid='false']) {\n &:not([disabled]:not([disabled='false'])) {\n --limel-notched-outline-border-color: var(\n --limel-theme-error-text-color\n );\n &:hover {\n --limel-notched-outline-border-color: var(\n --limel-theme-error-color\n );\n }\n }\n\n .limel-notched-outline--notch {\n label {\n &:after {\n color: var(--limel-theme-error-text-color);\n }\n }\n }\n }\n\n &[readonly]:not([readonly='false']) {\n --limel-notched-outline-border-color: transparent !important;\n --limel-notched-outline-background-color: transparent !important;\n\n .limel-notched-outline--notch {\n label {\n transition-duration: 0s;\n }\n }\n }\n\n &[has-leading-icon] {\n &:not([has-leading-icon='false']):not([has-floating-label]):not(\n [has-value]\n ) {\n --limel-notched-outline-label-transform-x: 1.25rem;\n }\n\n .limel-notched-outline--empty-readonly-value {\n left: 2.25rem;\n }\n }\n}\n\n// Transitioning the floating label\n@mixin float-label {\n --limel-notched-outline-label-font-size: 0.65rem; // `10.4px` similar to MDC's floating label\n --limel-notched-outline-label-transform-x: 0;\n --limel-notched-outline-label-transform-y: calc(-50% - 0.09375rem);\n --limel-notched-outline-notch-border-top-color: transparent;\n}\n\nlimel-notched-outline {\n &:not([disabled]:not([disabled='false'])) {\n &:hover,\n &:focus,\n &:focus-within {\n label {\n will-change: color, transform, font-size;\n }\n }\n\n &:has([slot='content']:focus-visible),\n &:has([slot='content']:focus-within) {\n @include float-label;\n }\n }\n\n &[has-floating-label],\n &[has-value]:not([has-value='false']),\n &[readonly]:not([has-value]:not([has-value='true'])) {\n @include float-label;\n }\n}\n","import { Component, Prop, h } from '@stencil/core';\n\n/**\n * This is a private component, used to render a notched outline\n * around all input elements that can have a floating label.\n * Inspired by Material Design's styles for input fields.\n * We use it in various components to unify styles and avoid\n * repeating code.\n *\n * :::note\n * The component has `shadow: false`. This is to improve performance,\n * and ensure that its internal elements are considered as internal parts\n * of the consumer's DOM. This way, the value `for` in `<label for=\"id-of-input-element\">`\n * would be correctly associated with the input element's `id`, in the consumer component.\n * :::\n * @exampleComponent limel-example-notched-outline-basic\n * @private\n */\n@Component({\n tag: 'limel-notched-outline',\n styleUrl: 'notched-outline.scss',\n shadow: false,\n})\nexport class NotchedOutline {\n /**\n * Set to `true` when the input element is required.\n * This applies proper visual styles, such as inclusion of an asterisk\n * beside the label.\n */\n @Prop({ reflect: true })\n public required = false;\n\n /**\n * Set to `true` when the input element is readonly.\n * This applies proper visual styles, such as making the outline transparent.\n */\n @Prop({ reflect: true })\n public readonly = false;\n\n /**\n * Set to `true` to indicate that the current value of the input element is\n * invalid. This applies proper visual styles, such as making the outlines red.\n */\n @Prop({ reflect: true })\n public invalid = false;\n\n /**\n * Set to `true` to indicate that the input element is\n * disabled. This applies proper visual styles, such as making the outlines\n * and the label transparent.\n */\n @Prop({ reflect: true })\n public disabled = false;\n\n /**\n * Label to display for the input element.\n * :::important\n * Note that the input element of the consumer component will be\n * labeled by this label, using the `labelId` prop.\n * :::\n */\n @Prop({ reflect: true })\n public label?: string;\n\n /**\n * The `id` of the input element which should be\n * labeled by the provided label.\n */\n @Prop({ reflect: true })\n public labelId?: string;\n\n /**\n * Set to `true` when the user has entered a value for the input element,\n * shrinking the label in size, and visually rendering it above the entered value.\n */\n @Prop({ reflect: true })\n public hasValue = false;\n\n /**\n * Set to `true` when the consumer element displays a leading icon.\n * This applies proper visual styles, such as rendering the label\n * correctly placed beside the leading icon.\n */\n @Prop({ reflect: true })\n public hasLeadingIcon = false;\n\n /**\n * Set to `true` when the consumer element needs to render the\n * label above the input element, despite existence of a `value`.\n * For example in the `text-editor` or `limel-select`,\n * where the default layout requires a floating label.\n */\n @Prop({ reflect: true })\n public hasFloatingLabel = false;\n\n public render() {\n return (\n <div class=\"limel-notched-outline\">\n <slot name=\"content\" />\n <span\n class=\"limel-notched-outline--outlines\"\n aria-hidden=\"true\"\n >\n <span class=\"limel-notched-outline--leading-outline\" />\n {this.renderLabel()}\n <span class=\"limel-notched-outline--trailing-outline\" />\n {this.renderEmptyReadonlyValue()}\n </span>\n </div>\n );\n }\n\n private renderLabel() {\n if (!this.label) {\n return;\n }\n\n return (\n <span class=\"limel-notched-outline--notch\">\n <label htmlFor={this.labelId}>{this.label}</label>\n </span>\n );\n }\n\n private renderEmptyReadonlyValue() {\n if (!this.readonly || this.hasValue) {\n return;\n }\n\n return (\n <span\n class=\"limel-notched-outline--empty-readonly-value\"\n aria-hidden=\"true\"\n >\n –\n </span>\n );\n }\n}\n"],"mappings":"kDAAA,MAAMA,EAAgB,k7B,MC2BTC,EAAU,M,yBAqDXC,KAAAC,WAAa,OAEbD,KAAKE,UAAY,GAChBF,KAAKG,YAAcH,KAAKG,WAAWC,OAAS,GAI7CJ,KAAAK,iBAAmB,KACvB,IAAKL,KAAKG,WAAY,CAClB,M,CAGJ,OACIG,EAAA,QAAMC,MAAM,cAAcC,GAAIR,KAAKS,cAC9BT,KAAKG,WACH,EAIPH,KAAAU,uBAAyB,KAC7B,MAAMC,EAAU,GAAGX,KAAKI,YAAYJ,KAAKE,YAEzC,IAAKF,KAAKE,UAAW,CACjB,M,CAGJ,OAAOI,EAAA,QAAMC,MAAM,WAAWI,EAAe,E,sFApDtB,M,4BAQpBC,SACH,OACIN,EAACO,EAAI,CACDC,UAAW,EACXP,MAAO,CACHQ,QAASf,KAAKe,SAElBC,MAAOhB,KAAKC,aAAe,GAAK,CAAEgB,QAAS,QAAQ,eACrCjB,KAAKC,cAEnBK,EAAA,WACKN,KAAKK,mBACLL,KAAKU,0B,aC1E1B,MAAMQ,EAAoB,iuL,MCuBbC,EAAc,M,uCAOL,M,cAOA,M,aAOD,M,cAQC,M,0DAwBA,M,oBAQM,M,sBASE,K,CAEnBP,SACH,OACIN,EAAA,OAAKC,MAAM,yBACPD,EAAA,QAAMc,KAAK,YACXd,EAAA,QACIC,MAAM,kCAAiC,cAC3B,QAEZD,EAAA,QAAMC,MAAM,2CACXP,KAAKqB,cACNf,EAAA,QAAMC,MAAM,4CACXP,KAAKsB,4B,CAMdD,cACJ,IAAKrB,KAAKuB,MAAO,CACb,M,CAGJ,OACIjB,EAAA,QAAMC,MAAM,gCACRD,EAAA,SAAOkB,QAASxB,KAAKyB,SAAUzB,KAAKuB,O,CAKxCD,2BACJ,IAAKtB,KAAK0B,UAAY1B,KAAK2B,SAAU,CACjC,M,CAGJ,OACIrB,EAAA,QACIC,MAAM,8CAA6C,cACvC,QAAM,I"}
|
|
@@ -16,6 +16,7 @@ import 'codemirror/addon/fold/xml-fold';
|
|
|
16
16
|
* @exampleComponent limel-example-code-editor
|
|
17
17
|
* @exampleComponent limel-example-code-editor-readonly-with-line-numbers
|
|
18
18
|
* @exampleComponent limel-example-code-editor-fold-lint-wrap
|
|
19
|
+
* @exampleComponent limel-example-code-editor-composite
|
|
19
20
|
*/
|
|
20
21
|
export declare class CodeEditor {
|
|
21
22
|
/**
|
|
@@ -27,9 +28,35 @@ export declare class CodeEditor {
|
|
|
27
28
|
*/
|
|
28
29
|
language: Language;
|
|
29
30
|
/**
|
|
30
|
-
*
|
|
31
|
+
* Set to `true` to make the editor read-only.
|
|
32
|
+
* Use `readonly` when the editor is only there to present the data it holds,
|
|
33
|
+
* and will not become possible for the current user to edit.
|
|
31
34
|
*/
|
|
32
35
|
readonly: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Set to `true` to disable the editor.
|
|
38
|
+
* Use `disabled` to indicate that the editor can normally be interacted
|
|
39
|
+
* with, but is currently disabled. This tells the user that if certain
|
|
40
|
+
* requirements are met, the editor may become enabled again.
|
|
41
|
+
*/
|
|
42
|
+
disabled: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Set to `true` to indicate that the current value of the input editor is
|
|
45
|
+
* invalid.
|
|
46
|
+
*/
|
|
47
|
+
invalid: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Set to `true` to indicate that the field is required.
|
|
50
|
+
*/
|
|
51
|
+
required: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* The input label.
|
|
54
|
+
*/
|
|
55
|
+
label?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Optional helper text to display below the input field when it has focus
|
|
58
|
+
*/
|
|
59
|
+
helperText?: string;
|
|
33
60
|
/**
|
|
34
61
|
* Displays line numbers in the editor
|
|
35
62
|
*/
|
|
@@ -63,10 +90,18 @@ export declare class CodeEditor {
|
|
|
63
90
|
protected random: number;
|
|
64
91
|
private editor;
|
|
65
92
|
private observer;
|
|
93
|
+
private labelId;
|
|
94
|
+
private helperTextId;
|
|
95
|
+
constructor();
|
|
66
96
|
connectedCallback(): void;
|
|
67
97
|
disconnectedCallback(): void;
|
|
68
98
|
componentDidRender(): void;
|
|
69
99
|
protected watchValue(newValue: string): void;
|
|
100
|
+
protected watchDisabled(): void;
|
|
101
|
+
protected watchReadonly(): void;
|
|
102
|
+
protected watchInvalid(): void;
|
|
103
|
+
protected watchRequired(): void;
|
|
104
|
+
protected watchHelperText(): void;
|
|
70
105
|
private handleChangeDarkMode;
|
|
71
106
|
private handleChange;
|
|
72
107
|
private handleResize;
|
|
@@ -74,7 +109,11 @@ export declare class CodeEditor {
|
|
|
74
109
|
private getOptions;
|
|
75
110
|
private isDarkMode;
|
|
76
111
|
render(): any;
|
|
112
|
+
private renderHelperLine;
|
|
77
113
|
private forceRedraw;
|
|
78
114
|
private get darkMode();
|
|
115
|
+
private updateEditorReadOnlyState;
|
|
116
|
+
private getReadOnlyOption;
|
|
117
|
+
private updateInputFieldAccessibilityAttributes;
|
|
79
118
|
}
|
|
80
119
|
//# sourceMappingURL=code-editor.d.ts.map
|
|
@@ -865,16 +865,33 @@ export namespace Components {
|
|
|
865
865
|
* @exampleComponent limel-example-code-editor
|
|
866
866
|
* @exampleComponent limel-example-code-editor-readonly-with-line-numbers
|
|
867
867
|
* @exampleComponent limel-example-code-editor-fold-lint-wrap
|
|
868
|
+
* @exampleComponent limel-example-code-editor-composite
|
|
868
869
|
*/
|
|
869
870
|
interface LimelCodeEditor {
|
|
870
871
|
/**
|
|
871
872
|
* Select color scheme for the editor
|
|
872
873
|
*/
|
|
873
874
|
"colorScheme": ColorScheme;
|
|
875
|
+
/**
|
|
876
|
+
* Set to `true` to disable the editor. Use `disabled` to indicate that the editor can normally be interacted with, but is currently disabled. This tells the user that if certain requirements are met, the editor may become enabled again.
|
|
877
|
+
*/
|
|
878
|
+
"disabled": boolean;
|
|
874
879
|
/**
|
|
875
880
|
* Allows the user to fold code
|
|
876
881
|
*/
|
|
877
882
|
"fold": boolean;
|
|
883
|
+
/**
|
|
884
|
+
* Optional helper text to display below the input field when it has focus
|
|
885
|
+
*/
|
|
886
|
+
"helperText"?: string;
|
|
887
|
+
/**
|
|
888
|
+
* Set to `true` to indicate that the current value of the input editor is invalid.
|
|
889
|
+
*/
|
|
890
|
+
"invalid": boolean;
|
|
891
|
+
/**
|
|
892
|
+
* The input label.
|
|
893
|
+
*/
|
|
894
|
+
"label"?: string;
|
|
878
895
|
/**
|
|
879
896
|
* The language of the code
|
|
880
897
|
*/
|
|
@@ -892,9 +909,13 @@ export namespace Components {
|
|
|
892
909
|
*/
|
|
893
910
|
"lint": boolean;
|
|
894
911
|
/**
|
|
895
|
-
*
|
|
912
|
+
* Set to `true` to make the editor read-only. Use `readonly` when the editor is only there to present the data it holds, and will not become possible for the current user to edit.
|
|
896
913
|
*/
|
|
897
914
|
"readonly": boolean;
|
|
915
|
+
/**
|
|
916
|
+
* Set to `true` to indicate that the field is required.
|
|
917
|
+
*/
|
|
918
|
+
"required": boolean;
|
|
898
919
|
/**
|
|
899
920
|
* The code to be rendered
|
|
900
921
|
*/
|
|
@@ -3955,6 +3976,7 @@ declare global {
|
|
|
3955
3976
|
* @exampleComponent limel-example-code-editor
|
|
3956
3977
|
* @exampleComponent limel-example-code-editor-readonly-with-line-numbers
|
|
3957
3978
|
* @exampleComponent limel-example-code-editor-fold-lint-wrap
|
|
3979
|
+
* @exampleComponent limel-example-code-editor-composite
|
|
3958
3980
|
*/
|
|
3959
3981
|
interface HTMLLimelCodeEditorElement extends Components.LimelCodeEditor, HTMLStencilElement {
|
|
3960
3982
|
}
|
|
@@ -6063,16 +6085,33 @@ declare namespace LocalJSX {
|
|
|
6063
6085
|
* @exampleComponent limel-example-code-editor
|
|
6064
6086
|
* @exampleComponent limel-example-code-editor-readonly-with-line-numbers
|
|
6065
6087
|
* @exampleComponent limel-example-code-editor-fold-lint-wrap
|
|
6088
|
+
* @exampleComponent limel-example-code-editor-composite
|
|
6066
6089
|
*/
|
|
6067
6090
|
interface LimelCodeEditor {
|
|
6068
6091
|
/**
|
|
6069
6092
|
* Select color scheme for the editor
|
|
6070
6093
|
*/
|
|
6071
6094
|
"colorScheme"?: ColorScheme;
|
|
6095
|
+
/**
|
|
6096
|
+
* Set to `true` to disable the editor. Use `disabled` to indicate that the editor can normally be interacted with, but is currently disabled. This tells the user that if certain requirements are met, the editor may become enabled again.
|
|
6097
|
+
*/
|
|
6098
|
+
"disabled"?: boolean;
|
|
6072
6099
|
/**
|
|
6073
6100
|
* Allows the user to fold code
|
|
6074
6101
|
*/
|
|
6075
6102
|
"fold"?: boolean;
|
|
6103
|
+
/**
|
|
6104
|
+
* Optional helper text to display below the input field when it has focus
|
|
6105
|
+
*/
|
|
6106
|
+
"helperText"?: string;
|
|
6107
|
+
/**
|
|
6108
|
+
* Set to `true` to indicate that the current value of the input editor is invalid.
|
|
6109
|
+
*/
|
|
6110
|
+
"invalid"?: boolean;
|
|
6111
|
+
/**
|
|
6112
|
+
* The input label.
|
|
6113
|
+
*/
|
|
6114
|
+
"label"?: string;
|
|
6076
6115
|
/**
|
|
6077
6116
|
* The language of the code
|
|
6078
6117
|
*/
|
|
@@ -6094,9 +6133,13 @@ declare namespace LocalJSX {
|
|
|
6094
6133
|
*/
|
|
6095
6134
|
"onChange"?: (event: LimelCodeEditorCustomEvent<string>) => void;
|
|
6096
6135
|
/**
|
|
6097
|
-
*
|
|
6136
|
+
* Set to `true` to make the editor read-only. Use `readonly` when the editor is only there to present the data it holds, and will not become possible for the current user to edit.
|
|
6098
6137
|
*/
|
|
6099
6138
|
"readonly"?: boolean;
|
|
6139
|
+
/**
|
|
6140
|
+
* Set to `true` to indicate that the field is required.
|
|
6141
|
+
*/
|
|
6142
|
+
"required"?: boolean;
|
|
6100
6143
|
/**
|
|
6101
6144
|
* The code to be rendered
|
|
6102
6145
|
*/
|
|
@@ -9269,6 +9312,7 @@ declare module "@stencil/core" {
|
|
|
9269
9312
|
* @exampleComponent limel-example-code-editor
|
|
9270
9313
|
* @exampleComponent limel-example-code-editor-readonly-with-line-numbers
|
|
9271
9314
|
* @exampleComponent limel-example-code-editor-fold-lint-wrap
|
|
9315
|
+
* @exampleComponent limel-example-code-editor-composite
|
|
9272
9316
|
*/
|
|
9273
9317
|
"limel-code-editor": LocalJSX.LimelCodeEditor & JSXBase.HTMLAttributes<HTMLLimelCodeEditorElement>;
|
|
9274
9318
|
/**
|