@livinglogic/livingapi 1.33.0 → 1.35.0
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/CHANGELOG.md +38 -0
- package/README.md +2 -2
- package/dist/esm-node/livingapi.js +1 -1
- package/dist/esm-node/livingapi.js.map +1 -1
- package/dist/esm-npm/livingapi.js +1 -1
- package/dist/esm-npm/livingapi.js.map +1 -1
- package/dist/esm-static/livingapi.js +1 -1
- package/dist/esm-static/livingapi.js.map +1 -1
- package/dist/umd/livingapi.js +1 -1
- package/dist/umd/livingapi.js.map +1 -1
- package/package.json +1 -1
- package/src/livingapi.js +701 -26
package/src/livingapi.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* LivingAPI JavaScript Library
|
|
3
3
|
* https://my.living-apps.de/docs/LivingAPI.html
|
|
4
4
|
*
|
|
5
|
-
* Copyright 2017-
|
|
6
|
-
* Copyright 2017-
|
|
5
|
+
* Copyright 2017-2026 by LivingLogic AG, Bayreuth/Germany
|
|
6
|
+
* Copyright 2017-2026 by Walter Dörwald
|
|
7
7
|
*
|
|
8
8
|
* All Rights Reserved
|
|
9
9
|
*
|
|
@@ -727,6 +727,297 @@ class WithAttachments extends Base
|
|
|
727
727
|
}
|
|
728
728
|
}
|
|
729
729
|
|
|
730
|
+
class TranslationsType extends ul4.Type
|
|
731
|
+
{
|
|
732
|
+
instancecheck(obj)
|
|
733
|
+
{
|
|
734
|
+
return obj instanceof Translations;
|
|
735
|
+
}
|
|
736
|
+
};
|
|
737
|
+
|
|
738
|
+
let translationstype = new TranslationsType("la", "Translations", "The translations of the multilingual attributes of a LivingAPI object (one attribute per language)");
|
|
739
|
+
|
|
740
|
+
|
|
741
|
+
// The languages for which translations may be created
|
|
742
|
+
const knownlangs = new Set(["de", "en", "fr", "it", "es", "cs"]);
|
|
743
|
+
|
|
744
|
+
|
|
745
|
+
export class Translations extends ul4.Proto
|
|
746
|
+
{
|
|
747
|
+
constructor(owner, langs=null)
|
|
748
|
+
{
|
|
749
|
+
super();
|
|
750
|
+
this.owner = owner;
|
|
751
|
+
this.langs = langs;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
[ul4.symbols.type]()
|
|
755
|
+
{
|
|
756
|
+
return translationstype;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
// Return the translations for the language ``lang`` (or for the current
|
|
760
|
+
// language ``globals.lang`` if ``lang`` is not given); returns ``null``
|
|
761
|
+
// if there are none
|
|
762
|
+
get(lang)
|
|
763
|
+
{
|
|
764
|
+
if (lang === undefined)
|
|
765
|
+
{
|
|
766
|
+
let globals = this.owner.globals;
|
|
767
|
+
if (globals === null || globals === undefined)
|
|
768
|
+
return null;
|
|
769
|
+
lang = globals.lang;
|
|
770
|
+
}
|
|
771
|
+
if (this.langs === null || lang === null)
|
|
772
|
+
return null;
|
|
773
|
+
let translation = this.langs.get(lang);
|
|
774
|
+
return translation !== undefined ? translation : null;
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
// Return the translations for the language ``lang``, creating a new empty
|
|
778
|
+
// translation object if there are none yet and ``lang`` is a known
|
|
779
|
+
// language (for unknown languages ``null`` will be returned)
|
|
780
|
+
get_or_add(lang)
|
|
781
|
+
{
|
|
782
|
+
if (!knownlangs.has(lang))
|
|
783
|
+
return null;
|
|
784
|
+
if (this.langs === null)
|
|
785
|
+
this.langs = new Map();
|
|
786
|
+
let translation = this.langs.get(lang);
|
|
787
|
+
if (translation === undefined)
|
|
788
|
+
{
|
|
789
|
+
translation = this.owner._create_translation(lang);
|
|
790
|
+
this.langs.set(lang, translation);
|
|
791
|
+
}
|
|
792
|
+
return translation;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
// One getter for each known language (must be kept in sync with
|
|
796
|
+
// ``knownlangs``)
|
|
797
|
+
get de()
|
|
798
|
+
{
|
|
799
|
+
return this.get_or_add("de");
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
get en()
|
|
803
|
+
{
|
|
804
|
+
return this.get_or_add("en");
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
get fr()
|
|
808
|
+
{
|
|
809
|
+
return this.get_or_add("fr");
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
get it()
|
|
813
|
+
{
|
|
814
|
+
return this.get_or_add("it");
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
get es()
|
|
818
|
+
{
|
|
819
|
+
return this.get_or_add("es");
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
get cs()
|
|
823
|
+
{
|
|
824
|
+
return this.get_or_add("cs");
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
[ul4.symbols.getattr](name)
|
|
828
|
+
{
|
|
829
|
+
let translation = this.get_or_add(name);
|
|
830
|
+
if (translation !== null)
|
|
831
|
+
return translation;
|
|
832
|
+
throw new ul4.AttributeError(this, name);
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
[ul4.symbols.repr]()
|
|
836
|
+
{
|
|
837
|
+
return "<Translations owner=" + ul4._repr(this.owner) + " langs=" + ul4._repr(this.langs !== null ? [...this.langs.keys()] : null) + ">";
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
toString()
|
|
841
|
+
{
|
|
842
|
+
return this[ul4.symbols.repr]();
|
|
843
|
+
}
|
|
844
|
+
};
|
|
845
|
+
|
|
846
|
+
|
|
847
|
+
export class LangBase extends Base
|
|
848
|
+
{
|
|
849
|
+
constructor(id, lang=null)
|
|
850
|
+
{
|
|
851
|
+
super(id);
|
|
852
|
+
this.lang = lang;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
[ul4.symbols.setattr](name, value)
|
|
856
|
+
{
|
|
857
|
+
if (this._settableattrs.has(name))
|
|
858
|
+
{
|
|
859
|
+
if (value !== null && typeof(value) !== "string")
|
|
860
|
+
throw new ul4.ArgumentError(name + " must be None or a string");
|
|
861
|
+
this[name] = value;
|
|
862
|
+
}
|
|
863
|
+
else
|
|
864
|
+
super[ul4.symbols.setattr](name, value);
|
|
865
|
+
}
|
|
866
|
+
};
|
|
867
|
+
|
|
868
|
+
LangBase.prototype._ul4attrs = new Set(["id", "lang"]);
|
|
869
|
+
LangBase.prototype._settableattrs = new Set();
|
|
870
|
+
|
|
871
|
+
|
|
872
|
+
class AppLangType extends ul4.Type
|
|
873
|
+
{
|
|
874
|
+
instancecheck(obj)
|
|
875
|
+
{
|
|
876
|
+
return obj instanceof AppLang;
|
|
877
|
+
}
|
|
878
|
+
};
|
|
879
|
+
|
|
880
|
+
let applangtype = new AppLangType("la", "AppLang", "The translations of the multilingual attributes of an app for one language");
|
|
881
|
+
|
|
882
|
+
|
|
883
|
+
export class AppLang extends LangBase
|
|
884
|
+
{
|
|
885
|
+
constructor(id, app=null, lang=null)
|
|
886
|
+
{
|
|
887
|
+
super(id, lang);
|
|
888
|
+
this.app = app;
|
|
889
|
+
this.name = null;
|
|
890
|
+
this.description = null;
|
|
891
|
+
this.typename_grammatical_gender = null;
|
|
892
|
+
this.typenames = null;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
[ul4.symbols.type]()
|
|
896
|
+
{
|
|
897
|
+
return applangtype;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
[ul4.symbols.repr]()
|
|
901
|
+
{
|
|
902
|
+
return "<AppLang lang=" + ul4._repr(this.lang) + " name=" + ul4._repr(this.name) + ">";
|
|
903
|
+
}
|
|
904
|
+
};
|
|
905
|
+
|
|
906
|
+
AppLang.prototype._ul4onattrs = ["app", "lang", "name", "description", "typename_grammatical_gender", "typenames"];
|
|
907
|
+
AppLang.prototype._ul4attrs = new Set(["id", "app", "lang", "name", "description", "typename_grammatical_gender", "typenames"]);
|
|
908
|
+
AppLang.prototype._settableattrs = new Set(["name", "description", "typename_grammatical_gender"]);
|
|
909
|
+
|
|
910
|
+
|
|
911
|
+
class AppGroupLangType extends ul4.Type
|
|
912
|
+
{
|
|
913
|
+
instancecheck(obj)
|
|
914
|
+
{
|
|
915
|
+
return obj instanceof AppGroupLang;
|
|
916
|
+
}
|
|
917
|
+
};
|
|
918
|
+
|
|
919
|
+
let appgrouplangtype = new AppGroupLangType("la", "AppGroupLang", "The translations of the multilingual attributes of an app group for one language");
|
|
920
|
+
|
|
921
|
+
|
|
922
|
+
export class AppGroupLang extends LangBase
|
|
923
|
+
{
|
|
924
|
+
constructor(id, appgroup=null, lang=null)
|
|
925
|
+
{
|
|
926
|
+
super(id, lang);
|
|
927
|
+
this.appgroup = appgroup;
|
|
928
|
+
this.name = null;
|
|
929
|
+
this.description = null;
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
[ul4.symbols.type]()
|
|
933
|
+
{
|
|
934
|
+
return appgrouplangtype;
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
[ul4.symbols.repr]()
|
|
938
|
+
{
|
|
939
|
+
return "<AppGroupLang lang=" + ul4._repr(this.lang) + " name=" + ul4._repr(this.name) + ">";
|
|
940
|
+
}
|
|
941
|
+
};
|
|
942
|
+
|
|
943
|
+
AppGroupLang.prototype._ul4onattrs = ["appgroup", "lang", "name", "description"];
|
|
944
|
+
AppGroupLang.prototype._ul4attrs = new Set(["id", "appgroup", "lang", "name", "description"]);
|
|
945
|
+
AppGroupLang.prototype._settableattrs = new Set(["name", "description"]);
|
|
946
|
+
|
|
947
|
+
|
|
948
|
+
class ControlLangType extends ul4.Type
|
|
949
|
+
{
|
|
950
|
+
instancecheck(obj)
|
|
951
|
+
{
|
|
952
|
+
return obj instanceof ControlLang;
|
|
953
|
+
}
|
|
954
|
+
};
|
|
955
|
+
|
|
956
|
+
let controllangtype = new ControlLangType("la", "ControlLang", "The translations of the multilingual attributes of a control for one language");
|
|
957
|
+
|
|
958
|
+
|
|
959
|
+
export class ControlLang extends LangBase
|
|
960
|
+
{
|
|
961
|
+
constructor(id, control=null, lang=null)
|
|
962
|
+
{
|
|
963
|
+
super(id, lang);
|
|
964
|
+
this.control = control;
|
|
965
|
+
this.label = null;
|
|
966
|
+
this.description = null;
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
[ul4.symbols.type]()
|
|
970
|
+
{
|
|
971
|
+
return controllangtype;
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
[ul4.symbols.repr]()
|
|
975
|
+
{
|
|
976
|
+
return "<ControlLang lang=" + ul4._repr(this.lang) + " label=" + ul4._repr(this.label) + ">";
|
|
977
|
+
}
|
|
978
|
+
};
|
|
979
|
+
|
|
980
|
+
ControlLang.prototype._ul4onattrs = ["control", "lang", "label", "description"];
|
|
981
|
+
ControlLang.prototype._ul4attrs = new Set(["id", "control", "lang", "label", "description"]);
|
|
982
|
+
ControlLang.prototype._settableattrs = new Set(["label", "description"]);
|
|
983
|
+
|
|
984
|
+
|
|
985
|
+
class LookupItemLangType extends ul4.Type
|
|
986
|
+
{
|
|
987
|
+
instancecheck(obj)
|
|
988
|
+
{
|
|
989
|
+
return obj instanceof LookupItemLang;
|
|
990
|
+
}
|
|
991
|
+
};
|
|
992
|
+
|
|
993
|
+
let lookupitemlangtype = new LookupItemLangType("la", "LookupItemLang", "The translations of the multilingual attributes of a lookup item for one language");
|
|
994
|
+
|
|
995
|
+
|
|
996
|
+
export class LookupItemLang extends LangBase
|
|
997
|
+
{
|
|
998
|
+
constructor(id, lookup_item=null, lang=null)
|
|
999
|
+
{
|
|
1000
|
+
super(id, lang);
|
|
1001
|
+
this.lookup_item = lookup_item;
|
|
1002
|
+
this.label = null;
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
[ul4.symbols.type]()
|
|
1006
|
+
{
|
|
1007
|
+
return lookupitemlangtype;
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
[ul4.symbols.repr]()
|
|
1011
|
+
{
|
|
1012
|
+
return "<LookupItemLang lang=" + ul4._repr(this.lang) + " label=" + ul4._repr(this.label) + ">";
|
|
1013
|
+
}
|
|
1014
|
+
};
|
|
1015
|
+
|
|
1016
|
+
LookupItemLang.prototype._ul4onattrs = ["lookup_item", "lang", "label"];
|
|
1017
|
+
LookupItemLang.prototype._ul4attrs = new Set(["id", "lookup_item", "lang", "label"]);
|
|
1018
|
+
LookupItemLang.prototype._settableattrs = new Set(["label"]);
|
|
1019
|
+
|
|
1020
|
+
|
|
730
1021
|
class AppType extends ul4.Type
|
|
731
1022
|
{
|
|
732
1023
|
instancecheck(obj)
|
|
@@ -756,6 +1047,228 @@ export class App extends WithAttachments
|
|
|
756
1047
|
return this.appgroup;
|
|
757
1048
|
}
|
|
758
1049
|
|
|
1050
|
+
get translations()
|
|
1051
|
+
{
|
|
1052
|
+
if (this._translations === undefined)
|
|
1053
|
+
this._translations = new Translations(this);
|
|
1054
|
+
return this._translations;
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
_create_translation(lang)
|
|
1058
|
+
{
|
|
1059
|
+
return new AppLang(null, this, lang);
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
get name()
|
|
1063
|
+
{
|
|
1064
|
+
let translation = this.translations.get();
|
|
1065
|
+
if (translation !== null && translation.name !== null)
|
|
1066
|
+
return translation.name;
|
|
1067
|
+
return this._name;
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
set name(value)
|
|
1071
|
+
{
|
|
1072
|
+
this._name = value;
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
get description()
|
|
1076
|
+
{
|
|
1077
|
+
let translation = this.translations.get();
|
|
1078
|
+
if (translation !== null && translation.description !== null)
|
|
1079
|
+
return translation.description;
|
|
1080
|
+
return this._description;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
set description(value)
|
|
1084
|
+
{
|
|
1085
|
+
this._description = value;
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
get typename_grammatical_gender()
|
|
1089
|
+
{
|
|
1090
|
+
let translation = this.translations.get();
|
|
1091
|
+
if (translation !== null && translation.typename_grammatical_gender !== null)
|
|
1092
|
+
return translation.typename_grammatical_gender;
|
|
1093
|
+
return this._typename_grammatical_gender;
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
set typename_grammatical_gender(value)
|
|
1097
|
+
{
|
|
1098
|
+
this._typename_grammatical_gender = value;
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
get typename_nominative_singular()
|
|
1102
|
+
{
|
|
1103
|
+
let translation = this.translations.get();
|
|
1104
|
+
if (translation !== null && translation.typenames !== null)
|
|
1105
|
+
{
|
|
1106
|
+
let value = translation.typenames.get("nom_sin");
|
|
1107
|
+
if (value !== null && value !== undefined)
|
|
1108
|
+
return value;
|
|
1109
|
+
}
|
|
1110
|
+
return this._typename_nominative_singular;
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
set typename_nominative_singular(value)
|
|
1114
|
+
{
|
|
1115
|
+
this._typename_nominative_singular = value;
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
get typename_genitive_singular()
|
|
1119
|
+
{
|
|
1120
|
+
let translation = this.translations.get();
|
|
1121
|
+
if (translation !== null && translation.typenames !== null)
|
|
1122
|
+
{
|
|
1123
|
+
let value = translation.typenames.get("gen_sin");
|
|
1124
|
+
if (value !== null && value !== undefined)
|
|
1125
|
+
return value;
|
|
1126
|
+
}
|
|
1127
|
+
return this._typename_genitive_singular;
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
set typename_genitive_singular(value)
|
|
1131
|
+
{
|
|
1132
|
+
this._typename_genitive_singular = value;
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
get typename_dative_singular()
|
|
1136
|
+
{
|
|
1137
|
+
let translation = this.translations.get();
|
|
1138
|
+
if (translation !== null && translation.typenames !== null)
|
|
1139
|
+
{
|
|
1140
|
+
let value = translation.typenames.get("dat_sin");
|
|
1141
|
+
if (value !== null && value !== undefined)
|
|
1142
|
+
return value;
|
|
1143
|
+
}
|
|
1144
|
+
return this._typename_dative_singular;
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
set typename_dative_singular(value)
|
|
1148
|
+
{
|
|
1149
|
+
this._typename_dative_singular = value;
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
get typename_accusative_singular()
|
|
1153
|
+
{
|
|
1154
|
+
let translation = this.translations.get();
|
|
1155
|
+
if (translation !== null && translation.typenames !== null)
|
|
1156
|
+
{
|
|
1157
|
+
let value = translation.typenames.get("acc_sin");
|
|
1158
|
+
if (value !== null && value !== undefined)
|
|
1159
|
+
return value;
|
|
1160
|
+
}
|
|
1161
|
+
return this._typename_accusative_singular;
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
set typename_accusative_singular(value)
|
|
1165
|
+
{
|
|
1166
|
+
this._typename_accusative_singular = value;
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
get typename_nominative_plural()
|
|
1170
|
+
{
|
|
1171
|
+
let translation = this.translations.get();
|
|
1172
|
+
if (translation !== null && translation.typenames !== null)
|
|
1173
|
+
{
|
|
1174
|
+
let value = translation.typenames.get("nom_plu");
|
|
1175
|
+
if (value !== null && value !== undefined)
|
|
1176
|
+
return value;
|
|
1177
|
+
}
|
|
1178
|
+
return this._typename_nominative_plural;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
set typename_nominative_plural(value)
|
|
1182
|
+
{
|
|
1183
|
+
this._typename_nominative_plural = value;
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
get typename_genitive_plural()
|
|
1187
|
+
{
|
|
1188
|
+
let translation = this.translations.get();
|
|
1189
|
+
if (translation !== null && translation.typenames !== null)
|
|
1190
|
+
{
|
|
1191
|
+
let value = translation.typenames.get("gen_plu");
|
|
1192
|
+
if (value !== null && value !== undefined)
|
|
1193
|
+
return value;
|
|
1194
|
+
}
|
|
1195
|
+
return this._typename_genitive_plural;
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
set typename_genitive_plural(value)
|
|
1199
|
+
{
|
|
1200
|
+
this._typename_genitive_plural = value;
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
get typename_dative_plural()
|
|
1204
|
+
{
|
|
1205
|
+
let translation = this.translations.get();
|
|
1206
|
+
if (translation !== null && translation.typenames !== null)
|
|
1207
|
+
{
|
|
1208
|
+
let value = translation.typenames.get("dat_plu");
|
|
1209
|
+
if (value !== null && value !== undefined)
|
|
1210
|
+
return value;
|
|
1211
|
+
}
|
|
1212
|
+
return this._typename_dative_plural;
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
set typename_dative_plural(value)
|
|
1216
|
+
{
|
|
1217
|
+
this._typename_dative_plural = value;
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
get typename_accusative_plural()
|
|
1221
|
+
{
|
|
1222
|
+
let translation = this.translations.get();
|
|
1223
|
+
if (translation !== null && translation.typenames !== null)
|
|
1224
|
+
{
|
|
1225
|
+
let value = translation.typenames.get("acc_plu");
|
|
1226
|
+
if (value !== null && value !== undefined)
|
|
1227
|
+
return value;
|
|
1228
|
+
}
|
|
1229
|
+
return this._typename_accusative_plural;
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
set typename_accusative_plural(value)
|
|
1233
|
+
{
|
|
1234
|
+
this._typename_accusative_plural = value;
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
get typenames()
|
|
1238
|
+
{
|
|
1239
|
+
let translation = this.translations.get();
|
|
1240
|
+
if (translation !== null && translation.typenames !== null && translation.typenames.size !== 0)
|
|
1241
|
+
return translation.typenames;
|
|
1242
|
+
translation = this.translations.get(this.lang);
|
|
1243
|
+
if (translation !== null && translation.typenames !== null && translation.typenames.size !== 0)
|
|
1244
|
+
return translation.typenames;
|
|
1245
|
+
return null;
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
_dumpUL4ONAttr(name)
|
|
1249
|
+
{
|
|
1250
|
+
if (name === "translations")
|
|
1251
|
+
return this.translations.langs;
|
|
1252
|
+
else
|
|
1253
|
+
return this[name];
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
_loadUL4ONAttr(name, value)
|
|
1257
|
+
{
|
|
1258
|
+
if (name === "translations")
|
|
1259
|
+
this.translations.langs = value;
|
|
1260
|
+
else
|
|
1261
|
+
this[name] = value;
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
_setDefaultUL4ONAttr(name)
|
|
1265
|
+
{
|
|
1266
|
+
if (name === "translations")
|
|
1267
|
+
this.translations.langs = null;
|
|
1268
|
+
else
|
|
1269
|
+
this[name] = null;
|
|
1270
|
+
}
|
|
1271
|
+
|
|
759
1272
|
insert(values={})
|
|
760
1273
|
{
|
|
761
1274
|
let record = this[ul4.symbols.call](values);
|
|
@@ -954,9 +1467,9 @@ export class App extends WithAttachments
|
|
|
954
1467
|
};
|
|
955
1468
|
|
|
956
1469
|
|
|
957
|
-
App.prototype._ul4onattrs = ["globals", "internal_id", "
|
|
958
|
-
"startlink", "image", "createdby", "controls", "records", "record_start", "record_count", "record_total", "installation", "categories", "params", "views", "datamanagement_identifier", "basetable", "primarykey", "insertprocedure", "updateprocedure", "deleteprocedure", "templates", "createdat", "updatedat", "updatedby", "superid", "favorite", "_active_view", "datasource", "main", "ai_generated", "viewtemplates", "filter_default", "sort_default", "filter_owndata", "_permissions", "data_actions", "attachments", "order"];
|
|
959
|
-
App.prototype._ul4attrs = new Set(["id", "globals", "name", "description", "lang", "appgroup", "group", "main", "order", "ai_generated", "typename_grammatical_gender", "typename_nominative_singular", "typename_genitive_singular", "typename_dative_singular", "typename_accusative_singular", "typename_nominative_plural", "typename_genitive_plural", "typename_dative_plural", "typename_accusative_plural", "startlink", "image", "createdat", "createdby", "updatedat", "updatedby", "controls", "layout_controls", "records", "record_start", "record_count", "record_total", "installation", "categories", "params", "views", "menus", "panels", "datasource", "datamanagement_identifier", "insert", "favorite", "_active_view", "filter_default", "sort_default", "filter_owndata", "permissions", "data_actions", "attachments", "template_url", "new_embedded_url", "new_standalone_url", "home_url", "datamanagement_url", "import_url", "tasks_url", /*"formbuilder_url", "tasks_config_url",*/ "datamanagement_config_url", "permissions_url", "datamanageview_url"]);
|
|
1470
|
+
App.prototype._ul4onattrs = ["globals", "internal_id", "_name", "_description", "lang", "appgroup", "_typename_grammatical_gender", "_typename_nominative_singular", "_typename_genitive_singular", "_typename_dative_singular", "_typename_accusative_singular", "_typename_nominative_plural", "_typename_genitive_plural", "_typename_dative_plural", "_typename_accusative_plural",
|
|
1471
|
+
"startlink", "image", "createdby", "controls", "records", "record_start", "record_count", "record_total", "installation", "categories", "params", "views", "datamanagement_identifier", "basetable", "primarykey", "insertprocedure", "updateprocedure", "deleteprocedure", "templates", "createdat", "updatedat", "updatedby", "superid", "favorite", "_active_view", "datasource", "main", "ai_generated", "viewtemplates", "filter_default", "sort_default", "filter_owndata", "_permissions", "data_actions", "attachments", "order", "translations"];
|
|
1472
|
+
App.prototype._ul4attrs = new Set(["id", "globals", "name", "description", "translations", "lang", "appgroup", "group", "main", "order", "ai_generated", "typename_grammatical_gender", "typename_nominative_singular", "typename_genitive_singular", "typename_dative_singular", "typename_accusative_singular", "typename_nominative_plural", "typename_genitive_plural", "typename_dative_plural", "typename_accusative_plural", "typenames", "startlink", "image", "createdat", "createdby", "updatedat", "updatedby", "controls", "layout_controls", "records", "record_start", "record_count", "record_total", "installation", "categories", "params", "views", "menus", "panels", "datasource", "datamanagement_identifier", "insert", "favorite", "_active_view", "filter_default", "sort_default", "filter_owndata", "permissions", "data_actions", "attachments", "template_url", "new_embedded_url", "new_standalone_url", "home_url", "datamanagement_url", "import_url", "tasks_url", /*"formbuilder_url", "tasks_config_url",*/ "datamanagement_config_url", "permissions_url", "datamanageview_url"]);
|
|
960
1473
|
ul4.expose(App.prototype[ul4.symbols.call], ["values", "**"], {"needsobject": true});
|
|
961
1474
|
ul4.expose(App.prototype.insert, ["values", "**"], {"needsobject": true});
|
|
962
1475
|
ul4.expose(App.prototype.template_url, ["identifier", "p", "record", "p=", null, "params", "**"]);
|
|
@@ -986,9 +1499,71 @@ export class AppGroup extends WithAttachments
|
|
|
986
1499
|
{
|
|
987
1500
|
return "<AppGroup id=" + ul4._repr(this.id) + " name=" + ul4._repr(this.name) + ">";
|
|
988
1501
|
}
|
|
1502
|
+
|
|
1503
|
+
get translations()
|
|
1504
|
+
{
|
|
1505
|
+
if (this._translations === undefined)
|
|
1506
|
+
this._translations = new Translations(this);
|
|
1507
|
+
return this._translations;
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1510
|
+
_create_translation(lang)
|
|
1511
|
+
{
|
|
1512
|
+
return new AppGroupLang(null, this, lang);
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
get name()
|
|
1516
|
+
{
|
|
1517
|
+
let translation = this.translations.get();
|
|
1518
|
+
if (translation !== null && translation.name !== null)
|
|
1519
|
+
return translation.name;
|
|
1520
|
+
return this._name;
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
set name(value)
|
|
1524
|
+
{
|
|
1525
|
+
this._name = value;
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
get description()
|
|
1529
|
+
{
|
|
1530
|
+
let translation = this.translations.get();
|
|
1531
|
+
if (translation !== null && translation.description !== null)
|
|
1532
|
+
return translation.description;
|
|
1533
|
+
return this._description;
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
set description(value)
|
|
1537
|
+
{
|
|
1538
|
+
this._description = value;
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1541
|
+
_dumpUL4ONAttr(name)
|
|
1542
|
+
{
|
|
1543
|
+
if (name === "translations")
|
|
1544
|
+
return this.translations.langs;
|
|
1545
|
+
else
|
|
1546
|
+
return this[name];
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
_loadUL4ONAttr(name, value)
|
|
1550
|
+
{
|
|
1551
|
+
if (name === "translations")
|
|
1552
|
+
this.translations.langs = value;
|
|
1553
|
+
else
|
|
1554
|
+
this[name] = value;
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
_setDefaultUL4ONAttr(name)
|
|
1558
|
+
{
|
|
1559
|
+
if (name === "translations")
|
|
1560
|
+
this.translations.langs = null;
|
|
1561
|
+
else
|
|
1562
|
+
this[name] = null;
|
|
1563
|
+
}
|
|
989
1564
|
};
|
|
990
|
-
AppGroup.prototype._ul4onattrs = ["globals", "
|
|
991
|
-
AppGroup.prototype._ul4attrs = new Set(["globals", "id", "name", "description", "image", "apps", "main_app", "params", "attachments"]);
|
|
1565
|
+
AppGroup.prototype._ul4onattrs = ["globals", "_name", "_description", "image", "apps", "main_app", "params", "attachments", "translations"];
|
|
1566
|
+
AppGroup.prototype._ul4attrs = new Set(["globals", "id", "name", "description", "translations", "image", "apps", "main_app", "params", "attachments"]);
|
|
992
1567
|
|
|
993
1568
|
|
|
994
1569
|
class ViewType extends ul4.Type
|
|
@@ -4022,15 +4597,31 @@ export class Control extends Base
|
|
|
4022
4597
|
return this.subtype ? this.type + "/" + this.subtype : this.type;
|
|
4023
4598
|
}
|
|
4024
4599
|
|
|
4600
|
+
get translations()
|
|
4601
|
+
{
|
|
4602
|
+
if (this._translations === undefined)
|
|
4603
|
+
this._translations = new Translations(this);
|
|
4604
|
+
return this._translations;
|
|
4605
|
+
}
|
|
4606
|
+
|
|
4607
|
+
_create_translation(lang)
|
|
4608
|
+
{
|
|
4609
|
+
return new ControlLang(null, this, lang);
|
|
4610
|
+
}
|
|
4611
|
+
|
|
4025
4612
|
get label()
|
|
4026
4613
|
{
|
|
4027
4614
|
let view_control = this._view_control();
|
|
4028
|
-
if (view_control
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4615
|
+
if (view_control !== null)
|
|
4616
|
+
{
|
|
4617
|
+
let label = view_control.label;
|
|
4618
|
+
if (label !== null)
|
|
4619
|
+
return label;
|
|
4620
|
+
}
|
|
4621
|
+
let translation = this.translations.get();
|
|
4622
|
+
if (translation !== null && translation.label !== null)
|
|
4623
|
+
return translation.label;
|
|
4624
|
+
return this._label;
|
|
4034
4625
|
}
|
|
4035
4626
|
|
|
4036
4627
|
set label(value)
|
|
@@ -4040,6 +4631,9 @@ export class Control extends Base
|
|
|
4040
4631
|
|
|
4041
4632
|
get description()
|
|
4042
4633
|
{
|
|
4634
|
+
let translation = this.translations.get();
|
|
4635
|
+
if (translation !== null && translation.description !== null)
|
|
4636
|
+
return translation.description;
|
|
4043
4637
|
return this._description;
|
|
4044
4638
|
}
|
|
4045
4639
|
|
|
@@ -4048,6 +4642,30 @@ export class Control extends Base
|
|
|
4048
4642
|
this._description = value;
|
|
4049
4643
|
}
|
|
4050
4644
|
|
|
4645
|
+
_dumpUL4ONAttr(name)
|
|
4646
|
+
{
|
|
4647
|
+
if (name === "translations")
|
|
4648
|
+
return this.translations.langs;
|
|
4649
|
+
else
|
|
4650
|
+
return this[name];
|
|
4651
|
+
}
|
|
4652
|
+
|
|
4653
|
+
_loadUL4ONAttr(name, value)
|
|
4654
|
+
{
|
|
4655
|
+
if (name === "translations")
|
|
4656
|
+
this.translations.langs = value;
|
|
4657
|
+
else
|
|
4658
|
+
this[name] = value;
|
|
4659
|
+
}
|
|
4660
|
+
|
|
4661
|
+
_setDefaultUL4ONAttr(name)
|
|
4662
|
+
{
|
|
4663
|
+
if (name === "translations")
|
|
4664
|
+
this.translations.langs = null;
|
|
4665
|
+
else
|
|
4666
|
+
this[name] = null;
|
|
4667
|
+
}
|
|
4668
|
+
|
|
4051
4669
|
get priority()
|
|
4052
4670
|
{
|
|
4053
4671
|
return this._priority;
|
|
@@ -4252,8 +4870,8 @@ export class Control extends Base
|
|
|
4252
4870
|
|
|
4253
4871
|
Control.prototype.type = null;
|
|
4254
4872
|
Control.prototype.subtype = null;
|
|
4255
|
-
Control.prototype._ul4onattrs = ["identifier", "fieldname", "app", "_label", "_description", "base_mode", "in_sum", "_priority", "_in_mobile_list", "_in_text", "_in_structured_search", "_in_fulltext_search", "_in_expert_search", "_required", "_required_in_view", "order", "ininsertprocedure", "inupdateprocedure"];
|
|
4256
|
-
Control.prototype._ul4attrs = new Set(["id", "identifier", "fieldname", "app", "base_mode", "in_sum", "priority", "in_list", "in_mobile_list", "in_text", "in_structured_search", "in_fulltext_search", "in_expert_search", "order", "ininsertprocedure", "inupdateprocedure", "fulltype", "label", "description", "top", "left", "width", "height", "z_index", "liveupdate", "tabindex", "required", "mode", "labelpos", "autoalign", "in_active_view"]);
|
|
4873
|
+
Control.prototype._ul4onattrs = ["identifier", "fieldname", "app", "_label", "_description", "base_mode", "in_sum", "_priority", "_in_mobile_list", "_in_text", "_in_structured_search", "_in_fulltext_search", "_in_expert_search", "_required", "_required_in_view", "order", "ininsertprocedure", "inupdateprocedure", "translations"];
|
|
4874
|
+
Control.prototype._ul4attrs = new Set(["id", "identifier", "fieldname", "app", "base_mode", "in_sum", "priority", "in_list", "in_mobile_list", "in_text", "in_structured_search", "in_fulltext_search", "in_expert_search", "order", "ininsertprocedure", "inupdateprocedure", "fulltype", "label", "description", "translations", "top", "left", "width", "height", "z_index", "liveupdate", "tabindex", "required", "mode", "labelpos", "autoalign", "in_active_view"]);
|
|
4257
4875
|
Control.prototype._cssclass_root = "llft-control";
|
|
4258
4876
|
Control.prototype._cssclass_control = "input";
|
|
4259
4877
|
|
|
@@ -5548,17 +6166,41 @@ export class LookupItem extends Base
|
|
|
5548
6166
|
return lookupitemtype;
|
|
5549
6167
|
}
|
|
5550
6168
|
|
|
6169
|
+
get globals()
|
|
6170
|
+
{
|
|
6171
|
+
if (this.control === null || this.control.app === null)
|
|
6172
|
+
return null;
|
|
6173
|
+
return this.control.app.globals;
|
|
6174
|
+
}
|
|
6175
|
+
|
|
6176
|
+
get translations()
|
|
6177
|
+
{
|
|
6178
|
+
if (this._translations === undefined)
|
|
6179
|
+
this._translations = new Translations(this);
|
|
6180
|
+
return this._translations;
|
|
6181
|
+
}
|
|
6182
|
+
|
|
6183
|
+
_create_translation(lang)
|
|
6184
|
+
{
|
|
6185
|
+
return new LookupItemLang(null, this, lang);
|
|
6186
|
+
}
|
|
6187
|
+
|
|
5551
6188
|
get label()
|
|
5552
6189
|
{
|
|
5553
|
-
if (this.control
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5561
|
-
|
|
6190
|
+
if (this.control !== null)
|
|
6191
|
+
{
|
|
6192
|
+
let view_lookupitem = this._view_lookupitem();
|
|
6193
|
+
if (view_lookupitem !== null)
|
|
6194
|
+
{
|
|
6195
|
+
let label = view_lookupitem.label;
|
|
6196
|
+
if (label !== null)
|
|
6197
|
+
return label;
|
|
6198
|
+
}
|
|
6199
|
+
}
|
|
6200
|
+
let translation = this.translations.get();
|
|
6201
|
+
if (translation !== null && translation.label !== null)
|
|
6202
|
+
return translation.label;
|
|
6203
|
+
return this._label;
|
|
5562
6204
|
}
|
|
5563
6205
|
|
|
5564
6206
|
get visible()
|
|
@@ -5588,6 +6230,30 @@ export class LookupItem extends Base
|
|
|
5588
6230
|
return null;
|
|
5589
6231
|
}
|
|
5590
6232
|
|
|
6233
|
+
_dumpUL4ONAttr(name)
|
|
6234
|
+
{
|
|
6235
|
+
if (name === "translations")
|
|
6236
|
+
return this.translations.langs;
|
|
6237
|
+
else
|
|
6238
|
+
return this[name];
|
|
6239
|
+
}
|
|
6240
|
+
|
|
6241
|
+
_loadUL4ONAttr(name, value)
|
|
6242
|
+
{
|
|
6243
|
+
if (name === "translations")
|
|
6244
|
+
this.translations.langs = value;
|
|
6245
|
+
else
|
|
6246
|
+
this[name] = value;
|
|
6247
|
+
}
|
|
6248
|
+
|
|
6249
|
+
_setDefaultUL4ONAttr(name)
|
|
6250
|
+
{
|
|
6251
|
+
if (name === "translations")
|
|
6252
|
+
this.translations.langs = null;
|
|
6253
|
+
else
|
|
6254
|
+
this[name] = null;
|
|
6255
|
+
}
|
|
6256
|
+
|
|
5591
6257
|
[ul4.symbols.repr]()
|
|
5592
6258
|
{
|
|
5593
6259
|
let repr = "<LookupItem key=" + ul4._repr(this.key) + " label=" + ul4._repr(this.label);
|
|
@@ -5597,8 +6263,8 @@ export class LookupItem extends Base
|
|
|
5597
6263
|
}
|
|
5598
6264
|
};
|
|
5599
6265
|
|
|
5600
|
-
LookupItem.prototype._ul4onattrs = ["control", "key", "_label"];
|
|
5601
|
-
LookupItem.prototype._ul4attrs = new Set(["id", "control", "key", "label"]);
|
|
6266
|
+
LookupItem.prototype._ul4onattrs = ["control", "key", "_label", "translations"];
|
|
6267
|
+
LookupItem.prototype._ul4attrs = new Set(["id", "control", "key", "label", "translations"]);
|
|
5602
6268
|
|
|
5603
6269
|
|
|
5604
6270
|
class ViewLookupItemType extends ul4.Type
|
|
@@ -6645,6 +7311,10 @@ let classes = [
|
|
|
6645
7311
|
MultipleAppLookupField,
|
|
6646
7312
|
LookupItem,
|
|
6647
7313
|
ViewLookupItem,
|
|
7314
|
+
AppLang,
|
|
7315
|
+
AppGroupLang,
|
|
7316
|
+
ControlLang,
|
|
7317
|
+
LookupItemLang,
|
|
6648
7318
|
LayoutControl,
|
|
6649
7319
|
HTMLLayoutControl,
|
|
6650
7320
|
ImageLayoutControl,
|
|
@@ -6728,6 +7398,11 @@ export const module = new ul4.Module(
|
|
|
6728
7398
|
DataSourceChildren: DataSourceChildren,
|
|
6729
7399
|
LookupItem: LookupItem,
|
|
6730
7400
|
ViewLookupItem: ViewLookupItem,
|
|
7401
|
+
Translations: Translations,
|
|
7402
|
+
AppLang: AppLang,
|
|
7403
|
+
AppGroupLang: AppGroupLang,
|
|
7404
|
+
ControlLang: ControlLang,
|
|
7405
|
+
LookupItemLang: LookupItemLang,
|
|
6731
7406
|
Category: Category,
|
|
6732
7407
|
AppParameter: AppParameter,
|
|
6733
7408
|
MutableAppParameter: MutableAppParameter,
|