cx 26.4.2 → 26.4.4
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/build/data/AugmentedViewBase.d.ts.map +1 -1
- package/build/data/AugmentedViewBase.js +5 -4
- package/build/data/View.d.ts +0 -1
- package/build/data/View.d.ts.map +1 -1
- package/build/data/View.js +1 -3
- package/build/jsx-dev-runtime.d.ts +1 -0
- package/build/jsx-dev-runtime.d.ts.map +1 -1
- package/build/jsx-dev-runtime.js +1 -0
- package/build/widgets/form/LookupField.js +2 -1
- package/dist/data.js +5 -4
- package/dist/manifest.js +809 -809
- package/dist/widgets.css +9 -3
- package/dist/widgets.js +5 -1
- package/package.json +1 -1
- package/src/data/AugmentedViewBase.ts +89 -88
- package/src/data/View.ts +301 -346
- package/src/jsx-dev-runtime.ts +1 -0
- package/src/widgets/form/LookupField.scss +234 -227
- package/src/widgets/form/LookupField.tsx +4 -1
package/dist/widgets.css
CHANGED
|
@@ -1429,9 +1429,6 @@ th.cxe-calendar-display {
|
|
|
1429
1429
|
}
|
|
1430
1430
|
|
|
1431
1431
|
.cxs-single > .cxe-lookupfield-input {
|
|
1432
|
-
overflow: hidden;
|
|
1433
|
-
text-overflow: ellipsis;
|
|
1434
|
-
white-space: nowrap;
|
|
1435
1432
|
flex-basis: 0%;
|
|
1436
1433
|
flex-grow: 1;
|
|
1437
1434
|
}
|
|
@@ -1440,6 +1437,15 @@ th.cxe-calendar-display {
|
|
|
1440
1437
|
padding-left: 26px;
|
|
1441
1438
|
}
|
|
1442
1439
|
|
|
1440
|
+
.cxe-lookupfield-text {
|
|
1441
|
+
overflow: hidden;
|
|
1442
|
+
text-overflow: ellipsis;
|
|
1443
|
+
white-space: nowrap;
|
|
1444
|
+
min-width: 0;
|
|
1445
|
+
flex-basis: 0%;
|
|
1446
|
+
flex-grow: 1;
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1443
1449
|
.cxe-lookupfield-tags {
|
|
1444
1450
|
display: flex;
|
|
1445
1451
|
margin: -2px -2px -2px -2px;
|
package/dist/widgets.js
CHANGED
|
@@ -9153,7 +9153,11 @@ class LookupComponent extends VDOM.Component {
|
|
|
9153
9153
|
text = this.getPlaceholder(data.placeholder);
|
|
9154
9154
|
}
|
|
9155
9155
|
} else {
|
|
9156
|
-
|
|
9156
|
+
let content = !data.empty ? data.text || this.getPlaceholder() : this.getPlaceholder(data.placeholder);
|
|
9157
|
+
text = jsx("span", {
|
|
9158
|
+
className: CSS.element(baseClass, "text"),
|
|
9159
|
+
children: content,
|
|
9160
|
+
});
|
|
9157
9161
|
}
|
|
9158
9162
|
let states = {
|
|
9159
9163
|
visited: state.visited,
|
package/package.json
CHANGED
|
@@ -1,88 +1,89 @@
|
|
|
1
|
-
import { View, ViewConfig } from "./View";
|
|
2
|
-
import { Binding } from "./Binding";
|
|
3
|
-
|
|
4
|
-
export interface AugmentedViewBaseConfig extends ViewConfig {
|
|
5
|
-
store: View<any>;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export class AugmentedViewBase<D = any> extends View<D> {
|
|
9
|
-
declare immutable: boolean;
|
|
10
|
-
declare store: View;
|
|
11
|
-
|
|
12
|
-
constructor(config: AugmentedViewBaseConfig) {
|
|
13
|
-
super(config);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
getData() {
|
|
17
|
-
if (this.sealed && this.meta.version === this.cache.version && this.meta === this.store.meta)
|
|
18
|
-
return this.cache.result;
|
|
19
|
-
let parentStoreData = this.store.getData();
|
|
20
|
-
let result = this.getBaseData(parentStoreData);
|
|
21
|
-
this.embedAugmentData(result, parentStoreData);
|
|
22
|
-
this.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return parentStoreData;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
let
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
1
|
+
import { View, ViewConfig } from "./View";
|
|
2
|
+
import { Binding } from "./Binding";
|
|
3
|
+
|
|
4
|
+
export interface AugmentedViewBaseConfig extends ViewConfig {
|
|
5
|
+
store: View<any>;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export class AugmentedViewBase<D = any> extends View<D> {
|
|
9
|
+
declare immutable: boolean;
|
|
10
|
+
declare store: View;
|
|
11
|
+
|
|
12
|
+
constructor(config: AugmentedViewBaseConfig) {
|
|
13
|
+
super(config);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
getData() {
|
|
17
|
+
if (this.sealed && this.meta.version === this.cache.version && this.meta === this.store.meta)
|
|
18
|
+
return this.cache.result;
|
|
19
|
+
let parentStoreData = this.store.getData();
|
|
20
|
+
let result = this.getBaseData(parentStoreData);
|
|
21
|
+
this.embedAugmentData(result, parentStoreData);
|
|
22
|
+
if (this.sealed) {
|
|
23
|
+
this.cache.result = result;
|
|
24
|
+
this.cache.version = this.meta.version;
|
|
25
|
+
}
|
|
26
|
+
this.meta = this.store.meta;
|
|
27
|
+
return result;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
protected getBaseData(parentStoreData: any): any {
|
|
31
|
+
if (this.sealed || this.immutable || this.store.sealed) return { ...parentStoreData };
|
|
32
|
+
return parentStoreData;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
protected embedAugmentData(result: any, parentStoreData: any): void {
|
|
36
|
+
throw new Error("abstract");
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
protected isExtraKey(key: string): boolean {
|
|
40
|
+
throw new Error("abstract");
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Stores which need to support nested aliases should override this method
|
|
44
|
+
protected getExtraKeyBinding(key: string): any {
|
|
45
|
+
let binding = Binding.get(key);
|
|
46
|
+
return this.isExtraKey(binding.parts[0]) ? Binding.get(binding.parts[0]) : null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
protected setExtraKeyValue(key: string, value: any): boolean {
|
|
50
|
+
throw new Error("abstract");
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
protected deleteExtraKeyValue(key: string): boolean {
|
|
54
|
+
throw new Error("abstract");
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
setItem(path: string, value: any): boolean {
|
|
58
|
+
let extraKeyBinding = this.getExtraKeyBinding(path);
|
|
59
|
+
if (extraKeyBinding) {
|
|
60
|
+
let binding = Binding.get(path);
|
|
61
|
+
let newValue = value;
|
|
62
|
+
if (binding.parts.length > extraKeyBinding.parts.length) {
|
|
63
|
+
let data = {};
|
|
64
|
+
this.embedAugmentData(data, this.store.getData());
|
|
65
|
+
let binding = Binding.get(path);
|
|
66
|
+
data = binding.set(data, value);
|
|
67
|
+
newValue = extraKeyBinding.value(data);
|
|
68
|
+
}
|
|
69
|
+
return this.setExtraKeyValue(extraKeyBinding.path, newValue);
|
|
70
|
+
}
|
|
71
|
+
return super.setItem(path, value);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
deleteItem(path: string): boolean {
|
|
75
|
+
let extraKeyBinding = this.getExtraKeyBinding(path);
|
|
76
|
+
if (extraKeyBinding) {
|
|
77
|
+
if (path == extraKeyBinding.path) return this.deleteExtraKeyValue(extraKeyBinding.path);
|
|
78
|
+
let data = {};
|
|
79
|
+
this.embedAugmentData(data, this.store.getData());
|
|
80
|
+
let binding = Binding.get(path);
|
|
81
|
+
data = binding.delete(data);
|
|
82
|
+
let newValue = extraKeyBinding.value(data);
|
|
83
|
+
return this.setExtraKeyValue(extraKeyBinding.path, newValue);
|
|
84
|
+
}
|
|
85
|
+
return super.deleteItem(path);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
AugmentedViewBase.prototype.immutable = false;
|