@ticatec/uniface-element 5.0.1 → 5.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -54
- package/README_CN.md +37 -57
- package/dist/base-calendar/CalendarBase.svelte +29 -6
- package/dist/base-calendar/CalendarBase.svelte.d.ts +4 -0
- package/dist/base-calendar/MonthPickupPanel.svelte +19 -6
- package/dist/base-calendar/MonthPickupPanel.svelte.d.ts +1 -1
- package/dist/base-calendar/MonthlyCalendar.svelte +18 -2
- package/dist/base-calendar/YearPickupPanel.svelte +24 -6
- package/dist/base-calendar/YearPickupPanel.svelte.d.ts +1 -1
- package/dist/composite/pagination_panel/PaginationPanel.svelte +2 -0
- package/dist/data_display/card/CommonCardActionBar.svelte +34 -14
- package/dist/data_display/concise_data_table/Column.d.ts +6 -0
- package/dist/data_display/concise_data_table/ConciseListTable.svelte +4 -3
- package/dist/data_display/concise_data_table/DataCell.svelte +3 -3
- package/dist/data_display/list_box/ListBox.svelte +90 -15
- package/dist/data_display/list_box/ListBox.svelte.d.ts +4 -0
- package/dist/data_display/tree_view/TreeNodeView.svelte +25 -4
- package/dist/data_table/DataTable.svelte +5 -5
- package/dist/data_table/DataTable.svelte.d.ts +36 -16
- package/dist/data_table/lib/ActionsColumn.d.ts +2 -2
- package/dist/data_table/lib/DataColumn.d.ts +7 -1
- package/dist/data_table/lib/RowAction.d.ts +5 -5
- package/dist/data_table/parts/FixedHeaderPanel.svelte +18 -3
- package/dist/data_table/parts/FixedRow.svelte +10 -1
- package/dist/data_table/parts/HrefCell.svelte +1 -1
- package/dist/data_table/parts/TableHeaderPanel.svelte +18 -2
- package/dist/data_table/parts/TextCell.svelte +2 -2
- package/dist/form/attachment_files/AttachmentEditor.svelte +9 -9
- package/dist/form/attachment_files/FileRender.svelte +1 -1
- package/dist/form/attachment_files/FileUploadPanel.svelte +5 -1
- package/dist/form/cascade_options_select/CascadeOptionSelect.svelte +10 -2
- package/dist/form/cascade_options_select/OptionsBox.svelte +48 -2
- package/dist/form/color_picker/ColorPickerPanel.svelte +23 -20
- package/dist/form/color_picker/ColorPickerPanel.svelte.d.ts +5 -18
- package/dist/form/common_editor/CommonEditor.svelte +36 -5
- package/dist/form/common_editor/CommonPicker.svelte +11 -4
- package/dist/form/common_editor/CommonPopupEditor.svelte +11 -2
- package/dist/form/common_range_editor/CommonRangeEditor.svelte +11 -2
- package/dist/form/date_picker/DatePicker.svelte +1 -1
- package/dist/form/date_picker/DateTimePicker.svelte +1 -1
- package/dist/form/date_picker/ScrollBar.svelte +20 -12
- package/dist/form/date_picker/ScrollBar.svelte.d.ts +4 -18
- package/dist/form/date_range/DateRangeEditor.svelte +11 -3
- package/dist/form/group_box/group-check-box/GroupCheckBox.svelte +6 -1
- package/dist/form/group_box/group-radio-box/GroupRadioBox.svelte +6 -1
- package/dist/form/image-files/ImageFilesField.svelte +51 -7
- package/dist/form/image-files/ImagePreview.svelte +8 -2
- package/dist/form/image-files/ImageRender.svelte +69 -11
- package/dist/form/input_options_select/InputOptionsSelect.svelte +10 -2
- package/dist/form/lookup_editor/LookupEditor.svelte +9 -2
- package/dist/form/number_editor/NumberEditor.svelte +2 -0
- package/dist/form/options_multi_select/OptionsMultiSelect.svelte +19 -3
- package/dist/form/options_select/OptionsSelect.svelte +15 -6
- package/dist/form/options_select/OptionsSelect.svelte.d.ts +39 -17
- package/dist/form/prompts_text_editor/PromptsTextEditor.svelte +12 -3
- package/dist/form/search_box/SearchBox.svelte +2 -1
- package/dist/form/switch/Switch.svelte +4 -4
- package/dist/form/text_editor/PasswordEditor.svelte +2 -1
- package/dist/form/text_editor/TextEditor.svelte +2 -1
- package/dist/form/time_editor/TimeEditor.svelte +2 -0
- package/dist/form/unit-number-editor/UnitNumberEditor.svelte +13 -2
- package/dist/form/unit-number-editor/UnitNumberEditor.svelte.d.ts +1 -0
- package/dist/general/button/Button.svelte +3 -0
- package/dist/general/button/Button.svelte.d.ts +1 -0
- package/dist/general/button/IconButton.svelte +3 -1
- package/dist/general/button/IconButton.svelte.d.ts +1 -0
- package/dist/general/button/TextButton.svelte +3 -0
- package/dist/general/button/TextButton.svelte.d.ts +1 -0
- package/dist/general/icon/Icon.svelte +18 -1
- package/dist/general/tag/Tag.svelte +9 -1
- package/dist/navigation/nav_menu/NavigatorMenu.svelte +2 -2
- package/dist/navigation/nav_menu/NavigatorMenuItem.svelte +10 -1
- package/dist/navigation/navigator/Navigator.svelte +17 -17
- package/dist/navigation/page-stack/PageStack.svelte +160 -0
- package/dist/navigation/page-stack/PageStack.svelte.d.ts +24 -0
- package/dist/navigation/page-stack/PageStackContext.d.ts +25 -0
- package/dist/navigation/page-stack/PageStackContext.js +12 -0
- package/dist/navigation/page-stack/PageStackFrame.svelte +24 -0
- package/dist/navigation/page-stack/PageStackFrame.svelte.d.ts +11 -0
- package/dist/navigation/page-stack/README.md +154 -0
- package/dist/navigation/page-stack/README_CN.md +154 -0
- package/dist/navigation/page-stack/index.d.ts +6 -0
- package/dist/navigation/page-stack/index.js +4 -0
- package/dist/navigation/pagination/Pagination.svelte +114 -14
- package/dist/navigation/tabs/Tabs.svelte +42 -10
- package/dist/navigation/tabs/Tabs.svelte.d.ts +2 -2
- package/dist/overlay/common/FloatingPanel.svelte +3 -11
- package/dist/overlay/common/FullscreenOverlay.svelte +27 -3
- package/dist/overlay/common/FullscreenOverlay.svelte.d.ts +6 -27
- package/dist/overlay/common/ModalPopover.svelte +18 -2
- package/dist/overlay/common/Popover.svelte +56 -57
- package/dist/overlay/common/Popover.svelte.d.ts +1 -5
- package/dist/overlay/common/escapeClose.d.ts +28 -0
- package/dist/overlay/common/escapeClose.js +47 -0
- package/dist/overlay/common/focusTrap.d.ts +8 -0
- package/dist/overlay/common/focusTrap.js +83 -0
- package/dist/overlay/common/mountSingleton.d.ts +27 -0
- package/dist/overlay/common/mountSingleton.js +45 -0
- package/dist/overlay/common/outsideClick.d.ts +28 -0
- package/dist/overlay/common/outsideClick.js +20 -0
- package/dist/overlay/common/scrollLock.d.ts +8 -0
- package/dist/overlay/common/scrollLock.js +49 -0
- package/dist/overlay/context-menu/ContextMenu.svelte.js +2 -15
- package/dist/overlay/context-menu/ContextMenuPanel.svelte +13 -1
- package/dist/overlay/dialog/Dialog.svelte +46 -29
- package/dist/overlay/dialog/DialogManager.svelte.js +7 -9
- package/dist/overlay/drawer/Drawer.svelte +30 -3
- package/dist/overlay/indicator/Indicator.svelte.js +2 -15
- package/dist/overlay/indicator/IndicatorPanel.svelte +4 -1
- package/dist/overlay/message-box/MessageBox.svelte.js +2 -15
- package/dist/overlay/message-box/MessageBoxPanel.svelte +19 -3
- package/dist/overlay/toast/Toast.svelte.js +2 -15
- package/dist/overlay/toast/ToastPanel.svelte +1 -1
- package/dist/overlay/tooltip/Tooltip.svelte +1 -1
- package/dist/ticatec-uniface-web.css +102 -7
- package/dist/types.d.ts +4 -3
- package/docs/components/README.md +133 -0
- package/docs/components/accordion/README.md +60 -0
- package/docs/components/accordion/example.svelte +7 -0
- package/docs/components/action-bar/README.md +114 -0
- package/docs/components/action-bar/example.svelte +7 -0
- package/docs/components/app-top-bar/README.md +60 -0
- package/docs/components/app-top-bar/example.svelte +9 -0
- package/docs/components/attachment-files/README.md +332 -0
- package/docs/components/attachment-files/example.svelte +16 -0
- package/docs/components/box/README.md +63 -0
- package/docs/components/box/example.svelte +10 -0
- package/docs/components/breadcrumbs/README.md +86 -0
- package/docs/components/breadcrumbs/example.svelte +11 -0
- package/docs/components/button/README.md +103 -0
- package/docs/components/button/example.svelte +10 -0
- package/docs/components/card/README.md +113 -0
- package/docs/components/card/example.svelte +10 -0
- package/docs/components/cascade-options-select/README.md +162 -0
- package/docs/components/cascade-options-select/example.svelte +18 -0
- package/docs/components/checkbox/README.md +103 -0
- package/docs/components/checkbox/example.svelte +15 -0
- package/docs/components/classic-layout/README.md +76 -0
- package/docs/components/classic-layout/example.svelte +16 -0
- package/docs/components/color-picker/README.md +132 -0
- package/docs/components/color-picker/example.svelte +16 -0
- package/docs/components/columns-layout/README.md +70 -0
- package/docs/components/columns-layout/example.svelte +12 -0
- package/docs/components/common-dialog/README.md +109 -0
- package/docs/components/common-dialog/example.svelte +12 -0
- package/docs/components/concise-data-table/README.md +307 -0
- package/docs/components/concise-data-table/example.svelte +16 -0
- package/docs/components/context-menu/README.md +99 -0
- package/docs/components/context-menu/example.svelte +10 -0
- package/docs/components/criteria-field/README.md +69 -0
- package/docs/components/criteria-field/example.svelte +9 -0
- package/docs/components/data-table/README.md +365 -0
- package/docs/components/data-table/example.svelte +23 -0
- package/docs/components/date-picker/README.md +136 -0
- package/docs/components/date-picker/example.svelte +16 -0
- package/docs/components/date-range/README.md +122 -0
- package/docs/components/date-range/example.svelte +15 -0
- package/docs/components/date-time-picker/README.md +142 -0
- package/docs/components/date-time-picker/example.svelte +16 -0
- package/docs/components/dialog/README.md +174 -0
- package/docs/components/dialog/example.svelte +13 -0
- package/docs/components/dialog-board/README.md +41 -0
- package/docs/components/dialog-board/example.svelte +5 -0
- package/docs/components/drawer/README.md +70 -0
- package/docs/components/drawer/example.svelte +12 -0
- package/docs/components/flex-form/README.md +55 -0
- package/docs/components/flex-form/example.svelte +7 -0
- package/docs/components/flex-row-form/README.md +56 -0
- package/docs/components/flex-row-form/example.svelte +7 -0
- package/docs/components/form-field/README.md +84 -0
- package/docs/components/form-field/example.svelte +10 -0
- package/docs/components/full-screen-overlay/README.md +66 -0
- package/docs/components/full-screen-overlay/example.svelte +11 -0
- package/docs/components/grid-form/README.md +75 -0
- package/docs/components/grid-form/example.svelte +9 -0
- package/docs/components/group-check-box/README.md +147 -0
- package/docs/components/group-check-box/example.svelte +21 -0
- package/docs/components/group-radio-box/README.md +144 -0
- package/docs/components/group-radio-box/example.svelte +21 -0
- package/docs/components/header-layout/README.md +65 -0
- package/docs/components/header-layout/example.svelte +12 -0
- package/docs/components/icon/README.md +87 -0
- package/docs/components/icon/example.svelte +9 -0
- package/docs/components/icon-button/README.md +91 -0
- package/docs/components/icon-button/example.svelte +10 -0
- package/docs/components/image-files/README.md +174 -0
- package/docs/components/image-files/example.svelte +19 -0
- package/docs/components/indicator/README.md +53 -0
- package/docs/components/indicator/example.svelte +14 -0
- package/docs/components/input-options-select/README.md +163 -0
- package/docs/components/input-options-select/example.svelte +16 -0
- package/docs/components/list-box/ListItem.svelte +14 -0
- package/docs/components/list-box/README.md +221 -0
- package/docs/components/list-box/example.svelte +61 -0
- package/docs/components/lookup-editor/README.md +137 -0
- package/docs/components/lookup-editor/example.svelte +16 -0
- package/docs/components/memo-editor/README.md +143 -0
- package/docs/components/memo-editor/example.svelte +16 -0
- package/docs/components/message-box/README.md +68 -0
- package/docs/components/message-box/example.svelte +10 -0
- package/docs/components/navigator/README.md +75 -0
- package/docs/components/navigator/example.svelte +13 -0
- package/docs/components/navigator-menu/README.md +113 -0
- package/docs/components/navigator-menu/example.svelte +10 -0
- package/docs/components/number-editor/README.md +144 -0
- package/docs/components/number-editor/example.svelte +16 -0
- package/docs/components/number-range/README.md +116 -0
- package/docs/components/number-range/example.svelte +15 -0
- package/docs/components/options-multi-select/README.md +161 -0
- package/docs/components/options-multi-select/example.svelte +20 -0
- package/docs/components/options-select/README.md +160 -0
- package/docs/components/options-select/example.svelte +21 -0
- package/docs/components/page/README.md +77 -0
- package/docs/components/page/example.svelte +10 -0
- package/docs/components/pagination/README.md +88 -0
- package/docs/components/pagination/example.svelte +10 -0
- package/docs/components/pagination-panel/README.md +120 -0
- package/docs/components/pagination-panel/example.svelte +16 -0
- package/docs/components/popup-hint/README.md +44 -0
- package/docs/components/popup-hint/example.svelte +5 -0
- package/docs/components/progress-bar/README.md +64 -0
- package/docs/components/progress-bar/example.svelte +8 -0
- package/docs/components/progress-step-bar/README.md +93 -0
- package/docs/components/progress-step-bar/example.svelte +7 -0
- package/docs/components/prompts-text-editor/README.md +146 -0
- package/docs/components/prompts-text-editor/example.svelte +17 -0
- package/docs/components/radio-button/README.md +121 -0
- package/docs/components/radio-button/example.svelte +18 -0
- package/docs/components/rows-layout/README.md +70 -0
- package/docs/components/rows-layout/example.svelte +12 -0
- package/docs/components/search-box/README.md +136 -0
- package/docs/components/search-box/example.svelte +16 -0
- package/docs/components/separator/README.md +44 -0
- package/docs/components/separator/example.svelte +7 -0
- package/docs/components/sidebar-layout/README.md +65 -0
- package/docs/components/sidebar-layout/example.svelte +12 -0
- package/docs/components/split/README.md +48 -0
- package/docs/components/split/example.svelte +8 -0
- package/docs/components/switch/README.md +77 -0
- package/docs/components/switch/example.svelte +11 -0
- package/docs/components/tabs/README.md +127 -0
- package/docs/components/tabs/example.svelte +22 -0
- package/docs/components/tag/README.md +63 -0
- package/docs/components/tag/example.svelte +8 -0
- package/docs/components/text-button/README.md +90 -0
- package/docs/components/text-button/example.svelte +9 -0
- package/docs/components/text-editor/README.md +147 -0
- package/docs/components/text-editor/example.svelte +16 -0
- package/docs/components/time-editor/README.md +130 -0
- package/docs/components/time-editor/example.svelte +16 -0
- package/docs/components/toast/README.md +52 -0
- package/docs/components/toast/example.svelte +9 -0
- package/docs/components/tooltip/README.md +44 -0
- package/docs/components/tooltip/example.svelte +5 -0
- package/docs/components/transfer/README.md +109 -0
- package/docs/components/transfer/example.svelte +13 -0
- package/docs/components/tree-view/README.md +163 -0
- package/docs/components/tree-view/example.svelte +26 -0
- package/docs/components/unit-number-editor/README.md +192 -0
- package/docs/components/unit-number-editor/example.svelte +18 -0
- package/package.json +15 -7
package/README.md
CHANGED
|
@@ -25,8 +25,8 @@ npm install @ticatec/uniface-element
|
|
|
25
25
|
|
|
26
26
|
## 📚 Documentation
|
|
27
27
|
|
|
28
|
-
- **[Component
|
|
29
|
-
- **[
|
|
28
|
+
- **[Generated Component Reference](./docs/components/README.md)** - Source-derived API tables and a standalone Svelte example for every public component
|
|
29
|
+
- **[AI Coding Prompts Index](./assets/ai-coding/README.md)** - Category guides and a full component API matrix, meant to be handed to an AI coding assistant
|
|
30
30
|
- **[中文文档](./README_CN.md)** - Chinese documentation
|
|
31
31
|
|
|
32
32
|
## Quick Start
|
|
@@ -44,11 +44,11 @@ import '@ticatec/uniface-element/ticatec-uniface-web.css';
|
|
|
44
44
|
<script lang="ts">
|
|
45
45
|
import Button from '@ticatec/uniface-element/Button';
|
|
46
46
|
import DataTable from '@ticatec/uniface-element/DataTable';
|
|
47
|
-
import type { DataColumn } from '@ticatec/uniface-element';
|
|
47
|
+
import type { DataColumn } from '@ticatec/uniface-element/DataTable';
|
|
48
48
|
|
|
49
49
|
let columns: DataColumn[] = [
|
|
50
|
-
{
|
|
51
|
-
{
|
|
50
|
+
{ text: 'Name', field: 'name', width: 150 },
|
|
51
|
+
{ text: 'Email', field: 'email', width: 200 }
|
|
52
52
|
];
|
|
53
53
|
|
|
54
54
|
let data = [
|
|
@@ -57,7 +57,7 @@ import '@ticatec/uniface-element/ticatec-uniface-web.css';
|
|
|
57
57
|
];
|
|
58
58
|
</script>
|
|
59
59
|
|
|
60
|
-
<Button type="primary"
|
|
60
|
+
<Button type="primary" onclick={() => console.log('Clicked!')}>
|
|
61
61
|
Click Me
|
|
62
62
|
</Button>
|
|
63
63
|
|
|
@@ -75,14 +75,14 @@ import '@ticatec/uniface-element/ticatec-uniface-web.css';
|
|
|
75
75
|
### Data Display
|
|
76
76
|
- **Tables**: `DataTable`, `ConciseDataTable`
|
|
77
77
|
- **Lists**: `ListBox`, `TreeView`
|
|
78
|
-
- **Navigation**: `Breadcrumbs`, `Tabs`, `NavigatorMenu` | [Navigation Components Docs](./
|
|
78
|
+
- **Navigation**: `Breadcrumbs`, `Tabs`, `NavigatorMenu`, `PageStack` | [Navigation Components Docs](./assets/ai-coding/05-navigation-and-general-guide.md)
|
|
79
79
|
- **Indicators**: `ProgressBar`, `ProgressStepBar`, `Tag`
|
|
80
80
|
|
|
81
81
|
### Form Controls
|
|
82
|
-
- **Input**: `TextEditor`, `NumberEditor`,
|
|
82
|
+
- **Input**: `TextEditor`, `NumberEditor`, `MemoEditor`, `PasswordEditor` | [Form Editors Guide](./assets/ai-coding/01-form-editors-guide.md)
|
|
83
83
|
- **Selection**: `OptionsSelect`, `OptionsMultiSelect`, `CascadeOptionsSelect`
|
|
84
84
|
- **Date/Time**: `DatePicker`, `DateTimePicker`, `TimeEditor`
|
|
85
|
-
- **Search/Filter**:
|
|
85
|
+
- **Search/Filter**: `SearchBox`, `NumberRange`, `DateRange` - Advanced search and filtering components
|
|
86
86
|
- **Others**: `CheckBox`, `RadioButton`, `Switch`, `ColorPicker`
|
|
87
87
|
|
|
88
88
|
### Feedback Components
|
|
@@ -103,22 +103,22 @@ import '@ticatec/uniface-element/ticatec-uniface-web.css';
|
|
|
103
103
|
```svelte
|
|
104
104
|
<script lang="ts">
|
|
105
105
|
import DataTable from '@ticatec/uniface-element/DataTable';
|
|
106
|
-
import type { DataColumn } from '@ticatec/uniface-element';
|
|
106
|
+
import type { DataColumn } from '@ticatec/uniface-element/DataTable';
|
|
107
107
|
|
|
108
108
|
let columns: DataColumn[] = [
|
|
109
109
|
{
|
|
110
110
|
field: 'name',
|
|
111
|
-
|
|
111
|
+
text: 'Name',
|
|
112
112
|
width: 200
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
115
|
field: 'email',
|
|
116
|
-
|
|
116
|
+
text: 'Email',
|
|
117
117
|
width: 250
|
|
118
118
|
},
|
|
119
119
|
{
|
|
120
120
|
field: 'status',
|
|
121
|
-
|
|
121
|
+
text: 'Status',
|
|
122
122
|
width: 120
|
|
123
123
|
}
|
|
124
124
|
];
|
|
@@ -146,23 +146,23 @@ import '@ticatec/uniface-element/ticatec-uniface-web.css';
|
|
|
146
146
|
|
|
147
147
|
let showDialog = false;
|
|
148
148
|
let formData = { name: '', email: '' };
|
|
149
|
+
|
|
150
|
+
const actions = [
|
|
151
|
+
{ label: 'Cancel', handler: () => { showDialog = false; } },
|
|
152
|
+
{ label: 'Save', type: 'primary', handler: () => { showDialog = false; } }
|
|
153
|
+
];
|
|
149
154
|
</script>
|
|
150
155
|
|
|
151
|
-
<Button
|
|
156
|
+
<Button onclick={() => showDialog = true}>Open Dialog</Button>
|
|
152
157
|
|
|
153
|
-
<Dialog bind:visible={showDialog} title="Edit User">
|
|
158
|
+
<Dialog bind:visible={showDialog} title="Edit User" {actions}>
|
|
154
159
|
<FormField label="Name">
|
|
155
160
|
<TextEditor bind:value={formData.name} />
|
|
156
161
|
</FormField>
|
|
157
|
-
|
|
162
|
+
|
|
158
163
|
<FormField label="Email">
|
|
159
164
|
<TextEditor bind:value={formData.email} type="email" />
|
|
160
165
|
</FormField>
|
|
161
|
-
|
|
162
|
-
<svelte:fragment slot="actions">
|
|
163
|
-
<Button on:click={() => showDialog = false}>Cancel</Button>
|
|
164
|
-
<Button type="primary" on:click={() => showDialog = false}>Save</Button>
|
|
165
|
-
</svelte:fragment>
|
|
166
166
|
</Dialog>
|
|
167
167
|
```
|
|
168
168
|
|
|
@@ -285,10 +285,6 @@ npm run check
|
|
|
285
285
|
- Safari ≥ 14
|
|
286
286
|
- Edge ≥ 88
|
|
287
287
|
|
|
288
|
-
## Contributing
|
|
289
|
-
|
|
290
|
-
We welcome contributions! Please see our [Contributing Guide](./CONTRIBUTING.md) for details.
|
|
291
|
-
|
|
292
288
|
## License
|
|
293
289
|
|
|
294
290
|
MIT License - see [LICENSE](./LICENSE) file for details.
|
|
@@ -299,34 +295,13 @@ MIT License - see [LICENSE](./LICENSE) file for details.
|
|
|
299
295
|
|
|
300
296
|
## Documentation
|
|
301
297
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
### Layout Components
|
|
305
|
-
- [SidebarLayout](./docs/layout/en/sidebarlayout.md) | [中文](./docs/layout/cn/sidebarlayout.md) - Left sidebar with resizable main content area
|
|
306
|
-
- [HeaderLayout](./docs/layout/en/headerlayout.md) | [中文](./docs/layout/cn/headerlayout.md) - Top header with content area and optional sidebar
|
|
307
|
-
- [ClassicLayout](./docs/layout/en/classiclayout.md) | [中文](./docs/layout/cn/classiclayout.md) - Full-screen layout with header, footer, sidebar, and content areas
|
|
308
|
-
|
|
309
|
-
### Button Components
|
|
310
|
-
- [Button System](./docs/buttons/en/README.md) | [中文](./docs/buttons/cn/README.md) - Complete button components including Button, TextButton, IconButton, and ActionBar
|
|
311
|
-
|
|
312
|
-
### Dialog Components
|
|
313
|
-
- [Dialog System](./docs/dialog/en/README.md) | [中文](./docs/dialog/cn/README.md) - Modal dialog system with DialogBoard, Dialog, and CommonDialog components
|
|
314
|
-
|
|
315
|
-
### Form Components
|
|
316
|
-
- [Form Controls](./docs/form/en/README.md) | [中文](./docs/form/cn/README.md) - Comprehensive form input components including TextEditor, NumberEditor, CheckBox, OptionsSelect, and more
|
|
317
|
-
|
|
318
|
-
- Overlay Controllers: `indicator`, `toast`, `messageBox`, `Dialog`, `Drawer`
|
|
319
|
-
|
|
320
|
-
### Miscellaneous Components
|
|
321
|
-
- [Utility Components](./docs/misc/en/README.md) | [中文](./docs/misc/cn/README.md) - Additional components including Split, Drawer, Tag, and Card
|
|
322
|
-
|
|
323
|
-
Each component documentation includes:
|
|
324
|
-
- API reference with all props and methods
|
|
325
|
-
- Advanced usage examples and patterns
|
|
326
|
-
- Best practices and styling guides
|
|
327
|
-
- Accessibility considerations
|
|
328
|
-
- Integration tips
|
|
298
|
+
Component-by-category guides and a full props/events/snippets API matrix are available in [`assets/ai-coding/`](./assets/ai-coding/README.md):
|
|
329
299
|
|
|
330
|
-
|
|
300
|
+
- [Form editors](./assets/ai-coding/01-form-editors-guide.md) - `TextEditor`, `NumberEditor`, `DatePicker`, `OptionsSelect`, `CheckBox`, `Switch`, and more
|
|
301
|
+
- [Layouts and containers](./assets/ai-coding/02-layouts-and-containers-guide.md) - `FlexForm`, `GridForm`, `FormField`, `Page`, `ActionBar`, `SidebarLayout`, `ClassicLayout`
|
|
302
|
+
- [Data display and tables](./assets/ai-coding/03-data-display-and-tables-guide.md) - `DataTable`, `ConciseDataTable`, `TreeView`, `Card`, `Accordion`, `ListBox`
|
|
303
|
+
- [Overlays and feedback](./assets/ai-coding/04-overlays-and-feedback-guide.md) - `Dialog`, `CommonDialog`, `Drawer`, `Toast`, `MessageBox`, `Tooltip`, `ContextMenu`
|
|
304
|
+
- [Navigation and general](./assets/ai-coding/05-navigation-and-general-guide.md) - `Tabs`, `Breadcrumbs`, `Pagination`, `Button`, `IconButton`, `Split`, `Tag`, `Transfer`
|
|
305
|
+
- [Components API matrix](./assets/ai-coding/06-components-api-matrix.md) - full props/types/events/snippets reference for every core component
|
|
331
306
|
|
|
332
|
-
|
|
307
|
+
You can also browse the demo components under `/src/routes/demo` for live, working examples.
|
package/README_CN.md
CHANGED
|
@@ -23,6 +23,10 @@
|
|
|
23
23
|
npm install @ticatec/uniface-element
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
+
## 组件文档
|
|
27
|
+
|
|
28
|
+
- **[自动生成的组件参考](./docs/components/README.md)**:覆盖全部公开组件的源码派生属性表和独立 Svelte 示例
|
|
29
|
+
|
|
26
30
|
## 快速开始
|
|
27
31
|
|
|
28
32
|
### 1. 导入样式
|
|
@@ -37,13 +41,12 @@ import '@ticatec/uniface-element/ticatec-uniface-web.css';
|
|
|
37
41
|
```svelte
|
|
38
42
|
<script lang="ts">
|
|
39
43
|
import Button from '@ticatec/uniface-element/Button';
|
|
40
|
-
import DataTable
|
|
41
|
-
import Dialog from '@ticatec/uniface-element/Dialog';
|
|
44
|
+
import DataTable from '@ticatec/uniface-element/DataTable';
|
|
42
45
|
import type { DataColumn } from '@ticatec/uniface-element/DataTable';
|
|
43
|
-
|
|
46
|
+
|
|
44
47
|
let columns: DataColumn[] = [
|
|
45
|
-
{ field: 'name',
|
|
46
|
-
{ field: 'email',
|
|
48
|
+
{ field: 'name', text: '姓名', width: 150 },
|
|
49
|
+
{ field: 'email', text: '邮箱', width: 200 }
|
|
47
50
|
];
|
|
48
51
|
|
|
49
52
|
let data = [
|
|
@@ -52,7 +55,7 @@ import '@ticatec/uniface-element/ticatec-uniface-web.css';
|
|
|
52
55
|
];
|
|
53
56
|
</script>
|
|
54
57
|
|
|
55
|
-
<Button type="primary"
|
|
58
|
+
<Button type="primary" onclick={() => console.log('点击了!')}>
|
|
56
59
|
点击我
|
|
57
60
|
</Button>
|
|
58
61
|
|
|
@@ -70,7 +73,7 @@ import '@ticatec/uniface-element/ticatec-uniface-web.css';
|
|
|
70
73
|
### 数据展示
|
|
71
74
|
- **表格组件**: `DataTable`、`ConciseDataTable`
|
|
72
75
|
- **列表组件**: `ListBox`、`TreeView`
|
|
73
|
-
- **导航组件**: `Breadcrumbs`、`Tabs`、`NavigatorMenu`
|
|
76
|
+
- **导航组件**: `Breadcrumbs`、`Tabs`、`NavigatorMenu`、`PageStack`
|
|
74
77
|
- **指示器**: `ProgressBar`、`ProgressStepBar`、`Tag`
|
|
75
78
|
|
|
76
79
|
### 表单控件
|
|
@@ -163,22 +166,22 @@ await messageBox.showInfo("操作完成", { title: "提示" });
|
|
|
163
166
|
```svelte
|
|
164
167
|
<script lang="ts">
|
|
165
168
|
import DataTable from '@ticatec/uniface-element/DataTable';
|
|
166
|
-
import type { DataColumn } from '@ticatec/uniface-element';
|
|
167
|
-
|
|
169
|
+
import type { DataColumn } from '@ticatec/uniface-element/DataTable';
|
|
170
|
+
|
|
168
171
|
let columns: DataColumn[] = [
|
|
169
172
|
{
|
|
170
173
|
field: 'name',
|
|
171
|
-
|
|
174
|
+
text: '姓名',
|
|
172
175
|
width: 200
|
|
173
176
|
},
|
|
174
177
|
{
|
|
175
178
|
field: 'email',
|
|
176
|
-
|
|
179
|
+
text: '邮箱',
|
|
177
180
|
width: 250
|
|
178
181
|
},
|
|
179
182
|
{
|
|
180
183
|
field: 'status',
|
|
181
|
-
|
|
184
|
+
text: '状态',
|
|
182
185
|
width: 120
|
|
183
186
|
}
|
|
184
187
|
];
|
|
@@ -199,27 +202,30 @@ await messageBox.showInfo("操作完成", { title: "提示" });
|
|
|
199
202
|
|
|
200
203
|
```svelte
|
|
201
204
|
<script lang="ts">
|
|
202
|
-
import Dialog
|
|
203
|
-
|
|
205
|
+
import Dialog from '@ticatec/uniface-element/Dialog';
|
|
206
|
+
import Button from '@ticatec/uniface-element/Button';
|
|
207
|
+
import TextEditor from '@ticatec/uniface-element/TextEditor';
|
|
208
|
+
import FormField from '@ticatec/uniface-element/FormField';
|
|
209
|
+
|
|
204
210
|
let showDialog = false;
|
|
205
211
|
let formData = { name: '', email: '' };
|
|
212
|
+
|
|
213
|
+
const actions = [
|
|
214
|
+
{ label: '取消', handler: () => { showDialog = false; } },
|
|
215
|
+
{ label: '保存', type: 'primary', handler: () => { showDialog = false; } }
|
|
216
|
+
];
|
|
206
217
|
</script>
|
|
207
218
|
|
|
208
|
-
<Button
|
|
219
|
+
<Button onclick={() => showDialog = true}>打开对话框</Button>
|
|
209
220
|
|
|
210
|
-
<Dialog bind:visible={showDialog} title="编辑用户">
|
|
221
|
+
<Dialog bind:visible={showDialog} title="编辑用户" {actions}>
|
|
211
222
|
<FormField label="姓名">
|
|
212
223
|
<TextEditor bind:value={formData.name} />
|
|
213
224
|
</FormField>
|
|
214
|
-
|
|
225
|
+
|
|
215
226
|
<FormField label="邮箱">
|
|
216
227
|
<TextEditor bind:value={formData.email} type="email" />
|
|
217
228
|
</FormField>
|
|
218
|
-
|
|
219
|
-
<svelte:fragment slot="actions">
|
|
220
|
-
<Button on:click={() => showDialog = false}>取消</Button>
|
|
221
|
-
<Button type="primary" on:click={() => showDialog = false}>保存</Button>
|
|
222
|
-
</svelte:fragment>
|
|
223
229
|
</Dialog>
|
|
224
230
|
```
|
|
225
231
|
|
|
@@ -227,34 +233,16 @@ await messageBox.showInfo("操作完成", { title: "提示" });
|
|
|
227
233
|
|
|
228
234
|
## 文档
|
|
229
235
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
### 布局组件
|
|
233
|
-
- [SidebarLayout](./docs/layout/cn/sidebarlayout.md) | [English](./docs/layout/en/sidebarlayout.md) - 左侧边栏与可调整大小的主内容区域
|
|
234
|
-
- [HeaderLayout](./docs/layout/cn/headerlayout.md) | [English](./docs/layout/en/headerlayout.md) - 顶部头部与内容区域及可选侧边栏
|
|
235
|
-
- [ClassicLayout](./docs/layout/cn/classiclayout.md) | [English](./docs/layout/en/classiclayout.md) - 全屏布局,包含头部、底部、侧边栏和内容区域
|
|
236
|
-
|
|
237
|
-
### 按钮组件
|
|
238
|
-
- [按钮系统](./docs/buttons/cn/README.md) | [English](./docs/buttons/en/README.md) - 完整的按钮组件,包括 Button、TextButton、IconButton 和 ActionBar
|
|
236
|
+
按类别划分的组件指南以及完整的属性/事件/Snippet API 矩阵,位于 [`assets/ai-coding/`](./assets/ai-coding/README.md):
|
|
239
237
|
|
|
240
|
-
|
|
241
|
-
- [
|
|
238
|
+
- [表单编辑器](./assets/ai-coding/01-form-editors-guide.md) - `TextEditor`、`NumberEditor`、`DatePicker`、`OptionsSelect`、`CheckBox`、`Switch` 等
|
|
239
|
+
- [布局与容器](./assets/ai-coding/02-layouts-and-containers-guide.md) - `FlexForm`、`GridForm`、`FormField`、`Page`、`ActionBar`、`SidebarLayout`、`ClassicLayout`
|
|
240
|
+
- [数据展示与表格](./assets/ai-coding/03-data-display-and-tables-guide.md) - `DataTable`、`ConciseDataTable`、`TreeView`、`Card`、`Accordion`、`ListBox`
|
|
241
|
+
- [弹层与反馈](./assets/ai-coding/04-overlays-and-feedback-guide.md) - `Dialog`、`CommonDialog`、`Drawer`、`Toast`、`MessageBox`、`Tooltip`、`ContextMenu`
|
|
242
|
+
- [导航与通用组件](./assets/ai-coding/05-navigation-and-general-guide.md) - `Tabs`、`Breadcrumbs`、`Pagination`、`Button`、`IconButton`、`Split`、`Tag`、`Transfer`
|
|
243
|
+
- [组件 API 矩阵](./assets/ai-coding/06-components-api-matrix.md) - 所有核心组件的完整 Props/Types/Events/Snippets 参考
|
|
242
244
|
|
|
243
|
-
|
|
244
|
-
- [表单控件](./docs/form/cn/README.md) | [English](./docs/form/en/README.md) - 全面的表单输入组件,包括 TextEditor、NumberEditor、CheckBox、OptionsSelect 等
|
|
245
|
-
|
|
246
|
-
### Overlay 组件
|
|
247
|
-
- 应用程序级 Overlay 控制器,包括 Indicator、Toast、MessageBox、ContextMenu、Dialog
|
|
248
|
-
|
|
249
|
-
### 杂项组件
|
|
250
|
-
- [实用组件](./docs/misc/cn/README.md) | [English](./docs/misc/en/README.md) - 其他组件,包括 Split、Drawer、Tag 和 Card
|
|
251
|
-
|
|
252
|
-
每个组件文档都包括:
|
|
253
|
-
- 包含所有属性和方法的 API 参考
|
|
254
|
-
- 高级用法示例和模式
|
|
255
|
-
- 最佳实践和样式指南
|
|
256
|
-
- 无障碍访问注意事项
|
|
257
|
-
- 集成提示
|
|
245
|
+
也可以查看 `/src/routes/demo` 目录下的示例组件,获取可运行的真实用法。
|
|
258
246
|
|
|
259
247
|
## 主题定制
|
|
260
248
|
|
|
@@ -347,7 +335,7 @@ import MemoEditor from '@ticatec/uniface-element/MemoEditor';
|
|
|
347
335
|
|
|
348
336
|
// 工具导入
|
|
349
337
|
import { utils } from '@ticatec/uniface-element/utils';
|
|
350
|
-
import type { DataColumn } from '@ticatec/uniface-element/
|
|
338
|
+
import type { DataColumn } from '@ticatec/uniface-element/DataTable';
|
|
351
339
|
```
|
|
352
340
|
|
|
353
341
|
## 开发
|
|
@@ -373,10 +361,6 @@ npm run check
|
|
|
373
361
|
- Safari ≥ 14
|
|
374
362
|
- Edge ≥ 88
|
|
375
363
|
|
|
376
|
-
## 贡献
|
|
377
|
-
|
|
378
|
-
欢迎贡献代码!请查看我们的 [贡献指南](./CONTRIBUTING.md) 了解详细信息。
|
|
379
|
-
|
|
380
364
|
## 许可证
|
|
381
365
|
|
|
382
366
|
MIT 许可证 - 查看 [LICENSE](./LICENSE) 文件了解详细信息。
|
|
@@ -384,7 +368,3 @@ MIT 许可证 - 查看 [LICENSE](./LICENSE) 文件了解详细信息。
|
|
|
384
368
|
## 作者
|
|
385
369
|
|
|
386
370
|
**Henry Feng** - [Ticatec](https://github.com/ticatec-auckland)
|
|
387
|
-
|
|
388
|
-
---
|
|
389
|
-
|
|
390
|
-
更多详细文档和示例,请访问我们的 [文档网站](#) 或查看 `/src/routes/demo` 目录中的示例组件。
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
cellWidth?: number;
|
|
15
15
|
cellHeight?: number;
|
|
16
16
|
border?: boolean;
|
|
17
|
+
onchange?: (value: dayjs.Dayjs) => void;
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated 请使用 onchange;仍受支持以兼容旧调用。
|
|
20
|
+
*/
|
|
17
21
|
onselect?: (value: dayjs.Dayjs) => void;
|
|
18
22
|
}
|
|
19
23
|
|
|
@@ -25,6 +29,7 @@
|
|
|
25
29
|
cellWidth = 32,
|
|
26
30
|
cellHeight = 32,
|
|
27
31
|
border = false,
|
|
32
|
+
onchange,
|
|
28
33
|
onselect
|
|
29
34
|
}: Props = $props();
|
|
30
35
|
|
|
@@ -54,6 +59,7 @@
|
|
|
54
59
|
});
|
|
55
60
|
|
|
56
61
|
const onSelectDate = (d: dayjs.Dayjs) => {
|
|
62
|
+
onchange?.(d);
|
|
57
63
|
onselect?.(d);
|
|
58
64
|
};
|
|
59
65
|
|
|
@@ -75,18 +81,29 @@
|
|
|
75
81
|
month = m;
|
|
76
82
|
year = y;
|
|
77
83
|
};
|
|
84
|
+
|
|
85
|
+
const handleKeyActivate = (handler: () => void) => (e: KeyboardEvent) => {
|
|
86
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
87
|
+
e.preventDefault();
|
|
88
|
+
handler();
|
|
89
|
+
}
|
|
90
|
+
};
|
|
78
91
|
</script>
|
|
79
92
|
<div class="uniface-calendar" class:border style="{style}; width: {cellWidth * 7}px">
|
|
80
93
|
<div>
|
|
81
94
|
<div class="uniface-title-bar">
|
|
82
|
-
<div class="action-icon"
|
|
95
|
+
<div class="action-icon" role="button" tabindex="0" aria-label="Previous month"
|
|
96
|
+
onclick={adjustMonth(-1)} onkeydown={handleKeyActivate(adjustMonth(-1))}>
|
|
83
97
|
<i class="icon_google_keyboard_arrow_left"></i>
|
|
84
98
|
</div>
|
|
85
99
|
<div style="flex: 1 1 auto; text-align: center">
|
|
86
|
-
<span class="title-text"
|
|
87
|
-
|
|
100
|
+
<span class="title-text" role="button" tabindex="0" aria-label="Pick year"
|
|
101
|
+
onclick={pickupYear} onkeydown={handleKeyActivate(pickupYear)}>{year}</span>
|
|
102
|
+
<span class="title-text" role="button" tabindex="0" aria-label="Pick month"
|
|
103
|
+
onclick={pickupMonth} onkeydown={handleKeyActivate(pickupMonth)}>{month + 1}</span>
|
|
88
104
|
</div>
|
|
89
|
-
<div class="action-icon"
|
|
105
|
+
<div class="action-icon" role="button" tabindex="0" aria-label="Next month"
|
|
106
|
+
onclick={adjustMonth(1)} onkeydown={handleKeyActivate(adjustMonth(1))}>
|
|
90
107
|
<i class="icon_google_keyboard_arrow_right"></i>
|
|
91
108
|
</div>
|
|
92
109
|
</div>
|
|
@@ -100,12 +117,12 @@
|
|
|
100
117
|
onselect={onSelectDate}/>
|
|
101
118
|
{#if showMonths}
|
|
102
119
|
<MonthPickupPanel bind:value={month} months={dateCtx.months}
|
|
103
|
-
|
|
120
|
+
onclick={() => { showMonths = false; }}/>
|
|
104
121
|
{:else if showYears}
|
|
105
122
|
<YearPickupPanel bind:year
|
|
106
123
|
maxYear={maxDate == null ? null : maxDate.year()}
|
|
107
124
|
minYear={minDate == null ? null : minDate.year()}
|
|
108
|
-
|
|
125
|
+
onclick={() => { showYears = false; }}/>
|
|
109
126
|
{/if}
|
|
110
127
|
</div>
|
|
111
128
|
</div>
|
|
@@ -168,4 +185,10 @@
|
|
|
168
185
|
.action-icon:hover i {
|
|
169
186
|
color: var(--uniface-primary-hover-color, #42A5F5);
|
|
170
187
|
}
|
|
188
|
+
|
|
189
|
+
.action-icon:focus-visible,
|
|
190
|
+
.title-text:focus-visible {
|
|
191
|
+
outline: 2px solid var(--uniface-primary-border-color, #298DFF);
|
|
192
|
+
outline-offset: 1px;
|
|
193
|
+
}
|
|
171
194
|
</style>
|
|
@@ -8,6 +8,10 @@ interface Props {
|
|
|
8
8
|
cellWidth?: number;
|
|
9
9
|
cellHeight?: number;
|
|
10
10
|
border?: boolean;
|
|
11
|
+
onchange?: (value: dayjs.Dayjs) => void;
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated 请使用 onchange;仍受支持以兼容旧调用。
|
|
14
|
+
*/
|
|
11
15
|
onselect?: (value: dayjs.Dayjs) => void;
|
|
12
16
|
}
|
|
13
17
|
declare const CalendarBase: import("svelte").Component<Props, {}, "">;
|
|
@@ -2,31 +2,39 @@
|
|
|
2
2
|
interface Props {
|
|
3
3
|
value: number;
|
|
4
4
|
months: Array<string>;
|
|
5
|
-
|
|
5
|
+
onclick?: (event: MouseEvent) => void;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
let {
|
|
9
9
|
value = $bindable<number>(),
|
|
10
10
|
months,
|
|
11
|
-
|
|
11
|
+
onclick
|
|
12
12
|
}: Props = $props();
|
|
13
13
|
|
|
14
14
|
const handleMonthClick = (m: number) => (e: MouseEvent) => {
|
|
15
15
|
if (m !== value) {
|
|
16
16
|
value = m;
|
|
17
|
-
|
|
17
|
+
onclick?.(e);
|
|
18
18
|
} else {
|
|
19
19
|
e.stopPropagation();
|
|
20
20
|
e.preventDefault();
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
+
|
|
24
|
+
const handleKeyActivate = (m: number) => (e: KeyboardEvent) => {
|
|
25
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
26
|
+
e.preventDefault();
|
|
27
|
+
handleMonthClick(m)(e as unknown as MouseEvent);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
23
30
|
</script>
|
|
24
|
-
<div class="uniface-month-pickup-panel" onclick={
|
|
31
|
+
<div class="uniface-month-pickup-panel" onclick={onclick} role="presentation">
|
|
25
32
|
<div>
|
|
26
33
|
<div style="display: grid; grid-template-columns: auto auto auto; overflow: hidden; width: 100%">
|
|
27
34
|
{#each months as month, idx}
|
|
28
|
-
<div class="month-block" class:selected={idx === value}
|
|
29
|
-
|
|
35
|
+
<div class="month-block" class:selected={idx === value}
|
|
36
|
+
role="button" tabindex="0" aria-current={idx === value ? 'date' : undefined}
|
|
37
|
+
onclick={handleMonthClick(idx)} onkeydown={handleKeyActivate(idx)}>
|
|
30
38
|
<span>{month}</span>
|
|
31
39
|
</div>
|
|
32
40
|
{/each}
|
|
@@ -85,4 +93,9 @@
|
|
|
85
93
|
.month-block.selected:hover {
|
|
86
94
|
background-color: unset;
|
|
87
95
|
}
|
|
96
|
+
|
|
97
|
+
.month-block:focus-visible {
|
|
98
|
+
outline: 2px solid var(--uniface-primary-border-color, #298DFF);
|
|
99
|
+
outline-offset: 1px;
|
|
100
|
+
}
|
|
88
101
|
</style>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
interface Props {
|
|
2
2
|
value: number;
|
|
3
3
|
months: Array<string>;
|
|
4
|
-
|
|
4
|
+
onclick?: (event: MouseEvent) => void;
|
|
5
5
|
}
|
|
6
6
|
declare const MonthPickupPanel: import("svelte").Component<Props, {}, "value">;
|
|
7
7
|
type MonthPickupPanel = ReturnType<typeof MonthPickupPanel>;
|
|
@@ -94,6 +94,13 @@
|
|
|
94
94
|
onselect?.(dayjs(new Date(year, month, ad.d)));
|
|
95
95
|
}
|
|
96
96
|
};
|
|
97
|
+
|
|
98
|
+
const handleDayKeyDown = (ad: CalendarDay) => (e: KeyboardEvent) => {
|
|
99
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
100
|
+
e.preventDefault();
|
|
101
|
+
handleDayClick(ad)();
|
|
102
|
+
}
|
|
103
|
+
};
|
|
97
104
|
</script>
|
|
98
105
|
<div class="monthly-calendar" class:border>
|
|
99
106
|
{#each Array(7) as _, idx}
|
|
@@ -103,14 +110,18 @@
|
|
|
103
110
|
{/each}
|
|
104
111
|
{#each days as day, idx}
|
|
105
112
|
<div class="cell calendar-day"
|
|
106
|
-
|
|
113
|
+
role="button" tabindex={day.disabled ? -1 : 0}
|
|
114
|
+
aria-disabled={day.disabled}
|
|
115
|
+
aria-current={day.isToday ? 'date' : undefined}
|
|
116
|
+
aria-pressed={selected.year === day.y && selected.month === day.m && selected.date === day.d}
|
|
117
|
+
aria-label="{day.y}-{day.m + 1}-{day.d}"
|
|
107
118
|
style="width: {cellWidth}px; height: {cellHeight}px;"
|
|
108
119
|
class:weekend={isWeekend(idx)}
|
|
109
120
|
class:today={day.isToday}
|
|
110
121
|
class:selected={selected.year === day.y && selected.month === day.m && selected.date === day.d}
|
|
111
122
|
class:lastRow={idx > 34}
|
|
112
123
|
class:disabled={day.disabled}
|
|
113
|
-
onclick={handleDayClick(day)}>
|
|
124
|
+
onclick={handleDayClick(day)} onkeydown={handleDayKeyDown(day)}>
|
|
114
125
|
<span>{day.d}</span>
|
|
115
126
|
{#if dailyContent}
|
|
116
127
|
<div>
|
|
@@ -200,4 +211,9 @@
|
|
|
200
211
|
.disabled > span:first-child:hover {
|
|
201
212
|
background-color: unset;
|
|
202
213
|
}
|
|
214
|
+
|
|
215
|
+
.calendar-day:focus-visible > span:first-child {
|
|
216
|
+
outline: 2px solid var(--uniface-primary-border-color, #298DFF);
|
|
217
|
+
outline-offset: 1px;
|
|
218
|
+
}
|
|
203
219
|
</style>
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
year: number;
|
|
4
4
|
maxYear?: number | null;
|
|
5
5
|
minYear?: number | null;
|
|
6
|
-
|
|
6
|
+
onclick?: (event: MouseEvent) => void;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
let {
|
|
10
10
|
year = $bindable<number>(),
|
|
11
11
|
maxYear = null,
|
|
12
12
|
minYear = null,
|
|
13
|
-
|
|
13
|
+
onclick
|
|
14
14
|
}: Props = $props();
|
|
15
15
|
|
|
16
16
|
let offset = $state(6);
|
|
@@ -34,18 +34,28 @@
|
|
|
34
34
|
e.stopPropagation();
|
|
35
35
|
e.preventDefault();
|
|
36
36
|
};
|
|
37
|
+
|
|
38
|
+
const handleKeyActivate = (handler: (e: any) => void) => (e: KeyboardEvent) => {
|
|
39
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
40
|
+
e.preventDefault();
|
|
41
|
+
handler(e);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
37
44
|
</script>
|
|
38
|
-
<div class="uniface-year-pickup-panel"
|
|
45
|
+
<div class="uniface-year-pickup-panel" onclick={onclick} role="presentation">
|
|
39
46
|
<div>
|
|
40
47
|
<div>
|
|
41
48
|
<div style="text-align: center">
|
|
42
49
|
<div style="display: inline-block; width: 30px; height: 10px; padding: 6px 0">
|
|
43
|
-
<i class="icon_google_keyboard_arrow_up"
|
|
50
|
+
<i class="icon_google_keyboard_arrow_up" role="button" tabindex="0" aria-label="Previous years"
|
|
51
|
+
onclick={showYears(-years)} onkeydown={handleKeyActivate(showYears(-years))}></i>
|
|
44
52
|
</div>
|
|
45
53
|
</div>
|
|
46
54
|
<div style="display: grid; grid-template-columns: auto auto auto auto; width: 100%; overflow: hidden">
|
|
47
55
|
{#each Array(years) as _, i}
|
|
48
|
-
<div class="year-block" onclick={handleYearClick(i)}
|
|
56
|
+
<div class="year-block" onclick={handleYearClick(i)} onkeydown={handleKeyActivate(handleYearClick(i))}
|
|
57
|
+
role="button" tabindex="0" aria-disabled={isDisabled(year - offset + i)}
|
|
58
|
+
aria-current={year === year - offset + i ? 'date' : undefined}
|
|
49
59
|
class:disabled={isDisabled(year - offset + i)}
|
|
50
60
|
class:selected={year === year - offset + i}>
|
|
51
61
|
<span>{year - offset + i}</span>
|
|
@@ -54,7 +64,8 @@
|
|
|
54
64
|
</div>
|
|
55
65
|
<div style="text-align: center">
|
|
56
66
|
<div style="display: inline-block; width: 30px; height: 10px; padding: 6px 0">
|
|
57
|
-
<i class="icon_google_keyboard_arrow_down" aria-
|
|
67
|
+
<i class="icon_google_keyboard_arrow_down" role="button" tabindex="0" aria-label="Next years"
|
|
68
|
+
onclick={showYears(years)} onkeydown={handleKeyActivate(showYears(years))}></i>
|
|
58
69
|
</div>
|
|
59
70
|
</div>
|
|
60
71
|
</div>
|
|
@@ -122,4 +133,11 @@
|
|
|
122
133
|
.year-block.disabled:hover {
|
|
123
134
|
font-weight: unset;
|
|
124
135
|
}
|
|
136
|
+
|
|
137
|
+
.year-block:focus-visible,
|
|
138
|
+
.icon_google_keyboard_arrow_up:focus-visible,
|
|
139
|
+
.icon_google_keyboard_arrow_down:focus-visible {
|
|
140
|
+
outline: 2px solid var(--uniface-primary-border-color, #298DFF);
|
|
141
|
+
outline-offset: 1px;
|
|
142
|
+
}
|
|
125
143
|
</style>
|
|
@@ -2,7 +2,7 @@ interface Props {
|
|
|
2
2
|
year: number;
|
|
3
3
|
maxYear?: number | null;
|
|
4
4
|
minYear?: number | null;
|
|
5
|
-
|
|
5
|
+
onclick?: (event: MouseEvent) => void;
|
|
6
6
|
}
|
|
7
7
|
declare const YearPickupPanel: import("svelte").Component<Props, {}, "year">;
|
|
8
8
|
type YearPickupPanel = ReturnType<typeof YearPickupPanel>;
|
|
@@ -38,6 +38,8 @@
|
|
|
38
38
|
let pagesOptions = $derived(
|
|
39
39
|
(rowsSet ?? [25, 50, 100]).map(v => ({code: v, text: `${v}`}))
|
|
40
40
|
);
|
|
41
|
+
// Rendered via {@html} below: generateInfo is a trusted, caller-supplied
|
|
42
|
+
// renderer (not user input) — same opt-in-HTML boundary as DataColumn#renderHTML.
|
|
41
43
|
let totalText = $derived(
|
|
42
44
|
generateInfo
|
|
43
45
|
? generateInfo(total, pageCount, pageNo, rowCount)
|