@3t-transform/threeteeui 0.2.76 → 0.2.78
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/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/tttx-multiselect-box.cjs.entry.js +5 -2
- package/dist/cjs/tttx-textarea.cjs.entry.js +59 -0
- package/dist/cjs/tttx.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/molecules/tttx-multiselect-box/tttx-multiselect-box.js +5 -2
- package/dist/collection/components/molecules/tttx-textarea/tttx-textarea.css +62 -0
- package/dist/collection/components/molecules/tttx-textarea/tttx-textarea.js +420 -0
- package/dist/collection/components/molecules/tttx-textarea/tttx-textarea.stories.js +107 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/tttx-multiselect-box.js +5 -2
- package/dist/components/tttx-textarea.d.ts +11 -0
- package/dist/components/tttx-textarea.js +90 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/tttx-multiselect-box.entry.js +5 -2
- package/dist/esm/tttx-textarea.entry.js +55 -0
- package/dist/esm/tttx.js +1 -1
- package/dist/tttx/p-5f1f699d.entry.js +1 -0
- package/dist/tttx/p-9c3f730f.entry.js +1 -0
- package/dist/tttx/tttx.esm.js +1 -1
- package/dist/types/components/molecules/tttx-multiselect-box/tttx-multiselect-box.d.ts +1 -0
- package/dist/types/components/molecules/tttx-textarea/tttx-textarea.d.ts +42 -0
- package/dist/types/components/molecules/tttx-textarea/tttx-textarea.stories.d.ts +89 -0
- package/dist/types/components.d.ts +77 -0
- package/package.json +3 -3
- package/dist/tttx/p-77fed2a6.entry.js +0 -1
|
@@ -144,6 +144,36 @@ export namespace Components {
|
|
|
144
144
|
"color": string;
|
|
145
145
|
"text": string;
|
|
146
146
|
}
|
|
147
|
+
interface TttxTextarea {
|
|
148
|
+
"disabled": boolean;
|
|
149
|
+
"errormsg": string;
|
|
150
|
+
/**
|
|
151
|
+
* tabindex - Allows the HTML elements to be focusable
|
|
152
|
+
* @example <caption>In HTML (like `index.html`)</caption> <tttx-textarea input-index="1" />
|
|
153
|
+
* @example <caption>In TSX files</caption> <tttx-textarea inputindex={1} />
|
|
154
|
+
*/
|
|
155
|
+
"inputindex": string | number;
|
|
156
|
+
/**
|
|
157
|
+
* Defines what action to present for the enter key on virtual keyboards
|
|
158
|
+
*/
|
|
159
|
+
"inputkeyhint": 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';
|
|
160
|
+
"inputtitle": string;
|
|
161
|
+
"label": string;
|
|
162
|
+
"maxlength": string | number;
|
|
163
|
+
"name": string;
|
|
164
|
+
"placeholder": string;
|
|
165
|
+
"readonly": string | boolean;
|
|
166
|
+
"required": boolean;
|
|
167
|
+
"rows": number;
|
|
168
|
+
/**
|
|
169
|
+
* Footnote under the input field
|
|
170
|
+
*/
|
|
171
|
+
"secondarylabel": string;
|
|
172
|
+
"showerrorbubble": boolean;
|
|
173
|
+
"showerrormsg": boolean;
|
|
174
|
+
"textareaautofocus": boolean;
|
|
175
|
+
"value": string | number;
|
|
176
|
+
}
|
|
147
177
|
interface TttxToolbar {
|
|
148
178
|
"border": boolean;
|
|
149
179
|
}
|
|
@@ -187,6 +217,10 @@ export interface TttxTabsCustomEvent<T> extends CustomEvent<T> {
|
|
|
187
217
|
detail: T;
|
|
188
218
|
target: HTMLTttxTabsElement;
|
|
189
219
|
}
|
|
220
|
+
export interface TttxTextareaCustomEvent<T> extends CustomEvent<T> {
|
|
221
|
+
detail: T;
|
|
222
|
+
target: HTMLTttxTextareaElement;
|
|
223
|
+
}
|
|
190
224
|
export interface TttxTreeViewCustomEvent<T> extends CustomEvent<T> {
|
|
191
225
|
detail: T;
|
|
192
226
|
target: HTMLTttxTreeViewElement;
|
|
@@ -282,6 +316,12 @@ declare global {
|
|
|
282
316
|
prototype: HTMLTttxTagElement;
|
|
283
317
|
new (): HTMLTttxTagElement;
|
|
284
318
|
};
|
|
319
|
+
interface HTMLTttxTextareaElement extends Components.TttxTextarea, HTMLStencilElement {
|
|
320
|
+
}
|
|
321
|
+
var HTMLTttxTextareaElement: {
|
|
322
|
+
prototype: HTMLTttxTextareaElement;
|
|
323
|
+
new (): HTMLTttxTextareaElement;
|
|
324
|
+
};
|
|
285
325
|
interface HTMLTttxToolbarElement extends Components.TttxToolbar, HTMLStencilElement {
|
|
286
326
|
}
|
|
287
327
|
var HTMLTttxToolbarElement: {
|
|
@@ -310,6 +350,7 @@ declare global {
|
|
|
310
350
|
"tttx-standalone-input": HTMLTttxStandaloneInputElement;
|
|
311
351
|
"tttx-tabs": HTMLTttxTabsElement;
|
|
312
352
|
"tttx-tag": HTMLTttxTagElement;
|
|
353
|
+
"tttx-textarea": HTMLTttxTextareaElement;
|
|
313
354
|
"tttx-toolbar": HTMLTttxToolbarElement;
|
|
314
355
|
"tttx-tree-view": HTMLTttxTreeViewElement;
|
|
315
356
|
}
|
|
@@ -467,6 +508,40 @@ declare namespace LocalJSX {
|
|
|
467
508
|
"color"?: string;
|
|
468
509
|
"text"?: string;
|
|
469
510
|
}
|
|
511
|
+
interface TttxTextarea {
|
|
512
|
+
"disabled"?: boolean;
|
|
513
|
+
"errormsg"?: string;
|
|
514
|
+
/**
|
|
515
|
+
* tabindex - Allows the HTML elements to be focusable
|
|
516
|
+
* @example <caption>In HTML (like `index.html`)</caption> <tttx-textarea input-index="1" />
|
|
517
|
+
* @example <caption>In TSX files</caption> <tttx-textarea inputindex={1} />
|
|
518
|
+
*/
|
|
519
|
+
"inputindex"?: string | number;
|
|
520
|
+
/**
|
|
521
|
+
* Defines what action to present for the enter key on virtual keyboards
|
|
522
|
+
*/
|
|
523
|
+
"inputkeyhint"?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';
|
|
524
|
+
"inputtitle"?: string;
|
|
525
|
+
"label"?: string;
|
|
526
|
+
"maxlength"?: string | number;
|
|
527
|
+
"name"?: string;
|
|
528
|
+
"onBlurChanged"?: (event: TttxTextareaCustomEvent<string>) => void;
|
|
529
|
+
"onFocusChanged"?: (event: TttxTextareaCustomEvent<string>) => void;
|
|
530
|
+
"onInvalidChanged"?: (event: TttxTextareaCustomEvent<string>) => void;
|
|
531
|
+
"onValueChanged"?: (event: TttxTextareaCustomEvent<string>) => void;
|
|
532
|
+
"placeholder"?: string;
|
|
533
|
+
"readonly"?: string | boolean;
|
|
534
|
+
"required"?: boolean;
|
|
535
|
+
"rows"?: number;
|
|
536
|
+
/**
|
|
537
|
+
* Footnote under the input field
|
|
538
|
+
*/
|
|
539
|
+
"secondarylabel"?: string;
|
|
540
|
+
"showerrorbubble"?: boolean;
|
|
541
|
+
"showerrormsg"?: boolean;
|
|
542
|
+
"textareaautofocus"?: boolean;
|
|
543
|
+
"value"?: string | number;
|
|
544
|
+
}
|
|
470
545
|
interface TttxToolbar {
|
|
471
546
|
"border"?: boolean;
|
|
472
547
|
}
|
|
@@ -490,6 +565,7 @@ declare namespace LocalJSX {
|
|
|
490
565
|
"tttx-standalone-input": TttxStandaloneInput;
|
|
491
566
|
"tttx-tabs": TttxTabs;
|
|
492
567
|
"tttx-tag": TttxTag;
|
|
568
|
+
"tttx-textarea": TttxTextarea;
|
|
493
569
|
"tttx-toolbar": TttxToolbar;
|
|
494
570
|
"tttx-tree-view": TttxTreeView;
|
|
495
571
|
}
|
|
@@ -513,6 +589,7 @@ declare module "@stencil/core" {
|
|
|
513
589
|
"tttx-standalone-input": LocalJSX.TttxStandaloneInput & JSXBase.HTMLAttributes<HTMLTttxStandaloneInputElement>;
|
|
514
590
|
"tttx-tabs": LocalJSX.TttxTabs & JSXBase.HTMLAttributes<HTMLTttxTabsElement>;
|
|
515
591
|
"tttx-tag": LocalJSX.TttxTag & JSXBase.HTMLAttributes<HTMLTttxTagElement>;
|
|
592
|
+
"tttx-textarea": LocalJSX.TttxTextarea & JSXBase.HTMLAttributes<HTMLTttxTextareaElement>;
|
|
516
593
|
"tttx-toolbar": LocalJSX.TttxToolbar & JSXBase.HTMLAttributes<HTMLTttxToolbarElement>;
|
|
517
594
|
"tttx-tree-view": LocalJSX.TttxTreeView & JSXBase.HTMLAttributes<HTMLTttxTreeViewElement>;
|
|
518
595
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@3t-transform/threeteeui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.78",
|
|
4
4
|
"description": "3t Design System",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@typescript-eslint/parser": "^5.59.1",
|
|
57
57
|
"chromatic": "^6.7.4",
|
|
58
58
|
"eslint": "^8.38.0",
|
|
59
|
-
"eslint-plugin-storybook": "^0.6.
|
|
59
|
+
"eslint-plugin-storybook": "^0.6.14",
|
|
60
60
|
"jest": "^27.4.5",
|
|
61
61
|
"jest-cli": "^27.4.5",
|
|
62
62
|
"less": "^4.1.3",
|
|
@@ -76,4 +76,4 @@
|
|
|
76
76
|
"storybook": "^7.4.0",
|
|
77
77
|
"ts-qrcode": "^0.0.4"
|
|
78
78
|
}
|
|
79
|
-
}
|
|
79
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,c as t,h as i,H as s,g as e}from"./p-3f1b6013.js";import{p as n,d}from"./p-5ed38d61.js";import"./p-112455b1.js";const r=class{constructor(i){o(this,i),this.selectItemEvent=t(this,"selectItemEvent",7),this.toggleOpen=t(this,"toggleOpen",7),this.changesApplied=t(this,"changesApplied",7),this.bodyOffset={},this.optionsData=null,this.label=void 0,this.inline=void 0,this.placeholder="",this.searchEnabled=void 0,this.htmlVisibleValue=void 0,this.visibleValue=void 0,this.open=!1,this.unsavedSelectedItems=void 0,this.searchTerm=""}handleCloseSelectBox(){this.open=!1}handleBlur(){this.open=!1,this.toggleOpen.emit(!1)}safelyCloneArray(o){return JSON.parse(JSON.stringify(o))}onDropdownClicked(){this.open=!this.open,this.searchTerm="",this.calculateDropdownMenuOffset(),this.toggleOpen.emit(this.open)}onCancel(){this.open=!1,this.unsavedSelectedItems=this.safelyCloneArray(this._optionsData),this.toggleOpen.emit(!1)}applyChanges(){this.open=!1,this.changesApplied.emit(this.safelyCloneArray(this.unsavedSelectedItems))}onItemSelected(o){const t=this.unsavedSelectedItems.findIndex((t=>t.value===o.value));this.unsavedSelectedItems[t]=Object.assign(Object.assign({},o),{selected:!o.selected}),this.unsavedSelectedItems=[...this.unsavedSelectedItems],this.selectItemEvent.emit(o)}dropdownSelectorContent(){if(!this._optionsData.find((o=>o.selected)))return i("div",{class:"placeholder"},this.placeholder);if(this.htmlVisibleValue){const o=n.sanitize(this.visibleValue,d);return i("div",{class:"dropdown-selector-html-content",innerHTML:o})}return i("div",null,this.visibleValue)}dropdownOption(o){const t=this.searchEnabled&&-1===o.label.toLowerCase().indexOf(this.searchTerm.toLowerCase()),s=o.selected?"check_box":"check_box_outline_blank",e=o.selected?"blue":"grey";if(o.html){const r=n.sanitize(o.html,d);return i("div",{class:`dropdown-option ${t?"hidden":""} ${o.selected?"selected":""}`,onClick:this.onItemSelected.bind(this,o),key:o.label},i("tttx-icon",{icon:s,color:e,class:"checkbox-icon"}),i("div",{innerHTML:r}))}return i("div",{class:`dropdown-option ${t?"hidden":""} ${o.selected?"selected":""}`,onClick:this.onItemSelected.bind(this,o),key:o.label},i("tttx-icon",{icon:s,color:e,class:"checkbox-icon"}),i("div",{class:"plaintext-option"},o.label))}handleSearchInput(o){this.searchTerm=o.target.value}calculateDropdownMenuOffset(){const o=this.el.shadowRoot.querySelector(".dropdown-selector"),t=o.getBoundingClientRect().bottom;let i=Math.min(288,36*this._optionsData.length)+45+8;this.searchEnabled&&(i+=52),this.bodyOffset=t+i>window.innerHeight?{bottom:"16px",position:"fixed",width:`${o.offsetWidth}px`}:{}}render(){if(!this.optionsData)return;this._optionsData="string"==typeof this.optionsData?JSON.parse(this.optionsData):this.optionsData,this.unsavedSelectedItems||(this.unsavedSelectedItems=this.safelyCloneArray(this._optionsData));const o=this.open?"expand_less":"expand_more";return i(s,{class:this.inline?"inline":"block"},this.label&&i("div",{class:"label"},this.label),i("div",{tabindex:"0",class:"dropdown-container"},i("div",{class:"dropdown-selector",onClick:this.onDropdownClicked.bind(this)},this.dropdownSelectorContent(),i("div",{class:"dropdown-selector-chevron"},i("tttx-icon",{icon:o,color:"black"}))),this.open&&i("div",{class:"dropdown-body-container"},i("div",{class:"dropdown-body",style:Object.assign({},this.bodyOffset)},this.searchEnabled&&i("div",{class:"searchbox"},i("tttx-standalone-input",{type:"text",label:"",required:!0,showerrorbubble:!1,iconleft:"search",onInput:this.handleSearchInput.bind(this),inline:!0})),i("div",{class:"dropdown-options-list"},this.unsavedSelectedItems.map((o=>this.dropdownOption(o)))),i("div",{class:"footer"},i("tttx-button",{design:"primary",onClick:this.applyChanges.bind(this)},"Apply"),i("tttx-button",{onClick:this.onCancel.bind(this)},"Cancel"))))))}get el(){return e(this)}};r.style='.material-symbols-rounded{font-variation-settings:"FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24}:host{display:flex;gap:4px}.label{font-size:16px;font-style:normal;font-weight:500;line-height:normal}:host(.inline) .label{padding-top:8px}:host(.block){flex-direction:column}.dropdown-container{display:grid;position:relative;display:flex;flex-direction:column;width:100%}.dropdown-container:focus-visible{outline:none}.dropdown-container:focus .dropdown-selector{border:1px solid #1479c6}.dropdown-selector,.dropdown-body{display:flex;border-radius:4px;background-color:white}.dropdown-selector{grid-row:1;align-items:center;gap:8px;padding:6px 8px 6px 16px;cursor:pointer;border:1px solid #d5d5d5}.dropdown-selector-chevron{margin-left:auto;height:24px}.dropdown-selector-chevron>tttx-icon{cursor:pointer}.dropdown-selector-html-content{display:flex;gap:8px;flex-wrap:wrap}.dropdown-body-container{grid-row:2;position:relative}.dropdown-body{position:absolute;display:flex;position:absolute;flex-direction:column;box-shadow:0px 1px 5px #1111114D;padding-bottom:8px;border:1px solid #d5d5d5;width:100%}.dropdown-options-list{display:flex;flex-direction:column;overflow-y:auto;scrollbar-gutter:stable;max-height:288px}.dropdown-option{padding:6px 8px 6px 16px;cursor:pointer;display:flex;gap:8px}.dropdown-option .checkbox-icon{height:24px}.dropdown-option .plaintext-option{line-height:24px}.dropdown-option:hover{background-color:#1111110d}.dropdown-option:active,.dropdown-option.selected{background-color:#ebfbfc}.placeholder{color:#9e9e9e}.searchbox{padding:8px 16px 8px 16px;height:52px;box-sizing:border-box}.searchbox tttx-standalone-input{margin-top:-4px}.hidden{display:none}.footer{display:flex;gap:8px;flex-direction:row-reverse;padding:8px 16px 0 16px;border-top:1px solid #d5d5d5}';export{r as tttx_multiselect_box}
|