primevue 3.7.0 → 3.8.1
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/autocomplete/AutoComplete.d.ts +1 -0
- package/autocomplete/AutoComplete.vue +8 -1
- package/autocomplete/autocomplete.cjs.js +8 -1
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.esm.js +8 -1
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +8 -1
- package/autocomplete/autocomplete.min.js +1 -1
- package/blockui/BlockUI.vue +1 -1
- package/blockui/blockui.cjs.js +1 -1
- package/blockui/blockui.cjs.min.js +1 -1
- package/blockui/blockui.esm.js +1 -1
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +1 -1
- package/blockui/blockui.min.js +1 -1
- package/breadcrumb/Breadcrumb.vue +4 -0
- package/breadcrumb/breadcrumb.cjs.js +1 -1
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +1 -1
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +1 -1
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/confirmationservice/ConfirmationService.d.ts +3 -2
- package/core/core.js +7574 -0
- package/core/core.min.js +47 -0
- package/datatable/BodyCell.vue +36 -17
- package/datatable/ColumnFilter.vue +3 -3
- package/datatable/DataTable.d.ts +1 -1
- package/datatable/DataTable.vue +109 -69
- package/datatable/FooterCell.vue +2 -2
- package/datatable/HeaderCell.vue +2 -2
- package/datatable/TableBody.vue +10 -5
- package/datatable/TableFooter.vue +2 -1
- package/datatable/TableHeader.vue +3 -2
- package/datatable/datatable.cjs.js +192 -122
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.esm.js +192 -122
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +192 -122
- package/datatable/datatable.min.js +1 -1
- package/dock/Dock.d.ts +1 -0
- package/dock/Dock.vue +1 -1
- package/dock/DockSub.vue +13 -8
- package/dock/dock.cjs.js +24 -10
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.esm.js +20 -10
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +25 -12
- package/dock/dock.min.js +1 -1
- package/dropdown/Dropdown.vue +9 -8
- package/dropdown/dropdown.cjs.js +13 -11
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +13 -11
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +13 -11
- package/dropdown/dropdown.min.js +1 -1
- package/galleria/Galleria.vue +1 -0
- package/galleria/GalleriaContent.vue +10 -1
- package/galleria/galleria.cjs.js +11 -2
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.esm.js +11 -2
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +11 -2
- package/galleria/galleria.min.js +1 -1
- package/inplace/Inplace.d.ts +1 -0
- package/inplace/Inplace.vue +12 -1
- package/inplace/inplace.cjs.js +13 -2
- package/inplace/inplace.cjs.min.js +1 -1
- package/inplace/inplace.esm.js +13 -2
- package/inplace/inplace.esm.min.js +1 -1
- package/inplace/inplace.js +13 -2
- package/inplace/inplace.min.js +1 -1
- package/inputnumber/InputNumber.d.ts +2 -0
- package/inputnumber/InputNumber.vue +84 -35
- package/inputnumber/inputnumber.cjs.js +84 -35
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.js +84 -35
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +84 -35
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/InputSwitch.vue +6 -3
- package/inputswitch/inputswitch.cjs.js +6 -3
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +6 -3
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +6 -3
- package/inputswitch/inputswitch.min.js +1 -1
- package/knob/Knob.vue +1 -1
- package/knob/knob.cjs.js +1 -1
- package/knob/knob.esm.js +1 -1
- package/knob/knob.js +1 -1
- package/overlaypanel/OverlayPanel.d.ts +2 -0
- package/overlaypanel/OverlayPanel.vue +4 -1
- package/overlaypanel/overlaypanel.cjs.js +7 -3
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.esm.js +7 -3
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +7 -3
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +1 -1
- package/paginator/CurrentPageReport.vue +5 -1
- package/paginator/JumpToPageInput.vue +1 -1
- package/paginator/Paginator.vue +6 -3
- package/paginator/paginator.cjs.js +12 -4
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.esm.js +12 -4
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +12 -4
- package/paginator/paginator.min.js +1 -1
- package/panelmenu/PanelMenuSub.vue +4 -4
- package/panelmenu/panelmenu.cjs.js +4 -4
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +4 -4
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +4 -4
- package/panelmenu/panelmenu.min.js +1 -1
- package/resources/primevue.css +3 -0
- package/resources/primevue.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +6 -1
- package/resources/themes/arya-green/theme.css +6 -1
- package/resources/themes/arya-orange/theme.css +6 -1
- package/resources/themes/arya-purple/theme.css +6 -1
- package/resources/themes/bootstrap4-dark-blue/theme.css +6 -1
- package/resources/themes/bootstrap4-dark-purple/theme.css +6 -1
- package/resources/themes/bootstrap4-light-blue/theme.css +6 -1
- package/resources/themes/bootstrap4-light-purple/theme.css +6 -1
- package/resources/themes/fluent-light/theme.css +6 -1
- package/resources/themes/luna-amber/theme.css +6 -1
- package/resources/themes/luna-blue/theme.css +6 -1
- package/resources/themes/luna-green/theme.css +6 -1
- package/resources/themes/luna-pink/theme.css +6 -1
- package/resources/themes/md-dark-deeppurple/theme.css +6 -1
- package/resources/themes/md-dark-indigo/theme.css +6 -1
- package/resources/themes/md-light-deeppurple/theme.css +6 -1
- package/resources/themes/md-light-indigo/theme.css +6 -1
- package/resources/themes/mdc-dark-deeppurple/theme.css +6 -1
- package/resources/themes/mdc-dark-indigo/theme.css +6 -1
- package/resources/themes/mdc-light-deeppurple/theme.css +6 -1
- package/resources/themes/mdc-light-indigo/theme.css +6 -1
- package/resources/themes/nova/theme.css +6 -1
- package/resources/themes/nova-accent/theme.css +6 -1
- package/resources/themes/nova-alt/theme.css +6 -1
- package/resources/themes/nova-vue/theme.css +6 -1
- package/resources/themes/rhea/theme.css +6 -1
- package/resources/themes/saga-blue/theme.css +6 -1
- package/resources/themes/saga-green/theme.css +6 -1
- package/resources/themes/saga-orange/theme.css +6 -1
- package/resources/themes/saga-purple/theme.css +6 -1
- package/resources/themes/tailwind-light/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-Light.woff +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/tailwind-light/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/tailwind-light/theme.css +5440 -0
- package/resources/themes/vela-blue/theme.css +6 -1
- package/resources/themes/vela-green/theme.css +6 -1
- package/resources/themes/vela-orange/theme.css +6 -1
- package/resources/themes/vela-purple/theme.css +6 -1
- package/speeddial/SpeedDial.vue +2 -1
- package/speeddial/speeddial.cjs.js +2 -1
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.esm.js +2 -1
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +2 -1
- package/speeddial/speeddial.min.js +1 -1
- package/splitter/Splitter.vue +5 -3
- package/splitter/splitter.cjs.js +4 -2
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.esm.js +5 -3
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +4 -2
- package/splitter/splitter.min.js +1 -1
- package/tabmenu/TabMenu.vue +4 -0
- package/tabmenu/tabmenu.cjs.js +1 -1
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +1 -1
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +1 -1
- package/tabmenu/tabmenu.min.js +1 -1
- package/terminal/terminal.js +1 -1
- package/terminal/terminal.min.js +1 -1
- package/tieredmenu/TieredMenuSub.vue +1 -1
- package/tieredmenu/tieredmenu.cjs.js +1 -1
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.esm.js +1 -1
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +1 -1
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/toastservice/ToastService.d.ts +3 -2
- package/tooltip/tooltip.cjs.js +10 -3
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.esm.js +10 -3
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +10 -3
- package/tooltip/tooltip.min.js +1 -1
- package/treetable/BodyCell.vue +2 -3
- package/treetable/FooterCell.vue +2 -2
- package/treetable/HeaderCell.vue +2 -2
- package/treetable/TreeTable.vue +2 -2
- package/treetable/TreeTableRow.vue +2 -2
- package/treetable/treetable.cjs.js +6 -6
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.esm.js +7 -7
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +6 -6
- package/treetable/treetable.min.js +1 -1
- package/utils/Utils.d.ts +80 -0
- package/utils/package.json +3 -2
- package/utils/utils.cjs.js +126 -108
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.esm.js +126 -108
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +126 -108
- package/utils/utils.min.js +1 -1
- package/vetur-attributes.json +12 -0
- package/vetur-tags.json +4 -1
- package/virtualscroller/VirtualScroller.vue +1 -1
- package/virtualscroller/virtualscroller.cjs.js +1 -1
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +1 -1
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +1 -1
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +88 -5
|
@@ -96,6 +96,10 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
|
|
|
96
96
|
type: Number,
|
|
97
97
|
default: 1
|
|
98
98
|
},
|
|
99
|
+
allowEmpty: {
|
|
100
|
+
type: Boolean,
|
|
101
|
+
default: true
|
|
102
|
+
},
|
|
99
103
|
style: null,
|
|
100
104
|
class: null,
|
|
101
105
|
inputStyle: null,
|
|
@@ -172,10 +176,10 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
|
|
|
172
176
|
const numerals = [...new Intl.NumberFormat(this.locale, {useGrouping: false}).format(9876543210)].reverse();
|
|
173
177
|
const index = new Map(numerals.map((d, i) => [d, i]));
|
|
174
178
|
this._numeral = new RegExp(`[${numerals.join('')}]`, 'g');
|
|
175
|
-
this._decimal = this.getDecimalExpression();
|
|
176
179
|
this._group = this.getGroupingExpression();
|
|
177
180
|
this._minusSign = this.getMinusSignExpression();
|
|
178
181
|
this._currency = this.getCurrencyExpression();
|
|
182
|
+
this._decimal = this.getDecimalExpression();
|
|
179
183
|
this._suffix = this.getSuffixExpression();
|
|
180
184
|
this._prefix = this.getPrefixExpression();
|
|
181
185
|
this._index = d => index.get(d);
|
|
@@ -189,8 +193,8 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
|
|
|
189
193
|
return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
|
|
190
194
|
},
|
|
191
195
|
getDecimalExpression() {
|
|
192
|
-
const formatter = new Intl.NumberFormat(this.locale, {useGrouping: false});
|
|
193
|
-
return new RegExp(`[${formatter.format(1.1).trim().replace(this._numeral, '')}]`, 'g');
|
|
196
|
+
const formatter = new Intl.NumberFormat(this.locale, {...this.getOptions(), useGrouping: false});
|
|
197
|
+
return new RegExp(`[${formatter.format(1.1).replace(this._currency, '').trim().replace(this._numeral, '')}]`, 'g');
|
|
194
198
|
},
|
|
195
199
|
getGroupingExpression() {
|
|
196
200
|
const formatter = new Intl.NumberFormat(this.locale, {useGrouping: true});
|
|
@@ -203,8 +207,9 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
|
|
|
203
207
|
},
|
|
204
208
|
getCurrencyExpression() {
|
|
205
209
|
if (this.currency) {
|
|
206
|
-
const formatter = new Intl.NumberFormat(this.locale, {style: 'currency', currency: this.currency, currencyDisplay: this.currencyDisplay
|
|
207
|
-
|
|
210
|
+
const formatter = new Intl.NumberFormat(this.locale, {style: 'currency', currency: this.currency, currencyDisplay: this.currencyDisplay,
|
|
211
|
+
minimumFractionDigits: 0, maximumFractionDigits: 0});
|
|
212
|
+
return new RegExp(`[${formatter.format(1).replace(/\s/g, '').replace(this._numeral, '').replace(this._group, '')}]`, 'g');
|
|
208
213
|
}
|
|
209
214
|
|
|
210
215
|
return new RegExp(`[]`,'g');
|
|
@@ -417,9 +422,8 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
|
|
|
417
422
|
event.preventDefault();
|
|
418
423
|
|
|
419
424
|
if (selectionStart === selectionEnd) {
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
this._decimal.lastIndex = 0;
|
|
425
|
+
const deleteChar = inputValue.charAt(selectionStart - 1);
|
|
426
|
+
const { decimalCharIndex, decimalCharIndexWithoutPrefix } = this.getDecimalCharIndexes(inputValue);
|
|
423
427
|
|
|
424
428
|
if (this.isNumeralChar(deleteChar)) {
|
|
425
429
|
const decimalLength = this.getDecimalLength(inputValue);
|
|
@@ -439,10 +443,10 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
|
|
|
439
443
|
}
|
|
440
444
|
}
|
|
441
445
|
else if (decimalCharIndex > 0 && selectionStart > decimalCharIndex) {
|
|
442
|
-
const insertedText = (this.minFractionDigits || 0) < decimalLength ? '' : '0';
|
|
446
|
+
const insertedText = this.isDecimalMode() && (this.minFractionDigits || 0) < decimalLength ? '' : '0';
|
|
443
447
|
newValueStr = inputValue.slice(0, selectionStart - 1) + insertedText + inputValue.slice(selectionStart);
|
|
444
448
|
}
|
|
445
|
-
else if (
|
|
449
|
+
else if (decimalCharIndexWithoutPrefix === 1) {
|
|
446
450
|
newValueStr = inputValue.slice(0, selectionStart - 1) + '0' + inputValue.slice(selectionStart);
|
|
447
451
|
newValueStr = this.parseValue(newValueStr) > 0 ? newValueStr : '';
|
|
448
452
|
}
|
|
@@ -466,9 +470,8 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
|
|
|
466
470
|
event.preventDefault();
|
|
467
471
|
|
|
468
472
|
if (selectionStart === selectionEnd) {
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
this._decimal.lastIndex = 0;
|
|
473
|
+
const deleteChar = inputValue.charAt(selectionStart);
|
|
474
|
+
const { decimalCharIndex, decimalCharIndexWithoutPrefix } = this.getDecimalCharIndexes(inputValue);
|
|
472
475
|
|
|
473
476
|
if (this.isNumeralChar(deleteChar)) {
|
|
474
477
|
const decimalLength = this.getDecimalLength(inputValue);
|
|
@@ -488,10 +491,10 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
|
|
|
488
491
|
}
|
|
489
492
|
}
|
|
490
493
|
else if (decimalCharIndex > 0 && selectionStart > decimalCharIndex) {
|
|
491
|
-
const insertedText = (this.minFractionDigits || 0) < decimalLength ? '' : '0';
|
|
494
|
+
const insertedText = this.isDecimalMode() && (this.minFractionDigits || 0) < decimalLength ? '' : '0';
|
|
492
495
|
newValueStr = inputValue.slice(0, selectionStart) + insertedText + inputValue.slice(selectionStart + 1);
|
|
493
496
|
}
|
|
494
|
-
else if (
|
|
497
|
+
else if (decimalCharIndexWithoutPrefix === 1) {
|
|
495
498
|
newValueStr = inputValue.slice(0, selectionStart) + '0' + inputValue.slice(selectionStart + 1);
|
|
496
499
|
newValueStr = this.parseValue(newValueStr) > 0 ? newValueStr : '';
|
|
497
500
|
}
|
|
@@ -534,7 +537,7 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
|
|
|
534
537
|
return this.min === null || this.min < 0;
|
|
535
538
|
},
|
|
536
539
|
isMinusSign(char) {
|
|
537
|
-
if (this._minusSign.test(char)) {
|
|
540
|
+
if (this._minusSign.test(char) || char === '-') {
|
|
538
541
|
this._minusSign.lastIndex = 0;
|
|
539
542
|
return true;
|
|
540
543
|
}
|
|
@@ -549,6 +552,31 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
|
|
|
549
552
|
|
|
550
553
|
return false;
|
|
551
554
|
},
|
|
555
|
+
isDecimalMode() {
|
|
556
|
+
return this.mode === 'decimal';
|
|
557
|
+
},
|
|
558
|
+
getDecimalCharIndexes(val) {
|
|
559
|
+
let decimalCharIndex = val.search(this._decimal);
|
|
560
|
+
this._decimal.lastIndex = 0;
|
|
561
|
+
|
|
562
|
+
const filteredVal = val.replace(this._prefix, '').trim().replace(/\s/g, '').replace(this._currency, '');
|
|
563
|
+
const decimalCharIndexWithoutPrefix = filteredVal.search(this._decimal);
|
|
564
|
+
this._decimal.lastIndex = 0;
|
|
565
|
+
|
|
566
|
+
return { decimalCharIndex, decimalCharIndexWithoutPrefix };
|
|
567
|
+
},
|
|
568
|
+
getCharIndexes(val) {
|
|
569
|
+
const decimalCharIndex = val.search(this._decimal);
|
|
570
|
+
this._decimal.lastIndex = 0;
|
|
571
|
+
const minusCharIndex = val.search(this._minusSign);
|
|
572
|
+
this._minusSign.lastIndex = 0;
|
|
573
|
+
const suffixCharIndex = val.search(this._suffix);
|
|
574
|
+
this._suffix.lastIndex = 0;
|
|
575
|
+
const currencyCharIndex = val.search(this._currency);
|
|
576
|
+
this._currency.lastIndex = 0;
|
|
577
|
+
|
|
578
|
+
return { decimalCharIndex, minusCharIndex, suffixCharIndex, currencyCharIndex };
|
|
579
|
+
},
|
|
552
580
|
insert(event, text, sign = { isDecimalSign: false, isMinusSign: false }) {
|
|
553
581
|
const minusCharIndexOnText = text.search(this._minusSign);
|
|
554
582
|
this._minusSign.lastIndex = 0;
|
|
@@ -559,10 +587,7 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
|
|
|
559
587
|
const selectionStart = this.$refs.input.$el.selectionStart;
|
|
560
588
|
const selectionEnd = this.$refs.input.$el.selectionEnd;
|
|
561
589
|
let inputValue = this.$refs.input.$el.value.trim();
|
|
562
|
-
const decimalCharIndex =
|
|
563
|
-
this._decimal.lastIndex = 0;
|
|
564
|
-
const minusCharIndex = inputValue.search(this._minusSign);
|
|
565
|
-
this._minusSign.lastIndex = 0;
|
|
590
|
+
const { decimalCharIndex, minusCharIndex, suffixCharIndex, currencyCharIndex } = this.getCharIndexes(inputValue);
|
|
566
591
|
let newValueStr;
|
|
567
592
|
|
|
568
593
|
if (sign.isMinusSign) {
|
|
@@ -594,7 +619,9 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
|
|
|
594
619
|
|
|
595
620
|
if (decimalCharIndex > 0 && selectionStart > decimalCharIndex) {
|
|
596
621
|
if ((selectionStart + text.length - (decimalCharIndex + 1)) <= maxFractionDigits) {
|
|
597
|
-
|
|
622
|
+
const charIndex = currencyCharIndex >= selectionStart ? currencyCharIndex - 1 : (suffixCharIndex >= selectionStart ? suffixCharIndex : inputValue.length);
|
|
623
|
+
|
|
624
|
+
newValueStr = inputValue.slice(0, selectionStart) + text + inputValue.slice(selectionStart + text.length, charIndex) + inputValue.slice(charIndex);
|
|
598
625
|
this.updateValue(event, newValueStr, text, operation);
|
|
599
626
|
}
|
|
600
627
|
}
|
|
@@ -645,9 +672,14 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
|
|
|
645
672
|
let valueLength = inputValue.length;
|
|
646
673
|
let index = null;
|
|
647
674
|
|
|
675
|
+
// remove prefix
|
|
676
|
+
let prefixLength = (this.prefixChar || '').length;
|
|
677
|
+
inputValue = inputValue.replace(this._prefix, '');
|
|
678
|
+
selectionStart = selectionStart - prefixLength;
|
|
679
|
+
|
|
648
680
|
let char = inputValue.charAt(selectionStart);
|
|
649
681
|
if (this.isNumeralChar(char)) {
|
|
650
|
-
return;
|
|
682
|
+
return selectionStart + prefixLength;
|
|
651
683
|
}
|
|
652
684
|
|
|
653
685
|
//left
|
|
@@ -655,7 +687,7 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
|
|
|
655
687
|
while (i >= 0) {
|
|
656
688
|
char = inputValue.charAt(i);
|
|
657
689
|
if (this.isNumeralChar(char)) {
|
|
658
|
-
index = i;
|
|
690
|
+
index = i + prefixLength;
|
|
659
691
|
break;
|
|
660
692
|
}
|
|
661
693
|
else {
|
|
@@ -667,11 +699,11 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
|
|
|
667
699
|
this.$refs.input.$el.setSelectionRange(index + 1, index + 1);
|
|
668
700
|
}
|
|
669
701
|
else {
|
|
670
|
-
i = selectionStart
|
|
702
|
+
i = selectionStart;
|
|
671
703
|
while (i < valueLength) {
|
|
672
704
|
char = inputValue.charAt(i);
|
|
673
705
|
if (this.isNumeralChar(char)) {
|
|
674
|
-
index = i;
|
|
706
|
+
index = i + prefixLength;
|
|
675
707
|
break;
|
|
676
708
|
}
|
|
677
709
|
else {
|
|
@@ -683,6 +715,8 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
|
|
|
683
715
|
this.$refs.input.$el.setSelectionRange(index, index);
|
|
684
716
|
}
|
|
685
717
|
}
|
|
718
|
+
|
|
719
|
+
return index || 0;
|
|
686
720
|
},
|
|
687
721
|
onInputClick() {
|
|
688
722
|
this.initCursor();
|
|
@@ -707,6 +741,7 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
|
|
|
707
741
|
|
|
708
742
|
if (valueStr != null) {
|
|
709
743
|
newValue = this.parseValue(valueStr);
|
|
744
|
+
newValue = !newValue && !this.allowEmpty ? 0 : newValue;
|
|
710
745
|
this.updateInput(newValue, insertedValueStr, operation, valueStr);
|
|
711
746
|
|
|
712
747
|
this.handleOnInput(event, currentValue, newValue);
|
|
@@ -730,6 +765,10 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
|
|
|
730
765
|
return false;
|
|
731
766
|
},
|
|
732
767
|
validateValue(value) {
|
|
768
|
+
if (value === '-' || value == null) {
|
|
769
|
+
return null;
|
|
770
|
+
}
|
|
771
|
+
|
|
733
772
|
if (this.min != null && value < this.min) {
|
|
734
773
|
return this.min;
|
|
735
774
|
}
|
|
@@ -738,10 +777,6 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
|
|
|
738
777
|
return this.max;
|
|
739
778
|
}
|
|
740
779
|
|
|
741
|
-
if (value === '-') { // Minus sign
|
|
742
|
-
return null;
|
|
743
|
-
}
|
|
744
|
-
|
|
745
780
|
return value;
|
|
746
781
|
},
|
|
747
782
|
updateInput(value, insertedValueStr, operation, valueStr) {
|
|
@@ -758,9 +793,8 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
|
|
|
758
793
|
if (currentLength === 0) {
|
|
759
794
|
this.$refs.input.$el.value = newValue;
|
|
760
795
|
this.$refs.input.$el.setSelectionRange(0, 0);
|
|
761
|
-
this.initCursor();
|
|
762
|
-
const
|
|
763
|
-
const selectionEnd = prefixLength + insertedValueStr.length;
|
|
796
|
+
const index = this.initCursor();
|
|
797
|
+
const selectionEnd = index + insertedValueStr.length;
|
|
764
798
|
this.$refs.input.$el.setSelectionRange(selectionEnd, selectionEnd);
|
|
765
799
|
}
|
|
766
800
|
else {
|
|
@@ -807,6 +841,12 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
|
|
|
807
841
|
this._group.lastIndex = 0;
|
|
808
842
|
this.$refs.input.$el.setSelectionRange(selectionEnd, selectionEnd);
|
|
809
843
|
}
|
|
844
|
+
else if (inputValue === '-' && operation === 'insert') {
|
|
845
|
+
this.$refs.input.$el.setSelectionRange(0, 0);
|
|
846
|
+
const index = this.initCursor();
|
|
847
|
+
const selectionEnd = index + insertedValueStr.length + 1;
|
|
848
|
+
this.$refs.input.$el.setSelectionRange(selectionEnd, selectionEnd);
|
|
849
|
+
}
|
|
810
850
|
else {
|
|
811
851
|
selectionEnd = selectionEnd + (newLength - currentLength);
|
|
812
852
|
this.$refs.input.$el.setSelectionRange(selectionEnd, selectionEnd);
|
|
@@ -820,7 +860,7 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
|
|
|
820
860
|
let decimalCharIndex = val2.search(this._decimal);
|
|
821
861
|
this._decimal.lastIndex = 0;
|
|
822
862
|
|
|
823
|
-
return val1.split(this._decimal)[0] +
|
|
863
|
+
return decimalCharIndex !== -1 ? (val1.split(this._decimal)[0] + val2.slice(decimalCharIndex)) : val1;
|
|
824
864
|
}
|
|
825
865
|
|
|
826
866
|
return val1;
|
|
@@ -829,7 +869,12 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
|
|
|
829
869
|
if (value) {
|
|
830
870
|
const valueSplit = value.split(this._decimal);
|
|
831
871
|
|
|
832
|
-
|
|
872
|
+
if (valueSplit.length === 2) {
|
|
873
|
+
return valueSplit[1].replace(this._suffix, '')
|
|
874
|
+
.trim()
|
|
875
|
+
.replace(/\s/g, '')
|
|
876
|
+
.replace(this._currency, '').length;
|
|
877
|
+
}
|
|
833
878
|
}
|
|
834
879
|
|
|
835
880
|
return 0;
|
|
@@ -893,7 +938,11 @@ this.primevue.inputnumber = (function (InputText, Button, vue) {
|
|
|
893
938
|
}
|
|
894
939
|
},
|
|
895
940
|
formattedValue() {
|
|
896
|
-
|
|
941
|
+
const val = !this.modelValue && !this.allowEmpty ? 0 : this.modelValue;
|
|
942
|
+
return this.formatValue(val);
|
|
943
|
+
},
|
|
944
|
+
getFormatter() {
|
|
945
|
+
return this.numberFormat;
|
|
897
946
|
}
|
|
898
947
|
},
|
|
899
948
|
components: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.inputnumber=function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var s=i(t),r=i(e),u={name:"InputNumber",inheritAttrs:!1,emits:["update:modelValue","input"],props:{modelValue:{type:Number,default:null},format:{type:Boolean,default:!0},showButtons:{type:Boolean,default:!1},buttonLayout:{type:String,default:"stacked"},incrementButtonClass:{type:String,default:null},decrementButtonClass:{type:String,default:null},incrementButtonIcon:{type:String,default:"pi pi-angle-up"},decrementButtonIcon:{type:String,default:"pi pi-angle-down"},locale:{type:String,default:void 0},localeMatcher:{type:String,default:void 0},mode:{type:String,default:"decimal"},prefix:{type:String,default:null},suffix:{type:String,default:null},currency:{type:String,default:void 0},currencyDisplay:{type:String,default:void 0},useGrouping:{type:Boolean,default:!0},minFractionDigits:{type:Number,default:void 0},maxFractionDigits:{type:Number,default:void 0},min:{type:Number,default:null},max:{type:Number,default:null},step:{type:Number,default:1},style:null,class:null,inputStyle:null,inputClass:null},numberFormat:null,_numeral:null,_decimal:null,_group:null,_minusSign:null,_currency:null,_suffix:null,_prefix:null,_index:null,groupChar:"",isSpecialChar:null,prefixChar:null,suffixChar:null,timer:null,data:()=>({focused:!1}),watch:{locale(t,e){this.updateConstructParser(t,e)},localeMatcher(t,e){this.updateConstructParser(t,e)},mode(t,e){this.updateConstructParser(t,e)},currency(t,e){this.updateConstructParser(t,e)},currencyDisplay(t,e){this.updateConstructParser(t,e)},useGrouping(t,e){this.updateConstructParser(t,e)},minFractionDigits(t,e){this.updateConstructParser(t,e)},maxFractionDigits(t,e){this.updateConstructParser(t,e)},suffix(t,e){this.updateConstructParser(t,e)},prefix(t,e){this.updateConstructParser(t,e)}},created(){this.constructParser()},methods:{getOptions(){return{localeMatcher:this.localeMatcher,style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay,useGrouping:this.useGrouping,minimumFractionDigits:this.minFractionDigits,maximumFractionDigits:this.maxFractionDigits}},constructParser(){this.numberFormat=new Intl.NumberFormat(this.locale,this.getOptions());const t=[...new Intl.NumberFormat(this.locale,{useGrouping:!1}).format(9876543210)].reverse(),e=new Map(t.map(((t,e)=>[t,e])));this._numeral=new RegExp(`[${t.join("")}]`,"g"),this._decimal=this.getDecimalExpression(),this._group=this.getGroupingExpression(),this._minusSign=this.getMinusSignExpression(),this._currency=this.getCurrencyExpression(),this._suffix=this.getSuffixExpression(),this._prefix=this.getPrefixExpression(),this._index=t=>e.get(t)},updateConstructParser(t,e){t!==e&&this.constructParser()},escapeRegExp:t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),getDecimalExpression(){const t=new Intl.NumberFormat(this.locale,{useGrouping:!1});return new RegExp(`[${t.format(1.1).trim().replace(this._numeral,"")}]`,"g")},getGroupingExpression(){const t=new Intl.NumberFormat(this.locale,{useGrouping:!0});return this.groupChar=t.format(1e6).trim().replace(this._numeral,"").charAt(0),new RegExp(`[${this.groupChar}]`,"g")},getMinusSignExpression(){const t=new Intl.NumberFormat(this.locale,{useGrouping:!1});return new RegExp(`[${t.format(-1).trim().replace(this._numeral,"")}]`,"g")},getCurrencyExpression(){if(this.currency){const t=new Intl.NumberFormat(this.locale,{style:"currency",currency:this.currency,currencyDisplay:this.currencyDisplay});return new RegExp(`[${t.format(1).replace(/\s/g,"").replace(this._numeral,"").replace(this._decimal,"").replace(this._group,"")}]`,"g")}return new RegExp("[]","g")},getPrefixExpression(){if(this.prefix)this.prefixChar=this.prefix;else{const t=new Intl.NumberFormat(this.locale,{style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay});this.prefixChar=t.format(1).split("1")[0]}return new RegExp(`${this.escapeRegExp(this.prefixChar||"")}`,"g")},getSuffixExpression(){if(this.suffix)this.suffixChar=this.suffix;else{const t=new Intl.NumberFormat(this.locale,{style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay,minimumFractionDigits:0,maximumFractionDigits:0});this.suffixChar=t.format(1).split("1")[1]}return new RegExp(`${this.escapeRegExp(this.suffixChar||"")}`,"g")},formatValue(t){if(null!=t){if("-"===t)return t;if(this.format){let e=new Intl.NumberFormat(this.locale,this.getOptions()).format(t);return this.prefix&&(e=this.prefix+e),this.suffix&&(e+=this.suffix),e}return t.toString()}return""},parseValue(t){let e=t.replace(this._suffix,"").replace(this._prefix,"").trim().replace(/\s/g,"").replace(this._currency,"").replace(this._group,"").replace(this._minusSign,"-").replace(this._decimal,".").replace(this._numeral,this._index);if(e){if("-"===e)return e;let t=+e;return isNaN(t)?null:t}return null},repeat(t,e,n){let i=e||500;this.clearTimer(),this.timer=setTimeout((()=>{this.repeat(t,40,n)}),i),this.spin(t,n)},spin(t,e){if(this.$refs.input){let n=this.step*e,i=this.parseValue(this.$refs.input.$el.value)||0,s=this.validateValue(i+n);this.updateInput(s,null,"spin"),this.updateModel(t,s),this.handleOnInput(t,i,s)}},onUpButtonMouseDown(t){this.$attrs.disabled||(this.$refs.input.$el.focus(),this.repeat(t,null,1),t.preventDefault())},onUpButtonMouseUp(){this.$attrs.disabled||this.clearTimer()},onUpButtonMouseLeave(){this.$attrs.disabled||this.clearTimer()},onUpButtonKeyUp(){this.$attrs.disabled||this.clearTimer()},onUpButtonKeyDown(t){32!==t.keyCode&&13!==t.keyCode||this.repeat(t,null,1)},onDownButtonMouseDown(t){this.$attrs.disabled||(this.$refs.input.$el.focus(),this.repeat(t,null,-1),t.preventDefault())},onDownButtonMouseUp(){this.$attrs.disabled||this.clearTimer()},onDownButtonMouseLeave(){this.$attrs.disabled||this.clearTimer()},onDownButtonKeyUp(){this.$attrs.disabled||this.clearTimer()},onDownButtonKeyDown(t){32!==t.keyCode&&13!==t.keyCode||this.repeat(t,null,-1)},onUserInput(){this.isSpecialChar&&(this.$refs.input.$el.value=this.lastValue),this.isSpecialChar=!1},onInputKeyDown(t){if(this.lastValue=t.target.value,t.shiftKey||t.altKey)return void(this.isSpecialChar=!0);let e=t.target.selectionStart,n=t.target.selectionEnd,i=t.target.value,s=null;switch(t.altKey&&t.preventDefault(),t.which){case 38:this.spin(t,1),t.preventDefault();break;case 40:this.spin(t,-1),t.preventDefault();break;case 37:this.isNumeralChar(i.charAt(e-1))||t.preventDefault();break;case 39:this.isNumeralChar(i.charAt(e))||t.preventDefault();break;case 13:s=this.validateValue(this.parseValue(i)),this.$refs.input.$el.value=this.formatValue(s),this.$refs.input.$el.setAttribute("aria-valuenow",s),this.updateModel(t,s);break;case 8:if(t.preventDefault(),e===n){let n=i.charAt(e-1),r=i.search(this._decimal);if(this._decimal.lastIndex=0,this.isNumeralChar(n)){const t=this.getDecimalLength(i);if(this._group.test(n))this._group.lastIndex=0,s=i.slice(0,e-2)+i.slice(e-1);else if(this._decimal.test(n))this._decimal.lastIndex=0,t?this.$refs.input.$el.setSelectionRange(e-1,e-1):s=i.slice(0,e-1)+i.slice(e);else if(r>0&&e>r){const n=(this.minFractionDigits||0)<t?"":"0";s=i.slice(0,e-1)+n+i.slice(e)}else r>0&&1===r?(s=i.slice(0,e-1)+"0"+i.slice(e),s=this.parseValue(s)>0?s:""):s=i.slice(0,e-1)+i.slice(e)}this.updateValue(t,s,null,"delete-single")}else s=this.deleteRange(i,e,n),this.updateValue(t,s,null,"delete-range");break;case 46:if(t.preventDefault(),e===n){let n=i.charAt(e),r=i.search(this._decimal);if(this._decimal.lastIndex=0,this.isNumeralChar(n)){const t=this.getDecimalLength(i);if(this._group.test(n))this._group.lastIndex=0,s=i.slice(0,e)+i.slice(e+2);else if(this._decimal.test(n))this._decimal.lastIndex=0,t?this.$refs.input.$el.setSelectionRange(e+1,e+1):s=i.slice(0,e)+i.slice(e+1);else if(r>0&&e>r){const n=(this.minFractionDigits||0)<t?"":"0";s=i.slice(0,e)+n+i.slice(e+1)}else r>0&&1===r?(s=i.slice(0,e)+"0"+i.slice(e+1),s=this.parseValue(s)>0?s:""):s=i.slice(0,e)+i.slice(e+1)}this.updateValue(t,s,null,"delete-back-single")}else s=this.deleteRange(i,e,n),this.updateValue(t,s,null,"delete-range")}},onInputKeyPress(t){t.preventDefault();let e=t.which||t.keyCode,n=String.fromCharCode(e);const i=this.isDecimalSign(n),s=this.isMinusSign(n);(48<=e&&e<=57||s||i)&&this.insert(t,n,{isDecimalSign:i,isMinusSign:s})},onPaste(t){t.preventDefault();let e=(t.clipboardData||window.clipboardData).getData("Text");if(e){let n=this.parseValue(e);null!=n&&this.insert(t,n.toString())}},allowMinusSign(){return null===this.min||this.min<0},isMinusSign(t){return!!this._minusSign.test(t)&&(this._minusSign.lastIndex=0,!0)},isDecimalSign(t){return!!this._decimal.test(t)&&(this._decimal.lastIndex=0,!0)},insert(t,e,n={isDecimalSign:!1,isMinusSign:!1}){const i=e.search(this._minusSign);if(this._minusSign.lastIndex=0,!this.allowMinusSign()&&-1!==i)return;const s=this.$refs.input.$el.selectionStart,r=this.$refs.input.$el.selectionEnd;let u=this.$refs.input.$el.value.trim();const l=u.search(this._decimal);this._decimal.lastIndex=0;const a=u.search(this._minusSign);let o;if(this._minusSign.lastIndex=0,n.isMinusSign)0===s&&(o=u,-1!==a&&0===r||(o=this.insertText(u,e,0,r)),this.updateValue(t,o,e,"insert"));else if(n.isDecimalSign)l>0&&s===l?this.updateValue(t,u,e,"insert"):(l>s&&l<r||-1===l&&this.maxFractionDigits)&&(o=this.insertText(u,e,s,r),this.updateValue(t,o,e,"insert"));else{const n=this.numberFormat.resolvedOptions().maximumFractionDigits,i=s!==r?"range-insert":"insert";l>0&&s>l?s+e.length-(l+1)<=n&&(o=u.slice(0,s)+e+u.slice(s+e.length),this.updateValue(t,o,e,i)):(o=this.insertText(u,e,s,r),this.updateValue(t,o,e,i))}},insertText(t,e,n,i){if(2===("."===e?e:e.split(".")).length){const s=t.slice(n,i).search(this._decimal);return this._decimal.lastIndex=0,s>0?t.slice(0,n)+this.formatValue(e)+t.slice(i):t||this.formatValue(e)}return i-n===t.length?this.formatValue(e):0===n?e+t.slice(i):i===t.length?t.slice(0,n)+e:t.slice(0,n)+e+t.slice(i)},deleteRange(t,e,n){let i;return i=n-e===t.length?"":0===e?t.slice(n):n===t.length?t.slice(0,e):t.slice(0,e)+t.slice(n),i},initCursor(){let t=this.$refs.input.$el.selectionStart,e=this.$refs.input.$el.value,n=e.length,i=null,s=e.charAt(t);if(this.isNumeralChar(s))return;let r=t-1;for(;r>=0;){if(s=e.charAt(r),this.isNumeralChar(s)){i=r;break}r--}if(null!==i)this.$refs.input.$el.setSelectionRange(i+1,i+1);else{for(r=t+1;r<n;){if(s=e.charAt(r),this.isNumeralChar(s)){i=r;break}r++}null!==i&&this.$refs.input.$el.setSelectionRange(i,i)}},onInputClick(){this.initCursor()},isNumeralChar(t){return!(1!==t.length||!(this._numeral.test(t)||this._decimal.test(t)||this._group.test(t)||this._minusSign.test(t)))&&(this.resetRegex(),!0)},resetRegex(){this._numeral.lastIndex=0,this._decimal.lastIndex=0,this._group.lastIndex=0,this._minusSign.lastIndex=0},updateValue(t,e,n,i){let s=this.$refs.input.$el.value,r=null;null!=e&&(r=this.parseValue(e),this.updateInput(r,n,i,e),this.handleOnInput(t,s,r))},handleOnInput(t,e,n){this.isValueChanged(e,n)&&this.$emit("input",{originalEvent:t,value:n})},isValueChanged(t,e){if(null===e&&null!==t)return!0;if(null!=e){return e!==("string"==typeof t?this.parseValue(t):t)}return!1},validateValue(t){return null!=this.min&&t<this.min?this.min:null!=this.max&&t>this.max?this.max:"-"===t?null:t},updateInput(t,e,n,i){e=e||"";let s=this.$refs.input.$el.value,r=this.formatValue(t),u=s.length;if(r!==i&&(r=this.concatValues(r,i)),0===u){this.$refs.input.$el.value=r,this.$refs.input.$el.setSelectionRange(0,0),this.initCursor();const t=(this.prefixChar||"").length+e.length;this.$refs.input.$el.setSelectionRange(t,t)}else{let t=this.$refs.input.$el.selectionStart,i=this.$refs.input.$el.selectionEnd;this.$refs.input.$el.value=r;let l=r.length;if("range-insert"===n){const n=this.parseValue((s||"").slice(0,t)),u=(null!==n?n.toString():"").split("").join(`(${this.groupChar})?`),l=new RegExp(u,"g");l.test(r);const a=e.split("").join(`(${this.groupChar})?`),o=new RegExp(a,"g");o.test(r.slice(l.lastIndex)),i=l.lastIndex+o.lastIndex,this.$refs.input.$el.setSelectionRange(i,i)}else if(l===u)"insert"===n||"delete-back-single"===n?this.$refs.input.$el.setSelectionRange(i+1,i+1):"delete-single"===n?this.$refs.input.$el.setSelectionRange(i-1,i-1):"delete-range"!==n&&"spin"!==n||this.$refs.input.$el.setSelectionRange(i,i);else if("delete-back-single"===n){let t=s.charAt(i-1),e=s.charAt(i),n=u-l,r=this._group.test(e);r&&1===n?i+=1:!r&&this.isNumeralChar(t)&&(i+=-1*n+1),this._group.lastIndex=0,this.$refs.input.$el.setSelectionRange(i,i)}else i+=l-u,this.$refs.input.$el.setSelectionRange(i,i)}this.$refs.input.$el.setAttribute("aria-valuenow",t)},concatValues(t,e){if(t&&e){let n=e.search(this._decimal);return this._decimal.lastIndex=0,t.split(this._decimal)[0]+(-1!==n?e.slice(n):"")}return t},getDecimalLength(t){if(t){const e=t.split(this._decimal);return 2===e.length?e[1].length:0}return 0},updateModel(t,e){this.$emit("update:modelValue",e)},onInputFocus(){this.focused=!0},onInputBlur(t){this.focused=!1;let e=t.target,n=this.validateValue(this.parseValue(e.value));e.value=this.formatValue(n),e.setAttribute("aria-valuenow",n),this.updateModel(t,n)},clearTimer(){this.timer&&clearInterval(this.timer)}},computed:{containerClass(){return["p-inputnumber p-component p-inputwrapper",this.class,{"p-inputwrapper-filled":this.filled,"p-inputwrapper-focus":this.focused,"p-inputnumber-buttons-stacked":this.showButtons&&"stacked"===this.buttonLayout,"p-inputnumber-buttons-horizontal":this.showButtons&&"horizontal"===this.buttonLayout,"p-inputnumber-buttons-vertical":this.showButtons&&"vertical"===this.buttonLayout}]},upButtonClass(){return["p-inputnumber-button p-inputnumber-button-up",this.incrementButtonClass]},downButtonClass(){return["p-inputnumber-button p-inputnumber-button-down",this.decrementButtonClass]},filled(){return null!=this.modelValue&&this.modelValue.toString().length>0},upButtonListeners(){return{mousedown:t=>this.onUpButtonMouseDown(t),mouseup:t=>this.onUpButtonMouseUp(t),mouseleave:t=>this.onUpButtonMouseLeave(t),keydown:t=>this.onUpButtonKeyDown(t),keyup:t=>this.onUpButtonKeyUp(t)}},downButtonListeners(){return{mousedown:t=>this.onDownButtonMouseDown(t),mouseup:t=>this.onDownButtonMouseUp(t),mouseleave:t=>this.onDownButtonMouseLeave(t),keydown:t=>this.onDownButtonKeyDown(t),keyup:t=>this.onDownButtonKeyUp(t)}},formattedValue(){return this.formatValue(this.modelValue)}},components:{INInputText:s.default,INButton:r.default}};const l={key:0,class:"p-inputnumber-button-group"};return function(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===n&&i.firstChild?i.insertBefore(s,i.firstChild):i.appendChild(s),s.styleSheet?s.styleSheet.cssText=t:s.appendChild(document.createTextNode(t))}}("\n.p-inputnumber {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n}\n.p-inputnumber-button {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-box-flex: 0;\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n}\n.p-inputnumber-buttons-stacked .p-button.p-inputnumber-button .p-button-label,\n.p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button .p-button-label {\n display: none;\n}\n.p-inputnumber-buttons-stacked .p-button.p-inputnumber-button-up {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n padding: 0;\n}\n.p-inputnumber-buttons-stacked .p-inputnumber-input {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n.p-inputnumber-buttons-stacked .p-button.p-inputnumber-button-down {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n border-bottom-left-radius: 0;\n padding: 0;\n}\n.p-inputnumber-buttons-stacked .p-inputnumber-button-group {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.p-inputnumber-buttons-stacked .p-inputnumber-button-group .p-button.p-inputnumber-button {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n}\n.p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-up {\n -webkit-box-ordinal-group: 4;\n -ms-flex-order: 3;\n order: 3;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n.p-inputnumber-buttons-horizontal .p-inputnumber-input {\n -webkit-box-ordinal-group: 3;\n -ms-flex-order: 2;\n order: 2;\n border-radius: 0;\n}\n.p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-down {\n -webkit-box-ordinal-group: 2;\n -ms-flex-order: 1;\n order: 1;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n.p-inputnumber-buttons-vertical {\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-up {\n -webkit-box-ordinal-group: 2;\n -ms-flex-order: 1;\n order: 1;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n width: 100%;\n}\n.p-inputnumber-buttons-vertical .p-inputnumber-input {\n -webkit-box-ordinal-group: 3;\n -ms-flex-order: 2;\n order: 2;\n border-radius: 0;\n text-align: center;\n}\n.p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-down {\n -webkit-box-ordinal-group: 4;\n -ms-flex-order: 3;\n order: 3;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n width: 100%;\n}\n.p-inputnumber-input {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n}\n.p-fluid .p-inputnumber {\n width: 100%;\n}\n.p-fluid .p-inputnumber .p-inputnumber-input {\n width: 1%;\n}\n.p-fluid .p-inputnumber-buttons-vertical .p-inputnumber-input {\n width: 100%;\n}\n"),u.render=function(t,e,i,s,r,u){const a=n.resolveComponent("INInputText"),o=n.resolveComponent("INButton");return n.openBlock(),n.createBlock("span",{class:u.containerClass,style:i.style},[n.createVNode(a,n.mergeProps({ref:"input",class:["p-inputnumber-input",i.inputClass],style:i.inputStyle,value:u.formattedValue},t.$attrs,{"aria-valumin":i.min,"aria-valuemax":i.max,onInput:u.onUserInput,onKeydown:u.onInputKeyDown,onKeypress:u.onInputKeyPress,onPaste:u.onPaste,onClick:u.onInputClick,onFocus:u.onInputFocus,onBlur:u.onInputBlur}),null,16,["class","style","value","aria-valumin","aria-valuemax","onInput","onKeydown","onKeypress","onPaste","onClick","onFocus","onBlur"]),i.showButtons&&"stacked"===i.buttonLayout?(n.openBlock(),n.createBlock("span",l,[n.createVNode(o,n.mergeProps({class:u.upButtonClass,icon:i.incrementButtonIcon},n.toHandlers(u.upButtonListeners),{disabled:t.$attrs.disabled}),null,16,["class","icon","disabled"]),n.createVNode(o,n.mergeProps({class:u.downButtonClass,icon:i.decrementButtonIcon},n.toHandlers(u.downButtonListeners),{disabled:t.$attrs.disabled}),null,16,["class","icon","disabled"])])):n.createCommentVNode("",!0),i.showButtons&&"stacked"!==i.buttonLayout?(n.openBlock(),n.createBlock(o,n.mergeProps({key:1,class:u.upButtonClass,icon:i.incrementButtonIcon},n.toHandlers(u.upButtonListeners),{disabled:t.$attrs.disabled}),null,16,["class","icon","disabled"])):n.createCommentVNode("",!0),i.showButtons&&"stacked"!==i.buttonLayout?(n.openBlock(),n.createBlock(o,n.mergeProps({key:2,class:u.downButtonClass,icon:i.decrementButtonIcon},n.toHandlers(u.downButtonListeners),{disabled:t.$attrs.disabled}),null,16,["class","icon","disabled"])):n.createCommentVNode("",!0)],6)},u}(primevue.inputtext,primevue.button,Vue);
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.inputnumber=function(e,t,n){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=i(e),r=i(t),u={name:"InputNumber",inheritAttrs:!1,emits:["update:modelValue","input"],props:{modelValue:{type:Number,default:null},format:{type:Boolean,default:!0},showButtons:{type:Boolean,default:!1},buttonLayout:{type:String,default:"stacked"},incrementButtonClass:{type:String,default:null},decrementButtonClass:{type:String,default:null},incrementButtonIcon:{type:String,default:"pi pi-angle-up"},decrementButtonIcon:{type:String,default:"pi pi-angle-down"},locale:{type:String,default:void 0},localeMatcher:{type:String,default:void 0},mode:{type:String,default:"decimal"},prefix:{type:String,default:null},suffix:{type:String,default:null},currency:{type:String,default:void 0},currencyDisplay:{type:String,default:void 0},useGrouping:{type:Boolean,default:!0},minFractionDigits:{type:Number,default:void 0},maxFractionDigits:{type:Number,default:void 0},min:{type:Number,default:null},max:{type:Number,default:null},step:{type:Number,default:1},allowEmpty:{type:Boolean,default:!0},style:null,class:null,inputStyle:null,inputClass:null},numberFormat:null,_numeral:null,_decimal:null,_group:null,_minusSign:null,_currency:null,_suffix:null,_prefix:null,_index:null,groupChar:"",isSpecialChar:null,prefixChar:null,suffixChar:null,timer:null,data:()=>({focused:!1}),watch:{locale(e,t){this.updateConstructParser(e,t)},localeMatcher(e,t){this.updateConstructParser(e,t)},mode(e,t){this.updateConstructParser(e,t)},currency(e,t){this.updateConstructParser(e,t)},currencyDisplay(e,t){this.updateConstructParser(e,t)},useGrouping(e,t){this.updateConstructParser(e,t)},minFractionDigits(e,t){this.updateConstructParser(e,t)},maxFractionDigits(e,t){this.updateConstructParser(e,t)},suffix(e,t){this.updateConstructParser(e,t)},prefix(e,t){this.updateConstructParser(e,t)}},created(){this.constructParser()},methods:{getOptions(){return{localeMatcher:this.localeMatcher,style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay,useGrouping:this.useGrouping,minimumFractionDigits:this.minFractionDigits,maximumFractionDigits:this.maxFractionDigits}},constructParser(){this.numberFormat=new Intl.NumberFormat(this.locale,this.getOptions());const e=[...new Intl.NumberFormat(this.locale,{useGrouping:!1}).format(9876543210)].reverse(),t=new Map(e.map(((e,t)=>[e,t])));this._numeral=new RegExp(`[${e.join("")}]`,"g"),this._group=this.getGroupingExpression(),this._minusSign=this.getMinusSignExpression(),this._currency=this.getCurrencyExpression(),this._decimal=this.getDecimalExpression(),this._suffix=this.getSuffixExpression(),this._prefix=this.getPrefixExpression(),this._index=e=>t.get(e)},updateConstructParser(e,t){e!==t&&this.constructParser()},escapeRegExp:e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),getDecimalExpression(){const e=new Intl.NumberFormat(this.locale,{...this.getOptions(),useGrouping:!1});return new RegExp(`[${e.format(1.1).replace(this._currency,"").trim().replace(this._numeral,"")}]`,"g")},getGroupingExpression(){const e=new Intl.NumberFormat(this.locale,{useGrouping:!0});return this.groupChar=e.format(1e6).trim().replace(this._numeral,"").charAt(0),new RegExp(`[${this.groupChar}]`,"g")},getMinusSignExpression(){const e=new Intl.NumberFormat(this.locale,{useGrouping:!1});return new RegExp(`[${e.format(-1).trim().replace(this._numeral,"")}]`,"g")},getCurrencyExpression(){if(this.currency){const e=new Intl.NumberFormat(this.locale,{style:"currency",currency:this.currency,currencyDisplay:this.currencyDisplay,minimumFractionDigits:0,maximumFractionDigits:0});return new RegExp(`[${e.format(1).replace(/\s/g,"").replace(this._numeral,"").replace(this._group,"")}]`,"g")}return new RegExp("[]","g")},getPrefixExpression(){if(this.prefix)this.prefixChar=this.prefix;else{const e=new Intl.NumberFormat(this.locale,{style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay});this.prefixChar=e.format(1).split("1")[0]}return new RegExp(`${this.escapeRegExp(this.prefixChar||"")}`,"g")},getSuffixExpression(){if(this.suffix)this.suffixChar=this.suffix;else{const e=new Intl.NumberFormat(this.locale,{style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay,minimumFractionDigits:0,maximumFractionDigits:0});this.suffixChar=e.format(1).split("1")[1]}return new RegExp(`${this.escapeRegExp(this.suffixChar||"")}`,"g")},formatValue(e){if(null!=e){if("-"===e)return e;if(this.format){let t=new Intl.NumberFormat(this.locale,this.getOptions()).format(e);return this.prefix&&(t=this.prefix+t),this.suffix&&(t+=this.suffix),t}return e.toString()}return""},parseValue(e){let t=e.replace(this._suffix,"").replace(this._prefix,"").trim().replace(/\s/g,"").replace(this._currency,"").replace(this._group,"").replace(this._minusSign,"-").replace(this._decimal,".").replace(this._numeral,this._index);if(t){if("-"===t)return t;let e=+t;return isNaN(e)?null:e}return null},repeat(e,t,n){let i=t||500;this.clearTimer(),this.timer=setTimeout((()=>{this.repeat(e,40,n)}),i),this.spin(e,n)},spin(e,t){if(this.$refs.input){let n=this.step*t,i=this.parseValue(this.$refs.input.$el.value)||0,s=this.validateValue(i+n);this.updateInput(s,null,"spin"),this.updateModel(e,s),this.handleOnInput(e,i,s)}},onUpButtonMouseDown(e){this.$attrs.disabled||(this.$refs.input.$el.focus(),this.repeat(e,null,1),e.preventDefault())},onUpButtonMouseUp(){this.$attrs.disabled||this.clearTimer()},onUpButtonMouseLeave(){this.$attrs.disabled||this.clearTimer()},onUpButtonKeyUp(){this.$attrs.disabled||this.clearTimer()},onUpButtonKeyDown(e){32!==e.keyCode&&13!==e.keyCode||this.repeat(e,null,1)},onDownButtonMouseDown(e){this.$attrs.disabled||(this.$refs.input.$el.focus(),this.repeat(e,null,-1),e.preventDefault())},onDownButtonMouseUp(){this.$attrs.disabled||this.clearTimer()},onDownButtonMouseLeave(){this.$attrs.disabled||this.clearTimer()},onDownButtonKeyUp(){this.$attrs.disabled||this.clearTimer()},onDownButtonKeyDown(e){32!==e.keyCode&&13!==e.keyCode||this.repeat(e,null,-1)},onUserInput(){this.isSpecialChar&&(this.$refs.input.$el.value=this.lastValue),this.isSpecialChar=!1},onInputKeyDown(e){if(this.lastValue=e.target.value,e.shiftKey||e.altKey)return void(this.isSpecialChar=!0);let t=e.target.selectionStart,n=e.target.selectionEnd,i=e.target.value,s=null;switch(e.altKey&&e.preventDefault(),e.which){case 38:this.spin(e,1),e.preventDefault();break;case 40:this.spin(e,-1),e.preventDefault();break;case 37:this.isNumeralChar(i.charAt(t-1))||e.preventDefault();break;case 39:this.isNumeralChar(i.charAt(t))||e.preventDefault();break;case 13:s=this.validateValue(this.parseValue(i)),this.$refs.input.$el.value=this.formatValue(s),this.$refs.input.$el.setAttribute("aria-valuenow",s),this.updateModel(e,s);break;case 8:if(e.preventDefault(),t===n){const n=i.charAt(t-1),{decimalCharIndex:r,decimalCharIndexWithoutPrefix:u}=this.getDecimalCharIndexes(i);if(this.isNumeralChar(n)){const e=this.getDecimalLength(i);if(this._group.test(n))this._group.lastIndex=0,s=i.slice(0,t-2)+i.slice(t-1);else if(this._decimal.test(n))this._decimal.lastIndex=0,e?this.$refs.input.$el.setSelectionRange(t-1,t-1):s=i.slice(0,t-1)+i.slice(t);else if(r>0&&t>r){const n=this.isDecimalMode()&&(this.minFractionDigits||0)<e?"":"0";s=i.slice(0,t-1)+n+i.slice(t)}else 1===u?(s=i.slice(0,t-1)+"0"+i.slice(t),s=this.parseValue(s)>0?s:""):s=i.slice(0,t-1)+i.slice(t)}this.updateValue(e,s,null,"delete-single")}else s=this.deleteRange(i,t,n),this.updateValue(e,s,null,"delete-range");break;case 46:if(e.preventDefault(),t===n){const n=i.charAt(t),{decimalCharIndex:r,decimalCharIndexWithoutPrefix:u}=this.getDecimalCharIndexes(i);if(this.isNumeralChar(n)){const e=this.getDecimalLength(i);if(this._group.test(n))this._group.lastIndex=0,s=i.slice(0,t)+i.slice(t+2);else if(this._decimal.test(n))this._decimal.lastIndex=0,e?this.$refs.input.$el.setSelectionRange(t+1,t+1):s=i.slice(0,t)+i.slice(t+1);else if(r>0&&t>r){const n=this.isDecimalMode()&&(this.minFractionDigits||0)<e?"":"0";s=i.slice(0,t)+n+i.slice(t+1)}else 1===u?(s=i.slice(0,t)+"0"+i.slice(t+1),s=this.parseValue(s)>0?s:""):s=i.slice(0,t)+i.slice(t+1)}this.updateValue(e,s,null,"delete-back-single")}else s=this.deleteRange(i,t,n),this.updateValue(e,s,null,"delete-range")}},onInputKeyPress(e){e.preventDefault();let t=e.which||e.keyCode,n=String.fromCharCode(t);const i=this.isDecimalSign(n),s=this.isMinusSign(n);(48<=t&&t<=57||s||i)&&this.insert(e,n,{isDecimalSign:i,isMinusSign:s})},onPaste(e){e.preventDefault();let t=(e.clipboardData||window.clipboardData).getData("Text");if(t){let n=this.parseValue(t);null!=n&&this.insert(e,n.toString())}},allowMinusSign(){return null===this.min||this.min<0},isMinusSign(e){return!(!this._minusSign.test(e)&&"-"!==e)&&(this._minusSign.lastIndex=0,!0)},isDecimalSign(e){return!!this._decimal.test(e)&&(this._decimal.lastIndex=0,!0)},isDecimalMode(){return"decimal"===this.mode},getDecimalCharIndexes(e){let t=e.search(this._decimal);this._decimal.lastIndex=0;const n=e.replace(this._prefix,"").trim().replace(/\s/g,"").replace(this._currency,"").search(this._decimal);return this._decimal.lastIndex=0,{decimalCharIndex:t,decimalCharIndexWithoutPrefix:n}},getCharIndexes(e){const t=e.search(this._decimal);this._decimal.lastIndex=0;const n=e.search(this._minusSign);this._minusSign.lastIndex=0;const i=e.search(this._suffix);this._suffix.lastIndex=0;const s=e.search(this._currency);return this._currency.lastIndex=0,{decimalCharIndex:t,minusCharIndex:n,suffixCharIndex:i,currencyCharIndex:s}},insert(e,t,n={isDecimalSign:!1,isMinusSign:!1}){const i=t.search(this._minusSign);if(this._minusSign.lastIndex=0,!this.allowMinusSign()&&-1!==i)return;const s=this.$refs.input.$el.selectionStart,r=this.$refs.input.$el.selectionEnd;let u=this.$refs.input.$el.value.trim();const{decimalCharIndex:l,minusCharIndex:a,suffixCharIndex:o,currencyCharIndex:p}=this.getCharIndexes(u);let c;if(n.isMinusSign)0===s&&(c=u,-1!==a&&0===r||(c=this.insertText(u,t,0,r)),this.updateValue(e,c,t,"insert"));else if(n.isDecimalSign)l>0&&s===l?this.updateValue(e,u,t,"insert"):(l>s&&l<r||-1===l&&this.maxFractionDigits)&&(c=this.insertText(u,t,s,r),this.updateValue(e,c,t,"insert"));else{const n=this.numberFormat.resolvedOptions().maximumFractionDigits,i=s!==r?"range-insert":"insert";if(l>0&&s>l){if(s+t.length-(l+1)<=n){const n=p>=s?p-1:o>=s?o:u.length;c=u.slice(0,s)+t+u.slice(s+t.length,n)+u.slice(n),this.updateValue(e,c,t,i)}}else c=this.insertText(u,t,s,r),this.updateValue(e,c,t,i)}},insertText(e,t,n,i){if(2===("."===t?t:t.split(".")).length){const s=e.slice(n,i).search(this._decimal);return this._decimal.lastIndex=0,s>0?e.slice(0,n)+this.formatValue(t)+e.slice(i):e||this.formatValue(t)}return i-n===e.length?this.formatValue(t):0===n?t+e.slice(i):i===e.length?e.slice(0,n)+t:e.slice(0,n)+t+e.slice(i)},deleteRange(e,t,n){let i;return i=n-t===e.length?"":0===t?e.slice(n):n===e.length?e.slice(0,t):e.slice(0,t)+e.slice(n),i},initCursor(){let e=this.$refs.input.$el.selectionStart,t=this.$refs.input.$el.value,n=t.length,i=null,s=(this.prefixChar||"").length;t=t.replace(this._prefix,""),e-=s;let r=t.charAt(e);if(this.isNumeralChar(r))return e+s;let u=e-1;for(;u>=0;){if(r=t.charAt(u),this.isNumeralChar(r)){i=u+s;break}u--}if(null!==i)this.$refs.input.$el.setSelectionRange(i+1,i+1);else{for(u=e;u<n;){if(r=t.charAt(u),this.isNumeralChar(r)){i=u+s;break}u++}null!==i&&this.$refs.input.$el.setSelectionRange(i,i)}return i||0},onInputClick(){this.initCursor()},isNumeralChar(e){return!(1!==e.length||!(this._numeral.test(e)||this._decimal.test(e)||this._group.test(e)||this._minusSign.test(e)))&&(this.resetRegex(),!0)},resetRegex(){this._numeral.lastIndex=0,this._decimal.lastIndex=0,this._group.lastIndex=0,this._minusSign.lastIndex=0},updateValue(e,t,n,i){let s=this.$refs.input.$el.value,r=null;null!=t&&(r=this.parseValue(t),r=r||this.allowEmpty?r:0,this.updateInput(r,n,i,t),this.handleOnInput(e,s,r))},handleOnInput(e,t,n){this.isValueChanged(t,n)&&this.$emit("input",{originalEvent:e,value:n})},isValueChanged(e,t){if(null===t&&null!==e)return!0;if(null!=t){return t!==("string"==typeof e?this.parseValue(e):e)}return!1},validateValue(e){return"-"===e||null==e?null:null!=this.min&&e<this.min?this.min:null!=this.max&&e>this.max?this.max:e},updateInput(e,t,n,i){t=t||"";let s=this.$refs.input.$el.value,r=this.formatValue(e),u=s.length;if(r!==i&&(r=this.concatValues(r,i)),0===u){this.$refs.input.$el.value=r,this.$refs.input.$el.setSelectionRange(0,0);const e=this.initCursor()+t.length;this.$refs.input.$el.setSelectionRange(e,e)}else{let e=this.$refs.input.$el.selectionStart,i=this.$refs.input.$el.selectionEnd;this.$refs.input.$el.value=r;let l=r.length;if("range-insert"===n){const n=this.parseValue((s||"").slice(0,e)),u=(null!==n?n.toString():"").split("").join(`(${this.groupChar})?`),l=new RegExp(u,"g");l.test(r);const a=t.split("").join(`(${this.groupChar})?`),o=new RegExp(a,"g");o.test(r.slice(l.lastIndex)),i=l.lastIndex+o.lastIndex,this.$refs.input.$el.setSelectionRange(i,i)}else if(l===u)"insert"===n||"delete-back-single"===n?this.$refs.input.$el.setSelectionRange(i+1,i+1):"delete-single"===n?this.$refs.input.$el.setSelectionRange(i-1,i-1):"delete-range"!==n&&"spin"!==n||this.$refs.input.$el.setSelectionRange(i,i);else if("delete-back-single"===n){let e=s.charAt(i-1),t=s.charAt(i),n=u-l,r=this._group.test(t);r&&1===n?i+=1:!r&&this.isNumeralChar(e)&&(i+=-1*n+1),this._group.lastIndex=0,this.$refs.input.$el.setSelectionRange(i,i)}else if("-"===s&&"insert"===n){this.$refs.input.$el.setSelectionRange(0,0);const e=this.initCursor()+t.length+1;this.$refs.input.$el.setSelectionRange(e,e)}else i+=l-u,this.$refs.input.$el.setSelectionRange(i,i)}this.$refs.input.$el.setAttribute("aria-valuenow",e)},concatValues(e,t){if(e&&t){let n=t.search(this._decimal);return this._decimal.lastIndex=0,-1!==n?e.split(this._decimal)[0]+t.slice(n):e}return e},getDecimalLength(e){if(e){const t=e.split(this._decimal);if(2===t.length)return t[1].replace(this._suffix,"").trim().replace(/\s/g,"").replace(this._currency,"").length}return 0},updateModel(e,t){this.$emit("update:modelValue",t)},onInputFocus(){this.focused=!0},onInputBlur(e){this.focused=!1;let t=e.target,n=this.validateValue(this.parseValue(t.value));t.value=this.formatValue(n),t.setAttribute("aria-valuenow",n),this.updateModel(e,n)},clearTimer(){this.timer&&clearInterval(this.timer)}},computed:{containerClass(){return["p-inputnumber p-component p-inputwrapper",this.class,{"p-inputwrapper-filled":this.filled,"p-inputwrapper-focus":this.focused,"p-inputnumber-buttons-stacked":this.showButtons&&"stacked"===this.buttonLayout,"p-inputnumber-buttons-horizontal":this.showButtons&&"horizontal"===this.buttonLayout,"p-inputnumber-buttons-vertical":this.showButtons&&"vertical"===this.buttonLayout}]},upButtonClass(){return["p-inputnumber-button p-inputnumber-button-up",this.incrementButtonClass]},downButtonClass(){return["p-inputnumber-button p-inputnumber-button-down",this.decrementButtonClass]},filled(){return null!=this.modelValue&&this.modelValue.toString().length>0},upButtonListeners(){return{mousedown:e=>this.onUpButtonMouseDown(e),mouseup:e=>this.onUpButtonMouseUp(e),mouseleave:e=>this.onUpButtonMouseLeave(e),keydown:e=>this.onUpButtonKeyDown(e),keyup:e=>this.onUpButtonKeyUp(e)}},downButtonListeners(){return{mousedown:e=>this.onDownButtonMouseDown(e),mouseup:e=>this.onDownButtonMouseUp(e),mouseleave:e=>this.onDownButtonMouseLeave(e),keydown:e=>this.onDownButtonKeyDown(e),keyup:e=>this.onDownButtonKeyUp(e)}},formattedValue(){const e=this.modelValue||this.allowEmpty?this.modelValue:0;return this.formatValue(e)},getFormatter(){return this.numberFormat}},components:{INInputText:s.default,INButton:r.default}};const l={key:0,class:"p-inputnumber-button-group"};return function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===n&&i.firstChild?i.insertBefore(s,i.firstChild):i.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}("\n.p-inputnumber {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n}\n.p-inputnumber-button {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-box-flex: 0;\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n}\n.p-inputnumber-buttons-stacked .p-button.p-inputnumber-button .p-button-label,\n.p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button .p-button-label {\n display: none;\n}\n.p-inputnumber-buttons-stacked .p-button.p-inputnumber-button-up {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n padding: 0;\n}\n.p-inputnumber-buttons-stacked .p-inputnumber-input {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n.p-inputnumber-buttons-stacked .p-button.p-inputnumber-button-down {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n border-bottom-left-radius: 0;\n padding: 0;\n}\n.p-inputnumber-buttons-stacked .p-inputnumber-button-group {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.p-inputnumber-buttons-stacked .p-inputnumber-button-group .p-button.p-inputnumber-button {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n}\n.p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-up {\n -webkit-box-ordinal-group: 4;\n -ms-flex-order: 3;\n order: 3;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n.p-inputnumber-buttons-horizontal .p-inputnumber-input {\n -webkit-box-ordinal-group: 3;\n -ms-flex-order: 2;\n order: 2;\n border-radius: 0;\n}\n.p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-down {\n -webkit-box-ordinal-group: 2;\n -ms-flex-order: 1;\n order: 1;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n.p-inputnumber-buttons-vertical {\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-up {\n -webkit-box-ordinal-group: 2;\n -ms-flex-order: 1;\n order: 1;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n width: 100%;\n}\n.p-inputnumber-buttons-vertical .p-inputnumber-input {\n -webkit-box-ordinal-group: 3;\n -ms-flex-order: 2;\n order: 2;\n border-radius: 0;\n text-align: center;\n}\n.p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-down {\n -webkit-box-ordinal-group: 4;\n -ms-flex-order: 3;\n order: 3;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n width: 100%;\n}\n.p-inputnumber-input {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n}\n.p-fluid .p-inputnumber {\n width: 100%;\n}\n.p-fluid .p-inputnumber .p-inputnumber-input {\n width: 1%;\n}\n.p-fluid .p-inputnumber-buttons-vertical .p-inputnumber-input {\n width: 100%;\n}\n"),u.render=function(e,t,i,s,r,u){const a=n.resolveComponent("INInputText"),o=n.resolveComponent("INButton");return n.openBlock(),n.createBlock("span",{class:u.containerClass,style:i.style},[n.createVNode(a,n.mergeProps({ref:"input",class:["p-inputnumber-input",i.inputClass],style:i.inputStyle,value:u.formattedValue},e.$attrs,{"aria-valumin":i.min,"aria-valuemax":i.max,onInput:u.onUserInput,onKeydown:u.onInputKeyDown,onKeypress:u.onInputKeyPress,onPaste:u.onPaste,onClick:u.onInputClick,onFocus:u.onInputFocus,onBlur:u.onInputBlur}),null,16,["class","style","value","aria-valumin","aria-valuemax","onInput","onKeydown","onKeypress","onPaste","onClick","onFocus","onBlur"]),i.showButtons&&"stacked"===i.buttonLayout?(n.openBlock(),n.createBlock("span",l,[n.createVNode(o,n.mergeProps({class:u.upButtonClass,icon:i.incrementButtonIcon},n.toHandlers(u.upButtonListeners),{disabled:e.$attrs.disabled}),null,16,["class","icon","disabled"]),n.createVNode(o,n.mergeProps({class:u.downButtonClass,icon:i.decrementButtonIcon},n.toHandlers(u.downButtonListeners),{disabled:e.$attrs.disabled}),null,16,["class","icon","disabled"])])):n.createCommentVNode("",!0),i.showButtons&&"stacked"!==i.buttonLayout?(n.openBlock(),n.createBlock(o,n.mergeProps({key:1,class:u.upButtonClass,icon:i.incrementButtonIcon},n.toHandlers(u.upButtonListeners),{disabled:e.$attrs.disabled}),null,16,["class","icon","disabled"])):n.createCommentVNode("",!0),i.showButtons&&"stacked"!==i.buttonLayout?(n.openBlock(),n.createBlock(o,n.mergeProps({key:2,class:u.downButtonClass,icon:i.decrementButtonIcon},n.toHandlers(u.downButtonListeners),{disabled:e.$attrs.disabled}),null,16,["class","icon","disabled"])):n.createCommentVNode("",!0)],6)},u}(primevue.inputtext,primevue.button,Vue);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="containerClass" @click="onClick($event)" :style="style">
|
|
3
3
|
<div class="p-hidden-accessible">
|
|
4
|
-
<input ref="input" type="checkbox" :checked="
|
|
5
|
-
role="switch" :aria-checked="
|
|
4
|
+
<input ref="input" type="checkbox" :checked="checked" v-bind="$attrs" @focus="onFocus($event)" @blur="onBlur($event)" @keydown.enter.prevent="onClick($event)"
|
|
5
|
+
role="switch" :aria-checked="checked">
|
|
6
6
|
</div>
|
|
7
7
|
<span class="p-inputswitch-slider"></span>
|
|
8
8
|
</div>
|
|
@@ -14,7 +14,10 @@ export default {
|
|
|
14
14
|
inheritAttrs: false,
|
|
15
15
|
emits: ['click', 'update:modelValue', 'change', 'input'],
|
|
16
16
|
props: {
|
|
17
|
-
modelValue:
|
|
17
|
+
modelValue: {
|
|
18
|
+
type: null,
|
|
19
|
+
default: false
|
|
20
|
+
},
|
|
18
21
|
class: null,
|
|
19
22
|
style: null,
|
|
20
23
|
trueValue: {
|
|
@@ -7,7 +7,10 @@ var script = {
|
|
|
7
7
|
inheritAttrs: false,
|
|
8
8
|
emits: ['click', 'update:modelValue', 'change', 'input'],
|
|
9
9
|
props: {
|
|
10
|
-
modelValue:
|
|
10
|
+
modelValue: {
|
|
11
|
+
type: null,
|
|
12
|
+
default: false
|
|
13
|
+
},
|
|
11
14
|
class: null,
|
|
12
15
|
style: null,
|
|
13
16
|
trueValue: {
|
|
@@ -73,13 +76,13 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
73
76
|
vue.createVNode("input", vue.mergeProps({
|
|
74
77
|
ref: "input",
|
|
75
78
|
type: "checkbox",
|
|
76
|
-
checked: $
|
|
79
|
+
checked: $options.checked
|
|
77
80
|
}, _ctx.$attrs, {
|
|
78
81
|
onFocus: _cache[1] || (_cache[1] = $event => ($options.onFocus($event))),
|
|
79
82
|
onBlur: _cache[2] || (_cache[2] = $event => ($options.onBlur($event))),
|
|
80
83
|
onKeydown: _cache[3] || (_cache[3] = vue.withKeys(vue.withModifiers($event => ($options.onClick($event)), ["prevent"]), ["enter"])),
|
|
81
84
|
role: "switch",
|
|
82
|
-
"aria-checked": $
|
|
85
|
+
"aria-checked": $options.checked
|
|
83
86
|
}), null, 16, ["checked", "aria-checked"])
|
|
84
87
|
]),
|
|
85
88
|
_hoisted_2
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("vue"),t={name:"InputSwitch",inheritAttrs:!1,emits:["click","update:modelValue","change","input"],props:{modelValue:
|
|
1
|
+
"use strict";var e=require("vue"),t={name:"InputSwitch",inheritAttrs:!1,emits:["click","update:modelValue","change","input"],props:{modelValue:{type:null,default:!1},class:null,style:null,trueValue:{type:null,default:!0},falseValue:{type:null,default:!1}},data:()=>({focused:!1}),methods:{onClick(e){if(!this.$attrs.disabled){const t=this.checked?this.falseValue:this.trueValue;this.$emit("click",e),this.$emit("update:modelValue",t),this.$emit("change",e),this.$emit("input",t),this.$refs.input.focus()}e.preventDefault()},onFocus(){this.focused=!0},onBlur(){this.focused=!1}},computed:{containerClass(){return["p-inputswitch p-component",this.class,{"p-inputswitch-checked":this.checked,"p-disabled":this.$attrs.disabled,"p-focus":this.focused}]},checked(){return this.modelValue===this.trueValue}}};const n={class:"p-hidden-accessible"},s=e.createVNode("span",{class:"p-inputswitch-slider"},null,-1);!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var s=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&s.firstChild?s.insertBefore(i,s.firstChild):s.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}('\n.p-inputswitch {\n position: relative;\n display: inline-block;\n}\n.p-inputswitch-slider {\n position: absolute;\n cursor: pointer;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n}\n.p-inputswitch-slider:before {\n position: absolute;\n content: "";\n top: 50%;\n}\n'),t.render=function(t,i,c,l,o,u){return e.openBlock(),e.createBlock("div",{class:u.containerClass,onClick:i[4]||(i[4]=e=>u.onClick(e)),style:c.style},[e.createVNode("div",n,[e.createVNode("input",e.mergeProps({ref:"input",type:"checkbox",checked:u.checked},t.$attrs,{onFocus:i[1]||(i[1]=e=>u.onFocus(e)),onBlur:i[2]||(i[2]=e=>u.onBlur(e)),onKeydown:i[3]||(i[3]=e.withKeys(e.withModifiers((e=>u.onClick(e)),["prevent"]),["enter"])),role:"switch","aria-checked":u.checked}),null,16,["checked","aria-checked"])]),s],6)},module.exports=t;
|
|
@@ -5,7 +5,10 @@ var script = {
|
|
|
5
5
|
inheritAttrs: false,
|
|
6
6
|
emits: ['click', 'update:modelValue', 'change', 'input'],
|
|
7
7
|
props: {
|
|
8
|
-
modelValue:
|
|
8
|
+
modelValue: {
|
|
9
|
+
type: null,
|
|
10
|
+
default: false
|
|
11
|
+
},
|
|
9
12
|
class: null,
|
|
10
13
|
style: null,
|
|
11
14
|
trueValue: {
|
|
@@ -71,13 +74,13 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
71
74
|
createVNode("input", mergeProps({
|
|
72
75
|
ref: "input",
|
|
73
76
|
type: "checkbox",
|
|
74
|
-
checked: $
|
|
77
|
+
checked: $options.checked
|
|
75
78
|
}, _ctx.$attrs, {
|
|
76
79
|
onFocus: _cache[1] || (_cache[1] = $event => ($options.onFocus($event))),
|
|
77
80
|
onBlur: _cache[2] || (_cache[2] = $event => ($options.onBlur($event))),
|
|
78
81
|
onKeydown: _cache[3] || (_cache[3] = withKeys(withModifiers($event => ($options.onClick($event)), ["prevent"]), ["enter"])),
|
|
79
82
|
role: "switch",
|
|
80
|
-
"aria-checked": $
|
|
83
|
+
"aria-checked": $options.checked
|
|
81
84
|
}), null, 16, ["checked", "aria-checked"])
|
|
82
85
|
]),
|
|
83
86
|
_hoisted_2
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{openBlock as e,createBlock as t,createVNode as n,mergeProps as i,withKeys as s,withModifiers as l}from"vue";var c={name:"InputSwitch",inheritAttrs:!1,emits:["click","update:modelValue","change","input"],props:{modelValue:
|
|
1
|
+
import{openBlock as e,createBlock as t,createVNode as n,mergeProps as i,withKeys as s,withModifiers as l}from"vue";var c={name:"InputSwitch",inheritAttrs:!1,emits:["click","update:modelValue","change","input"],props:{modelValue:{type:null,default:!1},class:null,style:null,trueValue:{type:null,default:!0},falseValue:{type:null,default:!1}},data:()=>({focused:!1}),methods:{onClick(e){if(!this.$attrs.disabled){const t=this.checked?this.falseValue:this.trueValue;this.$emit("click",e),this.$emit("update:modelValue",t),this.$emit("change",e),this.$emit("input",t),this.$refs.input.focus()}e.preventDefault()},onFocus(){this.focused=!0},onBlur(){this.focused=!1}},computed:{containerClass(){return["p-inputswitch p-component",this.class,{"p-inputswitch-checked":this.checked,"p-disabled":this.$attrs.disabled,"p-focus":this.focused}]},checked(){return this.modelValue===this.trueValue}}};const o={class:"p-hidden-accessible"},u=n("span",{class:"p-inputswitch-slider"},null,-1);!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===n&&i.firstChild?i.insertBefore(s,i.firstChild):i.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}('\n.p-inputswitch {\n position: relative;\n display: inline-block;\n}\n.p-inputswitch-slider {\n position: absolute;\n cursor: pointer;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n}\n.p-inputswitch-slider:before {\n position: absolute;\n content: "";\n top: 50%;\n}\n'),c.render=function(c,d,a,r,p,h){return e(),t("div",{class:h.containerClass,onClick:d[4]||(d[4]=e=>h.onClick(e)),style:a.style},[n("div",o,[n("input",i({ref:"input",type:"checkbox",checked:h.checked},c.$attrs,{onFocus:d[1]||(d[1]=e=>h.onFocus(e)),onBlur:d[2]||(d[2]=e=>h.onBlur(e)),onKeydown:d[3]||(d[3]=s(l((e=>h.onClick(e)),["prevent"]),["enter"])),role:"switch","aria-checked":h.checked}),null,16,["checked","aria-checked"])]),u],6)};export default c;
|
|
@@ -7,7 +7,10 @@ this.primevue.inputswitch = (function (vue) {
|
|
|
7
7
|
inheritAttrs: false,
|
|
8
8
|
emits: ['click', 'update:modelValue', 'change', 'input'],
|
|
9
9
|
props: {
|
|
10
|
-
modelValue:
|
|
10
|
+
modelValue: {
|
|
11
|
+
type: null,
|
|
12
|
+
default: false
|
|
13
|
+
},
|
|
11
14
|
class: null,
|
|
12
15
|
style: null,
|
|
13
16
|
trueValue: {
|
|
@@ -73,13 +76,13 @@ this.primevue.inputswitch = (function (vue) {
|
|
|
73
76
|
vue.createVNode("input", vue.mergeProps({
|
|
74
77
|
ref: "input",
|
|
75
78
|
type: "checkbox",
|
|
76
|
-
checked: $
|
|
79
|
+
checked: $options.checked
|
|
77
80
|
}, _ctx.$attrs, {
|
|
78
81
|
onFocus: _cache[1] || (_cache[1] = $event => ($options.onFocus($event))),
|
|
79
82
|
onBlur: _cache[2] || (_cache[2] = $event => ($options.onBlur($event))),
|
|
80
83
|
onKeydown: _cache[3] || (_cache[3] = vue.withKeys(vue.withModifiers($event => ($options.onClick($event)), ["prevent"]), ["enter"])),
|
|
81
84
|
role: "switch",
|
|
82
|
-
"aria-checked": $
|
|
85
|
+
"aria-checked": $options.checked
|
|
83
86
|
}), null, 16, ["checked", "aria-checked"])
|
|
84
87
|
]),
|
|
85
88
|
_hoisted_2
|
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.inputswitch=function(e){"use strict";var t={name:"InputSwitch",inheritAttrs:!1,emits:["click","update:modelValue","change","input"],props:{modelValue:
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.inputswitch=function(e){"use strict";var t={name:"InputSwitch",inheritAttrs:!1,emits:["click","update:modelValue","change","input"],props:{modelValue:{type:null,default:!1},class:null,style:null,trueValue:{type:null,default:!0},falseValue:{type:null,default:!1}},data:()=>({focused:!1}),methods:{onClick(e){if(!this.$attrs.disabled){const t=this.checked?this.falseValue:this.trueValue;this.$emit("click",e),this.$emit("update:modelValue",t),this.$emit("change",e),this.$emit("input",t),this.$refs.input.focus()}e.preventDefault()},onFocus(){this.focused=!0},onBlur(){this.focused=!1}},computed:{containerClass(){return["p-inputswitch p-component",this.class,{"p-inputswitch-checked":this.checked,"p-disabled":this.$attrs.disabled,"p-focus":this.focused}]},checked(){return this.modelValue===this.trueValue}}};const i={class:"p-hidden-accessible"},n=e.createVNode("span",{class:"p-inputswitch-slider"},null,-1);return function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===i&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}('\n.p-inputswitch {\n position: relative;\n display: inline-block;\n}\n.p-inputswitch-slider {\n position: absolute;\n cursor: pointer;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n}\n.p-inputswitch-slider:before {\n position: absolute;\n content: "";\n top: 50%;\n}\n'),t.render=function(t,s,c,l,o,u){return e.openBlock(),e.createBlock("div",{class:u.containerClass,onClick:s[4]||(s[4]=e=>u.onClick(e)),style:c.style},[e.createVNode("div",i,[e.createVNode("input",e.mergeProps({ref:"input",type:"checkbox",checked:u.checked},t.$attrs,{onFocus:s[1]||(s[1]=e=>u.onFocus(e)),onBlur:s[2]||(s[2]=e=>u.onBlur(e)),onKeydown:s[3]||(s[3]=e.withKeys(e.withModifiers((e=>u.onClick(e)),["prevent"]),["enter"])),role:"switch","aria-checked":u.checked}),null,16,["checked","aria-checked"])]),n],6)},t}(Vue);
|
package/knob/Knob.vue
CHANGED
package/knob/knob.cjs.js
CHANGED
|
@@ -199,7 +199,7 @@ var script = {
|
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
};
|
|
202
|
-
//
|
|
202
|
+
//Derived and forked from https://github.com/kramer99/vue-knob-control
|
|
203
203
|
|
|
204
204
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
205
205
|
return (vue.openBlock(), vue.createBlock("div", { class: $options.containerClass }, [
|
package/knob/knob.esm.js
CHANGED
|
@@ -197,7 +197,7 @@ var script = {
|
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
};
|
|
200
|
-
//
|
|
200
|
+
//Derived and forked from https://github.com/kramer99/vue-knob-control
|
|
201
201
|
|
|
202
202
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
203
203
|
return (openBlock(), createBlock("div", { class: $options.containerClass }, [
|
package/knob/knob.js
CHANGED
|
@@ -199,7 +199,7 @@ this.primevue.knob = (function (vue) {
|
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
};
|
|
202
|
-
//
|
|
202
|
+
//Derived and forked from https://github.com/kramer99/vue-knob-control
|
|
203
203
|
|
|
204
204
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
205
205
|
return (vue.openBlock(), vue.createBlock("div", { class: $options.containerClass }, [
|