kempo-ui 0.0.7 → 0.0.8
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/src/components/Icon.js +1 -1
- package/dist/src/components/ShadowComponent.js +1 -1
- package/dist/src/components/Tree.js +37 -0
- package/docs/components/accordion.html +3 -9
- package/docs/components/card.html +3 -9
- package/docs/components/collapsible.html +3 -9
- package/docs/components/content-slider.html +3 -9
- package/docs/components/dialog.html +4 -151
- package/docs/components/focus-capture.html +3 -7
- package/docs/components/hybrid-component.html +3 -7
- package/docs/components/icon.html +1 -6
- package/docs/components/import.html +1 -6
- package/docs/components/init.js +7 -0
- package/docs/components/light-component.html +3 -7
- package/docs/components/persistant-collapsible.html +1 -8
- package/docs/components/photo-viewer.html +1 -8
- package/docs/components/resize.html +3 -9
- package/docs/components/shadow-component.html +3 -7
- package/docs/components/show-more.html +3 -9
- package/docs/components/side-menu.html +1 -6
- package/docs/components/sortable.html +3 -7
- package/docs/components/split.html +3 -7
- package/docs/components/table.html +3 -7
- package/docs/components/tableControls.html +3 -7
- package/docs/components/tableCustomFields.html +3 -7
- package/docs/components/tableFetchRecords.html +3 -7
- package/docs/components/tableFieldSortHide.html +3 -7
- package/docs/components/tablePagination.html +3 -7
- package/docs/components/tableRecordEditing.html +3 -7
- package/docs/components/tableRecordFiltering.html +3 -7
- package/docs/components/tableRecordHiding.html +3 -7
- package/docs/components/tableRecordSearching.html +3 -7
- package/docs/components/tableRecordSelection.html +3 -7
- package/docs/components/tableRowControls.html +3 -7
- package/docs/components/tableSorting.html +3 -7
- package/docs/components/tabs.html +3 -9
- package/docs/components/tags.html +3 -9
- package/docs/components/theme-switcher.html +3 -9
- package/docs/components/timestamp.html +3 -9
- package/docs/components/toast.html +4 -272
- package/docs/components/toggle.html +3 -9
- package/docs/components/tree.html +108 -21
- package/docs/index.html +10 -6
- package/docs/init.js +7 -0
- package/docs/src/components/Icon.js +1 -1
- package/docs/src/components/ShadowComponent.js +1 -1
- package/docs/src/components/Tree.js +37 -0
- package/docs/utils/debounce.html +1 -6
- package/docs/utils/drag.html +1 -6
- package/docs/utils/formatTimestamp.html +1 -6
- package/docs/utils/init.js +7 -0
- package/docs/utils/propConverters.html +1 -6
- package/docs/utils/toTitleCase.html +1 -6
- package/docs/utils/watchWindowSize.html +1 -6
- package/package.json +1 -1
- package/scripts/build.js +12 -2
- package/scripts/fix-docs-paths.js +62 -0
- package/src/components/Tree.js +64 -72
|
@@ -7,4 +7,4 @@ import ShadowComponent from"./ShadowComponent.js";import{html,css,unsafeHTML}fro
|
|
|
7
7
|
height: 1.35em;
|
|
8
8
|
vertical-align: middle;
|
|
9
9
|
}
|
|
10
|
-
`;render(){return this.iconContent?html`${unsafeHTML(this.iconContent)}`:html`<slot></slot>`}static pathToIcons=["
|
|
10
|
+
`;render(){return this.iconContent?html`${unsafeHTML(this.iconContent)}`:html`<slot></slot>`}static pathToIcons=["./icons"];static fallback='\n\t\t<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M480-79q-16 0-30.5-6T423-102L102-423q-11-12-17-26.5T79-480q0-16 6-31t17-26l321-321q12-12 26.5-17.5T480-881q16 0 31 5.5t26 17.5l321 321q12 11 17.5 26t5.5 31q0 16-5.5 30.5T858-423L537-102q-11 11-26 17t-31 6Zm0-80 321-321-321-321-321 321 321 321Zm-40-281h80v-240h-80v240Zm40 120q17 0 28.5-11.5T520-360q0-17-11.5-28.5T480-400q-17 0-28.5 11.5T440-360q0 17 11.5 28.5T480-320Zm0-160Z"/></svg>\n\t'}window.customElements.define("k-icon",Icon);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{LitElement}from"../lit-all.min.js";export default class ShadowComponent extends LitElement{static stylesheetPath="
|
|
1
|
+
import{LitElement}from"../lit-all.min.js";export default class ShadowComponent extends LitElement{static stylesheetPath="./kempo.min.css";createRenderRoot(){const t=this.attachShadow({mode:"open"}),e=document.createElement("link");e.rel="stylesheet",e.href=this.constructor.stylesheetPath,t.appendChild(e);const n=this.constructor.styles;if(n){const e=document.createElement("style");Array.isArray(n)?e.textContent=n.map(t=>t.cssText||t).join("\n"):e.textContent=n.cssText||n,t.appendChild(e)}const s=document.createElement("div");return s.style.display="contents",t.appendChild(s),s}}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import ShadowComponent from"./ShadowComponent.js";import{html,css,render}from"../lit-all.min.js";import{boolExists}from"../utils/propConverters.js";import"./Icon.js";export default class Tree extends ShadowComponent{static properties={data:{type:Object},depth:{type:Number,reflect:!0},editable:{type:Boolean,converter:boolExists,attribute:"editable",reflect:!0}};constructor(){super(),this.data=null,this.depth=0,this.editable=!1}render(){return this.data?"object"==typeof this.data&&null!==this.data?html`
|
|
2
|
+
<div class="tree-root">
|
|
3
|
+
${(Array.isArray(this.data)?this.data.map((e,t)=>[t,e]):Object.entries(this.data)).map(([e,t])=>Tree.renderValue(t,e,1,this.depth))}
|
|
4
|
+
</div>
|
|
5
|
+
`:html`
|
|
6
|
+
<div class="tree-root">
|
|
7
|
+
${Tree.renderValue(this.data,null,0,this.depth)}
|
|
8
|
+
</div>
|
|
9
|
+
`:html`<slot></slot>`}static leafs=[];static addLeaf=(...e)=>{e.forEach(e=>Tree.leafs.unshift(e))};static renderValue(e,t=null,s=0,r=0){const a=Tree.leafs.find(t=>t.detect(e));if(a){const s=document.createElement("span");if(s.className="d-b",null!==t){const e=document.createElement("span");e.className="number"==typeof t?"tc-muted":"",e.textContent=`${t}: `,s.appendChild(e)}const r=new a(e).render();if(r instanceof Node)s.appendChild(r);else{const e=document.createElement("span");render(r,e),s.appendChild(e)}return s}if("object"==typeof e&&null!==e){const a=new TreeBranch;return a.value=e,a.key=t,a.currentDepth=s,a.maxDepth=r,a}return html`<span class="d-b primitive">${null!==t?html`<span class="${"number"==typeof t?"tc-muted":""}">${t}: </span>`:""}${e}</span>`}}window.customElements.define("k-tree",Tree);export class TreeBranch extends ShadowComponent{static properties={value:{type:Object},key:{type:String},currentDepth:{type:Number},maxDepth:{type:Number},opened:{type:Boolean,converter:boolExists,reflect:!0}};constructor(){super(),this.value=null,this.key=null,this.currentDepth=0,this.maxDepth=0,this.opened=!1}connectedCallback(){super.connectedCallback(),this.currentDepth<=this.maxDepth&&(this.opened=!0)}get tree(){return this.closest("k-tree")}toggle=()=>{this.opened=!this.opened};render(){const e=null!==this.key?`${this.key}: `:"",t=Array.isArray(this.value)?"Array":"Object";return html`
|
|
10
|
+
<div>
|
|
11
|
+
<div class="branch-label" @click=${this.toggle}>
|
|
12
|
+
<k-icon name="chevron-right" class="toggle-icon ${this.opened?"opened":""}"></k-icon>
|
|
13
|
+
${e}${t}
|
|
14
|
+
</div>
|
|
15
|
+
${this.opened?html`
|
|
16
|
+
<div class="pl">
|
|
17
|
+
${this.value?(Array.isArray(this.value)?this.value.map((e,t)=>[t,e]):Object.entries(this.value)).map(([e,t])=>Tree.renderValue(t,e,this.currentDepth+1,this.maxDepth)):""}
|
|
18
|
+
</div>
|
|
19
|
+
`:""}
|
|
20
|
+
</div>
|
|
21
|
+
`}static styles=css`
|
|
22
|
+
:host{
|
|
23
|
+
display: block;
|
|
24
|
+
}
|
|
25
|
+
.branch-label{
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
}
|
|
28
|
+
.branch-label:hover{
|
|
29
|
+
background-color: var(--c_bg__alt, #f5f5f5);
|
|
30
|
+
}
|
|
31
|
+
.toggle-icon{
|
|
32
|
+
transition: transform var(--animation_ms, 200ms);
|
|
33
|
+
}
|
|
34
|
+
.toggle-icon.opened{
|
|
35
|
+
transform: rotate(90deg);
|
|
36
|
+
}
|
|
37
|
+
`}window.customElements.define("k-tree-branch",TreeBranch);export class TreeLeaf{constructor(e=null){this.value=e}render(){return html`${this.value}`}static detect=()=>!1}export class StringLeaf extends TreeLeaf{render(){return html`<span class="tc-success">"${this.value}"</span>`}static detect=e=>"string"==typeof e}export class NumberLeaf extends TreeLeaf{render(){return html`<span class="tc-primary">${this.value}</span>`}static detect=e=>"number"==typeof e}export class BooleanLeaf extends TreeLeaf{render(){return html`<span class="${this.value?"tc-success":"tc-danger"}">${this.value}</span>`}static detect=e=>"boolean"==typeof e}export class NullLeaf extends TreeLeaf{render(){return html`<span class="tc-muted">null</span>`}static detect=e=>null===e}export class UndefinedLeaf extends TreeLeaf{render(){return html`<span class="tc-muted">undefined</span>`}static detect=e=>void 0===e}Tree.addLeaf(UndefinedLeaf,NullLeaf,BooleanLeaf,NumberLeaf,StringLeaf);
|
|
@@ -5,15 +5,9 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Accordion - Components - Kempo Docs - A Web Components Solution</title>
|
|
7
7
|
<link rel="stylesheet" href="../src/kempo-vars.css" /><link rel="stylesheet" href="../kempo.min.css" />
|
|
8
|
-
<link rel="stylesheet" href="../src/kempo-hljs.css"
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
import Import from '../src/components/Import.js';
|
|
12
|
-
import Icon from '../src/components/Icon.js';
|
|
13
|
-
ShadowComponent.stylesheetPath = '../kempo.min.css';
|
|
14
|
-
Import.replacements.root = '../';
|
|
15
|
-
Icon.pathToIcons = ['../icons'];
|
|
16
|
-
</script>
|
|
8
|
+
<link rel="stylesheet" href="../src/kempo-hljs.css" />
|
|
9
|
+
<link rel="stylesheet" href="../styles.css" />
|
|
10
|
+
<script type="module" src="./init.js"></script>
|
|
17
11
|
</head>
|
|
18
12
|
<body>
|
|
19
13
|
<k-import src="../nav.inc.html"></k-import>
|
|
@@ -5,15 +5,9 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Card - Components - Kempo Docs - A Web Components Solution</title>
|
|
7
7
|
<link rel="stylesheet" href="../src/kempo-vars.css" /><link rel="stylesheet" href="../kempo.min.css" />
|
|
8
|
-
<link rel="stylesheet" href="../src/kempo-hljs.css"
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
import Import from '../src/components/Import.js';
|
|
12
|
-
import Icon from '../src/components/Icon.js';
|
|
13
|
-
ShadowComponent.stylesheetPath = '../kempo.min.css';
|
|
14
|
-
Import.replacements.root = '../';
|
|
15
|
-
Icon.pathToIcons = ['../icons'];
|
|
16
|
-
</script>
|
|
8
|
+
<link rel="stylesheet" href="../src/kempo-hljs.css" />
|
|
9
|
+
<link rel="stylesheet" href="../styles.css" />
|
|
10
|
+
<script type="module" src="./init.js"></script>
|
|
17
11
|
</head>
|
|
18
12
|
<body>
|
|
19
13
|
<k-import src="../nav.inc.html"></k-import>
|
|
@@ -5,15 +5,9 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Collapsible - Components - Kempo Docs - A Web Components Solution</title>
|
|
7
7
|
<link rel="stylesheet" href="../src/kempo-vars.css" /><link rel="stylesheet" href="../kempo.min.css" />
|
|
8
|
-
<link rel="stylesheet" href="../src/kempo-hljs.css"
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
import Import from '../src/components/Import.js';
|
|
12
|
-
import Icon from '../src/components/Icon.js';
|
|
13
|
-
ShadowComponent.stylesheetPath = '../kempo.min.css';
|
|
14
|
-
Import.replacements.root = '../';
|
|
15
|
-
Icon.pathToIcons = ['../icons'];
|
|
16
|
-
</script>
|
|
8
|
+
<link rel="stylesheet" href="../src/kempo-hljs.css" />
|
|
9
|
+
<link rel="stylesheet" href="../styles.css" />
|
|
10
|
+
<script type="module" src="./init.js"></script>
|
|
17
11
|
</head>
|
|
18
12
|
<body>
|
|
19
13
|
<k-import src="../nav.inc.html"></k-import>
|
|
@@ -5,15 +5,9 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Content Slider - Components - Kempo Docs - A Web Components Solution</title>
|
|
7
7
|
<link rel="stylesheet" href="../src/kempo-vars.css" /><link rel="stylesheet" href="../kempo.min.css" />
|
|
8
|
-
<link rel="stylesheet" href="../src/kempo-hljs.css"
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
import Import from '../src/components/Import.js';
|
|
12
|
-
import Icon from '../src/components/Icon.js';
|
|
13
|
-
ShadowComponent.stylesheetPath = '../kempo.min.css';
|
|
14
|
-
Import.replacements.root = '../';
|
|
15
|
-
Icon.pathToIcons = ['../icons'];
|
|
16
|
-
</script>
|
|
8
|
+
<link rel="stylesheet" href="../src/kempo-hljs.css" />
|
|
9
|
+
<link rel="stylesheet" href="../styles.css" />
|
|
10
|
+
<script type="module" src="./init.js"></script>
|
|
17
11
|
</head>
|
|
18
12
|
<body>
|
|
19
13
|
<k-import src="../nav.inc.html"></k-import>
|
|
@@ -5,15 +5,9 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Dialog - Components - Kempo Docs - A Web Components Solution</title>
|
|
7
7
|
<link rel="stylesheet" href="../src/kempo-vars.css" /><link rel="stylesheet" href="../kempo.min.css" />
|
|
8
|
-
<link rel="stylesheet" href="../src/kempo-hljs.css"
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
import Import from '../src/components/Import.js';
|
|
12
|
-
import Icon from '../src/components/Icon.js';
|
|
13
|
-
ShadowComponent.stylesheetPath = '../kempo.min.css';
|
|
14
|
-
Import.replacements.root = '../';
|
|
15
|
-
Icon.pathToIcons = ['../icons'];
|
|
16
|
-
</script>
|
|
8
|
+
<link rel="stylesheet" href="../src/kempo-hljs.css" />
|
|
9
|
+
<link rel="stylesheet" href="../styles.css" />
|
|
10
|
+
<script type="module" src="./init.js"></script>
|
|
17
11
|
</head>
|
|
18
12
|
<body>
|
|
19
13
|
<k-import src="../nav.inc.html"></k-import>
|
|
@@ -96,148 +90,7 @@
|
|
|
96
90
|
<h5>Create Dialog</h5>
|
|
97
91
|
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"d7"</span>></span>Open Dialog<span class="hljs-tag"></<span class="hljs-name">button</span>></span><br /><span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"module"</span>></span><span class="javascript"><br /> <span class="hljs-keyword">import</span> Dialog <span class="hljs-keyword">from</span> <span class="hljs-string">'/src/components/Dialog.js'</span>;<br /> <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'d7'</span>).addEventListener(<span class="hljs-string">'click'</span>, () => {<br /> Dialog.create(<span class="hljs-string">'<p>Hello World</p>'</span>);<br /> });<br /></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span></code></pre>
|
|
98
92
|
<button id="d7" class="mb">Open Dialog</button>
|
|
99
|
-
<script type="module">
|
|
100
|
-
import Dialog from '/src/components/Dialog.js';
|
|
101
|
-
document.getElementById('d7').addEventListener('click', () => {
|
|
102
|
-
Dialog.create('<p>Hello World</p>');
|
|
103
|
-
});
|
|
104
|
-
</script>
|
|
105
|
-
|
|
106
|
-
<h5>Error Dialog</h5>
|
|
107
|
-
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"d8"</span>></span>Open Dialog<span class="hljs-tag"></<span class="hljs-name">button</span>></span><br /><span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"module"</span>></span><span class="javascript"><br /> <span class="hljs-keyword">import</span> Dialog <span class="hljs-keyword">from</span> <span class="hljs-string">'/src/components/Dialog.js'</span>;<br /> <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'d8'</span>).addEventListener(<span class="hljs-string">'click'</span>, () => {<br /> Dialog.error(<span class="hljs-string">"<p>Oh no, don't do that!</p>"</span>);<br /> });<br /></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span></code></pre>
|
|
108
|
-
<button id="d8" class="mb">Open Dialog</button>
|
|
109
|
-
<script type="module">
|
|
110
|
-
import Dialog from '/src/components/Dialog.js';
|
|
111
|
-
document.getElementById('d8').addEventListener('click', () => {
|
|
112
|
-
Dialog.error("Oh no, don't do that!");
|
|
113
|
-
});
|
|
114
|
-
</script>
|
|
115
|
-
|
|
116
|
-
<h3 id="confirmDialog"><a href="#confirmDialog" class="no-link">Confirm Dialog</a></h3>
|
|
117
|
-
<p>Use the <code>Dialog.confirm</code> static method to create a confirmation dialog. This method takes a text message, a response callback, and an options object.</p>
|
|
118
|
-
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"d9"</span>></span>Open Confirm Dialog<span class="hljs-tag"></<span class="hljs-name">button</span>></span><br /><span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"module"</span>></span><span class="javascript"><br /> <span class="hljs-keyword">import</span> Dialog <span class="hljs-keyword">from</span> <span class="hljs-string">'/src/components/Dialog.js'</span>;<br /> <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'d9'</span>).addEventListener(<span class="hljs-string">'click'</span>, () => {<br /> Dialog.confirm(<span class="hljs-string">"Are you sure you want to proceed?"</span>, <span class="hljs-function"><span class="hljs-params">response</span> =></span> {<br /> <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"User response:"</span>, response);<br /> });<br /> });<br /></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span></code></pre>
|
|
119
|
-
<button id="d9" class="mb">Open Confirm Dialog</button>
|
|
120
|
-
<script type="module">
|
|
121
|
-
import Dialog from '/src/components/Dialog.js';
|
|
122
|
-
document.getElementById('d9').addEventListener('click', () => {
|
|
123
|
-
Dialog.confirm("Are you sure you want to proceed?", response => {
|
|
124
|
-
console.log("User response:", response);
|
|
125
|
-
});
|
|
126
|
-
});
|
|
127
|
-
</script>
|
|
128
|
-
|
|
129
|
-
<h2 id="jsRef">JavaScript Reference</h2>
|
|
130
|
-
|
|
131
|
-
<h3 id="constructor"><a href="#constructor" class="no-link">Constructor</a></h3>
|
|
132
|
-
<h6>Extends <a href="./ShadowComponent.html">ShadowComponent</a></h6>
|
|
133
|
-
<h5>
|
|
134
|
-
<code>new Dialog()</code>
|
|
135
|
-
</h5>
|
|
136
|
-
|
|
137
|
-
<h4>Parameters</h4>
|
|
138
|
-
<p>The Dialog constructor takes no parameters. Configuration is done through attributes or properties after instantiation.</p>
|
|
139
|
-
|
|
140
|
-
<h3 id="requirements"><a href="#requirements" class="no-link">Requirements</a></h3>
|
|
141
|
-
<ul>
|
|
142
|
-
<li><a href="./shadow-component.html">ShadowComponent</a></li>
|
|
143
|
-
<li><a href="./icon.html">Icon</a></li>
|
|
144
|
-
</ul>
|
|
145
|
-
|
|
146
|
-
<h3 id="properties"><a href="#properties" class="no-link">Properties</a></h3>
|
|
147
|
-
<h5><code>opened<i>: boolean</i></code></h5>
|
|
148
|
-
<p>Whether the dialog is opened. Syncs with the <code>opened</code> attribute.</p>
|
|
149
|
-
<h5><code>closeBtn<i>: boolean</i></code></h5>
|
|
150
|
-
<p>Whether to show the close button. Syncs with the <code>close-btn</code> attribute.</p>
|
|
151
|
-
<h5><code>overlayClose<i>: boolean</i></code></h5>
|
|
152
|
-
<p>Whether clicking the overlay closes the dialog. Syncs with the <code>overlay-close</code> attribute.</p>
|
|
153
|
-
<h5><code>confirmText<i>: string</i></code></h5>
|
|
154
|
-
<p>Text for the confirm button. Syncs with the <code>confirm-text</code> attribute.</p>
|
|
155
|
-
<h5><code>confirmClasses<i>: string</i></code></h5>
|
|
156
|
-
<p>Classes for the confirm button. Syncs with the <code>confirm-classes</code> attribute.</p>
|
|
157
|
-
<h5><code>cancelText<i>: string</i></code></h5>
|
|
158
|
-
<p>Text for the cancel button. Syncs with the <code>cancel-text</code> attribute.</p>
|
|
159
|
-
<h5><code>cancelClasses<i>: string</i></code></h5>
|
|
160
|
-
<p>Classes for the cancel button. Syncs with the <code>cancel-classes</code> attribute.</p>
|
|
161
|
-
<h5><code>confirmAction<i>: function</i></code></h5>
|
|
162
|
-
<p>Action to perform when the confirm button is clicked. Not reflected as an attribute.</p>
|
|
163
|
-
<h5><code>cancelAction<i>: function</i></code></h5>
|
|
164
|
-
<p>Action to perform when the cancel button is clicked. Not reflected as an attribute.</p>
|
|
165
|
-
<h5><code>closeCallback<i>: function</i></code></h5>
|
|
166
|
-
<p>Callback to execute when the dialog is closed. Not reflected as an attribute.</p>
|
|
167
|
-
<h5><code>previousFocus<i>: Element</i></code></h5>
|
|
168
|
-
<p>Reference to the element that had focus before the dialog was opened. Not reflected as an attribute.</p>
|
|
169
|
-
|
|
170
|
-
<h3 id="methods"><a href="#methods" class="no-link">Methods</a></h3>
|
|
171
|
-
<h5><code>open()<i>: void</i></code></h5>
|
|
172
|
-
<p>Opens the dialog.</p>
|
|
173
|
-
<h5><code>close()<i>: void</i></code></h5>
|
|
174
|
-
<p>Closes the dialog.</p>
|
|
175
|
-
<h5><code>toggle()<i>: void</i></code></h5>
|
|
176
|
-
<p>Toggles the dialog open or closed.</p>
|
|
177
|
-
<h5><code>focus()<i>: void</i></code></h5>
|
|
178
|
-
<p>Focuses the first focusable element in the dialog.</p>
|
|
179
|
-
<h5><code>blur()<i>: void</i></code></h5>
|
|
180
|
-
<p>Returns focus to the element that had focus before the dialog was opened.</p>
|
|
181
|
-
|
|
182
|
-
<h3 id="staticMethods"><a href="#staticMethods" class="no-link">Static Methods</a></h3>
|
|
183
|
-
<h5><code>create(contents, options)<i>: Dialog</i></code></h5>
|
|
184
|
-
<p>Creates and opens a new dialog with the specified contents and options.</p>
|
|
185
|
-
<h6>Options</h6>
|
|
186
|
-
<ul>
|
|
187
|
-
<li><code>opened</code>: <i>boolean</i> - Whether the dialog is initially opened.</li>
|
|
188
|
-
<li><code>closeBtn</code>: <i>boolean</i> - Whether to show the close button.</li>
|
|
189
|
-
<li><code>overlayClose</code>: <i>boolean</i> - Whether clicking the overlay closes the dialog.</li>
|
|
190
|
-
<li><code>confirmText</code>: <i>string</i> - Text for the confirm button.</li>
|
|
191
|
-
<li><code>confirmClasses</code>: <i>string</i> - Classes for the confirm button.</li>
|
|
192
|
-
<li><code>confirmAction</code>: <i>function</i> - Action to perform on confirm.</li>
|
|
193
|
-
<li><code>cancelText</code>: <i>string</i> - Text for the cancel button.</li>
|
|
194
|
-
<li><code>cancelClasses</code>: <i>string</i> - Classes for the cancel button.</li>
|
|
195
|
-
<li><code>cancelAction</code>: <i>function</i> - Action to perform on cancel.</li>
|
|
196
|
-
<li><code>closeCallback</code>: <i>function</i> - Callback to execute when the dialog is closed.</li>
|
|
197
|
-
</ul>
|
|
198
|
-
<h5><code>confirm(text, responseCallback, options)<i>: Dialog</i></code></h5>
|
|
199
|
-
<p>Creates and opens a confirmation dialog with the specified text and options. The responseCallback receives a boolean indicating the user's choice.</p>
|
|
200
|
-
<h6>Options</h6>
|
|
201
|
-
<ul>
|
|
202
|
-
<li><code>title</code>: <i>string</i> - The title of the dialog (default: "Confirm").</li>
|
|
203
|
-
<li><code>confirmText</code>: <i>string</i> - Text for the confirm button (default: "Yes").</li>
|
|
204
|
-
<li><code>confirmClasses</code>: <i>string</i> - Classes for the confirm button (default: "success ml").</li>
|
|
205
|
-
<li><code>cancelText</code>: <i>string</i> - Text for the cancel button (default: "No").</li>
|
|
206
|
-
<li><code>cancelClasses</code>: <i>string</i> - Classes for the cancel button (default: "danger").</li>
|
|
207
|
-
<li><code>closeBtn</code>: <i>boolean</i> - Whether to show the close button (default: false).</li>
|
|
208
|
-
<li><code>overlayClose</code>: <i>boolean</i> - Whether clicking the overlay closes the dialog (default: false).</li>
|
|
209
|
-
</ul>
|
|
210
|
-
<h5><code>alert(text, responseCallback, options)<i>: Dialog</i></code></h5>
|
|
211
|
-
<p>Creates and opens an alert dialog with the specified text and options.</p>
|
|
212
|
-
<h6>Options</h6>
|
|
213
|
-
<ul>
|
|
214
|
-
<li><code>title</code>: <i>string</i> - The title of the dialog (default: "Alert").</li>
|
|
215
|
-
<li><code>cancelText</code>: <i>string</i> - Text for the ok button (default: "Ok").</li>
|
|
216
|
-
<li><code>closeBtn</code>: <i>boolean</i> - Whether to show the close button.</li>
|
|
217
|
-
<li><code>overlayClose</code>: <i>boolean</i> - Whether clicking the overlay closes the dialog.</li>
|
|
218
|
-
</ul>
|
|
219
|
-
<h5><code>error(text, responseCallback, options)<i>: Dialog</i></code></h5>
|
|
220
|
-
<p>Creates and opens an error dialog with the specified text and options.</p>
|
|
221
|
-
<h6>Options</h6>
|
|
222
|
-
<ul>
|
|
223
|
-
<li><code>title</code>: <i>string</i> - The title of the dialog (default: "Error").</li>
|
|
224
|
-
<li><code>cancelText</code>: <i>string</i> - Text for the ok button (default: "Ok").</li>
|
|
225
|
-
<li><code>closeBtn</code>: <i>boolean</i> - Whether to show the close button.</li>
|
|
226
|
-
<li><code>overlayClose</code>: <i>boolean</i> - Whether clicking the overlay closes the dialog.</li>
|
|
227
|
-
</ul>
|
|
228
|
-
<h5><code>success(text, responseCallback, options)<i>: Dialog</i></code></h5>
|
|
229
|
-
<p>Creates and opens a success dialog with the specified text and options.</p>
|
|
230
|
-
<h6>Options</h6>
|
|
231
|
-
<ul>
|
|
232
|
-
<li><code>title</code>: <i>string</i> - The title of the dialog (default: "Success").</li>
|
|
233
|
-
<li><code>cancelText</code>: <i>string</i> - Text for the ok button (default: "Ok").</li>
|
|
234
|
-
<li><code>closeBtn</code>: <i>boolean</i> - Whether to show the close button.</li>
|
|
235
|
-
<li><code>overlayClose</code>: <i>boolean</i> - Whether clicking the overlay closes the dialog.</li>
|
|
236
|
-
</ul>
|
|
237
|
-
|
|
238
|
-
</main>
|
|
239
|
-
<div style="height:33vh"></div>
|
|
240
|
-
<script type="module" src="../src/components/Import.js"></script>
|
|
93
|
+
<script type="module" src="./init.js"></script>
|
|
241
94
|
<script type="module" src="../src/components/Dialog.js"></script>
|
|
242
95
|
<script>
|
|
243
96
|
document.querySelectorAll('.openDialog').forEach( $btn => {
|
|
@@ -5,13 +5,9 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>FocusCapture - Components - Kempo Docs - A Web Components Solution</title>
|
|
7
7
|
<link rel="stylesheet" href="../src/kempo-vars.css" /><link rel="stylesheet" href="../kempo.min.css" />
|
|
8
|
-
<link rel="stylesheet" href="../src/kempo-hljs.css"
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
import Icon from '../src/components/Icon.js';
|
|
12
|
-
Import.replacements.root = '../';
|
|
13
|
-
Icon.pathToIcons = ['../icons'];
|
|
14
|
-
</script>
|
|
8
|
+
<link rel="stylesheet" href="../src/kempo-hljs.css" />
|
|
9
|
+
<link rel="stylesheet" href="../styles.css" />
|
|
10
|
+
<script type="module" src="./init.js"></script>
|
|
15
11
|
</head>
|
|
16
12
|
<body>
|
|
17
13
|
<k-import src="../nav.inc.html"></k-import>
|
|
@@ -5,13 +5,9 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>HybridComponent - Base Components - Kempo Docs - A Web Components Solution</title>
|
|
7
7
|
<link rel="stylesheet" href="../src/kempo-vars.css" /><link rel="stylesheet" href="../kempo.min.css" />
|
|
8
|
-
<link rel="stylesheet" href="../src/kempo-hljs.css"
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
import Icon from '../src/components/Icon.js';
|
|
12
|
-
Import.replacements.root = '../';
|
|
13
|
-
Icon.pathToIcons = ['../icons'];
|
|
14
|
-
</script>
|
|
8
|
+
<link rel="stylesheet" href="../src/kempo-hljs.css" />
|
|
9
|
+
<link rel="stylesheet" href="../styles.css" />
|
|
10
|
+
<script type="module" src="./init.js"></script>
|
|
15
11
|
</head>
|
|
16
12
|
<body>
|
|
17
13
|
<k-import src="../nav.inc.html"></k-import>
|
|
@@ -7,12 +7,7 @@
|
|
|
7
7
|
<link rel="stylesheet" href="../src/kempo-vars.css" /><link rel="stylesheet" href="../kempo.css" />
|
|
8
8
|
<link rel="stylesheet" href="../src/kempo-hljs.css" />
|
|
9
9
|
<link rel="stylesheet" href="../styles.css" />
|
|
10
|
-
<script type="module">
|
|
11
|
-
import Import from '../src/components/Import.js';
|
|
12
|
-
import Icon from '../src/components/Icon.js';
|
|
13
|
-
Import.replacements.root = '../';
|
|
14
|
-
Icon.pathToIcons = ['../icons'];
|
|
15
|
-
</script>
|
|
10
|
+
<script type="module" src="./init.js"></script>
|
|
16
11
|
</head>
|
|
17
12
|
<body>
|
|
18
13
|
<k-import src="../nav.inc.html"></k-import>
|
|
@@ -7,12 +7,7 @@
|
|
|
7
7
|
<link rel="stylesheet" href="../src/kempo-vars.css" /><link rel="stylesheet" href="../kempo.min.css" />
|
|
8
8
|
<link rel="stylesheet" href="../src/kempo-hljs.css" />
|
|
9
9
|
<link rel="stylesheet" href="../styles.css" />
|
|
10
|
-
<script type="module">
|
|
11
|
-
import Import from '../src/components/Import.js';
|
|
12
|
-
import Icon from '../src/components/Icon.js';
|
|
13
|
-
Import.replacements.root = '../';
|
|
14
|
-
Icon.pathToIcons = ['../icons'];
|
|
15
|
-
</script>
|
|
10
|
+
<script type="module" src="./init.js"></script>
|
|
16
11
|
</head>
|
|
17
12
|
<body>
|
|
18
13
|
<k-import src="../nav.inc.html"></k-import>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import Import from '../src/components/Import.js';
|
|
2
|
+
import Icon from '../src/components/Icon.js';
|
|
3
|
+
import ShadowComponent from '../src/components/ShadowComponent.js';
|
|
4
|
+
|
|
5
|
+
Import.replacements.root = '../';
|
|
6
|
+
Icon.pathToIcons = ['../icons'];
|
|
7
|
+
ShadowComponent.stylesheetPath = '../kempo.min.css';
|
|
@@ -5,13 +5,9 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>LightComponent - Base Components - Kempo Docs - A Web Components Solution</title>
|
|
7
7
|
<link rel="stylesheet" href="../src/kempo-vars.css" /><link rel="stylesheet" href="../kempo.min.css" />
|
|
8
|
-
<link rel="stylesheet" href="../src/kempo-hljs.css"
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
import Icon from '../src/components/Icon.js';
|
|
12
|
-
Import.replacements.root = '../';
|
|
13
|
-
Icon.pathToIcons = ['../icons'];
|
|
14
|
-
</script>
|
|
8
|
+
<link rel="stylesheet" href="../src/kempo-hljs.css" />
|
|
9
|
+
<link rel="stylesheet" href="../styles.css" />
|
|
10
|
+
<script type="module" src="./init.js"></script>
|
|
15
11
|
</head>
|
|
16
12
|
<body>
|
|
17
13
|
<k-import src="../nav.inc.html"></k-import>
|
|
@@ -7,14 +7,7 @@
|
|
|
7
7
|
<link rel="stylesheet" href="../src/kempo-vars.css" /><link rel="stylesheet" href="../kempo.min.css" />
|
|
8
8
|
<link rel="stylesheet" href="../src/kempo-hljs.css" />
|
|
9
9
|
<link rel="stylesheet" href="../styles.css" />
|
|
10
|
-
<script type="module">
|
|
11
|
-
import ShadowComponent from '../src/components/ShadowComponent.js';
|
|
12
|
-
import Import from '../src/components/Import.js';
|
|
13
|
-
import Icon from '../src/components/Icon.js';
|
|
14
|
-
ShadowComponent.stylesheetPath = '../kempo.min.css';
|
|
15
|
-
Import.replacements.root = '../';
|
|
16
|
-
Icon.pathToIcons = ['../icons'];
|
|
17
|
-
</script>
|
|
10
|
+
<script type="module" src="./init.js"></script>
|
|
18
11
|
</head>
|
|
19
12
|
<body>
|
|
20
13
|
<k-import src="../nav.inc.html"></k-import>
|
|
@@ -7,14 +7,7 @@
|
|
|
7
7
|
<link rel="stylesheet" href="../src/kempo-vars.css" /><link rel="stylesheet" href="../kempo.min.css" />
|
|
8
8
|
<link rel="stylesheet" href="../src/kempo-hljs.css" />
|
|
9
9
|
<link rel="stylesheet" href="../styles.css" />
|
|
10
|
-
<script type="module">
|
|
11
|
-
import ShadowComponent from '../src/components/ShadowComponent.js';
|
|
12
|
-
import Import from '../src/components/Import.js';
|
|
13
|
-
import Icon from '../src/components/Icon.js';
|
|
14
|
-
ShadowComponent.stylesheetPath = '../kempo.min.css';
|
|
15
|
-
Import.replacements.root = '../';
|
|
16
|
-
Icon.pathToIcons = ['../icons'];
|
|
17
|
-
</script>
|
|
10
|
+
<script type="module" src="./init.js"></script>
|
|
18
11
|
</head>
|
|
19
12
|
<body>
|
|
20
13
|
<k-import src="../nav.inc.html"></k-import>
|
|
@@ -5,15 +5,9 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Resize - Components - Kempo Docs - A Web Components Solution</title>
|
|
7
7
|
<link rel="stylesheet" href="../src/kempo-vars.css" /><link rel="stylesheet" href="../kempo.min.css" />
|
|
8
|
-
<link rel="stylesheet" href="../src/kempo-hljs.css"
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
import Import from '../src/components/Import.js';
|
|
12
|
-
import Icon from '../src/components/Icon.js';
|
|
13
|
-
ShadowComponent.stylesheetPath = '../kempo.min.css';
|
|
14
|
-
Import.replacements.root = '../';
|
|
15
|
-
Icon.pathToIcons = ['../icons'];
|
|
16
|
-
</script>
|
|
8
|
+
<link rel="stylesheet" href="../src/kempo-hljs.css" />
|
|
9
|
+
<link rel="stylesheet" href="../styles.css" />
|
|
10
|
+
<script type="module" src="./init.js"></script>
|
|
17
11
|
</head>
|
|
18
12
|
<body>
|
|
19
13
|
<k-import src="../nav.inc.html"></k-import>
|
|
@@ -5,13 +5,9 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>ShadowComponent - Base Components - Kempo Docs - A Web Components Solution</title>
|
|
7
7
|
<link rel="stylesheet" href="../src/kempo-vars.css" /><link rel="stylesheet" href="../kempo.min.css" />
|
|
8
|
-
<link rel="stylesheet" href="../src/kempo-hljs.css"
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
import Icon from '../src/components/Icon.js';
|
|
12
|
-
Import.replacements.root = '../';
|
|
13
|
-
Icon.pathToIcons = ['../icons'];
|
|
14
|
-
</script>
|
|
8
|
+
<link rel="stylesheet" href="../src/kempo-hljs.css" />
|
|
9
|
+
<link rel="stylesheet" href="../styles.css" />
|
|
10
|
+
<script type="module" src="./init.js"></script>
|
|
15
11
|
</head>
|
|
16
12
|
<body>
|
|
17
13
|
<k-import src="../nav.inc.html"></k-import>
|
|
@@ -5,15 +5,9 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Show More - Components - Kempo Docs - A Web Components Solution</title>
|
|
7
7
|
<link rel="stylesheet" href="../src/kempo-vars.css" /><link rel="stylesheet" href="../kempo.min.css" />
|
|
8
|
-
<link rel="stylesheet" href="../src/kempo-hljs.css"
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
import Import from '../src/components/Import.js';
|
|
12
|
-
import Icon from '../src/components/Icon.js';
|
|
13
|
-
ShadowComponent.stylesheetPath = '../kempo.min.css';
|
|
14
|
-
Import.replacements.root = '../';
|
|
15
|
-
Icon.pathToIcons = ['../icons'];
|
|
16
|
-
</script>
|
|
8
|
+
<link rel="stylesheet" href="../src/kempo-hljs.css" />
|
|
9
|
+
<link rel="stylesheet" href="../styles.css" />
|
|
10
|
+
<script type="module" src="./init.js"></script>
|
|
17
11
|
</head>
|
|
18
12
|
<body>
|
|
19
13
|
<k-import src="../nav.inc.html"></k-import>
|
|
@@ -8,12 +8,7 @@
|
|
|
8
8
|
<link rel="stylesheet" href="../kempo.min.css" />
|
|
9
9
|
<link rel="stylesheet" href="../src/kempo-hljs.css" />
|
|
10
10
|
<link rel="stylesheet" href="../styles.css" />
|
|
11
|
-
<script type="module">
|
|
12
|
-
import Import from '../src/components/Import.js';
|
|
13
|
-
import Icon from '../src/components/Icon.js';
|
|
14
|
-
Import.replacements.root = '../';
|
|
15
|
-
Icon.pathToIcons = ['../icons'];
|
|
16
|
-
</script>
|
|
11
|
+
<script type="module" src="./init.js"></script>
|
|
17
12
|
</head>
|
|
18
13
|
<body>
|
|
19
14
|
<k-import src="../nav.inc.html"></k-import>
|
|
@@ -5,13 +5,9 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Sortable - Components - Kempo Docs - A Web Components Solution</title>
|
|
7
7
|
<link rel="stylesheet" href="../src/kempo-vars.css" /><link rel="stylesheet" href="../kempo.min.css" />
|
|
8
|
-
<link rel="stylesheet" href="../src/kempo-hljs.css"
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
import Icon from '../src/components/Icon.js';
|
|
12
|
-
Import.replacements.root = '../';
|
|
13
|
-
Icon.pathToIcons = ['../icons'];
|
|
14
|
-
</script>
|
|
8
|
+
<link rel="stylesheet" href="../src/kempo-hljs.css" />
|
|
9
|
+
<link rel="stylesheet" href="../styles.css" />
|
|
10
|
+
<script type="module" src="./init.js"></script>
|
|
15
11
|
</head>
|
|
16
12
|
<body>
|
|
17
13
|
<k-import src="../nav.inc.html"></k-import>
|
|
@@ -5,13 +5,9 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Split - Components - Kempo Docs - A Web Components Solution</title>
|
|
7
7
|
<link rel="stylesheet" href="../src/kempo-vars.css" /><link rel="stylesheet" href="../kempo.min.css" />
|
|
8
|
-
<link rel="stylesheet" href="../src/kempo-hljs.css"
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
import Icon from '../src/components/Icon.js';
|
|
12
|
-
Import.replacements.root = '../';
|
|
13
|
-
Icon.pathToIcons = ['../icons'];
|
|
14
|
-
</script>
|
|
8
|
+
<link rel="stylesheet" href="../src/kempo-hljs.css" />
|
|
9
|
+
<link rel="stylesheet" href="../styles.css" />
|
|
10
|
+
<script type="module" src="./init.js"></script>
|
|
15
11
|
</head>
|
|
16
12
|
<body>
|
|
17
13
|
<k-import src="../nav.inc.html"></k-import>
|
|
@@ -6,14 +6,10 @@
|
|
|
6
6
|
<title>Table - Components - Kempo Docs - A Web Components Solution</title>
|
|
7
7
|
<link rel="stylesheet" href="../src/kempo-vars.css" />
|
|
8
8
|
<link rel="stylesheet" href="../kempo.min.css" />
|
|
9
|
-
<link rel="stylesheet" href="../src/kempo-hljs.css"
|
|
9
|
+
<link rel="stylesheet" href="../src/kempo-hljs.css" />
|
|
10
|
+
<link rel="stylesheet" href="../styles.css" />
|
|
10
11
|
<script type="module" src="../src/components/Table.js"></script>
|
|
11
|
-
<script type="module">
|
|
12
|
-
import Import from '../src/components/Import.js';
|
|
13
|
-
import Icon from '../src/components/Icon.js';
|
|
14
|
-
Import.replacements.root = '../';
|
|
15
|
-
Icon.pathToIcons = ['../icons'];
|
|
16
|
-
</script>
|
|
12
|
+
<script type="module" src="./init.js"></script>
|
|
17
13
|
<script>
|
|
18
14
|
|
|
19
15
|
window.contacts = [];
|
|
@@ -6,14 +6,10 @@
|
|
|
6
6
|
<title>Top and Bottom Controls - Table - Kempo Docs</title>
|
|
7
7
|
<link rel="stylesheet" href="../src/kempo-vars.css" />
|
|
8
8
|
<link rel="stylesheet" href="../kempo.min.css" />
|
|
9
|
-
<link rel="stylesheet" href="../src/kempo-hljs.css"
|
|
9
|
+
<link rel="stylesheet" href="../src/kempo-hljs.css" />
|
|
10
|
+
<link rel="stylesheet" href="../styles.css" />
|
|
10
11
|
<script type="module" src="../src/components/Table.js"></script>
|
|
11
|
-
<script type="module">
|
|
12
|
-
import Import from '../src/components/Import.js';
|
|
13
|
-
import Icon from '../src/components/Icon.js';
|
|
14
|
-
Import.replacements.root = '../';
|
|
15
|
-
Icon.pathToIcons = ['../icons'];
|
|
16
|
-
</script>
|
|
12
|
+
<script type="module" src="./init.js"></script>
|
|
17
13
|
<script>
|
|
18
14
|
window.contacts = [];
|
|
19
15
|
function generateContact(){
|