@3t-transform/threeteeui 0.1.8 → 0.1.19
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/{index-8ba406f6.js → index-b8a62ede.js} +80 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/tttx-button.cjs.entry.js +24 -24
- package/dist/cjs/tttx-filter.cjs.entry.js +162 -0
- package/dist/cjs/tttx-form.cjs.entry.js +363 -363
- package/dist/cjs/tttx-icon.cjs.entry.js +11 -11
- package/dist/cjs/tttx-keyvalue-block.cjs.entry.js +62 -58
- package/dist/cjs/tttx-list.cjs.entry.js +43 -43
- package/dist/cjs/tttx-loading-spinner.cjs.entry.js +16 -16
- package/dist/cjs/tttx-standalone-input.cjs.entry.js +60 -60
- package/dist/cjs/tttx-toolbar.cjs.entry.js +10 -10
- package/dist/cjs/tttx.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/atoms/tttx-button/tttx-button.js +110 -110
- package/dist/collection/components/atoms/tttx-button/tttx-button.stories.js +14 -14
- package/dist/collection/components/atoms/tttx-icon/tttx-icon.js +62 -62
- package/dist/collection/components/atoms/tttx-icon/tttx-icon.stories.js +22 -22
- package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.css +6 -0
- package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.js +111 -107
- package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.js +38 -38
- package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.js +67 -67
- package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.js +17 -17
- package/dist/collection/components/molecules/tttx-filter/tttx-filter.css +215 -0
- package/dist/collection/components/molecules/tttx-filter/tttx-filter.js +325 -0
- package/dist/collection/components/molecules/tttx-filter/tttx-filter.stories.js +118 -0
- package/dist/collection/components/molecules/tttx-form/lib/setErrorState.js +35 -35
- package/dist/collection/components/molecules/tttx-form/lib/validityCheck.js +58 -58
- package/dist/collection/components/molecules/tttx-form/tttx-form.js +364 -364
- package/dist/collection/components/molecules/tttx-form/tttx-form.stories.js +127 -127
- package/dist/collection/components/molecules/tttx-list/tttx-list.js +105 -105
- package/dist/collection/components/molecules/tttx-list/tttx-list.stories.js +43 -43
- package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.js +627 -627
- package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.js +157 -157
- package/dist/collection/components/molecules/tttx-toolbar/tttx-toolbar.js +44 -44
- package/dist/collection/components/molecules/tttx-toolbar/tttx-toolbar.stories.js +14 -14
- package/dist/collection/components/palette.stories.js +7 -7
- package/dist/collection/docs/gettingstarted-developer.stories.js +5 -5
- package/dist/collection/icons.js +2838 -2838
- package/dist/collection/index.js +1 -1
- package/dist/collection/shared/domsanitiser.options.js +14 -14
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/tttx-button.js +48 -48
- package/dist/components/tttx-filter.d.ts +11 -0
- package/dist/components/tttx-filter.js +195 -0
- package/dist/components/tttx-form.js +380 -380
- package/dist/components/tttx-icon2.js +28 -28
- package/dist/components/tttx-keyvalue-block.js +79 -75
- package/dist/components/tttx-list.js +65 -65
- package/dist/components/tttx-loading-spinner.js +33 -33
- package/dist/components/tttx-standalone-input.js +107 -107
- package/dist/components/tttx-toolbar.js +26 -26
- package/dist/esm/{index-5f9b72ff.js → index-e888a5f4.js} +80 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/esm/tttx-button.entry.js +24 -24
- package/dist/esm/tttx-filter.entry.js +158 -0
- package/dist/esm/tttx-form.entry.js +363 -363
- package/dist/esm/tttx-icon.entry.js +11 -11
- package/dist/esm/tttx-keyvalue-block.entry.js +62 -58
- package/dist/esm/tttx-list.entry.js +43 -43
- package/dist/esm/tttx-loading-spinner.entry.js +16 -16
- package/dist/esm/tttx-standalone-input.entry.js +60 -60
- package/dist/esm/tttx-toolbar.entry.js +10 -10
- package/dist/esm/tttx.js +3 -3
- package/dist/tttx/{p-405219b2.entry.js → p-01f4628e.entry.js} +1 -1
- package/dist/tttx/{p-435c62b3.entry.js → p-043f9b8a.entry.js} +1 -1
- package/dist/tttx/{p-9cff9c64.entry.js → p-34052e38.entry.js} +1 -1
- package/dist/tttx/p-41f5b296.entry.js +1 -0
- package/dist/tttx/{p-0342cc46.entry.js → p-4cf3e1e0.entry.js} +1 -1
- package/dist/tttx/{p-1290dcd7.entry.js → p-6dff6b5a.entry.js} +1 -1
- package/dist/tttx/p-6f535da9.entry.js +1 -0
- package/dist/tttx/{p-adf35f58.entry.js → p-96bbf1ed.entry.js} +1 -1
- package/dist/tttx/{p-4ecc9e8b.entry.js → p-b3a03986.entry.js} +1 -1
- package/dist/tttx/p-f764ffc4.js +2 -0
- package/dist/tttx/tttx.esm.js +1 -1
- package/dist/types/components/atoms/tttx-button/tttx-button.d.ts +10 -10
- package/dist/types/components/atoms/tttx-button/tttx-button.stories.d.ts +10 -10
- package/dist/types/components/atoms/tttx-icon/tttx-icon.d.ts +5 -5
- package/dist/types/components/atoms/tttx-icon/tttx-icon.stories.d.ts +20 -20
- package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.d.ts +7 -7
- package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.d.ts +9 -9
- package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.d.ts +6 -6
- package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.d.ts +17 -17
- package/dist/types/components/molecules/tttx-filter/tttx-filter.d.ts +37 -0
- package/dist/types/components/molecules/tttx-filter/tttx-filter.stories.d.ts +43 -0
- package/dist/types/components/molecules/tttx-form/lib/setErrorState.d.ts +13 -13
- package/dist/types/components/molecules/tttx-form/lib/validityCheck.d.ts +17 -17
- package/dist/types/components/molecules/tttx-form/tttx-form.d.ts +114 -114
- package/dist/types/components/molecules/tttx-form/tttx-form.stories.d.ts +13 -13
- package/dist/types/components/molecules/tttx-list/tttx-list.d.ts +11 -11
- package/dist/types/components/molecules/tttx-list/tttx-list.stories.d.ts +14 -14
- package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.d.ts +56 -56
- package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.d.ts +123 -123
- package/dist/types/components/molecules/tttx-toolbar/tttx-toolbar.d.ts +4 -4
- package/dist/types/components/molecules/tttx-toolbar/tttx-toolbar.stories.d.ts +13 -13
- package/dist/types/components/palette.stories.d.ts +6 -6
- package/dist/types/components.d.ts +33 -0
- package/dist/types/docs/gettingstarted-developer.stories.d.ts +5 -5
- package/dist/types/icons.d.ts +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/shared/domsanitiser.options.d.ts +10 -10
- package/package.json +1 -1
- package/dist/tttx/p-1b394414.entry.js +0 -1
- package/dist/tttx/p-c4b803fc.js +0 -2
|
@@ -87,6 +87,7 @@ function queryNonceMetaTagContent(doc) {
|
|
|
87
87
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
|
|
88
88
|
const h = (nodeName, vnodeData, ...children) => {
|
|
89
89
|
let child = null;
|
|
90
|
+
let key = null;
|
|
90
91
|
let simple = false;
|
|
91
92
|
let lastSimple = false;
|
|
92
93
|
const vNodeChildren = [];
|
|
@@ -114,6 +115,10 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
114
115
|
};
|
|
115
116
|
walk(children);
|
|
116
117
|
if (vnodeData) {
|
|
118
|
+
// normalize class / classname attributes
|
|
119
|
+
if (vnodeData.key) {
|
|
120
|
+
key = vnodeData.key;
|
|
121
|
+
}
|
|
117
122
|
{
|
|
118
123
|
const classData = vnodeData.className || vnodeData.class;
|
|
119
124
|
if (classData) {
|
|
@@ -131,6 +136,9 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
131
136
|
if (vNodeChildren.length > 0) {
|
|
132
137
|
vnode.$children$ = vNodeChildren;
|
|
133
138
|
}
|
|
139
|
+
{
|
|
140
|
+
vnode.$key$ = key;
|
|
141
|
+
}
|
|
134
142
|
return vnode;
|
|
135
143
|
};
|
|
136
144
|
/**
|
|
@@ -152,6 +160,9 @@ const newVNode = (tag, text) => {
|
|
|
152
160
|
{
|
|
153
161
|
vnode.$attrs$ = null;
|
|
154
162
|
}
|
|
163
|
+
{
|
|
164
|
+
vnode.$key$ = null;
|
|
165
|
+
}
|
|
155
166
|
return vnode;
|
|
156
167
|
};
|
|
157
168
|
const Host = {};
|
|
@@ -329,6 +340,33 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
329
340
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
330
341
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
331
342
|
}
|
|
343
|
+
else if (memberName === 'style') {
|
|
344
|
+
// update style attribute, css properties and values
|
|
345
|
+
{
|
|
346
|
+
for (const prop in oldValue) {
|
|
347
|
+
if (!newValue || newValue[prop] == null) {
|
|
348
|
+
if (prop.includes('-')) {
|
|
349
|
+
elm.style.removeProperty(prop);
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
elm.style[prop] = '';
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
for (const prop in newValue) {
|
|
358
|
+
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
359
|
+
if (prop.includes('-')) {
|
|
360
|
+
elm.style.setProperty(prop, newValue[prop]);
|
|
361
|
+
}
|
|
362
|
+
else {
|
|
363
|
+
elm.style[prop] = newValue[prop];
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
else if (memberName === 'key')
|
|
369
|
+
;
|
|
332
370
|
else if (memberName === 'ref') {
|
|
333
371
|
// minifier will clean this up
|
|
334
372
|
if (newValue) {
|
|
@@ -606,6 +644,8 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
|
606
644
|
const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
607
645
|
let oldStartIdx = 0;
|
|
608
646
|
let newStartIdx = 0;
|
|
647
|
+
let idxInOld = 0;
|
|
648
|
+
let i = 0;
|
|
609
649
|
let oldEndIdx = oldCh.length - 1;
|
|
610
650
|
let oldStartVnode = oldCh[0];
|
|
611
651
|
let oldEndVnode = oldCh[oldEndIdx];
|
|
@@ -613,6 +653,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
613
653
|
let newStartVnode = newCh[0];
|
|
614
654
|
let newEndVnode = newCh[newEndIdx];
|
|
615
655
|
let node;
|
|
656
|
+
let elmToMove;
|
|
616
657
|
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
617
658
|
if (oldStartVnode == null) {
|
|
618
659
|
// VNode might have been moved left
|
|
@@ -679,7 +720,41 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
679
720
|
newStartVnode = newCh[++newStartIdx];
|
|
680
721
|
}
|
|
681
722
|
else {
|
|
723
|
+
// Here we do some checks to match up old and new nodes based on the
|
|
724
|
+
// `$key$` attribute, which is set by putting a `key="my-key"` attribute
|
|
725
|
+
// in the JSX for a DOM element in the implementation of a Stencil
|
|
726
|
+
// component.
|
|
727
|
+
//
|
|
728
|
+
// First we check to see if there are any nodes in the array of old
|
|
729
|
+
// children which have the same key as the first node in the new
|
|
730
|
+
// children.
|
|
731
|
+
idxInOld = -1;
|
|
682
732
|
{
|
|
733
|
+
for (i = oldStartIdx; i <= oldEndIdx; ++i) {
|
|
734
|
+
if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
|
|
735
|
+
idxInOld = i;
|
|
736
|
+
break;
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
if (idxInOld >= 0) {
|
|
741
|
+
// We found a node in the old children which matches up with the first
|
|
742
|
+
// node in the new children! So let's deal with that
|
|
743
|
+
elmToMove = oldCh[idxInOld];
|
|
744
|
+
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
745
|
+
// the tag doesn't match so we'll need a new DOM element
|
|
746
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
|
|
747
|
+
}
|
|
748
|
+
else {
|
|
749
|
+
patch(elmToMove, newStartVnode);
|
|
750
|
+
// invalidate the matching old node so that we won't try to update it
|
|
751
|
+
// again later on
|
|
752
|
+
oldCh[idxInOld] = undefined;
|
|
753
|
+
node = elmToMove.$elm$;
|
|
754
|
+
}
|
|
755
|
+
newStartVnode = newCh[++newStartIdx];
|
|
756
|
+
}
|
|
757
|
+
else {
|
|
683
758
|
// We either didn't find an element in the old children that matches
|
|
684
759
|
// the key of the first new child OR the build is not using `key`
|
|
685
760
|
// attributes at all. In either case we need to create a new element
|
|
@@ -728,7 +803,10 @@ const isSameVnode = (leftVNode, rightVNode) => {
|
|
|
728
803
|
// compare if two vnode to see if they're "technically" the same
|
|
729
804
|
// need to have the same element tag, and same key to be the same
|
|
730
805
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
731
|
-
|
|
806
|
+
// this will be set if components in the build have `key` attrs set on them
|
|
807
|
+
{
|
|
808
|
+
return leftVNode.$key$ === rightVNode.$key$;
|
|
809
|
+
}
|
|
732
810
|
}
|
|
733
811
|
return false;
|
|
734
812
|
};
|
|
@@ -1461,6 +1539,7 @@ const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
|
|
|
1461
1539
|
exports.Host = Host;
|
|
1462
1540
|
exports.bootstrapLazy = bootstrapLazy;
|
|
1463
1541
|
exports.createEvent = createEvent;
|
|
1542
|
+
exports.getElement = getElement;
|
|
1464
1543
|
exports.h = h;
|
|
1465
1544
|
exports.promiseResolve = promiseResolve;
|
|
1466
1545
|
exports.registerInstance = registerInstance;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-b8a62ede.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
Stencil Client Patch Esm v2.22.3 | MIT Licensed | https://stenciljs.com
|
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["tttx-button.cjs",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"design":[1]}]]],["tttx-list.cjs",[[1,"tttx-list",{"data":[1025],"name":[1]}]]],["tttx-standalone-input.cjs",[[2,"tttx-standalone-input",{"label":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"iconleft":[1],"iconright":[1],"inputicon":[1],"inline":[4],"inputAutocapitalize":[1,"input-autocapitalize"],"inputAutofocus":[4,"input-autofocus"],"inputKeyhint":[1,"input-keyhint"],"inputIndex":[8,"input-index"],"inputTitle":[1,"input-title"],"autocomplete":[1],"checked":[4],"disabled":[4],"max":[8],"maxlength":[8],"min":[8],"minlength":[8],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[8],"required":[4],"step":[8],"type":[1],"value":[1032]}]]],["tttx-form.cjs",[[1,"tttx-form",{"formschema":[1032],"submitValue":[1032,"submit-value"]}]]],["tttx-keyvalue-block.cjs",[[1,"tttx-keyvalue-block",{"keyvalues":[8],"horizontal":[4]}]]],["tttx-loading-spinner.cjs",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-toolbar.cjs",[[1,"tttx-toolbar",{"border":[4]}]]],["tttx-icon.cjs",[[1,"tttx-icon",{"icon":[1],"color":[1]}]]]], options);
|
|
17
|
+
return index.bootstrapLazy([["tttx-button.cjs",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"design":[1]}]]],["tttx-filter.cjs",[[1,"tttx-filter",{"filterKey":[1,"filter-key"],"filterOptions":[16],"showSelectAll":[4,"show-select-all"],"showSearchField":[4,"show-search-field"],"showOptionIcons":[4,"show-option-icons"],"filterButtonStyle":[1,"filter-button-style"],"filterHeader":[1,"filter-header"],"showPopover":[32],"selectedFilters":[32],"filterSearchTerm":[32],"displayedFilterSettings":[32],"allSelected":[32]}]]],["tttx-list.cjs",[[1,"tttx-list",{"data":[1025],"name":[1]}]]],["tttx-standalone-input.cjs",[[2,"tttx-standalone-input",{"label":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"iconleft":[1],"iconright":[1],"inputicon":[1],"inline":[4],"inputAutocapitalize":[1,"input-autocapitalize"],"inputAutofocus":[4,"input-autofocus"],"inputKeyhint":[1,"input-keyhint"],"inputIndex":[8,"input-index"],"inputTitle":[1,"input-title"],"autocomplete":[1],"checked":[4],"disabled":[4],"max":[8],"maxlength":[8],"min":[8],"minlength":[8],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[8],"required":[4],"step":[8],"type":[1],"value":[1032]}]]],["tttx-form.cjs",[[1,"tttx-form",{"formschema":[1032],"submitValue":[1032,"submit-value"]}]]],["tttx-keyvalue-block.cjs",[[1,"tttx-keyvalue-block",{"keyvalues":[8],"horizontal":[4]}]]],["tttx-loading-spinner.cjs",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-toolbar.cjs",[[1,"tttx-toolbar",{"border":[4]}]]],["tttx-icon.cjs",[[1,"tttx-icon",{"icon":[1],"color":[1]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -2,33 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-b8a62ede.js');
|
|
6
6
|
|
|
7
7
|
const tttxButtonCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.button{font-family:Roboto, serif;box-sizing:border-box;height:36px;min-width:36px;padding:0;margin:0;background:transparent;color:#212121;border:1px solid #c8c8c8;border-radius:4px;text-transform:uppercase;display:flex;justify-content:left;align-items:center;font-size:14px;font-weight:400}.button-content{display:block;padding:0 16px}.icon-left,.icon-right{margin-top:4px}.iconleft{padding-left:8px}.iconleft .button-content{padding-left:4px}.iconright{padding-right:8px}.iconright .button-content{padding-right:4px}.notext{padding:0 6px}.button:hover{background:rgba(17, 17, 17, 0.1);border:1px solid #D5D5D5}.button:active{background:rgba(17, 17, 17, 0.2);border:1px solid #D5D5D5}.primary{background:#1479c6;border:1px solid #1479c6;color:white}.primary:hover{background:#146EB3;border:1px solid #146EB3}.primary:active{background:#1464A2;border:1px solid #1464A2}.borderless{background:transparent;border:none;color:#212121}.borderless:hover{background:rgba(17, 17, 17, 0.1);border:none}.borderless:active{background:rgba(17, 17, 17, 0.2);border:none}.danger{background:#DC0000;border:1px solid #DC0000;color:white}.danger:hover{background:#C60000;border:1px solid #C60000}.danger:active{background:#B00000;border:1px solid #B00000}.disabled{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}.disabled:hover{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}.disabled:active{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}:host{display:inline-block}button{cursor:pointer}tttx-icon{cursor:inherit}.spacingleft{margin-left:8px}";
|
|
8
8
|
|
|
9
|
-
const TttxButton = class {
|
|
10
|
-
constructor(hostRef) {
|
|
11
|
-
index.registerInstance(this, hostRef);
|
|
12
|
-
this._iconcolor = 'black';
|
|
13
|
-
this.notext = undefined;
|
|
14
|
-
this.icon = undefined;
|
|
15
|
-
this.iconposition = 'left';
|
|
16
|
-
this.design = 'default';
|
|
17
|
-
}
|
|
18
|
-
componentWillLoad() {
|
|
19
|
-
this._design = this.design;
|
|
20
|
-
const designs = ['primary', 'default', 'disabled', 'danger', 'borderless'];
|
|
21
|
-
if (!designs.includes(this.design)) {
|
|
22
|
-
this._design = 'default';
|
|
23
|
-
}
|
|
24
|
-
if (this._design === 'primary' || this._design === 'danger') {
|
|
25
|
-
this._iconcolor = 'white';
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
render() {
|
|
29
|
-
return (index.h(index.Host, null, index.h("button", { class: `button ${this._design} ${this.icon ? 'withicon' : ''} ${this.icon && this.iconposition ? 'icon' + this.iconposition : ''} ${this.notext ? 'notext' : ''}` }, this.icon && this.iconposition === 'left' && (index.h("div", { class: "icon-left" }, index.h("tttx-icon", { icon: this.icon, color: this._iconcolor }))), !this.notext && index.h("div", { class: "button-content" }, index.h("slot", null)), this.icon && this.iconposition === 'right' && (index.h("div", { class: "icon-right" }, index.h("tttx-icon", { icon: this.icon, color: this._iconcolor }))))));
|
|
30
|
-
}
|
|
31
|
-
};
|
|
9
|
+
const TttxButton = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this._iconcolor = 'black';
|
|
13
|
+
this.notext = undefined;
|
|
14
|
+
this.icon = undefined;
|
|
15
|
+
this.iconposition = 'left';
|
|
16
|
+
this.design = 'default';
|
|
17
|
+
}
|
|
18
|
+
componentWillLoad() {
|
|
19
|
+
this._design = this.design;
|
|
20
|
+
const designs = ['primary', 'default', 'disabled', 'danger', 'borderless'];
|
|
21
|
+
if (!designs.includes(this.design)) {
|
|
22
|
+
this._design = 'default';
|
|
23
|
+
}
|
|
24
|
+
if (this._design === 'primary' || this._design === 'danger') {
|
|
25
|
+
this._iconcolor = 'white';
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
render() {
|
|
29
|
+
return (index.h(index.Host, null, index.h("button", { class: `button ${this._design} ${this.icon ? 'withicon' : ''} ${this.icon && this.iconposition ? 'icon' + this.iconposition : ''} ${this.notext ? 'notext' : ''}` }, this.icon && this.iconposition === 'left' && (index.h("div", { class: "icon-left" }, index.h("tttx-icon", { icon: this.icon, color: this._iconcolor }))), !this.notext && index.h("div", { class: "button-content" }, index.h("slot", null)), this.icon && this.iconposition === 'right' && (index.h("div", { class: "icon-right" }, index.h("tttx-icon", { icon: this.icon, color: this._iconcolor }))))));
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
32
|
TttxButton.style = tttxButtonCss;
|
|
33
33
|
|
|
34
34
|
exports.tttx_button = TttxButton;
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-b8a62ede.js');
|
|
6
|
+
|
|
7
|
+
const tttxFilterCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.material-symbols-rounded{font-family:\"Material Symbols Rounded\", sans-serif;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;color:#9e9e9e}.filter-container .filter-button{display:inline-flex;justify-content:center;align-items:center;font-size:14px;font-weight:400;font-family:\"Roboto\", serif;text-transform:uppercase;color:#212121;border:1px solid #d5d5d5;border-radius:4px;background:transparent;height:36px;width:95px;margin:0;padding-right:16px}.filter-container .filter-button .filter-icon{padding-left:8px;padding-right:4px}.filter-container .filter-button.--list-icon{font-size:0;width:36px;height:36px;padding:0}.filter-container .filter-button.--list-icon .filter-icon{padding:0}.filter-container .filter-button.--list-icon:hover{background:#e3e3e3}.filter-container .filter-button.--table-icon{font-size:0;width:36px;height:36px;padding:0;border:none}.filter-container .filter-button.--table-icon .filter-icon{padding:0;width:24px;height:24px}.filter-container .filter-button.--table-icon:hover{background:#e3e3e3;border-radius:50%;width:36px;height:36px}.filter-container .filter-button:hover{background:#e3e3e3}.filter-container .filter-popover-container{display:block;width:196px;border-radius:4px;box-shadow:0px 1px 5px #1111114D;position:absolute}.filter-container .filter-popover-container .filter-header{color:#757575;text-transform:uppercase;font-size:14px;font-weight:500;font-family:\"Roboto\", serif;padding-left:16px;padding-top:12px;padding-bottom:12px;margin:0}.filter-container .filter-popover-container .popover-divider{border:none;width:164px;display:flex;margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:8px;height:1px;background-color:#d5d5d5}.filter-container .filter-popover-container .filter-option{display:flex;flex-direction:row;align-items:center;height:36px;padding-left:22px;padding-bottom:4px}.filter-container .filter-popover-container .filter-option .select-all-icon{padding-right:6px}.filter-container .filter-popover-container .filter-option .checkbox-icon{padding-right:8px}.filter-container .filter-popover-container .filter-option .filter-label{padding-left:8px;padding-bottom:3px;font-size:16px;font-weight:500;font-family:\"Roboto\", serif}.filter-container .filter-popover-container .filter-option:first-child{margin-top:8px}.filter-container .filter-popover-container .filter-option:last-child{margin-bottom:8px}.filter-container .filter-popover-container .filter-popover-button-container{display:flex;justify-content:flex-end;align-items:center;padding-bottom:8px}.filter-container .filter-popover-container .filter-popover-button-container .close-button{height:36px;width:74px;background-color:white;border:1px solid #d5d5d5;border-radius:4px;text-transform:uppercase;margin-right:8px;font-size:14px;font-weight:400;font-family:\"Roboto\", serif}.filter-container .filter-popover-container .filter-popover-button-container .apply-button{height:36px;width:73px;background-color:#1479c6;color:white;border-radius:4px;border:none;text-transform:uppercase;margin-right:16px;font-size:14px;font-weight:400;font-family:\"Roboto\", serif}.filter-container .filter-popover-container.--with-search-field{width:252px}.filter-container .filter-popover-container.--with-search-field .popover-divider{width:220px}.filter-container .filter-popover-container.--with-search-field .popover-divider:first-child{top:44px}.filter-container .filter-popover-container.--with-search-field .search-field-container{position:relative;color:#d5d5d5;width:220px;height:36px;padding:0 16px}.filter-container .filter-popover-container.--with-search-field .search-field-container .search-icon{position:absolute;top:50%;padding-left:8px;padding-bottom:9.2px;height:17px;width:17px;transform:translateY(-50%)}.filter-container .filter-popover-container.--with-search-field .search-field-container .search-input{padding-left:36px;border:1px solid #d5d5d5;border-radius:4px;height:36px;width:220px;font-size:16px;font-family:\"Roboto\", serif;font-weight:500;color:#9e9e9e;box-sizing:border-box}.filter-container .filter-popover-container.--with-search-field .search-field-container .search-input:focus-visible,.filter-container .filter-popover-container.--with-search-field .search-field-container .search-input:focus{outline:none;border:1px solid #1479c6}.filter-container .filter-popover-container.--with-search-field .search-field-container .search-input::placeholder{color:#9e9e9e;font-size:16px;font-family:\"Roboto\", serif;font-weight:500}.filter-container .filter-popover-container.--with-search-field .search-field-container .popover-divider{margin-top:8px}.filter-container .filter-popover-container.--with-search-field .filter-option:first-child{padding-top:8px}";
|
|
8
|
+
|
|
9
|
+
const TttxFilter = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.filterChangeEvent = index.createEvent(this, "filterChangeEvent", 7);
|
|
13
|
+
this.filterKey = undefined;
|
|
14
|
+
this.filterOptions = [
|
|
15
|
+
{ optionIcon: 'cancel', optionIconColor: 'darkred', optionText: 'Expired' },
|
|
16
|
+
{ optionIcon: 'warning', optionIconColor: 'orange', optionText: 'Expiring soon' },
|
|
17
|
+
{ optionIcon: 'check_circle', optionIconColor: 'green', optionText: 'Active' },
|
|
18
|
+
];
|
|
19
|
+
this.showSelectAll = true;
|
|
20
|
+
this.showSearchField = false;
|
|
21
|
+
this.showOptionIcons = true;
|
|
22
|
+
this.filterButtonStyle = 'list filter';
|
|
23
|
+
this.filterHeader = 'Qualification status';
|
|
24
|
+
this.showPopover = false;
|
|
25
|
+
this.selectedFilters = this.filterOptions.map((filterOption) => filterOption.optionText);
|
|
26
|
+
this.filterSearchTerm = '';
|
|
27
|
+
this.displayedFilterSettings = this.filterOptions;
|
|
28
|
+
this.allSelected = true;
|
|
29
|
+
}
|
|
30
|
+
emitFilterEvent() {
|
|
31
|
+
this.filterChangeEvent.emit({
|
|
32
|
+
selectedFilters: this.selectedFilters,
|
|
33
|
+
filterKey: this.filterKey,
|
|
34
|
+
allSelected: this.allSelected,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
onFilterButtonClick() {
|
|
38
|
+
this.togglePopover();
|
|
39
|
+
}
|
|
40
|
+
onCloseButtonClick() {
|
|
41
|
+
this.togglePopover();
|
|
42
|
+
}
|
|
43
|
+
onApplyFilterButtonClick() {
|
|
44
|
+
this.emitFilterEvent();
|
|
45
|
+
this.togglePopover();
|
|
46
|
+
}
|
|
47
|
+
onFilterOptionSelected(selectedOption) {
|
|
48
|
+
this.allSelected = false;
|
|
49
|
+
if (this.selectedFilters.includes(selectedOption)) {
|
|
50
|
+
this.selectedFilters = this.selectedFilters.filter((filter) => filter != selectedOption);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
this.selectedFilters = [...this.selectedFilters, selectedOption];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
togglePopover() {
|
|
57
|
+
this.showPopover = !this.showPopover;
|
|
58
|
+
// if(!this.showPopover) {
|
|
59
|
+
// // this._focussedElementIndex = -1;
|
|
60
|
+
// }
|
|
61
|
+
}
|
|
62
|
+
// Commented out keyboard interaction for now
|
|
63
|
+
// @Listen('keyup')
|
|
64
|
+
// handleKeyUp(event: KeyboardEvent) {
|
|
65
|
+
// const keyboardEventValue = event.key;
|
|
66
|
+
// if (document.activeElement.id != `filter__${this.filterKey}`) return;
|
|
67
|
+
// if (event.key == " " || event.code == "Space" || event.keyCode == 32) {
|
|
68
|
+
// if (this._focussedElementIndex == 0) {
|
|
69
|
+
// this.onSelectAllClick()
|
|
70
|
+
// } else {
|
|
71
|
+
// const options = this.el.shadowRoot.querySelectorAll('.filter-option') as HTMLElement[];
|
|
72
|
+
// this.onFilterOptionSelected(options[this._focussedElementIndex].textContent)
|
|
73
|
+
// }
|
|
74
|
+
// return;
|
|
75
|
+
// }
|
|
76
|
+
// switch (keyboardEventValue) {
|
|
77
|
+
// case 'Enter':
|
|
78
|
+
// if(!this.showPopover) {
|
|
79
|
+
// this.showPopover=true
|
|
80
|
+
// } else {
|
|
81
|
+
// this.emitFilterEvent()
|
|
82
|
+
// }
|
|
83
|
+
// break;
|
|
84
|
+
// case 'Escape':
|
|
85
|
+
// this.showPopover = false;
|
|
86
|
+
// this._focussedElementIndex = -1;
|
|
87
|
+
// break;
|
|
88
|
+
// case 'ArrowDown':
|
|
89
|
+
// this.showPopover = true;
|
|
90
|
+
// if (this._focussedElementIndex == -1) {
|
|
91
|
+
// this._focussedElementIndex = 0;
|
|
92
|
+
// } else {
|
|
93
|
+
// const options = this.el.shadowRoot.querySelectorAll('.filter-option') as HTMLElement[];
|
|
94
|
+
// const currentOption = options[this._focussedElementIndex] as HTMLElement;
|
|
95
|
+
// currentOption.blur();
|
|
96
|
+
// // options[this._focussedElementIndex].focus();
|
|
97
|
+
// this._focussedElementIndex + 1 < options.length ? this._focussedElementIndex++ : (this._focussedElementIndex = 0);
|
|
98
|
+
// }
|
|
99
|
+
// break;
|
|
100
|
+
// case 'ArrowUp':
|
|
101
|
+
// if (this._focussedElementIndex == -1) {
|
|
102
|
+
// this.showPopover = true;
|
|
103
|
+
// this._focussedElementIndex = 0;
|
|
104
|
+
// } else {
|
|
105
|
+
// const options = this.el.shadowRoot.querySelectorAll('.filter-option') as HTMLElement[];
|
|
106
|
+
// const currentOption = options[this._focussedElementIndex] as HTMLElement;
|
|
107
|
+
// currentOption.blur();
|
|
108
|
+
// // options[this._focussedElementIndex].focus();
|
|
109
|
+
// this._focussedElementIndex > 0 ? this._focussedElementIndex-- : (this._focussedElementIndex = options.length - 1);
|
|
110
|
+
// }
|
|
111
|
+
// break;
|
|
112
|
+
// }
|
|
113
|
+
// }
|
|
114
|
+
handleFilterChange(event) {
|
|
115
|
+
const target = event.target;
|
|
116
|
+
this.filterSearchTerm = target.value;
|
|
117
|
+
const filteredResults = this.filterOptions.filter((filterOption) => {
|
|
118
|
+
const lowercaseOption = filterOption.optionText.toLowerCase();
|
|
119
|
+
const filterTerm = this.filterSearchTerm.toLowerCase();
|
|
120
|
+
return lowercaseOption.includes(filterTerm);
|
|
121
|
+
});
|
|
122
|
+
this.displayedFilterSettings = filteredResults;
|
|
123
|
+
}
|
|
124
|
+
onSelectAllClick() {
|
|
125
|
+
this.allSelected = !this.allSelected;
|
|
126
|
+
if (this.allSelected) {
|
|
127
|
+
this.displayedFilterSettings.forEach((filterSetting) => { this.selectedFilters = [...this.selectedFilters, filterSetting.optionText]; });
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
this.selectedFilters = [];
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
getFilterButtonClassName(buttonStyle) {
|
|
134
|
+
switch (buttonStyle) {
|
|
135
|
+
case 'table icon': {
|
|
136
|
+
return '--table-icon';
|
|
137
|
+
}
|
|
138
|
+
case 'list icon': {
|
|
139
|
+
return '--list-icon';
|
|
140
|
+
}
|
|
141
|
+
default: {
|
|
142
|
+
return '';
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
render() {
|
|
147
|
+
const filterPopoverContainerClassNameModifier = this.showSearchField ? '--with-search-field' : '';
|
|
148
|
+
const selectAllCheckboxIcon = this.allSelected ? 'check_box' : 'check_box_outline_blank';
|
|
149
|
+
const selectAllCheckboxColor = this.allSelected ? 'blue' : 'grey';
|
|
150
|
+
const buttonStyleClassNameModifier = this.getFilterButtonClassName(this.filterButtonStyle);
|
|
151
|
+
const filterKey = `filter__${this.filterKey}`;
|
|
152
|
+
return (index.h(index.Host, { id: filterKey }, index.h("div", { class: 'filter-container' }, index.h("button", { class: `filter-button ${buttonStyleClassNameModifier}`, type: 'button', onClick: this.onFilterButtonClick.bind(this) }, index.h("tttx-icon", { icon: 'filter_list', class: 'filter-icon', color: 'black' }), "Filter"), this.showPopover && (index.h("div", { class: `filter-popover-container ${filterPopoverContainerClassNameModifier}` }, index.h("h4", { class: 'filter-header' }, this.filterHeader), index.h("hr", { class: 'popover-divider' }), this.showSearchField ? (index.h("div", { class: 'search-field-container' }, index.h("tttx-icon", { icon: 'search', class: 'search-icon' }), index.h("input", { type: 'text', class: 'search-input', placeholder: 'Search', value: this.filterSearchTerm, onInput: this.handleFilterChange.bind(this) }), index.h("hr", { class: 'popover-divider' }))) : (''), index.h("div", { class: 'filter-options-container' }, this.showSelectAll ? (index.h("div", { class: 'filter-option', tabIndex: -1, onClick: this.onSelectAllClick.bind(this) }, index.h("tttx-icon", { icon: selectAllCheckboxIcon, color: selectAllCheckboxColor, class: 'select-all-icon' }), index.h("label", { class: 'filter-label' }, "Select all"))) : (''), this.displayedFilterSettings.map((option) => {
|
|
153
|
+
const checkboxIcon = this.selectedFilters.includes(option.optionText) ? 'check_box' : 'check_box_outline_blank';
|
|
154
|
+
const checkboxColor = this.selectedFilters.includes(option.optionText) ? 'blue' : 'grey';
|
|
155
|
+
return index.h("div", { class: 'filter-option', tabIndex: -1, onClick: () => this.onFilterOptionSelected(option.optionText), key: option.optionText }, index.h("tttx-icon", { icon: checkboxIcon, color: checkboxColor, class: 'checkbox-icon' }), this.showOptionIcons && index.h("tttx-icon", { icon: option.optionIcon, color: option.optionIconColor }), index.h("label", { class: 'filter-label' }, option.optionText));
|
|
156
|
+
})), index.h("hr", { class: 'popover-divider' }), index.h("div", { class: 'filter-popover-button-container' }, index.h("button", { type: 'button', class: 'close-button', onClick: this.onCloseButtonClick.bind(this) }, "Close"), index.h("button", { type: 'button', class: 'apply-button', onClick: this.onApplyFilterButtonClick.bind(this) }, "Apply")))))));
|
|
157
|
+
}
|
|
158
|
+
get el() { return index.getElement(this); }
|
|
159
|
+
};
|
|
160
|
+
TttxFilter.style = tttxFilterCss;
|
|
161
|
+
|
|
162
|
+
exports.tttx_filter = TttxFilter;
|