@lowdefy/blocks-antd 5.6.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/TagPillRow.js +88 -0
- package/dist/blocks/Affix/gallery.yaml +399 -0
- package/dist/blocks/Affix/tests/Affix.e2e.yaml +72 -0
- package/dist/blocks/Affix/tests.yaml +29 -0
- package/dist/blocks/Alert/gallery.yaml +701 -0
- package/dist/blocks/Alert/tests/Alert.e2e.yaml +161 -0
- package/dist/blocks/Alert/tests.yaml +261 -0
- package/dist/blocks/AutoComplete/gallery.yaml +713 -0
- package/dist/blocks/AutoComplete/tests/AutoComplete.e2e.yaml +330 -0
- package/dist/blocks/AutoComplete/tests.yaml +178 -0
- package/dist/blocks/Avatar/gallery.yaml +1037 -0
- package/dist/blocks/Avatar/tests/Avatar.e2e.yaml +125 -0
- package/dist/blocks/Avatar/tests.yaml +76 -0
- package/dist/blocks/Badge/gallery.yaml +1090 -0
- package/dist/blocks/Badge/tests/Badge.e2e.yaml +195 -0
- package/dist/blocks/Badge/tests.yaml +91 -0
- package/dist/blocks/Breadcrumb/gallery.yaml +484 -0
- package/dist/blocks/Breadcrumb/tests/Breadcrumb.e2e.yaml +165 -0
- package/dist/blocks/Breadcrumb/tests.yaml +106 -0
- package/dist/blocks/Button/gallery.yaml +718 -0
- package/dist/blocks/Button/tests/Button.e2e.yaml +246 -0
- package/dist/blocks/Button/tests.yaml +104 -0
- package/dist/blocks/ButtonSelector/gallery.yaml +891 -0
- package/dist/blocks/ButtonSelector/tests/ButtonSelector.e2e.yaml +188 -0
- package/dist/blocks/ButtonSelector/tests.yaml +167 -0
- package/dist/blocks/Calendar/gallery.yaml +128 -0
- package/dist/blocks/Calendar/tests/Calendar.e2e.yaml +136 -0
- package/dist/blocks/Calendar/tests.yaml +50 -0
- package/dist/blocks/Card/gallery.yaml +1035 -0
- package/dist/blocks/Card/tests/Card.e2e.yaml +209 -0
- package/dist/blocks/Card/tests.yaml +75 -0
- package/dist/blocks/Carousel/gallery.yaml +1971 -0
- package/dist/blocks/Carousel/tests/Carousel.e2e.yaml +211 -0
- package/dist/blocks/Carousel/tests.yaml +117 -0
- package/dist/blocks/CheckboxSelector/gallery.yaml +781 -0
- package/dist/blocks/CheckboxSelector/tests/CheckboxSelector.e2e.yaml +272 -0
- package/dist/blocks/CheckboxSelector/tests.yaml +325 -0
- package/dist/blocks/CheckboxSwitch/gallery.yaml +457 -0
- package/dist/blocks/CheckboxSwitch/tests/CheckboxSwitch.e2e.yaml +126 -0
- package/dist/blocks/CheckboxSwitch/tests.yaml +96 -0
- package/dist/blocks/Collapse/gallery.yaml +1079 -0
- package/dist/blocks/Collapse/tests/Collapse.e2e.yaml +206 -0
- package/dist/blocks/Collapse/tests.yaml +265 -0
- package/dist/blocks/ColorSelector/gallery.yaml +807 -0
- package/dist/blocks/ColorSelector/tests/ColorSelector.e2e.yaml +77 -0
- package/dist/blocks/ColorSelector/tests.yaml +84 -0
- package/dist/blocks/ConfigProvider/gallery.yaml +1003 -0
- package/dist/blocks/ConfigProvider/tests.yaml +62 -0
- package/dist/blocks/ConfirmModal/gallery.yaml +1043 -0
- package/dist/blocks/ConfirmModal/tests/ConfirmModal.e2e.yaml +410 -0
- package/dist/blocks/ConfirmModal/tests.yaml +95 -0
- package/dist/blocks/Content/gallery.yaml +528 -0
- package/dist/blocks/Content/tests/Content.e2e.yaml +71 -0
- package/dist/blocks/Content/tests.yaml +42 -0
- package/dist/blocks/ControlledList/ControlledList.js +1 -1
- package/dist/blocks/ControlledList/gallery.yaml +481 -0
- package/dist/blocks/ControlledList/{style.module.css → style.css} +3 -3
- package/dist/blocks/ControlledList/tests/ControlledList.e2e.yaml +161 -0
- package/dist/blocks/ControlledList/tests.yaml +57 -0
- package/dist/blocks/DateRangeSelector/DateRangeSelector.js +7 -0
- package/dist/blocks/DateRangeSelector/e2e.js +28 -2
- package/dist/blocks/DateRangeSelector/gallery.yaml +858 -0
- package/dist/blocks/DateRangeSelector/meta.js +2 -0
- package/dist/blocks/DateRangeSelector/tests/DateRangeSelector.e2e.yaml +204 -0
- package/dist/blocks/DateRangeSelector/tests.yaml +129 -0
- package/dist/blocks/DateSelector/DateSelector.js +6 -0
- package/dist/blocks/DateSelector/e2e.js +28 -2
- package/dist/blocks/DateSelector/gallery.yaml +691 -0
- package/dist/blocks/DateSelector/meta.js +6 -0
- package/dist/blocks/DateSelector/tests/DateSelector.e2e.yaml +229 -0
- package/dist/blocks/DateSelector/tests.yaml +117 -0
- package/dist/blocks/DateTimeSelector/DateTimeSelector.js +7 -0
- package/dist/blocks/DateTimeSelector/e2e.js +26 -2
- package/dist/blocks/DateTimeSelector/gallery.yaml +770 -0
- package/dist/blocks/DateTimeSelector/meta.js +2 -0
- package/dist/blocks/DateTimeSelector/tests/DateTimeSelector.e2e.yaml +163 -0
- package/dist/blocks/DateTimeSelector/tests.yaml +140 -0
- package/dist/blocks/Descriptions/gallery.yaml +839 -0
- package/dist/blocks/Descriptions/tests/Descriptions.e2e.yaml +143 -0
- package/dist/blocks/Descriptions/tests.yaml +256 -0
- package/dist/blocks/Divider/gallery.yaml +375 -0
- package/dist/blocks/Divider/tests/Divider.e2e.yaml +107 -0
- package/dist/blocks/Divider/tests.yaml +58 -0
- package/dist/blocks/Drawer/gallery.yaml +1257 -0
- package/dist/blocks/Drawer/tests/Drawer.e2e.yaml +562 -0
- package/dist/blocks/Drawer/tests.yaml +80 -0
- package/dist/blocks/DropdownButton/gallery.yaml +606 -0
- package/dist/blocks/DropdownButton/tests/DropdownButton.e2e.yaml +243 -0
- package/dist/blocks/DropdownMenu/gallery.yaml +578 -0
- package/dist/blocks/DropdownMenu/tests/DropdownMenu.e2e.yaml +267 -0
- package/dist/blocks/Flex/gallery.yaml +1416 -0
- package/dist/blocks/Flex/tests/Flex.e2e.yaml +95 -0
- package/dist/blocks/Flex/tests.yaml +92 -0
- package/dist/blocks/FloatButton/gallery.yaml +518 -0
- package/dist/blocks/FloatButton/tests/FloatButton.e2e.yaml +73 -0
- package/dist/blocks/FloatButton/tests.yaml +59 -0
- package/dist/blocks/Footer/gallery.yaml +355 -0
- package/dist/blocks/Footer/tests/Footer.e2e.yaml +70 -0
- package/dist/blocks/Footer/tests.yaml +28 -0
- package/dist/blocks/Header/gallery.yaml +249 -0
- package/dist/blocks/Header/tests/Header.e2e.yaml +77 -0
- package/dist/blocks/Header/tests.yaml +36 -0
- package/dist/blocks/Label/Label.js +1 -1
- package/dist/blocks/Label/gallery.yaml +762 -0
- package/dist/blocks/Label/{style.module.css → style.css} +28 -28
- package/dist/blocks/Label/tests/Label.e2e.yaml +247 -0
- package/dist/blocks/Label/tests.yaml +212 -0
- package/dist/blocks/Layout/gallery.yaml +548 -0
- package/dist/blocks/Layout/tests/Layout.e2e.yaml +86 -0
- package/dist/blocks/Layout/tests.yaml +28 -0
- package/dist/blocks/ListSelector/gallery.yaml +223 -0
- package/dist/blocks/Masonry/gallery.yaml +989 -0
- package/dist/blocks/Masonry/tests/Masonry.e2e.yaml +128 -0
- package/dist/blocks/Masonry/tests.yaml +42 -0
- package/dist/blocks/MasonryList/gallery.yaml +224 -0
- package/dist/blocks/MasonryList/tests/MasonryList.e2e.yaml +55 -0
- package/dist/blocks/MasonryList/tests.yaml +42 -0
- package/dist/blocks/Menu/gallery.yaml +974 -0
- package/dist/blocks/Menu/tests/Menu.e2e.yaml +484 -0
- package/dist/blocks/Menu/tests.yaml +1053 -0
- package/dist/blocks/Message/gallery.yaml +860 -0
- package/dist/blocks/Message/tests/Message.e2e.yaml +246 -0
- package/dist/blocks/Message/tests.yaml +54 -0
- package/dist/blocks/MobileMenu/gallery.yaml +1172 -0
- package/dist/blocks/MobileMenu/tests/MobileMenu.e2e.yaml +314 -0
- package/dist/blocks/MobileMenu/tests.yaml +359 -0
- package/dist/blocks/Modal/gallery.yaml +1039 -0
- package/dist/blocks/Modal/tests/Modal.e2e.yaml +493 -0
- package/dist/blocks/Modal/tests.yaml +75 -0
- package/dist/blocks/MonthSelector/MonthSelector.js +6 -0
- package/dist/blocks/MonthSelector/e2e.js +26 -2
- package/dist/blocks/MonthSelector/gallery.yaml +687 -0
- package/dist/blocks/MonthSelector/meta.js +6 -0
- package/dist/blocks/MonthSelector/tests/MonthSelector.e2e.yaml +167 -0
- package/dist/blocks/MonthSelector/tests.yaml +124 -0
- package/dist/blocks/MultipleSelector/gallery.yaml +1245 -0
- package/dist/blocks/MultipleSelector/tests/MultipleSelector.e2e.yaml +445 -0
- package/dist/blocks/MultipleSelector/tests.yaml +201 -0
- package/dist/blocks/Notification/gallery.yaml +1376 -0
- package/dist/blocks/Notification/tests/Notification.e2e.yaml +362 -0
- package/dist/blocks/Notification/tests.yaml +97 -0
- package/dist/blocks/NumberInput/gallery.yaml +753 -0
- package/dist/blocks/NumberInput/tests/NumberInput.e2e.yaml +228 -0
- package/dist/blocks/NumberInput/tests.yaml +116 -0
- package/dist/blocks/PageHeaderMenu/PageHeaderMenu.js +1 -1
- package/dist/blocks/PageHeaderMenu/gallery.yaml +480 -0
- package/dist/blocks/PageHeaderMenu/tests/PageHeaderMenu.e2e.yaml +110 -0
- package/dist/blocks/PageHeaderMenu/tests.yaml +173 -0
- package/dist/blocks/PageSidebarLayout/PageSidebarLayout.js +10 -1
- package/dist/blocks/PageSidebarLayout/gallery.yaml +302 -0
- package/dist/blocks/PageSidebarLayout/meta.js +1 -0
- package/dist/blocks/PageSidebarLayout/tests/PageSidebarLayout.e2e.yaml +216 -0
- package/dist/blocks/PageSidebarLayout/tests.yaml +174 -0
- package/dist/blocks/PageSiderMenu/PageSiderMenu.js +1 -1
- package/dist/blocks/PageSiderMenu/gallery.yaml +516 -0
- package/dist/blocks/PageSiderMenu/tests/PageSiderMenu.e2e.yaml +175 -0
- package/dist/blocks/PageSiderMenu/tests.yaml +211 -0
- package/dist/blocks/Pagination/gallery.yaml +503 -0
- package/dist/blocks/Pagination/tests/Pagination.e2e.yaml +159 -0
- package/dist/blocks/Pagination/tests.yaml +80 -0
- package/dist/blocks/Paragraph/gallery.yaml +458 -0
- package/dist/blocks/Paragraph/tests/Paragraph.e2e.yaml +153 -0
- package/dist/blocks/Paragraph/tests.yaml +176 -0
- package/dist/blocks/ParagraphInput/gallery.yaml +1483 -0
- package/dist/blocks/ParagraphInput/tests/ParagraphInput.e2e.yaml +189 -0
- package/dist/blocks/ParagraphInput/tests.yaml +163 -0
- package/dist/blocks/PasswordInput/gallery.yaml +420 -0
- package/dist/blocks/PasswordInput/tests/PasswordInput.e2e.yaml +188 -0
- package/dist/blocks/PasswordInput/tests.yaml +78 -0
- package/dist/blocks/PhoneNumberInput/gallery.yaml +677 -0
- package/dist/blocks/PhoneNumberInput/tests/PhoneNumberInput.e2e.yaml +279 -0
- package/dist/blocks/PhoneNumberInput/tests.yaml +25 -0
- package/dist/blocks/Popover/gallery.yaml +1301 -0
- package/dist/blocks/Popover/tests/Popover.e2e.yaml +249 -0
- package/dist/blocks/Popover/tests.yaml +105 -0
- package/dist/blocks/Progress/gallery.yaml +772 -0
- package/dist/blocks/Progress/tests/Progress.e2e.yaml +167 -0
- package/dist/blocks/Progress/tests.yaml +114 -0
- package/dist/blocks/QRCode/gallery.yaml +492 -0
- package/dist/blocks/QRCode/tests/QRCode.e2e.yaml +66 -0
- package/dist/blocks/QRCode/tests.yaml +113 -0
- package/dist/blocks/RadioSelector/gallery.yaml +816 -0
- package/dist/blocks/RadioSelector/tests/RadioSelector.e2e.yaml +269 -0
- package/dist/blocks/RadioSelector/tests.yaml +339 -0
- package/dist/blocks/RatingSlider/gallery.yaml +627 -0
- package/dist/blocks/RatingSlider/tests/RatingSlider.e2e.yaml +188 -0
- package/dist/blocks/RatingSlider/tests.yaml +116 -0
- package/dist/blocks/Result/gallery.yaml +925 -0
- package/dist/blocks/Result/tests/Result.e2e.yaml +126 -0
- package/dist/blocks/Result/tests.yaml +75 -0
- package/dist/blocks/Search/Search.js +1 -1
- package/dist/blocks/Search/SearchModal.js +18 -9
- package/dist/blocks/Search/gallery.yaml +170 -0
- package/dist/blocks/Search/meta.js +2 -1
- package/dist/blocks/Search/{style.module.css → style.css} +19 -12
- package/dist/blocks/Search/tests/Search.e2e.yaml +125 -0
- package/dist/blocks/Search/useSearchIndex.js +24 -2
- package/dist/blocks/SegmentedSelector/gallery.yaml +725 -0
- package/dist/blocks/SegmentedSelector/tests/SegmentedSelector.e2e.yaml +115 -0
- package/dist/blocks/SegmentedSelector/tests.yaml +141 -0
- package/dist/blocks/Selector/gallery.yaml +1055 -0
- package/dist/blocks/Selector/tests/Selector.e2e.yaml +427 -0
- package/dist/blocks/Selector/tests.yaml +196 -0
- package/dist/blocks/Sider/gallery.yaml +994 -0
- package/dist/blocks/Sider/tests/Sider.e2e.yaml +162 -0
- package/dist/blocks/Sider/tests.yaml +20 -0
- package/dist/blocks/Slider/gallery.yaml +600 -0
- package/dist/blocks/Slider/tests/Slider.e2e.yaml +190 -0
- package/dist/blocks/Slider/tests.yaml +68 -0
- package/dist/blocks/Splitter/gallery.yaml +1511 -0
- package/dist/blocks/Splitter/tests/Splitter.e2e.yaml +114 -0
- package/dist/blocks/Splitter/tests.yaml +79 -0
- package/dist/blocks/Statistic/gallery.yaml +460 -0
- package/dist/blocks/Statistic/tests/Statistic.e2e.yaml +137 -0
- package/dist/blocks/Statistic/tests.yaml +77 -0
- package/dist/blocks/Steps/gallery.yaml +550 -0
- package/dist/blocks/Switch/gallery.yaml +502 -0
- package/dist/blocks/Switch/tests/Switch.e2e.yaml +132 -0
- package/dist/blocks/Switch/tests.yaml +87 -0
- package/dist/blocks/Tabs/gallery.yaml +1353 -0
- package/dist/blocks/Tabs/tests/Tabs.e2e.yaml +370 -0
- package/dist/blocks/Tabs/tests.yaml +349 -0
- package/dist/blocks/Tag/gallery.yaml +598 -0
- package/dist/blocks/Tag/tests/Tag.e2e.yaml +173 -0
- package/dist/blocks/Tag/tests.yaml +51 -0
- package/dist/blocks/TagMultipleSelector/TagMultipleSelector.js +53 -0
- package/dist/blocks/TagMultipleSelector/e2e.js +36 -0
- package/dist/blocks/TagMultipleSelector/gallery.yaml +70 -0
- package/dist/blocks/TagMultipleSelector/meta.js +91 -0
- package/dist/blocks/TagMultipleSelector/tests/TagMultipleSelector.e2e.yaml +93 -0
- package/dist/blocks/TagSelector/TagSelector.js +49 -0
- package/dist/blocks/TagSelector/e2e.js +36 -0
- package/dist/blocks/TagSelector/gallery.yaml +70 -0
- package/dist/blocks/TagSelector/meta.js +91 -0
- package/dist/blocks/TagSelector/tests/TagSelector.e2e.yaml +93 -0
- package/dist/blocks/TextArea/gallery.yaml +618 -0
- package/dist/blocks/TextArea/tests/TextArea.e2e.yaml +218 -0
- package/dist/blocks/TextArea/tests.yaml +100 -0
- package/dist/blocks/TextInput/gallery.yaml +560 -0
- package/dist/blocks/TextInput/tests/TextInput.e2e.yaml +287 -0
- package/dist/blocks/TextInput/tests.yaml +114 -0
- package/dist/blocks/TimelineList/gallery.yaml +431 -0
- package/dist/blocks/TimelineList/tests/TimelineList.e2e.yaml +244 -0
- package/dist/blocks/TimelineList/tests.yaml +251 -0
- package/dist/blocks/Title/gallery.yaml +483 -0
- package/dist/blocks/Title/tests/Title.e2e.yaml +180 -0
- package/dist/blocks/Title/tests.yaml +175 -0
- package/dist/blocks/TitleInput/gallery.yaml +1006 -0
- package/dist/blocks/TitleInput/tests/TitleInput.e2e.yaml +195 -0
- package/dist/blocks/TitleInput/tests.yaml +181 -0
- package/dist/blocks/Tooltip/gallery.yaml +1214 -0
- package/dist/blocks/Tooltip/tests/Tooltip.e2e.yaml +195 -0
- package/dist/blocks/Tooltip/tests.yaml +92 -0
- package/dist/blocks/Tour/gallery.yaml +2305 -0
- package/dist/blocks/Tour/tests/Tour.e2e.yaml +90 -0
- package/dist/blocks/Tour/tests.yaml +151 -0
- package/dist/blocks/TreeInput/gallery.yaml +78 -0
- package/dist/blocks/TreeInput/tests/TreeInput.e2e.yaml +139 -0
- package/dist/blocks/TreeInput/tests.yaml +140 -0
- package/dist/blocks/TreeMultipleSelector/gallery.yaml +67 -0
- package/dist/blocks/TreeSelector/gallery.yaml +81 -0
- package/dist/blocks/Watermark/gallery.yaml +479 -0
- package/dist/blocks/Watermark/tests/Watermark.e2e.yaml +62 -0
- package/dist/blocks/Watermark/tests.yaml +86 -0
- package/dist/blocks/WeekSelector/WeekSelector.js +6 -0
- package/dist/blocks/WeekSelector/e2e.js +26 -2
- package/dist/blocks/WeekSelector/gallery.yaml +589 -0
- package/dist/blocks/WeekSelector/meta.js +6 -0
- package/dist/blocks/WeekSelector/tests/WeekSelector.e2e.yaml +154 -0
- package/dist/blocks/WeekSelector/tests.yaml +122 -0
- package/dist/blocks.js +2 -0
- package/dist/disabledDate.js +91 -19
- package/dist/e2e.js +2 -0
- package/dist/getPresets.js +151 -0
- package/dist/getTagColor.js +44 -0
- package/dist/getTagSelectorOptions.js +30 -0
- package/dist/metas.js +2 -0
- package/dist/pickerPresetsStyle.css +26 -0
- package/dist/schemas/disabledDates.js +6 -2
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/presets.js +111 -0
- package/dist/tagSelectorStyle.css +68 -0
- package/package.json +13 -13
|
@@ -23,6 +23,7 @@ import { withBlockDefaults } from '@lowdefy/block-utils';
|
|
|
23
23
|
import Label from '../Label/Label.js';
|
|
24
24
|
import withTheme from '../withTheme.js';
|
|
25
25
|
import disabledDate from '../../disabledDate.js';
|
|
26
|
+
import getPresets from '../../getPresets.js';
|
|
26
27
|
dayjs.extend(utc);
|
|
27
28
|
dayjs.extend(weekOfYear);
|
|
28
29
|
dayjs.extend(advancedFormat);
|
|
@@ -68,6 +69,11 @@ const WeekSelector = ({ blockId, classNames = {}, components: { Icon, Link }, ev
|
|
|
68
69
|
format: properties.format ?? 'YYYY-wo',
|
|
69
70
|
getPopupContainer: ()=>document.getElementById(`${blockId}_${elementId}_popup`),
|
|
70
71
|
placeholder: properties.placeholder,
|
|
72
|
+
presets: getPresets({
|
|
73
|
+
disabledDates: properties.disabledDates,
|
|
74
|
+
methods,
|
|
75
|
+
presets: properties.presets
|
|
76
|
+
}),
|
|
71
77
|
size: properties.size,
|
|
72
78
|
status: validation.status,
|
|
73
79
|
suffixIcon: /*#__PURE__*/ React.createElement(Icon, {
|
|
@@ -16,6 +16,13 @@
|
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
17
|
const locator = (page, blockId)=>page.locator(`.ant-picker:has(#${escapeId(blockId)}_input)`);
|
|
18
18
|
const input = (page, blockId)=>page.locator(`#${escapeId(blockId)}_input`);
|
|
19
|
+
// The block renders the picker popup into a container inside itself, so the dropdown is scoped to
|
|
20
|
+
// the block rather than to every open picker on the page.
|
|
21
|
+
const pickerDropdown = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)} .ant-picker-dropdown`);
|
|
22
|
+
const presets = (page, blockId)=>pickerDropdown(page, blockId).locator('.ant-picker-presets');
|
|
23
|
+
const presetItem = (page, blockId, label)=>presets(page, blockId).locator('li', {
|
|
24
|
+
hasText: label
|
|
25
|
+
});
|
|
19
26
|
const monthNames = [
|
|
20
27
|
'Jan',
|
|
21
28
|
'Feb',
|
|
@@ -73,11 +80,18 @@ export default createBlockHelper({
|
|
|
73
80
|
select: async (page, blockId, dateString)=>{
|
|
74
81
|
const [year, month] = dateString.split('-').map(Number);
|
|
75
82
|
await locator(page, blockId).click();
|
|
76
|
-
const dropdown = page
|
|
83
|
+
const dropdown = pickerDropdown(page, blockId);
|
|
77
84
|
await expect(dropdown).toBeVisible();
|
|
78
85
|
await navigateToMonth(dropdown, year, month);
|
|
79
86
|
await dropdown.locator(`.ant-picker-cell-in-view[title="${dateString}"]`).click();
|
|
80
87
|
},
|
|
88
|
+
selectPreset: async (page, blockId, label)=>{
|
|
89
|
+
await locator(page, blockId).click();
|
|
90
|
+
await expect(pickerDropdown(page, blockId)).toBeVisible();
|
|
91
|
+
await presets(page, blockId).getByText(label, {
|
|
92
|
+
exact: true
|
|
93
|
+
}).click();
|
|
94
|
+
},
|
|
81
95
|
clear: async (page, blockId)=>{
|
|
82
96
|
await locator(page, blockId).hover();
|
|
83
97
|
await locator(page, blockId).locator('.ant-picker-clear').click();
|
|
@@ -85,6 +99,16 @@ export default createBlockHelper({
|
|
|
85
99
|
},
|
|
86
100
|
expect: {
|
|
87
101
|
value: (page, blockId, val)=>expect(input(page, blockId)).toHaveValue(val),
|
|
88
|
-
placeholder: (page, blockId, text)=>expect(input(page, blockId)).toHaveAttribute('placeholder', text)
|
|
102
|
+
placeholder: (page, blockId, text)=>expect(input(page, blockId)).toHaveAttribute('placeholder', text),
|
|
103
|
+
presetLabels: (page, blockId, labels)=>expect(presets(page, blockId).locator('li')).toHaveText(labels),
|
|
104
|
+
presetLabelHtml: (page, blockId, { selector, text })=>expect(presets(page, blockId).locator(selector)).toHaveText(text),
|
|
105
|
+
noPresets: (page, blockId)=>expect(presets(page, blockId)).toHaveCount(0),
|
|
106
|
+
// A preset the calendar cannot select is disabled through the list item's pointer events, so
|
|
107
|
+
// asserting on those checks the shortcut is really unclickable and not only styled as such.
|
|
108
|
+
presetDisabled: (page, blockId, label)=>expect(presetItem(page, blockId, label)).toHaveCSS('pointer-events', 'none'),
|
|
109
|
+
presetEnabled: (page, blockId, label)=>expect(presetItem(page, blockId, label)).toHaveCSS('pointer-events', 'auto'),
|
|
110
|
+
// The picker only closes the popup once it accepts the value, so a closed popup is the
|
|
111
|
+
// signal that a selection was committed rather than just shown in the input.
|
|
112
|
+
closed: (page, blockId)=>expect(pickerDropdown(page, blockId)).toBeHidden()
|
|
89
113
|
}
|
|
90
114
|
});
|
|
@@ -0,0 +1,589 @@
|
|
|
1
|
+
# Copyright 2020-2026 Lowdefy, Inc
|
|
2
|
+
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
- title: Basic Week Picker
|
|
16
|
+
blocks:
|
|
17
|
+
- id: ws_basic_default
|
|
18
|
+
type: WeekSelector
|
|
19
|
+
properties:
|
|
20
|
+
title: Select a Week
|
|
21
|
+
- id: ws_basic_with_extra
|
|
22
|
+
type: WeekSelector
|
|
23
|
+
properties:
|
|
24
|
+
title: Reporting Week
|
|
25
|
+
placeholder: Pick a week...
|
|
26
|
+
label:
|
|
27
|
+
extra: Choose the week for the weekly report.
|
|
28
|
+
|
|
29
|
+
- title: Sizes
|
|
30
|
+
blocks:
|
|
31
|
+
- id: ws_size_small
|
|
32
|
+
type: WeekSelector
|
|
33
|
+
properties:
|
|
34
|
+
title: Small
|
|
35
|
+
size: small
|
|
36
|
+
- id: ws_size_default
|
|
37
|
+
type: WeekSelector
|
|
38
|
+
properties:
|
|
39
|
+
title: Default
|
|
40
|
+
- id: ws_size_large
|
|
41
|
+
type: WeekSelector
|
|
42
|
+
properties:
|
|
43
|
+
title: Large
|
|
44
|
+
size: large
|
|
45
|
+
|
|
46
|
+
- title: Variants
|
|
47
|
+
blocks:
|
|
48
|
+
- id: ws_variant_outlined
|
|
49
|
+
type: WeekSelector
|
|
50
|
+
properties:
|
|
51
|
+
title: Outlined (default)
|
|
52
|
+
variant: outlined
|
|
53
|
+
- id: ws_variant_filled
|
|
54
|
+
type: WeekSelector
|
|
55
|
+
properties:
|
|
56
|
+
title: Filled
|
|
57
|
+
variant: filled
|
|
58
|
+
- id: ws_variant_borderless
|
|
59
|
+
type: WeekSelector
|
|
60
|
+
properties:
|
|
61
|
+
title: Borderless
|
|
62
|
+
variant: borderless
|
|
63
|
+
|
|
64
|
+
- title: Format Variations
|
|
65
|
+
blocks:
|
|
66
|
+
- id: ws_fmt_default
|
|
67
|
+
type: WeekSelector
|
|
68
|
+
properties:
|
|
69
|
+
title: YYYY-wo (default)
|
|
70
|
+
format: YYYY-wo
|
|
71
|
+
label:
|
|
72
|
+
disabled: true
|
|
73
|
+
- id: ws_fmt_reversed
|
|
74
|
+
type: WeekSelector
|
|
75
|
+
properties:
|
|
76
|
+
title: wo-YYYY
|
|
77
|
+
format: wo-YYYY
|
|
78
|
+
label:
|
|
79
|
+
disabled: true
|
|
80
|
+
- id: ws_fmt_week_prefix
|
|
81
|
+
type: WeekSelector
|
|
82
|
+
properties:
|
|
83
|
+
title: YYYY [Week] wo
|
|
84
|
+
format: YYYY [Week] wo
|
|
85
|
+
label:
|
|
86
|
+
disabled: true
|
|
87
|
+
- id: ws_fmt_w_prefix
|
|
88
|
+
type: WeekSelector
|
|
89
|
+
properties:
|
|
90
|
+
title: YYYY [W]ww
|
|
91
|
+
format: YYYY [W]ww
|
|
92
|
+
label:
|
|
93
|
+
disabled: true
|
|
94
|
+
|
|
95
|
+
- title: Placeholder
|
|
96
|
+
blocks:
|
|
97
|
+
- id: ws_ph_default
|
|
98
|
+
type: WeekSelector
|
|
99
|
+
properties:
|
|
100
|
+
title: Default Placeholder
|
|
101
|
+
label:
|
|
102
|
+
disabled: true
|
|
103
|
+
- id: ws_ph_custom
|
|
104
|
+
type: WeekSelector
|
|
105
|
+
properties:
|
|
106
|
+
title: Custom Placeholder
|
|
107
|
+
placeholder: Pick a week...
|
|
108
|
+
label:
|
|
109
|
+
disabled: true
|
|
110
|
+
- id: ws_ph_descriptive
|
|
111
|
+
type: WeekSelector
|
|
112
|
+
properties:
|
|
113
|
+
title: Descriptive Placeholder
|
|
114
|
+
placeholder: Which week does the report cover?
|
|
115
|
+
label:
|
|
116
|
+
disabled: true
|
|
117
|
+
|
|
118
|
+
- title: Allow Clear
|
|
119
|
+
blocks:
|
|
120
|
+
- id: ws_clear_enabled
|
|
121
|
+
type: WeekSelector
|
|
122
|
+
properties:
|
|
123
|
+
title: Allow Clear (default)
|
|
124
|
+
allowClear: true
|
|
125
|
+
label:
|
|
126
|
+
disabled: true
|
|
127
|
+
- id: ws_clear_disabled
|
|
128
|
+
type: WeekSelector
|
|
129
|
+
properties:
|
|
130
|
+
title: No Clear Button
|
|
131
|
+
allowClear: false
|
|
132
|
+
label:
|
|
133
|
+
disabled: true
|
|
134
|
+
|
|
135
|
+
- title: Show Today Button
|
|
136
|
+
blocks:
|
|
137
|
+
- id: ws_today_enabled
|
|
138
|
+
type: WeekSelector
|
|
139
|
+
properties:
|
|
140
|
+
title: Show Today (default)
|
|
141
|
+
showToday: true
|
|
142
|
+
label:
|
|
143
|
+
disabled: true
|
|
144
|
+
- id: ws_today_disabled
|
|
145
|
+
type: WeekSelector
|
|
146
|
+
properties:
|
|
147
|
+
title: No Today Button
|
|
148
|
+
showToday: false
|
|
149
|
+
label:
|
|
150
|
+
disabled: true
|
|
151
|
+
|
|
152
|
+
- title: Suffix Icon
|
|
153
|
+
blocks:
|
|
154
|
+
- id: ws_icon_default
|
|
155
|
+
type: WeekSelector
|
|
156
|
+
properties:
|
|
157
|
+
title: Default Calendar Icon
|
|
158
|
+
label:
|
|
159
|
+
disabled: true
|
|
160
|
+
- id: ws_icon_clock
|
|
161
|
+
type: WeekSelector
|
|
162
|
+
properties:
|
|
163
|
+
title: Clock Icon
|
|
164
|
+
suffixIcon: AiOutlineClockCircle
|
|
165
|
+
label:
|
|
166
|
+
disabled: true
|
|
167
|
+
- id: ws_icon_schedule
|
|
168
|
+
type: WeekSelector
|
|
169
|
+
properties:
|
|
170
|
+
title: Schedule Icon
|
|
171
|
+
suffixIcon: AiOutlineSchedule
|
|
172
|
+
label:
|
|
173
|
+
disabled: true
|
|
174
|
+
- id: ws_icon_custom_color
|
|
175
|
+
type: WeekSelector
|
|
176
|
+
properties:
|
|
177
|
+
title: Custom Color Icon
|
|
178
|
+
suffixIcon:
|
|
179
|
+
name: AiOutlineCalendar
|
|
180
|
+
color: '#1677ff'
|
|
181
|
+
label:
|
|
182
|
+
disabled: true
|
|
183
|
+
|
|
184
|
+
- title: Disabled State
|
|
185
|
+
blocks:
|
|
186
|
+
- id: ws_dis_default
|
|
187
|
+
type: WeekSelector
|
|
188
|
+
properties:
|
|
189
|
+
title: Disabled
|
|
190
|
+
disabled: true
|
|
191
|
+
label:
|
|
192
|
+
disabled: true
|
|
193
|
+
- id: ws_dis_filled
|
|
194
|
+
type: WeekSelector
|
|
195
|
+
properties:
|
|
196
|
+
title: Disabled Filled
|
|
197
|
+
disabled: true
|
|
198
|
+
variant: filled
|
|
199
|
+
label:
|
|
200
|
+
disabled: true
|
|
201
|
+
|
|
202
|
+
- title: Disabled Dates
|
|
203
|
+
blocks:
|
|
204
|
+
- id: ws_dd_min
|
|
205
|
+
type: WeekSelector
|
|
206
|
+
properties:
|
|
207
|
+
title: Min Date (2024-01-01)
|
|
208
|
+
disabledDates:
|
|
209
|
+
min: '2024-01-01'
|
|
210
|
+
label:
|
|
211
|
+
disabled: true
|
|
212
|
+
- id: ws_dd_range
|
|
213
|
+
type: WeekSelector
|
|
214
|
+
properties:
|
|
215
|
+
title: Min & Max (2026 only)
|
|
216
|
+
disabledDates:
|
|
217
|
+
min: '2026-01-01'
|
|
218
|
+
max: '2026-12-31'
|
|
219
|
+
label:
|
|
220
|
+
disabled: true
|
|
221
|
+
- id: ws_dd_specific
|
|
222
|
+
type: WeekSelector
|
|
223
|
+
properties:
|
|
224
|
+
title: Specific Dates Disabled
|
|
225
|
+
disabledDates:
|
|
226
|
+
dates:
|
|
227
|
+
- '2026-03-15'
|
|
228
|
+
- '2026-03-20'
|
|
229
|
+
- '2026-03-25'
|
|
230
|
+
label:
|
|
231
|
+
disabled: true
|
|
232
|
+
- id: ws_dd_date_ranges
|
|
233
|
+
type: WeekSelector
|
|
234
|
+
properties:
|
|
235
|
+
title: Date Ranges Disabled
|
|
236
|
+
disabledDates:
|
|
237
|
+
ranges:
|
|
238
|
+
- ['2026-03-10', '2026-03-14']
|
|
239
|
+
- ['2026-03-20', '2026-03-24']
|
|
240
|
+
label:
|
|
241
|
+
disabled: true
|
|
242
|
+
|
|
243
|
+
- title: Presets
|
|
244
|
+
blocks:
|
|
245
|
+
- id: ws_presets_relative
|
|
246
|
+
type: WeekSelector
|
|
247
|
+
properties:
|
|
248
|
+
title: Relative Presets
|
|
249
|
+
label:
|
|
250
|
+
extra: Shortcuts are listed to the left of the calendar.
|
|
251
|
+
presets:
|
|
252
|
+
- label: This week
|
|
253
|
+
value:
|
|
254
|
+
_dayjs:
|
|
255
|
+
- now
|
|
256
|
+
- startOf: week
|
|
257
|
+
- format: YYYY-MM-DD
|
|
258
|
+
- label: Last week
|
|
259
|
+
value:
|
|
260
|
+
_dayjs:
|
|
261
|
+
- now
|
|
262
|
+
- subtract: [1, week]
|
|
263
|
+
- format: YYYY-MM-DD
|
|
264
|
+
- label: 4 weeks ago
|
|
265
|
+
value:
|
|
266
|
+
_dayjs:
|
|
267
|
+
- now
|
|
268
|
+
- subtract: [4, weeks]
|
|
269
|
+
- format: YYYY-MM-DD
|
|
270
|
+
- id: ws_presets_fixed
|
|
271
|
+
type: WeekSelector
|
|
272
|
+
properties:
|
|
273
|
+
title: Fixed Presets
|
|
274
|
+
label:
|
|
275
|
+
disabled: true
|
|
276
|
+
presets:
|
|
277
|
+
- label: First week of 2026
|
|
278
|
+
value: '2026-01-01'
|
|
279
|
+
- label: Week of 1 July 2026
|
|
280
|
+
value: '2026-07-01'
|
|
281
|
+
|
|
282
|
+
- title: Label Options
|
|
283
|
+
blocks:
|
|
284
|
+
- id: ws_lbl_default
|
|
285
|
+
type: WeekSelector
|
|
286
|
+
properties:
|
|
287
|
+
title: Default Label
|
|
288
|
+
- id: ws_lbl_colon_off
|
|
289
|
+
type: WeekSelector
|
|
290
|
+
properties:
|
|
291
|
+
title: No Colon
|
|
292
|
+
label:
|
|
293
|
+
colon: false
|
|
294
|
+
- id: ws_lbl_inline
|
|
295
|
+
type: WeekSelector
|
|
296
|
+
properties:
|
|
297
|
+
title: Inline Label
|
|
298
|
+
label:
|
|
299
|
+
inline: true
|
|
300
|
+
span: 8
|
|
301
|
+
- id: ws_lbl_extra
|
|
302
|
+
type: WeekSelector
|
|
303
|
+
properties:
|
|
304
|
+
title: Sprint Week
|
|
305
|
+
label:
|
|
306
|
+
extra: 'Choose the <b>sprint week</b> for your team.'
|
|
307
|
+
placeholder: Select sprint week
|
|
308
|
+
|
|
309
|
+
- title: Label Disabled (No Label)
|
|
310
|
+
blocks:
|
|
311
|
+
- id: ws_lbl_hidden
|
|
312
|
+
type: WeekSelector
|
|
313
|
+
properties:
|
|
314
|
+
title: Hidden Label
|
|
315
|
+
label:
|
|
316
|
+
disabled: true
|
|
317
|
+
placeholder: No label shown
|
|
318
|
+
- id: ws_lbl_hidden_filled
|
|
319
|
+
type: WeekSelector
|
|
320
|
+
properties:
|
|
321
|
+
title: Hidden Label Filled
|
|
322
|
+
label:
|
|
323
|
+
disabled: true
|
|
324
|
+
variant: filled
|
|
325
|
+
placeholder: No label, filled variant
|
|
326
|
+
|
|
327
|
+
- title: AutoFocus
|
|
328
|
+
blocks:
|
|
329
|
+
- id: ws_af_on
|
|
330
|
+
type: WeekSelector
|
|
331
|
+
properties:
|
|
332
|
+
title: Auto Focus Enabled
|
|
333
|
+
autoFocus: true
|
|
334
|
+
label:
|
|
335
|
+
disabled: true
|
|
336
|
+
|
|
337
|
+
- title: Style Overrides
|
|
338
|
+
blocks:
|
|
339
|
+
- id: ws_style_element_bg
|
|
340
|
+
type: WeekSelector
|
|
341
|
+
style:
|
|
342
|
+
.element:
|
|
343
|
+
properties:
|
|
344
|
+
title: Custom Background
|
|
345
|
+
label:
|
|
346
|
+
disabled: true
|
|
347
|
+
- id: ws_style_label
|
|
348
|
+
type: WeekSelector
|
|
349
|
+
style:
|
|
350
|
+
.label:
|
|
351
|
+
color: '#531dab'
|
|
352
|
+
fontWeight: bold
|
|
353
|
+
properties:
|
|
354
|
+
title: Styled Label
|
|
355
|
+
|
|
356
|
+
- title: Class Overrides (Tailwind)
|
|
357
|
+
blocks:
|
|
358
|
+
- id: ws_class_rounded
|
|
359
|
+
type: WeekSelector
|
|
360
|
+
class: rounded-lg shadow-sm
|
|
361
|
+
properties:
|
|
362
|
+
title: Rounded with Shadow
|
|
363
|
+
label:
|
|
364
|
+
disabled: true
|
|
365
|
+
- id: ws_class_border
|
|
366
|
+
type: WeekSelector
|
|
367
|
+
class: border-2 border-border
|
|
368
|
+
properties:
|
|
369
|
+
title: Blue Border
|
|
370
|
+
label:
|
|
371
|
+
disabled: true
|
|
372
|
+
|
|
373
|
+
- title: Theme Token Overrides
|
|
374
|
+
blocks:
|
|
375
|
+
- id: ws_theme_primary_color
|
|
376
|
+
type: WeekSelector
|
|
377
|
+
properties:
|
|
378
|
+
title: Custom Primary Color
|
|
379
|
+
label:
|
|
380
|
+
disabled: true
|
|
381
|
+
theme:
|
|
382
|
+
colorPrimary: '#722ed1'
|
|
383
|
+
- id: ws_theme_large_radius
|
|
384
|
+
type: WeekSelector
|
|
385
|
+
properties:
|
|
386
|
+
title: Large Border Radius
|
|
387
|
+
label:
|
|
388
|
+
disabled: true
|
|
389
|
+
theme:
|
|
390
|
+
borderRadius: 16
|
|
391
|
+
- id: ws_theme_tall
|
|
392
|
+
type: WeekSelector
|
|
393
|
+
properties:
|
|
394
|
+
title: Tall Input
|
|
395
|
+
label:
|
|
396
|
+
disabled: true
|
|
397
|
+
theme:
|
|
398
|
+
controlHeight: 48
|
|
399
|
+
fontSize: 18
|
|
400
|
+
borderRadius: 12
|
|
401
|
+
- id: ws_theme_brand_color
|
|
402
|
+
type: WeekSelector
|
|
403
|
+
properties:
|
|
404
|
+
title: Brand Purple
|
|
405
|
+
label:
|
|
406
|
+
disabled: true
|
|
407
|
+
theme:
|
|
408
|
+
colorPrimary: '#722ed1'
|
|
409
|
+
colorBorder: '#d3adf7'
|
|
410
|
+
- id: ws_theme_popup_highlight
|
|
411
|
+
type: WeekSelector
|
|
412
|
+
properties:
|
|
413
|
+
title: Custom Cell Highlight
|
|
414
|
+
label:
|
|
415
|
+
disabled: true
|
|
416
|
+
theme:
|
|
417
|
+
activeBorderColor: '#fa8c16'
|
|
418
|
+
cellHoverBg: 'rgba(250, 140, 22, 0.1)'
|
|
419
|
+
|
|
420
|
+
- title: Combined Features
|
|
421
|
+
blocks:
|
|
422
|
+
- id: ws_combined_full
|
|
423
|
+
type: WeekSelector
|
|
424
|
+
properties:
|
|
425
|
+
title: Sprint Planning Week
|
|
426
|
+
placeholder: Select sprint week
|
|
427
|
+
format: YYYY [Week] wo
|
|
428
|
+
size: large
|
|
429
|
+
suffixIcon: AiOutlineSchedule
|
|
430
|
+
showToday: true
|
|
431
|
+
allowClear: true
|
|
432
|
+
label:
|
|
433
|
+
extra: Choose the week for sprint planning.
|
|
434
|
+
colon: false
|
|
435
|
+
- id: ws_combined_minimal
|
|
436
|
+
type: WeekSelector
|
|
437
|
+
properties:
|
|
438
|
+
title: Week
|
|
439
|
+
variant: borderless
|
|
440
|
+
size: small
|
|
441
|
+
allowClear: false
|
|
442
|
+
showToday: false
|
|
443
|
+
format: YYYY-ww
|
|
444
|
+
placeholder: wk
|
|
445
|
+
label:
|
|
446
|
+
disabled: true
|
|
447
|
+
- id: ws_combined_restricted
|
|
448
|
+
type: WeekSelector
|
|
449
|
+
properties:
|
|
450
|
+
title: Fiscal Week
|
|
451
|
+
placeholder: Select fiscal week
|
|
452
|
+
format: YYYY [W]ww
|
|
453
|
+
suffixIcon:
|
|
454
|
+
name: AiOutlineCalendar
|
|
455
|
+
color: '#1677ff'
|
|
456
|
+
disabledDates:
|
|
457
|
+
min: '2026-01-01'
|
|
458
|
+
max: '2026-12-31'
|
|
459
|
+
label:
|
|
460
|
+
extra: Only weeks in fiscal year 2026 are available.
|
|
461
|
+
|
|
462
|
+
- title: WeekSelector in Sprint Planning
|
|
463
|
+
blocks:
|
|
464
|
+
- id: applied_sprint_card
|
|
465
|
+
type: Card
|
|
466
|
+
properties:
|
|
467
|
+
title: Sprint Planning
|
|
468
|
+
blocks:
|
|
469
|
+
- id: applied_sprint_week
|
|
470
|
+
type: WeekSelector
|
|
471
|
+
properties:
|
|
472
|
+
title: Sprint Week
|
|
473
|
+
placeholder: Select sprint week
|
|
474
|
+
format: YYYY [Week] wo
|
|
475
|
+
size: large
|
|
476
|
+
suffixIcon: AiOutlineSchedule
|
|
477
|
+
label:
|
|
478
|
+
extra: Choose the week this sprint begins.
|
|
479
|
+
- id: applied_sprint_team
|
|
480
|
+
type: Selector
|
|
481
|
+
properties:
|
|
482
|
+
title: Team
|
|
483
|
+
placeholder: Select team...
|
|
484
|
+
options:
|
|
485
|
+
- label: Frontend
|
|
486
|
+
value: frontend
|
|
487
|
+
- label: Backend
|
|
488
|
+
value: backend
|
|
489
|
+
- label: Mobile
|
|
490
|
+
value: mobile
|
|
491
|
+
- label: Infrastructure
|
|
492
|
+
value: infra
|
|
493
|
+
- id: applied_sprint_capacity
|
|
494
|
+
type: NumberInput
|
|
495
|
+
properties:
|
|
496
|
+
title: Team Capacity
|
|
497
|
+
placeholder: Enter story points
|
|
498
|
+
label:
|
|
499
|
+
extra: Total story points available for this sprint.
|
|
500
|
+
- id: applied_sprint_btn
|
|
501
|
+
type: Button
|
|
502
|
+
properties:
|
|
503
|
+
title: Start Sprint
|
|
504
|
+
icon: AiOutlineThunderbolt
|
|
505
|
+
type: primary
|
|
506
|
+
block: true
|
|
507
|
+
events:
|
|
508
|
+
onClick:
|
|
509
|
+
- id: start_sprint_action
|
|
510
|
+
type: DisplayMessage
|
|
511
|
+
params:
|
|
512
|
+
content: Sprint has been started successfully!
|
|
513
|
+
status: success
|
|
514
|
+
|
|
515
|
+
- title: WeekSelector in Timesheet Entry
|
|
516
|
+
blocks:
|
|
517
|
+
- id: applied_ts_card
|
|
518
|
+
type: Card
|
|
519
|
+
properties:
|
|
520
|
+
title: Log Weekly Hours
|
|
521
|
+
blocks:
|
|
522
|
+
- id: applied_ts_week
|
|
523
|
+
type: WeekSelector
|
|
524
|
+
properties:
|
|
525
|
+
title: Work Week
|
|
526
|
+
placeholder: Select week to log
|
|
527
|
+
format: YYYY [W]ww
|
|
528
|
+
disabledDates:
|
|
529
|
+
min: '2026-01-01'
|
|
530
|
+
label:
|
|
531
|
+
extra: Select the week you want to submit hours for.
|
|
532
|
+
events:
|
|
533
|
+
onChange:
|
|
534
|
+
- id: week_selected
|
|
535
|
+
type: SetState
|
|
536
|
+
params:
|
|
537
|
+
selectedWeek:
|
|
538
|
+
_state: applied_ts_week
|
|
539
|
+
- id: applied_ts_project
|
|
540
|
+
type: Selector
|
|
541
|
+
properties:
|
|
542
|
+
title: Project
|
|
543
|
+
placeholder: Select project...
|
|
544
|
+
options:
|
|
545
|
+
- label: Website Redesign
|
|
546
|
+
value: web-redesign
|
|
547
|
+
- label: API Migration
|
|
548
|
+
value: api-migration
|
|
549
|
+
- label: Mobile App v2
|
|
550
|
+
value: mobile-v2
|
|
551
|
+
- label: Internal Tools
|
|
552
|
+
value: internal
|
|
553
|
+
- id: applied_ts_hours
|
|
554
|
+
type: NumberInput
|
|
555
|
+
properties:
|
|
556
|
+
title: Hours Worked
|
|
557
|
+
placeholder: Enter hours
|
|
558
|
+
min: 0
|
|
559
|
+
max: 60
|
|
560
|
+
precision: 1
|
|
561
|
+
label:
|
|
562
|
+
extra: Total hours for the selected week.
|
|
563
|
+
- id: applied_ts_notes
|
|
564
|
+
type: TextArea
|
|
565
|
+
properties:
|
|
566
|
+
title: Notes
|
|
567
|
+
placeholder: Describe what you worked on...
|
|
568
|
+
autoSize:
|
|
569
|
+
minRows: 2
|
|
570
|
+
maxRows: 4
|
|
571
|
+
- id: applied_ts_submit
|
|
572
|
+
type: Button
|
|
573
|
+
properties:
|
|
574
|
+
title: Submit Timesheet
|
|
575
|
+
icon: AiOutlineCheck
|
|
576
|
+
type: primary
|
|
577
|
+
block: true
|
|
578
|
+
events:
|
|
579
|
+
onClick:
|
|
580
|
+
- id: submit_ts
|
|
581
|
+
type: Validate
|
|
582
|
+
params:
|
|
583
|
+
- applied_ts_week
|
|
584
|
+
- applied_ts_hours
|
|
585
|
+
- id: ts_success
|
|
586
|
+
type: DisplayMessage
|
|
587
|
+
params:
|
|
588
|
+
content: Timesheet submitted successfully.
|
|
589
|
+
status: success
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import label from '../../schemas/label.js';
|
|
17
17
|
import icon from '../../schemas/icon.js';
|
|
18
18
|
import disabledDates from '../../schemas/disabledDates.js';
|
|
19
|
+
import { datePresets } from '../../schemas/presets.js';
|
|
19
20
|
import { disabled, placeholder, inputTitle, autoFocus, allowClear, sizeSmallDefaultLarge } from '../../schemas/inputProperties.js';
|
|
20
21
|
export default {
|
|
21
22
|
category: 'input',
|
|
@@ -75,6 +76,11 @@ export default {
|
|
|
75
76
|
placeholder: {
|
|
76
77
|
...placeholder
|
|
77
78
|
},
|
|
79
|
+
presets: datePresets({
|
|
80
|
+
example: '_dayjs: [now, {startOf: week}, {format: YYYY-MM-DD}]',
|
|
81
|
+
selects: 'a week',
|
|
82
|
+
unit: 'week'
|
|
83
|
+
}),
|
|
78
84
|
label,
|
|
79
85
|
showToday: {
|
|
80
86
|
type: 'boolean',
|