@furo/open-models 1.7.2 → 1.8.1
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/custom-elements.json +2803 -981
- package/dist/FieldNode.d.ts +4 -4
- package/dist/FieldNode.js +1 -1
- package/dist/FieldNode.js.map +1 -1
- package/dist/primitives/FLOAT.js +3 -3
- package/dist/primitives/FLOAT.js.map +1 -1
- package/dist/primitives/INT32.js +1 -1
- package/dist/primitives/INT32.js.map +1 -1
- package/dist/primitives/INT64.d.ts +8 -9
- package/dist/primitives/INT64.js +8 -24
- package/dist/primitives/INT64.js.map +1 -1
- package/dist/primitives/UINT32.js +1 -1
- package/dist/primitives/UINT32.js.map +1 -1
- package/dist/primitives/UINT64.d.ts +8 -8
- package/dist/primitives/UINT64.js +9 -16
- package/dist/primitives/UINT64.js.map +1 -1
- package/dist/well_known/Int64Value.d.ts +8 -9
- package/dist/well_known/Int64Value.js +7 -23
- package/dist/well_known/Int64Value.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UINT32.js","sourceRoot":"","sources":["../../src/primitives/UINT32.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,OAAO,MAAO,SAAQ,SAAS;IACnC,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,IAAI,KAAK,CAAC,KAAa;QACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IAID,YACE,QAAiB,EAC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sBAA+B,KAAK;QACjD,oCAAoC;QACpC,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC;QACvC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAChB,IAAI,YAAY,IAAI,CAAC,mBAAmB,EAAE,CAAC;YACzC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC;QACvC,CAAC;IACH,CAAC;CACF;AAED,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC","sourcesContent":["import { FieldNode } from '../FieldNode';\nimport { Registry } from '../Registry';\nimport { FieldConstraints } from '../FieldConstraints';\nimport { OPEN_MODELS_OPTIONS } from '../OPEN_MODELS_OPTIONS';\n\nexport class UINT32 extends FieldNode {\n get value(): number {\n return this._value;\n }\n\n set value(value: number) {\n this._value = value;\n this.__isEmpty = false;\n this.__climbUpValidation();\n this.__notifyFieldValueChange(true);\n }\n\n public _value: number;\n\n constructor(\n initData?: number,\n parent?: FieldNode,\n parentAttributeName?: string,\n ) {\n super(undefined, parent, parentAttributeName);\n this.__isPrimitive = true;\n this._value = Number.isInteger(initData) ? (initData as number) : 0;\n this.__meta.typeName = 'primitives.UINT32';\n }\n\n __updateWithLiteral(v: number) {\n this._value = v;\n this.__isEmpty = false;\n this.__notifyFieldValueChange(false);\n }\n\n protected ___updateNotEmptyPath() {\n if (this._value === 0) {\n this.___isEmpty = !(\n OPEN_MODELS_OPTIONS.EmitDefaultValues ||\n OPEN_MODELS_OPTIONS.EmitUnpopulated\n );\n } else {\n this.___isEmpty = false;\n super.___updateNotEmptyPath();\n }\n }\n\n // eslint-disable-next-line class-methods-use-this\n __mapProtoNameJsonToJson(data: number): number {\n return data;\n }\n\n protected __checkTypeBoundaries(): string[] | undefined {\n // check for uint32 min max boundaries\n\n if (this._value > 4294967295) {\n return ['constraint.violation.range.uint32.max', '4294967295'];\n }\n if (this._value < 0) {\n return ['constraint.violation.range.uint32.min', '0'];\n }\n return undefined;\n }\n\n protected __checkConstraints(\n fieldConstraints: FieldConstraints,\n ): string[] | undefined {\n // eslint-disable-next-line guard-for-in\n for (const [constraint, value] of Object.entries(fieldConstraints)) {\n // An uint32 has always a value if (constraint === 'required') {}\n if (constraint === 'maximum') {\n // By default, the minimum and maximum values are included in the range. \">\" is used to check.\n if (fieldConstraints.exclusive_maximum && this._value >= value) {\n return ['constraint.violation.exclusive_maximum', value, this._value];\n }\n if (this._value > value) {\n return ['constraint.violation.maximum', value, this._value];\n }\n }\n if (constraint === 'minimum') {\n // By default, the minimum and maximum values are included in the range. \"<\" is used to check.\n if (fieldConstraints.exclusive_minimum && this._value <= value) {\n return ['constraint.violation.exclusive_minimum', value, this._value];\n }\n if (this._value < value) {\n return ['constraint.violation.minimum', value, this._value];\n }\n }\n if (constraint === 'multiple_of') {\n // Use the multiple_of keyword to specify that a number must be the multiple of another number\n // use this to define the step ??\n if (this._value % value !== 0) {\n return ['constraint.violation.multiple_of', value, this._value];\n }\n }\n }\n\n return undefined;\n }\n\n __toJson(): number {\n return this.__toLiteral();\n }\n\n __toLiteral() {\n return this._value;\n }\n\n valueOf(): number {\n return this._value;\n }\n\n toString(): string {\n return this._value.toString();\n }\n\n public __clear(withoutNotification: boolean = false) {\n // only notify when they are changes\n const shouldNotify = this._value !== 0;\n this._value = 0;\n if (shouldNotify && !withoutNotification) {\n this.__notifyFieldValueChange(false);\n }\n }\n}\n\nRegistry.register('uint32', UINT32);\n"]}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { FieldNode } from '../FieldNode.js';
|
|
2
2
|
import { FieldConstraints } from '../FieldConstraints.js';
|
|
3
3
|
export declare class UINT64 extends FieldNode {
|
|
4
|
-
get value():
|
|
5
|
-
set value(value:
|
|
6
|
-
_value:
|
|
7
|
-
constructor(initData?:
|
|
8
|
-
__updateWithLiteral(v:
|
|
4
|
+
get value(): bigint;
|
|
5
|
+
set value(value: bigint);
|
|
6
|
+
_value: bigint;
|
|
7
|
+
constructor(initData?: string, parent?: FieldNode, parentAttributeName?: string);
|
|
8
|
+
__updateWithLiteral(v: string): void;
|
|
9
9
|
protected ___updateNotEmptyPath(): void;
|
|
10
10
|
__mapProtoNameJsonToJson(data: number): number;
|
|
11
11
|
protected __checkTypeBoundaries(): string[] | undefined;
|
|
12
12
|
protected __checkConstraints(fieldConstraints: FieldConstraints): string[] | undefined;
|
|
13
|
-
__toJson():
|
|
14
|
-
__toLiteral():
|
|
15
|
-
valueOf():
|
|
13
|
+
__toJson(): string;
|
|
14
|
+
__toLiteral(): string;
|
|
15
|
+
valueOf(): bigint;
|
|
16
16
|
toString(): string;
|
|
17
17
|
__clear(withoutNotification?: boolean): void;
|
|
18
18
|
}
|
|
@@ -14,16 +14,16 @@ export class UINT64 extends FieldNode {
|
|
|
14
14
|
constructor(initData, parent, parentAttributeName) {
|
|
15
15
|
super(undefined, parent, parentAttributeName);
|
|
16
16
|
this.__isPrimitive = true;
|
|
17
|
-
this._value =
|
|
17
|
+
this._value = BigInt(initData || '0');
|
|
18
18
|
this.__meta.typeName = 'primitives.UINT64';
|
|
19
19
|
}
|
|
20
20
|
__updateWithLiteral(v) {
|
|
21
|
-
this._value = v;
|
|
21
|
+
this._value = BigInt(v);
|
|
22
22
|
this.__isEmpty = false;
|
|
23
23
|
this.__notifyFieldValueChange(false);
|
|
24
24
|
}
|
|
25
25
|
___updateNotEmptyPath() {
|
|
26
|
-
if (this._value ===
|
|
26
|
+
if (this._value === 0n) {
|
|
27
27
|
this.___isEmpty = !(OPEN_MODELS_OPTIONS.EmitDefaultValues ||
|
|
28
28
|
OPEN_MODELS_OPTIONS.EmitUnpopulated);
|
|
29
29
|
}
|
|
@@ -37,14 +37,7 @@ export class UINT64 extends FieldNode {
|
|
|
37
37
|
return data;
|
|
38
38
|
}
|
|
39
39
|
__checkTypeBoundaries() {
|
|
40
|
-
|
|
41
|
-
if (this._value > Number.MAX_SAFE_INTEGER) {
|
|
42
|
-
return [
|
|
43
|
-
'constraint.violation.range.uint64.max',
|
|
44
|
-
Number.MAX_SAFE_INTEGER.toString(),
|
|
45
|
-
];
|
|
46
|
-
}
|
|
47
|
-
if (this._value < 0) {
|
|
40
|
+
if (this._value < 0n) {
|
|
48
41
|
return ['constraint.violation.range.uint64.min', '0'];
|
|
49
42
|
}
|
|
50
43
|
return undefined;
|
|
@@ -59,7 +52,7 @@ export class UINT64 extends FieldNode {
|
|
|
59
52
|
return ['constraint.violation.exclusive_maximum', value, this._value];
|
|
60
53
|
}
|
|
61
54
|
if (this._value > value) {
|
|
62
|
-
return ['constraint.violation.maximum', value];
|
|
55
|
+
return ['constraint.violation.maximum', value, this._value];
|
|
63
56
|
}
|
|
64
57
|
}
|
|
65
58
|
if (constraint === 'minimum') {
|
|
@@ -74,7 +67,7 @@ export class UINT64 extends FieldNode {
|
|
|
74
67
|
if (constraint === 'multiple_of') {
|
|
75
68
|
// Use the multiple_of keyword to specify that a number must be the multiple of another number
|
|
76
69
|
// use this to define the step ??
|
|
77
|
-
if (this._value % value !==
|
|
70
|
+
if (this._value % BigInt(value) !== 0n) {
|
|
78
71
|
return ['constraint.violation.multiple_of', value, this._value];
|
|
79
72
|
}
|
|
80
73
|
}
|
|
@@ -85,7 +78,7 @@ export class UINT64 extends FieldNode {
|
|
|
85
78
|
return this.__toLiteral();
|
|
86
79
|
}
|
|
87
80
|
__toLiteral() {
|
|
88
|
-
return this._value;
|
|
81
|
+
return this._value.toString();
|
|
89
82
|
}
|
|
90
83
|
valueOf() {
|
|
91
84
|
return this._value;
|
|
@@ -95,8 +88,8 @@ export class UINT64 extends FieldNode {
|
|
|
95
88
|
}
|
|
96
89
|
__clear(withoutNotification = false) {
|
|
97
90
|
// only notify when they are changes
|
|
98
|
-
const shouldNotify = this._value !==
|
|
99
|
-
this._value =
|
|
91
|
+
const shouldNotify = this._value !== 0n;
|
|
92
|
+
this._value = 0n;
|
|
100
93
|
if (shouldNotify && !withoutNotification) {
|
|
101
94
|
this.__notifyFieldValueChange(false);
|
|
102
95
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UINT64.js","sourceRoot":"","sources":["../../src/primitives/UINT64.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,OAAO,MAAO,SAAQ,SAAS;IACnC,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,IAAI,KAAK,CAAC,KAAa;QACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IAID,YACE,QAAiB,EACjB,MAAkB,EAClB,mBAA4B;QAE5B,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,mBAAmB,CAAC,CAAC;QAC9C,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"UINT64.js","sourceRoot":"","sources":["../../src/primitives/UINT64.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,OAAO,MAAO,SAAQ,SAAS;IACnC,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,IAAI,KAAK,CAAC,KAAa;QACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,IAAI,CA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AM,CAAC,QAAQ,EAAE,CAAC;IAChC,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;IAChC,CAAC;IAEM,OAAO,CAAC,sBAA+B,KAAK;QACjD,oCAAoC;QACpC,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,KAAK,EAAE,CAAC;QACxC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,YAAY,IAAI,CAAC,mBAAmB,EAAE,CAAC;YACzC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC;QACvC,CAAC;IACH,CAAC;CACF;AAED,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC","sourcesContent":["import { FieldNode } from '../FieldNode';\nimport { Registry } from '../Registry';\nimport { FieldConstraints } from '../FieldConstraints';\nimport { OPEN_MODELS_OPTIONS } from '../OPEN_MODELS_OPTIONS';\n\nexport class UINT64 extends FieldNode {\n get value(): bigint {\n return this._value;\n }\n\n set value(value: bigint) {\n this._value = value;\n this.__isEmpty = false;\n this.__climbUpValidation();\n this.__notifyFieldValueChange(true);\n }\n\n public _value: bigint;\n\n constructor(\n initData?: string,\n parent?: FieldNode,\n parentAttributeName?: string,\n ) {\n super(undefined, parent, parentAttributeName);\n this.__isPrimitive = true;\n this._value = BigInt(initData || '0');\n this.__meta.typeName = 'primitives.UINT64';\n }\n\n __updateWithLiteral(v: string) {\n this._value = BigInt(v);\n this.__isEmpty = false;\n this.__notifyFieldValueChange(false);\n }\n\n protected ___updateNotEmptyPath() {\n if (this._value === 0n) {\n this.___isEmpty = !(\n OPEN_MODELS_OPTIONS.EmitDefaultValues ||\n OPEN_MODELS_OPTIONS.EmitUnpopulated\n );\n } else {\n this.___isEmpty = false;\n super.___updateNotEmptyPath();\n }\n }\n\n // eslint-disable-next-line class-methods-use-this\n __mapProtoNameJsonToJson(data: number): number {\n return data;\n }\n\n protected __checkTypeBoundaries(): string[] | undefined {\n if (this._value < 0n) {\n return ['constraint.violation.range.uint64.min', '0'];\n }\n return undefined;\n }\n\n protected __checkConstraints(\n fieldConstraints: FieldConstraints,\n ): string[] | undefined {\n // eslint-disable-next-line guard-for-in\n for (const [constraint, value] of Object.entries(fieldConstraints)) {\n // An uint64 has always a value if (constraint === 'required') {}\n if (constraint === 'maximum') {\n // By default, the minimum and maximum values are included in the range. \">\" is used to check.\n if (fieldConstraints.exclusive_maximum && this._value >= value) {\n return ['constraint.violation.exclusive_maximum', value, this._value];\n }\n if (this._value > value) {\n return ['constraint.violation.maximum', value, this._value];\n }\n }\n if (constraint === 'minimum') {\n // By default, the minimum and maximum values are included in the range. \"<\" is used to check.\n if (fieldConstraints.exclusive_minimum && this._value <= value) {\n return ['constraint.violation.exclusive_minimum', value, this._value];\n }\n if (this._value < value) {\n return ['constraint.violation.minimum', value, this._value];\n }\n }\n if (constraint === 'multiple_of') {\n // Use the multiple_of keyword to specify that a number must be the multiple of another number\n // use this to define the step ??\n if (this._value % BigInt(value) !== 0n) {\n return ['constraint.violation.multiple_of', value, this._value];\n }\n }\n }\n\n return undefined;\n }\n\n __toJson(): string {\n return this.__toLiteral();\n }\n\n __toLiteral() {\n return this._value.toString();\n }\n\n valueOf(): bigint {\n return this._value;\n }\n\n toString(): string {\n return this._value.toString();\n }\n\n public __clear(withoutNotification: boolean = false) {\n // only notify when they are changes\n const shouldNotify = this._value !== 0n;\n this._value = 0n;\n if (shouldNotify && !withoutNotification) {\n this.__notifyFieldValueChange(false);\n }\n }\n}\n\nRegistry.register('uint64', UINT64);\n"]}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { FieldNode } from '../FieldNode.js';
|
|
2
2
|
import { FieldConstraints } from '../FieldConstraints.js';
|
|
3
3
|
export declare class Int64Value extends FieldNode {
|
|
4
|
-
get value():
|
|
5
|
-
set value(value:
|
|
6
|
-
_value:
|
|
7
|
-
constructor(initData?:
|
|
8
|
-
__updateWithLiteral(v:
|
|
4
|
+
get value(): bigint;
|
|
5
|
+
set value(value: bigint);
|
|
6
|
+
_value: bigint;
|
|
7
|
+
constructor(initData?: string | undefined, parent?: FieldNode, parentAttributeName?: string);
|
|
8
|
+
__updateWithLiteral(v: string): void;
|
|
9
9
|
__mapProtoNameJsonToJson(data: number): number;
|
|
10
|
-
__toJson():
|
|
11
|
-
valueOf(): number;
|
|
12
|
-
__toLiteral():
|
|
13
|
-
protected __checkTypeBoundaries(): string[] | undefined;
|
|
10
|
+
__toJson(): string | null;
|
|
11
|
+
valueOf(): number | bigint;
|
|
12
|
+
__toLiteral(): string;
|
|
14
13
|
protected __checkConstraints(fieldConstraints: FieldConstraints): string[] | undefined;
|
|
15
14
|
toString(): string;
|
|
16
15
|
__clear(withoutNotification?: boolean): void;
|
|
@@ -19,14 +19,14 @@ export class Int64Value extends FieldNode {
|
|
|
19
19
|
}
|
|
20
20
|
constructor(initData, parent, parentAttributeName) {
|
|
21
21
|
super(undefined, parent, parentAttributeName);
|
|
22
|
-
this._value =
|
|
22
|
+
this._value = 0n;
|
|
23
23
|
this.__isEmpty = !(OPEN_MODELS_OPTIONS.EmitDefaultValues ||
|
|
24
24
|
OPEN_MODELS_OPTIONS.EmitUnpopulated);
|
|
25
|
-
this._value =
|
|
25
|
+
this._value = BigInt(initData || '0');
|
|
26
26
|
this.__meta.typeName = 'google.protobuf.Int64Value';
|
|
27
27
|
}
|
|
28
28
|
__updateWithLiteral(v) {
|
|
29
|
-
this._value = v;
|
|
29
|
+
this._value = BigInt(v);
|
|
30
30
|
if (OPEN_MODELS_OPTIONS.EmitDefaultValues ||
|
|
31
31
|
OPEN_MODELS_OPTIONS.EmitUnpopulated) {
|
|
32
32
|
this.__isEmpty = false;
|
|
@@ -47,23 +47,7 @@ export class Int64Value extends FieldNode {
|
|
|
47
47
|
return this._value || NaN;
|
|
48
48
|
}
|
|
49
49
|
__toLiteral() {
|
|
50
|
-
return this._value;
|
|
51
|
-
}
|
|
52
|
-
__checkTypeBoundaries() {
|
|
53
|
-
// check for int64 min max boundaries
|
|
54
|
-
if (this._value && this._value > Number.MAX_SAFE_INTEGER) {
|
|
55
|
-
return [
|
|
56
|
-
'constraint.violation.range.int64.max',
|
|
57
|
-
Number.MAX_SAFE_INTEGER.toString(),
|
|
58
|
-
];
|
|
59
|
-
}
|
|
60
|
-
if (this._value && this._value < Number.MIN_SAFE_INTEGER) {
|
|
61
|
-
return [
|
|
62
|
-
'constraint.violation.range.int64.min',
|
|
63
|
-
Number.MIN_SAFE_INTEGER.toString(),
|
|
64
|
-
];
|
|
65
|
-
}
|
|
66
|
-
return undefined;
|
|
50
|
+
return this._value.toString();
|
|
67
51
|
}
|
|
68
52
|
__checkConstraints(fieldConstraints) {
|
|
69
53
|
// eslint-disable-next-line guard-for-in
|
|
@@ -93,7 +77,7 @@ export class Int64Value extends FieldNode {
|
|
|
93
77
|
if (constraint === 'multiple_of') {
|
|
94
78
|
// Use the multiple_of keyword to specify that a number must be the multiple of another number
|
|
95
79
|
// use this to define the step ??
|
|
96
|
-
if (this._value !== null && this._value % value !==
|
|
80
|
+
if (this._value !== null && this._value % BigInt(value) !== 0n) {
|
|
97
81
|
return ['constraint.violation.multiple_of', value, this._value];
|
|
98
82
|
}
|
|
99
83
|
}
|
|
@@ -113,8 +97,8 @@ export class Int64Value extends FieldNode {
|
|
|
113
97
|
}
|
|
114
98
|
__clear(withoutNotification = false) {
|
|
115
99
|
// only notify when they are changes
|
|
116
|
-
const shouldNotify = this._value !==
|
|
117
|
-
this._value =
|
|
100
|
+
const shouldNotify = this._value !== 0n;
|
|
101
|
+
this._value = 0n;
|
|
118
102
|
this.__isEmpty = !(OPEN_MODELS_OPTIONS.EmitDefaultValues ||
|
|
119
103
|
OPEN_MODELS_OPTIONS.EmitUnpopulated);
|
|
120
104
|
if (shouldNotify && !withoutNotification) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Int64Value.js","sourceRoot":"","sources":["../../src/well_known/Int64Value.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,OAAO,UAAW,SAAQ,SAAS;IACvC,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,IAAI,KAAK,CAAC,KAAa;QACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IACE,mBAAmB,CAAC,iBAAiB;YACrC,mBAAmB,CAAC,eAAe,EACnC,CAAC;YACD,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACzB,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,SAAS,GAAG,KAAK,KAAK,IAAI,CAAC;QAClC,CAAC;QAED,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IAID,YACE,QAA6B,EAC7B,MAAkB,EAClB,mBAA4B;QAE5B,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,mBAAmB,CAAC,CAAC;QAPzC,WAAM,GAAW,
|
|
1
|
+
{"version":3,"file":"Int64Value.js","sourceRoot":"","sources":["../../src/well_known/Int64Value.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,OAAO,UAAW,SAAQ,SAAS;IACvC,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,IAAI,KAAK,CAAC,KAAa;QACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB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C;gBACjC,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;oBAC/D,OAAO,CAAC,kCAAkC,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;gBAClE,CAAC;YACH,CAAC;YACD,IAAI,UAAU,KAAK,UAAU,EAAE,CAAC;gBAC9B,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;oBACzB,OAAO,CAAC,+BAA+B,CAAC,CAAC;gBAC3C,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,QAAQ;QACN,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YACvD,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QAChC,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC;IAEM,OAAO,CAAC,sBAA+B,KAAK;QACjD,oCAAoC;QACpC,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,KAAK,EAAE,CAAC;QACxC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,SAAS,GAAG,CAAC,CAChB,mBAAmB,CAAC,iBAAiB;YACrC,mBAAmB,CAAC,eAAe,CACpC,CAAC;QACF,IAAI,YAAY,IAAI,CAAC,mBAAmB,EAAE,CAAC;YACzC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC;QACvC,CAAC;IACH,CAAC;CACF;AAED,QAAQ,CAAC,QAAQ,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC","sourcesContent":["import { FieldNode } from '../FieldNode';\nimport { Registry } from '../Registry';\nimport { FieldConstraints } from '../FieldConstraints';\nimport { OPEN_MODELS_OPTIONS } from '../OPEN_MODELS_OPTIONS';\n\nexport class Int64Value extends FieldNode {\n get value(): bigint {\n return this._value;\n }\n\n set value(value: bigint) {\n this._value = value;\n if (\n OPEN_MODELS_OPTIONS.EmitDefaultValues ||\n OPEN_MODELS_OPTIONS.EmitUnpopulated\n ) {\n this.__isEmpty = false;\n } else {\n this.__isEmpty = value === null;\n }\n\n this.__climbUpValidation();\n this.__notifyFieldValueChange(true);\n }\n\n public _value: bigint = 0n;\n\n constructor(\n initData?: string | undefined,\n parent?: FieldNode,\n parentAttributeName?: string,\n ) {\n super(undefined, parent, parentAttributeName);\n\n this.__isEmpty = !(\n OPEN_MODELS_OPTIONS.EmitDefaultValues ||\n OPEN_MODELS_OPTIONS.EmitUnpopulated\n );\n this._value = BigInt(initData || '0');\n this.__meta.typeName = 'google.protobuf.Int64Value';\n }\n\n __updateWithLiteral(v: string) {\n this._value = BigInt(v);\n if (\n OPEN_MODELS_OPTIONS.EmitDefaultValues ||\n OPEN_MODELS_OPTIONS.EmitUnpopulated\n ) {\n this.__isEmpty = false;\n } else {\n this.__isEmpty = v === null;\n }\n this.__notifyFieldValueChange(false);\n }\n\n // eslint-disable-next-line class-methods-use-this\n __mapProtoNameJsonToJson(data: number): number {\n return data;\n }\n\n __toJson(): string | null {\n return this.__toLiteral();\n }\n\n valueOf() {\n return this._value || NaN;\n }\n\n __toLiteral() {\n return this._value.toString();\n }\n\n protected __checkConstraints(\n fieldConstraints: FieldConstraints,\n ): string[] | undefined {\n // eslint-disable-next-line guard-for-in\n for (const [constraint, value] of Object.entries(fieldConstraints)) {\n if (constraint === 'maximum') {\n // By default, the minimum and maximum values are included in the range. \">\" is used to check.\n if (\n fieldConstraints.exclusive_maximum &&\n this._value !== null &&\n this._value >= value\n ) {\n return ['constraint.violation.exclusive_maximum', value, this._value];\n }\n if (this._value !== null && this._value > value) {\n return ['constraint.violation.maximum', value, this._value];\n }\n }\n if (constraint === 'minimum') {\n // By default, the minimum and maximum values are included in the range. \"<\" is used to check.\n if (\n fieldConstraints.exclusive_minimum &&\n this._value !== null &&\n this._value <= value\n ) {\n return ['constraint.violation.exclusive_minimum', value, this._value];\n }\n if (this._value !== null && this._value < value) {\n return ['constraint.violation.minimum', value, this._value];\n }\n }\n if (constraint === 'multiple_of') {\n // Use the multiple_of keyword to specify that a number must be the multiple of another number\n // use this to define the step ??\n if (this._value !== null && this._value % BigInt(value) !== 0n) {\n return ['constraint.violation.multiple_of', value, this._value];\n }\n }\n if (constraint === 'required') {\n if (this._value === null) {\n return ['constraint.violation.required'];\n }\n }\n }\n\n return undefined;\n }\n\n toString(): string {\n if (this._value !== null && !Number.isNaN(this._value)) {\n return this._value.toString();\n }\n return '';\n }\n\n public __clear(withoutNotification: boolean = false) {\n // only notify when they are changes\n const shouldNotify = this._value !== 0n;\n this._value = 0n;\n this.__isEmpty = !(\n OPEN_MODELS_OPTIONS.EmitDefaultValues ||\n OPEN_MODELS_OPTIONS.EmitUnpopulated\n );\n if (shouldNotify && !withoutNotification) {\n this.__notifyFieldValueChange(false);\n }\n }\n}\n\nRegistry.register('Int64Value', Int64Value);\n"]}
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"homepage": "https://github.com/eclipse/eclipsefuro-web/tree/main/packages",
|
|
6
6
|
"repository": "git@github.com:eclipse/eclipsefuro-web.git",
|
|
7
7
|
"author": "eclipse furo",
|
|
8
|
-
"version": "1.
|
|
8
|
+
"version": "1.8.1",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"main": "dist/index.js",
|
|
11
11
|
"module": "dist/index.js",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"prettier --write"
|
|
84
84
|
]
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "7570704310aad87fe75c81269fabfd60595d9740"
|
|
87
87
|
}
|