@3t-transform/threeteeui 0.1.5 → 0.1.7
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/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/css-shim-211819bc.js +6 -0
- package/dist/cjs/dom-9deb26c8.js +75 -0
- package/dist/cjs/index-11cfdabe.js +3297 -0
- package/dist/cjs/{index-906c2757.js → index-451f61dd.js} +3 -102
- package/dist/cjs/loader.cjs.js +19 -4
- package/dist/cjs/shadow-css-bf3843d2.js +389 -0
- package/dist/cjs/{tttx-button_2.cjs.entry.js → tttx-button.cjs.entry.js} +24 -50
- package/dist/cjs/tttx-form.cjs.entry.js +364 -364
- package/dist/cjs/tttx-icon.cjs.entry.js +21 -0
- package/dist/cjs/tttx-keyvalue-block.cjs.entry.js +57 -57
- package/dist/cjs/tttx-list.cjs.entry.js +76 -46
- package/dist/cjs/tttx-loading-spinner.cjs.entry.js +16 -16
- package/dist/cjs/tttx-standalone-input.cjs.entry.js +61 -58
- package/dist/cjs/tttx-toolbar.cjs.entry.js +20 -0
- package/dist/cjs/tttx.cjs.js +117 -9
- package/dist/collection/collection-manifest.json +4 -3
- package/dist/collection/components/atoms/tttx-button/test/tttx-button.e2e.js +9 -0
- package/dist/collection/components/atoms/tttx-button/test/tttx-button.spec.js +83 -0
- package/dist/collection/components/atoms/tttx-button/tttx-button.js +110 -116
- package/dist/collection/components/atoms/tttx-button/tttx-button.stories.js +14 -14
- package/dist/collection/components/atoms/tttx-icon/test/tttx-icon.e2e.js +9 -0
- package/dist/collection/components/atoms/tttx-icon/test/tttx-icon.spec.js +16 -0
- package/dist/collection/components/atoms/tttx-icon/tttx-icon.css +4 -0
- 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/test/tttx-keyvalue-block.spec.js +216 -0
- package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.js +107 -107
- package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.js +38 -38
- package/dist/collection/components/atoms/tttx-loading-spinner/Test/tttx-loading-spinner.spec.js +64 -0
- 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-form/lib/setErrorState.js +35 -35
- package/dist/collection/components/molecules/tttx-form/lib/setErrorState.spec.js +38 -0
- package/dist/collection/components/molecules/tttx-form/lib/validityCheck.js +58 -58
- package/dist/collection/components/molecules/tttx-form/lib/validityCheck.spec.js +214 -0
- package/dist/collection/components/molecules/tttx-form/test/tttx-form.e2e.js +9 -0
- package/dist/collection/components/molecules/tttx-form/test/tttx-form.spec.js +232 -0
- package/dist/collection/components/molecules/tttx-form/tttx-form.css +32 -3
- 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/test/ttttx-list.spec.e2e.js +26 -0
- package/dist/collection/components/molecules/tttx-list/test/tttx-list.spec.js +183 -0
- 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/test/tttx-standalone-input.e2e.js +9 -0
- package/dist/collection/components/molecules/tttx-standalone-input/test/tttx-standalone-input.spec.js +219 -0
- package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.css +32 -3
- package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.js +627 -572
- package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.js +148 -135
- package/dist/collection/components/molecules/tttx-toolbar/test/tttx-toolbar.test.js +0 -0
- package/dist/collection/components/molecules/tttx-toolbar/tttx-toolbar.css +30 -0
- package/dist/collection/components/molecules/tttx-toolbar/tttx-toolbar.js +44 -0
- package/dist/collection/components/molecules/tttx-toolbar/tttx-toolbar.stories.js +20 -0
- 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/collection/shared/test/domsanitiser.options.spec.js +23 -0
- package/dist/components/index.d.ts +1 -9
- package/dist/components/index.js +6 -1
- package/dist/components/tttx-button.js +48 -59
- package/dist/components/tttx-form.js +381 -381
- package/dist/components/tttx-icon2.js +29 -29
- package/dist/components/tttx-keyvalue-block.js +74 -74
- package/dist/components/tttx-list.js +98 -68
- package/dist/components/tttx-loading-spinner.js +33 -33
- package/dist/components/tttx-standalone-input.js +108 -102
- package/dist/components/tttx-toolbar.d.ts +11 -0
- package/dist/components/tttx-toolbar.js +36 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/css-shim-9d54a2f2.js +4 -0
- package/dist/esm/dom-6be6f662.js +73 -0
- package/dist/esm/{index-4010ad69.js → index-0350f122.js} +4 -101
- package/dist/esm/index-dbe25028.js +3262 -0
- package/dist/esm/loader.js +19 -4
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/css-shim.js +1 -1
- 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/shadow-css-ed4599f8.js +387 -0
- package/dist/esm/{tttx-button_2.entry.js → tttx-button.entry.js} +25 -50
- package/dist/esm/tttx-form.entry.js +364 -364
- package/dist/esm/tttx-icon.entry.js +17 -0
- package/dist/esm/tttx-keyvalue-block.entry.js +57 -57
- package/dist/esm/tttx-list.entry.js +76 -46
- package/dist/esm/tttx-loading-spinner.entry.js +16 -16
- package/dist/esm/tttx-standalone-input.entry.js +61 -58
- package/dist/esm/tttx-toolbar.entry.js +16 -0
- package/dist/esm/tttx.js +117 -6
- package/dist/tttx/app-globals-0f993ce5.js +3 -0
- package/dist/tttx/css-shim-9d54a2f2.js +4 -0
- package/dist/tttx/dom-6be6f662.js +73 -0
- package/dist/tttx/index-dbe25028.js +3262 -0
- package/dist/tttx/index.esm.js +1 -0
- package/dist/tttx/p-0a85dda4.entry.js +1 -0
- package/dist/tttx/{p-3281444a.entry.js → p-1b015a9d.entry.js} +1 -1
- package/dist/tttx/p-4f3958fa.entry.js +1 -0
- package/dist/tttx/p-5cae1beb.entry.js +1 -0
- package/dist/tttx/p-62869344.js +2 -0
- package/dist/tttx/p-92465671.entry.js +1 -0
- package/dist/tttx/{p-dab7ee1b.entry.js → p-a0179cb1.entry.js} +1 -1
- package/dist/tttx/p-cc6644c9.entry.js +1 -0
- package/dist/tttx/p-cd1565e0.entry.js +3 -0
- package/dist/tttx/shadow-css-ed4599f8.js +387 -0
- package/dist/tttx/tttx-button.entry.js +30 -0
- package/dist/tttx/tttx-form.entry.js +373 -0
- package/dist/tttx/tttx-icon.entry.js +17 -0
- package/dist/tttx/tttx-keyvalue-block.entry.js +63 -0
- package/dist/tttx/tttx-list.entry.js +1730 -0
- package/dist/tttx/tttx-loading-spinner.entry.js +22 -0
- package/dist/tttx/tttx-standalone-input.entry.js +66 -0
- package/dist/tttx/tttx-toolbar.entry.js +16 -0
- package/dist/tttx/tttx.esm.js +129 -1
- package/dist/types/components/atoms/tttx-button/test/tttx-button.e2e.d.ts +1 -0
- package/dist/types/components/atoms/tttx-button/test/tttx-button.spec.d.ts +1 -0
- package/dist/types/components/atoms/tttx-button/tttx-button.d.ts +10 -13
- package/dist/types/components/atoms/tttx-button/tttx-button.stories.d.ts +10 -10
- package/dist/types/components/atoms/tttx-icon/test/tttx-icon.e2e.d.ts +1 -0
- package/dist/types/components/atoms/tttx-icon/test/tttx-icon.spec.d.ts +1 -0
- 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/test/tttx-keyvalue-block.spec.d.ts +1 -0
- 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/Test/tttx-loading-spinner.spec.d.ts +1 -0
- 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-form/lib/setErrorState.d.ts +13 -13
- package/dist/types/components/molecules/tttx-form/lib/setErrorState.spec.d.ts +1 -0
- package/dist/types/components/molecules/tttx-form/lib/validityCheck.d.ts +17 -17
- package/dist/types/components/molecules/tttx-form/lib/validityCheck.spec.d.ts +1 -0
- package/dist/types/components/molecules/tttx-form/test/tttx-form.e2e.d.ts +1 -0
- package/dist/types/components/molecules/tttx-form/test/tttx-form.spec.d.ts +1 -0
- 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/test/ttttx-list.spec.e2e.d.ts +1 -0
- package/dist/types/components/molecules/tttx-list/test/tttx-list.spec.d.ts +1 -0
- 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/test/tttx-standalone-input.e2e.d.ts +1 -0
- package/dist/types/components/molecules/tttx-standalone-input/test/tttx-standalone-input.spec.d.ts +1 -0
- package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.d.ts +56 -53
- package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.d.ts +122 -106
- package/dist/types/components/molecules/tttx-toolbar/test/tttx-toolbar.test.d.ts +0 -0
- package/dist/types/components/molecules/tttx-toolbar/tttx-toolbar.d.ts +4 -0
- package/dist/types/components/molecules/tttx-toolbar/tttx-toolbar.stories.d.ts +13 -0
- package/dist/types/components/palette.stories.d.ts +6 -6
- package/dist/types/components.d.ts +21 -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/dist/types/shared/test/domsanitiser.options.spec.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +3 -59
- package/loader/index.d.ts +0 -9
- package/package.json +1 -1
- package/dist/collection/transform-tag-name.js +0 -5
- package/dist/tttx/p-083eeedc.entry.js +0 -1
- package/dist/tttx/p-5687f4ad.js +0 -2
- package/dist/tttx/p-5c9a1626.entry.js +0 -3
- package/dist/tttx/p-931e42c9.entry.js +0 -1
- package/dist/tttx/p-b5c1dd86.entry.js +0 -1
- package/dist/types/transform-tag-name.d.ts +0 -1
package/dist/cjs/tttx.cjs.js
CHANGED
|
@@ -1,23 +1,131 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const index = require('./index-906c2757.js');
|
|
3
|
+
const index = require('./index-11cfdabe.js');
|
|
4
|
+
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
6
5
|
|
|
7
6
|
/*
|
|
8
|
-
Stencil Client Patch Browser v2.
|
|
7
|
+
Stencil Client Patch Browser v2.20.0 | MIT Licensed | https://stenciljs.com
|
|
9
8
|
*/
|
|
9
|
+
const getDynamicImportFunction = (namespace) => `__sc_import_${namespace.replace(/\s|-/g, '_')}`;
|
|
10
10
|
const patchBrowser = () => {
|
|
11
|
+
// NOTE!! This fn cannot use async/await!
|
|
12
|
+
if (index.BUILD.isDev && !index.BUILD.isTesting) {
|
|
13
|
+
index.consoleDevInfo('Running in development mode.');
|
|
14
|
+
}
|
|
15
|
+
if (index.BUILD.cssVarShim) {
|
|
16
|
+
// shim css vars
|
|
17
|
+
index.plt.$cssShim$ = index.win.__cssshim;
|
|
18
|
+
}
|
|
19
|
+
if (index.BUILD.cloneNodeFix) {
|
|
20
|
+
// opted-in to polyfill cloneNode() for slot polyfilled components
|
|
21
|
+
patchCloneNodeFix(index.H.prototype);
|
|
22
|
+
}
|
|
23
|
+
if (index.BUILD.profile && !performance.mark) {
|
|
24
|
+
// not all browsers support performance.mark/measure (Safari 10)
|
|
25
|
+
// because the mark/measure APIs are designed to write entries to a buffer in the browser that does not exist,
|
|
26
|
+
// simply stub the implementations out.
|
|
27
|
+
// TODO(STENCIL-323): Remove this patch when support for older browsers is removed (breaking)
|
|
28
|
+
// @ts-ignore
|
|
29
|
+
performance.mark = performance.measure = () => {
|
|
30
|
+
/*noop*/
|
|
31
|
+
};
|
|
32
|
+
performance.getEntriesByName = () => [];
|
|
33
|
+
}
|
|
34
|
+
// @ts-ignore
|
|
35
|
+
const scriptElm = index.BUILD.scriptDataOpts || index.BUILD.safari10 || index.BUILD.dynamicImportShim
|
|
36
|
+
? Array.from(index.doc.querySelectorAll('script')).find((s) => new RegExp(`\/${index.NAMESPACE}(\\.esm)?\\.js($|\\?|#)`).test(s.src) ||
|
|
37
|
+
s.getAttribute('data-stencil-namespace') === index.NAMESPACE)
|
|
38
|
+
: null;
|
|
11
39
|
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('tttx.cjs.js', document.baseURI).href));
|
|
12
|
-
const opts = {};
|
|
13
|
-
if (
|
|
40
|
+
const opts = index.BUILD.scriptDataOpts ? scriptElm['data-opts'] || {} : {};
|
|
41
|
+
if (index.BUILD.safari10 && 'onbeforeload' in scriptElm && !history.scrollRestoration /* IS_ESM_BUILD */) {
|
|
42
|
+
// Safari < v11 support: This IF is true if it's Safari below v11.
|
|
43
|
+
// This fn cannot use async/await since Safari didn't support it until v11,
|
|
44
|
+
// however, Safari 10 did support modules. Safari 10 also didn't support "nomodule",
|
|
45
|
+
// so both the ESM file and nomodule file would get downloaded. Only Safari
|
|
46
|
+
// has 'onbeforeload' in the script, and "history.scrollRestoration" was added
|
|
47
|
+
// to Safari in v11. Return a noop then() so the async/await ESM code doesn't continue.
|
|
48
|
+
// IS_ESM_BUILD is replaced at build time so this check doesn't happen in systemjs builds.
|
|
49
|
+
return {
|
|
50
|
+
then() {
|
|
51
|
+
/* promise noop */
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
if (!index.BUILD.safari10 && importMeta !== '') {
|
|
14
56
|
opts.resourcesUrl = new URL('.', importMeta).href;
|
|
15
57
|
}
|
|
58
|
+
else if (index.BUILD.dynamicImportShim || index.BUILD.safari10) {
|
|
59
|
+
opts.resourcesUrl = new URL('.', new URL(scriptElm.getAttribute('data-resources-url') || scriptElm.src, index.win.location.href)).href;
|
|
60
|
+
if (index.BUILD.dynamicImportShim) {
|
|
61
|
+
patchDynamicImport(opts.resourcesUrl, scriptElm);
|
|
62
|
+
}
|
|
63
|
+
if (index.BUILD.dynamicImportShim && !index.win.customElements) {
|
|
64
|
+
// module support, but no custom elements support (Old Edge)
|
|
65
|
+
// @ts-ignore
|
|
66
|
+
return Promise.resolve().then(function () { return require(/* webpackChunkName: "polyfills-dom" */ './dom-9deb26c8.js'); }).then(() => opts);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
16
69
|
return index.promiseResolve(opts);
|
|
17
70
|
};
|
|
71
|
+
const patchDynamicImport = (base, orgScriptElm) => {
|
|
72
|
+
const importFunctionName = getDynamicImportFunction(index.NAMESPACE);
|
|
73
|
+
try {
|
|
74
|
+
// test if this browser supports dynamic imports
|
|
75
|
+
// There is a caching issue in V8, that breaks using import() in Function
|
|
76
|
+
// By generating a random string, we can workaround it
|
|
77
|
+
// Check https://bugs.chromium.org/p/chromium/issues/detail?id=990810 for more info
|
|
78
|
+
index.win[importFunctionName] = new Function('w', `return import(w);//${Math.random()}`);
|
|
79
|
+
}
|
|
80
|
+
catch (e) {
|
|
81
|
+
// this shim is specifically for browsers that do support "esm" imports
|
|
82
|
+
// however, they do NOT support "dynamic" imports
|
|
83
|
+
// basically this code is for old Edge, v18 and below
|
|
84
|
+
const moduleMap = new Map();
|
|
85
|
+
index.win[importFunctionName] = (src) => {
|
|
86
|
+
const url = new URL(src, base).href;
|
|
87
|
+
let mod = moduleMap.get(url);
|
|
88
|
+
if (!mod) {
|
|
89
|
+
const script = index.doc.createElement('script');
|
|
90
|
+
script.type = 'module';
|
|
91
|
+
script.crossOrigin = orgScriptElm.crossOrigin;
|
|
92
|
+
script.src = URL.createObjectURL(new Blob([`import * as m from '${url}'; window.${importFunctionName}.m = m;`], {
|
|
93
|
+
type: 'application/javascript',
|
|
94
|
+
}));
|
|
95
|
+
mod = new Promise((resolve) => {
|
|
96
|
+
script.onload = () => {
|
|
97
|
+
resolve(index.win[importFunctionName].m);
|
|
98
|
+
script.remove();
|
|
99
|
+
};
|
|
100
|
+
});
|
|
101
|
+
moduleMap.set(url, mod);
|
|
102
|
+
index.doc.head.appendChild(script);
|
|
103
|
+
}
|
|
104
|
+
return mod;
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
const patchCloneNodeFix = (HTMLElementPrototype) => {
|
|
109
|
+
const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;
|
|
110
|
+
HTMLElementPrototype.cloneNode = function (deep) {
|
|
111
|
+
if (this.nodeName === 'TEMPLATE') {
|
|
112
|
+
return nativeCloneNodeFn.call(this, deep);
|
|
113
|
+
}
|
|
114
|
+
const clonedNode = nativeCloneNodeFn.call(this, false);
|
|
115
|
+
const srcChildNodes = this.childNodes;
|
|
116
|
+
if (deep) {
|
|
117
|
+
for (let i = 0; i < srcChildNodes.length; i++) {
|
|
118
|
+
// Node.ATTRIBUTE_NODE === 2, and checking because IE11
|
|
119
|
+
if (srcChildNodes[i].nodeType !== 2) {
|
|
120
|
+
clonedNode.appendChild(srcChildNodes[i].cloneNode(true));
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return clonedNode;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
18
127
|
|
|
19
128
|
patchBrowser().then(options => {
|
|
20
|
-
|
|
129
|
+
appGlobals.globalScripts();
|
|
130
|
+
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);
|
|
21
131
|
});
|
|
22
|
-
|
|
23
|
-
exports.setNonce = index.setNonce;
|
|
@@ -6,12 +6,13 @@
|
|
|
6
6
|
"./components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.js",
|
|
7
7
|
"./components/atoms/tttx-loading-spinner/tttx-loading-spinner.js",
|
|
8
8
|
"./components/molecules/tttx-form/tttx-form.js",
|
|
9
|
-
"./components/molecules/tttx-list/tttx-list.js"
|
|
9
|
+
"./components/molecules/tttx-list/tttx-list.js",
|
|
10
|
+
"./components/molecules/tttx-toolbar/tttx-toolbar.js"
|
|
10
11
|
],
|
|
11
12
|
"compiler": {
|
|
12
13
|
"name": "@stencil/core",
|
|
13
|
-
"version": "2.
|
|
14
|
-
"typescriptVersion": "4.
|
|
14
|
+
"version": "2.20.0",
|
|
15
|
+
"typescriptVersion": "4.8.4"
|
|
15
16
|
},
|
|
16
17
|
"collections": [],
|
|
17
18
|
"bundles": []
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { newE2EPage } from '@stencil/core/testing';
|
|
2
|
+
describe('tttx-button', () => {
|
|
3
|
+
it('renders', async () => {
|
|
4
|
+
const page = await newE2EPage();
|
|
5
|
+
await page.setContent('<tttx-button></tttx-button>');
|
|
6
|
+
const element = await page.find('tttx-button');
|
|
7
|
+
expect(element).toHaveClass('hydrated');
|
|
8
|
+
});
|
|
9
|
+
});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { newSpecPage } from '@stencil/core/testing';
|
|
2
|
+
import { TttxButton } from '../tttx-button';
|
|
3
|
+
describe('tttx-button', () => {
|
|
4
|
+
it('renders', async () => {
|
|
5
|
+
const page = await newSpecPage({
|
|
6
|
+
components: [TttxButton],
|
|
7
|
+
html: '<tttx-button></tttx-button>',
|
|
8
|
+
});
|
|
9
|
+
expect(page.root).toEqualHtml(`
|
|
10
|
+
<tttx-button>
|
|
11
|
+
<mock:shadow-root>
|
|
12
|
+
<button class="button default">
|
|
13
|
+
<div class="button-content">
|
|
14
|
+
<slot></slot>
|
|
15
|
+
</div>
|
|
16
|
+
</button>
|
|
17
|
+
</mock:shadow-root>
|
|
18
|
+
</tttx-button>
|
|
19
|
+
`);
|
|
20
|
+
});
|
|
21
|
+
it('renders a white icon', async () => {
|
|
22
|
+
const page = await newSpecPage({
|
|
23
|
+
components: [TttxButton],
|
|
24
|
+
html: '<tttx-button design="primary" icon="person"></tttx-button>',
|
|
25
|
+
});
|
|
26
|
+
expect(page.root).toEqualHtml(`
|
|
27
|
+
<tttx-button design="primary" icon="person">
|
|
28
|
+
<mock:shadow-root>
|
|
29
|
+
<button class="button iconleft primary withicon">
|
|
30
|
+
<div class="icon-left">
|
|
31
|
+
<tttx-icon color="white" icon="person"></tttx-icon>
|
|
32
|
+
</div>
|
|
33
|
+
<div class="button-content">
|
|
34
|
+
<slot></slot>
|
|
35
|
+
</div>
|
|
36
|
+
</button>
|
|
37
|
+
</mock:shadow-root>
|
|
38
|
+
</tttx-button>
|
|
39
|
+
`);
|
|
40
|
+
});
|
|
41
|
+
it('design doesn\'t exist', async () => {
|
|
42
|
+
const page = await newSpecPage({
|
|
43
|
+
components: [TttxButton],
|
|
44
|
+
html: '<tttx-button design="memphis" icon="person"></tttx-button>',
|
|
45
|
+
});
|
|
46
|
+
expect(page.root).toEqualHtml(`
|
|
47
|
+
<tttx-button design="memphis" icon="person">
|
|
48
|
+
<mock:shadow-root>
|
|
49
|
+
<button class="button default iconleft withicon">
|
|
50
|
+
<div class="icon-left">
|
|
51
|
+
<tttx-icon color="black" icon="person"></tttx-icon>
|
|
52
|
+
</div>
|
|
53
|
+
<div class="button-content">
|
|
54
|
+
<slot></slot>
|
|
55
|
+
</div>
|
|
56
|
+
</button>
|
|
57
|
+
</mock:shadow-root>
|
|
58
|
+
</tttx-button>
|
|
59
|
+
`);
|
|
60
|
+
});
|
|
61
|
+
it('clicks', async () => {
|
|
62
|
+
const page = await newSpecPage({
|
|
63
|
+
components: [TttxButton],
|
|
64
|
+
html: '<tttx-button></tttx-button>',
|
|
65
|
+
});
|
|
66
|
+
expect(page.root).toEqualHtml(`
|
|
67
|
+
<tttx-button>
|
|
68
|
+
<mock:shadow-root>
|
|
69
|
+
<button class="button default">
|
|
70
|
+
<div class="button-content">
|
|
71
|
+
<slot></slot>
|
|
72
|
+
</div>
|
|
73
|
+
</button>
|
|
74
|
+
</mock:shadow-root>
|
|
75
|
+
</tttx-button>
|
|
76
|
+
`);
|
|
77
|
+
const callbackFn = jest.fn();
|
|
78
|
+
// add an event listener directly to the tttx-button host and click it
|
|
79
|
+
page.root.addEventListener('click', callbackFn);
|
|
80
|
+
page.root.click();
|
|
81
|
+
expect(callbackFn).toHaveBeenCalled();
|
|
82
|
+
});
|
|
83
|
+
});
|
|
@@ -1,116 +1,110 @@
|
|
|
1
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
-
import { Host, h } from '@stencil/core';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
this.
|
|
7
|
-
this.
|
|
8
|
-
this.
|
|
9
|
-
this.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
this._design
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
static get
|
|
32
|
-
return {
|
|
33
|
-
"$": ["tttx-button.
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
static get
|
|
37
|
-
return {
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
"
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
"
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
"
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
"defaultValue": "'default'"
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
static get elementRef() { return "el"; }
|
|
116
|
-
}
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import { Host, h } from '@stencil/core';
|
|
3
|
+
export class TttxButton {
|
|
4
|
+
constructor() {
|
|
5
|
+
this._iconcolor = 'black';
|
|
6
|
+
this.notext = undefined;
|
|
7
|
+
this.icon = undefined;
|
|
8
|
+
this.iconposition = 'left';
|
|
9
|
+
this.design = 'default';
|
|
10
|
+
}
|
|
11
|
+
componentWillLoad() {
|
|
12
|
+
this._design = this.design;
|
|
13
|
+
const designs = ['primary', 'default', 'disabled', 'danger', 'borderless'];
|
|
14
|
+
if (!designs.includes(this.design)) {
|
|
15
|
+
this._design = 'default';
|
|
16
|
+
}
|
|
17
|
+
if (this._design === 'primary' || this._design === 'danger') {
|
|
18
|
+
this._iconcolor = 'white';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
return (h(Host, null, h("button", { class: `button ${this._design} ${this.icon ? 'withicon' : ''} ${this.icon && this.iconposition ? 'icon' + this.iconposition : ''} ${this.notext ? 'notext' : ''}` }, this.icon && this.iconposition === 'left' && (h("div", { class: "icon-left" }, h("tttx-icon", { icon: this.icon, color: this._iconcolor }))), !this.notext && h("div", { class: "button-content" }, h("slot", null)), this.icon && this.iconposition === 'right' && (h("div", { class: "icon-right" }, h("tttx-icon", { icon: this.icon, color: this._iconcolor }))))));
|
|
23
|
+
}
|
|
24
|
+
static get is() { return "tttx-button"; }
|
|
25
|
+
static get encapsulation() { return "shadow"; }
|
|
26
|
+
static get originalStyleUrls() {
|
|
27
|
+
return {
|
|
28
|
+
"$": ["tttx-button.scss"]
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
static get styleUrls() {
|
|
32
|
+
return {
|
|
33
|
+
"$": ["tttx-button.css"]
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
static get properties() {
|
|
37
|
+
return {
|
|
38
|
+
"notext": {
|
|
39
|
+
"type": "boolean",
|
|
40
|
+
"mutable": false,
|
|
41
|
+
"complexType": {
|
|
42
|
+
"original": "boolean",
|
|
43
|
+
"resolved": "boolean",
|
|
44
|
+
"references": {}
|
|
45
|
+
},
|
|
46
|
+
"required": false,
|
|
47
|
+
"optional": false,
|
|
48
|
+
"docs": {
|
|
49
|
+
"tags": [],
|
|
50
|
+
"text": ""
|
|
51
|
+
},
|
|
52
|
+
"attribute": "notext",
|
|
53
|
+
"reflect": false
|
|
54
|
+
},
|
|
55
|
+
"icon": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"mutable": false,
|
|
58
|
+
"complexType": {
|
|
59
|
+
"original": "string",
|
|
60
|
+
"resolved": "string",
|
|
61
|
+
"references": {}
|
|
62
|
+
},
|
|
63
|
+
"required": false,
|
|
64
|
+
"optional": false,
|
|
65
|
+
"docs": {
|
|
66
|
+
"tags": [],
|
|
67
|
+
"text": ""
|
|
68
|
+
},
|
|
69
|
+
"attribute": "icon",
|
|
70
|
+
"reflect": false
|
|
71
|
+
},
|
|
72
|
+
"iconposition": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"mutable": false,
|
|
75
|
+
"complexType": {
|
|
76
|
+
"original": "'left' | 'right'",
|
|
77
|
+
"resolved": "\"left\" | \"right\"",
|
|
78
|
+
"references": {}
|
|
79
|
+
},
|
|
80
|
+
"required": false,
|
|
81
|
+
"optional": false,
|
|
82
|
+
"docs": {
|
|
83
|
+
"tags": [],
|
|
84
|
+
"text": ""
|
|
85
|
+
},
|
|
86
|
+
"attribute": "iconposition",
|
|
87
|
+
"reflect": false,
|
|
88
|
+
"defaultValue": "'left'"
|
|
89
|
+
},
|
|
90
|
+
"design": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"mutable": false,
|
|
93
|
+
"complexType": {
|
|
94
|
+
"original": "string",
|
|
95
|
+
"resolved": "string",
|
|
96
|
+
"references": {}
|
|
97
|
+
},
|
|
98
|
+
"required": false,
|
|
99
|
+
"optional": false,
|
|
100
|
+
"docs": {
|
|
101
|
+
"tags": [],
|
|
102
|
+
"text": ""
|
|
103
|
+
},
|
|
104
|
+
"attribute": "design",
|
|
105
|
+
"reflect": false,
|
|
106
|
+
"defaultValue": "'default'"
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
title: 'Atoms/Button',
|
|
3
|
-
component: 'tttx-button'
|
|
4
|
-
};
|
|
1
|
+
export default {
|
|
2
|
+
title: 'Atoms/Button',
|
|
3
|
+
component: 'tttx-button'
|
|
4
|
+
};
|
|
5
5
|
const PrimaryButtons = () => `
|
|
6
6
|
<h2>Standard</h2>
|
|
7
7
|
<tttx-button design="primary">Primary</tttx-button>
|
|
@@ -14,8 +14,8 @@ const PrimaryButtons = () => `
|
|
|
14
14
|
<hr />
|
|
15
15
|
<h2>Icon Only</h2>
|
|
16
16
|
<tttx-button design="primary" icon="more_vert" notext></tttx-button>
|
|
17
|
-
`;
|
|
18
|
-
export const Primary = PrimaryButtons.bind({});
|
|
17
|
+
`;
|
|
18
|
+
export const Primary = PrimaryButtons.bind({});
|
|
19
19
|
const DefaultButtons = () => `
|
|
20
20
|
<h2>Standard</h2>
|
|
21
21
|
<tttx-button>Default</tttx-button>
|
|
@@ -28,8 +28,8 @@ const DefaultButtons = () => `
|
|
|
28
28
|
<hr />
|
|
29
29
|
<h2>Icon Only</h2>
|
|
30
30
|
<tttx-button icon="more_vert" notext></tttx-button>
|
|
31
|
-
`;
|
|
32
|
-
export const Default = DefaultButtons.bind({});
|
|
31
|
+
`;
|
|
32
|
+
export const Default = DefaultButtons.bind({});
|
|
33
33
|
const BorderlessButtons = () => `
|
|
34
34
|
<h2>Standard</h2>
|
|
35
35
|
<tttx-button design="borderless">Borderless</tttx-button>
|
|
@@ -42,8 +42,8 @@ const BorderlessButtons = () => `
|
|
|
42
42
|
<hr />
|
|
43
43
|
<h2>Icon Only</h2>
|
|
44
44
|
<tttx-button design="borderless" icon="more_vert" notext></tttx-button>
|
|
45
|
-
`;
|
|
46
|
-
export const Borderless = BorderlessButtons.bind({});
|
|
45
|
+
`;
|
|
46
|
+
export const Borderless = BorderlessButtons.bind({});
|
|
47
47
|
const DangerButtons = () => `
|
|
48
48
|
<h2>Standard</h2>
|
|
49
49
|
<tttx-button design="danger">Danger</tttx-button>
|
|
@@ -56,8 +56,8 @@ const DangerButtons = () => `
|
|
|
56
56
|
<hr />
|
|
57
57
|
<h2>Icon Only</h2>
|
|
58
58
|
<tttx-button design="danger" icon="more_vert" notext></tttx-button>
|
|
59
|
-
`;
|
|
60
|
-
export const Danger = DangerButtons.bind({});
|
|
59
|
+
`;
|
|
60
|
+
export const Danger = DangerButtons.bind({});
|
|
61
61
|
const DisabledButtons = () => `
|
|
62
62
|
<h2>Standard</h2>
|
|
63
63
|
<tttx-button design="disabled">Disabled</tttx-button>
|
|
@@ -70,5 +70,5 @@ const DisabledButtons = () => `
|
|
|
70
70
|
<hr />
|
|
71
71
|
<h2>Icon Only</h2>
|
|
72
72
|
<tttx-button design="disabled" icon="more_vert" notext></tttx-button>
|
|
73
|
-
`;
|
|
74
|
-
export const Disabled = DisabledButtons.bind({});
|
|
73
|
+
`;
|
|
74
|
+
export const Disabled = DisabledButtons.bind({});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { newE2EPage } from '@stencil/core/testing';
|
|
2
|
+
describe('tttx-icon', () => {
|
|
3
|
+
it('renders', async () => {
|
|
4
|
+
const page = await newE2EPage();
|
|
5
|
+
await page.setContent('<tttx-icon></tttx-icon>');
|
|
6
|
+
const element = await page.find('tttx-icon');
|
|
7
|
+
expect(element).toHaveClass('hydrated');
|
|
8
|
+
});
|
|
9
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { newSpecPage } from '@stencil/core/testing';
|
|
2
|
+
import { TttxIcon } from '../tttx-icon';
|
|
3
|
+
describe('tttx-icon', () => {
|
|
4
|
+
it('renders', async () => {
|
|
5
|
+
const page = await newSpecPage({
|
|
6
|
+
components: [TttxIcon],
|
|
7
|
+
html: '<tttx-icon color="danger" icon="warning"></tttx-icon>',
|
|
8
|
+
});
|
|
9
|
+
expect(page.root).toEqualHtml(`
|
|
10
|
+
<tttx-icon color="danger" icon="warning">
|
|
11
|
+
<mock:shadow-root>
|
|
12
|
+
<span class="material-symbols-rounded danger">warning</span>
|
|
13
|
+
</mock:shadow-root>
|
|
14
|
+
</tttx-icon>`);
|
|
15
|
+
});
|
|
16
|
+
});
|