@terraware/web-components 1.0.3 → 1.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.
- package/components/Autocomplete.d.ts +16 -0
- package/components/Autocomplete.d.ts.map +1 -0
- package/components/Autocomplete.js +53 -0
- package/components/Button/Button.d.ts +18 -0
- package/components/Button/Button.d.ts.map +1 -0
- package/components/Button/Button.js +42 -0
- package/components/Button/button.test.d.ts +2 -0
- package/components/Button/button.test.d.ts.map +1 -0
- package/components/Button/button.test.js +33 -0
- package/components/Button/styles.scss +443 -0
- package/components/Checkbox.d.ts +12 -0
- package/components/Checkbox.d.ts.map +1 -0
- package/components/Checkbox.js +33 -0
- package/components/DatePicker.d.ts +19 -0
- package/components/DatePicker.d.ts.map +1 -0
- package/components/DatePicker.js +45 -0
- package/components/DialogBox/DialogBox.d.ts +16 -0
- package/components/DialogBox/DialogBox.d.ts.map +1 -0
- package/components/DialogBox/DialogBox.js +85 -0
- package/components/DialogBox/styles.scss +138 -0
- package/components/Divisor.d.ts +6 -0
- package/components/Divisor.d.ts.map +1 -0
- package/components/Divisor.js +24 -0
- package/components/Dropdown.d.ts +15 -0
- package/components/Dropdown.d.ts.map +1 -0
- package/components/Dropdown.js +59 -0
- package/components/Icon/Icon.d.ts +11 -0
- package/components/Icon/Icon.d.ts.map +1 -0
- package/components/Icon/Icon.js +25 -0
- package/components/Icon/icons/assets/BlobbyGrayIconUploadToTheCloud.d.ts +8 -0
- package/components/Icon/icons/assets/BlobbyGrayIconUploadToTheCloud.d.ts.map +1 -0
- package/components/Icon/icons/assets/BlobbyGrayIconUploadToTheCloud.js +41 -0
- package/components/Icon/icons/assets/BlobbyIconHappy.d.ts +8 -0
- package/components/Icon/icons/assets/BlobbyIconHappy.d.ts.map +1 -0
- package/components/Icon/icons/assets/BlobbyIconHappy.js +165 -0
- package/components/Icon/icons/assets/BlobbyIconHeartMonitor.d.ts +8 -0
- package/components/Icon/icons/assets/BlobbyIconHeartMonitor.d.ts.map +1 -0
- package/components/Icon/icons/assets/BlobbyIconHeartMonitor.js +165 -0
- package/components/Icon/icons/assets/BlobbyIconLeaf.d.ts +8 -0
- package/components/Icon/icons/assets/BlobbyIconLeaf.d.ts.map +1 -0
- package/components/Icon/icons/assets/BlobbyIconLeaf.js +165 -0
- package/components/Icon/icons/assets/BlobbyIconLibrary.d.ts +8 -0
- package/components/Icon/icons/assets/BlobbyIconLibrary.d.ts.map +1 -0
- package/components/Icon/icons/assets/BlobbyIconLibrary.js +165 -0
- package/components/Icon/icons/assets/BlobbyIconOrganization.d.ts +8 -0
- package/components/Icon/icons/assets/BlobbyIconOrganization.d.ts.map +1 -0
- package/components/Icon/icons/assets/BlobbyIconOrganization.js +158 -0
- package/components/Icon/icons/assets/BlobbyIconPeople.d.ts +8 -0
- package/components/Icon/icons/assets/BlobbyIconPeople.d.ts.map +1 -0
- package/components/Icon/icons/assets/BlobbyIconPeople.js +158 -0
- package/components/Icon/icons/assets/BlobbyIconSeedBank.d.ts +8 -0
- package/components/Icon/icons/assets/BlobbyIconSeedBank.d.ts.map +1 -0
- package/components/Icon/icons/assets/BlobbyIconSeedBank.js +165 -0
- package/components/Icon/icons/assets/BlobbyIconWrench.d.ts +8 -0
- package/components/Icon/icons/assets/BlobbyIconWrench.d.ts.map +1 -0
- package/components/Icon/icons/assets/BlobbyIconWrench.js +165 -0
- package/components/Icon/icons/assets/Bug.d.ts +8 -0
- package/components/Icon/icons/assets/Bug.d.ts.map +1 -0
- package/components/Icon/icons/assets/Bug.js +36 -0
- package/components/Icon/icons/assets/Calendar.d.ts +8 -0
- package/components/Icon/icons/assets/Calendar.d.ts.map +1 -0
- package/components/Icon/icons/assets/Calendar.js +35 -0
- package/components/Icon/icons/assets/CaretDown.d.ts +8 -0
- package/components/Icon/icons/assets/CaretDown.d.ts.map +1 -0
- package/components/Icon/icons/assets/CaretDown.js +35 -0
- package/components/Icon/icons/assets/CaretLeft.d.ts +8 -0
- package/components/Icon/icons/assets/CaretLeft.d.ts.map +1 -0
- package/components/Icon/icons/assets/CaretLeft.js +35 -0
- package/components/Icon/icons/assets/CaretUp.d.ts +8 -0
- package/components/Icon/icons/assets/CaretUp.d.ts.map +1 -0
- package/components/Icon/icons/assets/CaretUp.js +35 -0
- package/components/Icon/icons/assets/ChevronDown.d.ts +8 -0
- package/components/Icon/icons/assets/ChevronDown.d.ts.map +1 -0
- package/components/Icon/icons/assets/ChevronDown.js +36 -0
- package/components/Icon/icons/assets/ChevronUp.d.ts +8 -0
- package/components/Icon/icons/assets/ChevronUp.d.ts.map +1 -0
- package/components/Icon/icons/assets/ChevronUp.js +35 -0
- package/components/Icon/icons/assets/Close.d.ts +8 -0
- package/components/Icon/icons/assets/Close.d.ts.map +1 -0
- package/components/Icon/icons/assets/Close.js +35 -0
- package/components/Icon/icons/assets/Critical.d.ts +8 -0
- package/components/Icon/icons/assets/Critical.d.ts.map +1 -0
- package/components/Icon/icons/assets/Critical.js +35 -0
- package/components/Icon/icons/assets/Edit.d.ts +8 -0
- package/components/Icon/icons/assets/Edit.d.ts.map +1 -0
- package/components/Icon/icons/assets/Edit.js +158 -0
- package/components/Icon/icons/assets/Error.d.ts +8 -0
- package/components/Icon/icons/assets/Error.d.ts.map +1 -0
- package/components/Icon/icons/assets/Error.js +35 -0
- package/components/Icon/icons/assets/Export.d.ts +8 -0
- package/components/Icon/icons/assets/Export.d.ts.map +1 -0
- package/components/Icon/icons/assets/Export.js +36 -0
- package/components/Icon/icons/assets/Filter.d.ts +8 -0
- package/components/Icon/icons/assets/Filter.d.ts.map +1 -0
- package/components/Icon/icons/assets/Filter.js +36 -0
- package/components/Icon/icons/assets/Folder.d.ts +8 -0
- package/components/Icon/icons/assets/Folder.d.ts.map +1 -0
- package/components/Icon/icons/assets/Folder.js +35 -0
- package/components/Icon/icons/assets/Help.d.ts +8 -0
- package/components/Icon/icons/assets/Help.d.ts.map +1 -0
- package/components/Icon/icons/assets/Help.js +35 -0
- package/components/Icon/icons/assets/Home.d.ts +8 -0
- package/components/Icon/icons/assets/Home.d.ts.map +1 -0
- package/components/Icon/icons/assets/Home.js +35 -0
- package/components/Icon/icons/assets/IconCancel.d.ts +8 -0
- package/components/Icon/icons/assets/IconCancel.d.ts.map +1 -0
- package/components/Icon/icons/assets/IconCancel.js +36 -0
- package/components/Icon/icons/assets/IconChargingBattery.d.ts +8 -0
- package/components/Icon/icons/assets/IconChargingBattery.d.ts.map +1 -0
- package/components/Icon/icons/assets/IconChargingBattery.js +36 -0
- package/components/Icon/icons/assets/IconCheckmark.d.ts +8 -0
- package/components/Icon/icons/assets/IconCheckmark.d.ts.map +1 -0
- package/components/Icon/icons/assets/IconCheckmark.js +36 -0
- package/components/Icon/icons/assets/IconDashboard.d.ts +8 -0
- package/components/Icon/icons/assets/IconDashboard.d.ts.map +1 -0
- package/components/Icon/icons/assets/IconDashboard.js +36 -0
- package/components/Icon/icons/assets/IconHeartMonitor.d.ts +8 -0
- package/components/Icon/icons/assets/IconHeartMonitor.d.ts.map +1 -0
- package/components/Icon/icons/assets/IconHeartMonitor.js +35 -0
- package/components/Icon/icons/assets/IconMail.d.ts +8 -0
- package/components/Icon/icons/assets/IconMail.d.ts.map +1 -0
- package/components/Icon/icons/assets/IconMail.js +36 -0
- package/components/Icon/icons/assets/IconManager.d.ts +8 -0
- package/components/Icon/icons/assets/IconManager.d.ts.map +1 -0
- package/components/Icon/icons/assets/IconManager.js +36 -0
- package/components/Icon/icons/assets/IconMenu.d.ts +8 -0
- package/components/Icon/icons/assets/IconMenu.d.ts.map +1 -0
- package/components/Icon/icons/assets/IconMenu.js +36 -0
- package/components/Icon/icons/assets/IconOrg.d.ts +8 -0
- package/components/Icon/icons/assets/IconOrg.d.ts.map +1 -0
- package/components/Icon/icons/assets/IconOrg.js +36 -0
- package/components/Icon/icons/assets/IconSeedBank.d.ts +8 -0
- package/components/Icon/icons/assets/IconSeedBank.d.ts.map +1 -0
- package/components/Icon/icons/assets/IconSeedBank.js +35 -0
- package/components/Icon/icons/assets/IconWifi.d.ts +8 -0
- package/components/Icon/icons/assets/IconWifi.d.ts.map +1 -0
- package/components/Icon/icons/assets/IconWifi.js +36 -0
- package/components/Icon/icons/assets/Info.d.ts +8 -0
- package/components/Icon/icons/assets/Info.d.ts.map +1 -0
- package/components/Icon/icons/assets/Info.js +35 -0
- package/components/Icon/icons/assets/Key.d.ts +8 -0
- package/components/Icon/icons/assets/Key.d.ts.map +1 -0
- package/components/Icon/icons/assets/Key.js +35 -0
- package/components/Icon/icons/assets/Leaf.d.ts +8 -0
- package/components/Icon/icons/assets/Leaf.d.ts.map +1 -0
- package/components/Icon/icons/assets/Leaf.js +35 -0
- package/components/Icon/icons/assets/Lock.d.ts +8 -0
- package/components/Icon/icons/assets/Lock.d.ts.map +1 -0
- package/components/Icon/icons/assets/Lock.js +34 -0
- package/components/Icon/icons/assets/MenuVertical.d.ts +8 -0
- package/components/Icon/icons/assets/MenuVertical.d.ts.map +1 -0
- package/components/Icon/icons/assets/MenuVertical.js +36 -0
- package/components/Icon/icons/assets/Notification.d.ts +8 -0
- package/components/Icon/icons/assets/Notification.d.ts.map +1 -0
- package/components/Icon/icons/assets/Notification.js +35 -0
- package/components/Icon/icons/assets/Person.d.ts +8 -0
- package/components/Icon/icons/assets/Person.d.ts.map +1 -0
- package/components/Icon/icons/assets/Person.js +35 -0
- package/components/Icon/icons/assets/Plus.d.ts +8 -0
- package/components/Icon/icons/assets/Plus.d.ts.map +1 -0
- package/components/Icon/icons/assets/Plus.js +35 -0
- package/components/Icon/icons/assets/RestorationSite.d.ts +8 -0
- package/components/Icon/icons/assets/RestorationSite.d.ts.map +1 -0
- package/components/Icon/icons/assets/RestorationSite.js +35 -0
- package/components/Icon/icons/assets/Search.d.ts +8 -0
- package/components/Icon/icons/assets/Search.d.ts.map +1 -0
- package/components/Icon/icons/assets/Search.js +35 -0
- package/components/Icon/icons/assets/Seeds.d.ts +8 -0
- package/components/Icon/icons/assets/Seeds.d.ts.map +1 -0
- package/components/Icon/icons/assets/Seeds.js +35 -0
- package/components/Icon/icons/assets/Site.d.ts +8 -0
- package/components/Icon/icons/assets/Site.d.ts.map +1 -0
- package/components/Icon/icons/assets/Site.js +35 -0
- package/components/Icon/icons/assets/Sparkles.d.ts +8 -0
- package/components/Icon/icons/assets/Sparkles.d.ts.map +1 -0
- package/components/Icon/icons/assets/Sparkles.js +36 -0
- package/components/Icon/icons/assets/Species.d.ts +8 -0
- package/components/Icon/icons/assets/Species.d.ts.map +1 -0
- package/components/Icon/icons/assets/Species.js +35 -0
- package/components/Icon/icons/assets/Species2.d.ts +8 -0
- package/components/Icon/icons/assets/Species2.d.ts.map +1 -0
- package/components/Icon/icons/assets/Species2.js +158 -0
- package/components/Icon/icons/assets/Spinner.d.ts +8 -0
- package/components/Icon/icons/assets/Spinner.d.ts.map +1 -0
- package/components/Icon/icons/assets/Spinner.js +61 -0
- package/components/Icon/icons/assets/Success.d.ts +8 -0
- package/components/Icon/icons/assets/Success.d.ts.map +1 -0
- package/components/Icon/icons/assets/Success.js +35 -0
- package/components/Icon/icons/assets/Touchscreen.d.ts +8 -0
- package/components/Icon/icons/assets/Touchscreen.d.ts.map +1 -0
- package/components/Icon/icons/assets/Touchscreen.js +36 -0
- package/components/Icon/icons/assets/UploadCloud.d.ts +8 -0
- package/components/Icon/icons/assets/UploadCloud.d.ts.map +1 -0
- package/components/Icon/icons/assets/UploadCloud.js +158 -0
- package/components/Icon/icons/assets/Warning.d.ts +8 -0
- package/components/Icon/icons/assets/Warning.d.ts.map +1 -0
- package/components/Icon/icons/assets/Warning.js +35 -0
- package/components/Icon/icons/assets/index.d.ts +57 -0
- package/components/Icon/icons/assets/index.d.ts.map +1 -0
- package/components/Icon/icons/assets/index.js +455 -0
- package/components/Icon/icons/index.d.ts +8 -0
- package/components/Icon/icons/index.d.ts.map +1 -0
- package/components/Icon/icons/index.js +179 -0
- package/components/Icon/styles.scss +43 -0
- package/components/Navbar/NavFooter.d.ts +7 -0
- package/components/Navbar/NavFooter.d.ts.map +1 -0
- package/components/Navbar/NavFooter.js +19 -0
- package/components/Navbar/NavItem.d.ts +13 -0
- package/components/Navbar/NavItem.d.ts.map +1 -0
- package/components/Navbar/NavItem.js +42 -0
- package/components/Navbar/NavSection.d.ts +7 -0
- package/components/Navbar/NavSection.d.ts.map +1 -0
- package/components/Navbar/NavSection.js +23 -0
- package/components/Navbar/Navbar.d.ts +8 -0
- package/components/Navbar/Navbar.d.ts.map +1 -0
- package/components/Navbar/Navbar.js +64 -0
- package/components/Navbar/logo.svg +25 -0
- package/components/Navbar/styles.scss +159 -0
- package/components/Note.d.ts +6 -0
- package/components/Note.d.ts.map +1 -0
- package/components/Note.js +35 -0
- package/components/ProgressCircle/ProgressCircle.d.ts +10 -0
- package/components/ProgressCircle/ProgressCircle.d.ts.map +1 -0
- package/components/ProgressCircle/ProgressCircle.js +37 -0
- package/components/ProgressCircle/styles.scss +84 -0
- package/components/RadioButton.d.ts +10 -0
- package/components/RadioButton.d.ts.map +1 -0
- package/components/RadioButton.js +31 -0
- package/components/Select/Select.d.ts +23 -0
- package/components/Select/Select.d.ts.map +1 -0
- package/components/Select/Select.js +248 -0
- package/components/Select/styles.scss +282 -0
- package/components/Size.d.ts +2 -0
- package/components/Size.d.ts.map +1 -0
- package/components/Size.js +5 -0
- package/components/SummaryBox.d.ts +11 -0
- package/components/SummaryBox.d.ts.map +1 -0
- package/components/SummaryBox.js +79 -0
- package/components/Textfield/Textfield.d.ts +27 -0
- package/components/Textfield/Textfield.d.ts.map +1 -0
- package/components/Textfield/Textfield.js +123 -0
- package/components/Textfield/styles.scss +216 -0
- package/components/table/EnhancedTableToolbar.d.ts +9 -0
- package/components/table/EnhancedTableToolbar.d.ts.map +1 -0
- package/components/table/EnhancedTableToolbar.js +53 -0
- package/components/table/TableCellRenderer.d.ts +26 -0
- package/components/table/TableCellRenderer.d.ts.map +1 -0
- package/components/table/TableCellRenderer.js +166 -0
- package/components/table/TableHeader.d.ts +16 -0
- package/components/table/TableHeader.d.ts.map +1 -0
- package/components/table/TableHeader.js +68 -0
- package/components/table/TableHeaderItem.d.ts +17 -0
- package/components/table/TableHeaderItem.d.ts.map +1 -0
- package/components/table/TableHeaderItem.js +77 -0
- package/components/table/index.d.ts +40 -0
- package/components/table/index.d.ts.map +1 -0
- package/components/table/index.js +322 -0
- package/components/table/sort.d.ts +9 -0
- package/components/table/sort.d.ts.map +1 -0
- package/components/table/sort.js +51 -0
- package/components/table/types.d.ts +34 -0
- package/components/table/types.d.ts.map +1 -0
- package/components/table/types.js +5 -0
- package/fonts/Inter.ttf +0 -0
- package/index.css +13 -0
- package/index.d.ts +26 -0
- package/index.d.ts.map +1 -0
- package/license-report.html +50 -0
- package/package.json +1 -4
- package/setupTests.d.ts +2 -0
- package/setupTests.d.ts.map +1 -0
- package/setupTests.js +5 -0
- package/stories/Autocomplete.stories.d.ts +9 -0
- package/stories/Autocomplete.stories.d.ts.map +1 -0
- package/stories/Button.stories.d.ts +35 -0
- package/stories/Button.stories.d.ts.map +1 -0
- package/stories/Checkbox.stories.d.ts +9 -0
- package/stories/Checkbox.stories.d.ts.map +1 -0
- package/stories/DatePicker.stories.d.ts +11 -0
- package/stories/DatePicker.stories.d.ts.map +1 -0
- package/stories/DialogBox.stories.d.ts +14 -0
- package/stories/DialogBox.stories.d.ts.map +1 -0
- package/stories/Divisor.stories.d.ts +20 -0
- package/stories/Divisor.stories.d.ts.map +1 -0
- package/stories/Dropdown.stories.d.ts +9 -0
- package/stories/Dropdown.stories.d.ts.map +1 -0
- package/stories/Icon.stories.d.ts +9 -0
- package/stories/Icon.stories.d.ts.map +1 -0
- package/stories/Navbar.stories.d.ts +10 -0
- package/stories/Navbar.stories.d.ts.map +1 -0
- package/stories/Note.stories.d.ts +9 -0
- package/stories/Note.stories.d.ts.map +1 -0
- package/stories/ProgressCircle.stories.d.ts +9 -0
- package/stories/ProgressCircle.stories.d.ts.map +1 -0
- package/stories/RadioButton.stories.d.ts +9 -0
- package/stories/RadioButton.stories.d.ts.map +1 -0
- package/stories/Select.stories.d.ts +9 -0
- package/stories/Select.stories.d.ts.map +1 -0
- package/stories/SummaryBox.stories.d.ts +11 -0
- package/stories/SummaryBox.stories.d.ts.map +1 -0
- package/stories/Table.stories.d.ts +12 -0
- package/stories/Table.stories.d.ts.map +1 -0
- package/stories/TextfieldNew.stories.d.ts +29 -0
- package/stories/TextfieldNew.stories.d.ts.map +1 -0
- package/style-dictionary-dist/button_variables.scss +299 -0
- package/style-dictionary-dist/dialogBox_variables.scss +251 -0
- package/style-dictionary-dist/navbar_variables.scss +257 -0
- package/style-dictionary-dist/progressCircle_variables.scss +251 -0
- package/style-dictionary-dist/textfield_variables.scss +297 -0
- package/theme.d.ts +60 -0
- package/theme.d.ts.map +1 -0
- package/theme.js +76 -0
- package/utils/date.d.ts +3 -0
- package/utils/date.d.ts.map +1 -0
- package/utils/date.js +13 -0
- package/utils/index.d.ts +6 -0
- package/utils/index.d.ts.map +1 -0
- package/utils/index.js +39 -0
- package/utils/preventDefaultEvent.d.ts +4 -0
- package/utils/preventDefaultEvent.d.ts.map +1 -0
- package/utils/preventDefaultEvent.js +13 -0
- package/utils/text.d.ts +3 -0
- package/utils/text.d.ts.map +1 -0
- package/utils/text.js +13 -0
- package/utils/useDeviceInfo.d.ts +42 -0
- package/utils/useDeviceInfo.d.ts.map +1 -0
- package/utils/useDeviceInfo.js +87 -0
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
@use 'sass:math';
|
|
2
|
+
|
|
3
|
+
@import '../../style-dictionary-dist/textfield_variables.scss';
|
|
4
|
+
|
|
5
|
+
@font-face {
|
|
6
|
+
font-family: 'Inter';
|
|
7
|
+
src: local('Inter'), url(../../fonts/Inter.ttf) format('truetype');
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.textfield {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-flow: row wrap;
|
|
13
|
+
.textfield-label {
|
|
14
|
+
font-family: $tw-fnt-frm-fld-label-font-family;
|
|
15
|
+
font-size: $tw-fnt-frm-fld-label-font-size;
|
|
16
|
+
font-weight: $tw-fnt-frm-fld-label-font-weight;
|
|
17
|
+
line-height: $tw-fnt-frm-fld-label-line-height;
|
|
18
|
+
color: $tw-clr-frm-fld-label;
|
|
19
|
+
margin-bottom: $tw-spc-base-xx-small;
|
|
20
|
+
display: block;
|
|
21
|
+
width: 100%;
|
|
22
|
+
max-width: 100%;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.textfield-help-text {
|
|
26
|
+
font-family: $tw-fnt-frm-fld-help-text-font-family;
|
|
27
|
+
font-size: $tw-fnt-frm-fld-help-text-font-size;
|
|
28
|
+
font-weight: $tw-fnt-frm-fld-help-text-font-weight;
|
|
29
|
+
line-height: $tw-fnt-frm-fld-help-text-line-height;
|
|
30
|
+
color: $tw-clr-frm-fld-help-text;
|
|
31
|
+
display: block;
|
|
32
|
+
width: 100%;
|
|
33
|
+
max-width: 100%;
|
|
34
|
+
margin-top: $tw-spc-base-xx-small;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
textarea {
|
|
38
|
+
font-family: $tw-fnt-frm-fld-text-value-font-family;
|
|
39
|
+
font-size: $tw-fnt-frm-fld-text-value-font-size;
|
|
40
|
+
font-weight: $tw-fnt-frm-fld-text-value-font-weight;
|
|
41
|
+
line-height: $tw-fnt-frm-fld-text-value-line-height;
|
|
42
|
+
color: $tw-clr-frm-fld-value;
|
|
43
|
+
padding-top: 0;
|
|
44
|
+
padding-bottom: 0;
|
|
45
|
+
&::placeholder {
|
|
46
|
+
font-family: $tw-fnt-frm-fld-text-placeholder-font-family;
|
|
47
|
+
font-size: $tw-fnt-frm-fld-text-placeholder-font-size;
|
|
48
|
+
font-weight: $tw-fnt-frm-fld-text-placeholder-font-weight;
|
|
49
|
+
line-height: $tw-fnt-frm-fld-text-placeholder-line-height;
|
|
50
|
+
color: $tw-clr-base-gray-300;
|
|
51
|
+
}
|
|
52
|
+
&:focus-visible {
|
|
53
|
+
outline: none;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.textfield-value {
|
|
58
|
+
background-color: $tw-clr-frm-fld-text-input-fill;
|
|
59
|
+
border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-frm-fld-text-input-stroke;
|
|
60
|
+
padding: $tw-spc-base-x-small;
|
|
61
|
+
border-radius: $tw-rds-frm-fld-text-input;
|
|
62
|
+
border-width: $tw-sz-frm-fld-text-input-stroke;
|
|
63
|
+
width: 100%;
|
|
64
|
+
max-width: 100%;
|
|
65
|
+
display: flex;
|
|
66
|
+
|
|
67
|
+
&:hover {
|
|
68
|
+
border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-frm-fld-text-input-stroke-hover;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&:active {
|
|
72
|
+
border: math.div($tw-sz-frm-fld-text-input-stroke-active, 2) solid $tw-clr-frm-fld-text-input-stroke-hover;
|
|
73
|
+
outline: math.div($tw-sz-frm-fld-text-input-stroke-active, 2) solid $tw-clr-frm-fld-text-input-stroke-hover;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
input {
|
|
77
|
+
border: none;
|
|
78
|
+
width: 100%;
|
|
79
|
+
font-family: $tw-fnt-frm-fld-text-value-font-family;
|
|
80
|
+
font-size: $tw-fnt-frm-fld-text-value-font-size;
|
|
81
|
+
font-weight: $tw-fnt-frm-fld-text-value-font-weight;
|
|
82
|
+
line-height: $tw-fnt-frm-fld-text-value-line-height;
|
|
83
|
+
color: $tw-clr-frm-fld-value;
|
|
84
|
+
background: transparent;
|
|
85
|
+
padding-top: 0;
|
|
86
|
+
padding-bottom: 0;
|
|
87
|
+
&::placeholder {
|
|
88
|
+
font-family: $tw-fnt-frm-fld-text-placeholder-font-family;
|
|
89
|
+
font-size: $tw-fnt-frm-fld-text-placeholder-font-size;
|
|
90
|
+
font-weight: $tw-fnt-frm-fld-text-placeholder-font-weight;
|
|
91
|
+
line-height: $tw-fnt-frm-fld-text-placeholder-line-height;
|
|
92
|
+
color: $tw-clr-base-gray-300;
|
|
93
|
+
}
|
|
94
|
+
&:focus-visible {
|
|
95
|
+
outline: none;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&--display {
|
|
100
|
+
font-family: $tw-fnt-frm-fld-text-value-font-family;
|
|
101
|
+
font-size: $tw-fnt-frm-fld-text-value-font-size;
|
|
102
|
+
font-weight: $tw-fnt-frm-fld-text-value-font-weight;
|
|
103
|
+
line-height: $tw-fnt-frm-fld-text-value-line-height;
|
|
104
|
+
padding: 0;
|
|
105
|
+
margin: 0;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&--disabled {
|
|
109
|
+
opacity: $tw-opcty-semantic-off;
|
|
110
|
+
&:hover {
|
|
111
|
+
border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-frm-fld-text-input-stroke;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&:active {
|
|
115
|
+
border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-frm-fld-text-input-stroke;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&--icon-container {
|
|
120
|
+
background: none;
|
|
121
|
+
border: 0;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&--icon-right {
|
|
125
|
+
width: $tw-fnt-frm-fld-text-value-line-height;
|
|
126
|
+
height: $tw-fnt-frm-fld-text-value-line-height;
|
|
127
|
+
fill: $tw-clr-frm-fld-value;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
&--icon-left {
|
|
131
|
+
width: $tw-fnt-frm-fld-text-value-line-height;
|
|
132
|
+
height: $tw-fnt-frm-fld-text-value-line-height;
|
|
133
|
+
fill: $tw-clr-frm-fld-value;
|
|
134
|
+
margin-right: $tw-spc-base-x-small;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
&--error {
|
|
138
|
+
border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-frm-fld-text-input-stroke-error;
|
|
139
|
+
background-color: $tw-clr-frm-fld-text-input-fill-error;
|
|
140
|
+
|
|
141
|
+
&:hover {
|
|
142
|
+
border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-frm-fld-text-input-stroke-error;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
&:active {
|
|
146
|
+
border: $tw-sz-frm-fld-text-input-stroke-active solid $tw-clr-frm-fld-text-input-stroke-error;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
&--warning {
|
|
151
|
+
border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-frm-fld-text-input-stroke-warning;
|
|
152
|
+
background-color: $tw-clr-frm-fld-text-input-fill-warning;
|
|
153
|
+
|
|
154
|
+
&:hover {
|
|
155
|
+
border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-frm-fld-text-input-stroke-warning;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
&:active {
|
|
159
|
+
border: $tw-sz-frm-fld-text-input-stroke-active solid $tw-clr-frm-fld-text-input-stroke-warning;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&--readonly {
|
|
164
|
+
background-color: $tw-clr-frm-fld-text-input-fill-read-only;
|
|
165
|
+
&:hover {
|
|
166
|
+
border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-frm-fld-text-input-stroke;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
&:active {
|
|
170
|
+
border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-frm-fld-text-input-stroke;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.textfield-error-text {
|
|
176
|
+
font-family: $tw-fnt-frm-fld-error-text-font-family;
|
|
177
|
+
font-size: $tw-fnt-frm-fld-error-text-font-size;
|
|
178
|
+
font-weight: $tw-fnt-frm-fld-error-text-font-weight;
|
|
179
|
+
line-height: $tw-fnt-frm-fld-error-text-line-height;
|
|
180
|
+
color: $tw-clr-frm-fld-error-text;
|
|
181
|
+
display: block;
|
|
182
|
+
width: 100%;
|
|
183
|
+
max-width: 100%;
|
|
184
|
+
|
|
185
|
+
&--icon {
|
|
186
|
+
fill: $tw-clr-frm-fld-error-text;
|
|
187
|
+
width: $tw-fnt-frm-fld-error-text-line-height;
|
|
188
|
+
height: $tw-fnt-frm-fld-error-text-line-height;
|
|
189
|
+
margin-right: $tw-spc-base-x-small;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.textfield-warning-text {
|
|
194
|
+
font-family: $tw-fnt-frm-fld-warning-text-font-family;
|
|
195
|
+
font-size: $tw-fnt-frm-fld-warning-text-font-size;
|
|
196
|
+
font-weight: $tw-fnt-frm-fld-warning-text-font-weight;
|
|
197
|
+
line-height: $tw-fnt-frm-fld-warning-text-line-height;
|
|
198
|
+
color: $tw-clr-frm-fld-warning-text;
|
|
199
|
+
display: block;
|
|
200
|
+
width: 100%;
|
|
201
|
+
max-width: 100%;
|
|
202
|
+
|
|
203
|
+
&--icon {
|
|
204
|
+
fill: $tw-clr-frm-fld-warning-text;
|
|
205
|
+
width: $tw-fnt-frm-fld-error-text-line-height;
|
|
206
|
+
height: $tw-fnt-frm-fld-error-text-line-height;
|
|
207
|
+
margin-right: $tw-spc-base-x-small;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.textfield-label-container {
|
|
212
|
+
display: flex;
|
|
213
|
+
width: 100%;
|
|
214
|
+
margin-top: $tw-spc-base-xx-small;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TopBarButton } from '.';
|
|
3
|
+
interface EnhancedTableToolbarProps {
|
|
4
|
+
numSelected: number;
|
|
5
|
+
topBarButtons?: TopBarButton[];
|
|
6
|
+
}
|
|
7
|
+
export default function EnhancedTableToolbar(props: EnhancedTableToolbarProps): JSX.Element | null;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=EnhancedTableToolbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EnhancedTableToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/table/EnhancedTableToolbar.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,CAAC;AAiBjC,UAAU,yBAAyB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;CAChC;AAED,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAuBjG"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = EnhancedTableToolbar;
|
|
9
|
+
|
|
10
|
+
var _material = require("@mui/material");
|
|
11
|
+
|
|
12
|
+
var _Button = _interopRequireDefault(require("../Button/Button"));
|
|
13
|
+
|
|
14
|
+
var _styles = require("@mui/styles");
|
|
15
|
+
|
|
16
|
+
var _react = _interopRequireDefault(require("react"));
|
|
17
|
+
|
|
18
|
+
var styles = (0, _styles.makeStyles)(function (theme) {
|
|
19
|
+
return {
|
|
20
|
+
toolbar: {
|
|
21
|
+
background: '#EDF0F1'
|
|
22
|
+
},
|
|
23
|
+
flexText: {
|
|
24
|
+
flex: '1 1 100%'
|
|
25
|
+
},
|
|
26
|
+
buttonSpacing: {
|
|
27
|
+
marginLeft: theme.spacing(1)
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
function EnhancedTableToolbar(props) {
|
|
33
|
+
var numSelected = props.numSelected,
|
|
34
|
+
topBarButtons = props.topBarButtons;
|
|
35
|
+
var classes = styles();
|
|
36
|
+
return numSelected > 0 ? /*#__PURE__*/_react.default.createElement(_material.Toolbar, {
|
|
37
|
+
className: classes.toolbar
|
|
38
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
39
|
+
color: "inherit",
|
|
40
|
+
variant: "subtitle1",
|
|
41
|
+
component: "div",
|
|
42
|
+
className: classes.flexText
|
|
43
|
+
}, numSelected, " selected"), topBarButtons === null || topBarButtons === void 0 ? void 0 : topBarButtons.map(function (tbButton) {
|
|
44
|
+
return /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
45
|
+
className: classes.buttonSpacing,
|
|
46
|
+
key: tbButton.buttonText,
|
|
47
|
+
label: tbButton.buttonText,
|
|
48
|
+
priority: "secondary",
|
|
49
|
+
type: tbButton.buttonType,
|
|
50
|
+
onClick: tbButton.onButtonClick
|
|
51
|
+
});
|
|
52
|
+
})) : null;
|
|
53
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { RendererProps } from './types';
|
|
3
|
+
export declare type TableRowType = Record<string, any>;
|
|
4
|
+
export default function CellRenderer(props: RendererProps<TableRowType>): JSX.Element;
|
|
5
|
+
export declare const cellDateFormatter: (value?: string | undefined) => string | undefined;
|
|
6
|
+
export declare function CellDateRenderer({ id, value }: {
|
|
7
|
+
id: string;
|
|
8
|
+
value: string;
|
|
9
|
+
}): JSX.Element;
|
|
10
|
+
export declare function CellTextRenderer({ id, value, }: {
|
|
11
|
+
id: string;
|
|
12
|
+
value?: string | number | any[] | ReactNode;
|
|
13
|
+
}): JSX.Element;
|
|
14
|
+
export declare function CellBooleanRenderer({ id, value, }: {
|
|
15
|
+
id: string;
|
|
16
|
+
value?: string | number | any[] | ReactNode;
|
|
17
|
+
}): JSX.Element;
|
|
18
|
+
export declare function CellNotesRenderer({ id, value }: {
|
|
19
|
+
id: string;
|
|
20
|
+
value?: string;
|
|
21
|
+
}): JSX.Element;
|
|
22
|
+
export declare function CellEditRenderer({ id, onRowClick }: {
|
|
23
|
+
id: string;
|
|
24
|
+
onRowClick?: () => void;
|
|
25
|
+
}): JSX.Element;
|
|
26
|
+
//# sourceMappingURL=TableCellRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableCellRenderer.d.ts","sourceRoot":"","sources":["../../../src/components/table/TableCellRenderer.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAgBxC,oBAAY,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAE/C,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,aAAa,CAAC,YAAY,CAAC,GAAG,GAAG,CAAC,OAAO,CAcpF;AAED,eAAO,MAAM,iBAAiB,kCAAqB,MAAM,GAAG,SAI3D,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,GAAG,CAAC,OAAO,CAU1F;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,EAAE,EACF,KAAK,GACN,EAAE;IACD,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,EAAE,GAAG,SAAS,CAAC;CAC7C,GAAG,GAAG,CAAC,OAAO,CAUd;AAED,wBAAgB,mBAAmB,CAAC,EAClC,EAAE,EACF,KAAK,GACN,EAAE;IACD,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,EAAE,GAAG,SAAS,CAAC;CAC7C,GAAG,GAAG,CAAC,OAAO,CAQd;AAED,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,GAAG,CAAC,OAAO,CAQ5F;AAED,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,GAAG,GAAG,CAAC,OAAO,CAwBzG"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = CellRenderer;
|
|
9
|
+
exports.CellDateRenderer = CellDateRenderer;
|
|
10
|
+
exports.CellTextRenderer = CellTextRenderer;
|
|
11
|
+
exports.CellBooleanRenderer = CellBooleanRenderer;
|
|
12
|
+
exports.CellNotesRenderer = CellNotesRenderer;
|
|
13
|
+
exports.CellEditRenderer = CellEditRenderer;
|
|
14
|
+
exports.cellDateFormatter = void 0;
|
|
15
|
+
|
|
16
|
+
var _iconsMaterial = require("@mui/icons-material");
|
|
17
|
+
|
|
18
|
+
var _material = require("@mui/material");
|
|
19
|
+
|
|
20
|
+
var _react = _interopRequireDefault(require("react"));
|
|
21
|
+
|
|
22
|
+
var _styles = require("@mui/styles");
|
|
23
|
+
|
|
24
|
+
var _utils = require("../../utils");
|
|
25
|
+
|
|
26
|
+
var useStyles = (0, _styles.makeStyles)(function (theme) {
|
|
27
|
+
return {
|
|
28
|
+
editIcon: {
|
|
29
|
+
marginLeft: theme.spacing(1)
|
|
30
|
+
},
|
|
31
|
+
textRoot: {
|
|
32
|
+
maxWidth: 400
|
|
33
|
+
},
|
|
34
|
+
date: {
|
|
35
|
+
whiteSpace: 'nowrap'
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
function CellRenderer(props) {
|
|
41
|
+
var column = props.column,
|
|
42
|
+
value = props.value,
|
|
43
|
+
onRowClick = props.onRowClick,
|
|
44
|
+
index = props.index;
|
|
45
|
+
var id = "row".concat(index, "-").concat(column.key);
|
|
46
|
+
|
|
47
|
+
if (column.type === 'date' && typeof value === 'string' && value) {
|
|
48
|
+
return /*#__PURE__*/_react.default.createElement(CellDateRenderer, {
|
|
49
|
+
id: id,
|
|
50
|
+
value: value
|
|
51
|
+
});
|
|
52
|
+
} else if (column.type === 'notes' && value && typeof value === 'string') {
|
|
53
|
+
return /*#__PURE__*/_react.default.createElement(CellNotesRenderer, {
|
|
54
|
+
id: id,
|
|
55
|
+
value: value
|
|
56
|
+
});
|
|
57
|
+
} else if (column.type === 'boolean') {
|
|
58
|
+
return /*#__PURE__*/_react.default.createElement(CellBooleanRenderer, {
|
|
59
|
+
id: id,
|
|
60
|
+
value: value
|
|
61
|
+
});
|
|
62
|
+
} else if (column.type === 'edit') {
|
|
63
|
+
return /*#__PURE__*/_react.default.createElement(CellEditRenderer, {
|
|
64
|
+
id: id,
|
|
65
|
+
onRowClick: onRowClick
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return /*#__PURE__*/_react.default.createElement(CellTextRenderer, {
|
|
70
|
+
id: id,
|
|
71
|
+
value: value
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
var cellDateFormatter = function cellDateFormatter(value) {
|
|
76
|
+
if (value) {
|
|
77
|
+
return (0, _utils.getDateDisplayValue)(value);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
exports.cellDateFormatter = cellDateFormatter;
|
|
82
|
+
|
|
83
|
+
function CellDateRenderer(_ref) {
|
|
84
|
+
var id = _ref.id,
|
|
85
|
+
value = _ref.value;
|
|
86
|
+
var classes = useStyles();
|
|
87
|
+
return /*#__PURE__*/_react.default.createElement(_material.TableCell, {
|
|
88
|
+
id: id,
|
|
89
|
+
align: "left",
|
|
90
|
+
className: classes.date
|
|
91
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
92
|
+
component: "p",
|
|
93
|
+
variant: "body1"
|
|
94
|
+
}, cellDateFormatter(value)));
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function CellTextRenderer(_ref2) {
|
|
98
|
+
var id = _ref2.id,
|
|
99
|
+
value = _ref2.value;
|
|
100
|
+
var classes = useStyles();
|
|
101
|
+
return /*#__PURE__*/_react.default.createElement(_material.TableCell, {
|
|
102
|
+
id: id,
|
|
103
|
+
align: "left",
|
|
104
|
+
title: typeof value === 'string' ? value : ''
|
|
105
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
106
|
+
component: "p",
|
|
107
|
+
variant: "body1",
|
|
108
|
+
noWrap: true,
|
|
109
|
+
classes: {
|
|
110
|
+
root: classes.textRoot
|
|
111
|
+
}
|
|
112
|
+
}, value));
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function CellBooleanRenderer(_ref3) {
|
|
116
|
+
var id = _ref3.id,
|
|
117
|
+
value = _ref3.value;
|
|
118
|
+
return /*#__PURE__*/_react.default.createElement(_material.TableCell, {
|
|
119
|
+
id: id,
|
|
120
|
+
align: "left"
|
|
121
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
122
|
+
component: "p",
|
|
123
|
+
variant: "body1"
|
|
124
|
+
}, value === 'true' ? 'YES' : 'NO'));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function CellNotesRenderer(_ref4) {
|
|
128
|
+
var id = _ref4.id,
|
|
129
|
+
value = _ref4.value;
|
|
130
|
+
return /*#__PURE__*/_react.default.createElement(_material.TableCell, {
|
|
131
|
+
id: id,
|
|
132
|
+
align: "left"
|
|
133
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
134
|
+
id: id,
|
|
135
|
+
component: "p",
|
|
136
|
+
variant: "body1"
|
|
137
|
+
}, value && value.length > 0 ? /*#__PURE__*/_react.default.createElement(_iconsMaterial.Notes, null) : ''));
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function CellEditRenderer(_ref5) {
|
|
141
|
+
var id = _ref5.id,
|
|
142
|
+
onRowClick = _ref5.onRowClick;
|
|
143
|
+
var classes = useStyles();
|
|
144
|
+
return /*#__PURE__*/_react.default.createElement(_material.TableCell, {
|
|
145
|
+
id: id,
|
|
146
|
+
align: "left"
|
|
147
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Link, {
|
|
148
|
+
id: "".concat(id, "-button"),
|
|
149
|
+
href: "#",
|
|
150
|
+
onClick: function onClick(event) {
|
|
151
|
+
(0, _utils.preventDefaultEvent)(event);
|
|
152
|
+
|
|
153
|
+
if (onRowClick) {
|
|
154
|
+
onRowClick();
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
158
|
+
display: "flex"
|
|
159
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
160
|
+
component: "p",
|
|
161
|
+
variant: "body1"
|
|
162
|
+
}, "Edit"), /*#__PURE__*/_react.default.createElement(_iconsMaterial.Edit, {
|
|
163
|
+
fontSize: "small",
|
|
164
|
+
className: classes.editIcon
|
|
165
|
+
}))));
|
|
166
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Order } from './sort';
|
|
3
|
+
import { TableColumnType } from './types';
|
|
4
|
+
interface Props {
|
|
5
|
+
onRequestSort: (event: React.MouseEvent<unknown>, property: string) => void;
|
|
6
|
+
order: Order;
|
|
7
|
+
orderBy?: string;
|
|
8
|
+
columns: TableColumnType[];
|
|
9
|
+
onReorderEnd?: ({ oldIndex, newIndex }: any) => void;
|
|
10
|
+
numSelected?: number;
|
|
11
|
+
rowCount?: number;
|
|
12
|
+
onSelectAllClick?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
13
|
+
}
|
|
14
|
+
export default function EnhancedTableHead(props: Props): JSX.Element;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=TableHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableHeader.d.ts","sourceRoot":"","sources":["../../../src/components/table/TableHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAK1C,UAAU,KAAK;IACb,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5E,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,YAAY,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,GAAG,KAAK,IAAI,CAAC;IACrD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CACzE;AAUD,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,KAAK,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAqCnE"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = EnhancedTableHead;
|
|
9
|
+
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
11
|
+
|
|
12
|
+
var _material = require("@mui/material");
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
|
|
16
|
+
var _sortable = require("@dnd-kit/sortable");
|
|
17
|
+
|
|
18
|
+
var _TableHeaderItem = _interopRequireDefault(require("./TableHeaderItem"));
|
|
19
|
+
|
|
20
|
+
function columnsToHeadCells(columns) {
|
|
21
|
+
return columns.map(function (c) {
|
|
22
|
+
return {
|
|
23
|
+
id: c.key,
|
|
24
|
+
disablePadding: false,
|
|
25
|
+
label: typeof c.name === 'string' ? c.name.toUpperCase() : c.name
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function EnhancedTableHead(props) {
|
|
31
|
+
var order = props.order,
|
|
32
|
+
orderBy = props.orderBy,
|
|
33
|
+
onRequestSort = props.onRequestSort,
|
|
34
|
+
numSelected = props.numSelected,
|
|
35
|
+
rowCount = props.rowCount,
|
|
36
|
+
onSelectAllClick = props.onSelectAllClick;
|
|
37
|
+
|
|
38
|
+
var _React$useState = _react.default.useState(columnsToHeadCells(props.columns)),
|
|
39
|
+
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
40
|
+
headCells = _React$useState2[0],
|
|
41
|
+
setHeadCells = _React$useState2[1];
|
|
42
|
+
|
|
43
|
+
_react.default.useEffect(function () {
|
|
44
|
+
setHeadCells(columnsToHeadCells(props.columns));
|
|
45
|
+
}, [props.columns]);
|
|
46
|
+
|
|
47
|
+
return /*#__PURE__*/_react.default.createElement("thead", null, /*#__PURE__*/_react.default.createElement(_material.TableRow, {
|
|
48
|
+
id: "table-header"
|
|
49
|
+
}, numSelected !== undefined && rowCount !== undefined && rowCount > 0 && onSelectAllClick && /*#__PURE__*/_react.default.createElement(_material.TableCell, {
|
|
50
|
+
padding: "checkbox"
|
|
51
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Checkbox, {
|
|
52
|
+
color: "primary",
|
|
53
|
+
indeterminate: numSelected > 0 && numSelected < rowCount,
|
|
54
|
+
checked: rowCount > 0 && numSelected === rowCount,
|
|
55
|
+
onChange: onSelectAllClick
|
|
56
|
+
})), /*#__PURE__*/_react.default.createElement(_sortable.SortableContext, {
|
|
57
|
+
items: headCells
|
|
58
|
+
}, headCells.map(function (headCell, i) {
|
|
59
|
+
return /*#__PURE__*/_react.default.createElement(_TableHeaderItem.default, {
|
|
60
|
+
headCell: headCell,
|
|
61
|
+
order: order,
|
|
62
|
+
orderBy: orderBy,
|
|
63
|
+
onRequestSort: onRequestSort,
|
|
64
|
+
i: i,
|
|
65
|
+
key: i
|
|
66
|
+
});
|
|
67
|
+
}))));
|
|
68
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Order } from './sort';
|
|
3
|
+
interface HeadCell {
|
|
4
|
+
disablePadding: boolean;
|
|
5
|
+
id: string;
|
|
6
|
+
label: string | JSX.Element;
|
|
7
|
+
}
|
|
8
|
+
declare type Props = {
|
|
9
|
+
headCell: HeadCell;
|
|
10
|
+
order: Order;
|
|
11
|
+
orderBy?: string;
|
|
12
|
+
onRequestSort: (event: React.MouseEvent<unknown>, property: string) => void;
|
|
13
|
+
i: number;
|
|
14
|
+
};
|
|
15
|
+
export default function TableHeaderItem(props: Props): JSX.Element;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=TableHeaderItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableHeaderItem.d.ts","sourceRoot":"","sources":["../../../src/components/table/TableHeaderItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,UAAU,QAAQ;IAChB,cAAc,EAAE,OAAO,CAAC;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC;CAC7B;AAED,aAAK,KAAK,GAAG;IACX,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5E,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AACF,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CA8CjE"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = TableHeaderItem;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _sortable = require("@dnd-kit/sortable");
|
|
13
|
+
|
|
14
|
+
var _utilities = require("@dnd-kit/utilities");
|
|
15
|
+
|
|
16
|
+
var _iconsMaterial = require("@mui/icons-material");
|
|
17
|
+
|
|
18
|
+
var _material = require("@mui/material");
|
|
19
|
+
|
|
20
|
+
var _styles = require("@mui/styles");
|
|
21
|
+
|
|
22
|
+
function TableHeaderItem(props) {
|
|
23
|
+
var headCell = props.headCell,
|
|
24
|
+
order = props.order,
|
|
25
|
+
orderBy = props.orderBy,
|
|
26
|
+
onRequestSort = props.onRequestSort,
|
|
27
|
+
i = props.i;
|
|
28
|
+
|
|
29
|
+
var _useSortable = (0, _sortable.useSortable)({
|
|
30
|
+
id: headCell.id
|
|
31
|
+
}),
|
|
32
|
+
attributes = _useSortable.attributes,
|
|
33
|
+
listeners = _useSortable.listeners,
|
|
34
|
+
setNodeRef = _useSortable.setNodeRef,
|
|
35
|
+
transform = _useSortable.transform,
|
|
36
|
+
transition = _useSortable.transition,
|
|
37
|
+
isDragging = _useSortable.isDragging;
|
|
38
|
+
|
|
39
|
+
var style = {
|
|
40
|
+
transform: _utilities.CSS.Transform.toString(transform),
|
|
41
|
+
transition: transition,
|
|
42
|
+
opacity: isDragging ? 0.5 : 1
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
var createSortHandler = function createSortHandler(property) {
|
|
46
|
+
return function (event) {
|
|
47
|
+
onRequestSort(event, property);
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
var dragIconStyles = (0, _styles.makeStyles)(function (theme) {
|
|
52
|
+
return {
|
|
53
|
+
root: {
|
|
54
|
+
marginLeft: -20,
|
|
55
|
+
color: theme.palette.common.white,
|
|
56
|
+
'&:hover': {
|
|
57
|
+
color: theme.palette.neutral[600]
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
return /*#__PURE__*/_react.default.createElement(_material.TableCell, {
|
|
63
|
+
ref: setNodeRef,
|
|
64
|
+
id: "table-header-".concat(headCell.id),
|
|
65
|
+
key: headCell.id,
|
|
66
|
+
align: "left",
|
|
67
|
+
padding: headCell.disablePadding ? 'none' : 'normal',
|
|
68
|
+
sortDirection: orderBy === headCell.id ? order : false,
|
|
69
|
+
style: style
|
|
70
|
+
}, headCell.label && /*#__PURE__*/_react.default.createElement(_material.TableSortLabel, {
|
|
71
|
+
active: orderBy === headCell.id,
|
|
72
|
+
direction: orderBy === headCell.id ? order : 'asc',
|
|
73
|
+
onClick: createSortHandler(headCell.id)
|
|
74
|
+
}, i > 0 && /*#__PURE__*/_react.default.createElement(_iconsMaterial.DragHandle, Object.assign({
|
|
75
|
+
classes: dragIconStyles()
|
|
76
|
+
}, attributes, listeners)), headCell.label));
|
|
77
|
+
}
|