tp-react-elements 3.0.11 → 3.0.13

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.
@@ -1,3 +1,3 @@
1
- var InputRangeField = {};
1
+ var DayCell = {};
2
2
 
3
- export { InputRangeField as __exports };
3
+ export { DayCell as __exports };
@@ -1,3 +1,3 @@
1
- var DayCell = {};
1
+ var Month = {};
2
2
 
3
- export { DayCell as __exports };
3
+ export { Month as __exports };
@@ -1,3 +1,3 @@
1
- var Month = {};
1
+ var InputRangeField = {};
2
2
 
3
- export { Month as __exports };
3
+ export { InputRangeField as __exports };
@@ -1,3 +1,3 @@
1
- var DateRange = {};
1
+ var Calendar = {};
2
2
 
3
- export { DateRange as __exports };
3
+ export { Calendar as __exports };
@@ -1,3 +1,3 @@
1
- var DateRangePicker = {};
1
+ var DateRange = {};
2
2
 
3
- export { DateRangePicker as __exports };
3
+ export { DateRange as __exports };
@@ -1,3 +1,3 @@
1
- var Calendar = {};
1
+ var DateRangePicker = {};
2
2
 
3
- export { Calendar as __exports };
3
+ export { DateRangePicker as __exports };
@@ -57,28 +57,6 @@ const RichTextEditor = ({ props }) => {
57
57
  openSearchDialog: 'ctrl+f',
58
58
  openReplaceDialog: 'ctrl+r',
59
59
  },
60
- events: {
61
- processPaste: (_event, html) => {
62
- const instance = editor.current;
63
- if (instance?.editor) {
64
- const joditEditor = instance.editor;
65
- joditEditor.selection?.insertHTML?.(html);
66
- joditEditor.tempContent = joditEditor.getHTML?.();
67
- }
68
- },
69
- afterPaste: () => {
70
- const instance = editor.current;
71
- if (instance?.editor) {
72
- const joditEditor = instance.editor;
73
- const el = document.createElement('div');
74
- el.innerHTML = joditEditor.tempContent
75
- ? joditEditor.tempContent
76
- : joditEditor.getHTML?.();
77
- joditEditor.setHTML?.(el.innerHTML);
78
- joditEditor.tempContent = null;
79
- }
80
- },
81
- },
82
60
  ...props.item.sx,
83
61
  }),
84
62
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -76,8 +76,27 @@ const extractSxColors = (sx) => {
76
76
  }
77
77
  return { background, text };
78
78
  };
79
- /** Converts a `#RRGGBB` hex string to the 8-char ARGB xlsx-js-style expects. Returns `undefined` for anything else. */
80
- const hexToArgb = (hex) => hex?.startsWith('#') ? 'FF' + hex.slice(1).toUpperCase().padEnd(6, '0') : undefined;
79
+ /**
80
+ * Converts a hex colour string to the 8-char ARGB `xlsx-js-style` expects.
81
+ * Handles both `#RRGGBB` and CSS shorthand `#RGB` (each digit doubled, e.g.
82
+ * `#fff` → `ffffff`) — shorthand was previously padded with trailing zeros
83
+ * instead of expanded, silently turning `#fff` into a bright yellow
84
+ * (`FFFFF000`) instead of white. An 8-digit `#RRGGBBAA` has its alpha
85
+ * channel dropped (this export always renders fully opaque). Returns
86
+ * `undefined` for anything else (non-hex/theme-token colours, etc.).
87
+ */
88
+ const hexToArgb = (hex) => {
89
+ if (!hex?.startsWith('#'))
90
+ return undefined;
91
+ let digits = hex.slice(1);
92
+ if (digits.length === 3 || digits.length === 4) {
93
+ digits = digits.slice(0, 3).split('').map((c) => c + c).join('');
94
+ }
95
+ else {
96
+ digits = digits.slice(0, 6);
97
+ }
98
+ return 'FF' + digits.toUpperCase().padEnd(6, '0');
99
+ };
81
100
  /**
82
101
  * Header overrides applied via GlobalStyles (literal prop values).
83
102
  * MRT sets `backgroundColor: 'inherit'` and fixed density padding — must use !important.
@@ -1,4 +1,4 @@
1
- import { __exports as Calendar } from '../../../../../_virtual/index.esm7.js';
1
+ import { __exports as Calendar } from '../../../../../_virtual/index.esm4.js';
2
2
  import require$$0__default from 'react';
3
3
  import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
4
4
  import { __require as requireDayCell } from '../DayCell/index.esm.js';
@@ -1,4 +1,4 @@
1
- import { __exports as DateRange } from '../../../../../_virtual/index.esm4.js';
1
+ import { __exports as DateRange } from '../../../../../_virtual/index.esm5.js';
2
2
  import require$$0__default from 'react';
3
3
  import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
4
4
  import { __require as requireCalendar } from '../Calendar/index.esm.js';
@@ -1,4 +1,4 @@
1
- import { __exports as DateRangePicker } from '../../../../../_virtual/index.esm5.js';
1
+ import { __exports as DateRangePicker } from '../../../../../_virtual/index.esm7.js';
2
2
  import require$$0__default from 'react';
3
3
  import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
4
4
  import { __require as requireDateRange } from '../DateRange/index.esm.js';
@@ -1,4 +1,4 @@
1
- import { __exports as DayCell } from '../../../../../_virtual/index.esm12.js';
1
+ import { __exports as DayCell } from '../../../../../_virtual/index.esm11.js';
2
2
  import require$$0__default from 'react';
3
3
  import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
4
4
  import { __require as requireClassnames } from '../../../../classnames/index.esm.js';
@@ -1,4 +1,4 @@
1
- import { __exports as InputRangeField } from '../../../../../_virtual/index.esm11.js';
1
+ import { __exports as InputRangeField } from '../../../../../_virtual/index.esm14.js';
2
2
  import require$$0__default from 'react';
3
3
  import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { __exports as Month } from '../../../../../_virtual/index.esm14.js';
1
+ import { __exports as Month } from '../../../../../_virtual/index.esm12.js';
2
2
  import require$$0__default from 'react';
3
3
  import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
4
4
  import { __require as requireDayCell } from '../DayCell/index.esm.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tp-react-elements",
3
- "version": "3.0.11",
3
+ "version": "3.0.13",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "React form components library built with React Hook Form and Yup",