inviton-powerduck 0.0.8 → 0.0.9

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 (39) hide show
  1. package/app/vuetsx.ts +14 -9
  2. package/common/base-component.tsx +2 -2
  3. package/common/history-extended.ts +172 -0
  4. package/common/history-handler.ts +91 -135
  5. package/common/slot-unwrapper.ts +17 -0
  6. package/common/utils/broswer-image-compression.ts +19 -15
  7. package/common/utils/format-string.ts +5 -4
  8. package/common/utils/upload-image-helper.ts +5 -3
  9. package/common/validation.ts +4 -15
  10. package/components/bootstrap-toggle/index.tsx +1 -1
  11. package/components/chart-js/bar-chart.tsx +2 -2
  12. package/components/chart-js/line-chart-flot.tsx +1 -1
  13. package/components/chart-js/line-chart.tsx +1 -1
  14. package/components/chart-js/pie-chart.tsx +2 -2
  15. package/components/chart-js/plot.tsx +1 -1
  16. package/components/counter/testall.tsx +1 -0
  17. package/components/datatable/col-vis-modal.tsx +6 -11
  18. package/components/datatable/datatable.tsx +4 -4
  19. package/components/datatable/export-excel-modal.tsx +2 -17
  20. package/components/datatable/filter-modal.tsx +2 -14
  21. package/components/dropdown/index.tsx +1 -1
  22. package/components/dropdown-button/dropdown-button.tsx +1 -1
  23. package/components/fullcalendar/timegrid-calendar.tsx +1 -1
  24. package/components/image-crop/upload-and-crop.tsx +10 -3
  25. package/components/input/color-picker.tsx +1 -1
  26. package/components/input/daterange-picker.tsx +1 -1
  27. package/components/input/datetime-picker.tsx +2 -2
  28. package/components/input/localized-info-input.tsx +2 -0
  29. package/components/input/wysiwig.tsx +2 -2
  30. package/components/modal/modal-utils.ts +18 -4
  31. package/components/modal/ts/file-manager-dialog.ts +6 -5
  32. package/components/modal-wrap/modal-section.tsx +1 -1
  33. package/components/quick-edit/quick-edit-modal-base.tsx +1 -1
  34. package/components/tabs/tabs.tsx +6 -4
  35. package/components/tooltip/index.tsx +1 -1
  36. package/components/ui/notification.ts +23 -18
  37. package/package.json +1 -1
  38. package/common/static-wrappers/history-handler-ext.ts +0 -27
  39. package/components/ui/bootstrap-modal.ts +0 -52
package/app/vuetsx.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  import { Prop, Vue, Component as OriginalComponent } from "vue-facing-decorator";
3
3
  import { ComponentSetupFunction, Cons } from "vue-facing-decorator/dist/component";
4
4
  import { ValidationRuleset, ValidationState } from "../common/static-wrappers/interfaces/validation-interface";
5
+ import { slotUnwrapper } from "../common/slot-unwrapper";
5
6
 
6
7
  @Component
7
8
  export default class TsxComponent<P> extends Vue {
@@ -31,16 +32,20 @@ export default class TsxComponent<P> extends Vue {
31
32
  }
32
33
  }
33
34
 
34
- protected getSlotProperties<T>(type: string): Array<T> {
35
- var retVal: Array<T> = [];
36
- for (const node of (this.$slots.default?.() || [])) {
37
- const fwId = (node as any).type?.__vfdConstructor?.$fwName;
38
- if (fwId == type) {
39
- retVal.push(node.props as any)
40
- }
41
- }
42
-
35
+ protected getSlotProperties<T>(type: string): Array<T> {
36
+ const slots = slotUnwrapper(this.$slots.default?.());
37
+ const retVal: Array<T> = [] = slots?.filter(node => (node as any)?.type?.__vfdConstructor?.$fwName == type).map(node => node.props as any);
43
38
  return retVal;
39
+
40
+ // var retVal: Array<T> = [];
41
+ // for (const node of (this.$slots.default?.() || [])) {
42
+ // const fwId = (node as any).type?.__vfdConstructor?.$fwName;
43
+ // if (fwId == type) {
44
+ // retVal.push(node.props as any)
45
+ // }
46
+ // }
47
+
48
+ // return retVal;
44
49
  }
45
50
  }
46
51
 
@@ -179,7 +179,7 @@ export abstract class PowerduckViewModelBase extends Vue {
179
179
  /**
180
180
  * Validates current viewModel state based on given valdiation ruleset
181
181
  */
182
- validate(showErrorMessage?: boolean, silent?: boolean): boolean {
182
+ async validate(showErrorMessage?: boolean, silent?: boolean): Promise<boolean> {
183
183
  if (localStorage.getItem("disableValidation") == "1") {
184
184
  return true;
185
185
  }
@@ -188,7 +188,7 @@ export abstract class PowerduckViewModelBase extends Vue {
188
188
  throw "Validation rules not specified, has to be specified in @Component declaration!";
189
189
  }
190
190
 
191
- var isInvalid = this.v$.$error;
191
+ var isInvalid = !(await this.v$.$validate());
192
192
  if (isInvalid) {
193
193
  if (showErrorMessage != false) {
194
194
  this.showValidationErrorMessage();
@@ -0,0 +1,172 @@
1
+ export interface HistoryChangedData {
2
+ from: any
3
+ to: any
4
+ history: any[]
5
+ direction: 'back' | 'forward' | 'reload'
6
+ handled?: boolean
7
+ }
8
+
9
+ export interface HistoryChangedEvent extends PopStateEvent {
10
+ detail: HistoryChangedData
11
+ }
12
+
13
+ interface HistoryOnSteroids extends History {
14
+ __historyExtendedInitialized: boolean
15
+ // stateIndex: number
16
+ // states: string[][]
17
+ // silentPop: boolean
18
+
19
+ silentBack: () => void
20
+ clearForward: () => void
21
+ nextBackWillNavigateAway: () => boolean
22
+ }
23
+
24
+
25
+ const history: HistoryOnSteroids = window.history as any;
26
+ if (!history.__historyExtendedInitialized) {
27
+ history.__historyExtendedInitialized = true;
28
+
29
+ (function () {
30
+ const originalPushState = history.pushState;
31
+ const originalReplaceState = history.replaceState;
32
+
33
+ let currentIndex = 0;
34
+ let previousState = null;
35
+ const stateHistory = []; // Array to store the timeline of states
36
+ let silentMode = false; // Flag to suppress events
37
+
38
+ // Function to log state into history
39
+ function logState(state, index) {
40
+ stateHistory[index] = { ...state, __heindex: index };
41
+ }
42
+
43
+ // Function to dispatch the 'history-changed' event
44
+ function dispatchHistoryChangedEvent(direction, fromState, toState) {
45
+ const event = new CustomEvent("history-changed", {
46
+ detail: {
47
+ direction,
48
+ from: fromState,
49
+ to: toState,
50
+ history: stateHistory.slice(0, currentIndex + 1),
51
+ },
52
+ });
53
+
54
+ if (silentMode) {
55
+ return;
56
+ }
57
+
58
+ window.dispatchEvent(event);
59
+ }
60
+
61
+ // Override pushState
62
+ history.pushState = function (state, title, url) {
63
+ previousState = { ...history.state, __heindex: currentIndex };
64
+ currentIndex++;
65
+ const enhancedState = { ...state, __heindex: currentIndex };
66
+
67
+ logState(enhancedState, currentIndex); // Log new state to history
68
+ originalPushState.call(history, enhancedState, title, url);
69
+ //dispatchHistoryChangedEvent("forward", previousState, enhancedState);
70
+ };
71
+
72
+ // Override replaceState
73
+ history.replaceState = function (state, title, url) {
74
+ const enhancedState = { ...state, __heindex: currentIndex };
75
+ logState(enhancedState, currentIndex); // Replace state in history
76
+ originalReplaceState.call(history, enhancedState, title, url);
77
+ };
78
+
79
+ // Popstate listener to detect navigation direction
80
+ window.addEventListener("popstate", (event) => {
81
+ if (silentMode) return; // Suppress event if in silent mode
82
+
83
+ const previousIndex = currentIndex;
84
+ previousState = stateHistory[previousIndex] || null;
85
+
86
+ currentIndex = event.state ? event.state.__heindex || 0 : 0;
87
+ const toState = stateHistory[currentIndex] || event.state || {};
88
+
89
+ if (currentIndex > previousIndex) {
90
+ dispatchHistoryChangedEvent("forward", previousState, toState);
91
+ } else if (currentIndex < previousIndex) {
92
+ dispatchHistoryChangedEvent("back", previousState, toState);
93
+ } else {
94
+ dispatchHistoryChangedEvent("reload", previousState, toState);
95
+ }
96
+ });
97
+
98
+ // Preserve current state on load and add index
99
+ window.addEventListener("load", () => {
100
+ const initialState = history.state || {};
101
+ if (!initialState.__heindex) {
102
+ history.replaceState({ ...initialState, __heindex: currentIndex }, "");
103
+ } else {
104
+ currentIndex = initialState.__heindex;
105
+ }
106
+ logState(history.state, currentIndex);
107
+ previousState = history.state;
108
+ });
109
+
110
+ // Add silent back navigation method
111
+ history.silentBack = function () {
112
+ silentMode = true; // Suppress events temporarily
113
+ history.back();
114
+ setTimeout(() => {
115
+ silentMode = false; // Restore normal behavior
116
+ }, 0);
117
+ };
118
+
119
+ // Add clear forward navigation method
120
+ history.clearForward = function () {
121
+ const currentState = { ...history.state };
122
+ silentMode = true; // Suppress events temporarily
123
+ originalReplaceState.call(history, currentState, "", location.href);
124
+ stateHistory.splice(currentIndex + 1); // Remove all forward history
125
+ setTimeout(() => {
126
+ silentMode = false; // Restore normal behavior
127
+ }, 0);
128
+ };
129
+
130
+ history.nextBackWillNavigateAway = function () {
131
+ return currentIndex < 1;
132
+ }
133
+ })();
134
+ }
135
+
136
+ export default class HistoryExtended {
137
+ static addPopstateListener(handler: (ev: HistoryChangedEvent) => any) {
138
+ addEventListener("history-changed" as any, handler);
139
+ }
140
+
141
+ static removePopstateListener(handler: (ev: HistoryChangedEvent) => any) {
142
+ removeEventListener("history-changed" as any, handler);
143
+ }
144
+
145
+ static nextBackWillNavigateAway(): boolean {
146
+ return history.nextBackWillNavigateAway();
147
+ }
148
+
149
+ static back(args?: { silent?: boolean }): void {
150
+ if (args?.silent == true) {
151
+ history.silentBack();
152
+ } else {
153
+ history.back();
154
+ }
155
+ }
156
+
157
+ static forward(): void {
158
+ history.forward();
159
+ }
160
+
161
+ static go(delta?: number): void {
162
+ history.go(delta);
163
+ }
164
+
165
+ static pushState(data: any, unused: string, url?: string | URL | null): void {
166
+ history.pushState(data, unused, url);
167
+ }
168
+
169
+ static replaceState(data: any, unused: string, url?: string | URL | null): void {
170
+ history.replaceState(data, unused, url);
171
+ }
172
+ }
@@ -1,155 +1,111 @@
1
- import { arrayExtend } from "./utils/array-extend"
2
- import { isNullOrEmpty } from "./utils/is-null-or-empty"
3
- import { PortalUtils } from "./utils/utils"
1
+ import { ModalUtils } from "./../components/modal/modal-utils";
2
+ import HistoryExtended from "./history-extended"
3
+
4
4
 
5
5
  export const initHistory = () => {
6
- import("jquery").then((jq) => {
7
- const $ = jq.default
8
- let openArr = arrayExtend<string>([]);
9
- let skipModalHideCount = 0
10
- let skipHistoryCount = 0
11
-
12
- let initializer = {
13
- intializeModalListener() {
14
- $(document).on("show.bs.modal", ".modal", function (this: any) {
15
- if ($(this).attr("data-preventhistory") == "true") {
16
- return
17
- }
6
+ const randomString = (length: number): string => {
7
+ var result = "";
8
+ var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
9
+ for (var i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)];
10
+ return result;
11
+ }
12
+
13
+ const initializer = {
14
+ intializeModalListener() {
15
+ if ((window as any).__historyPowerduckInitialized == true) {
16
+ return;
17
+ }
18
18
 
19
- let handleUUID = PortalUtils.randomString(16)
20
- $(this).attr("data-hist-uuid", handleUUID)
21
- openArr.push(handleUUID)
22
-
23
- window.history.pushState(
24
- {
25
- modalId: handleUUID,
26
- },
27
- null,
28
- null,
29
- )
30
- })
31
-
32
- $(document).on("fdd-show", function (this: any, e: any, context: JQuery) {
33
- let handleUUID = PortalUtils.randomString(16)
34
- $(context).attr("data-hist-uuid", handleUUID)
35
- openArr.push(handleUUID)
36
-
37
- window.history.pushState(
38
- {
39
- fddId: handleUUID,
40
- },
41
- null,
42
- null,
43
- )
44
- })
45
-
46
- $(document).on("hide.bs.modal", ".modal", function (this: any) {
47
- if ($(this).attr("data-preventhistory") == "true") {
48
- return
49
- }
19
+ (window as any).__historyPowerduckInitialized = true;
20
+ $(document).on("show.bs.modal", ".modal", function (this: any) {
21
+ const elem = this as HTMLElement;
22
+ if (elem.getAttribute('data-preventhistory') == 'true') {
23
+ return;
24
+ }
50
25
 
51
- let handleUUID = $(this).attr("data-hist-uuid")
52
- openArr.remove(handleUUID)
26
+ const modalId = randomString(16);
27
+ elem.setAttribute('data-history-uuid', modalId);
28
+ HistoryExtended.pushState({ modalId }, null, null);
29
+ });
53
30
 
54
- if (skipModalHideCount > 0) {
55
- skipModalHideCount -= 1
56
- } else {
57
- skipHistoryCount += 1
58
- window.history.back()
59
- }
60
- })
31
+ $(document).on("fdd-show", function (this: any, e: any, context: JQuery) {
32
+ const elem = this as HTMLElement;
33
+ if (elem.getAttribute('data-preventhistory') == 'true') {
34
+ return;
35
+ }
61
36
 
62
- $(document).on("fdd-hide", function (this: any, e: any, context: JQuery) {
63
- let handleUUID = $(this).attr("data-hist-uuid")
64
- openArr.remove(handleUUID)
37
+ const fddId = randomString(16);
38
+ elem.setAttribute('data-history-uuid', fddId);
39
+ HistoryExtended.pushState({ fddId }, null, null);
40
+ });
65
41
 
66
- if (skipModalHideCount > 0) {
67
- skipModalHideCount -= 1
68
- } else {
69
- skipHistoryCount += 1
70
- window.history.back()
71
- }
72
- })
73
-
74
- window.addEventListener("popstate", function (e) {
75
- let state = e.state
76
- if (state != null && !isNullOrEmpty(state.modalId)) {
77
- let modalElem = $("[data-hist-uuid='" + state.modalId + "']")
78
- if (modalElem.length > 0 && !modalElem.hasClass("show")) {
79
- modalElem.show()
80
- return
42
+ $(document).on("hide.bs.modal", ".modal", function (this: any, e) {
43
+ const elem = this as HTMLElement;
44
+ if (elem.getAttribute('data-preventhistory') == 'true') {
45
+ return;
46
+ }
47
+
48
+ const backButtonTriggered = elem.getAttribute('data-history-bbtrigger');
49
+ elem.removeAttribute('data-history-bbtrigger');
50
+
51
+ if (backButtonTriggered != 'true') {
52
+ const isHandled = (e as any)._isNavHandled;
53
+ if (isHandled != true) {
54
+ (e as any)._isNavHandled = true;
55
+
56
+ if (!HistoryExtended.nextBackWillNavigateAway()) {
57
+ HistoryExtended.back({ silent: true });
81
58
  }
82
59
  }
60
+ }
61
+ });
62
+
63
+ $(document).on("fdd-hide", function (this: any, e: any, context: JQuery) {
64
+ const elem = this as HTMLElement;
65
+ if (elem.getAttribute('data-preventhistory') == 'true') {
66
+ return;
67
+ }
83
68
 
84
- if (state != null && !isNullOrEmpty(state.fddId)) {
85
- return
69
+ const backButtonTriggered = elem.getAttribute('data-history-bbtrigger');
70
+ elem.removeAttribute('data-history-bbtrigger');
71
+
72
+ if (backButtonTriggered != 'true') {
73
+ const isHandled = (e as any)._isNavHandled;
74
+ if (isHandled != true) {
75
+ (e as any)._isNavHandled = true;
76
+ HistoryExtended.back({ silent: true });
86
77
  }
78
+ }
79
+ });
87
80
 
88
- if (skipHistoryCount > 0) {
89
- skipHistoryCount -= 1
90
- //history.replaceState({ "obsolete": true }, "");
91
- //setTimeout(() => {
92
- //history.pushState(null, document.title, location.href);
93
- //}, 20);
94
- } else {
95
- let handleUUID = openArr.pop()
96
- if (!isNullOrEmpty(handleUUID)) {
97
- skipModalHideCount += 1
98
-
99
- let context = $("[data-hist-uuid='" + handleUUID + "']")
100
- if (context.hasClass("modal")) {
101
- context.hide()
102
- } else if (context.attr("id") == "filterableSelectDropDown") {
103
- $("#btn_fdd_FddCancel").click()
104
- }
105
- }
81
+ HistoryExtended.addPopstateListener((e) => {
82
+ const { detail } = e;
83
+ if (detail == null) {
84
+ return;
85
+ }
106
86
 
107
- //history.replaceState({ "obsolete": true }, "");
108
- //setTimeout(() => {
109
- // history.pushState(null, document.title, location.href);
110
- //}, 20);
87
+ if (detail.direction == 'back') {
88
+ const stateFrom = detail.from;
89
+ if (stateFrom == null) {
90
+ return;
91
+ }
92
+
93
+ const modalId = stateFrom.modalId;
94
+ if (modalId != null && modalId.length > 0) {
95
+ const $modal = $("[data-history-uuid='" + modalId + "']");
96
+ $modal.attr('data-history-bbtrigger', 'true');
97
+ ModalUtils.hideModal($modal);
111
98
  }
112
- })
113
- },
114
- }
115
99
 
116
- //Modal stacking handler
117
- $(document).on("show.bs.modal", ".modal", function (this: any) {
118
- var $this = $(this)
119
- var highestZ = 0
120
-
121
- $(".modal:visible").each(function (this: HTMLElement) {
122
- let zi = this.style.zIndex
123
- if (zi != null && zi.length > 0) {
124
- let numZi = Number(zi)
125
- if (numZi > highestZ && numZi > 1049) {
126
- highestZ = numZi
100
+ const fddId = stateFrom.fddId;
101
+ if (fddId != null && fddId.length > 0) {
102
+ $("#btn_fdd_FddCancel").trigger('click');
127
103
  }
128
104
  }
129
- })
130
105
 
131
- if (highestZ < 1049) {
132
- highestZ = 1049
133
- }
106
+ });
107
+ }
108
+ }
134
109
 
135
- var zIndex = highestZ + 2
136
- $this.css("z-index", zIndex)
137
- setTimeout(function () {
138
- $(".modal-backdrop")
139
- .not(".modal-stack")
140
- .css("z-index", zIndex - 1)
141
- .addClass("modal-stack")
142
- }, 0)
143
- })
144
-
145
- $(document).on("hidden.bs.modal", ".modal", function (this: any) {
146
- $(this).css("z-index", "")
147
- })
148
-
149
- //if (PortalUtils.treatAsMobileDevice()) {
150
- initializer.intializeModalListener()
151
- //}
152
-
153
- // window['HistoryHandlerExt'] = historyHandler;
154
- })
110
+ initializer.intializeModalListener();
155
111
  }
@@ -0,0 +1,17 @@
1
+ import { Fragment, VNode } from "vue";
2
+
3
+ export function slotUnwrapper(slots: VNode[]): VNode[] {
4
+ const extractNodes = (nodes: VNode | VNode[]): VNode[] => {
5
+ if (!nodes) {
6
+ return [];
7
+ }
8
+
9
+ if (Array.isArray(nodes)) {
10
+ return nodes.flatMap(node => (node.type === Fragment ? extractNodes(node.children as VNode[]) : node));
11
+ }
12
+
13
+ return [nodes];
14
+ };
15
+
16
+ return slots.flatMap(node => (node.type === Fragment ? extractNodes(node.children as VNode[]) : node));
17
+ }
@@ -1,27 +1,31 @@
1
- import imageCompression from "browser-image-compression";
1
+ import imageCompression, { Options } from "browser-image-compression";
2
+
3
+ interface BrowserImageFile extends File {
4
+ isCompressed?: boolean
5
+ }
2
6
 
3
7
  export class BrowserImageCompression {
4
- static async compress(file: File): Promise<File> {
5
- const options = {
6
- maxSizeMB: 0.5,
7
- useWebWorker: true,
8
- };
8
+ static async compress(file: BrowserImageFile, args?: Options): Promise<BrowserImageFile> {
9
+ if (file.isCompressed) {
10
+ return file;
11
+ }
9
12
 
10
- // console.log('Before:');
11
- // console.log('compressedFile instanceof Blob', file instanceof Blob);
12
- // console.log(`compressedFile size ${file.size / 1024 / 1024} MB`);
13
+ let options: Options = args || {};
14
+ options.useWebWorker = true;
13
15
 
14
- let compressedImage: File = null;
16
+ if (options.maxSizeMB == null) {
17
+ options.maxSizeMB = 0.5;
18
+ }
19
+
20
+ let compressedImage: BrowserImageFile = null;
15
21
 
16
22
  try {
17
23
  compressedImage = await imageCompression(file, options);
24
+ compressedImage.isCompressed = true;
25
+ return compressedImage;
18
26
  } catch (error) {
19
27
  console.log(error);
28
+ return file;
20
29
  }
21
-
22
- // console.log('After:');
23
- // console.log('compressedFile instanceof Blob', file instanceof Blob);
24
- // console.log(`compressedFile size ${file.size / 1024 / 1024} MB`);
25
- return compressedImage;
26
30
  }
27
31
  }
@@ -1,5 +1,4 @@
1
- export function formatString(str: string) {
2
- var args = arguments;
1
+ export function formatString(str: string, ...args: any[]): string {
3
2
  return str.replace(/\{\{|\}\}|\{(\d+)\}/g, function (m, n) {
4
3
  if (m == "{{") {
5
4
  return "{";
@@ -7,6 +6,8 @@ export function formatString(str: string) {
7
6
  if (m == "}}") {
8
7
  return "}";
9
8
  }
10
- return args[parseInt(n) + 1];
9
+
10
+ const index = parseInt(n);
11
+ return args[index] ?? '';
11
12
  });
12
- };
13
+ };
@@ -6,9 +6,11 @@ import { BrowserImageCompression } from "./broswer-image-compression";
6
6
  import StringUtils from "./string-utils";
7
7
 
8
8
  export class UploadImageHelper {
9
- static async postImage(file: File, attractionType: string): Promise<ImageResponse> {
10
- if (file.type != "image/svg+xml") {
11
- file = await BrowserImageCompression.compress(file);
9
+ static async postImage(file: File, attractionType: string, disableCompression: boolean = false, compressionMaxMb: number = 0.5): Promise<ImageResponse> {
10
+ if (!(disableCompression || file.type == "image/svg+xml")) {
11
+ file = await BrowserImageCompression.compress(file, {
12
+ maxSizeMB: compressionMaxMb
13
+ });
12
14
  }
13
15
 
14
16
  let formData: FormData = new FormData();
@@ -28,9 +28,10 @@ import PowerduckState from "../app/powerduck-state";
28
28
  import { IValidationSet, ValidationRuleset, ValidationState } from "./static-wrappers/interfaces/validation-interface";
29
29
 
30
30
  function getFirstUnsattisfiedValidatorName(valProp: Validation): string {
31
- for (var validatorName in valProp.$params) {
32
- if (valProp[validatorName] === false) {
33
- return validatorName;
31
+ const errors = valProp?.$errors || [];
32
+ for (var fieldError of errors) {
33
+ if (fieldError != null) {
34
+ return fieldError.$validator;
34
35
  }
35
36
  }
36
37
 
@@ -69,10 +70,6 @@ function getErrorMessage(valProp: Validation, invalidValidatorName: string): str
69
70
  errMsg = PowerduckState.getResourceValue('validationErrorGeneric');
70
71
  }
71
72
 
72
- if (valProp.$params.customErrMsg) {
73
- errMsg = valProp.$params.customErrMsg.errMsg;
74
- }
75
-
76
73
  return errMsg;
77
74
  }
78
75
 
@@ -256,12 +253,4 @@ export class ValidationBuilder {
256
253
  this._validationArgs[name] = validationFunc;
257
254
  return this;
258
255
  }
259
-
260
- withCustomErrorMessage(msg: string): ValidationBuilder {
261
- this._validationArgs["customErrMsg"] = helpers.withParams({ type: "customErrMsg", errMsg: msg }, function (value, parentVm) {
262
- return true;
263
- });
264
-
265
- return this;
266
- }
267
256
  }
@@ -140,7 +140,7 @@ class BootstrapToggle extends TsxComponent<BootstrapToggleArgs> implements Boots
140
140
  }
141
141
  }
142
142
 
143
- beforeDestroy() {
143
+ beforeUnmount() {
144
144
  $(this.getBootstrapToggleElement())["bootstrapToggle"]("destroy");
145
145
  $(this.getBootstrapToggleElement()).off("change");
146
146
  }
@@ -185,7 +185,7 @@ class BarChart extends TsxComponent<BarChartArgs> implements BarChartArgs {
185
185
  this.bindChart();
186
186
  }
187
187
 
188
- beforeDestroy() {
188
+ beforeUnmount() {
189
189
  this.destroyChart();
190
190
  }
191
191
 
@@ -206,4 +206,4 @@ class BarChart extends TsxComponent<BarChartArgs> implements BarChartArgs {
206
206
  }
207
207
  }
208
208
 
209
- export default toNative(BarChart);
209
+ export default toNative(BarChart);
@@ -37,7 +37,7 @@ class LineChartFlot extends TsxComponent<LineChartArgs> implements LineChartArgs
37
37
  window.addEventListener("resize", this.resizeFlot);
38
38
  }
39
39
 
40
- destroyed() {
40
+ unmounted() {
41
41
  window.removeEventListener("resize", this.resizeFlot);
42
42
  }
43
43
 
@@ -187,7 +187,7 @@ class LineChart extends TsxComponent<LineChartArgs> implements LineChartArgs {
187
187
  }
188
188
  }
189
189
 
190
- beforeDestroy() {
190
+ beforeUnmount() {
191
191
  this.destroyChart();
192
192
  }
193
193