@itrocks/framework 0.0.7 → 0.0.8

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.js CHANGED
@@ -1,28 +1,28 @@
1
- import build from '../build/build.js';
2
- import buildXTarget from '../xtarget/build.js';
3
- import XTargetBeginEnd from '../xtarget/begin-end.js';
4
- import XTargetComposite from '../xtarget/composite.js';
5
- import XTargetDefaultTarget from '../xtarget/default-target.js';
6
- import XTargetHead from '../xtarget/head.js';
7
- import XTargetHeadersSize from '../xtarget/headers-size.js';
8
- import XTargetHistory from '../xtarget/history.js';
9
- import XTargetMainTarget from '../xtarget/main-target.js';
10
- import XTargetModifier from '../xtarget/modifier.js';
1
+ import { build } from '../build/build.js';
2
+ import { buildXTarget } from '../xtarget/build.js';
3
+ import { XTargetBeginEnd } from '../xtarget/begin-end.js';
4
+ import { XTargetComposite } from '../xtarget/composite.js';
5
+ import { XTargetDefaultTarget } from '../xtarget/default-target.js';
6
+ import { XTargetHead } from '../xtarget/head.js';
7
+ import { XTargetHeadersSize } from '../xtarget/headers-size.js';
8
+ import { XTargetHistory } from '../xtarget/history.js';
9
+ import { XTargetMainTarget } from '../xtarget/main-target.js';
10
+ import { XTargetModifier } from '../xtarget/modifier.js';
11
11
  import { XTargetDefaultOptions } from '../xtarget/xtarget.js';
12
- import autoFocus from '../auto-focus/auto-focus.js';
12
+ import { autoFocus } from '../auto-focus/auto-focus.js';
13
13
  import '../auto-redirect/build.js';
14
- import breadcrumb from '../breadcrumb/breadcrumb.js';
15
- import collapse from '../collapse/collapse.js';
16
- import containedAutoWidth from '../contained-auto-width/contained-auto-width.js';
17
- import notification from '../notifications/notifications.js';
14
+ import { breadcrumb } from '../breadcrumb/breadcrumb.js';
15
+ import { collapse } from '../collapse/collapse.js';
16
+ import { containedAutoWidth } from '../contained-auto-width/contained-auto-width.js';
17
+ import { notification } from '../notifications/notifications.js';
18
18
  import { notifications } from '../notifications/notifications.js';
19
19
  import '../real-viewport-height/real-viewport-height.js';
20
20
  let selector;
21
21
  selector = 'input[data-type=object], ul[data-type=objects] > li > input';
22
- build(selector, async (input) => (await import('../autocompleter/autocompleter.js')).default(input));
22
+ build(selector, async (input) => (await import('../autocompleter/autocompleter.js')).autoCompleter(input));
23
23
  build('main > * > h2, main > * > header > h2', breadcrumb);
24
24
  build('button.collapse', button => collapse(button, 'body'));
25
- build('input[data-type=date]', async (input) => (await import('../air-datepicker/air-datepicker.js')).default(input));
25
+ build('input[data-type=date]', async (input) => (await import('../air-datepicker/air-datepicker.js')).airDatePicker(input));
26
26
  build('form', autoFocus);
27
27
  selector = '[data-contained-auto-width], [data-multiple-contained-auto-width] > li';
28
28
  build(selector, async (container) => containedAutoWidth(container));
package/cjs/compose.js CHANGED
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.composeConfig = void 0;
4
4
  const config_1 = require("./config");
5
5
  exports.composeConfig = {
6
- '@itrocks/reflect:ReflectClass': '/class',
7
- '@itrocks/reflect:ReflectProperty': '/property',
6
+ '@itrocks/reflect:ReflectClass': '/reflect-class',
7
+ '@itrocks/reflect:ReflectProperty': '/reflect-property',
8
8
  };
9
9
  (0, config_1.mergeConfig)(exports.composeConfig, '/app/config/compose.js');
10
10
  //# sourceMappingURL=compose.js.map
@@ -0,0 +1,8 @@
1
+ import { PropertyTypes } from '@itrocks/property-type';
2
+ import { ReflectClass as RC } from '@itrocks/reflect';
3
+ export declare class ReflectClass<T extends object = object> extends RC<T> {
4
+ inheritedPropertyTypes(propertyTypes: PropertyTypes<T>): void;
5
+ get parent(): any;
6
+ get properties(): Record<Extract<keyof T, string>, import("@itrocks/reflect").ReflectProperty<T>>;
7
+ get uses(): import("@itrocks/class-type").Type[];
8
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReflectClass = void 0;
4
+ const reflect_1 = require("@itrocks/reflect");
5
+ const uses_1 = require("@itrocks/uses");
6
+ const reflect_property_1 = require("./reflect-property");
7
+ class ReflectClass extends reflect_1.ReflectClass {
8
+ inheritedPropertyTypes(propertyTypes) {
9
+ super.inheritedPropertyTypes(propertyTypes);
10
+ for (const uses of this.uses) {
11
+ Object.assign(propertyTypes, new ReflectClass(uses).propertyTypes);
12
+ }
13
+ }
14
+ get parent() {
15
+ const parent = super.parent;
16
+ return parent
17
+ ? Object.setPrototypeOf(parent, ReflectClass.prototype)
18
+ : parent;
19
+ }
20
+ get properties() {
21
+ const properties = super.properties;
22
+ for (const reflectProperty of Object.values(properties)) {
23
+ Object.setPrototypeOf(reflectProperty, reflect_property_1.ReflectProperty.prototype);
24
+ }
25
+ return properties;
26
+ }
27
+ get uses() {
28
+ const value = (0, uses_1.usesOf)(this.type);
29
+ Object.defineProperty(this, 'uses', { value });
30
+ return value;
31
+ }
32
+ }
33
+ exports.ReflectClass = ReflectClass;
34
+ //# sourceMappingURL=reflect-class.js.map
@@ -0,0 +1,9 @@
1
+ import { HtmlContainer } from '@itrocks/core-transformers';
2
+ import { ReflectProperty as RP } from '@itrocks/reflect';
3
+ export declare class ReflectProperty<T extends object> extends RP<T> {
4
+ get class(): any;
5
+ edit(format?: string): Promise<string>;
6
+ output(format?: string, askFor?: HtmlContainer): Promise<string>;
7
+ outputMandatoryContainer(format?: string): Promise<string>;
8
+ outputOptionalContainer(format?: string): Promise<string>;
9
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReflectProperty = void 0;
4
+ const core_transformers_1 = require("@itrocks/core-transformers");
5
+ const reflect_1 = require("@itrocks/reflect");
6
+ const transformer_1 = require("@itrocks/transformer");
7
+ const transformer_2 = require("@itrocks/transformer");
8
+ const reflect_class_1 = require("./reflect-class");
9
+ class ReflectProperty extends reflect_1.ReflectProperty {
10
+ get class() {
11
+ return Object.setPrototypeOf(super.class, reflect_class_1.ReflectClass.prototype);
12
+ }
13
+ async edit(format = transformer_2.HTML) {
14
+ const object = this.object ?? this.class.type;
15
+ const value = this.object ? this.object[this.name] : undefined;
16
+ return (0, transformer_1.applyTransformer)(await value, object, this.name, format, transformer_2.EDIT);
17
+ }
18
+ async output(format = transformer_2.HTML, askFor) {
19
+ const object = this.object ?? this.class.type;
20
+ const value = this.object ? await this.object[this.name] : undefined;
21
+ return (0, transformer_1.applyTransformer)(value, object, this.name, format, transformer_2.OUTPUT, askFor);
22
+ }
23
+ async outputMandatoryContainer(format = transformer_2.HTML) {
24
+ return this.output(format, new core_transformers_1.HtmlContainer(true));
25
+ }
26
+ async outputOptionalContainer(format = transformer_2.HTML) {
27
+ return this.output(format, new core_transformers_1.HtmlContainer(false));
28
+ }
29
+ }
30
+ exports.ReflectProperty = ReflectProperty;
31
+ //# sourceMappingURL=reflect-property.js.map
package/package.json CHANGED
@@ -98,5 +98,5 @@
98
98
  "build:front": "tsc -p src/front/tsconfig.json && sed -i 's#../../##g' app.js app.d.ts"
99
99
  },
100
100
  "types": "./cjs/framework.d.ts",
101
- "version": "0.0.7"
101
+ "version": "0.0.8"
102
102
  }