@enki-tek/fms-web-components 0.0.1 → 0.0.3

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 (106) hide show
  1. package/README.md +1 -1
  2. package/app.scss +1 -1
  3. package/components/Accordion/Accordion.scss +30 -0
  4. package/components/Accordion/Accordion.stories.d.ts +20 -0
  5. package/components/Accordion/Accordion.stories.js +30 -0
  6. package/components/Accordion/Accordion.svelte +617 -0
  7. package/components/Accordion/Accordion.svelte.d.ts +17 -0
  8. package/components/Alert/Alert.scss +25 -0
  9. package/components/Alert/Alert.stories.d.ts +54 -0
  10. package/components/Alert/Alert.stories.js +46 -0
  11. package/components/Alert/Alert.svelte +29 -0
  12. package/components/Alert/Alert.svelte.d.ts +19 -0
  13. package/components/Badge/Badge.scss +8 -0
  14. package/components/Badge/Badge.stories.d.ts +75 -0
  15. package/components/Badge/Badge.stories.js +55 -0
  16. package/components/Badge/Badge.svelte +587 -0
  17. package/components/Badge/Badge.svelte.d.ts +17 -0
  18. package/components/Badge/BadgeConfig.d.ts +10 -0
  19. package/components/Badge/BadgeConfig.js +34 -0
  20. package/components/Breadcrumb/Breadcrumb.scss +26 -0
  21. package/components/Breadcrumb/Breadcrumb.stories.d.ts +23 -0
  22. package/components/Breadcrumb/Breadcrumb.stories.js +20 -0
  23. package/components/Breadcrumb/Breadcrumb.svelte +603 -0
  24. package/components/Breadcrumb/Breadcrumb.svelte.d.ts +16 -0
  25. package/components/Button/Button.scss +706 -0
  26. package/components/Button/Button.stories.d.ts +96 -27
  27. package/components/Button/Button.stories.js +99 -38
  28. package/components/Button/Button.svelte +1125 -10
  29. package/components/Button/Button.svelte.d.ts +43 -9
  30. package/components/Button/buttonConfig.d.ts +38 -0
  31. package/components/Button/buttonConfig.js +203 -0
  32. package/components/Card/Card.scss +39 -0
  33. package/components/Card/Card.stories.d.ts +59 -0
  34. package/components/Card/Card.stories.js +42 -0
  35. package/components/Card/Card.svelte +123 -0
  36. package/components/Card/Card.svelte.d.ts +51 -0
  37. package/components/CheckBox/Checkbox.scss +32 -0
  38. package/components/CheckBox/Checkbox.stories.d.ts +94 -0
  39. package/components/CheckBox/Checkbox.stories.js +51 -0
  40. package/components/CheckBox/Checkbox.svelte +614 -0
  41. package/components/CheckBox/Checkbox.svelte.d.ts +31 -0
  42. package/components/Dropdown/Dropdown.scss +72 -0
  43. package/components/Dropdown/Dropdown.stories.d.ts +29 -0
  44. package/components/Dropdown/Dropdown.stories.js +19 -0
  45. package/components/Dropdown/Dropdown.svelte +646 -0
  46. package/components/Dropdown/Dropdown.svelte.d.ts +17 -0
  47. package/components/Header/Header.scss +54 -0
  48. package/components/Header/Header.stories.d.ts +28 -0
  49. package/components/Header/Header.stories.js +28 -0
  50. package/components/Header/Header.svelte +667 -0
  51. package/components/Header/Header.svelte.d.ts +27 -0
  52. package/components/Icon/Icon.scss +0 -0
  53. package/components/Icon/Icon.stories.d.ts +21 -0
  54. package/components/Icon/Icon.stories.js +18 -0
  55. package/components/Icon/Icon.svelte +7 -0
  56. package/components/Icon/Icon.svelte.d.ts +23 -0
  57. package/components/ModalWindow/Modal.scss +28 -0
  58. package/components/ModalWindow/Modal.stories.d.ts +29 -0
  59. package/components/ModalWindow/Modal.stories.js +20 -0
  60. package/components/ModalWindow/Modal.svelte +641 -0
  61. package/components/ModalWindow/Modal.svelte.d.ts +23 -0
  62. package/components/Pagination/Pagination.scss +83 -0
  63. package/components/Pagination/Pagination.stories.d.ts +29 -0
  64. package/components/Pagination/Pagination.stories.js +18 -0
  65. package/components/Pagination/Pagination.svelte +702 -0
  66. package/components/Pagination/Pagination.svelte.d.ts +18 -0
  67. package/components/RadioButton/RadioButton.scss +28 -0
  68. package/components/RadioButton/RadioButton.stories.d.ts +35 -0
  69. package/components/RadioButton/RadioButton.stories.js +25 -0
  70. package/components/RadioButton/RadioButton.svelte +616 -0
  71. package/components/RadioButton/RadioButton.svelte.d.ts +41 -0
  72. package/components/Sidebar/Sidebar.scss +87 -0
  73. package/components/Sidebar/Sidebar.stories.d.ts +28 -0
  74. package/components/Sidebar/Sidebar.stories.js +27 -0
  75. package/components/Sidebar/Sidebar.svelte +144 -0
  76. package/components/Sidebar/Sidebar.svelte.d.ts +31 -0
  77. package/components/Switches/Switch.scss +12 -0
  78. package/components/Switches/Switch.stories.d.ts +87 -0
  79. package/components/Switches/Switch.stories.js +50 -0
  80. package/components/Switches/Switch.svelte +595 -0
  81. package/components/Switches/Switch.svelte.d.ts +29 -0
  82. package/components/Tab/Tab.scss +30 -0
  83. package/components/Tab/Tab.stories.d.ts +23 -0
  84. package/components/Tab/Tab.stories.js +19 -0
  85. package/components/Tab/Tab.svelte +615 -0
  86. package/components/Tab/Tab.svelte.d.ts +19 -0
  87. package/components/Table/Table.scss +38 -0
  88. package/components/Table/Table.stories.d.ts +28 -0
  89. package/components/Table/Table.stories.js +21 -0
  90. package/components/Table/Table.svelte +137 -0
  91. package/components/Table/Table.svelte.d.ts +35 -0
  92. package/components/Tooltip/Tooltip.scss +29 -0
  93. package/components/Tooltip/Tooltip.stories.d.ts +40 -0
  94. package/components/Tooltip/Tooltip.stories.js +24 -0
  95. package/components/Tooltip/Tooltip.svelte +622 -0
  96. package/components/Tooltip/Tooltip.svelte.d.ts +21 -0
  97. package/components/common.scss +789 -0
  98. package/components/textField/TextField.scss +34 -0
  99. package/components/textField/TextField.stories.d.ts +85 -0
  100. package/components/textField/TextField.stories.js +32 -0
  101. package/components/textField/TextField.svelte +607 -0
  102. package/components/textField/TextField.svelte.d.ts +33 -0
  103. package/components/variable.scss +134 -0
  104. package/index.d.ts +17 -1
  105. package/index.js +17 -1
  106. package/package.json +60 -1
@@ -0,0 +1,137 @@
1
+ <script>
2
+ import { Table } from 'sveltestrap';
3
+ import Icon from '../Icon/Icon.svelte';
4
+ import Button from '../Button/Button.svelte';
5
+ import Badge from '../Badge/Badge.svelte';
6
+
7
+ // Declare props for header and tableData
8
+ export let header = ['First Name', 'Last Name', 'User Name', 'Status', ];
9
+ export let tableData = [
10
+ { 'First Name': 'Mark', 'Last Name': 'Otto', 'User Name': '@Mdo', Status: 'progress' },
11
+ { 'First Name': 'Jacob', 'Last Name': 'Tornando', 'User Name': '@fat', Status: 'Active' },
12
+ { 'First Name': 'Pooja', 'Last Name': 'Krishna', 'User Name': '@pooja', Status: 'waiting' }
13
+ ];
14
+
15
+ // State to track the index of the row currently being edited
16
+ let editingIndex = null;
17
+ let editingRow = null;
18
+
19
+ // Function to start editing a row
20
+ function editRow(index) {
21
+ editingIndex = index;
22
+ editingRow = { ...tableData[index] };
23
+ }
24
+
25
+ // Function to save the edited row
26
+ function saveRow() {
27
+ if (editingIndex !== null) {
28
+ tableData[editingIndex] = editingRow;
29
+ editingIndex = null;
30
+ editingRow = null;
31
+ }
32
+ }
33
+ // Function to handle input change
34
+ function handleInputChange(event, key) {
35
+ editingRow[key] = event.target.value;
36
+ }
37
+
38
+ function deleteRow(rowToBeDeleted) {
39
+ tableData = tableData.filter((row) => row !== rowToBeDeleted);
40
+ }
41
+ </script>
42
+
43
+ <Table size="sm" class="table table-hover">
44
+ <thead>
45
+ <tr>
46
+ <th>#</th>
47
+ {#each header as columnHeading}
48
+ <!-- <th>{columnHeading === 'Status' ? ' ' : columnHeading}</th> -->
49
+ <th>
50
+ {#if columnHeading === "Status"}
51
+ {""}
52
+ {:else if columnHeading ==="Action"}
53
+ {""}
54
+ {:else}
55
+ {columnHeading }
56
+ {/if}
57
+ </th>
58
+ {/each}
59
+ <th>Actions</th>
60
+ </tr>
61
+ </thead>
62
+ <tbody>
63
+ {#each tableData as row, index}
64
+ <tr>
65
+ <td class="index">{index + 1}</td>
66
+ {#if editingIndex === index}
67
+ {#each header as key}
68
+ <td class="table-data">
69
+ <!-- If this row is being edited, render an input field -->
70
+ <input
71
+ type="text"
72
+ bind:value={editingRow[key]}
73
+ on:input={(event) => handleInputChange(event, key)}
74
+ />
75
+ </td>
76
+ {/each}
77
+ <td>
78
+ <Button config="successBtnSmall" on:click={saveRow}>Save</Button>
79
+ </td>
80
+ {:else}
81
+ {#each header as key}
82
+ <td>
83
+ {#if row[key] === 'progress'}
84
+ <Badge config="primaryLight" label={row['Status']} />
85
+ {:else if row[key] === 'Active'}
86
+ <Badge config="secondaryLight" label={row['Status']} />
87
+ {:else if row[key] === 'waiting'}
88
+ <Badge config="yellow" label={row['Status']} />
89
+ {:else}
90
+ {row[key]}
91
+ {/if}
92
+ </td>
93
+ {/each}
94
+ <td>
95
+ <div class="icons">
96
+ <div class="icon-edit" on:click={() => editRow(index)}>
97
+ <Icon iconName="pencil" />
98
+ </div>
99
+ <div class="icon-trash" on:click={() => deleteRow(row)}>
100
+ <Icon iconName="trash" />
101
+ </div>
102
+ </div>
103
+ </td>
104
+ {/if}
105
+ </tr>
106
+ {/each}
107
+ </tbody>
108
+ </Table>
109
+
110
+ <style>@import url(https://fonts.googleapis.com/icon?family=Material+Icons);
111
+ @import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");
112
+ @import url("https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,300;0,400;0,700;0,900;1,300;1,400;1,700;1,900&display=swap");
113
+ tr .index, tbody tr td, thead tr th {
114
+ color: #152536;
115
+ font-size: 16px;
116
+ font-style: normal;
117
+ font-weight: 700;
118
+ font-family: Roboto;
119
+ }
120
+ thead tr th {
121
+ font-size: 17px;
122
+ }
123
+ tbody tr td {
124
+ width: 12.5rem;
125
+ padding: 0.5rem 0.5rem 0.5625rem 0.5rem;
126
+ font-weight: 400;
127
+ }
128
+ .icons {
129
+ display: flex;
130
+ gap: 0.5rem;
131
+ }
132
+ .icon-edit {
133
+ color: rgb(13, 110, 253);
134
+ }
135
+ .icon-trash {
136
+ color: #FE4747;
137
+ }</style>
@@ -0,0 +1,35 @@
1
+ /** @typedef {typeof __propDef.props} TableProps */
2
+ /** @typedef {typeof __propDef.events} TableEvents */
3
+ /** @typedef {typeof __propDef.slots} TableSlots */
4
+ export default class Table extends SvelteComponentTyped<{
5
+ header?: string[] | undefined;
6
+ tableData?: {
7
+ 'First Name': string;
8
+ 'Last Name': string;
9
+ 'User Name': string;
10
+ Status: string;
11
+ }[] | undefined;
12
+ }, {
13
+ [evt: string]: CustomEvent<any>;
14
+ }, {}> {
15
+ }
16
+ export type TableProps = typeof __propDef.props;
17
+ export type TableEvents = typeof __propDef.events;
18
+ export type TableSlots = typeof __propDef.slots;
19
+ import { SvelteComponentTyped } from "svelte";
20
+ declare const __propDef: {
21
+ props: {
22
+ header?: string[] | undefined;
23
+ tableData?: {
24
+ 'First Name': string;
25
+ 'Last Name': string;
26
+ 'User Name': string;
27
+ Status: string;
28
+ }[] | undefined;
29
+ };
30
+ events: {
31
+ [evt: string]: CustomEvent<any>;
32
+ };
33
+ slots: {};
34
+ };
35
+ export {};
@@ -0,0 +1,29 @@
1
+ @import './../variable.scss';
2
+ @import './../common.scss';
3
+
4
+ .label {
5
+ @extend %efs-normal;
6
+ color: $white;
7
+ font-size: 16px;
8
+ line-height: 22px;
9
+ }
10
+
11
+ :global(.tooltip-inner) {
12
+ background-color: $primary-dark;
13
+ }
14
+
15
+ :global(.bs-tooltip-end .tooltip-arrow::before) {
16
+ border-right-color: $primary-dark;
17
+ }
18
+
19
+ :global(.tooltip.bs-tooltip-start .tooltip-arrow::before) {
20
+ border-left-color: $primary-dark;
21
+ }
22
+
23
+ :global(.tooltip.bs-tooltip-top .tooltip-arrow::before) {
24
+ border-top-color: $primary-dark;
25
+ }
26
+
27
+ :global(.tooltip.bs-tooltip-bottom .tooltip-arrow::before) {
28
+ border-bottom-color: $primary-dark;
29
+ }
@@ -0,0 +1,40 @@
1
+ declare namespace _default {
2
+ export const title: string;
3
+ export { Tooltip as component };
4
+ export const tags: string[];
5
+ export namespace argTypes {
6
+ namespace placement {
7
+ namespace control {
8
+ const type: string;
9
+ }
10
+ const options: string[];
11
+ }
12
+ namespace target {
13
+ export namespace control_1 {
14
+ const type_1: string;
15
+ export { type_1 as type };
16
+ }
17
+ export { control_1 as control };
18
+ }
19
+ namespace dealy {
20
+ export namespace control_2 {
21
+ const type_2: string;
22
+ export { type_2 as type };
23
+ }
24
+ export { control_2 as control };
25
+ }
26
+ }
27
+ }
28
+ export default _default;
29
+ export namespace Default {
30
+ namespace args {
31
+ const placement_1: string;
32
+ export { placement_1 as placement };
33
+ const target_1: string;
34
+ export { target_1 as target };
35
+ const dealy_1: number;
36
+ export { dealy_1 as dealy };
37
+ export const label: string;
38
+ }
39
+ }
40
+ import Tooltip from "./Tooltip.svelte";
@@ -0,0 +1,24 @@
1
+ import Tooltip from "./Tooltip.svelte";
2
+
3
+ export default {
4
+ title: 'FMS/Tooltip',
5
+ component: Tooltip,
6
+ tags: ['autodocs'],
7
+ argTypes: {
8
+ placement: {
9
+ control: { type: 'select' },
10
+ options: ['right', 'left', 'top', 'bottom']
11
+ },
12
+ target: { control: { type: 'text' } },
13
+ dealy: { control: { type: 'number' } },
14
+ }
15
+ }
16
+
17
+ export const Default = {
18
+ args: {
19
+ placement: 'right',
20
+ target: 'btn-right-html',
21
+ dealy: 500,
22
+ label:"Tooltip to Display"
23
+ }
24
+ }