@luzmo/analytics-components-kit 1.0.1-alpha.140 → 1.0.1-alpha.141
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/README.md +17 -5
- package/angular/components/ai-interaction-textarea.component.ts +2 -0
- package/angular/components/grid.component.ts +2 -2
- package/angular/esm/components/ai-interaction-textarea.component.d.ts +2 -1
- package/angular/esm/components/ai-interaction-textarea.component.js +7 -2
- package/angular/esm/components/grid.component.d.ts +2 -2
- package/angular/esm/types/ai-chat.types.d.ts +1 -0
- package/angular/types/ai-chat.types.ts +1 -0
- package/components/ai-chat/ai-chat.d.ts +21 -1
- package/components/ai-chat/index.cjs +1 -1
- package/components/ai-chat/index.d.ts +1 -0
- package/components/ai-chat/index.js +3 -3
- package/components/ai-chat/request-contract.d.ts +38 -0
- package/components/ai-chat-BrTAn0m-.cjs +62 -0
- package/components/{ai-chat-Dg2dvhDq.js → ai-chat-D6fPnWEi.js} +211 -151
- package/components/ai-interaction-textarea/ai-interaction-textarea.d.ts +6 -0
- package/components/ai-interaction-textarea/index.cjs +1 -1
- package/components/ai-interaction-textarea/index.js +1 -1
- package/components/{ai-interaction-textarea-DDVKMfTQ.cjs → ai-interaction-textarea-BGnQbDpJ.cjs} +2 -2
- package/components/{ai-interaction-textarea-ZDQPVgXC.js → ai-interaction-textarea-EdWcPK0w.js} +6 -3
- package/components/grid/grid.d.ts +4 -9
- package/components/grid/helpers/grid-effects.d.ts +1 -0
- package/components/grid/helpers/grid-events.d.ts +50 -0
- package/components/grid/helpers/grid-interactions.d.ts +91 -0
- package/components/grid/helpers/grid-item-management.d.ts +45 -0
- package/components/grid/helpers/grid-item-popover.d.ts +15 -0
- package/components/grid/helpers/grid-items.d.ts +9 -0
- package/components/grid/helpers/grid-keyboard-updates.d.ts +18 -0
- package/components/grid/helpers/grid-keydown-event.d.ts +18 -0
- package/components/grid/helpers/grid-popover-cleanup.d.ts +4 -0
- package/components/grid/helpers/grid-rendering.d.ts +63 -0
- package/components/grid/helpers/grid-stack-lifecycle.d.ts +26 -0
- package/components/grid/helpers/grid-theme.d.ts +16 -0
- package/components/grid/helpers/grid-update-cycle.d.ts +24 -0
- package/components/grid/index.cjs +1 -1
- package/components/grid/index.js +1 -1
- package/components/grid-BNbbl-9p.cjs +316 -0
- package/components/{grid-BW6LPvCu.js → grid-Ca-fxUK1.js} +2341 -1965
- package/components/index.cjs +1 -1
- package/components/index.js +5 -5
- package/components/item-data-picker-panel/index.cjs +1 -1
- package/components/item-data-picker-panel/index.js +1 -1
- package/components/slot-contents-picker/index.cjs +1 -1
- package/components/slot-contents-picker/index.js +1 -1
- package/components/slot-contents-picker/slot-contents-picker.d.ts +4 -2
- package/components/{slot-contents-picker-HRJuZQq5.cjs → slot-contents-picker-BO5lSTDz.cjs} +4 -4
- package/components/{slot-contents-picker-CgACNIVS.js → slot-contents-picker-Bw_G1BwZ.js} +112 -92
- package/custom-elements.json +1558 -17
- package/package.json +2 -2
- package/types/ai-chat.types.d.ts +1 -0
- package/components/ai-chat-CbqvVZDp.cjs +0 -60
- package/components/grid-xtLaTdhb.cjs +0 -316
|
@@ -11,6 +11,7 @@ import '../dataset-selector-row';
|
|
|
11
11
|
* @property {boolean} hide-dataset-button - When true, hides the "+ Add dataset" button
|
|
12
12
|
* @property {boolean} is-generating - When true, shows a spinning loader icon instead of the submit arrow
|
|
13
13
|
* @property {string} value - The current value of the textarea (can be controlled from parent to clear or set text)
|
|
14
|
+
* @property {boolean} retain-on-submit - When true, retains the input value after submission (default: false, clears on submit)
|
|
14
15
|
*
|
|
15
16
|
* @property {string} --luzmo-ai-interaction-textarea-background-color - Override for background color of the component (client customization)
|
|
16
17
|
* @property {string} --ai-interaction-textarea-background-color - Background color of the component
|
|
@@ -89,6 +90,11 @@ export declare class LuzmoAiInteractionTextarea extends LitElement {
|
|
|
89
90
|
* The current value of the textarea (controlled from parent)
|
|
90
91
|
*/
|
|
91
92
|
value: string;
|
|
93
|
+
/**
|
|
94
|
+
* When true, retains the input value after submitting a prompt (default: false)
|
|
95
|
+
* When false (default), clears the textarea value after submission
|
|
96
|
+
*/
|
|
97
|
+
retainOnSubmit: boolean;
|
|
92
98
|
private _promptValue;
|
|
93
99
|
private _isPromptValid;
|
|
94
100
|
private get _buttonDisabled();
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
18
|
* SOFTWARE.
|
|
19
19
|
* */
|
|
20
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../set-locale-CKjJZRH6.cjs`),require(`../dataset-icon-BbNgugDA.cjs`),require(`../data-broker-BUIUM5hr.cjs`),require(`../dataset-selector-list-BdeJlo0u.cjs`),require(`../dataset-selector-row-CAlRVIk_.cjs`);const e=require(`../ai-interaction-textarea-
|
|
20
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../set-locale-CKjJZRH6.cjs`),require(`../dataset-icon-BbNgugDA.cjs`),require(`../data-broker-BUIUM5hr.cjs`),require(`../dataset-selector-list-BdeJlo0u.cjs`),require(`../dataset-selector-row-CAlRVIk_.cjs`);const e=require(`../ai-interaction-textarea-BGnQbDpJ.cjs`);Object.defineProperty(exports,`LuzmoAiInteractionTextarea`,{enumerable:!0,get:function(){return e.t}});
|
|
@@ -28,5 +28,5 @@ import "../dataset-icon-x6Q8nhYc.js";
|
|
|
28
28
|
import "../data-broker-cLR-t5LM.js";
|
|
29
29
|
import "../dataset-selector-list-DO_ExOrO.js";
|
|
30
30
|
import "../dataset-selector-row-VsvdrVDf.js";
|
|
31
|
-
import { t as LuzmoAiInteractionTextarea } from "../ai-interaction-textarea-
|
|
31
|
+
import { t as LuzmoAiInteractionTextarea } from "../ai-interaction-textarea-EdWcPK0w.js";
|
|
32
32
|
export { LuzmoAiInteractionTextarea };
|
package/components/{ai-interaction-textarea-DDVKMfTQ.cjs → ai-interaction-textarea-BGnQbDpJ.cjs}
RENAMED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
18
|
* SOFTWARE.
|
|
19
19
|
* */
|
|
20
|
-
const e=require(`./chunk-350yNsax.cjs`),t=require(`./decorate-Dq4-zbi1.cjs`);let n=require(`lit`),r=require(`lit/decorators.js`),i=require(`@lit/localize`),a=require(`@luzmo/icons`),o=require(`lit/directives/class-map.js`);var s=`:host{box-sizing:border-box;background-color:var(--luzmo-ai-interaction-textarea-background-color,var(--ai-interaction-textarea-background-color));border:1px solid var(--luzmo-ai-interaction-textarea-border-color,var(--ai-interaction-textarea-border-color));border-radius:var(--luzmo-ai-interaction-textarea-border-radius,var(--ai-interaction-textarea-border-radius));padding:var(--luzmo-ai-interaction-textarea-padding,var(--ai-interaction-textarea-padding));gap:var(--luzmo-ai-interaction-textarea-gap,var(--ai-interaction-textarea-gap));font-family:var(--luzmo-ai-interaction-textarea-font-family,var(--ai-interaction-textarea-font-family));font-size:var(--luzmo-ai-interaction-textarea-font-size,var(--ai-interaction-textarea-font-size));flex-direction:column;display:flex}:host:has(textarea:focus){border-color:var(--luzmo-ai-interaction-textarea-focus-border-color,var(--ai-interaction-textarea-focus-border-color));box-shadow:var(--luzmo-ai-interaction-textarea-focus-box-shadow,var(--ai-interaction-textarea-focus-box-shadow))}:host .content-wrapper{gap:var(--luzmo-ai-interaction-textarea-gap,var(--ai-interaction-textarea-gap));flex-direction:column;display:flex}:host .content-wrapper.single-line{flex-direction:row;align-items:center}:host .content-wrapper.single-line textarea{flex:1;min-height:auto}:host .content-wrapper.single-line .button-container{align-self:flex-end}:host .content-wrapper.disabled{opacity:.6;pointer-events:none;cursor:not-allowed}:host .content-wrapper.disabled *{pointer-events:none}:host textarea{background-color:var(--luzmo-ai-interaction-textarea-textarea-background,var(--ai-interaction-textarea-textarea-background));resize:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;vertical-align:middle;min-height:var(--luzmo-ai-interaction-textarea-textarea-min-height,var(--ai-interaction-textarea-textarea-min-height,3rem));color:var(--luzmo-ai-interaction-textarea-textarea-color,var(--ai-interaction-textarea-textarea-color));font-family:var(--luzmo-ai-interaction-textarea-font-family,var(--ai-interaction-textarea-font-family));font-size:var(--luzmo-ai-interaction-textarea-font-size,var(--ai-interaction-textarea-font-size));border:none;outline:none;padding:0;line-height:1.5}:host textarea::placeholder{color:var(--luzmo-ai-interaction-textarea-textarea-placeholder-color,var(--ai-interaction-textarea-textarea-placeholder-color))}:host .button-container{text-align:var(--luzmo-ai-interaction-textarea-button-container-text-align,var(--ai-interaction-textarea-button-container-text-align))}:host .button-container button{padding:var(--luzmo-ai-interaction-textarea-button-padding,var(--ai-interaction-textarea-button-padding));min-width:var(--luzmo-ai-interaction-textarea-button-min-width,var(--ai-interaction-textarea-button-min-width));min-height:var(--luzmo-ai-interaction-textarea-button-min-height,var(--ai-interaction-textarea-button-min-height));border-radius:var(--luzmo-ai-interaction-textarea-button-border-radius,var(--ai-interaction-textarea-button-border-radius));font-size:var(--luzmo-ai-interaction-textarea-button-font-size,var(--ai-interaction-textarea-button-font-size));cursor:pointer;border:none;justify-content:center;align-items:center;transition:all .15s;display:inline-flex}:host .button-container button:disabled,:host .button-container button.disabled{opacity:.6;cursor:not-allowed}:host .button-container button svg{justify-content:center;align-items:center;display:flex}:host .button-container button svg.spin{animation:1s linear infinite spin}:host .button-container button.btn-primary{background-color:var(--luzmo-ai-interaction-textarea-button-background-color,var(--ai-interaction-textarea-button-background-color));color:var(--luzmo-ai-interaction-textarea-button-color,var(--ai-interaction-textarea-button-color))}:host .button-container button.btn-primary:hover:not(:disabled):not(.disabled){background-color:var(--luzmo-ai-interaction-textarea-button-background-color-hover,var(--ai-interaction-textarea-button-background-color-hover))}:host .button-container button.btn-primary:disabled,:host .button-container button.btn-primary.disabled{background-color:var(--luzmo-ai-interaction-textarea-button-background-color-disabled,var(--ai-interaction-textarea-button-background-color-disabled));opacity:.6}@keyframes spin{to{transform:rotate(360deg)}}:host{--ai-interaction-textarea-background-color:var(--luzmo-background-color-alt-2);--ai-interaction-textarea-border-color:var(--luzmo-border-color);--ai-interaction-textarea-border-radius:.5rem;--ai-interaction-textarea-padding:.75rem;--ai-interaction-textarea-gap:1rem;--ai-interaction-textarea-focus-border-color:var(--luzmo-primary);--ai-interaction-textarea-focus-box-shadow:0 0 1rem 0 var(--luzmo-primary-50);--ai-interaction-textarea-font-family:var(--luzmo-font-family);--ai-interaction-textarea-font-size:.875rem;--ai-interaction-textarea-textarea-background:transparent;--ai-interaction-textarea-textarea-color:var(--luzmo-font-color);--ai-interaction-textarea-textarea-placeholder-color:var(--luzmo-font-color-extra-dimmed);--ai-interaction-textarea-textarea-min-height:3rem;--ai-interaction-textarea-button-container-text-align:right;--ai-interaction-textarea-button-padding:0;--ai-interaction-textarea-button-min-width:2rem;--ai-interaction-textarea-button-min-height:1.875rem;--ai-interaction-textarea-button-border-radius:.5rem;--ai-interaction-textarea-button-font-size:1rem;--ai-interaction-textarea-button-background-color:var(--luzmo-primary);--ai-interaction-textarea-button-background-color-hover:var(--luzmo-primary-hover);--ai-interaction-textarea-button-background-color-disabled:var(--luzmo-primary);--ai-interaction-textarea-button-color:var(--luzmo-primary-inverse-color)}`,c=class extends n.LitElement{constructor(...e){super(...e),this.placeholder=`Type your prompt here...`,this.selectedDatasets=[],this.authKey=``,this.authToken=``,this.apiUrl=`https://api.luzmo.com`,this.appServer=`https://app.luzmo.com`,this.flagOpendata=!1,this.disabled=!1,this.singleLine=!1,this.hideDatasetButton=!1,this.isGenerating=!1,this.value=``,this._promptValue=``,this._isPromptValid=!1}static{this.styles=(0,n.unsafeCSS)(s)}static{this.tagName=`luzmo-ai-interaction-textarea`}get _buttonDisabled(){return this.hideDatasetButton?this.disabled||!this._isPromptValid:this.disabled||this.selectedDatasets.length===0||!this._isPromptValid}_autoResizeTextarea(e){if(e.style.height=`auto`,this.singleLine){let t=1.5,n=Number.parseFloat(getComputedStyle(e).fontSize)||14,r=t*n,i=8*t*n,a=Math.max(r,Math.min(e.scrollHeight,i));e.style.height=`${a}px`}else{let t=Math.max(2*1.5*16,Math.min(e.scrollHeight,8*1.5*16));e.style.height=`${t}px`}}_handlePromptInput(e){let t=e.target;this._promptValue=t.value,this._isPromptValid=t.value.trim().length>0,this._autoResizeTextarea(t),t.scrollTo({top:t.scrollHeight})}_handleKeyDown(e){e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),this._submitPrompt())}_submitPrompt(){if(this._buttonDisabled)return;let e=this._promptValue.trim();this.dispatchEvent(new CustomEvent(`prompt-submitted`,{detail:{prompt:e,selectedDatasets:this.selectedDatasets},bubbles:!0,composed:!0})),this._promptValue=``,this._isPromptValid=!1,requestAnimationFrame(()=>{let e=this.shadowRoot?.querySelector(`textarea`);e&&this._autoResizeTextarea(e)})}_handleDatasetSelected(e){let t=e.detail;this.selectedDatasets.some(e=>e.id===t.id)||(this.selectedDatasets=[...this.selectedDatasets,t])}_handleDatasetRemoved(e){let t=e.detail;this.selectedDatasets=this.selectedDatasets.filter(e=>e.id!==t.id)}willUpdate(e){e.has(`value`)&&(this._promptValue=this.value,this._isPromptValid=this.value.trim().length>0,requestAnimationFrame(()=>{let e=this.shadowRoot?.querySelector(`textarea`);e&&this._autoResizeTextarea(e)}))}firstUpdated(){let e=this.shadowRoot?.querySelector(`textarea`);e&&this._autoResizeTextarea(e)}render(){return n.html`
|
|
20
|
+
const e=require(`./chunk-350yNsax.cjs`),t=require(`./decorate-Dq4-zbi1.cjs`);let n=require(`lit`),r=require(`lit/decorators.js`),i=require(`@lit/localize`),a=require(`@luzmo/icons`),o=require(`lit/directives/class-map.js`);var s=`:host{box-sizing:border-box;background-color:var(--luzmo-ai-interaction-textarea-background-color,var(--ai-interaction-textarea-background-color));border:1px solid var(--luzmo-ai-interaction-textarea-border-color,var(--ai-interaction-textarea-border-color));border-radius:var(--luzmo-ai-interaction-textarea-border-radius,var(--ai-interaction-textarea-border-radius));padding:var(--luzmo-ai-interaction-textarea-padding,var(--ai-interaction-textarea-padding));gap:var(--luzmo-ai-interaction-textarea-gap,var(--ai-interaction-textarea-gap));font-family:var(--luzmo-ai-interaction-textarea-font-family,var(--ai-interaction-textarea-font-family));font-size:var(--luzmo-ai-interaction-textarea-font-size,var(--ai-interaction-textarea-font-size));flex-direction:column;display:flex}:host:has(textarea:focus){border-color:var(--luzmo-ai-interaction-textarea-focus-border-color,var(--ai-interaction-textarea-focus-border-color));box-shadow:var(--luzmo-ai-interaction-textarea-focus-box-shadow,var(--ai-interaction-textarea-focus-box-shadow))}:host .content-wrapper{gap:var(--luzmo-ai-interaction-textarea-gap,var(--ai-interaction-textarea-gap));flex-direction:column;display:flex}:host .content-wrapper.single-line{flex-direction:row;align-items:center}:host .content-wrapper.single-line textarea{flex:1;min-height:auto}:host .content-wrapper.single-line .button-container{align-self:flex-end}:host .content-wrapper.disabled{opacity:.6;pointer-events:none;cursor:not-allowed}:host .content-wrapper.disabled *{pointer-events:none}:host textarea{background-color:var(--luzmo-ai-interaction-textarea-textarea-background,var(--ai-interaction-textarea-textarea-background));resize:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;vertical-align:middle;min-height:var(--luzmo-ai-interaction-textarea-textarea-min-height,var(--ai-interaction-textarea-textarea-min-height,3rem));color:var(--luzmo-ai-interaction-textarea-textarea-color,var(--ai-interaction-textarea-textarea-color));font-family:var(--luzmo-ai-interaction-textarea-font-family,var(--ai-interaction-textarea-font-family));font-size:var(--luzmo-ai-interaction-textarea-font-size,var(--ai-interaction-textarea-font-size));border:none;outline:none;padding:0;line-height:1.5}:host textarea::placeholder{color:var(--luzmo-ai-interaction-textarea-textarea-placeholder-color,var(--ai-interaction-textarea-textarea-placeholder-color))}:host .button-container{text-align:var(--luzmo-ai-interaction-textarea-button-container-text-align,var(--ai-interaction-textarea-button-container-text-align))}:host .button-container button{padding:var(--luzmo-ai-interaction-textarea-button-padding,var(--ai-interaction-textarea-button-padding));min-width:var(--luzmo-ai-interaction-textarea-button-min-width,var(--ai-interaction-textarea-button-min-width));min-height:var(--luzmo-ai-interaction-textarea-button-min-height,var(--ai-interaction-textarea-button-min-height));border-radius:var(--luzmo-ai-interaction-textarea-button-border-radius,var(--ai-interaction-textarea-button-border-radius));font-size:var(--luzmo-ai-interaction-textarea-button-font-size,var(--ai-interaction-textarea-button-font-size));cursor:pointer;border:none;justify-content:center;align-items:center;transition:all .15s;display:inline-flex}:host .button-container button:disabled,:host .button-container button.disabled{opacity:.6;cursor:not-allowed}:host .button-container button svg{justify-content:center;align-items:center;display:flex}:host .button-container button svg.spin{animation:1s linear infinite spin}:host .button-container button.btn-primary{background-color:var(--luzmo-ai-interaction-textarea-button-background-color,var(--ai-interaction-textarea-button-background-color));color:var(--luzmo-ai-interaction-textarea-button-color,var(--ai-interaction-textarea-button-color))}:host .button-container button.btn-primary:hover:not(:disabled):not(.disabled){background-color:var(--luzmo-ai-interaction-textarea-button-background-color-hover,var(--ai-interaction-textarea-button-background-color-hover))}:host .button-container button.btn-primary:disabled,:host .button-container button.btn-primary.disabled{background-color:var(--luzmo-ai-interaction-textarea-button-background-color-disabled,var(--ai-interaction-textarea-button-background-color-disabled));opacity:.6}@keyframes spin{to{transform:rotate(360deg)}}:host{--ai-interaction-textarea-background-color:var(--luzmo-background-color-alt-2);--ai-interaction-textarea-border-color:var(--luzmo-border-color);--ai-interaction-textarea-border-radius:.5rem;--ai-interaction-textarea-padding:.75rem;--ai-interaction-textarea-gap:1rem;--ai-interaction-textarea-focus-border-color:var(--luzmo-primary);--ai-interaction-textarea-focus-box-shadow:0 0 1rem 0 var(--luzmo-primary-50);--ai-interaction-textarea-font-family:var(--luzmo-font-family);--ai-interaction-textarea-font-size:.875rem;--ai-interaction-textarea-textarea-background:transparent;--ai-interaction-textarea-textarea-color:var(--luzmo-font-color);--ai-interaction-textarea-textarea-placeholder-color:var(--luzmo-font-color-extra-dimmed);--ai-interaction-textarea-textarea-min-height:3rem;--ai-interaction-textarea-button-container-text-align:right;--ai-interaction-textarea-button-padding:0;--ai-interaction-textarea-button-min-width:2rem;--ai-interaction-textarea-button-min-height:1.875rem;--ai-interaction-textarea-button-border-radius:.5rem;--ai-interaction-textarea-button-font-size:1rem;--ai-interaction-textarea-button-background-color:var(--luzmo-primary);--ai-interaction-textarea-button-background-color-hover:var(--luzmo-primary-hover);--ai-interaction-textarea-button-background-color-disabled:var(--luzmo-primary);--ai-interaction-textarea-button-color:var(--luzmo-primary-inverse-color)}`,c=class extends n.LitElement{constructor(...e){super(...e),this.placeholder=`Type your prompt here...`,this.selectedDatasets=[],this.authKey=``,this.authToken=``,this.apiUrl=`https://api.luzmo.com`,this.appServer=`https://app.luzmo.com`,this.flagOpendata=!1,this.disabled=!1,this.singleLine=!1,this.hideDatasetButton=!1,this.isGenerating=!1,this.value=``,this.retainOnSubmit=!1,this._promptValue=``,this._isPromptValid=!1}static{this.styles=(0,n.unsafeCSS)(s)}static{this.tagName=`luzmo-ai-interaction-textarea`}get _buttonDisabled(){return this.hideDatasetButton?this.disabled||!this._isPromptValid:this.disabled||this.selectedDatasets.length===0||!this._isPromptValid}_autoResizeTextarea(e){if(e.style.height=`auto`,this.singleLine){let t=1.5,n=Number.parseFloat(getComputedStyle(e).fontSize)||14,r=t*n,i=8*t*n,a=Math.max(r,Math.min(e.scrollHeight,i));e.style.height=`${a}px`}else{let t=Math.max(2*1.5*16,Math.min(e.scrollHeight,8*1.5*16));e.style.height=`${t}px`}}_handlePromptInput(e){let t=e.target;this._promptValue=t.value,this._isPromptValid=t.value.trim().length>0,this._autoResizeTextarea(t),t.scrollTo({top:t.scrollHeight})}_handleKeyDown(e){e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),this._submitPrompt())}_submitPrompt(){if(this._buttonDisabled)return;let e=this._promptValue.trim();this.dispatchEvent(new CustomEvent(`prompt-submitted`,{detail:{prompt:e,selectedDatasets:this.selectedDatasets},bubbles:!0,composed:!0})),this.retainOnSubmit||(this._promptValue=``,this._isPromptValid=!1),requestAnimationFrame(()=>{let e=this.shadowRoot?.querySelector(`textarea`);e&&this._autoResizeTextarea(e)})}_handleDatasetSelected(e){let t=e.detail;this.selectedDatasets.some(e=>e.id===t.id)||(this.selectedDatasets=[...this.selectedDatasets,t])}_handleDatasetRemoved(e){let t=e.detail;this.selectedDatasets=this.selectedDatasets.filter(e=>e.id!==t.id)}willUpdate(e){e.has(`value`)&&(this._promptValue=this.value,this._isPromptValid=this.value.trim().length>0,requestAnimationFrame(()=>{let e=this.shadowRoot?.querySelector(`textarea`);e&&this._autoResizeTextarea(e)}))}firstUpdated(){let e=this.shadowRoot?.querySelector(`textarea`);e&&this._autoResizeTextarea(e)}render(){return n.html`
|
|
21
21
|
<div class=${(0,o.classMap)({"content-wrapper":!0,disabled:this.disabled,"single-line":this.singleLine})}>
|
|
22
22
|
${this.hideDatasetButton?``:n.html`
|
|
23
23
|
<luzmo-dataset-selector-row
|
|
@@ -53,4 +53,4 @@ const e=require(`./chunk-350yNsax.cjs`),t=require(`./decorate-Dq4-zbi1.cjs`);let
|
|
|
53
53
|
</button>
|
|
54
54
|
</div>
|
|
55
55
|
</div>
|
|
56
|
-
`}};t.t([(0,r.property)({type:String})],c.prototype,`placeholder`,void 0),t.t([(0,r.property)({type:Array})],c.prototype,`selectedDatasets`,void 0),t.t([(0,r.property)({type:String,attribute:`auth-key`})],c.prototype,`authKey`,void 0),t.t([(0,r.property)({type:String,attribute:`auth-token`})],c.prototype,`authToken`,void 0),t.t([(0,r.property)({type:String,attribute:`api-url`})],c.prototype,`apiUrl`,void 0),t.t([(0,r.property)({type:String,attribute:`app-server`})],c.prototype,`appServer`,void 0),t.t([(0,r.property)({type:Boolean,attribute:`flag-opendata`})],c.prototype,`flagOpendata`,void 0),t.t([(0,r.property)({type:Boolean,reflect:!0,attribute:`disabled`})],c.prototype,`disabled`,void 0),t.t([(0,r.property)({type:Boolean,attribute:`single-line`})],c.prototype,`singleLine`,void 0),t.t([(0,r.property)({type:Boolean,attribute:`hide-dataset-button`})],c.prototype,`hideDatasetButton`,void 0),t.t([(0,r.property)({type:Boolean,attribute:`is-generating`})],c.prototype,`isGenerating`,void 0),t.t([(0,r.property)({type:String})],c.prototype,`value`,void 0),t.t([(0,r.state)()],c.prototype,`_promptValue`,void 0),t.t([(0,r.state)()],c.prototype,`_isPromptValid`,void 0),c=t.t([(0,i.localized)()],c),customElements.get(`luzmo-ai-interaction-textarea`)||customElements.define(`luzmo-ai-interaction-textarea`,c),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return c}});
|
|
56
|
+
`}};t.t([(0,r.property)({type:String})],c.prototype,`placeholder`,void 0),t.t([(0,r.property)({type:Array})],c.prototype,`selectedDatasets`,void 0),t.t([(0,r.property)({type:String,attribute:`auth-key`})],c.prototype,`authKey`,void 0),t.t([(0,r.property)({type:String,attribute:`auth-token`})],c.prototype,`authToken`,void 0),t.t([(0,r.property)({type:String,attribute:`api-url`})],c.prototype,`apiUrl`,void 0),t.t([(0,r.property)({type:String,attribute:`app-server`})],c.prototype,`appServer`,void 0),t.t([(0,r.property)({type:Boolean,attribute:`flag-opendata`})],c.prototype,`flagOpendata`,void 0),t.t([(0,r.property)({type:Boolean,reflect:!0,attribute:`disabled`})],c.prototype,`disabled`,void 0),t.t([(0,r.property)({type:Boolean,attribute:`single-line`})],c.prototype,`singleLine`,void 0),t.t([(0,r.property)({type:Boolean,attribute:`hide-dataset-button`})],c.prototype,`hideDatasetButton`,void 0),t.t([(0,r.property)({type:Boolean,attribute:`is-generating`})],c.prototype,`isGenerating`,void 0),t.t([(0,r.property)({type:String})],c.prototype,`value`,void 0),t.t([(0,r.property)({type:Boolean,attribute:`retain-on-submit`})],c.prototype,`retainOnSubmit`,void 0),t.t([(0,r.state)()],c.prototype,`_promptValue`,void 0),t.t([(0,r.state)()],c.prototype,`_isPromptValid`,void 0),c=t.t([(0,i.localized)()],c),customElements.get(`luzmo-ai-interaction-textarea`)||customElements.define(`luzmo-ai-interaction-textarea`,c),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return c}});
|
package/components/{ai-interaction-textarea-ZDQPVgXC.js → ai-interaction-textarea-EdWcPK0w.js}
RENAMED
|
@@ -25,7 +25,7 @@ import { luzmoArrowRight, luzmoIcon, luzmoSpin } from "@luzmo/icons";
|
|
|
25
25
|
import { classMap } from "lit/directives/class-map.js";
|
|
26
26
|
var ai_interaction_textarea_module_default = ":host{box-sizing:border-box;background-color:var(--luzmo-ai-interaction-textarea-background-color,var(--ai-interaction-textarea-background-color));border:1px solid var(--luzmo-ai-interaction-textarea-border-color,var(--ai-interaction-textarea-border-color));border-radius:var(--luzmo-ai-interaction-textarea-border-radius,var(--ai-interaction-textarea-border-radius));padding:var(--luzmo-ai-interaction-textarea-padding,var(--ai-interaction-textarea-padding));gap:var(--luzmo-ai-interaction-textarea-gap,var(--ai-interaction-textarea-gap));font-family:var(--luzmo-ai-interaction-textarea-font-family,var(--ai-interaction-textarea-font-family));font-size:var(--luzmo-ai-interaction-textarea-font-size,var(--ai-interaction-textarea-font-size));flex-direction:column;display:flex}:host:has(textarea:focus){border-color:var(--luzmo-ai-interaction-textarea-focus-border-color,var(--ai-interaction-textarea-focus-border-color));box-shadow:var(--luzmo-ai-interaction-textarea-focus-box-shadow,var(--ai-interaction-textarea-focus-box-shadow))}:host .content-wrapper{gap:var(--luzmo-ai-interaction-textarea-gap,var(--ai-interaction-textarea-gap));flex-direction:column;display:flex}:host .content-wrapper.single-line{flex-direction:row;align-items:center}:host .content-wrapper.single-line textarea{flex:1;min-height:auto}:host .content-wrapper.single-line .button-container{align-self:flex-end}:host .content-wrapper.disabled{opacity:.6;pointer-events:none;cursor:not-allowed}:host .content-wrapper.disabled *{pointer-events:none}:host textarea{background-color:var(--luzmo-ai-interaction-textarea-textarea-background,var(--ai-interaction-textarea-textarea-background));resize:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;vertical-align:middle;min-height:var(--luzmo-ai-interaction-textarea-textarea-min-height,var(--ai-interaction-textarea-textarea-min-height,3rem));color:var(--luzmo-ai-interaction-textarea-textarea-color,var(--ai-interaction-textarea-textarea-color));font-family:var(--luzmo-ai-interaction-textarea-font-family,var(--ai-interaction-textarea-font-family));font-size:var(--luzmo-ai-interaction-textarea-font-size,var(--ai-interaction-textarea-font-size));border:none;outline:none;padding:0;line-height:1.5}:host textarea::placeholder{color:var(--luzmo-ai-interaction-textarea-textarea-placeholder-color,var(--ai-interaction-textarea-textarea-placeholder-color))}:host .button-container{text-align:var(--luzmo-ai-interaction-textarea-button-container-text-align,var(--ai-interaction-textarea-button-container-text-align))}:host .button-container button{padding:var(--luzmo-ai-interaction-textarea-button-padding,var(--ai-interaction-textarea-button-padding));min-width:var(--luzmo-ai-interaction-textarea-button-min-width,var(--ai-interaction-textarea-button-min-width));min-height:var(--luzmo-ai-interaction-textarea-button-min-height,var(--ai-interaction-textarea-button-min-height));border-radius:var(--luzmo-ai-interaction-textarea-button-border-radius,var(--ai-interaction-textarea-button-border-radius));font-size:var(--luzmo-ai-interaction-textarea-button-font-size,var(--ai-interaction-textarea-button-font-size));cursor:pointer;border:none;justify-content:center;align-items:center;transition:all .15s;display:inline-flex}:host .button-container button:disabled,:host .button-container button.disabled{opacity:.6;cursor:not-allowed}:host .button-container button svg{justify-content:center;align-items:center;display:flex}:host .button-container button svg.spin{animation:1s linear infinite spin}:host .button-container button.btn-primary{background-color:var(--luzmo-ai-interaction-textarea-button-background-color,var(--ai-interaction-textarea-button-background-color));color:var(--luzmo-ai-interaction-textarea-button-color,var(--ai-interaction-textarea-button-color))}:host .button-container button.btn-primary:hover:not(:disabled):not(.disabled){background-color:var(--luzmo-ai-interaction-textarea-button-background-color-hover,var(--ai-interaction-textarea-button-background-color-hover))}:host .button-container button.btn-primary:disabled,:host .button-container button.btn-primary.disabled{background-color:var(--luzmo-ai-interaction-textarea-button-background-color-disabled,var(--ai-interaction-textarea-button-background-color-disabled));opacity:.6}@keyframes spin{to{transform:rotate(360deg)}}:host{--ai-interaction-textarea-background-color:var(--luzmo-background-color-alt-2);--ai-interaction-textarea-border-color:var(--luzmo-border-color);--ai-interaction-textarea-border-radius:.5rem;--ai-interaction-textarea-padding:.75rem;--ai-interaction-textarea-gap:1rem;--ai-interaction-textarea-focus-border-color:var(--luzmo-primary);--ai-interaction-textarea-focus-box-shadow:0 0 1rem 0 var(--luzmo-primary-50);--ai-interaction-textarea-font-family:var(--luzmo-font-family);--ai-interaction-textarea-font-size:.875rem;--ai-interaction-textarea-textarea-background:transparent;--ai-interaction-textarea-textarea-color:var(--luzmo-font-color);--ai-interaction-textarea-textarea-placeholder-color:var(--luzmo-font-color-extra-dimmed);--ai-interaction-textarea-textarea-min-height:3rem;--ai-interaction-textarea-button-container-text-align:right;--ai-interaction-textarea-button-padding:0;--ai-interaction-textarea-button-min-width:2rem;--ai-interaction-textarea-button-min-height:1.875rem;--ai-interaction-textarea-button-border-radius:.5rem;--ai-interaction-textarea-button-font-size:1rem;--ai-interaction-textarea-button-background-color:var(--luzmo-primary);--ai-interaction-textarea-button-background-color-hover:var(--luzmo-primary-hover);--ai-interaction-textarea-button-background-color-disabled:var(--luzmo-primary);--ai-interaction-textarea-button-color:var(--luzmo-primary-inverse-color)}", LuzmoAiInteractionTextarea = class extends LitElement {
|
|
27
27
|
constructor(...e) {
|
|
28
|
-
super(...e), this.placeholder = "Type your prompt here...", this.selectedDatasets = [], this.authKey = "", this.authToken = "", this.apiUrl = "https://api.luzmo.com", this.appServer = "https://app.luzmo.com", this.flagOpendata = !1, this.disabled = !1, this.singleLine = !1, this.hideDatasetButton = !1, this.isGenerating = !1, this.value = "", this._promptValue = "", this._isPromptValid = !1;
|
|
28
|
+
super(...e), this.placeholder = "Type your prompt here...", this.selectedDatasets = [], this.authKey = "", this.authToken = "", this.apiUrl = "https://api.luzmo.com", this.appServer = "https://app.luzmo.com", this.flagOpendata = !1, this.disabled = !1, this.singleLine = !1, this.hideDatasetButton = !1, this.isGenerating = !1, this.value = "", this.retainOnSubmit = !1, this._promptValue = "", this._isPromptValid = !1;
|
|
29
29
|
}
|
|
30
30
|
static {
|
|
31
31
|
this.styles = unsafeCSS(ai_interaction_textarea_module_default);
|
|
@@ -62,7 +62,7 @@ var ai_interaction_textarea_module_default = ":host{box-sizing:border-box;backgr
|
|
|
62
62
|
},
|
|
63
63
|
bubbles: !0,
|
|
64
64
|
composed: !0
|
|
65
|
-
})), this._promptValue = "", this._isPromptValid = !1, requestAnimationFrame(() => {
|
|
65
|
+
})), this.retainOnSubmit || (this._promptValue = "", this._isPromptValid = !1), requestAnimationFrame(() => {
|
|
66
66
|
let e = this.shadowRoot?.querySelector("textarea");
|
|
67
67
|
e && this._autoResizeTextarea(e);
|
|
68
68
|
});
|
|
@@ -157,5 +157,8 @@ __decorate([property({ type: String })], LuzmoAiInteractionTextarea.prototype, "
|
|
|
157
157
|
})], LuzmoAiInteractionTextarea.prototype, "hideDatasetButton", void 0), __decorate([property({
|
|
158
158
|
type: Boolean,
|
|
159
159
|
attribute: "is-generating"
|
|
160
|
-
})], LuzmoAiInteractionTextarea.prototype, "isGenerating", void 0), __decorate([property({ type: String })], LuzmoAiInteractionTextarea.prototype, "value", void 0), __decorate([
|
|
160
|
+
})], LuzmoAiInteractionTextarea.prototype, "isGenerating", void 0), __decorate([property({ type: String })], LuzmoAiInteractionTextarea.prototype, "value", void 0), __decorate([property({
|
|
161
|
+
type: Boolean,
|
|
162
|
+
attribute: "retain-on-submit"
|
|
163
|
+
})], LuzmoAiInteractionTextarea.prototype, "retainOnSubmit", void 0), __decorate([state()], LuzmoAiInteractionTextarea.prototype, "_promptValue", void 0), __decorate([state()], LuzmoAiInteractionTextarea.prototype, "_isPromptValid", void 0), LuzmoAiInteractionTextarea = __decorate([localized()], LuzmoAiInteractionTextarea), customElements.get("luzmo-ai-interaction-textarea") || customElements.define("luzmo-ai-interaction-textarea", LuzmoAiInteractionTextarea);
|
|
161
164
|
export { LuzmoAiInteractionTextarea as t };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import '@luzmo/embed';
|
|
2
|
+
import type { ThemeConfig } from '@luzmo/dashboard-contents-types';
|
|
2
3
|
import type { LuzmoEmbedVizItem } from '@luzmo/embed';
|
|
3
4
|
import { Placement } from '@luzmo/lucero';
|
|
4
5
|
import '@luzmo/lucero/action-button';
|
|
@@ -8,6 +9,7 @@ import { LuzmoElement } from '@luzmo/lucero/utils';
|
|
|
8
9
|
import { GridStack } from 'gridstack';
|
|
9
10
|
import { CSSResultArray, PropertyValues, TemplateResult } from 'lit';
|
|
10
11
|
import './grid-item-actions-menu';
|
|
12
|
+
import { type GridItemLookup } from './helpers/grid-item-management';
|
|
11
13
|
import type { GridItemData, GridItemRenderer, InputActionGroup } from './types';
|
|
12
14
|
/**
|
|
13
15
|
* @customElement luzmo-grid
|
|
@@ -80,7 +82,7 @@ export declare class LuzmoGrid extends LuzmoElement {
|
|
|
80
82
|
/**
|
|
81
83
|
* Grid options configuration
|
|
82
84
|
*/
|
|
83
|
-
theme?:
|
|
85
|
+
theme?: ThemeConfig;
|
|
84
86
|
/**
|
|
85
87
|
* Items to add to the grid
|
|
86
88
|
*/
|
|
@@ -104,7 +106,6 @@ export declare class LuzmoGrid extends LuzmoElement {
|
|
|
104
106
|
disconnectedCallback(): void;
|
|
105
107
|
protected willUpdate(changedProperties: PropertyValues): void;
|
|
106
108
|
protected updated(changedProperties: PropertyValues): void;
|
|
107
|
-
private _updateLuzmoVizItemsLanguage;
|
|
108
109
|
private _handleMouseover;
|
|
109
110
|
private _handleMouseout;
|
|
110
111
|
private _handleKeyDown;
|
|
@@ -136,12 +137,7 @@ export declare class LuzmoGrid extends LuzmoElement {
|
|
|
136
137
|
private _renderOverlayContent;
|
|
137
138
|
private _createItemActionsMenuPopover;
|
|
138
139
|
private _removeItemActionsMenuPopover;
|
|
139
|
-
|
|
140
|
-
getGridItemById(id: string): {
|
|
141
|
-
item: GridItemData;
|
|
142
|
-
element: HTMLElement;
|
|
143
|
-
luzmoElement?: LuzmoEmbedVizItem;
|
|
144
|
-
} | undefined;
|
|
140
|
+
getGridItemById(id: string): GridItemLookup | undefined;
|
|
145
141
|
addGridItem(newItem: GridItemData): HTMLElement;
|
|
146
142
|
removeGridItem(gridItem: GridItemData): void;
|
|
147
143
|
removeGridItemById(id: string): void;
|
|
@@ -163,7 +159,6 @@ export declare class LuzmoGrid extends LuzmoElement {
|
|
|
163
159
|
* @returns The number of items that were deactivated
|
|
164
160
|
*/
|
|
165
161
|
deactivateItems(): number;
|
|
166
|
-
private _renderItem;
|
|
167
162
|
private _renderGrid;
|
|
168
163
|
protected render(): TemplateResult;
|
|
169
164
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const updateLuzmoVizItemsLanguage: (gridItemElements: NodeListOf<HTMLElement>, contentLanguage: string) => void;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { GridStack } from 'gridstack';
|
|
2
|
+
import type { GridItemData } from '../types';
|
|
3
|
+
export type GridItemActionType = 'toggle' | 'button';
|
|
4
|
+
type GridLifecycleEventName = 'luzmo-grid-ready' | 'luzmo-grid-changed';
|
|
5
|
+
export type DispatchItemActionEvent = (action: string, actionType: GridItemActionType, active: boolean, element: HTMLElement, itemId: string, item?: GridItemData, deletedId?: string, originalElement?: HTMLElement) => void;
|
|
6
|
+
export interface GridItemActionEventDetail {
|
|
7
|
+
action: string;
|
|
8
|
+
actionType: GridItemActionType;
|
|
9
|
+
active: boolean;
|
|
10
|
+
items: GridItemData[];
|
|
11
|
+
element: HTMLElement;
|
|
12
|
+
id: string;
|
|
13
|
+
type?: GridItemData['type'];
|
|
14
|
+
slots?: GridItemData['slots'];
|
|
15
|
+
options?: GridItemData['options'];
|
|
16
|
+
filters: NonNullable<GridItemData['filters']>;
|
|
17
|
+
deletedId?: string;
|
|
18
|
+
originalElement?: HTMLElement;
|
|
19
|
+
}
|
|
20
|
+
export interface CreateGridItemActionDetailArgs {
|
|
21
|
+
action: string;
|
|
22
|
+
actionType: GridItemActionType;
|
|
23
|
+
active: boolean;
|
|
24
|
+
items: GridItemData[];
|
|
25
|
+
element: HTMLElement;
|
|
26
|
+
itemId: string;
|
|
27
|
+
item?: GridItemData;
|
|
28
|
+
deletedId?: string;
|
|
29
|
+
originalElement?: HTMLElement;
|
|
30
|
+
}
|
|
31
|
+
interface EventDispatcher {
|
|
32
|
+
dispatchEvent: (event: Event) => boolean;
|
|
33
|
+
}
|
|
34
|
+
interface DispatchGridItemActionEventArgs extends CreateGridItemActionDetailArgs {
|
|
35
|
+
target: EventDispatcher;
|
|
36
|
+
}
|
|
37
|
+
interface GridLifecycleEventDetail {
|
|
38
|
+
element: HTMLElement;
|
|
39
|
+
grid?: GridStack;
|
|
40
|
+
items: GridItemData[];
|
|
41
|
+
}
|
|
42
|
+
interface DispatchGridLifecycleEventArgs {
|
|
43
|
+
target: EventDispatcher;
|
|
44
|
+
eventName: GridLifecycleEventName;
|
|
45
|
+
detail: GridLifecycleEventDetail;
|
|
46
|
+
}
|
|
47
|
+
export declare const createGridItemActionDetail: ({ action, actionType, active, items, element, itemId, item, deletedId, originalElement }: CreateGridItemActionDetailArgs) => GridItemActionEventDetail;
|
|
48
|
+
export declare const dispatchGridItemActionEvent: ({ target, action, actionType, active, items, element, itemId, item, deletedId, originalElement }: DispatchGridItemActionEventArgs) => void;
|
|
49
|
+
export declare const dispatchGridLifecycleEvent: ({ target, eventName, detail }: DispatchGridLifecycleEventArgs) => void;
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { GridItemData } from '../types';
|
|
2
|
+
import type { DispatchItemActionEvent } from './grid-events';
|
|
3
|
+
import type { GridItemLookup } from './grid-item-management';
|
|
4
|
+
export interface GridInteractionState {
|
|
5
|
+
activeItemElement?: HTMLElement;
|
|
6
|
+
activeItemActionToggle?: string;
|
|
7
|
+
}
|
|
8
|
+
interface ShouldRemovePopoverOnMouseoutArgs {
|
|
9
|
+
event: Event;
|
|
10
|
+
gridItem: HTMLElement;
|
|
11
|
+
}
|
|
12
|
+
interface ApplyGridItemFocusArgs {
|
|
13
|
+
event: FocusEvent;
|
|
14
|
+
focusedItemElement?: HTMLElement;
|
|
15
|
+
removeItemActionsMenuPopover: (item: HTMLElement) => void;
|
|
16
|
+
}
|
|
17
|
+
interface ClearGridItemFocusArgs {
|
|
18
|
+
event: FocusEvent;
|
|
19
|
+
focusedItemElement?: HTMLElement;
|
|
20
|
+
removeItemActionsMenuPopover: (item: HTMLElement) => void;
|
|
21
|
+
}
|
|
22
|
+
interface ClearGridItemFocusResult {
|
|
23
|
+
focusedItemElement?: HTMLElement;
|
|
24
|
+
shouldFocusGrid: boolean;
|
|
25
|
+
}
|
|
26
|
+
interface CleanupActiveGridItemArgs {
|
|
27
|
+
item: HTMLElement;
|
|
28
|
+
activeItemElement?: HTMLElement;
|
|
29
|
+
gridElement: HTMLElement;
|
|
30
|
+
removeItemActionsMenuPopover: (item: HTMLElement) => void;
|
|
31
|
+
}
|
|
32
|
+
interface HandleGridActionArgs {
|
|
33
|
+
event: CustomEvent;
|
|
34
|
+
gridElement: HTMLElement;
|
|
35
|
+
items: GridItemData[];
|
|
36
|
+
state: GridInteractionState;
|
|
37
|
+
cleanupActiveItem: (item: HTMLElement) => void;
|
|
38
|
+
dispatchItemActionEvent: DispatchItemActionEvent;
|
|
39
|
+
handleDeleteItem: (event: Event) => void;
|
|
40
|
+
handleCloneItem: (event: CustomEvent) => void;
|
|
41
|
+
createItemActionsMenuPopover: (element: HTMLElement, activeAction?: string) => void;
|
|
42
|
+
}
|
|
43
|
+
interface HandleGridClickArgs {
|
|
44
|
+
event: MouseEvent;
|
|
45
|
+
gridElement: HTMLElement;
|
|
46
|
+
hostElement: HTMLElement;
|
|
47
|
+
items: GridItemData[];
|
|
48
|
+
activeItemActionToggle?: string;
|
|
49
|
+
cleanupActiveItem: (item: HTMLElement) => void;
|
|
50
|
+
dispatchItemActionEvent: DispatchItemActionEvent;
|
|
51
|
+
}
|
|
52
|
+
interface TriggerGridItemActionArgs {
|
|
53
|
+
gridElement: HTMLElement;
|
|
54
|
+
items: GridItemData[];
|
|
55
|
+
gridItemData?: GridItemLookup;
|
|
56
|
+
itemId: string;
|
|
57
|
+
action: string;
|
|
58
|
+
options?: {
|
|
59
|
+
active?: boolean;
|
|
60
|
+
};
|
|
61
|
+
state: GridInteractionState;
|
|
62
|
+
cleanupActiveItem: (item: HTMLElement) => void;
|
|
63
|
+
dispatchItemActionEvent: DispatchItemActionEvent;
|
|
64
|
+
createItemActionsMenuPopover: (element: HTMLElement, activeAction?: string) => void;
|
|
65
|
+
}
|
|
66
|
+
export interface TriggerGridItemActionResult {
|
|
67
|
+
result: boolean | undefined;
|
|
68
|
+
state: GridInteractionState;
|
|
69
|
+
}
|
|
70
|
+
interface DeactivateGridItemsArgs {
|
|
71
|
+
gridElement: HTMLElement;
|
|
72
|
+
items: GridItemData[];
|
|
73
|
+
state: GridInteractionState;
|
|
74
|
+
cleanupActiveItem: (item: HTMLElement) => void;
|
|
75
|
+
dispatchItemActionEvent: DispatchItemActionEvent;
|
|
76
|
+
}
|
|
77
|
+
export interface DeactivateGridItemsResult {
|
|
78
|
+
deactivatedCount: number;
|
|
79
|
+
state: GridInteractionState;
|
|
80
|
+
}
|
|
81
|
+
export declare const getGridItemElementFromTarget: (target: EventTarget | null) => HTMLElement | undefined;
|
|
82
|
+
export declare const shouldRemovePopoverOnMouseout: ({ event, gridItem }: ShouldRemovePopoverOnMouseoutArgs) => boolean;
|
|
83
|
+
export declare const applyGridItemFocus: ({ event, focusedItemElement, removeItemActionsMenuPopover }: ApplyGridItemFocusArgs) => HTMLElement | undefined;
|
|
84
|
+
export declare const clearGridItemFocus: ({ event, focusedItemElement, removeItemActionsMenuPopover }: ClearGridItemFocusArgs) => ClearGridItemFocusResult;
|
|
85
|
+
export declare const resolveGridItemForDelete: (event: Event, fallback?: HTMLElement) => HTMLElement | undefined;
|
|
86
|
+
export declare const cleanupActiveGridItem: ({ item, activeItemElement, gridElement, removeItemActionsMenuPopover }: CleanupActiveGridItemArgs) => HTMLElement | undefined;
|
|
87
|
+
export declare const handleGridAction: ({ event, gridElement, items, state, cleanupActiveItem, dispatchItemActionEvent, handleDeleteItem, handleCloneItem, createItemActionsMenuPopover }: HandleGridActionArgs) => GridInteractionState;
|
|
88
|
+
export declare const handleGridClick: ({ event, gridElement, hostElement, items, activeItemActionToggle, cleanupActiveItem, dispatchItemActionEvent }: HandleGridClickArgs) => GridInteractionState;
|
|
89
|
+
export declare const triggerGridItemAction: ({ gridElement, items, gridItemData, itemId, action, options, state, cleanupActiveItem, dispatchItemActionEvent, createItemActionsMenuPopover }: TriggerGridItemActionArgs) => TriggerGridItemActionResult;
|
|
90
|
+
export declare const deactivateGridItems: ({ gridElement, items, state, cleanupActiveItem, dispatchItemActionEvent }: DeactivateGridItemsArgs) => DeactivateGridItemsResult;
|
|
91
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { LuzmoEmbedVizItem } from '@luzmo/embed';
|
|
2
|
+
import type { GridStack } from 'gridstack';
|
|
3
|
+
import type { GridItemData } from '../types';
|
|
4
|
+
import type { DispatchItemActionEvent } from './grid-events';
|
|
5
|
+
export interface GridItemLookup {
|
|
6
|
+
item: GridItemData;
|
|
7
|
+
element: HTMLElement;
|
|
8
|
+
luzmoElement?: LuzmoEmbedVizItem;
|
|
9
|
+
}
|
|
10
|
+
interface AddGridItemArgs {
|
|
11
|
+
newItem: GridItemData;
|
|
12
|
+
gridElement: HTMLElement;
|
|
13
|
+
grid?: GridStack;
|
|
14
|
+
createId: () => string;
|
|
15
|
+
}
|
|
16
|
+
export interface AddGridItemResult {
|
|
17
|
+
item: GridItemData;
|
|
18
|
+
element: HTMLElement;
|
|
19
|
+
}
|
|
20
|
+
interface RemoveGridItemByIdArgs {
|
|
21
|
+
id: string;
|
|
22
|
+
grid?: GridStack;
|
|
23
|
+
items: GridItemData[];
|
|
24
|
+
getGridItemById: (id: string) => GridItemLookup | undefined;
|
|
25
|
+
removeItemActionsMenuPopover: (gridItem: HTMLElement) => void;
|
|
26
|
+
activeItemElement?: HTMLElement;
|
|
27
|
+
cleanupActiveItem: (item: HTMLElement) => void;
|
|
28
|
+
}
|
|
29
|
+
interface RemoveGridItemByIdResult {
|
|
30
|
+
activeItemElement?: HTMLElement;
|
|
31
|
+
focusedItemElement?: HTMLElement;
|
|
32
|
+
}
|
|
33
|
+
interface HandleCloneItemArgs {
|
|
34
|
+
event: CustomEvent;
|
|
35
|
+
hasGrid: boolean;
|
|
36
|
+
items: GridItemData[];
|
|
37
|
+
createId: () => string;
|
|
38
|
+
addGridItem: (newItem: GridItemData) => HTMLElement;
|
|
39
|
+
dispatchItemActionEvent: DispatchItemActionEvent;
|
|
40
|
+
}
|
|
41
|
+
export declare const mapGridItems: (items: GridItemData[], gridElement: HTMLElement) => GridItemLookup[];
|
|
42
|
+
export declare const addGridItem: ({ newItem, gridElement, grid, createId }: AddGridItemArgs) => AddGridItemResult;
|
|
43
|
+
export declare const removeGridItemById: ({ id, grid, items, getGridItemById, removeItemActionsMenuPopover, activeItemElement, cleanupActiveItem }: RemoveGridItemByIdArgs) => RemoveGridItemByIdResult;
|
|
44
|
+
export declare const handleCloneItem: ({ event, hasGrid, items, createId, addGridItem: addGridItemToComponent, dispatchItemActionEvent }: HandleCloneItemArgs) => void;
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Placement } from '@luzmo/lucero';
|
|
2
|
+
import { type TemplateResult } from 'lit';
|
|
3
|
+
import type { GridItemData } from '../types';
|
|
4
|
+
import type { GridItemLookup } from './grid-item-management';
|
|
5
|
+
interface CreateItemActionsMenuPopoverArgs {
|
|
6
|
+
element: HTMLElement;
|
|
7
|
+
activeAction?: string;
|
|
8
|
+
getGridItemById: (id: string) => GridItemLookup | undefined;
|
|
9
|
+
placementItemActionsMenu: Placement;
|
|
10
|
+
renderOverlayContent: (item?: GridItemData, activeAction?: string) => TemplateResult;
|
|
11
|
+
removeItemActionsMenuPopover: (gridItem: HTMLElement) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const createItemActionsMenuPopover: ({ element, activeAction, getGridItemById, placementItemActionsMenu, renderOverlayContent, removeItemActionsMenuPopover }: CreateItemActionsMenuPopoverArgs) => void;
|
|
14
|
+
export declare const removeItemActionsMenuPopover: (gridItem: HTMLElement) => void;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { GridStackWidget } from 'gridstack';
|
|
2
|
+
import type { GridItemData } from '../types';
|
|
3
|
+
export declare const normalizeGridItems: (items: GridItemData[], createId: () => string) => void;
|
|
4
|
+
export declare const ensureGridItemId: (item: GridItemData, createId: () => string) => string;
|
|
5
|
+
export declare const buildGridWidgetOptions: (item: GridItemData | undefined, id?: string) => GridStackWidget;
|
|
6
|
+
export declare const createGridItemFromInput: (newItem: GridItemData, id: string) => GridItemData;
|
|
7
|
+
export declare const createOrphanGridItemElement: (itemId: string) => HTMLDivElement;
|
|
8
|
+
export declare const readGridItemPosition: (gridItemElement: HTMLElement) => GridItemData["position"];
|
|
9
|
+
export declare const findGridItemElementById: (elements: Iterable<HTMLElement>, id: string | undefined) => HTMLElement | undefined;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type GridArrowKey = 'ArrowLeft' | 'ArrowRight' | 'ArrowUp' | 'ArrowDown';
|
|
2
|
+
export interface GridKeyboardNode {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
w: number;
|
|
6
|
+
h: number;
|
|
7
|
+
}
|
|
8
|
+
export type GridKeyboardUpdate = Partial<Pick<GridKeyboardNode, 'x' | 'y' | 'w' | 'h'>>;
|
|
9
|
+
export interface GridKeyboardUpdateArgs {
|
|
10
|
+
key: GridArrowKey;
|
|
11
|
+
node: GridKeyboardNode;
|
|
12
|
+
maxColumns: number;
|
|
13
|
+
shiftKey: boolean;
|
|
14
|
+
ctrlKey: boolean;
|
|
15
|
+
metaKey: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare const isGridArrowKey: (key: string) => key is GridArrowKey;
|
|
18
|
+
export declare const getGridKeyboardUpdate: ({ key, node, maxColumns, shiftKey, ctrlKey, metaKey }: GridKeyboardUpdateArgs) => GridKeyboardUpdate | undefined;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { GridStack } from 'gridstack';
|
|
2
|
+
export interface HandleGridKeyDownArgs {
|
|
3
|
+
event: KeyboardEvent;
|
|
4
|
+
viewMode: boolean;
|
|
5
|
+
focusedItemElement?: HTMLElement;
|
|
6
|
+
activeItemElement?: HTMLElement;
|
|
7
|
+
gridElement: HTMLElement;
|
|
8
|
+
grid?: GridStack;
|
|
9
|
+
columns: number;
|
|
10
|
+
handleDeleteItem: (event: Event) => void;
|
|
11
|
+
removeItemActionsMenuPopover: (gridItem: HTMLElement) => void;
|
|
12
|
+
createItemActionsMenuPopover: (element: HTMLElement) => void;
|
|
13
|
+
}
|
|
14
|
+
export interface HandleGridKeyDownResult {
|
|
15
|
+
focusedItemElement?: HTMLElement;
|
|
16
|
+
activeItemElement?: HTMLElement;
|
|
17
|
+
}
|
|
18
|
+
export declare const handleGridKeyDown: ({ event, viewMode, focusedItemElement, activeItemElement, gridElement, grid, columns, handleDeleteItem, removeItemActionsMenuPopover, createItemActionsMenuPopover }: HandleGridKeyDownArgs) => HandleGridKeyDownResult;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { ThemeConfig } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
import type { Placement } from '@luzmo/lucero';
|
|
3
|
+
import { type TemplateResult } from 'lit';
|
|
4
|
+
import { repeat } from 'lit/directives/repeat.js';
|
|
5
|
+
import type { GridItemData, InputActionGroup } from '../types';
|
|
6
|
+
interface RenderOverlayContentArgs {
|
|
7
|
+
item?: GridItemData;
|
|
8
|
+
activeAction?: string;
|
|
9
|
+
defaultItemActionsMenu?: InputActionGroup[];
|
|
10
|
+
placementItemActionsMenu: Placement;
|
|
11
|
+
language: string;
|
|
12
|
+
handleAction: (event: CustomEvent) => void;
|
|
13
|
+
}
|
|
14
|
+
interface RenderGridItemArgs {
|
|
15
|
+
item: GridItemData;
|
|
16
|
+
index: number;
|
|
17
|
+
initialized: boolean;
|
|
18
|
+
viewMode: boolean;
|
|
19
|
+
contentLanguage: string;
|
|
20
|
+
fullTheme?: ThemeConfig;
|
|
21
|
+
appServer?: string;
|
|
22
|
+
apiHost?: string;
|
|
23
|
+
authKey?: string;
|
|
24
|
+
authToken?: string;
|
|
25
|
+
handleMouseover: (event: Event) => void;
|
|
26
|
+
handleMouseout: (event: Event) => void;
|
|
27
|
+
handleFocus: (event: FocusEvent) => void;
|
|
28
|
+
handleBlur: (event: FocusEvent) => void;
|
|
29
|
+
}
|
|
30
|
+
interface RenderGridItemsArgs {
|
|
31
|
+
items: GridItemData[];
|
|
32
|
+
initialized: boolean;
|
|
33
|
+
viewMode: boolean;
|
|
34
|
+
contentLanguage: string;
|
|
35
|
+
fullTheme?: ThemeConfig;
|
|
36
|
+
appServer?: string;
|
|
37
|
+
apiHost?: string;
|
|
38
|
+
authKey?: string;
|
|
39
|
+
authToken?: string;
|
|
40
|
+
renderItem: (item: GridItemData, index: number) => TemplateResult;
|
|
41
|
+
}
|
|
42
|
+
interface RenderGridArgs {
|
|
43
|
+
items: GridItemData[];
|
|
44
|
+
initialized: boolean;
|
|
45
|
+
viewMode: boolean;
|
|
46
|
+
contentLanguage: string;
|
|
47
|
+
fullTheme?: ThemeConfig;
|
|
48
|
+
appServer?: string;
|
|
49
|
+
apiHost?: string;
|
|
50
|
+
authKey?: string;
|
|
51
|
+
authToken?: string;
|
|
52
|
+
columns: number;
|
|
53
|
+
ensureGridItemId: (item: GridItemData) => void;
|
|
54
|
+
handleMouseover: (event: Event) => void;
|
|
55
|
+
handleMouseout: (event: Event) => void;
|
|
56
|
+
handleFocus: (event: FocusEvent) => void;
|
|
57
|
+
handleBlur: (event: FocusEvent) => void;
|
|
58
|
+
}
|
|
59
|
+
export declare const renderOverlayContent: ({ item, activeAction, defaultItemActionsMenu, placementItemActionsMenu, language, handleAction }: RenderOverlayContentArgs) => TemplateResult;
|
|
60
|
+
export declare const renderGridItem: ({ item, index, initialized, viewMode, contentLanguage, fullTheme, appServer, apiHost, authKey, authToken, handleMouseover, handleMouseout, handleFocus, handleBlur }: RenderGridItemArgs) => TemplateResult;
|
|
61
|
+
export declare const renderGridItems: ({ items, initialized, viewMode, contentLanguage, fullTheme, appServer, apiHost, authKey, authToken, renderItem }: RenderGridItemsArgs) => ReturnType<typeof repeat>;
|
|
62
|
+
export declare const renderGrid: ({ items, initialized, viewMode, contentLanguage, fullTheme, appServer, apiHost, authKey, authToken, columns, ensureGridItemId, handleMouseover, handleMouseout, handleFocus, handleBlur }: RenderGridArgs) => TemplateResult;
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ThemeConfig } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
import { GridStack, type GridStackNode } from 'gridstack';
|
|
3
|
+
import type { GridItemData } from '../types';
|
|
4
|
+
interface InitializeGridStackArgs {
|
|
5
|
+
gridElement: HTMLElement;
|
|
6
|
+
gridItemElements: NodeListOf<HTMLElement>;
|
|
7
|
+
items: GridItemData[];
|
|
8
|
+
columns: number;
|
|
9
|
+
rowHeight: number;
|
|
10
|
+
viewMode: boolean;
|
|
11
|
+
fullTheme?: ThemeConfig;
|
|
12
|
+
onCreateOrUpdateDimensionsHint: (element: HTMLElement, numberOfColumns: string, numberOfRows: string) => void;
|
|
13
|
+
onRemoveDimensionsHint: (element: HTMLElement) => void;
|
|
14
|
+
onChange: (changedItems: GridStackNode[]) => void;
|
|
15
|
+
}
|
|
16
|
+
interface CreateOrUpdateDimensionsHintArgs {
|
|
17
|
+
element: HTMLElement;
|
|
18
|
+
numberOfColumns: string;
|
|
19
|
+
numberOfRows: string;
|
|
20
|
+
offsetHint: number;
|
|
21
|
+
}
|
|
22
|
+
export declare const initializeGridStack: ({ gridElement, gridItemElements, items, columns, rowHeight, viewMode, fullTheme, onCreateOrUpdateDimensionsHint, onRemoveDimensionsHint, onChange }: InitializeGridStackArgs) => GridStack;
|
|
23
|
+
export declare const applyGridStackChanges: (items: GridItemData[], changedItems: GridStackNode[]) => void;
|
|
24
|
+
export declare const createOrUpdateDimensionsHint: ({ element, numberOfColumns, numberOfRows, offsetHint }: CreateOrUpdateDimensionsHintArgs) => void;
|
|
25
|
+
export declare const removeDimensionsHint: (element: HTMLElement) => void;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ThemeConfig } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
export interface GridThemeResolutionArgs {
|
|
3
|
+
theme?: ThemeConfig;
|
|
4
|
+
currentTheme?: ThemeConfig;
|
|
5
|
+
}
|
|
6
|
+
export declare const resolveGridTheme: ({ theme, currentTheme }: GridThemeResolutionArgs) => Promise<ThemeConfig | undefined>;
|
|
7
|
+
export declare const getGridHalfMargins: (theme?: {
|
|
8
|
+
margins?: number[];
|
|
9
|
+
}) => [number, number];
|
|
10
|
+
export declare const getDimensionsHintOffset: (theme?: {
|
|
11
|
+
margins?: number[];
|
|
12
|
+
}) => number;
|
|
13
|
+
export declare const getGridBoxShadow: (theme?: ThemeConfig) => string;
|
|
14
|
+
export declare const getGridCssVariables: (theme?: ThemeConfig) => ReadonlyMap<string, string | undefined>;
|
|
15
|
+
export declare const isGridDarkBackground: (theme?: ThemeConfig) => boolean;
|
|
16
|
+
export declare const applyThemeProperties: (style: CSSStyleDeclaration, fullTheme?: ThemeConfig) => void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { GridStack } from 'gridstack';
|
|
2
|
+
import type { GridItemData } from '../types';
|
|
3
|
+
interface SyncGridItemsArgs {
|
|
4
|
+
initialized: boolean;
|
|
5
|
+
grid?: GridStack;
|
|
6
|
+
hasItemsChanged: boolean;
|
|
7
|
+
hasItemAdded: boolean;
|
|
8
|
+
gridItemElements: NodeListOf<HTMLElement>;
|
|
9
|
+
items: GridItemData[];
|
|
10
|
+
gridElement: HTMLElement;
|
|
11
|
+
}
|
|
12
|
+
interface ApplyViewModeChangeArgs {
|
|
13
|
+
initialized: boolean;
|
|
14
|
+
grid?: GridStack;
|
|
15
|
+
hasViewModeChanged: boolean;
|
|
16
|
+
viewMode: boolean;
|
|
17
|
+
previousViewMode: unknown;
|
|
18
|
+
activeItemElement?: HTMLElement;
|
|
19
|
+
gridElement: HTMLElement;
|
|
20
|
+
cleanupActiveItem: (item: HTMLElement) => void;
|
|
21
|
+
}
|
|
22
|
+
export declare const syncGridItems: ({ initialized, grid, hasItemsChanged, hasItemAdded, gridItemElements, items, gridElement }: SyncGridItemsArgs) => boolean;
|
|
23
|
+
export declare const applyViewModeChange: ({ initialized, grid, hasViewModeChanged, viewMode, previousViewMode, activeItemElement, gridElement, cleanupActiveItem }: ApplyViewModeChangeArgs) => HTMLElement | undefined;
|
|
24
|
+
export {};
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
18
|
* SOFTWARE.
|
|
19
19
|
* */
|
|
20
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../set-locale-CKjJZRH6.cjs`),require(`../localized-mixin-DTvVLuXW.cjs`);const e=require(`../grid-
|
|
20
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../set-locale-CKjJZRH6.cjs`),require(`../localized-mixin-DTvVLuXW.cjs`);const e=require(`../grid-BNbbl-9p.cjs`);exports.LuzmoGrid=e.t,Object.defineProperty(exports,`LuzmoGridItemActionsMenu`,{enumerable:!0,get:function(){return e.n}});
|
package/components/grid/index.js
CHANGED
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
})();
|
|
26
26
|
import "../set-locale-Uv6F4uSq.js";
|
|
27
27
|
import "../localized-mixin-cLT0UbaF.js";
|
|
28
|
-
import { n as LuzmoGridItemActionsMenu, t as LuzmoGrid } from "../grid-
|
|
28
|
+
import { n as LuzmoGridItemActionsMenu, t as LuzmoGrid } from "../grid-Ca-fxUK1.js";
|
|
29
29
|
export { LuzmoGrid, LuzmoGridItemActionsMenu };
|