@ibiz-template/runtime 0.1.13 → 0.1.15

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 (158) hide show
  1. package/dist/index.esm.js +606 -136
  2. package/dist/index.system.min.js +1 -1
  3. package/dist/index.system.min.js.map +1 -1
  4. package/out/controller/common/base.controller.d.ts.map +1 -1
  5. package/out/controller/common/base.controller.js +2 -0
  6. package/out/controller/common/editor/editor.controller.d.ts +1 -1
  7. package/out/controller/common/editor/editor.controller.d.ts.map +1 -1
  8. package/out/controller/common/editor/editor.controller.js +3 -1
  9. package/out/controller/control/caption-bar/caption-bar.controller.js +1 -1
  10. package/out/controller/control/form/form-detail/form-druipart/form-druipart.controller.d.ts.map +1 -1
  11. package/out/controller/control/form/form-detail/form-druipart/form-druipart.controller.js +4 -2
  12. package/out/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.d.ts +1 -1
  13. package/out/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.d.ts.map +1 -1
  14. package/out/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.js +16 -14
  15. package/out/controller/control/search-bar/search-bar.controller.d.ts.map +1 -1
  16. package/out/controller/control/search-bar/search-bar.controller.js +1 -0
  17. package/out/controller/control/tree/tree.controller.d.ts.map +1 -1
  18. package/out/controller/control/tree/tree.controller.js +0 -1
  19. package/out/controller/utils/event/controller-event.d.ts +7 -0
  20. package/out/controller/utils/event/controller-event.d.ts.map +1 -1
  21. package/out/controller/utils/event/controller-event.js +17 -0
  22. package/out/controller/utils/index.d.ts +1 -0
  23. package/out/controller/utils/index.d.ts.map +1 -1
  24. package/out/controller/utils/index.js +1 -0
  25. package/out/controller/utils/value-ex/value-ex.d.ts +47 -0
  26. package/out/controller/utils/value-ex/value-ex.d.ts.map +1 -0
  27. package/out/controller/utils/value-ex/value-ex.js +48 -0
  28. package/out/engine/md-view.engine.d.ts.map +1 -1
  29. package/out/engine/md-view.engine.js +16 -5
  30. package/out/interface/common/i-modal/i-modal.d.ts +8 -0
  31. package/out/interface/common/i-modal/i-modal.d.ts.map +1 -1
  32. package/out/interface/controller/state/common/i-controller.state.d.ts +8 -0
  33. package/out/interface/controller/state/common/i-controller.state.d.ts.map +1 -1
  34. package/out/interface/controller/state/control/i-search-bar.state.d.ts +8 -0
  35. package/out/interface/controller/state/control/i-search-bar.state.d.ts.map +1 -1
  36. package/out/service/dto/method.dto.d.ts.map +1 -1
  37. package/out/service/dto/method.dto.js +3 -1
  38. package/out/service/service/entity/method/method.d.ts.map +1 -1
  39. package/out/service/service/entity/method/method.js +5 -4
  40. package/out/ui-action/provider/backend-ui-action-provider.d.ts.map +1 -1
  41. package/out/ui-action/provider/backend-ui-action-provider.js +6 -3
  42. package/out/ui-action/uiaction-util.d.ts.map +1 -1
  43. package/out/ui-action/uiaction-util.js +1 -0
  44. package/out/utils/handlebars/handlebars.d.ts +11 -2
  45. package/out/utils/handlebars/handlebars.d.ts.map +1 -1
  46. package/out/utils/handlebars/handlebars.js +24 -2
  47. package/out/utils/handlebars/helpers/and/and.d.ts +16 -0
  48. package/out/utils/handlebars/helpers/and/and.d.ts.map +1 -0
  49. package/out/utils/handlebars/helpers/and/and.js +24 -0
  50. package/out/utils/handlebars/helpers/camel-case/camel-case.d.ts +16 -0
  51. package/out/utils/handlebars/helpers/camel-case/camel-case.d.ts.map +1 -0
  52. package/out/utils/handlebars/helpers/camel-case/camel-case.js +23 -0
  53. package/out/utils/handlebars/helpers/concat/concat.d.ts +16 -0
  54. package/out/utils/handlebars/helpers/concat/concat.d.ts.map +1 -0
  55. package/out/utils/handlebars/helpers/concat/concat.js +20 -0
  56. package/out/utils/handlebars/helpers/eq/eq.d.ts +16 -0
  57. package/out/utils/handlebars/helpers/eq/eq.d.ts.map +1 -0
  58. package/out/utils/handlebars/helpers/eq/eq.js +22 -0
  59. package/out/utils/handlebars/helpers/eq-property-value/eq-property-value.d.ts +15 -0
  60. package/out/utils/handlebars/helpers/eq-property-value/eq-property-value.d.ts.map +1 -0
  61. package/out/utils/handlebars/helpers/eq-property-value/eq-property-value.js +32 -0
  62. package/out/utils/handlebars/helpers/gt/gt.d.ts +16 -0
  63. package/out/utils/handlebars/helpers/gt/gt.d.ts.map +1 -0
  64. package/out/utils/handlebars/helpers/gt/gt.js +22 -0
  65. package/out/utils/handlebars/helpers/gte/gte.d.ts +16 -0
  66. package/out/utils/handlebars/helpers/gte/gte.d.ts.map +1 -0
  67. package/out/utils/handlebars/helpers/gte/gte.js +22 -0
  68. package/out/utils/handlebars/helpers/helper-base.d.ts +29 -0
  69. package/out/utils/handlebars/helpers/helper-base.d.ts.map +1 -0
  70. package/out/utils/handlebars/helpers/helper-base.js +20 -0
  71. package/out/utils/handlebars/helpers/index.d.ts +9 -0
  72. package/out/utils/handlebars/helpers/index.d.ts.map +1 -0
  73. package/out/utils/handlebars/helpers/index.js +45 -0
  74. package/out/utils/handlebars/helpers/json/json.d.ts +16 -0
  75. package/out/utils/handlebars/helpers/json/json.d.ts.map +1 -0
  76. package/out/utils/handlebars/helpers/json/json.js +19 -0
  77. package/out/utils/handlebars/helpers/lower-case/lower-case.d.ts +16 -0
  78. package/out/utils/handlebars/helpers/lower-case/lower-case.d.ts.map +1 -0
  79. package/out/utils/handlebars/helpers/lower-case/lower-case.js +22 -0
  80. package/out/utils/handlebars/helpers/lt/lt.d.ts +16 -0
  81. package/out/utils/handlebars/helpers/lt/lt.d.ts.map +1 -0
  82. package/out/utils/handlebars/helpers/lt/lt.js +22 -0
  83. package/out/utils/handlebars/helpers/lte/lte.d.ts +16 -0
  84. package/out/utils/handlebars/helpers/lte/lte.d.ts.map +1 -0
  85. package/out/utils/handlebars/helpers/lte/lte.js +22 -0
  86. package/out/utils/handlebars/helpers/neq/neq.d.ts +16 -0
  87. package/out/utils/handlebars/helpers/neq/neq.d.ts.map +1 -0
  88. package/out/utils/handlebars/helpers/neq/neq.js +22 -0
  89. package/out/utils/handlebars/helpers/not/not.d.ts +16 -0
  90. package/out/utils/handlebars/helpers/not/not.d.ts.map +1 -0
  91. package/out/utils/handlebars/helpers/not/not.js +21 -0
  92. package/out/utils/handlebars/helpers/or/or.d.ts +16 -0
  93. package/out/utils/handlebars/helpers/or/or.d.ts.map +1 -0
  94. package/out/utils/handlebars/helpers/or/or.js +27 -0
  95. package/out/utils/handlebars/helpers/pascal-case/pascal-case.d.ts +16 -0
  96. package/out/utils/handlebars/helpers/pascal-case/pascal-case.d.ts.map +1 -0
  97. package/out/utils/handlebars/helpers/pascal-case/pascal-case.js +23 -0
  98. package/out/utils/handlebars/helpers/snake-case/snake-case.d.ts +16 -0
  99. package/out/utils/handlebars/helpers/snake-case/snake-case.d.ts.map +1 -0
  100. package/out/utils/handlebars/helpers/snake-case/snake-case.js +23 -0
  101. package/out/utils/handlebars/helpers/spinal-case/spinal-case.d.ts +16 -0
  102. package/out/utils/handlebars/helpers/spinal-case/spinal-case.d.ts.map +1 -0
  103. package/out/utils/handlebars/helpers/spinal-case/spinal-case.js +23 -0
  104. package/out/utils/handlebars/helpers/upper-case/upper-case.d.ts +16 -0
  105. package/out/utils/handlebars/helpers/upper-case/upper-case.d.ts.map +1 -0
  106. package/out/utils/handlebars/helpers/upper-case/upper-case.js +22 -0
  107. package/out/utils/handlebars/utils/helper/helper.d.ts +42 -0
  108. package/out/utils/handlebars/utils/helper/helper.d.ts.map +1 -0
  109. package/out/utils/handlebars/utils/helper/helper.js +69 -0
  110. package/out/utils/handlebars/utils/index.d.ts +2 -0
  111. package/out/utils/handlebars/utils/index.d.ts.map +1 -0
  112. package/out/utils/handlebars/utils/index.js +1 -0
  113. package/out/utils/modal/modal.d.ts +1 -0
  114. package/out/utils/modal/modal.d.ts.map +1 -1
  115. package/out/utils/modal/modal.js +5 -2
  116. package/package.json +3 -3
  117. package/src/controller/common/base.controller.ts +2 -0
  118. package/src/controller/common/editor/editor.controller.ts +5 -2
  119. package/src/controller/control/caption-bar/caption-bar.controller.ts +1 -1
  120. package/src/controller/control/form/form-detail/form-druipart/form-druipart.controller.ts +4 -2
  121. package/src/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.ts +17 -14
  122. package/src/controller/control/search-bar/search-bar.controller.ts +1 -0
  123. package/src/controller/control/tree/tree.controller.ts +0 -1
  124. package/src/controller/utils/event/controller-event.ts +18 -0
  125. package/src/controller/utils/index.ts +1 -0
  126. package/src/controller/utils/value-ex/value-ex.ts +83 -0
  127. package/src/engine/md-view.engine.ts +17 -5
  128. package/src/interface/common/i-modal/i-modal.ts +9 -0
  129. package/src/interface/controller/state/common/i-controller.state.ts +9 -0
  130. package/src/interface/controller/state/control/i-search-bar.state.ts +9 -0
  131. package/src/service/dto/method.dto.ts +3 -1
  132. package/src/service/service/entity/method/method.ts +11 -4
  133. package/src/ui-action/provider/backend-ui-action-provider.ts +6 -3
  134. package/src/ui-action/uiaction-util.ts +1 -0
  135. package/src/utils/handlebars/handlebars.ts +25 -3
  136. package/src/utils/handlebars/helpers/and/and.ts +26 -0
  137. package/src/utils/handlebars/helpers/camel-case/camel-case.ts +25 -0
  138. package/src/utils/handlebars/helpers/concat/concat.ts +22 -0
  139. package/src/utils/handlebars/helpers/eq/eq.ts +28 -0
  140. package/src/utils/handlebars/helpers/eq-property-value/eq-property-value.ts +41 -0
  141. package/src/utils/handlebars/helpers/gt/gt.ts +28 -0
  142. package/src/utils/handlebars/helpers/gte/gte.ts +28 -0
  143. package/src/utils/handlebars/helpers/helper-base.ts +31 -0
  144. package/src/utils/handlebars/helpers/index.ts +46 -0
  145. package/src/utils/handlebars/helpers/json/json.ts +25 -0
  146. package/src/utils/handlebars/helpers/lower-case/lower-case.ts +24 -0
  147. package/src/utils/handlebars/helpers/lt/lt.ts +28 -0
  148. package/src/utils/handlebars/helpers/lte/lte.ts +28 -0
  149. package/src/utils/handlebars/helpers/neq/neq.ts +28 -0
  150. package/src/utils/handlebars/helpers/not/not.ts +26 -0
  151. package/src/utils/handlebars/helpers/or/or.ts +28 -0
  152. package/src/utils/handlebars/helpers/pascal-case/pascal-case.ts +25 -0
  153. package/src/utils/handlebars/helpers/snake-case/snake-case.ts +25 -0
  154. package/src/utils/handlebars/helpers/spinal-case/spinal-case.ts +25 -0
  155. package/src/utils/handlebars/helpers/upper-case/upper-case.ts +24 -0
  156. package/src/utils/handlebars/utils/helper/helper.ts +75 -0
  157. package/src/utils/handlebars/utils/index.ts +1 -0
  158. package/src/utils/modal/modal.ts +6 -2
@@ -41,6 +41,7 @@ export class UIActionUtil {
41
41
  var _a, _b;
42
42
  const result = await this.exec(actionId, params);
43
43
  if (result.closeView) {
44
+ params.view.modal.ignoreDismissCheck = true;
44
45
  params.view.closeView({ ok: true });
45
46
  }
46
47
  else if (result.refresh) {
@@ -8,6 +8,15 @@
8
8
  */
9
9
  export declare class HandlebarsUtil {
10
10
  protected hsb: any;
11
+ /**
12
+ * 如果已经在请求中,则不再重复请求
13
+ *
14
+ * @author chitanda
15
+ * @date 2023-08-30 11:08:58
16
+ * @protected
17
+ * @type {(Promise<unknown> | null)}
18
+ */
19
+ protected p: Promise<unknown> | null;
11
20
  /**
12
21
  * handlebars 是否已经初始化
13
22
  *
@@ -22,9 +31,9 @@ export declare class HandlebarsUtil {
22
31
  *
23
32
  * @author chitanda
24
33
  * @date 2023-08-28 17:08:24
25
- * @return {*} {Promise<void>}
34
+ * @return {*} {Promise<unknown>}
26
35
  */
27
- init(): Promise<void>;
36
+ init(): Promise<unknown>;
28
37
  /**
29
38
  * 异步绘制模板,返回渲染后的字符串
30
39
  *
@@ -1 +1 @@
1
- {"version":3,"file":"handlebars.d.ts","sourceRoot":"","sources":["../../../src/utils/handlebars/handlebars.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qBAAa,cAAc;IAEzB,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC;IAEnB;;;;;;;OAOG;IACH,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED;;;;;;OAMG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B;;;;;;;;OAQG;IACG,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC;IAQ5D;;;;;;;;;OASG;IACH,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,MAAM;CAOlD"}
1
+ {"version":3,"file":"handlebars.d.ts","sourceRoot":"","sources":["../../../src/utils/handlebars/handlebars.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,qBAAa,cAAc;IAEzB,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC;IAEnB;;;;;;;OAOG;IACH,SAAS,CAAC,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAAQ;IAE5C;;;;;;;OAOG;IACH,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED;;;;;;OAMG;IACG,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC;IAc9B;;;;;;;;OAQG;IACG,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC;IAQ5D;;;;;;;;;OASG;IACH,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,MAAM;CAOlD"}
@@ -1,3 +1,4 @@
1
+ import { installHelpers } from './helpers';
1
2
  /**
2
3
  * handlebars 渲染工具类
3
4
  *
@@ -7,6 +8,17 @@
7
8
  * @class HandlebarsUtil
8
9
  */
9
10
  export class HandlebarsUtil {
11
+ constructor() {
12
+ /**
13
+ * 如果已经在请求中,则不再重复请求
14
+ *
15
+ * @author chitanda
16
+ * @date 2023-08-30 11:08:58
17
+ * @protected
18
+ * @type {(Promise<unknown> | null)}
19
+ */
20
+ this.p = null;
21
+ }
10
22
  /**
11
23
  * handlebars 是否已经初始化
12
24
  *
@@ -23,10 +35,20 @@ export class HandlebarsUtil {
23
35
  *
24
36
  * @author chitanda
25
37
  * @date 2023-08-28 17:08:24
26
- * @return {*} {Promise<void>}
38
+ * @return {*} {Promise<unknown>}
27
39
  */
28
40
  async init() {
29
- this.hsb = await import('handlebars');
41
+ if (this.isInit) {
42
+ return;
43
+ }
44
+ if (this.p) {
45
+ return this.p;
46
+ }
47
+ this.p = import('handlebars');
48
+ this.hsb = await this.p;
49
+ this.p = null;
50
+ installHelpers(this.hsb);
51
+ return this.hsb;
30
52
  }
31
53
  /**
32
54
  * 异步绘制模板,返回渲染后的字符串
@@ -0,0 +1,16 @@
1
+ import { HelperBase } from '../helper-base';
2
+ /**
3
+ * 并且条件模式
4
+ *
5
+ * @description 判断: word wor2 word3 必须在判断中必须全部为 true, 用法: {{#and word word2 word3}}xxx{{else}}yyy{{/and}}、{{and word word2 word3}} 返回值为 boolean 类型
6
+ * @author chitanda
7
+ * @date 2021-12-29 14:12:10
8
+ * @export
9
+ * @class HelperAnd
10
+ * @extends {HelperBase}
11
+ */
12
+ export declare class HelperAnd extends HelperBase {
13
+ constructor(hbs: IData);
14
+ onExecute(...args: unknown[] | Handlebars.HelperOptions[]): string | boolean;
15
+ }
16
+ //# sourceMappingURL=and.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"and.d.ts","sourceRoot":"","sources":["../../../../../src/utils/handlebars/helpers/and/and.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;;;;;;;;GASG;AACH,qBAAa,SAAU,SAAQ,UAAU;gBAC3B,GAAG,EAAE,KAAK;IAItB,SAAS,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,aAAa,EAAE,GAAG,MAAM,GAAG,OAAO;CAO7E"}
@@ -0,0 +1,24 @@
1
+ import { HelperUtil } from '../../utils';
2
+ import { HelperBase } from '../helper-base';
3
+ /**
4
+ * 并且条件模式
5
+ *
6
+ * @description 判断: word wor2 word3 必须在判断中必须全部为 true, 用法: {{#and word word2 word3}}xxx{{else}}yyy{{/and}}、{{and word word2 word3}} 返回值为 boolean 类型
7
+ * @author chitanda
8
+ * @date 2021-12-29 14:12:10
9
+ * @export
10
+ * @class HelperAnd
11
+ * @extends {HelperBase}
12
+ */
13
+ export class HelperAnd extends HelperBase {
14
+ constructor(hbs) {
15
+ super(hbs, 'and');
16
+ }
17
+ onExecute(...args) {
18
+ const options = args[args.length - 1];
19
+ args.pop();
20
+ const arr = args.filter(item => !!item);
21
+ const bol = arr.length === args.length;
22
+ return HelperUtil.handleJudgmentExecute(this, bol, options);
23
+ }
24
+ }
@@ -0,0 +1,16 @@
1
+ import { HelperBase } from '../helper-base';
2
+ /**
3
+ * 转驼峰
4
+ *
5
+ * @description 用法 {{camelCase xxx}},效果: this-is-my-name => thisIsMyName
6
+ * @author chitanda
7
+ * @date 2021-12-24 15:12:59
8
+ * @export
9
+ * @class HelperCamelCase
10
+ * @extends {HelperBase}
11
+ */
12
+ export declare class HelperCamelCase extends HelperBase {
13
+ constructor(hbs: IData);
14
+ onExecute(param: string): string;
15
+ }
16
+ //# sourceMappingURL=camel-case.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"camel-case.d.ts","sourceRoot":"","sources":["../../../../../src/utils/handlebars/helpers/camel-case/camel-case.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;;;;;;;;GASG;AACH,qBAAa,eAAgB,SAAQ,UAAU;gBACjC,GAAG,EAAE,KAAK;IAItB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;CAMjC"}
@@ -0,0 +1,23 @@
1
+ import { camelCase } from 'lodash-es';
2
+ import { HelperBase } from '../helper-base';
3
+ /**
4
+ * 转驼峰
5
+ *
6
+ * @description 用法 {{camelCase xxx}},效果: this-is-my-name => thisIsMyName
7
+ * @author chitanda
8
+ * @date 2021-12-24 15:12:59
9
+ * @export
10
+ * @class HelperCamelCase
11
+ * @extends {HelperBase}
12
+ */
13
+ export class HelperCamelCase extends HelperBase {
14
+ constructor(hbs) {
15
+ super(hbs, 'camelCase');
16
+ }
17
+ onExecute(param) {
18
+ if (!param) {
19
+ return '';
20
+ }
21
+ return camelCase(param);
22
+ }
23
+ }
@@ -0,0 +1,16 @@
1
+ import { HelperBase } from '../helper-base';
2
+ /**
3
+ * 字符串拼接
4
+ *
5
+ * @description 用法:{{concat string1 string2 string3}} 返回值为 string 类型
6
+ * @author mosher
7
+ * @date 2022-10-12 10:59:10
8
+ * @export
9
+ * @class HelperConcat
10
+ * @extends {HelperBase}
11
+ */
12
+ export declare class HelperConcat extends HelperBase {
13
+ constructor(hbs: IData);
14
+ onExecute(...args: string[]): string;
15
+ }
16
+ //# sourceMappingURL=concat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"concat.d.ts","sourceRoot":"","sources":["../../../../../src/utils/handlebars/helpers/concat/concat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;;;;;;;;GASG;AACH,qBAAa,YAAa,SAAQ,UAAU;gBAC9B,GAAG,EAAE,KAAK;IAItB,SAAS,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM;CAIrC"}
@@ -0,0 +1,20 @@
1
+ import { HelperBase } from '../helper-base';
2
+ /**
3
+ * 字符串拼接
4
+ *
5
+ * @description 用法:{{concat string1 string2 string3}} 返回值为 string 类型
6
+ * @author mosher
7
+ * @date 2022-10-12 10:59:10
8
+ * @export
9
+ * @class HelperConcat
10
+ * @extends {HelperBase}
11
+ */
12
+ export class HelperConcat extends HelperBase {
13
+ constructor(hbs) {
14
+ super(hbs, 'concat');
15
+ }
16
+ onExecute(...args) {
17
+ args.pop();
18
+ return args.join('');
19
+ }
20
+ }
@@ -0,0 +1,16 @@
1
+ import { HelperBase } from '../helper-base';
2
+ /**
3
+ * 等于
4
+ *
5
+ * @description 判断: word === word2, 用法: {{#eq word word2}}xxx{{else}}yyy{{/eq}}、{{eq word 'xxx'}} 返回值为 boolean 类型
6
+ * @author chitanda
7
+ * @date 2021-12-24 14:12:25
8
+ * @export
9
+ * @class HelperEq
10
+ * @extends {HelperBase}
11
+ */
12
+ export declare class HelperEq extends HelperBase {
13
+ constructor(hbs: IData);
14
+ onExecute(param: unknown, param2: unknown, options: Handlebars.HelperOptions): string | boolean;
15
+ }
16
+ //# sourceMappingURL=eq.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eq.d.ts","sourceRoot":"","sources":["../../../../../src/utils/handlebars/helpers/eq/eq.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;;;;;;;;GASG;AACH,qBAAa,QAAS,SAAQ,UAAU;gBAC1B,GAAG,EAAE,KAAK;IAItB,SAAS,CACP,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,UAAU,CAAC,aAAa,GAChC,MAAM,GAAG,OAAO;CAIpB"}
@@ -0,0 +1,22 @@
1
+ import { eq } from 'lodash-es';
2
+ import { HelperUtil } from '../../utils';
3
+ import { HelperBase } from '../helper-base';
4
+ /**
5
+ * 等于
6
+ *
7
+ * @description 判断: word === word2, 用法: {{#eq word word2}}xxx{{else}}yyy{{/eq}}、{{eq word 'xxx'}} 返回值为 boolean 类型
8
+ * @author chitanda
9
+ * @date 2021-12-24 14:12:25
10
+ * @export
11
+ * @class HelperEq
12
+ * @extends {HelperBase}
13
+ */
14
+ export class HelperEq extends HelperBase {
15
+ constructor(hbs) {
16
+ super(hbs, 'eq');
17
+ }
18
+ onExecute(param, param2, options) {
19
+ const bol = eq(param, param2);
20
+ return HelperUtil.handleJudgmentExecute(this, bol, options);
21
+ }
22
+ }
@@ -0,0 +1,15 @@
1
+ import { HelperBase } from '../helper-base';
2
+ /**
3
+ * 比较数组或对象是否存在某个属性的值
4
+ *
5
+ * @author zk
6
+ * @date 2023-06-15 09:06:37
7
+ * @export
8
+ * @class HelperHaCtrl
9
+ * @extends {HelperBase}
10
+ */
11
+ export declare class HelperEqPropertyValue extends HelperBase {
12
+ constructor(hbs: IData);
13
+ onExecute(obj: unknown[] | unknown, key: string, val: unknown, options: Handlebars.HelperOptions): string | boolean;
14
+ }
15
+ //# sourceMappingURL=eq-property-value.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eq-property-value.d.ts","sourceRoot":"","sources":["../../../../../src/utils/handlebars/helpers/eq-property-value/eq-property-value.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;;;;;;;GAQG;AACH,qBAAa,qBAAsB,SAAQ,UAAU;gBACvC,GAAG,EAAE,KAAK;IAItB,SAAS,CACP,GAAG,EAAE,OAAO,EAAE,GAAG,OAAO,EACxB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,OAAO,EACZ,OAAO,EAAE,UAAU,CAAC,aAAa,GAChC,MAAM,GAAG,OAAO;CAgBpB"}
@@ -0,0 +1,32 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import { eq, findIndex, isArray } from 'lodash-es';
3
+ import { HelperUtil } from '../../utils';
4
+ import { HelperBase } from '../helper-base';
5
+ /**
6
+ * 比较数组或对象是否存在某个属性的值
7
+ *
8
+ * @author zk
9
+ * @date 2023-06-15 09:06:37
10
+ * @export
11
+ * @class HelperHaCtrl
12
+ * @extends {HelperBase}
13
+ */
14
+ export class HelperEqPropertyValue extends HelperBase {
15
+ constructor(hbs) {
16
+ super(hbs, 'eqPropertyValue');
17
+ }
18
+ onExecute(obj, key, val, options) {
19
+ // 数组
20
+ let bol = false;
21
+ if (isArray(obj)) {
22
+ bol = !eq(findIndex(obj, o => eq(o[key], val)), -1);
23
+ }
24
+ else {
25
+ bol =
26
+ // eslint-disable-next-line no-prototype-builtins
27
+ obj.hasOwnProperty(key) &&
28
+ (bol = eq(obj[key], val));
29
+ }
30
+ return HelperUtil.handleJudgmentExecute(this, bol, options);
31
+ }
32
+ }
@@ -0,0 +1,16 @@
1
+ import { HelperBase } from '../helper-base';
2
+ /**
3
+ * 大于
4
+ *
5
+ * @description 判断: word > word2, 用法: {{#gt word word2}}xxx{{else}}yyy{{/gt}}、{{gt word word2}} 返回值为 boolean 类型
6
+ * @author chitanda
7
+ * @date 2021-12-24 15:12:56
8
+ * @export
9
+ * @class HelperGt
10
+ * @extends {HelperBase}
11
+ */
12
+ export declare class HelperGt extends HelperBase {
13
+ constructor(hbs: IData);
14
+ onExecute(param: unknown, param2: unknown, options: Handlebars.HelperOptions): string | boolean;
15
+ }
16
+ //# sourceMappingURL=gt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gt.d.ts","sourceRoot":"","sources":["../../../../../src/utils/handlebars/helpers/gt/gt.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;;;;;;;;GASG;AACH,qBAAa,QAAS,SAAQ,UAAU;gBAC1B,GAAG,EAAE,KAAK;IAItB,SAAS,CACP,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,UAAU,CAAC,aAAa,GAChC,MAAM,GAAG,OAAO;CAIpB"}
@@ -0,0 +1,22 @@
1
+ import { gt } from 'lodash-es';
2
+ import { HelperUtil } from '../../utils';
3
+ import { HelperBase } from '../helper-base';
4
+ /**
5
+ * 大于
6
+ *
7
+ * @description 判断: word > word2, 用法: {{#gt word word2}}xxx{{else}}yyy{{/gt}}、{{gt word word2}} 返回值为 boolean 类型
8
+ * @author chitanda
9
+ * @date 2021-12-24 15:12:56
10
+ * @export
11
+ * @class HelperGt
12
+ * @extends {HelperBase}
13
+ */
14
+ export class HelperGt extends HelperBase {
15
+ constructor(hbs) {
16
+ super(hbs, 'gt');
17
+ }
18
+ onExecute(param, param2, options) {
19
+ const bol = gt(param, param2);
20
+ return HelperUtil.handleJudgmentExecute(this, bol, options);
21
+ }
22
+ }
@@ -0,0 +1,16 @@
1
+ import { HelperBase } from '../helper-base';
2
+ /**
3
+ * 大于等于
4
+ *
5
+ * @description 判断: word >= word2, 用法 {{#gte word word2}}xxx{{else}}yyy{{/gte}}、{{gte word word2}} 返回值为 boolean 类型
6
+ * @author chitanda
7
+ * @date 2021-12-24 15:12:35
8
+ * @export
9
+ * @class HelperGte
10
+ * @extends {HelperBase}
11
+ */
12
+ export declare class HelperGte extends HelperBase {
13
+ constructor(hbs: IData);
14
+ onExecute(param: unknown, param2: unknown, options: Handlebars.HelperOptions): string | boolean;
15
+ }
16
+ //# sourceMappingURL=gte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gte.d.ts","sourceRoot":"","sources":["../../../../../src/utils/handlebars/helpers/gte/gte.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;;;;;;;;GASG;AACH,qBAAa,SAAU,SAAQ,UAAU;gBAC3B,GAAG,EAAE,KAAK;IAItB,SAAS,CACP,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,UAAU,CAAC,aAAa,GAChC,MAAM,GAAG,OAAO;CAIpB"}
@@ -0,0 +1,22 @@
1
+ import { gte } from 'lodash-es';
2
+ import { HelperUtil } from '../../utils';
3
+ import { HelperBase } from '../helper-base';
4
+ /**
5
+ * 大于等于
6
+ *
7
+ * @description 判断: word >= word2, 用法 {{#gte word word2}}xxx{{else}}yyy{{/gte}}、{{gte word word2}} 返回值为 boolean 类型
8
+ * @author chitanda
9
+ * @date 2021-12-24 15:12:35
10
+ * @export
11
+ * @class HelperGte
12
+ * @extends {HelperBase}
13
+ */
14
+ export class HelperGte extends HelperBase {
15
+ constructor(hbs) {
16
+ super(hbs, 'gte');
17
+ }
18
+ onExecute(param, param2, options) {
19
+ const bol = gte(param, param2);
20
+ return HelperUtil.handleJudgmentExecute(this, bol, options);
21
+ }
22
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * helper 基类
3
+ *
4
+ * @author chitanda
5
+ * @date 2021-12-29 14:12:34
6
+ * @export
7
+ * @class HelperBase
8
+ */
9
+ export declare abstract class HelperBase {
10
+ /**
11
+ * Creates an instance of HelperBase.
12
+ *
13
+ * @author chitanda
14
+ * @date 2021-12-29 14:12:47
15
+ * @param {string} tag 助手标识
16
+ */
17
+ constructor(Handlebars: IData, tag: string);
18
+ /**
19
+ * 助手执行
20
+ *
21
+ * @author chitanda
22
+ * @date 2022-08-05 18:08:03
23
+ * @abstract
24
+ * @param {...unknown[]} args
25
+ * @return {*} {(string | boolean)}
26
+ */
27
+ abstract onExecute(...args: unknown[]): string | boolean;
28
+ }
29
+ //# sourceMappingURL=helper-base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helper-base.d.ts","sourceRoot":"","sources":["../../../../src/utils/handlebars/helpers/helper-base.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,8BAAsB,UAAU;IAC9B;;;;;;OAMG;gBACS,UAAU,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM;IAI1C;;;;;;;;OAQG;IACH,QAAQ,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,GAAG,OAAO;CACzD"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * helper 基类
3
+ *
4
+ * @author chitanda
5
+ * @date 2021-12-29 14:12:34
6
+ * @export
7
+ * @class HelperBase
8
+ */
9
+ export class HelperBase {
10
+ /**
11
+ * Creates an instance of HelperBase.
12
+ *
13
+ * @author chitanda
14
+ * @date 2021-12-29 14:12:47
15
+ * @param {string} tag 助手标识
16
+ */
17
+ constructor(Handlebars, tag) {
18
+ Handlebars.registerHelper(tag, this.onExecute);
19
+ }
20
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * 安装自定义助手
3
+ *
4
+ * @author chitanda
5
+ * @date 2021-12-24 14:12:05
6
+ * @export
7
+ */
8
+ export declare function installHelpers(hsb: IData): void;
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/handlebars/helpers/index.ts"],"names":[],"mappings":"AAmBA;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,CAmB/C"}
@@ -0,0 +1,45 @@
1
+ import { HelperAnd } from './and/and';
2
+ import { HelperCamelCase } from './camel-case/camel-case';
3
+ import { HelperConcat } from './concat/concat';
4
+ import { HelperEq } from './eq/eq';
5
+ import { HelperGt } from './gt/gt';
6
+ import { HelperGte } from './gte/gte';
7
+ import { HelperEqPropertyValue } from './eq-property-value/eq-property-value';
8
+ import { HelperJson } from './json/json';
9
+ import { HelperLowerCase } from './lower-case/lower-case';
10
+ import { HelperLt } from './lt/lt';
11
+ import { HelperLte } from './lte/lte';
12
+ import { HelperNeq } from './neq/neq';
13
+ import { HelperNot } from './not/not';
14
+ import { HelperOr } from './or/or';
15
+ import { HelperPascalCase } from './pascal-case/pascal-case';
16
+ import { HelperSnakeCase } from './snake-case/snake-case';
17
+ import { HelperSpinalCase } from './spinal-case/spinal-case';
18
+ import { HelperUpperCase } from './upper-case/upper-case';
19
+ /**
20
+ * 安装自定义助手
21
+ *
22
+ * @author chitanda
23
+ * @date 2021-12-24 14:12:05
24
+ * @export
25
+ */
26
+ export function installHelpers(hsb) {
27
+ new HelperAnd(hsb);
28
+ new HelperCamelCase(hsb);
29
+ new HelperConcat(hsb);
30
+ new HelperEq(hsb);
31
+ new HelperGt(hsb);
32
+ new HelperGte(hsb);
33
+ new HelperJson(hsb);
34
+ new HelperLowerCase(hsb);
35
+ new HelperLt(hsb);
36
+ new HelperLte(hsb);
37
+ new HelperNeq(hsb);
38
+ new HelperNot(hsb);
39
+ new HelperOr(hsb);
40
+ new HelperPascalCase(hsb);
41
+ new HelperSnakeCase(hsb);
42
+ new HelperSpinalCase(hsb);
43
+ new HelperUpperCase(hsb);
44
+ new HelperEqPropertyValue(hsb);
45
+ }
@@ -0,0 +1,16 @@
1
+ import { HelperBase } from '../helper-base';
2
+ /**
3
+ * json 转 string
4
+ *
5
+ * @description 用法 {{json xxx 2}},支持第二个参数传递格式化。效果: 将 json 对象转为 json 字符串
6
+ * @author chitanda
7
+ * @date 2021-12-24 15:12:59
8
+ * @export
9
+ * @class HelperJson
10
+ * @extends {HelperBase}
11
+ */
12
+ export declare class HelperJson extends HelperBase {
13
+ constructor(hbs: IData);
14
+ onExecute(obj: Record<string, unknown> | unknown[], space: number): string;
15
+ }
16
+ //# sourceMappingURL=json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../../../src/utils/handlebars/helpers/json/json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;;;;;;;;GASG;AACH,qBAAa,UAAW,SAAQ,UAAU;gBAC5B,GAAG,EAAE,KAAK;IAItB,SAAS,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;CAO3E"}
@@ -0,0 +1,19 @@
1
+ import { HelperBase } from '../helper-base';
2
+ /**
3
+ * json 转 string
4
+ *
5
+ * @description 用法 {{json xxx 2}},支持第二个参数传递格式化。效果: 将 json 对象转为 json 字符串
6
+ * @author chitanda
7
+ * @date 2021-12-24 15:12:59
8
+ * @export
9
+ * @class HelperJson
10
+ * @extends {HelperBase}
11
+ */
12
+ export class HelperJson extends HelperBase {
13
+ constructor(hbs) {
14
+ super(hbs, 'jsonStringify');
15
+ }
16
+ onExecute(obj, space) {
17
+ return JSON.stringify(obj, null, typeof space === 'number' ? space : undefined);
18
+ }
19
+ }
@@ -0,0 +1,16 @@
1
+ import { HelperBase } from '../helper-base';
2
+ /**
3
+ * 字符串转换小写
4
+ *
5
+ * @description 用法 {{lowerCase word}}, 效果: MyName => myname
6
+ * @author chitanda
7
+ * @date 2021-12-24 15:12:35
8
+ * @export
9
+ * @class HelperLowerCase
10
+ * @extends {HelperBase}
11
+ */
12
+ export declare class HelperLowerCase extends HelperBase {
13
+ constructor(hbs: IData);
14
+ onExecute(param: string): string;
15
+ }
16
+ //# sourceMappingURL=lower-case.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lower-case.d.ts","sourceRoot":"","sources":["../../../../../src/utils/handlebars/helpers/lower-case/lower-case.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;;;;;;;;GASG;AACH,qBAAa,eAAgB,SAAQ,UAAU;gBACjC,GAAG,EAAE,KAAK;IAItB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;CAMjC"}
@@ -0,0 +1,22 @@
1
+ import { HelperBase } from '../helper-base';
2
+ /**
3
+ * 字符串转换小写
4
+ *
5
+ * @description 用法 {{lowerCase word}}, 效果: MyName => myname
6
+ * @author chitanda
7
+ * @date 2021-12-24 15:12:35
8
+ * @export
9
+ * @class HelperLowerCase
10
+ * @extends {HelperBase}
11
+ */
12
+ export class HelperLowerCase extends HelperBase {
13
+ constructor(hbs) {
14
+ super(hbs, 'lowerCase');
15
+ }
16
+ onExecute(param) {
17
+ if (!param) {
18
+ return '';
19
+ }
20
+ return param.toLowerCase();
21
+ }
22
+ }
@@ -0,0 +1,16 @@
1
+ import { HelperBase } from '../helper-base';
2
+ /**
3
+ * 小于
4
+ *
5
+ * @description 判断: word < word2, 用法 {{#lt word word2}}xxx{{else}}yyy{{/lt}}、{{lt word word2}} 返回值为 boolean 类型
6
+ * @author chitanda
7
+ * @date 2021-12-24 15:12:53
8
+ * @export
9
+ * @class HelperLt
10
+ * @extends {HelperBase}
11
+ */
12
+ export declare class HelperLt extends HelperBase {
13
+ constructor(hbs: IData);
14
+ onExecute(param: unknown, param2: unknown, options: Handlebars.HelperOptions): string | boolean;
15
+ }
16
+ //# sourceMappingURL=lt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lt.d.ts","sourceRoot":"","sources":["../../../../../src/utils/handlebars/helpers/lt/lt.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;;;;;;;;GASG;AACH,qBAAa,QAAS,SAAQ,UAAU;gBAC1B,GAAG,EAAE,KAAK;IAItB,SAAS,CACP,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,UAAU,CAAC,aAAa,GAChC,MAAM,GAAG,OAAO;CAIpB"}
@@ -0,0 +1,22 @@
1
+ import { lt } from 'lodash-es';
2
+ import { HelperUtil } from '../../utils';
3
+ import { HelperBase } from '../helper-base';
4
+ /**
5
+ * 小于
6
+ *
7
+ * @description 判断: word < word2, 用法 {{#lt word word2}}xxx{{else}}yyy{{/lt}}、{{lt word word2}} 返回值为 boolean 类型
8
+ * @author chitanda
9
+ * @date 2021-12-24 15:12:53
10
+ * @export
11
+ * @class HelperLt
12
+ * @extends {HelperBase}
13
+ */
14
+ export class HelperLt extends HelperBase {
15
+ constructor(hbs) {
16
+ super(hbs, 'lt');
17
+ }
18
+ onExecute(param, param2, options) {
19
+ const bol = lt(param, param2);
20
+ return HelperUtil.handleJudgmentExecute(this, bol, options);
21
+ }
22
+ }