otimus-library 0.2.48 → 0.2.50

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 (201) hide show
  1. package/esm2022/lib/components/oc-accordion/oc-accordion.component.mjs +48 -0
  2. package/esm2022/lib/components/oc-accordion-item/oc-accordion-item.component.mjs +35 -0
  3. package/esm2022/lib/components/oc-autocomplete/oc-autocomplete.component.mjs +275 -0
  4. package/esm2022/lib/components/oc-badge/oc-badge.component.mjs +30 -0
  5. package/esm2022/lib/components/oc-checkbox/oc-checkbox.component.mjs +133 -0
  6. package/esm2022/lib/components/oc-chip/oc-chip.component.mjs +45 -0
  7. package/esm2022/lib/components/oc-filter/oc-filter.component.mjs +39 -0
  8. package/esm2022/lib/components/oc-input/oc-input.component.mjs +97 -0
  9. package/esm2022/lib/components/oc-key-value/oc-key-value.component.mjs +29 -0
  10. package/esm2022/lib/components/oc-log/oc-log.component.mjs +22 -0
  11. package/esm2022/lib/components/oc-menu/oc-menu.component.mjs +81 -0
  12. package/esm2022/lib/components/oc-modal/oc-modal.component.mjs +85 -0
  13. package/esm2022/lib/components/oc-modal-footer/oc-modal-footer.component.mjs +23 -0
  14. package/esm2022/lib/components/oc-not-found/oc-not-found.component.mjs +11 -0
  15. package/esm2022/lib/components/oc-pagination/oc-pagination.component.mjs +49 -0
  16. package/esm2022/lib/components/oc-profile/oc-profile.component.mjs +38 -0
  17. package/esm2022/lib/components/oc-step/oc-step.component.mjs +49 -0
  18. package/esm2022/lib/components/oc-stepper/oc-stepper.component.mjs +90 -0
  19. package/esm2022/lib/components/oc-tab/oc-tab.component.mjs +20 -0
  20. package/esm2022/lib/components/oc-tabs/oc-tabs.component.mjs +42 -0
  21. package/esm2022/lib/components/oc-toast/oc-toast.component.mjs +17 -0
  22. package/esm2022/lib/components/oc-toggle/oc-toggle.component.mjs +34 -0
  23. package/esm2022/lib/directives/oc-tooltip/oc-tooltip.directive.mjs +117 -0
  24. package/esm2022/lib/interfaces/oc-autocomplete.mjs +2 -0
  25. package/esm2022/lib/interfaces/oc-menu.mjs +2 -0
  26. package/esm2022/lib/interfaces/oc-style-theme.mjs +2 -0
  27. package/esm2022/lib/interfaces/oc-toast.mjs +2 -0
  28. package/esm2022/lib/otimus-library.component.mjs +19 -0
  29. package/esm2022/lib/otimus-library.service.mjs +14 -0
  30. package/esm2022/lib/services/internationalization.service.mjs +68 -0
  31. package/esm2022/lib/services/oc-toast.service.mjs +81 -0
  32. package/esm2022/lib/services/style-theme.service.mjs +21 -0
  33. package/esm2022/otimus-library.mjs +5 -0
  34. package/esm2022/public-api.mjs +30 -0
  35. package/fesm2022/otimus-library.mjs +1513 -0
  36. package/fesm2022/otimus-library.mjs.map +1 -0
  37. package/index.d.ts +5 -0
  38. package/lib/components/oc-accordion/oc-accordion.component.d.ts +18 -0
  39. package/lib/components/oc-accordion-item/oc-accordion-item.component.d.ts +12 -0
  40. package/lib/components/oc-autocomplete/oc-autocomplete.component.d.ts +68 -0
  41. package/lib/components/oc-badge/oc-badge.component.d.ts +11 -0
  42. package/lib/components/oc-checkbox/oc-checkbox.component.d.ts +35 -0
  43. package/lib/components/oc-chip/oc-chip.component.d.ts +14 -0
  44. package/lib/components/oc-filter/oc-filter.component.d.ts +17 -0
  45. package/lib/components/oc-input/oc-input.component.d.ts +31 -0
  46. package/lib/components/oc-key-value/oc-key-value.component.d.ts +14 -0
  47. package/lib/components/oc-log/oc-log.component.d.ts +7 -0
  48. package/lib/components/oc-menu/oc-menu.component.d.ts +20 -0
  49. package/lib/components/oc-modal/oc-modal.component.d.ts +30 -0
  50. package/lib/components/oc-modal-footer/oc-modal-footer.component.d.ts +8 -0
  51. package/lib/components/oc-not-found/oc-not-found.component.d.ts +5 -0
  52. package/lib/components/oc-pagination/oc-pagination.component.d.ts +14 -0
  53. package/lib/components/oc-profile/oc-profile.component.d.ts +12 -0
  54. package/lib/components/oc-step/oc-step.component.d.ts +22 -0
  55. package/lib/components/oc-stepper/oc-stepper.component.d.ts +24 -0
  56. package/lib/components/oc-tab/oc-tab.component.d.ts +8 -0
  57. package/lib/components/oc-tabs/oc-tabs.component.d.ts +18 -0
  58. package/lib/components/oc-toast/oc-toast.component.d.ts +8 -0
  59. package/lib/components/oc-toggle/oc-toggle.component.d.ts +12 -0
  60. package/lib/directives/oc-tooltip/oc-tooltip.directive.d.ts +20 -0
  61. package/lib/interfaces/oc-autocomplete.d.ts +5 -0
  62. package/lib/interfaces/oc-menu.d.ts +9 -0
  63. package/lib/interfaces/oc-style-theme.d.ts +2 -0
  64. package/lib/interfaces/oc-toast.d.ts +8 -0
  65. package/lib/otimus-library.component.d.ts +5 -0
  66. package/lib/otimus-library.service.d.ts +6 -0
  67. package/lib/services/internationalization.service.d.ts +17 -0
  68. package/lib/services/oc-toast.service.d.ts +14 -0
  69. package/lib/services/style-theme.service.d.ts +8 -0
  70. package/package.json +13 -4
  71. package/public-api.d.ts +26 -0
  72. package/ng-package.json +0 -12
  73. package/src/assets/images/loading.svg +0 -0
  74. package/src/assets/images/not-found-bg.jpg +0 -0
  75. package/src/lib/components/oc-accordion/oc-accordion.component.html +0 -3
  76. package/src/lib/components/oc-accordion/oc-accordion.component.scss +0 -4
  77. package/src/lib/components/oc-accordion/oc-accordion.component.ts +0 -44
  78. package/src/lib/components/oc-accordion-item/oc-accordion-item.component.html +0 -19
  79. package/src/lib/components/oc-accordion-item/oc-accordion-item.component.scss +0 -86
  80. package/src/lib/components/oc-accordion-item/oc-accordion-item.component.ts +0 -27
  81. package/src/lib/components/oc-accordion-item/styles/oc-accordion-item.shui-component.scss +0 -41
  82. package/src/lib/components/oc-autocomplete/oc-autocomplete.component.html +0 -66
  83. package/src/lib/components/oc-autocomplete/oc-autocomplete.component.scss +0 -157
  84. package/src/lib/components/oc-autocomplete/oc-autocomplete.component.ts +0 -277
  85. package/src/lib/components/oc-badge/oc-badge.component.html +0 -7
  86. package/src/lib/components/oc-badge/oc-badge.component.scss +0 -125
  87. package/src/lib/components/oc-badge/oc-badge.component.ts +0 -22
  88. package/src/lib/components/oc-checkbox/oc-checkbox.component.html +0 -30
  89. package/src/lib/components/oc-checkbox/oc-checkbox.component.scss +0 -103
  90. package/src/lib/components/oc-checkbox/oc-checkbox.component.ts +0 -132
  91. package/src/lib/components/oc-checkbox/styles/oc-checkbox.shui-component.scss +0 -21
  92. package/src/lib/components/oc-chip/oc-chip.component.html +0 -20
  93. package/src/lib/components/oc-chip/oc-chip.component.scss +0 -102
  94. package/src/lib/components/oc-chip/oc-chip.component.ts +0 -32
  95. package/src/lib/components/oc-filter/oc-filter.component.html +0 -22
  96. package/src/lib/components/oc-filter/oc-filter.component.scss +0 -78
  97. package/src/lib/components/oc-filter/oc-filter.component.spec.ts +0 -23
  98. package/src/lib/components/oc-filter/oc-filter.component.ts +0 -30
  99. package/src/lib/components/oc-input/oc-input.component.html +0 -21
  100. package/src/lib/components/oc-input/oc-input.component.scss +0 -3
  101. package/src/lib/components/oc-input/oc-input.component.ts +0 -100
  102. package/src/lib/components/oc-key-value/oc-key-value.component.html +0 -12
  103. package/src/lib/components/oc-key-value/oc-key-value.component.scss +0 -26
  104. package/src/lib/components/oc-key-value/oc-key-value.component.ts +0 -23
  105. package/src/lib/components/oc-key-value/styles/oc-key-value.shui-component.scss +0 -26
  106. package/src/lib/components/oc-log/oc-log.component.html +0 -18
  107. package/src/lib/components/oc-log/oc-log.component.scss +0 -61
  108. package/src/lib/components/oc-log/oc-log.component.ts +0 -15
  109. package/src/lib/components/oc-menu/oc-menu.component.html +0 -31
  110. package/src/lib/components/oc-menu/oc-menu.component.scss +0 -101
  111. package/src/lib/components/oc-menu/oc-menu.component.ts +0 -84
  112. package/src/lib/components/oc-modal/oc-modal.component.html +0 -54
  113. package/src/lib/components/oc-modal/oc-modal.component.scss +0 -204
  114. package/src/lib/components/oc-modal/oc-modal.component.ts +0 -82
  115. package/src/lib/components/oc-modal/styles/oc-modal.shui-component.scss +0 -3
  116. package/src/lib/components/oc-modal-footer/oc-modal-footer.component.html +0 -11
  117. package/src/lib/components/oc-modal-footer/oc-modal-footer.component.scss +0 -27
  118. package/src/lib/components/oc-modal-footer/oc-modal-footer.component.ts +0 -15
  119. package/src/lib/components/oc-not-found/oc-not-found.component.html +0 -14
  120. package/src/lib/components/oc-not-found/oc-not-found.component.scss +0 -153
  121. package/src/lib/components/oc-not-found/oc-not-found.component.spec.ts +0 -23
  122. package/src/lib/components/oc-not-found/oc-not-found.component.ts +0 -12
  123. package/src/lib/components/oc-pagination/oc-pagination.component.html +0 -32
  124. package/src/lib/components/oc-pagination/oc-pagination.component.scss +0 -80
  125. package/src/lib/components/oc-pagination/oc-pagination.component.ts +0 -46
  126. package/src/lib/components/oc-profile/oc-profile.component.html +0 -17
  127. package/src/lib/components/oc-profile/oc-profile.component.scss +0 -80
  128. package/src/lib/components/oc-profile/oc-profile.component.ts +0 -38
  129. package/src/lib/components/oc-step/oc-step.component.html +0 -32
  130. package/src/lib/components/oc-step/oc-step.component.scss +0 -106
  131. package/src/lib/components/oc-step/oc-step.component.ts +0 -39
  132. package/src/lib/components/oc-step/styles/oc-step.shui-component.scss +0 -52
  133. package/src/lib/components/oc-stepper/oc-stepper.component.html +0 -3
  134. package/src/lib/components/oc-stepper/oc-stepper.component.scss +0 -9
  135. package/src/lib/components/oc-stepper/oc-stepper.component.ts +0 -86
  136. package/src/lib/components/oc-tab/oc-tab.component.html +0 -3
  137. package/src/lib/components/oc-tab/oc-tab.component.scss +0 -0
  138. package/src/lib/components/oc-tab/oc-tab.component.ts +0 -15
  139. package/src/lib/components/oc-table/oc-table.component.html +0 -62
  140. package/src/lib/components/oc-table/oc-table.component.scss +0 -2
  141. package/src/lib/components/oc-table/oc-table.component.ts +0 -51
  142. package/src/lib/components/oc-tabs/oc-tabs.component.html +0 -13
  143. package/src/lib/components/oc-tabs/oc-tabs.component.scss +0 -47
  144. package/src/lib/components/oc-tabs/oc-tabs.component.ts +0 -46
  145. package/src/lib/components/oc-tabs/styles/oc-tabs.shui-component.scss +0 -25
  146. package/src/lib/components/oc-toast/oc-toast.component.html +0 -46
  147. package/src/lib/components/oc-toast/oc-toast.component.scss +0 -133
  148. package/src/lib/components/oc-toast/oc-toast.component.ts +0 -15
  149. package/src/lib/components/oc-toggle/oc-toggle.component.html +0 -4
  150. package/src/lib/components/oc-toggle/oc-toggle.component.scss +0 -73
  151. package/src/lib/components/oc-toggle/oc-toggle.component.spec.ts +0 -23
  152. package/src/lib/components/oc-toggle/oc-toggle.component.ts +0 -32
  153. package/src/lib/directives/oc-tooltip/oc-tooltip.directive.ts +0 -108
  154. package/src/lib/interfaces/internal/languages.ts +0 -16
  155. package/src/lib/interfaces/oc-autocomplete.ts +0 -6
  156. package/src/lib/interfaces/oc-menu.ts +0 -10
  157. package/src/lib/interfaces/oc-style-theme.ts +0 -3
  158. package/src/lib/interfaces/oc-table.ts +0 -12
  159. package/src/lib/interfaces/oc-toast.ts +0 -8
  160. package/src/lib/otimus-library.component.ts +0 -16
  161. package/src/lib/otimus-library.service.ts +0 -9
  162. package/src/lib/services/internationalization.service.ts +0 -73
  163. package/src/lib/services/oc-toast.service.ts +0 -107
  164. package/src/lib/services/style-theme.service.ts +0 -19
  165. package/src/public-api.ts +0 -30
  166. package/tsconfig.lib.json +0 -14
  167. package/tsconfig.lib.prod.json +0 -10
  168. package/tsconfig.spec.json +0 -14
  169. /package/{src/assets → assets}/fonts/siemens/SH-Bree-Headline-Oblique.woff +0 -0
  170. /package/{src/assets → assets}/fonts/siemens/SH-Bree-Headline-Oblique.woff2 +0 -0
  171. /package/{src/assets → assets}/fonts/siemens/SH-Bree-Headline-Regular.woff +0 -0
  172. /package/{src/assets → assets}/fonts/siemens/SH-Bree-Headline-Regular.woff2 +0 -0
  173. /package/{src/assets → assets}/fonts/siemens/SiemensSans-Black.woff +0 -0
  174. /package/{src/assets → assets}/fonts/siemens/SiemensSans-Black.woff2 +0 -0
  175. /package/{src/assets → assets}/fonts/siemens/SiemensSans-BlackItalic.woff +0 -0
  176. /package/{src/assets → assets}/fonts/siemens/SiemensSans-BlackItalic.woff2 +0 -0
  177. /package/{src/assets → assets}/fonts/siemens/SiemensSans-Bold.woff +0 -0
  178. /package/{src/assets → assets}/fonts/siemens/SiemensSans-Bold.woff2 +0 -0
  179. /package/{src/assets → assets}/fonts/siemens/SiemensSans-BoldItalic.woff +0 -0
  180. /package/{src/assets → assets}/fonts/siemens/SiemensSans-BoldItalic.woff2 +0 -0
  181. /package/{src/assets → assets}/fonts/siemens/SiemensSans-Italic.woff +0 -0
  182. /package/{src/assets → assets}/fonts/siemens/SiemensSans-Italic.woff2 +0 -0
  183. /package/{src/assets → assets}/fonts/siemens/SiemensSans-Roman.woff +0 -0
  184. /package/{src/assets → assets}/fonts/siemens/SiemensSans-Roman.woff2 +0 -0
  185. /package/{src/styles → styles}/colors.scss +0 -0
  186. /package/{src/styles → styles}/components/buttons/buttons.scss +0 -0
  187. /package/{src/styles → styles}/components/buttons/buttons.shui.scss +0 -0
  188. /package/{src/styles → styles}/components/index.scss +0 -0
  189. /package/{src/styles → styles}/components/inputs/inputs.scss +0 -0
  190. /package/{src/styles → styles}/components/inputs/inputs.shui.scss +0 -0
  191. /package/{src/styles → styles}/components/table/table.scss +0 -0
  192. /package/{src/styles → styles}/components/table/table.shui.scss +0 -0
  193. /package/{src/styles → styles}/components/tooltip.scss +0 -0
  194. /package/{src/styles → styles}/grid.scss +0 -0
  195. /package/{src/styles → styles}/patterns/shui/colors.shui.scss +0 -0
  196. /package/{src/styles → styles}/patterns/shui/fonts.shui.scss +0 -0
  197. /package/{src/styles → styles}/patterns/shui/index.shui.scss +0 -0
  198. /package/{src/styles → styles}/patterns/shui/variables.shui.scss +0 -0
  199. /package/{src/styles → styles}/states.scss +0 -0
  200. /package/{src/styles → styles}/styles.scss +0 -0
  201. /package/{src/styles → styles}/variables.scss +0 -0
@@ -1,133 +0,0 @@
1
- @use '../../../styles/variables.scss';
2
-
3
- .toast {
4
- position: fixed;
5
- bottom: 30px;
6
- right: 30px;
7
-
8
- width: 370px !important;
9
- min-height: 116px !important;
10
-
11
- display: flex;
12
- flex-direction: column;
13
- justify-content: space-between;
14
-
15
- border-radius: 17px;
16
-
17
- padding: 1rem;
18
- padding-bottom: 1.5rem;
19
-
20
- box-shadow: 8px 16px 32px 0 rgba(0, 0, 0, 0.3);
21
- background-color: variables.$color-white;
22
-
23
- z-index: 50;
24
-
25
- p {
26
- color: variables.$color-brand-dp-4;
27
- font-size: 13px;
28
- }
29
-
30
- > header {
31
- color: variables.$color-brand-p-1;
32
-
33
- display: flex;
34
- align-items: center;
35
- gap: 0.5rem;
36
-
37
- > button {
38
- position: absolute;
39
- right: 20px;
40
- border: none;
41
- background-color: transparent;
42
-
43
- color: variables.$color-gray-4;
44
-
45
- padding: 10px;
46
- padding-right: 0;
47
-
48
- cursor: pointer;
49
-
50
- transition: 0.3s ease;
51
-
52
- &:hover {
53
- color: variables.$color-error;
54
- }
55
- }
56
-
57
- > .icon {
58
- border: 4px solid variables.$color-brand-p-1;
59
- border-radius: 50%;
60
-
61
- width: 30px;
62
- height: 30px;
63
- }
64
-
65
- h4 {
66
- margin: 0;
67
- padding: 0;
68
-
69
- font-size: 20px;
70
- }
71
- }
72
- }
73
-
74
- .animation {
75
- animation: show-up 0.5s ease;
76
- }
77
-
78
- .error {
79
- > header {
80
- color: variables.$color-error;
81
-
82
- h4 {
83
- color: variables.$color-error;
84
- }
85
- }
86
- }
87
-
88
- .success {
89
- > header {
90
- color: variables.$color-success;
91
-
92
- h4 {
93
- color: variables.$color-success;
94
- }
95
- }
96
- }
97
-
98
- .loading {
99
- > header {
100
- h4 {
101
- color: variables.$color-brand-dp-5;
102
- }
103
- > img, svg {
104
- transform: rotate(45deg);
105
- }
106
- }
107
- }
108
-
109
- .close-toast {
110
- animation: close 1.1s ease;
111
- }
112
-
113
- @keyframes show-up {
114
- from {
115
- opacity: 0;
116
- transform: translateY(100vw);
117
- }
118
- to {
119
- opacity: 1;
120
- transform: translateX(0);
121
- }
122
- }
123
-
124
- @keyframes close {
125
- from {
126
- opacity: 1;
127
- transform: translateX(0);
128
- }
129
- to {
130
- opacity: 0;
131
- transform: translateX(100vw);
132
- }
133
- }
@@ -1,15 +0,0 @@
1
- import { CommonModule } from '@angular/common'
2
- import { ChangeDetectionStrategy, Component } from '@angular/core'
3
- import { OcToastService } from '../../services/oc-toast.service'
4
-
5
- @Component({
6
- selector: 'oc-toast',
7
- standalone: true,
8
- imports: [CommonModule],
9
- templateUrl: './oc-toast.component.html',
10
- styleUrl: './oc-toast.component.scss',
11
- changeDetection: ChangeDetectionStrategy.Default,
12
- })
13
- export class OcToastComponent {
14
- constructor(public toast: OcToastService) {}
15
- }
@@ -1,4 +0,0 @@
1
- <label class="switch">
2
- <input [checked]="ocChecked" (click)="toggleChecked()" type="checkbox">
3
- <span class="slider round" [ngClass]="[ocColor]"></span>
4
- </label>
@@ -1,73 +0,0 @@
1
- @use '../../../styles/variables.scss';
2
-
3
- /* The switch - the box around the slider */
4
- .switch {
5
- position: relative;
6
- display: inline-block;
7
- width: 60px;
8
- height: 33px;
9
- }
10
-
11
- /* Hide default HTML checkbox */
12
- .switch input {
13
- opacity: 0;
14
- width: 0;
15
- height: 0;
16
- }
17
-
18
- /* The slider */
19
- .slider {
20
- position: absolute;
21
- cursor: pointer;
22
- top: 0;
23
- left: 0;
24
- right: 0;
25
- bottom: 0;
26
- box-shadow: 0px 0px 20px 0px rgba(0, 221, 163, 0.17);
27
- background-color: #ccc;
28
- -webkit-transition: .4s;
29
- transition: .4s;
30
- border: 1px solid variables.$color-white;
31
- }
32
-
33
- .slider:before {
34
- position: absolute;
35
- content: "";
36
- height: 26px;
37
- width: 26px;
38
- left: 4px;
39
- bottom: 1.5px;
40
- background-color: white;
41
- -webkit-transition: .4s;
42
- transition: .4s;
43
- bottom: 2.5px;
44
- }
45
-
46
- input:checked + .slider {
47
- &.purple {
48
- background-color: variables.$color-brand-p-1;
49
- }
50
-
51
- &.green {
52
- background-color: variables.$color-brand-g-1;
53
- }
54
- }
55
-
56
- input:focus + .slider {
57
- box-shadow: 0 0 1px #2196F3;
58
- }
59
-
60
- input:checked + .slider:before {
61
- -webkit-transform: translateX(25px);
62
- -ms-transform: translateX(25px);
63
- transform: translateX(25px);
64
- }
65
-
66
- /* Rounded sliders */
67
- .slider.round {
68
- border-radius: 34px;
69
- }
70
-
71
- .slider.round:before {
72
- border-radius: 50%;
73
- }
@@ -1,23 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { OcToggleComponent } from './oc-toggle.component';
4
-
5
- describe('OcToggleComponent', () => {
6
- let component: OcToggleComponent;
7
- let fixture: ComponentFixture<OcToggleComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- imports: [OcToggleComponent]
12
- })
13
- .compileComponents();
14
-
15
- fixture = TestBed.createComponent(OcToggleComponent);
16
- component = fixture.componentInstance;
17
- fixture.detectChanges();
18
- });
19
-
20
- it('should create', () => {
21
- expect(component).toBeTruthy();
22
- });
23
- });
@@ -1,32 +0,0 @@
1
- import { CommonModule } from '@angular/common';
2
- import { Component, EventEmitter, Input, Output } from '@angular/core';
3
-
4
- @Component({
5
- selector: 'oc-toggle',
6
- standalone: true,
7
- imports: [ CommonModule ],
8
- templateUrl: './oc-toggle.component.html',
9
- styleUrl: './oc-toggle.component.scss'
10
- })
11
- export class OcToggleComponent {
12
- _ocChecked: boolean = false;
13
-
14
- @Input() set ocChecked(value: boolean) {
15
- this._ocChecked = value
16
- this.ocCheckedChange.emit(this._ocChecked)
17
- }
18
-
19
- get ocChecked() {
20
- return this._ocChecked
21
- }
22
-
23
- @Input() ocColor: 'purple' | 'green' = 'green';
24
-
25
- @Output() ocCheckedChange = new EventEmitter<boolean>();
26
-
27
- toggleChecked() {
28
- this.ocChecked = !this.ocChecked;
29
- }
30
- }
31
-
32
-
@@ -1,108 +0,0 @@
1
- import { Directive, ElementRef, HostListener, Input, Renderer2 } from '@angular/core'
2
-
3
- @Directive({
4
- selector: '[ocTooltip]',
5
- standalone: true,
6
- })
7
- export class OcTooltipDirective {
8
- constructor(
9
- private elRef: ElementRef,
10
- private renderer: Renderer2
11
- ) {}
12
-
13
- @Input() content: string = ''
14
- @Input() side: 'bottom' | 'upon' | 'left' | 'right' | 'top' | 'mouse' = 'mouse'
15
-
16
- private created: boolean = false
17
- private tooltip: HTMLElement | null = null
18
-
19
- createToolTip(): HTMLElement | null {
20
- if (this.created) {
21
- return this.tooltip!
22
- }
23
-
24
- this.tooltip = this.renderer.createElement('div')
25
- const htmlRegex = /<([a-z][a-z0-9]*)\b[^>]*>(.*?)<\/\1>/is
26
- if (htmlRegex.test(this.content)) {
27
- this.content = this.content.replace('>', ' style="margin: 0">')
28
- this.renderer.setProperty(this.tooltip, 'innerHTML', this.content)
29
- } else {
30
- const text = this.renderer.createText(this.content)
31
- this.renderer.appendChild(this.tooltip, text)
32
- this.renderer.setStyle(this.tooltip, 'color', '#7E8485')
33
- }
34
- this.renderer.addClass(this.tooltip, 'oc-tooltip')
35
- if (this.side === 'mouse') {
36
- this.renderer.addClass(this.tooltip, 'mouse-tracking')
37
- }
38
- this.renderer.setStyle(this.tooltip, 'position', 'absolute')
39
- this.renderer.setStyle(this.tooltip, 'pointer-events', 'none')
40
- this.renderer.setStyle(this.tooltip, 'z-index', '1000')
41
-
42
- document.body.appendChild(this.tooltip as any)
43
- this.created = true
44
- return this.tooltip
45
- }
46
-
47
- @HostListener('mouseover', ['$event'])
48
- onMouseOver(event: MouseEvent): void {
49
- if (!this.content) {
50
- return
51
- }
52
- this.tooltip = this.createToolTip()
53
- this.updateTooltipPosition(event)
54
- }
55
-
56
- mouseingInterval: any | null = null
57
- @HostListener('mousemove', ['$event'])
58
- onMouseMove(event: MouseEvent): void {
59
- if (this.tooltip) {
60
- if (this.side === 'mouse') {
61
- this.updateTooltipPosition(event)
62
- } else {
63
- this.positionTooltipFixed()
64
- }
65
- }
66
- }
67
-
68
- private updateTooltipPosition(event: MouseEvent): void {
69
- if (this.tooltip) {
70
- this.renderer.setStyle(this.tooltip, 'left', `${event.pageX + 12}px`)
71
- this.renderer.setStyle(this.tooltip, 'top', `${event.pageY + 12}px`)
72
- }
73
- }
74
-
75
- private positionTooltipFixed(): void {
76
- if (!this.tooltip) {
77
- return
78
- }
79
- const rect = this.elRef.nativeElement.getBoundingClientRect()
80
- const width = this.elRef.nativeElement.offsetWidth
81
- const height = this.elRef.nativeElement.offsetHeight
82
-
83
- if (this.side === 'right') {
84
- this.renderer.setStyle(this.tooltip, 'left', `${rect.right + 10}px`)
85
- this.renderer.setStyle(this.tooltip, 'top', `${rect.top + height / 2}px`)
86
- } else if (this.side === 'left') {
87
- this.renderer.setStyle(this.tooltip, 'left', `${rect.left - this.tooltip.offsetWidth - 10}px`)
88
- this.renderer.setStyle(this.tooltip, 'top', `${rect.top + height / 2}px`)
89
- } else if (this.side === 'upon' || this.side === 'top') {
90
- this.renderer.setStyle(this.tooltip, 'left', `${rect.left + width / 2}px`)
91
- this.renderer.setStyle(this.tooltip, 'top', `${rect.top - this.tooltip.offsetHeight - 10}px`)
92
- } else if (this.side === 'bottom') {
93
- this.renderer.setStyle(this.tooltip, 'left', `${rect.left + width / 2}px`)
94
- this.renderer.setStyle(this.tooltip, 'top', `${rect.bottom + 10}px`)
95
- }
96
- }
97
-
98
- @HostListener('mouseout')
99
- onMouseOut(): void {
100
- if (this.tooltip) {
101
- document.body.removeChild(this.tooltip)
102
- this.created = false
103
- this.tooltip = null
104
- }
105
-
106
- this.mouseingInterval = null
107
- }
108
- }
@@ -1,16 +0,0 @@
1
- interface LanguageType {
2
- "id"?: number,
3
- "code": string,
4
- "ptbr": string,
5
- "esch": string,
6
- "enus": string,
7
- "createdAt"?: string,
8
- "updatedAt"?: string
9
- }
10
-
11
- type AvailableLanguagesType = 'ptbr' | 'esch' | 'enus'
12
-
13
- export type {
14
- LanguageType,
15
- AvailableLanguagesType
16
- }
@@ -1,6 +0,0 @@
1
- interface OcAutoCompleteType {
2
- name: string,
3
- value?: any
4
- }
5
-
6
- export {OcAutoCompleteType}
@@ -1,10 +0,0 @@
1
- interface OcMenuType {
2
- name: string
3
- url?: string
4
- callback?: any
5
- targetBlank?: boolean
6
- icon?: string
7
- checked?: boolean
8
- }
9
-
10
- export { OcMenuType }
@@ -1,3 +0,0 @@
1
- type OcStyleThemeType = 'otimus' | 'shui' | 'semantic'
2
-
3
- export { OcStyleThemeType }
@@ -1,12 +0,0 @@
1
- export interface OcTableType {
2
- data: any
3
- id?: string | number | null
4
- selectable?: boolean
5
- actions?: OcTableActionsType
6
- }
7
-
8
- interface OcTableActionsType {
9
- edit: () => any
10
- delete: () => any
11
- print: () => any
12
- }
@@ -1,8 +0,0 @@
1
- export interface ToastType {
2
- id: number
3
- status: string
4
- message: string
5
- counter: number
6
- promiseKey?: string
7
- hasAnimation?: boolean
8
- }
@@ -1,16 +0,0 @@
1
- import { Component } from '@angular/core';
2
-
3
- @Component({
4
- selector: 'lib-otimus-library',
5
- standalone: true,
6
- imports: [],
7
- template: `
8
- <p>
9
- otimus-library works!
10
- </p>
11
- `,
12
- styles: ``
13
- })
14
- export class OtimusLibraryComponent {
15
-
16
- }
@@ -1,9 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
-
3
- @Injectable({
4
- providedIn: 'root'
5
- })
6
- export class OtimusLibraryService {
7
-
8
- constructor() { }
9
- }
@@ -1,73 +0,0 @@
1
- import { HttpClient } from '@angular/common/http'
2
- import { Injectable } from '@angular/core'
3
-
4
- @Injectable({
5
- providedIn: 'root'
6
- })
7
- export class InternationalizationService {
8
- constructor(private http: HttpClient) { }
9
- private queryLang: string | null = null
10
-
11
- getTranslation(
12
- code: string | number,
13
- params?: { [key: string]: string | number } | null
14
- ): string {
15
- code = typeof code === 'number' ? `LIB${code}` : code
16
- const translations = JSON.parse(localStorage.getItem('@oc-lib-lang_words') || '{}')
17
- let translation = translations[code] || code
18
-
19
- if (params) {
20
- Object.keys(params).forEach((key) => {
21
- translation = translation.replace(`%{${key}}`, params[key].toString())
22
- })
23
- }
24
-
25
- return translation
26
- }
27
-
28
- getTranslationsByLanguage() {
29
- const urlParams = new URLSearchParams(window.location.search)
30
- this.queryLang = urlParams.get('lang')
31
- if(!this.queryLang) return
32
- if (!this.canUpdateStoredLanguages()) return
33
-
34
- return this.http.get<Object>(`https://cms-backend.otimusclinic.com/translations/language?lang=${this.queryLang}`)
35
- .subscribe(resp => {
36
- if (!resp || !Object.keys(resp).length) return
37
- this.setLanguages(resp)
38
- this.setLanguage(this.queryLang as string)
39
- this.setUpdatedLastTime()
40
- })
41
- }
42
-
43
- canUpdateStoredLanguages(): boolean {
44
- const storedLastTime = localStorage.getItem('@oc-lib-stored_at')
45
- const storedLanguage = localStorage.getItem('language')
46
-
47
- if (!storedLastTime || !storedLanguage || !this.queryLang) return true
48
-
49
- let yesterday = new Date()
50
- yesterday.setDate(yesterday.getDate() - 1)
51
-
52
- const storedDate = new Date(storedLastTime)
53
-
54
- if (storedDate <= yesterday || (storedLanguage !== this.queryLang)) {
55
- return true
56
- }
57
-
58
- return false
59
- }
60
-
61
- setLanguage(language: string): void {
62
- localStorage.setItem('language', language)
63
- }
64
-
65
- setUpdatedLastTime(): void {
66
- const updatedLastTime = new Date().toISOString()
67
- localStorage.setItem('@oc-lib-stored_at', updatedLastTime)
68
- }
69
-
70
- setLanguages(translations: Object): void {
71
- localStorage.setItem('@oc-lib-lang_words', JSON.stringify(translations))
72
- }
73
- }
@@ -1,107 +0,0 @@
1
- import { ChangeDetectorRef, Injectable } from '@angular/core'
2
- import { ToastType } from '../interfaces/oc-toast'
3
-
4
- type ToastStatusType =
5
- | 'erro'
6
- | 'error'
7
- | 'success'
8
- | 'éxito'
9
- | 'sucesso'
10
- | 'carregando'
11
- | 'cargando'
12
- | 'loading'
13
- | 'informação'
14
- | 'información'
15
- | 'information'
16
-
17
- @Injectable({
18
- providedIn: 'root',
19
- })
20
- export class OcToastService {
21
- toastList: ToastType[] = []
22
- isRunning: boolean = false
23
- currentToast!: ToastType
24
-
25
- closeToast(id: number): void {
26
- this.toastList = this.toastList.map((to) => {
27
- if (to.id === id) {
28
- return { ...to, counter: 0 }
29
- }
30
- return to
31
- })
32
-
33
- this.currentToast = this.toastList[0]
34
- }
35
-
36
- openToast = (
37
- toastStatus: ToastStatusType,
38
- toastMessage: string,
39
- toastCounter?: number,
40
- promiseKey?: string
41
- ): void => {
42
- const toast = {
43
- id: this.toastList.length === 0 ? 1 : this.toastList[this.toastList.length - 1].id + 1,
44
- counter: toastCounter || 5,
45
- status: toastStatus,
46
- message: toastMessage,
47
- promiseKey,
48
- hasAnimation: true,
49
- }
50
-
51
- const toastExists = this.toastList.some((to) => {
52
- return to.status === toastStatus && to.message === toastMessage
53
- })
54
-
55
- if (toastExists) {
56
- return
57
- }
58
-
59
- const keyExists = this.toastList.find((to) => to.promiseKey === toast.promiseKey)
60
-
61
- if (keyExists) {
62
- this.toastList = this.toastList.map((to) => {
63
- if (to.promiseKey === promiseKey) {
64
- return { ...toast, hasAnimation: false }
65
- }
66
- return to
67
- })
68
- }
69
-
70
- this.toastList.push(toast)
71
-
72
- if (!this.isRunning) {
73
- this.renderToasts()
74
- }
75
- }
76
-
77
- renderToasts(): void {
78
- if (this.toastList.length === 0) {
79
- this.isRunning = false
80
- return
81
- }
82
-
83
- this.isRunning = true
84
- this.currentToast = this.toastList[0]
85
-
86
- const toastInterval = setInterval(() => {
87
- if (this.toastList.length === 0) {
88
- clearInterval(toastInterval)
89
- this.isRunning = false
90
- return
91
- }
92
-
93
- this.currentToast = this.toastList[0]
94
- if (this.currentToast.status !== 'carregando') {
95
- this.currentToast.counter--
96
- }
97
-
98
- if (this.currentToast.counter <= 0) {
99
- this.toastList = this.toastList.filter((to) => {
100
- return to.status !== this.currentToast.status && to.message !== this.currentToast.message
101
- })
102
- clearInterval(toastInterval)
103
- this.renderToasts()
104
- }
105
- }, 1000)
106
- }
107
- }
@@ -1,19 +0,0 @@
1
- import { Injectable } from '@angular/core'
2
- import { OcStyleThemeType } from '../interfaces/oc-style-theme'
3
-
4
- @Injectable({
5
- providedIn: 'root',
6
- })
7
- export class StyleThemeService {
8
- constructor() {}
9
-
10
- getStyleTheme(): OcStyleThemeType | undefined {
11
- const localStorageTheme = localStorage.getItem('@oc-lib-style_theme')
12
-
13
- if (!localStorageTheme || !['otimus', 'shui', 'semantic'].includes(localStorageTheme)) {
14
- return undefined
15
- }
16
-
17
- return localStorageTheme as OcStyleThemeType
18
- }
19
- }