@for-the-people-initiative/design-system 1.3.1
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/README.md +80 -0
- package/dist/css/theme-dark.css +7 -0
- package/dist/css/tokens.css +2315 -0
- package/dist/scss/_tokens.scss +2521 -0
- package/dist/ts/tokens.ts +2441 -0
- package/package.json +80 -0
- package/src/components/Accordion/Accordion.scss +118 -0
- package/src/components/Accordion/Accordion.vue +105 -0
- package/src/components/Accordion/AccordionTab.vue +79 -0
- package/src/components/Alert/Alert.scss +109 -0
- package/src/components/Alert/Alert.vue +79 -0
- package/src/components/AppBar/AppBar.scss +73 -0
- package/src/components/AppBar/AppBar.vue +49 -0
- package/src/components/AtmosphericBackground/AtmosphericBackground.vue +198 -0
- package/src/components/AutoComplete/AutoComplete.scss +282 -0
- package/src/components/AutoComplete/AutoComplete.vue +398 -0
- package/src/components/Avatar/Avatar.scss +191 -0
- package/src/components/Avatar/Avatar.vue +44 -0
- package/src/components/Badge/Badge.scss +84 -0
- package/src/components/Badge/Badge.vue +41 -0
- package/src/components/BlockUI/BlockUI.scss +85 -0
- package/src/components/BlockUI/BlockUI.vue +90 -0
- package/src/components/Breadcrumb/Breadcrumb.scss +84 -0
- package/src/components/Breadcrumb/Breadcrumb.vue +141 -0
- package/src/components/Button/Button.scss +254 -0
- package/src/components/Button/Button.vue +68 -0
- package/src/components/CTA/CTA.scss +92 -0
- package/src/components/CTA/CTA.vue +33 -0
- package/src/components/Calendar/Calendar.scss +330 -0
- package/src/components/Calendar/Calendar.vue +455 -0
- package/src/components/Card/Card.scss +66 -0
- package/src/components/Card/Card.vue +48 -0
- package/src/components/Carousel/Carousel.scss +121 -0
- package/src/components/Carousel/Carousel.vue +191 -0
- package/src/components/Chart/Chart.scss +109 -0
- package/src/components/Chart/Chart.vue +209 -0
- package/src/components/Checkbox/Checkbox.scss +148 -0
- package/src/components/Checkbox/Checkbox.vue +75 -0
- package/src/components/Chip/Chip.scss +83 -0
- package/src/components/Chip/Chip.vue +73 -0
- package/src/components/ColorPicker/ColorPicker.scss +244 -0
- package/src/components/ColorPicker/ColorPicker.vue +411 -0
- package/src/components/Column/Column.scss +87 -0
- package/src/components/Column/Column.vue +45 -0
- package/src/components/ColumnGroup/ColumnGroup.scss +41 -0
- package/src/components/ColumnGroup/ColumnGroup.vue +27 -0
- package/src/components/ColumnGroup/ColumnGroupRow.vue +18 -0
- package/src/components/CommandPalette/CommandPalette.scss +143 -0
- package/src/components/CommandPalette/CommandPalette.vue +165 -0
- package/src/components/ConfirmDialog/ConfirmDialog.scss +177 -0
- package/src/components/ConfirmDialog/ConfirmDialog.vue +162 -0
- package/src/components/ConfirmPopup/ConfirmPopup.scss +180 -0
- package/src/components/ConfirmPopup/ConfirmPopup.vue +185 -0
- package/src/components/ContextMenu/ContextMenu.scss +171 -0
- package/src/components/ContextMenu/ContextMenu.vue +383 -0
- package/src/components/DataTable/DataTable.scss +162 -0
- package/src/components/DataTable/DataTable.vue +225 -0
- package/src/components/DataView/DataView.scss +149 -0
- package/src/components/DataView/DataView.vue +172 -0
- package/src/components/DatePicker/DatePicker.scss +71 -0
- package/src/components/DatePicker/DatePicker.vue +121 -0
- package/src/components/Dialog/Dialog.scss +161 -0
- package/src/components/Dialog/Dialog.vue +245 -0
- package/src/components/Divider/Divider.scss +147 -0
- package/src/components/Divider/Divider.vue +49 -0
- package/src/components/Dock/Dock.scss +221 -0
- package/src/components/Dock/Dock.vue +107 -0
- package/src/components/Drawer/Drawer.scss +220 -0
- package/src/components/Drawer/Drawer.vue +137 -0
- package/src/components/Dropdown/Dropdown.scss +218 -0
- package/src/components/Dropdown/Dropdown.vue +313 -0
- package/src/components/Editor/Editor.scss +156 -0
- package/src/components/Editor/Editor.vue +253 -0
- package/src/components/FAQ/FAQ.scss +24 -0
- package/src/components/FAQ/FAQ.vue +28 -0
- package/src/components/FeatureGrid/FeatureGrid.scss +92 -0
- package/src/components/FeatureGrid/FeatureGrid.vue +39 -0
- package/src/components/FieldSet/FieldSet.scss +97 -0
- package/src/components/FieldSet/FieldSet.vue +70 -0
- package/src/components/FileUpload/FileUpload.scss +137 -0
- package/src/components/FileUpload/FileUpload.vue +183 -0
- package/src/components/Footer/Footer.scss +95 -0
- package/src/components/Footer/Footer.vue +59 -0
- package/src/components/Form/Form.scss +72 -0
- package/src/components/Form/Form.vue +30 -0
- package/src/components/Form/FormField.vue +42 -0
- package/src/components/Galleria/Galleria.scss +295 -0
- package/src/components/Galleria/Galleria.vue +274 -0
- package/src/components/Hero/Hero.scss +116 -0
- package/src/components/Hero/Hero.vue +57 -0
- package/src/components/Image/Image.scss +129 -0
- package/src/components/Image/Image.vue +117 -0
- package/src/components/ImageCompare/ImageCompare.scss +97 -0
- package/src/components/ImageCompare/ImageCompare.vue +66 -0
- package/src/components/InPlace/InPlace.scss +97 -0
- package/src/components/InPlace/InPlace.vue +107 -0
- package/src/components/InlineMessage/InlineMessage.scss +69 -0
- package/src/components/InlineMessage/InlineMessage.vue +47 -0
- package/src/components/InputChips/InputChips.scss +165 -0
- package/src/components/InputChips/InputChips.vue +169 -0
- package/src/components/InputGroup/InputGroup.scss +57 -0
- package/src/components/InputGroup/InputGroup.vue +22 -0
- package/src/components/InputGroupAddon/InputGroupAddon.scss +28 -0
- package/src/components/InputGroupAddon/InputGroupAddon.vue +22 -0
- package/src/components/InputIcon/InputIcon.scss +58 -0
- package/src/components/InputIcon/InputIcon.vue +28 -0
- package/src/components/InputMask/InputMask.scss +65 -0
- package/src/components/InputMask/InputMask.vue +268 -0
- package/src/components/InputNumber/InputNumber.scss +122 -0
- package/src/components/InputNumber/InputNumber.vue +150 -0
- package/src/components/InputOtp/InputOtp.scss +88 -0
- package/src/components/InputOtp/InputOtp.vue +230 -0
- package/src/components/InputSwitch/InputSwitch.scss +131 -0
- package/src/components/InputSwitch/InputSwitch.vue +49 -0
- package/src/components/InputText/InputText.scss +61 -0
- package/src/components/InputText/InputText.vue +71 -0
- package/src/components/Knob/Knob.scss +92 -0
- package/src/components/Knob/Knob.vue +252 -0
- package/src/components/ListBox/ListBox.scss +152 -0
- package/src/components/ListBox/ListBox.vue +198 -0
- package/src/components/LogoCloud/LogoCloud.scss +64 -0
- package/src/components/LogoCloud/LogoCloud.vue +35 -0
- package/src/components/MegaMenu/MegaMenu.scss +280 -0
- package/src/components/MegaMenu/MegaMenu.vue +218 -0
- package/src/components/Menu/Menu.scss +102 -0
- package/src/components/Menu/Menu.vue +221 -0
- package/src/components/MenuBar/MenuBar.scss +208 -0
- package/src/components/MenuBar/MenuBar.vue +306 -0
- package/src/components/Message/Message.scss +126 -0
- package/src/components/Message/Message.vue +99 -0
- package/src/components/MeterGroup/MeterGroup.scss +105 -0
- package/src/components/MeterGroup/MeterGroup.vue +73 -0
- package/src/components/MultiSelect/MultiSelect.scss +239 -0
- package/src/components/MultiSelect/MultiSelect.vue +296 -0
- package/src/components/OrderList/OrderList.scss +133 -0
- package/src/components/OrderList/OrderList.vue +267 -0
- package/src/components/OrganizationChart/OrganizationChart.scss +145 -0
- package/src/components/OrganizationChart/OrganizationChart.vue +220 -0
- package/src/components/OverlayPanel/OverlayPanel.scss +69 -0
- package/src/components/OverlayPanel/OverlayPanel.vue +180 -0
- package/src/components/Paginator/Paginator.scss +130 -0
- package/src/components/Paginator/Paginator.vue +212 -0
- package/src/components/Panel/Panel.scss +113 -0
- package/src/components/Panel/Panel.vue +89 -0
- package/src/components/PanelMenu/PanelMenu.scss +211 -0
- package/src/components/PanelMenu/PanelMenu.vue +295 -0
- package/src/components/ParticleBackground/ParticleBackground.vue +310 -0
- package/src/components/PickList/PickList.scss +126 -0
- package/src/components/PickList/PickList.vue +249 -0
- package/src/components/PopOver/PopOver.scss +112 -0
- package/src/components/PopOver/PopOver.vue +254 -0
- package/src/components/PricingTable/PricingCard.vue +33 -0
- package/src/components/PricingTable/PricingTable.scss +133 -0
- package/src/components/PricingTable/PricingTable.vue +21 -0
- package/src/components/ProgressBar/ProgressBar.scss +58 -0
- package/src/components/ProgressBar/ProgressBar.vue +48 -0
- package/src/components/ProgressSpinner/ProgressSpinner.scss +48 -0
- package/src/components/ProgressSpinner/ProgressSpinner.vue +53 -0
- package/src/components/RadioButton/RadioButton.scss +148 -0
- package/src/components/RadioButton/RadioButton.vue +52 -0
- package/src/components/Rating/Rating.scss +109 -0
- package/src/components/Rating/Rating.vue +136 -0
- package/src/components/Row/Row.scss +38 -0
- package/src/components/Row/Row.vue +30 -0
- package/src/components/ScrollPanel/ScrollPanel.scss +90 -0
- package/src/components/ScrollPanel/ScrollPanel.vue +284 -0
- package/src/components/ScrollTop/ScrollTop.scss +59 -0
- package/src/components/ScrollTop/ScrollTop.vue +99 -0
- package/src/components/Section/Section.scss +58 -0
- package/src/components/Section/Section.vue +39 -0
- package/src/components/Select/Select.scss +98 -0
- package/src/components/Select/Select.vue +92 -0
- package/src/components/SelectButton/SelectButton.scss +65 -0
- package/src/components/SelectButton/SelectButton.vue +144 -0
- package/src/components/Sidebar/Sidebar.scss +170 -0
- package/src/components/Sidebar/Sidebar.vue +137 -0
- package/src/components/Skeleton/Skeleton.scss +43 -0
- package/src/components/Skeleton/Skeleton.vue +57 -0
- package/src/components/Slider/Slider.scss +103 -0
- package/src/components/Slider/Slider.vue +65 -0
- package/src/components/SpeedDial/SpeedDial.scss +217 -0
- package/src/components/SpeedDial/SpeedDial.vue +196 -0
- package/src/components/SplitButton/SplitButton.scss +264 -0
- package/src/components/SplitButton/SplitButton.vue +172 -0
- package/src/components/Splitter/Splitter.scss +95 -0
- package/src/components/Splitter/Splitter.vue +191 -0
- package/src/components/Splitter/SplitterPanel.vue +125 -0
- package/src/components/Stats/Stats.scss +54 -0
- package/src/components/Stats/Stats.vue +28 -0
- package/src/components/Steps/Steps.scss +164 -0
- package/src/components/Steps/Steps.vue +100 -0
- package/src/components/TabMenu/TabMenu.scss +106 -0
- package/src/components/TabMenu/TabMenu.vue +174 -0
- package/src/components/Tabs/TabPanel.vue +41 -0
- package/src/components/Tabs/Tabs.scss +82 -0
- package/src/components/Tabs/Tabs.vue +162 -0
- package/src/components/Tag/Tag.scss +73 -0
- package/src/components/Tag/Tag.vue +37 -0
- package/src/components/Terminal/Terminal.scss +80 -0
- package/src/components/Terminal/Terminal.vue +113 -0
- package/src/components/Testimonial/Testimonial.scss +80 -0
- package/src/components/Testimonial/Testimonial.vue +29 -0
- package/src/components/Textarea/Textarea.scss +65 -0
- package/src/components/Textarea/Textarea.vue +101 -0
- package/src/components/TieredMenu/TieredMenu.scss +146 -0
- package/src/components/TieredMenu/TieredMenu.vue +270 -0
- package/src/components/TieredMenu/TieredMenuSub.vue +132 -0
- package/src/components/Timeline/Timeline.scss +190 -0
- package/src/components/Timeline/Timeline.vue +79 -0
- package/src/components/Toast/Toast.scss +284 -0
- package/src/components/Toast/Toast.vue +162 -0
- package/src/components/ToggleButton/ToggleButton.scss +99 -0
- package/src/components/ToggleButton/ToggleButton.vue +65 -0
- package/src/components/ToggleSwitch/ToggleSwitch.scss +68 -0
- package/src/components/ToggleSwitch/ToggleSwitch.vue +44 -0
- package/src/components/Toolbar/Toolbar.scss +37 -0
- package/src/components/Toolbar/Toolbar.vue +23 -0
- package/src/components/Tooltip/Tooltip.scss +114 -0
- package/src/components/Tooltip/Tooltip.vue +169 -0
- package/src/components/Tree/Tree.scss +164 -0
- package/src/components/Tree/Tree.vue +273 -0
- package/src/components/TreeSelect/TreeSelect.scss +238 -0
- package/src/components/TreeSelect/TreeSelect.vue +401 -0
- package/src/components/TreeTable/TreeTable.scss +172 -0
- package/src/components/TreeTable/TreeTable.vue +285 -0
- package/src/components/VirtualScroller/VirtualScroller.scss +107 -0
- package/src/components/VirtualScroller/VirtualScroller.vue +234 -0
- package/src/scss/fonts.scss +63 -0
- package/src/scss/mixins/accent-gradient.scss +43 -0
- package/src/scss/mixins/border.scss +28 -0
- package/src/scss/mixins/breakpoint.scss +80 -0
- package/src/scss/mixins/container.scss +33 -0
- package/src/scss/mixins/elevation.scss +43 -0
- package/src/scss/mixins/grid.scss +23 -0
- package/src/scss/mixins/levitation.scss +15 -0
- package/src/scss/mixins/list.scss +5 -0
- package/src/scss/mixins/surface-atmospheric.scss +93 -0
- package/src/scss/mixins/surface.scss +19 -0
- package/src/scss/mixins/typography.scss +91 -0
- package/src/scss/utility-classes/utility-classes-spacing.scss +34 -0
- package/src/scss/utility-classes/utility-classes-typography.scss +114 -0
- package/tokens/components/accordion.json +127 -0
- package/tokens/components/autocomplete.json +238 -0
- package/tokens/components/avatar.json +220 -0
- package/tokens/components/badge.json +119 -0
- package/tokens/components/block-ui.json +40 -0
- package/tokens/components/breadcrumb.json +57 -0
- package/tokens/components/button.json +395 -0
- package/tokens/components/calendar.json +260 -0
- package/tokens/components/card.json +157 -0
- package/tokens/components/carousel.json +154 -0
- package/tokens/components/chart.json +132 -0
- package/tokens/components/checkbox.json +130 -0
- package/tokens/components/chip.json +100 -0
- package/tokens/components/color-picker.json +196 -0
- package/tokens/components/column-group.json +45 -0
- package/tokens/components/column.json +109 -0
- package/tokens/components/confirm-dialog.json +141 -0
- package/tokens/components/confirm-popup.json +101 -0
- package/tokens/components/context-menu.json +168 -0
- package/tokens/components/data-table.json +157 -0
- package/tokens/components/data-view.json +172 -0
- package/tokens/components/dialog.json +151 -0
- package/tokens/components/divider.json +45 -0
- package/tokens/components/dock.json +173 -0
- package/tokens/components/drawer.json +163 -0
- package/tokens/components/dropdown.json +230 -0
- package/tokens/components/editor.json +170 -0
- package/tokens/components/field-set.json +115 -0
- package/tokens/components/file-upload.json +193 -0
- package/tokens/components/galleria.json +235 -0
- package/tokens/components/image-compare.json +74 -0
- package/tokens/components/image.json +71 -0
- package/tokens/components/in-place.json +100 -0
- package/tokens/components/inline-message.json +107 -0
- package/tokens/components/input-chips.json +187 -0
- package/tokens/components/input-group-addon.json +47 -0
- package/tokens/components/input-group.json +21 -0
- package/tokens/components/input-icon.json +38 -0
- package/tokens/components/input-mask.json +136 -0
- package/tokens/components/input-number.json +144 -0
- package/tokens/components/input-otp.json +138 -0
- package/tokens/components/input-switch.json +108 -0
- package/tokens/components/input-text.json +136 -0
- package/tokens/components/knob.json +119 -0
- package/tokens/components/listbox.json +166 -0
- package/tokens/components/mega-menu.json +283 -0
- package/tokens/components/menu.json +145 -0
- package/tokens/components/menubar.json +152 -0
- package/tokens/components/message.json +151 -0
- package/tokens/components/meter-group.json +108 -0
- package/tokens/components/multi-select.json +244 -0
- package/tokens/components/order-list.json +193 -0
- package/tokens/components/organization-chart.json +188 -0
- package/tokens/components/overlay-panel.json +94 -0
- package/tokens/components/paginator.json +186 -0
- package/tokens/components/panel.json +120 -0
- package/tokens/components/panelmenu.json +190 -0
- package/tokens/components/picklist.json +187 -0
- package/tokens/components/popover.json +65 -0
- package/tokens/components/progress-bar.json +33 -0
- package/tokens/components/progress-spinner.json +38 -0
- package/tokens/components/radio.json +125 -0
- package/tokens/components/rating.json +76 -0
- package/tokens/components/row.json +62 -0
- package/tokens/components/scroll-panel.json +69 -0
- package/tokens/components/scroll-top.json +84 -0
- package/tokens/components/select-button.json +145 -0
- package/tokens/components/select.json +190 -0
- package/tokens/components/sidebar.json +146 -0
- package/tokens/components/skeleton.json +26 -0
- package/tokens/components/slider.json +82 -0
- package/tokens/components/speed-dial.json +144 -0
- package/tokens/components/split-button.json +316 -0
- package/tokens/components/splitter.json +88 -0
- package/tokens/components/steps.json +154 -0
- package/tokens/components/tabmenu.json +103 -0
- package/tokens/components/tabs.json +97 -0
- package/tokens/components/tag.json +122 -0
- package/tokens/components/terminal.json +100 -0
- package/tokens/components/textarea.json +96 -0
- package/tokens/components/tieredmenu.json +142 -0
- package/tokens/components/timeline.json +129 -0
- package/tokens/components/toast.json +281 -0
- package/tokens/components/toggle-button.json +220 -0
- package/tokens/components/toggle-switch.json +95 -0
- package/tokens/components/toolbar.json +41 -0
- package/tokens/components/tooltip.json +60 -0
- package/tokens/components/tree-select.json +224 -0
- package/tokens/components/tree.json +153 -0
- package/tokens/components/treetable.json +155 -0
- package/tokens/components/virtualscroller.json +95 -0
- package/tokens/primitives/color.json +137 -0
- package/tokens/primitives/radius.json +12 -0
- package/tokens/primitives/shadow.json +29 -0
- package/tokens/primitives/spacing.json +15 -0
- package/tokens/semantics/color.json +81 -0
- package/tokens/semantics/radius.json +10 -0
- package/tokens/semantics/shadow.json +9 -0
- package/tokens/semantics/spacing.json +24 -0
- package/tokens/themes/dark.json +7 -0
- package/tokens/themes/light.json +7 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="data-table" :class="additionalClasses">
|
|
3
|
+
<div v-if="$slots.header" class="data-table__header">
|
|
4
|
+
<slot name="header" />
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<div class="data-table__wrapper">
|
|
8
|
+
<table class="data-table__table">
|
|
9
|
+
<thead class="data-table__thead">
|
|
10
|
+
<tr>
|
|
11
|
+
<th
|
|
12
|
+
v-for="col in columns"
|
|
13
|
+
:key="col.field"
|
|
14
|
+
class="data-table__th"
|
|
15
|
+
:class="{ 'data-table__th--sortable': col.sortable }"
|
|
16
|
+
:style="col.width ? { width: col.width } : {}"
|
|
17
|
+
scope="col"
|
|
18
|
+
:aria-sort="col.sortable && sortField === col.field ? (sortOrder === 1 ? 'ascending' : 'descending') : (col.sortable ? 'none' : undefined)"
|
|
19
|
+
@click="col.sortable ? onSort(col.field) : null"
|
|
20
|
+
>
|
|
21
|
+
<span class="data-table__th-content">
|
|
22
|
+
{{ col.header }}
|
|
23
|
+
<span v-if="col.sortable" class="data-table__sort-icon">
|
|
24
|
+
<svg
|
|
25
|
+
v-if="sortField === col.field"
|
|
26
|
+
viewBox="0 0 24 24"
|
|
27
|
+
fill="none"
|
|
28
|
+
stroke="currentColor"
|
|
29
|
+
stroke-width="2"
|
|
30
|
+
:class="{ 'data-table__sort-icon--desc': sortOrder === -1 }"
|
|
31
|
+
>
|
|
32
|
+
<polyline points="18 15 12 9 6 15" />
|
|
33
|
+
</svg>
|
|
34
|
+
<svg
|
|
35
|
+
v-else
|
|
36
|
+
viewBox="0 0 24 24"
|
|
37
|
+
fill="none"
|
|
38
|
+
stroke="currentColor"
|
|
39
|
+
stroke-width="2"
|
|
40
|
+
class="data-table__sort-icon--neutral"
|
|
41
|
+
>
|
|
42
|
+
<polyline points="7 10 12 5 17 10" />
|
|
43
|
+
<polyline points="7 14 12 19 17 14" />
|
|
44
|
+
</svg>
|
|
45
|
+
</span>
|
|
46
|
+
</span>
|
|
47
|
+
</th>
|
|
48
|
+
</tr>
|
|
49
|
+
</thead>
|
|
50
|
+
<tbody class="data-table__tbody">
|
|
51
|
+
<tr
|
|
52
|
+
v-for="(row, rowIndex) in paginatedData"
|
|
53
|
+
:key="rowIndex"
|
|
54
|
+
class="data-table__row"
|
|
55
|
+
:class="{ 'data-table__row--striped': striped && rowIndex % 2 === 1 }"
|
|
56
|
+
>
|
|
57
|
+
<td
|
|
58
|
+
v-for="col in columns"
|
|
59
|
+
:key="col.field"
|
|
60
|
+
class="data-table__td"
|
|
61
|
+
>
|
|
62
|
+
<slot :name="`column-${col.field}`" :data="row" :field="col.field">
|
|
63
|
+
{{ getFieldValue(row, col.field) }}
|
|
64
|
+
</slot>
|
|
65
|
+
</td>
|
|
66
|
+
</tr>
|
|
67
|
+
<tr v-if="paginatedData.length === 0" class="data-table__empty-row">
|
|
68
|
+
<td :colspan="columns.length" class="data-table__empty">
|
|
69
|
+
<slot name="empty">
|
|
70
|
+
No records found
|
|
71
|
+
</slot>
|
|
72
|
+
</td>
|
|
73
|
+
</tr>
|
|
74
|
+
</tbody>
|
|
75
|
+
</table>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
<div v-if="paginator && totalPages > 1" class="data-table__pagination">
|
|
79
|
+
<button
|
|
80
|
+
type="button"
|
|
81
|
+
class="data-table__page-btn"
|
|
82
|
+
:disabled="currentPage === 1"
|
|
83
|
+
aria-label="First page"
|
|
84
|
+
@click="goToPage(1)"
|
|
85
|
+
>
|
|
86
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
|
|
87
|
+
<polyline points="11 17 6 12 11 7" />
|
|
88
|
+
<polyline points="18 17 13 12 18 7" />
|
|
89
|
+
</svg>
|
|
90
|
+
</button>
|
|
91
|
+
<button
|
|
92
|
+
type="button"
|
|
93
|
+
class="data-table__page-btn"
|
|
94
|
+
:disabled="currentPage === 1"
|
|
95
|
+
aria-label="Previous page"
|
|
96
|
+
@click="goToPage(currentPage - 1)"
|
|
97
|
+
>
|
|
98
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
|
|
99
|
+
<polyline points="15 18 9 12 15 6" />
|
|
100
|
+
</svg>
|
|
101
|
+
</button>
|
|
102
|
+
<span class="data-table__page-info">
|
|
103
|
+
Page {{ currentPage }} of {{ totalPages }}
|
|
104
|
+
</span>
|
|
105
|
+
<button
|
|
106
|
+
type="button"
|
|
107
|
+
class="data-table__page-btn"
|
|
108
|
+
:disabled="currentPage === totalPages"
|
|
109
|
+
aria-label="Next page"
|
|
110
|
+
@click="goToPage(currentPage + 1)"
|
|
111
|
+
>
|
|
112
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
|
|
113
|
+
<polyline points="9 18 15 12 9 6" />
|
|
114
|
+
</svg>
|
|
115
|
+
</button>
|
|
116
|
+
<button
|
|
117
|
+
type="button"
|
|
118
|
+
class="data-table__page-btn"
|
|
119
|
+
:disabled="currentPage === totalPages"
|
|
120
|
+
aria-label="Last page"
|
|
121
|
+
@click="goToPage(totalPages)"
|
|
122
|
+
>
|
|
123
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
|
|
124
|
+
<polyline points="13 17 18 12 13 7" />
|
|
125
|
+
<polyline points="6 17 11 12 6 7" />
|
|
126
|
+
</svg>
|
|
127
|
+
</button>
|
|
128
|
+
</div>
|
|
129
|
+
|
|
130
|
+
<div v-if="$slots.footer" class="data-table__footer">
|
|
131
|
+
<slot name="footer" />
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
</template>
|
|
135
|
+
|
|
136
|
+
<style src="./DataTable.scss"></style>
|
|
137
|
+
|
|
138
|
+
<script setup lang="ts">
|
|
139
|
+
import type { DataTableProps, DataTableEmits } from '../../types';
|
|
140
|
+
import { ref, computed, watch } from "vue";
|
|
141
|
+
|
|
142
|
+
const props = withDefaults(defineProps<DataTableProps>(), {
|
|
143
|
+
value: () => [],
|
|
144
|
+
columns: () => [],
|
|
145
|
+
striped: false,
|
|
146
|
+
hoverable: true,
|
|
147
|
+
paginator: false,
|
|
148
|
+
rows: 10,
|
|
149
|
+
sortField: null,
|
|
150
|
+
sortOrder: 1,
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
const emit = defineEmits(["sort", "page"]);
|
|
154
|
+
|
|
155
|
+
defineOptions({
|
|
156
|
+
name: "FtpDataTable",
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
const currentPage = ref(1);
|
|
160
|
+
const internalSortField = ref(props.sortField);
|
|
161
|
+
const internalSortOrder = ref(props.sortOrder);
|
|
162
|
+
|
|
163
|
+
watch(
|
|
164
|
+
() => props.sortField,
|
|
165
|
+
(val) => {
|
|
166
|
+
internalSortField.value = val;
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
watch(
|
|
171
|
+
() => props.sortOrder,
|
|
172
|
+
(val) => {
|
|
173
|
+
internalSortOrder.value = val;
|
|
174
|
+
}
|
|
175
|
+
);
|
|
176
|
+
|
|
177
|
+
const sortField = computed(() => internalSortField.value);
|
|
178
|
+
const sortOrder = computed(() => internalSortOrder.value);
|
|
179
|
+
|
|
180
|
+
const sortedData = computed(() => {
|
|
181
|
+
if (!internalSortField.value) return props.value;
|
|
182
|
+
return [...props.value].sort((a, b) => {
|
|
183
|
+
const aVal = getFieldValue(a, internalSortField.value);
|
|
184
|
+
const bVal = getFieldValue(b, internalSortField.value);
|
|
185
|
+
if (aVal < bVal) return -1 * internalSortOrder.value;
|
|
186
|
+
if (aVal > bVal) return 1 * internalSortOrder.value;
|
|
187
|
+
return 0;
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
const totalPages = computed(() => {
|
|
192
|
+
if (!props.paginator || props.rows <= 0) return 1;
|
|
193
|
+
return Math.ceil(sortedData.value.length / props.rows);
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
const paginatedData = computed(() => {
|
|
197
|
+
if (!props.paginator) return sortedData.value;
|
|
198
|
+
const start = (currentPage.value - 1) * props.rows;
|
|
199
|
+
return sortedData.value.slice(start, start + props.rows);
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
const additionalClasses = computed(() =>
|
|
203
|
+
[props.hoverable && "data-table--hoverable"].filter(Boolean).join(" ")
|
|
204
|
+
);
|
|
205
|
+
|
|
206
|
+
const getFieldValue = (obj: any, field: any) => {
|
|
207
|
+
return field.split(".").reduce((o: any, k: any) => (o ? o[k] : undefined), obj);
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
const onSort = (field: any) => {
|
|
211
|
+
if (internalSortField.value === field) {
|
|
212
|
+
internalSortOrder.value = (internalSortOrder.value * -1) as 1 | -1;
|
|
213
|
+
} else {
|
|
214
|
+
internalSortField.value = field;
|
|
215
|
+
internalSortOrder.value = 1;
|
|
216
|
+
}
|
|
217
|
+
emit("sort", { sortField: internalSortField.value, sortOrder: internalSortOrder.value });
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
const goToPage = (page: any) => {
|
|
221
|
+
if (page < 1 || page > totalPages.value) return;
|
|
222
|
+
currentPage.value = page;
|
|
223
|
+
emit("page", { page: currentPage.value });
|
|
224
|
+
};
|
|
225
|
+
</script>
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
@use "../../../dist/scss/tokens" as *;
|
|
2
|
+
|
|
3
|
+
$c: data-view;
|
|
4
|
+
|
|
5
|
+
.#{$c} {
|
|
6
|
+
background-color: var(--dataView-background, $dataView-background);
|
|
7
|
+
border: var(--dataView-border-width, $dataView-border-width) solid var(--dataView-border-color, $dataView-border-color);
|
|
8
|
+
border-radius: var(--dataView-radius, $dataView-radius);
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.#{$c}__header {
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: space-between;
|
|
16
|
+
gap: var(--inset-m, $inset-m);
|
|
17
|
+
padding: var(--dataView-header-padding, $dataView-header-padding);
|
|
18
|
+
background-color: var(--dataView-header-background, $dataView-header-background);
|
|
19
|
+
border-bottom: var(--dataView-border-width, $dataView-border-width) solid var(--dataView-header-borderColor, $dataView-header-borderColor);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.#{$c}__header-content {
|
|
23
|
+
flex: 1;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.#{$c}__layout-switcher {
|
|
27
|
+
display: flex;
|
|
28
|
+
gap: var(--dataView-layoutSwitcher-gap, $dataView-layoutSwitcher-gap);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.#{$c}__layout-btn {
|
|
32
|
+
display: inline-flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
width: var(--dataView-layoutSwitcher-button-size, $dataView-layoutSwitcher-button-size);
|
|
36
|
+
height: var(--dataView-layoutSwitcher-button-size, $dataView-layoutSwitcher-button-size);
|
|
37
|
+
padding: 0;
|
|
38
|
+
border: none;
|
|
39
|
+
background-color: var(--dataView-layoutSwitcher-button-background-default, $dataView-layoutSwitcher-button-background-default);
|
|
40
|
+
border-radius: var(--dataView-layoutSwitcher-button-radius, $dataView-layoutSwitcher-button-radius);
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
transition: background-color var(--dataView-transition-duration, $dataView-transition-duration) ease,
|
|
43
|
+
color var(--dataView-transition-duration, $dataView-transition-duration) ease;
|
|
44
|
+
|
|
45
|
+
svg {
|
|
46
|
+
width: 16px;
|
|
47
|
+
height: 16px;
|
|
48
|
+
color: var(--dataView-layoutSwitcher-button-color-default, $dataView-layoutSwitcher-button-color-default);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&:hover {
|
|
52
|
+
background-color: var(--dataView-layoutSwitcher-button-background-hover, $dataView-layoutSwitcher-button-background-hover);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&--active {
|
|
56
|
+
background-color: var(--dataView-layoutSwitcher-button-background-active, $dataView-layoutSwitcher-button-background-active);
|
|
57
|
+
|
|
58
|
+
svg {
|
|
59
|
+
color: var(--dataView-layoutSwitcher-button-color-active, $dataView-layoutSwitcher-button-color-active);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.#{$c}__content {
|
|
65
|
+
padding: var(--dataView-content-padding, $dataView-content-padding);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.#{$c}__content--list {
|
|
69
|
+
display: flex;
|
|
70
|
+
flex-direction: column;
|
|
71
|
+
gap: var(--dataView-list-gap, $dataView-list-gap);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.#{$c}__content--grid {
|
|
75
|
+
display: grid;
|
|
76
|
+
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
|
|
77
|
+
gap: var(--dataView-grid-gap, $dataView-grid-gap);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.#{$c}--layout-list .#{$c}__item {
|
|
81
|
+
padding: var(--dataView-list-item-padding, $dataView-list-item-padding);
|
|
82
|
+
background-color: var(--dataView-list-item-background-default, $dataView-list-item-background-default);
|
|
83
|
+
border: 1px solid var(--dataView-list-item-borderColor, $dataView-list-item-borderColor);
|
|
84
|
+
border-radius: var(--dataView-list-item-radius, $dataView-list-item-radius);
|
|
85
|
+
transition: background-color var(--dataView-transition-duration, $dataView-transition-duration) ease;
|
|
86
|
+
|
|
87
|
+
&:hover {
|
|
88
|
+
background-color: var(--dataView-list-item-background-hover, $dataView-list-item-background-hover);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.#{$c}--layout-grid .#{$c}__item {
|
|
93
|
+
// Grid items are typically styled by the slot content
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.#{$c}__empty {
|
|
97
|
+
padding: var(--dataView-empty-padding, $dataView-empty-padding);
|
|
98
|
+
text-align: center;
|
|
99
|
+
color: var(--dataView-empty-color, $dataView-empty-color);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.#{$c}__pagination {
|
|
103
|
+
display: flex;
|
|
104
|
+
align-items: center;
|
|
105
|
+
justify-content: center;
|
|
106
|
+
gap: var(--inset-xs, $inset-xs);
|
|
107
|
+
padding: var(--dataView-pagination-padding, $dataView-pagination-padding);
|
|
108
|
+
border-top: var(--dataView-border-width, $dataView-border-width) solid var(--dataView-pagination-borderColor, $dataView-pagination-borderColor);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.#{$c}__page-btn {
|
|
112
|
+
display: inline-flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
justify-content: center;
|
|
115
|
+
width: 32px;
|
|
116
|
+
height: 32px;
|
|
117
|
+
padding: 0;
|
|
118
|
+
border: none;
|
|
119
|
+
background: transparent;
|
|
120
|
+
cursor: pointer;
|
|
121
|
+
border-radius: var(--dataView-layoutSwitcher-button-radius, $dataView-layoutSwitcher-button-radius);
|
|
122
|
+
transition: background-color var(--dataView-transition-duration, $dataView-transition-duration) ease;
|
|
123
|
+
|
|
124
|
+
svg {
|
|
125
|
+
width: 16px;
|
|
126
|
+
height: 16px;
|
|
127
|
+
color: var(--text-default, $text-default);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
&:hover:not(:disabled) {
|
|
131
|
+
background-color: var(--dataView-list-item-background-hover, $dataView-list-item-background-hover);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
&:disabled {
|
|
135
|
+
opacity: 0.4;
|
|
136
|
+
cursor: not-allowed;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.#{$c}__page-info {
|
|
141
|
+
font-size: 14px;
|
|
142
|
+
color: var(--text-default, $text-default);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.#{$c}__footer {
|
|
146
|
+
padding: var(--dataView-header-padding, $dataView-header-padding);
|
|
147
|
+
background-color: var(--dataView-header-background, $dataView-header-background);
|
|
148
|
+
border-top: var(--dataView-border-width, $dataView-border-width) solid var(--dataView-header-borderColor, $dataView-header-borderColor);
|
|
149
|
+
}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="data-view" :class="additionalClasses">
|
|
3
|
+
<div v-if="$slots.header || showLayoutSwitcher" class="data-view__header">
|
|
4
|
+
<div class="data-view__header-content">
|
|
5
|
+
<slot name="header" />
|
|
6
|
+
</div>
|
|
7
|
+
<div v-if="showLayoutSwitcher" class="data-view__layout-switcher">
|
|
8
|
+
<button
|
|
9
|
+
class="data-view__layout-btn"
|
|
10
|
+
:class="{ 'data-view__layout-btn--active': internalLayout === 'list' }"
|
|
11
|
+
type="button"
|
|
12
|
+
aria-label="List view"
|
|
13
|
+
@click="setLayout('list')"
|
|
14
|
+
>
|
|
15
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
16
|
+
<line x1="8" y1="6" x2="21" y2="6" />
|
|
17
|
+
<line x1="8" y1="12" x2="21" y2="12" />
|
|
18
|
+
<line x1="8" y1="18" x2="21" y2="18" />
|
|
19
|
+
<line x1="3" y1="6" x2="3.01" y2="6" />
|
|
20
|
+
<line x1="3" y1="12" x2="3.01" y2="12" />
|
|
21
|
+
<line x1="3" y1="18" x2="3.01" y2="18" />
|
|
22
|
+
</svg>
|
|
23
|
+
</button>
|
|
24
|
+
<button
|
|
25
|
+
class="data-view__layout-btn"
|
|
26
|
+
:class="{ 'data-view__layout-btn--active': internalLayout === 'grid' }"
|
|
27
|
+
type="button"
|
|
28
|
+
aria-label="Grid view"
|
|
29
|
+
@click="setLayout('grid')"
|
|
30
|
+
>
|
|
31
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
32
|
+
<rect x="3" y="3" width="7" height="7" />
|
|
33
|
+
<rect x="14" y="3" width="7" height="7" />
|
|
34
|
+
<rect x="14" y="14" width="7" height="7" />
|
|
35
|
+
<rect x="3" y="14" width="7" height="7" />
|
|
36
|
+
</svg>
|
|
37
|
+
</button>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<div class="data-view__content" :class="`data-view__content--${internalLayout}`">
|
|
42
|
+
<template v-if="paginatedData.length > 0">
|
|
43
|
+
<div
|
|
44
|
+
v-for="(item, index) in paginatedData"
|
|
45
|
+
:key="index"
|
|
46
|
+
class="data-view__item"
|
|
47
|
+
>
|
|
48
|
+
<slot :name="internalLayout" :data="item" :index="index">
|
|
49
|
+
<slot name="item" :data="item" :index="index">
|
|
50
|
+
{{ item }}
|
|
51
|
+
</slot>
|
|
52
|
+
</slot>
|
|
53
|
+
</div>
|
|
54
|
+
</template>
|
|
55
|
+
<div v-else class="data-view__empty">
|
|
56
|
+
<slot name="empty">
|
|
57
|
+
No records found
|
|
58
|
+
</slot>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<div v-if="paginator && totalPages > 1" class="data-view__pagination">
|
|
63
|
+
<button
|
|
64
|
+
type="button"
|
|
65
|
+
class="data-view__page-btn"
|
|
66
|
+
:disabled="currentPage === 1"
|
|
67
|
+
@click="goToPage(1)"
|
|
68
|
+
>
|
|
69
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
70
|
+
<polyline points="11 17 6 12 11 7" />
|
|
71
|
+
<polyline points="18 17 13 12 18 7" />
|
|
72
|
+
</svg>
|
|
73
|
+
</button>
|
|
74
|
+
<button
|
|
75
|
+
type="button"
|
|
76
|
+
class="data-view__page-btn"
|
|
77
|
+
:disabled="currentPage === 1"
|
|
78
|
+
@click="goToPage(currentPage - 1)"
|
|
79
|
+
>
|
|
80
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
81
|
+
<polyline points="15 18 9 12 15 6" />
|
|
82
|
+
</svg>
|
|
83
|
+
</button>
|
|
84
|
+
<span class="data-view__page-info">
|
|
85
|
+
Page {{ currentPage }} of {{ totalPages }}
|
|
86
|
+
</span>
|
|
87
|
+
<button
|
|
88
|
+
type="button"
|
|
89
|
+
class="data-view__page-btn"
|
|
90
|
+
:disabled="currentPage === totalPages"
|
|
91
|
+
@click="goToPage(currentPage + 1)"
|
|
92
|
+
>
|
|
93
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
94
|
+
<polyline points="9 18 15 12 9 6" />
|
|
95
|
+
</svg>
|
|
96
|
+
</button>
|
|
97
|
+
<button
|
|
98
|
+
type="button"
|
|
99
|
+
class="data-view__page-btn"
|
|
100
|
+
:disabled="currentPage === totalPages"
|
|
101
|
+
@click="goToPage(totalPages)"
|
|
102
|
+
>
|
|
103
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
104
|
+
<polyline points="13 17 18 12 13 7" />
|
|
105
|
+
<polyline points="6 17 11 12 6 7" />
|
|
106
|
+
</svg>
|
|
107
|
+
</button>
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
<div v-if="$slots.footer" class="data-view__footer">
|
|
111
|
+
<slot name="footer" />
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
</template>
|
|
115
|
+
|
|
116
|
+
<style src="./DataView.scss"></style>
|
|
117
|
+
|
|
118
|
+
<script setup lang="ts">
|
|
119
|
+
import type { DataViewProps, DataViewEmits } from '../../types';
|
|
120
|
+
import { ref, computed, watch } from "vue";
|
|
121
|
+
|
|
122
|
+
const props = withDefaults(defineProps<DataViewProps>(), {
|
|
123
|
+
value: () => [],
|
|
124
|
+
layout: "list",
|
|
125
|
+
gridColumns: 3,
|
|
126
|
+
paginator: false,
|
|
127
|
+
rows: 9,
|
|
128
|
+
showLayoutSwitcher: true,
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
const emit = defineEmits(["update:layout", "page"]);
|
|
132
|
+
|
|
133
|
+
defineOptions({
|
|
134
|
+
name: "FtpDataView",
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
const currentPage = ref(1);
|
|
138
|
+
const internalLayout = ref(props.layout);
|
|
139
|
+
|
|
140
|
+
watch(
|
|
141
|
+
() => props.layout,
|
|
142
|
+
(val) => {
|
|
143
|
+
internalLayout.value = val;
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
const totalPages = computed(() => {
|
|
148
|
+
if (!props.paginator || props.rows <= 0) return 1;
|
|
149
|
+
return Math.ceil(props.value.length / props.rows);
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
const paginatedData = computed(() => {
|
|
153
|
+
if (!props.paginator) return props.value;
|
|
154
|
+
const start = (currentPage.value - 1) * props.rows;
|
|
155
|
+
return props.value.slice(start, start + props.rows);
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
const additionalClasses = computed(() =>
|
|
159
|
+
[`data-view--layout-${internalLayout.value}`].filter(Boolean).join(" ")
|
|
160
|
+
);
|
|
161
|
+
|
|
162
|
+
const setLayout = (layout: any) => {
|
|
163
|
+
internalLayout.value = layout;
|
|
164
|
+
emit("update:layout", layout);
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
const goToPage = (page: any) => {
|
|
168
|
+
if (page < 1 || page > totalPages.value) return;
|
|
169
|
+
currentPage.value = page;
|
|
170
|
+
emit("page", { page: currentPage.value });
|
|
171
|
+
};
|
|
172
|
+
</script>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
@use "../../../dist/scss/tokens" as *;
|
|
2
|
+
|
|
3
|
+
$c: date-picker;
|
|
4
|
+
|
|
5
|
+
.#{$c} {
|
|
6
|
+
position: relative;
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
|
|
9
|
+
&--disabled {
|
|
10
|
+
opacity: 0.5;
|
|
11
|
+
pointer-events: none;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.#{$c}__input-wrapper {
|
|
16
|
+
position: relative;
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.#{$c}__input {
|
|
23
|
+
width: 100%;
|
|
24
|
+
min-width: 200px;
|
|
25
|
+
padding: 0.5rem 2.5rem 0.5rem 0.75rem;
|
|
26
|
+
border: 1px solid var(--surface-border, rgba(255, 255, 255, 0.15));
|
|
27
|
+
border-radius: 0.5rem;
|
|
28
|
+
background: var(--surface-ground, rgba(255, 255, 255, 0.05));
|
|
29
|
+
color: var(--text-primary, #fff);
|
|
30
|
+
font-size: 0.875rem;
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
outline: none;
|
|
33
|
+
transition: border-color 0.15s ease;
|
|
34
|
+
|
|
35
|
+
&::placeholder {
|
|
36
|
+
color: var(--text-muted, rgba(255, 255, 255, 0.4));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&:focus,
|
|
40
|
+
&--active {
|
|
41
|
+
border-color: var(--color-primary, #6366f1);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.#{$c}__calendar-icon {
|
|
46
|
+
position: absolute;
|
|
47
|
+
right: 0.75rem;
|
|
48
|
+
width: 1rem;
|
|
49
|
+
height: 1rem;
|
|
50
|
+
color: var(--text-muted, rgba(255, 255, 255, 0.5));
|
|
51
|
+
pointer-events: none;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.#{$c}__dropdown {
|
|
55
|
+
background: var(--surface-overlay, #1e1e2e);
|
|
56
|
+
border: 1px solid var(--surface-border, rgba(255, 255, 255, 0.1));
|
|
57
|
+
border-radius: 0.75rem;
|
|
58
|
+
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
|
|
59
|
+
overflow: hidden;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Transition
|
|
63
|
+
.date-picker-dropdown-enter-active,
|
|
64
|
+
.date-picker-dropdown-leave-active {
|
|
65
|
+
transition: opacity 0.15s ease, transform 0.15s ease;
|
|
66
|
+
}
|
|
67
|
+
.date-picker-dropdown-enter-from,
|
|
68
|
+
.date-picker-dropdown-leave-to {
|
|
69
|
+
opacity: 0;
|
|
70
|
+
transform: translateY(-4px);
|
|
71
|
+
}
|