@ifsworld/granite-components 4.2.0 → 4.5.0

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 (29) hide show
  1. package/README.md +117 -4
  2. package/bundles/ifsworld-granite-components.umd.js +33 -11
  3. package/bundles/ifsworld-granite-components.umd.js.map +1 -1
  4. package/bundles/ifsworld-granite-components.umd.min.js +2 -2
  5. package/bundles/ifsworld-granite-components.umd.min.js.map +1 -1
  6. package/esm2015/index.js +1 -0
  7. package/esm2015/index.js.map +1 -1
  8. package/esm2015/index.metadata.json +1 -1
  9. package/esm2015/lib/checkbox/checkbox-group.component.js +19 -0
  10. package/esm2015/lib/checkbox/checkbox-group.component.js.map +1 -0
  11. package/esm2015/lib/checkbox/checkbox-group.component.metadata.json +1 -0
  12. package/esm2015/lib/checkbox/checkbox.component.js +1 -1
  13. package/esm2015/lib/checkbox/checkbox.component.metadata.json +1 -1
  14. package/esm2015/lib/checkbox/checkbox.module.js +3 -2
  15. package/esm2015/lib/checkbox/checkbox.module.js.map +1 -1
  16. package/esm2015/lib/checkbox/checkbox.module.metadata.json +1 -1
  17. package/esm2015/lib/radio-button/radio-button.component.js +4 -5
  18. package/esm2015/lib/radio-button/radio-button.component.js.map +1 -1
  19. package/esm2015/lib/radio-button/radio-button.component.metadata.json +1 -1
  20. package/esm2015/lib/radio-button/radio-group.component.js +3 -3
  21. package/esm2015/lib/radio-button/radio-group.component.js.map +1 -1
  22. package/esm2015/lib/radio-button/radio-group.component.metadata.json +1 -1
  23. package/fesm2015/ifsworld-granite-components.js +28 -12
  24. package/fesm2015/ifsworld-granite-components.js.map +1 -1
  25. package/ifsworld-granite-components.metadata.json +1 -1
  26. package/index.d.ts +1 -0
  27. package/lib/checkbox/checkbox-group.component.d.ts +3 -0
  28. package/lib/radio-button/radio-button.component.d.ts +1 -1
  29. package/package.json +1 -1
package/README.md CHANGED
@@ -1,7 +1,120 @@
1
- # granite-components
1
+ # Granite Components
2
2
 
3
- This library was generated with [Nx](https://nx.dev).
3
+ This library is an Angular implementation of the [IFS Design System](https://design.ifs.com). The IFS User Experience product group builds and maintains common UI components and tools. [The goal](docs/strategy.md) is to help product teams rapidly build applications with a delightful IFS branded experience.
4
4
 
5
- ## Running unit tests
5
+ ![npm](https://img.shields.io/npm/v/@ifsworld/granite-components)
6
+ ![npm weekly downloads](https://img.shields.io/npm/dw/@ifsworld/granite-components)
7
+ [![@ifsworld/granite-components](https://snyk.io/advisor/npm-package/@ifsworld/granite-components/badge.svg)](https://snyk.io/advisor/npm-package/@ifsworld/granite-components)
6
8
 
7
- Run `nx test granite-components` to execute the unit tests.
9
+ [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
10
+ [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
11
+ [![Storybook](https://cdn.jsdelivr.net/gh/storybookjs/brand@main/badge/badge-storybook.svg)](https://uxstorybooklatest.z16.web.core.windows.net/)
12
+
13
+ ## Deployments
14
+
15
+ | Name | URL | Secondary URL |
16
+ | ------------------------------------------- | ----------------------------------------------------- | --------------------------------------------------- |
17
+ | **Storybook - Latest** | <https://uxstorybooklatest.z16.web.core.windows.net/> | - |
18
+ | **Storybook - Beta** | <https://sb-designifs.azureedge.net/> | <https://uxstorybookbeta.z16.web.core.windows.net/> |
19
+ | **Granite Component Library Demo - Latest** | <https://uxdemolatest.z16.web.core.windows.net/> | - |
20
+ | **Granite Component Library Demo - Beta** | <https://cl-designifs.azureedge.net/> | <https://uxdemobeta.z16.web.core.windows.net/> |
21
+
22
+ ## Getting started
23
+
24
+ Assuming we're starting with a new @angular/cli project:
25
+
26
+ ```shell
27
+ npx @angular/cli new my-project --style=scss
28
+
29
+ cd my-project
30
+
31
+ npm i --save @ifsworld/granite-components
32
+
33
+ ```
34
+
35
+ If peer dependencies haven't automatically been installed (default behavior of NPM 7 and beyond), then manually install [@ifsworld/granite-icons](https://www.npmjs.com/package/@ifsworld/granite-icons) and [@ifsworld/granite-tokens](https://www.npmjs.com/package/@ifsworld/granite-tokens).
36
+
37
+ ```shell
38
+ npm i --save @ifsworld/granite-icons @ifsworld/granite-tokens
39
+ ```
40
+
41
+ Finally, add them in `src/styles.scss`:
42
+
43
+ ```scss
44
+ @use '@ifsworld/granite-tokens/design-tokens/light/tokens';
45
+ @use  '@ifsworld/granite-icons/assets/fonts/ligature/granite-iconfont-liga.css';
46
+ ```
47
+
48
+ > That's it! Now we can run `npm start` and start building out our application!
49
+
50
+ [StackBlitz Example](https://stackblitz.com/edit/angular-ivy-zcgdkv?file=src/app/app.component.html)
51
+
52
+ **Note: currrently there's an issue with the _Ivy compiler_. To get the project to work, the Ivy Compiler must be set to disabled in `tsconfig.json`!**
53
+
54
+ ### Support
55
+
56
+ #### Angular version support matrix
57
+
58
+ | Angular / Library | 0.x.x | 1.x.x | 2.x.x | 3.x.x |
59
+ | ----------------- | ----- | ----- | ----- | ----- |
60
+ | 10 | ❌ | ❌ | ❌ | ❌ |
61
+ | 11 | ✅ | 🔶 | ✅ | ✅ |
62
+ | 12 | ✅ | ✅ | ✅ | ✅ |
63
+ | 13 | ✅ | ✅ | ✅ | ✅ |
64
+ | 14 | 🔶 | 🔶 | 🔶 | 🔶 |
65
+
66
+ _Note: we plan to only support our latest release. Beyond that we make no guarantees of continued support._
67
+
68
+ ❌ unsupported
69
+ 🔶 limited support
70
+ ✅ fully supported
71
+
72
+ ## Contributing
73
+
74
+ If you'd like to contribute, please see the [Getting started guide](../../docs/getting-started.md). Then follow our [Development guidelines](../../docs/development-guidelines.md).
75
+
76
+ Check the IFS internal Jira for issues.
77
+
78
+ ### Further help
79
+
80
+ To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
81
+
82
+ #### External sources
83
+
84
+ - [Angular - Creating Libraries](https://angular.io/guide/creating-libraries)
85
+ - [Create your Standalone Angular Library in 10 minutes](https://indepth.dev/create-your-standalone-angular-library-in-10-minutes/)
86
+ - [Creating monorepos using NX](https://nx.dev/)
87
+
88
+ ## What we're working on now (2022)
89
+
90
+ - Multi Select Input Control
91
+ - Date Picker Control
92
+ - Advance Input Control
93
+ - Advance Table Control
94
+ - Rating Control
95
+ - Label Control
96
+
97
+ ## About the product group
98
+
99
+ The project is governed by the [User Experience Product Group](https://ifs.sharepoint.com/teams/UserExperienceProductGroup). The mission of the product group is to drive the unified User Experience of IFS business applications. Own and provide UI components and guidelines based on our user's needs. Act as a guide and advisor helping application teams create great UX.
100
+
101
+ ### Primary goals of component library
102
+
103
+ - Build high-quality UI components that developers can drop into existing applications
104
+ - Provide tools that help developers build their own custom components with common interaction patterns
105
+
106
+ #### What we mean by _high-quality_ components
107
+
108
+ - Internationalized and accessible so that all users can use them.
109
+ - Straightforward APIs that don't confuse developers.
110
+ - Behave as expected across a wide variety of use-cases without bugs.
111
+ - Behavior is well-tested with both unit and integration tests.
112
+ - Customizable.
113
+ - Performance cost is minimized.
114
+ - Code is clean and well-documented to serve as an example for Angular developers.
115
+
116
+ ## Browser and accessibility support
117
+
118
+ The library supports the most recent versions of the following major browsers: [Google Chrome (including Android)](https://www.google.com/chrome/), [Apple Safari (including iOS)](https://www.apple.com/safari/), and [Microsoft Edge](https://www.microsoft.com/edge). See [IFS official guidelines](https://ifs.sharepoint.com/sites/IFSCloudProdInfo/SitePages/Supported-Platforms-21R2.aspx).
119
+
120
+ We aim for great user experience and to provide high levels of accessibility through support for standardized tools such as [ARIA](https://www.w3.org/WAI/standards-guidelines/aria/).
@@ -2734,10 +2734,7 @@
2734
2734
  this.radioBlur = new core.EventEmitter();
2735
2735
  this._positionBefore = false;
2736
2736
  this._radioDisabled = false;
2737
- this._removeUniqueSelectionListener = function () {
2738
- // Function used to deregister listener
2739
- };
2740
- this._removeUniqueSelectionListener = _radioDispatcher.listen(function (id, name) {
2737
+ this._removeUniqueSelectionListenerFn = _radioDispatcher.listen(function (id, name) {
2741
2738
  if (id !== _this.id && name === _this.name) {
2742
2739
  _this.checked = false;
2743
2740
  }
@@ -2767,7 +2764,9 @@
2767
2764
  }
2768
2765
  };
2769
2766
  GraniteRadioButtonComponent.prototype.ngOnDestroy = function () {
2770
- this._removeUniqueSelectionListener();
2767
+ if (this._removeUniqueSelectionListenerFn instanceof Function) {
2768
+ this._removeUniqueSelectionListenerFn();
2769
+ }
2771
2770
  };
2772
2771
  // Focuses the radio button.
2773
2772
  GraniteRadioButtonComponent.prototype.focus = function (origin, options) {
@@ -2855,11 +2854,11 @@
2855
2854
  class: 'granite-radio-group',
2856
2855
  '[attr.role]': '"radiogroup"',
2857
2856
  '[attr.aria-labelledby]': 'ariaLabelledby',
2858
- '[class.granite-radio-group-layout-horizontal]': 'layout === "horizontal"',
2857
+ '[class.granite-radio-checkbox-base-layout-horizontal]': 'layout === "horizontal"',
2859
2858
  },
2860
- template: "<ng-content></ng-content>\n",
2859
+ template: '<ng-content></ng-content>',
2861
2860
  changeDetection: core.ChangeDetectionStrategy.OnPush,
2862
- styles: [":host(.granite-radio-group-layout-horizontal){display:flex;align-items:flex-start}"]
2861
+ styles: [":host(.granite-radio-checkbox-base-layout-horizontal){display:flex;align-items:flex-start}"]
2863
2862
  },] }
2864
2863
  ];
2865
2864
 
@@ -2943,7 +2942,7 @@
2943
2942
  },
2944
2943
  template: "<label [attr.for]=\"id\" class=\"granite-checkbox-label\">\n <div class=\"granite-checkbox-box\">\n <input\n #input\n [id]=\"id\"\n class=\"granite-checkbox-input cdk-visually-hidden\"\n role=\"checkbox\"\n type=\"checkbox\"\n [attr.aria-checked]=\"checked.toString()\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [checked]=\"checked\"\n [disabled]=\"_checkboxDisabled\"\n [readonly]=\"readonly\"\n (click)=\"_checkboxClick()\"\n (change)=\"_checkboxChange()\"\n (blur)=\"_onBlur()\"\n />\n <div class=\"granite-checkbox-check\"></div>\n </div>\n <span class=\"granite-checkbox-text\"><ng-content></ng-content></span>\n</label>\n",
2945
2944
  changeDetection: core.ChangeDetectionStrategy.OnPush,
2946
- styles: [".cdk-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;outline:0;-webkit-appearance:none;-moz-appearance:none}:host{box-sizing:border-box}:host *,:host :after,:host :before{box-sizing:inherit;cursor:pointer}:host(.granite-checkbox){color:var(--granite-color-text)}:host(.granite-checkbox):not(.granite-checkbox-checked):not(.granite-checkbox-readonly):not(.granite-checkbox-disabled) .granite-checkbox-label:hover .granite-checkbox-box{border-color:var(--granite-color-background-active)}:host(.granite-checkbox-checked):not(.granite-checkbox-readonly):not(.granite-checkbox-disabled) .granite-checkbox-label:hover .granite-checkbox-box{background-color:var(--granite-color-background-active-hover);border-color:var(--granite-color-background-active-hover)}:host(.granite-checkbox-checked) .granite-checkbox-box{border-color:var(--granite-color-background-active);background-color:var(--granite-color-background-active)}:host(.granite-checkbox-checked) .granite-checkbox-box:focus-within{border-color:var(--granite-color-focus)}:host(.granite-checkbox-checked) .granite-checkbox-check{display:flex}:host(.granite-checkbox-checked):not(.granite-checkbox-readonly):not(.granite-checkbox-disabled) .granite-checkbox-box{-webkit-animation:fadeInAnimation .2s;animation:fadeInAnimation .2s;-webkit-animation-iteration-count:1;animation-iteration-count:1}:host(:not(.granite-checkbox-checked)) .granite-checkbox-box{-webkit-animation:fadeOutAnimation .2s;animation:fadeOutAnimation .2s;-webkit-animation-iteration-count:1;animation-iteration-count:1}:host(.granite-checkbox-readonly.granite-checkbox-checked) .granite-checkbox-box{background-color:var(--granite-color-text);border-color:var(--granite-color-text)}:host(.granite-checkbox-readonly.granite-checkbox-checked) .granite-checkbox-box .granite-checkbox-check{border-color:var(--granite-color-background)}:host(.granite-checkbox-disabled) .granite-checkbox-box{opacity:.3;background-color:var(--granite-color-border-soft)}:host(.granite-checkbox-disabled) .granite-checkbox-label{opacity:.6}:host(.granite-checkbox-disabled) *,:host(.granite-checkbox-readonly) *{cursor:default}:host(.granite-checkbox-label-before) .granite-checkbox-label{flex-direction:row-reverse}:host(.granite-checkbox-label-before) .granite-checkbox-text{-webkit-padding-start:0;padding-inline-start:0;-webkit-padding-end:var(--granite-spacing-s);padding-inline-end:var(--granite-spacing-s)}.granite-checkbox-label{display:flex;align-items:center;width:-webkit-max-content;width:-moz-max-content;width:max-content}.granite-checkbox-box{width:1rem;height:1rem;border:solid var(--granite-color-background-inactive);border-width:.0625rem;border-radius:.25rem;display:flex;justify-content:center;position:relative}.granite-checkbox-box:focus-within{border:.0625rem solid var(--granite-color-focus)}.granite-checkbox-check{position:relative;display:none;width:.5625rem;height:.3125rem;background-color:transparent;border:solid var(--granite-color-text-static-light);transform:rotate(-45deg);margin-top:var(--granite-spacing-xs);border-width:0 0 .125rem .125rem}.granite-checkbox-text{-webkit-padding-start:var(--granite-spacing-s);padding-inline-start:var(--granite-spacing-s)}.granite-checkbox-text:empty{display:none}@-webkit-keyframes fadeInAnimation{0%{opacity:0}to{opacity:1}}@keyframes fadeInAnimation{0%{opacity:0}to{opacity:1}}@-webkit-keyframes fadeOutAnimation{0%{opacity:1}to{opacity:0}}@keyframes fadeOutAnimation{0%{opacity:1}to{opacity:0}}"]
2945
+ styles: [".cdk-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;outline:0;-webkit-appearance:none;-moz-appearance:none}:host{box-sizing:border-box}:host *,:host :after,:host :before{box-sizing:inherit;cursor:pointer}:host(.granite-checkbox){color:var(--granite-color-text)}:host(.granite-checkbox):not(.granite-checkbox-checked):not(.granite-checkbox-readonly):not(.granite-checkbox-disabled) .granite-checkbox-label:hover .granite-checkbox-box{border-color:var(--granite-color-background-active)}:host(.granite-checkbox-checked):not(.granite-checkbox-readonly):not(.granite-checkbox-disabled) .granite-checkbox-label:hover .granite-checkbox-box{background-color:var(--granite-color-background-active-hover);border-color:var(--granite-color-background-active-hover)}:host(.granite-checkbox-checked) .granite-checkbox-box{border-color:var(--granite-color-background-active);background-color:var(--granite-color-background-active)}:host(.granite-checkbox-checked) .granite-checkbox-box:focus-within{border-color:var(--granite-color-focus)}:host(.granite-checkbox-checked) .granite-checkbox-check{display:flex}:host(.granite-checkbox-checked):not(.granite-checkbox-readonly):not(.granite-checkbox-disabled) .granite-checkbox-box{-webkit-animation:fadeInAnimation .2s;animation:fadeInAnimation .2s;-webkit-animation-iteration-count:1;animation-iteration-count:1}:host(:not(.granite-checkbox-checked)) .granite-checkbox-box{-webkit-animation:fadeOutAnimation .2s;animation:fadeOutAnimation .2s;-webkit-animation-iteration-count:1;animation-iteration-count:1}:host(.granite-checkbox-readonly.granite-checkbox-checked) .granite-checkbox-box{background-color:var(--granite-color-text);border-color:var(--granite-color-text)}:host(.granite-checkbox-readonly.granite-checkbox-checked) .granite-checkbox-box .granite-checkbox-check{border-color:var(--granite-color-background)}:host(.granite-checkbox-disabled) .granite-checkbox-box{opacity:.3;background-color:var(--granite-color-border-soft)}:host(.granite-checkbox-disabled) .granite-checkbox-label{opacity:.6}:host(.granite-checkbox-disabled) *,:host(.granite-checkbox-readonly) *{cursor:default}:host(.granite-checkbox-label-before) .granite-checkbox-label{flex-direction:row-reverse}:host(.granite-checkbox-label-before) .granite-checkbox-text{-webkit-padding-start:0;padding-inline-start:0;-webkit-padding-end:var(--granite-spacing-s);padding-inline-end:var(--granite-spacing-s)}.granite-checkbox-label{display:flex;align-items:center;width:-webkit-max-content;width:-moz-max-content;width:max-content;-webkit-margin-end:var(--granite-spacing-xl);margin-inline-end:var(--granite-spacing-xl)}.granite-checkbox-box{width:1rem;height:1rem;border:solid var(--granite-color-background-inactive);border-width:.0625rem;border-radius:.25rem;display:flex;justify-content:center;position:relative}.granite-checkbox-box:focus-within{border:.0625rem solid var(--granite-color-focus)}.granite-checkbox-check{position:relative;display:none;width:.5625rem;height:.3125rem;background-color:transparent;border:solid var(--granite-color-text-static-light);transform:rotate(-45deg);margin-top:var(--granite-spacing-xs);border-width:0 0 .125rem .125rem}.granite-checkbox-text{-webkit-padding-start:var(--granite-spacing-s);padding-inline-start:var(--granite-spacing-s)}.granite-checkbox-text:empty{display:none}@-webkit-keyframes fadeInAnimation{0%{opacity:0}to{opacity:1}}@keyframes fadeInAnimation{0%{opacity:0}to{opacity:1}}@-webkit-keyframes fadeOutAnimation{0%{opacity:1}to{opacity:0}}@keyframes fadeOutAnimation{0%{opacity:1}to{opacity:0}}"]
2947
2946
  },] }
2948
2947
  ];
2949
2948
  GraniteCheckboxComponent.ctorParameters = function () { return [
@@ -2963,6 +2962,28 @@
2963
2962
  _inputElement: [{ type: core.ViewChild, args: ['input',] }]
2964
2963
  };
2965
2964
 
2965
+ var GraniteCheckboxGroupComponent = /** @class */ (function (_super) {
2966
+ __extends(GraniteCheckboxGroupComponent, _super);
2967
+ function GraniteCheckboxGroupComponent() {
2968
+ return _super !== null && _super.apply(this, arguments) || this;
2969
+ }
2970
+ return GraniteCheckboxGroupComponent;
2971
+ }(GraniteRadioCheckboxBase));
2972
+ GraniteCheckboxGroupComponent.decorators = [
2973
+ { type: core.Component, args: [{
2974
+ selector: 'granite-checkbox-group',
2975
+ host: {
2976
+ class: 'granite-checkbox-group',
2977
+ '[attr.role]': '"group"',
2978
+ '[attr.aria-labelledby]': 'ariaLabelledby',
2979
+ '[class.granite-radio-checkbox-base-layout-horizontal]': 'layout === "horizontal"',
2980
+ },
2981
+ template: '<ng-content></ng-content>',
2982
+ changeDetection: core.ChangeDetectionStrategy.OnPush,
2983
+ styles: [":host(.granite-radio-checkbox-base-layout-horizontal){display:flex;align-items:flex-start}"]
2984
+ },] }
2985
+ ];
2986
+
2966
2987
  var GraniteCheckboxModule = /** @class */ (function () {
2967
2988
  function GraniteCheckboxModule() {
2968
2989
  }
@@ -2970,8 +2991,8 @@
2970
2991
  }());
2971
2992
  GraniteCheckboxModule.decorators = [
2972
2993
  { type: core.NgModule, args: [{
2973
- declarations: [GraniteCheckboxComponent],
2974
- exports: [GraniteCheckboxComponent],
2994
+ declarations: [GraniteCheckboxComponent, GraniteCheckboxGroupComponent],
2995
+ exports: [GraniteCheckboxComponent, GraniteCheckboxGroupComponent],
2975
2996
  },] }
2976
2997
  ];
2977
2998
 
@@ -3576,6 +3597,7 @@
3576
3597
  exports.GraniteButtonComponent = GraniteButtonComponent;
3577
3598
  exports.GraniteButtonModule = GraniteButtonModule;
3578
3599
  exports.GraniteCheckboxComponent = GraniteCheckboxComponent;
3600
+ exports.GraniteCheckboxGroupComponent = GraniteCheckboxGroupComponent;
3579
3601
  exports.GraniteCheckboxModule = GraniteCheckboxModule;
3580
3602
  exports.GraniteCoreModule = GraniteCoreModule;
3581
3603
  exports.GraniteDividerDirective = GraniteDividerDirective;