@3t-transform/threeteeui 0.0.2 → 0.0.3

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.
@@ -38,7 +38,7 @@ const TttxWorksheet = class {
38
38
  });
39
39
  }
40
40
  render() {
41
- const customPageWidth = this.pageSizeIsNumeric ? { width: `${this.pageSize}px` } : {};
41
+ const customPageWidth = this.pageSizeIsNumeric() ? { width: `${this.pageSize}px` } : {};
42
42
  return (index.h(index.Host, null, index.h("div", { class: this.pageSizeClasses('worksheet__container'), style: Object.assign({}, customPageWidth) }, index.h("slot", null), index.h("div", { class: `worksheet__footer--${this.pageSize}`, ref: el => (this.footerBar = el) }))));
43
43
  }
44
44
  };
@@ -31,7 +31,7 @@ export class TttxWorksheet {
31
31
  });
32
32
  }
33
33
  render() {
34
- const customPageWidth = this.pageSizeIsNumeric ? { width: `${this.pageSize}px` } : {};
34
+ const customPageWidth = this.pageSizeIsNumeric() ? { width: `${this.pageSize}px` } : {};
35
35
  return (h(Host, null, h("div", { class: this.pageSizeClasses('worksheet__container'), style: Object.assign({}, customPageWidth) }, h("slot", null), h("div", { class: `worksheet__footer--${this.pageSize}`, ref: el => (this.footerBar = el) }))));
36
36
  }
37
37
  static get is() { return "tttx-worksheet"; }
@@ -34264,7 +34264,7 @@ const TttxWorksheet = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
34264
34264
  });
34265
34265
  }
34266
34266
  render() {
34267
- const customPageWidth = this.pageSizeIsNumeric ? { width: `${this.pageSize}px` } : {};
34267
+ const customPageWidth = this.pageSizeIsNumeric() ? { width: `${this.pageSize}px` } : {};
34268
34268
  return (h(Host, null, h("div", { class: this.pageSizeClasses('worksheet__container'), style: Object.assign({}, customPageWidth) }, h("slot", null), h("div", { class: `worksheet__footer--${this.pageSize}`, ref: el => (this.footerBar = el) }))));
34269
34269
  }
34270
34270
  static get style() { return tttxWorksheetCss; }
@@ -34,7 +34,7 @@ const TttxWorksheet = class {
34
34
  });
35
35
  }
36
36
  render() {
37
- const customPageWidth = this.pageSizeIsNumeric ? { width: `${this.pageSize}px` } : {};
37
+ const customPageWidth = this.pageSizeIsNumeric() ? { width: `${this.pageSize}px` } : {};
38
38
  return (h(Host, null, h("div", { class: this.pageSizeClasses('worksheet__container'), style: Object.assign({}, customPageWidth) }, h("slot", null), h("div", { class: `worksheet__footer--${this.pageSize}`, ref: el => (this.footerBar = el) }))));
39
39
  }
40
40
  };
@@ -0,0 +1 @@
1
+ import{r as t,h as e,H as o}from"./p-2681b874.js";import{T as s,a as i}from"./p-d038fe18.js";const r=class{constructor(e){t(this,e),this.pageSize="large"}componentDidLoad(){this.footer()}pageSizeIsNumeric(){return/^\d+$/.test(this.pageSize)}pageSizeClasses(t){return this.pageSizeIsNumeric()?t:`${t}--${this.pageSize}`}footer(){["medium","small"].includes(this.pageSize)&&new s(this.footerBar,{items:[{location:"after",widget:i,options:{text:"save"}}]})}render(){const t=this.pageSizeIsNumeric()?{width:`${this.pageSize}px`}:{};return e(o,null,e("div",{class:this.pageSizeClasses("worksheet__container"),style:Object.assign({},t)},e("slot",null),e("div",{class:`worksheet__footer--${this.pageSize}`,ref:t=>this.footerBar=t})))}};r.style='@import url("https://fonts.googleapis.com/css?family=Roboto&display=swap");*{box-sizing:border-box}.flex-start{justify-content:start}.flex-end{justify-content:end}.flex-centre{justify-content:center}[class^=col-]{display:flex;padding-left:8px !important;padding-right:8px !important}h1,h2,h3,h4,h5,h6,p,label,small{margin:0;padding:0}h1,h2,h3,h4,h5,h6,p,label{display:block}*{font-family:"Roboto", sans-serif}html,body{font-weight:normal;font-size:16px}h1{font-weight:700;font-size:24px}h2{font-weight:700;font-size:20px}h3{font-weight:700;font-size:18px}h4{font-weight:normal;font-size:14px;text-transform:uppercase}button{font-weight:500;font-size:14px;text-transform:uppercase}small{font-weight:normal;font-size:14px}label{font-weight:700;font-size:16px}:host{display:block}.worksheet__container,.worksheet__container--large,.worksheet__container--medium,.worksheet__container--small{position:absolute;top:104px;bottom:8px;left:0px;right:0px;overflow:auto;background-color:#ffffff;clear:both}.worksheet__container,.worksheet__container--medium,.worksheet__container--small,.worksheet__footer--medium,.worksheet__footer--small{margin:0px auto}.worksheet__container--large{margin:0px 16px}.worksheet__container--medium{width:900px}.worksheet__container--small{width:600px}.worksheet__footer--medium.dx-toolbar,.worksheet__footer--small.dx-toolbar{position:fixed;bottom:0px;left:0px;right:0px;padding:0 8px}.worksheet__footer--medium.dx-toolbar{width:900px}.worksheet__footer--small.dx-toolbar{width:600px}';export{r as tttx_worksheet}
@@ -1 +1 @@
1
- import{p as e,b as a}from"./p-2681b874.js";(()=>{const a=import.meta.url,t={};return""!==a&&(t.resourcesUrl=new URL(".",a).href),e(t)})().then((e=>a([["p-d5c31f03",[[4,"tttx-worksheet",{pageSize:[1,"page-size"]}]]],["p-285977b3",[[4,"tttx-page",{appName:[1,"app-name"],pageTitle:[1,"page-title"],lastUpdated:[1,"last-updated"],manageAccountsUrl:[1,"manage-accounts-url"],logoutUrl:[1,"logout-url"],pageSize:[1,"page-size"],helpUrl:[1,"help-url"]}]]]],e)));
1
+ import{p as e,b as a}from"./p-2681b874.js";(()=>{const a=import.meta.url,t={};return""!==a&&(t.resourcesUrl=new URL(".",a).href),e(t)})().then((e=>a([["p-997a8339",[[4,"tttx-worksheet",{pageSize:[1,"page-size"]}]]],["p-285977b3",[[4,"tttx-page",{appName:[1,"app-name"],pageTitle:[1,"page-title"],lastUpdated:[1,"last-updated"],manageAccountsUrl:[1,"manage-accounts-url"],logoutUrl:[1,"logout-url"],pageSize:[1,"page-size"],helpUrl:[1,"help-url"]}]]]],e)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@3t-transform/threeteeui",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "3t Design System",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
package/readme.md CHANGED
@@ -66,7 +66,17 @@ When creating new component tags, we recommend _not_ using `stencil` in the comp
66
66
 
67
67
  Instead, use a prefix that fits your company or any name for a group of related components. For example, all of the Ionic generated web components use the prefix `ion`.
68
68
 
69
- We suggest: `<threetee-button>` for example.
69
+ We suggest: `<tttx-button>` for example.
70
+
71
+ ## Testing Components
72
+
73
+ Stencil uses a testing framework built using Jest and Puppeteer. It provides support for two types of test: Unit and End-to-End.
74
+
75
+ You can find out more form their [docs](https://stenciljs.com/docs/testing-overview)
76
+
77
+ For our purposes, if you are creating a component that consumes a devextreme component which is itself a container for other components (e.g. a devextreme toolbar that contains a devextreme button), you will want to create an End-to-End test for that.
78
+
79
+ This is because the helper method that builds a test page in the unit tests mocks out HTML elements, and the mock class it provides doesn't define all the methods that devextreme uses when attaching the component to the container, which causes the render to fail. The End-to-End tests build the component in the browser, so we're able to render them there.
70
80
 
71
81
  ## Using this component
72
82
 
@@ -74,6 +84,10 @@ There are three strategies we recommend for using web components built with Sten
74
84
 
75
85
  The first step for all three of these strategies is to [publish to NPM](https://docs.npmjs.com/getting-started/publishing-npm-packages).
76
86
 
87
+ - First, you need to [sign up](https://www.npmjs.com/signup) for an npm account. You will also need to ask an organisation owner to add you as a member of the @3t-transform organisation.
88
+ - Update the `version` in the package.json.
89
+ - Publish the new version with `npm publish @3t-transform/threeteeui`
90
+
77
91
  ### Script tag
78
92
 
79
93
  - Put a script tag similar to this `<script type='module' src='https://unpkg.com/my-component@0.0.1/dist/my-component.esm.js'></script>` in the head of your index.html
@@ -1 +0,0 @@
1
- import{r as t,h as e,H as o}from"./p-2681b874.js";import{T as s,a as i}from"./p-d038fe18.js";const r=class{constructor(e){t(this,e),this.pageSize="large"}componentDidLoad(){this.footer()}pageSizeIsNumeric(){return/^\d+$/.test(this.pageSize)}pageSizeClasses(t){return this.pageSizeIsNumeric()?t:`${t}--${this.pageSize}`}footer(){["medium","small"].includes(this.pageSize)&&new s(this.footerBar,{items:[{location:"after",widget:i,options:{text:"save"}}]})}render(){const t=this.pageSizeIsNumeric?{width:`${this.pageSize}px`}:{};return e(o,null,e("div",{class:this.pageSizeClasses("worksheet__container"),style:Object.assign({},t)},e("slot",null),e("div",{class:`worksheet__footer--${this.pageSize}`,ref:t=>this.footerBar=t})))}};r.style='@import url("https://fonts.googleapis.com/css?family=Roboto&display=swap");*{box-sizing:border-box}.flex-start{justify-content:start}.flex-end{justify-content:end}.flex-centre{justify-content:center}[class^=col-]{display:flex;padding-left:8px !important;padding-right:8px !important}h1,h2,h3,h4,h5,h6,p,label,small{margin:0;padding:0}h1,h2,h3,h4,h5,h6,p,label{display:block}*{font-family:"Roboto", sans-serif}html,body{font-weight:normal;font-size:16px}h1{font-weight:700;font-size:24px}h2{font-weight:700;font-size:20px}h3{font-weight:700;font-size:18px}h4{font-weight:normal;font-size:14px;text-transform:uppercase}button{font-weight:500;font-size:14px;text-transform:uppercase}small{font-weight:normal;font-size:14px}label{font-weight:700;font-size:16px}:host{display:block}.worksheet__container,.worksheet__container--large,.worksheet__container--medium,.worksheet__container--small{position:absolute;top:104px;bottom:8px;left:0px;right:0px;overflow:auto;background-color:#ffffff;clear:both}.worksheet__container,.worksheet__container--medium,.worksheet__container--small,.worksheet__footer--medium,.worksheet__footer--small{margin:0px auto}.worksheet__container--large{margin:0px 16px}.worksheet__container--medium{width:900px}.worksheet__container--small{width:600px}.worksheet__footer--medium.dx-toolbar,.worksheet__footer--small.dx-toolbar{position:fixed;bottom:0px;left:0px;right:0px;padding:0 8px}.worksheet__footer--medium.dx-toolbar{width:900px}.worksheet__footer--small.dx-toolbar{width:600px}';export{r as tttx_worksheet}