@yoobic/yobi 8.6.42 → 8.6.43
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/dist/cjs/design-system.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/yoo-form-input.cjs.entry.js +3 -2
- package/dist/cjs/yoo-form-number-picker.cjs.entry.js +1 -4
- package/dist/collection/components/form/form-input/form-input.js +19 -2
- package/dist/collection/components/form/form-number-picker/form-number-picker.js +2 -6
- package/dist/design-system/design-system.esm.js +1 -1
- package/dist/design-system/yoo-form-input.entry.js +3 -2
- package/dist/design-system/yoo-form-number-picker.entry.js +2 -5
- package/dist/esm/design-system.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/yoo-form-input.entry.js +3 -2
- package/dist/esm/yoo-form-number-picker.entry.js +2 -5
- package/dist/types/components/form/form-input/form-input.d.ts +3 -0
- package/dist/types/components.d.ts +2 -0
- package/package.json +1 -1
@@ -106,6 +106,7 @@ const YooFormInputComponent = class {
|
|
106
106
|
this.fireInputChangeEvent = true;
|
107
107
|
this.allowDecimals = true;
|
108
108
|
this.format = 'input';
|
109
|
+
this.contentEventListeners = {};
|
109
110
|
this.inputType = undefined;
|
110
111
|
this.remainingCharacters = undefined;
|
111
112
|
this.checkboxParams = null;
|
@@ -469,12 +470,12 @@ const YooFormInputComponent = class {
|
|
469
470
|
placeholderlabel: this.placeholdertolabel,
|
470
471
|
valid: this.uiValidation.valid && this.validity,
|
471
472
|
invalid: this.uiValidation.invalid && this.validity === false && !this.inputReloaded
|
472
|
-
} }, this.finalIconPrefix && this.hasIconPrefix && (index.h("div", { class: "icon-prefix", onClick: () => (this.inputElement && this.inputElement.focus ? this.inputElement.focus() : null) }, index.h("yoo-icon", { name: this.finalIconPrefix, size: this.getIconSize(), color: this.iconPrefixColor }))), (_a = this.buttonsPrefix) === null || _a === void 0 ? void 0 :
|
473
|
+
} }, this.finalIconPrefix && this.hasIconPrefix && (index.h("div", { class: "icon-prefix", onClick: () => (this.inputElement && this.inputElement.focus ? this.inputElement.focus() : null), ...this.contentEventListeners }, index.h("yoo-icon", { name: this.finalIconPrefix, size: this.getIconSize(), color: this.iconPrefixColor }))), (_a = this.buttonsPrefix) === null || _a === void 0 ? void 0 :
|
473
474
|
_a.map((button) => (button && index.h("div", { class: "icon-prefix", onClick: () => button.handler() }, index.h("yoo-icon", { name: button.icon, size: this.getIconSize() })))), index.h("input", { type: this.inputType, readOnly: this.disableInputTyping, name: this.name, tabindex: this.inputTabIndex, ref: (el) => (this.inputElement = el), autocapitalize: this.autocapitalize, autocorrect: this.autocorrect, autoComplete: ['username', 'password'].includes(this.name) ? this.name : undefined, inputmode: this.inputmode ? this.inputmode : undefined, placeholder: !this.placeholdertolabel && this.internalPlaceholder ? index$1.translate(this.internalPlaceholder) : '', required: this.required, onBlur: (ev) => formInputHelpers.onInputBlurred(ev, this, '.input-container', this.type, this.uiValidation), onChange: (ev) => ev === null || ev === void 0 ? void 0 : ev.stopPropagation(), onInput: (ev) => (this.fireInputChangeEvent ? this.onInputChanged(ev) : ev === null || ev === void 0 ? void 0 : ev.stopPropagation()), onFocus: () => !this.disableFocus && formInputHelpers.onInputFocused(this, '.input-container'), onKeyDown: (ev) => this.onKeyPress(ev), onWheel: this.onWheel, min: this.min, max: this.max, pattern: this.getPattern(), step: this.step, class: {
|
474
475
|
last: !((hasValue && this.clearable) || (this.type === 'password' && this.showPasswordToggle) || (this.uiValidation.invalid && this.validity === false)),
|
475
476
|
'hide-value': (_b = this.checkboxParams) === null || _b === void 0 ? void 0 : _b.value,
|
476
477
|
'has-icon-prefix': this.finalIconPrefix && this.hasIconPrefix
|
477
|
-
}, disabled: this.disabled, value: this.localValue }), this.maxCharacters && this.renderMaxCharacterCounter(), this.host.classList.contains('warning') && index.h("div", { class: "warning-icon" }), (hasValue && !lodash.isNil(this.validity) && this.uiValidation && this.uiValidation.valid && this.validity) ||
|
478
|
+
}, disabled: this.disabled, value: this.localValue, ...this.contentEventListeners }), this.maxCharacters && this.renderMaxCharacterCounter(), this.host.classList.contains('warning') && index.h("div", { class: "warning-icon" }), (hasValue && !lodash.isNil(this.validity) && this.uiValidation && this.uiValidation.valid && this.validity) ||
|
478
479
|
(this.uiValidation.invalid && this.validity === false && !this.inputReloaded && (index.h("div", { class: 'valid-icon ' + (this.validity ? 'valid' : 'invalid' + (this.clearable && hasValue && this.type === 'password' && this.showPasswordToggle ? '' : ' last')) }, index.h("yoo-icon", { color: this.validity ? 'app-color' : 'danger', name: this.validity ? 'check' : 'rejected', size: this.getIconSize() })))), this.type === 'password' && this.showPasswordToggle && (index.h("div", { class: 'icon-suffix-focus' + (this.clearable && hasValue ? '' : ' last'), onClick: this.onShowPassword.bind(this) }, hasValue && index.h("yoo-icon", { size: this.getIconSize(), name: "eye", color: this.inputType === 'password' ? 'stable-alt' : 'light' }))), this.clearable && !((_c = this.checkboxParams) === null || _c === void 0 ? void 0 : _c.value) && (index.h("div", { class: { 'icon-suffix-focus last icon-close': true }, style: { display: hasValue ? undefined : 'none' }, onClick: () => (hasValue ? this.clearInput() : null) }, index.h("yoo-icon", { size: this.getIconSize(), name: "cross" }))), this.iconSuffix && (index.h("div", { class: "icon-suffix-focus", onClick: () => (this.inputElement && this.inputElement.focus ? this.inputElement.focus() : null) }, index.h("yoo-icon", { name: this.iconSuffix, size: this.getIconSize() }))), (_d = this.inlineActions) === null || _d === void 0 ? void 0 :
|
479
480
|
_d.map((action) => {
|
480
481
|
const { handler, iconColor, icon, tooltip } = action || {};
|
@@ -158,9 +158,6 @@ const YooFormNumberPickerComponent = class {
|
|
158
158
|
ev.stopPropagation();
|
159
159
|
ev.preventDefault();
|
160
160
|
this.updateValidity();
|
161
|
-
if (index$1.isNativeMobile()) {
|
162
|
-
index$1.Keyboard.hide();
|
163
|
-
}
|
164
161
|
this.showContainerDialog();
|
165
162
|
}
|
166
163
|
onInputBlurred() {
|
@@ -211,7 +208,7 @@ const YooFormNumberPickerComponent = class {
|
|
211
208
|
];
|
212
209
|
}
|
213
210
|
else {
|
214
|
-
return (index.h("div", { class: "outer-container" }, index.h("yoo-form-input", { step: this.stepAmount, size: this.size, disabled: this.disabled, type: "number", forceValueUpdate: true, value: this.selection ? this.selection : this.value, clearable: this.clearable && !this.disabled, required: this.required, readonly: this.readonly, validity: this.validity, onIconClicked: (ev) => this.onClearIconClicked(ev), onInputFocused: (ev) => this.onInputFocused(ev), onValidityChanged: (ev) => ev.stopPropagation() })));
|
211
|
+
return (index.h("div", { class: "outer-container" }, index.h("yoo-form-input", { step: this.stepAmount, size: this.size, disabled: this.disabled, type: "number", forceValueUpdate: true, value: this.selection ? this.selection : this.value, clearable: this.clearable && !this.disabled, required: this.required, readonly: this.readonly, validity: this.validity, onIconClicked: (ev) => this.onClearIconClicked(ev), disableFocus: !index$1.isWeb(this.host), onInputFocused: (ev) => this.onInputFocused(ev), contentEventListeners: index$1.isWeb(this.host) ? {} : { onTouchStart: (ev) => this.onInputFocused(ev) }, onValidityChanged: (ev) => ev.stopPropagation() })));
|
215
212
|
}
|
216
213
|
}
|
217
214
|
render() {
|
@@ -83,6 +83,7 @@ export class YooFormInputComponent {
|
|
83
83
|
this.fireInputChangeEvent = true;
|
84
84
|
this.allowDecimals = true;
|
85
85
|
this.format = 'input';
|
86
|
+
this.contentEventListeners = {};
|
86
87
|
this.inputType = undefined;
|
87
88
|
this.remainingCharacters = undefined;
|
88
89
|
this.checkboxParams = null;
|
@@ -446,12 +447,12 @@ export class YooFormInputComponent {
|
|
446
447
|
placeholderlabel: this.placeholdertolabel,
|
447
448
|
valid: this.uiValidation.valid && this.validity,
|
448
449
|
invalid: this.uiValidation.invalid && this.validity === false && !this.inputReloaded
|
449
|
-
} }, this.finalIconPrefix && this.hasIconPrefix && (h("div", { class: "icon-prefix", onClick: () => (this.inputElement && this.inputElement.focus ? this.inputElement.focus() : null) }, h("yoo-icon", { name: this.finalIconPrefix, size: this.getIconSize(), color: this.iconPrefixColor }))), (_a = this.buttonsPrefix) === null || _a === void 0 ? void 0 :
|
450
|
+
} }, this.finalIconPrefix && this.hasIconPrefix && (h("div", { class: "icon-prefix", onClick: () => (this.inputElement && this.inputElement.focus ? this.inputElement.focus() : null), ...this.contentEventListeners }, h("yoo-icon", { name: this.finalIconPrefix, size: this.getIconSize(), color: this.iconPrefixColor }))), (_a = this.buttonsPrefix) === null || _a === void 0 ? void 0 :
|
450
451
|
_a.map((button) => (button && h("div", { class: "icon-prefix", onClick: () => button.handler() }, h("yoo-icon", { name: button.icon, size: this.getIconSize() })))), h("input", { type: this.inputType, readOnly: this.disableInputTyping, name: this.name, tabindex: this.inputTabIndex, ref: (el) => (this.inputElement = el), autocapitalize: this.autocapitalize, autocorrect: this.autocorrect, autoComplete: ['username', 'password'].includes(this.name) ? this.name : undefined, inputmode: this.inputmode ? this.inputmode : undefined, placeholder: !this.placeholdertolabel && this.internalPlaceholder ? translate(this.internalPlaceholder) : '', required: this.required, onBlur: (ev) => onInputBlurred(ev, this, '.input-container', this.type, this.uiValidation), onChange: (ev) => ev === null || ev === void 0 ? void 0 : ev.stopPropagation(), onInput: (ev) => (this.fireInputChangeEvent ? this.onInputChanged(ev) : ev === null || ev === void 0 ? void 0 : ev.stopPropagation()), onFocus: () => !this.disableFocus && onInputFocused(this, '.input-container'), onKeyDown: (ev) => this.onKeyPress(ev), onWheel: this.onWheel, min: this.min, max: this.max, pattern: this.getPattern(), step: this.step, class: {
|
451
452
|
last: !((hasValue && this.clearable) || (this.type === 'password' && this.showPasswordToggle) || (this.uiValidation.invalid && this.validity === false)),
|
452
453
|
'hide-value': (_b = this.checkboxParams) === null || _b === void 0 ? void 0 : _b.value,
|
453
454
|
'has-icon-prefix': this.finalIconPrefix && this.hasIconPrefix
|
454
|
-
}, disabled: this.disabled, value: this.localValue }), this.maxCharacters && this.renderMaxCharacterCounter(), this.host.classList.contains('warning') && h("div", { class: "warning-icon" }), (hasValue && !isNil(this.validity) && this.uiValidation && this.uiValidation.valid && this.validity) ||
|
455
|
+
}, disabled: this.disabled, value: this.localValue, ...this.contentEventListeners }), this.maxCharacters && this.renderMaxCharacterCounter(), this.host.classList.contains('warning') && h("div", { class: "warning-icon" }), (hasValue && !isNil(this.validity) && this.uiValidation && this.uiValidation.valid && this.validity) ||
|
455
456
|
(this.uiValidation.invalid && this.validity === false && !this.inputReloaded && (h("div", { class: 'valid-icon ' + (this.validity ? 'valid' : 'invalid' + (this.clearable && hasValue && this.type === 'password' && this.showPasswordToggle ? '' : ' last')) }, h("yoo-icon", { color: this.validity ? 'app-color' : 'danger', name: this.validity ? 'check' : 'rejected', size: this.getIconSize() })))), this.type === 'password' && this.showPasswordToggle && (h("div", { class: 'icon-suffix-focus' + (this.clearable && hasValue ? '' : ' last'), onClick: this.onShowPassword.bind(this) }, hasValue && h("yoo-icon", { size: this.getIconSize(), name: "eye", color: this.inputType === 'password' ? 'stable-alt' : 'light' }))), this.clearable && !((_c = this.checkboxParams) === null || _c === void 0 ? void 0 : _c.value) && (h("div", { class: { 'icon-suffix-focus last icon-close': true }, style: { display: hasValue ? undefined : 'none' }, onClick: () => (hasValue ? this.clearInput() : null) }, h("yoo-icon", { size: this.getIconSize(), name: "cross" }))), this.iconSuffix && (h("div", { class: "icon-suffix-focus", onClick: () => (this.inputElement && this.inputElement.focus ? this.inputElement.focus() : null) }, h("yoo-icon", { name: this.iconSuffix, size: this.getIconSize() }))), (_d = this.inlineActions) === null || _d === void 0 ? void 0 :
|
456
457
|
_d.map((action) => {
|
457
458
|
const { handler, iconColor, icon, tooltip } = action || {};
|
@@ -1536,6 +1537,22 @@ export class YooFormInputComponent {
|
|
1536
1537
|
"attribute": "format",
|
1537
1538
|
"reflect": true,
|
1538
1539
|
"defaultValue": "'input'"
|
1540
|
+
},
|
1541
|
+
"contentEventListeners": {
|
1542
|
+
"type": "unknown",
|
1543
|
+
"mutable": false,
|
1544
|
+
"complexType": {
|
1545
|
+
"original": "{ [key: string]: (event: any) => void }",
|
1546
|
+
"resolved": "{ [key: string]: (event: any) => void; }",
|
1547
|
+
"references": {}
|
1548
|
+
},
|
1549
|
+
"required": false,
|
1550
|
+
"optional": false,
|
1551
|
+
"docs": {
|
1552
|
+
"tags": [],
|
1553
|
+
"text": ""
|
1554
|
+
},
|
1555
|
+
"defaultValue": "{}"
|
1539
1556
|
}
|
1540
1557
|
};
|
1541
1558
|
}
|
@@ -1,5 +1,4 @@
|
|
1
|
-
import {
|
2
|
-
import { getCssColor, isNativeMobile, isWeb, showModal, translate } from '@shared/utils';
|
1
|
+
import { getCssColor, isWeb, showModal, translate } from '@shared/utils';
|
3
2
|
import { h } from '@stencil/core';
|
4
3
|
import { isFinite, range } from 'lodash-es';
|
5
4
|
export class YooFormNumberPickerComponent {
|
@@ -147,9 +146,6 @@ export class YooFormNumberPickerComponent {
|
|
147
146
|
ev.stopPropagation();
|
148
147
|
ev.preventDefault();
|
149
148
|
this.updateValidity();
|
150
|
-
if (isNativeMobile()) {
|
151
|
-
Keyboard.hide();
|
152
|
-
}
|
153
149
|
this.showContainerDialog();
|
154
150
|
}
|
155
151
|
onInputBlurred() {
|
@@ -200,7 +196,7 @@ export class YooFormNumberPickerComponent {
|
|
200
196
|
];
|
201
197
|
}
|
202
198
|
else {
|
203
|
-
return (h("div", { class: "outer-container" }, h("yoo-form-input", { step: this.stepAmount, size: this.size, disabled: this.disabled, type: "number", forceValueUpdate: true, value: this.selection ? this.selection : this.value, clearable: this.clearable && !this.disabled, required: this.required, readonly: this.readonly, validity: this.validity, onIconClicked: (ev) => this.onClearIconClicked(ev), onInputFocused: (ev) => this.onInputFocused(ev), onValidityChanged: (ev) => ev.stopPropagation() })));
|
199
|
+
return (h("div", { class: "outer-container" }, h("yoo-form-input", { step: this.stepAmount, size: this.size, disabled: this.disabled, type: "number", forceValueUpdate: true, value: this.selection ? this.selection : this.value, clearable: this.clearable && !this.disabled, required: this.required, readonly: this.readonly, validity: this.validity, onIconClicked: (ev) => this.onClearIconClicked(ev), disableFocus: !isWeb(this.host), onInputFocused: (ev) => this.onInputFocused(ev), contentEventListeners: isWeb(this.host) ? {} : { onTouchStart: (ev) => this.onInputFocused(ev) }, onValidityChanged: (ev) => ev.stopPropagation() })));
|
204
200
|
}
|
205
201
|
}
|
206
202
|
render() {
|