@enigmatry/entry-components 17.0.0-preview.5 → 17.0.0-preview.5.1

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 (136) hide show
  1. package/README.md +32 -32
  2. package/assets/nswag-templates/Client.RequestBody.liquid +95 -95
  3. package/assets/nswag-templates/Client.RequestUrl.liquid +67 -67
  4. package/assets/nswag-templates/ConvertToClass.liquid +64 -64
  5. package/assets/nswag-templates/original/Client.RequestBody.liquid +89 -89
  6. package/assets/nswag-templates/original/Client.RequestUrl.liquid +59 -59
  7. package/assets/nswag-templates/original/ConvertToClass.liquid +65 -65
  8. package/assets/nswag-templates/original/File.FormatDate.liquid +4 -4
  9. package/assets/nswag-templates/original/File.ParseDateOnly.liquid +4 -4
  10. package/button/README.md +45 -45
  11. package/date-time-picker/README.md +69 -69
  12. package/dialog/README.md +73 -73
  13. package/esm2022/button/entry-button.directive.mjs +1 -1
  14. package/esm2022/button/entry-button.module.mjs +1 -1
  15. package/esm2022/button/public-api.mjs +1 -1
  16. package/esm2022/common/common.module.mjs +1 -1
  17. package/esm2022/common/date-time/entry-date-time-adapter.mjs +1 -1
  18. package/esm2022/common/date-time/entry-date-time-formats.mjs +1 -1
  19. package/esm2022/common/date-time/entry-time-adapter.mjs +1 -1
  20. package/esm2022/common/date-time/native-time-adapter.mjs +1 -1
  21. package/esm2022/common/directives/auto-disable-button.directive.mjs +1 -1
  22. package/esm2022/common/directives/ng-control-accessor.directive.mjs +1 -1
  23. package/esm2022/common/directives/noop-control-value-accessor.mjs +1 -1
  24. package/esm2022/common/interceptors/accept-language.interceptor.mjs +1 -1
  25. package/esm2022/common/public-api.mjs +1 -1
  26. package/esm2022/date-time-picker/date-time-picker.component.mjs +3 -3
  27. package/esm2022/date-time-picker/date-time-picker.module.mjs +1 -1
  28. package/esm2022/date-time-picker/public-api.mjs +1 -1
  29. package/esm2022/date-time-picker/time-picker.component.mjs +3 -3
  30. package/esm2022/dialog/dialogs/alert/entry-alert-dialog-data.interface.mjs +1 -1
  31. package/esm2022/dialog/dialogs/alert/entry-alert-dialog.component.mjs +3 -3
  32. package/esm2022/dialog/dialogs/confirm/entry-confirm-dialog-data.interface.mjs +1 -1
  33. package/esm2022/dialog/dialogs/confirm/entry-confirm-dialog.component.mjs +3 -3
  34. package/esm2022/dialog/dialogs/entry-dialog.component.mjs +3 -3
  35. package/esm2022/dialog/dialogs/error/entry-error-dialog-data.interface.mjs +1 -1
  36. package/esm2022/dialog/dialogs/error/entry-error-dialog.component.mjs +3 -3
  37. package/esm2022/dialog/entry-dialog-buttons-alignment.type.mjs +1 -1
  38. package/esm2022/dialog/entry-dialog-config.model.mjs +1 -1
  39. package/esm2022/dialog/entry-dialog.module.mjs +1 -1
  40. package/esm2022/dialog/entry-dialog.service.mjs +1 -1
  41. package/esm2022/dialog/public-api.mjs +1 -1
  42. package/esm2022/file-input/entry-file-input.component.mjs +1 -1
  43. package/esm2022/file-input/entry-file-input.module.mjs +1 -1
  44. package/esm2022/file-input/public-api.mjs +1 -1
  45. package/esm2022/permissions/permission-type.mjs +1 -1
  46. package/esm2022/permissions/permission.directive.mjs +1 -1
  47. package/esm2022/permissions/permission.module.mjs +1 -1
  48. package/esm2022/permissions/permission.pipe.mjs +1 -1
  49. package/esm2022/permissions/public-api.mjs +1 -1
  50. package/esm2022/public-api.mjs +1 -1
  51. package/esm2022/search-filter/autocomplete/autocomplete-search-filter.component.mjs +3 -3
  52. package/esm2022/search-filter/autocomplete/autocomplete-search-filter.model.mjs +1 -1
  53. package/esm2022/search-filter/control-type.mjs +1 -1
  54. package/esm2022/search-filter/date/date-search-filter.component.mjs +3 -3
  55. package/esm2022/search-filter/date/date-search-filter.model.mjs +1 -1
  56. package/esm2022/search-filter/date-time/date-time-search-filter.component.mjs +3 -3
  57. package/esm2022/search-filter/date-time/date-time-search-filter.model.mjs +1 -1
  58. package/esm2022/search-filter/public-api.mjs +1 -1
  59. package/esm2022/search-filter/search-filter-base.model.mjs +1 -1
  60. package/esm2022/search-filter/search-filter-config.model.mjs +1 -1
  61. package/esm2022/search-filter/search-filter-params.type.mjs +1 -1
  62. package/esm2022/search-filter/select/select-search-filter.component.mjs +3 -3
  63. package/esm2022/search-filter/select/select-search-filter.model.mjs +1 -1
  64. package/esm2022/search-filter/select-option.model.mjs +1 -1
  65. package/esm2022/search-filter/text/text-search-filter.component.mjs +3 -3
  66. package/esm2022/search-filter/text/text-search-filter.model.mjs +1 -1
  67. package/esm2022/spinner/entry-spinner/spinner.component.mjs +1 -1
  68. package/esm2022/spinner/public-api.mjs +1 -1
  69. package/esm2022/spinner/spinner.module.mjs +1 -1
  70. package/esm2022/table/components/entry-cell/entry-cell.component.mjs +1 -1
  71. package/esm2022/table/components/entry-cell-context-menu/entry-cell-context-menu.component.mjs +3 -3
  72. package/esm2022/table/components/entry-cell-formatted-value/entry-cell-formatted-value.component.mjs +3 -3
  73. package/esm2022/table/components/entry-table/entry-table.component.mjs +3 -3
  74. package/esm2022/table/entry-table.module.mjs +1 -1
  75. package/esm2022/table/interfaces/entry-table-config.mjs +1 -1
  76. package/esm2022/table/interfaces/paged-query.mjs +1 -1
  77. package/esm2022/table/interfaces/pagination.mjs +1 -1
  78. package/esm2022/table/public-api.mjs +1 -1
  79. package/esm2022/validation/entry-display-control-validation.directive.mjs +1 -1
  80. package/esm2022/validation/entry-form-errors.component.mjs +13 -13
  81. package/esm2022/validation/entry-validation-config.model.mjs +1 -1
  82. package/esm2022/validation/entry-validation.mjs +1 -1
  83. package/esm2022/validation/entry-validation.module.mjs +1 -1
  84. package/esm2022/validation/public-api.mjs +1 -1
  85. package/esm2022/validation/validation-problem-details.interface.mjs +1 -1
  86. package/fesm2022/enigmatry-entry-components-button.mjs.map +1 -1
  87. package/fesm2022/enigmatry-entry-components-common.mjs.map +1 -1
  88. package/fesm2022/enigmatry-entry-components-date-time-picker.mjs +4 -4
  89. package/fesm2022/enigmatry-entry-components-date-time-picker.mjs.map +1 -1
  90. package/fesm2022/enigmatry-entry-components-dialog.mjs +8 -8
  91. package/fesm2022/enigmatry-entry-components-dialog.mjs.map +1 -1
  92. package/fesm2022/enigmatry-entry-components-file-input.mjs.map +1 -1
  93. package/fesm2022/enigmatry-entry-components-permissions.mjs.map +1 -1
  94. package/fesm2022/enigmatry-entry-components-search-filter.mjs +10 -10
  95. package/fesm2022/enigmatry-entry-components-search-filter.mjs.map +1 -1
  96. package/fesm2022/enigmatry-entry-components-spinner.mjs.map +1 -1
  97. package/fesm2022/enigmatry-entry-components-table.mjs +6 -6
  98. package/fesm2022/enigmatry-entry-components-table.mjs.map +1 -1
  99. package/fesm2022/enigmatry-entry-components-validation.mjs +12 -12
  100. package/fesm2022/enigmatry-entry-components-validation.mjs.map +1 -1
  101. package/fesm2022/enigmatry-entry-components.mjs.map +1 -1
  102. package/file-input/README.md +70 -70
  103. package/package.json +1 -1
  104. package/permissions/README.md +67 -67
  105. package/search-filter/README.md +132 -132
  106. package/styles/_generator.scss +25 -25
  107. package/styles/modules/_default-theme.scss +91 -91
  108. package/styles/modules/components/buttons/_generator.scss +10 -10
  109. package/styles/modules/components/buttons/_radio.scss +18 -18
  110. package/styles/modules/components/checkboxes/_generator.scss +31 -31
  111. package/styles/modules/components/dialogs/_generator.scss +13 -13
  112. package/styles/modules/components/forms/_generator.scss +14 -14
  113. package/styles/modules/components/inputs/_generator.scss +14 -14
  114. package/styles/modules/components/search-filter/_generator.scss +14 -14
  115. package/styles/modules/components/tables/_cells.scss +25 -25
  116. package/styles/modules/components/tables/_generator.scss +6 -6
  117. package/styles/modules/components/tables/_header.scss +10 -10
  118. package/styles/modules/components/tables/_no-result.scss +9 -9
  119. package/styles/modules/components/tables/_rows.scss +39 -39
  120. package/styles/modules/components/tables/_sorting.scss +10 -10
  121. package/styles/modules/components/tables/_table-body.scss +12 -12
  122. package/styles/modules/components/toggle/_generator.scss +47 -47
  123. package/styles/modules/typography/_fonts.scss +64 -64
  124. package/styles/modules/vendors/angular-material/_generator.scss +46 -46
  125. package/styles/modules/vendors/angular-material/_palette-generator.scss +32 -32
  126. package/styles/modules/vendors/angular-material/_typography-generator.scss +107 -107
  127. package/styles/partials/core/components/_index.scss +4 -4
  128. package/styles/partials/core/components/date-time-picker/_general.scss +64 -64
  129. package/styles/partials/core/components/dialogs/_general.scss +23 -23
  130. package/styles/partials/core/components/forms/_general.scss +21 -21
  131. package/styles/partials/core/components/search-filter/_general.scss +8 -8
  132. package/styles/partials/core/components/tables/_general.scss +17 -17
  133. package/styles/partials/generator-test.scss +41 -41
  134. package/styles/partials/theming.scss +1 -1
  135. package/table/README.md +76 -76
  136. package/validation/README.md +108 -108
@@ -1,47 +1,47 @@
1
- /* stylelint-disable max-nesting-depth */
2
- @use 'sass:map';
3
- @use 'sass:color';
4
-
5
- @function -adjust-lightness($color, $percentage: 10%) {
6
- @if not $color or $color == transparent {
7
- @return null;
8
- }
9
- $current-lightness: color.lightness($color);
10
- $adjustment: if($current-lightness > 50%, -$percentage, $percentage);
11
- @return color.adjust($color, $lightness: $adjustment);
12
- }
13
-
14
- @mixin generate-from($theme) {
15
- $enabled-states: 'enabled', 'enabled:focus:not(:active)', 'enabled:active', 'enabled:hover:not(:focus):not(:active)';
16
- $handle-selector: '.mdc-switch__handle::after';
17
-
18
- $toggle: map.get($theme, 'general', 'toggle');
19
- $handle-on-background: map.get($toggle, 'on', 'background');
20
- $handle-off-background: map.get($toggle, 'off', 'background');
21
-
22
- @if $handle-on-background and $handle-off-background {
23
- .mat-mdc-slide-toggle {
24
- @each $state in $enabled-states {
25
- .mdc-switch:#{$state} {
26
- &.mdc-switch--selected #{$handle-selector} {
27
- background-color: $handle-on-background;
28
- }
29
-
30
- &:not(.mdc-switch--selected) #{$handle-selector} {
31
- background-color: $handle-off-background;
32
- }
33
-
34
- .mdc-switch__track {
35
- &::after {
36
- background-color: -adjust-lightness($handle-on-background);
37
- }
38
-
39
- &::before {
40
- background-color: -adjust-lightness($handle-off-background);
41
- }
42
- }
43
- }
44
- }
45
- }
46
- }
47
- }
1
+ /* stylelint-disable max-nesting-depth */
2
+ @use 'sass:map';
3
+ @use 'sass:color';
4
+
5
+ @function -adjust-lightness($color, $percentage: 10%) {
6
+ @if not $color or $color == transparent {
7
+ @return null;
8
+ }
9
+ $current-lightness: color.lightness($color);
10
+ $adjustment: if($current-lightness > 50%, -$percentage, $percentage);
11
+ @return color.adjust($color, $lightness: $adjustment);
12
+ }
13
+
14
+ @mixin generate-from($theme) {
15
+ $enabled-states: 'enabled', 'enabled:focus:not(:active)', 'enabled:active', 'enabled:hover:not(:focus):not(:active)';
16
+ $handle-selector: '.mdc-switch__handle::after';
17
+
18
+ $toggle: map.get($theme, 'general', 'toggle');
19
+ $handle-on-background: map.get($toggle, 'on', 'background');
20
+ $handle-off-background: map.get($toggle, 'off', 'background');
21
+
22
+ @if $handle-on-background and $handle-off-background {
23
+ .mat-mdc-slide-toggle {
24
+ @each $state in $enabled-states {
25
+ .mdc-switch:#{$state} {
26
+ &.mdc-switch--selected #{$handle-selector} {
27
+ background-color: $handle-on-background;
28
+ }
29
+
30
+ &:not(.mdc-switch--selected) #{$handle-selector} {
31
+ background-color: $handle-off-background;
32
+ }
33
+
34
+ .mdc-switch__track {
35
+ &::after {
36
+ background-color: -adjust-lightness($handle-on-background);
37
+ }
38
+
39
+ &::before {
40
+ background-color: -adjust-lightness($handle-off-background);
41
+ }
42
+ }
43
+ }
44
+ }
45
+ }
46
+ }
47
+ }
@@ -1,64 +1,64 @@
1
- @use 'sass:map';
2
-
3
- $font-path: '/assets/fonts/';
4
- $font-sources: (
5
- (
6
- name: 'Roboto',
7
- style: normal,
8
- formats: ('woff2'),
9
- weight: 400
10
- ),
11
- (
12
- name: 'Roboto',
13
- style: bold,
14
- formats: ('woff2'),
15
- weight: 500
16
- )
17
- );
18
-
19
- // $font-sources: (
20
- // (
21
- // name: 'OpenSans',
22
- // style: normal,
23
- // formats: ('eot', 'woff', 'woff2', 'ttf')
24
- // ),
25
- // (
26
- // name: 'OpenSans',
27
- // style: bold,
28
- // formats: ('eot', 'woff', 'woff2', 'ttf')
29
- // ),
30
- // (
31
- // name: 'Montserrat',
32
- // style: bold,
33
- // formats: ('eot', 'woff', 'woff2', 'ttf')
34
- // )
35
- // );
36
-
37
- @mixin generate-default-font() {
38
- @each $font in $font-sources {
39
- $name: map.get($font, name);
40
- $style: map.get($font, style);
41
- $formats: map.get($font, formats);
42
- $weight: map.get($font, weight);
43
-
44
- @each $format in $formats {
45
- $url: '#{$font-path}#{$name}/#{$name}-#{$style}.#{$format}';
46
-
47
- @font-face {
48
- font: {
49
- style: '#{$style}';
50
-
51
- /* stylelint-disable property-no-unknown, max-nesting-depth */
52
- @if $weight {
53
- family: '#{$name}';
54
- weight: $weight;
55
- }
56
- @else {
57
- family: '#{$name}-#{$style}';
58
- }
59
- }
60
- src: url('#{$url}') format('#{$format}');
61
- }
62
- }
63
- }
64
- }
1
+ @use 'sass:map';
2
+
3
+ $font-path: '/assets/fonts/';
4
+ $font-sources: (
5
+ (
6
+ name: 'Roboto',
7
+ style: normal,
8
+ formats: ('woff2'),
9
+ weight: 400
10
+ ),
11
+ (
12
+ name: 'Roboto',
13
+ style: bold,
14
+ formats: ('woff2'),
15
+ weight: 500
16
+ )
17
+ );
18
+
19
+ // $font-sources: (
20
+ // (
21
+ // name: 'OpenSans',
22
+ // style: normal,
23
+ // formats: ('eot', 'woff', 'woff2', 'ttf')
24
+ // ),
25
+ // (
26
+ // name: 'OpenSans',
27
+ // style: bold,
28
+ // formats: ('eot', 'woff', 'woff2', 'ttf')
29
+ // ),
30
+ // (
31
+ // name: 'Montserrat',
32
+ // style: bold,
33
+ // formats: ('eot', 'woff', 'woff2', 'ttf')
34
+ // )
35
+ // );
36
+
37
+ @mixin generate-default-font() {
38
+ @each $font in $font-sources {
39
+ $name: map.get($font, name);
40
+ $style: map.get($font, style);
41
+ $formats: map.get($font, formats);
42
+ $weight: map.get($font, weight);
43
+
44
+ @each $format in $formats {
45
+ $url: '#{$font-path}#{$name}/#{$name}-#{$style}.#{$format}';
46
+
47
+ @font-face {
48
+ font: {
49
+ style: '#{$style}';
50
+
51
+ /* stylelint-disable property-no-unknown, max-nesting-depth */
52
+ @if $weight {
53
+ family: '#{$name}';
54
+ weight: $weight;
55
+ }
56
+ @else {
57
+ family: '#{$name}-#{$style}';
58
+ }
59
+ }
60
+ src: url('#{$url}') format('#{$format}');
61
+ }
62
+ }
63
+ }
64
+ }
@@ -1,46 +1,46 @@
1
- /* stylelint-disable scss/no-duplicate-dollar-variables */
2
- @use '@angular/material' as theming;
3
- @use 'palette-generator';
4
- @use 'typography-generator';
5
- @use 'sass:map';
6
- @use '../../typography/fonts';
7
-
8
- /* stylelint-disable scss/function-no-unknown */
9
- @mixin generate-from($entry-theme) {
10
- @include theming.core();
11
- $body-font: map.get($entry-theme, 'general', 'fonts', 'body', 'family');
12
-
13
- @if $body-font == '' {
14
- @include fonts.generate-default-font();
15
- }
16
-
17
- $primary-palette: theming.define-palette(-get-material-palette-for('primary', $entry-theme));
18
- $accent-palette: theming.define-palette(-get-material-palette-for('accent', $entry-theme));
19
- $warn-palette: theming.define-palette(theming.$red-palette);
20
-
21
- $typography: typography-generator.generate-from($entry-theme);
22
- @include theming.typography-hierarchy($typography);
23
-
24
- $material-theme: theming.define-light-theme((
25
- color: (
26
- primary: $primary-palette,
27
- accent: $accent-palette,
28
- warn: $warn-palette,
29
- ),
30
- typography: $typography,
31
- density: map.get($entry-theme, 'general', 'density')
32
- ));
33
-
34
- @include theming.all-component-themes($material-theme);
35
- }
36
-
37
- @function -get-material-palette-for($key, $theme) {
38
- $palette: map.get($theme, 'general', 'colors', $key + '-theme');
39
-
40
- @if $palette {
41
- @return $palette;
42
- }
43
-
44
- $color: map.get($theme, 'general', 'colors', $key);
45
- @return palette-generator.generate-from($color);
46
- }
1
+ /* stylelint-disable scss/no-duplicate-dollar-variables */
2
+ @use '@angular/material' as theming;
3
+ @use 'palette-generator';
4
+ @use 'typography-generator';
5
+ @use 'sass:map';
6
+ @use '../../typography/fonts';
7
+
8
+ /* stylelint-disable scss/function-no-unknown */
9
+ @mixin generate-from($entry-theme) {
10
+ @include theming.core();
11
+ $body-font: map.get($entry-theme, 'general', 'fonts', 'body', 'family');
12
+
13
+ @if $body-font == '' {
14
+ @include fonts.generate-default-font();
15
+ }
16
+
17
+ $primary-palette: theming.define-palette(-get-material-palette-for('primary', $entry-theme));
18
+ $accent-palette: theming.define-palette(-get-material-palette-for('accent', $entry-theme));
19
+ $warn-palette: theming.define-palette(theming.$red-palette);
20
+
21
+ $typography: typography-generator.generate-from($entry-theme);
22
+ @include theming.typography-hierarchy($typography);
23
+
24
+ $material-theme: theming.define-light-theme((
25
+ color: (
26
+ primary: $primary-palette,
27
+ accent: $accent-palette,
28
+ warn: $warn-palette,
29
+ ),
30
+ typography: $typography,
31
+ density: map.get($entry-theme, 'general', 'density')
32
+ ));
33
+
34
+ @include theming.all-component-themes($material-theme);
35
+ }
36
+
37
+ @function -get-material-palette-for($key, $theme) {
38
+ $palette: map.get($theme, 'general', 'colors', $key + '-theme');
39
+
40
+ @if $palette {
41
+ @return $palette;
42
+ }
43
+
44
+ $color: map.get($theme, 'general', 'colors', $key);
45
+ @return palette-generator.generate-from($color);
46
+ }
@@ -1,32 +1,32 @@
1
- @use 'sass:color';
2
- @use 'sass:map';
3
-
4
- @function generate-from($color) {
5
- $result: (
6
- 50: color.adjust($color, $lightness: -30%),
7
- contrast: (
8
- 50: #212121,
9
- 100: #212121,
10
- 200: #212121,
11
- 300: #212121,
12
- 400: #212121,
13
- 500: #FFF,
14
- 600: #FFF,
15
- 700: #FFF,
16
- 800: #FFF,
17
- 900: #FFF,
18
- a100: #212121,
19
- a200: #212121,
20
- a400: #FFF,
21
- a700: #FFF
22
- )
23
- );
24
-
25
- @for $counter from 1 through 9 {
26
- $blended-color: color.adjust($color, $lightness: -27 + $counter * 5%);
27
- /* stylelint-disable-next-line scss/no-duplicate-dollar-variables */
28
- $result: map.set($result, $counter * 100, $blended-color);
29
- }
30
-
31
- @return $result;
32
- }
1
+ @use 'sass:color';
2
+ @use 'sass:map';
3
+
4
+ @function generate-from($color) {
5
+ $result: (
6
+ 50: color.adjust($color, $lightness: -30%),
7
+ contrast: (
8
+ 50: #212121,
9
+ 100: #212121,
10
+ 200: #212121,
11
+ 300: #212121,
12
+ 400: #212121,
13
+ 500: #FFF,
14
+ 600: #FFF,
15
+ 700: #FFF,
16
+ 800: #FFF,
17
+ 900: #FFF,
18
+ a100: #212121,
19
+ a200: #212121,
20
+ a400: #FFF,
21
+ a700: #FFF
22
+ )
23
+ );
24
+
25
+ @for $counter from 1 through 9 {
26
+ $blended-color: color.adjust($color, $lightness: -27 + $counter * 5%);
27
+ /* stylelint-disable-next-line scss/no-duplicate-dollar-variables */
28
+ $result: map.set($result, $counter * 100, $blended-color);
29
+ }
30
+
31
+ @return $result;
32
+ }
@@ -1,108 +1,108 @@
1
- /* stylelint-disable scss/no-duplicate-dollar-variables, scss/function-no-unknown */
2
- @use '@angular/material' as theming;
3
- @use 'sass:map';
4
-
5
- @function generate-from($theme) {
6
- $theme-typography: map.get($theme, 'general', 'typography');
7
-
8
- @if $theme-typography {
9
- @return $theme-typography;
10
- }
11
-
12
- @return -generate-typography-from($theme);
13
- }
14
-
15
- @function -generate-typography-from($theme) {
16
- $fonts: map.get($theme, 'general', 'fonts');
17
- $typography: theming.define-typography-config();
18
-
19
- $typography: -set-font-for('body', $typography, $fonts, ('body-1', 'body-2'));
20
- $typography: -set-font-for('buttons', $typography, $fonts, ('button'));
21
- $typography: -set-font-for('hero-titles',$typography,$fonts,('headline-1', 'headline-2',
22
- 'headline-3', 'headline-4', 'headline-5', 'headline-6'));
23
- $typography: -set-font-for('titles', $typography, $fonts, ('subtitle-1', 'subtitle-2'));
24
- $typography: -set-font-family($typography, $fonts);
25
-
26
- @return $typography;
27
- }
28
-
29
- @function -set-font-for($selector, $typography, $fonts, $desired-size-settings) {
30
- $desired-size: map.get($fonts, $selector, 'size');
31
- $desired-spacing: map.get($fonts, $selector, 'letter-spacing');
32
-
33
- @each $setting in $desired-size-settings {
34
- /* stylelint-disable-next-line scss/at-if-no-null */
35
- @if $desired-size != null {
36
- $typography: map.set($typography, $setting, 'font-size', $desired-size);
37
- }
38
-
39
- /* stylelint-disable-next-line scss/at-if-no-null */
40
- @if $desired-spacing != null {
41
- $typography: map.set($typography, $setting, 'letter-spacing', $desired-spacing);
42
- }
43
- }
44
-
45
- @return $typography;
46
- }
47
-
48
- @function -set-font-family($typography, $fonts) {
49
- $body-font: map.get($fonts, 'body', 'family');
50
-
51
- @if $body-font == '' {
52
- @return -generate-defaults-from($typography);
53
- }
54
-
55
- $typography: -set-typography-group($typography, ('body-1', 'body-2', 'caption'), $body-font);
56
-
57
- $titles-font: map.get($fonts, 'titles', 'family');
58
- $hero-titles-font: map.get($fonts, 'hero-titles', 'family');
59
- $buttons-font: map.get($fonts, 'buttons', 'family');
60
-
61
- // We fallback to body font if buttons font isn't provided.
62
- @if $buttons-font == '' {
63
- $buttons-font: $body-font;
64
- }
65
-
66
- // Both titles font fallback to body font unless main one's being set.
67
- @if $hero-titles-font == '' and $titles-font == '' {
68
- $hero-titles-font: $body-font;
69
- $titles-font: $body-font;
70
- }
71
- @else if $hero-titles-font == '' and $titles-font != '' {
72
- $hero-titles-font: $titles-font;
73
- }
74
-
75
- $typography: -set-text-groups-for($typography, $body-font, $buttons-font);
76
- $typography: -set-typography-group($typography, ('headline-1', 'headline-2', 'headline-3', 'headline-4'), $hero-titles-font);
77
- $typography: -set-typography-group($typography, ('headline-5', 'headline-6', 'subtitle-1', 'subtitle-2'), $titles-font);
78
- $typography: map.set($typography, 'font-family', '"#{$buttons-font}"');
79
-
80
- @return $typography;
81
- }
82
-
83
- @function -set-text-groups-for($typography, $body-font, $buttons-font) {
84
- $typography: -set-typography-group($typography, ('body-1', 'body-2', 'caption'), $body-font);
85
- $typography: -set-typography-group($typography, ('button'), $buttons-font);
86
- @return $typography;
87
- }
88
-
89
- @function -generate-defaults-from($typography) {
90
- // Return Roboto (default Angular Material's font (for now).
91
- // $typography: -set-text-groups-for($typography, 'OpenSans-normal', 'OpenSans-bold');
92
- // $typography: -set-typography-group($typography,('headline-1', 'headline-2', 'headline-3',
93
- // 'headline-4', 'headline-5', 'headline-6', 'subtitle-1', 'subtitle-2'),'Montserrat-bold');
94
- @return $typography;
95
- }
96
-
97
- @function -set-typography-group($typography, $desired-typography-group, $font) {
98
- @each $setting in $desired-typography-group {
99
- $typography: -set-typography-font($typography, $setting, $font);
100
- }
101
-
102
- @return $typography;
103
- }
104
-
105
- @function -set-typography-font($typography, $section, $font) {
106
- $typography: map.set($typography, $section, 'font-family', '"#{$font}"');
107
- @return $typography;
1
+ /* stylelint-disable scss/no-duplicate-dollar-variables, scss/function-no-unknown */
2
+ @use '@angular/material' as theming;
3
+ @use 'sass:map';
4
+
5
+ @function generate-from($theme) {
6
+ $theme-typography: map.get($theme, 'general', 'typography');
7
+
8
+ @if $theme-typography {
9
+ @return $theme-typography;
10
+ }
11
+
12
+ @return -generate-typography-from($theme);
13
+ }
14
+
15
+ @function -generate-typography-from($theme) {
16
+ $fonts: map.get($theme, 'general', 'fonts');
17
+ $typography: theming.define-typography-config();
18
+
19
+ $typography: -set-font-for('body', $typography, $fonts, ('body-1', 'body-2'));
20
+ $typography: -set-font-for('buttons', $typography, $fonts, ('button'));
21
+ $typography: -set-font-for('hero-titles',$typography,$fonts,('headline-1', 'headline-2',
22
+ 'headline-3', 'headline-4', 'headline-5', 'headline-6'));
23
+ $typography: -set-font-for('titles', $typography, $fonts, ('subtitle-1', 'subtitle-2'));
24
+ $typography: -set-font-family($typography, $fonts);
25
+
26
+ @return $typography;
27
+ }
28
+
29
+ @function -set-font-for($selector, $typography, $fonts, $desired-size-settings) {
30
+ $desired-size: map.get($fonts, $selector, 'size');
31
+ $desired-spacing: map.get($fonts, $selector, 'letter-spacing');
32
+
33
+ @each $setting in $desired-size-settings {
34
+ /* stylelint-disable-next-line scss/at-if-no-null */
35
+ @if $desired-size != null {
36
+ $typography: map.set($typography, $setting, 'font-size', $desired-size);
37
+ }
38
+
39
+ /* stylelint-disable-next-line scss/at-if-no-null */
40
+ @if $desired-spacing != null {
41
+ $typography: map.set($typography, $setting, 'letter-spacing', $desired-spacing);
42
+ }
43
+ }
44
+
45
+ @return $typography;
46
+ }
47
+
48
+ @function -set-font-family($typography, $fonts) {
49
+ $body-font: map.get($fonts, 'body', 'family');
50
+
51
+ @if $body-font == '' {
52
+ @return -generate-defaults-from($typography);
53
+ }
54
+
55
+ $typography: -set-typography-group($typography, ('body-1', 'body-2', 'caption'), $body-font);
56
+
57
+ $titles-font: map.get($fonts, 'titles', 'family');
58
+ $hero-titles-font: map.get($fonts, 'hero-titles', 'family');
59
+ $buttons-font: map.get($fonts, 'buttons', 'family');
60
+
61
+ // We fallback to body font if buttons font isn't provided.
62
+ @if $buttons-font == '' {
63
+ $buttons-font: $body-font;
64
+ }
65
+
66
+ // Both titles font fallback to body font unless main one's being set.
67
+ @if $hero-titles-font == '' and $titles-font == '' {
68
+ $hero-titles-font: $body-font;
69
+ $titles-font: $body-font;
70
+ }
71
+ @else if $hero-titles-font == '' and $titles-font != '' {
72
+ $hero-titles-font: $titles-font;
73
+ }
74
+
75
+ $typography: -set-text-groups-for($typography, $body-font, $buttons-font);
76
+ $typography: -set-typography-group($typography, ('headline-1', 'headline-2', 'headline-3', 'headline-4'), $hero-titles-font);
77
+ $typography: -set-typography-group($typography, ('headline-5', 'headline-6', 'subtitle-1', 'subtitle-2'), $titles-font);
78
+ $typography: map.set($typography, 'font-family', '"#{$buttons-font}"');
79
+
80
+ @return $typography;
81
+ }
82
+
83
+ @function -set-text-groups-for($typography, $body-font, $buttons-font) {
84
+ $typography: -set-typography-group($typography, ('body-1', 'body-2', 'caption'), $body-font);
85
+ $typography: -set-typography-group($typography, ('button'), $buttons-font);
86
+ @return $typography;
87
+ }
88
+
89
+ @function -generate-defaults-from($typography) {
90
+ // Return Roboto (default Angular Material's font (for now).
91
+ // $typography: -set-text-groups-for($typography, 'OpenSans-normal', 'OpenSans-bold');
92
+ // $typography: -set-typography-group($typography,('headline-1', 'headline-2', 'headline-3',
93
+ // 'headline-4', 'headline-5', 'headline-6', 'subtitle-1', 'subtitle-2'),'Montserrat-bold');
94
+ @return $typography;
95
+ }
96
+
97
+ @function -set-typography-group($typography, $desired-typography-group, $font) {
98
+ @each $setting in $desired-typography-group {
99
+ $typography: -set-typography-font($typography, $setting, $font);
100
+ }
101
+
102
+ @return $typography;
103
+ }
104
+
105
+ @function -set-typography-font($typography, $section, $font) {
106
+ $typography: map.set($typography, $section, 'font-family', '"#{$font}"');
107
+ @return $typography;
108
108
  }
@@ -1,5 +1,5 @@
1
- @use 'dialogs/general' as dialogs;
2
- @use 'tables/general' as tables;
3
- @use 'forms/general' as forms;
4
- @use 'search-filter/general' as search-filter;
1
+ @use 'dialogs/general' as dialogs;
2
+ @use 'tables/general' as tables;
3
+ @use 'forms/general' as forms;
4
+ @use 'search-filter/general' as search-filter;
5
5
  @use 'date-time-picker/general' as date-time-picker;