primevue 4.2.2 → 4.2.3

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.
Files changed (72) hide show
  1. package/autocomplete/AutoComplete.vue +1 -1
  2. package/autocomplete/index.mjs +2 -1
  3. package/autocomplete/index.mjs.map +1 -1
  4. package/colorpicker/ColorPicker.vue +1 -1
  5. package/colorpicker/index.mjs +1 -0
  6. package/colorpicker/index.mjs.map +1 -1
  7. package/datatable/BodyCell.vue +2 -11
  8. package/datatable/DataTable.vue +3 -24
  9. package/datatable/FooterCell.vue +3 -12
  10. package/datatable/HeaderCell.vue +2 -11
  11. package/datatable/index.mjs +49 -98
  12. package/datatable/index.mjs.map +1 -1
  13. package/datatable/style/index.mjs +1 -1
  14. package/datatable/style/index.mjs.map +1 -1
  15. package/datepicker/DatePicker.vue +1 -1
  16. package/datepicker/index.mjs +1 -1
  17. package/datepicker/index.mjs.map +1 -1
  18. package/datepicker/style/index.mjs +1 -1
  19. package/datepicker/style/index.mjs.map +1 -1
  20. package/drawer/style/index.mjs +1 -1
  21. package/drawer/style/index.mjs.map +1 -1
  22. package/imagecompare/ImageCompare.vue +3 -33
  23. package/imagecompare/index.mjs +3 -35
  24. package/imagecompare/index.mjs.map +1 -1
  25. package/imagecompare/style/index.mjs +1 -1
  26. package/imagecompare/style/index.mjs.map +1 -1
  27. package/inputtext/index.d.ts +2 -2
  28. package/package.json +5 -5
  29. package/panelmenu/PanelMenu.vue +6 -3
  30. package/panelmenu/index.mjs +5 -2
  31. package/panelmenu/index.mjs.map +1 -1
  32. package/password/index.d.ts +1 -1
  33. package/scrollpanel/ScrollPanel.vue +4 -35
  34. package/scrollpanel/index.mjs +27 -57
  35. package/scrollpanel/index.mjs.map +1 -1
  36. package/scrollpanel/style/index.mjs +1 -1
  37. package/scrollpanel/style/index.mjs.map +1 -1
  38. package/select/Select.vue +1 -1
  39. package/select/index.mjs +1 -1
  40. package/select/index.mjs.map +1 -1
  41. package/slider/Slider.vue +7 -33
  42. package/slider/index.mjs +11 -47
  43. package/slider/index.mjs.map +1 -1
  44. package/splitter/Splitter.vue +3 -24
  45. package/splitter/index.mjs +21 -43
  46. package/splitter/index.mjs.map +1 -1
  47. package/step/Step.vue +2 -2
  48. package/step/index.mjs +2 -2
  49. package/step/index.mjs.map +1 -1
  50. package/tablist/TabList.vue +11 -43
  51. package/tablist/index.mjs +11 -42
  52. package/tablist/index.mjs.map +1 -1
  53. package/tabs/index.d.ts +3 -3
  54. package/textarea/index.d.ts +2 -3
  55. package/togglebutton/ToggleButton.vue +1 -1
  56. package/togglebutton/index.mjs +1 -1
  57. package/togglebutton/index.mjs.map +1 -1
  58. package/tree/Tree.vue +1 -1
  59. package/tree/index.mjs +29 -23
  60. package/tree/index.mjs.map +1 -1
  61. package/tree/style/index.mjs +1 -1
  62. package/tree/style/index.mjs.map +1 -1
  63. package/treetable/BodyCell.vue +2 -11
  64. package/treetable/FooterCell.vue +3 -12
  65. package/treetable/HeaderCell.vue +3 -12
  66. package/treetable/TreeTable.vue +3 -26
  67. package/treetable/index.mjs +24 -75
  68. package/treetable/index.mjs.map +1 -1
  69. package/treetable/style/index.mjs +1 -1
  70. package/treetable/style/index.mjs.map +1 -1
  71. package/umd/primevue.min.js +1 -1
  72. package/web-types.json +1 -1
@@ -6,8 +6,8 @@
6
6
  </template>
7
7
 
8
8
  <script>
9
+ import { getNextElementSibling, getOuterWidth, getPreviousElementSibling } from '@primeuix/utils/dom';
9
10
  import BaseComponent from '@primevue/core/basecomponent';
10
- import { getNextElementSibling, getPreviousElementSibling, getOuterWidth } from '@primeuix/utils/dom';
11
11
  import { getVNodeProp } from '@primevue/core/utils';
12
12
  import { mergeProps } from 'vue';
13
13
 
@@ -66,7 +66,6 @@ export default {
66
66
  },
67
67
  updateStickyPosition() {
68
68
  if (this.columnProp('frozen')) {
69
- let isRTL = this.$parentInstance.isRTL;
70
69
  let align = this.columnProp('alignFrozen');
71
70
 
72
71
  if (align === 'right') {
@@ -77,11 +76,7 @@ export default {
77
76
  pos = getOuterWidth(next) + parseFloat(next.style.right || 0);
78
77
  }
79
78
 
80
- if (isRTL) {
81
- this.styleObject.left = pos + 'px';
82
- } else {
83
- this.styleObject.right = pos + 'px';
84
- }
79
+ this.styleObject.insetInlineEnd = pos + 'px';
85
80
  } else {
86
81
  let pos = 0;
87
82
  let prev = getPreviousElementSibling(this.$el, '[data-p-frozen-column="true"]');
@@ -90,11 +85,7 @@ export default {
90
85
  pos = getOuterWidth(prev) + parseFloat(prev.style.left || 0);
91
86
  }
92
87
 
93
- if (isRTL) {
94
- this.styleObject.right = pos + 'px';
95
- } else {
96
- this.styleObject.left = pos + 'px';
97
- }
88
+ this.styleObject.insetInlineStart = pos + 'px';
98
89
  }
99
90
  }
100
91
  }
@@ -26,8 +26,8 @@
26
26
  </template>
27
27
 
28
28
  <script>
29
+ import { getAttribute, getIndex, getNextElementSibling, getOuterWidth, getPreviousElementSibling } from '@primeuix/utils/dom';
29
30
  import BaseComponent from '@primevue/core/basecomponent';
30
- import { getNextElementSibling, getPreviousElementSibling, getOuterWidth, getAttribute, getIndex } from '@primeuix/utils/dom';
31
31
  import { getVNodeProp } from '@primevue/core/utils';
32
32
  import SortAltIcon from '@primevue/icons/sortalt';
33
33
  import SortAmountDownIcon from '@primevue/icons/sortamountdown';
@@ -115,7 +115,6 @@ export default {
115
115
  },
116
116
  updateStickyPosition() {
117
117
  if (this.columnProp('frozen')) {
118
- let isRTL = this.$parentInstance.isRTL;
119
118
  let align = this.columnProp('alignFrozen');
120
119
 
121
120
  if (align === 'right') {
@@ -126,11 +125,7 @@ export default {
126
125
  pos = getOuterWidth(next) + parseFloat(next.style.right || 0);
127
126
  }
128
127
 
129
- if (isRTL) {
130
- this.styleObject.left = pos + 'px';
131
- } else {
132
- this.styleObject.right = pos + 'px';
133
- }
128
+ this.styleObject.insetInlineEnd = pos + 'px';
134
129
  } else {
135
130
  let pos = 0;
136
131
  let prev = getPreviousElementSibling(this.$el, '[data-p-frozen-column="true"]');
@@ -139,11 +134,7 @@ export default {
139
134
  pos = getOuterWidth(prev) + parseFloat(prev.style.left || 0);
140
135
  }
141
136
 
142
- if (isRTL) {
143
- this.styleObject.right = pos + 'px';
144
- } else {
145
- this.styleObject.left = pos + 'px';
146
- }
137
+ this.styleObject.insetInlineStart = pos + 'px';
147
138
  }
148
139
 
149
140
  let filterRow = this.$el.parentElement.nextElementSibling;
@@ -203,7 +203,7 @@
203
203
  </template>
204
204
 
205
205
  <script>
206
- import { addStyle, clearSelection, find, getAttribute, getIndex, getOffset, getOuterWidth, setAttribute } from '@primeuix/utils/dom';
206
+ import { addStyle, clearSelection, find, getAttribute, getIndex, getOffset, getOuterWidth, isRTL, setAttribute } from '@primeuix/utils/dom';
207
207
  import { localeComparator, resolveFieldData, sort } from '@primeuix/utils/object';
208
208
  import { FilterService } from '@primevue/core/api';
209
209
  import { getVNodeProp, HelperSet } from '@primevue/core/utils';
@@ -251,15 +251,13 @@ export default {
251
251
  d_sortOrder: this.sortOrder,
252
252
  d_multiSortMeta: this.multiSortMeta ? [...this.multiSortMeta] : [],
253
253
  hasASelectedNode: false,
254
- d_columns: new HelperSet({ type: 'Column' }),
255
- isRTL: false
254
+ d_columns: new HelperSet({ type: 'Column' })
256
255
  };
257
256
  },
258
257
  documentColumnResizeListener: null,
259
258
  documentColumnResizeEndListener: null,
260
259
  lastResizeHelperX: null,
261
260
  resizeColumnElement: null,
262
- mutationObserver: null,
263
261
  watch: {
264
262
  expandedKeys(newValue) {
265
263
  this.d_expandedKeys = newValue;
@@ -280,32 +278,11 @@ export default {
280
278
  this.d_multiSortMeta = newValue;
281
279
  }
282
280
  },
283
- mounted() {
284
- this.updateDirection();
285
- this.observeDirectionChanges();
286
- },
287
281
  beforeUnmount() {
288
282
  this.destroyStyleElement();
289
283
  this.d_columns.clear();
290
-
291
- if (this.mutationObserver) {
292
- this.mutationObserver.disconnect();
293
- }
294
284
  },
295
285
  methods: {
296
- updateDirection() {
297
- this.isRTL = !!this.$el.closest('[dir="rtl"]');
298
- },
299
- observeDirectionChanges() {
300
- const targetNode = document.documentElement;
301
- const config = { attributes: true, attributeFilter: ['dir'] };
302
-
303
- this.mutationObserver = new MutationObserver(() => {
304
- this.updateDirection();
305
- });
306
-
307
- this.mutationObserver.observe(targetNode, config);
308
- },
309
286
  columnProp(col, prop) {
310
287
  return getVNodeProp(col, prop);
311
288
  },
@@ -701,7 +678,7 @@ export default {
701
678
  this.$refs.resizeHelper.style.display = 'block';
702
679
  },
703
680
  onColumnResizeEnd() {
704
- let delta = this.isRTL ? this.lastResizeHelperX - this.$refs.resizeHelper.offsetLeft : this.$refs.resizeHelper.offsetLeft - this.lastResizeHelperX;
681
+ let delta = isRTL(this.$el) ? this.lastResizeHelperX - this.$refs.resizeHelper.offsetLeft : this.$refs.resizeHelper.offsetLeft - this.lastResizeHelperX;
705
682
  let columnWidth = this.resizeColumnElement.offsetWidth;
706
683
  let newColumnWidth = columnWidth + delta;
707
684
  let minWidth = this.resizeColumnElement.style.minWidth || 15;
@@ -1,4 +1,4 @@
1
- import { getNextElementSibling, getOuterWidth, getPreviousElementSibling, getIndex, getAttribute, isClickable, findSingle, focus, find, clearSelection, getOffset, addStyle, setAttribute } from '@primeuix/utils/dom';
1
+ import { getNextElementSibling, getOuterWidth, getPreviousElementSibling, getIndex, getAttribute, isClickable, findSingle, focus, find, clearSelection, getOffset, addStyle, isRTL, setAttribute } from '@primeuix/utils/dom';
2
2
  import { resolveFieldData, equals, localeComparator, sort } from '@primeuix/utils/object';
3
3
  import { FilterService } from '@primevue/core/api';
4
4
  import { getVNodeProp, HelperSet } from '@primevue/core/utils';
@@ -261,7 +261,6 @@ var script$4 = {
261
261
  },
262
262
  updateStickyPosition: function updateStickyPosition() {
263
263
  if (this.columnProp('frozen')) {
264
- var isRTL = this.$parentInstance.isRTL;
265
264
  var align = this.columnProp('alignFrozen');
266
265
  if (align === 'right') {
267
266
  var pos = 0;
@@ -269,22 +268,14 @@ var script$4 = {
269
268
  if (next) {
270
269
  pos = getOuterWidth(next) + parseFloat(next.style.right || 0);
271
270
  }
272
- if (isRTL) {
273
- this.styleObject.left = pos + 'px';
274
- } else {
275
- this.styleObject.right = pos + 'px';
276
- }
271
+ this.styleObject.insetInlineEnd = pos + 'px';
277
272
  } else {
278
273
  var _pos = 0;
279
274
  var prev = getPreviousElementSibling(this.$el, '[data-p-frozen-column="true"]');
280
275
  if (prev) {
281
276
  _pos = getOuterWidth(prev) + parseFloat(prev.style.left || 0);
282
277
  }
283
- if (isRTL) {
284
- this.styleObject.right = _pos + 'px';
285
- } else {
286
- this.styleObject.left = _pos + 'px';
287
- }
278
+ this.styleObject.insetInlineStart = _pos + 'px';
288
279
  }
289
280
  }
290
281
  }
@@ -408,7 +399,6 @@ var script$3 = {
408
399
  },
409
400
  updateStickyPosition: function updateStickyPosition() {
410
401
  if (this.columnProp('frozen')) {
411
- var isRTL = this.$parentInstance.isRTL;
412
402
  var align = this.columnProp('alignFrozen');
413
403
  if (align === 'right') {
414
404
  var pos = 0;
@@ -416,22 +406,14 @@ var script$3 = {
416
406
  if (next) {
417
407
  pos = getOuterWidth(next) + parseFloat(next.style.right || 0);
418
408
  }
419
- if (isRTL) {
420
- this.styleObject.left = pos + 'px';
421
- } else {
422
- this.styleObject.right = pos + 'px';
423
- }
409
+ this.styleObject.insetInlineEnd = pos + 'px';
424
410
  } else {
425
411
  var _pos = 0;
426
412
  var prev = getPreviousElementSibling(this.$el, '[data-p-frozen-column="true"]');
427
413
  if (prev) {
428
414
  _pos = getOuterWidth(prev) + parseFloat(prev.style.left || 0);
429
415
  }
430
- if (isRTL) {
431
- this.styleObject.right = _pos + 'px';
432
- } else {
433
- this.styleObject.left = _pos + 'px';
434
- }
416
+ this.styleObject.insetInlineStart = _pos + 'px';
435
417
  }
436
418
  var filterRow = this.$el.parentElement.nextElementSibling;
437
419
  if (filterRow) {
@@ -709,7 +691,6 @@ var script$2 = {
709
691
  },
710
692
  updateStickyPosition: function updateStickyPosition() {
711
693
  if (this.columnProp('frozen')) {
712
- var isRTL = this.$parentInstance.isRTL;
713
694
  var align = this.columnProp('alignFrozen');
714
695
  if (align === 'right') {
715
696
  var pos = 0;
@@ -717,22 +698,14 @@ var script$2 = {
717
698
  if (next) {
718
699
  pos = getOuterWidth(next) + parseFloat(next.style.right || 0);
719
700
  }
720
- if (isRTL) {
721
- this.styleObject.left = pos + 'px';
722
- } else {
723
- this.styleObject.right = pos + 'px';
724
- }
701
+ this.styleObject.insetInlineEnd = pos + 'px';
725
702
  } else {
726
703
  var _pos = 0;
727
704
  var prev = getPreviousElementSibling(this.$el, '[data-p-frozen-column="true"]');
728
705
  if (prev) {
729
706
  _pos = getOuterWidth(prev) + parseFloat(prev.style.left || 0);
730
707
  }
731
- if (isRTL) {
732
- this.styleObject.right = _pos + 'px';
733
- } else {
734
- this.styleObject.left = _pos + 'px';
735
- }
708
+ this.styleObject.insetInlineStart = _pos + 'px';
736
709
  }
737
710
  }
738
711
  },
@@ -1396,15 +1369,13 @@ var script = {
1396
1369
  hasASelectedNode: false,
1397
1370
  d_columns: new HelperSet({
1398
1371
  type: 'Column'
1399
- }),
1400
- isRTL: false
1372
+ })
1401
1373
  };
1402
1374
  },
1403
1375
  documentColumnResizeListener: null,
1404
1376
  documentColumnResizeEndListener: null,
1405
1377
  lastResizeHelperX: null,
1406
1378
  resizeColumnElement: null,
1407
- mutationObserver: null,
1408
1379
  watch: {
1409
1380
  expandedKeys: function expandedKeys(newValue) {
1410
1381
  this.d_expandedKeys = newValue;
@@ -1425,33 +1396,11 @@ var script = {
1425
1396
  this.d_multiSortMeta = newValue;
1426
1397
  }
1427
1398
  },
1428
- mounted: function mounted() {
1429
- this.updateDirection();
1430
- this.observeDirectionChanges();
1431
- },
1432
1399
  beforeUnmount: function beforeUnmount() {
1433
1400
  this.destroyStyleElement();
1434
1401
  this.d_columns.clear();
1435
- if (this.mutationObserver) {
1436
- this.mutationObserver.disconnect();
1437
- }
1438
1402
  },
1439
1403
  methods: {
1440
- updateDirection: function updateDirection() {
1441
- this.isRTL = !!this.$el.closest('[dir="rtl"]');
1442
- },
1443
- observeDirectionChanges: function observeDirectionChanges() {
1444
- var _this = this;
1445
- var targetNode = document.documentElement;
1446
- var config = {
1447
- attributes: true,
1448
- attributeFilter: ['dir']
1449
- };
1450
- this.mutationObserver = new MutationObserver(function () {
1451
- _this.updateDirection();
1452
- });
1453
- this.mutationObserver.observe(targetNode, config);
1454
- },
1455
1404
  columnProp: function columnProp(col, prop) {
1456
1405
  return getVNodeProp(col, prop);
1457
1406
  },
@@ -1634,13 +1583,13 @@ var script = {
1634
1583
  return this.sortNodesSingle(nodes);
1635
1584
  },
1636
1585
  sortNodesSingle: function sortNodesSingle(nodes) {
1637
- var _this2 = this;
1586
+ var _this = this;
1638
1587
  var _nodes = _toConsumableArray(nodes);
1639
1588
  var comparer = localeComparator();
1640
1589
  _nodes.sort(function (node1, node2) {
1641
- var value1 = resolveFieldData(node1.data, _this2.d_sortField);
1642
- var value2 = resolveFieldData(node2.data, _this2.d_sortField);
1643
- return sort(value1, value2, _this2.d_sortOrder, comparer);
1590
+ var value1 = resolveFieldData(node1.data, _this.d_sortField);
1591
+ var value2 = resolveFieldData(node2.data, _this.d_sortField);
1592
+ return sort(value1, value2, _this.d_sortOrder, comparer);
1644
1593
  });
1645
1594
  return _nodes;
1646
1595
  },
@@ -1648,10 +1597,10 @@ var script = {
1648
1597
  return this.sortNodesMultiple(nodes);
1649
1598
  },
1650
1599
  sortNodesMultiple: function sortNodesMultiple(nodes) {
1651
- var _this3 = this;
1600
+ var _this2 = this;
1652
1601
  var _nodes = _toConsumableArray(nodes);
1653
1602
  _nodes.sort(function (node1, node2) {
1654
- return _this3.multisortField(node1, node2, 0);
1603
+ return _this2.multisortField(node1, node2, 0);
1655
1604
  });
1656
1605
  return _nodes;
1657
1606
  },
@@ -1788,13 +1737,13 @@ var script = {
1788
1737
  return node.leaf === false ? false : !(node.children && node.children.length);
1789
1738
  },
1790
1739
  createLazyLoadEvent: function createLazyLoadEvent(event) {
1791
- var _this4 = this;
1740
+ var _this3 = this;
1792
1741
  var filterMatchModes;
1793
1742
  if (this.hasFilters()) {
1794
1743
  filterMatchModes = {};
1795
1744
  this.columns.forEach(function (col) {
1796
- if (_this4.columnProp(col, 'field')) {
1797
- filterMatchModes[col.props.field] = _this4.columnProp(col, 'filterMatchMode');
1745
+ if (_this3.columnProp(col, 'field')) {
1746
+ filterMatchModes[col.props.field] = _this3.columnProp(col, 'filterMatchMode');
1798
1747
  }
1799
1748
  });
1800
1749
  }
@@ -1828,7 +1777,7 @@ var script = {
1828
1777
  this.$refs.resizeHelper.style.display = 'block';
1829
1778
  },
1830
1779
  onColumnResizeEnd: function onColumnResizeEnd() {
1831
- var delta = this.isRTL ? this.lastResizeHelperX - this.$refs.resizeHelper.offsetLeft : this.$refs.resizeHelper.offsetLeft - this.lastResizeHelperX;
1780
+ var delta = isRTL(this.$el) ? this.lastResizeHelperX - this.$refs.resizeHelper.offsetLeft : this.$refs.resizeHelper.offsetLeft - this.lastResizeHelperX;
1832
1781
  var columnWidth = this.resizeColumnElement.offsetWidth;
1833
1782
  var newColumnWidth = columnWidth + delta;
1834
1783
  var minWidth = this.resizeColumnElement.style.minWidth || 15;
@@ -1879,19 +1828,19 @@ var script = {
1879
1828
  this.styleElement.innerHTML = innerHTML;
1880
1829
  },
1881
1830
  bindColumnResizeEvents: function bindColumnResizeEvents() {
1882
- var _this5 = this;
1831
+ var _this4 = this;
1883
1832
  if (!this.documentColumnResizeListener) {
1884
1833
  this.documentColumnResizeListener = document.addEventListener('mousemove', function (event) {
1885
- if (_this5.columnResizing) {
1886
- _this5.onColumnResize(event);
1834
+ if (_this4.columnResizing) {
1835
+ _this4.onColumnResize(event);
1887
1836
  }
1888
1837
  });
1889
1838
  }
1890
1839
  if (!this.documentColumnResizeEndListener) {
1891
1840
  this.documentColumnResizeEndListener = document.addEventListener('mouseup', function () {
1892
- if (_this5.columnResizing) {
1893
- _this5.columnResizing = false;
1894
- _this5.onColumnResizeEnd();
1841
+ if (_this4.columnResizing) {
1842
+ _this4.columnResizing = false;
1843
+ _this4.onColumnResizeEnd();
1895
1844
  }
1896
1845
  });
1897
1846
  }