@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,64 +0,0 @@
1
- @if (mode === 'icon') {
2
- <div class="pos-relative d-flex align-center">
3
- @if (dateValue) {
4
- <span class="mr-12 green">{{ dateValue | date: 'dd.MM.yyyy' }}</span>
5
- }
6
- <dd-lib-svg-icon class="cup" (click)="showCalendar = !showCalendar" icon="calendar"></dd-lib-svg-icon>
7
- @if (dateValue) {
8
- <dd-lib-svg-icon class="cup" (click)="canselDate()" icon="clear"></dd-lib-svg-icon>
9
- } @if (showCalendar) {
10
- <div class="calendar-abs-wrapper">
11
- <ng-template [ngTemplateOutlet]="calendar"></ng-template>
12
- </div>
13
- }
14
- </div>
15
- } @if (mode === 'full') {
16
- <ng-template [ngTemplateOutlet]="calendar"></ng-template>
17
- }
18
-
19
- <ng-template #calendar>
20
- <dd-lib-card class="calendar-block" type="small">
21
- <div class="calendar-block__header">
22
- <div class="calendar-block__header_arrow">
23
- <dd-lib-svg-icon (click)="changeMonth(-1)" icon="left_chevron"></dd-lib-svg-icon>
24
- </div>
25
- <div class="calendar-block__header_year">{{ getMonth() + ' ' + year }}</div>
26
- <div class="calendar-block__header_arrow">
27
- <dd-lib-svg-icon (click)="changeMonth(1)" icon="right_chevron"></dd-lib-svg-icon>
28
- </div>
29
- </div>
30
- <div class="calendar-block__week">
31
- @for (day of week; track day) {
32
- <div class="calendar-block__week_day">{{ day }}</div>
33
- }
34
- </div>
35
- <div class="calendar-block__days">
36
- @for (day of daysInMonth?.prevDays; track day) {
37
- <div class="calendar-block__days_day hide">{{ day }}</div>
38
- } @for (day of daysInMonth?.days; track day) {
39
- <div
40
- (click)="selectDay(day)"
41
- [class.active]="
42
- dateValue?.getDate() === day && dateValue?.getMonth() === month && dateValue?.getFullYear() === year
43
- "
44
- [class.current]="
45
- dateNow.getDate() === day && dateNow.getMonth() === month && dateNow.getFullYear() === year
46
- "
47
- [class.hide]="checkHideDay(day)"
48
- class="calendar-block__days_day normal">
49
- {{ day }}
50
- </div>
51
- } @for (day of daysInMonth?.lastDays; track day) {
52
- <div class="calendar-block__days_day hide">{{ day }}</div>
53
- }
54
- </div>
55
- <div class="calendar-block__footer">
56
- <dd-lib-button (click)="canselDate()" [btnColor]="'transparent'" class="calendar-block__footer_btn"
57
- >Отменить
58
- </dd-lib-button>
59
- <dd-lib-button (click)="selectDate()" [disabled]="!dateValue" class="calendar-block__footer_btn"
60
- >Выбрать
61
- </dd-lib-button>
62
- </div>
63
- </dd-lib-card>
64
- </ng-template>
@@ -1,88 +0,0 @@
1
- :host {
2
- display: block;
3
- }
4
- .calendar-block {
5
- z-index: 1100;
6
- display: block;
7
-
8
- &__header {
9
- display: flex;
10
- align-items: center;
11
- justify-content: space-between;
12
- margin-bottom: 22px;
13
- color: var(--calendar-gray-color);
14
- font-size: 14px;
15
- font-weight: 400;
16
- line-height: 24px;
17
-
18
- &_arrow {
19
- cursor: pointer;
20
- }
21
- }
22
-
23
- &__week {
24
- display: flex;
25
- align-items: center;
26
- justify-content: space-around;
27
- color: var(--primary-green-color);
28
- font-size: 10px;
29
- font-weight: 400;
30
- line-height: 12px;
31
- letter-spacing: 1.5px;
32
- margin-bottom: 22px;
33
-
34
- &_day {
35
- min-width: 45px;
36
- display: flex;
37
- align-items: center;
38
- justify-content: space-around;
39
- }
40
- }
41
-
42
- &__days {
43
- display: grid;
44
- grid-template-columns: repeat(auto-fit, minmax(30px, 1fr));
45
- gap: 14px;
46
- justify-items: center;
47
- margin-bottom: 22px;
48
-
49
- &_day {
50
- cursor: pointer;
51
- width: 30px;
52
- height: 30px;
53
- display: flex;
54
- align-items: center;
55
- justify-content: center;
56
- border-radius: 29px;
57
-
58
- &.current {
59
- border: 1px solid var(--primary-green-color);
60
- }
61
-
62
- &.active,
63
- &.normal:hover {
64
- background-color: var(--primary-green-color);
65
- color: var(--white-color);
66
- }
67
-
68
- &.hide {
69
- pointer-events: none;
70
- cursor: default;
71
- color: var(--calendar-gray-hide-color);
72
- }
73
- }
74
- }
75
-
76
- &__footer {
77
- display: flex;
78
- align-items: center;
79
- justify-content: space-between;
80
- }
81
- }
82
-
83
- .calendar-abs-wrapper {
84
- position: absolute;
85
- box-shadow: var(--main-card-shadow);
86
- right: 0;
87
- z-index: 1111;
88
- }
@@ -1,227 +0,0 @@
1
- import {ChangeDetectionStrategy, Component, EventEmitter, forwardRef, Input, OnInit, Output,} from '@angular/core';
2
- import {LibFilterButtonComponent} from '../lib-filter-button/lib-filter-button.component';
3
- import {LibCardComponent} from '../lib-card/lib-card.component';
4
- import {LibRadioComponent} from '../lib-radio/lib-radio.component';
5
- import {CommonModule, NgOptimizedImage} from '@angular/common';
6
- import {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';
7
- import {LibButtonComponent} from '../lib-button/lib-button.component';
8
- import {parse} from 'date-fns';
9
- import {DateService, IDaysInMonth} from "../core";
10
- import {LibSvgIconComponent} from "../lib-svg-icon/lib-svg-icon.component";
11
-
12
- const Months = [
13
- 'Январь',
14
- 'Февраль',
15
- 'Март',
16
- 'Апрель',
17
- 'Май',
18
- 'Июнь',
19
- 'Июль',
20
- 'Август',
21
- 'Сентябрь',
22
- 'Октябрь',
23
- 'Ноябрь',
24
- 'Декабрь',
25
- ];
26
-
27
- /**
28
- Этот компонент используется для отображения календаря с возможностью выбора даты.
29
- Ниже приведено описание свойств и методов данного компонента:
30
-
31
- Свойства:
32
- - @Input() public type: 'string' | 'number' | 'date' = 'string'; - тип данных для выбора даты.
33
- - @Input() public format = 'dd.MM.yyyy HH:mm'; - формат отображения даты.
34
- - @Input() public maxDate = new Date(); - максимальная дата, которую можно выбрать.
35
- - @Output() public emitDate = new EventEmitter<date | undefined>(); - событие, срабатывающее при выборе даты.
36
- - public dateValue: Date | undefined; - выбранная пользователем дата.
37
- - public months = Months; - массив с названиями месяцев.
38
- - public week = ['ПН', 'ВТ', 'СР', 'ЧТ', 'ПТ', 'СБ', 'ВС']; - массив с названиями дней недели.
39
- - public year = new Date().getFullYear(); - текущий год.
40
- - public month = new Date().getMonth(); - текущий месяц.
41
- - public day = new Date().getDay(); - текущий день недели.
42
- - public daysInMonth: IDaysInMonth; - количество дней в текущем месяце.
43
- - public currentDate = new Date(); - текущая выбранная дата.
44
- - public dateNow = new Date(); - текущая дата.
45
- - public onTouchedCallback: () => void; - функция обратного вызова при касании.
46
-
47
- Методы:
48
- - public propagateChange(_value: Date): void {} - метод для обновления значения выбранной даты.
49
- - public ngOnInit(): void {} - метод жизненного цикла компонента, вызываемый при инициализации.
50
- - public setDayInMonth(): void {} - метод для установки количества дней в текущем месяце.
51
- - public changeMonth(number: number): void {} - метод для изменения месяца в календаре.
52
- - public getMonth(): string {} - метод для получения названия текущего месяца.
53
- - public registerOnChange(fn: any): void {} - метод для регистрации функции обратного вызова при изменении значения.
54
- - public registerOnTouched(fn: any): void {} - метод для регистрации функции обратного вызова при касании.
55
- - public writeValue(val: Date): void {} - метод для установки значения даты.
56
- - public selectDay(day: number): void {} - метод для выбора конкретного дня в календаре.
57
- - public selectDate(): void {} - метод для выбора даты и передачи значения через propagateChange и emitDate.
58
- - public checkHideDay(day: number): boolean {} - метод для проверки скрытия определенного дня в календаре.
59
- - public canselDate(): void {} - метод для отмены выбранной даты и сброса значений.
60
- **/
61
- @Component({
62
- selector: 'dd-lib-calendar',
63
- standalone: true,
64
- imports: [
65
- LibFilterButtonComponent,
66
- LibCardComponent,
67
- LibRadioComponent,
68
- CommonModule,
69
- LibButtonComponent,
70
- NgOptimizedImage,
71
- LibSvgIconComponent,
72
- ],
73
- providers: [
74
- {
75
- provide: NG_VALUE_ACCESSOR,
76
- useExisting: forwardRef(() => LibCalendarComponent),
77
- multi: true,
78
- },
79
- ],
80
- templateUrl: './lib-calendar.component.html',
81
- styleUrl: './lib-calendar.component.scss',
82
- changeDetection: ChangeDetectionStrategy.OnPush,
83
- })
84
- export class LibCalendarComponent implements ControlValueAccessor, OnInit {
85
- @Input() public type: 'string' | 'number' | 'date' = 'string';
86
- @Input() public formatDate = 'dd.MM.yyyy';
87
- @Input() public formatTime: string | undefined;
88
- @Input() public mode: 'icon' | 'full' = 'full';
89
- @Output() public emitDate = new EventEmitter<Date | undefined>();
90
- @Input()
91
- public set maxDate(date: any) {
92
- if (date === 'current') {
93
- this._maxDate = new Date();
94
- } else if (typeof date === 'object') {
95
- this._maxDate = date;
96
- } else if (typeof date === 'string') {
97
- this._maxDate = parse(
98
- date,
99
- `${this.formatDate}${this.formatTime ? ' ' + this.formatTime : ''}`,
100
- new Date(),
101
- );
102
- }
103
- }
104
-
105
- @Input()
106
- public set minDate(date: any) {
107
- if (date === 'current') {
108
- this._minDate = new Date();
109
- } else if (date === 'year') {
110
- this._minDate = new Date(new Date().setFullYear(new Date().getFullYear() - 1));
111
- } else if (date === 'month') {
112
- this._minDate = new Date(new Date().setMonth(new Date().getMonth() - 1));
113
- } else if (typeof date === 'object') {
114
- this._minDate = date;
115
- } else if (typeof date === 'string') {
116
- this._minDate = parse(
117
- date,
118
- `${this.formatDate}${this.formatTime ? ' ' + this.formatTime : ''}`,
119
- new Date(),
120
- );
121
- }
122
- }
123
-
124
- private _maxDate: Date | undefined;
125
- private _minDate: Date | undefined;
126
- public dateValue: Date | undefined;
127
- public months = Months;
128
- public week = ['ПН', 'ВТ', 'СР', 'ЧТ', 'ПТ', 'СБ', 'ВС'];
129
- public year = new Date().getFullYear();
130
- public month = new Date().getMonth();
131
- public day = new Date().getDay();
132
- public daysInMonth: IDaysInMonth | undefined;
133
- // minDate = setMinDate();
134
- public currentDate = new Date();
135
- public dateNow = new Date();
136
- public onTouchedCallback: (() => void) | undefined;
137
- public showCalendar: boolean | undefined;
138
-
139
- constructor(private dateService: DateService) {}
140
-
141
- public propagateChange(_value: Date): void {}
142
-
143
- public ngOnInit(): void {
144
- this.setDayInMonth();
145
- }
146
-
147
- public setDayInMonth(): void {
148
- this.daysInMonth = this.dateService.getDaysInMonth(this.month, this.year);
149
- }
150
-
151
- public changeMonth(number: number): void {
152
- const temp = new Date(this.currentDate);
153
- temp.setMonth(temp.getMonth() + number);
154
- this.month = temp.getMonth();
155
- this.year = temp.getFullYear();
156
- this.currentDate = temp;
157
- this.setDayInMonth();
158
- }
159
-
160
- public getMonth(): string {
161
- if (this.currentDate) {
162
- return this.months[this.currentDate.getMonth()];
163
- } else {
164
- return this.months[this.month];
165
- }
166
- }
167
-
168
- public registerOnChange(fn: any): void {
169
- this.propagateChange = fn;
170
- }
171
-
172
- public registerOnTouched(fn: any): void {
173
- this.onTouchedCallback = fn;
174
- }
175
-
176
- public writeValue(val: Date): void {
177
- this.dateValue = val;
178
- }
179
-
180
- public selectDay(day: number): void {
181
- if (!this.checkHideDay(day)) {
182
- this.dateValue = new Date(this.year, this.month, day);
183
- }
184
- }
185
-
186
- public selectDate(): void {
187
- this.propagateChange(this.dateValue as Date);
188
- this.emitDate.emit(this.dateValue);
189
- this.showCalendar = false;
190
- }
191
-
192
- public checkHideDay(day: number): boolean {
193
- let moreDay = false;
194
- let moreMonth = false;
195
- let moreYear = false;
196
- const lessDay = false;
197
- const lessMonth = false;
198
- const lessYear = false;
199
- if (this._maxDate) {
200
- const [maxYear, maxMonth, maxDay] = [
201
- this._maxDate.getFullYear(),
202
- this._maxDate.getMonth(),
203
- this._maxDate.getDate(),
204
- ];
205
- moreDay = this.year >= maxYear && this.month >= maxMonth && day > maxDay;
206
- moreMonth = this.year >= maxYear && this.month > maxMonth;
207
- moreYear = this.year > maxYear;
208
- }
209
- if (this._minDate) {
210
- const [minYear, minMonth, minDay] = [
211
- this._minDate.getFullYear(),
212
- this._minDate.getMonth(),
213
- this._minDate.getDate(),
214
- ];
215
- moreDay = this.year <= minYear && this.month <= minMonth && day < minDay;
216
- moreMonth = this.year <= minYear && this.month < minMonth;
217
- moreYear = this.year < minYear;
218
- }
219
- return moreDay || moreMonth || moreYear || lessDay || lessMonth || lessYear;
220
- }
221
-
222
- public canselDate(): void {
223
- this.emitDate.emit();
224
- this.dateValue = undefined;
225
- this.showCalendar = false;
226
- }
227
- }
@@ -1,23 +0,0 @@
1
- <div
2
- class="lib-card-wrapper"
3
- [class.border-r-bottom]="borderRadius === 'bottom'"
4
- [class.border-r-none]="borderRadius === 'none'"
5
- [class.border-r-top]="borderRadius === 'top'"
6
- [class.giant-card]="type === 'giant'"
7
- [class.small-card]="type === 'small'"
8
- [class.with-footer]="!!footerBtn">
9
- <dd-lib-skeleton
10
- [deepParent]="parentLvlForSkeleton"
11
- [skeleton]="skeleton"
12
- [plugs]="plugs"
13
- [sHeight]="sHeight">
14
- <div class="lib-card">
15
- <ng-content></ng-content>
16
- </div>
17
- </dd-lib-skeleton>
18
- </div>
19
- @if (footerBtn) {
20
- <div (click)="cardBtnEvent.emit(); cdr.detectChanges()" class="lib-card-footer-btn">
21
- {{ footerBtn }}
22
- </div>
23
- }
@@ -1,64 +0,0 @@
1
- @import '../../../assets/scss/mixins';
2
- @import '../../../assets/scss/vars';
3
-
4
- :host {
5
- display: block;
6
- }
7
- .lib-card-wrapper {
8
- overflow: hidden;
9
- border-radius: 24px;
10
- box-shadow: var(--main-card-shadow);
11
- background-color: var(--main-card-color);
12
- min-height: 100%;
13
-
14
- &.border-r-bottom {
15
- border-radius: 0 0 24px 24px;
16
- }
17
-
18
- &.border-r-top {
19
- border-radius: 24px 24px 0 0;
20
- }
21
-
22
- &.border-r-none {
23
- border-radius: 0;
24
- }
25
-
26
- &.small-card {
27
- border-radius: 12px;
28
- }
29
-
30
- &.giant-card {
31
- .lib-card {
32
- padding: 32px;
33
-
34
- @include below($mobile) {
35
- padding: 16px;
36
- }
37
- }
38
- }
39
-
40
- &.with-footer {
41
- border-radius: 24px 24px 0 0;
42
- }
43
- }
44
-
45
- .lib-card {
46
- min-height: 100%;
47
- padding: 24px;
48
-
49
- @include below($mobile) {
50
- padding: 16px;
51
- }
52
- }
53
-
54
- .lib-card-footer-btn {
55
- border-radius: 0 0 12px 12px;
56
- font-weight: 500;
57
- background-color: var(--primary-green-color);
58
- color: var(--white-color);
59
- cursor: pointer;
60
- height: 48px;
61
- display: flex;
62
- align-items: center;
63
- justify-content: center;
64
- }
@@ -1,32 +0,0 @@
1
- import {
2
- ChangeDetectionStrategy,
3
- ChangeDetectorRef,
4
- Component,
5
- EventEmitter,
6
- Input,
7
- Output,
8
- } from '@angular/core';
9
-
10
- import { LibSkeletonComponent } from '../lib-skeleton/lib-skeleton.component';
11
-
12
- @Component({
13
- selector: 'dd-lib-card',
14
- standalone: true,
15
- imports: [LibSkeletonComponent],
16
- templateUrl: './lib-card.component.html',
17
- styleUrl: './lib-card.component.scss',
18
- changeDetection: ChangeDetectionStrategy.OnPush,
19
- })
20
- export class LibCardComponent {
21
- @Input() public type: 'giant' | 'standard' | 'small' = 'standard';
22
- @Input() public footerBtn: string | undefined;
23
- @Input() public sHeight: string | undefined;
24
- @Input() public skeleton: any;
25
- @Input() public parentLvlForSkeleton: number | undefined;
26
- @Input() public plugs: number | undefined;
27
- @Input() public borderRadius: 'all' | 'top' | 'bottom' | 'none' = 'all';
28
-
29
- @Output() public cardBtnEvent = new EventEmitter<undefined>();
30
-
31
- constructor(public cdr: ChangeDetectorRef) {}
32
- }
@@ -1,15 +0,0 @@
1
- <input
2
- (change)="onChecked($event.target)"
3
- [checked]="checked"
4
- [class.disabled]="disabled"
5
- [class.invalid]="invalid"
6
- [disabled]="disabled"
7
- [id]="checkboxId"
8
- [required]="required"
9
- [tabindex]="disabled ? -1 : null"
10
- class="check-input"
11
- type="checkbox" />
12
- <label [for]="checkboxId" class="{{ customClass }} check">
13
- <span [class.focused]="focused" class="checkbox"></span>
14
- <ng-content></ng-content>
15
- </label>
@@ -1,80 +0,0 @@
1
-
2
- :host {
3
- outline: none;
4
- position: relative;
5
- }
6
-
7
- .check {
8
- display: flex;
9
- position: relative;
10
- font-size: 16px;
11
- width: fit-content;
12
- cursor: pointer;
13
- align-items: center;
14
- }
15
-
16
- .check-input {
17
- appearance: none;
18
- position: absolute;
19
- opacity: 0;
20
-
21
- width: 20px;
22
- height: 20px;
23
-
24
- &:hover + label .checkbox {
25
- border-color: var(--light-black-color);
26
- }
27
-
28
- &:hover:checked + label .checkbox {
29
- background: var(--cb-hover-bgc);
30
- border: none;
31
- }
32
-
33
- &:disabled + label,
34
- &:disabled + label .checkbox,
35
- &:hover:disabled + label,
36
- &:hover:disabled + label .checkbox {
37
- cursor: default;
38
- pointer-events: none;
39
- border-color: var(--cb-init-border);
40
- }
41
-
42
- &:disabled:checked + label .checkbox {
43
- cursor: default;
44
- pointer-events: none;
45
- border-color: var(--cb-init-border);
46
- background-color: var(--cb-init-border);
47
- font-weight: bold;
48
- }
49
-
50
- &:checked + label {
51
- font-weight: bold;
52
- }
53
-
54
- &:checked + label .checkbox {
55
- background: var(--cb-checked-bgc);
56
- border: none;
57
- position: relative;
58
-
59
- &:before {
60
- content: '';
61
- background: url(../../../assets/images/svg/check-white.svg) no-repeat;
62
- height: 10px;
63
- position: absolute;
64
- width: 13px;
65
- top: 5px;
66
- left: 4px;
67
- }
68
- }
69
- }
70
-
71
- .checkbox {
72
- min-width: 20px;
73
- min-height: 20px;
74
- padding: 3px;
75
- background-color: var(--white-color);
76
- border-radius: 5px;
77
- border: 1px solid var(--cb-init-border);
78
- cursor: pointer;
79
- margin-right: 12px;
80
- }
@@ -1,67 +0,0 @@
1
- import {
2
- ChangeDetectionStrategy,
3
- Component,
4
- EventEmitter,
5
- forwardRef,
6
- Input,
7
- OnInit,
8
- Output,
9
- } from '@angular/core';
10
-
11
- import { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
12
-
13
- @Component({
14
- selector: 'dd-lib-checkbox',
15
- standalone: true,
16
- imports: [FormsModule],
17
- templateUrl: './lib-checkbox.component.html',
18
- styleUrl: './lib-checkbox.component.scss',
19
- changeDetection: ChangeDetectionStrategy.OnPush,
20
- providers: [
21
- {
22
- provide: NG_VALUE_ACCESSOR,
23
- useExisting: forwardRef(() => LibCheckboxComponent),
24
- multi: true,
25
- },
26
- ],
27
- })
28
- export class LibCheckboxComponent implements OnInit, ControlValueAccessor {
29
- public static idCounter = 1;
30
-
31
- @Input() public checkboxId: string | undefined;
32
- @Input() public required = false;
33
- @Input() public disabled = false;
34
- @Input() public checked = false;
35
- @Input() public customClass: string | undefined;
36
- @Input() public invalid = false;
37
-
38
- @Output() public checkEvent = new EventEmitter<boolean>();
39
- public focused: boolean | undefined;
40
- private onTouchedCallback: (() => void) | undefined;
41
-
42
- public ngOnInit(): void {
43
- if (!this.checkboxId) {
44
- this.checkboxId = 'dd-checkbox-' + LibCheckboxComponent.idCounter++;
45
- }
46
- }
47
-
48
- public registerOnChange(fn: any): void {
49
- this.propagateChange = fn;
50
- }
51
-
52
- public registerOnTouched(fn: any): void {
53
- this.onTouchedCallback = fn;
54
- }
55
-
56
- public onChecked(target: EventTarget | null): void {
57
- this.checked = (target as HTMLInputElement)?.checked;
58
- this.propagateChange(this.checked);
59
- this.checkEvent.emit(this.checked);
60
- }
61
-
62
- public writeValue(value: boolean): void {
63
- this.checked = value;
64
- }
65
-
66
- private propagateChange(value: boolean) {}
67
- }
@@ -1,32 +0,0 @@
1
- <div class="lib-comment-textarea">
2
- <textarea
3
- [(ngModel)]="value"
4
- [disabled]="disabled"
5
- [placeholder]="placeholder"
6
- [readOnly]="readOnly"
7
- ddResizeTextarea
8
- type="text"></textarea>
9
- <dd-lib-button [disabled]="disabled" [noPadding]="true" height="48px" width="48px">
10
- <svg fill="none" height="28" viewBox="0 0 24 22" width="24" xmlns="http://www.w3.org/2000/svg">
11
- <g clip-path="url(#clip0_429_4922)">
12
- <path
13
- [attr.stroke]="disabled ? '#8e9cbe' : 'white'"
14
- d="M10 14L21 3"
15
- stroke-linecap="round"
16
- stroke-linejoin="round"
17
- stroke-width="1.7" />
18
- <path
19
- [attr.stroke]="disabled ? '#8e9cbe' : 'white'"
20
- d="M21.0001 3L14.5001 21C14.4562 21.0957 14.3858 21.1769 14.2971 21.2338C14.2085 21.2906 14.1054 21.3209 14.0001 21.3209C13.8948 21.3209 13.7917 21.2906 13.703 21.2338C13.6144 21.1769 13.5439 21.0957 13.5001 21L10.0001 14L3.00007 10.5C2.90433 10.4561 2.8232 10.3857 2.76632 10.2971C2.70944 10.2084 2.6792 10.1053 2.6792 10C2.6792 9.89468 2.70944 9.79158 2.76632 9.70295C2.8232 9.61431 2.90433 9.54387 3.00007 9.5L21.0001 3Z"
21
- stroke-linecap="round"
22
- stroke-linejoin="round"
23
- stroke-width="1.7" />
24
- </g>
25
- <defs>
26
- <clipPath id="clip0_429_4922">
27
- <rect [attr.fill]="disabled ? '#8e9cbe' : 'white'" height="28" width="24" />
28
- </clipPath>
29
- </defs>
30
- </svg>
31
- </dd-lib-button>
32
- </div>