@syncfusion/ej2-inputs 20.4.40 → 20.4.48
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/CHANGELOG.md +7 -1
- package/README.md +1 -1
- package/dist/ej2-inputs.min.js +2 -2
- package/dist/ej2-inputs.umd.min.js +2 -2
- package/dist/ej2-inputs.umd.min.js.map +1 -1
- package/dist/es6/ej2-inputs.es2015.js +60 -39
- package/dist/es6/ej2-inputs.es2015.js.map +1 -1
- package/dist/es6/ej2-inputs.es5.js +61 -39
- package/dist/es6/ej2-inputs.es5.js.map +1 -1
- package/dist/global/ej2-inputs.min.js +2 -2
- package/dist/global/ej2-inputs.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +9 -9
- package/src/common/signature-base.js +2 -0
- package/src/rating/rating-model.d.ts +57 -41
- package/src/rating/rating.d.ts +88 -56
- package/src/rating/rating.js +52 -32
- package/src/uploader/uploader.js +8 -8
- package/styles/bootstrap-dark.css +5 -0
- package/styles/bootstrap.css +5 -0
- package/styles/bootstrap4.css +5 -0
- package/styles/bootstrap5-dark.css +5 -0
- package/styles/bootstrap5.css +5 -0
- package/styles/color-picker/_layout.scss +14 -0
- package/styles/color-picker/fluent-dark.css +6 -0
- package/styles/color-picker/fluent.css +6 -0
- package/styles/fabric-dark.css +5 -0
- package/styles/fabric.css +5 -0
- package/styles/fluent-dark.css +12 -1
- package/styles/fluent.css +12 -1
- package/styles/highcontrast-light.css +5 -0
- package/styles/highcontrast.css +5 -0
- package/styles/input/_layout.scss +1 -0
- package/styles/input/bootstrap-dark.css +1 -0
- package/styles/input/bootstrap.css +1 -0
- package/styles/input/bootstrap4.css +1 -0
- package/styles/input/bootstrap5-dark.css +1 -0
- package/styles/input/bootstrap5.css +1 -0
- package/styles/input/fabric-dark.css +1 -0
- package/styles/input/fabric.css +1 -0
- package/styles/input/fluent-dark.css +1 -0
- package/styles/input/fluent.css +1 -0
- package/styles/input/highcontrast-light.css +1 -0
- package/styles/input/highcontrast.css +1 -0
- package/styles/input/material-dark.css +1 -0
- package/styles/input/material.css +1 -0
- package/styles/input/tailwind-dark.css +1 -0
- package/styles/input/tailwind.css +1 -0
- package/styles/material-dark.css +5 -0
- package/styles/material.css +5 -0
- package/styles/rating/_bootstrap-dark-definition.scss +1 -0
- package/styles/rating/_bootstrap-definition.scss +1 -0
- package/styles/rating/_bootstrap4-definition.scss +1 -0
- package/styles/rating/_bootstrap5-definition.scss +1 -0
- package/styles/rating/_fabric-dark-definition.scss +1 -0
- package/styles/rating/_fabric-definition.scss +1 -0
- package/styles/rating/_fluent-definition.scss +1 -0
- package/styles/rating/_fusionnew-definition.scss +1 -0
- package/styles/rating/_highcontrast-definition.scss +1 -0
- package/styles/rating/_highcontrast-light-definition.scss +1 -0
- package/styles/rating/_layout.scss +6 -1
- package/styles/rating/_material-dark-definition.scss +1 -0
- package/styles/rating/_material-definition.scss +1 -0
- package/styles/rating/_material3-definition.scss +1 -0
- package/styles/rating/_tailwind-definition.scss +1 -0
- package/styles/rating/bootstrap-dark.css +4 -0
- package/styles/rating/bootstrap.css +4 -0
- package/styles/rating/bootstrap4.css +4 -0
- package/styles/rating/bootstrap5-dark.css +4 -0
- package/styles/rating/bootstrap5.css +4 -0
- package/styles/rating/fabric-dark.css +4 -0
- package/styles/rating/fabric.css +4 -0
- package/styles/rating/fluent-dark.css +5 -1
- package/styles/rating/fluent.css +5 -1
- package/styles/rating/highcontrast-light.css +4 -0
- package/styles/rating/highcontrast.css +4 -0
- package/styles/rating/material-dark.css +4 -0
- package/styles/rating/material.css +4 -0
- package/styles/rating/tailwind-dark.css +4 -0
- package/styles/rating/tailwind.css +4 -0
- package/styles/tailwind-dark.css +5 -0
- package/styles/tailwind.css +5 -0
|
@@ -8281,13 +8281,6 @@ let Uploader = class Uploader extends Component {
|
|
|
8281
8281
|
}
|
|
8282
8282
|
}
|
|
8283
8283
|
setCSSClass(oldCSSClass) {
|
|
8284
|
-
let updatedCssClassValue = this.cssClass;
|
|
8285
|
-
if (!isNullOrUndefined(this.cssClass) && this.cssClass !== '') {
|
|
8286
|
-
updatedCssClassValue = (this.cssClass.replace(/\s+/g, ' ')).trim();
|
|
8287
|
-
}
|
|
8288
|
-
if (!isNullOrUndefined(this.cssClass) && updatedCssClassValue !== '') {
|
|
8289
|
-
addClass([this.uploadWrapper], updatedCssClassValue.split(updatedCssClassValue.indexOf(',') > -1 ? ',' : ' '));
|
|
8290
|
-
}
|
|
8291
8284
|
let updatedOldCssClass = oldCSSClass;
|
|
8292
8285
|
if (!isNullOrUndefined(oldCSSClass)) {
|
|
8293
8286
|
updatedOldCssClass = (oldCSSClass.replace(/\s+/g, ' ')).trim();
|
|
@@ -8295,6 +8288,13 @@ let Uploader = class Uploader extends Component {
|
|
|
8295
8288
|
if (!isNullOrUndefined(oldCSSClass) && updatedOldCssClass !== '') {
|
|
8296
8289
|
removeClass([this.uploadWrapper], updatedOldCssClass.split(' '));
|
|
8297
8290
|
}
|
|
8291
|
+
let updatedCssClassValue = this.cssClass;
|
|
8292
|
+
if (!isNullOrUndefined(this.cssClass) && this.cssClass !== '') {
|
|
8293
|
+
updatedCssClassValue = (this.cssClass.replace(/\s+/g, ' ')).trim();
|
|
8294
|
+
}
|
|
8295
|
+
if (!isNullOrUndefined(this.cssClass) && updatedCssClassValue !== '') {
|
|
8296
|
+
addClass([this.uploadWrapper], updatedCssClassValue.split(updatedCssClassValue.indexOf(',') > -1 ? ',' : ' '));
|
|
8297
|
+
}
|
|
8298
8298
|
}
|
|
8299
8299
|
wireEvents() {
|
|
8300
8300
|
EventHandler.add(this.browseButton, 'click', this.browseButtonClick, this);
|
|
@@ -10833,7 +10833,7 @@ let Uploader = class Uploader extends Component {
|
|
|
10833
10833
|
const files = this.getFiles(fileData);
|
|
10834
10834
|
for (let i = 0; i < files.length; i++) {
|
|
10835
10835
|
if (files[i].statusCode === '5' || files[i].statusCode === '0') {
|
|
10836
|
-
if (this.asyncSettings.chunkSize > 0) {
|
|
10836
|
+
if (this.asyncSettings.chunkSize > 0 && this.getCurrentMetaData(files[i], null)) {
|
|
10837
10837
|
this.retryUpload(this.getCurrentMetaData(files[i], null), fromcanceledStage);
|
|
10838
10838
|
}
|
|
10839
10839
|
else {
|
|
@@ -14260,6 +14260,7 @@ class SignatureBase extends Component {
|
|
|
14260
14260
|
* @returns {void}.
|
|
14261
14261
|
*/
|
|
14262
14262
|
draw(text, fontFamily, fontSize) {
|
|
14263
|
+
const args = { actionName: 'draw-text' };
|
|
14263
14264
|
this.canvasContext.clearRect(0, 0, this.canvasContext.canvas.width, this.canvasContext.canvas.height);
|
|
14264
14265
|
fontFamily = fontFamily || 'Arial';
|
|
14265
14266
|
fontSize = fontSize || 30;
|
|
@@ -14269,6 +14270,7 @@ class SignatureBase extends Component {
|
|
|
14269
14270
|
this.canvasContext.fillText(text, this.element.width / 2, this.element.height / 2);
|
|
14270
14271
|
this.updateSnapCollection();
|
|
14271
14272
|
this.isSignatureEmpty = false;
|
|
14273
|
+
this.trigger('change', args);
|
|
14272
14274
|
}
|
|
14273
14275
|
/**
|
|
14274
14276
|
* To load the signature with the given base 64 string, height and width.
|
|
@@ -14734,49 +14736,64 @@ const EMPTYTEMPLATE = 'e-rating-empty';
|
|
|
14734
14736
|
const SELECTEDVALUE = 'e-selected-value';
|
|
14735
14737
|
const RATINGVALUE = '--rating-value';
|
|
14736
14738
|
/**
|
|
14737
|
-
* Defines
|
|
14739
|
+
* Defines where to position the label in rating
|
|
14738
14740
|
*/
|
|
14739
14741
|
var LabelPosition;
|
|
14740
14742
|
(function (LabelPosition) {
|
|
14741
14743
|
/**
|
|
14742
|
-
*
|
|
14744
|
+
* The label is positioned at the top center of the rating component.
|
|
14743
14745
|
*/
|
|
14744
14746
|
LabelPosition["Top"] = "Top";
|
|
14745
14747
|
/**
|
|
14746
|
-
*
|
|
14748
|
+
* The label is positioned at the bottom center of the rating component.
|
|
14747
14749
|
*/
|
|
14748
14750
|
LabelPosition["Bottom"] = "Bottom";
|
|
14749
14751
|
/**
|
|
14750
|
-
*
|
|
14752
|
+
* The label is positioned at the left side of the rating component.
|
|
14751
14753
|
*/
|
|
14752
14754
|
LabelPosition["Left"] = "Left";
|
|
14753
14755
|
/**
|
|
14754
|
-
*
|
|
14756
|
+
* The label is positioned at the right side of the rating component.
|
|
14755
14757
|
*/
|
|
14756
14758
|
LabelPosition["Right"] = "Right";
|
|
14757
14759
|
})(LabelPosition || (LabelPosition = {}));
|
|
14758
14760
|
/**
|
|
14759
|
-
* Defines the
|
|
14761
|
+
* Defines the precision type of the rating.
|
|
14762
|
+
* It is used to component the granularity of the rating, allowing users to provide ratings with varying levels of precision.
|
|
14760
14763
|
*/
|
|
14761
14764
|
var PrecisionType;
|
|
14762
14765
|
(function (PrecisionType) {
|
|
14763
14766
|
/**
|
|
14764
|
-
*
|
|
14767
|
+
* The rating is increased in whole number increments.
|
|
14765
14768
|
*/
|
|
14766
14769
|
PrecisionType["Full"] = "Full";
|
|
14767
14770
|
/**
|
|
14768
|
-
*
|
|
14771
|
+
* The rating is increased in increments of 0.5 (half).
|
|
14769
14772
|
*/
|
|
14770
14773
|
PrecisionType["Half"] = "Half";
|
|
14771
14774
|
/**
|
|
14772
|
-
*
|
|
14775
|
+
* The rating is increased in increments of 0.25 (quarter).
|
|
14773
14776
|
*/
|
|
14774
14777
|
PrecisionType["Quarter"] = "Quarter";
|
|
14775
14778
|
/**
|
|
14776
|
-
*
|
|
14779
|
+
* The rating is increased in increments of 0.1.
|
|
14777
14780
|
*/
|
|
14778
14781
|
PrecisionType["Exact"] = "Exact";
|
|
14779
14782
|
})(PrecisionType || (PrecisionType = {}));
|
|
14783
|
+
/**
|
|
14784
|
+
* The Rating component allows the user to rate something by clicking on a set of symbols on a numeric scale.
|
|
14785
|
+
* This allows users to provide feedback or ratings for products, services, or content.
|
|
14786
|
+
*
|
|
14787
|
+
* ```html
|
|
14788
|
+
* <input id="rating">
|
|
14789
|
+
* ```
|
|
14790
|
+
* ```typescript
|
|
14791
|
+
* <script>
|
|
14792
|
+
* let ratingObj: Rating = new Rating();
|
|
14793
|
+
* ratingObj.appendTo('#rating');
|
|
14794
|
+
* </script>
|
|
14795
|
+
* ```
|
|
14796
|
+
*/
|
|
14780
14797
|
let Rating = class Rating extends Component {
|
|
14781
14798
|
/**
|
|
14782
14799
|
* Constructor for creating the widget
|
|
@@ -14852,7 +14869,7 @@ let Rating = class Rating extends Component {
|
|
|
14852
14869
|
attributes(this.ratingItemList, { 'aria-label': 'rating', 'role': 'slider' });
|
|
14853
14870
|
this.wrapper.appendChild(this.ratingItemList);
|
|
14854
14871
|
EventHandler.add(this.ratingItemList, 'touchmove', (e) => this.touchMoveHandler(e), this);
|
|
14855
|
-
EventHandler.add(this.ratingItemList,
|
|
14872
|
+
EventHandler.add(this.ratingItemList, Browser.touchEndEvent, this.touchEndHandler, this);
|
|
14856
14873
|
}
|
|
14857
14874
|
touchMoveHandler(e) {
|
|
14858
14875
|
const rect = this.ratingItemList.getBoundingClientRect();
|
|
@@ -14936,9 +14953,9 @@ let Rating = class Rating extends Component {
|
|
|
14936
14953
|
if (this.showTooltip) {
|
|
14937
14954
|
this.tooltipObj = new Tooltip({
|
|
14938
14955
|
target: '.e-rating-item-container', windowCollision: true,
|
|
14939
|
-
opensOn: 'Custom', cssClass: 'e-rating-tooltip'
|
|
14956
|
+
opensOn: 'Custom', cssClass: this.cssClass ? ('e-rating-tooltip ' + this.cssClass) : 'e-rating-tooltip'
|
|
14940
14957
|
});
|
|
14941
|
-
this.tooltipObj.appendTo(
|
|
14958
|
+
this.tooltipObj.appendTo(this.ratingItemList);
|
|
14942
14959
|
}
|
|
14943
14960
|
else {
|
|
14944
14961
|
if (!isNullOrUndefined(this.tooltipObj)) {
|
|
@@ -14967,14 +14984,14 @@ let Rating = class Rating extends Component {
|
|
|
14967
14984
|
currentValue = 0;
|
|
14968
14985
|
}
|
|
14969
14986
|
else {
|
|
14970
|
-
currentValue = (this.precision === PrecisionType.Full) ? Math.round(currentValue) :
|
|
14987
|
+
currentValue = ((this.precision === PrecisionType.Full) || this.enableSingleSelection) ? Math.round(currentValue) :
|
|
14971
14988
|
(this.precision === PrecisionType.Half) ? (Math.round(currentValue * 2) / 2) :
|
|
14972
14989
|
(this.precision === PrecisionType.Quarter) ? (Math.round(currentValue * 4) / 4) : (Math.round(currentValue * 10) / 10);
|
|
14973
14990
|
}
|
|
14974
14991
|
return currentValue;
|
|
14975
14992
|
}
|
|
14976
14993
|
getRatingValue(value, i) {
|
|
14977
|
-
return (this.enableSingleSelection
|
|
14994
|
+
return (this.enableSingleSelection) ? (((value > i) && (value <= i + 1)) ? 1 : 0) :
|
|
14978
14995
|
(value >= i + 1) ? 1 : ((value < i) ? 0 : (value - i));
|
|
14979
14996
|
}
|
|
14980
14997
|
updateItemValue() {
|
|
@@ -15128,6 +15145,11 @@ let Rating = class Rating extends Component {
|
|
|
15128
15145
|
this.updateResetButton();
|
|
15129
15146
|
}
|
|
15130
15147
|
}
|
|
15148
|
+
updateValueChange(e, val, isInteracted = true) {
|
|
15149
|
+
this.triggerChange(e, val, isInteracted);
|
|
15150
|
+
this.updateItemValue();
|
|
15151
|
+
this.updateLabel();
|
|
15152
|
+
}
|
|
15131
15153
|
triggerChange(e, val, isInteracted = true) {
|
|
15132
15154
|
val = this.validateValue(val);
|
|
15133
15155
|
this.currentValue = val;
|
|
@@ -15181,7 +15203,7 @@ let Rating = class Rating extends Component {
|
|
|
15181
15203
|
}
|
|
15182
15204
|
calculateCurrentValue(index, args) {
|
|
15183
15205
|
let currentValue = index;
|
|
15184
|
-
if (this.precision
|
|
15206
|
+
if (!(this.enableSingleSelection || (this.precision === PrecisionType.Full))) {
|
|
15185
15207
|
currentValue = args.offsetX / this.itemElements[index - 1].clientWidth;
|
|
15186
15208
|
currentValue = (this.enableRtl) ? (1 - currentValue) : currentValue;
|
|
15187
15209
|
if (this.precision === PrecisionType.Quarter) {
|
|
@@ -15203,9 +15225,7 @@ let Rating = class Rating extends Component {
|
|
|
15203
15225
|
this.resetClicked(null, false);
|
|
15204
15226
|
}
|
|
15205
15227
|
resetClicked(e, isInteracted = true) {
|
|
15206
|
-
this.
|
|
15207
|
-
this.updateItemValue();
|
|
15208
|
-
this.updateLabel();
|
|
15228
|
+
this.updateValueChange(e, this.min, isInteracted);
|
|
15209
15229
|
this.updateResetButton();
|
|
15210
15230
|
}
|
|
15211
15231
|
wireKeyboardEvent() {
|
|
@@ -15245,12 +15265,11 @@ let Rating = class Rating extends Component {
|
|
|
15245
15265
|
}
|
|
15246
15266
|
handleNavigation(e, isIncrease) {
|
|
15247
15267
|
if ((!isIncrease && (this.value > this.min)) || (isIncrease && (this.value < this.itemsCount))) {
|
|
15248
|
-
let currentValue = (this.precision === PrecisionType.Full
|
|
15249
|
-
(this.precision === PrecisionType.
|
|
15268
|
+
let currentValue = (this.precision === PrecisionType.Full || this.enableSingleSelection) ? 1 :
|
|
15269
|
+
(this.precision === PrecisionType.Half) ? 0.5 : (this.precision === PrecisionType.Quarter) ? 0.25 :
|
|
15270
|
+
Math.round(0.1 * 10) / 10;
|
|
15250
15271
|
currentValue = isIncrease ? this.value + currentValue : this.value - currentValue;
|
|
15251
|
-
this.
|
|
15252
|
-
this.updateItemValue();
|
|
15253
|
-
this.updateLabel();
|
|
15272
|
+
this.updateValueChange(e, (currentValue));
|
|
15254
15273
|
if (this.allowReset) {
|
|
15255
15274
|
this.updateResetButton();
|
|
15256
15275
|
}
|
|
@@ -15328,9 +15347,7 @@ let Rating = class Rating extends Component {
|
|
|
15328
15347
|
for (const prop of Object.keys(newProp)) {
|
|
15329
15348
|
switch (prop) {
|
|
15330
15349
|
case 'value':
|
|
15331
|
-
this.
|
|
15332
|
-
this.updateItemValue();
|
|
15333
|
-
this.updateLabel();
|
|
15350
|
+
this.updateValueChange(null, (this.value > this.min) ? this.value : this.min, false);
|
|
15334
15351
|
break;
|
|
15335
15352
|
case 'min':
|
|
15336
15353
|
this.updateMinValue();
|
|
@@ -15362,6 +15379,9 @@ let Rating = class Rating extends Component {
|
|
|
15362
15379
|
if (newProp.cssClass) {
|
|
15363
15380
|
addClass([this.wrapper], newProp.cssClass.split(' '));
|
|
15364
15381
|
}
|
|
15382
|
+
if (this.tooltipObj) {
|
|
15383
|
+
this.tooltipObj.setProperties({ cssClass: this.cssClass ? ('e-rating-tooltip ' + this.cssClass) : 'e-rating-tooltip' });
|
|
15384
|
+
}
|
|
15365
15385
|
break;
|
|
15366
15386
|
case 'labelPosition':
|
|
15367
15387
|
this.updateLabelPosition();
|
|
@@ -15374,7 +15394,8 @@ let Rating = class Rating extends Component {
|
|
|
15374
15394
|
this.updateLabel();
|
|
15375
15395
|
break;
|
|
15376
15396
|
case 'enableSingleSelection':
|
|
15377
|
-
|
|
15397
|
+
//To validate the value against single selection and update the items, label + trigger change event if value changed
|
|
15398
|
+
this.updateValueChange(null, this.currentValue, false);
|
|
15378
15399
|
break;
|
|
15379
15400
|
case 'enableAnimation':
|
|
15380
15401
|
this.wrapper.classList[this.enableAnimation ? 'add' : 'remove'](ANIMATION);
|
|
@@ -15406,12 +15427,12 @@ __decorate$8([
|
|
|
15406
15427
|
__decorate$8([
|
|
15407
15428
|
Property(false)
|
|
15408
15429
|
], Rating.prototype, "disabled", void 0);
|
|
15409
|
-
__decorate$8([
|
|
15410
|
-
Property(true)
|
|
15411
|
-
], Rating.prototype, "enableAnimation", void 0);
|
|
15412
15430
|
__decorate$8([
|
|
15413
15431
|
Property('')
|
|
15414
15432
|
], Rating.prototype, "emptyTemplate", void 0);
|
|
15433
|
+
__decorate$8([
|
|
15434
|
+
Property(true)
|
|
15435
|
+
], Rating.prototype, "enableAnimation", void 0);
|
|
15415
15436
|
__decorate$8([
|
|
15416
15437
|
Property(false)
|
|
15417
15438
|
], Rating.prototype, "enableSingleSelection", void 0);
|