@sarasanalytics-com/design-system 0.0.3 → 0.0.4

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 (181) hide show
  1. package/README.md +9 -12
  2. package/esm2022/interfaces/avatar-interface.mjs +2 -0
  3. package/esm2022/interfaces/button-interface.mjs +2 -0
  4. package/esm2022/interfaces/chip-interface.mjs +2 -0
  5. package/esm2022/interfaces/grid-interface.mjs +2 -0
  6. package/esm2022/interfaces/select-interface.mjs +2 -0
  7. package/esm2022/interfaces/tab-interface.mjs +2 -0
  8. package/esm2022/lib/avatar/avatar.component.mjs +56 -0
  9. package/esm2022/lib/button/button.component.mjs +84 -0
  10. package/esm2022/lib/calendar-header/calendar-header.component.mjs +170 -0
  11. package/esm2022/lib/chips/chips.component.mjs +62 -0
  12. package/esm2022/lib/component-library.component.mjs +19 -0
  13. package/esm2022/lib/component-library.service.mjs +14 -0
  14. package/esm2022/lib/datepicker/datepicker.component.mjs +39 -0
  15. package/esm2022/lib/form-select/form-select.component.mjs +59 -0
  16. package/esm2022/lib/grid-cell/grid-cell.component.mjs +84 -0
  17. package/esm2022/lib/header/header.component.mjs +37 -0
  18. package/esm2022/lib/stepper/stepper.component.mjs +64 -0
  19. package/esm2022/lib/tabs/tabs.component.mjs +38 -0
  20. package/esm2022/lib/toast/toast.component.mjs +54 -0
  21. package/esm2022/lib/tool-tip/tool-tip.component.mjs +41 -0
  22. package/esm2022/public-api.mjs +23 -0
  23. package/esm2022/sarasanalytics-com-design-system.mjs +5 -0
  24. package/fesm2022/sarasanalytics-com-design-system.mjs +760 -0
  25. package/fesm2022/sarasanalytics-com-design-system.mjs.map +1 -0
  26. package/index.d.ts +5 -0
  27. package/interfaces/avatar-interface.d.ts +6 -0
  28. package/interfaces/button-interface.d.ts +12 -0
  29. package/interfaces/chip-interface.d.ts +11 -0
  30. package/interfaces/grid-interface.d.ts +24 -0
  31. package/interfaces/select-interface.d.ts +19 -0
  32. package/interfaces/tab-interface.d.ts +6 -0
  33. package/lib/avatar/avatar.component.d.ts +18 -0
  34. package/lib/button/button.component.d.ts +26 -0
  35. package/lib/calendar-header/calendar-header.component.d.ts +31 -0
  36. package/lib/chips/chips.component.d.ts +22 -0
  37. package/lib/component-library.component.d.ts +5 -0
  38. package/lib/component-library.service.d.ts +6 -0
  39. package/lib/datepicker/datepicker.component.d.ts +9 -0
  40. package/lib/form-select/form-select.component.d.ts +17 -0
  41. package/lib/grid-cell/grid-cell.component.d.ts +20 -0
  42. package/lib/header/header.component.d.ts +14 -0
  43. package/lib/stepper/stepper.component.d.ts +17 -0
  44. package/lib/tabs/tabs.component.d.ts +15 -0
  45. package/lib/toast/toast.component.d.ts +18 -0
  46. package/lib/tool-tip/tool-tip.component.d.ts +15 -0
  47. package/package.json +19 -68
  48. package/{projects/component-library/src/public-api.ts → public-api.d.ts} +1 -7
  49. package/.editorconfig +0 -16
  50. package/.eslintrc.json +0 -22
  51. package/.storybook/main.ts +0 -21
  52. package/.storybook/manager.ts +0 -17
  53. package/.storybook/preview-head.html +0 -5
  54. package/.storybook/preview.ts +0 -65
  55. package/.storybook/tsconfig.doc.json +0 -10
  56. package/.storybook/tsconfig.json +0 -11
  57. package/.storybook/typings.d.ts +0 -4
  58. package/.vscode/extensions.json +0 -7
  59. package/.vscode/launch.json +0 -20
  60. package/.vscode/settings.json +0 -13
  61. package/.vscode/tasks.json +0 -42
  62. package/angular.json +0 -189
  63. package/build-storybook.log +0 -39
  64. package/documentation.json +0 -0
  65. package/projects/component-library/README.md +0 -24
  66. package/projects/component-library/ng-package.json +0 -8
  67. package/projects/component-library/package.json +0 -12
  68. package/projects/component-library/src/interfaces/avatar-interface.ts +0 -6
  69. package/projects/component-library/src/interfaces/button-interface.ts +0 -12
  70. package/projects/component-library/src/interfaces/chip-interface.ts +0 -11
  71. package/projects/component-library/src/interfaces/grid-interface.ts +0 -24
  72. package/projects/component-library/src/interfaces/select-interface.ts +0 -19
  73. package/projects/component-library/src/interfaces/tab-interface.ts +0 -6
  74. package/projects/component-library/src/lib/avatar/avatar.component.css +0 -48
  75. package/projects/component-library/src/lib/avatar/avatar.component.html +0 -5
  76. package/projects/component-library/src/lib/avatar/avatar.component.spec.ts +0 -23
  77. package/projects/component-library/src/lib/avatar/avatar.component.ts +0 -50
  78. package/projects/component-library/src/lib/button/button.component.css +0 -145
  79. package/projects/component-library/src/lib/button/button.component.html +0 -11
  80. package/projects/component-library/src/lib/button/button.component.spec.ts +0 -23
  81. package/projects/component-library/src/lib/button/button.component.ts +0 -68
  82. package/projects/component-library/src/lib/calendar-header/calendar-header.component.css +0 -67
  83. package/projects/component-library/src/lib/calendar-header/calendar-header.component.html +0 -20
  84. package/projects/component-library/src/lib/calendar-header/calendar-header.component.spec.ts +0 -23
  85. package/projects/component-library/src/lib/calendar-header/calendar-header.component.ts +0 -196
  86. package/projects/component-library/src/lib/chips/chips.component.css +0 -129
  87. package/projects/component-library/src/lib/chips/chips.component.html +0 -17
  88. package/projects/component-library/src/lib/chips/chips.component.spec.ts +0 -23
  89. package/projects/component-library/src/lib/chips/chips.component.ts +0 -55
  90. package/projects/component-library/src/lib/component-library.component.spec.ts +0 -23
  91. package/projects/component-library/src/lib/component-library.component.ts +0 -16
  92. package/projects/component-library/src/lib/component-library.service.spec.ts +0 -16
  93. package/projects/component-library/src/lib/component-library.service.ts +0 -9
  94. package/projects/component-library/src/lib/datepicker/datepicker.component.css +0 -33
  95. package/projects/component-library/src/lib/datepicker/datepicker.component.html +0 -11
  96. package/projects/component-library/src/lib/datepicker/datepicker.component.spec.ts +0 -23
  97. package/projects/component-library/src/lib/datepicker/datepicker.component.ts +0 -37
  98. package/projects/component-library/src/lib/form-select/form-select.component.css +0 -156
  99. package/projects/component-library/src/lib/form-select/form-select.component.html +0 -38
  100. package/projects/component-library/src/lib/form-select/form-select.component.spec.ts +0 -23
  101. package/projects/component-library/src/lib/form-select/form-select.component.ts +0 -54
  102. package/projects/component-library/src/lib/grid-cell/grid-cell.component.css +0 -78
  103. package/projects/component-library/src/lib/grid-cell/grid-cell.component.html +0 -31
  104. package/projects/component-library/src/lib/grid-cell/grid-cell.component.spec.ts +0 -23
  105. package/projects/component-library/src/lib/grid-cell/grid-cell.component.ts +0 -89
  106. package/projects/component-library/src/lib/header/header.component.css +0 -62
  107. package/projects/component-library/src/lib/header/header.component.html +0 -23
  108. package/projects/component-library/src/lib/header/header.component.spec.ts +0 -23
  109. package/projects/component-library/src/lib/header/header.component.ts +0 -28
  110. package/projects/component-library/src/lib/stepper/stepper.component.css +0 -96
  111. package/projects/component-library/src/lib/stepper/stepper.component.html +0 -14
  112. package/projects/component-library/src/lib/stepper/stepper.component.spec.ts +0 -23
  113. package/projects/component-library/src/lib/stepper/stepper.component.ts +0 -61
  114. package/projects/component-library/src/lib/tabs/tabs.component.css +0 -100
  115. package/projects/component-library/src/lib/tabs/tabs.component.html +0 -16
  116. package/projects/component-library/src/lib/tabs/tabs.component.spec.ts +0 -23
  117. package/projects/component-library/src/lib/tabs/tabs.component.ts +0 -37
  118. package/projects/component-library/src/lib/toast/toast.component.css +0 -108
  119. package/projects/component-library/src/lib/toast/toast.component.html +0 -25
  120. package/projects/component-library/src/lib/toast/toast.component.spec.ts +0 -23
  121. package/projects/component-library/src/lib/toast/toast.component.ts +0 -37
  122. package/projects/component-library/src/lib/tool-tip/tool-tip.component.css +0 -139
  123. package/projects/component-library/src/lib/tool-tip/tool-tip.component.html +0 -31
  124. package/projects/component-library/src/lib/tool-tip/tool-tip.component.spec.ts +0 -23
  125. package/projects/component-library/src/lib/tool-tip/tool-tip.component.ts +0 -37
  126. package/projects/component-library/tsconfig.lib.json +0 -14
  127. package/projects/component-library/tsconfig.lib.prod.json +0 -10
  128. package/projects/component-library/tsconfig.spec.json +0 -14
  129. package/src/Saras-logo.svg +0 -15
  130. package/src/app/app.component.css +0 -13
  131. package/src/app/app.component.html +0 -77
  132. package/src/app/app.component.spec.ts +0 -29
  133. package/src/app/app.component.ts +0 -505
  134. package/src/app/app.config.ts +0 -27
  135. package/src/app/app.routes.ts +0 -3
  136. package/src/app/data.ts +0 -52
  137. package/src/app/kitchen-sink/kitchen-sink.component.css +0 -29
  138. package/src/app/kitchen-sink/kitchen-sink.component.html +0 -7
  139. package/src/app/kitchen-sink/kitchen-sink.component.spec.ts +0 -23
  140. package/src/app/kitchen-sink/kitchen-sink.component.ts +0 -92
  141. package/src/assets/.gitkeep +0 -0
  142. package/src/assets/Chevron.svg +0 -5
  143. package/src/assets/Frame.svg +0 -5
  144. package/src/assets/Grid.svg +0 -5
  145. package/src/assets/Location.svg +0 -5
  146. package/src/assets/Mail.svg +0 -5
  147. package/src/assets/Person.svg +0 -5
  148. package/src/assets/Scan.svg +0 -5
  149. package/src/assets/Sources.svg +0 -5
  150. package/src/assets/arrow.svg +0 -5
  151. package/src/assets/avatar.svg +0 -12
  152. package/src/assets/checkmark.svg +0 -5
  153. package/src/assets/crossmark.svg +0 -5
  154. package/src/assets/dot.svg +0 -5
  155. package/src/assets/negativemark.svg +0 -5
  156. package/src/assets/pointer-polygon.svg +0 -3
  157. package/src/assets/tick-icon.svg +0 -5
  158. package/src/assets/tick.svg +0 -8
  159. package/src/assets/warningmark.svg +0 -5
  160. package/src/custom-theme.scss +0 -37
  161. package/src/favicon.ico +0 -0
  162. package/src/index.html +0 -23
  163. package/src/main.ts +0 -6
  164. package/src/stories/GettingStarted.mdx +0 -233
  165. package/src/stories/KitchenSink.stories.ts +0 -86
  166. package/src/stories/avatar.stories.ts +0 -45
  167. package/src/stories/chips.stories.ts +0 -61
  168. package/src/stories/custom-button.stories.ts +0 -74
  169. package/src/stories/datepicker.stories.ts +0 -78
  170. package/src/stories/gridCell.stories.ts +0 -234
  171. package/src/stories/header.stories.ts +0 -61
  172. package/src/stories/selectInput.stories.ts +0 -158
  173. package/src/stories/stepper.stories.ts +0 -92
  174. package/src/stories/tabs.stories.ts +0 -97
  175. package/src/stories/toast.stories.ts +0 -54
  176. package/src/stories/tool-tip.stories.ts +0 -45
  177. package/src/styles.css +0 -204
  178. package/src/svg.d.ts +0 -1
  179. package/tsconfig.app.json +0 -14
  180. package/tsconfig.json +0 -42
  181. package/tsconfig.spec.json +0 -14
@@ -1,86 +0,0 @@
1
- // parent.component.stories.ts
2
- import { moduleMetadata, StoryFn, Meta } from '@storybook/angular';
3
- import { KitchenSinkComponent } from '../app/kitchen-sink/kitchen-sink.component';
4
- import { AvatarComponent } from '../../projects/component-library/src/public-api';
5
- import { ChipsComponent } from '../../projects/component-library/src/public-api';
6
- import { ButtonComponent } from '../../projects/component-library/src/public-api';
7
-
8
- export default {
9
- title: 'Kitchen Sink',
10
- component: KitchenSinkComponent,
11
- decorators: [
12
- moduleMetadata({
13
- imports: [KitchenSinkComponent],
14
- }),
15
- ],
16
- argTypes: {
17
- inputComponent: { control: 'object' },
18
- },
19
- } as Meta;
20
-
21
- const Template: StoryFn<KitchenSinkComponent> = (args: KitchenSinkComponent) => ({
22
- props: args,
23
- });
24
-
25
- export const _Avatar = Template.bind({});
26
- export const _Button = Template.bind({});
27
- export const _Chip = Template.bind({});
28
-
29
- _Avatar.args = {
30
- inputComponent: AvatarComponent,
31
- params: [
32
- ["../assets/avatar.svg", ""],
33
- ["extra-small", "small", "medium", "large", "extra-large"],
34
- ["AB"]
35
- ],
36
- paramTypes: ["imagePath", "size", "altText"]
37
- };
38
-
39
- _Button.args = {
40
- inputComponent: ButtonComponent,
41
- params: [
42
- ["primary", "outline", "transparent"],
43
- ["default", "error", "disabled"],
44
- ["small", "medium", "large"],
45
- ["Button"],
46
- ["../assets/Sources.svg"],
47
- ["both", "left", "right"],
48
- ["https://sarasanalytics.com"],
49
- ["self"]
50
- ],
51
- paramTypes: [
52
- "type",
53
- "state",
54
- "size",
55
- "text",
56
- "ImagePath",
57
- "iconPosition",
58
- "href",
59
- "hrefTarget"
60
- ]
61
- }
62
-
63
-
64
- _Chip.args = {
65
- inputComponent: ChipsComponent,
66
- params: [
67
- ["regular", "small", "large"],
68
- ["primary", "secondary", "neutral", "success", "error", "warning"],
69
- ["filled", "outline"],
70
- ["Chip text"],
71
- ["../assets/Frame.svg"],
72
- ["both", "left", "right"],
73
- ["../assets/dot.svg"],
74
- ["Good"],
75
- ],
76
- paramTypes: [
77
- "type",
78
- "state",
79
- "filling",
80
- "text",
81
- "iconPath",
82
- "iconPosition",
83
- "largeStateIcon",
84
- "largeStateText"
85
- ]
86
- };
@@ -1,45 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/angular';
2
- import { argsToTemplate } from '@storybook/angular';
3
- import { AvatarComponent } from '../../projects/component-library/src/lib/avatar/avatar.component';
4
-
5
- const meta: Meta<AvatarComponent> = {
6
- title: 'Avatar',
7
- component: AvatarComponent,
8
- tags: ['autodocs'],
9
- argTypes: {
10
- size: {
11
- options: ['extra-small', 'small', 'medium', 'large', 'extra-large'],
12
- control: { type: 'radio' },
13
- },
14
- altText: {
15
- description: "Alternate text that should be displayed if image doesn't exist or is broken"
16
- },
17
- onClickEvent: {
18
- action: "onClickEvent"
19
- },
20
- onMouseInEvent: {
21
- action: "onMouseInEvent"
22
- },
23
- onMouseOutEvent: {
24
- action: "onMouseOutEvent"
25
- },
26
- },
27
- render: (args) => ({
28
- props: {
29
- ...args,
30
- },
31
- template: `<sa-avatar ${argsToTemplate(args)}></sa-avatar>`
32
- }),
33
- };
34
-
35
- export default meta;
36
- type Story = StoryObj<AvatarComponent>;
37
-
38
-
39
- export const Avatar: Story = {
40
- args: {
41
- size: "medium",
42
- imagePath: "../assets/avatar.svg",
43
- altText: "AB"
44
- }
45
- };
@@ -1,61 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/angular';
2
- import { argsToTemplate } from '@storybook/angular';
3
- import { ChipsComponent } from '../../projects/component-library/src/lib/chips/chips.component';
4
-
5
-
6
- const meta: Meta<ChipsComponent> = {
7
- title: 'Chips',
8
- component: ChipsComponent,
9
- tags: ['autodocs'],
10
- argTypes: {
11
- largeStateIcon: {
12
- description: "This icon will be used when type is set to `large`.",
13
- },
14
- largeStateText: {
15
- description: "This text will be used next to `text` when type is set to `large`."
16
- },
17
- type: {
18
- options: ['regular', 'small', 'large'],
19
- control: { type: 'radio' },
20
- },
21
- state: {
22
- options: ['primary', 'secondary', 'neutral', 'error', 'warning', 'success'],
23
- control: { type: 'radio' },
24
- },
25
- filling: {
26
- options: ['outline', 'filled'],
27
- control: { type: 'radio' },
28
- },
29
- iconPosition: {
30
- description: "`''` renders no icon",
31
- options: ['left', 'right', 'both', ''],
32
- control: { type: 'radio' },
33
- },
34
- onClickEvent: {
35
- action: "onClickEvent"
36
- },
37
- },
38
- render: (args) => ({
39
- props: {
40
- ...args,
41
- },
42
- template: `<sa-chip ${argsToTemplate(args)}></sa-chip>`
43
- }),
44
- };
45
-
46
- export default meta;
47
- type Story = StoryObj<ChipsComponent>;
48
-
49
-
50
- export const chips: Story = {
51
- args: {
52
- iconPath: "../assets/Frame.svg",
53
- text: "Chip text",
54
- type: "regular",
55
- state: "success",
56
- filling: "outline",
57
- iconPosition: "both",
58
- largeStateIcon: "../assets/dot.svg",
59
- largeStateText: "Good",
60
- }
61
- };
@@ -1,74 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/angular';
2
- import { argsToTemplate } from '@storybook/angular';
3
- import { ButtonComponent } from '../../projects/component-library/src/lib/button/button.component';
4
-
5
- const meta: Meta<ButtonComponent> = {
6
- title: 'Button',
7
- component: ButtonComponent,
8
- tags: ['autodocs'],
9
- argTypes: {
10
- href: {
11
- description: "Button redirects to the link given here."
12
- },
13
- type: {
14
- options: ['primary', 'outline', 'transparent'],
15
- control: { type: 'radio' },
16
- },
17
- size: {
18
- options: ['small', 'medium', 'large'],
19
- control: { type: 'radio' },
20
- },
21
- state: {
22
- options: ['default', 'error', 'disabled'],
23
- control: { type: 'radio' },
24
- },
25
- iconPosition: {
26
- description: "`''` renders no icon",
27
- options: ['left', 'right', 'both', ''],
28
- control: { type: 'radio' },
29
- },
30
- hrefTarget: {
31
- options: ['blank', 'self'],
32
- control: { type: 'radio' },
33
- description: "Specifies where the `href` should be opened. (same tab or different tab)."
34
- },
35
- isSubmit: {
36
- options: [true, false],
37
- control: { type: 'boolean' },
38
- description: "Setting this `True`, Button will act as a submit button inside a form."
39
- },
40
- onClickEvent: {
41
- action: "onClickEvent"
42
- },
43
- onMouseInEvent: {
44
- action: "onMouseInEvent"
45
- },
46
- onMouseOutEvent: {
47
- action: "onMouseOutEvent"
48
- },
49
- },
50
- render: (args) => ({
51
- props: {
52
- ...args,
53
- },
54
- template: `<sa-button ${argsToTemplate(args)}></sa-button>`
55
- }),
56
- };
57
-
58
- export default meta;
59
- type Story = StoryObj<ButtonComponent>;
60
-
61
-
62
- export const default_button: Story = {
63
- args: {
64
- id: 1,
65
- text: "Button",
66
- type: "primary",
67
- size: "medium",
68
- state: "default",
69
- ImagePath: "../assets/Sources.svg",
70
- iconPosition: "both",
71
- href: "",
72
- hrefTarget: "blank",
73
- }
74
- };
@@ -1,78 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/angular';
2
- import { argsToTemplate } from '@storybook/angular';
3
- import { DatepickerComponent } from '../../projects/component-library/src/lib/datepicker/datepicker.component';
4
- import { MatFormFieldModule } from '@angular/material/form-field';
5
- import { MatInputModule } from '@angular/material/input';
6
- import { MatDatepickerModule } from '@angular/material/datepicker';
7
- import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
8
- import { moduleMetadata } from '@storybook/angular';
9
- import { CalendarHeaderComponent } from '../../projects/component-library/src/lib/calendar-header/calendar-header.component';
10
- import { MatIcon } from '@angular/material/icon';
11
-
12
- const meta: Meta<DatepickerComponent> = {
13
- title: 'Datepicker',
14
- component: DatepickerComponent,
15
- tags: ['autodocs'],
16
- decorators: [
17
- moduleMetadata({
18
- imports: [
19
- MatFormFieldModule,
20
- MatInputModule,
21
- MatDatepickerModule,
22
- BrowserAnimationsModule,
23
- CalendarHeaderComponent,
24
- MatIcon
25
- ]
26
- }),
27
- ],
28
- render: (args) => ({
29
- props: {
30
- ...args,
31
- },
32
- template: `<sa-datepicker ${argsToTemplate(args)}></sa-datepicker>`
33
- }),
34
- };
35
-
36
- export default meta;
37
- type Story = StoryObj<DatepickerComponent>;
38
-
39
-
40
- export const datepicker: Story = {
41
- args: {
42
- }
43
- };
44
-
45
- // import type { Meta, StoryObj } from '@storybook/angular';
46
- // import { moduleMetadata } from '@storybook/angular';
47
- // import { DatepickerComponent } from '../../projects/component-library/src/lib/datepicker/datepicker.component';
48
- // import { MatFormFieldModule } from '@angular/material/form-field';
49
- // import { MatInputModule } from '@angular/material/input';
50
- // import { MatDatepickerModule } from '@angular/material/datepicker';
51
- // import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
52
-
53
-
54
- // export default {
55
- // title: 'Datepicker',
56
- // component: DatepickerComponent,
57
- // decorators: [
58
- // moduleMetadata({
59
- // declarations: [],
60
- // imports: [
61
- // MatFormFieldModule,
62
- // MatInputModule,
63
- // MatDatepickerModule,
64
- // BrowserAnimationsModule,
65
- // ],
66
- // })
67
- // ]
68
- // } as Meta;
69
-
70
- // const Template: any = (args: DatepickerComponent) => ({
71
- // props: args,
72
- // });
73
-
74
- // export const Primary = Template.bind({});
75
- // Primary.args = {
76
- // start: new Date(),
77
- // end: new Date()
78
- // };
@@ -1,234 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/angular';
2
- import { argsToTemplate } from '@storybook/angular';
3
- import { GridInterface } from '../../projects/component-library/src/public-api';
4
- import { GridCellComponent } from '../../projects/component-library/src/public-api';
5
- import { moduleMetadata } from '@storybook/angular';
6
- import { AgGridAngular, AgGridModule } from 'ag-grid-angular';
7
-
8
-
9
- const meta: Meta<AgGridAngular> = {
10
- title: 'GridCell',
11
- component: AgGridAngular,
12
- tags: ['autodocs'],
13
- decorators: [
14
- moduleMetadata({ imports: [GridCellComponent, AgGridAngular, AgGridModule], }),
15
- ],
16
- argTypes: {
17
- rowData: {
18
- description: [
19
- "An array of objects.",
20
- "Each object in this array (lets call it `rowObj`) represents a row.",
21
- "The `keys` in `rowObj` takes the same name (lets call it `colName`) as columns in that row,",
22
- "and the values take `GridInterface` object describing how that cell is rendered and with what content.",
23
- "**Please use `GridInterface` to configure cells**."
24
- ].join(" ")
25
- },
26
- columnDefs: {
27
- description: [
28
- "An array of objects. Each object represents a column.",
29
- "The `field` attribute in this object must be same as `colName`(from `rowData`).",
30
- "`CellRenderer` should be set to `GridCellComponent`.",
31
- "Remaining parameters are common to general ag-grid configuration."
32
- ].join(" ")
33
- }
34
- },
35
- render: (args) => ({
36
- props: {
37
- ...args,
38
- },
39
- template: `
40
- <ag-grid-angular
41
- style="height: 300px;"
42
- [rowHeight]=50
43
- [headerHeight]=44
44
- [suppressCellFocus]=true
45
- ${argsToTemplate(args)}>
46
- </ag-grid-angular>
47
- `
48
- }),
49
- };
50
-
51
- export default meta;
52
- type Story = StoryObj<AgGridAngular>;
53
-
54
- const params: GridInterface = {
55
- cellType: '',
56
- viewText: false,
57
- viewLeadingIcon: false,
58
- viewTrailingIcon: false,
59
- viewButton: false,
60
- viewChip: false,
61
- viewAvatar: false,
62
- }
63
-
64
- const default_colDef = [{
65
- field: "TestField",
66
- headerComponentParams: {
67
- ...params,
68
- text: "Cell Text",
69
- cellType: "header",
70
- viewText: true
71
- },
72
- resizable: false,
73
- headerComponent: GridCellComponent,
74
- cellRenderer: GridCellComponent,
75
- }]
76
-
77
- export const Regular: Story = {
78
- args: {
79
- rowData: [{
80
- TestField: {
81
- ...params,
82
- viewText: true,
83
- cellType: 'row',
84
- text: 1,
85
- }
86
- },
87
- {
88
- TestField: {
89
- ...params,
90
- viewText: true,
91
- cellType: 'row',
92
- text: 2,
93
- }
94
- }],
95
- columnDefs: default_colDef
96
- }
97
- };
98
-
99
- export const Numeric: Story = {
100
- args: {
101
- rowData: [{
102
- TestField: {
103
- ...params,
104
- viewText: true,
105
- cellType: 'numeric',
106
- text: 1,
107
- },
108
- }],
109
- columnDefs: default_colDef
110
- }
111
- };
112
-
113
- export const Text_SubText: Story = {
114
- args: {
115
- rowData: [{
116
- TestField: {
117
- ...params,
118
- viewText: true,
119
- cellType: "row",
120
- text: "Nithish",
121
- subText: "Developer",
122
- },
123
- }],
124
- columnDefs: default_colDef
125
- }
126
- };
127
-
128
-
129
- export const leadingIcon: Story = {
130
- args: {
131
- rowData: [{
132
- TestField: {
133
- ...params,
134
- viewText: true,
135
- viewLeadingIcon: true,
136
- iconPath: '../assets/Scan.svg',
137
- cellType: 'Row',
138
- text: "Cell Name",
139
- },
140
- }],
141
- columnDefs: default_colDef
142
- }
143
- };
144
-
145
- export const Chip: Story = {
146
- args: {
147
- rowData: [{
148
- TestField: {
149
- ...params,
150
- viewChip: true,
151
- cellType: 'Row',
152
- chipConfig: [
153
- {
154
- id: 0,
155
- text: "Chip text",
156
- type: 'primary',
157
- state: 'regular',
158
- filling: 'filled',
159
- iconPath: '../assets/Frame.svg',
160
- iconPosition: 'left',
161
- largeStateIcon: '',
162
- largeStateText: '',
163
- }
164
- ],
165
- chipClicked: (evt: Event) => {
166
- console.log(evt);
167
- }
168
- },
169
- }],
170
- columnDefs: default_colDef
171
- }
172
- };
173
-
174
- export const Interactive: Story = {
175
- args: {
176
- rowData: [{
177
- TestField: {
178
- ...params,
179
- viewText: true,
180
- cellType: 'interactive',
181
- interactiveLink: '',
182
- interactiveLinkTarget: 'blank',
183
- text: "Cell Name",
184
- },
185
- }],
186
- columnDefs: default_colDef
187
- }
188
- };
189
-
190
- export const Button: Story = {
191
- args: {
192
- rowData: [{
193
- TestField: {
194
- ...params,
195
- viewButton: true,
196
- cellType: 'Row',
197
- buttonConfig: {
198
- id: 0,
199
- type: 'primary',
200
- state: 'default',
201
- size: 'small',
202
- text: 'Button',
203
- imagePath: '../assets/Sources.svg',
204
- iconPosition: 'right',
205
- href: "",
206
- hrefTarget: 'blank',
207
- }
208
- },
209
- }],
210
- columnDefs: default_colDef
211
- }
212
- };
213
-
214
- export const Avatar: Story = {
215
- args: {
216
- rowData: [{
217
- TestField: {
218
- ...params,
219
- viewText: true,
220
- cellType: "row",
221
- avatarConfig: {
222
- id: 0,
223
- size: 'small',
224
- imagePath: '../assets/avatar.svg',
225
- altText: 'AB'
226
- },
227
- viewAvatar: true,
228
- text: "Nithish",
229
- subText: "Developer",
230
- },
231
- }],
232
- columnDefs: default_colDef
233
- }
234
- };
@@ -1,61 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/angular';
2
- import { argsToTemplate } from '@storybook/angular';
3
- import { HeaderComponent } from '../../projects/component-library/src/lib/header/header.component';
4
-
5
- const meta: Meta<HeaderComponent> = {
6
- title: 'Header',
7
- component: HeaderComponent,
8
- tags: ['autodocs'],
9
- argTypes: {
10
- mainButtonClicked: {
11
- action: "mainButtonClicked"
12
- },
13
- helperButtonClicked: {
14
- action: "helperButtonClicked"
15
- },
16
- info: {
17
- description: "Two dimensional array of strings containing label and it's icon address."
18
- }
19
- },
20
- render: (args) => ({
21
- props: {
22
- ...args,
23
- },
24
- template: `<sa-header ${argsToTemplate(args)}></sa-header>`
25
- }),
26
- };
27
-
28
- export default meta;
29
- type Story = StoryObj<HeaderComponent>;
30
-
31
- export const Default: Story = {
32
- args: {
33
- info: [
34
- ["Info Text 1", "../assets/Person.svg"],
35
- ["Info Text 2", "../assets/Location.svg"],
36
- ["Info Text 3", "../assets/Mail.svg"]
37
- ],
38
- buttonMain: "+ Button",
39
- buttonHelper: "Helper",
40
- headerName: "Header"
41
- }
42
- };
43
-
44
- export const With_Chips: Story = {
45
- args: {
46
- info: [
47
- ["Info Text 1", "../assets/Person.svg"],
48
- ["Info Text 2", "../assets/Location.svg"],
49
- ["Info Text 3", "../assets/Mail.svg"]
50
- ],
51
- chipConfig: [
52
- ["Chip 1", "success"],
53
- ["Chip 2", "warning"],
54
- ["Chip 3", "error"],
55
- ],
56
- buttonMain: "+ Button",
57
- buttonHelper: "Helper",
58
- headerName: "Header"
59
- }
60
- };
61
-