x4js 1.4.8 → 1.4.11
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.sh +5 -0
- package/lib/application.d.ts +15 -11
- package/lib/application.js +15 -11
- package/lib/base64.d.ts +15 -11
- package/lib/base64.js +15 -11
- package/lib/base_component.d.ts +18 -1
- package/lib/base_component.js +18 -1
- package/lib/button.d.ts +15 -11
- package/lib/button.js +15 -11
- package/lib/calendar.d.ts +15 -11
- package/lib/calendar.js +29 -22
- package/lib/canvas.d.ts +15 -11
- package/lib/canvas.js +15 -11
- package/lib/cardview.d.ts +15 -11
- package/lib/cardview.js +15 -11
- package/lib/checkbox.d.ts +17 -12
- package/lib/checkbox.js +18 -11
- package/lib/color.d.ts +15 -11
- package/lib/color.js +15 -11
- package/lib/colorpicker.d.ts +18 -11
- package/lib/colorpicker.js +18 -11
- package/lib/combobox.d.ts +15 -11
- package/lib/combobox.js +16 -12
- package/lib/component.d.ts +19 -15
- package/lib/component.js +19 -15
- package/lib/datastore.d.ts +15 -11
- package/lib/datastore.js +16 -12
- package/lib/dialog.d.ts +15 -11
- package/lib/dialog.js +19 -14
- package/lib/dom_events.d.ts +17 -1
- package/lib/dom_events.js +17 -1
- package/lib/drag_manager.d.ts +28 -0
- package/lib/drawtext.d.ts +15 -11
- package/lib/drawtext.js +15 -11
- package/lib/fileupload.d.ts +15 -11
- package/lib/fileupload.js +15 -11
- package/lib/form.d.ts +15 -11
- package/lib/form.js +15 -11
- package/lib/formatters.d.ts +15 -11
- package/lib/formatters.js +16 -11
- package/lib/gridview.d.ts +15 -11
- package/lib/gridview.js +59 -29
- package/lib/i18n.d.ts +15 -11
- package/lib/i18n.js +15 -11
- package/lib/icon.d.ts +20 -12
- package/lib/icon.js +107 -25
- package/lib/image.d.ts +15 -11
- package/lib/image.js +15 -11
- package/lib/index.d.ts +28 -0
- package/lib/index.js +28 -0
- package/lib/input.d.ts +15 -11
- package/lib/input.js +15 -11
- package/lib/label.d.ts +15 -11
- package/lib/label.js +15 -11
- package/lib/layout.d.ts +27 -17
- package/lib/layout.js +61 -18
- package/lib/link.d.ts +15 -11
- package/lib/link.js +15 -11
- package/lib/listview.d.ts +18 -14
- package/lib/listview.js +16 -23
- package/lib/md5.d.ts +16 -11
- package/lib/md5.js +16 -10
- package/lib/menu.d.ts +15 -11
- package/lib/menu.js +19 -12
- package/lib/messagebox.d.ts +15 -11
- package/lib/messagebox.js +17 -13
- package/lib/panel.d.ts +15 -11
- package/lib/panel.js +15 -11
- package/lib/popup.d.ts +15 -11
- package/lib/popup.js +20 -18
- package/lib/property_editor.d.ts +15 -11
- package/lib/property_editor.js +15 -11
- package/lib/radiobtn.d.ts +15 -11
- package/lib/radiobtn.js +15 -11
- package/lib/rating.d.ts +15 -11
- package/lib/rating.js +15 -11
- package/lib/request.d.ts +15 -11
- package/lib/request.js +16 -12
- package/lib/router.d.ts +28 -0
- package/lib/router.js +28 -0
- package/lib/settings.d.ts +15 -11
- package/lib/settings.js +15 -11
- package/lib/sidebarview.d.ts +15 -11
- package/lib/sidebarview.js +15 -11
- package/lib/smartedit.d.ts +15 -11
- package/lib/smartedit.js +15 -11
- package/lib/spreadsheet.d.ts +15 -11
- package/lib/spreadsheet.js +15 -11
- package/lib/styles.d.ts +16 -12
- package/lib/styles.js +21 -14
- package/lib/svgcomponent.d.ts +15 -11
- package/lib/svgcomponent.js +15 -11
- package/lib/tabbar.d.ts +17 -2
- package/lib/tabbar.js +17 -2
- package/lib/tabview.d.ts +15 -11
- package/lib/tabview.js +15 -11
- package/lib/textarea.d.ts +15 -11
- package/lib/textarea.js +15 -11
- package/lib/textedit.d.ts +15 -11
- package/lib/textedit.js +16 -12
- package/lib/texthiliter.d.ts +15 -11
- package/lib/texthiliter.js +15 -11
- package/lib/toaster.d.ts +15 -11
- package/lib/toaster.js +15 -11
- package/lib/tools.d.ts +15 -11
- package/lib/tools.js +17 -12
- package/lib/tooltips.d.ts +15 -11
- package/lib/tooltips.js +16 -12
- package/lib/treeview.d.ts +15 -11
- package/lib/treeview.js +15 -11
- package/{x4.css → lib/x4.css} +269 -106
- package/lib/x4_events.d.ts +17 -12
- package/lib/x4_events.js +24 -14
- package/package.json +5 -1
- package/src/MIT-license.md +14 -0
- package/src/application.ts +15 -11
- package/src/base64.ts +15 -11
- package/src/base_component.ts +18 -1
- package/src/button.ts +15 -11
- package/src/calendar.ts +30 -22
- package/src/canvas.ts +22 -18
- package/src/cardview.ts +15 -11
- package/src/checkbox.ts +21 -12
- package/src/color.ts +15 -11
- package/src/colorpicker.ts +19 -11
- package/src/combobox.ts +16 -12
- package/src/component.ts +21 -16
- package/src/datastore.ts +16 -12
- package/src/dialog.ts +19 -14
- package/src/dom_events.ts +17 -1
- package/src/drag_manager.ts +28 -0
- package/src/drawtext.ts +15 -11
- package/src/fileupload.ts +15 -11
- package/src/form.ts +15 -11
- package/src/formatters.ts +19 -12
- package/src/gridview.ts +76 -30
- package/src/i18n.ts +15 -11
- package/src/icon.ts +125 -33
- package/src/image.ts +15 -11
- package/src/index.ts +29 -0
- package/src/input.ts +15 -11
- package/src/label.ts +15 -11
- package/src/layout.ts +75 -20
- package/src/link.ts +15 -11
- package/src/listview.ts +18 -14
- package/src/md5.ts +16 -10
- package/src/menu.ts +19 -12
- package/src/messagebox.ts +17 -13
- package/src/panel.ts +15 -11
- package/src/popup.ts +20 -19
- package/src/property_editor.ts +15 -11
- package/src/radiobtn.ts +15 -11
- package/src/rating.ts +15 -11
- package/src/request.ts +16 -12
- package/src/router.ts +28 -0
- package/src/settings.ts +15 -11
- package/src/sidebarview.ts +15 -11
- package/src/smartedit.ts +15 -11
- package/src/spreadsheet.ts +15 -11
- package/src/styles.ts +23 -14
- package/src/svgcomponent.ts +15 -11
- package/src/tabbar.ts +17 -2
- package/src/tabview.ts +15 -11
- package/src/textarea.ts +15 -11
- package/src/textedit.ts +17 -13
- package/src/texthiliter.ts +15 -11
- package/src/toaster.ts +15 -11
- package/src/tools.ts +18 -12
- package/src/tooltips.ts +16 -12
- package/src/treeview.ts +15 -11
- package/src/x4.less +289 -120
- package/src/x4_events.ts +27 -16
- package/tsconfig.json +1 -1
package/lib/x4_events.d.ts
CHANGED
|
@@ -7,20 +7,24 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @file observable.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
|
-
* @license
|
|
11
|
-
* Copyright (c) 2019-2021 R-libre ingenierie
|
|
12
10
|
*
|
|
13
|
-
*
|
|
14
|
-
* it under the terms of the GNU General Public License as published by
|
|
15
|
-
* the Free Software Foundation; either version 3 of the License, or
|
|
16
|
-
* (at your option) any later version.
|
|
11
|
+
* Copyright (c) 2019-2022 R-libre ingenierie
|
|
17
12
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
13
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
15
|
+
* in the Software without restriction, including without limitation the rights
|
|
16
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
17
|
+
* of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
18
|
+
* subject to the following conditions:
|
|
19
|
+
* The above copyright notice and this permission notice shall be included in all copies
|
|
20
|
+
* or substantial portions of the Software.
|
|
22
21
|
*
|
|
23
|
-
*
|
|
22
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
23
|
+
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
24
|
+
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
25
|
+
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
26
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
27
|
+
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
24
28
|
**/
|
|
25
29
|
export declare type EventCallback<T extends BasicEvent = BasicEvent> = (event: T) => any;
|
|
26
30
|
export interface EventDisposer {
|
|
@@ -244,7 +248,8 @@ export declare class EventSource<Q extends EventMap, T extends EventTypes = MapE
|
|
|
244
248
|
* @param eventName - event name
|
|
245
249
|
* @param callback - callback to remove (must be the same as in on )
|
|
246
250
|
*/
|
|
247
|
-
off(
|
|
251
|
+
off<K extends keyof Q>(type: K, callback: (ev: Q[K]) => any): void;
|
|
252
|
+
_off(eventName: string, callback: EventCallback): void;
|
|
248
253
|
/**
|
|
249
254
|
* remove all listeners for an event
|
|
250
255
|
* @param eventName - event name
|
package/lib/x4_events.js
CHANGED
|
@@ -8,20 +8,24 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @file observable.ts
|
|
10
10
|
* @author Etienne Cochard
|
|
11
|
-
* @license
|
|
12
|
-
* Copyright (c) 2019-2021 R-libre ingenierie
|
|
13
11
|
*
|
|
14
|
-
*
|
|
15
|
-
* it under the terms of the GNU General Public License as published by
|
|
16
|
-
* the Free Software Foundation; either version 3 of the License, or
|
|
17
|
-
* (at your option) any later version.
|
|
12
|
+
* Copyright (c) 2019-2022 R-libre ingenierie
|
|
18
13
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
14
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
15
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
16
|
+
* in the Software without restriction, including without limitation the rights
|
|
17
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
18
|
+
* of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
19
|
+
* subject to the following conditions:
|
|
20
|
+
* The above copyright notice and this permission notice shall be included in all copies
|
|
21
|
+
* or substantial portions of the Software.
|
|
23
22
|
*
|
|
24
|
-
*
|
|
23
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
24
|
+
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
25
|
+
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
26
|
+
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
27
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
28
|
+
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
25
29
|
**/
|
|
26
30
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
31
|
exports.EventSource = exports.EvDrag = exports.EvMessage = exports.EvTimer = exports.EvContextMenu = exports.EvSelectionChange = exports.EvChange = exports.EvClick = exports.BasicEvent = void 0;
|
|
@@ -232,11 +236,12 @@ class EventSource {
|
|
|
232
236
|
* the system may overflow
|
|
233
237
|
*/
|
|
234
238
|
once(type, callback) {
|
|
239
|
+
//@ts-ignore
|
|
235
240
|
this._once(type, callback);
|
|
236
241
|
}
|
|
237
242
|
_once(eventName, callback) {
|
|
238
243
|
const newCallback = (ev) => {
|
|
239
|
-
this.
|
|
244
|
+
this._off(eventName, newCallback);
|
|
240
245
|
callback(ev);
|
|
241
246
|
};
|
|
242
247
|
this._on(eventName, newCallback);
|
|
@@ -313,6 +318,7 @@ class EventSource {
|
|
|
313
318
|
* @param capturing - if true, capture event before other registred event handlers
|
|
314
319
|
*/
|
|
315
320
|
on(type, callback) {
|
|
321
|
+
//@ts-ignore
|
|
316
322
|
return this._on(type, callback);
|
|
317
323
|
}
|
|
318
324
|
_on(eventName, callback, capturing = false) {
|
|
@@ -333,7 +339,7 @@ class EventSource {
|
|
|
333
339
|
}
|
|
334
340
|
}
|
|
335
341
|
return {
|
|
336
|
-
dispose: () => { this.
|
|
342
|
+
dispose: () => { this._off(eventName, callback); }
|
|
337
343
|
};
|
|
338
344
|
}
|
|
339
345
|
/**
|
|
@@ -341,7 +347,11 @@ class EventSource {
|
|
|
341
347
|
* @param eventName - event name
|
|
342
348
|
* @param callback - callback to remove (must be the same as in on )
|
|
343
349
|
*/
|
|
344
|
-
off(
|
|
350
|
+
off(type, callback) {
|
|
351
|
+
//@ts-ignore
|
|
352
|
+
return this._off(type, callback);
|
|
353
|
+
}
|
|
354
|
+
_off(eventName, callback) {
|
|
345
355
|
if (!this.m_eventRegistry) {
|
|
346
356
|
return;
|
|
347
357
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x4js",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.11",
|
|
4
4
|
"description": "X4js core files",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
7
|
+
"style": "lib/x4.css",
|
|
7
8
|
"repository": {
|
|
8
9
|
"type": "git",
|
|
9
10
|
"url": "git+https://github.com/rlibre/x4js.git"
|
|
@@ -12,6 +13,9 @@
|
|
|
12
13
|
"typescript",
|
|
13
14
|
"framework"
|
|
14
15
|
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "build.sh"
|
|
18
|
+
},
|
|
15
19
|
"author": "etienne cochard",
|
|
16
20
|
"license": "MIT",
|
|
17
21
|
"bugs": {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# MIT LICENSE #
|
|
2
|
+
|
|
3
|
+
**Copyright (c) 2019-2022 R-libre ingenierie**
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
7
|
+
of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
8
|
+
|
|
9
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
10
|
+
|
|
11
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
12
|
+
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
13
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
14
|
+
|
package/src/application.ts
CHANGED
|
@@ -7,20 +7,24 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @file application.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
|
-
* @license
|
|
11
|
-
* Copyright (c) 2019-2021 R-libre ingenierie
|
|
12
10
|
*
|
|
13
|
-
*
|
|
14
|
-
* it under the terms of the GNU General Public License as published by
|
|
15
|
-
* the Free Software Foundation; either version 3 of the License, or
|
|
16
|
-
* (at your option) any later version.
|
|
11
|
+
* Copyright (c) 2019-2022 R-libre ingenierie
|
|
17
12
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
13
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
15
|
+
* in the Software without restriction, including without limitation the rights
|
|
16
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
17
|
+
* of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
18
|
+
* subject to the following conditions:
|
|
19
|
+
* The above copyright notice and this permission notice shall be included in all copies
|
|
20
|
+
* or substantial portions of the Software.
|
|
22
21
|
*
|
|
23
|
-
*
|
|
22
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
23
|
+
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
24
|
+
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
25
|
+
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
26
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
27
|
+
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
24
28
|
**/
|
|
25
29
|
|
|
26
30
|
import { EvMessage } from './x4_events'
|
package/src/base64.ts
CHANGED
|
@@ -7,20 +7,24 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @file base64.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
|
-
* @license
|
|
11
|
-
* Copyright (c) 2019-2021 R-libre ingenierie
|
|
12
10
|
*
|
|
13
|
-
*
|
|
14
|
-
* it under the terms of the GNU General Public License as published by
|
|
15
|
-
* the Free Software Foundation; either version 3 of the License, or
|
|
16
|
-
* (at your option) any later version.
|
|
11
|
+
* Copyright (c) 2019-2022 R-libre ingenierie
|
|
17
12
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
13
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
15
|
+
* in the Software without restriction, including without limitation the rights
|
|
16
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
17
|
+
* of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
18
|
+
* subject to the following conditions:
|
|
19
|
+
* The above copyright notice and this permission notice shall be included in all copies
|
|
20
|
+
* or substantial portions of the Software.
|
|
22
21
|
*
|
|
23
|
-
*
|
|
22
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
23
|
+
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
24
|
+
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
25
|
+
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
26
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
27
|
+
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
24
28
|
**/
|
|
25
29
|
|
|
26
30
|
const _alphabet: string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
package/src/base_component.ts
CHANGED
|
@@ -7,7 +7,24 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @file base_component.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
|
-
*
|
|
10
|
+
*
|
|
11
|
+
* Copyright (c) 2019-2022 R-libre ingenierie
|
|
12
|
+
*
|
|
13
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
15
|
+
* in the Software without restriction, including without limitation the rights
|
|
16
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
17
|
+
* of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
18
|
+
* subject to the following conditions:
|
|
19
|
+
* The above copyright notice and this permission notice shall be included in all copies
|
|
20
|
+
* or substantial portions of the Software.
|
|
21
|
+
*
|
|
22
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
23
|
+
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
24
|
+
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
25
|
+
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
26
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
27
|
+
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
11
28
|
*
|
|
12
29
|
**/
|
|
13
30
|
|
package/src/button.ts
CHANGED
|
@@ -7,20 +7,24 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @file button.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
|
-
* @license
|
|
11
|
-
* Copyright (c) 2019-2021 R-libre ingenierie
|
|
12
10
|
*
|
|
13
|
-
*
|
|
14
|
-
* it under the terms of the GNU General Public License as published by
|
|
15
|
-
* the Free Software Foundation; either version 3 of the License, or
|
|
16
|
-
* (at your option) any later version.
|
|
11
|
+
* Copyright (c) 2019-2022 R-libre ingenierie
|
|
17
12
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
13
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
15
|
+
* in the Software without restriction, including without limitation the rights
|
|
16
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
17
|
+
* of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
18
|
+
* subject to the following conditions:
|
|
19
|
+
* The above copyright notice and this permission notice shall be included in all copies
|
|
20
|
+
* or substantial portions of the Software.
|
|
22
21
|
*
|
|
23
|
-
*
|
|
22
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
23
|
+
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
24
|
+
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
25
|
+
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
26
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
27
|
+
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
24
28
|
**/
|
|
25
29
|
|
|
26
30
|
|
package/src/calendar.ts
CHANGED
|
@@ -7,20 +7,24 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @file calendar.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
|
-
* @license
|
|
11
|
-
* Copyright (c) 2019-2021 R-libre ingenierie
|
|
12
10
|
*
|
|
13
|
-
*
|
|
14
|
-
* it under the terms of the GNU General Public License as published by
|
|
15
|
-
* the Free Software Foundation; either version 3 of the License, or
|
|
16
|
-
* (at your option) any later version.
|
|
11
|
+
* Copyright (c) 2019-2022 R-libre ingenierie
|
|
17
12
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
13
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
15
|
+
* in the Software without restriction, including without limitation the rights
|
|
16
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
17
|
+
* of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
18
|
+
* subject to the following conditions:
|
|
19
|
+
* The above copyright notice and this permission notice shall be included in all copies
|
|
20
|
+
* or substantial portions of the Software.
|
|
22
21
|
*
|
|
23
|
-
*
|
|
22
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
23
|
+
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
24
|
+
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
25
|
+
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
26
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
27
|
+
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
24
28
|
**/
|
|
25
29
|
|
|
26
30
|
import { Button } from './button';
|
|
@@ -163,17 +167,21 @@ export class Calendar extends VLayout<CalendarProps, CalendarEventMap>
|
|
|
163
167
|
cls += ' out';
|
|
164
168
|
}
|
|
165
169
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
170
|
+
const mkItem = ( dte ) => {
|
|
171
|
+
return new HLayout({
|
|
172
|
+
cls,
|
|
173
|
+
flex: 1,
|
|
174
|
+
content: new Component({
|
|
175
|
+
tag: 'span',
|
|
176
|
+
content: formatIntlDate(dte, 'd'),
|
|
177
|
+
}),
|
|
178
|
+
dom_events: {
|
|
179
|
+
click: () => this.select(dte)
|
|
180
|
+
}
|
|
181
|
+
})
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
days.push( mkItem( dte.clone() ) );
|
|
177
185
|
|
|
178
186
|
dte.setDate(dte.getDate() + 1);
|
|
179
187
|
first = false;
|
package/src/canvas.ts
CHANGED
|
@@ -7,20 +7,24 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @file canvas.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
|
-
* @license
|
|
11
|
-
* Copyright (c) 2019-2021 R-libre ingenierie
|
|
12
10
|
*
|
|
13
|
-
*
|
|
14
|
-
* it under the terms of the GNU General Public License as published by
|
|
15
|
-
* the Free Software Foundation; either version 3 of the License, or
|
|
16
|
-
* (at your option) any later version.
|
|
11
|
+
* Copyright (c) 2019-2022 R-libre ingenierie
|
|
17
12
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
13
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
15
|
+
* in the Software without restriction, including without limitation the rights
|
|
16
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
17
|
+
* of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
18
|
+
* subject to the following conditions:
|
|
19
|
+
* The above copyright notice and this permission notice shall be included in all copies
|
|
20
|
+
* or substantial portions of the Software.
|
|
22
21
|
*
|
|
23
|
-
*
|
|
22
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
23
|
+
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
24
|
+
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
25
|
+
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
26
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
27
|
+
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
24
28
|
**/
|
|
25
29
|
|
|
26
30
|
import { Component, CProps, CEventMap, html } from './component'
|
|
@@ -83,7 +87,7 @@ function mkPainter(c2d: CanvasRenderingContext2D, w: number, h: number): CanvasP
|
|
|
83
87
|
return cp;
|
|
84
88
|
}
|
|
85
89
|
|
|
86
|
-
function smoothLine(points: any[], path: CanvasPath = null, move = true) {
|
|
90
|
+
function smoothLine( this: CanvasRenderingContext2D, points: any[], path: CanvasPath = null, move = true) {
|
|
87
91
|
if (points.length < 2) {
|
|
88
92
|
return;
|
|
89
93
|
}
|
|
@@ -146,7 +150,7 @@ function smoothLine(points: any[], path: CanvasPath = null, move = true) {
|
|
|
146
150
|
path.lineTo(p1.x, p1.y);
|
|
147
151
|
}
|
|
148
152
|
|
|
149
|
-
function smoothLineEx(_points: any[], tension: number = 0.5, numOfSeg: number = 10, path: CanvasPath = null, move = true, close = false) {
|
|
153
|
+
function smoothLineEx(this: CanvasRenderingContext2D, _points: any[], tension: number = 0.5, numOfSeg: number = 10, path: CanvasPath = null, move = true, close = false) {
|
|
150
154
|
|
|
151
155
|
let points = [];
|
|
152
156
|
|
|
@@ -257,7 +261,7 @@ function smoothLineEx(_points: any[], tension: number = 0.5, numOfSeg: number =
|
|
|
257
261
|
}
|
|
258
262
|
}
|
|
259
263
|
|
|
260
|
-
function line(x1: number, y1: number, x2: number, y2: number, color: string, lineWidth: number = 1) {
|
|
264
|
+
function line(this: CanvasRenderingContext2D, x1: number, y1: number, x2: number, y2: number, color: string, lineWidth: number = 1) {
|
|
261
265
|
this.save();
|
|
262
266
|
this.beginPath();
|
|
263
267
|
this.moveTo(x1, y1);
|
|
@@ -268,7 +272,7 @@ function line(x1: number, y1: number, x2: number, y2: number, color: string, lin
|
|
|
268
272
|
this.restore();
|
|
269
273
|
}
|
|
270
274
|
|
|
271
|
-
function roundRect(x: number, y: number, width: number, height: number, radius: number) {
|
|
275
|
+
function roundRect(this: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, radius: number) {
|
|
272
276
|
//this.beginPath( );
|
|
273
277
|
this.moveTo(x + radius, y);
|
|
274
278
|
this.lineTo(x + width - radius, y);
|
|
@@ -282,7 +286,7 @@ function roundRect(x: number, y: number, width: number, height: number, radius:
|
|
|
282
286
|
this.closePath();
|
|
283
287
|
}
|
|
284
288
|
|
|
285
|
-
function calcTextSize(text: string, rounded = false): { width: number, height: number } {
|
|
289
|
+
function calcTextSize( this: CanvasRenderingContext2D, text: string, rounded = false): { width: number, height: number } {
|
|
286
290
|
|
|
287
291
|
let fh = this.measureText(text);
|
|
288
292
|
let lh = fh.fontBoundingBoxAscent + fh.fontBoundingBoxDescent;
|
|
@@ -295,12 +299,12 @@ function calcTextSize(text: string, rounded = false): { width: number, height: n
|
|
|
295
299
|
}
|
|
296
300
|
}
|
|
297
301
|
|
|
298
|
-
function setFontSize(fs: number) {
|
|
302
|
+
function setFontSize( this: CanvasRenderingContext2D, fs: number) {
|
|
299
303
|
let fsize = Math.round(fs) + 'px';
|
|
300
304
|
this.font = this.font.replace(/\d+px/, fsize);
|
|
301
305
|
}
|
|
302
306
|
|
|
303
|
-
function circle(x: number, y: number, radius: number) {
|
|
307
|
+
function circle( this: CanvasRenderingContext2D, x: number, y: number, radius: number) {
|
|
304
308
|
this.moveTo(x + radius, y);
|
|
305
309
|
this.arc(x, y, radius, 0, Math.PI * 2);
|
|
306
310
|
}
|
package/src/cardview.ts
CHANGED
|
@@ -7,20 +7,24 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @file cardview.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
|
-
* @license
|
|
11
|
-
* Copyright (c) 2019-2021 R-libre ingenierie
|
|
12
10
|
*
|
|
13
|
-
*
|
|
14
|
-
* it under the terms of the GNU General Public License as published by
|
|
15
|
-
* the Free Software Foundation; either version 3 of the License, or
|
|
16
|
-
* (at your option) any later version.
|
|
11
|
+
* Copyright (c) 2019-2022 R-libre ingenierie
|
|
17
12
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
13
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
15
|
+
* in the Software without restriction, including without limitation the rights
|
|
16
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
17
|
+
* of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
18
|
+
* subject to the following conditions:
|
|
19
|
+
* The above copyright notice and this permission notice shall be included in all copies
|
|
20
|
+
* or substantial portions of the Software.
|
|
22
21
|
*
|
|
23
|
-
*
|
|
22
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
23
|
+
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
24
|
+
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
25
|
+
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
26
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
27
|
+
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
24
28
|
**/
|
|
25
29
|
|
|
26
30
|
import { Component, CProps, CEventMap } from './component'
|
package/src/checkbox.ts
CHANGED
|
@@ -7,20 +7,24 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @file checkbox.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
|
-
* @license
|
|
11
|
-
* Copyright (c) 2019-2021 R-libre ingenierie
|
|
12
10
|
*
|
|
13
|
-
*
|
|
14
|
-
* it under the terms of the GNU General Public License as published by
|
|
15
|
-
* the Free Software Foundation; either version 3 of the License, or
|
|
16
|
-
* (at your option) any later version.
|
|
11
|
+
* Copyright (c) 2019-2022 R-libre ingenierie
|
|
17
12
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
13
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
15
|
+
* in the Software without restriction, including without limitation the rights
|
|
16
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
17
|
+
* of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
18
|
+
* subject to the following conditions:
|
|
19
|
+
* The above copyright notice and this permission notice shall be included in all copies
|
|
20
|
+
* or substantial portions of the Software.
|
|
22
21
|
*
|
|
23
|
-
*
|
|
22
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
23
|
+
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
24
|
+
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
25
|
+
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
26
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
27
|
+
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
24
28
|
**/
|
|
25
29
|
|
|
26
30
|
import { CEventMap, Component, CProps } from './component'
|
|
@@ -45,12 +49,13 @@ interface CheckBoxProps extends CProps<CheckBoxEventMap> {
|
|
|
45
49
|
|
|
46
50
|
checked?: boolean;
|
|
47
51
|
value?: string;
|
|
52
|
+
slider?: boolean;
|
|
48
53
|
|
|
49
54
|
labelWidth?: number; // <0 mean flex value
|
|
50
55
|
labelAlign?: 'left' | 'right';
|
|
51
56
|
align?: 'left' | 'right';
|
|
52
57
|
|
|
53
|
-
change
|
|
58
|
+
change?: EventCallback<EvChange>;
|
|
54
59
|
}
|
|
55
60
|
|
|
56
61
|
/**
|
|
@@ -65,6 +70,10 @@ export class CheckBox extends Component<CheckBoxProps, CheckBoxEventMap> {
|
|
|
65
70
|
|
|
66
71
|
this.setDomEvent('focus', () => this._setFocus());
|
|
67
72
|
this.mapPropEvents( props, 'change' );
|
|
73
|
+
|
|
74
|
+
if( props.slider ) {
|
|
75
|
+
this.addClass( 'slider' );
|
|
76
|
+
}
|
|
68
77
|
}
|
|
69
78
|
|
|
70
79
|
/** @ignore */
|
package/src/color.ts
CHANGED
|
@@ -7,20 +7,24 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @file color.ts
|
|
9
9
|
* @author Etienne Cochard
|
|
10
|
-
* @license
|
|
11
|
-
* Copyright (c) 2019-2021 R-libre ingenierie
|
|
12
10
|
*
|
|
13
|
-
*
|
|
14
|
-
* it under the terms of the GNU General Public License as published by
|
|
15
|
-
* the Free Software Foundation; either version 3 of the License, or
|
|
16
|
-
* (at your option) any later version.
|
|
11
|
+
* Copyright (c) 2019-2022 R-libre ingenierie
|
|
17
12
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
13
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
15
|
+
* in the Software without restriction, including without limitation the rights
|
|
16
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
17
|
+
* of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
18
|
+
* subject to the following conditions:
|
|
19
|
+
* The above copyright notice and this permission notice shall be included in all copies
|
|
20
|
+
* or substantial portions of the Software.
|
|
22
21
|
*
|
|
23
|
-
*
|
|
22
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
23
|
+
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
24
|
+
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
25
|
+
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
26
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
27
|
+
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
24
28
|
**/
|
|
25
29
|
|
|
26
30
|
import { Stylesheet } from './styles'
|