le-kit 0.1.7 → 0.1.9

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 (198) hide show
  1. package/custom-elements.json +1135 -1135
  2. package/dist/cjs/index-D7B9TPh8.js.map +1 -1
  3. package/dist/collection/components/le-popup/le-popup.js +7 -7
  4. package/dist/components/index.js.map +1 -1
  5. package/dist/core/cjs/index-D7B9TPh8.js +1835 -0
  6. package/dist/core/cjs/index-D7B9TPh8.js.map +1 -0
  7. package/dist/core/cjs/index.cjs.js +119 -0
  8. package/dist/core/cjs/index.cjs.js.map +1 -0
  9. package/dist/core/cjs/le-box.cjs.entry.js +184 -0
  10. package/dist/core/cjs/le-box.entry.cjs.js.map +1 -0
  11. package/dist/core/cjs/le-button.cjs.entry.js +92 -0
  12. package/dist/core/cjs/le-button.entry.cjs.js.map +1 -0
  13. package/dist/core/cjs/le-card.cjs.entry.js +29 -0
  14. package/dist/core/cjs/le-card.entry.cjs.js.map +1 -0
  15. package/dist/core/cjs/le-checkbox.cjs.entry.js +61 -0
  16. package/dist/core/cjs/le-checkbox.entry.cjs.js.map +1 -0
  17. package/dist/core/cjs/le-kit.cjs.js +25 -0
  18. package/dist/core/cjs/le-kit.cjs.js.map +1 -0
  19. package/dist/core/cjs/le-number-input.cjs.entry.js +202 -0
  20. package/dist/core/cjs/le-number-input.entry.cjs.js.map +1 -0
  21. package/dist/core/cjs/le-popover.cjs.entry.js +348 -0
  22. package/dist/core/cjs/le-popover.entry.cjs.js.map +1 -0
  23. package/dist/core/cjs/le-popup.cjs.entry.js +212 -0
  24. package/dist/core/cjs/le-popup.entry.cjs.js.map +1 -0
  25. package/dist/core/cjs/le-round-progress.cjs.entry.js +106 -0
  26. package/dist/core/cjs/le-round-progress.entry.cjs.js.map +1 -0
  27. package/dist/core/cjs/le-stack.cjs.entry.js +135 -0
  28. package/dist/core/cjs/le-stack.entry.cjs.js.map +1 -0
  29. package/dist/core/cjs/le-string-input.cjs.entry.js +95 -0
  30. package/dist/core/cjs/le-string-input.entry.cjs.js.map +1 -0
  31. package/dist/core/cjs/le-text.cjs.entry.js +335 -0
  32. package/dist/core/cjs/le-text.entry.cjs.js.map +1 -0
  33. package/dist/core/cjs/le-turntable.cjs.entry.js +139 -0
  34. package/dist/core/cjs/le-turntable.entry.cjs.js.map +1 -0
  35. package/dist/core/cjs/loader.cjs.js +13 -0
  36. package/dist/core/cjs/loader.cjs.js.map +1 -0
  37. package/dist/core/cjs/utils-DrsoID-a.js +152 -0
  38. package/dist/core/cjs/utils-DrsoID-a.js.map +1 -0
  39. package/dist/core/collection/collection-manifest.json +24 -0
  40. package/dist/core/collection/components/le-box/le-box.default.css +37 -0
  41. package/dist/core/collection/components/le-box/le-box.js +614 -0
  42. package/dist/core/collection/components/le-box/le-box.js.map +1 -0
  43. package/dist/core/collection/components/le-button/le-button.default.css +263 -0
  44. package/dist/core/collection/components/le-button/le-button.js +368 -0
  45. package/dist/core/collection/components/le-button/le-button.js.map +1 -0
  46. package/dist/core/collection/components/le-card/le-card.default.css +74 -0
  47. package/dist/core/collection/components/le-card/le-card.js +102 -0
  48. package/dist/core/collection/components/le-card/le-card.js.map +1 -0
  49. package/dist/core/collection/components/le-checkbox/le-checkbox.css +93 -0
  50. package/dist/core/collection/components/le-checkbox/le-checkbox.js +192 -0
  51. package/dist/core/collection/components/le-checkbox/le-checkbox.js.map +1 -0
  52. package/dist/core/collection/components/le-number-input/le-number-input.css +135 -0
  53. package/dist/core/collection/components/le-number-input/le-number-input.js +515 -0
  54. package/dist/core/collection/components/le-number-input/le-number-input.js.map +1 -0
  55. package/dist/core/collection/components/le-popover/le-popover.css +143 -0
  56. package/dist/core/collection/components/le-popover/le-popover.js +693 -0
  57. package/dist/core/collection/components/le-popover/le-popover.js.map +1 -0
  58. package/dist/core/collection/components/le-popup/le-popup.api.js +101 -0
  59. package/dist/core/collection/components/le-popup/le-popup.api.js.map +1 -0
  60. package/dist/core/collection/components/le-popup/le-popup.css +222 -0
  61. package/dist/core/collection/components/le-popup/le-popup.js +596 -0
  62. package/dist/core/collection/components/le-popup/le-popup.js.map +1 -0
  63. package/dist/core/collection/components/le-round-progress/le-round-progress.css +34 -0
  64. package/dist/core/collection/components/le-round-progress/le-round-progress.js +184 -0
  65. package/dist/core/collection/components/le-round-progress/le-round-progress.js.map +1 -0
  66. package/dist/core/collection/components/le-stack/le-stack.default.css +37 -0
  67. package/dist/core/collection/components/le-stack/le-stack.js +389 -0
  68. package/dist/core/collection/components/le-stack/le-stack.js.map +1 -0
  69. package/dist/core/collection/components/le-string-input/le-string-input.css +83 -0
  70. package/dist/core/collection/components/le-string-input/le-string-input.js +359 -0
  71. package/dist/core/collection/components/le-string-input/le-string-input.js.map +1 -0
  72. package/dist/core/collection/components/le-text/le-text.default.css +169 -0
  73. package/dist/core/collection/components/le-text/le-text.js +475 -0
  74. package/dist/core/collection/components/le-text/le-text.js.map +1 -0
  75. package/dist/core/collection/components/le-turntable/le-turntable.css +10 -0
  76. package/dist/core/collection/components/le-turntable/le-turntable.js +210 -0
  77. package/dist/core/collection/components/le-turntable/le-turntable.js.map +1 -0
  78. package/dist/core/collection/global/app.js +167 -0
  79. package/dist/core/collection/global/app.js.map +1 -0
  80. package/dist/core/collection/index.js +15 -0
  81. package/dist/core/collection/index.js.map +1 -0
  82. package/dist/core/collection/types/blocks.js +115 -0
  83. package/dist/core/collection/types/blocks.js.map +1 -0
  84. package/dist/core/collection/types/options.js +2 -0
  85. package/dist/core/collection/types/options.js.map +1 -0
  86. package/dist/core/collection/utils/utils.js +141 -0
  87. package/dist/core/collection/utils/utils.js.map +1 -0
  88. package/dist/core/esm/index-PS-3Rz-c.js +1818 -0
  89. package/dist/core/esm/index-PS-3Rz-c.js.map +1 -0
  90. package/dist/core/esm/index.js +106 -0
  91. package/dist/core/esm/index.js.map +1 -0
  92. package/dist/core/esm/le-box.entry.js +182 -0
  93. package/dist/core/esm/le-box.entry.js.map +1 -0
  94. package/dist/core/esm/le-button.entry.js +90 -0
  95. package/dist/core/esm/le-button.entry.js.map +1 -0
  96. package/dist/core/esm/le-card.entry.js +27 -0
  97. package/dist/core/esm/le-card.entry.js.map +1 -0
  98. package/dist/core/esm/le-checkbox.entry.js +59 -0
  99. package/dist/core/esm/le-checkbox.entry.js.map +1 -0
  100. package/dist/core/esm/le-kit.js +21 -0
  101. package/dist/core/esm/le-kit.js.map +1 -0
  102. package/dist/core/esm/le-number-input.entry.js +200 -0
  103. package/dist/core/esm/le-number-input.entry.js.map +1 -0
  104. package/dist/core/esm/le-popover.entry.js +346 -0
  105. package/dist/core/esm/le-popover.entry.js.map +1 -0
  106. package/dist/core/esm/le-popup.entry.js +210 -0
  107. package/dist/core/esm/le-popup.entry.js.map +1 -0
  108. package/dist/core/esm/le-round-progress.entry.js +104 -0
  109. package/dist/core/esm/le-round-progress.entry.js.map +1 -0
  110. package/dist/core/esm/le-stack.entry.js +133 -0
  111. package/dist/core/esm/le-stack.entry.js.map +1 -0
  112. package/dist/core/esm/le-string-input.entry.js +93 -0
  113. package/dist/core/esm/le-string-input.entry.js.map +1 -0
  114. package/dist/core/esm/le-text.entry.js +333 -0
  115. package/dist/core/esm/le-text.entry.js.map +1 -0
  116. package/dist/core/esm/le-turntable.entry.js +137 -0
  117. package/dist/core/esm/le-turntable.entry.js.map +1 -0
  118. package/dist/core/esm/loader.js +11 -0
  119. package/dist/core/esm/loader.js.map +1 -0
  120. package/dist/core/esm/utils-lgjSfQP0.js +146 -0
  121. package/dist/core/esm/utils-lgjSfQP0.js.map +1 -0
  122. package/dist/core/index.cjs.js +1 -0
  123. package/dist/core/index.js +1 -0
  124. package/dist/core/le-kit/index.esm.js +2 -0
  125. package/dist/core/le-kit/index.esm.js.map +1 -0
  126. package/dist/core/le-kit/le-box.entry.esm.js.map +1 -0
  127. package/dist/core/le-kit/le-button.entry.esm.js.map +1 -0
  128. package/dist/core/le-kit/le-card.entry.esm.js.map +1 -0
  129. package/dist/core/le-kit/le-checkbox.entry.esm.js.map +1 -0
  130. package/dist/core/le-kit/le-kit.css +1 -0
  131. package/dist/core/le-kit/le-kit.esm.js +2 -0
  132. package/dist/core/le-kit/le-kit.esm.js.map +1 -0
  133. package/dist/core/le-kit/le-number-input.entry.esm.js.map +1 -0
  134. package/dist/core/le-kit/le-popover.entry.esm.js.map +1 -0
  135. package/dist/core/le-kit/le-popup.entry.esm.js.map +1 -0
  136. package/dist/core/le-kit/le-round-progress.entry.esm.js.map +1 -0
  137. package/dist/core/le-kit/le-stack.entry.esm.js.map +1 -0
  138. package/dist/core/le-kit/le-string-input.entry.esm.js.map +1 -0
  139. package/dist/core/le-kit/le-text.entry.esm.js.map +1 -0
  140. package/dist/core/le-kit/le-turntable.entry.esm.js.map +1 -0
  141. package/dist/core/le-kit/loader.esm.js.map +1 -0
  142. package/dist/core/le-kit/p-1c5262eb.entry.js +2 -0
  143. package/dist/core/le-kit/p-1c5262eb.entry.js.map +1 -0
  144. package/dist/core/le-kit/p-32c08678.entry.js +2 -0
  145. package/dist/core/le-kit/p-32c08678.entry.js.map +1 -0
  146. package/dist/core/le-kit/p-38e7ec05.entry.js +2 -0
  147. package/dist/core/le-kit/p-38e7ec05.entry.js.map +1 -0
  148. package/dist/core/le-kit/p-4bf51acc.entry.js +2 -0
  149. package/dist/core/le-kit/p-4bf51acc.entry.js.map +1 -0
  150. package/dist/core/le-kit/p-86961f34.entry.js +2 -0
  151. package/dist/core/le-kit/p-86961f34.entry.js.map +1 -0
  152. package/dist/core/le-kit/p-9ee92c29.entry.js +2 -0
  153. package/dist/core/le-kit/p-9ee92c29.entry.js.map +1 -0
  154. package/dist/core/le-kit/p-DN2JVY-7.js +2 -0
  155. package/dist/core/le-kit/p-DN2JVY-7.js.map +1 -0
  156. package/dist/core/le-kit/p-PS-3Rz-c.js +3 -0
  157. package/dist/core/le-kit/p-PS-3Rz-c.js.map +1 -0
  158. package/dist/core/le-kit/p-a07048f8.entry.js +2 -0
  159. package/dist/core/le-kit/p-a07048f8.entry.js.map +1 -0
  160. package/dist/core/le-kit/p-a24b042d.entry.js +2 -0
  161. package/dist/core/le-kit/p-a24b042d.entry.js.map +1 -0
  162. package/dist/core/le-kit/p-bbc9e13e.entry.js +2 -0
  163. package/dist/core/le-kit/p-bbc9e13e.entry.js.map +1 -0
  164. package/dist/core/le-kit/p-c4223c60.entry.js +2 -0
  165. package/dist/core/le-kit/p-c4223c60.entry.js.map +1 -0
  166. package/dist/core/le-kit/p-dcf1343d.entry.js +2 -0
  167. package/dist/core/le-kit/p-dcf1343d.entry.js.map +1 -0
  168. package/dist/core/le-kit/p-fb4e68e0.entry.js +2 -0
  169. package/dist/core/le-kit/p-fb4e68e0.entry.js.map +1 -0
  170. package/dist/core/loader/cdn.js +1 -0
  171. package/dist/core/loader/index.cjs.js +1 -0
  172. package/dist/core/loader/index.d.ts +24 -0
  173. package/dist/core/loader/index.es2017.js +1 -0
  174. package/dist/core/loader/index.js +2 -0
  175. package/dist/core/types/components/le-box/le-box.d.ts +111 -0
  176. package/dist/core/types/components/le-button/le-button.d.ts +78 -0
  177. package/dist/core/types/components/le-card/le-card.d.ts +37 -0
  178. package/dist/core/types/components/le-checkbox/le-checkbox.d.ts +46 -0
  179. package/dist/core/types/components/le-number-input/le-number-input.d.ts +106 -0
  180. package/dist/core/types/components/le-popover/le-popover.d.ts +109 -0
  181. package/dist/core/types/components/le-popup/le-popup.api.d.ts +73 -0
  182. package/dist/core/types/components/le-popup/le-popup.d.ts +122 -0
  183. package/dist/core/types/components/le-round-progress/le-round-progress.d.ts +37 -0
  184. package/dist/core/types/components/le-stack/le-stack.d.ts +73 -0
  185. package/dist/core/types/components/le-string-input/le-string-input.d.ts +83 -0
  186. package/dist/core/types/components/le-text/le-text.d.ts +141 -0
  187. package/dist/core/types/components/le-turntable/le-turntable.d.ts +55 -0
  188. package/dist/core/types/components.d.ts +1752 -0
  189. package/dist/core/types/global/app.d.ts +73 -0
  190. package/dist/core/types/index.d.ts +15 -0
  191. package/dist/core/types/stencil-public-runtime.d.ts +1756 -0
  192. package/dist/core/types/types/blocks.d.ts +136 -0
  193. package/dist/core/types/types/options.d.ts +124 -0
  194. package/dist/core/types/utils/utils.d.ts +54 -0
  195. package/dist/docs.json +8 -8
  196. package/dist/esm/index-PS-3Rz-c.js.map +1 -1
  197. package/dist/le-kit/p-PS-3Rz-c.js.map +1 -1
  198. package/package.json +21 -4
@@ -0,0 +1,515 @@
1
+ import { h, Host } from "@stencil/core";
2
+ import { classnames } from "../../utils/utils";
3
+ /**
4
+ * A number input component with validation, keyboard controls, and custom spinners.
5
+ *
6
+ * @slot - The label text for the input
7
+ * @slot description - Additional description text displayed below the input
8
+ * @slot icon-start - Icon to display at the start of the input
9
+ *
10
+ * @cssprop --le-input-bg - Input background color
11
+ * @cssprop --le-input-color - Input text color
12
+ * @cssprop --le-input-border - Input border style
13
+ * @cssprop --le-input-border-focus - Input border style when focused
14
+ * @cssprop --le-input-border-error - Input border style when invalid
15
+ * @cssprop --le-input-radius - Input border radius
16
+ * @cssprop --le-input-padding - Input padding
17
+ */
18
+ export class LeNumberInput {
19
+ el;
20
+ /**
21
+ * The value of the input
22
+ */
23
+ value;
24
+ /**
25
+ * The name of the input
26
+ */
27
+ name;
28
+ /**
29
+ * Label for the input
30
+ */
31
+ label;
32
+ /**
33
+ * Placeholder text
34
+ */
35
+ placeholder;
36
+ /**
37
+ * Minimum allowed value
38
+ */
39
+ min;
40
+ /**
41
+ * Maximum allowed value
42
+ */
43
+ max;
44
+ /**
45
+ * Step value for increment/decrement
46
+ */
47
+ step = 1;
48
+ /**
49
+ * Whether the input is required
50
+ */
51
+ required = false;
52
+ /**
53
+ * Whether the input is disabled
54
+ */
55
+ disabled = false;
56
+ /**
57
+ * Whether the input is read-only
58
+ */
59
+ readonly = false;
60
+ /**
61
+ * Icon for the start icon
62
+ */
63
+ iconStart;
64
+ /**
65
+ * Whether to show the spinner controls
66
+ */
67
+ showSpinners = true;
68
+ /**
69
+ * External ID for linking with external systems
70
+ */
71
+ externalId;
72
+ /**
73
+ * Internal validation state
74
+ */
75
+ isValid = true;
76
+ validationMessage = '';
77
+ /**
78
+ * Emitted when the value changes (on blur or Enter)
79
+ */
80
+ leChange;
81
+ /**
82
+ * Emitted when the input value changes (on keystroke/spin)
83
+ */
84
+ leInput;
85
+ valueChanged() {
86
+ this.validate();
87
+ }
88
+ validate() {
89
+ if (this.required && (this.value === undefined || this.value === null || isNaN(this.value))) {
90
+ this.isValid = false;
91
+ this.validationMessage = 'This field is required';
92
+ return;
93
+ }
94
+ if (this.value !== undefined && this.value !== null && !isNaN(this.value)) {
95
+ if (this.min !== undefined && this.value < this.min) {
96
+ this.isValid = false;
97
+ this.validationMessage = `Value must be at least ${this.min}`;
98
+ return;
99
+ }
100
+ if (this.max !== undefined && this.value > this.max) {
101
+ this.isValid = false;
102
+ this.validationMessage = `Value must be at most ${this.max}`;
103
+ return;
104
+ }
105
+ }
106
+ this.isValid = true;
107
+ this.validationMessage = '';
108
+ }
109
+ emitChange() {
110
+ this.leChange.emit({
111
+ value: this.value,
112
+ name: this.name,
113
+ externalId: this.externalId,
114
+ isValid: this.isValid
115
+ });
116
+ }
117
+ emitInput() {
118
+ this.leInput.emit({
119
+ value: this.value,
120
+ name: this.name,
121
+ externalId: this.externalId,
122
+ isValid: this.isValid
123
+ });
124
+ }
125
+ updateValue(newValue) {
126
+ if (this.disabled || this.readonly)
127
+ return;
128
+ // Round to avoid floating point errors
129
+ const precision = this.step.toString().split('.')[1]?.length || 0;
130
+ const rounded = parseFloat(newValue.toFixed(precision));
131
+ this.value = rounded;
132
+ this.validate();
133
+ this.emitInput();
134
+ }
135
+ handleInput = (ev) => {
136
+ const input = ev.target;
137
+ const val = parseFloat(input.value);
138
+ if (input.value === '') {
139
+ this.value = undefined;
140
+ }
141
+ else if (!isNaN(val)) {
142
+ this.value = val;
143
+ }
144
+ this.validate();
145
+ this.emitInput();
146
+ };
147
+ handleChange = () => {
148
+ this.validate();
149
+ this.emitChange();
150
+ };
151
+ handleKeyDown = (ev) => {
152
+ if (this.disabled || this.readonly)
153
+ return;
154
+ let multiplier = 1;
155
+ if (ev.shiftKey)
156
+ multiplier = 10;
157
+ if (ev.altKey)
158
+ multiplier = 0.1;
159
+ const current = this.value || 0;
160
+ if (ev.key === 'ArrowUp') {
161
+ ev.preventDefault();
162
+ this.updateValue(current + (this.step * multiplier));
163
+ }
164
+ else if (ev.key === 'ArrowDown') {
165
+ ev.preventDefault();
166
+ this.updateValue(current - (this.step * multiplier));
167
+ }
168
+ };
169
+ handleWheel = (ev) => {
170
+ if (this.disabled || this.readonly)
171
+ return;
172
+ // Only handle if input is focused to prevent accidental scrolling
173
+ if (document.activeElement !== ev.target)
174
+ return;
175
+ ev.preventDefault();
176
+ const current = this.value || 0;
177
+ if (ev.deltaY < 0) {
178
+ this.updateValue(current + this.step);
179
+ }
180
+ else {
181
+ this.updateValue(current - this.step);
182
+ }
183
+ };
184
+ increment = (ev) => {
185
+ ev.preventDefault(); // Prevent focus loss
186
+ const current = this.value || 0;
187
+ this.updateValue(current + this.step);
188
+ // Trigger change event for buttons as they are "final" actions usually
189
+ this.emitChange();
190
+ };
191
+ decrement = (ev) => {
192
+ ev.preventDefault();
193
+ const current = this.value || 0;
194
+ this.updateValue(current - this.step);
195
+ this.emitChange();
196
+ };
197
+ render() {
198
+ return (h(Host, { key: '4b23af3dffd76a17c89f028447bb85c7cf12e3df', class: classnames({ 'disabled': this.disabled }) }, h("div", { key: '750438149c519f06672bed9d57f1f9830db79d11', class: "le-input-wrapper" }, this.label && (h("label", { key: '6e5f1dc4cd9211def05593635a3d798684aee52e', class: "le-input-label", htmlFor: this.name }, this.label)), h("div", { key: 'a3a39d3ae3c0da57927b06b0293ca5852d4f2b60', class: classnames('le-input-container', { 'has-error': !this.isValid }) }, this.iconStart && (h("span", { key: 'be1c9e1cb4061e6ca8e13796dfb536a7e436a688', class: "icon-start" }, this.iconStart)), h("input", { key: 'e59624c3a2360595b75577e2d9b04933300f4d3d', id: this.name, type: "number", name: this.name, placeholder: this.placeholder, min: this.min, max: this.max, step: this.step, value: this.value, disabled: this.disabled, readOnly: this.readonly, required: this.required, onInput: this.handleInput, onChange: this.handleChange, onKeyDown: this.handleKeyDown, onWheel: this.handleWheel }), this.showSpinners && (h("div", { key: 'ac84077c3444da1414ba06e8b797f60766edd3db', class: "le-input-controls" }, h("le-button", { key: 'c452141f07a3a4f3090374df10896fca036f4a01', mode: "default", variant: "clear", size: "small", "icon-only": true, class: "le-input-control-btn", onClick: this.increment, disabled: this.disabled || this.readonly || (this.max !== undefined && this.value >= this.max), tabindex: "-1" }, h("span", { key: '489960a26e655f3852b4d26f1660d7c8411cc896', slot: "icon-only" }, "\u2191")), h("le-button", { key: 'd3662170c7718c9d51a0089362faf70b62715aa8', mode: "default", variant: "clear", size: "small", "icon-only": true, class: "le-input-control-btn", onClick: this.decrement, disabled: this.disabled || this.readonly || (this.min !== undefined && this.value <= this.min), tabindex: "-1" }, h("span", { key: '48e035cece04f248137925af42d0728010e4ac78', slot: "icon-only" }, "\u2193"))))), !this.isValid && h("div", { key: 'd439b3c235fd3f8fb127eaed292f49e6382d0d6e', class: "le-input-error" }, this.validationMessage), h("div", { key: 'e27428a5e033617af04c656cbf5d5954ab770cec', class: "le-input-description" }, h("slot", { key: 'bab0f00e77f7241d63ffb694f4905b8cf82e5513', name: "description" })))));
199
+ }
200
+ static get is() { return "le-number-input"; }
201
+ static get encapsulation() { return "shadow"; }
202
+ static get originalStyleUrls() {
203
+ return {
204
+ "$": ["le-number-input.css"]
205
+ };
206
+ }
207
+ static get styleUrls() {
208
+ return {
209
+ "$": ["le-number-input.css"]
210
+ };
211
+ }
212
+ static get properties() {
213
+ return {
214
+ "value": {
215
+ "type": "number",
216
+ "mutable": true,
217
+ "complexType": {
218
+ "original": "number",
219
+ "resolved": "number",
220
+ "references": {}
221
+ },
222
+ "required": false,
223
+ "optional": false,
224
+ "docs": {
225
+ "tags": [],
226
+ "text": "The value of the input"
227
+ },
228
+ "getter": false,
229
+ "setter": false,
230
+ "reflect": true,
231
+ "attribute": "value"
232
+ },
233
+ "name": {
234
+ "type": "string",
235
+ "mutable": false,
236
+ "complexType": {
237
+ "original": "string",
238
+ "resolved": "string",
239
+ "references": {}
240
+ },
241
+ "required": false,
242
+ "optional": false,
243
+ "docs": {
244
+ "tags": [],
245
+ "text": "The name of the input"
246
+ },
247
+ "getter": false,
248
+ "setter": false,
249
+ "reflect": false,
250
+ "attribute": "name"
251
+ },
252
+ "label": {
253
+ "type": "string",
254
+ "mutable": false,
255
+ "complexType": {
256
+ "original": "string",
257
+ "resolved": "string",
258
+ "references": {}
259
+ },
260
+ "required": false,
261
+ "optional": false,
262
+ "docs": {
263
+ "tags": [],
264
+ "text": "Label for the input"
265
+ },
266
+ "getter": false,
267
+ "setter": false,
268
+ "reflect": false,
269
+ "attribute": "label"
270
+ },
271
+ "placeholder": {
272
+ "type": "string",
273
+ "mutable": false,
274
+ "complexType": {
275
+ "original": "string",
276
+ "resolved": "string",
277
+ "references": {}
278
+ },
279
+ "required": false,
280
+ "optional": false,
281
+ "docs": {
282
+ "tags": [],
283
+ "text": "Placeholder text"
284
+ },
285
+ "getter": false,
286
+ "setter": false,
287
+ "reflect": false,
288
+ "attribute": "placeholder"
289
+ },
290
+ "min": {
291
+ "type": "number",
292
+ "mutable": false,
293
+ "complexType": {
294
+ "original": "number",
295
+ "resolved": "number",
296
+ "references": {}
297
+ },
298
+ "required": false,
299
+ "optional": true,
300
+ "docs": {
301
+ "tags": [],
302
+ "text": "Minimum allowed value"
303
+ },
304
+ "getter": false,
305
+ "setter": false,
306
+ "reflect": false,
307
+ "attribute": "min"
308
+ },
309
+ "max": {
310
+ "type": "number",
311
+ "mutable": false,
312
+ "complexType": {
313
+ "original": "number",
314
+ "resolved": "number",
315
+ "references": {}
316
+ },
317
+ "required": false,
318
+ "optional": true,
319
+ "docs": {
320
+ "tags": [],
321
+ "text": "Maximum allowed value"
322
+ },
323
+ "getter": false,
324
+ "setter": false,
325
+ "reflect": false,
326
+ "attribute": "max"
327
+ },
328
+ "step": {
329
+ "type": "number",
330
+ "mutable": false,
331
+ "complexType": {
332
+ "original": "number",
333
+ "resolved": "number",
334
+ "references": {}
335
+ },
336
+ "required": false,
337
+ "optional": false,
338
+ "docs": {
339
+ "tags": [],
340
+ "text": "Step value for increment/decrement"
341
+ },
342
+ "getter": false,
343
+ "setter": false,
344
+ "reflect": false,
345
+ "attribute": "step",
346
+ "defaultValue": "1"
347
+ },
348
+ "required": {
349
+ "type": "boolean",
350
+ "mutable": false,
351
+ "complexType": {
352
+ "original": "boolean",
353
+ "resolved": "boolean",
354
+ "references": {}
355
+ },
356
+ "required": false,
357
+ "optional": false,
358
+ "docs": {
359
+ "tags": [],
360
+ "text": "Whether the input is required"
361
+ },
362
+ "getter": false,
363
+ "setter": false,
364
+ "reflect": false,
365
+ "attribute": "required",
366
+ "defaultValue": "false"
367
+ },
368
+ "disabled": {
369
+ "type": "boolean",
370
+ "mutable": false,
371
+ "complexType": {
372
+ "original": "boolean",
373
+ "resolved": "boolean",
374
+ "references": {}
375
+ },
376
+ "required": false,
377
+ "optional": false,
378
+ "docs": {
379
+ "tags": [],
380
+ "text": "Whether the input is disabled"
381
+ },
382
+ "getter": false,
383
+ "setter": false,
384
+ "reflect": false,
385
+ "attribute": "disabled",
386
+ "defaultValue": "false"
387
+ },
388
+ "readonly": {
389
+ "type": "boolean",
390
+ "mutable": false,
391
+ "complexType": {
392
+ "original": "boolean",
393
+ "resolved": "boolean",
394
+ "references": {}
395
+ },
396
+ "required": false,
397
+ "optional": false,
398
+ "docs": {
399
+ "tags": [],
400
+ "text": "Whether the input is read-only"
401
+ },
402
+ "getter": false,
403
+ "setter": false,
404
+ "reflect": false,
405
+ "attribute": "readonly",
406
+ "defaultValue": "false"
407
+ },
408
+ "iconStart": {
409
+ "type": "string",
410
+ "mutable": false,
411
+ "complexType": {
412
+ "original": "string",
413
+ "resolved": "string",
414
+ "references": {}
415
+ },
416
+ "required": false,
417
+ "optional": true,
418
+ "docs": {
419
+ "tags": [],
420
+ "text": "Icon for the start icon"
421
+ },
422
+ "getter": false,
423
+ "setter": false,
424
+ "reflect": false,
425
+ "attribute": "icon-start"
426
+ },
427
+ "showSpinners": {
428
+ "type": "boolean",
429
+ "mutable": false,
430
+ "complexType": {
431
+ "original": "boolean",
432
+ "resolved": "boolean",
433
+ "references": {}
434
+ },
435
+ "required": false,
436
+ "optional": false,
437
+ "docs": {
438
+ "tags": [],
439
+ "text": "Whether to show the spinner controls"
440
+ },
441
+ "getter": false,
442
+ "setter": false,
443
+ "reflect": false,
444
+ "attribute": "show-spinners",
445
+ "defaultValue": "true"
446
+ },
447
+ "externalId": {
448
+ "type": "string",
449
+ "mutable": false,
450
+ "complexType": {
451
+ "original": "string",
452
+ "resolved": "string",
453
+ "references": {}
454
+ },
455
+ "required": false,
456
+ "optional": false,
457
+ "docs": {
458
+ "tags": [],
459
+ "text": "External ID for linking with external systems"
460
+ },
461
+ "getter": false,
462
+ "setter": false,
463
+ "reflect": false,
464
+ "attribute": "external-id"
465
+ }
466
+ };
467
+ }
468
+ static get states() {
469
+ return {
470
+ "isValid": {},
471
+ "validationMessage": {}
472
+ };
473
+ }
474
+ static get events() {
475
+ return [{
476
+ "method": "leChange",
477
+ "name": "leChange",
478
+ "bubbles": true,
479
+ "cancelable": true,
480
+ "composed": true,
481
+ "docs": {
482
+ "tags": [],
483
+ "text": "Emitted when the value changes (on blur or Enter)"
484
+ },
485
+ "complexType": {
486
+ "original": "{ value: number; name: string; externalId: string; isValid: boolean }",
487
+ "resolved": "{ value: number; name: string; externalId: string; isValid: boolean; }",
488
+ "references": {}
489
+ }
490
+ }, {
491
+ "method": "leInput",
492
+ "name": "leInput",
493
+ "bubbles": true,
494
+ "cancelable": true,
495
+ "composed": true,
496
+ "docs": {
497
+ "tags": [],
498
+ "text": "Emitted when the input value changes (on keystroke/spin)"
499
+ },
500
+ "complexType": {
501
+ "original": "{ value: number; name: string; externalId: string; isValid: boolean }",
502
+ "resolved": "{ value: number; name: string; externalId: string; isValid: boolean; }",
503
+ "references": {}
504
+ }
505
+ }];
506
+ }
507
+ static get elementRef() { return "el"; }
508
+ static get watchers() {
509
+ return [{
510
+ "propName": "value",
511
+ "methodName": "valueChanged"
512
+ }];
513
+ }
514
+ }
515
+ //# sourceMappingURL=le-number-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"le-number-input.js","sourceRoot":"","sources":["../../../src-core/components/le-number-input/le-number-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAgB,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAG,IAAI,EAAE,MAAM,eAAe,CAAC;AACtG,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C;;;;;;;;;;;;;;GAcG;AAMH,MAAM,OAAO,aAAa;IACb,EAAE,CAAc;IAE3B;;OAEG;IACqC,KAAK,CAAS;IAEtD;;OAEG;IACK,IAAI,CAAS;IAErB;;OAEG;IACK,KAAK,CAAS;IAEtB;;OAEG;IACK,WAAW,CAAS;IAE5B;;OAEG;IACK,GAAG,CAAU;IAErB;;OAEG;IACK,GAAG,CAAU;IAErB;;OAEG;IACK,IAAI,GAAW,CAAC,CAAC;IAEzB;;OAEG;IACK,QAAQ,GAAY,KAAK,CAAC;IAElC;;OAEG;IACK,QAAQ,GAAY,KAAK,CAAC;IAElC;;OAEG;IACK,QAAQ,GAAY,KAAK,CAAC;IAElC;;OAEG;IACK,SAAS,CAAU;IAE3B;;OAEG;IACK,YAAY,GAAY,IAAI,CAAC;IAErC;;OAEG;IACK,UAAU,CAAS;IAE3B;;OAEG;IACc,OAAO,GAAY,IAAI,CAAC;IACxB,iBAAiB,GAAW,EAAE,CAAC;IAEhD;;OAEG;IACM,QAAQ,CAAsF;IAEvG;;OAEG;IACM,OAAO,CAAsF;IAGtG,YAAY;QACV,IAAI,CAAC,QAAQ,EAAE,CAAC;IAClB,CAAC;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GAAG,CAAC,EAC9F,QAAQ,EAAC,IAAI;4BAEb,6DAAM,IAAI,EAAC,WAAW,aAAS,CACrB,CACR,CACP,CACG;gBAEL,CAAC,IAAI,CAAC,OAAO,IAAI,4DAAK,KAAK,EAAC,gBAAgB,IAAE,IAAI,CAAC,iBAAiB,CAAO;gBAE5E,4DAAK,KAAK,EAAC,sBAAsB;oBAE7B,6DAAM,IAAI,EAAC,aAAa,GAAQ,CAE9B,CACF,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, Event, EventEmitter, State, h, Element, Watch , Host } from '@stencil/core';\nimport { classnames } from '../../utils/utils';\n\n/**\n * A number input component with validation, keyboard controls, and custom spinners.\n *\n * @slot - The label text for the input\n * @slot description - Additional description text displayed below the input\n * @slot icon-start - Icon to display at the start of the input\n *\n * @cssprop --le-input-bg - Input background color\n * @cssprop --le-input-color - Input text color\n * @cssprop --le-input-border - Input border style\n * @cssprop --le-input-border-focus - Input border style when focused\n * @cssprop --le-input-border-error - Input border style when invalid\n * @cssprop --le-input-radius - Input border radius\n * @cssprop --le-input-padding - Input padding\n */\n@Component({\n tag: 'le-number-input',\n styleUrl: 'le-number-input.css',\n shadow: true,\n})\nexport class LeNumberInput {\n @Element() el: HTMLElement;\n\n /**\n * The value of the input\n */\n @Prop({ mutable: true, reflect: true }) value: number;\n\n /**\n * The name of the input\n */\n @Prop() name: string;\n\n /**\n * Label for the input\n */\n @Prop() label: string;\n\n /**\n * Placeholder text\n */\n @Prop() placeholder: string;\n\n /**\n * Minimum allowed value\n */\n @Prop() min?: number;\n\n /**\n * Maximum allowed value\n */\n @Prop() max?: number;\n\n /**\n * Step value for increment/decrement\n */\n @Prop() step: number = 1;\n\n /**\n * Whether the input is required\n */\n @Prop() required: boolean = false;\n\n /**\n * Whether the input is disabled\n */\n @Prop() disabled: boolean = false;\n\n /**\n * Whether the input is read-only\n */\n @Prop() readonly: boolean = false;\n\n /**\n * Icon for the start icon\n */\n @Prop() iconStart?: string;\n\n /**\n * Whether to show the spinner controls\n */\n @Prop() showSpinners: boolean = true;\n\n /**\n * External ID for linking with external systems\n */\n @Prop() externalId: string;\n\n /**\n * Internal validation state\n */\n @State() private isValid: boolean = true;\n @State() private validationMessage: string = '';\n\n /**\n * Emitted when the value changes (on blur or Enter)\n */\n @Event() leChange: EventEmitter<{ value: number; name: string; externalId: string; isValid: boolean }>;\n\n /**\n * Emitted when the input value changes (on keystroke/spin)\n */\n @Event() leInput: EventEmitter<{ value: number; name: string; externalId: string; isValid: boolean }>;\n\n @Watch('value')\n valueChanged() {\n this.validate();\n }\n\n private validate() {\n if (this.required && (this.value === undefined || this.value === null || isNaN(this.value))) {\n this.isValid = false;\n this.validationMessage = 'This field is required';\n return;\n }\n\n if (this.value !== undefined && this.value !== null && !isNaN(this.value)) {\n if (this.min !== undefined && this.value < this.min) {\n this.isValid = false;\n this.validationMessage = `Value must be at least ${this.min}`;\n return;\n }\n if (this.max !== undefined && this.value > this.max) {\n this.isValid = false;\n this.validationMessage = `Value must be at most ${this.max}`;\n return;\n }\n }\n\n this.isValid = true;\n this.validationMessage = '';\n }\n\n private emitChange() {\n this.leChange.emit({\n value: this.value,\n name: this.name,\n externalId: this.externalId,\n isValid: this.isValid\n });\n }\n\n private emitInput() {\n this.leInput.emit({\n value: this.value,\n name: this.name,\n externalId: this.externalId,\n isValid: this.isValid\n });\n }\n\n private updateValue(newValue: number) {\n if (this.disabled || this.readonly) return;\n \n // Round to avoid floating point errors\n const precision = this.step.toString().split('.')[1]?.length || 0;\n const rounded = parseFloat(newValue.toFixed(precision));\n \n this.value = rounded;\n this.validate();\n this.emitInput();\n }\n\n private handleInput = (ev: Event) => {\n const input = ev.target as HTMLInputElement;\n const val = parseFloat(input.value);\n \n if (input.value === '') {\n this.value = undefined;\n } else if (!isNaN(val)) {\n this.value = val;\n }\n \n this.validate();\n this.emitInput();\n };\n\n private handleChange = () => {\n this.validate();\n this.emitChange();\n };\n\n private handleKeyDown = (ev: KeyboardEvent) => {\n if (this.disabled || this.readonly) return;\n\n let multiplier = 1;\n if (ev.shiftKey) multiplier = 10;\n if (ev.altKey) multiplier = 0.1;\n\n const current = this.value || 0;\n\n if (ev.key === 'ArrowUp') {\n ev.preventDefault();\n this.updateValue(current + (this.step * multiplier));\n } else if (ev.key === 'ArrowDown') {\n ev.preventDefault();\n this.updateValue(current - (this.step * multiplier));\n }\n };\n\n private handleWheel = (ev: WheelEvent) => {\n if (this.disabled || this.readonly) return;\n // Only handle if input is focused to prevent accidental scrolling\n if (document.activeElement !== ev.target) return;\n\n ev.preventDefault();\n const current = this.value || 0;\n \n if (ev.deltaY < 0) {\n this.updateValue(current + this.step);\n } else {\n this.updateValue(current - this.step);\n }\n };\n\n private increment = (ev: Event) => {\n ev.preventDefault(); // Prevent focus loss\n const current = this.value || 0;\n this.updateValue(current + this.step);\n // Trigger change event for buttons as they are \"final\" actions usually\n this.emitChange();\n };\n\n private decrement = (ev: Event) => {\n ev.preventDefault();\n const current = this.value || 0;\n this.updateValue(current - this.step);\n this.emitChange();\n };\n\n render() {\n return (\n <Host class={classnames({ 'disabled': this.disabled })}>\n <div class=\"le-input-wrapper\">\n {this.label && (\n <label class=\"le-input-label\" htmlFor={this.name}>{this.label}</label>\n )}\n \n <div class={classnames('le-input-container', { 'has-error': !this.isValid })}>\n {this.iconStart && (\n <span class=\"icon-start\">{this.iconStart}</span>\n )}\n \n <input\n id={this.name}\n type=\"number\"\n name={this.name}\n placeholder={this.placeholder}\n min={this.min}\n max={this.max}\n step={this.step}\n value={this.value}\n disabled={this.disabled}\n readOnly={this.readonly}\n required={this.required}\n onInput={this.handleInput}\n onChange={this.handleChange}\n onKeyDown={this.handleKeyDown}\n onWheel={this.handleWheel}\n />\n \n {this.showSpinners && (\n <div class=\"le-input-controls\">\n <le-button\n mode=\"default\"\n variant=\"clear\" \n size=\"small\"\n icon-only\n class=\"le-input-control-btn\" \n onClick={this.increment}\n disabled={this.disabled || this.readonly || (this.max !== undefined && this.value >= this.max)}\n tabindex=\"-1\"\n >\n <span slot=\"icon-only\">↑</span>\n </le-button>\n <le-button\n mode=\"default\"\n variant=\"clear\" \n size=\"small\" \n icon-only \n class=\"le-input-control-btn\" \n onClick={this.decrement}\n disabled={this.disabled || this.readonly || (this.min !== undefined && this.value <= this.min)}\n tabindex=\"-1\"\n >\n <span slot=\"icon-only\">↓</span>\n </le-button>\n </div>\n )}\n </div>\n\n {!this.isValid && <div class=\"le-input-error\">{this.validationMessage}</div>}\n\n <div class=\"le-input-description\">\n \n <slot name=\"description\"></slot>\n \n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
@@ -0,0 +1,143 @@
1
+ /* ============================================
2
+ le-popover.css
3
+ Popover using native HTML Popover API
4
+ ============================================ */
5
+
6
+ :host {
7
+ display: inline-block;
8
+ position: relative;
9
+ }
10
+
11
+ /* ============================================
12
+ Trigger
13
+ ============================================ */
14
+
15
+ .le-popover-trigger {
16
+ display: inline-flex;
17
+ cursor: pointer;
18
+ }
19
+
20
+ .le-popover-default-trigger {
21
+ display: flex;
22
+ align-items: center;
23
+ justify-content: center;
24
+ width: 28px;
25
+ height: 28px;
26
+ padding: 0;
27
+ border: 1px solid var(--le-color-border, #e0e0e0);
28
+ border-radius: var(--le-radius-md, 6px);
29
+ background: var(--le-color-surface, #fff);
30
+ color: var(--le-color-text-secondary, #666);
31
+ font-size: 16px;
32
+ cursor: pointer;
33
+ transition: all var(--le-transition-fast, 0.15s ease);
34
+ }
35
+
36
+ .le-popover-default-trigger:hover {
37
+ border-color: var(--le-color-primary, #2196f3);
38
+ color: var(--le-color-primary, #2196f3);
39
+ background: var(--le-color-primary-light, rgba(33, 150, 243, 0.1));
40
+ }
41
+
42
+ /* ============================================
43
+ Popover Content (native popover)
44
+ ============================================ */
45
+
46
+ .le-popover-content {
47
+ /* Reset native popover defaults */
48
+ margin: 0;
49
+ padding: 0;
50
+ border: none;
51
+ background: transparent;
52
+
53
+ /* Positioning - will be set via JS */
54
+ position: fixed;
55
+ inset: unset;
56
+
57
+ /* Styling */
58
+ background: var(--le-color-surface, #ffffff);
59
+ border: 1px solid var(--le-color-border, #e0e0e0);
60
+ border-radius: var(--le-radius-lg, 8px);
61
+ box-shadow: var(--le-shadow-lg, 0 4px 12px rgba(0, 0, 0, 0.15));
62
+ overflow: hidden;
63
+ font-family: var(--le-font-family, system-ui, -apple-system, sans-serif);
64
+ font-size: var(--le-font-size-sm, 0.875rem);
65
+ color: var(--le-color-text, #333);
66
+
67
+ /* Animation */
68
+ opacity: 0;
69
+ transform: scale(0.95);
70
+ transition: opacity 0.15s ease, transform 0.15s ease, display 0.15s ease allow-discrete;
71
+ }
72
+
73
+ /* When popover is open */
74
+ .le-popover-content:popover-open {
75
+ opacity: 1;
76
+ transform: scale(1);
77
+ }
78
+
79
+ /* Starting style for animation (CSS Anchor Positioning spec) */
80
+ @starting-style {
81
+ .le-popover-content:popover-open {
82
+ opacity: 0;
83
+ transform: scale(0.95);
84
+ }
85
+ }
86
+
87
+ /* ============================================
88
+ Header
89
+ ============================================ */
90
+
91
+ .le-popover-header {
92
+ display: flex;
93
+ align-items: center;
94
+ justify-content: space-between;
95
+ padding: var(--le-space-xs, 4px) var(--le-space-xs, 4px) var(--le-space-xs, 4px) var(--le-space-sm, 8px);
96
+ border-bottom: 1px solid var(--le-color-border, #e0e0e0);
97
+ background: var(--le-color-surface-alt, #f9f9f9);
98
+ min-height: 32px;
99
+ }
100
+
101
+ .le-popover-title {
102
+ font-weight: var(--le-font-weight-semibold, 600);
103
+ font-size: var(--le-font-size-sm, 0.875rem);
104
+ color: var(--le-color-text, #333);
105
+ }
106
+
107
+ .le-popover-close {
108
+ display: flex;
109
+ align-items: center;
110
+ justify-content: center;
111
+ width: 24px;
112
+ height: 24px;
113
+ padding: 0;
114
+ border: none;
115
+ background: transparent;
116
+ color: var(--le-color-text-secondary, #666);
117
+ font-size: 18px;
118
+ line-height: 1;
119
+ cursor: pointer;
120
+ border-radius: var(--le-radius-sm, 4px);
121
+ transition: background-color 0.15s, color 0.15s;
122
+ }
123
+
124
+ .le-popover-close:hover {
125
+ background: var(--le-color-surface-hover, rgba(0, 0, 0, 0.05));
126
+ color: var(--le-color-text, #333);
127
+ }
128
+
129
+ /* ============================================
130
+ Body
131
+ ============================================ */
132
+
133
+ .le-popover-body {
134
+ padding: var(--le-space-md, 12px);
135
+ }
136
+
137
+ /* ============================================
138
+ Scrollable content
139
+ ============================================ */
140
+
141
+ .le-popover-content[style*="overflow-y: auto"] .le-popover-body {
142
+ overflow-y: auto;
143
+ }