@topconsultnpm/sdkui-react-beta 6.12.20 → 6.12.22
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/lib/components/editors/TMHtmlEditor.js +0 -17
- package/lib/components/sidebar/TMSidebarItem.d.ts +1 -1
- package/lib/helper/Enum_Localizator.d.ts +2 -1
- package/lib/helper/Enum_Localizator.js +28 -1
- package/lib/helper/helpers.d.ts +1 -0
- package/lib/helper/helpers.js +27 -1
- package/lib/services/platform_services.d.ts +1 -2
- package/lib/services/platform_services.js +2 -3
- package/package.json +1 -1
@@ -11,23 +11,6 @@ const TMHtmlEditor = (props) => {
|
|
11
11
|
const [isEditorEnabled, setIsEditorEnabled] = useState(false);
|
12
12
|
// State to hold HTML markup
|
13
13
|
const [markup, setMarkup] = useState("");
|
14
|
-
// Effect hook to handle quill instance and @mention behavior
|
15
|
-
useEffect(() => {
|
16
|
-
if (editorRef.current) {
|
17
|
-
const instance = editorRef.current.instance();
|
18
|
-
const quill = instance.getQuillInstance();
|
19
|
-
// Listen for text changes
|
20
|
-
quill.on('text-change', (delta) => {
|
21
|
-
const html = instance.option('value');
|
22
|
-
// Remove span tags and replace non-breaking spaces
|
23
|
-
const cleaned = html.replace(/<span[^>]*>|<\/span>/g, '').replace(/ /g, ' ');
|
24
|
-
// Update value only if changed
|
25
|
-
if (html !== cleaned) {
|
26
|
-
instance.option('value', cleaned);
|
27
|
-
}
|
28
|
-
});
|
29
|
-
}
|
30
|
-
}, [markup]);
|
31
14
|
// Handler for value change
|
32
15
|
const onValueChangeCallback = (text) => {
|
33
16
|
setMarkup(text);
|
@@ -1,7 +1,8 @@
|
|
1
|
-
import { ArchiveConstraints, JoinTypes, MetadataFormats, OwnershipLevels, ParametricFilterTypes, QueryFunctions, QueryOperators, UserLevels } from "@topconsultnpm/sdk-ts-beta";
|
1
|
+
import { ArchiveConstraints, JobTypes, JoinTypes, MetadataFormats, OwnershipLevels, ParametricFilterTypes, QueryFunctions, QueryOperators, UserLevels } from "@topconsultnpm/sdk-ts-beta";
|
2
2
|
import { FormModes } from "../ts";
|
3
3
|
export declare function LocalizeArchiveConstraints(value: ArchiveConstraints | undefined): "Archivierung nur mit Dateien erlauben" | "Allow file only archiving" | "Permitir solo almacenamientos con archivo" | "Autorise uniquement l'archivage de fichiers" | "Permitir somente depósitos com arquivos" | "Consenti solo archiviazioni con file" | "Alles zulassen" | "Allow everything" | "Permitir todo" | "Autorise tout" | "Permitir que todos" | "Consenti tutto" | "Nur Methadatenarchivierung erlauben" | "Allow metadata only archiving" | "Permitir solo almacenamiento de metadatos" | "Autorise uniquement l'archivage de métadonnées" | "Permitir somente os metadados de arquivamento" | "Consenti solo archiviazioni di metadati";
|
4
4
|
export declare function LocalizeFormModes(value: FormModes | undefined): "Erstellen" | "Create" | "Crear" | "Créer" | "Criar" | "Crea" | "Duplikat" | "Duplicate" | "Duplicar" | "Dupliquer" | "Duplicado" | "Duplica" | "Nur Lesen" | "Read only" | "Solo lectura" | "En lecture seule" | "Somente leitura" | "Solo lettura" | "Bearbeiten" | "Update" | "Modificar" | "Modifie" | "Modificação" | "Modifica" | "None" | "Niemand" | "Ninguno" | "Aucun" | "Nenhum" | "Nessuno";
|
5
|
+
export declare function LocalizeJobTypes(value: JobTypes | undefined): string | undefined;
|
5
6
|
export declare function LocalizeMetadataFormats(value: MetadataFormats): string;
|
6
7
|
export declare function LocalizeOwnershipLevels(value: OwnershipLevels | undefined): string | undefined;
|
7
8
|
export declare function LocalizeParametricFilterTypes(value: ParametricFilterTypes | undefined): "Personalisierter Ausdruck" | "Custom expression" | "Expresión personalizada" | "Expression personnalisée" | "Expressão personalizado" | "Espressione personalizzata" | "Filtern nach {@UserID}" | "Filter on {@UserID}" | "Filtro en {@UserID}" | "Filtre sur {@UserID}" | "Filtre on {@UserID}" | "Filtro su {@UserID}" | "Filtern nach {@Benutzername} (=)" | "Filter on {@UserName} (=)" | "Filtro en {@UserName} (=)" | "Filtre sur {@UserName} (=)" | "Filtre on {@UserName} (=)" | "Filtro su {@UserName} (=)" | "Filter nach {@Benutzername} (Enthält)" | "Filter on {@UserName} (Contains)" | "Filtro en {@UserName} (Contiene)" | "Filtre sur {@UserName} (Contient)" | "Filtre on {@UserName} (Contém)" | "Filtro su {@UserName} (Contiene)" | "None" | "Niemand" | "Ninguno" | "Aucun" | "Nenhum" | "Nessuno";
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ArchiveConstraints, JoinTypes, MetadataFormats, OwnershipLevels, ParametricFilterTypes, QueryFunctions, QueryOperators, SDK_Localizator, UserLevels } from "@topconsultnpm/sdk-ts-beta";
|
1
|
+
import { ArchiveConstraints, CultureIDs, JobTypes, JoinTypes, MetadataFormats, OwnershipLevels, ParametricFilterTypes, QueryFunctions, QueryOperators, SDK_Globals, SDK_Localizator, UserLevels } from "@topconsultnpm/sdk-ts-beta";
|
2
2
|
import { SDKUI_Localizator } from "./SDKUI_Localizator";
|
3
3
|
import { FormModes } from "../ts";
|
4
4
|
export function LocalizeArchiveConstraints(value) {
|
@@ -19,6 +19,33 @@ export function LocalizeFormModes(value) {
|
|
19
19
|
case FormModes.ReadOnly: return SDKUI_Localizator.ReadOnly;
|
20
20
|
}
|
21
21
|
}
|
22
|
+
export function LocalizeJobTypes(value) {
|
23
|
+
switch (value) {
|
24
|
+
case JobTypes.FileExec: return "CustomExec";
|
25
|
+
case JobTypes.Signer: return "DcmtSigner";
|
26
|
+
case JobTypes.CassettoFiscaleQuery:
|
27
|
+
switch (SDK_Globals.tmSession?.SessionDescr?.cultureID) {
|
28
|
+
case CultureIDs.It_IT: return value?.toString();
|
29
|
+
default: return "TaxDrawerQuery";
|
30
|
+
}
|
31
|
+
case JobTypes.CassettoFiscaleSender:
|
32
|
+
switch (SDK_Globals.tmSession?.SessionDescr?.cultureID) {
|
33
|
+
case CultureIDs.It_IT: return value?.toString();
|
34
|
+
default: return "TaxDrawerSender";
|
35
|
+
}
|
36
|
+
case JobTypes.CassettoDoganale:
|
37
|
+
switch (SDK_Globals.tmSession?.SessionDescr?.cultureID) {
|
38
|
+
case CultureIDs.It_IT: return value?.toString();
|
39
|
+
default: return "CustomsDrawer";
|
40
|
+
}
|
41
|
+
case JobTypes.CassettoDoganalePlus:
|
42
|
+
switch (SDK_Globals.tmSession?.SessionDescr?.cultureID) {
|
43
|
+
case CultureIDs.It_IT: return value?.toString();
|
44
|
+
default: return "CustomsDrawerPlus";
|
45
|
+
}
|
46
|
+
default: return value?.toString();
|
47
|
+
}
|
48
|
+
}
|
22
49
|
export function LocalizeMetadataFormats(value) {
|
23
50
|
switch (value) {
|
24
51
|
case MetadataFormats.None: return SDK_Localizator.None;
|
package/lib/helper/helpers.d.ts
CHANGED
@@ -29,6 +29,7 @@ export declare function calcIsModified(formData: any, formDataOrig: any): boolea
|
|
29
29
|
export { openApps, calcResponsiveDirection, calcResponsiveSizes, getColor, genUniqueId, makeID, MOBILE_WIDTH, TABLET_WIDTH };
|
30
30
|
export declare function moduleVersion(module: moduleTypes): string;
|
31
31
|
export declare function buildtype(module: moduleTypes): string;
|
32
|
+
export declare const highlightText: (text: string, searchValue: string) => JSX.Element;
|
32
33
|
export declare function versionAndBuildtypeInfo(module: moduleTypes): string;
|
33
34
|
export declare const getListMaxItems: (deviceType: DeviceType | undefined) => number;
|
34
35
|
export declare const svgToString: (icon: React.ReactElement) => string;
|
package/lib/helper/helpers.js
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
import { Fragment as _Fragment, jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
1
2
|
import { Colors } from "../utils/theme";
|
2
3
|
import { ButtonNames, DeviceType, TMExceptionBoxManager, TMMessageBoxManager, TMSpinner } from "../components";
|
3
4
|
import { AccessLevels, MetadataDataDomains, MetadataDataTypes, MetadataDescriptor, MetadataFormatDescriptor, MetadataFormats, MetadataPermission, SDK_Globals, SystemMIDs, SystemMIDsAsNumber, TopMediaServer } from "@topconsultnpm/sdk-ts-beta";
|
@@ -490,6 +491,32 @@ export function buildtype(module) {
|
|
490
491
|
buildType = buildTypes.PATCH;
|
491
492
|
return buildType;
|
492
493
|
}
|
494
|
+
export const highlightText = (text, searchValue) => {
|
495
|
+
if (!text.trim() || !searchValue.trim())
|
496
|
+
return _jsxs(_Fragment, { children: [text, " "] });
|
497
|
+
const foundStrings = searchValue.match(/[^\s]+/g) || [];
|
498
|
+
const escapedStrings = foundStrings
|
499
|
+
.map((str) => str.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&')) // NOSONAR
|
500
|
+
.filter(Boolean);
|
501
|
+
if (escapedStrings.length === 0)
|
502
|
+
return _jsxs(_Fragment, { children: [text, " "] });
|
503
|
+
const regex = new RegExp(`(${escapedStrings.join('|')})`, 'gi');
|
504
|
+
const parts = [];
|
505
|
+
let lastIndex = 0;
|
506
|
+
for (const match of text.matchAll(regex)) {
|
507
|
+
const matchStart = match.index;
|
508
|
+
const matchEnd = matchStart + match[0].length;
|
509
|
+
if (lastIndex < matchStart) {
|
510
|
+
parts.push(text.substring(lastIndex, matchStart));
|
511
|
+
}
|
512
|
+
parts.push(_jsx("span", { style: { backgroundColor: "yellow", borderRadius: '2px' }, children: match[0] }, matchStart));
|
513
|
+
lastIndex = matchEnd;
|
514
|
+
}
|
515
|
+
if (lastIndex < text.length) {
|
516
|
+
parts.push(text.substring(lastIndex));
|
517
|
+
}
|
518
|
+
return _jsxs(_Fragment, { children: [parts, " "] });
|
519
|
+
};
|
493
520
|
export function versionAndBuildtypeInfo(module) {
|
494
521
|
let buildType = buildtype(module);
|
495
522
|
let version = moduleVersion(module);
|
@@ -535,4 +562,3 @@ export function getExceptionMessage(ex) {
|
|
535
562
|
let msg = ex.isApiException ? ex.response.title : ex.message;
|
536
563
|
return msg ?? ex.toString();
|
537
564
|
}
|
538
|
-
// #endregion
|
@@ -10,8 +10,7 @@ export declare class PlatformObjectService {
|
|
10
10
|
private static readonly createJobAsync;
|
11
11
|
static readonly createAsync: (objClass: ObjectClasses, jobType: JobTypes, d: any) => Promise<number | undefined>;
|
12
12
|
static readonly deleteAsync: (objClass: ObjectClasses, id: number) => Promise<number | undefined>;
|
13
|
-
|
14
|
-
static readonly getName: (objClass: ObjectClasses, jobType?: JobTypes, isPlural?: boolean) => string;
|
13
|
+
static readonly getName: (objClass: ObjectClasses, jobType?: JobTypes, isPlural?: boolean) => string | undefined;
|
15
14
|
static readonly getIcon: (objClass: ObjectClasses, d: any) => import("react/jsx-runtime").JSX.Element;
|
16
15
|
static readonly getTooltip: (objClass: ObjectClasses, d: any) => import("react/jsx-runtime").JSX.Element | null;
|
17
16
|
}
|
@@ -4,7 +4,7 @@ import { SDK_Globals, SDK_Localizator, JobTypes, ObjectClasses, OwnershipLevels,
|
|
4
4
|
import { TMDcmtTypeIcon, TMTooltip, TMUserIcon } from "../components";
|
5
5
|
import { Icon123, IconAccessPoint, IconAddressBook, IconBasket, IconCloud, IconDataList, IconDisk, IconProcess, IconServerService, IconSettings, IconSignCert, IconSuitcase, IconTree, IconUserGroup, SDKUI_Localizator } from "../helper";
|
6
6
|
import { TMColors } from "../utils/theme";
|
7
|
-
import { LocalizeOwnershipLevels } from "../helper/Enum_Localizator";
|
7
|
+
import { LocalizeJobTypes, LocalizeOwnershipLevels } from "../helper/Enum_Localizator";
|
8
8
|
export class PlatformObjectService {
|
9
9
|
}
|
10
10
|
_a = PlatformObjectService;
|
@@ -377,7 +377,6 @@ PlatformObjectService.deleteAsync = async (objClass, id) => {
|
|
377
377
|
default: return -1;
|
378
378
|
}
|
379
379
|
};
|
380
|
-
PlatformObjectService.getJobName = (jobType) => { return jobType.toString(); };
|
381
380
|
PlatformObjectService.getName = (objClass, jobType = JobTypes.None, isPlural = false) => {
|
382
381
|
switch (objClass) {
|
383
382
|
case ObjectClasses.Area: return isPlural ? SDK_Localizator.Areas : SDK_Localizator.Area;
|
@@ -393,7 +392,7 @@ PlatformObjectService.getName = (objClass, jobType = JobTypes.None, isPlural = f
|
|
393
392
|
case ObjectClasses.Tree: return isPlural ? SDK_Localizator.Trees : SDK_Localizator.Tree;
|
394
393
|
case ObjectClasses.TSA: return isPlural ? SDK_Localizator.TSAs : SDK_Localizator.TSA;
|
395
394
|
case ObjectClasses.User: return isPlural ? SDK_Localizator.Users : SDK_Localizator.User;
|
396
|
-
case ObjectClasses.Job: return
|
395
|
+
case ObjectClasses.Job: return LocalizeJobTypes(jobType);
|
397
396
|
case ObjectClasses.Process: return isPlural ? SDK_Localizator.Processes : SDK_Localizator.Process;
|
398
397
|
default: return objClass.toString();
|
399
398
|
}
|