@morozeckiy/dd-lib 0.1.1 → 0.1.2

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 (227) hide show
  1. package/esm2022/lib/common/lib-common-button.mjs +62 -0
  2. package/esm2022/lib/common/lib-common-input-text.mjs +172 -0
  3. package/esm2022/lib/core/dialog/dialog-config.mjs +15 -0
  4. package/esm2022/lib/core/dialog/dialog-container.component.mjs +40 -0
  5. package/esm2022/lib/core/dialog/dialog-ref.mjs +19 -0
  6. package/esm2022/lib/core/dialog/dialog.service.mjs +106 -0
  7. package/esm2022/lib/core/directives/auto-height.directive.mjs +36 -0
  8. package/esm2022/lib/core/directives/click-outside.directive.mjs +42 -0
  9. package/esm2022/lib/core/directives/counter.directive.mjs +64 -0
  10. package/esm2022/lib/core/directives/declension.directive.mjs +40 -0
  11. package/esm2022/lib/core/directives/resize-textarea.directive.mjs +26 -0
  12. package/esm2022/lib/core/directives/triangle.directive.mjs +75 -0
  13. package/esm2022/lib/core/index.mjs +26 -0
  14. package/esm2022/lib/core/pipes/filter-tabs.pipe.mjs +31 -0
  15. package/esm2022/lib/core/pipes/filter.pipe.mjs +49 -0
  16. package/esm2022/lib/core/pipes/highlight.pipe.mjs +23 -0
  17. package/esm2022/lib/core/pipes/reverse.pipe.mjs +17 -0
  18. package/esm2022/lib/core/pipes/safe.pipe.mjs +34 -0
  19. package/esm2022/lib/core/services/date.service.mjs +113 -0
  20. package/esm2022/lib/core/services/destroy.service.mjs +15 -0
  21. package/esm2022/lib/core/services/fetcher.service.mjs +92 -0
  22. package/esm2022/lib/core/services/interceptors.service.mjs +27 -0
  23. package/esm2022/lib/core/services/svg-icons.service.mjs +26 -0
  24. package/esm2022/lib/core/services/theme-constructor.service.mjs +64 -0
  25. package/esm2022/lib/core/services/validators.service.mjs +73 -0
  26. package/esm2022/lib/core/tools.mjs +128 -0
  27. package/esm2022/lib/core/tooltip/tooltip.component.mjs +27 -0
  28. package/esm2022/lib/core/tooltip/tooltip.directive.mjs +137 -0
  29. package/esm2022/lib/lib-accordion/lib-accordion.component.mjs +15 -0
  30. package/esm2022/lib/lib-back-button/lib-back-button.component.mjs +37 -0
  31. package/esm2022/lib/lib-button/lib-button.component.mjs +30 -0
  32. package/esm2022/lib/lib-calendar/lib-calendar.component.mjs +222 -0
  33. package/esm2022/lib/lib-card/lib-card.component.mjs +34 -0
  34. package/esm2022/lib/lib-checkbox/lib-checkbox.component.mjs +66 -0
  35. package/esm2022/lib/lib-comment-input/lib-comment-input.component.mjs +20 -0
  36. package/esm2022/lib/lib-file-upload/lib-file-upload.component.mjs +34 -0
  37. package/esm2022/lib/lib-filter-button/lib-filter-button.component.mjs +42 -0
  38. package/esm2022/lib/lib-image-loader/lib-image-loader.component.mjs +14 -0
  39. package/esm2022/lib/lib-input/lib-input.component.mjs +55 -0
  40. package/esm2022/lib/lib-loader/lib-loader.component.mjs +16 -0
  41. package/esm2022/lib/lib-period/lib-period.component.mjs +114 -0
  42. package/esm2022/lib/lib-radio/lib-radio.component.mjs +76 -0
  43. package/esm2022/lib/lib-search-input/lib-search-input.component.mjs +91 -0
  44. package/esm2022/lib/lib-select/lib-select.component.mjs +137 -0
  45. package/esm2022/lib/lib-skeleton/lib-skeleton.component.mjs +45 -0
  46. package/esm2022/lib/lib-sort/lib-sort.component.mjs +44 -0
  47. package/esm2022/lib/lib-step/lib-step.component.mjs +19 -0
  48. package/esm2022/lib/lib-svg/lib-svg.component.mjs +75 -0
  49. package/esm2022/lib/lib-svg-icon/lib-svg-icon.component.mjs +55 -0
  50. package/esm2022/lib/lib-tabs-fragment/lib-tabs-fragment.component.mjs +79 -0
  51. package/esm2022/lib/lib-textarea/lib-textarea.component.mjs +50 -0
  52. package/esm2022/lib/toast/toast-base/toast-base.component.mjs +29 -0
  53. package/esm2022/lib/toast/toast-placeholder/toast-placeholder.component.mjs +29 -0
  54. package/esm2022/lib/toast/toast.service.mjs +124 -0
  55. package/esm2022/lib/utils/decorators.mjs +102 -0
  56. package/esm2022/morozeckiy-dd-lib.mjs +5 -0
  57. package/esm2022/public-api.mjs +35 -0
  58. package/fesm2022/morozeckiy-dd-lib.mjs +3004 -0
  59. package/fesm2022/morozeckiy-dd-lib.mjs.map +1 -0
  60. package/index.d.ts +5 -0
  61. package/lib/common/lib-common-button.d.ts +20 -0
  62. package/lib/common/lib-common-input-text.d.ts +53 -0
  63. package/lib/core/dialog/dialog-config.d.ts +14 -0
  64. package/lib/core/dialog/dialog-container.component.d.ts +18 -0
  65. package/lib/core/dialog/dialog-ref.d.ts +18 -0
  66. package/lib/core/dialog/dialog.service.d.ts +28 -0
  67. package/lib/core/directives/auto-height.directive.d.ts +11 -0
  68. package/lib/core/directives/click-outside.directive.d.ts +11 -0
  69. package/lib/core/directives/counter.directive.d.ts +11 -0
  70. package/lib/core/directives/declension.directive.d.ts +13 -0
  71. package/lib/core/directives/resize-textarea.directive.d.ts +10 -0
  72. package/lib/core/directives/triangle.directive.d.ts +16 -0
  73. package/lib/core/index.d.ts +20 -0
  74. package/lib/core/pipes/filter-tabs.pipe.d.ts +7 -0
  75. package/lib/core/pipes/filter.pipe.d.ts +12 -0
  76. package/lib/core/pipes/highlight.pipe.d.ts +7 -0
  77. package/lib/core/pipes/reverse.pipe.d.ts +7 -0
  78. package/lib/core/pipes/safe.pipe.d.ts +10 -0
  79. package/lib/core/services/date.service.d.ts +41 -0
  80. package/lib/core/services/destroy.service.d.ts +8 -0
  81. package/lib/core/services/fetcher.service.d.ts +29 -0
  82. package/lib/core/services/interceptors.service.d.ts +12 -0
  83. package/lib/core/services/svg-icons.service.d.ts +9 -0
  84. package/lib/core/services/theme-constructor.service.d.ts +27 -0
  85. package/lib/core/services/validators.service.d.ts +18 -0
  86. package/lib/core/tools.d.ts +16 -0
  87. package/lib/core/tooltip/tooltip.component.d.ts +12 -0
  88. package/lib/core/tooltip/tooltip.directive.d.ts +22 -0
  89. package/lib/lib-accordion/lib-accordion.component.d.ts +8 -0
  90. package/lib/lib-back-button/lib-back-button.component.d.ts +13 -0
  91. package/lib/lib-button/lib-button.component.d.ts +10 -0
  92. package/lib/lib-calendar/lib-calendar.component.d.ts +76 -0
  93. package/lib/lib-card/lib-card.component.d.ts +16 -0
  94. package/lib/lib-checkbox/lib-checkbox.component.d.ts +23 -0
  95. package/lib/lib-comment-input/lib-comment-input.component.d.ts +8 -0
  96. package/lib/lib-file-upload/lib-file-upload.component.d.ts +12 -0
  97. package/lib/lib-filter-button/lib-filter-button.component.d.ts +13 -0
  98. package/lib/lib-image-loader/lib-image-loader.component.d.ts +6 -0
  99. package/lib/lib-input/lib-input.component.d.ts +13 -0
  100. package/lib/lib-loader/lib-loader.component.d.ts +6 -0
  101. package/lib/lib-period/lib-period.component.d.ts +41 -0
  102. package/lib/lib-radio/lib-radio.component.d.ts +25 -0
  103. package/lib/lib-search-input/lib-search-input.component.d.ts +29 -0
  104. package/lib/lib-select/lib-select.component.d.ts +30 -0
  105. package/lib/lib-skeleton/lib-skeleton.component.d.ts +16 -0
  106. package/lib/lib-sort/lib-sort.component.d.ts +18 -0
  107. package/lib/lib-step/lib-step.component.d.ts +7 -0
  108. package/{src/lib/lib-svg/lib-svg.component.ts → lib/lib-svg/lib-svg.component.d.ts} +38 -66
  109. package/lib/lib-svg-icon/lib-svg-icon.component.d.ts +18 -0
  110. package/lib/lib-tabs-fragment/lib-tabs-fragment.component.d.ts +29 -0
  111. package/lib/lib-textarea/lib-textarea.component.d.ts +13 -0
  112. package/lib/toast/toast-base/toast-base.component.d.ts +21 -0
  113. package/lib/toast/toast-placeholder/toast-placeholder.component.d.ts +12 -0
  114. package/lib/toast/toast.service.d.ts +35 -0
  115. package/lib/utils/decorators.d.ts +4 -0
  116. package/package.json +16 -3
  117. package/public-api.d.ts +30 -0
  118. package/ekgip-dd-lib-0.0.1.tgz +0 -0
  119. package/ng-package.json +0 -8
  120. package/src/lib/common/lib-common-button.ts +0 -34
  121. package/src/lib/common/lib-common-input-text.ts +0 -154
  122. package/src/lib/core/dialog/dialog-config.ts +0 -19
  123. package/src/lib/core/dialog/dialog-container.component.ts +0 -38
  124. package/src/lib/core/dialog/dialog-ref.ts +0 -28
  125. package/src/lib/core/dialog/dialog.service.ts +0 -144
  126. package/src/lib/core/directives/auto-height.directive.ts +0 -29
  127. package/src/lib/core/directives/click-outside.directive.ts +0 -33
  128. package/src/lib/core/directives/counter.directive.ts +0 -54
  129. package/src/lib/core/directives/declension.directive.ts +0 -29
  130. package/src/lib/core/directives/resize-textarea.directive.ts +0 -16
  131. package/src/lib/core/directives/triangle.directive.ts +0 -56
  132. package/src/lib/core/index.ts +0 -27
  133. package/src/lib/core/pipes/filter-tabs.pipe.ts +0 -25
  134. package/src/lib/core/pipes/filter.pipe.ts +0 -36
  135. package/src/lib/core/pipes/highlight.pipe.ts +0 -17
  136. package/src/lib/core/pipes/reverse.pipe.ts +0 -11
  137. package/src/lib/core/pipes/safe.pipe.ts +0 -37
  138. package/src/lib/core/services/date.service.ts +0 -153
  139. package/src/lib/core/services/destroy.service.ts +0 -10
  140. package/src/lib/core/services/fetcher.service.ts +0 -109
  141. package/src/lib/core/services/interceptors.service.ts +0 -26
  142. package/src/lib/core/services/svg-icons.service.ts +0 -25
  143. package/src/lib/core/services/theme-constructor.service.ts +0 -68
  144. package/src/lib/core/services/validators.service.ts +0 -73
  145. package/src/lib/core/tools.ts +0 -159
  146. package/src/lib/core/tooltip/tooltip.component.html +0 -10
  147. package/src/lib/core/tooltip/tooltip.component.scss +0 -59
  148. package/src/lib/core/tooltip/tooltip.component.ts +0 -27
  149. package/src/lib/core/tooltip/tooltip.directive.ts +0 -137
  150. package/src/lib/core/utils.ts +0 -28
  151. package/src/lib/lib-accordion/lib-accordion.component.html +0 -15
  152. package/src/lib/lib-accordion/lib-accordion.component.scss +0 -23
  153. package/src/lib/lib-accordion/lib-accordion.component.ts +0 -17
  154. package/src/lib/lib-back-button/lib-back-button.component.html +0 -4
  155. package/src/lib/lib-back-button/lib-back-button.component.scss +0 -3
  156. package/src/lib/lib-back-button/lib-back-button.component.ts +0 -31
  157. package/src/lib/lib-button/lib-button.component.html +0 -30
  158. package/src/lib/lib-button/lib-button.component.scss +0 -89
  159. package/src/lib/lib-button/lib-button.component.ts +0 -33
  160. package/src/lib/lib-calendar/lib-calendar.component.html +0 -64
  161. package/src/lib/lib-calendar/lib-calendar.component.scss +0 -88
  162. package/src/lib/lib-calendar/lib-calendar.component.ts +0 -227
  163. package/src/lib/lib-card/lib-card.component.html +0 -23
  164. package/src/lib/lib-card/lib-card.component.scss +0 -64
  165. package/src/lib/lib-card/lib-card.component.ts +0 -32
  166. package/src/lib/lib-checkbox/lib-checkbox.component.html +0 -15
  167. package/src/lib/lib-checkbox/lib-checkbox.component.scss +0 -80
  168. package/src/lib/lib-checkbox/lib-checkbox.component.ts +0 -67
  169. package/src/lib/lib-comment-input/lib-comment-input.component.html +0 -32
  170. package/src/lib/lib-comment-input/lib-comment-input.component.scss +0 -28
  171. package/src/lib/lib-comment-input/lib-comment-input.component.ts +0 -20
  172. package/src/lib/lib-file-upload/lib-file-upload.component.html +0 -14
  173. package/src/lib/lib-file-upload/lib-file-upload.component.scss +0 -3
  174. package/src/lib/lib-file-upload/lib-file-upload.component.ts +0 -26
  175. package/src/lib/lib-filter-button/lib-filter-button.component.html +0 -46
  176. package/src/lib/lib-filter-button/lib-filter-button.component.scss +0 -62
  177. package/src/lib/lib-filter-button/lib-filter-button.component.ts +0 -45
  178. package/src/lib/lib-image-loader/lib-image-loader.component.html +0 -17
  179. package/src/lib/lib-image-loader/lib-image-loader.component.scss +0 -6
  180. package/src/lib/lib-image-loader/lib-image-loader.component.ts +0 -16
  181. package/src/lib/lib-input/lib-input.component.html +0 -32
  182. package/src/lib/lib-input/lib-input.component.scss +0 -72
  183. package/src/lib/lib-input/lib-input.component.ts +0 -62
  184. package/src/lib/lib-loader/lib-loader.component.html +0 -29
  185. package/src/lib/lib-loader/lib-loader.component.scss +0 -26
  186. package/src/lib/lib-loader/lib-loader.component.ts +0 -13
  187. package/src/lib/lib-period/lib-period.component.html +0 -41
  188. package/src/lib/lib-period/lib-period.component.scss +0 -77
  189. package/src/lib/lib-period/lib-period.component.ts +0 -131
  190. package/src/lib/lib-radio/lib-radio.component.html +0 -22
  191. package/src/lib/lib-radio/lib-radio.component.scss +0 -113
  192. package/src/lib/lib-radio/lib-radio.component.ts +0 -78
  193. package/src/lib/lib-search-input/lib-search-input.component.html +0 -48
  194. package/src/lib/lib-search-input/lib-search-input.component.scss +0 -86
  195. package/src/lib/lib-search-input/lib-search-input.component.ts +0 -94
  196. package/src/lib/lib-select/lib-select.component.html +0 -83
  197. package/src/lib/lib-select/lib-select.component.scss +0 -130
  198. package/src/lib/lib-select/lib-select.component.ts +0 -152
  199. package/src/lib/lib-skeleton/lib-skeleton.component.html +0 -11
  200. package/src/lib/lib-skeleton/lib-skeleton.component.scss +0 -36
  201. package/src/lib/lib-skeleton/lib-skeleton.component.ts +0 -41
  202. package/src/lib/lib-sort/lib-sort.component.html +0 -21
  203. package/src/lib/lib-sort/lib-sort.component.scss +0 -21
  204. package/src/lib/lib-sort/lib-sort.component.ts +0 -52
  205. package/src/lib/lib-step/lib-step.component.html +0 -4
  206. package/src/lib/lib-step/lib-step.component.scss +0 -23
  207. package/src/lib/lib-step/lib-step.component.ts +0 -14
  208. package/src/lib/lib-svg/lib-svg.component.html +0 -15
  209. package/src/lib/lib-svg/lib-svg.component.scss +0 -81
  210. package/src/lib/lib-svg-icon/lib-svg-icon.component.css +0 -0
  211. package/src/lib/lib-svg-icon/lib-svg-icon.component.ts +0 -58
  212. package/src/lib/lib-tabs-fragment/lib-tabs-fragment.component.html +0 -12
  213. package/src/lib/lib-tabs-fragment/lib-tabs-fragment.component.scss +0 -19
  214. package/src/lib/lib-tabs-fragment/lib-tabs-fragment.component.ts +0 -88
  215. package/src/lib/lib-textarea/lib-textarea.component.html +0 -37
  216. package/src/lib/lib-textarea/lib-textarea.component.scss +0 -77
  217. package/src/lib/lib-textarea/lib-textarea.component.ts +0 -49
  218. package/src/lib/toast/toast-base/toast-base.component.html +0 -7
  219. package/src/lib/toast/toast-base/toast-base.component.scss +0 -44
  220. package/src/lib/toast/toast-base/toast-base.component.ts +0 -38
  221. package/src/lib/toast/toast-placeholder/toast-placeholder.component.ts +0 -20
  222. package/src/lib/toast/toast.service.ts +0 -130
  223. package/src/lib/utils/decorators.ts +0 -124
  224. package/src/public-api.ts +0 -35
  225. package/tsconfig.lib.json +0 -14
  226. package/tsconfig.lib.prod.json +0 -10
  227. package/tsconfig.spec.json +0 -14
@@ -1,159 +0,0 @@
1
- export function compare(field?: any, order?: number, ...args: undefined[]): any {
2
- let len = args.length;
3
- if (len === 0) {
4
- return (a: number, b: number) => (a < b && -1) || (a > b && 1) || 0;
5
- }
6
- if (len === 1) {
7
- switch (typeof field) {
8
- case 'number':
9
- return field < 0
10
- ? (a: number, b: number) => (a < b && 1) || (a > b && -1) || 0
11
- : (a: number, b: number) => (a < b && -1) || (a > b && 1) || 0;
12
- case 'string':
13
- return (a: { [x: string]: string }, b: { [x: string]: string }) =>
14
- (a[field] ? a[field].toLowerCase() : '' < b[field] ? b[field].toLowerCase() : '' && -1) ||
15
- (a[field] ? a[field].toLowerCase() : '' > b[field] ? b[field].toLowerCase() : '' && 1) ||
16
- 0;
17
- }
18
- }
19
- if (field && len === 2 && typeof order === 'number') {
20
- return order < 0
21
- ? (
22
- a: { [x: string]: any },
23
- b: {
24
- [x: string]: any;
25
- },
26
- ) => (b[field] || '').toLowerCase().localeCompare((a[field] || '').toLowerCase())
27
- : (
28
- a: { [x: string]: any },
29
- b: {
30
- [x: string]: any;
31
- },
32
- ) => (a[field] || '').toLowerCase().localeCompare((b[field] || '').toLowerCase());
33
- }
34
- let fields: any[];
35
- let orders: any[];
36
- if (typeof field === 'object') {
37
- fields = Object.getOwnPropertyNames(field);
38
- orders = fields.map(key => field[key]);
39
- len = fields.length;
40
- } else {
41
- fields = new Array(len);
42
- orders = new Array(len);
43
- for (let i = len; i--; ) {
44
- fields[i] = args[i];
45
- orders[i] = 1;
46
- }
47
- }
48
- return (
49
- a: { [x: string]: { toLowerCase: () => number } },
50
- b: { [x: string]: { toLowerCase: () => number } },
51
- ) => {
52
- for (let i = 0; i < len; i++) {
53
- if (a[fields[i]].toLowerCase() < b[fields[i]].toLowerCase()) {
54
- return orders[i];
55
- }
56
- if (a[fields[i]].toLowerCase() > b[fields[i]].toLowerCase()) {
57
- return -orders[i];
58
- }
59
- }
60
- return 0;
61
- };
62
- }
63
-
64
- // export function parseDate(value) {
65
- // if (value && value.length === 6) {
66
- // const year = parseInt(value.slice(2, 6), 10);
67
- // const month = parseInt(value.slice(0, 2), 10) - 1;
68
- // return new Date(year, month);
69
- // }
70
- // }
71
-
72
- export function rndRgb() {
73
- const x = Math.floor(Math.random() * 256);
74
- const y = Math.floor(Math.random() * 256);
75
- const z = Math.floor(Math.random() * 256);
76
- return 'rgb(' + x + ',' + y + ',' + z + ')';
77
- }
78
-
79
- export function setMinDate() {
80
- let curYear = new Date().getFullYear();
81
- let curMonth = new Date().getMonth();
82
- const curDay = new Date().getDate();
83
- if (curMonth < 6) {
84
- curYear -= 1;
85
- curMonth = curMonth - 6 + 12;
86
- } else {
87
- curMonth -= 6;
88
- }
89
- return new Date(curYear, curMonth, curDay);
90
- }
91
-
92
- export function isNil(value: any): value is null | undefined {
93
- return value === null || typeof value === 'undefined';
94
- }
95
-
96
- export function isString(value: any): value is string {
97
- return typeof value === 'string';
98
- }
99
-
100
- export function isObject(value: any): boolean {
101
- return value !== null && typeof value === 'object';
102
- }
103
-
104
- export function getProperty(value: { [key: string]: any }, key: string): any {
105
- if (isNil(value) || !isObject(value)) {
106
- return undefined;
107
- }
108
-
109
- const keys: string[] = key.split('.');
110
- let result: any = value[keys.shift()!];
111
-
112
- for (const k of keys) {
113
- if (isNil(result) || !isObject(result)) {
114
- return undefined;
115
- }
116
-
117
- result = result[k];
118
- }
119
-
120
- return result;
121
- }
122
-
123
- export function isMobile() {
124
- return Android() || BlackBerry() || iOS() || Opera() || Windows();
125
- }
126
-
127
- export function Android() {
128
- return !!navigator.userAgent.match(/Android/i);
129
- }
130
-
131
- export function BlackBerry() {
132
- return !!navigator.userAgent.match(/BlackBerry/i);
133
- }
134
-
135
- export function iOS() {
136
- return !!navigator.userAgent.match(/iPhone|iPad|iPod/i);
137
- }
138
-
139
- export function Opera() {
140
- return !!navigator.userAgent.match(/Opera Mini/i);
141
- }
142
-
143
- export function Windows() {
144
- return !!navigator.userAgent.match(/IEMobile/i) || navigator.userAgent.match(/WPDesktop/i);
145
- }
146
-
147
- export function dataURLtoFile(dataUrl: string, filename: string) {
148
- const arr = dataUrl.split(',');
149
- const mime = (arr as any)[0].match(/:(.*?);/)[1];
150
- const bstr = atob(arr[1]);
151
- let n = bstr.length;
152
- const u8arr = new Uint8Array(n);
153
-
154
- while (n--) {
155
- u8arr[n] = bstr.charCodeAt(n);
156
- }
157
-
158
- return new File([u8arr], filename, { type: mime });
159
- }
@@ -1,10 +0,0 @@
1
- <div class="tooltip-container">
2
- @if (asString; as string) {
3
- {{ string }}
4
- } @if (asTemplate; as template) {
5
- <ng-template [ngTemplateOutlet]="template"></ng-template>
6
- }
7
- <svg class="tooltip-container__triangle" width="16" height="16">
8
- <polyline points="8,0 0,8 8,16"></polyline>
9
- </svg>
10
- </div>
@@ -1,59 +0,0 @@
1
- :host {
2
- position: relative;
3
- }
4
-
5
- .tooltip-container {
6
- position: relative;
7
- display: block;
8
- max-width: 312px;
9
- padding: 6px 12px 6px 12px;
10
- background: var(--white-color);
11
- border-radius: 8px;
12
- box-sizing: border-box;
13
- box-shadow: 0 14px 64px -4px #18274b0f, 0px 8px 22px -6px #18274b0f;
14
-
15
- &__triangle {
16
- width: 16px;
17
- height: 16px;
18
- position: absolute;
19
- fill: rgb(255, 255, 255);
20
- stroke: rgb(255, 255, 255);
21
- box-shadow: rgba(24, 39, 75, 0.06) 0 14px 64px -4px, rgba(24, 39, 75, 0.06) 0px 8px 22px -6px;
22
- }
23
- }
24
-
25
- :host-context(.left) {
26
- //left: -35px;
27
-
28
- svg {
29
- top: calc(50% - 8px);
30
- right: -8px;
31
- rotate: 180deg;
32
- }
33
- }
34
-
35
- :host-context(.right) {
36
- //right: -35px;
37
- svg {
38
- top: calc(50% - 8px);
39
- left: -8px;
40
- }
41
- }
42
-
43
- :host-context(.top) {
44
- //margin-bottom: 16px;
45
- svg {
46
- right: calc(50% - 8px);
47
- bottom: -8px;
48
- rotate: -90deg;
49
- }
50
- }
51
-
52
- :host-context(.bottom) {
53
- //margin-top: 16px;
54
- svg {
55
- right: calc(50% - 8px);
56
- top: -8px;
57
- rotate: 90deg;
58
- }
59
- }
@@ -1,27 +0,0 @@
1
- import {ChangeDetectionStrategy, Component, Inject, InjectionToken, TemplateRef} from '@angular/core';
2
- import {CommonModule} from '@angular/common';
3
- import {TriangleDirective} from "../directives/triangle.directive";
4
-
5
- export type TooltipData = string | TemplateRef<void>;
6
- export const TOOLTIP_DATA = new InjectionToken<TooltipData>('Подсказка');
7
-
8
- @Component({
9
- selector: 'dd-tooltip',
10
- standalone: true,
11
- imports: [CommonModule, TriangleDirective],
12
- templateUrl: './tooltip.component.html',
13
- styleUrl: './tooltip.component.scss',
14
- changeDetection: ChangeDetectionStrategy.OnPush,
15
- })
16
- export class TooltipComponent {
17
- public get asString(): string | false {
18
- return typeof this.tooltipData === 'string' ? this.tooltipData : false;
19
- }
20
-
21
- public get asTemplate(): TemplateRef<void> | false {
22
- return this.tooltipData instanceof TemplateRef ? this.tooltipData : false;
23
- }
24
-
25
- constructor(@Inject(TOOLTIP_DATA) public tooltipData: TooltipData) {
26
- }
27
- }
@@ -1,137 +0,0 @@
1
- import {
2
- Directive,
3
- ElementRef,
4
- HostListener,
5
- Injector,
6
- Input,
7
- OnDestroy,
8
- Renderer2,
9
- TemplateRef,
10
- ViewContainerRef,
11
- } from '@angular/core';
12
- import { Overlay, OverlayRef, PositionStrategy } from '@angular/cdk/overlay';
13
- import { ComponentPortal } from '@angular/cdk/portal';
14
- import { TOOLTIP_DATA, TooltipComponent } from './tooltip.component';
15
-
16
- @Directive({
17
- selector: '[ddTooltip]',
18
- standalone: true,
19
- })
20
- export class TooltipDirective implements OnDestroy {
21
- @Input() public ddTooltip!: string | TemplateRef<void>;
22
- @Input() public withClick = false;
23
- private overlayRef: OverlayRef | null = null;
24
-
25
- constructor(
26
- private element: ElementRef,
27
- private overlay: Overlay,
28
- private viewContainer: ViewContainerRef,
29
- private rdr: Renderer2,
30
- ) {}
31
-
32
- @HostListener('document:click', ['$event'])
33
- public onClick(targetElement: Event) {
34
- const clickedInside = this.element.nativeElement.contains(targetElement.target);
35
-
36
- if (!clickedInside) {
37
- if (this.overlayRef?.hasAttached() === true) {
38
- this.overlayRef?.detach();
39
- }
40
- }
41
- }
42
-
43
- @HostListener('click')
44
- public showTooltipOnClick(): void {
45
- const overlay = document.getElementsByClassName('cdk-overlay-container')?.[0];
46
- if (overlay && overlay.firstChild) {
47
- overlay.removeChild(overlay.firstChild);
48
- }
49
- if (this.overlayRef?.hasAttached() === true) {
50
- this.overlayRef?.detach();
51
- return;
52
- }
53
-
54
- this.attachTooltip();
55
- }
56
-
57
- @HostListener('mouseenter')
58
- @HostListener('focus')
59
- public showTooltip(): void {
60
- if (this.withClick) {
61
- return;
62
- }
63
- if (this.overlayRef?.hasAttached() === true) {
64
- return;
65
- }
66
-
67
- this.attachTooltip();
68
- }
69
-
70
- @HostListener('mouseleave')
71
- @HostListener('blur')
72
- public hideTooltip(): void {
73
- if (this.withClick) {
74
- return;
75
- }
76
- if (this.overlayRef?.hasAttached() === true) {
77
- this.overlayRef?.detach();
78
- }
79
- }
80
-
81
- public ngOnDestroy(): void {
82
- this.overlayRef?.dispose();
83
- }
84
-
85
- private attachTooltip(): void {
86
- if (this.overlayRef === null) {
87
- const positionStrategy = this.getPositionStrategy();
88
- this.overlayRef = this.overlay.create({ positionStrategy });
89
- }
90
- const injector = Injector.create({
91
- providers: [
92
- {
93
- provide: TOOLTIP_DATA,
94
- useValue: this.ddTooltip,
95
- },
96
- ],
97
- });
98
- const component = new ComponentPortal(TooltipComponent, this.viewContainer, injector);
99
- this.overlayRef.attach(component);
100
- }
101
-
102
- private getPositionStrategy(): PositionStrategy {
103
- return this.overlay
104
- .position()
105
- .flexibleConnectedTo(this.element)
106
- .withPositions([
107
- {
108
- originX: 'start',
109
- originY: 'center',
110
- overlayX: 'start',
111
- overlayY: 'center',
112
- panelClass: 'right',
113
- },
114
- {
115
- originX: 'center',
116
- originY: 'bottom',
117
- overlayX: 'center',
118
- overlayY: 'top',
119
- panelClass: 'bottom',
120
- },
121
- {
122
- originX: 'center',
123
- originY: 'top',
124
- overlayX: 'center',
125
- overlayY: 'bottom',
126
- panelClass: 'top',
127
- },
128
- {
129
- originX: 'end',
130
- originY: 'center',
131
- overlayX: 'end',
132
- overlayY: 'center',
133
- panelClass: 'left',
134
- },
135
- ]);
136
- }
137
- }
@@ -1,28 +0,0 @@
1
- export function isMobile() {
2
- return Android() || BlackBerry() || iOS() || Opera() || Windows();
3
- }
4
-
5
- export function Android() {
6
- return !!navigator.userAgent.match(/Android/i);
7
- }
8
-
9
- export function BlackBerry() {
10
- return !!navigator.userAgent.match(/BlackBerry/i);
11
- }
12
-
13
- export function iOS() {
14
- return !!navigator.userAgent.match(/iPhone|iPad|iPod/i);
15
- }
16
-
17
- export function Opera() {
18
- return !!navigator.userAgent.match(/Opera Mini/i);
19
- }
20
-
21
- export function Windows() {
22
- return !!navigator.userAgent.match(/IEMobile/i) || navigator.userAgent.match(/WPDesktop/i);
23
- }
24
-
25
- export const objConverting = ([name, data]: [string, string]) => ({ name, data });
26
-
27
- export const iconsToArray = (obj: { [key: string]: string }): { name: string, data: string }[] =>
28
- Object.entries(obj).map(objConverting);
@@ -1,15 +0,0 @@
1
- <div class="accordion">
2
- <div (click)="showAccordionContent = !showAccordionContent" class="accordion__header">
3
- @if (accTitle) {
4
- <div [innerHTML]="accTitle" class="accordion__title"></div>
5
- }
6
- <div>
7
- <dd-lib-svg-icon class="cup" icon="{{ showAccordionContent ? 'minus' : 'plus' }}"></dd-lib-svg-icon>
8
- </div>
9
- </div>
10
- @if (showAccordionContent) {
11
- <div class="mt-8">
12
- <ng-content></ng-content>
13
- </div>
14
- }
15
- </div>
@@ -1,23 +0,0 @@
1
- //@import '../../../assets/scss/mixins';
2
- //@import '../../../assets/scss/vars';
3
- //
4
- //.accordion {
5
- // &__header {
6
- // display: flex;
7
- // align-items: center;
8
- // justify-content: space-between;
9
- // cursor: pointer;
10
- // }
11
- //
12
- // &__title {
13
- // font-weight: 500;
14
- // font-size: 20px;
15
- // line-height: 28px;
16
- // color: var(--light-black-color);
17
- //
18
- // @include below($mobile) {
19
- // font-size: 16px;
20
- // line-height: 24px;
21
- // }
22
- // }
23
- //}
@@ -1,17 +0,0 @@
1
- import {ChangeDetectionStrategy, Component, Input} from '@angular/core';
2
- import {NgOptimizedImage} from '@angular/common';
3
- import {SafeHtml} from '@angular/platform-browser';
4
- import {LibSvgIconComponent} from "../lib-svg-icon/lib-svg-icon.component";
5
-
6
- @Component({
7
- selector: 'dd-lib-accordion',
8
- standalone: true,
9
- imports: [NgOptimizedImage, LibSvgIconComponent],
10
- templateUrl: './lib-accordion.component.html',
11
- styleUrl: './lib-accordion.component.scss',
12
- changeDetection: ChangeDetectionStrategy.OnPush,
13
- })
14
- export class LibAccordionComponent {
15
- @Input() public accTitle: string | SafeHtml | undefined;
16
- public showAccordionContent: boolean | undefined;
17
- }
@@ -1,4 +0,0 @@
1
- <div (click)="onBack()" class="mr-8 align-center cup d-inline-flex">
2
- <dd-lib-svg-icon icon="back_arrow"></dd-lib-svg-icon>
3
- <div class="b3-title gray cup">{{ backTitle }}</div>
4
- </div>
@@ -1,3 +0,0 @@
1
- :host {
2
- display: block;
3
- }
@@ -1,31 +0,0 @@
1
- import {ChangeDetectionStrategy, Component, Input} from '@angular/core';
2
- import {Location, NgOptimizedImage} from '@angular/common';
3
- import {Router} from '@angular/router';
4
- import {LibSvgIconComponent} from "../lib-svg-icon/lib-svg-icon.component";
5
-
6
- @Component({
7
- selector: 'dd-lib-back-button',
8
- standalone: true,
9
- imports: [NgOptimizedImage, LibSvgIconComponent],
10
- templateUrl: './lib-back-button.component.html',
11
- styleUrl: './lib-back-button.component.scss',
12
- changeDetection: ChangeDetectionStrategy.OnPush,
13
- })
14
- export class LibBackButtonComponent {
15
- @Input() public backTitle = 'Назад';
16
- @Input() public rout: string | undefined;
17
-
18
- constructor(private location: Location, private router: Router) {}
19
-
20
- public onBack(): void {
21
- if (this.rout) {
22
- this.router.navigate([this.rout]);
23
- } else {
24
- try {
25
- this.location.back();
26
- } catch (err) {
27
- this.router.navigate(['/']);
28
- }
29
- }
30
- }
31
- }
@@ -1,30 +0,0 @@
1
- <div (click)="onClick($event)" [ngStyle]="{width, height}" class="button-container">
2
- <button
3
- #btn
4
- [attr.tabIndex]="disabled ? -1 : 0"
5
- [autofocus]="autofocus"
6
- [class.active]="active"
7
- [class.disabled]="disabled"
8
- [class.green]="btnColor === 'green'"
9
- [class.loader]="showLoader"
10
- [class.no-padding]="noPadding"
11
- [class.red]="btnColor === 'red'"
12
- [class.transparent]="btnColor === 'transparent'"
13
- [class.white]="btnColor === 'white'"
14
- [class.dark]="btnColor === 'dark'"
15
- [disabled]="disabled"
16
- [ngStyle]="{width, height}"
17
- [type]="buttonType"
18
- class=""
19
- role="button">
20
- @if (!showLoader) {
21
- <ng-container *ngTemplateOutlet="content"></ng-container>
22
- } @if (showLoader) {
23
- <dd-lib-loader [color]="loaderColor"></dd-lib-loader>
24
- }
25
- </button>
26
- </div>
27
-
28
- <ng-template #content>
29
- <span #contentData><ng-content></ng-content></span>
30
- </ng-template>
@@ -1,89 +0,0 @@
1
- @import '../../../assets/scss/mixins';
2
- @import '../../../assets/scss/vars';
3
-
4
- .button-container {
5
- display: inline-block;
6
-
7
- button {
8
- display: flex;
9
- align-items: center;
10
- justify-content: center;
11
- height: var(--btn-height);
12
- padding: var(--btn-padding);
13
- font-size: 14px;
14
- line-height: 24px;
15
- font-weight: var(--font-wheit-big);
16
- border-radius: var(--btn-border-radius);
17
- outline: none;
18
- cursor: pointer;
19
- white-space: nowrap;
20
- border: none;
21
- background-color: var(--btn-green-bgc);
22
- color: #fff;
23
-
24
- &:hover,
25
- &:focus {
26
- background-color: var(--btn-green-hover);
27
- }
28
-
29
- &:active {
30
- background-color: var(--btn-green-hover);
31
- }
32
-
33
- &.active {
34
- background-color: var(--btn-green-hover);
35
- }
36
-
37
- &.disabled {
38
- color: var(--disabled-color);
39
- background-color: var(--btn-disabled-bgc);
40
- pointer-events: none;
41
- cursor: default;
42
- }
43
-
44
- &.loader {
45
- min-width: 100px;
46
- }
47
-
48
- &.white {
49
- background-color: var(--btn-light-green-bgc);
50
- color: var(--btn-white-color);
51
-
52
- &:hover {
53
- color: var(--btn-white-hover-color);
54
- }
55
- }
56
-
57
- &.transparent {
58
- background-color: transparent;
59
- color: var(--btn-white-color);
60
- border: none;
61
-
62
- &:hover {
63
- color: var(--btn-white-hover-color);
64
- }
65
- }
66
-
67
- &.red {
68
- background-color: var(--btn-red-bgc);
69
- color: var(--btn-red-color);
70
-
71
- &:hover {
72
- color: var(--btn-red-hover-color);
73
- }
74
- }
75
-
76
- &.dark {
77
- background-color: var(--btn-dark-bgc);
78
- color: var(--btn-dark-color);
79
-
80
- &:hover {
81
- background-color: var(--btn-dark-hover-color);
82
- }
83
- }
84
-
85
- &.no-padding {
86
- padding: 0;
87
- }
88
- }
89
- }
@@ -1,33 +0,0 @@
1
- import {
2
- AfterViewInit,
3
- ChangeDetectionStrategy,
4
- Component,
5
- CUSTOM_ELEMENTS_SCHEMA,
6
- Input,
7
- NO_ERRORS_SCHEMA,
8
- } from '@angular/core';
9
- import { CommonModule } from '@angular/common';
10
- import { FormsModule } from '@angular/forms';
11
- import { LibCommonButtonComponent } from '../common/lib-common-button';
12
- import { LibLoaderComponent } from '../lib-loader/lib-loader.component';
13
-
14
- @Component({
15
- selector: 'dd-lib-button',
16
- standalone: true,
17
- templateUrl: './lib-button.component.html',
18
- styleUrls: ['./lib-button.component.scss'],
19
- changeDetection: ChangeDetectionStrategy.OnPush,
20
- imports: [CommonModule, FormsModule, LibLoaderComponent],
21
- schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA],
22
- })
23
- export class LibButtonComponent extends LibCommonButtonComponent implements AfterViewInit {
24
- @Input() public noPadding: boolean | undefined;
25
- @Input() public loaderColor = this.btnColor === 'green' ? '#fff' : '';
26
-
27
- public ngAfterViewInit() {
28
- const btn = this.button?.nativeElement;
29
- if (btn && btn.attributes?.autofocus) {
30
- btn.focus();
31
- }
32
- }
33
- }