Skip to content

Commit 44b2675

Browse files
authored
Merge pull request #7339 from IgniteUI/hPopov/new-component
chore(*): Fix failing tests
2 parents 3c993c9 + 206b898 commit 44b2675

File tree

21 files changed

+304
-17
lines changed

21 files changed

+304
-17
lines changed

package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
"classlist.js": "^1.1.20150312",
5959
"core-js": "^2.6.11",
6060
"hammerjs": "^2.0.8",
61+
"igniteui-trial-watermark": "^1.0.3",
6162
"jszip": "^3.4.0",
6263
"resize-observer-polyfill": "^1.5.1",
6364
"rxjs": "^6.5.4",

projects/igniteui-angular/ng-package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"@types/jszip",
1111
"hammerjs",
1212
"jszip",
13-
"resize-observer-polyfill"
13+
"resize-observer-polyfill",
14+
"igniteui-trial-watermark"
1415
]
1516
}

projects/igniteui-angular/ng-package.prod.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"@types/jszip",
1313
"hammerjs",
1414
"jszip",
15-
"resize-observer-polyfill"
15+
"resize-observer-polyfill",
16+
"igniteui-trial-watermark"
1617
]
1718
}

projects/igniteui-angular/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@
7070
"@types/jszip": "^3.1.7",
7171
"hammerjs": "^2.0.8",
7272
"jszip": "^3.3.0",
73-
"resize-observer-polyfill": "^1.5.1"
73+
"resize-observer-polyfill": "^1.5.1",
74+
"igniteui-trial-watermark": "^1.0.3"
7475
},
7576
"peerDependencies": {
7677
"@angular/common": "^9.0.0",

projects/igniteui-angular/schematics/utils/dependency-handler.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export const DEPENDENCIES_MAP: PackageEntry[] = [
2828
{ name: 'resize-observer-polyfill', target: PackageTarget.REGULAR },
2929
{ name: '@types/hammerjs', target: PackageTarget.DEV },
3030
{ name: '@types/jszip', target: PackageTarget.DEV },
31+
{ name: 'igniteui-trial-watermark', target: PackageTarget.NONE },
3132
// peerDependencies
3233
{ name: '@angular/forms', target: PackageTarget.NONE },
3334
{ name: '@angular/common', target: PackageTarget.NONE },
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
////
2+
/// @access privet
3+
/// @group components
4+
/// @author <a href="https://github.com/desig9stein" target="_blank">Marin Popov</a>
5+
/// @requires {mixin} bem-block
6+
/// @requires {mixin} bem-elem
7+
/// @requires {mixin} bem-mod
8+
////
9+
10+
@include b(igx-watermark) {
11+
$this: bem--selector-to-string(&);
12+
@include register-component(str-slice($this, 2, -1));
13+
14+
@extend %igx-watermark !optional;
15+
16+
@include e(link) {
17+
@extend %igx-watermark__link !optional;
18+
}
19+
20+
@include e(background-img) {
21+
@extend %igx-watermark__background-img !optional;
22+
}
23+
}
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
////
2+
/// @group themes
3+
/// @access privet
4+
/// @author <a href="https://github.com/desig9stein" target="_blank">Marin Popov</a>
5+
////
6+
7+
/// Returns a map containing all style properties related to the theming the watermark directive.
8+
/// @param {Map} $palette [$default-palette] - The palette used as basis for styling the component.
9+
/// @param {Map} $schema [$light-schema] - The schema used as basis for styling the component.
10+
///
11+
/// @requires $default-palette
12+
/// @requires $light-schema
13+
/// @requires apply-palette
14+
/// @requires extend
15+
/// @requires text-contrast
16+
/// @requires round-borders
17+
///
18+
/// @example scss Change the watermark background
19+
/// $my-watermark-theme: igx-watermark-theme($background: magenta);
20+
/// // Pass the theme to the igx-watermark component mixin
21+
/// @include igx-watermark($my-checkbox-theme);
22+
@function igx-watermark-theme(
23+
$palette: $default-palette,
24+
$schema: $light-schema,
25+
26+
$border-radius: null,
27+
$background-image: null,
28+
$link-background: null,
29+
$color: null,
30+
$border-color: null,
31+
) {
32+
$name: 'igx-watermark';
33+
$watermark-schema: ();
34+
35+
@if map-has-key($schema, $name) {
36+
$watermark-schema: map-get($schema, $name);
37+
} @else {
38+
$watermark-schema: $schema;
39+
}
40+
41+
$theme: apply-palette($watermark-schema, $palette);
42+
43+
$border-radius: round-borders(
44+
if($border-radius, $border-radius, map-get($watermark-schema, 'border-radius')), 0, 16px
45+
);
46+
47+
@if not($color) and $link-background {
48+
$color: text-contrast($link-background);
49+
}
50+
51+
@return extend($theme, (
52+
name: $name,
53+
palette: $default-palette,
54+
background-image: $background-image,
55+
link-background: $link-background,
56+
border-radius: $border-radius,
57+
color: $color,
58+
border-color: $border-color,
59+
));
60+
}
61+
62+
/// @param {Map} $theme - The theme used to style the component.
63+
/// @requires {mixin} igx-root-css-vars
64+
/// @requires --var
65+
@mixin igx-watermark($theme) {
66+
@include igx-root-css-vars($theme);
67+
68+
%igx-watermark {
69+
display: block;
70+
position: absolute;
71+
bottom: 0;
72+
right: 0;
73+
width: 100%;
74+
height: 100%;
75+
z-index: 10000;
76+
pointer-events: none;
77+
}
78+
79+
%igx-watermark__link {
80+
display: inline-flex;
81+
align-items: center;
82+
position: absolute;
83+
bottom: 0;
84+
right: 0;
85+
font-size: rem(14px);
86+
padding: rem(2px) rem(4px);
87+
line-height: normal;
88+
border: 1px solid --var($theme, 'border-color');
89+
color: --var($theme, 'color');
90+
z-index: 10002;
91+
background-color: --var($theme, 'link-background');
92+
pointer-events: all;
93+
text-decoration: none;
94+
}
95+
96+
%igx-watermark__background-img {
97+
width: 100%;
98+
height: 100%;
99+
position: absolute;
100+
top: 0;
101+
left: 0;
102+
z-index: 10001;
103+
pointer-events: none;
104+
background-image: --var($theme, 'background-image');
105+
background-repeat: repeat;
106+
background-position: rem(16px) rem(16px);
107+
// Target only IE 10,11.
108+
@media all and (-ms-high-contrast:none)
109+
{
110+
background-image: none;
111+
}
112+
// END Target only IE 10,11.
113+
}
114+
}

projects/igniteui-angular/src/lib/core/styles/themes/_core.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
@import '../components/toast/toast-component';
6363
@import '../components/tooltip/tooltip-component';
6464
@import '../components/time-picker/time-picker-component';
65+
@import '../components/watermark/watermark-component';
6566
@import '../print/index';
6667

6768
/// Includes the base for each theme.
@@ -97,3 +98,4 @@
9798
@include igx-print-layout();
9899
}
99100
}
101+

projects/igniteui-angular/src/lib/core/styles/themes/schemas/dark/_index.scss

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
@import './time-picker';
4747
@import './toast';
4848
@import './tooltip';
49+
@import './watermark';
4950

5051
/// The default dark schema for all components.
5152
/// @type {Map}
@@ -136,7 +137,8 @@ $dark-schema: (
136137
igx-tabs: $_dark-tabs,
137138
igx-time-picker: $_dark-time-picker,
138139
igx-toast: $_dark-toast,
139-
igx-tooltip: $_dark-tooltip
140+
igx-tooltip: $_dark-tooltip,
141+
igx-watermark: $_dark-watermark,
140142
);
141143

142144
/// The default dark fluent schema for all components.
@@ -228,7 +230,8 @@ $dark-fluent-schema: (
228230
igx-tabs: $_dark-fluent-tabs,
229231
igx-time-picker: $_dark-fluent-time-picker,
230232
igx-toast: $_dark-fluent-toast,
231-
igx-tooltip: $_dark-fluent-tooltip
233+
igx-tooltip: $_dark-fluent-tooltip,
234+
igx-watermark: $_dark-fluent-watermark
232235
);
233236

234237
/// The default dark bootstrap schema for all components.
@@ -320,5 +323,6 @@ $dark-bootstrap-schema: (
320323
igx-tabs: $_dark-bootstrap-tabs,
321324
igx-time-picker: $_dark-bootstrap-time-picker,
322325
igx-toast: $_dark-bootstrap-toast,
323-
igx-tooltip: $_dark-bootstrap-tooltip
326+
igx-tooltip: $_dark-bootstrap-tooltip,
327+
igx-watermark: $_dark-bootstrap-watermark
324328
);

0 commit comments

Comments
 (0)