x4js 1.5.27 → 1.5.31
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/cjs/index.js +7 -7
- package/lib/cjs/index.js.map +4 -4
- package/lib/esm/index.mjs +3295 -3186
- package/lib/esm/index.mjs.map +4 -4
- package/lib/src/autocomplete.ts +22 -5
- package/lib/src/combobox.ts +42 -2
- package/lib/src/component.ts +14 -0
- package/lib/src/datastore.ts +6 -2
- package/lib/src/form.ts +43 -5
- package/lib/src/icon.ts +8 -0
- package/lib/src/image.ts +38 -17
- package/lib/src/input.ts +44 -4
- package/lib/src/router.ts +7 -3
- package/lib/src/textedit.ts +15 -26
- package/lib/src/version.ts +1 -1
- package/lib/src/x4.less +3 -5
- package/lib/styles/x4.css +2 -2
- package/lib/styles/x4.less +3 -5
- package/lib/types/autocomplete.d.ts +5 -1
- package/lib/types/combobox.d.ts +7 -3
- package/lib/types/component.d.ts +1 -0
- package/lib/types/form.d.ts +12 -3
- package/lib/types/image.d.ts +3 -2
- package/lib/types/input.d.ts +6 -0
- package/lib/types/router.d.ts +1 -1
- package/lib/types/textedit.d.ts +5 -2
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/lib/src/version.ts
CHANGED
package/lib/src/x4.less
CHANGED
|
@@ -665,11 +665,9 @@ textarea {
|
|
|
665
665
|
padding-right: 2px;
|
|
666
666
|
}
|
|
667
667
|
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
border-left: 4px solid var( --x4-error-color );
|
|
672
|
-
}
|
|
668
|
+
input.x-error {
|
|
669
|
+
border-bottom: none;
|
|
670
|
+
border-left: 4px solid var( --x4-error-color );
|
|
673
671
|
}
|
|
674
672
|
}
|
|
675
673
|
|
package/lib/styles/x4.css
CHANGED
|
@@ -552,8 +552,8 @@ textarea::selection {
|
|
|
552
552
|
content: '*';
|
|
553
553
|
padding-right: 2px;
|
|
554
554
|
}
|
|
555
|
-
.x-text-edit.x-error
|
|
556
|
-
.x-combo-box.x-error
|
|
555
|
+
.x-text-edit input.x-error,
|
|
556
|
+
.x-combo-box input.x-error {
|
|
557
557
|
border-bottom: none;
|
|
558
558
|
border-left: 4px solid var(--x4-error-color);
|
|
559
559
|
}
|
package/lib/styles/x4.less
CHANGED
|
@@ -665,11 +665,9 @@ textarea {
|
|
|
665
665
|
padding-right: 2px;
|
|
666
666
|
}
|
|
667
667
|
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
border-left: 4px solid var( --x4-error-color );
|
|
672
|
-
}
|
|
668
|
+
input.x-error {
|
|
669
|
+
border-bottom: none;
|
|
670
|
+
border-left: 4px solid var( --x4-error-color );
|
|
673
671
|
}
|
|
674
672
|
}
|
|
675
673
|
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
27
27
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
28
28
|
**/
|
|
29
|
+
import { RenderListItem } from "./listview";
|
|
29
30
|
import { TextEdit, TextEditProps } from './textedit';
|
|
30
31
|
/**
|
|
31
32
|
*
|
|
@@ -33,6 +34,7 @@ import { TextEdit, TextEditProps } from './textedit';
|
|
|
33
34
|
interface AutoCompleteProps extends TextEditProps {
|
|
34
35
|
enumValues: (filter: string) => string[] | Promise<string[]>;
|
|
35
36
|
selectValue?: (text: string) => string;
|
|
37
|
+
renderItem?: RenderListItem;
|
|
36
38
|
}
|
|
37
39
|
/**
|
|
38
40
|
*
|
|
@@ -46,14 +48,16 @@ export declare class AutoComplete extends TextEdit<AutoCompleteProps> {
|
|
|
46
48
|
_onKey(e: KeyboardEvent): void;
|
|
47
49
|
private _onChange;
|
|
48
50
|
componentDisposed(): void;
|
|
51
|
+
showPopup(show?: boolean): void;
|
|
49
52
|
/**
|
|
50
53
|
* display the popup
|
|
51
54
|
*/
|
|
52
|
-
|
|
55
|
+
private _showPopup;
|
|
53
56
|
protected _validate(value: string): boolean;
|
|
54
57
|
validate(): boolean;
|
|
55
58
|
private _checkFocus;
|
|
56
59
|
private _hidePopup;
|
|
57
60
|
private _onFocus;
|
|
61
|
+
isPopupVisible(): boolean;
|
|
58
62
|
}
|
|
59
63
|
export {};
|
package/lib/types/combobox.d.ts
CHANGED
|
@@ -26,9 +26,6 @@
|
|
|
26
26
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
27
27
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
28
28
|
**/
|
|
29
|
-
/**
|
|
30
|
-
* TODO: replace custom combo list by listview or gridview
|
|
31
|
-
*/
|
|
32
29
|
import { Component, CProps, ContainerEventMap } from './component';
|
|
33
30
|
import { EvChange, EvSelectionChange, EventCallback } from './x4events';
|
|
34
31
|
import { Input } from './input';
|
|
@@ -52,6 +49,7 @@ export interface ComboBoxProps extends CProps<ComboBoxEventMap> {
|
|
|
52
49
|
tabIndex?: number | boolean;
|
|
53
50
|
name?: string;
|
|
54
51
|
readOnly?: boolean;
|
|
52
|
+
required?: true;
|
|
55
53
|
label?: string;
|
|
56
54
|
labelWidth?: number;
|
|
57
55
|
labelAlign?: 'left' | 'right';
|
|
@@ -82,6 +80,12 @@ export declare class ComboBox extends HLayout<ComboBoxProps, ComboBoxEventMap> {
|
|
|
82
80
|
* display the popup
|
|
83
81
|
*/
|
|
84
82
|
showPopup(filter_items?: boolean): ListViewItem[];
|
|
83
|
+
/**
|
|
84
|
+
*
|
|
85
|
+
*/
|
|
86
|
+
validate(): boolean;
|
|
87
|
+
showError(text: string): void;
|
|
88
|
+
clearError(): void;
|
|
85
89
|
/** @ignore
|
|
86
90
|
*/
|
|
87
91
|
private _selectItem;
|
package/lib/types/component.d.ts
CHANGED
package/lib/types/form.d.ts
CHANGED
|
@@ -26,21 +26,26 @@
|
|
|
26
26
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
27
27
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
28
28
|
**/
|
|
29
|
-
import { Component, Container, CProps, ContainerEventMap, ComponentContent } from './component';
|
|
29
|
+
import { Component, Container, CProps, ContainerEventMap, ComponentContent, EventHandler } from './component';
|
|
30
30
|
import { HLayout, VLayout } from './layout';
|
|
31
31
|
import { Button } from './button';
|
|
32
32
|
import { RequestProps } from './request';
|
|
33
|
-
import {
|
|
33
|
+
import { BasicEvent } from './x4events';
|
|
34
34
|
import { EvBtnClick } from './dialog';
|
|
35
|
+
export interface EvDirty extends BasicEvent {
|
|
36
|
+
dirty: boolean;
|
|
37
|
+
}
|
|
35
38
|
export type FormBtn = 'ok' | 'cancel' | 'ignore' | 'yes' | 'no' | 'close' | 'save' | 'dontsave';
|
|
36
39
|
export type FormButtons = (FormBtn | Button | Component)[];
|
|
37
40
|
export interface FormEventMap extends ContainerEventMap {
|
|
38
41
|
btnClick?: EvBtnClick;
|
|
42
|
+
dirty?: EvDirty;
|
|
39
43
|
}
|
|
40
44
|
export interface FormProps extends CProps<FormEventMap> {
|
|
41
45
|
disableSuggestions?: boolean;
|
|
42
46
|
buttons?: FormButtons;
|
|
43
|
-
btnClick?:
|
|
47
|
+
btnClick?: EventHandler<EvBtnClick>;
|
|
48
|
+
dirty?: EventHandler<EvDirty>;
|
|
44
49
|
}
|
|
45
50
|
/**
|
|
46
51
|
*
|
|
@@ -107,6 +112,10 @@ export declare class Form<T extends FormProps = FormProps, E extends FormEventMa
|
|
|
107
112
|
*
|
|
108
113
|
*/
|
|
109
114
|
setValues(values: any): void;
|
|
115
|
+
/**
|
|
116
|
+
*
|
|
117
|
+
*/
|
|
118
|
+
clearValues(): void;
|
|
110
119
|
/**
|
|
111
120
|
* values are not escaped
|
|
112
121
|
* checkbox set true when checked
|
package/lib/types/image.d.ts
CHANGED
|
@@ -27,11 +27,12 @@
|
|
|
27
27
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
28
28
|
**/
|
|
29
29
|
import { Component, CProps } from './component';
|
|
30
|
-
interface ImageProps extends CProps {
|
|
30
|
+
export interface ImageProps extends CProps {
|
|
31
31
|
src: string;
|
|
32
32
|
alt?: string;
|
|
33
33
|
lazy?: boolean;
|
|
34
34
|
alignment?: 'fill' | 'contain' | 'cover' | 'scale-down' | 'none';
|
|
35
|
+
overlays?: Component[];
|
|
35
36
|
}
|
|
36
37
|
/**
|
|
37
38
|
* Standard image class
|
|
@@ -39,6 +40,7 @@ interface ImageProps extends CProps {
|
|
|
39
40
|
export declare class Image extends Component<ImageProps> {
|
|
40
41
|
protected m_created: boolean;
|
|
41
42
|
protected m_lazysrc: string;
|
|
43
|
+
private m_img;
|
|
42
44
|
constructor(props: ImageProps);
|
|
43
45
|
/** @ignore */
|
|
44
46
|
render(): void;
|
|
@@ -52,4 +54,3 @@ export declare class Image extends Component<ImageProps> {
|
|
|
52
54
|
private static lazy_image_timer;
|
|
53
55
|
private static lazyWatch;
|
|
54
56
|
}
|
|
55
|
-
export {};
|
package/lib/types/input.d.ts
CHANGED
|
@@ -55,19 +55,25 @@ export interface InputProps<P extends InputEventMap = InputEventMap> extends CPr
|
|
|
55
55
|
* CARE derived classes must set this.ui.input
|
|
56
56
|
*/
|
|
57
57
|
export declare class Input extends Component<InputProps, InputEventMap> {
|
|
58
|
+
private m_error_tip;
|
|
58
59
|
constructor(props: InputProps);
|
|
60
|
+
componentDisposed(): void;
|
|
59
61
|
/** @ignore */
|
|
60
62
|
render(props: InputProps): void;
|
|
63
|
+
showError(text: string): void;
|
|
64
|
+
clearError(): void;
|
|
61
65
|
getType(): EditType;
|
|
62
66
|
/**
|
|
63
67
|
* return the current editor value
|
|
64
68
|
*/
|
|
65
69
|
get value(): string;
|
|
70
|
+
getValue(): string;
|
|
66
71
|
/**
|
|
67
72
|
* Change the editor value
|
|
68
73
|
* @param value - new value to set
|
|
69
74
|
*/
|
|
70
75
|
set value(value: string);
|
|
76
|
+
setValue(value: string): void;
|
|
71
77
|
getStoreValue(): any;
|
|
72
78
|
setStoreValue(v: any): void;
|
|
73
79
|
set readOnly(ro: boolean);
|
package/lib/types/router.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ export declare class Router extends EventSource<RouterEventMap> {
|
|
|
61
61
|
get(uri: string | RegExp, handler: RouteHandler): void;
|
|
62
62
|
init(): void;
|
|
63
63
|
private _getLocation;
|
|
64
|
-
navigate(uri: string, notify?: boolean): void;
|
|
64
|
+
navigate(uri: string, notify?: boolean, replace?: boolean): void;
|
|
65
65
|
private _find;
|
|
66
66
|
}
|
|
67
67
|
export {};
|
package/lib/types/textedit.d.ts
CHANGED
|
@@ -59,10 +59,8 @@ export interface TextEditProps extends InputProps<TextEditEventMap> {
|
|
|
59
59
|
export declare class TextEdit<T extends TextEditProps = TextEditProps, E extends TextEditEventMap = TextEditEventMap> extends Component<T, E> {
|
|
60
60
|
private m_cal_popup;
|
|
61
61
|
protected m_ui_input: Input;
|
|
62
|
-
private m_error_tip;
|
|
63
62
|
constructor(props: T);
|
|
64
63
|
componentCreated(): void;
|
|
65
|
-
componentDisposed(): void;
|
|
66
64
|
focus(): void;
|
|
67
65
|
/** @ignore */
|
|
68
66
|
render(props: TextEditProps): void;
|
|
@@ -82,7 +80,12 @@ export declare class TextEdit<T extends TextEditProps = TextEditProps, E extends
|
|
|
82
80
|
showError(text: string): void;
|
|
83
81
|
clearError(): void;
|
|
84
82
|
get value(): string;
|
|
83
|
+
getValue(): string;
|
|
84
|
+
/**
|
|
85
|
+
*
|
|
86
|
+
*/
|
|
85
87
|
set value(value: string);
|
|
88
|
+
setValue(value: string): void;
|
|
86
89
|
/**
|
|
87
90
|
* select all the text
|
|
88
91
|
*/
|
package/lib/types/version.d.ts
CHANGED