@wavemaker/app-ng-runtime 12.0.0-next.44005 → 12.0.0-next.45002

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 (105) hide show
  1. app-ng-runtime/build-task/advanced/custom-widget-container/custom-widget-container.build.d.ts +2 -0
  2. app-ng-runtime/build-task/advanced/custom-widget-prop/custom-widget-prop.build.d.ts +2 -0
  3. app-ng-runtime/build-task/advanced/custom-widget-wrapper/custom-widget-wrapper.build.d.ts +2 -0
  4. app-ng-runtime/build-task/bundles/index.umd.js +477 -404
  5. app-ng-runtime/build-task/esm2022/advanced/custom-widget-container/custom-widget-container.build.mjs +15 -0
  6. app-ng-runtime/build-task/esm2022/advanced/custom-widget-prop/custom-widget-prop.build.mjs +10 -0
  7. app-ng-runtime/build-task/esm2022/advanced/custom-widget-wrapper/custom-widget-wrapper.build.mjs +26 -0
  8. app-ng-runtime/build-task/esm2022/data/form/form-field/form-field.build.mjs +3 -2
  9. app-ng-runtime/build-task/esm2022/navigation/menu/menu.build.mjs +14 -2
  10. app-ng-runtime/build-task/esm2022/public_api.mjs +4 -1
  11. app-ng-runtime/build-task/fesm2022/index.mjs +479 -405
  12. app-ng-runtime/build-task/fesm2022/index.mjs.map +1 -1
  13. app-ng-runtime/build-task/public_api.d.ts +3 -0
  14. app-ng-runtime/components/advanced/custom/bundles/index.umd.js +275 -0
  15. app-ng-runtime/components/advanced/custom/custom-widget-container/custom-widget-container.directive.d.ts +14 -0
  16. app-ng-runtime/components/advanced/custom/custom-widget-container/custom-widget.props.d.ts +1 -0
  17. app-ng-runtime/components/advanced/custom/custom-widget-container-prop/custom-widget-container-prop.directive.d.ts +20 -0
  18. app-ng-runtime/components/advanced/custom/custom-widget-prop.d.ts +1 -0
  19. app-ng-runtime/components/advanced/custom/custom-widget.directive.d.ts +19 -0
  20. app-ng-runtime/components/advanced/custom/custom-widget.module.d.ts +11 -0
  21. app-ng-runtime/components/advanced/custom/esm2022/custom-widget-container/custom-widget-container.directive.mjs +73 -0
  22. app-ng-runtime/components/advanced/custom/esm2022/custom-widget-container/custom-widget.props.mjs +9 -0
  23. app-ng-runtime/components/advanced/custom/esm2022/custom-widget-container-prop/custom-widget-container-prop.directive.mjs +70 -0
  24. app-ng-runtime/components/advanced/custom/esm2022/custom-widget-prop.mjs +8 -0
  25. app-ng-runtime/components/advanced/custom/esm2022/custom-widget.directive.mjs +68 -0
  26. app-ng-runtime/components/advanced/custom/esm2022/custom-widget.module.mjs +39 -0
  27. app-ng-runtime/components/advanced/custom/esm2022/index.mjs +5 -0
  28. app-ng-runtime/components/advanced/custom/esm2022/public_api.mjs +5 -0
  29. app-ng-runtime/components/advanced/custom/fesm2022/index.mjs +256 -0
  30. app-ng-runtime/components/advanced/custom/fesm2022/index.mjs.map +1 -0
  31. app-ng-runtime/components/advanced/custom/index.d.ts +5 -0
  32. app-ng-runtime/components/advanced/custom/package.json +23 -0
  33. app-ng-runtime/components/advanced/custom/public_api.d.ts +4 -0
  34. app-ng-runtime/components/base/bundles/index.umd.js +65 -9
  35. app-ng-runtime/components/base/components.module.d.ts +12 -11
  36. app-ng-runtime/components/base/esm2022/components.module.mjs +5 -1
  37. app-ng-runtime/components/base/esm2022/public_api.mjs +2 -1
  38. app-ng-runtime/components/base/esm2022/widgets/common/base/base.component.mjs +28 -10
  39. app-ng-runtime/components/base/esm2022/widgets/common/base/custom-widget-container.directive.mjs +39 -0
  40. app-ng-runtime/components/base/fesm2022/index.mjs +65 -10
  41. app-ng-runtime/components/base/fesm2022/index.mjs.map +1 -1
  42. app-ng-runtime/components/base/public_api.d.ts +1 -0
  43. app-ng-runtime/components/base/widgets/common/base/base.component.d.ts +9 -3
  44. app-ng-runtime/components/base/widgets/common/base/custom-widget-container.directive.d.ts +14 -0
  45. app-ng-runtime/components/basic/default/audio/audio.component.d.ts +1 -0
  46. app-ng-runtime/components/basic/default/bundles/index.umd.js +5 -4
  47. app-ng-runtime/components/basic/default/esm2022/audio/audio.component.mjs +6 -5
  48. app-ng-runtime/components/basic/default/fesm2022/index.mjs +5 -4
  49. app-ng-runtime/components/basic/default/fesm2022/index.mjs.map +1 -1
  50. app-ng-runtime/components/basic/progress/bundles/index.umd.js +3 -2
  51. app-ng-runtime/components/basic/progress/esm2022/progress-circle/progress-circle.component.mjs +4 -3
  52. app-ng-runtime/components/basic/progress/fesm2022/index.mjs +3 -2
  53. app-ng-runtime/components/basic/progress/fesm2022/index.mjs.map +1 -1
  54. app-ng-runtime/components/basic/progress/progress-circle/progress-circle.component.d.ts +1 -0
  55. app-ng-runtime/components/data/form/bundles/index.umd.js +4 -3
  56. app-ng-runtime/components/data/form/esm2022/form-field/form-field.directive.mjs +1 -2
  57. app-ng-runtime/components/data/form/esm2022/live-form/live-form.directive.mjs +5 -3
  58. app-ng-runtime/components/data/form/fesm2022/index.mjs +4 -3
  59. app-ng-runtime/components/data/form/fesm2022/index.mjs.map +1 -1
  60. app-ng-runtime/components/input/default/bundles/index.umd.js +46 -53
  61. app-ng-runtime/components/input/default/esm2022/caption-position.directive.mjs +2 -3
  62. app-ng-runtime/components/input/default/esm2022/select/select.component.mjs +44 -53
  63. app-ng-runtime/components/input/default/esm2022/text/base/base-input.mjs +4 -1
  64. app-ng-runtime/components/input/default/fesm2022/index.mjs +47 -54
  65. app-ng-runtime/components/input/default/fesm2022/index.mjs.map +1 -1
  66. app-ng-runtime/components/input/default/select/select.component.d.ts +1 -2
  67. app-ng-runtime/components/input/epoch/bundles/index.umd.js +19 -7
  68. app-ng-runtime/components/input/epoch/date/date.component.d.ts +1 -0
  69. app-ng-runtime/components/input/epoch/esm2022/date/date.component.mjs +9 -3
  70. app-ng-runtime/components/input/epoch/esm2022/date/imaskUtil.mjs +8 -2
  71. app-ng-runtime/components/input/epoch/esm2022/date-time/date-time.component.mjs +3 -3
  72. app-ng-runtime/components/input/epoch/esm2022/time/time.component.mjs +3 -3
  73. app-ng-runtime/components/input/epoch/fesm2022/index.mjs +19 -7
  74. app-ng-runtime/components/input/epoch/fesm2022/index.mjs.map +1 -1
  75. app-ng-runtime/core/bundles/index.umd.js +10 -0
  76. app-ng-runtime/core/enums/enums.d.ts +2 -1
  77. app-ng-runtime/core/esm2022/enums/enums.mjs +2 -1
  78. app-ng-runtime/core/esm2022/types/types.mjs +4 -1
  79. app-ng-runtime/core/esm2022/utils/build-utils.mjs +6 -1
  80. app-ng-runtime/core/fesm2022/index.mjs +10 -1
  81. app-ng-runtime/core/fesm2022/index.mjs.map +1 -1
  82. app-ng-runtime/core/types/types.d.ts +5 -1
  83. app-ng-runtime/package.json +1 -1
  84. app-ng-runtime/runtime/base/bundles/index.umd.js +254 -4
  85. app-ng-runtime/runtime/base/components/base-custom-widget.component.d.ts +71 -0
  86. app-ng-runtime/runtime/base/esm2022/components/base-custom-widget.component.mjs +253 -0
  87. app-ng-runtime/runtime/base/esm2022/public_api.mjs +2 -1
  88. app-ng-runtime/runtime/base/esm2022/runtime-base.module.mjs +6 -1
  89. app-ng-runtime/runtime/base/esm2022/types/types.mjs +2 -1
  90. app-ng-runtime/runtime/base/fesm2022/index.mjs +251 -1
  91. app-ng-runtime/runtime/base/fesm2022/index.mjs.map +1 -1
  92. app-ng-runtime/runtime/base/public_api.d.ts +1 -0
  93. app-ng-runtime/runtime/base/runtime-base.module.d.ts +9 -8
  94. app-ng-runtime/runtime/base/types/types.d.ts +2 -1
  95. app-ng-runtime/runtime/dynamic/bundles/index.umd.js +26 -9
  96. app-ng-runtime/runtime/dynamic/esm2022/app/app.module.mjs +5 -2
  97. app-ng-runtime/runtime/dynamic/esm2022/app/services/component-ref-provider.service.mjs +22 -7
  98. app-ng-runtime/runtime/dynamic/fesm2022/index.mjs +25 -7
  99. app-ng-runtime/runtime/dynamic/fesm2022/index.mjs.map +1 -1
  100. app-ng-runtime/scripts/datatable/datatable.js +1 -0
  101. app-ng-runtime/transpiler/bundles/index.umd.js +5 -0
  102. app-ng-runtime/transpiler/esm2022/build.mjs +4 -1
  103. app-ng-runtime/transpiler/esm2022/imports.mjs +3 -1
  104. app-ng-runtime/transpiler/fesm2022/index.mjs +5 -0
  105. app-ng-runtime/transpiler/fesm2022/index.mjs.map +1 -1
@@ -1012,9 +1012,10 @@ class BaseComponent {
1012
1012
  }
1013
1013
  else {
1014
1014
  this.delayedInit = true;
1015
- initPromise.then(() => {
1015
+ initPromise.then((resolveFn) => {
1016
1016
  this.initWidget();
1017
1017
  this.setInitProps();
1018
+ resolveFn && resolveFn();
1018
1019
  });
1019
1020
  }
1020
1021
  }
@@ -1221,11 +1222,11 @@ class BaseComponent {
1221
1222
  * @param {string} eventName
1222
1223
  * @param {string} expr
1223
1224
  */
1224
- processEventAttr(eventName, expr, meta) {
1225
+ processEventAttr(eventName, expr, meta, child) {
1225
1226
  const fn = $parseEvent(expr);
1226
1227
  const locals = this.context;
1227
- locals.widget = this.widget;
1228
- const boundFn = fn.bind(undefined, this.viewParent, locals);
1228
+ locals.widget = child ? child.widget : this.widget;
1229
+ const boundFn = fn.bind(undefined, child ? this.viewParent.viewParent : this.viewParent, locals);
1229
1230
  const eventCallback = () => {
1230
1231
  let boundFnVal;
1231
1232
  $invokeWatchers(true);
@@ -1245,15 +1246,29 @@ class BaseComponent {
1245
1246
  console.error(e);
1246
1247
  }
1247
1248
  };
1248
- this.eventHandlers.set(this.getMappedEventName(eventName), { callback: eventCallback, locals });
1249
+ if (child) {
1250
+ if (!child.widget.eventHandlers)
1251
+ child.widget.eventHandlers = new Map();
1252
+ child.widget.eventHandlers.set(this.getMappedEventName(eventName), { callback: eventCallback, locals });
1253
+ }
1254
+ else
1255
+ this.eventHandlers.set(this.getMappedEventName(eventName), { callback: eventCallback, locals });
1249
1256
  // prepend eventName with on and convert it to camelcase.
1250
1257
  // eg, "click" ---> onClick
1251
1258
  const onEventName = _.camelCase(`on-${eventName}`);
1252
1259
  // save the eventCallback in widgetScope.
1253
- this[onEventName] = eventCallback;
1260
+ if (child) {
1261
+ child.widget[onEventName] = eventCallback;
1262
+ }
1263
+ else
1264
+ this[onEventName] = eventCallback;
1254
1265
  // events needs to be setup after viewInit
1255
1266
  this.toBeSetupEventsQueue.push(() => {
1256
- this.handleEvent(this.nativeElement, this.getMappedEventName(eventName), eventCallback, locals, meta);
1267
+ if (child) {
1268
+ this.handleEvent(child.nativeElement, this.getMappedEventName(eventName), eventCallback, locals, meta);
1269
+ }
1270
+ else
1271
+ this.handleEvent(this.nativeElement, this.getMappedEventName(eventName), eventCallback, locals, meta);
1257
1272
  });
1258
1273
  }
1259
1274
  /**
@@ -1285,13 +1300,16 @@ class BaseComponent {
1285
1300
  }
1286
1301
  }
1287
1302
  }
1303
+ processChildAttr(attrName, attrValue, child) {
1304
+ this.processAttr(attrName, attrValue, child);
1305
+ }
1288
1306
  /**
1289
1307
  * Process the attribute
1290
1308
  * If the attribute is an event expression, generate a functional representation of the expression
1291
1309
  * and keep in eventHandlers
1292
1310
  * If the attribute is a bound expression, register a watch on the expression
1293
1311
  */
1294
- processAttr(attrName, attrValue) {
1312
+ processAttr(attrName, attrValue, child) {
1295
1313
  // console.log("====attrName=====", attrName, "=====typeof attrname=====", typeof attrName, "-----attrValue----", attrValue);
1296
1314
  const { 0: propName, 1: type, 2: meta, length } = attrName.split('.');
1297
1315
  if (type === 'bind') {
@@ -1302,7 +1320,7 @@ class BaseComponent {
1302
1320
  this.processBindAttr(propName, attrValue);
1303
1321
  }
1304
1322
  else if (type === 'event') {
1305
- this.processEventAttr(propName, attrValue, meta);
1323
+ this.processEventAttr(propName, attrValue, meta, child);
1306
1324
  }
1307
1325
  else if (length === 1) {
1308
1326
  // remove class and name attributes. Component will set them on the proper node
@@ -2023,6 +2041,40 @@ class PartialContainerDirective {
2023
2041
  args: ['content']
2024
2042
  }] }, { type: i0.ComponentFactoryResolver }, { type: i1.PartialRefProvider }]; }, null); })();
2025
2043
 
2044
+ class CustomWidgetContainerDirective {
2045
+ constructor(componentInstance, vcRef, elRef, inj, app, widgetname, customWidgetRefProvider) {
2046
+ this.componentInstance = componentInstance;
2047
+ this.vcRef = vcRef;
2048
+ this.elRef = elRef;
2049
+ this.inj = inj;
2050
+ this.app = app;
2051
+ this.customWidgetRefProvider = customWidgetRefProvider;
2052
+ const widgetnames = this.componentInstance.widgetname;
2053
+ this.customWidgetRefProvider.getComponentFactoryRef(widgetname, ComponentType.WIDGET).then((componentFactory) => {
2054
+ if (componentFactory) {
2055
+ const instanceRef = this.vcRef.createComponent(componentFactory, 0, this.inj);
2056
+ this.elRef.nativeElement.appendChild(instanceRef.location.nativeElement);
2057
+ }
2058
+ });
2059
+ }
2060
+ static { this.ɵfac = function CustomWidgetContainerDirective_Factory(t) { return new (t || CustomWidgetContainerDirective)(i0.ɵɵdirectiveInject(WidgetRef, 2), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Injector), i0.ɵɵdirectiveInject(i1.App), i0.ɵɵinjectAttribute('widgetname'), i0.ɵɵdirectiveInject(i1.CustomWidgetRefProvider)); }; }
2061
+ static { this.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: CustomWidgetContainerDirective, selectors: [["", "customWidgetContainer", "", "widgetname", ""]] }); }
2062
+ }
2063
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CustomWidgetContainerDirective, [{
2064
+ type: Directive,
2065
+ args: [{
2066
+ selector: '[customWidgetContainer][widgetname]'
2067
+ }]
2068
+ }], function () { return [{ type: undefined, decorators: [{
2069
+ type: Self
2070
+ }, {
2071
+ type: Inject,
2072
+ args: [WidgetRef]
2073
+ }] }, { type: i0.ViewContainerRef }, { type: i0.ElementRef }, { type: i0.Injector }, { type: i1.App }, { type: undefined, decorators: [{
2074
+ type: Attribute,
2075
+ args: ['widgetname']
2076
+ }] }, { type: i1.CustomWidgetRefProvider }]; }, null); })();
2077
+
2026
2078
  class ShowInDeviceDirective {
2027
2079
  constructor(elRef, widget, viewContainerRef, inj, templateRef) {
2028
2080
  this.elRef = elRef;
@@ -3029,6 +3081,7 @@ const wmComponents = [
3029
3081
  PartialParamHandlerDirective,
3030
3082
  PartialParamDirective,
3031
3083
  PartialContainerDirective,
3084
+ CustomWidgetContainerDirective,
3032
3085
  RedrawableDirective,
3033
3086
  ShowInDeviceDirective,
3034
3087
  SmoothScrollDirective,
@@ -3096,6 +3149,7 @@ class WmComponentsModule {
3096
3149
  PartialParamHandlerDirective,
3097
3150
  PartialParamDirective,
3098
3151
  PartialContainerDirective,
3152
+ CustomWidgetContainerDirective,
3099
3153
  RedrawableDirective,
3100
3154
  ShowInDeviceDirective,
3101
3155
  SmoothScrollDirective,
@@ -3126,6 +3180,7 @@ class WmComponentsModule {
3126
3180
  PartialParamHandlerDirective,
3127
3181
  PartialParamDirective,
3128
3182
  PartialContainerDirective,
3183
+ CustomWidgetContainerDirective,
3129
3184
  RedrawableDirective,
3130
3185
  ShowInDeviceDirective,
3131
3186
  SmoothScrollDirective,
@@ -5144,5 +5199,5 @@ const updateDeviceView = (element, isTablet = false) => {
5144
5199
  * Generated bundle index. Do not edit.
5145
5200
  */
5146
5201
 
5147
- export { ALLFIELDS, APPLY_STYLES_TYPE, AUTOCLOSE_TYPE, BaseComponent, BaseContainerComponent, BaseFieldValidations, ContainerDirective, Context, CustomPipe, DEBOUNCE_TIMES, DISPLAY_TYPE, DataSetItem, DatasetAwareNavComponent, DialogRef, DialogServiceImpl, EDIT_MODE, EVENTS_MAP, FileExtensionFromMimePipe, FileIconClassPipe, FileSizePipe, FilterPipe, INPUTMODE, ImagePipe, ItemTemplateDirective, LIVE_CONSTANTS, LazyLoadDirective, Live_Operations, MessageComponent, NAVIGATION_TYPE, NumberToStringPipe, PROP_ANY, PROP_BOOLEAN, PROP_NUMBER, PROP_STRING, PROP_TYPE, PartialContainerDirective, PartialDirective, PartialParamDirective, PartialParamHandlerDirective, PrefixPipe, PullToRefresh, RedrawableDirective, RepeatTemplateDirective, SanitizePipe, ShowInDeviceDirective, SmoothScrollDirective, StateClassPipe, StringToNumberPipe, StylableComponent, SuffixPipe, TextContentDirective, TimeFromNowPipe, ToCurrencyPipe, ToDatePipe, ToNumberPipe, TrailingZeroDecimalPipe, TrustAsPipe, WidgetConfig, WidgetRef, WmComponentsModule, applyFilterOnField, configureDnD, convertDataToObject, createArrayFrom, extractDataAsArray, extractDataSourceName, fetchDistinctValues, fetchRelatedFieldData, filterDate, getBackGroundImageUrl, getConditionalClasses, getContainerTargetClass, getDataTableFilterWidget, getDefaultValue, getDefaultViewModeWidget, getDistinctFieldProperties, getDistinctValues, getDistinctValuesForField, getEditModeWidget, getEmptyMatchMode, getEnableEmptyFilter, getEvaluatedData, getFieldLayoutConfig, getFieldTypeWidgetTypesMap, getImageUrl, getKeyboardFocusableElements, getMatchModeMsgs, getMatchModeTypesMap, getObjValueByKey, getOrderByExpr, getOrderedDataset, getRangeFieldValue, getRangeMatchMode, getRowOperationsColumn, getUniqObjsByDataField, getWatchIdentifier, getWidgetPropsByType, groupData, handleHeaderClick, hasLinkToCurrentPage, interpolateBindExpressions, isActiveNavItem, isBooleanAttr, isDataSetWidget, isDimensionProp, isStyle, parseValueByType, performDataOperation, prepareFieldDefs, propNameCSSKeyMap, provideAs, provideAsDialogRef, provideAsWidgetRef, refreshDataSource, register$1 as register, registerFormWidget, setFocusTrap, setHeaderConfig, setHeaderConfigForTable, setItemByCompare, styler, toggleAllHeaders, transformData, transformDataWithKeys, transformFormData, unsupportedStatePersistenceTypes, updateDeviceView };
5202
+ export { ALLFIELDS, APPLY_STYLES_TYPE, AUTOCLOSE_TYPE, BaseComponent, BaseContainerComponent, BaseFieldValidations, ContainerDirective, Context, CustomPipe, CustomWidgetContainerDirective, DEBOUNCE_TIMES, DISPLAY_TYPE, DataSetItem, DatasetAwareNavComponent, DialogRef, DialogServiceImpl, EDIT_MODE, EVENTS_MAP, FileExtensionFromMimePipe, FileIconClassPipe, FileSizePipe, FilterPipe, INPUTMODE, ImagePipe, ItemTemplateDirective, LIVE_CONSTANTS, LazyLoadDirective, Live_Operations, MessageComponent, NAVIGATION_TYPE, NumberToStringPipe, PROP_ANY, PROP_BOOLEAN, PROP_NUMBER, PROP_STRING, PROP_TYPE, PartialContainerDirective, PartialDirective, PartialParamDirective, PartialParamHandlerDirective, PrefixPipe, PullToRefresh, RedrawableDirective, RepeatTemplateDirective, SanitizePipe, ShowInDeviceDirective, SmoothScrollDirective, StateClassPipe, StringToNumberPipe, StylableComponent, SuffixPipe, TextContentDirective, TimeFromNowPipe, ToCurrencyPipe, ToDatePipe, ToNumberPipe, TrailingZeroDecimalPipe, TrustAsPipe, WidgetConfig, WidgetRef, WmComponentsModule, applyFilterOnField, configureDnD, convertDataToObject, createArrayFrom, extractDataAsArray, extractDataSourceName, fetchDistinctValues, fetchRelatedFieldData, filterDate, getBackGroundImageUrl, getConditionalClasses, getContainerTargetClass, getDataTableFilterWidget, getDefaultValue, getDefaultViewModeWidget, getDistinctFieldProperties, getDistinctValues, getDistinctValuesForField, getEditModeWidget, getEmptyMatchMode, getEnableEmptyFilter, getEvaluatedData, getFieldLayoutConfig, getFieldTypeWidgetTypesMap, getImageUrl, getKeyboardFocusableElements, getMatchModeMsgs, getMatchModeTypesMap, getObjValueByKey, getOrderByExpr, getOrderedDataset, getRangeFieldValue, getRangeMatchMode, getRowOperationsColumn, getUniqObjsByDataField, getWatchIdentifier, getWidgetPropsByType, groupData, handleHeaderClick, hasLinkToCurrentPage, interpolateBindExpressions, isActiveNavItem, isBooleanAttr, isDataSetWidget, isDimensionProp, isStyle, parseValueByType, performDataOperation, prepareFieldDefs, propNameCSSKeyMap, provideAs, provideAsDialogRef, provideAsWidgetRef, refreshDataSource, register$1 as register, registerFormWidget, setFocusTrap, setHeaderConfig, setHeaderConfigForTable, setItemByCompare, styler, toggleAllHeaders, transformData, transformDataWithKeys, transformFormData, unsupportedStatePersistenceTypes, updateDeviceView };
5148
5203
  //# sourceMappingURL=index.mjs.map