@progress/kendo-vue-inputs 6.1.0-develop.1 → 6.1.0-develop.2
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/cdn/js/kendo-vue-inputs.js +1 -1
- package/index.d.mts +110 -80
- package/index.d.ts +110 -80
- package/maskedtextbox/MaskedTextBox.js +1 -1
- package/maskedtextbox/MaskedTextBox.mjs +43 -40
- package/numerictextbox/NumericTextBox.js +1 -1
- package/numerictextbox/NumericTextBox.mjs +69 -67
- package/package-metadata.mjs +1 -1
- package/package.json +8 -8
- package/textarea/TextArea.js +1 -1
- package/textarea/TextArea.mjs +31 -28
- package/textbox/TextBox.js +1 -1
- package/textbox/TextBox.mjs +24 -21
package/index.d.ts
CHANGED
|
@@ -1895,78 +1895,83 @@ export declare const InputSeparator: DefineComponent< {}, {}, {}, {}, {}, Com
|
|
|
1895
1895
|
*/
|
|
1896
1896
|
export declare const MaskedTextBox: DefineComponent<ExtractPropTypes< {
|
|
1897
1897
|
type: {
|
|
1898
|
-
type:
|
|
1898
|
+
type: PropType<string>;
|
|
1899
1899
|
default: string;
|
|
1900
1900
|
};
|
|
1901
|
-
modelValue:
|
|
1902
|
-
modelRawValue:
|
|
1903
|
-
value:
|
|
1904
|
-
defaultValue:
|
|
1905
|
-
placeholder:
|
|
1906
|
-
title:
|
|
1907
|
-
dir:
|
|
1908
|
-
id:
|
|
1909
|
-
ariaLabelledBy:
|
|
1910
|
-
ariaDescribedBy:
|
|
1911
|
-
tabIndex:
|
|
1912
|
-
accessKey:
|
|
1913
|
-
disabled:
|
|
1914
|
-
readonly:
|
|
1901
|
+
modelValue: PropType<string>;
|
|
1902
|
+
modelRawValue: PropType<string>;
|
|
1903
|
+
value: PropType<string>;
|
|
1904
|
+
defaultValue: PropType<string>;
|
|
1905
|
+
placeholder: PropType<string>;
|
|
1906
|
+
title: PropType<string>;
|
|
1907
|
+
dir: PropType<string>;
|
|
1908
|
+
id: PropType<string>;
|
|
1909
|
+
ariaLabelledBy: PropType<string>;
|
|
1910
|
+
ariaDescribedBy: PropType<string>;
|
|
1911
|
+
tabIndex: PropType<number>;
|
|
1912
|
+
accessKey: PropType<string>;
|
|
1913
|
+
disabled: PropType<boolean>;
|
|
1914
|
+
readonly: PropType<boolean>;
|
|
1915
1915
|
size: {
|
|
1916
|
-
type:
|
|
1916
|
+
type: PropType<string>;
|
|
1917
1917
|
default: string;
|
|
1918
1918
|
validator: (value: any) => any;
|
|
1919
1919
|
};
|
|
1920
1920
|
rounded: {
|
|
1921
|
-
type:
|
|
1921
|
+
type: PropType<string>;
|
|
1922
1922
|
default: string;
|
|
1923
1923
|
validator: (value: any) => any;
|
|
1924
1924
|
};
|
|
1925
1925
|
fillMode: {
|
|
1926
|
-
type:
|
|
1926
|
+
type: PropType<string>;
|
|
1927
1927
|
default: string;
|
|
1928
1928
|
validator: (value: any) => any;
|
|
1929
1929
|
};
|
|
1930
1930
|
prompt: {
|
|
1931
|
-
type:
|
|
1931
|
+
type: PropType<string>;
|
|
1932
1932
|
default: string;
|
|
1933
1933
|
};
|
|
1934
1934
|
promptPlaceholder: {
|
|
1935
|
-
type:
|
|
1935
|
+
type: PropType<string>;
|
|
1936
1936
|
default: string;
|
|
1937
1937
|
};
|
|
1938
1938
|
includeLiterals: {
|
|
1939
|
-
type:
|
|
1939
|
+
type: PropType<boolean>;
|
|
1940
1940
|
default: boolean;
|
|
1941
1941
|
};
|
|
1942
1942
|
maskValidation: {
|
|
1943
|
-
type:
|
|
1943
|
+
type: PropType<boolean>;
|
|
1944
1944
|
default: boolean;
|
|
1945
1945
|
};
|
|
1946
|
-
mask:
|
|
1946
|
+
mask: PropType<string>;
|
|
1947
1947
|
rules: {
|
|
1948
|
-
type:
|
|
1948
|
+
type: PropType<{
|
|
1949
|
+
[key: string]: RegExp;
|
|
1950
|
+
}>;
|
|
1949
1951
|
default: () => {
|
|
1950
1952
|
[key: string]: RegExp;
|
|
1951
1953
|
};
|
|
1952
1954
|
};
|
|
1953
|
-
selection:
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1955
|
+
selection: PropType<{
|
|
1956
|
+
start: number;
|
|
1957
|
+
end: number;
|
|
1958
|
+
}>;
|
|
1959
|
+
name: PropType<string>;
|
|
1960
|
+
label: PropType<string>;
|
|
1961
|
+
validationMessage: PropType<string>;
|
|
1957
1962
|
required: {
|
|
1958
|
-
type:
|
|
1963
|
+
type: PropType<boolean>;
|
|
1959
1964
|
default: boolean;
|
|
1960
1965
|
};
|
|
1961
1966
|
valid: {
|
|
1962
|
-
type:
|
|
1967
|
+
type: PropType<boolean>;
|
|
1963
1968
|
default: any;
|
|
1964
1969
|
};
|
|
1965
1970
|
validityStyles: {
|
|
1966
|
-
type:
|
|
1971
|
+
type: PropType<boolean>;
|
|
1967
1972
|
default: boolean;
|
|
1968
1973
|
};
|
|
1969
|
-
iconName:
|
|
1974
|
+
iconName: PropType<String>;
|
|
1970
1975
|
inputPrefix: {
|
|
1971
1976
|
type: (ObjectConstructor | BooleanConstructor | StringConstructor | FunctionConstructor)[];
|
|
1972
1977
|
default: () => any;
|
|
@@ -1975,11 +1980,12 @@ inputSuffix: {
|
|
|
1975
1980
|
type: (ObjectConstructor | BooleanConstructor | StringConstructor | FunctionConstructor)[];
|
|
1976
1981
|
default: () => any;
|
|
1977
1982
|
};
|
|
1978
|
-
showValidationIcon:
|
|
1979
|
-
showLoadingIcon:
|
|
1980
|
-
showClearButton:
|
|
1981
|
-
inputClass:
|
|
1982
|
-
wrapperClass:
|
|
1983
|
+
showValidationIcon: PropType<Boolean>;
|
|
1984
|
+
showLoadingIcon: PropType<Boolean>;
|
|
1985
|
+
showClearButton: PropType<Boolean>;
|
|
1986
|
+
inputClass: PropType<String>;
|
|
1987
|
+
wrapperClass: PropType<String>;
|
|
1988
|
+
inputAttributes: PropType<Object>;
|
|
1983
1989
|
}>, {
|
|
1984
1990
|
inputRef: Ref<any, any>;
|
|
1985
1991
|
}, {
|
|
@@ -2027,78 +2033,83 @@ updateService(extra?: any): void;
|
|
|
2027
2033
|
setValidity(): void;
|
|
2028
2034
|
}, ComponentOptionsMixin, ComponentOptionsMixin, ("blur" | "change" | "focus" | "changemodel" | "update:modelValue" | "update:modelRawValue")[], "blur" | "change" | "focus" | "changemodel" | "update:modelValue" | "update:modelRawValue", PublicProps, Readonly<ExtractPropTypes< {
|
|
2029
2035
|
type: {
|
|
2030
|
-
type:
|
|
2036
|
+
type: PropType<string>;
|
|
2031
2037
|
default: string;
|
|
2032
2038
|
};
|
|
2033
|
-
modelValue:
|
|
2034
|
-
modelRawValue:
|
|
2035
|
-
value:
|
|
2036
|
-
defaultValue:
|
|
2037
|
-
placeholder:
|
|
2038
|
-
title:
|
|
2039
|
-
dir:
|
|
2040
|
-
id:
|
|
2041
|
-
ariaLabelledBy:
|
|
2042
|
-
ariaDescribedBy:
|
|
2043
|
-
tabIndex:
|
|
2044
|
-
accessKey:
|
|
2045
|
-
disabled:
|
|
2046
|
-
readonly:
|
|
2039
|
+
modelValue: PropType<string>;
|
|
2040
|
+
modelRawValue: PropType<string>;
|
|
2041
|
+
value: PropType<string>;
|
|
2042
|
+
defaultValue: PropType<string>;
|
|
2043
|
+
placeholder: PropType<string>;
|
|
2044
|
+
title: PropType<string>;
|
|
2045
|
+
dir: PropType<string>;
|
|
2046
|
+
id: PropType<string>;
|
|
2047
|
+
ariaLabelledBy: PropType<string>;
|
|
2048
|
+
ariaDescribedBy: PropType<string>;
|
|
2049
|
+
tabIndex: PropType<number>;
|
|
2050
|
+
accessKey: PropType<string>;
|
|
2051
|
+
disabled: PropType<boolean>;
|
|
2052
|
+
readonly: PropType<boolean>;
|
|
2047
2053
|
size: {
|
|
2048
|
-
type:
|
|
2054
|
+
type: PropType<string>;
|
|
2049
2055
|
default: string;
|
|
2050
2056
|
validator: (value: any) => any;
|
|
2051
2057
|
};
|
|
2052
2058
|
rounded: {
|
|
2053
|
-
type:
|
|
2059
|
+
type: PropType<string>;
|
|
2054
2060
|
default: string;
|
|
2055
2061
|
validator: (value: any) => any;
|
|
2056
2062
|
};
|
|
2057
2063
|
fillMode: {
|
|
2058
|
-
type:
|
|
2064
|
+
type: PropType<string>;
|
|
2059
2065
|
default: string;
|
|
2060
2066
|
validator: (value: any) => any;
|
|
2061
2067
|
};
|
|
2062
2068
|
prompt: {
|
|
2063
|
-
type:
|
|
2069
|
+
type: PropType<string>;
|
|
2064
2070
|
default: string;
|
|
2065
2071
|
};
|
|
2066
2072
|
promptPlaceholder: {
|
|
2067
|
-
type:
|
|
2073
|
+
type: PropType<string>;
|
|
2068
2074
|
default: string;
|
|
2069
2075
|
};
|
|
2070
2076
|
includeLiterals: {
|
|
2071
|
-
type:
|
|
2077
|
+
type: PropType<boolean>;
|
|
2072
2078
|
default: boolean;
|
|
2073
2079
|
};
|
|
2074
2080
|
maskValidation: {
|
|
2075
|
-
type:
|
|
2081
|
+
type: PropType<boolean>;
|
|
2076
2082
|
default: boolean;
|
|
2077
2083
|
};
|
|
2078
|
-
mask:
|
|
2084
|
+
mask: PropType<string>;
|
|
2079
2085
|
rules: {
|
|
2080
|
-
type:
|
|
2086
|
+
type: PropType<{
|
|
2087
|
+
[key: string]: RegExp;
|
|
2088
|
+
}>;
|
|
2081
2089
|
default: () => {
|
|
2082
2090
|
[key: string]: RegExp;
|
|
2083
2091
|
};
|
|
2084
2092
|
};
|
|
2085
|
-
selection:
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2093
|
+
selection: PropType<{
|
|
2094
|
+
start: number;
|
|
2095
|
+
end: number;
|
|
2096
|
+
}>;
|
|
2097
|
+
name: PropType<string>;
|
|
2098
|
+
label: PropType<string>;
|
|
2099
|
+
validationMessage: PropType<string>;
|
|
2089
2100
|
required: {
|
|
2090
|
-
type:
|
|
2101
|
+
type: PropType<boolean>;
|
|
2091
2102
|
default: boolean;
|
|
2092
2103
|
};
|
|
2093
2104
|
valid: {
|
|
2094
|
-
type:
|
|
2105
|
+
type: PropType<boolean>;
|
|
2095
2106
|
default: any;
|
|
2096
2107
|
};
|
|
2097
2108
|
validityStyles: {
|
|
2098
|
-
type:
|
|
2109
|
+
type: PropType<boolean>;
|
|
2099
2110
|
default: boolean;
|
|
2100
2111
|
};
|
|
2101
|
-
iconName:
|
|
2112
|
+
iconName: PropType<String>;
|
|
2102
2113
|
inputPrefix: {
|
|
2103
2114
|
type: (ObjectConstructor | BooleanConstructor | StringConstructor | FunctionConstructor)[];
|
|
2104
2115
|
default: () => any;
|
|
@@ -2107,11 +2118,12 @@ inputSuffix: {
|
|
|
2107
2118
|
type: (ObjectConstructor | BooleanConstructor | StringConstructor | FunctionConstructor)[];
|
|
2108
2119
|
default: () => any;
|
|
2109
2120
|
};
|
|
2110
|
-
showValidationIcon:
|
|
2111
|
-
showLoadingIcon:
|
|
2112
|
-
showClearButton:
|
|
2113
|
-
inputClass:
|
|
2114
|
-
wrapperClass:
|
|
2121
|
+
showValidationIcon: PropType<Boolean>;
|
|
2122
|
+
showLoadingIcon: PropType<Boolean>;
|
|
2123
|
+
showClearButton: PropType<Boolean>;
|
|
2124
|
+
inputClass: PropType<String>;
|
|
2125
|
+
wrapperClass: PropType<String>;
|
|
2126
|
+
inputAttributes: PropType<Object>;
|
|
2115
2127
|
}>> & Readonly<{
|
|
2116
2128
|
onFocus?: (...args: any[]) => any;
|
|
2117
2129
|
onBlur?: (...args: any[]) => any;
|
|
@@ -2123,21 +2135,18 @@ onChangemodel?: (...args: any[]) => any;
|
|
|
2123
2135
|
type: string;
|
|
2124
2136
|
required: boolean;
|
|
2125
2137
|
size: string;
|
|
2126
|
-
disabled: boolean;
|
|
2127
2138
|
rounded: string;
|
|
2128
2139
|
fillMode: string;
|
|
2129
2140
|
valid: boolean;
|
|
2130
2141
|
validityStyles: boolean;
|
|
2131
2142
|
inputPrefix: string | boolean | Function | Record<string, any>;
|
|
2132
2143
|
inputSuffix: string | boolean | Function | Record<string, any>;
|
|
2133
|
-
showValidationIcon: boolean;
|
|
2134
|
-
showLoadingIcon: boolean;
|
|
2135
|
-
showClearButton: boolean;
|
|
2136
2144
|
prompt: string;
|
|
2137
2145
|
promptPlaceholder: string;
|
|
2138
|
-
rules:
|
|
2146
|
+
rules: {
|
|
2147
|
+
[key: string]: RegExp;
|
|
2148
|
+
};
|
|
2139
2149
|
includeLiterals: boolean;
|
|
2140
|
-
readonly: boolean;
|
|
2141
2150
|
maskValidation: boolean;
|
|
2142
2151
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
2143
2152
|
|
|
@@ -2361,6 +2370,11 @@ export declare interface MaskedTextBoxProps extends FormComponentProps {
|
|
|
2361
2370
|
* Defines additional class to the wrapper element.
|
|
2362
2371
|
*/
|
|
2363
2372
|
wrapperClass?: String;
|
|
2373
|
+
/**
|
|
2374
|
+
* Sets the built-in HTML attributes of the inner focusable input element.
|
|
2375
|
+
* Attributes which are essential for certain component functionalities cannot be changed.
|
|
2376
|
+
*/
|
|
2377
|
+
inputAttributes?: Object;
|
|
2364
2378
|
}
|
|
2365
2379
|
|
|
2366
2380
|
/**
|
|
@@ -2434,6 +2448,7 @@ type: PropType<string>;
|
|
|
2434
2448
|
default: string;
|
|
2435
2449
|
};
|
|
2436
2450
|
wrapperClass: PropType<string>;
|
|
2451
|
+
inputAttributes: PropType<Object>;
|
|
2437
2452
|
}>, {
|
|
2438
2453
|
inputRef: Ref<any, any>;
|
|
2439
2454
|
elementWrapperRef: Ref<any, any>;
|
|
@@ -2580,6 +2595,7 @@ type: PropType<string>;
|
|
|
2580
2595
|
default: string;
|
|
2581
2596
|
};
|
|
2582
2597
|
wrapperClass: PropType<string>;
|
|
2598
|
+
inputAttributes: PropType<Object>;
|
|
2583
2599
|
}>> & Readonly<{
|
|
2584
2600
|
onBlur?: (...args: any[] | unknown[]) => any;
|
|
2585
2601
|
onChange?: (...args: any[] | unknown[]) => any;
|
|
@@ -4612,6 +4628,7 @@ type: PropType<string>;
|
|
|
4612
4628
|
default: string;
|
|
4613
4629
|
validator: (value: any) => any;
|
|
4614
4630
|
};
|
|
4631
|
+
inputAttributes: PropType<Object>;
|
|
4615
4632
|
}>, {}, {
|
|
4616
4633
|
currentValue: string | number | string[];
|
|
4617
4634
|
textAreaHeight: string;
|
|
@@ -4733,6 +4750,7 @@ type: PropType<string>;
|
|
|
4733
4750
|
default: string;
|
|
4734
4751
|
validator: (value: any) => any;
|
|
4735
4752
|
};
|
|
4753
|
+
inputAttributes: PropType<Object>;
|
|
4736
4754
|
}>> & Readonly<{
|
|
4737
4755
|
onInput?: (...args: any[] | unknown[]) => any;
|
|
4738
4756
|
onBlur?: (...args: any[] | unknown[]) => any;
|
|
@@ -4948,6 +4966,11 @@ export declare interface TextAreaProps extends FormComponentProps {
|
|
|
4948
4966
|
* Defines additional class to the input element.
|
|
4949
4967
|
*/
|
|
4950
4968
|
inputClass?: string;
|
|
4969
|
+
/**
|
|
4970
|
+
* Sets the built-in HTML attributes of the inner focusable input element.
|
|
4971
|
+
* Attributes which are essential for certain component functionalities cannot be changed.
|
|
4972
|
+
*/
|
|
4973
|
+
inputAttributes?: Object;
|
|
4951
4974
|
/**
|
|
4952
4975
|
* The event handler that will be fired when the changes the selected value.
|
|
4953
4976
|
*/
|
|
@@ -5069,6 +5092,7 @@ tabIndex: PropType<number>;
|
|
|
5069
5092
|
role: PropType<string>;
|
|
5070
5093
|
title: PropType<string>;
|
|
5071
5094
|
ariaLabel: PropType<string>;
|
|
5095
|
+
inputAttributes: PropType<Object>;
|
|
5072
5096
|
}>, {
|
|
5073
5097
|
inputRef: Ref<any, any>;
|
|
5074
5098
|
}, {
|
|
@@ -5211,6 +5235,7 @@ tabIndex: PropType<number>;
|
|
|
5211
5235
|
role: PropType<string>;
|
|
5212
5236
|
title: PropType<string>;
|
|
5213
5237
|
ariaLabel: PropType<string>;
|
|
5238
|
+
inputAttributes: PropType<Object>;
|
|
5214
5239
|
}>> & Readonly<{
|
|
5215
5240
|
onInput?: (...args: any[] | unknown[]) => any;
|
|
5216
5241
|
onBlur?: (...args: any[] | unknown[]) => any;
|
|
@@ -5392,6 +5417,11 @@ export declare interface TextBoxProps extends FormComponentProps {
|
|
|
5392
5417
|
* Defines the built-in [aria-label](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute) property of the input element inside the TextBox.
|
|
5393
5418
|
*/
|
|
5394
5419
|
ariaLabel?: string;
|
|
5420
|
+
/**
|
|
5421
|
+
* Sets the built-in HTML attributes of the inner focusable input element.
|
|
5422
|
+
* Attributes which are essential for certain component functionalities cannot be changed.
|
|
5423
|
+
*/
|
|
5424
|
+
inputAttributes?: Object;
|
|
5395
5425
|
}
|
|
5396
5426
|
|
|
5397
5427
|
/**
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),v=require("./masking.service.js"),p=require("./utils.js"),s=require("@progress/kendo-vue-common"),$=require("../package-metadata.js"),c=require("@progress/kendo-svg-icons"),V=n.defineComponent({model:{event:"changemodel"},emits:["change","focus","blur","update:modelValue","update:modelRawValue","changemodel"],props:{type:{type:String,default:"text"},modelValue:String,modelRawValue:String,value:String,defaultValue:String,placeholder:String,title:String,dir:String,id:String,ariaLabelledBy:String,ariaDescribedBy:String,tabIndex:Number,accessKey:String,disabled:Boolean,readonly:Boolean,size:{type:String,default:"medium",validator:function(e){return[null,"small","medium","large"].includes(e)}},rounded:{type:String,default:"medium",validator:function(e){return[null,"small","medium","large","full"].includes(e)}},fillMode:{type:String,default:"solid",validator:function(e){return[null,"solid","flat","outline"].includes(e)}},prompt:{type:String,default:"_"},promptPlaceholder:{type:String,default:" "},includeLiterals:{type:Boolean,default:!1},maskValidation:{type:Boolean,default:!0},mask:String,rules:{type:Object,default:function(){return p.defaultRules}},selection:Object,name:String,label:String,validationMessage:String,required:{type:Boolean,default:!1},valid:{type:Boolean,default:void 0},validityStyles:{type:Boolean,default:!0},iconName:String,inputPrefix:s.templateDefinition,inputSuffix:s.templateDefinition,showValidationIcon:Boolean,showLoadingIcon:Boolean,showClearButton:Boolean,inputClass:String,wrapperClass:String,inputAttributes:Object},data(){return{currentValue:void 0,currentFocused:!1,inputValue:void 0,currentSelection:[null,null]}},created(){s.validatePackage($.packageMetadata),this.hasMounted=!1,this.valueDuringOnChange=void 0,this.inputId=`k-${s.guid()}`,this.service=new v.MaskingService,this.isPasted=!1},setup(){return{inputRef:n.ref(null)}},mounted(){this.hasMounted=!0,this.element=this.input=this.inputRef,this.updateService(),this.setValidity()},watch:{currentFocused:function(e,t){this.prevCurrentFocused=t},selection:function(e,t){this.prevSelection=t},includeLiterals:function(e,t){this.prevIncludeLiterals=t},mask:function(e,t){this.prevMask=t},prompt:function(e,t){this.prevPrompt=t},promptPlaceholder:function(e,t){this.prevPromptPlaceholder=t},rules:function(e,t){this.prevRules=t}},updated(){if(this.element&&this.currentFocused){let[t,i]=this.currentSelection;const a=this.prevSelection,l=this.$props.selection;(!a&&l||a&&l&&(a.start!==l.start||a.end!==l.end))&&(t=l.start,i=l.end),t!==null&&i!==null&&this.element.setSelectionRange(t,i)}const e={includeLiterals:this.prevIncludeLiterals,mask:this.prevMask,prompt:this.prevPrompt,promptPlaceholder:this.prevPromptPlaceholder,rules:this.prevRules};p.maskingChanged(e,this.$props)&&this.updateService(),this.setValidity()},computed:{computedRules(){return Object.assign({},p.defaultRules,this.$props.rules)},spanClassNames(){const e=!this.hasMounted||!this.$props.validityStyles||this.validity().valid;return{"k-floating-label-container":!0,"k-focus":this.currentFocused,"k-empty":!this.computedValue(),"k-invalid":!e&&e!==void 0,"k-rtl":this.$props.dir==="rtl","k-loading":this.showLoadingIcon,[this.wrapperClass]:this.wrapperClass}},wrapperSpanClass(){const{size:e,fillMode:t,rounded:i}=this.$props,a=!this.$props.validityStyles||this.validity().valid;return{"k-maskedtextbox":!0,"k-input":!0,[`k-input-${s.kendoThemeMaps.sizeMap[e]||e}`]:e,[`k-input-${t}`]:t,[`k-rounded-${s.kendoThemeMaps.roundedMap[i]||i}`]:i,"k-invalid":!a,"k-required":this.required,"k-disabled":this.$props.disabled,"k-loading":this.showLoadingIcon,[this.wrapperClass]:this.wrapperClass}},inputInnerClass(){return{"k-input-inner":!0,[this.inputClass]:this.inputClass}}},methods:{focus(){this.input&&this.input.focus()},computedValue(){let e;return this.valueDuringOnChange!==void 0?e=this.valueDuringOnChange:this.$props.value!==void 0?e=this.$props.value:this.$props.modelValue!==void 0?e=this.$props.modelValue:this.currentValue!==void 0?e=this.currentValue:this.$props.defaultValue!==void 0&&(e=this.$props.defaultValue),e||""},rawValue(){return this.service.rawValue(this.computedValue())},validity(){const e=this.computedValue(),t=this.service.validationValue(e),i=this.$props.validationMessage!==void 0,a=this.$props.valid!==void 0?this.$props.valid:(!this.$props.required||!!t)&&(!this.$props.maskValidation||!this.$props.prompt||e.indexOf(this.$props.prompt)===-1);return{customError:i,valid:a,valueMissing:!t}},pasteHandler(e){const{selectionStart:t,selectionEnd:i}=e.target;i!==t&&(this.isPasted=!0,this.currentSelection=[t||0,i||0])},clearClick(e){this.triggerOnChange("",e)},onChangeHandler(e){const t=e.currentTarget,i=this.inputValue=t.value,a=this.currentSelection[0]||0,l=this.currentSelection[1]||0;if(!this.$props.mask){this.isPasted=!1,this.currentSelection=[null,null],this.triggerOnChange(i,e);return}const u=this.computedValue();let r;if(this.isPasted){this.isPasted=!1;const o=u.length-l,d=i.length-o;r=this.service.maskInRange(i.slice(a,d),u,a,l)}else r=this.service.maskInput(i,u,t.selectionStart||0);this.currentSelection=[r.selection,r.selection],this.triggerOnChange(r.value,e),this.inputValue=void 0},focusHandler(e){this.currentFocused||(this.currentFocused=!0,this.$emit("focus",{target:this,event:e}))},blurHandler(e){this.currentFocused&&(this.currentFocused=!1,this.$emit("blur",{target:this,event:e}))},triggerOnChange(e,t){this.currentValue=e,this.valueDuringOnChange=e,this.$emit("change",{event:t,selectionStart:this.currentSelection[0],selectionEnd:this.currentSelection[1],value:this.computedValue(),component:this,target:{name:this.$props.name,value:this.computedValue(),rawValue:this.rawValue()},validity:this.validity()}),this.$emit("update:modelValue",this.computedValue()),this.$emit("update:modelRawValue",this.rawValue()),this.$emit("changemodel",this.computedValue()),this.valueDuringOnChange=void 0},updateService(e){const t=Object.assign({includeLiterals:this.$props.includeLiterals,mask:this.$props.mask,prompt:this.$props.prompt,promptPlaceholder:this.$props.promptPlaceholder,rules:this.$props.rules},e);this.service.update(t)},setValidity(){this.element&&this.element.setCustomValidity(this.validity().valid?"":this.$props.validationMessage||"")}},render(){const e=this.$props.id||this.inputId,{iconName:t,showValidationIcon:i,showLoadingIcon:a,showClearButton:l,inputAttributes:u}=this.$props,r=!this.$props.validityStyles||this.validity().valid,o=this.computedValue();this.inputValue;const d=s.templateRendering.call(this,this.$props.inputPrefix,s.getListeners.call(this)),f=s.templateRendering.call(this,this.$props.inputSuffix,s.getListeners.call(this)),m=s.getTemplate.call(this,{h:n.h,template:d,additionalProps:{value:o,valid:r}}),g=s.getTemplate.call(this,{h:n.h,template:f,additionalProps:{value:o,valid:r}}),h=n.createVNode("span",{dir:this.$props.dir,class:this.wrapperSpanClass,style:this.$props.label?void 0:{width:this.$props.width}},[t&&n.createVNode(s.Icon,{name:t,class:"k-input-icon"},null),this.$props.inputPrefix&&n.createVNode("span",{class:"k-input-prefix"},[m]),n.createVNode("input",n.mergeProps({type:this.$props.type,autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:!1,class:this.inputInnerClass,value:o,id:e,"aria-labelledby":this.$props.ariaLabelledBy,"aria-describedby":this.$props.ariaDescribedBy,"aria-disabled":this.$props.disabled,name:this.$props.name,tabindex:s.getTabIndex(this.$props.tabIndex,this.$props.disabled,!0),accesskey:this.$props.accessKey,title:this.$props.title,disabled:this.$props.disabled||void 0,readonly:this.$props.readonly||void 0,placeholder:this.$props.placeholder,"aria-placeholder":this.$props.placeholder,required:this.$props.required,ref:s.setRef(this,"input")},u,{onInput:this.onChangeHandler,onPaste:this.pasteHandler,onFocus:this.focusHandler,onBlur:this.blurHandler,onDragstart:p.returnFalse,onDrop:p.returnFalse}),null),this.$props.inputSuffix&&n.createVNode("span",{class:"k-input-suffix"},[g]),i&&r&&n.createVNode(s.Icon,{name:"check",icon:c.checkIcon,class:"k-input-validation-icon"},null),i&&!r&&n.createVNode(s.Icon,{name:"exclamation-circle",icon:c.exclamationCircleIcon,class:"k-input-validation-icon"},null),a&&n.createVNode(s.Icon,{name:"loading",class:"k-input-loading-icon"},null),l&&o&&n.createVNode("span",{onClick:this.clearClick,class:"k-clear-value"},[n.createVNode(s.Icon,{name:"x",icon:c.xIcon},null)])]);return this.$props.label?n.createVNode("span",{class:this.spanClassNames,dir:this.$props.dir},[h,this.$props.label?e?n.createVNode("label",{for:e,class:"k-floating-label"},[this.$props.label]):n.createVNode("span",{class:"k-label"},[this.$props.label]):null]):h}});exports.MaskedTextBox=V;
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { defineComponent as
|
|
9
|
-
import { MaskingService as
|
|
10
|
-
import { defaultRules as h, maskingChanged as
|
|
11
|
-
import { templateDefinition as m, validatePackage as
|
|
12
|
-
import { packageMetadata as
|
|
13
|
-
import { checkIcon as
|
|
14
|
-
const
|
|
8
|
+
import { defineComponent as b, ref as C, h as c, createVNode as n, mergeProps as w } from "vue";
|
|
9
|
+
import { MaskingService as x } from "./masking.service.mjs";
|
|
10
|
+
import { defaultRules as h, maskingChanged as P, returnFalse as f } from "./utils.mjs";
|
|
11
|
+
import { templateDefinition as m, validatePackage as I, guid as B, kendoThemeMaps as g, templateRendering as v, getListeners as $, getTemplate as S, Icon as u, getTabIndex as M, setRef as O } from "@progress/kendo-vue-common";
|
|
12
|
+
import { packageMetadata as L } from "../package-metadata.mjs";
|
|
13
|
+
import { checkIcon as R, exclamationCircleIcon as F, xIcon as D } from "@progress/kendo-svg-icons";
|
|
14
|
+
const z = /* @__PURE__ */ b({
|
|
15
15
|
model: {
|
|
16
16
|
event: "changemodel"
|
|
17
17
|
},
|
|
@@ -102,7 +102,8 @@ const N = /* @__PURE__ */ y({
|
|
|
102
102
|
showLoadingIcon: Boolean,
|
|
103
103
|
showClearButton: Boolean,
|
|
104
104
|
inputClass: String,
|
|
105
|
-
wrapperClass: String
|
|
105
|
+
wrapperClass: String,
|
|
106
|
+
inputAttributes: Object
|
|
106
107
|
},
|
|
107
108
|
data() {
|
|
108
109
|
return {
|
|
@@ -113,11 +114,11 @@ const N = /* @__PURE__ */ y({
|
|
|
113
114
|
};
|
|
114
115
|
},
|
|
115
116
|
created() {
|
|
116
|
-
|
|
117
|
+
I(L), this.hasMounted = !1, this.valueDuringOnChange = void 0, this.inputId = `k-${B()}`, this.service = new x(), this.isPasted = !1;
|
|
117
118
|
},
|
|
118
119
|
setup() {
|
|
119
120
|
return {
|
|
120
|
-
inputRef:
|
|
121
|
+
inputRef: C(null)
|
|
121
122
|
};
|
|
122
123
|
},
|
|
123
124
|
mounted() {
|
|
@@ -159,7 +160,7 @@ const N = /* @__PURE__ */ y({
|
|
|
159
160
|
promptPlaceholder: this.prevPromptPlaceholder,
|
|
160
161
|
rules: this.prevRules
|
|
161
162
|
};
|
|
162
|
-
|
|
163
|
+
P(e, this.$props) && this.updateService(), this.setValidity();
|
|
163
164
|
},
|
|
164
165
|
computed: {
|
|
165
166
|
computedRules() {
|
|
@@ -238,14 +239,14 @@ const N = /* @__PURE__ */ y({
|
|
|
238
239
|
this.isPasted = !1, this.currentSelection = [null, null], this.triggerOnChange(i, e);
|
|
239
240
|
return;
|
|
240
241
|
}
|
|
241
|
-
const
|
|
242
|
+
const o = this.computedValue();
|
|
242
243
|
let l;
|
|
243
244
|
if (this.isPasted) {
|
|
244
245
|
this.isPasted = !1;
|
|
245
|
-
const
|
|
246
|
-
l = this.service.maskInRange(i.slice(s, p),
|
|
246
|
+
const r = o.length - a, p = i.length - r;
|
|
247
|
+
l = this.service.maskInRange(i.slice(s, p), o, s, a);
|
|
247
248
|
} else
|
|
248
|
-
l = this.service.maskInput(i,
|
|
249
|
+
l = this.service.maskInput(i, o, t.selectionStart || 0);
|
|
249
250
|
this.currentSelection = [l.selection, l.selection], this.triggerOnChange(l.value, e), this.inputValue = void 0;
|
|
250
251
|
},
|
|
251
252
|
focusHandler(e) {
|
|
@@ -294,22 +295,23 @@ const N = /* @__PURE__ */ y({
|
|
|
294
295
|
iconName: t,
|
|
295
296
|
showValidationIcon: i,
|
|
296
297
|
showLoadingIcon: s,
|
|
297
|
-
showClearButton: a
|
|
298
|
-
|
|
298
|
+
showClearButton: a,
|
|
299
|
+
inputAttributes: o
|
|
300
|
+
} = this.$props, l = !this.$props.validityStyles || this.validity().valid, r = this.computedValue();
|
|
299
301
|
this.inputValue;
|
|
300
|
-
const
|
|
302
|
+
const p = v.call(this, this.$props.inputPrefix, $.call(this)), k = v.call(this, this.$props.inputSuffix, $.call(this)), V = S.call(this, {
|
|
301
303
|
h: c,
|
|
302
|
-
template:
|
|
304
|
+
template: p,
|
|
303
305
|
additionalProps: {
|
|
304
|
-
value:
|
|
305
|
-
valid:
|
|
306
|
+
value: r,
|
|
307
|
+
valid: l
|
|
306
308
|
}
|
|
307
|
-
}),
|
|
309
|
+
}), y = S.call(this, {
|
|
308
310
|
h: c,
|
|
309
|
-
template:
|
|
311
|
+
template: k,
|
|
310
312
|
additionalProps: {
|
|
311
|
-
value:
|
|
312
|
-
valid:
|
|
313
|
+
value: r,
|
|
314
|
+
valid: l
|
|
313
315
|
}
|
|
314
316
|
}), d = n("span", {
|
|
315
317
|
dir: this.$props.dir,
|
|
@@ -317,25 +319,25 @@ const N = /* @__PURE__ */ y({
|
|
|
317
319
|
style: this.$props.label ? void 0 : {
|
|
318
320
|
width: this.$props.width
|
|
319
321
|
}
|
|
320
|
-
}, [t && n(
|
|
322
|
+
}, [t && n(u, {
|
|
321
323
|
name: t,
|
|
322
324
|
class: "k-input-icon"
|
|
323
325
|
}, null), this.$props.inputPrefix && n("span", {
|
|
324
326
|
class: "k-input-prefix"
|
|
325
|
-
}, [
|
|
327
|
+
}, [V]), n("input", w({
|
|
326
328
|
type: this.$props.type,
|
|
327
329
|
autocomplete: "off",
|
|
328
330
|
autocorrect: "off",
|
|
329
331
|
autocapitalize: "off",
|
|
330
332
|
spellcheck: !1,
|
|
331
333
|
class: this.inputInnerClass,
|
|
332
|
-
value:
|
|
334
|
+
value: r,
|
|
333
335
|
id: e,
|
|
334
336
|
"aria-labelledby": this.$props.ariaLabelledBy,
|
|
335
337
|
"aria-describedby": this.$props.ariaDescribedBy,
|
|
336
338
|
"aria-disabled": this.$props.disabled,
|
|
337
339
|
name: this.$props.name,
|
|
338
|
-
tabindex:
|
|
340
|
+
tabindex: M(this.$props.tabIndex, this.$props.disabled, !0),
|
|
339
341
|
accesskey: this.$props.accessKey,
|
|
340
342
|
title: this.$props.title,
|
|
341
343
|
disabled: this.$props.disabled || void 0,
|
|
@@ -343,32 +345,33 @@ const N = /* @__PURE__ */ y({
|
|
|
343
345
|
placeholder: this.$props.placeholder,
|
|
344
346
|
"aria-placeholder": this.$props.placeholder,
|
|
345
347
|
required: this.$props.required,
|
|
346
|
-
ref:
|
|
348
|
+
ref: O(this, "input")
|
|
349
|
+
}, o, {
|
|
347
350
|
onInput: this.onChangeHandler,
|
|
348
351
|
onPaste: this.pasteHandler,
|
|
349
352
|
onFocus: this.focusHandler,
|
|
350
353
|
onBlur: this.blurHandler,
|
|
351
354
|
onDragstart: f,
|
|
352
355
|
onDrop: f
|
|
353
|
-
}, null), this.$props.inputSuffix && n("span", {
|
|
356
|
+
}), null), this.$props.inputSuffix && n("span", {
|
|
354
357
|
class: "k-input-suffix"
|
|
355
|
-
}, [
|
|
358
|
+
}, [y]), i && l && n(u, {
|
|
356
359
|
name: "check",
|
|
357
|
-
icon:
|
|
360
|
+
icon: R,
|
|
358
361
|
class: "k-input-validation-icon"
|
|
359
|
-
}, null), i && !
|
|
362
|
+
}, null), i && !l && n(u, {
|
|
360
363
|
name: "exclamation-circle",
|
|
361
|
-
icon:
|
|
364
|
+
icon: F,
|
|
362
365
|
class: "k-input-validation-icon"
|
|
363
|
-
}, null), s && n(
|
|
366
|
+
}, null), s && n(u, {
|
|
364
367
|
name: "loading",
|
|
365
368
|
class: "k-input-loading-icon"
|
|
366
|
-
}, null), a &&
|
|
369
|
+
}, null), a && r && n("span", {
|
|
367
370
|
onClick: this.clearClick,
|
|
368
371
|
class: "k-clear-value"
|
|
369
|
-
}, [n(
|
|
372
|
+
}, [n(u, {
|
|
370
373
|
name: "x",
|
|
371
|
-
icon:
|
|
374
|
+
icon: D
|
|
372
375
|
}, null)])]);
|
|
373
376
|
return this.$props.label ? n("span", {
|
|
374
377
|
class: this.spanClassNames,
|
|
@@ -382,5 +385,5 @@ const N = /* @__PURE__ */ y({
|
|
|
382
385
|
}
|
|
383
386
|
});
|
|
384
387
|
export {
|
|
385
|
-
|
|
388
|
+
z as MaskedTextBox
|
|
386
389
|
};
|