@3t-transform/threeteeui 0.0.13 → 0.0.15

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 (121) hide show
  1. package/package.json +7 -4
  2. package/dist/cjs/index-bf39be87.js +0 -1530
  3. package/dist/cjs/index.cjs.js +0 -2
  4. package/dist/cjs/loader.cjs.js +0 -22
  5. package/dist/cjs/tttx-button.cjs.entry.js +0 -28
  6. package/dist/cjs/tttx-checkbox.cjs.entry.js +0 -28
  7. package/dist/cjs/tttx-form.cjs.entry.js +0 -186
  8. package/dist/cjs/tttx-icon.cjs.entry.js +0 -1861
  9. package/dist/cjs/tttx-list.cjs.entry.js +0 -198
  10. package/dist/cjs/tttx-loading-spinner.cjs.entry.js +0 -26
  11. package/dist/cjs/tttx-popover-content.cjs.entry.js +0 -23
  12. package/dist/cjs/tttx-standalone-input.cjs.entry.js +0 -136
  13. package/dist/cjs/tttx.cjs.js +0 -23
  14. package/dist/collection/collection-manifest.json +0 -19
  15. package/dist/collection/components/atoms/tttx-button/tttx-button.css +0 -62
  16. package/dist/collection/components/atoms/tttx-button/tttx-button.js +0 -93
  17. package/dist/collection/components/atoms/tttx-button/tttx-button.stories.js +0 -27
  18. package/dist/collection/components/atoms/tttx-icon/tttx-icon.css +0 -105
  19. package/dist/collection/components/atoms/tttx-icon/tttx-icon.js +0 -114
  20. package/dist/collection/components/atoms/tttx-icon/tttx-icon.stories.js +0 -47
  21. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.css +0 -48
  22. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.js +0 -66
  23. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.js +0 -17
  24. package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.css +0 -30
  25. package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.js +0 -96
  26. package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.stories.js +0 -23
  27. package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.css +0 -181
  28. package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.js +0 -101
  29. package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.stories.js +0 -13
  30. package/dist/collection/components/molecules/tttx-form/tttx-form.css +0 -230
  31. package/dist/collection/components/molecules/tttx-form/tttx-form.js +0 -249
  32. package/dist/collection/components/molecules/tttx-form/tttx-form.stories.js +0 -102
  33. package/dist/collection/components/molecules/tttx-list/tttx-list.css +0 -56
  34. package/dist/collection/components/molecules/tttx-list/tttx-list.js +0 -311
  35. package/dist/collection/components/molecules/tttx-list/tttx-list.stories.js +0 -37
  36. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.css +0 -177
  37. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.js +0 -569
  38. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.js +0 -156
  39. package/dist/collection/components/palette.stories.js +0 -88
  40. package/dist/collection/docs/gettingstarted-developer.stories.js +0 -9
  41. package/dist/collection/icons.js +0 -2838
  42. package/dist/collection/index.js +0 -1
  43. package/dist/components/index.d.ts +0 -38
  44. package/dist/components/index.js +0 -9
  45. package/dist/components/tttx-button.d.ts +0 -11
  46. package/dist/components/tttx-button.js +0 -45
  47. package/dist/components/tttx-checkbox.d.ts +0 -11
  48. package/dist/components/tttx-checkbox.js +0 -46
  49. package/dist/components/tttx-form.d.ts +0 -11
  50. package/dist/components/tttx-form.js +0 -203
  51. package/dist/components/tttx-icon.d.ts +0 -11
  52. package/dist/components/tttx-icon.js +0 -6
  53. package/dist/components/tttx-icon2.js +0 -1875
  54. package/dist/components/tttx-list.d.ts +0 -11
  55. package/dist/components/tttx-list.js +0 -225
  56. package/dist/components/tttx-loading-spinner.d.ts +0 -11
  57. package/dist/components/tttx-loading-spinner.js +0 -6
  58. package/dist/components/tttx-loading-spinner2.js +0 -40
  59. package/dist/components/tttx-popover-content.d.ts +0 -11
  60. package/dist/components/tttx-popover-content.js +0 -42
  61. package/dist/components/tttx-standalone-input.d.ts +0 -11
  62. package/dist/components/tttx-standalone-input.js +0 -178
  63. package/dist/esm/index-63c4d25e.js +0 -1501
  64. package/dist/esm/index.js +0 -1
  65. package/dist/esm/loader.js +0 -18
  66. package/dist/esm/polyfills/core-js.js +0 -11
  67. package/dist/esm/polyfills/css-shim.js +0 -1
  68. package/dist/esm/polyfills/dom.js +0 -79
  69. package/dist/esm/polyfills/es5-html-element.js +0 -1
  70. package/dist/esm/polyfills/index.js +0 -34
  71. package/dist/esm/polyfills/system.js +0 -6
  72. package/dist/esm/tttx-button.entry.js +0 -24
  73. package/dist/esm/tttx-checkbox.entry.js +0 -24
  74. package/dist/esm/tttx-form.entry.js +0 -182
  75. package/dist/esm/tttx-icon.entry.js +0 -1857
  76. package/dist/esm/tttx-list.entry.js +0 -194
  77. package/dist/esm/tttx-loading-spinner.entry.js +0 -22
  78. package/dist/esm/tttx-popover-content.entry.js +0 -19
  79. package/dist/esm/tttx-standalone-input.entry.js +0 -132
  80. package/dist/esm/tttx.js +0 -18
  81. package/dist/index.cjs.js +0 -1
  82. package/dist/index.js +0 -1
  83. package/dist/tttx/index.esm.js +0 -0
  84. package/dist/tttx/p-1a4eb1f3.entry.js +0 -1
  85. package/dist/tttx/p-25953f82.entry.js +0 -1
  86. package/dist/tttx/p-2b6720ac.entry.js +0 -1
  87. package/dist/tttx/p-2d54f8aa.entry.js +0 -1
  88. package/dist/tttx/p-4c57bcbd.entry.js +0 -1
  89. package/dist/tttx/p-709246f5.entry.js +0 -1
  90. package/dist/tttx/p-95a29e09.entry.js +0 -1
  91. package/dist/tttx/p-ad0c3fe4.entry.js +0 -1
  92. package/dist/tttx/p-bec472d8.js +0 -2
  93. package/dist/tttx/tttx.esm.js +0 -1
  94. package/dist/types/components/atoms/tttx-button/tttx-button.d.ts +0 -9
  95. package/dist/types/components/atoms/tttx-button/tttx-button.stories.d.ts +0 -20
  96. package/dist/types/components/atoms/tttx-icon/tttx-icon.d.ts +0 -14
  97. package/dist/types/components/atoms/tttx-icon/tttx-icon.stories.d.ts +0 -21
  98. package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.d.ts +0 -6
  99. package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.d.ts +0 -17
  100. package/dist/types/components/atoms/tttx-popover-content/tttx-popover-content.d.ts +0 -7
  101. package/dist/types/components/atoms/tttx-popover-content/tttx-popover-content.stories.d.ts +0 -18
  102. package/dist/types/components/atoms/ttx-checkbox/tttx-checkbox.d.ts +0 -9
  103. package/dist/types/components/atoms/ttx-checkbox/tttx-checkbox.stories.d.ts +0 -6
  104. package/dist/types/components/molecules/tttx-form/tttx-form.d.ts +0 -18
  105. package/dist/types/components/molecules/tttx-form/tttx-form.stories.d.ts +0 -6
  106. package/dist/types/components/molecules/tttx-list/tttx-list.d.ts +0 -51
  107. package/dist/types/components/molecules/tttx-list/tttx-list.stories.d.ts +0 -13
  108. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.d.ts +0 -38
  109. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.d.ts +0 -106
  110. package/dist/types/components/palette.stories.d.ts +0 -6
  111. package/dist/types/components.d.ts +0 -236
  112. package/dist/types/docs/gettingstarted-developer.stories.d.ts +0 -5
  113. package/dist/types/icons.d.ts +0 -2
  114. package/dist/types/index.d.ts +0 -1
  115. package/dist/types/stencil-public-runtime.d.ts +0 -1637
  116. package/loader/cdn.js +0 -3
  117. package/loader/index.cjs.js +0 -3
  118. package/loader/index.d.ts +0 -21
  119. package/loader/index.es2017.js +0 -3
  120. package/loader/index.js +0 -4
  121. package/loader/package.json +0 -11
@@ -1,182 +0,0 @@
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}";
4
-
5
- const TttxForm = class {
6
- constructor(hostRef) {
7
- registerInstance(this, hostRef);
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);
69
- }
70
- else {
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 : '');
120
- }
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);
169
- });
170
- // append to the fieldset
171
- this.fieldset.appendChild(formItems);
172
- }
173
- render() {
174
- return (h(Host, null, h("form", { onSubmit: this.doSubmit.bind(this) }, h("fieldset", { onChange: this.fieldsetChange, ref: el => (this.fieldset = el) }))));
175
- }
176
- static get watchers() { return {
177
- "formschema": ["onFormSchemaChange"]
178
- }; }
179
- };
180
- TttxForm.style = tttxFormCss;
181
-
182
- export { TttxForm as tttx_form };