@decaf-ts/ui-decorators 0.5.32 → 0.6.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.
Files changed (61) hide show
  1. package/dist/ui-decorators.cjs +1 -1
  2. package/dist/ui-decorators.cjs.map +1 -1
  3. package/dist/ui-decorators.js +1 -1
  4. package/dist/ui-decorators.js.map +1 -1
  5. package/lib/esm/index.d.ts +1 -1
  6. package/lib/esm/index.js +1 -1
  7. package/lib/esm/model/decorators.d.ts +1 -1
  8. package/lib/esm/model/decorators.js +15 -17
  9. package/lib/esm/model/decorators.js.map +1 -1
  10. package/lib/esm/model/model.d.ts +17 -0
  11. package/lib/esm/model/overrides.d.ts +1 -1
  12. package/lib/esm/model/overrides.js +74 -0
  13. package/lib/esm/model/overrides.js.map +1 -1
  14. package/lib/esm/ui/DecafComponent.d.ts +195 -0
  15. package/lib/esm/ui/DecafComponent.js +96 -0
  16. package/lib/esm/ui/DecafComponent.js.map +1 -0
  17. package/lib/esm/ui/Rendering.d.ts +1 -11
  18. package/lib/esm/ui/Rendering.js +139 -70
  19. package/lib/esm/ui/Rendering.js.map +1 -1
  20. package/lib/esm/ui/constants.d.ts +3 -1
  21. package/lib/esm/ui/constants.js +10 -10
  22. package/lib/esm/ui/constants.js.map +1 -1
  23. package/lib/esm/ui/decorators.d.ts +38 -10
  24. package/lib/esm/ui/decorators.js +53 -12
  25. package/lib/esm/ui/decorators.js.map +1 -1
  26. package/lib/esm/ui/index.d.ts +1 -0
  27. package/lib/esm/ui/index.js +1 -0
  28. package/lib/esm/ui/index.js.map +1 -1
  29. package/lib/esm/ui/types.d.ts +7 -3
  30. package/lib/esm/ui/utils.d.ts +1 -0
  31. package/lib/esm/ui/utils.js +24 -12
  32. package/lib/esm/ui/utils.js.map +1 -1
  33. package/lib/index.cjs +1 -1
  34. package/lib/index.d.ts +1 -1
  35. package/lib/model/decorators.cjs +15 -17
  36. package/lib/model/decorators.d.ts +1 -1
  37. package/lib/model/decorators.js.map +1 -1
  38. package/lib/model/model.d.ts +17 -0
  39. package/lib/model/overrides.cjs +74 -0
  40. package/lib/model/overrides.d.ts +1 -1
  41. package/lib/model/overrides.js.map +1 -1
  42. package/lib/ui/DecafComponent.cjs +100 -0
  43. package/lib/ui/DecafComponent.d.ts +195 -0
  44. package/lib/ui/DecafComponent.js.map +1 -0
  45. package/lib/ui/Rendering.cjs +138 -69
  46. package/lib/ui/Rendering.d.ts +1 -11
  47. package/lib/ui/Rendering.js.map +1 -1
  48. package/lib/ui/constants.cjs +9 -9
  49. package/lib/ui/constants.d.ts +3 -1
  50. package/lib/ui/constants.js.map +1 -1
  51. package/lib/ui/decorators.cjs +55 -12
  52. package/lib/ui/decorators.d.ts +38 -10
  53. package/lib/ui/decorators.js.map +1 -1
  54. package/lib/ui/index.cjs +1 -0
  55. package/lib/ui/index.d.ts +1 -0
  56. package/lib/ui/index.js.map +1 -1
  57. package/lib/ui/types.d.ts +7 -3
  58. package/lib/ui/utils.cjs +23 -10
  59. package/lib/ui/utils.d.ts +1 -0
  60. package/lib/ui/utils.js.map +1 -1
  61. package/package.json +2 -3
@@ -7,10 +7,8 @@ exports.uihandlers = uihandlers;
7
7
  exports.uilayout = uilayout;
8
8
  exports.uisteppedmodel = uisteppedmodel;
9
9
  const constants_1 = require("./../ui/constants.cjs");
10
- const reflection_1 = require("@decaf-ts/reflection");
11
- const Rendering_1 = require("./../ui/Rendering.cjs");
12
10
  const constants_2 = require("./../ui/constants.cjs");
13
- const decorator_validation_1 = require("@decaf-ts/decorator-validation");
11
+ const decoration_1 = require("@decaf-ts/decoration");
14
12
  /**
15
13
  * @description Decorator that tags a class as a UI model
16
14
  * @summary Adds rendering capabilities to a model class by providing a render method
@@ -61,7 +59,7 @@ function uimodel(tag, props) {
61
59
  tag: tag || original.name,
62
60
  props: props,
63
61
  };
64
- return (0, reflection_1.metadata)(Rendering_1.RenderingEngine.key(constants_1.UIKeys.UIMODEL), meta)(original);
62
+ return (0, decoration_1.metadata)(decoration_1.Metadata.key(constants_1.UIKeys.REFLECT, constants_1.UIKeys.UIMODEL), meta)(original);
65
63
  };
66
64
  }
67
65
  /**
@@ -97,7 +95,7 @@ function uimodel(tag, props) {
97
95
  * RenderingEngine->>System: renders with custom engine
98
96
  */
99
97
  function renderedBy(engine) {
100
- return (0, reflection_1.apply)((0, reflection_1.metadata)(Rendering_1.RenderingEngine.key(constants_1.UIKeys.RENDERED_BY), engine));
98
+ return (0, decoration_1.apply)((0, decoration_1.metadata)(decoration_1.Metadata.key(constants_1.UIKeys.REFLECT, constants_1.UIKeys.RENDERED_BY), engine));
101
99
  }
102
100
  /**
103
101
  * @description Decorator that tags a model as a list item for UI rendering
@@ -153,7 +151,7 @@ function uilistmodel(name, props) {
153
151
  props: props,
154
152
  },
155
153
  };
156
- return (0, reflection_1.metadata)(Rendering_1.RenderingEngine.key(constants_1.UIKeys.UILISTMODEL), meta)(original);
154
+ return (0, decoration_1.metadata)(decoration_1.Metadata.key(constants_1.UIKeys.REFLECT, constants_1.UIKeys.UILISTMODEL), meta)(original);
157
155
  };
158
156
  }
159
157
  /**
@@ -212,9 +210,9 @@ function uilistmodel(name, props) {
212
210
  function uihandlers(props) {
213
211
  return (original) => {
214
212
  const meta = {
215
- handlers: props
213
+ handlers: props,
216
214
  };
217
- return (0, reflection_1.metadata)(Rendering_1.RenderingEngine.key(constants_1.UIKeys.HANDLERS), meta)(original);
215
+ return (0, decoration_1.metadata)(decoration_1.Metadata.key(constants_1.UIKeys.REFLECT, constants_1.UIKeys.HANDLERS), meta)(original);
218
216
  };
219
217
  }
220
218
  /**
@@ -278,17 +276,17 @@ function uihandlers(props) {
278
276
  function uilayout(tag, colsMode = 1, rows = 1, props = {}) {
279
277
  return (original, propertyKey) => {
280
278
  return uimodel(tag, Object.assign({
281
- ...(typeof colsMode === decorator_validation_1.ReservedModels.BOOLEAN ?
282
- {
279
+ ...(typeof colsMode === "boolean"
280
+ ? {
283
281
  flexMode: colsMode,
284
- cols: 1
285
- } :
286
- {
282
+ cols: 1,
283
+ }
284
+ : {
287
285
  flexMode: false,
288
- cols: colsMode
286
+ cols: colsMode,
289
287
  }),
290
288
  rows,
291
- ...Object.assign({ breakpoint: constants_2.UIMediaBreakPoints.LARGE }, props)
289
+ ...Object.assign({ breakpoint: constants_2.UIMediaBreakPoints.LARGE }, props),
292
290
  }))(original, propertyKey);
293
291
  };
294
292
  }
@@ -374,7 +372,7 @@ function uilayout(tag, colsMode = 1, rows = 1, props = {}) {
374
372
  */
375
373
  function uisteppedmodel(tag, pages = 1, paginated = false, props = {}) {
376
374
  let pageTitles = [];
377
- if (typeof pages === decorator_validation_1.ReservedModels.OBJECT) {
375
+ if (typeof pages === "object") {
378
376
  pageTitles = pages;
379
377
  pages = pageTitles.length;
380
378
  }
@@ -382,7 +380,7 @@ function uisteppedmodel(tag, pages = 1, paginated = false, props = {}) {
382
380
  pages,
383
381
  paginated,
384
382
  pageTitles,
385
- props
383
+ props,
386
384
  });
387
385
  }
388
386
  //# sourceMappingURL=decorators.js.map
@@ -75,7 +75,7 @@ export declare function uimodel(tag?: string, props?: Record<string, any>): (ori
75
75
  * Model->>RenderingEngine: uses specified engine
76
76
  * RenderingEngine->>System: renders with custom engine
77
77
  */
78
- export declare function renderedBy(engine: string): (target: object, propertyKey?: string | symbol | unknown, descriptor?: PropertyDescriptor) => void;
78
+ export declare function renderedBy(engine: string): (target: object, propertyKey?: string | symbol | unknown, descriptor?: PropertyDescriptor | number) => void;
79
79
  /**
80
80
  * @description Decorator that tags a model as a list item for UI rendering
81
81
  * @summary Specifies how a model should be rendered when displayed in a list context
@@ -1 +1 @@
1
- {"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../src/model/decorators.ts"],"names":[],"mappings":";;AAmDA,0BASC;AAkCD,gCAEC;AA+CD,kCAWC;AAuDD,gCAOC;AA4DD,4BAiBC;AAkFD,wCAYC;AAnYD,qDAAyC;AACzC,qDAAuD;AACvD,qDAAkD;AAElD,qDAAqD;AA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,QAAQ;iBACf,CAAC;YACN,IAAI;YACJ,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,8BAAkB,CAAC,KAAK,EAAE,EAAE,KAAK,CAAC;SAClE,CAAC,CACH,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IAC3B,CAAC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EG;AACH,SAAgB,cAAc,CAC5B,GAAW,EACX,QAA8C,CAAC,EAC/C,YAAqB,KAAK,EAC1B,QAAa,EAAE;IAEf,IAAI,UAAU,GAAgC,EAAE,CAAC;IACjD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,UAAU,GAAG,KAAoC,CAAC;QAClD,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC;IAC5B,CAAC;IACD,OAAO,OAAO,CAAC,GAAG,EAAE;QAClB,KAAK;QACL,SAAS;QACT,UAAU;QACV,KAAK;KACN,CAAC,CAAC;AACL,CAAC"}
@@ -1,4 +1,6 @@
1
1
  import { Renderable } from "./Renderable";
2
+ import { Constructor } from "@decaf-ts/decoration";
3
+ import { CrudOperationKeys, UIElementMetadata, UIHandlerMetadata, UILayoutMetadata, UIListModelMetadata, UIModelMetadata } from "../ui/index";
2
4
  declare module "@decaf-ts/decorator-validation" {
3
5
  interface Model extends Renderable {
4
6
  /**
@@ -11,4 +13,19 @@ declare module "@decaf-ts/decorator-validation" {
11
13
  */
12
14
  render<R>(...args: any[]): R;
13
15
  }
16
+ namespace Model {
17
+ function renderedBy<M extends Model>(model: Constructor<M>): string | undefined;
18
+ function uiPropertiesOf<M extends Model>(model: Constructor<M>): string[] | undefined;
19
+ function uiDecorationOf<M extends Model>(model: Constructor<M>, prop: keyof M, key?: string): any;
20
+ function uiModelOf<M extends Model>(model: Constructor<M>): UIModelMetadata | undefined;
21
+ function uiElementOf<M extends Model>(model: Constructor<M>, prop: keyof M): UIElementMetadata | undefined;
22
+ function uiListModelOf<M extends Model>(model: Constructor<M>): UIListModelMetadata | undefined;
23
+ function uiHandlersFor<M extends Model>(model: Constructor<M>): UIHandlerMetadata | undefined;
24
+ function uiLayoutOf<M extends Model>(model: Constructor<M>): UILayoutMetadata | undefined;
25
+ function uiTypeOf<M extends Model>(model: Constructor<M>, prop: keyof M): UILayoutMetadata | undefined;
26
+ function uiIsHidden<M extends Model>(model: Constructor<M>, prop: keyof M): boolean;
27
+ function uiHiddenOn<M extends Model>(model: Constructor<M>, prop: keyof M): CrudOperationKeys[] | false;
28
+ function uiHiddenOn<M extends Model>(model: Constructor<M>, prop: keyof M, op: CrudOperationKeys): boolean;
29
+ function uiHiddenOn<M extends Model>(model: Constructor<M>, prop: keyof M, op?: CrudOperationKeys): CrudOperationKeys[] | boolean;
30
+ }
14
31
  }
@@ -10,6 +10,10 @@
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
11
  const decorator_validation_1 = require("@decaf-ts/decorator-validation");
12
12
  const Rendering_1 = require("./../ui/Rendering.cjs");
13
+ const decoration_1 = require("@decaf-ts/decoration");
14
+ const index_1 = require("./../ui/index.cjs");
15
+ require("./model.cjs");
16
+ const db_decorators_1 = require("@decaf-ts/db-decorators");
13
17
  /**
14
18
  * @description Renders the model using the appropriate rendering engine
15
19
  * @summary Delegates rendering to the RenderingEngine based on model metadata
@@ -23,4 +27,74 @@ const Rendering_1 = require("./../ui/Rendering.cjs");
23
27
  decorator_validation_1.Model.prototype.render = function (...args) {
24
28
  return Rendering_1.RenderingEngine.render(this, ...args);
25
29
  };
30
+ decorator_validation_1.Model.renderedBy = function (model) {
31
+ return decoration_1.Metadata.get(model, decoration_1.Metadata.key(index_1.UIKeys.REFLECT, index_1.UIKeys.RENDERED_BY));
32
+ }.bind(decorator_validation_1.Model);
33
+ decorator_validation_1.Model.uiPropertiesOf = function (model) {
34
+ const meta = decoration_1.Metadata.get(model, decoration_1.Metadata.key(index_1.UIKeys.REFLECT, decoration_1.DecorationKeys.PROPERTIES));
35
+ if (!meta)
36
+ return undefined;
37
+ return Object.keys(meta);
38
+ }.bind(decorator_validation_1.Model);
39
+ decorator_validation_1.Model.uiDecorationOf = function (model, prop, key) {
40
+ const meta = decoration_1.Metadata.get(model, decoration_1.Metadata.key(index_1.UIKeys.REFLECT, decoration_1.DecorationKeys.PROPERTIES, prop));
41
+ if (!meta)
42
+ return undefined;
43
+ if (!key)
44
+ return meta;
45
+ return meta[key];
46
+ };
47
+ decorator_validation_1.Model.uiModelOf = function (model) {
48
+ return decoration_1.Metadata.get(model, decoration_1.Metadata.key(index_1.UIKeys.REFLECT, index_1.UIKeys.UIMODEL));
49
+ };
50
+ decorator_validation_1.Model.uiElementOf = function (model, prop) {
51
+ return decoration_1.Metadata.get(model, (0, index_1.getUIAttributeKey)(prop, index_1.UIKeys.ELEMENT));
52
+ };
53
+ decorator_validation_1.Model.uiListModelOf = function (model) {
54
+ return decoration_1.Metadata.get(model, decoration_1.Metadata.key(index_1.UIKeys.REFLECT, index_1.UIKeys.UILISTMODEL));
55
+ };
56
+ decorator_validation_1.Model.uiHandlersFor = function (model) {
57
+ return decoration_1.Metadata.get(model, decoration_1.Metadata.key(index_1.UIKeys.REFLECT, index_1.UIKeys.HANDLERS));
58
+ };
59
+ decorator_validation_1.Model.uiLayoutOf = function (model) {
60
+ return decoration_1.Metadata.get(model, decoration_1.Metadata.key(index_1.UIKeys.REFLECT, index_1.UIKeys.UILAYOUT));
61
+ };
62
+ decorator_validation_1.Model.uiIsHidden = function (model, prop) {
63
+ return !!decoration_1.Metadata.get(model, (0, index_1.getUIAttributeKey)(prop, index_1.UIKeys.HIDDEN));
64
+ };
65
+ decorator_validation_1.Model.uiIsHiddenOn = function (model, prop, op) {
66
+ const meta = decoration_1.Metadata.get(model, (0, index_1.getUIAttributeKey)(prop, index_1.UIKeys.HIDDEN));
67
+ if (!meta)
68
+ return false;
69
+ if (!op)
70
+ return meta;
71
+ return meta.includes(op);
72
+ };
73
+ decorator_validation_1.Model.uiTypeOf = function (model, prop) {
74
+ const meta = decoration_1.Metadata.get(model, decoration_1.Metadata.key(index_1.UIKeys.REFLECT, decoration_1.DecorationKeys.PROPERTIES, prop));
75
+ if (!meta)
76
+ throw new db_decorators_1.NotFoundError(`No metadata found for property '${prop}' on model '${model.name}'`);
77
+ const keys = Object.keys(meta).filter((k) => [index_1.UIKeys.PROP, index_1.UIKeys.ELEMENT, index_1.UIKeys.CHILD].includes(k));
78
+ if (keys.length === 0)
79
+ throw new db_decorators_1.NotFoundError(`No UI type metadata found for property '${prop}' on model '${model.name}'`);
80
+ if (keys.length > 1)
81
+ throw new index_1.RenderingError(`Only one type of decoration is allowed. Please choose between @uiprop, @uichild or @uielement`);
82
+ return meta[keys[0]];
83
+ };
84
+ //
85
+ // (Metadata as any).uiElements = function <M extends Model>(
86
+ // model: Constructor<M>
87
+ // ): string[] | undefined {
88
+ // const props = Metadata.uiPropertiesOf(model);
89
+ // if (!props) return undefined;
90
+ // return props
91
+ // .map((prop) => Metadata.get(model, getUIAttributeKey(prop, UIKeys.ELEMENT)))
92
+ // .filter(Boolean);
93
+ // }.bind(Model);
94
+ decorator_validation_1.Model.uiListItems = function (model) {
95
+ const meta = decoration_1.Metadata.get(model, decoration_1.Metadata.key(index_1.UIKeys.REFLECT, decoration_1.DecorationKeys.PROPERTIES));
96
+ if (!meta)
97
+ return undefined;
98
+ return Object.keys(meta);
99
+ }.bind(decorator_validation_1.Model);
26
100
  //# sourceMappingURL=overrides.js.map
@@ -6,4 +6,4 @@
6
6
  * @module model/overrides
7
7
  * @memberOf module:ui-decorators/model
8
8
  */
9
- export {};
9
+ import "./model";
@@ -1 +1 @@
1
- {"version":3,"file":"overrides.js","sourceRoot":"","sources":["../../src/model/overrides.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;AAEH,yEAAuD;AACvD,qDAAkD;AAElD;;;;;;;;;GASG;AACH,4BAAK,CAAC,SA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AAK,CAAC,IAAI,GAAG,CAC5E,CAAC;IACJ,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC;QACjB,MAAM,IAAI,sBAAc,CACtB,+FAA+F,CAChG,CAAC;IACJ,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACvB,CAAC,CAAC;AACF,EAAE;AACF,6DAA6D;AAC7D,0BAA0B;AAC1B,4BAA4B;AAC5B,kDAAkD;AAClD,kCAAkC;AAClC,iBAAiB;AACjB,mFAAmF;AACnF,wBAAwB;AACxB,iBAAiB;AAEhB,4BAAa,CAAC,WAAW,GAAG,UAE3B,KAAqB;IAErB,MAAM,IAAI,GAAG,qBAAQ,CAAC,GAAG,CACvB,KAAK,EACL,qBAAQ,CAAC,GAAG,CAAC,cAAM,CAAC,OAAO,EAAE,2BAAc,CAAC,UAAU,CAAC,CACxD,CAAC;IACF,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5B,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC,CAAC,IAAI,CAAC,4BAAK,CAAC,CAAC"}
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DecafComponent = void 0;
4
+ const logging_1 = require("@decaf-ts/logging");
5
+ const db_decorators_1 = require("@decaf-ts/db-decorators");
6
+ class DecafComponent extends logging_1.LoggedClass {
7
+ constructor() {
8
+ super();
9
+ /**
10
+ * @description Flag to enable or disable dark mode support for the component.
11
+ * @summary When enabled, the component will automatically detect the system's dark mode
12
+ * preference using the media service and apply appropriate styling classes. This flag
13
+ * controls whether the component should respond to dark mode changes and apply the
14
+ * dark palette class to its DOM element. By default, dark mode support is disabled.
15
+ * @protected
16
+ * @type {boolean}
17
+ * @default false
18
+ */
19
+ this.enableDarkMode = true;
20
+ /**
21
+ * @description Flag to enable or disable dark mode support for the component.
22
+ * @summary When enabled, the component will automatically detect the system's dark mode
23
+ * preference using the media service and apply appropriate styling classes. This flag
24
+ * controls whether the component should respond to dark mode changes and apply the
25
+ * dark palette class to its DOM element. By default, dark mode support is disabled.
26
+ * @protected
27
+ * @type {boolean}
28
+ * @default false
29
+ */
30
+ this.isDarkMode = false;
31
+ /**
32
+ * @description Configuration for list item rendering behavior.
33
+ * @summary Defines how list items should be rendered in the component.
34
+ * This property holds a configuration object that specifies the tag name
35
+ * and other properties needed to render list items correctly. The tag property
36
+ * identifies which component should be used to render each item in a list.
37
+ * Additional properties can be included to customize the rendering behavior.
38
+ * @type {Record<string, unknown>}
39
+ * @default {tag: ""}
40
+ */
41
+ this.item = { tag: '' };
42
+ /**
43
+ * @description Dynamic properties configuration for runtime customization.
44
+ * @summary Contains key-value pairs of dynamic properties that can be applied to the component
45
+ * at runtime. This flexible configuration object allows for dynamic property assignment without
46
+ * requiring explicit input bindings for every possible configuration option. Properties from
47
+ * this object are parsed and applied to the component instance through the parseProps method,
48
+ * enabling customizable component behavior based on external configuration.
49
+ * @type {Record<string, unknown>}
50
+ * @default {}
51
+ */
52
+ this.props = {};
53
+ /**
54
+ * @description Base route path for component navigation.
55
+ * @summary Defines the base route path used for navigation actions related to this component.
56
+ * This is often used as a prefix for constructing navigation URLs when transitioning between
57
+ * different operations or views. The route helps establish the component's position in the
58
+ * application's routing hierarchy.
59
+ * @type {string}
60
+ */
61
+ this.route = "";
62
+ /**
63
+ * @description Controls whether borders are displayed around the component.
64
+ * @summary Boolean flag that determines if the component should be visually outlined with borders.
65
+ * When true, borders are shown to visually separate the component from surrounding content.
66
+ *
67
+ * @type {boolean}
68
+ * @default false
69
+ */
70
+ this.borders = false;
71
+ /**
72
+ * @description Reference to CRUD operation constants for template usage.
73
+ * @summary Exposes the OperationKeys enum to the component template, enabling
74
+ * conditional rendering and behavior based on operation types. This protected
75
+ * readonly property ensures that template logic can access operation constants
76
+ * while maintaining encapsulation and preventing accidental modification.
77
+ * @protected
78
+ * @readonly
79
+ */
80
+ this.OperationKeys = db_decorators_1.OperationKeys;
81
+ /**
82
+ * @description Initialization status flag for the component.
83
+ * @summary Tracks whether the component has completed its initialization process.
84
+ * This flag is used to prevent duplicate initialization and to determine if
85
+ * certain operations that require initialization can be performed.
86
+ * @type {boolean}
87
+ * @default false
88
+ */
89
+ this.initialized = false;
90
+ this.handlers = {};
91
+ }
92
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
93
+ async render(...args) { }
94
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
95
+ async initialize(...args) {
96
+ this.initialized = true;
97
+ }
98
+ }
99
+ exports.DecafComponent = DecafComponent;
100
+ //# sourceMappingURL=DecafComponent.js.map
@@ -0,0 +1,195 @@
1
+ import { LoggedClass } from '@decaf-ts/logging';
2
+ import { UIFunctionLike } from './types';
3
+ import { Model } from '@decaf-ts/decorator-validation';
4
+ import { IRepository, OperationKeys } from '@decaf-ts/db-decorators';
5
+ export declare abstract class DecafComponent extends LoggedClass {
6
+ /**
7
+ * @description Name identifier for the component instance.
8
+ * @summary Provides a string identifier that can be used to name or label the component
9
+ * instance. This name can be used for debugging purposes, logging, or to identify specific
10
+ * component instances within a larger application structure. It serves as a human-readable
11
+ * identifier that helps distinguish between multiple instances of the same component type.
12
+ * @type {string}
13
+ */
14
+ protected name: string;
15
+ /**
16
+ * @description Parent component identifier for hierarchical component relationships.
17
+ * @summary Specifies the identifier of the parent component in a hierarchical component structure.
18
+ * This property establishes a parent-child relationship between components, allowing for
19
+ * proper nesting and organization of components within a layout. It can be used to track
20
+ * component dependencies and establish component hierarchies for rendering and event propagation.
21
+ * @type {string | undefined}
22
+ */
23
+ protected childOf: string | undefined;
24
+ /**
25
+ * @description Unique identifier for the component instance.
26
+ * @summary A unique identifier automatically generated for each component instance.
27
+ * This UID is used for DOM element identification, component tracking, and debugging purposes.
28
+ * By default, it generates a random 16-character value, but it can be explicitly set via input.
29
+ * @type {string | number}
30
+ * @default generateRandomValue(16)
31
+ */
32
+ protected uid?: string | number;
33
+ /**
34
+ * @description Data model or model name for component operations.
35
+ * @summary The data model that this component will use for CRUD operations. This can be provided
36
+ * as a Model instance, a model constructor, or a string representing the model's registered name.
37
+ * When set, this property provides the component with access to the model's schema, validation rules,
38
+ * and metadata needed for rendering and data operations.
39
+ * @type {Model | string | undefined}
40
+ */
41
+ protected model: Model | string | undefined;
42
+ /**
43
+ * @description Primary key field name for the data model.
44
+ * @summary Specifies which field in the model should be used as the primary key.
45
+ * This is typically used for identifying unique records in operations like update and delete.
46
+ * If not explicitly set, it defaults to the repository's configured primary key or 'id'.
47
+ * @type {string}
48
+ * @default 'id'
49
+ */
50
+ pk: string;
51
+ /**
52
+ * @description Primary key value of the current model instance.
53
+ * @summary Specifies the primary key value for the current model record being displayed or
54
+ * manipulated by the component. This identifier is used for CRUD operations that target
55
+ * specific records, such as read, update, and delete operations. The value corresponds to
56
+ * the field designated as the primary key in the model definition.
57
+ * @type {string | number | bigint | string[] | number[] | bigint[]}
58
+ */
59
+ protected modelId?: string | number | bigint | string[] | number[] | bigint[];
60
+ /**
61
+ * @description Flag to enable or disable dark mode support for the component.
62
+ * @summary When enabled, the component will automatically detect the system's dark mode
63
+ * preference using the media service and apply appropriate styling classes. This flag
64
+ * controls whether the component should respond to dark mode changes and apply the
65
+ * dark palette class to its DOM element. By default, dark mode support is disabled.
66
+ * @protected
67
+ * @type {boolean}
68
+ * @default false
69
+ */
70
+ protected enableDarkMode: boolean;
71
+ /**
72
+ * @description Flag to enable or disable dark mode support for the component.
73
+ * @summary When enabled, the component will automatically detect the system's dark mode
74
+ * preference using the media service and apply appropriate styling classes. This flag
75
+ * controls whether the component should respond to dark mode changes and apply the
76
+ * dark palette class to its DOM element. By default, dark mode support is disabled.
77
+ * @protected
78
+ * @type {boolean}
79
+ * @default false
80
+ */
81
+ protected isDarkMode: boolean;
82
+ /**
83
+ * @description Current locale identifier for component internationalization.
84
+ * @summary Specifies the locale code (e.g., 'en-US', 'pt-BR') used for translating UI text
85
+ * and formatting data according to regional conventions. This property can be set to override
86
+ * the default application locale for this specific component instance, enabling per-component
87
+ * localization when needed.
88
+ * @type {string | undefined}
89
+ */
90
+ locale?: string;
91
+ /**
92
+ * @description Configuration for list item rendering behavior.
93
+ * @summary Defines how list items should be rendered in the component.
94
+ * This property holds a configuration object that specifies the tag name
95
+ * and other properties needed to render list items correctly. The tag property
96
+ * identifies which component should be used to render each item in a list.
97
+ * Additional properties can be included to customize the rendering behavior.
98
+ * @type {Record<string, unknown>}
99
+ * @default {tag: ""}
100
+ */
101
+ item: Record<string, unknown>;
102
+ /**
103
+ * @description Dynamic properties configuration for runtime customization.
104
+ * @summary Contains key-value pairs of dynamic properties that can be applied to the component
105
+ * at runtime. This flexible configuration object allows for dynamic property assignment without
106
+ * requiring explicit input bindings for every possible configuration option. Properties from
107
+ * this object are parsed and applied to the component instance through the parseProps method,
108
+ * enabling customizable component behavior based on external configuration.
109
+ * @type {Record<string, unknown>}
110
+ * @default {}
111
+ */
112
+ props: Record<string, unknown>;
113
+ /**
114
+ * @description Base route path for component navigation.
115
+ * @summary Defines the base route path used for navigation actions related to this component.
116
+ * This is often used as a prefix for constructing navigation URLs when transitioning between
117
+ * different operations or views. The route helps establish the component's position in the
118
+ * application's routing hierarchy.
119
+ * @type {string}
120
+ */
121
+ route?: string;
122
+ /**
123
+ * @description Controls whether borders are displayed around the component.
124
+ * @summary Boolean flag that determines if the component should be visually outlined with borders.
125
+ * When true, borders are shown to visually separate the component from surrounding content.
126
+ *
127
+ * @type {boolean}
128
+ * @default false
129
+ */
130
+ borders: boolean;
131
+ /**
132
+ * @description Component name identifier for logging and localization contexts.
133
+ * @summary Stores the component's name which is used as a key for logging contexts
134
+ * and as a base for locale resolution. Can be injected via the CPTKN token or defaults
135
+ * to "NgxComponentDirective" if not provided.
136
+ * @protected
137
+ * @type {string | undefined}
138
+ */
139
+ protected componentName?: string;
140
+ /**
141
+ * @description Root key for component locale context resolution.
142
+ * @summary Defines the base key used to resolve localization contexts for this component.
143
+ * If not explicitly provided, it defaults to the component's name. This key is used to
144
+ * load appropriate translation resources and locale-specific configurations.
145
+ * @protected
146
+ * @type {string | undefined}
147
+ */
148
+ protected localeRoot?: string;
149
+ /**
150
+ * @description Reference to CRUD operation constants for template usage.
151
+ * @summary Exposes the OperationKeys enum to the component template, enabling
152
+ * conditional rendering and behavior based on operation types. This protected
153
+ * readonly property ensures that template logic can access operation constants
154
+ * while maintaining encapsulation and preventing accidental modification.
155
+ * @protected
156
+ * @readonly
157
+ */
158
+ protected readonly OperationKeys: typeof OperationKeys;
159
+ /**
160
+ * @description Angular Location service.
161
+ * @summary Injected service that provides direct access to the browser's URL and history.
162
+ * Unlike the Router, Location allows for low-level manipulation of the browser's history stack
163
+ * and URL path, such as programmatically navigating back or forward, or updating the URL without
164
+ * triggering a route change. This is useful for scenarios where you need to interact with the
165
+ * browser history or URL outside of Angular's routing system, such as closing modals, handling
166
+ * popstate events, or supporting custom navigation logic.
167
+ *
168
+ */
169
+ protected location: any;
170
+ /**
171
+ * @description Repository instance for data layer operations.
172
+ * @summary Provides a connection to the data layer for retrieving and manipulating data.
173
+ * This is an instance of the DecafRepository class, initialized lazily in the repository getter.
174
+ * The repository is used to perform CRUD (Create, Read, Update, Delete) operations on the
175
+ * data model and provides methods for querying and filtering data based on specific criteria.
176
+ * @type {DecafRepository<Model>}
177
+ * @private
178
+ * @memberOf module:lib/engine/NgxComponentDirective
179
+ */
180
+ protected _repository?: IRepository<Model>;
181
+ /**
182
+ * @description Initialization status flag for the component.
183
+ * @summary Tracks whether the component has completed its initialization process.
184
+ * This flag is used to prevent duplicate initialization and to determine if
185
+ * certain operations that require initialization can be performed.
186
+ * @type {boolean}
187
+ * @default false
188
+ */
189
+ protected initialized: boolean;
190
+ protected events?: Record<keyof Pick<DecafComponent, 'render' | 'initialize'>, UIFunctionLike>;
191
+ protected handlers: Record<string, UIFunctionLike>;
192
+ constructor();
193
+ render(...args: unknown[]): Promise<void>;
194
+ initialize(...args: unknown[]): Promise<void>;
195
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DecafComponent.js","sourceRoot":"","sources":["../../src/ui/DecafComponent.ts"],"names":[],"mappings":";;;AAAA,+CAAgD;AAGhD,2DAAqE;AAGrE,MAAsB,cAAe,SAAQ,qBAAW;IA4NtD;QACE,KAAK,EAAE,CAAC;QA5JV;;;;;;;;;WASG;QACO,mBAAc,GAAY,IAAI,CAAC;QAEzC;;;;;;;;;WASG;QACO,eAAU,GAAY,KAAK,CAAC;QActC;;;;;;;;;WASG;QACH,SAAI,GAA4B,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC;QAG5C;;;;;;;;;WASG;QACH,UAAK,GAA4B,EAAE,CAAC;QAGpC;;;;;;;WAOG;QACH,UAAK,GAAY,EAAE,CAAC;QAEpB;;;;;;;WAOG;QACH,YAAO,GAAY,KAAK,CAAC;QAuBzB;;;;;;;;WAQG;QACgB,kBAAa,GAAG,6BAAa,CAAC;QA6BjD;;;;;;;WAOG;QACO,gBAAW,GAAY,KAAK,CAAC;QAI7B,aAAQ,GAAmC,EAAE,CAAC;IAIxD,CAAC;IAED,6DAA6D;IAC7D,KAAK,CAAC,MAAM,CAAC,GAAG,IAAe,IAAkB,CAAC;IAElD,6DAA6D;IAC7D,KAAK,CAAC,UAAU,CAAC,GAAG,IAAe;QACjC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC1B,CAAC;CAEF;AAxOD,wCAwOC"}