otimus-library 0.2.45 → 0.2.47

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 (202) hide show
  1. package/README.md +26 -26
  2. package/ng-package.json +12 -0
  3. package/package.json +4 -13
  4. package/src/assets/images/loading.svg +0 -0
  5. package/src/assets/images/not-found-bg.jpg +0 -0
  6. package/src/lib/components/oc-accordion/oc-accordion.component.html +3 -0
  7. package/src/lib/components/oc-accordion/oc-accordion.component.scss +4 -0
  8. package/src/lib/components/oc-accordion/oc-accordion.component.ts +44 -0
  9. package/src/lib/components/oc-accordion-item/oc-accordion-item.component.html +19 -0
  10. package/src/lib/components/oc-accordion-item/oc-accordion-item.component.scss +86 -0
  11. package/src/lib/components/oc-accordion-item/oc-accordion-item.component.ts +27 -0
  12. package/src/lib/components/oc-accordion-item/styles/oc-accordion-item.shui-component.scss +41 -0
  13. package/src/lib/components/oc-autocomplete/oc-autocomplete.component.html +66 -0
  14. package/src/lib/components/oc-autocomplete/oc-autocomplete.component.scss +157 -0
  15. package/src/lib/components/oc-autocomplete/oc-autocomplete.component.ts +277 -0
  16. package/src/lib/components/oc-badge/oc-badge.component.html +7 -0
  17. package/src/lib/components/oc-badge/oc-badge.component.scss +125 -0
  18. package/src/lib/components/oc-badge/oc-badge.component.ts +22 -0
  19. package/src/lib/components/oc-checkbox/oc-checkbox.component.html +30 -0
  20. package/src/lib/components/oc-checkbox/oc-checkbox.component.scss +103 -0
  21. package/src/lib/components/oc-checkbox/oc-checkbox.component.ts +132 -0
  22. package/src/lib/components/oc-checkbox/styles/oc-checkbox.shui-component.scss +21 -0
  23. package/src/lib/components/oc-chip/oc-chip.component.html +20 -0
  24. package/src/lib/components/oc-chip/oc-chip.component.scss +102 -0
  25. package/src/lib/components/oc-chip/oc-chip.component.ts +32 -0
  26. package/src/lib/components/oc-filter/oc-filter.component.html +22 -0
  27. package/src/lib/components/oc-filter/oc-filter.component.scss +78 -0
  28. package/src/lib/components/oc-filter/oc-filter.component.spec.ts +23 -0
  29. package/src/lib/components/oc-filter/oc-filter.component.ts +30 -0
  30. package/src/lib/components/oc-input/oc-input.component.html +21 -0
  31. package/src/lib/components/oc-input/oc-input.component.scss +3 -0
  32. package/src/lib/components/oc-input/oc-input.component.ts +100 -0
  33. package/src/lib/components/oc-key-value/oc-key-value.component.html +12 -0
  34. package/src/lib/components/oc-key-value/oc-key-value.component.scss +26 -0
  35. package/src/lib/components/oc-key-value/oc-key-value.component.ts +23 -0
  36. package/src/lib/components/oc-key-value/styles/oc-key-value.shui-component.scss +26 -0
  37. package/src/lib/components/oc-log/oc-log.component.html +18 -0
  38. package/src/lib/components/oc-log/oc-log.component.scss +61 -0
  39. package/src/lib/components/oc-log/oc-log.component.ts +15 -0
  40. package/src/lib/components/oc-menu/oc-menu.component.html +31 -0
  41. package/src/lib/components/oc-menu/oc-menu.component.scss +101 -0
  42. package/src/lib/components/oc-menu/oc-menu.component.ts +84 -0
  43. package/src/lib/components/oc-modal/oc-modal.component.html +54 -0
  44. package/src/lib/components/oc-modal/oc-modal.component.scss +204 -0
  45. package/src/lib/components/oc-modal/oc-modal.component.ts +82 -0
  46. package/src/lib/components/oc-modal/styles/oc-modal.shui-component.scss +3 -0
  47. package/src/lib/components/oc-modal-footer/oc-modal-footer.component.html +11 -0
  48. package/src/lib/components/oc-modal-footer/oc-modal-footer.component.scss +27 -0
  49. package/src/lib/components/oc-modal-footer/oc-modal-footer.component.ts +15 -0
  50. package/src/lib/components/oc-not-found/oc-not-found.component.html +14 -0
  51. package/src/lib/components/oc-not-found/oc-not-found.component.scss +153 -0
  52. package/src/lib/components/oc-not-found/oc-not-found.component.spec.ts +23 -0
  53. package/src/lib/components/oc-not-found/oc-not-found.component.ts +12 -0
  54. package/src/lib/components/oc-pagination/oc-pagination.component.html +32 -0
  55. package/src/lib/components/oc-pagination/oc-pagination.component.scss +80 -0
  56. package/src/lib/components/oc-pagination/oc-pagination.component.ts +46 -0
  57. package/src/lib/components/oc-profile/oc-profile.component.html +17 -0
  58. package/src/lib/components/oc-profile/oc-profile.component.scss +80 -0
  59. package/src/lib/components/oc-profile/oc-profile.component.ts +38 -0
  60. package/src/lib/components/oc-step/oc-step.component.html +32 -0
  61. package/src/lib/components/oc-step/oc-step.component.scss +106 -0
  62. package/src/lib/components/oc-step/oc-step.component.ts +39 -0
  63. package/src/lib/components/oc-step/styles/oc-step.shui-component.scss +52 -0
  64. package/src/lib/components/oc-stepper/oc-stepper.component.html +3 -0
  65. package/src/lib/components/oc-stepper/oc-stepper.component.scss +9 -0
  66. package/src/lib/components/oc-stepper/oc-stepper.component.ts +86 -0
  67. package/src/lib/components/oc-tab/oc-tab.component.html +3 -0
  68. package/src/lib/components/oc-tab/oc-tab.component.scss +0 -0
  69. package/src/lib/components/oc-tab/oc-tab.component.ts +15 -0
  70. package/src/lib/components/oc-table/oc-table.component.html +62 -0
  71. package/src/lib/components/oc-table/oc-table.component.scss +2 -0
  72. package/src/lib/components/oc-table/oc-table.component.ts +51 -0
  73. package/src/lib/components/oc-tabs/oc-tabs.component.html +13 -0
  74. package/src/lib/components/oc-tabs/oc-tabs.component.scss +47 -0
  75. package/src/lib/components/oc-tabs/oc-tabs.component.ts +46 -0
  76. package/src/lib/components/oc-tabs/styles/oc-tabs.shui-component.scss +25 -0
  77. package/src/lib/components/oc-toast/oc-toast.component.html +46 -0
  78. package/src/lib/components/oc-toast/oc-toast.component.scss +133 -0
  79. package/src/lib/components/oc-toast/oc-toast.component.ts +15 -0
  80. package/src/lib/components/oc-toggle/oc-toggle.component.html +4 -0
  81. package/src/lib/components/oc-toggle/oc-toggle.component.scss +73 -0
  82. package/src/lib/components/oc-toggle/oc-toggle.component.spec.ts +23 -0
  83. package/src/lib/components/oc-toggle/oc-toggle.component.ts +32 -0
  84. package/src/lib/directives/oc-tooltip/oc-tooltip.directive.ts +108 -0
  85. package/src/lib/interfaces/internal/languages.ts +16 -0
  86. package/src/lib/interfaces/oc-autocomplete.ts +6 -0
  87. package/src/lib/interfaces/oc-menu.ts +10 -0
  88. package/src/lib/interfaces/oc-style-theme.ts +3 -0
  89. package/src/lib/interfaces/oc-table.ts +12 -0
  90. package/src/lib/interfaces/oc-toast.ts +8 -0
  91. package/src/lib/otimus-library.component.ts +16 -0
  92. package/src/lib/otimus-library.service.ts +9 -0
  93. package/src/lib/services/internationalization.service.ts +73 -0
  94. package/src/lib/services/oc-toast.service.ts +107 -0
  95. package/src/lib/services/style-theme.service.ts +19 -0
  96. package/src/public-api.ts +30 -0
  97. package/{styles → src/styles}/colors.scss +70 -70
  98. package/{styles → src/styles}/components/buttons/buttons.scss +225 -225
  99. package/{styles → src/styles}/components/buttons/buttons.shui.scss +61 -61
  100. package/{styles → src/styles}/components/index.scss +2 -2
  101. package/{styles → src/styles}/components/inputs/inputs.scss +249 -247
  102. package/{styles → src/styles}/components/inputs/inputs.shui.scss +212 -212
  103. package/{styles → src/styles}/components/table/table.scss +69 -69
  104. package/{styles → src/styles}/components/table/table.shui.scss +50 -50
  105. package/{styles → src/styles}/components/tooltip.scss +26 -26
  106. package/{styles → src/styles}/grid.scss +1122 -1122
  107. package/{styles → src/styles}/patterns/shui/colors.shui.scss +154 -154
  108. package/{styles → src/styles}/patterns/shui/fonts.shui.scss +65 -65
  109. package/{styles → src/styles}/patterns/shui/index.shui.scss +24 -24
  110. package/{styles → src/styles}/patterns/shui/variables.shui.scss +22 -22
  111. package/{styles → src/styles}/states.scss +5 -5
  112. package/{styles → src/styles}/styles.scss +46 -46
  113. package/{styles → src/styles}/variables.scss +47 -47
  114. package/tsconfig.lib.json +14 -0
  115. package/tsconfig.lib.prod.json +10 -0
  116. package/tsconfig.spec.json +14 -0
  117. package/esm2022/lib/components/oc-accordion/oc-accordion.component.mjs +0 -48
  118. package/esm2022/lib/components/oc-accordion-item/oc-accordion-item.component.mjs +0 -35
  119. package/esm2022/lib/components/oc-autocomplete/oc-autocomplete.component.mjs +0 -275
  120. package/esm2022/lib/components/oc-badge/oc-badge.component.mjs +0 -30
  121. package/esm2022/lib/components/oc-checkbox/oc-checkbox.component.mjs +0 -133
  122. package/esm2022/lib/components/oc-chip/oc-chip.component.mjs +0 -45
  123. package/esm2022/lib/components/oc-filter/oc-filter.component.mjs +0 -39
  124. package/esm2022/lib/components/oc-input/oc-input.component.mjs +0 -97
  125. package/esm2022/lib/components/oc-key-value/oc-key-value.component.mjs +0 -29
  126. package/esm2022/lib/components/oc-log/oc-log.component.mjs +0 -22
  127. package/esm2022/lib/components/oc-menu/oc-menu.component.mjs +0 -81
  128. package/esm2022/lib/components/oc-modal/oc-modal.component.mjs +0 -85
  129. package/esm2022/lib/components/oc-modal-footer/oc-modal-footer.component.mjs +0 -23
  130. package/esm2022/lib/components/oc-not-found/oc-not-found.component.mjs +0 -11
  131. package/esm2022/lib/components/oc-pagination/oc-pagination.component.mjs +0 -49
  132. package/esm2022/lib/components/oc-profile/oc-profile.component.mjs +0 -38
  133. package/esm2022/lib/components/oc-step/oc-step.component.mjs +0 -49
  134. package/esm2022/lib/components/oc-stepper/oc-stepper.component.mjs +0 -90
  135. package/esm2022/lib/components/oc-tab/oc-tab.component.mjs +0 -20
  136. package/esm2022/lib/components/oc-tabs/oc-tabs.component.mjs +0 -42
  137. package/esm2022/lib/components/oc-toast/oc-toast.component.mjs +0 -17
  138. package/esm2022/lib/components/oc-toggle/oc-toggle.component.mjs +0 -34
  139. package/esm2022/lib/directives/oc-tooltip/oc-tooltip.directive.mjs +0 -117
  140. package/esm2022/lib/interfaces/oc-autocomplete.mjs +0 -2
  141. package/esm2022/lib/interfaces/oc-menu.mjs +0 -2
  142. package/esm2022/lib/interfaces/oc-style-theme.mjs +0 -2
  143. package/esm2022/lib/interfaces/oc-toast.mjs +0 -2
  144. package/esm2022/lib/otimus-library.component.mjs +0 -19
  145. package/esm2022/lib/otimus-library.service.mjs +0 -14
  146. package/esm2022/lib/services/internationalization.service.mjs +0 -68
  147. package/esm2022/lib/services/oc-toast.service.mjs +0 -81
  148. package/esm2022/lib/services/style-theme.service.mjs +0 -21
  149. package/esm2022/otimus-library.mjs +0 -5
  150. package/esm2022/public-api.mjs +0 -30
  151. package/fesm2022/otimus-library.mjs +0 -1513
  152. package/fesm2022/otimus-library.mjs.map +0 -1
  153. package/index.d.ts +0 -5
  154. package/lib/components/oc-accordion/oc-accordion.component.d.ts +0 -18
  155. package/lib/components/oc-accordion-item/oc-accordion-item.component.d.ts +0 -12
  156. package/lib/components/oc-autocomplete/oc-autocomplete.component.d.ts +0 -68
  157. package/lib/components/oc-badge/oc-badge.component.d.ts +0 -11
  158. package/lib/components/oc-checkbox/oc-checkbox.component.d.ts +0 -35
  159. package/lib/components/oc-chip/oc-chip.component.d.ts +0 -14
  160. package/lib/components/oc-filter/oc-filter.component.d.ts +0 -17
  161. package/lib/components/oc-input/oc-input.component.d.ts +0 -31
  162. package/lib/components/oc-key-value/oc-key-value.component.d.ts +0 -14
  163. package/lib/components/oc-log/oc-log.component.d.ts +0 -7
  164. package/lib/components/oc-menu/oc-menu.component.d.ts +0 -20
  165. package/lib/components/oc-modal/oc-modal.component.d.ts +0 -30
  166. package/lib/components/oc-modal-footer/oc-modal-footer.component.d.ts +0 -8
  167. package/lib/components/oc-not-found/oc-not-found.component.d.ts +0 -5
  168. package/lib/components/oc-pagination/oc-pagination.component.d.ts +0 -14
  169. package/lib/components/oc-profile/oc-profile.component.d.ts +0 -12
  170. package/lib/components/oc-step/oc-step.component.d.ts +0 -22
  171. package/lib/components/oc-stepper/oc-stepper.component.d.ts +0 -24
  172. package/lib/components/oc-tab/oc-tab.component.d.ts +0 -8
  173. package/lib/components/oc-tabs/oc-tabs.component.d.ts +0 -18
  174. package/lib/components/oc-toast/oc-toast.component.d.ts +0 -8
  175. package/lib/components/oc-toggle/oc-toggle.component.d.ts +0 -12
  176. package/lib/directives/oc-tooltip/oc-tooltip.directive.d.ts +0 -20
  177. package/lib/interfaces/oc-autocomplete.d.ts +0 -5
  178. package/lib/interfaces/oc-menu.d.ts +0 -9
  179. package/lib/interfaces/oc-style-theme.d.ts +0 -2
  180. package/lib/interfaces/oc-toast.d.ts +0 -8
  181. package/lib/otimus-library.component.d.ts +0 -5
  182. package/lib/otimus-library.service.d.ts +0 -6
  183. package/lib/services/internationalization.service.d.ts +0 -17
  184. package/lib/services/oc-toast.service.d.ts +0 -14
  185. package/lib/services/style-theme.service.d.ts +0 -8
  186. package/public-api.d.ts +0 -26
  187. /package/{assets → src/assets}/fonts/siemens/SH-Bree-Headline-Oblique.woff +0 -0
  188. /package/{assets → src/assets}/fonts/siemens/SH-Bree-Headline-Oblique.woff2 +0 -0
  189. /package/{assets → src/assets}/fonts/siemens/SH-Bree-Headline-Regular.woff +0 -0
  190. /package/{assets → src/assets}/fonts/siemens/SH-Bree-Headline-Regular.woff2 +0 -0
  191. /package/{assets → src/assets}/fonts/siemens/SiemensSans-Black.woff +0 -0
  192. /package/{assets → src/assets}/fonts/siemens/SiemensSans-Black.woff2 +0 -0
  193. /package/{assets → src/assets}/fonts/siemens/SiemensSans-BlackItalic.woff +0 -0
  194. /package/{assets → src/assets}/fonts/siemens/SiemensSans-BlackItalic.woff2 +0 -0
  195. /package/{assets → src/assets}/fonts/siemens/SiemensSans-Bold.woff +0 -0
  196. /package/{assets → src/assets}/fonts/siemens/SiemensSans-Bold.woff2 +0 -0
  197. /package/{assets → src/assets}/fonts/siemens/SiemensSans-BoldItalic.woff +0 -0
  198. /package/{assets → src/assets}/fonts/siemens/SiemensSans-BoldItalic.woff2 +0 -0
  199. /package/{assets → src/assets}/fonts/siemens/SiemensSans-Italic.woff +0 -0
  200. /package/{assets → src/assets}/fonts/siemens/SiemensSans-Italic.woff2 +0 -0
  201. /package/{assets → src/assets}/fonts/siemens/SiemensSans-Roman.woff +0 -0
  202. /package/{assets → src/assets}/fonts/siemens/SiemensSans-Roman.woff2 +0 -0
@@ -0,0 +1,52 @@
1
+ @use '../../../../styles/variables.scss';
2
+
3
+ .shui-step {
4
+ .step-number {
5
+ border-radius: 100% !important;
6
+
7
+ background-color: rgba(variables.$color-shui-ui-8, 0.1) !important;
8
+
9
+ span {
10
+ color: variables.$color-shui-ui-8 !important;
11
+ }
12
+
13
+ border: 5px solid white;
14
+
15
+ box-shadow: none !important;
16
+ span {
17
+ font-size: 2rem;
18
+ }
19
+ }
20
+
21
+ &:hover {
22
+ background-color: rgba(variables.$color-shui-base-2, 0.4);
23
+
24
+ .step-number {
25
+ border: 5px solid variables.$color-shui-base-2;
26
+ }
27
+ }
28
+
29
+ .oc-content {
30
+ &.oc-left-border {
31
+ border-left: 5px solid variables.$color-shui-base-1 !important;
32
+ }
33
+ &.expanded, &.oc-prev-selected-p, &.oc-prev-selected-g {
34
+ border-left: 5px solid rgba(variables.$color-shui-ui-8, 0.7) !important;
35
+ }
36
+ }
37
+
38
+ .oc-purple,.oc-green, .oc-selected-g, .oc-selected-p {
39
+ background-color: variables.$color-shui-ui-8 !important;
40
+ span {
41
+ color: variables.$color-shui-base-1 !important;
42
+ }
43
+ }
44
+
45
+ h2 {
46
+ color: variables.$color-shui-ui-8;
47
+ font-weight: 500;
48
+ }
49
+ .oc-selected-p-title {
50
+ color: variables.$color-shui-ui-8 !important;
51
+ }
52
+ }
@@ -0,0 +1,3 @@
1
+ <div class="oc-stepper">
2
+ <ng-content></ng-content>
3
+ </div>
@@ -0,0 +1,9 @@
1
+ .oc-stepper{
2
+ display: flex;
3
+ flex-direction: column;
4
+ width: 100%;
5
+
6
+ > * {
7
+ width: 100% !important;
8
+ }
9
+ }
@@ -0,0 +1,86 @@
1
+ import { AfterViewInit, Component, ContentChildren, QueryList, Input } from '@angular/core'
2
+ import { OcStepComponent } from '../oc-step/oc-step.component'
3
+ import { OcStyleThemeType } from '../../interfaces/oc-style-theme'
4
+ import { StyleThemeService } from '../../services/style-theme.service'
5
+
6
+ @Component({
7
+ selector: 'oc-stepper',
8
+ standalone: true,
9
+ imports: [],
10
+ templateUrl: './oc-stepper.component.html',
11
+ styleUrl: './oc-stepper.component.scss',
12
+ })
13
+ export class OcStepperComponent implements AfterViewInit {
14
+ constructor(private styleThemeService: StyleThemeService) {}
15
+ @ContentChildren(OcStepComponent) ocSteps!: QueryList<OcStepComponent>
16
+ @Input() ocAllowNavigation: boolean = false
17
+ @Input() ocColor: 'purple' | 'green' = 'purple'
18
+ @Input() ocCurrentIndex: number = 0
19
+ @Input() ocSaveCompletedSteps: boolean = true
20
+ @Input() ocStyle: OcStyleThemeType = 'otimus'
21
+
22
+ private completedSteps: number[] = []
23
+
24
+ ngAfterViewInit(): void {
25
+ this.ocStyle = this.styleThemeService.getStyleTheme() || this.ocStyle
26
+ this.setStepsValues()
27
+ this.selectStep(this.ocCurrentIndex)
28
+ this.setCompletedSteps()
29
+ }
30
+
31
+ private setCompletedSteps(): void {
32
+ if (!this.ocSaveCompletedSteps) {
33
+ return
34
+ }
35
+ for (let i = 0; i <= this.ocCurrentIndex; i++) {
36
+ this.completedSteps.push(i)
37
+ }
38
+ }
39
+
40
+ setStepsValues(): void {
41
+ this.ocSteps.forEach((step, i) => {
42
+ step.stepIndex = i
43
+ step.ocColor = this.ocColor
44
+ step.lastIndex = this.ocSteps.length - 1
45
+ step.ocStyle = this.ocStyle
46
+
47
+ step.selectStep = (index: number) => this.selectStep(index)
48
+ })
49
+ }
50
+
51
+ selectStep(index: number): void {
52
+ this.ocSteps.forEach((step, i) => {
53
+ step.ocStyle = this.ocStyle
54
+
55
+ if (this.completedSteps.includes(i)) {
56
+ step.ocCompleted = true
57
+ }
58
+ if (i !== index) {
59
+ step.ocIsActive = false
60
+ step.selectedIndex = index
61
+ return
62
+ }
63
+ step.ocIsActive = true
64
+ this.ocCurrentIndex = index
65
+ step.selectedIndex = this.ocCurrentIndex
66
+ this.setCompletedSteps()
67
+ })
68
+ return
69
+ }
70
+
71
+ nextStep(event: Event): void {
72
+ event.stopPropagation()
73
+ if (this.ocCurrentIndex === this.ocSteps.length - 1) {
74
+ return
75
+ }
76
+ this.selectStep(this.ocCurrentIndex + 1)
77
+ }
78
+
79
+ previousStep(event: Event): void {
80
+ event.stopPropagation()
81
+ if (!this.ocCurrentIndex) {
82
+ return
83
+ }
84
+ this.selectStep(this.ocCurrentIndex - 1)
85
+ }
86
+ }
@@ -0,0 +1,3 @@
1
+ @if (ocIsActive) {
2
+ <ng-content></ng-content>
3
+ }
@@ -0,0 +1,15 @@
1
+ import { Component, Input } from '@angular/core'
2
+
3
+ @Component({
4
+ selector: 'oc-tab',
5
+ standalone: true,
6
+ imports: [],
7
+ templateUrl: './oc-tab.component.html',
8
+ styleUrl: './oc-tab.component.scss',
9
+ })
10
+ export class OcTabComponent {
11
+ @Input() ocTitle: string = ''
12
+ @Input() ocIsActive: boolean = false
13
+
14
+ tabIndex: number = 0
15
+ }
@@ -0,0 +1,62 @@
1
+ <table class="oc table" cdk-table [dataSource]="ocData">
2
+
3
+ <ng-container *ngFor="let column of columns; let i = index" [cdkColumnDef]="column">
4
+ <!-- Table Columns -->
5
+ <th cdk-header-cell *cdkHeaderCellDef>
6
+ @if(!column.includes('oc ')) {
7
+ {{column}}
8
+ } @else {
9
+ @if (ocSelect && i === 0) {
10
+ <oc-checkbox ocBorderColor="gray" />
11
+ }
12
+ }
13
+ </th>
14
+
15
+ <td cdk-cell *cdkCellDef="let row" [ngStyle]="{
16
+ 'width': (
17
+ column === 'oc select' ? '20px' :
18
+ row[keys[i]]?.width || 'inherit'
19
+ )
20
+ }">
21
+
22
+ @if (!column.includes('oc ')) {
23
+ @if (isObject(row[keys[i]])) {
24
+ @if (!row[keys[i]].component) {
25
+ {{row[keys[i]].value}}
26
+ } @else {
27
+
28
+ @if(row[keys[i]].component.name === 'oc-chip') {
29
+ <oc-chip [ocType]="row[keys[i]].component.ocType" [ocBg]="row[keys[i]].component.ocBg">
30
+ {{row[keys[i]].value}}
31
+ </oc-chip>
32
+ }
33
+ }
34
+ } @else {
35
+ {{row[keys[i]] || ''}}
36
+ }
37
+ } @else {
38
+
39
+ @if(column === 'oc select') {
40
+ <oc-checkbox ocBorderColor="gray"></oc-checkbox>
41
+ }@else if (column === 'oc actions') {
42
+ <div class="button-row">
43
+ @for (action of row.oc_actions; track $index) {
44
+ <button class="oc button icon tiny gray-1" (click)="action.callback()">
45
+ <span class="material-symbols-outlined oc color" [ngClass]="{
46
+ error: action.icon === 'delete'
47
+ }">{{action.icon}}</span>
48
+ </button>
49
+ }
50
+ </div>
51
+ }
52
+ }
53
+ </td>
54
+ </ng-container>
55
+
56
+ <tr cdk-header-row *cdkHeaderRowDef="columns"></tr>
57
+ <tr cdk-row *cdkRowDef="let row; columns: columns"></tr>
58
+ </table>
59
+
60
+ @if (ocPage) {
61
+ <oc-pagination [ocPage]="ocPage" [ocMaxPage]="ocMaxPage" (ocGetPage)="ocGetPage.emit()" />
62
+ }
@@ -0,0 +1,2 @@
1
+ @use '../../../styles/variables.scss';
2
+ @import '../../../styles/components/table/table.scss';
@@ -0,0 +1,51 @@
1
+ import { Component, EventEmitter, Input, OnInit, Output, ViewEncapsulation } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import {CdkTableModule} from '@angular/cdk/table'
4
+ import { OcCheckboxComponent, OcChipComponent, OcPaginationComponent } from 'otimus-library';
5
+
6
+
7
+ @Component({
8
+ selector: 'oc-table',
9
+ standalone: true,
10
+ imports: [CommonModule, CdkTableModule, OcCheckboxComponent, OcPaginationComponent, OcChipComponent],
11
+ templateUrl: './oc-table.component.html',
12
+ styleUrls: ['./oc-table.component.scss'],
13
+ encapsulation: ViewEncapsulation.None
14
+ })
15
+ export class OcTableComponent implements OnInit {
16
+ @Input() ocData: any[] = []
17
+
18
+ // Pagination attributes
19
+ @Input() ocPage: number = 0
20
+ @Input() ocMaxPage: number = 0
21
+ @Input() ocPerPage: number = 0
22
+ @Output() ocGetPage = new EventEmitter()
23
+
24
+ @Output() ocSelect = new EventEmitter()
25
+
26
+ columns: string[] = []
27
+ selectable: boolean = false
28
+ keys: string[] = []
29
+
30
+ innerComponents = ['oc-chip']
31
+
32
+ ngOnInit(): void {
33
+ if(!this.ocData.length) return
34
+ this.keys = Object.keys(this.ocData[0])
35
+
36
+ this.columns = Object.keys(this.ocData[0]).map(col => {
37
+ return col.split('_').join(' ').split('-').join(' ')
38
+ })
39
+
40
+ this.isAllSelected()
41
+ }
42
+
43
+ isAllSelected () {
44
+ this.selectable = this.ocData.every(row => row.selectable)
45
+ }
46
+
47
+ protected isObject (column: any) {
48
+ if(!column) return false
49
+ return !!Object.keys(column).length
50
+ }
51
+ }
@@ -0,0 +1,13 @@
1
+ <div class="oc-tabs" [ngClass]="{
2
+ shui: ocStyle === 'shui'
3
+ }">
4
+ <div class="row">
5
+ @for(tab of ocTabs; track $index) {
6
+ <button [ngClass]="{
7
+ 'oc-selected': tab.tabIndex === activeTabIndex
8
+ }" class="oc-tab" (click)="selectTab(tab.tabIndex);
9
+ handleTabClick()" type="button">{{tab.ocTitle}}</button>
10
+ }
11
+ </div>
12
+ <ng-content></ng-content>
13
+ </div>
@@ -0,0 +1,47 @@
1
+ @use '../../../styles/variables.scss';
2
+
3
+ .oc-tabs .row {
4
+ display: flex;
5
+ gap: 1px;
6
+ }
7
+
8
+ .oc-tab {
9
+ border: none;
10
+ padding: 0.75rem 1.3rem;
11
+ cursor: pointer;
12
+
13
+ border-radius: 8px 8px 0 0;
14
+
15
+ background-color: transparent;
16
+ border-bottom: 2px solid variables.$color-gray-5;
17
+
18
+ transition: 0.15s ease;
19
+
20
+ color: variables.$color-gray-2;
21
+
22
+ &:hover {
23
+ background-color: variables.$color-gray-6;
24
+ }
25
+
26
+ &.oc-selected {
27
+ border-bottom: 2px solid variables.$color-brand-p-1;
28
+ background-color: variables.$color-gray-6;
29
+ color: variables.$color-brand-p-1;
30
+ }
31
+ }
32
+
33
+ .row {
34
+ max-width: 100%;
35
+ transform: rotateX(180deg);
36
+ overflow-x: auto;
37
+ .oc-tab {
38
+ transform: rotateX(180deg);
39
+ }
40
+
41
+ }
42
+ ::-webkit-scrollbar {
43
+ height: 3px;
44
+ }
45
+
46
+
47
+ @import './styles/oc-tabs.shui-component.scss';
@@ -0,0 +1,46 @@
1
+ import {
2
+ Component,
3
+ ContentChildren,
4
+ QueryList,
5
+ AfterContentInit,
6
+ EventEmitter,
7
+ Output,
8
+ Input,
9
+ } from '@angular/core'
10
+ import { OcTabComponent } from '../oc-tab/oc-tab.component'
11
+ import { CommonModule } from '@angular/common'
12
+ import { StyleThemeService } from '../../services/style-theme.service'
13
+ import { OcStyleThemeType } from '../../interfaces/oc-style-theme'
14
+
15
+ @Component({
16
+ selector: 'oc-tabs',
17
+ standalone: true,
18
+ imports: [CommonModule],
19
+ templateUrl: './oc-tabs.component.html',
20
+ styleUrl: './oc-tabs.component.scss',
21
+ })
22
+ export class OcTabsComponent implements AfterContentInit {
23
+ constructor(private styleThemeService: StyleThemeService) {}
24
+ @ContentChildren(OcTabComponent) ocTabs!: QueryList<OcTabComponent>
25
+ @Input() ocStyle: OcStyleThemeType = 'otimus'
26
+ @Output() ocClick = new EventEmitter<void>()
27
+
28
+ activeTabIndex: number = 0
29
+
30
+ ngAfterContentInit(): void {
31
+ this.ocStyle = this.styleThemeService.getStyleTheme() || this.ocStyle
32
+ this.selectTab(0)
33
+ }
34
+
35
+ selectTab(index: number): void {
36
+ this.ocTabs.toArray().forEach((tab, i) => {
37
+ tab.tabIndex = i
38
+ tab.ocIsActive = i === index
39
+ })
40
+ this.activeTabIndex = index
41
+ }
42
+
43
+ handleTabClick(): void {
44
+ this.ocClick.emit()
45
+ }
46
+ }
@@ -0,0 +1,25 @@
1
+ @use '../../../../styles/variables.scss';
2
+
3
+ .oc-tabs.shui {
4
+ .row {
5
+ display: flex;
6
+ gap: 1rem;
7
+ }
8
+
9
+ .oc-tab {
10
+ border-bottom: 3px solid transparent;
11
+ font-weight: 600;
12
+
13
+ color: rgba(variables.$color-shui-ui-1, 0.5);
14
+
15
+ &:hover {
16
+ background-color: transparent;
17
+ border-bottom: 3px solid variables.$color-shui-ui-8;
18
+ }
19
+ &.oc-selected {
20
+ border-bottom: 3px solid variables.$color-shui-ui-8;
21
+ background-color: transparent;
22
+ color: rgba(variables.$color-shui-ui-1, 0.5);
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,46 @@
1
+ <div
2
+ class="toast"
3
+ [ngClass]="{
4
+ 'close-toast': toast.currentToast.counter === 1,
5
+ error: ['erro', 'error'].includes(toast.currentToast.status.toLowerCase()),
6
+ success: ['sucesso', 'success', 'éxito'].includes(toast.currentToast.status.toLowerCase()),
7
+ loading: ['carregando', 'cargando', 'loading'].includes(toast.currentToast.status.toLowerCase()),
8
+ animation: toast.currentToast.hasAnimation
9
+ }"
10
+ *ngIf="toast.currentToast && toast.currentToast.counter > 0"
11
+ >
12
+ <header>
13
+ <ng-container [ngTemplateOutlet]="iconTemplate"></ng-container>
14
+ <h4 class="status">
15
+ {{ toast.currentToast.status[0].toUpperCase() + toast.currentToast.status.slice(1) }}
16
+ </h4>
17
+ <button (click)="toast.closeToast(toast.currentToast.id)">
18
+ <span class="material-symbols-outlined">close</span>
19
+ </button>
20
+ </header>
21
+ <p>{{ toast.currentToast.message }}</p>
22
+ </div>
23
+
24
+ <ng-template #iconTemplate>
25
+ <span
26
+ class="material-symbols-outlined"
27
+ *ngIf="['erro', 'error'].includes(toast.currentToast.status.toLowerCase())"
28
+ >error</span
29
+ >
30
+
31
+ <span
32
+ class="material-symbols-outlined"
33
+ *ngIf="['sucesso', 'success', 'éxito'].includes(toast.currentToast.status.toLowerCase())"
34
+ >check_circle</span
35
+ >
36
+
37
+ <span
38
+ class="material-symbols-outlined"
39
+ *ngIf="['information', 'informação', 'información'].includes(toast.currentToast.status.toLowerCase())"
40
+ >info</span
41
+ >
42
+
43
+ <svg *ngIf="['carregando', 'cargando', 'loading'].includes(toast.currentToast.status.toLowerCase())" width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><style>rect{fill:#00DDA3}.spinner_zWVm{animation:spinner_5QiW 1.2s linear infinite,spinner_PnZo 1.2s linear infinite}.spinner_gfyD{animation:spinner_5QiW 1.2s linear infinite,spinner_4j7o 1.2s linear infinite;animation-delay:.1s}.spinner_T5JJ{animation:spinner_5QiW 1.2s linear infinite,spinner_fLK4 1.2s linear infinite;animation-delay:.1s}.spinner_E3Wz{animation:spinner_5QiW 1.2s linear infinite,spinner_tDji 1.2s linear infinite;animation-delay:.2s}.spinner_g2vs{animation:spinner_5QiW 1.2s linear infinite,spinner_CMiT 1.2s linear infinite;animation-delay:.2s}.spinner_ctYB{animation:spinner_5QiW 1.2s linear infinite,spinner_cHKR 1.2s linear infinite;animation-delay:.2s}.spinner_BDNj{animation:spinner_5QiW 1.2s linear infinite,spinner_Re6e 1.2s linear infinite;animation-delay:.3s}.spinner_rCw3{animation:spinner_5QiW 1.2s linear infinite,spinner_EJmJ 1.2s linear infinite;animation-delay:.3s}.spinner_Rszm{animation:spinner_5QiW 1.2s linear infinite,spinner_YJOP 1.2s linear infinite;animation-delay:.4s}@keyframes spinner_5QiW{0%,50%{width:7.33px;height:7.33px}25%{width:1.33px;height:1.33px}}@keyframes spinner_PnZo{0%,50%{x:1px;y:1px}25%{x:4px;y:4px}}@keyframes spinner_4j7o{0%,50%{x:8.33px;y:1px}25%{x:11.33px;y:4px}}@keyframes spinner_fLK4{0%,50%{x:1px;y:8.33px}25%{x:4px;y:11.33px}}@keyframes spinner_tDji{0%,50%{x:15.66px;y:1px}25%{x:18.66px;y:4px}}@keyframes spinner_CMiT{0%,50%{x:8.33px;y:8.33px}25%{x:11.33px;y:11.33px}}@keyframes spinner_cHKR{0%,50%{x:1px;y:15.66px}25%{x:4px;y:18.66px}}@keyframes spinner_Re6e{0%,50%{x:15.66px;y:8.33px}25%{x:18.66px;y:11.33px}}@keyframes spinner_EJmJ{0%,50%{x:8.33px;y:15.66px}25%{x:11.33px;y:18.66px}}@keyframes spinner_YJOP{0%,50%{x:15.66px;y:15.66px}25%{x:18.66px;y:18.66px}}</style><rect class="spinner_zWVm" x="1" y="1" width="7.33" height="7.33"/><rect class="spinner_gfyD" x="8.33" y="1" width="7.33" height="7.33"/><rect class="spinner_T5JJ" x="1" y="8.33" width="7.33" height="7.33"/><rect class="spinner_E3Wz" x="15.66" y="1" width="7.33" height="7.33"/><rect class="spinner_g2vs" x="8.33" y="8.33" width="7.33" height="7.33"/><rect class="spinner_ctYB" x="1" y="15.66" width="7.33" height="7.33"/><rect class="spinner_BDNj" x="15.66" y="8.33" width="7.33" height="7.33"/><rect class="spinner_rCw3" x="8.33" y="15.66" width="7.33" height="7.33"/><rect class="spinner_Rszm" x="15.66" y="15.66" width="7.33" height="7.33"/></svg>
44
+
45
+
46
+ </ng-template>
@@ -0,0 +1,133 @@
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
+ }
@@ -0,0 +1,15 @@
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
+ }
@@ -0,0 +1,4 @@
1
+ <label class="switch">
2
+ <input [checked]="ocChecked" (click)="toggleChecked()" type="checkbox">
3
+ <span class="slider round" [ngClass]="[ocColor]"></span>
4
+ </label>