yukit 1.3.4 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.npm/_cacache/content-v2/sha512/{06/fe/f10be9aedfe6bb06504a34aa35a084aafca066663661190d998f95937f4fbb09fc193de8313d577562865083f6045d7550dcc159a8a3d0affe85e5662a13 → ef/d1/a854556d6674a79df1d56d7f24d5f757afc4e575e9b4c2acb83e78b4e5cbfcaf51ee205ef744f746378443600cf029f86adb9102e5d60c3789222dce2f3d} +1 -1
- package/.npm/_cacache/index-v5/da/a6/cd0a3e3289cea9e3aa7ff1d04211095cfcfe35d9ed75a60d11fce35fe98f +1 -1
- package/.npm/_logs/{2026-09-07T06_50_18_342Z-debug-0.log → 2026-11-19T14_38_36_741Z-debug-0.log} +15 -15
- package/.npm/_logs/{2026-09-07T06_50_18_831Z-debug-0.log → 2026-11-19T14_38_37_229Z-debug-0.log} +4 -4
- package/README.md +63 -5
- package/fesm2022/yukit.mjs +223 -6
- package/fesm2022/yukit.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/components/input/input.component.html +9 -8
- package/src/lib/components/input/input.component.scss +4 -0
- package/src/lib/components/input/input.component.ts +162 -3
- package/src/lib/components/notice/notice.component.html +1 -1
- package/src/lib/config/decimal-separator.token.ts +7 -0
- package/src/lib/interface/input-appearance.interface.ts +1 -0
- package/src/lib/theme/components/alert.scss +4 -4
- package/src/lib/utils/number.utils.ts +113 -0
- package/types/yukit.d.ts +76 -7
package/README.md
CHANGED
|
@@ -182,20 +182,78 @@ List of all icons: https://phosphoricons.com/
|
|
|
182
182
|
|:-----------------|:------------------------------------------------------------------------------------------------------|-------------|
|
|
183
183
|
| label | `string` | |
|
|
184
184
|
| placeholder | `string` | |
|
|
185
|
-
| type | `date`|`datetime-local`|`email`|`month`|`number`|`password`|`search`|`tel`|`text`|`time`|`url`|`week` | `text` |
|
|
185
|
+
| type | `date`|`datetime-local`|`decimal`|`email`|`month`|`number`|`password`|`search`|`tel`|`text`|`time`|`url`|`week` | `text` |
|
|
186
186
|
| inputmode | `decimal`|`email`|`none`|`numeric`|`search`|`tel`|`text`|`url`|`password`|`undefined` | `undefined` |
|
|
187
187
|
| autocapitalize | `string` | `off` |
|
|
188
|
+
| appearance | `outline`|`inline` | `outline` |
|
|
188
189
|
| passwordToggle | `boolean` | `false` |
|
|
189
190
|
| disabled | `boolean` | `false` |
|
|
191
|
+
| readonly | `boolean` | `false` |
|
|
192
|
+
| min / max | `number`|`string` | |
|
|
193
|
+
| decimals | `number` (only `type="decimal"`) | `2` |
|
|
194
|
+
| allowNegative | `boolean` (only `type="decimal"`) | `false` |
|
|
190
195
|
| helperText | `string`|`undefined` | `undefined` |
|
|
191
196
|
| isIncorrectValue | `boolean` | `false` |
|
|
192
197
|
|
|
193
198
|
#### Events
|
|
194
199
|
|
|
195
|
-
| Name
|
|
196
|
-
|
|
197
|
-
|
|
|
198
|
-
|
|
|
200
|
+
| Name | Description |
|
|
201
|
+
|:------------|:-------------------------------------------------------------------|
|
|
202
|
+
| valueChange | Emitted when the value changes (`number`|`null` with `type="decimal"`). |
|
|
203
|
+
| yuBlur | Emitted when the input loses focus. |
|
|
204
|
+
| yuFocus | Emitted when the input has focus. |
|
|
205
|
+
|
|
206
|
+
#### Inline appearance
|
|
207
|
+
|
|
208
|
+
`appearance="inline"` renders a plain input with the app's mode, without outline, label or top margin,
|
|
209
|
+
for fields placed inside an `ion-item`, a list row or a custom layout:
|
|
210
|
+
|
|
211
|
+
```html
|
|
212
|
+
<ion-item>
|
|
213
|
+
<yu-input appearance="inline" type="decimal" placeholder="0" [(value)]="line.quantity">
|
|
214
|
+
<ion-note slot="end">kg</ion-note>
|
|
215
|
+
</yu-input>
|
|
216
|
+
</ion-item>
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
The host takes no box (`display: contents`), so the inner `ion-input` lays out as a direct child of
|
|
220
|
+
the container and existing styles that target `ion-input` there keep working. Classes set on
|
|
221
|
+
`yu-input` do not affect layout: style the inner `ion-input` instead. Content with a `slot`
|
|
222
|
+
(`start`/`end`) is projected into the input.
|
|
223
|
+
|
|
224
|
+
#### Decimal numbers
|
|
225
|
+
|
|
226
|
+
Use `type="decimal"` for amounts and quantities instead of `type="number"`:
|
|
227
|
+
|
|
228
|
+
```html
|
|
229
|
+
<yu-input type="decimal" [(value)]="form.amount"></yu-input>
|
|
230
|
+
<yu-input type="decimal" [decimals]="0" [(value)]="form.units"></yu-input>
|
|
231
|
+
<yu-input type="decimal" [allowNegative]="true" [min]="-100" [max]="100" [(value)]="form.discount"></yu-input>
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
- Renders a text input with `inputmode="decimal"` (`numeric` when `decimals` is `0`), so iOS
|
|
235
|
+
never drops the comma as it does with `type="number"` when the device language uses a dot.
|
|
236
|
+
- Accepts comma and dot while typing and keeps the text as typed (`12,0`, `0,`), so a model that
|
|
237
|
+
is written back never resets what the user is typing.
|
|
238
|
+
- `value` is always a `number` or `null` (empty). `valueChange` only fires when the number changes.
|
|
239
|
+
- Removes invalid characters, extra separators and extra decimals. Pasted values keep their
|
|
240
|
+
thousands (`1.234,56` → `1234,56`).
|
|
241
|
+
- A value above a non-negative `max` (or below a non-positive `min`) is corrected while typing;
|
|
242
|
+
other limits are applied on blur, since `5` may still become `50`.
|
|
243
|
+
- On blur, edited text is completed and shown with the configured separator (`12,` → `12`,
|
|
244
|
+
`12.5` → `12,5`). Leaving the field without typing never changes the value.
|
|
245
|
+
- Values that come from the model are displayed with the decimal separator provided by
|
|
246
|
+
`YU_DECIMAL_SEPARATOR` (`,` by default):
|
|
247
|
+
|
|
248
|
+
```typescript
|
|
249
|
+
providers: [{provide: YU_DECIMAL_SEPARATOR, useValue: '.'}]
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
- iOS decimal keyboards have no minus key: with `allowNegative`, pass `inputmode="text"` if users
|
|
253
|
+
must type the sign.
|
|
254
|
+
|
|
255
|
+
`YuNumberUtils.parse`, `format` and `sanitize` are exported to apply the same rules outside the
|
|
256
|
+
component (alerts, calculations).
|
|
199
257
|
|
|
200
258
|
### List action
|
|
201
259
|
|
package/fesm2022/yukit.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Input, Component, EventEmitter, Output, ViewChild, NgModule } from '@angular/core';
|
|
2
|
+
import { Input, Component, InjectionToken, EventEmitter, inject, HostBinding, Output, ViewChild, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import * as i2$1 from '@angular/forms';
|
|
@@ -112,29 +112,235 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
112
112
|
type: Input
|
|
113
113
|
}] } });
|
|
114
114
|
|
|
115
|
+
class YuNumberUtils {
|
|
116
|
+
static { this.DOT_GROUPED = /^\d{1,3}((\.\d{3})+,\d*|(\.\d{3}){2,})$/; }
|
|
117
|
+
static { this.COMMA_GROUPED = /^\d{1,3}((,\d{3})+\.\d*|(,\d{3}){2,})$/; }
|
|
118
|
+
/**
|
|
119
|
+
* Parses a number typed with a comma or a dot as decimal separator.
|
|
120
|
+
* Returns null when the value is empty, incomplete ("-", ",") or not a number.
|
|
121
|
+
*/
|
|
122
|
+
static parse(value) {
|
|
123
|
+
if (typeof value === 'number') {
|
|
124
|
+
return Number.isFinite(value) ? value : null;
|
|
125
|
+
}
|
|
126
|
+
if (value === null || value === undefined) {
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
const text = value.trim();
|
|
130
|
+
const normalized = text.lastIndexOf(',') > text.lastIndexOf('.')
|
|
131
|
+
? text.replace(/\./g, '').replace(',', '.')
|
|
132
|
+
: text.replace(/,/g, '');
|
|
133
|
+
if (!/^-?(\d+\.?\d*|\.\d+)$/.test(normalized)) {
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
const parsed = Number.parseFloat(normalized);
|
|
137
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Formats a number for display with the given decimal separator,
|
|
141
|
+
* rounded to at most `decimals` fraction digits and without trailing zeros.
|
|
142
|
+
*/
|
|
143
|
+
static format(value, separator = ',', decimals = 2) {
|
|
144
|
+
if (value === null || value === undefined || !Number.isFinite(value)) {
|
|
145
|
+
return '';
|
|
146
|
+
}
|
|
147
|
+
const fixed = value.toFixed(Math.max(0, decimals));
|
|
148
|
+
const trimmed = fixed.includes('.') ? fixed.replace(/\.?0+$/, '') : fixed;
|
|
149
|
+
return (trimmed === '-0' ? '0' : trimmed).replace('.', separator);
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Keeps only what a decimal field accepts while typing: digits, a single separator
|
|
153
|
+
* at most `decimals` fraction digits and a leading minus when negatives are allowed.
|
|
154
|
+
* With `decimals` 0 the separator is kept and everything typed after it is ignored ("12,5" → "12,").
|
|
155
|
+
* Pasted values with thousands separators keep their full value ("1.234,56" → "1234,56").
|
|
156
|
+
*/
|
|
157
|
+
static sanitize(value, options) {
|
|
158
|
+
if (!value) {
|
|
159
|
+
return '';
|
|
160
|
+
}
|
|
161
|
+
const negative = options.allowNegative && value.trimStart().startsWith('-');
|
|
162
|
+
const text = YuNumberUtils.stripThousands(value, options.decimals);
|
|
163
|
+
let integerPart = '';
|
|
164
|
+
let fractionPart = '';
|
|
165
|
+
let separator = '';
|
|
166
|
+
for (const char of text) {
|
|
167
|
+
if (/\d/.test(char)) {
|
|
168
|
+
if (separator) {
|
|
169
|
+
fractionPart += char;
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
integerPart += char;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
else if ((char === ',' || char === '.') && !separator) {
|
|
176
|
+
separator = char;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return (negative ? '-' : '') + integerPart + separator + fractionPart.slice(0, Math.max(0, options.decimals));
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Removes thousands separators when the text is clearly grouped in thousands:
|
|
183
|
+
* "1.234,56", "1,234.56", "1.234.567" or "1,234,567". A single group without a decimal part
|
|
184
|
+
* ("1.500", "12,345") is ambiguous and is left as a decimal number, except in integer fields.
|
|
185
|
+
*/
|
|
186
|
+
static stripThousands(text, decimals) {
|
|
187
|
+
const digits = text.replace(/[^\d.,]/g, '');
|
|
188
|
+
if (decimals === 0 && /^\d{1,3}([.,]\d{3})+$/.test(digits)) {
|
|
189
|
+
return text.replace(/[.,]/g, '');
|
|
190
|
+
}
|
|
191
|
+
if (YuNumberUtils.DOT_GROUPED.test(digits)) {
|
|
192
|
+
return text.replace(/\./g, '');
|
|
193
|
+
}
|
|
194
|
+
if (YuNumberUtils.COMMA_GROUPED.test(digits)) {
|
|
195
|
+
return text.replace(/,/g, '');
|
|
196
|
+
}
|
|
197
|
+
return text;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
const YU_DECIMAL_SEPARATOR = new InjectionToken('YU_DECIMAL_SEPARATOR', {
|
|
202
|
+
providedIn: 'root',
|
|
203
|
+
factory: () => ',',
|
|
204
|
+
});
|
|
205
|
+
|
|
115
206
|
class InputComponent {
|
|
116
207
|
constructor() {
|
|
208
|
+
this.appearance = 'outline';
|
|
117
209
|
this.disabled = false;
|
|
210
|
+
this.readonly = false;
|
|
118
211
|
this.type = 'text';
|
|
119
212
|
this.inputmode = undefined;
|
|
120
213
|
this.autocapitalize = 'off';
|
|
121
214
|
this.minlength = null;
|
|
122
215
|
this.maxlength = null;
|
|
216
|
+
this.decimals = 2;
|
|
217
|
+
this.allowNegative = false;
|
|
123
218
|
this.isIncorrectValue = false;
|
|
124
219
|
this.passwordToggle = false;
|
|
125
220
|
this.valueChange = new EventEmitter();
|
|
126
221
|
this.yuBlur = new EventEmitter();
|
|
127
222
|
this.yuFocus = new EventEmitter();
|
|
223
|
+
this.decimalText = '';
|
|
224
|
+
this.decimalEdited = false;
|
|
225
|
+
this.minValue = null;
|
|
226
|
+
this.maxValue = null;
|
|
227
|
+
this.decimalSeparator = inject(YU_DECIMAL_SEPARATOR);
|
|
228
|
+
}
|
|
229
|
+
get isInline() {
|
|
230
|
+
return this.appearance === 'inline';
|
|
231
|
+
}
|
|
232
|
+
get isDecimal() {
|
|
233
|
+
return this.type === 'decimal';
|
|
234
|
+
}
|
|
235
|
+
get nativeType() {
|
|
236
|
+
return this.type === 'decimal' ? 'text' : this.type;
|
|
237
|
+
}
|
|
238
|
+
get nativeInputmode() {
|
|
239
|
+
return this.inputmode ?? (this.isDecimal ? (this.decimals > 0 ? 'decimal' : 'numeric') : undefined);
|
|
240
|
+
}
|
|
241
|
+
ngOnChanges(changes) {
|
|
242
|
+
if (changes['min'] || changes['max']) {
|
|
243
|
+
this.minValue = YuNumberUtils.parse(this.min);
|
|
244
|
+
this.maxValue = YuNumberUtils.parse(this.max);
|
|
245
|
+
}
|
|
246
|
+
if (!this.isDecimal) {
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
if (changes['value'] || changes['type']) {
|
|
250
|
+
this.syncDecimalText();
|
|
251
|
+
}
|
|
252
|
+
if ((changes['decimals'] && !changes['decimals'].firstChange) || (changes['allowNegative'] && !changes['allowNegative'].firstChange)) {
|
|
253
|
+
this.applyDecimalRules();
|
|
254
|
+
}
|
|
128
255
|
}
|
|
129
256
|
setFocus() {
|
|
130
257
|
this.input.setFocus();
|
|
131
258
|
}
|
|
259
|
+
onModelChange(text) {
|
|
260
|
+
if (!this.isDecimal) {
|
|
261
|
+
this.value = text;
|
|
262
|
+
this.valueChange.emit(this.value);
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
this.decimalEdited = true;
|
|
266
|
+
let sanitized = this.sanitizeDecimal(text);
|
|
267
|
+
let value = YuNumberUtils.parse(sanitized);
|
|
268
|
+
if (value !== null && this.isOutOfRangeForGood(value)) {
|
|
269
|
+
sanitized = YuNumberUtils.format(this.clamp(value), this.decimalSeparator, this.decimals);
|
|
270
|
+
value = YuNumberUtils.parse(sanitized);
|
|
271
|
+
}
|
|
272
|
+
this.decimalText = sanitized;
|
|
273
|
+
if (sanitized !== (text ?? '')) {
|
|
274
|
+
this.input.value = sanitized;
|
|
275
|
+
}
|
|
276
|
+
this.emitDecimal(value);
|
|
277
|
+
}
|
|
278
|
+
onBlur() {
|
|
279
|
+
if (this.isDecimal && this.decimalEdited) {
|
|
280
|
+
this.completeDecimalText();
|
|
281
|
+
}
|
|
282
|
+
this.yuBlur.emit();
|
|
283
|
+
}
|
|
284
|
+
/** Rewrites the text only when it no longer represents the value received, so typing is never overwritten. */
|
|
285
|
+
syncDecimalText() {
|
|
286
|
+
const value = YuNumberUtils.parse(this.value);
|
|
287
|
+
if (value === YuNumberUtils.parse(this.decimalText)) {
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
this.decimalText = YuNumberUtils.format(value, this.decimalSeparator, this.decimals);
|
|
291
|
+
this.decimalEdited = false;
|
|
292
|
+
}
|
|
293
|
+
/** Re-applies decimals/allowNegative to the current text when they change at runtime. */
|
|
294
|
+
applyDecimalRules() {
|
|
295
|
+
this.decimalText = this.sanitizeDecimal(this.decimalText);
|
|
296
|
+
const value = YuNumberUtils.parse(this.decimalText);
|
|
297
|
+
if (value !== YuNumberUtils.parse(this.value)) {
|
|
298
|
+
queueMicrotask(() => this.emitDecimal(value));
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
/** Completes the typed text on blur ("12," → "12", "-" → "", "12.5" → "12,5") and applies min/max. */
|
|
302
|
+
completeDecimalText() {
|
|
303
|
+
const parsed = YuNumberUtils.parse(this.decimalText);
|
|
304
|
+
const value = parsed === null ? null : this.clamp(parsed);
|
|
305
|
+
this.decimalEdited = false;
|
|
306
|
+
this.decimalText = YuNumberUtils.format(value, this.decimalSeparator, this.decimals);
|
|
307
|
+
this.emitDecimal(value);
|
|
308
|
+
}
|
|
309
|
+
sanitizeDecimal(text) {
|
|
310
|
+
return YuNumberUtils.sanitize(text, { decimals: this.decimals, allowNegative: this.allowNegative });
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* A value beyond a bound that typing more digits can only move further away from
|
|
314
|
+
* (above a non-negative max or below a non-positive min) is corrected while typing.
|
|
315
|
+
* Other bounds are applied on blur, since "5" may still become "50" with min 10.
|
|
316
|
+
*/
|
|
317
|
+
isOutOfRangeForGood(value) {
|
|
318
|
+
const { minValue: min, maxValue: max } = this;
|
|
319
|
+
return (max !== null && max >= 0 && value > max) || (min !== null && min <= 0 && value < min);
|
|
320
|
+
}
|
|
321
|
+
clamp(value) {
|
|
322
|
+
if (this.minValue !== null && value < this.minValue) {
|
|
323
|
+
return this.minValue;
|
|
324
|
+
}
|
|
325
|
+
if (this.maxValue !== null && value > this.maxValue) {
|
|
326
|
+
return this.maxValue;
|
|
327
|
+
}
|
|
328
|
+
return value;
|
|
329
|
+
}
|
|
330
|
+
/** Emits only when the number changes: typing "12," or "12,0" after "12" emits nothing. */
|
|
331
|
+
emitDecimal(value) {
|
|
332
|
+
if (value === YuNumberUtils.parse(this.value)) {
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
this.value = value;
|
|
336
|
+
this.valueChange.emit(value);
|
|
337
|
+
}
|
|
132
338
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: InputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
133
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: InputComponent, isStandalone: false, selector: "yu-input", inputs: { label: "label", placeholder: "placeholder", disabled: "disabled", type: "type", inputmode: "inputmode", autocapitalize: "autocapitalize", min: "min", max: "max", minlength: "minlength", maxlength: "maxlength", helperText: "helperText", isIncorrectValue: "isIncorrectValue", passwordToggle: "passwordToggle", value: "value" }, outputs: { valueChange: "valueChange", yuBlur: "yuBlur", yuFocus: "yuFocus" }, viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "<ion-input\n #input\n mode=\"md\"\n fill=\"outline\"\n labelPlacement=\"stacked\"\n [ngClass]=\"{ 'has-error': isIncorrectValue }\"\n [label]=\"label\"\n [placeholder]=\"placeholder\"\n [autocapitalize]=\"autocapitalize\"\n [inputmode]=\"
|
|
339
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: InputComponent, isStandalone: false, selector: "yu-input", inputs: { label: "label", placeholder: "placeholder", appearance: "appearance", disabled: "disabled", readonly: "readonly", type: "type", inputmode: "inputmode", autocapitalize: "autocapitalize", min: "min", max: "max", minlength: "minlength", maxlength: "maxlength", decimals: "decimals", allowNegative: "allowNegative", helperText: "helperText", isIncorrectValue: "isIncorrectValue", passwordToggle: "passwordToggle", value: "value" }, outputs: { valueChange: "valueChange", yuBlur: "yuBlur", yuFocus: "yuFocus" }, host: { properties: { "class.yu-input-inline": "this.isInline" } }, viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ion-input\n #input\n [attr.mode]=\"isInline ? null : 'md'\"\n [fill]=\"isInline ? undefined : 'outline'\"\n [labelPlacement]=\"isInline ? undefined : 'stacked'\"\n [ngClass]=\"{ 'has-error': isIncorrectValue }\"\n [label]=\"label\"\n [placeholder]=\"placeholder\"\n [autocapitalize]=\"autocapitalize\"\n [inputmode]=\"nativeInputmode\"\n [type]=\"nativeType\"\n [min]=\"min\"\n [max]=\"max\"\n [minlength]=\"minlength\"\n [maxlength]=\"maxlength\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [ngModel]=\"isDecimal ? decimalText : value\"\n (ngModelChange)=\"onModelChange($event)\"\n (ionFocus)=\"yuFocus.emit()\"\n (ionBlur)=\"onBlur()\"\n>\n <ng-content></ng-content>\n\n @if (passwordToggle) {\n <ion-input-password-toggle\n slot=\"end\"\n color=\"dark\"\n showIcon=\"eye-outline\"\n hideIcon=\"eye-off-outline\"\n ></ion-input-password-toggle>\n }\n</ion-input>\n\n@if (isIncorrectValue) {\n <yu-helper color=\"error\" icon=\"warning-circle\">{{ helperText }}</yu-helper>\n}\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }, { kind: "directive", type: i2$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2.IonInput, selector: "ion-input", inputs: ["autocapitalize", "autocomplete", "autocorrect", "autofocus", "clearInput", "clearInputIcon", "clearOnEdit", "color", "counter", "counterFormatter", "debounce", "disabled", "enterkeyhint", "errorText", "fill", "helperText", "inputmode", "label", "labelPlacement", "max", "maxlength", "min", "minlength", "mode", "multiple", "name", "pattern", "placeholder", "readonly", "required", "shape", "spellcheck", "step", "type", "value"] }, { kind: "component", type: i2.IonInputPasswordToggle, selector: "ion-input-password-toggle", inputs: ["color", "hideIcon", "mode", "showIcon"] }, { kind: "directive", type: i2.TextValueAccessor, selector: "ion-input:not([type=number]),ion-input-otp[type=text],ion-textarea,ion-searchbar" }, { kind: "component", type: HelperComponent, selector: "yu-helper", inputs: ["icon", "color"] }] }); }
|
|
134
340
|
}
|
|
135
341
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: InputComponent, decorators: [{
|
|
136
342
|
type: Component,
|
|
137
|
-
args: [{ selector: 'yu-input', standalone: false, template: "<ion-input\n #input\n mode=\"md\"\n fill=\"outline\"\n labelPlacement=\"stacked\"\n [ngClass]=\"{ 'has-error': isIncorrectValue }\"\n [label]=\"label\"\n [placeholder]=\"placeholder\"\n [autocapitalize]=\"autocapitalize\"\n [inputmode]=\"
|
|
343
|
+
args: [{ selector: 'yu-input', standalone: false, template: "<ion-input\n #input\n [attr.mode]=\"isInline ? null : 'md'\"\n [fill]=\"isInline ? undefined : 'outline'\"\n [labelPlacement]=\"isInline ? undefined : 'stacked'\"\n [ngClass]=\"{ 'has-error': isIncorrectValue }\"\n [label]=\"label\"\n [placeholder]=\"placeholder\"\n [autocapitalize]=\"autocapitalize\"\n [inputmode]=\"nativeInputmode\"\n [type]=\"nativeType\"\n [min]=\"min\"\n [max]=\"max\"\n [minlength]=\"minlength\"\n [maxlength]=\"maxlength\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [ngModel]=\"isDecimal ? decimalText : value\"\n (ngModelChange)=\"onModelChange($event)\"\n (ionFocus)=\"yuFocus.emit()\"\n (ionBlur)=\"onBlur()\"\n>\n <ng-content></ng-content>\n\n @if (passwordToggle) {\n <ion-input-password-toggle\n slot=\"end\"\n color=\"dark\"\n showIcon=\"eye-outline\"\n hideIcon=\"eye-off-outline\"\n ></ion-input-password-toggle>\n }\n</ion-input>\n\n@if (isIncorrectValue) {\n <yu-helper color=\"error\" icon=\"warning-circle\">{{ helperText }}</yu-helper>\n}\n" }]
|
|
138
344
|
}], propDecorators: { input: [{
|
|
139
345
|
type: ViewChild,
|
|
140
346
|
args: ['input']
|
|
@@ -142,8 +348,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
142
348
|
type: Input
|
|
143
349
|
}], placeholder: [{
|
|
144
350
|
type: Input
|
|
351
|
+
}], appearance: [{
|
|
352
|
+
type: Input
|
|
145
353
|
}], disabled: [{
|
|
146
354
|
type: Input
|
|
355
|
+
}], readonly: [{
|
|
356
|
+
type: Input
|
|
147
357
|
}], type: [{
|
|
148
358
|
type: Input
|
|
149
359
|
}], inputmode: [{
|
|
@@ -158,6 +368,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
158
368
|
type: Input
|
|
159
369
|
}], maxlength: [{
|
|
160
370
|
type: Input
|
|
371
|
+
}], decimals: [{
|
|
372
|
+
type: Input
|
|
373
|
+
}], allowNegative: [{
|
|
374
|
+
type: Input
|
|
161
375
|
}], helperText: [{
|
|
162
376
|
type: Input
|
|
163
377
|
}], isIncorrectValue: [{
|
|
@@ -172,6 +386,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
172
386
|
type: Output
|
|
173
387
|
}], yuFocus: [{
|
|
174
388
|
type: Output
|
|
389
|
+
}], isInline: [{
|
|
390
|
+
type: HostBinding,
|
|
391
|
+
args: ['class.yu-input-inline']
|
|
175
392
|
}] } });
|
|
176
393
|
|
|
177
394
|
class ButtonComponent {
|
|
@@ -422,11 +639,11 @@ class NoticeComponent {
|
|
|
422
639
|
this.color = 'primary';
|
|
423
640
|
}
|
|
424
641
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: NoticeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
425
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.22", type: NoticeComponent, isStandalone: false, selector: "yu-notice", inputs: { title: "title", message: "message", icon: "icon", color: "color" }, ngImport: i0, template: "<div class=\"yu-notice yu-color-{{ color }}\">\n <yu-icon [name]=\"icon\" [color]=\"color\"></yu-icon>\n\n <div class=\"notice-content\">\n <div class=\"title\">{{ title }}</div>\n <div class=\"message\">{{ message }}</div>\n <ng-content select=\"yuAction\"></ng-content>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: IconComponent, selector: "yu-icon", inputs: ["name", "color", "weight"] }] }); }
|
|
642
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.22", type: NoticeComponent, isStandalone: false, selector: "yu-notice", inputs: { title: "title", message: "message", icon: "icon", color: "color" }, ngImport: i0, template: "<div class=\"yu-notice yu-color-{{ color }}\">\n <yu-icon [name]=\"icon\" [color]=\"color\"></yu-icon>\n\n <div class=\"notice-content\">\n <div class=\"title\">{{ title }}</div>\n <div class=\"message\">{{ message }}</div>\n <ng-content select=\"[yuAction]\"></ng-content>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: IconComponent, selector: "yu-icon", inputs: ["name", "color", "weight"] }] }); }
|
|
426
643
|
}
|
|
427
644
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: NoticeComponent, decorators: [{
|
|
428
645
|
type: Component,
|
|
429
|
-
args: [{ selector: 'yu-notice', standalone: false, template: "<div class=\"yu-notice yu-color-{{ color }}\">\n <yu-icon [name]=\"icon\" [color]=\"color\"></yu-icon>\n\n <div class=\"notice-content\">\n <div class=\"title\">{{ title }}</div>\n <div class=\"message\">{{ message }}</div>\n <ng-content select=\"yuAction\"></ng-content>\n </div>\n</div>\n" }]
|
|
646
|
+
args: [{ selector: 'yu-notice', standalone: false, template: "<div class=\"yu-notice yu-color-{{ color }}\">\n <yu-icon [name]=\"icon\" [color]=\"color\"></yu-icon>\n\n <div class=\"notice-content\">\n <div class=\"title\">{{ title }}</div>\n <div class=\"message\">{{ message }}</div>\n <ng-content select=\"[yuAction]\"></ng-content>\n </div>\n</div>\n" }]
|
|
430
647
|
}], propDecorators: { title: [{
|
|
431
648
|
type: Input
|
|
432
649
|
}], message: [{
|
|
@@ -501,5 +718,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
501
718
|
* Generated bundle index. Do not edit.
|
|
502
719
|
*/
|
|
503
720
|
|
|
504
|
-
export { AvatarComponent, BadgeComponent, ButtonComponent, CheckboxComponent, ChipComponent, HelperComponent, IconComponent, InputComponent, ListActionComponent, NoticeComponent, SearchbarComponent, TagComponent, TextareaComponent, ToggleComponent, YukitModule };
|
|
721
|
+
export { AvatarComponent, BadgeComponent, ButtonComponent, CheckboxComponent, ChipComponent, HelperComponent, IconComponent, InputComponent, ListActionComponent, NoticeComponent, SearchbarComponent, TagComponent, TextareaComponent, ToggleComponent, YU_DECIMAL_SEPARATOR, YuNumberUtils, YukitModule };
|
|
505
722
|
//# sourceMappingURL=yukit.mjs.map
|