@logosphere-ui/core 0.0.0-alpha.12 → 0.0.0-alpha.13
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/atoms/FormField/formfield.d.ts +7 -0
- package/dist/{badge-DVvdodRb.cjs → badge-7IIatiRv.cjs} +1 -1
- package/dist/{badge-CHWTCGQG.js → badge-B2chRYGd.js} +1 -1
- package/dist/badge.cjs +1 -1
- package/dist/badge.js +1 -1
- package/dist/{button-BqOMevro.js → button-BFq8AmDc.js} +1 -1
- package/dist/{button-CDRccsk9.cjs → button-Bx870pUi.cjs} +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/calendar-DF3q_dcG.cjs +88 -0
- package/dist/calendar-WZ_GQvnn.js +652 -0
- package/dist/calendar.cjs +1 -0
- package/dist/calendar.js +4 -0
- package/dist/{card-KiNHfEi2.cjs → card-BmW0sPDb.cjs} +1 -1
- package/dist/{card-CNoTUaJC.js → card-D0OT4Kuq.js} +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/{chatbot-xaFF5RNV.js → chatbot-Bn9tPquz.js} +190 -127
- package/dist/chatbot-CL9OGmNE.cjs +183 -0
- package/dist/chatbot.cjs +1 -1
- package/dist/chatbot.js +1 -1
- package/dist/combobox-C6zoQopK.cjs +113 -0
- package/dist/combobox-LBU6VHLi.js +376 -0
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.js +1 -1
- package/dist/datepicker-BLv_G9Yb.cjs +85 -0
- package/dist/datepicker-SwKsdw3S.js +375 -0
- package/dist/datepicker.cjs +1 -1
- package/dist/datepicker.js +1 -1
- package/dist/formfield-BFOIEicR.cjs +33 -0
- package/dist/formfield-CNh4mBSs.js +147 -0
- package/dist/formfield.cjs +1 -1
- package/dist/formfield.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +34 -27
- package/dist/index.umd.js +466 -232
- package/dist/input-JpAWN-M1.cjs +59 -0
- package/dist/{input-CxBP0i-3.js → input-jmbvgWEq.js} +100 -82
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/left-menu.cjs +1 -0
- package/dist/left-menu.js +5 -0
- package/dist/leftmenu-Bgqfmoe5.cjs +74 -0
- package/dist/leftmenu-GsoBxkeJ.js +291 -0
- package/dist/molecules/Input/input.d.ts +3 -1
- package/dist/molecules/Textarea/text-area.d.ts +0 -1
- package/dist/organisms/Calendar/calendar.d.ts +54 -0
- package/dist/organisms/Calendar/index.d.ts +1 -0
- package/dist/organisms/Calendar/shared.d.ts +9 -0
- package/dist/organisms/Chatbot/chatbot.d.ts +7 -0
- package/dist/organisms/Combobox/combobox.d.ts +16 -0
- package/dist/organisms/DatePicker/datepicker.d.ts +31 -31
- package/dist/organisms/LeftMenu/index.d.ts +2 -0
- package/dist/organisms/LeftMenu/leftmenu-item.d.ts +14 -0
- package/dist/organisms/LeftMenu/leftmenu.d.ts +44 -0
- package/dist/organisms/TreeMenu/index.d.ts +1 -0
- package/dist/organisms/TreeMenu/tree-menu.d.ts +41 -0
- package/dist/styles/main.css +1 -0
- package/dist/{text-area-eT-oCnqZ.cjs → text-area-CZDdxbrN.cjs} +5 -3
- package/dist/{text-area-Dw4CUBcz.js → text-area-Dec_k4rs.js} +18 -19
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/tree-menu-B1iwfHyd.cjs +47 -0
- package/dist/tree-menu-BbX8GK_z.js +154 -0
- package/dist/tree-menu.cjs +1 -0
- package/dist/tree-menu.js +4 -0
- package/dist/{ui-icon-ltkJROhR.js → ui-icon-Bys4HYSQ.js} +24 -18
- package/dist/{ui-icon-CVEyvL5D.cjs → ui-icon-DWh1MhBa.cjs} +4 -4
- package/package.json +16 -1
- package/dist/chatbot-BF4TQnlG.cjs +0 -160
- package/dist/combobox-CeK7yW2F.cjs +0 -99
- package/dist/combobox-DTUSFw9V.js +0 -270
- package/dist/datepicker-BQOVo1Pr.cjs +0 -115
- package/dist/datepicker-ChdQsc_l.js +0 -751
- package/dist/formfield-BOgRugzm.js +0 -118
- package/dist/formfield-D_7NFFoe.cjs +0 -27
- package/dist/input-CoY1ZcPF.cjs +0 -46
package/dist/styles/main.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const i=require("lit"),t=require("lit/decorators.js"),p=require("lit/directives/live.js");require("./formfield-
|
|
1
|
+
"use strict";const i=require("lit"),t=require("lit/decorators.js"),p=require("lit/directives/live.js");require("./formfield-BFOIEicR.cjs");require("./ui-icon-DWh1MhBa.cjs");const u=".textarea__field{width:100%;background:transparent;border:none;outline:none;font-size:var(--font-size-sm);font-family:var(--font-family-base);color:var(--color-body-text);box-sizing:border-box;line-height:1.5}.textarea__field::placeholder{color:var(--color-tertiary)}.textarea__field:disabled{cursor:not-allowed}.textarea__field--resize-none{resize:none}.textarea__field--resize-vertical{resize:vertical}.textarea__field--resize-horizontal{resize:horizontal}.textarea__field--resize-both{resize:both}.textarea__field--auto-resize{resize:none;overflow:hidden}.textarea__clear-btn{border:none;background:transparent;color:var(--color-gray-400);cursor:pointer;padding:0;display:inline-flex;align-items:flex-start;align-self:flex-start;margin-top:var(--spacing-1);outline:none;flex-shrink:0;transition:color var(--transition-speed-fast) var(--transition-timing)}.textarea__clear-btn:hover{color:var(--color-gray-600)}";var d=Object.defineProperty,y=Object.getOwnPropertyDescriptor,r=(l,e,a,o)=>{for(var s=o>1?void 0:o?y(e,a):e,n=l.length-1,h;n>=0;n--)(h=l[n])&&(s=(o?h(e,a,s):h(s))||s);return o&&s&&d(e,a,s),s};exports.TextArea=class extends i.LitElement{constructor(){super(...arguments),this.value="",this.placeholder="",this.name="",this.autocomplete="",this.rows=3,this.wrap="soft",this.resize="vertical",this.autoResize=!1,this.size="default",this.variant="default",this.label="",this.helper="",this.error="",this.required=!1,this.disabled=!1,this.readonly=!1,this._internalError="",this.handleInput=e=>{const a=e.target;this.value=a.value,this.autoResize&&this.adjustHeight(),this._internalError&&(this._internalError="",this._textareaElement.setCustomValidity("")),this.dispatchEvent(new CustomEvent("input",{bubbles:!0,composed:!0,detail:{value:this.value,originalEvent:e}}))},this.handleChange=e=>{const a=e.target;this.value=a.value,a.checkValidity()||(this._internalError=a.validationMessage),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{value:this.value,originalEvent:e}}))},this.handleKeyDown=e=>{this.dispatchEvent(new CustomEvent("keydown",{bubbles:!0,composed:!0,detail:{key:e.key,originalEvent:e}}))},this.handleKeyUp=e=>{this.dispatchEvent(new CustomEvent("keyup",{bubbles:!0,composed:!0,detail:{key:e.key,originalEvent:e}}))},this.handleClear=()=>{this.value="",this._textareaElement&&(this._textareaElement.value="",this.autoResize&&this.adjustHeight()),this.dispatchEvent(new CustomEvent("clear",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("input",{bubbles:!0,composed:!0,detail:{value:"",originalEvent:null}}))}}get textareaElement(){return this._textareaElement}focus(){this._textareaElement?.focus()}blur(){this._textareaElement?.blur()}select(){this._textareaElement?.select()}setSelectionRange(e,a,o){this._textareaElement?.setSelectionRange(e,a,o)}checkValidity(){return this._textareaElement?.checkValidity()??!0}reportValidity(){return this._textareaElement?.reportValidity()??!0}setCustomValidity(e){this._textareaElement?.setCustomValidity(e),this._internalError=e,this.requestUpdate()}adjustHeight(){!this.autoResize||!this._textareaElement||(this._textareaElement.style.height="auto",this._textareaElement.style.height=`${this._textareaElement.scrollHeight}px`)}updated(e){super.updated(e),e.has("value")&&this.autoResize&&this.adjustHeight()}getResizeClass(){return this.autoResize?"textarea__field--auto-resize":{none:"textarea__field--resize-none",vertical:"textarea__field--resize-vertical",horizontal:"textarea__field--resize-horizontal",both:"textarea__field--resize-both"}[this.resize]}render(){const e=this.error||this._internalError,a=!!this.value&&!this.disabled&&!this.readonly,o=`textarea__field ${this.getResizeClass()}`;return i.html`
|
|
2
2
|
<logosphere-formfield
|
|
3
3
|
.label=${this.label}
|
|
4
4
|
.helper=${this.helper}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
.size=${this.size}
|
|
11
11
|
.variant=${this.variant}
|
|
12
12
|
>
|
|
13
|
+
<slot name="prefix" slot="prefix"></slot>
|
|
13
14
|
<textarea
|
|
14
15
|
class="${o}"
|
|
15
16
|
.value=${p.live(this.value)}
|
|
@@ -32,7 +33,7 @@
|
|
|
32
33
|
${a?i.html`
|
|
33
34
|
<button
|
|
34
35
|
type="button"
|
|
35
|
-
slot="
|
|
36
|
+
slot="clear"
|
|
36
37
|
class="textarea__clear-btn"
|
|
37
38
|
@click=${this.handleClear}
|
|
38
39
|
tabindex="-1"
|
|
@@ -40,5 +41,6 @@
|
|
|
40
41
|
<ui-icon name="uil-times" size="14"></ui-icon>
|
|
41
42
|
</button>
|
|
42
43
|
`:i.nothing}
|
|
44
|
+
<slot name="suffix" slot="suffix"></slot>
|
|
43
45
|
</logosphere-formfield>
|
|
44
|
-
`}};exports.TextArea.styles=[i.css`${i.unsafeCSS(u)}`];r([t.query("textarea")],exports.TextArea.prototype,"_textareaElement",2);r([t.property({type:String})],exports.TextArea.prototype,"value",2);r([t.property({type:String})],exports.TextArea.prototype,"placeholder",2);r([t.property({type:String})],exports.TextArea.prototype,"name",2);r([t.property({type:String})],exports.TextArea.prototype,"autocomplete",2);r([t.property({type:Number})],exports.TextArea.prototype,"minlength",2);r([t.property({type:Number})],exports.TextArea.prototype,"maxlength",2);r([t.property({type:Number})],exports.TextArea.prototype,"rows",2);r([t.property({type:Number})],exports.TextArea.prototype,"cols",2);r([t.property({type:String})],exports.TextArea.prototype,"wrap",2);r([t.property({type:String})],exports.TextArea.prototype,"resize",2);r([t.property({type:Boolean})],exports.TextArea.prototype,"autoResize",2);r([t.property({type:String})],exports.TextArea.prototype,"size",2);r([t.property({type:String})],exports.TextArea.prototype,"variant",2);r([t.property({type:
|
|
46
|
+
`}};exports.TextArea.styles=[i.css`${i.unsafeCSS(u)}`];r([t.query("textarea")],exports.TextArea.prototype,"_textareaElement",2);r([t.property({type:String})],exports.TextArea.prototype,"value",2);r([t.property({type:String})],exports.TextArea.prototype,"placeholder",2);r([t.property({type:String})],exports.TextArea.prototype,"name",2);r([t.property({type:String})],exports.TextArea.prototype,"autocomplete",2);r([t.property({type:Number})],exports.TextArea.prototype,"minlength",2);r([t.property({type:Number})],exports.TextArea.prototype,"maxlength",2);r([t.property({type:Number})],exports.TextArea.prototype,"rows",2);r([t.property({type:Number})],exports.TextArea.prototype,"cols",2);r([t.property({type:String})],exports.TextArea.prototype,"wrap",2);r([t.property({type:String})],exports.TextArea.prototype,"resize",2);r([t.property({type:Boolean})],exports.TextArea.prototype,"autoResize",2);r([t.property({type:String})],exports.TextArea.prototype,"size",2);r([t.property({type:String})],exports.TextArea.prototype,"variant",2);r([t.property({type:String})],exports.TextArea.prototype,"label",2);r([t.property({type:String})],exports.TextArea.prototype,"helper",2);r([t.property({type:String})],exports.TextArea.prototype,"error",2);r([t.property({type:Boolean})],exports.TextArea.prototype,"required",2);r([t.property({type:Boolean})],exports.TextArea.prototype,"disabled",2);r([t.property({type:Boolean})],exports.TextArea.prototype,"readonly",2);r([t.state()],exports.TextArea.prototype,"_internalError",2);exports.TextArea=r([t.customElement("logosphere-textarea")],exports.TextArea);
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { unsafeCSS as d, css as
|
|
2
|
-
import { query as m, property as i, state as
|
|
3
|
-
import { live as
|
|
4
|
-
import "./formfield-
|
|
5
|
-
import "./ui-icon-
|
|
6
|
-
const
|
|
7
|
-
var
|
|
1
|
+
import { unsafeCSS as d, css as c, LitElement as y, nothing as l, html as u } from "lit";
|
|
2
|
+
import { query as m, property as i, state as f, customElement as _ } from "lit/decorators.js";
|
|
3
|
+
import { live as v } from "lit/directives/live.js";
|
|
4
|
+
import "./formfield-CNh4mBSs.js";
|
|
5
|
+
import "./ui-icon-Bys4HYSQ.js";
|
|
6
|
+
const x = ".textarea__field{width:100%;background:transparent;border:none;outline:none;font-size:var(--font-size-sm);font-family:var(--font-family-base);color:var(--color-body-text);box-sizing:border-box;line-height:1.5}.textarea__field::placeholder{color:var(--color-tertiary)}.textarea__field:disabled{cursor:not-allowed}.textarea__field--resize-none{resize:none}.textarea__field--resize-vertical{resize:vertical}.textarea__field--resize-horizontal{resize:horizontal}.textarea__field--resize-both{resize:both}.textarea__field--auto-resize{resize:none;overflow:hidden}.textarea__clear-btn{border:none;background:transparent;color:var(--color-gray-400);cursor:pointer;padding:0;display:inline-flex;align-items:flex-start;align-self:flex-start;margin-top:var(--spacing-1);outline:none;flex-shrink:0;transition:color var(--transition-speed-fast) var(--transition-timing)}.textarea__clear-btn:hover{color:var(--color-gray-600)}";
|
|
7
|
+
var b = Object.defineProperty, g = Object.getOwnPropertyDescriptor, r = (e, a, s, n) => {
|
|
8
8
|
for (var o = n > 1 ? void 0 : n ? g(a, s) : a, h = e.length - 1, p; h >= 0; h--)
|
|
9
9
|
(p = e[h]) && (o = (n ? p(a, s, o) : p(o)) || o);
|
|
10
|
-
return n && o &&
|
|
10
|
+
return n && o && b(a, s, o), o;
|
|
11
11
|
};
|
|
12
|
-
let t = class extends
|
|
12
|
+
let t = class extends y {
|
|
13
13
|
constructor() {
|
|
14
|
-
super(...arguments), this.value = "", this.placeholder = "", this.name = "", this.autocomplete = "", this.rows = 3, this.wrap = "soft", this.resize = "vertical", this.autoResize = !1, this.size = "default", this.variant = "default", this.
|
|
14
|
+
super(...arguments), this.value = "", this.placeholder = "", this.name = "", this.autocomplete = "", this.rows = 3, this.wrap = "soft", this.resize = "vertical", this.autoResize = !1, this.size = "default", this.variant = "default", this.label = "", this.helper = "", this.error = "", this.required = !1, this.disabled = !1, this.readonly = !1, this._internalError = "", this.handleInput = (e) => {
|
|
15
15
|
const a = e.target;
|
|
16
16
|
this.value = a.value, this.autoResize && this.adjustHeight(), this._internalError && (this._internalError = "", this._textareaElement.setCustomValidity("")), this.dispatchEvent(new CustomEvent("input", {
|
|
17
17
|
bubbles: !0,
|
|
@@ -84,7 +84,7 @@ let t = class extends c {
|
|
|
84
84
|
}[this.resize];
|
|
85
85
|
}
|
|
86
86
|
render() {
|
|
87
|
-
const e = this.error || this._internalError, a = this.
|
|
87
|
+
const e = this.error || this._internalError, a = !!this.value && !this.disabled && !this.readonly, s = `textarea__field ${this.getResizeClass()}`;
|
|
88
88
|
return u`
|
|
89
89
|
<logosphere-formfield
|
|
90
90
|
.label=${this.label}
|
|
@@ -97,9 +97,10 @@ let t = class extends c {
|
|
|
97
97
|
.size=${this.size}
|
|
98
98
|
.variant=${this.variant}
|
|
99
99
|
>
|
|
100
|
+
<slot name="prefix" slot="prefix"></slot>
|
|
100
101
|
<textarea
|
|
101
102
|
class="${s}"
|
|
102
|
-
.value=${
|
|
103
|
+
.value=${v(this.value)}
|
|
103
104
|
placeholder=${this.placeholder || l}
|
|
104
105
|
name=${this.name || l}
|
|
105
106
|
autocomplete=${this.autocomplete || l}
|
|
@@ -119,7 +120,7 @@ let t = class extends c {
|
|
|
119
120
|
${a ? u`
|
|
120
121
|
<button
|
|
121
122
|
type="button"
|
|
122
|
-
slot="
|
|
123
|
+
slot="clear"
|
|
123
124
|
class="textarea__clear-btn"
|
|
124
125
|
@click=${this.handleClear}
|
|
125
126
|
tabindex="-1"
|
|
@@ -127,11 +128,12 @@ let t = class extends c {
|
|
|
127
128
|
<ui-icon name="uil-times" size="14"></ui-icon>
|
|
128
129
|
</button>
|
|
129
130
|
` : l}
|
|
131
|
+
<slot name="suffix" slot="suffix"></slot>
|
|
130
132
|
</logosphere-formfield>
|
|
131
133
|
`;
|
|
132
134
|
}
|
|
133
135
|
};
|
|
134
|
-
t.styles = [
|
|
136
|
+
t.styles = [c`${d(x)}`];
|
|
135
137
|
r([
|
|
136
138
|
m("textarea")
|
|
137
139
|
], t.prototype, "_textareaElement", 2);
|
|
@@ -174,9 +176,6 @@ r([
|
|
|
174
176
|
r([
|
|
175
177
|
i({ type: String })
|
|
176
178
|
], t.prototype, "variant", 2);
|
|
177
|
-
r([
|
|
178
|
-
i({ type: Boolean })
|
|
179
|
-
], t.prototype, "showClear", 2);
|
|
180
179
|
r([
|
|
181
180
|
i({ type: String })
|
|
182
181
|
], t.prototype, "label", 2);
|
|
@@ -196,10 +195,10 @@ r([
|
|
|
196
195
|
i({ type: Boolean })
|
|
197
196
|
], t.prototype, "readonly", 2);
|
|
198
197
|
r([
|
|
199
|
-
|
|
198
|
+
f()
|
|
200
199
|
], t.prototype, "_internalError", 2);
|
|
201
200
|
t = r([
|
|
202
|
-
|
|
201
|
+
_("logosphere-textarea")
|
|
203
202
|
], t);
|
|
204
203
|
export {
|
|
205
204
|
t as T
|
package/dist/textarea.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./text-area-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./text-area-CZDdxbrN.cjs");Object.defineProperty(exports,"TextArea",{enumerable:!0,get:()=>e.TextArea});
|
package/dist/textarea.js
CHANGED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";const r=require("lit"),s=require("lit/decorators.js"),d=require("lit/directives/unsafe-html.js");require("./ui-icon-DWh1MhBa.cjs");const h=".tree{width:100%;font-family:var(--font-family-base)}.tree__list,.tree__children{list-style:none;margin:0;padding:0}.tree__item{margin:0;padding:0}.tree__row{display:flex;align-items:center;gap:var(--spacing-1);padding:var(--spacing-2) var(--spacing-3);padding-left:calc(var(--spacing-3) + (var(--tree-level, 0) * 14px));border-radius:var(--radius-sm);color:var(--color-body-text);cursor:pointer;-webkit-user-select:none;user-select:none;transition:background-color var(--transition-speed-fast) var(--transition-timing)}.tree--icons .tree__row{justify-content:center;padding:0;width:44px;height:44px;min-height:44px;margin:0 auto}.tree__row:hover{background-color:var(--color-tertiary-bg)}.tree__row:focus-visible{outline:2px solid var(--color-secondary);outline-offset:1px}.tree__row--disabled{opacity:.5;cursor:not-allowed}.tree__row--active .tree__label,.tree__row--active .tree__icon{color:var(--color-primary)}.tree:not(.tree--icons) .tree__row--active{background-color:var(--color-tertiary-bg)}.tree__icon{width:20px;min-width:20px;display:inline-flex;align-items:center;justify-content:center;color:inherit}.tree--icons .tree__icon{width:20px;min-width:20px;height:20px}.tree--icons .tree__row--active{background-color:var(--color-primary)}.tree--icons .tree__row--active .tree__icon{color:#fff}.tree--icons .tree__row--active:hover{background-color:var(--color-primary-hover)}.tree__chevron-btn{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border:none;background:transparent;color:var(--color-tertiary);cursor:pointer;padding:0;flex-shrink:0}.tree__chevron-btn--right{margin-left:auto}.tree__chevron{transform:rotate(-90deg);transition:transform var(--transition-speed-fast) var(--transition-timing)}.tree__chevron--open{transform:rotate(0)}.tree__chevron-spacer{width:20px;height:20px;flex-shrink:0}.tree__label{display:inline-flex;align-items:center;font-size:var(--font-size-sm);color:inherit}";var p=Object.defineProperty,_=Object.getOwnPropertyDescriptor,a=(c,e,t,n)=>{for(var i=n>1?void 0:n?_(e,t):e,l=c.length-1,o;l>=0;l--)(o=c[l])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&p(e,t,i),i};exports.TreeMenu=class extends r.LitElement{constructor(){super(...arguments),this.items=[],this.expandedIds=[],this.expandOnLabelClick=!0,this.chevronPosition="left",this.showLabels=!0,this.iconSize=16,this._expandedSet=new Set}willUpdate(e){e.has("expandedIds")&&(this._expandedSet=new Set(this.expandedIds??[]))}_isExpanded(e){return this._expandedSet.has(e)}_emitToggle(e,t){this.dispatchEvent(new CustomEvent("toggle",{detail:{item:e,expanded:t},bubbles:!0,composed:!0}))}_emitItemClick(e){this.dispatchEvent(new CustomEvent("item-click",{detail:{item:e},bubbles:!0,composed:!0}))}_emitNodeClick(e,t){this.dispatchEvent(new CustomEvent("node-click",{detail:{item:e,hasChildren:t},bubbles:!0,composed:!0}))}_setExpanded(e,t){t?this._expandedSet.add(e.id):this._expandedSet.delete(e.id),this.expandedIds=Array.from(this._expandedSet),this._emitToggle(e,t)}_toggle(e,t){t.stopPropagation(),!(e.disabled||!e.children?.length)&&this._setExpanded(e,!this._isExpanded(e.id))}_handleItemClick(e,t){if(t.stopPropagation(),e.disabled)return;const n=!!e.children?.length;if(this._emitNodeClick(e,n),n&&this.expandOnLabelClick){this._setExpanded(e,!this._isExpanded(e.id));return}n||(e.onClick?.(e),this._emitItemClick(e))}_handleRowKeydown(e,t){t.key!=="Enter"&&t.key!==" "||(t.preventDefault(),this._handleItemClick(e,t))}_renderIcon(e){return e.iconName?r.html`
|
|
2
|
+
<span class="tree__icon">
|
|
3
|
+
<ui-icon name=${e.iconName} .size=${this.iconSize}></ui-icon>
|
|
4
|
+
</span>
|
|
5
|
+
`:e.iconHtml?r.html`<span class="tree__icon">${d.unsafeHTML(e.iconHtml)}</span>`:r.nothing}_renderChevron(e,t){const n=!!e.children?.length;return this.showLabels?n?r.html`
|
|
6
|
+
<button
|
|
7
|
+
type="button"
|
|
8
|
+
class="tree__chevron-btn ${this.chevronPosition==="right"?"tree__chevron-btn--right":""}"
|
|
9
|
+
aria-label=${t?"Collapse":"Expand"}
|
|
10
|
+
@click=${i=>this._toggle(e,i)}
|
|
11
|
+
>
|
|
12
|
+
<ui-icon
|
|
13
|
+
class="tree__chevron ${t?"tree__chevron--open":""}"
|
|
14
|
+
name="uil-angle-down"
|
|
15
|
+
size="20"
|
|
16
|
+
></ui-icon>
|
|
17
|
+
</button>
|
|
18
|
+
`:r.html`<span class="tree__chevron-spacer"></span>`:r.nothing}_renderNode(e,t){const n=!!e.children?.length,i=n?this._isExpanded(e.id):!1,l=this.showLabels?`--tree-level:${t};`:"--tree-level:0;";return r.html`
|
|
19
|
+
<li class="tree__item">
|
|
20
|
+
<div
|
|
21
|
+
class="tree__row ${e.disabled?"tree__row--disabled":""} ${e.active?"tree__row--active":""}"
|
|
22
|
+
style=${l}
|
|
23
|
+
role="button"
|
|
24
|
+
tabindex=${e.disabled?-1:0}
|
|
25
|
+
@click=${o=>this._handleItemClick(e,o)}
|
|
26
|
+
@keydown=${o=>this._handleRowKeydown(e,o)}
|
|
27
|
+
title=${this.showLabels?"":e.label}
|
|
28
|
+
>
|
|
29
|
+
${this.chevronPosition==="left"?this._renderChevron(e,i):r.nothing}
|
|
30
|
+
${this._renderIcon(e)}
|
|
31
|
+
${this.showLabels?r.html`<span class="tree__label">${e.label}</span>`:r.nothing}
|
|
32
|
+
${this.chevronPosition==="right"?this._renderChevron(e,i):r.nothing}
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
${this.showLabels&&n&&i?r.html`
|
|
36
|
+
<ul class="tree__children">
|
|
37
|
+
${e.children.map(o=>this._renderNode(o,t+1))}
|
|
38
|
+
</ul>
|
|
39
|
+
`:r.nothing}
|
|
40
|
+
</li>
|
|
41
|
+
`}render(){return r.html`
|
|
42
|
+
<nav class="tree ${this.showLabels?"":"tree--icons"}" aria-label="Tree Menu">
|
|
43
|
+
<ul class="tree__list">
|
|
44
|
+
${this.items.map(e=>this._renderNode(e,0))}
|
|
45
|
+
</ul>
|
|
46
|
+
</nav>
|
|
47
|
+
`}};exports.TreeMenu.styles=[r.css`${r.unsafeCSS(h)}`];a([s.property({attribute:!1})],exports.TreeMenu.prototype,"items",2);a([s.property({type:Array})],exports.TreeMenu.prototype,"expandedIds",2);a([s.property({type:Boolean})],exports.TreeMenu.prototype,"expandOnLabelClick",2);a([s.property({type:String})],exports.TreeMenu.prototype,"chevronPosition",2);a([s.property({type:Boolean})],exports.TreeMenu.prototype,"showLabels",2);a([s.property({type:Number})],exports.TreeMenu.prototype,"iconSize",2);a([s.state()],exports.TreeMenu.prototype,"_expandedSet",2);exports.TreeMenu=a([s.customElement("logosphere-tree-menu")],exports.TreeMenu);
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { unsafeCSS as p, css as _, LitElement as u, html as a, nothing as c } from "lit";
|
|
2
|
+
import { property as d, state as v, customElement as b } from "lit/decorators.js";
|
|
3
|
+
import { unsafeHTML as g } from "lit/directives/unsafe-html.js";
|
|
4
|
+
import "./ui-icon-Bys4HYSQ.js";
|
|
5
|
+
const f = ".tree{width:100%;font-family:var(--font-family-base)}.tree__list,.tree__children{list-style:none;margin:0;padding:0}.tree__item{margin:0;padding:0}.tree__row{display:flex;align-items:center;gap:var(--spacing-1);padding:var(--spacing-2) var(--spacing-3);padding-left:calc(var(--spacing-3) + (var(--tree-level, 0) * 14px));border-radius:var(--radius-sm);color:var(--color-body-text);cursor:pointer;-webkit-user-select:none;user-select:none;transition:background-color var(--transition-speed-fast) var(--transition-timing)}.tree--icons .tree__row{justify-content:center;padding:0;width:44px;height:44px;min-height:44px;margin:0 auto}.tree__row:hover{background-color:var(--color-tertiary-bg)}.tree__row:focus-visible{outline:2px solid var(--color-secondary);outline-offset:1px}.tree__row--disabled{opacity:.5;cursor:not-allowed}.tree__row--active .tree__label,.tree__row--active .tree__icon{color:var(--color-primary)}.tree:not(.tree--icons) .tree__row--active{background-color:var(--color-tertiary-bg)}.tree__icon{width:20px;min-width:20px;display:inline-flex;align-items:center;justify-content:center;color:inherit}.tree--icons .tree__icon{width:20px;min-width:20px;height:20px}.tree--icons .tree__row--active{background-color:var(--color-primary)}.tree--icons .tree__row--active .tree__icon{color:#fff}.tree--icons .tree__row--active:hover{background-color:var(--color-primary-hover)}.tree__chevron-btn{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border:none;background:transparent;color:var(--color-tertiary);cursor:pointer;padding:0;flex-shrink:0}.tree__chevron-btn--right{margin-left:auto}.tree__chevron{transform:rotate(-90deg);transition:transform var(--transition-speed-fast) var(--transition-timing)}.tree__chevron--open{transform:rotate(0)}.tree__chevron-spacer{width:20px;height:20px;flex-shrink:0}.tree__label{display:inline-flex;align-items:center;font-size:var(--font-size-sm);color:inherit}";
|
|
6
|
+
var w = Object.defineProperty, x = Object.getOwnPropertyDescriptor, l = (e, t, r, n) => {
|
|
7
|
+
for (var o = n > 1 ? void 0 : n ? x(t, r) : t, s = e.length - 1, h; s >= 0; s--)
|
|
8
|
+
(h = e[s]) && (o = (n ? h(t, r, o) : h(o)) || o);
|
|
9
|
+
return n && o && w(t, r, o), o;
|
|
10
|
+
};
|
|
11
|
+
let i = class extends u {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments), this.items = [], this.expandedIds = [], this.expandOnLabelClick = !0, this.chevronPosition = "left", this.showLabels = !0, this.iconSize = 16, this._expandedSet = /* @__PURE__ */ new Set();
|
|
14
|
+
}
|
|
15
|
+
willUpdate(e) {
|
|
16
|
+
e.has("expandedIds") && (this._expandedSet = new Set(this.expandedIds ?? []));
|
|
17
|
+
}
|
|
18
|
+
_isExpanded(e) {
|
|
19
|
+
return this._expandedSet.has(e);
|
|
20
|
+
}
|
|
21
|
+
_emitToggle(e, t) {
|
|
22
|
+
this.dispatchEvent(
|
|
23
|
+
new CustomEvent("toggle", {
|
|
24
|
+
detail: { item: e, expanded: t },
|
|
25
|
+
bubbles: !0,
|
|
26
|
+
composed: !0
|
|
27
|
+
})
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
_emitItemClick(e) {
|
|
31
|
+
this.dispatchEvent(
|
|
32
|
+
new CustomEvent("item-click", {
|
|
33
|
+
detail: { item: e },
|
|
34
|
+
bubbles: !0,
|
|
35
|
+
composed: !0
|
|
36
|
+
})
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
_emitNodeClick(e, t) {
|
|
40
|
+
this.dispatchEvent(
|
|
41
|
+
new CustomEvent("node-click", {
|
|
42
|
+
detail: { item: e, hasChildren: t },
|
|
43
|
+
bubbles: !0,
|
|
44
|
+
composed: !0
|
|
45
|
+
})
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
_setExpanded(e, t) {
|
|
49
|
+
t ? this._expandedSet.add(e.id) : this._expandedSet.delete(e.id), this.expandedIds = Array.from(this._expandedSet), this._emitToggle(e, t);
|
|
50
|
+
}
|
|
51
|
+
_toggle(e, t) {
|
|
52
|
+
t.stopPropagation(), !(e.disabled || !e.children?.length) && this._setExpanded(e, !this._isExpanded(e.id));
|
|
53
|
+
}
|
|
54
|
+
_handleItemClick(e, t) {
|
|
55
|
+
if (t.stopPropagation(), e.disabled) return;
|
|
56
|
+
const r = !!e.children?.length;
|
|
57
|
+
if (this._emitNodeClick(e, r), r && this.expandOnLabelClick) {
|
|
58
|
+
this._setExpanded(e, !this._isExpanded(e.id));
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
r || (e.onClick?.(e), this._emitItemClick(e));
|
|
62
|
+
}
|
|
63
|
+
_handleRowKeydown(e, t) {
|
|
64
|
+
t.key !== "Enter" && t.key !== " " || (t.preventDefault(), this._handleItemClick(e, t));
|
|
65
|
+
}
|
|
66
|
+
_renderIcon(e) {
|
|
67
|
+
return e.iconName ? a`
|
|
68
|
+
<span class="tree__icon">
|
|
69
|
+
<ui-icon name=${e.iconName} .size=${this.iconSize}></ui-icon>
|
|
70
|
+
</span>
|
|
71
|
+
` : e.iconHtml ? a`<span class="tree__icon">${g(e.iconHtml)}</span>` : c;
|
|
72
|
+
}
|
|
73
|
+
_renderChevron(e, t) {
|
|
74
|
+
const r = !!e.children?.length;
|
|
75
|
+
return this.showLabels ? r ? a`
|
|
76
|
+
<button
|
|
77
|
+
type="button"
|
|
78
|
+
class="tree__chevron-btn ${this.chevronPosition === "right" ? "tree__chevron-btn--right" : ""}"
|
|
79
|
+
aria-label=${t ? "Collapse" : "Expand"}
|
|
80
|
+
@click=${(n) => this._toggle(e, n)}
|
|
81
|
+
>
|
|
82
|
+
<ui-icon
|
|
83
|
+
class="tree__chevron ${t ? "tree__chevron--open" : ""}"
|
|
84
|
+
name="uil-angle-down"
|
|
85
|
+
size="20"
|
|
86
|
+
></ui-icon>
|
|
87
|
+
</button>
|
|
88
|
+
` : a`<span class="tree__chevron-spacer"></span>` : c;
|
|
89
|
+
}
|
|
90
|
+
_renderNode(e, t) {
|
|
91
|
+
const r = !!e.children?.length, n = r ? this._isExpanded(e.id) : !1, o = this.showLabels ? `--tree-level:${t};` : "--tree-level:0;";
|
|
92
|
+
return a`
|
|
93
|
+
<li class="tree__item">
|
|
94
|
+
<div
|
|
95
|
+
class="tree__row ${e.disabled ? "tree__row--disabled" : ""} ${e.active ? "tree__row--active" : ""}"
|
|
96
|
+
style=${o}
|
|
97
|
+
role="button"
|
|
98
|
+
tabindex=${e.disabled ? -1 : 0}
|
|
99
|
+
@click=${(s) => this._handleItemClick(e, s)}
|
|
100
|
+
@keydown=${(s) => this._handleRowKeydown(e, s)}
|
|
101
|
+
title=${this.showLabels ? "" : e.label}
|
|
102
|
+
>
|
|
103
|
+
${this.chevronPosition === "left" ? this._renderChevron(e, n) : c}
|
|
104
|
+
${this._renderIcon(e)}
|
|
105
|
+
${this.showLabels ? a`<span class="tree__label">${e.label}</span>` : c}
|
|
106
|
+
${this.chevronPosition === "right" ? this._renderChevron(e, n) : c}
|
|
107
|
+
</div>
|
|
108
|
+
|
|
109
|
+
${this.showLabels && r && n ? a`
|
|
110
|
+
<ul class="tree__children">
|
|
111
|
+
${e.children.map((s) => this._renderNode(s, t + 1))}
|
|
112
|
+
</ul>
|
|
113
|
+
` : c}
|
|
114
|
+
</li>
|
|
115
|
+
`;
|
|
116
|
+
}
|
|
117
|
+
render() {
|
|
118
|
+
return a`
|
|
119
|
+
<nav class="tree ${this.showLabels ? "" : "tree--icons"}" aria-label="Tree Menu">
|
|
120
|
+
<ul class="tree__list">
|
|
121
|
+
${this.items.map((e) => this._renderNode(e, 0))}
|
|
122
|
+
</ul>
|
|
123
|
+
</nav>
|
|
124
|
+
`;
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
i.styles = [_`${p(f)}`];
|
|
128
|
+
l([
|
|
129
|
+
d({ attribute: !1 })
|
|
130
|
+
], i.prototype, "items", 2);
|
|
131
|
+
l([
|
|
132
|
+
d({ type: Array })
|
|
133
|
+
], i.prototype, "expandedIds", 2);
|
|
134
|
+
l([
|
|
135
|
+
d({ type: Boolean })
|
|
136
|
+
], i.prototype, "expandOnLabelClick", 2);
|
|
137
|
+
l([
|
|
138
|
+
d({ type: String })
|
|
139
|
+
], i.prototype, "chevronPosition", 2);
|
|
140
|
+
l([
|
|
141
|
+
d({ type: Boolean })
|
|
142
|
+
], i.prototype, "showLabels", 2);
|
|
143
|
+
l([
|
|
144
|
+
d({ type: Number })
|
|
145
|
+
], i.prototype, "iconSize", 2);
|
|
146
|
+
l([
|
|
147
|
+
v()
|
|
148
|
+
], i.prototype, "_expandedSet", 2);
|
|
149
|
+
i = l([
|
|
150
|
+
b("logosphere-tree-menu")
|
|
151
|
+
], i);
|
|
152
|
+
export {
|
|
153
|
+
i as T
|
|
154
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./tree-menu-B1iwfHyd.cjs");Object.defineProperty(exports,"TreeMenu",{enumerable:!0,get:()=>e.TreeMenu});
|
|
@@ -1,38 +1,44 @@
|
|
|
1
|
-
import { LitElement as l, css as
|
|
2
|
-
import { unsafeHTML as
|
|
3
|
-
const
|
|
4
|
-
"uil-times":
|
|
1
|
+
import { LitElement as l, css as e, html as w } from "lit";
|
|
2
|
+
import { unsafeHTML as o } from "lit/directives/unsafe-html.js";
|
|
3
|
+
const g = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13.41,12l4.3-4.29a1,1,0,1,0-1.42-1.42L12,10.59,7.71,6.29A1,1,0,0,0,6.29,7.71L10.59,12l-4.3,4.29a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0L12,13.41l4.29,4.3a1,1,0,0,0,1.42,0,1,1,0,0,0,0-1.42Z"/></svg>', h = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17,9.17a1,1,0,0,0-1.41,0L12,12.71,8.46,9.17a1,1,0,0,0-1.41,0,1,1,0,0,0,0,1.42l4.24,4.24a1,1,0,0,0,1.42,0L17,10.59A1,1,0,0,0,17,9.17Z"/></svg>', i = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19,4H17V3a1,1,0,0,0-2,0V4H9V3A1,1,0,0,0,7,3V4H5A3,3,0,0,0,2,7V19a3,3,0,0,0,3,3H19a3,3,0,0,0,3-3V7A3,3,0,0,0,19,4Zm1,15a1,1,0,0,1-1,1H5a1,1,0,0,1-1-1V12H20Zm0-9H4V7A1,1,0,0,1,5,6H7V7A1,1,0,0,0,9,7V6h6V7a1,1,0,0,0,2,0V6h2a1,1,0,0,1,1,1Z"/></svg>', n = '<svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" viewBox="0 0 24 24"><path d="M17,11H9.41l3.3-3.29a1,1,0,1,0-1.42-1.42l-5,5a1,1,0,0,0-.21.33,1,1,0,0,0,0,.76,1,1,0,0,0,.21.33l5,5a1,1,0,0,0,1.42,0,1,1,0,0,0,0-1.42L9.41,13H17a1,1,0,0,0,0-2Z"/></svg>', r = '<svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" viewBox="0 0 24 24"><path d="M17.92,11.62a1,1,0,0,0-.21-.33l-5-5a1,1,0,0,0-1.42,1.42L14.59,11H7a1,1,0,0,0,0,2h7.59l-3.3,3.29a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0l5-5a1,1,0,0,0,.21-.33A1,1,0,0,0,17.92,11.62Z"/></svg>', v = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20,6H16V5a3,3,0,0,0-3-3H11A3,3,0,0,0,8,5V6H4A1,1,0,0,0,4,8H5V19a3,3,0,0,0,3,3h8a3,3,0,0,0,3-3V8h1a1,1,0,0,0,0-2ZM10,5a1,1,0,0,1,1-1h2a1,1,0,0,1,1,1V6H10Zm7,14a1,1,0,0,1-1,1H8a1,1,0,0,1-1-1V8H17Z"/></svg>', p = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21.71,2.29a1,1,0,0,0-1.42,0L14.5,8.09V6.5a1,1,0,0,0-2,0v4a1,1,0,0,0,.08.38,1,1,0,0,0,.54.54,1,1,0,0,0,.38.08h4a1,1,0,0,0,0-2H15.91l5.8-5.79A1,1,0,0,0,21.71,2.29ZM10.88,12.58a1,1,0,0,0-.38-.08h-4a1,1,0,0,0,0,2H8.09l-5.8,5.79a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0l5.79-5.8V17.5a1,1,0,0,0,2,0v-4a1,1,0,0,0-.08-.38A1,1,0,0,0,10.88,12.58Z"/></svg>', A = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.79,12.79,4,18.59V17a1,1,0,0,0-2,0v4a1,1,0,0,0,.08.38,1,1,0,0,0,.54.54A1,1,0,0,0,3,22H7a1,1,0,0,0,0-2H5.41l5.8-5.79a1,1,0,0,0-1.42-1.42ZM21.92,2.62a1,1,0,0,0-.54-.54A1,1,0,0,0,21,2H17a1,1,0,0,0,0,2h1.59l-5.8,5.79a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0L20,5.41V7a1,1,0,0,0,2,0V3A1,1,0,0,0,21.92,2.62Z"/></svg>', m = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21,8.94a1.31,1.31,0,0,0-.06-.27l0-.09a1.07,1.07,0,0,0-.19-.28h0l-6-6h0a1.07,1.07,0,0,0-.28-.19.32.32,0,0,0-.09,0A.88.88,0,0,0,14.05,2H10A3,3,0,0,0,7,5V6H6A3,3,0,0,0,3,9V19a3,3,0,0,0,3,3h8a3,3,0,0,0,3-3V18h1a3,3,0,0,0,3-3V9S21,9,21,8.94ZM15,5.41,17.59,8H16a1,1,0,0,1-1-1ZM15,19a1,1,0,0,1-1,1H6a1,1,0,0,1-1-1V9A1,1,0,0,1,6,8H7v7a3,3,0,0,0,3,3h5Zm4-4a1,1,0,0,1-1,1H10a1,1,0,0,1-1-1V5a1,1,0,0,1,1-1h3V7a3,3,0,0,0,3,3h3Z"/></svg>', c = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21.3,10.08A3,3,0,0,0,19,9H14.44L15,7.57A4.13,4.13,0,0,0,11.11,2a1,1,0,0,0-.91.59L7.35,9H5a3,3,0,0,0-3,3v7a3,3,0,0,0,3,3H17.73a3,3,0,0,0,2.95-2.46l1.27-7A3,3,0,0,0,21.3,10.08ZM7,20H5a1,1,0,0,1-1-1V12a1,1,0,0,1,1-1H7Zm13-7.82-1.27,7a1,1,0,0,1-1,.82H9V10.21l2.72-6.12A2.11,2.11,0,0,1,13.1,6.87L12.57,8.3A2,2,0,0,0,14.44,11H19a1,1,0,0,1,.77.36A1,1,0,0,1,20,12.18Z"/></svg>', H = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19,2H6.27A3,3,0,0,0,3.32,4.46l-1.27,7A3,3,0,0,0,5,15H9.56L9,16.43A4.13,4.13,0,0,0,12.89,22a1,1,0,0,0,.91-.59L16.65,15H19a3,3,0,0,0,3-3V5A3,3,0,0,0,19,2ZM15,13.79l-2.72,6.12a2.13,2.13,0,0,1-1.38-2.78l.53-1.43A2,2,0,0,0,9.56,13H5a1,1,0,0,1-.77-.36A1,1,0,0,1,4,11.82l1.27-7a1,1,0,0,1,1-.82H15ZM20,12a1,1,0,0,1-1,1H17V4h2a1,1,0,0,1,1,1Z"/></svg>', Z = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.71,12.71a1,1,0,0,0,.21-.33,1,1,0,0,0,0-.76,1,1,0,0,0-.21-.33l-3-3a1,1,0,0,0-1.42,1.42L12.59,11H9a1,1,0,0,0,0,2h3.59l-1.3,1.29a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0ZM22,12A10,10,0,1,0,12,22,10,10,0,0,0,22,12ZM4,12a8,8,0,1,1,8,8A8,8,0,0,1,4,12Z"/></svg>', x = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21.92,11.6C19.9,6.91,16.1,4,12,4S4.1,6.91,2.08,11.6a1,1,0,0,0,0,.8C4.1,17.09,7.9,20,12,20s7.9-2.91,9.92-7.6A1,1,0,0,0,21.92,11.6ZM12,18c-3.17,0-6.17-2.29-7.9-6C5.83,8.29,8.83,6,12,6s6.17,2.29,7.9,6C18.17,15.71,15.17,18,12,18ZM12,8a4,4,0,1,0,4,4A4,4,0,0,0,12,8Zm0,6a2,2,0,1,1,2-2A2,2,0,0,1,12,14Z"/></svg>', V = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10.94,6.08A6.93,6.93,0,0,1,12,6c3.18,0,6.17,2.29,7.91,6a15.23,15.23,0,0,1-.9,1.64,1,1,0,0,0-.16.55,1,1,0,0,0,1.86.5,15.77,15.77,0,0,0,1.21-2.3,1,1,0,0,0,0-.79C19.9,6.91,16.1,4,12,4a7.77,7.77,0,0,0-1.4.12,1,1,0,1,0,.34,2ZM3.71,2.29A1,1,0,0,0,2.29,3.71L5.39,6.8a14.62,14.62,0,0,0-3.31,4.8,1,1,0,0,0,0,.8C4.1,17.09,7.9,20,12,20a9.26,9.26,0,0,0,5.05-1.54l3.24,3.25a1,1,0,0,0,1.42,0,1,1,0,0,0,0-1.42Zm6.36,9.19,2.45,2.45A1.81,1.81,0,0,1,12,14a2,2,0,0,1-2-2A1.81,1.81,0,0,1,10.07,11.48ZM12,18c-3.18,0-6.17-2.29-7.9-6A12.09,12.09,0,0,1,6.8,8.21L8.57,10A4,4,0,0,0,14,15.43L15.59,17A7.24,7.24,0,0,1,12,18Z"/></svg>', M = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21.71,20.29,18,16.61A9,9,0,1,0,16.61,18l3.68,3.68a1,1,0,0,0,1.42,0A1,1,0,0,0,21.71,20.29ZM11,18a7,7,0,1,1,7-7A7,7,0,0,1,11,18Z"/></svg>', u = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21,11H9.41l2.3-2.29a1,1,0,1,0-1.42-1.42l-4,4a1,1,0,0,0-.21.33,1,1,0,0,0,0,.76,1,1,0,0,0,.21.33l4,4a1,1,0,0,0,1.42,0,1,1,0,0,0,0-1.42L9.41,13H21a1,1,0,0,0,0-2ZM3,3A1,1,0,0,0,2,4V20a1,1,0,0,0,2,0V4A1,1,0,0,0,3,3Z"/></svg>', d = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.71,11.29l-4-4a1,1,0,1,0-1.42,1.42L14.59,11H3a1,1,0,0,0,0,2H14.59l-2.3,2.29a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0l4-4a1,1,0,0,0,.21-.33,1,1,0,0,0,0-.76A1,1,0,0,0,17.71,11.29ZM21,4a1,1,0,0,0-1,1V19a1,1,0,0,0,2,0V5A1,1,0,0,0,21,4Z"/></svg>', L = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M16.37,12.79a1,1,0,0,0-.74,1.86C17.09,15.23,18,16.13,18,17c0,1.42-2.46,3-6,3s-6-1.58-6-3c0-.87.91-1.77,2.37-2.35a1,1,0,0,0-.74-1.86C5.36,13.69,4,15.26,4,17c0,2.8,3.51,5,8,5s8-2.2,8-5C20,15.26,18.64,13.69,16.37,12.79ZM11,9.86V17a1,1,0,0,0,2,0V9.86a4,4,0,1,0-2,0ZM12,4a2,2,0,1,1-2,2A2,2,0,0,1,12,4Z"/></svg>', B = {
|
|
4
|
+
"uil-times": g,
|
|
5
5
|
"uil-angle-down": h,
|
|
6
6
|
"uil-calendar": i,
|
|
7
|
-
"uil-arrow-left":
|
|
8
|
-
"uil-arrow-right":
|
|
7
|
+
"uil-arrow-left": n,
|
|
8
|
+
"uil-arrow-right": r,
|
|
9
9
|
"uil-trash": v,
|
|
10
|
-
"uil-compress-alt":
|
|
11
|
-
"uil-expand-alt":
|
|
12
|
-
"uil-copy":
|
|
10
|
+
"uil-compress-alt": p,
|
|
11
|
+
"uil-expand-alt": A,
|
|
12
|
+
"uil-copy": m,
|
|
13
13
|
"uil-thumbs-up": c,
|
|
14
|
-
"uil-thumbs-down":
|
|
15
|
-
"uil-arrow-circle-right":
|
|
14
|
+
"uil-thumbs-down": H,
|
|
15
|
+
"uil-arrow-circle-right": Z,
|
|
16
|
+
"uil-eye": x,
|
|
17
|
+
"uil-eye-slash": V,
|
|
18
|
+
"uil-search": M,
|
|
19
|
+
"uil-left-arrow-to-left": u,
|
|
20
|
+
"uil-right-arrow-to-right": d,
|
|
21
|
+
"uil-pin": L
|
|
16
22
|
}, a = class a extends l {
|
|
17
23
|
constructor() {
|
|
18
24
|
super(...arguments), this.name = "", this.size = 20;
|
|
19
25
|
}
|
|
20
26
|
render() {
|
|
21
|
-
const
|
|
22
|
-
return
|
|
27
|
+
const t = B[this.name];
|
|
28
|
+
return t ? w`
|
|
23
29
|
<span
|
|
24
30
|
style="font-size: ${this.size}px;"
|
|
25
31
|
aria-hidden="true"
|
|
26
32
|
>
|
|
27
|
-
${
|
|
33
|
+
${o(t)}
|
|
28
34
|
</span>
|
|
29
|
-
` : (console.warn(`Icon "${this.name}" not found.`),
|
|
35
|
+
` : (console.warn(`Icon "${this.name}" not found.`), w``);
|
|
30
36
|
}
|
|
31
37
|
};
|
|
32
38
|
a.properties = {
|
|
33
39
|
name: { type: String },
|
|
34
40
|
size: { type: Number }
|
|
35
|
-
}, a.styles =
|
|
41
|
+
}, a.styles = e`
|
|
36
42
|
:host {
|
|
37
43
|
display: inline-flex;
|
|
38
44
|
align-items: center;
|
|
@@ -47,5 +53,5 @@ a.properties = {
|
|
|
47
53
|
fill: currentColor;
|
|
48
54
|
}
|
|
49
55
|
`;
|
|
50
|
-
let
|
|
51
|
-
customElements.define("ui-icon",
|
|
56
|
+
let s = a;
|
|
57
|
+
customElements.define("ui-icon", s);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";const a=require("lit"),
|
|
1
|
+
"use strict";const a=require("lit"),e=require("lit/directives/unsafe-html.js"),l='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13.41,12l4.3-4.29a1,1,0,1,0-1.42-1.42L12,10.59,7.71,6.29A1,1,0,0,0,6.29,7.71L10.59,12l-4.3,4.29a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0L12,13.41l4.29,4.3a1,1,0,0,0,1.42,0,1,1,0,0,0,0-1.42Z"/></svg>',o='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17,9.17a1,1,0,0,0-1.41,0L12,12.71,8.46,9.17a1,1,0,0,0-1.41,0,1,1,0,0,0,0,1.42l4.24,4.24a1,1,0,0,0,1.42,0L17,10.59A1,1,0,0,0,17,9.17Z"/></svg>',g='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19,4H17V3a1,1,0,0,0-2,0V4H9V3A1,1,0,0,0,7,3V4H5A3,3,0,0,0,2,7V19a3,3,0,0,0,3,3H19a3,3,0,0,0,3-3V7A3,3,0,0,0,19,4Zm1,15a1,1,0,0,1-1,1H5a1,1,0,0,1-1-1V12H20Zm0-9H4V7A1,1,0,0,1,5,6H7V7A1,1,0,0,0,9,7V6h6V7a1,1,0,0,0,2,0V6h2a1,1,0,0,1,1,1Z"/></svg>',h='<svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" viewBox="0 0 24 24"><path d="M17,11H9.41l3.3-3.29a1,1,0,1,0-1.42-1.42l-5,5a1,1,0,0,0-.21.33,1,1,0,0,0,0,.76,1,1,0,0,0,.21.33l5,5a1,1,0,0,0,1.42,0,1,1,0,0,0,0-1.42L9.41,13H17a1,1,0,0,0,0-2Z"/></svg>',n='<svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" viewBox="0 0 24 24"><path d="M17.92,11.62a1,1,0,0,0-.21-.33l-5-5a1,1,0,0,0-1.42,1.42L14.59,11H7a1,1,0,0,0,0,2h7.59l-3.3,3.29a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0l5-5a1,1,0,0,0,.21-.33A1,1,0,0,0,17.92,11.62Z"/></svg>',i='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20,6H16V5a3,3,0,0,0-3-3H11A3,3,0,0,0,8,5V6H4A1,1,0,0,0,4,8H5V19a3,3,0,0,0,3,3h8a3,3,0,0,0,3-3V8h1a1,1,0,0,0,0-2ZM10,5a1,1,0,0,1,1-1h2a1,1,0,0,1,1,1V6H10Zm7,14a1,1,0,0,1-1,1H8a1,1,0,0,1-1-1V8H17Z"/></svg>',r='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21.71,2.29a1,1,0,0,0-1.42,0L14.5,8.09V6.5a1,1,0,0,0-2,0v4a1,1,0,0,0,.08.38,1,1,0,0,0,.54.54,1,1,0,0,0,.38.08h4a1,1,0,0,0,0-2H15.91l5.8-5.79A1,1,0,0,0,21.71,2.29ZM10.88,12.58a1,1,0,0,0-.38-.08h-4a1,1,0,0,0,0,2H8.09l-5.8,5.79a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0l5.79-5.8V17.5a1,1,0,0,0,2,0v-4a1,1,0,0,0-.08-.38A1,1,0,0,0,10.88,12.58Z"/></svg>',v='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.79,12.79,4,18.59V17a1,1,0,0,0-2,0v4a1,1,0,0,0,.08.38,1,1,0,0,0,.54.54A1,1,0,0,0,3,22H7a1,1,0,0,0,0-2H5.41l5.8-5.79a1,1,0,0,0-1.42-1.42ZM21.92,2.62a1,1,0,0,0-.54-.54A1,1,0,0,0,21,2H17a1,1,0,0,0,0,2h1.59l-5.8,5.79a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0L20,5.41V7a1,1,0,0,0,2,0V3A1,1,0,0,0,21.92,2.62Z"/></svg>',p='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21,8.94a1.31,1.31,0,0,0-.06-.27l0-.09a1.07,1.07,0,0,0-.19-.28h0l-6-6h0a1.07,1.07,0,0,0-.28-.19.32.32,0,0,0-.09,0A.88.88,0,0,0,14.05,2H10A3,3,0,0,0,7,5V6H6A3,3,0,0,0,3,9V19a3,3,0,0,0,3,3h8a3,3,0,0,0,3-3V18h1a3,3,0,0,0,3-3V9S21,9,21,8.94ZM15,5.41,17.59,8H16a1,1,0,0,1-1-1ZM15,19a1,1,0,0,1-1,1H6a1,1,0,0,1-1-1V9A1,1,0,0,1,6,8H7v7a3,3,0,0,0,3,3h5Zm4-4a1,1,0,0,1-1,1H10a1,1,0,0,1-1-1V5a1,1,0,0,1,1-1h3V7a3,3,0,0,0,3,3h3Z"/></svg>',A='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21.3,10.08A3,3,0,0,0,19,9H14.44L15,7.57A4.13,4.13,0,0,0,11.11,2a1,1,0,0,0-.91.59L7.35,9H5a3,3,0,0,0-3,3v7a3,3,0,0,0,3,3H17.73a3,3,0,0,0,2.95-2.46l1.27-7A3,3,0,0,0,21.3,10.08ZM7,20H5a1,1,0,0,1-1-1V12a1,1,0,0,1,1-1H7Zm13-7.82-1.27,7a1,1,0,0,1-1,.82H9V10.21l2.72-6.12A2.11,2.11,0,0,1,13.1,6.87L12.57,8.3A2,2,0,0,0,14.44,11H19a1,1,0,0,1,.77.36A1,1,0,0,1,20,12.18Z"/></svg>',c='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19,2H6.27A3,3,0,0,0,3.32,4.46l-1.27,7A3,3,0,0,0,5,15H9.56L9,16.43A4.13,4.13,0,0,0,12.89,22a1,1,0,0,0,.91-.59L16.65,15H19a3,3,0,0,0,3-3V5A3,3,0,0,0,19,2ZM15,13.79l-2.72,6.12a2.13,2.13,0,0,1-1.38-2.78l.53-1.43A2,2,0,0,0,9.56,13H5a1,1,0,0,1-.77-.36A1,1,0,0,1,4,11.82l1.27-7a1,1,0,0,1,1-.82H15ZM20,12a1,1,0,0,1-1,1H17V4h2a1,1,0,0,1,1,1Z"/></svg>',m='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.71,12.71a1,1,0,0,0,.21-.33,1,1,0,0,0,0-.76,1,1,0,0,0-.21-.33l-3-3a1,1,0,0,0-1.42,1.42L12.59,11H9a1,1,0,0,0,0,2h3.59l-1.3,1.29a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0ZM22,12A10,10,0,1,0,12,22,10,10,0,0,0,22,12ZM4,12a8,8,0,1,1,8,8A8,8,0,0,1,4,12Z"/></svg>',H='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21.92,11.6C19.9,6.91,16.1,4,12,4S4.1,6.91,2.08,11.6a1,1,0,0,0,0,.8C4.1,17.09,7.9,20,12,20s7.9-2.91,9.92-7.6A1,1,0,0,0,21.92,11.6ZM12,18c-3.17,0-6.17-2.29-7.9-6C5.83,8.29,8.83,6,12,6s6.17,2.29,7.9,6C18.17,15.71,15.17,18,12,18ZM12,8a4,4,0,1,0,4,4A4,4,0,0,0,12,8Zm0,6a2,2,0,1,1,2-2A2,2,0,0,1,12,14Z"/></svg>',Z='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10.94,6.08A6.93,6.93,0,0,1,12,6c3.18,0,6.17,2.29,7.91,6a15.23,15.23,0,0,1-.9,1.64,1,1,0,0,0-.16.55,1,1,0,0,0,1.86.5,15.77,15.77,0,0,0,1.21-2.3,1,1,0,0,0,0-.79C19.9,6.91,16.1,4,12,4a7.77,7.77,0,0,0-1.4.12,1,1,0,1,0,.34,2ZM3.71,2.29A1,1,0,0,0,2.29,3.71L5.39,6.8a14.62,14.62,0,0,0-3.31,4.8,1,1,0,0,0,0,.8C4.1,17.09,7.9,20,12,20a9.26,9.26,0,0,0,5.05-1.54l3.24,3.25a1,1,0,0,0,1.42,0,1,1,0,0,0,0-1.42Zm6.36,9.19,2.45,2.45A1.81,1.81,0,0,1,12,14a2,2,0,0,1-2-2A1.81,1.81,0,0,1,10.07,11.48ZM12,18c-3.18,0-6.17-2.29-7.9-6A12.09,12.09,0,0,1,6.8,8.21L8.57,10A4,4,0,0,0,14,15.43L15.59,17A7.24,7.24,0,0,1,12,18Z"/></svg>',x='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21.71,20.29,18,16.61A9,9,0,1,0,16.61,18l3.68,3.68a1,1,0,0,0,1.42,0A1,1,0,0,0,21.71,20.29ZM11,18a7,7,0,1,1,7-7A7,7,0,0,1,11,18Z"/></svg>',u='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21,11H9.41l2.3-2.29a1,1,0,1,0-1.42-1.42l-4,4a1,1,0,0,0-.21.33,1,1,0,0,0,0,.76,1,1,0,0,0,.21.33l4,4a1,1,0,0,0,1.42,0,1,1,0,0,0,0-1.42L9.41,13H21a1,1,0,0,0,0-2ZM3,3A1,1,0,0,0,2,4V20a1,1,0,0,0,2,0V4A1,1,0,0,0,3,3Z"/></svg>',V='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.71,11.29l-4-4a1,1,0,1,0-1.42,1.42L14.59,11H3a1,1,0,0,0,0,2H14.59l-2.3,2.29a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0l4-4a1,1,0,0,0,.21-.33,1,1,0,0,0,0-.76A1,1,0,0,0,17.71,11.29ZM21,4a1,1,0,0,0-1,1V19a1,1,0,0,0,2,0V5A1,1,0,0,0,21,4Z"/></svg>',M='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M16.37,12.79a1,1,0,0,0-.74,1.86C17.09,15.23,18,16.13,18,17c0,1.42-2.46,3-6,3s-6-1.58-6-3c0-.87.91-1.77,2.37-2.35a1,1,0,0,0-.74-1.86C5.36,13.69,4,15.26,4,17c0,2.8,3.51,5,8,5s8-2.2,8-5C20,15.26,18.64,13.69,16.37,12.79ZM11,9.86V17a1,1,0,0,0,2,0V9.86a4,4,0,1,0-2,0ZM12,4a2,2,0,1,1-2,2A2,2,0,0,1,12,4Z"/></svg>',d={"uil-times":l,"uil-angle-down":o,"uil-calendar":g,"uil-arrow-left":h,"uil-arrow-right":n,"uil-trash":i,"uil-compress-alt":r,"uil-expand-alt":v,"uil-copy":p,"uil-thumbs-up":A,"uil-thumbs-down":c,"uil-arrow-circle-right":m,"uil-eye":H,"uil-eye-slash":Z,"uil-search":x,"uil-left-arrow-to-left":u,"uil-right-arrow-to-right":V,"uil-pin":M},s=class s extends a.LitElement{constructor(){super(...arguments),this.name="",this.size=20}render(){const w=d[this.name];return w?a.html`
|
|
2
2
|
<span
|
|
3
3
|
style="font-size: ${this.size}px;"
|
|
4
4
|
aria-hidden="true"
|
|
5
5
|
>
|
|
6
|
-
${
|
|
6
|
+
${e.unsafeHTML(w)}
|
|
7
7
|
</span>
|
|
8
|
-
`:(console.warn(`Icon "${this.name}" not found.`),a.html``)}};
|
|
8
|
+
`:(console.warn(`Icon "${this.name}" not found.`),a.html``)}};s.properties={name:{type:String},size:{type:Number}},s.styles=a.css`
|
|
9
9
|
:host {
|
|
10
10
|
display: inline-flex;
|
|
11
11
|
align-items: center;
|
|
@@ -19,4 +19,4 @@
|
|
|
19
19
|
height: 1em;
|
|
20
20
|
fill: currentColor;
|
|
21
21
|
}
|
|
22
|
-
`;let s
|
|
22
|
+
`;let t=s;customElements.define("ui-icon",t);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logosphere-ui/core",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.13",
|
|
4
4
|
"description": "A modern, framework-agnostic UI component library built with Lit and Web Components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -35,6 +35,11 @@
|
|
|
35
35
|
"import": "./dist/chatbot.js",
|
|
36
36
|
"require": "./dist/chatbot.cjs"
|
|
37
37
|
},
|
|
38
|
+
"./calendar": {
|
|
39
|
+
"types": "./dist/organisms/Calendar/index.d.ts",
|
|
40
|
+
"import": "./dist/calendar.js",
|
|
41
|
+
"require": "./dist/calendar.cjs"
|
|
42
|
+
},
|
|
38
43
|
"./popover": {
|
|
39
44
|
"types": "./dist/molecules/Popover/index.d.ts",
|
|
40
45
|
"import": "./dist/popover.js",
|
|
@@ -80,11 +85,21 @@
|
|
|
80
85
|
"import": "./dist/download-manager.js",
|
|
81
86
|
"require": "./dist/download-manager.cjs"
|
|
82
87
|
},
|
|
88
|
+
"./left-menu": {
|
|
89
|
+
"types": "./dist/organisms/LeftMenu/index.d.ts",
|
|
90
|
+
"import": "./dist/left-menu.js",
|
|
91
|
+
"require": "./dist/left-menu.cjs"
|
|
92
|
+
},
|
|
83
93
|
"./tab": {
|
|
84
94
|
"types": "./dist/organisms/Tab/index.d.ts",
|
|
85
95
|
"import": "./dist/tab.js",
|
|
86
96
|
"require": "./dist/tab.cjs"
|
|
87
97
|
},
|
|
98
|
+
"./tree-menu": {
|
|
99
|
+
"types": "./dist/organisms/TreeMenu/index.d.ts",
|
|
100
|
+
"import": "./dist/tree-menu.js",
|
|
101
|
+
"require": "./dist/tree-menu.cjs"
|
|
102
|
+
},
|
|
88
103
|
"./styles/main.css": "./dist/styles/main.css"
|
|
89
104
|
},
|
|
90
105
|
"keywords": [
|