@3t-transform/threeteeui 0.0.10 → 0.0.11

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.
Files changed (78) hide show
  1. package/dist/cjs/{index-8a4cb9bc.js → index-bf39be87.js} +41 -0
  2. package/dist/cjs/loader.cjs.js +2 -2
  3. package/dist/cjs/tttx-button.cjs.entry.js +2 -2
  4. package/dist/cjs/tttx-checkbox.cjs.entry.js +3 -3
  5. package/dist/cjs/tttx-form.cjs.entry.js +169 -41
  6. package/dist/cjs/tttx-icon.cjs.entry.js +2 -2
  7. package/dist/cjs/tttx-loading-spinner.cjs.entry.js +4 -4
  8. package/dist/cjs/tttx-popover-content.cjs.entry.js +2 -2
  9. package/dist/cjs/tttx-standalone-input.cjs.entry.js +134 -0
  10. package/dist/cjs/tttx.cjs.js +2 -2
  11. package/dist/collection/collection-manifest.json +2 -2
  12. package/dist/collection/components/atoms/tttx-button/tttx-button.css +1 -0
  13. package/dist/collection/components/atoms/tttx-button/tttx-button.stories.js +3 -3
  14. package/dist/collection/components/atoms/tttx-icon/tttx-icon.css +3 -3
  15. package/dist/collection/components/atoms/tttx-icon/tttx-icon.stories.js +15 -15
  16. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.css +1 -1
  17. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.js +2 -2
  18. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.js +1 -1
  19. package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.js +1 -1
  20. package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.stories.js +3 -3
  21. package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.css +85 -39
  22. package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.js +1 -1
  23. package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.stories.js +5 -5
  24. package/dist/collection/components/molecules/tttx-form/tttx-form.css +230 -0
  25. package/dist/collection/components/molecules/tttx-form/tttx-form.js +195 -55
  26. package/dist/collection/components/molecules/tttx-form/tttx-form.stories.js +97 -28
  27. package/dist/collection/components/molecules/{tttx-input/tttx-input.css → tttx-standalone-input/tttx-standalone-input.css} +77 -49
  28. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.js +561 -0
  29. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.js +156 -0
  30. package/dist/collection/components/palette.stories.js +81 -81
  31. package/dist/collection/docs/gettingstarted-developer.stories.js +4 -4
  32. package/dist/components/index.d.ts +1 -1
  33. package/dist/components/index.js +1 -1
  34. package/dist/components/tttx-button.js +1 -1
  35. package/dist/components/tttx-checkbox.js +2 -2
  36. package/dist/components/tttx-form.js +167 -39
  37. package/dist/components/tttx-icon2.js +1 -1
  38. package/dist/components/tttx-loading-spinner.js +3 -3
  39. package/dist/components/tttx-popover-content.js +1 -1
  40. package/dist/components/{tttx-input.d.ts → tttx-standalone-input.d.ts} +4 -4
  41. package/dist/components/tttx-standalone-input.js +178 -0
  42. package/dist/esm/{index-9654537d.js → index-63c4d25e.js} +41 -0
  43. package/dist/esm/loader.js +3 -3
  44. package/dist/esm/tttx-button.entry.js +2 -2
  45. package/dist/esm/tttx-checkbox.entry.js +3 -3
  46. package/dist/esm/tttx-form.entry.js +169 -41
  47. package/dist/esm/tttx-icon.entry.js +2 -2
  48. package/dist/esm/tttx-loading-spinner.entry.js +4 -4
  49. package/dist/esm/tttx-popover-content.entry.js +2 -2
  50. package/dist/esm/tttx-standalone-input.entry.js +130 -0
  51. package/dist/esm/tttx.js +3 -3
  52. package/dist/tttx/{p-3cb692d6.entry.js → p-1a4eb1f3.entry.js} +1 -1
  53. package/dist/tttx/p-2d54f8aa.entry.js +1 -0
  54. package/dist/tttx/p-338b3976.entry.js +1 -0
  55. package/dist/tttx/{p-674e2f18.entry.js → p-4c57bcbd.entry.js} +1 -1
  56. package/dist/tttx/{p-f4855113.entry.js → p-709246f5.entry.js} +1 -1
  57. package/dist/tttx/p-95a29e09.entry.js +1 -0
  58. package/dist/tttx/{p-1884203f.entry.js → p-ad0c3fe4.entry.js} +1 -1
  59. package/dist/tttx/p-bec472d8.js +2 -0
  60. package/dist/tttx/tttx.esm.js +1 -1
  61. package/dist/types/components/molecules/tttx-form/tttx-form.d.ts +14 -7
  62. package/dist/types/components/molecules/tttx-form/tttx-form.stories.d.ts +1 -8
  63. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.d.ts +38 -0
  64. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.d.ts +106 -0
  65. package/dist/types/components.d.ts +66 -41
  66. package/package.json +67 -65
  67. package/readme.md +89 -86
  68. package/dist/cjs/tttx-input.cjs.entry.js +0 -44
  69. package/dist/collection/components/molecules/tttx-input/tttx-input.js +0 -259
  70. package/dist/collection/components/molecules/tttx-input/tttx-input.stories.js +0 -106
  71. package/dist/components/tttx-input.js +0 -77
  72. package/dist/esm/tttx-input.entry.js +0 -40
  73. package/dist/tttx/p-317b13d3.entry.js +0 -1
  74. package/dist/tttx/p-3cd7ad04.entry.js +0 -1
  75. package/dist/tttx/p-b6cc2780.js +0 -2
  76. package/dist/tttx/p-f30a0e84.entry.js +0 -1
  77. package/dist/types/components/molecules/tttx-input/tttx-input.d.ts +0 -20
  78. package/dist/types/components/molecules/tttx-input/tttx-input.stories.d.ts +0 -60
@@ -1,6 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
2
 
3
- const tttxLoadingSpinnerCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.spinner-container{position:absolute}.loading-box{display:flex;align-items:center;justify-content:center}.loading-text{font-size:16px;font-weight:400;padding-top:10px;text-align:center}.spinner{border:solid #1479c6;border-bottom-color:#D5D5D5;border-radius:50%;position:relative;box-sizing:border-box;animation:rotation 1s linear infinite}.spinner.small{height:20px;width:20px;border-width:4px}.spinner.large{height:60px;width:60px;border-width:8px}@keyframes rotation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";
3
+ const tttxLoadingSpinnerCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.spinner-container{position:absolute}.loading-box{display:flex;align-items:center;justify-content:center}.loading-text{font-size:16px;font-weight:400;padding-top:10px;text-align:center}.spinner{border:solid #1479c6;border-bottom-color:#d5d5d5;border-radius:50%;position:relative;box-sizing:border-box;animation:rotation 1s linear infinite}.spinner.small{height:20px;width:20px;border-width:4px}.spinner.large{height:60px;width:60px;border-width:8px}@keyframes rotation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";
4
4
 
5
5
  const TttxLoadingSpinner$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
6
  constructor() {
@@ -13,10 +13,10 @@ const TttxLoadingSpinner$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
13
13
  renderLoadingMessage() {
14
14
  if (!this.loadingMessage)
15
15
  return '';
16
- return h("div", { class: 'loading-text' }, "Loading, please wait...");
16
+ return h("div", { class: "loading-text" }, "Loading, please wait...");
17
17
  }
18
18
  render() {
19
- return h("div", { class: 'spinner-container' }, h("div", { class: "loading-box" }, h("span", { class: `spinner ${this.size}` })), this.renderLoadingMessage());
19
+ return (h("div", { class: "spinner-container" }, h("div", { class: "loading-box" }, h("span", { class: `spinner ${this.size}` })), this.renderLoadingMessage()));
20
20
  }
21
21
  static get style() { return tttxLoadingSpinnerCss; }
22
22
  }, [1, "tttx-loading-spinner", {
@@ -13,7 +13,7 @@ const TttxPopoverContent$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
13
13
  this.linktext = undefined;
14
14
  }
15
15
  render() {
16
- return (h(Host, null, this.header && h("h4", null, this.header), this.body && h("p", null, this.body), this.linkcontext && h("span", { class: "linky", onClick: (evt) => console.log(this.linkcontext, evt) }, this.linktext || 'More Information')));
16
+ return (h(Host, null, this.header && h("h4", null, this.header), this.body && h("p", null, this.body), this.linkcontext && (h("span", { class: "linky", onClick: evt => console.log(this.linkcontext, evt) }, this.linktext || 'More Information'))));
17
17
  }
18
18
  static get style() { return tttxPopoverContentCss; }
19
19
  }, [1, "tttx-popover-content", {
@@ -1,9 +1,9 @@
1
1
  import type { Components, JSX } from "../types/components";
2
2
 
3
- interface TttxInput extends Components.TttxInput, HTMLElement {}
4
- export const TttxInput: {
5
- prototype: TttxInput;
6
- new (): TttxInput;
3
+ interface TttxStandaloneInput extends Components.TttxStandaloneInput, HTMLElement {}
4
+ export const TttxStandaloneInput: {
5
+ prototype: TttxStandaloneInput;
6
+ new (): TttxStandaloneInput;
7
7
  };
8
8
  /**
9
9
  * Used to define this component and all nested components recursively.
@@ -0,0 +1,178 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import { d as defineCustomElement$2 } from './tttx-icon2.js';
3
+
4
+ const tttxStandaloneInputCss = ".material-symbols-rounded.sc-tttx-standalone-input{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.material-symbols-rounded.sc-tttx-standalone-input{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}.icon-left.sc-tttx-standalone-input,.icon-right.sc-tttx-standalone-input{flex-basis:24px}.icon-left.sc-tttx-standalone-input span.sc-tttx-standalone-input,.icon-right.sc-tttx-standalone-input span.sc-tttx-standalone-input{font-size:24px;line-height:24px;text-align:center;display:block;width:24px;height:24px;margin-top:4px}.icon-left.sc-tttx-standalone-input span.sc-tttx-standalone-input{margin-left:4px}.icon-right.sc-tttx-standalone-input span.sc-tttx-standalone-input{margin-right:4px}.icon-right.sc-tttx-standalone-input{margin-top:5px;margin-right:4px}.icon-left.sc-tttx-standalone-input{margin-top:5px;margin-left:4px}.iconleft.sc-tttx-standalone-input .input.sc-tttx-standalone-input{padding-left:4px}.iconright.sc-tttx-standalone-input .input.sc-tttx-standalone-input{padding-right:4px}.focused.sc-tttx-standalone-input{border-color:#1479c6}.errormsg.sc-tttx-standalone-input{display:flex;justify-content:center;align-items:center;float:left;margin-bottom:16px;box-sizing:border-box;background-color:transparent;height:26px;font-size:14px;border-radius:none;z-index:2;color:#dc0000}.errormsg.sc-tttx-standalone-input .validationicon.sc-tttx-standalone-input{width:16px;height:16px;font-size:16px;margin-right:4px;vertical-align:middle;color:#dc0000}.danger.sc-tttx-standalone-input{color:#dc0000}.optional.sc-tttx-standalone-input{color:#757575;font-weight:normal}label.inputBlock.sc-tttx-standalone-input{display:block;position:relative;line-height:21px}label.sc-tttx-standalone-input{font-weight:500;font-size:16px}input.sc-tttx-standalone-input:not([type=submit]){font-family:\"Roboto\", serif;box-sizing:border-box;width:100%;height:36px;padding:0 16px;font-size:16px;border:1px solid #d5d5d5;border-radius:4px;margin-top:4px}input[type=date].sc-tttx-standalone-input{background:white;display:block;min-width:calc(100% - 18px);line-height:37px}input.invalid.sc-tttx-standalone-input:invalid,input.standalone.invalid.sc-tttx-standalone-input{border:1px solid #dc0000}input.sc-tttx-standalone-input~.errorBubble.sc-tttx-standalone-input{min-height:27px;position:relative;font-size:14px;font-weight:normal;width:100%;font-family:\"Roboto\", sans-serif;color:#dc0000;display:flex;align-content:center;align-items:center;justify-items:center}input.sc-tttx-standalone-input~.errorBubble.sc-tttx-standalone-input:not(.visible){visibility:hidden}input.sc-tttx-standalone-input~.errorBubble.sc-tttx-standalone-input span.sc-tttx-standalone-input{color:#dc0000;font-size:16px;margin-right:4px;height:16px}input.invalid.sc-tttx-standalone-input:invalid~.errorBubble.sc-tttx-standalone-input{position:relative;font-size:14px;font-weight:normal;width:100%;font-family:\"Roboto\", sans-serif;color:#dc0000;visibility:visible}input.sc-tttx-standalone-input:focus{border-color:#1479c6}.sc-tttx-standalone-input-h{display:block}";
5
+
6
+ const TttxInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
7
+ constructor() {
8
+ super();
9
+ this.__registerHost();
10
+ this.valueChanged = createEvent(this, "valueChanged", 7);
11
+ this.isfocused = false;
12
+ this.label = undefined;
13
+ this.valid = undefined;
14
+ this.showerrormsg = undefined;
15
+ this.errormsg = undefined;
16
+ this.iconleft = undefined;
17
+ this.iconright = undefined;
18
+ this.autocapitalize = undefined;
19
+ this.autocomplete = undefined;
20
+ this.autofocus = undefined;
21
+ this.checked = undefined;
22
+ this.disabled = undefined;
23
+ this.max = undefined;
24
+ this.maxlength = undefined;
25
+ this.min = undefined;
26
+ this.minlength = undefined;
27
+ this.name = undefined;
28
+ this.pattern = undefined;
29
+ this.placeholder = undefined;
30
+ this.readonly = undefined;
31
+ this.required = undefined;
32
+ this.step = undefined;
33
+ this.type = 'text';
34
+ this.value = undefined;
35
+ }
36
+ handleChange(event) {
37
+ const target = event.target;
38
+ this.value = target.value;
39
+ this.valueChanged.emit(target.value);
40
+ }
41
+ handleFocus() {
42
+ this.isfocused = true;
43
+ }
44
+ handleBlur() {
45
+ this.isfocused = false;
46
+ }
47
+ render() {
48
+ const classNames = ['standalone', this.showerrormsg ? 'invalid' : ''].join(' ');
49
+ return (h(Host, null, h("label", { class: 'inputBlock' }, this.label, !this.required ? h("span", { class: "optional" }, "\u00A0(optional)") : '', this.iconleft && (h("div", { class: "icon-left" }, h("tttx-icon", { icon: this.iconleft, colour: "grey" }))), h("input", { class: classNames, autocapitalize: this.type === 'url' || this.type === 'email' || this.type === 'password' ? this.autocapitalize : null, autofocus: this.autofocus, autocomplete: this.type === 'text' ||
50
+ this.type === 'search' ||
51
+ this.type === 'url' ||
52
+ this.type === 'tel' ||
53
+ this.type === 'email' ||
54
+ this.type === 'password' ||
55
+ this.type === 'datepickers' ||
56
+ this.type === 'range' ||
57
+ this.type === 'color'
58
+ ? this.autocomplete
59
+ : null, checked: this.type === 'checkbox' || this.type === 'radio' ? this.checked : null, disabled: !this.required ? this.disabled : null, max: this.type === 'date' ||
60
+ this.type === 'month' ||
61
+ this.type === 'week' ||
62
+ this.type === 'time' ||
63
+ this.type === 'datetime-local' ||
64
+ this.type === 'number' ||
65
+ this.type === 'range'
66
+ ? this.max
67
+ : null, maxlength: this.maxlength, min: this.type === 'date' ||
68
+ this.type === 'month' ||
69
+ this.type === 'week' ||
70
+ this.type === 'time' ||
71
+ this.type === 'datetime-local' ||
72
+ this.type === 'number' ||
73
+ this.type === 'range'
74
+ ? this.min
75
+ : null, minlength: this.maxlength, name: this.name, pattern: this.type === 'text' ||
76
+ this.type === 'date' ||
77
+ this.type === 'search' ||
78
+ this.type === 'url' ||
79
+ this.type === 'tel' ||
80
+ this.type === 'email' ||
81
+ this.type === 'password'
82
+ ? this.pattern
83
+ : null, placeholder: this.type === 'text' ||
84
+ this.type === 'tel' ||
85
+ this.type === 'email' ||
86
+ this.type === 'url' ||
87
+ this.type === 'password' ||
88
+ this.type === 'search'
89
+ ? this.placeholder
90
+ : null, readonly: this.type === 'text' ||
91
+ this.type === 'search' ||
92
+ this.type === 'url' ||
93
+ this.type === 'tel' ||
94
+ this.type === 'email' ||
95
+ this.type === 'password' ||
96
+ this.type === 'date' ||
97
+ this.type === 'month' ||
98
+ this.type === 'week' ||
99
+ this.type === 'time' ||
100
+ this.type === 'datetime-local' ||
101
+ this.type === 'number'
102
+ ? this.readonly
103
+ : null, required: this.type === 'text' ||
104
+ this.type === 'search' ||
105
+ this.type === 'url' ||
106
+ this.type === 'tel' ||
107
+ this.type === 'email' ||
108
+ this.type === 'password' ||
109
+ this.type === 'date' ||
110
+ this.type === 'month' ||
111
+ this.type === 'week' ||
112
+ this.type === 'time' ||
113
+ this.type === 'datetime-local' ||
114
+ this.type === 'number' ||
115
+ this.type === 'checkbox' ||
116
+ this.type === 'radio' ||
117
+ this.type === 'file'
118
+ ? this.required
119
+ : null, step: this.type === 'date' ||
120
+ this.type === 'month' ||
121
+ this.type === 'week' ||
122
+ this.type === 'time' ||
123
+ this.type === 'datetime-local' ||
124
+ this.type === 'number' ||
125
+ this.type === 'range'
126
+ ? this.step
127
+ : null, type: this.type, value: this.value, onBlur: this.handleBlur.bind(this), onFocus: this.handleFocus.bind(this), onInput: this.handleChange.bind(this) }), this.iconright && (h("div", { class: "icon-right" }, h("tttx-icon", { icon: this.iconright, colour: "grey" }))), h("span", { class: ['errorBubble', this.showerrormsg && this.errormsg ? 'visible' : ''].join(' ') }, h("span", { class: "material-symbols-rounded validationicon" }, "warning"), " ", this.errormsg))));
128
+ }
129
+ static get style() { return tttxStandaloneInputCss; }
130
+ }, [2, "tttx-standalone-input", {
131
+ "label": [1],
132
+ "valid": [4],
133
+ "showerrormsg": [4],
134
+ "errormsg": [1],
135
+ "iconleft": [1],
136
+ "iconright": [1],
137
+ "autocapitalize": [1],
138
+ "autocomplete": [1],
139
+ "autofocus": [4],
140
+ "checked": [4],
141
+ "disabled": [4],
142
+ "max": [8],
143
+ "maxlength": [8],
144
+ "min": [8],
145
+ "minlength": [8],
146
+ "name": [1],
147
+ "pattern": [1],
148
+ "placeholder": [1],
149
+ "readonly": [8],
150
+ "required": [4],
151
+ "step": [8],
152
+ "type": [1],
153
+ "value": [1032],
154
+ "isfocused": [32]
155
+ }]);
156
+ function defineCustomElement$1() {
157
+ if (typeof customElements === "undefined") {
158
+ return;
159
+ }
160
+ const components = ["tttx-standalone-input", "tttx-icon"];
161
+ components.forEach(tagName => { switch (tagName) {
162
+ case "tttx-standalone-input":
163
+ if (!customElements.get(tagName)) {
164
+ customElements.define(tagName, TttxInput);
165
+ }
166
+ break;
167
+ case "tttx-icon":
168
+ if (!customElements.get(tagName)) {
169
+ defineCustomElement$2();
170
+ }
171
+ break;
172
+ } });
173
+ }
174
+
175
+ const TttxStandaloneInput = TttxInput;
176
+ const defineCustomElement = defineCustomElement$1;
177
+
178
+ export { TttxStandaloneInput, defineCustomElement };
@@ -281,6 +281,9 @@ const attachStyles = (hostRef) => {
281
281
  // DOM WRITE!!
282
282
  elm['s-sc'] = scopeId;
283
283
  elm.classList.add(scopeId + '-h');
284
+ if (flags & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
285
+ elm.classList.add(scopeId + '-s');
286
+ }
284
287
  }
285
288
  endAttachStyles();
286
289
  };
@@ -826,6 +829,9 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
826
829
  promise = safeCall(instance, 'componentWillLoad');
827
830
  }
828
831
  }
832
+ {
833
+ promise = then(promise, () => safeCall(instance, 'componentWillRender'));
834
+ }
829
835
  endSchedule();
830
836
  return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
831
837
  };
@@ -895,6 +901,9 @@ const postUpdateComponent = (hostRef) => {
895
901
  const endPostUpdate = createTime('postUpdate', tagName);
896
902
  const instance = hostRef.$lazyInstance$ ;
897
903
  const ancestorComponent = hostRef.$ancestorComponent$;
904
+ {
905
+ safeCall(instance, 'componentDidRender');
906
+ }
898
907
  if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
899
908
  hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
900
909
  {
@@ -959,6 +968,7 @@ const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propNam
959
968
  const setValue = (ref, propName, newVal, cmpMeta) => {
960
969
  // check our new property value against our internal value
961
970
  const hostRef = getHostRef(ref);
971
+ const elm = hostRef.$hostElement$ ;
962
972
  const oldVal = hostRef.$instanceValues$.get(propName);
963
973
  const flags = hostRef.$flags$;
964
974
  const instance = hostRef.$lazyInstance$ ;
@@ -971,6 +981,22 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
971
981
  // set our new value!
972
982
  hostRef.$instanceValues$.set(propName, newVal);
973
983
  if (instance) {
984
+ // get an array of method names of watch functions to call
985
+ if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
986
+ const watchMethods = cmpMeta.$watchers$[propName];
987
+ if (watchMethods) {
988
+ // this instance is watching for when this property changed
989
+ watchMethods.map((watchMethodName) => {
990
+ try {
991
+ // fire off each of the watch methods that are watching this property
992
+ instance[watchMethodName](newVal, oldVal, propName);
993
+ }
994
+ catch (e) {
995
+ consoleError(e, elm);
996
+ }
997
+ });
998
+ }
999
+ }
974
1000
  if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
975
1001
  // looks like this value actually changed, so we've got work to do!
976
1002
  // but only if we've already rendered, otherwise just chill out
@@ -993,6 +1019,9 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
993
1019
  */
994
1020
  const proxyComponent = (Cstr, cmpMeta, flags) => {
995
1021
  if (cmpMeta.$members$) {
1022
+ if (Cstr.watchers) {
1023
+ cmpMeta.$watchers$ = Cstr.watchers;
1024
+ }
996
1025
  // It's better to have a const than two Object.entries()
997
1026
  const members = Object.entries(cmpMeta.$members$);
998
1027
  const prototype = Cstr.prototype;
@@ -1097,6 +1126,12 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1097
1126
  endLoad();
1098
1127
  }
1099
1128
  if (!Cstr.isProxied) {
1129
+ // we've never proxied this Constructor before
1130
+ // let's add the getters/setters to its prototype before
1131
+ // the first time we create an instance of the implementation
1132
+ {
1133
+ cmpMeta.$watchers$ = Cstr.watchers;
1134
+ }
1100
1135
  proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
1101
1136
  Cstr.isProxied = true;
1102
1137
  }
@@ -1120,6 +1155,9 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1120
1155
  {
1121
1156
  hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
1122
1157
  }
1158
+ {
1159
+ hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
1160
+ }
1123
1161
  endNewInstance();
1124
1162
  }
1125
1163
  if (Cstr.style) {
@@ -1239,6 +1277,9 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1239
1277
  {
1240
1278
  cmpMeta.$listeners$ = compactMeta[3];
1241
1279
  }
1280
+ {
1281
+ cmpMeta.$watchers$ = {};
1282
+ }
1242
1283
  const tagName = cmpMeta.$tagName$;
1243
1284
  const HostElement = class extends HTMLElement {
1244
1285
  // StencilLazyHost
@@ -1,5 +1,5 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-9654537d.js';
2
- export { s as setNonce } from './index-9654537d.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-63c4d25e.js';
2
+ export { s as setNonce } from './index-63c4d25e.js';
3
3
 
4
4
  /*
5
5
  Stencil Client Patch Esm v2.22.3 | MIT Licensed | https://stenciljs.com
@@ -11,7 +11,7 @@ const patchEsm = () => {
11
11
  const defineCustomElements = (win, options) => {
12
12
  if (typeof window === 'undefined') return Promise.resolve();
13
13
  return patchEsm().then(() => {
14
- return bootstrapLazy([["tttx-input",[[1,"tttx-input",{"label":[1],"valid":[4],"showerrormsg":[4],"errormsg":[1],"value":[1025],"type":[1],"placeholder":[1],"pattern":[1],"iconleft":[1],"iconright":[1],"required":[4],"isfocused":[32]}]]],["tttx-button",[[1,"tttx-button",{"fontColor":[1,"font-color"],"buttonStyle":[1,"button-style"]},[[0,"clickEvent","onClicked"]]]]],["tttx-checkbox",[[1,"tttx-checkbox",{"value":[4],"label":[1],"required":[4]}]]],["tttx-form",[[1,"tttx-form",{"dataAttribute":[1,"data-attribute"],"functionAttribute":[1,"function-attribute"]}]]],["tttx-loading-spinner",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-popover-content",[[1,"tttx-popover-content",{"header":[1],"body":[1],"linkcontext":[1],"linktext":[1]}]]],["tttx-icon",[[1,"tttx-icon",{"icon":[1],"colour":[1]},[[4,"click","handleDocumentClick"]]]]]], options);
14
+ return bootstrapLazy([["tttx-standalone-input",[[2,"tttx-standalone-input",{"label":[1],"valid":[4],"showerrormsg":[4],"errormsg":[1],"iconleft":[1],"iconright":[1],"autocapitalize":[1],"autocomplete":[1],"autofocus":[4],"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],"isfocused":[32]}]]],["tttx-button",[[1,"tttx-button",{"fontColor":[1,"font-color"],"buttonStyle":[1,"button-style"]},[[0,"clickEvent","onClicked"]]]]],["tttx-checkbox",[[1,"tttx-checkbox",{"value":[4],"label":[1],"required":[4]}]]],["tttx-form",[[1,"tttx-form",{"formschema":[8],"submitValue":[8,"submit-value"]}]]],["tttx-loading-spinner",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-popover-content",[[1,"tttx-popover-content",{"header":[1],"body":[1],"linkcontext":[1],"linktext":[1]}]]],["tttx-icon",[[1,"tttx-icon",{"icon":[1],"colour":[1]},[[4,"click","handleDocumentClick"]]]]]], options);
15
15
  });
16
16
  };
17
17
 
@@ -1,6 +1,6 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host } from './index-9654537d.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host } from './index-63c4d25e.js';
2
2
 
3
- const tttxButtonCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.button{height:36px;padding:8px 16px;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:hover{background:#f0f0f0}.button:active{background:#e3e3e3}.primary-blue{background:#1479c6;border:1px solid #1479c6}.primary-blue:hover{background:#1169ba}.primary-blue:active{background:#0951a8}.secondary-white{background:white;border:1px solid #212121}:host{display:inline-block}.spacingleft{margin-left:8px}.font-white{color:white}.font-black{color:#212121}";
3
+ const tttxButtonCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.button{height:36px;padding:8px 16px;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:hover{background:#f0f0f0}.button:active{background:#e3e3e3}.primary-blue{background:#1479c6;border:1px solid #1479c6;color:white}.primary-blue:hover{background:#1169ba}.primary-blue:active{background:#0951a8}.secondary-white{background:white;border:1px solid #212121}:host{display:inline-block}.spacingleft{margin-left:8px}.font-white{color:white}.font-black{color:#212121}";
4
4
 
5
5
  const TttxButton = class {
6
6
  constructor(hostRef) {
@@ -1,6 +1,6 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host } from './index-9654537d.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host } from './index-63c4d25e.js';
2
2
 
3
- const tttxCheckboxCss = ".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}.field{clear:both}.container{display:flex;flex-wrap:wrap;box-sizing:border-box;height:36px;border:1px solid #c8c8c8;border-radius:4px}.icon-left,.icon-right{flex-basis:24px}.icon-left span,.icon-right span{font-size:24px;line-height:24px;text-align:center;display:block;width:24px;height:24px;margin-top:4px}.icon-left span{margin-left:4px}.icon-right span{margin-right:4px}.input{flex-grow:1;border:none;outline:none;font-size:16px;padding:8px 16px;background-color:transparent}.iconleft .input{padding-left:4px}.iconright .input{padding-right:4px}.label{display:block;height:18px;font-weight:600;color:#212121;font-size:16px;margin-bottom:4px;z-index:1}.disabled{background:#f0f0f0;color:#9e9e9e;border-color:#c8c8c8}.focused{border-color:#1479c6}.errormsg{display:flex;justify-content:center;align-items:center;float:left;margin-bottom:16px;box-sizing:border-box;background-color:transparent;height:26px;font-size:14px;border-radius:none;z-index:2;color:#DC0000}.errormsg .validationicon{width:16px;height:16px;font-size:16px;margin-right:4px;vertical-align:middle;color:#DC0000}.danger{color:#DC0000}.optional{color:#757575;font-weight:normal}:host{display:block}.spacing{margin-bottom:16px}";
3
+ const tttxCheckboxCss = ".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}.icon-left,.icon-right{flex-basis:24px}.icon-left span,.icon-right span{font-size:24px;line-height:24px;text-align:center;display:block;width:24px;height:24px;margin-top:4px}.icon-left span{margin-left:4px}.icon-right span{margin-right:4px}.icon-right{margin-top:5px;margin-right:4px}.icon-left{margin-top:5px;margin-left:4px}.iconleft .input{padding-left:4px}.iconright .input{padding-right:4px}.focused{border-color:#1479c6}.errormsg{display:flex;justify-content:center;align-items:center;float:left;margin-bottom:16px;box-sizing:border-box;background-color:transparent;height:26px;font-size:14px;border-radius:none;z-index:2;color:#dc0000}.errormsg .validationicon{width:16px;height:16px;font-size:16px;margin-right:4px;vertical-align:middle;color:#dc0000}.danger{color:#dc0000}.optional{color:#757575;font-weight:normal}label.inputBlock{display:block;position:relative;line-height:21px}label{font-weight:500;font-size:16px}input:not([type=submit]){font-family:\"Roboto\", serif;box-sizing:border-box;width:100%;height:36px;padding:0 16px;font-size:16px;border:1px solid #d5d5d5;border-radius:4px;margin-top:4px}input[type=date]{background:white;display:block;min-width:calc(100% - 18px);line-height:37px}input.invalid:invalid,input.standalone.invalid{border:1px solid #dc0000}input~.errorBubble{min-height:27px;position:relative;font-size:14px;font-weight:normal;width:100%;font-family:\"Roboto\", sans-serif;color:#dc0000;display:flex;align-content:center;align-items:center;justify-items:center}input~.errorBubble:not(.visible){visibility:hidden}input~.errorBubble span{color:#dc0000;font-size:16px;margin-right:4px;height:16px}input.invalid:invalid~.errorBubble{position:relative;font-size:14px;font-weight:normal;width:100%;font-family:\"Roboto\", sans-serif;color:#dc0000;visibility:visible}input:focus{border-color:#1479c6}:host{display:block}.spacing{margin-bottom:16px}";
4
4
 
5
5
  const TttxCheckbox = class {
6
6
  constructor(hostRef) {
@@ -16,7 +16,7 @@ const TttxCheckbox = class {
16
16
  this.valueChanged.emit(target.checked);
17
17
  }
18
18
  render() {
19
- return (h(Host, null, h("div", { class: "field spacing" }, this.label && h("label", { class: "label" }, this.label, !this.required ? h("span", { class: "optional" }, " (optional)") : ''), h("input", { type: "checkbox", class: "input", onChange: event => this.handleClick(event), checked: this.value }))));
19
+ return (h(Host, null, h("div", { class: "field spacing" }, this.label && (h("label", { class: "label" }, this.label, !this.required ? h("span", { class: "optional" }, " (optional)") : '')), h("input", { type: "checkbox", class: "input", onChange: event => this.handleClick(event), checked: this.value }))));
20
20
  }
21
21
  };
22
22
  TttxCheckbox.style = tttxCheckboxCss;
@@ -1,54 +1,182 @@
1
- import { r as registerInstance, c as createEvent, h, g as getElement } from './index-9654537d.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host } from './index-63c4d25e.js';
2
+
3
+ const tttxFormCss = ".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}.icon-left,.icon-right{flex-basis:24px}.icon-left span,.icon-right span{font-size:24px;line-height:24px;text-align:center;display:block;width:24px;height:24px;margin-top:4px}.icon-left span{margin-left:4px}.icon-right span{margin-right:4px}.icon-right{margin-top:5px;margin-right:4px}.icon-left{margin-top:5px;margin-left:4px}.iconleft .input{padding-left:4px}.iconright .input{padding-right:4px}.focused{border-color:#1479c6}.errormsg{display:flex;justify-content:center;align-items:center;float:left;margin-bottom:16px;box-sizing:border-box;background-color:transparent;height:26px;font-size:14px;border-radius:none;z-index:2;color:#dc0000}.errormsg .validationicon{width:16px;height:16px;font-size:16px;margin-right:4px;vertical-align:middle;color:#dc0000}.danger{color:#dc0000}.optional{color:#757575;font-weight:normal}label.inputBlock{display:block;position:relative;line-height:21px}label{font-weight:500;font-size:16px}input:not([type=submit]){font-family:\"Roboto\", serif;box-sizing:border-box;width:100%;height:36px;padding:0 16px;font-size:16px;border:1px solid #d5d5d5;border-radius:4px;margin-top:4px}input[type=date]{background:white;display:block;min-width:calc(100% - 18px);line-height:37px}input.invalid:invalid,input.standalone.invalid{border:1px solid #dc0000}input~.errorBubble{min-height:27px;position:relative;font-size:14px;font-weight:normal;width:100%;font-family:\"Roboto\", sans-serif;color:#dc0000;display:flex;align-content:center;align-items:center;justify-items:center}input~.errorBubble:not(.visible){visibility:hidden}input~.errorBubble span{color:#dc0000;font-size:16px;margin-right:4px;height:16px}input.invalid:invalid~.errorBubble{position:relative;font-size:14px;font-weight:normal;width:100%;font-family:\"Roboto\", sans-serif;color:#dc0000;visibility:visible}input:focus{border-color:#1479c6}.button{height:36px;padding:8px 16px;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:hover{background:#f0f0f0}.button:active{background:#e3e3e3}.primary-blue{background:#1479c6;border:1px solid #1479c6;color:white}.primary-blue:hover{background:#1169ba}.primary-blue:active{background:#0951a8}.secondary-white{background:white;border:1px solid #212121}:host{display:block}fieldset{margin:0;padding:0;border:none}input[type=submit]{margin-left:auto}";
2
4
 
3
5
  const TttxForm = class {
4
6
  constructor(hostRef) {
5
7
  registerInstance(this, hostRef);
6
- this.formSubmit = createEvent(this, "formSubmit", 7);
7
- this.fetchFormData = () => {
8
- let validForm = true;
9
- const formData = {};
10
- const elements = this.el.querySelectorAll(`[${this.dataAttribute}]`);
11
- elements.forEach((element) => {
12
- const inputElement = element;
13
- validForm = validForm ? this.validateFormField(inputElement) : false;
14
- formData[inputElement.getAttribute(this.dataAttribute)] = inputElement.value;
15
- });
16
- return validForm ? formData : null;
17
- };
18
- this.dataAttribute = 'form-data';
19
- this.functionAttribute = 'function-data';
20
- }
21
- validateFormField(element) {
22
- let isValid = true;
23
- const isRequired = element.hasAttribute("required");
24
- if (isRequired && !element.value) {
25
- // required and not set, show error
26
- element.setAttribute("showerrormsg", "true");
27
- isValid = false;
8
+ this.submitEvent = createEvent(this, "submitEvent", 7);
9
+ this.template = document.createElement('template');
10
+ this.formschema = undefined;
11
+ this.submitValue = undefined;
12
+ }
13
+ onFormSchemaChange(newValue) {
14
+ if (typeof newValue === 'string') {
15
+ this._formSchema = JSON.parse(newValue);
16
+ }
17
+ else {
18
+ this._formSchema = newValue;
19
+ }
20
+ }
21
+ validityCheck(event) {
22
+ var _a, _b, _c, _d;
23
+ event.preventDefault();
24
+ const target = event.target;
25
+ let hasError = true;
26
+ let errorMessage = '';
27
+ // validity object on HTML5 inputs has the following options
28
+ // badInput
29
+ // customError
30
+ // patternMismatch
31
+ // rangeOverflow
32
+ // rangeUnderflow
33
+ // stepMismatch
34
+ // tooLong
35
+ // tooShort
36
+ // typeMismatch
37
+ // valid
38
+ // valueMissing
39
+ // customErrors can be set with
40
+ // target.setCustomValidity('custom error!');
41
+ // and cleared with
42
+ // target.setCustomValidity('');
43
+ if (target.validity.valueMissing) {
44
+ errorMessage = (_a = target.dataset.required) !== null && _a !== void 0 ? _a : 'This field is required';
45
+ }
46
+ else if (target.validity.patternMismatch) {
47
+ errorMessage = (_b = target.dataset.pattern) !== null && _b !== void 0 ? _b : 'Incorrect format';
48
+ }
49
+ else if (target.validity.badInput) {
50
+ // IE string in a number field
51
+ errorMessage = (_c = target.dataset.badinput) !== null && _c !== void 0 ? _c : 'Wrong input type';
52
+ }
53
+ else if (target.validity.rangeOverflow || target.validity.rangeUnderflow) {
54
+ // IE date or number is above or below value set in min or max tags
55
+ errorMessage = (_d = target.dataset.range) !== null && _d !== void 0 ? _d : 'Invalid value';
56
+ }
57
+ else {
58
+ // no error
59
+ hasError = false;
60
+ }
61
+ if (hasError) {
62
+ target.className = 'invalid';
63
+ const errorIcon = document.createElement('span');
64
+ errorIcon.className = 'material-symbols-rounded';
65
+ errorIcon.textContent = 'warning';
66
+ target.parentElement.querySelector('.errorBubble').replaceChildren();
67
+ target.parentElement.querySelector('.errorBubble').append(errorIcon);
68
+ target.parentElement.querySelector('.errorBubble').append(errorMessage);
28
69
  }
29
70
  else {
30
- // required and set, ensure error does not show
31
- element.removeAttribute("showerrormsg");
32
- }
33
- return isValid;
34
- }
35
- componentDidLoad() {
36
- const elements = this.el.querySelectorAll(`[${this.functionAttribute}]`);
37
- elements.forEach((element) => {
38
- element.addEventListener('click', event => {
39
- event.preventDefault();
40
- const formData = this.fetchFormData();
41
- if (formData) {
42
- // only emit event if form data is valid
43
- this.formSubmit.emit(this.fetchFormData());
71
+ target.className = '';
72
+ target.parentElement.querySelector('.errorBubble').replaceChildren();
73
+ }
74
+ }
75
+ doSubmit(event) {
76
+ event.preventDefault();
77
+ const formData = new FormData(event.target);
78
+ // Key value pair matching the key names given by the JSON schema will be output line by line
79
+ // TODO: Emit an event so external components can handle the resulting form data
80
+ // let output = "";
81
+ // for (var [key, value] of formData.entries()) {
82
+ // output += `${key} -> ${value}\n`;
83
+ // }
84
+ // console.log(output);
85
+ this.submitEvent.emit(formData);
86
+ }
87
+ fieldsetChange(event) {
88
+ console.log(event.target.name + ' has changed');
89
+ // The correct input box will always be the target of the incoming event
90
+ // TODO: Emit an event so external components can change based on form values input
91
+ }
92
+ componentWillLoad() {
93
+ // set proper on initial render
94
+ this.onFormSchemaChange(this.formschema);
95
+ }
96
+ componentWillRender() {
97
+ this.template.content.replaceChildren(); // clear the template to account for a potential re-render scenario
98
+ this.populateFormFromSchema();
99
+ }
100
+ populateFormFromSchema() {
101
+ if (!this._formSchema)
102
+ return;
103
+ const properties = this._formSchema.properties;
104
+ const propertyKeys = Object.keys(properties);
105
+ propertyKeys.forEach(formKey => {
106
+ var _a, _b, _c;
107
+ const formItem = properties[formKey];
108
+ const formProperties = formItem.form;
109
+ const input = document.createElement('input');
110
+ input.name = formKey;
111
+ input.type = formProperties.type;
112
+ input.placeholder = (_a = formProperties.placeholder) !== null && _a !== void 0 ? _a : '';
113
+ input.autocomplete = 'off';
114
+ input.autocapitalize = 'off';
115
+ if (formProperties.validation) {
116
+ const validation = formProperties.validation;
117
+ if (validation.required) {
118
+ input.setAttribute('required', '');
119
+ input.setAttribute('data-required', (_b = validation.required.message) !== null && _b !== void 0 ? _b : '');
44
120
  }
45
- });
121
+ if (validation.pattern) {
122
+ input.setAttribute('pattern', validation.pattern.pattern);
123
+ input.setAttribute('data-pattern', (_c = validation.pattern.message) !== null && _c !== void 0 ? _c : '');
124
+ }
125
+ if (validation.badInput) {
126
+ input.setAttribute('data-badinput', validation.badInput.message);
127
+ }
128
+ if (validation.minmax) {
129
+ input.setAttribute('min', validation.minmax.min);
130
+ input.setAttribute('max', validation.minmax.max);
131
+ input.setAttribute('data-range', validation.minmax.message);
132
+ }
133
+ if (validation.maxlength) {
134
+ input.setAttribute('maxlength', validation.maxlength);
135
+ }
136
+ }
137
+ const errorBubble = document.createElement('div');
138
+ errorBubble.className = 'errorBubble';
139
+ const label = document.createElement('label');
140
+ label.className = 'inputBlock';
141
+ label.innerText = formProperties.label;
142
+ if (!formProperties.validation) {
143
+ const optionalSpan = document.createElement('span');
144
+ optionalSpan.className = 'optional';
145
+ optionalSpan.innerHTML = ' (optional)';
146
+ label.appendChild(optionalSpan);
147
+ }
148
+ label.appendChild(input);
149
+ label.appendChild(errorBubble);
150
+ this.template.content.append(label);
151
+ });
152
+ const submitButton = document.createElement('input');
153
+ submitButton.type = 'submit';
154
+ submitButton.className = 'button primary-blue';
155
+ console.log(this.submitValue);
156
+ submitButton.value = 'Save';
157
+ this.template.content.append(submitButton);
158
+ }
159
+ componentDidRender() {
160
+ if (!this._formSchema)
161
+ return;
162
+ const formItems = this.template.content.cloneNode(true);
163
+ // bind to events here as you can't do it in a template in stencil
164
+ const properties = this._formSchema.properties;
165
+ const propertyKeys = Object.keys(properties);
166
+ propertyKeys.forEach(formKey => {
167
+ formItems.querySelector(`[name=${formKey}]`).oninvalid = this.validityCheck.bind(this);
168
+ formItems.querySelector(`[name=${formKey}]`).onblur = this.validityCheck.bind(this);
46
169
  });
170
+ // append to the fieldset
171
+ this.fieldset.appendChild(formItems);
47
172
  }
48
173
  render() {
49
- return (h("div", null, h("slot", null)));
174
+ return (h(Host, null, h("form", { onSubmit: this.doSubmit.bind(this) }, h("fieldset", { onChange: this.fieldsetChange, ref: el => (this.fieldset = el) }))));
50
175
  }
51
- get el() { return getElement(this); }
52
- };
176
+ static get watchers() { return {
177
+ "formschema": ["onFormSchemaChange"]
178
+ }; }
179
+ };
180
+ TttxForm.style = tttxFormCss;
53
181
 
54
182
  export { TttxForm as tttx_form };
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h, H as Host, g as getElement } from './index-9654537d.js';
1
+ import { r as registerInstance, h, H as Host, g as getElement } from './index-63c4d25e.js';
2
2
 
3
3
  var top = 'top';
4
4
  var bottom = 'bottom';
@@ -1797,7 +1797,7 @@ var createPopper = /*#__PURE__*/popperGenerator({
1797
1797
  defaultModifiers: defaultModifiers
1798
1798
  }); // eslint-disable-next-line import/no-unused-modules
1799
1799
 
1800
- const tttxIconCss = ".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}:host{display:block}.tooltip{background:#ffffff;color:#343434;font-weight:bold;padding:8px 16px;font-size:13px;border-radius:4px;box-shadow:0 0 5px 1px rgba(0, 0, 0, 0.3);display:none}.tooltip[data-show]{display:block}.arrow,.arrow::before{position:absolute;width:8px;height:8px;background:inherit}.arrow{visibility:hidden}.arrow::before{visibility:visible;content:\"\";transform:rotate(45deg)}.tooltip[data-popper-placement^=top]>.arrow{bottom:-4px}.tooltip[data-popper-placement^=bottom]>.arrow{top:-4px}.tooltip[data-popper-placement^=left]>.arrow{right:-4px}.tooltip[data-popper-placement^=right]>.arrow{left:-4px}.red{color:#DC0000}.orange{color:#F59500}.blue{color:#1479c6}.green{color:#A2BB31}.gray{color:#757575}.black{color:#212121}.white{color:white}.clickable{cursor:pointer}";
1800
+ const tttxIconCss = ".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}:host{display:block}.tooltip{background:#ffffff;color:#343434;font-weight:bold;padding:8px 16px;font-size:13px;border-radius:4px;box-shadow:0 0 5px 1px rgba(0, 0, 0, 0.3);display:none}.tooltip[data-show]{display:block}.arrow,.arrow::before{position:absolute;width:8px;height:8px;background:inherit}.arrow{visibility:hidden}.arrow::before{visibility:visible;content:\"\";transform:rotate(45deg)}.tooltip[data-popper-placement^=top]>.arrow{bottom:-4px}.tooltip[data-popper-placement^=bottom]>.arrow{top:-4px}.tooltip[data-popper-placement^=left]>.arrow{right:-4px}.tooltip[data-popper-placement^=right]>.arrow{left:-4px}.red{color:#dc0000}.orange{color:#f59500}.blue{color:#1479c6}.green{color:#a2bb31}.gray{color:#757575}.black{color:#212121}.white{color:white}.clickable{cursor:pointer}";
1801
1801
 
1802
1802
  const TttxIcon = class {
1803
1803
  constructor(hostRef) {