@itrocks/framework 0.2.7 → 0.3.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/app.d.ts +2 -2
- package/app.js +26 -26
- package/cjs/main.js +7 -3
- package/package.json +1 -1
package/app.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import '
|
|
1
|
+
import '@itrocks/auto-redirect/build.js';
|
|
2
|
+
import '@itrocks/real-viewport-height/real-viewport-height.js';
|
package/app.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { loadCss } from '
|
|
2
|
-
import { autoFocus } from '
|
|
3
|
-
import '
|
|
4
|
-
import { breadcrumb } from '
|
|
5
|
-
import { build } from '
|
|
6
|
-
import { collapse } from '
|
|
7
|
-
import { containedAutoWidth } from '
|
|
8
|
-
import { notification } from '
|
|
9
|
-
import { notifications } from '
|
|
10
|
-
import '
|
|
11
|
-
import { XTargetBeginEnd } from '
|
|
12
|
-
import { buildXTarget } from '
|
|
13
|
-
import { XTargetSecureClick } from '
|
|
14
|
-
import { XTargetComposite } from '
|
|
15
|
-
import { XTargetDefaultTarget } from '
|
|
16
|
-
import { XTargetDefaultOptions } from '
|
|
17
|
-
import { XTargetHead } from '
|
|
18
|
-
import { XTargetHeadersSize } from '
|
|
19
|
-
import { XTargetHistory } from '
|
|
20
|
-
import { XTargetHoldOn } from '
|
|
21
|
-
import { XTargetMainTarget } from '
|
|
22
|
-
import { XTargetModifier } from '
|
|
1
|
+
import { loadCss } from '@itrocks/asset-loader/asset-loader.js';
|
|
2
|
+
import { autoFocus } from '@itrocks/auto-focus/auto-focus.js';
|
|
3
|
+
import '@itrocks/auto-redirect/build.js';
|
|
4
|
+
import { breadcrumb } from '@itrocks/breadcrumb/breadcrumb.js';
|
|
5
|
+
import { build } from '@itrocks/build/build.js';
|
|
6
|
+
import { collapse } from '@itrocks/collapse/collapse.js';
|
|
7
|
+
import { containedAutoWidth } from '@itrocks/contained-auto-width/contained-auto-width.js';
|
|
8
|
+
import { notification } from '@itrocks/notifications/notifications.js';
|
|
9
|
+
import { notifications } from '@itrocks/notifications/notifications.js';
|
|
10
|
+
import '@itrocks/real-viewport-height/real-viewport-height.js';
|
|
11
|
+
import { XTargetBeginEnd } from '@itrocks/xtarget/begin-end.js';
|
|
12
|
+
import { buildXTarget } from '@itrocks/xtarget/build.js';
|
|
13
|
+
import { XTargetSecureClick } from '@itrocks/xtarget/secure-click.js';
|
|
14
|
+
import { XTargetComposite } from '@itrocks/xtarget/composite.js';
|
|
15
|
+
import { XTargetDefaultTarget } from '@itrocks/xtarget/default-target.js';
|
|
16
|
+
import { XTargetDefaultOptions } from '@itrocks/xtarget/xtarget.js';
|
|
17
|
+
import { XTargetHead } from '@itrocks/xtarget/head.js';
|
|
18
|
+
import { XTargetHeadersSize } from '@itrocks/xtarget/headers-size.js';
|
|
19
|
+
import { XTargetHistory } from '@itrocks/xtarget/history.js';
|
|
20
|
+
import { XTargetHoldOn } from '@itrocks/xtarget/hold-on.js';
|
|
21
|
+
import { XTargetMainTarget } from '@itrocks/xtarget/main-target.js';
|
|
22
|
+
import { XTargetModifier } from '@itrocks/xtarget/modifier.js';
|
|
23
23
|
let selector;
|
|
24
24
|
selector = 'input[data-type=object], ul[data-type=objects] > li > input:not([type=hidden])';
|
|
25
25
|
build(selector, async (input) => {
|
|
26
26
|
input.classList.add('autocomplete');
|
|
27
|
-
loadCss('
|
|
28
|
-
new (await import('
|
|
27
|
+
loadCss('/@itrocks/autocomplete/autocomplete.css');
|
|
28
|
+
new (await import('@itrocks/autocomplete/autocomplete.js')).AutoComplete(input);
|
|
29
29
|
if (input.dataset.type !== 'object') {
|
|
30
|
-
(await import('
|
|
30
|
+
(await import('@itrocks/links/links.js')).links(input);
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
33
|
build('main > * > h2, main > * > header > h2', breadcrumb);
|
|
34
34
|
build('button.collapse', button => collapse(button, 'body'));
|
|
35
|
-
build('input[data-type=date]', async (input) => (await import('
|
|
35
|
+
build('input[data-type=date]', async (input) => (await import('@itrocks/air-datepicker/air-datepicker.js')).airDatePicker(input));
|
|
36
36
|
build('form', autoFocus);
|
|
37
37
|
selector = '[data-contained-auto-width], [data-multiple-contained-auto-width] > li';
|
|
38
38
|
build(selector, async (container) => containedAutoWidth(container));
|
package/cjs/main.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.run = run;
|
|
4
4
|
const action_1 = require("@itrocks/action");
|
|
5
|
+
const action_2 = require("@itrocks/action");
|
|
5
6
|
const action_request_1 = require("@itrocks/action-request");
|
|
6
7
|
const action_request_2 = require("@itrocks/action-request");
|
|
7
8
|
const app_dir_1 = require("@itrocks/app-dir");
|
|
@@ -15,7 +16,7 @@ const store_1 = require("@itrocks/store");
|
|
|
15
16
|
const template_1 = require("@itrocks/template");
|
|
16
17
|
const node_path_1 = require("node:path");
|
|
17
18
|
const node_path_2 = require("node:path");
|
|
18
|
-
template_1.frontScripts.push('/
|
|
19
|
+
template_1.frontScripts.push('/lib/air-datepicker/locale/en.js', '/lib/air-datepicker/locale/fr.js');
|
|
19
20
|
async function execute(request) {
|
|
20
21
|
// Access control
|
|
21
22
|
if ((config_1.config.access?.free !== '*')
|
|
@@ -35,7 +36,7 @@ async function execute(request) {
|
|
|
35
36
|
if ((0, class_type_1.isAnyType)(module)) {
|
|
36
37
|
const action = (new module);
|
|
37
38
|
if (request.format in action) {
|
|
38
|
-
const need = (0,
|
|
39
|
+
const need = (0, action_2.needOf)(action);
|
|
39
40
|
if (need.alternative
|
|
40
41
|
&& (need.alternative !== request.action)
|
|
41
42
|
&& (((need.need === 'object') && !request.ids.length)
|
|
@@ -55,7 +56,10 @@ async function execute(request) {
|
|
|
55
56
|
}
|
|
56
57
|
async function run() {
|
|
57
58
|
await (0, route_1.loadRoutes)(route_1.routes, config_1.config.routes ?? {});
|
|
58
|
-
(0, action_request_1.actionRequestDependsOn)({
|
|
59
|
+
(0, action_request_1.actionRequestDependsOn)({
|
|
60
|
+
getModule: route_1.routes.resolve.bind(route_1.routes),
|
|
61
|
+
isDomainObject: object => (0, class_type_1.isAnyType)(object) && !(object instanceof action_1.Action)
|
|
62
|
+
});
|
|
59
63
|
return new fastify_1.FastifyServer({
|
|
60
64
|
assetPath: app_dir_1.appDir,
|
|
61
65
|
execute: request => execute(new action_request_2.Request(request)),
|
package/package.json
CHANGED