@eui/components 18.2.1-snapshot-1728031106807 → 18.2.1-snapshot-1728522473454
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/docs/dependencies.html +2 -2
- package/docs/js/search/search_index.js +2 -2
- package/docs/miscellaneous/variables.html +14 -12
- package/esm2022/externals/eui-editor/eui-editor.component.mjs +3 -3
- package/esm2022/externals/eui-editor/validators/eui-editor.validators.mjs +11 -9
- package/externals/eui-editor/validators/eui-editor.validators.d.ts.map +1 -1
- package/fesm2022/eui-components-externals-eui-editor.mjs +12 -10
- package/fesm2022/eui-components-externals-eui-editor.mjs.map +1 -1
- package/package.json +3 -3
@@ -763,19 +763,20 @@
|
|
763
763
|
<tr>
|
764
764
|
<td class="col-md-4">
|
765
765
|
<i>Default value : </i><code>(maxWords: number): ValidatorFn =>
|
766
|
-
(control: AbstractControl): { maxWords: { maxWords: number; actual: number } } | null => {
|
766
|
+
(control: AbstractControl<string>): { maxWords: { maxWords: number; actual: number } } | null => {
|
767
|
+
const regex = /[\s\n]+/;
|
767
768
|
if (control.value) {
|
768
769
|
let actual = 0;
|
769
770
|
if (isJson(control.value)) {
|
770
771
|
const content = JSON.parse(control.value)
|
771
|
-
.ops.filter((c: {
|
772
|
-
.map((c: {
|
772
|
+
.ops.filter((c: { insert: string }) => typeof c.insert === 'string')
|
773
|
+
.map((c: { insert: string }) => c.insert);
|
773
774
|
|
774
775
|
const jsonStrippedContent = content.join('');
|
775
|
-
actual = jsonStrippedContent.
|
776
|
+
actual = jsonStrippedContent.replace(/\n/g, ' ').split(/\s+/).filter(t => t !== '').length;
|
776
777
|
} else {
|
777
|
-
const
|
778
|
-
actual =
|
778
|
+
const text = control.value.replace(/[\u200B-\u200D\uFEFF]/g, '').replace(/<\/(p|div|br|li|h[1-6])>/gi, ' ').replace(/<[^>]+>/g, '');
|
779
|
+
actual = !text ? 0 : text.trim().split(regex).filter(t => t !== '').length;
|
779
780
|
}
|
780
781
|
|
781
782
|
return actual > maxWords ? { maxWords: { maxWords, actual } } : null;
|
@@ -869,19 +870,20 @@
|
|
869
870
|
<tr>
|
870
871
|
<td class="col-md-4">
|
871
872
|
<i>Default value : </i><code>(minWords: number): ValidatorFn =>
|
872
|
-
(control: AbstractControl): { minWords: { minWords: number; actual: number } } | null => {
|
873
|
+
(control: AbstractControl<string>): { minWords: { minWords: number; actual: number } } | null => {
|
874
|
+
const regex = /[\s\n]+/;
|
873
875
|
if (control.value) {
|
874
876
|
let actual = 0;
|
875
877
|
if (isJson(control.value)) {
|
876
878
|
const content = JSON.parse(control.value)
|
877
|
-
.ops.filter((c: {
|
878
|
-
.map((c: {
|
879
|
+
.ops.filter((c: { insert: string }) => typeof c.insert === 'string')
|
880
|
+
.map((c: { insert: string }) => c.insert);
|
879
881
|
|
880
882
|
const jsonStrippedContent = content.join('');
|
881
|
-
actual = jsonStrippedContent.
|
883
|
+
actual = jsonStrippedContent.replace(/\n/g, ' ').split(/\s+/).filter(t => t !== '').length;
|
882
884
|
} else {
|
883
|
-
const
|
884
|
-
actual =
|
885
|
+
const text = control.value.replace(/[\u200B-\u200D\uFEFF]/g, '').replace(/<\/(p|div|br|li|h[1-6])>/gi, ' ').replace(/<[^>]+>/g, '');
|
886
|
+
actual = !text ? 0 : text.trim().split(regex).filter(t => t !== '').length;
|
885
887
|
}
|
886
888
|
|
887
889
|
return actual < minWords ? { minWords: { minWords, actual } } : null;
|