This is page 97 of 141. Use http://codebase.md/xmlui-org/xmlui/xmlui/mockApiDef.js?lines=false&page={x} to view the full context.
# Directory Structure
```
├── .changeset
│ └── config.json
├── .eslintrc.cjs
├── .github
│ ├── build-checklist.png
│ ├── ISSUE_TEMPLATE
│ │ ├── bug_report.md
│ │ └── feature_request.md
│ └── workflows
│ ├── deploy-blog-optimized.yml
│ ├── deploy-blog.yml
│ ├── deploy-docs-optimized.yml
│ ├── deploy-docs.yml
│ ├── prepare-versions.yml
│ ├── release-packages.yml
│ ├── run-all-tests.yml
│ └── run-smoke-tests.yml
├── .gitignore
├── .prettierrc.js
├── .vscode
│ ├── launch.json
│ └── settings.json
├── blog
│ ├── .gitignore
│ ├── .gitkeep
│ ├── CHANGELOG.md
│ ├── extensions.ts
│ ├── index.html
│ ├── index.ts
│ ├── package.json
│ ├── public
│ │ ├── blog
│ │ │ ├── images
│ │ │ │ ├── an-advanced-codefence.gif
│ │ │ │ ├── an-advanced-codefence.mp4
│ │ │ │ ├── blog-page-component.png
│ │ │ │ ├── blog-scrabble.png
│ │ │ │ ├── codefence-runner.png
│ │ │ │ ├── integrated-blog-search.png
│ │ │ │ ├── lorem-ipsum.png
│ │ │ │ ├── playground-checkbox-source.png
│ │ │ │ ├── playground.png
│ │ │ │ ├── use-xmlui-mcp-to-find-a-howto.png
│ │ │ │ └── xmlui-demo-gallery.png
│ │ │ ├── introducing-xmlui.md
│ │ │ ├── lorem-ipsum.md
│ │ │ ├── newest-post.md
│ │ │ ├── older-post.md
│ │ │ ├── xmlui-playground.md
│ │ │ └── xmlui-powered-blog.md
│ │ ├── mockServiceWorker.js
│ │ ├── resources
│ │ │ ├── favicon.ico
│ │ │ ├── files
│ │ │ │ └── for-download
│ │ │ │ └── xmlui
│ │ │ │ └── xmlui-standalone.umd.js
│ │ │ ├── github.svg
│ │ │ ├── llms.txt
│ │ │ ├── logo-dark.svg
│ │ │ ├── logo.svg
│ │ │ ├── pg-popout.svg
│ │ │ ├── rss.svg
│ │ │ └── xmlui-logo.svg
│ │ ├── serve.json
│ │ └── web.config
│ ├── scripts
│ │ ├── download-latest-xmlui.js
│ │ ├── generate-rss.js
│ │ ├── get-releases.js
│ │ └── utils.js
│ ├── src
│ │ ├── components
│ │ │ ├── BlogOverview.xmlui
│ │ │ ├── BlogPage.xmlui
│ │ │ └── PageNotFound.xmlui
│ │ ├── config.ts
│ │ ├── Main.xmlui
│ │ └── themes
│ │ └── blog-theme.ts
│ └── tsconfig.json
├── CONTRIBUTING.md
├── docs
│ ├── .gitignore
│ ├── CHANGELOG.md
│ ├── ComponentRefLinks.txt
│ ├── content
│ │ ├── _meta.json
│ │ ├── components
│ │ │ ├── _meta.json
│ │ │ ├── _overview.md
│ │ │ ├── APICall.md
│ │ │ ├── App.md
│ │ │ ├── AppHeader.md
│ │ │ ├── AppState.md
│ │ │ ├── AutoComplete.md
│ │ │ ├── Avatar.md
│ │ │ ├── Backdrop.md
│ │ │ ├── Badge.md
│ │ │ ├── BarChart.md
│ │ │ ├── Bookmark.md
│ │ │ ├── Breakout.md
│ │ │ ├── Button.md
│ │ │ ├── Card.md
│ │ │ ├── Carousel.md
│ │ │ ├── ChangeListener.md
│ │ │ ├── Checkbox.md
│ │ │ ├── CHStack.md
│ │ │ ├── ColorPicker.md
│ │ │ ├── Column.md
│ │ │ ├── ContentSeparator.md
│ │ │ ├── CVStack.md
│ │ │ ├── DataSource.md
│ │ │ ├── DateInput.md
│ │ │ ├── DatePicker.md
│ │ │ ├── DonutChart.md
│ │ │ ├── DropdownMenu.md
│ │ │ ├── EmojiSelector.md
│ │ │ ├── ExpandableItem.md
│ │ │ ├── FileInput.md
│ │ │ ├── FileUploadDropZone.md
│ │ │ ├── FlowLayout.md
│ │ │ ├── Footer.md
│ │ │ ├── Form.md
│ │ │ ├── FormItem.md
│ │ │ ├── FormSection.md
│ │ │ ├── Fragment.md
│ │ │ ├── H1.md
│ │ │ ├── H2.md
│ │ │ ├── H3.md
│ │ │ ├── H4.md
│ │ │ ├── H5.md
│ │ │ ├── H6.md
│ │ │ ├── Heading.md
│ │ │ ├── HSplitter.md
│ │ │ ├── HStack.md
│ │ │ ├── Icon.md
│ │ │ ├── IFrame.md
│ │ │ ├── Image.md
│ │ │ ├── Items.md
│ │ │ ├── LabelList.md
│ │ │ ├── Legend.md
│ │ │ ├── LineChart.md
│ │ │ ├── Link.md
│ │ │ ├── List.md
│ │ │ ├── Logo.md
│ │ │ ├── Markdown.md
│ │ │ ├── MenuItem.md
│ │ │ ├── MenuSeparator.md
│ │ │ ├── ModalDialog.md
│ │ │ ├── NavGroup.md
│ │ │ ├── NavLink.md
│ │ │ ├── NavPanel.md
│ │ │ ├── NoResult.md
│ │ │ ├── NumberBox.md
│ │ │ ├── Option.md
│ │ │ ├── Page.md
│ │ │ ├── PageMetaTitle.md
│ │ │ ├── Pages.md
│ │ │ ├── Pagination.md
│ │ │ ├── PasswordInput.md
│ │ │ ├── PieChart.md
│ │ │ ├── ProgressBar.md
│ │ │ ├── Queue.md
│ │ │ ├── RadioGroup.md
│ │ │ ├── RealTimeAdapter.md
│ │ │ ├── Redirect.md
│ │ │ ├── Select.md
│ │ │ ├── Slider.md
│ │ │ ├── Slot.md
│ │ │ ├── SpaceFiller.md
│ │ │ ├── Spinner.md
│ │ │ ├── Splitter.md
│ │ │ ├── Stack.md
│ │ │ ├── StickyBox.md
│ │ │ ├── SubMenuItem.md
│ │ │ ├── Switch.md
│ │ │ ├── TabItem.md
│ │ │ ├── Table.md
│ │ │ ├── TableOfContents.md
│ │ │ ├── Tabs.md
│ │ │ ├── Text.md
│ │ │ ├── TextArea.md
│ │ │ ├── TextBox.md
│ │ │ ├── Theme.md
│ │ │ ├── TimeInput.md
│ │ │ ├── Timer.md
│ │ │ ├── ToneChangerButton.md
│ │ │ ├── ToneSwitch.md
│ │ │ ├── Tooltip.md
│ │ │ ├── Tree.md
│ │ │ ├── VSplitter.md
│ │ │ ├── VStack.md
│ │ │ ├── xmlui-animations
│ │ │ │ ├── _meta.json
│ │ │ │ ├── _overview.md
│ │ │ │ ├── Animation.md
│ │ │ │ ├── FadeAnimation.md
│ │ │ │ ├── FadeInAnimation.md
│ │ │ │ ├── FadeOutAnimation.md
│ │ │ │ ├── ScaleAnimation.md
│ │ │ │ └── SlideInAnimation.md
│ │ │ ├── xmlui-pdf
│ │ │ │ ├── _meta.json
│ │ │ │ ├── _overview.md
│ │ │ │ └── Pdf.md
│ │ │ ├── xmlui-spreadsheet
│ │ │ │ ├── _meta.json
│ │ │ │ ├── _overview.md
│ │ │ │ └── Spreadsheet.md
│ │ │ └── xmlui-website-blocks
│ │ │ ├── _meta.json
│ │ │ ├── _overview.md
│ │ │ ├── Carousel.md
│ │ │ ├── HelloMd.md
│ │ │ ├── HeroSection.md
│ │ │ └── ScrollToTop.md
│ │ └── extensions
│ │ ├── _meta.json
│ │ ├── xmlui-animations
│ │ │ ├── _meta.json
│ │ │ ├── _overview.md
│ │ │ ├── Animation.md
│ │ │ ├── FadeAnimation.md
│ │ │ ├── FadeInAnimation.md
│ │ │ ├── FadeOutAnimation.md
│ │ │ ├── ScaleAnimation.md
│ │ │ └── SlideInAnimation.md
│ │ └── xmlui-website-blocks
│ │ ├── _meta.json
│ │ ├── _overview.md
│ │ ├── Carousel.md
│ │ ├── FancyButton.md
│ │ ├── HeroSection.md
│ │ └── ScrollToTop.md
│ ├── extensions.ts
│ ├── index.html
│ ├── index.ts
│ ├── package.json
│ ├── public
│ │ ├── feed.rss
│ │ ├── mockServiceWorker.js
│ │ ├── pages
│ │ │ ├── _meta.json
│ │ │ ├── app-structure.md
│ │ │ ├── build-editor-component.md
│ │ │ ├── build-hello-world-component.md
│ │ │ ├── components-intro.md
│ │ │ ├── context-variables.md
│ │ │ ├── forms.md
│ │ │ ├── globals.md
│ │ │ ├── glossary.md
│ │ │ ├── helper-tags.md
│ │ │ ├── hosted-deployment.md
│ │ │ ├── howto
│ │ │ │ ├── assign-a-complex-json-literal-to-a-component-variable.md
│ │ │ │ ├── chain-a-refetch.md
│ │ │ │ ├── control-cache-invalidation.md
│ │ │ │ ├── debounce-user-input-for-api-calls.md
│ │ │ │ ├── debounce-with-changelistener.md
│ │ │ │ ├── debug-a-component.md
│ │ │ │ ├── delay-a-datasource-until-another-datasource-is-ready.md
│ │ │ │ ├── delegate-a-method.md
│ │ │ │ ├── do-custom-form-validation.md
│ │ │ │ ├── expose-a-method-from-a-component.md
│ │ │ │ ├── filter-and-transform-data-from-an-api.md
│ │ │ │ ├── group-items-in-list-by-a-property.md
│ │ │ │ ├── handle-background-operations.md
│ │ │ │ ├── hide-an-element-until-its-datasource-is-ready.md
│ │ │ │ ├── make-a-set-of-equal-width-cards.md
│ │ │ │ ├── make-a-table-responsive.md
│ │ │ │ ├── make-navpanel-width-responsive.md
│ │ │ │ ├── modify-a-value-reported-in-a-column.md
│ │ │ │ ├── paginate-a-list.md
│ │ │ │ ├── pass-data-to-a-modal-dialog.md
│ │ │ │ ├── react-to-button-click-not-keystrokes.md
│ │ │ │ ├── set-the-initial-value-of-a-select-from-fetched-data.md
│ │ │ │ ├── share-a-modaldialog-across-components.md
│ │ │ │ ├── sync-selections-between-table-and-list-views.md
│ │ │ │ ├── update-ui-optimistically.md
│ │ │ │ ├── use-built-in-form-validation.md
│ │ │ │ └── use-the-same-modaldialog-to-add-or-edit.md
│ │ │ ├── howto.md
│ │ │ ├── intro.md
│ │ │ ├── layout.md
│ │ │ ├── markup.md
│ │ │ ├── mcp.md
│ │ │ ├── modal-dialogs.md
│ │ │ ├── news-and-reviews.md
│ │ │ ├── reactive-intro.md
│ │ │ ├── refactoring.md
│ │ │ ├── routing-and-links.md
│ │ │ ├── samples
│ │ │ │ ├── color-palette.xmlui
│ │ │ │ ├── color-values.xmlui
│ │ │ │ ├── shadow-sizes.xmlui
│ │ │ │ ├── spacing-sizes.xmlui
│ │ │ │ ├── swatch.xmlui
│ │ │ │ ├── theme-gallery-brief.xmlui
│ │ │ │ └── theme-gallery.xmlui
│ │ │ ├── scoping.md
│ │ │ ├── scripting.md
│ │ │ ├── styles-and-themes
│ │ │ │ ├── common-units.md
│ │ │ │ ├── layout-props.md
│ │ │ │ ├── theme-variable-defaults.md
│ │ │ │ ├── theme-variables.md
│ │ │ │ └── themes.md
│ │ │ ├── template-properties.md
│ │ │ ├── test.md
│ │ │ ├── tutorial-01.md
│ │ │ ├── tutorial-02.md
│ │ │ ├── tutorial-03.md
│ │ │ ├── tutorial-04.md
│ │ │ ├── tutorial-05.md
│ │ │ ├── tutorial-06.md
│ │ │ ├── tutorial-07.md
│ │ │ ├── tutorial-08.md
│ │ │ ├── tutorial-09.md
│ │ │ ├── tutorial-10.md
│ │ │ ├── tutorial-11.md
│ │ │ ├── tutorial-12.md
│ │ │ ├── universal-properties.md
│ │ │ ├── user-defined-components.md
│ │ │ ├── vscode.md
│ │ │ ├── working-with-markdown.md
│ │ │ ├── working-with-text.md
│ │ │ ├── xmlui-animations
│ │ │ │ ├── _meta.json
│ │ │ │ ├── _overview.md
│ │ │ │ ├── Animation.md
│ │ │ │ ├── FadeAnimation.md
│ │ │ │ ├── FadeInAnimation.md
│ │ │ │ ├── FadeOutAnimation.md
│ │ │ │ ├── ScaleAnimation.md
│ │ │ │ └── SlideInAnimation.md
│ │ │ ├── xmlui-charts
│ │ │ │ ├── _meta.json
│ │ │ │ ├── _overview.md
│ │ │ │ ├── BarChart.md
│ │ │ │ ├── DonutChart.md
│ │ │ │ ├── LabelList.md
│ │ │ │ ├── Legend.md
│ │ │ │ ├── LineChart.md
│ │ │ │ └── PieChart.md
│ │ │ ├── xmlui-pdf
│ │ │ │ ├── _meta.json
│ │ │ │ ├── _overview.md
│ │ │ │ └── Pdf.md
│ │ │ └── xmlui-spreadsheet
│ │ │ ├── _meta.json
│ │ │ ├── _overview.md
│ │ │ └── Spreadsheet.md
│ │ ├── resources
│ │ │ ├── devdocs
│ │ │ │ ├── debug-proxy-object-2.png
│ │ │ │ ├── debug-proxy-object.png
│ │ │ │ ├── table_editor_01.png
│ │ │ │ ├── table_editor_02.png
│ │ │ │ ├── table_editor_03.png
│ │ │ │ ├── table_editor_04.png
│ │ │ │ ├── table_editor_05.png
│ │ │ │ ├── table_editor_06.png
│ │ │ │ ├── table_editor_07.png
│ │ │ │ ├── table_editor_08.png
│ │ │ │ ├── table_editor_09.png
│ │ │ │ ├── table_editor_10.png
│ │ │ │ ├── table_editor_11.png
│ │ │ │ ├── table-editor-01.png
│ │ │ │ ├── table-editor-02.png
│ │ │ │ ├── table-editor-03.png
│ │ │ │ ├── table-editor-04.png
│ │ │ │ ├── table-editor-06.png
│ │ │ │ ├── table-editor-07.png
│ │ │ │ ├── table-editor-08.png
│ │ │ │ ├── table-editor-09.png
│ │ │ │ └── xmlui-rendering-of-tiptap-markdown.png
│ │ │ ├── favicon.ico
│ │ │ ├── files
│ │ │ │ ├── clients.json
│ │ │ │ ├── daily-revenue.json
│ │ │ │ ├── dashboard-stats.json
│ │ │ │ ├── demo.xmlui
│ │ │ │ ├── demo.xmlui.xs
│ │ │ │ ├── downloads
│ │ │ │ │ └── downloads.json
│ │ │ │ ├── for-download
│ │ │ │ │ ├── index-with-api.html
│ │ │ │ │ ├── index.html
│ │ │ │ │ ├── mockApi.js
│ │ │ │ │ ├── start-darwin.sh
│ │ │ │ │ ├── start-linux.sh
│ │ │ │ │ ├── start.bat
│ │ │ │ │ └── xmlui
│ │ │ │ │ └── xmlui-standalone.umd.js
│ │ │ │ ├── getting-started
│ │ │ │ │ ├── cl-tutorial-final.zip
│ │ │ │ │ ├── cl-tutorial.zip
│ │ │ │ │ ├── cl-tutorial2.zip
│ │ │ │ │ ├── cl-tutorial3.zip
│ │ │ │ │ ├── cl-tutorial4.zip
│ │ │ │ │ ├── cl-tutorial5.zip
│ │ │ │ │ ├── cl-tutorial6.zip
│ │ │ │ │ ├── getting-started.zip
│ │ │ │ │ ├── hello-xmlui.zip
│ │ │ │ │ ├── xmlui-empty.zip
│ │ │ │ │ └── xmlui-starter.zip
│ │ │ │ ├── howto
│ │ │ │ │ └── component-icons
│ │ │ │ │ └── up-arrow.svg
│ │ │ │ ├── invoices.json
│ │ │ │ ├── monthly-status.json
│ │ │ │ ├── news-and-reviews.json
│ │ │ │ ├── products.json
│ │ │ │ ├── releases.json
│ │ │ │ ├── tutorials
│ │ │ │ │ ├── datasource
│ │ │ │ │ │ └── api.ts
│ │ │ │ │ └── p2do
│ │ │ │ │ ├── api.ts
│ │ │ │ │ └── todo-logo.svg
│ │ │ │ └── xmlui.json
│ │ │ ├── github.svg
│ │ │ ├── images
│ │ │ │ ├── apiaction-tutorial
│ │ │ │ │ ├── add-success.png
│ │ │ │ │ ├── apiaction-param.png
│ │ │ │ │ ├── change-completed.png
│ │ │ │ │ ├── change-in-progress.png
│ │ │ │ │ ├── confirm-delete.png
│ │ │ │ │ ├── data-error.png
│ │ │ │ │ ├── data-progress.png
│ │ │ │ │ ├── data-success.png
│ │ │ │ │ ├── display-1.png
│ │ │ │ │ ├── item-deleted.png
│ │ │ │ │ ├── item-updated.png
│ │ │ │ │ ├── missing-api-key.png
│ │ │ │ │ ├── new-item-added.png
│ │ │ │ │ └── test-message.png
│ │ │ │ ├── chat-api
│ │ │ │ │ └── domain-model.svg
│ │ │ │ ├── components
│ │ │ │ │ ├── image
│ │ │ │ │ │ └── breakfast.jpg
│ │ │ │ │ ├── markdown
│ │ │ │ │ │ └── colors.png
│ │ │ │ │ └── modal
│ │ │ │ │ ├── deep_link_dialog_1.jpg
│ │ │ │ │ └── deep_link_dialog_2.jpg
│ │ │ │ ├── create-apps
│ │ │ │ │ ├── collapsed-vertical.png
│ │ │ │ │ ├── using-forms-warning-dialog.png
│ │ │ │ │ └── using-forms.png
│ │ │ │ ├── datasource-tutorial
│ │ │ │ │ ├── data-with-header.png
│ │ │ │ │ ├── filtered-data.png
│ │ │ │ │ ├── filtered-items.png
│ │ │ │ │ ├── initial-page-items.png
│ │ │ │ │ ├── list-items.png
│ │ │ │ │ ├── next-page-items.png
│ │ │ │ │ ├── no-data.png
│ │ │ │ │ ├── pagination-1.jpg
│ │ │ │ │ ├── pagination-1.png
│ │ │ │ │ ├── polling-1.png
│ │ │ │ │ ├── refetch-data.png
│ │ │ │ │ ├── slow-loading.png
│ │ │ │ │ ├── test-message.png
│ │ │ │ │ ├── Thumbs.db
│ │ │ │ │ ├── unconventional-data.png
│ │ │ │ │ └── unfiltered-items.png
│ │ │ │ ├── flower.jpg
│ │ │ │ ├── get-started
│ │ │ │ │ ├── add-new-contact.png
│ │ │ │ │ ├── app-modified.png
│ │ │ │ │ ├── app-start.png
│ │ │ │ │ ├── app-with-boxes.png
│ │ │ │ │ ├── app-with-toast.png
│ │ │ │ │ ├── boilerplate-structure.png
│ │ │ │ │ ├── cl-initial.png
│ │ │ │ │ ├── cl-start.png
│ │ │ │ │ ├── contact-counts.png
│ │ │ │ │ ├── contact-dialog-title.png
│ │ │ │ │ ├── contact-dialog.png
│ │ │ │ │ ├── contact-menus.png
│ │ │ │ │ ├── contact-predicates.png
│ │ │ │ │ ├── context-menu.png
│ │ │ │ │ ├── dashboard-numbers.png
│ │ │ │ │ ├── default-contact-list.png
│ │ │ │ │ ├── delete-contact.png
│ │ │ │ │ ├── delete-task.png
│ │ │ │ │ ├── detailed-template.png
│ │ │ │ │ ├── edit-contact-details.png
│ │ │ │ │ ├── edited-contact-saved.png
│ │ │ │ │ ├── empty-sections.png
│ │ │ │ │ ├── filter-completed.png
│ │ │ │ │ ├── fullwidth-desktop.png
│ │ │ │ │ ├── fullwidth-mobile.png
│ │ │ │ │ ├── initial-table.png
│ │ │ │ │ ├── items-and-badges.png
│ │ │ │ │ ├── loading-message.png
│ │ │ │ │ ├── new-contact-button.png
│ │ │ │ │ ├── new-contact-saved.png
│ │ │ │ │ ├── no-empty-sections.png
│ │ │ │ │ ├── personal-todo-initial.png
│ │ │ │ │ ├── piechart.png
│ │ │ │ │ ├── review-today.png
│ │ │ │ │ ├── rudimentary-dashboard.png
│ │ │ │ │ ├── section-collapsed.png
│ │ │ │ │ ├── sectioned-items.png
│ │ │ │ │ ├── sections-ordered.png
│ │ │ │ │ ├── spacex-list-with-links.png
│ │ │ │ │ ├── spacex-list.png
│ │ │ │ │ ├── start-personal-todo-1.png
│ │ │ │ │ ├── submit-new-contact.png
│ │ │ │ │ ├── submit-new-task.png
│ │ │ │ │ ├── syntax-highlighting.png
│ │ │ │ │ ├── table-with-badge.png
│ │ │ │ │ ├── template-with-card.png
│ │ │ │ │ ├── test-emulated-api.png
│ │ │ │ │ ├── Thumbs.db
│ │ │ │ │ ├── todo-logo.png
│ │ │ │ │ └── xmlui-tools.png
│ │ │ │ ├── HelloApp.png
│ │ │ │ ├── HelloApp2.png
│ │ │ │ ├── logos
│ │ │ │ │ ├── xmlui1.svg
│ │ │ │ │ ├── xmlui2.svg
│ │ │ │ │ ├── xmlui3.svg
│ │ │ │ │ ├── xmlui4.svg
│ │ │ │ │ ├── xmlui5.svg
│ │ │ │ │ ├── xmlui6.svg
│ │ │ │ │ └── xmlui7.svg
│ │ │ │ ├── pdf
│ │ │ │ │ └── dummy-pdf.jpg
│ │ │ │ ├── rendering-engine
│ │ │ │ │ ├── AppEngine-flow.svg
│ │ │ │ │ ├── Component.svg
│ │ │ │ │ ├── CompoundComponent.svg
│ │ │ │ │ ├── RootComponent.svg
│ │ │ │ │ └── tree-with-containers.svg
│ │ │ │ ├── reviewers-guide
│ │ │ │ │ ├── AppEngine-flow.svg
│ │ │ │ │ └── incbutton-in-action.png
│ │ │ │ ├── tools
│ │ │ │ │ └── boilerplate-structure.png
│ │ │ │ ├── try.svg
│ │ │ │ ├── tutorial
│ │ │ │ │ ├── app-chat-history.png
│ │ │ │ │ ├── app-content-placeholder.png
│ │ │ │ │ ├── app-header-and-content.png
│ │ │ │ │ ├── app-links-channel-selected.png
│ │ │ │ │ ├── app-links-click.png
│ │ │ │ │ ├── app-navigation.png
│ │ │ │ │ ├── finished-ex01.png
│ │ │ │ │ ├── finished-ex02.png
│ │ │ │ │ ├── hello.png
│ │ │ │ │ ├── splash-screen-advanced.png
│ │ │ │ │ ├── splash-screen-after-click.png
│ │ │ │ │ ├── splash-screen-centered.png
│ │ │ │ │ ├── splash-screen-events.png
│ │ │ │ │ ├── splash-screen-expression.png
│ │ │ │ │ ├── splash-screen-reuse-after.png
│ │ │ │ │ ├── splash-screen-reuse-before.png
│ │ │ │ │ └── splash-screen.png
│ │ │ │ └── tutorial-01.png
│ │ │ ├── llms.txt
│ │ │ ├── logo-dark.svg
│ │ │ ├── logo.svg
│ │ │ ├── pg-popout.svg
│ │ │ └── xmlui-logo.svg
│ │ ├── serve.json
│ │ └── web.config
│ ├── scripts
│ │ ├── download-latest-xmlui.js
│ │ ├── generate-rss.js
│ │ ├── get-releases.js
│ │ └── utils.js
│ ├── src
│ │ ├── components
│ │ │ ├── BlogOverview.xmlui
│ │ │ ├── BlogPage.xmlui
│ │ │ ├── Boxes.xmlui
│ │ │ ├── Breadcrumb.xmlui
│ │ │ ├── ChangeLog.xmlui
│ │ │ ├── ColorPalette.xmlui
│ │ │ ├── DocumentLinks.xmlui
│ │ │ ├── DocumentPage.xmlui
│ │ │ ├── DocumentPageNoTOC.xmlui
│ │ │ ├── Icons.xmlui
│ │ │ ├── IncButton.xmlui
│ │ │ ├── IncButton2.xmlui
│ │ │ ├── NameValue.xmlui
│ │ │ ├── PageNotFound.xmlui
│ │ │ ├── PaletteItem.xmlui
│ │ │ ├── Palettes.xmlui
│ │ │ ├── SectionHeader.xmlui
│ │ │ ├── TBD.xmlui
│ │ │ ├── Test.xmlui
│ │ │ ├── ThemesIntro.xmlui
│ │ │ ├── ThousandThemes.xmlui
│ │ │ ├── TubeStops.xmlui
│ │ │ ├── TubeStops.xmlui.xs
│ │ │ └── TwoColumnCode.xmlui
│ │ ├── config.ts
│ │ ├── Main.xmlui
│ │ └── themes
│ │ ├── docs-theme.ts
│ │ ├── earthtone.ts
│ │ ├── xmlui-gray-on-default.ts
│ │ ├── xmlui-green-on-default.ts
│ │ └── xmlui-orange-on-default.ts
│ └── tsconfig.json
├── LICENSE
├── package-lock.json
├── package.json
├── packages
│ ├── tsconfig.json
│ ├── xmlui-animations
│ │ ├── .gitignore
│ │ ├── CHANGELOG.md
│ │ ├── demo
│ │ │ └── Main.xmlui
│ │ ├── index.html
│ │ ├── index.ts
│ │ ├── meta
│ │ │ └── componentsMetadata.ts
│ │ ├── package.json
│ │ └── src
│ │ ├── Animation.tsx
│ │ ├── AnimationNative.tsx
│ │ ├── FadeAnimation.tsx
│ │ ├── FadeInAnimation.tsx
│ │ ├── FadeOutAnimation.tsx
│ │ ├── index.tsx
│ │ ├── ScaleAnimation.tsx
│ │ └── SlideInAnimation.tsx
│ ├── xmlui-devtools
│ │ ├── .gitignore
│ │ ├── CHANGELOG.md
│ │ ├── demo
│ │ │ └── Main.xmlui
│ │ ├── index.html
│ │ ├── index.ts
│ │ ├── meta
│ │ │ └── componentsMetadata.ts
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── devtools
│ │ │ │ ├── DevTools.tsx
│ │ │ │ ├── DevToolsNative.module.scss
│ │ │ │ ├── DevToolsNative.tsx
│ │ │ │ ├── ModalDialog.module.scss
│ │ │ │ ├── ModalDialog.tsx
│ │ │ │ ├── ModalVisibilityContext.tsx
│ │ │ │ ├── Tooltip.module.scss
│ │ │ │ ├── Tooltip.tsx
│ │ │ │ └── utils.ts
│ │ │ ├── editor
│ │ │ │ └── Editor.tsx
│ │ │ └── index.tsx
│ │ └── vite.config-overrides.ts
│ ├── xmlui-hello-world
│ │ ├── .gitignore
│ │ ├── index.ts
│ │ ├── meta
│ │ │ └── componentsMetadata.ts
│ │ ├── package.json
│ │ └── src
│ │ ├── HelloWorld.module.scss
│ │ ├── HelloWorld.tsx
│ │ ├── HelloWorldNative.tsx
│ │ └── index.tsx
│ ├── xmlui-os-frames
│ │ ├── .gitignore
│ │ ├── demo
│ │ │ └── Main.xmlui
│ │ ├── index.html
│ │ ├── index.ts
│ │ ├── meta
│ │ │ └── componentsMetadata.ts
│ │ ├── package.json
│ │ └── src
│ │ ├── index.tsx
│ │ ├── IPhoneFrame.module.scss
│ │ ├── IPhoneFrame.tsx
│ │ ├── MacOSAppFrame.module.scss
│ │ ├── MacOSAppFrame.tsx
│ │ ├── WindowsAppFrame.module.scss
│ │ └── WindowsAppFrame.tsx
│ ├── xmlui-pdf
│ │ ├── .gitignore
│ │ ├── CHANGELOG.md
│ │ ├── demo
│ │ │ ├── components
│ │ │ │ └── Pdf.xmlui
│ │ │ └── Main.xmlui
│ │ ├── index.html
│ │ ├── index.ts
│ │ ├── meta
│ │ │ └── componentsMetadata.ts
│ │ ├── package.json
│ │ └── src
│ │ ├── index.tsx
│ │ ├── LazyPdfNative.tsx
│ │ ├── Pdf.module.scss
│ │ └── Pdf.tsx
│ ├── xmlui-playground
│ │ ├── .gitignore
│ │ ├── CHANGELOG.md
│ │ ├── demo
│ │ │ └── Main.xmlui
│ │ ├── index.html
│ │ ├── index.ts
│ │ ├── meta
│ │ │ └── componentsMetadata.ts
│ │ ├── package.json
│ │ └── src
│ │ ├── hooks
│ │ │ ├── usePlayground.ts
│ │ │ └── useToast.ts
│ │ ├── index.tsx
│ │ ├── playground
│ │ │ ├── Box.module.scss
│ │ │ ├── Box.tsx
│ │ │ ├── CodeSelector.tsx
│ │ │ ├── ConfirmationDialog.module.scss
│ │ │ ├── ConfirmationDialog.tsx
│ │ │ ├── Editor.tsx
│ │ │ ├── Header.module.scss
│ │ │ ├── Header.tsx
│ │ │ ├── Playground.tsx
│ │ │ ├── PlaygroundContent.module.scss
│ │ │ ├── PlaygroundContent.tsx
│ │ │ ├── PlaygroundNative.module.scss
│ │ │ ├── PlaygroundNative.tsx
│ │ │ ├── Preview.module.scss
│ │ │ ├── Preview.tsx
│ │ │ ├── Select.module.scss
│ │ │ ├── StandalonePlayground.tsx
│ │ │ ├── StandalonePlaygroundNative.module.scss
│ │ │ ├── StandalonePlaygroundNative.tsx
│ │ │ ├── ThemeSwitcher.module.scss
│ │ │ ├── ThemeSwitcher.tsx
│ │ │ ├── ToneSwitcher.tsx
│ │ │ ├── Tooltip.module.scss
│ │ │ ├── Tooltip.tsx
│ │ │ └── utils.ts
│ │ ├── providers
│ │ │ ├── Toast.module.scss
│ │ │ └── ToastProvider.tsx
│ │ ├── state
│ │ │ └── store.ts
│ │ ├── themes
│ │ │ └── theme.ts
│ │ └── utils
│ │ └── helpers.ts
│ ├── xmlui-search
│ │ ├── .gitignore
│ │ ├── CHANGELOG.md
│ │ ├── demo
│ │ │ └── Main.xmlui
│ │ ├── index.html
│ │ ├── index.ts
│ │ ├── meta
│ │ │ └── componentsMetadata.ts
│ │ ├── package.json
│ │ └── src
│ │ ├── index.tsx
│ │ ├── Search.module.scss
│ │ └── Search.tsx
│ ├── xmlui-spreadsheet
│ │ ├── .gitignore
│ │ ├── demo
│ │ │ └── Main.xmlui
│ │ ├── index.html
│ │ ├── index.ts
│ │ ├── meta
│ │ │ └── componentsMetadata.ts
│ │ ├── package.json
│ │ └── src
│ │ ├── index.tsx
│ │ ├── Spreadsheet.tsx
│ │ └── SpreadsheetNative.tsx
│ └── xmlui-website-blocks
│ ├── .gitignore
│ ├── CHANGELOG.md
│ ├── demo
│ │ ├── components
│ │ │ ├── HeroBackgroundBreakoutPage.xmlui
│ │ │ ├── HeroBackgroundsPage.xmlui
│ │ │ ├── HeroContentsPage.xmlui
│ │ │ ├── HeroTextAlignPage.xmlui
│ │ │ ├── HeroTextPage.xmlui
│ │ │ └── HeroTonesPage.xmlui
│ │ ├── Main.xmlui
│ │ └── themes
│ │ └── default.ts
│ ├── index.html
│ ├── index.ts
│ ├── meta
│ │ └── componentsMetadata.ts
│ ├── package.json
│ ├── public
│ │ └── resources
│ │ ├── building.jpg
│ │ └── xmlui-logo.svg
│ └── src
│ ├── Carousel
│ │ ├── Carousel.module.scss
│ │ ├── Carousel.tsx
│ │ ├── CarouselContext.tsx
│ │ └── CarouselNative.tsx
│ ├── FancyButton
│ │ ├── FancyButton.module.scss
│ │ ├── FancyButton.tsx
│ │ └── FancyButton.xmlui
│ ├── Hello
│ │ ├── Hello.tsx
│ │ ├── Hello.xmlui
│ │ └── Hello.xmlui.xs
│ ├── HeroSection
│ │ ├── HeroSection.module.scss
│ │ ├── HeroSection.spec.ts
│ │ ├── HeroSection.tsx
│ │ └── HeroSectionNative.tsx
│ ├── index.tsx
│ ├── ScrollToTop
│ │ ├── ScrollToTop.module.scss
│ │ ├── ScrollToTop.tsx
│ │ └── ScrollToTopNative.tsx
│ └── vite-env.d.ts
├── playwright.config.ts
├── README.md
├── tools
│ ├── codefence
│ │ └── xmlui-code-fence-docs.md
│ ├── create-app
│ │ ├── .gitignore
│ │ ├── CHANGELOG.md
│ │ ├── create-app.ts
│ │ ├── helpers
│ │ │ ├── copy.ts
│ │ │ ├── get-pkg-manager.ts
│ │ │ ├── git.ts
│ │ │ ├── install.ts
│ │ │ ├── is-folder-empty.ts
│ │ │ ├── is-writeable.ts
│ │ │ ├── make-dir.ts
│ │ │ └── validate-pkg.ts
│ │ ├── index.ts
│ │ ├── package.json
│ │ ├── templates
│ │ │ ├── default
│ │ │ │ └── ts
│ │ │ │ ├── gitignore
│ │ │ │ ├── index.html
│ │ │ │ ├── index.ts
│ │ │ │ ├── public
│ │ │ │ │ ├── mockServiceWorker.js
│ │ │ │ │ ├── resources
│ │ │ │ │ │ ├── favicon.ico
│ │ │ │ │ │ └── xmlui-logo.svg
│ │ │ │ │ └── serve.json
│ │ │ │ └── src
│ │ │ │ ├── components
│ │ │ │ │ ├── ApiAware.xmlui
│ │ │ │ │ ├── Home.xmlui
│ │ │ │ │ ├── IncButton.xmlui
│ │ │ │ │ └── PagePanel.xmlui
│ │ │ │ ├── config.ts
│ │ │ │ └── Main.xmlui
│ │ │ ├── index.ts
│ │ │ └── types.ts
│ │ └── tsconfig.json
│ ├── create-xmlui-hello-world
│ │ ├── index.js
│ │ └── package.json
│ └── vscode
│ ├── .gitignore
│ ├── .vscode
│ │ ├── launch.json
│ │ └── tasks.json
│ ├── .vscodeignore
│ ├── build.sh
│ ├── CHANGELOG.md
│ ├── esbuild.js
│ ├── eslint.config.mjs
│ ├── formatter-docs.md
│ ├── generate-test-sample.sh
│ ├── LICENSE.md
│ ├── package-lock.json
│ ├── package.json
│ ├── README.md
│ ├── resources
│ │ ├── xmlui-logo.png
│ │ └── xmlui-markup-syntax-highlighting.png
│ ├── src
│ │ ├── extension.ts
│ │ └── server.ts
│ ├── syntaxes
│ │ └── xmlui.tmLanguage.json
│ ├── test-samples
│ │ └── sample.xmlui
│ ├── tsconfig.json
│ └── tsconfig.tsbuildinfo
├── turbo.json
└── xmlui
├── .gitignore
├── bin
│ ├── bootstrap.cjs
│ ├── bootstrap.js
│ ├── build-lib.ts
│ ├── build.ts
│ ├── index.ts
│ ├── preview.ts
│ ├── start.ts
│ ├── vite-xmlui-plugin.ts
│ └── viteConfig.ts
├── CHANGELOG.md
├── conventions
│ ├── component-qa-checklist.md
│ ├── copilot-conventions.md
│ ├── create-xmlui-components.md
│ ├── mermaid.md
│ ├── testing-conventions.md
│ └── xmlui-in-a-nutshell.md
├── dev-docs
│ ├── accessibility.md
│ ├── build-system.md
│ ├── build-xmlui.md
│ ├── component-behaviors.md
│ ├── components-with-options.md
│ ├── containers.md
│ ├── data-operations.md
│ ├── glossary.md
│ ├── index.md
│ ├── next
│ │ ├── component-dev-guide.md
│ │ ├── configuration-management-enhancement-summary.md
│ │ ├── documentation-scripts-refactoring-complete-summary.md
│ │ ├── documentation-scripts-refactoring-plan.md
│ │ ├── duplicate-pattern-extraction-summary.md
│ │ ├── error-handling-standardization-summary.md
│ │ ├── generating-component-reference.md
│ │ ├── index.md
│ │ ├── logging-consistency-implementation-summary.md
│ │ ├── project-build.md
│ │ ├── project-structure.md
│ │ ├── theme-context.md
│ │ ├── tiptap-design-considerations.md
│ │ ├── working-with-code.md
│ │ ├── xmlui-runtime-architecture
│ │ └── xmlui-wcag-accessibility-report.md
│ ├── react-fundamentals.md
│ ├── release-method.md
│ ├── standalone-app.md
│ ├── ud-components.md
│ └── xmlui-repo.md
├── package.json
├── scripts
│ ├── coverage-only.js
│ ├── e2e-test-summary.js
│ ├── generate-docs
│ │ ├── build-downloads-map.mjs
│ │ ├── build-pages-map.mjs
│ │ ├── components-config.json
│ │ ├── configuration-management.mjs
│ │ ├── constants.mjs
│ │ ├── create-theme-files.mjs
│ │ ├── DocsGenerator.mjs
│ │ ├── error-handling.mjs
│ │ ├── extensions-config.json
│ │ ├── folders.mjs
│ │ ├── generate-summary-files.mjs
│ │ ├── get-docs.mjs
│ │ ├── input-handler.mjs
│ │ ├── logger.mjs
│ │ ├── logging-standards.mjs
│ │ ├── MetadataProcessor.mjs
│ │ ├── pattern-utilities.mjs
│ │ └── utils.mjs
│ ├── get-langserver-metadata.js
│ ├── inline-links.mjs
│ └── README-e2e-summary.md
├── src
│ ├── abstractions
│ │ ├── _conventions.md
│ │ ├── ActionDefs.ts
│ │ ├── AppContextDefs.ts
│ │ ├── ComponentDefs.ts
│ │ ├── ContainerDefs.ts
│ │ ├── ExtensionDefs.ts
│ │ ├── FunctionDefs.ts
│ │ ├── RendererDefs.ts
│ │ ├── scripting
│ │ │ ├── BlockScope.ts
│ │ │ ├── Compilation.ts
│ │ │ ├── LogicalThread.ts
│ │ │ ├── LoopScope.ts
│ │ │ ├── modules.ts
│ │ │ ├── ScriptParserError.ts
│ │ │ ├── Token.ts
│ │ │ ├── TryScope.ts
│ │ │ └── TryScopeExp.ts
│ │ └── ThemingDefs.ts
│ ├── components
│ │ ├── _conventions.md
│ │ ├── abstractions.ts
│ │ ├── Accordion
│ │ │ ├── Accordion.md
│ │ │ ├── Accordion.module.scss
│ │ │ ├── Accordion.spec.ts
│ │ │ ├── Accordion.tsx
│ │ │ ├── AccordionContext.tsx
│ │ │ ├── AccordionItem.tsx
│ │ │ ├── AccordionItemNative.tsx
│ │ │ └── AccordionNative.tsx
│ │ ├── Animation
│ │ │ └── AnimationNative.tsx
│ │ ├── APICall
│ │ │ ├── APICall.md
│ │ │ ├── APICall.spec.ts
│ │ │ ├── APICall.tsx
│ │ │ └── APICallNative.tsx
│ │ ├── App
│ │ │ ├── App.md
│ │ │ ├── App.module.scss
│ │ │ ├── App.spec.ts
│ │ │ ├── App.tsx
│ │ │ ├── AppLayoutContext.ts
│ │ │ ├── AppNative.tsx
│ │ │ ├── AppStateContext.ts
│ │ │ ├── doc-resources
│ │ │ │ ├── condensed-sticky.xmlui
│ │ │ │ ├── condensed.xmlui
│ │ │ │ ├── horizontal-sticky.xmlui
│ │ │ │ ├── horizontal.xmlui
│ │ │ │ ├── vertical-full-header.xmlui
│ │ │ │ ├── vertical-sticky.xmlui
│ │ │ │ └── vertical.xmlui
│ │ │ ├── IndexerContext.ts
│ │ │ ├── LinkInfoContext.ts
│ │ │ ├── SearchContext.tsx
│ │ │ ├── Sheet.module.scss
│ │ │ └── Sheet.tsx
│ │ ├── AppHeader
│ │ │ ├── AppHeader.md
│ │ │ ├── AppHeader.module.scss
│ │ │ ├── AppHeader.spec.ts
│ │ │ ├── AppHeader.tsx
│ │ │ └── AppHeaderNative.tsx
│ │ ├── AppState
│ │ │ ├── AppState.md
│ │ │ ├── AppState.spec.ts
│ │ │ ├── AppState.tsx
│ │ │ └── AppStateNative.tsx
│ │ ├── AutoComplete
│ │ │ ├── AutoComplete.md
│ │ │ ├── AutoComplete.module.scss
│ │ │ ├── AutoComplete.spec.ts
│ │ │ ├── AutoComplete.tsx
│ │ │ ├── AutoCompleteContext.tsx
│ │ │ └── AutoCompleteNative.tsx
│ │ ├── Avatar
│ │ │ ├── Avatar.md
│ │ │ ├── Avatar.module.scss
│ │ │ ├── Avatar.spec.ts
│ │ │ ├── Avatar.tsx
│ │ │ └── AvatarNative.tsx
│ │ ├── Backdrop
│ │ │ ├── Backdrop.md
│ │ │ ├── Backdrop.module.scss
│ │ │ ├── Backdrop.spec.ts
│ │ │ ├── Backdrop.tsx
│ │ │ └── BackdropNative.tsx
│ │ ├── Badge
│ │ │ ├── Badge.md
│ │ │ ├── Badge.module.scss
│ │ │ ├── Badge.spec.ts
│ │ │ ├── Badge.tsx
│ │ │ └── BadgeNative.tsx
│ │ ├── Bookmark
│ │ │ ├── Bookmark.md
│ │ │ ├── Bookmark.module.scss
│ │ │ ├── Bookmark.spec.ts
│ │ │ ├── Bookmark.tsx
│ │ │ └── BookmarkNative.tsx
│ │ ├── Breakout
│ │ │ ├── Breakout.module.scss
│ │ │ ├── Breakout.spec.ts
│ │ │ ├── Breakout.tsx
│ │ │ └── BreakoutNative.tsx
│ │ ├── Button
│ │ │ ├── Button-style.spec.ts
│ │ │ ├── Button.md
│ │ │ ├── Button.module.scss
│ │ │ ├── Button.spec.ts
│ │ │ ├── Button.tsx
│ │ │ └── ButtonNative.tsx
│ │ ├── Card
│ │ │ ├── Card.md
│ │ │ ├── Card.module.scss
│ │ │ ├── Card.spec.ts
│ │ │ ├── Card.tsx
│ │ │ └── CardNative.tsx
│ │ ├── Carousel
│ │ │ ├── Carousel.md
│ │ │ ├── Carousel.module.scss
│ │ │ ├── Carousel.spec.ts
│ │ │ ├── Carousel.tsx
│ │ │ ├── CarouselContext.tsx
│ │ │ ├── CarouselItem.tsx
│ │ │ ├── CarouselItemNative.tsx
│ │ │ └── CarouselNative.tsx
│ │ ├── ChangeListener
│ │ │ ├── ChangeListener.md
│ │ │ ├── ChangeListener.spec.ts
│ │ │ ├── ChangeListener.tsx
│ │ │ └── ChangeListenerNative.tsx
│ │ ├── chart-color-schemes.ts
│ │ ├── Charts
│ │ │ ├── AreaChart
│ │ │ │ ├── AreaChart.md
│ │ │ │ ├── AreaChart.spec.ts
│ │ │ │ ├── AreaChart.tsx
│ │ │ │ └── AreaChartNative.tsx
│ │ │ ├── BarChart
│ │ │ │ ├── BarChart.md
│ │ │ │ ├── BarChart.module.scss
│ │ │ │ ├── BarChart.spec.ts
│ │ │ │ ├── BarChart.tsx
│ │ │ │ └── BarChartNative.tsx
│ │ │ ├── DonutChart
│ │ │ │ ├── DonutChart.spec.ts
│ │ │ │ └── DonutChart.tsx
│ │ │ ├── LabelList
│ │ │ │ ├── LabelList.spec.ts
│ │ │ │ ├── LabelList.tsx
│ │ │ │ ├── LabelListNative.module.scss
│ │ │ │ └── LabelListNative.tsx
│ │ │ ├── Legend
│ │ │ │ ├── Legend.spec.ts
│ │ │ │ ├── Legend.tsx
│ │ │ │ └── LegendNative.tsx
│ │ │ ├── LineChart
│ │ │ │ ├── LineChart.md
│ │ │ │ ├── LineChart.module.scss
│ │ │ │ ├── LineChart.spec.ts
│ │ │ │ ├── LineChart.tsx
│ │ │ │ └── LineChartNative.tsx
│ │ │ ├── PieChart
│ │ │ │ ├── PieChart.md
│ │ │ │ ├── PieChart.spec.ts
│ │ │ │ ├── PieChart.tsx
│ │ │ │ ├── PieChartNative.module.scss
│ │ │ │ └── PieChartNative.tsx
│ │ │ ├── RadarChart
│ │ │ │ ├── RadarChart.md
│ │ │ │ ├── RadarChart.spec.ts
│ │ │ │ ├── RadarChart.tsx
│ │ │ │ └── RadarChartNative.tsx
│ │ │ ├── Tooltip
│ │ │ │ ├── TooltipContent.module.scss
│ │ │ │ ├── TooltipContent.spec.ts
│ │ │ │ └── TooltipContent.tsx
│ │ │ └── utils
│ │ │ ├── abstractions.ts
│ │ │ └── ChartProvider.tsx
│ │ ├── Checkbox
│ │ │ ├── Checkbox.md
│ │ │ ├── Checkbox.spec.ts
│ │ │ └── Checkbox.tsx
│ │ ├── CodeBlock
│ │ │ ├── CodeBlock.module.scss
│ │ │ ├── CodeBlock.spec.ts
│ │ │ ├── CodeBlock.tsx
│ │ │ ├── CodeBlockNative.tsx
│ │ │ └── highlight-code.ts
│ │ ├── collectedComponentMetadata.ts
│ │ ├── ColorPicker
│ │ │ ├── ColorPicker.md
│ │ │ ├── ColorPicker.module.scss
│ │ │ ├── ColorPicker.spec.ts
│ │ │ ├── ColorPicker.tsx
│ │ │ └── ColorPickerNative.tsx
│ │ ├── Column
│ │ │ ├── Column.md
│ │ │ ├── Column.tsx
│ │ │ ├── ColumnNative.tsx
│ │ │ ├── doc-resources
│ │ │ │ └── list-component-data.js
│ │ │ └── TableContext.tsx
│ │ ├── component-utils.ts
│ │ ├── ComponentProvider.tsx
│ │ ├── ComponentRegistryContext.tsx
│ │ ├── container-helpers.tsx
│ │ ├── ContentSeparator
│ │ │ ├── ContentSeparator.md
│ │ │ ├── ContentSeparator.module.scss
│ │ │ ├── ContentSeparator.spec.ts
│ │ │ ├── ContentSeparator.tsx
│ │ │ └── ContentSeparatorNative.tsx
│ │ ├── DataSource
│ │ │ ├── DataSource.md
│ │ │ └── DataSource.tsx
│ │ ├── DateInput
│ │ │ ├── DateInput.md
│ │ │ ├── DateInput.module.scss
│ │ │ ├── DateInput.spec.ts
│ │ │ ├── DateInput.tsx
│ │ │ └── DateInputNative.tsx
│ │ ├── DatePicker
│ │ │ ├── DatePicker.md
│ │ │ ├── DatePicker.module.scss
│ │ │ ├── DatePicker.spec.ts
│ │ │ ├── DatePicker.tsx
│ │ │ └── DatePickerNative.tsx
│ │ ├── DropdownMenu
│ │ │ ├── DropdownMenu.md
│ │ │ ├── DropdownMenu.module.scss
│ │ │ ├── DropdownMenu.spec.ts
│ │ │ ├── DropdownMenu.tsx
│ │ │ ├── DropdownMenuNative.tsx
│ │ │ ├── MenuItem.md
│ │ │ └── SubMenuItem.md
│ │ ├── EmojiSelector
│ │ │ ├── EmojiSelector.md
│ │ │ ├── EmojiSelector.spec.ts
│ │ │ ├── EmojiSelector.tsx
│ │ │ └── EmojiSelectorNative.tsx
│ │ ├── ExpandableItem
│ │ │ ├── ExpandableItem.module.scss
│ │ │ ├── ExpandableItem.spec.ts
│ │ │ ├── ExpandableItem.tsx
│ │ │ └── ExpandableItemNative.tsx
│ │ ├── FileInput
│ │ │ ├── FileInput.md
│ │ │ ├── FileInput.module.scss
│ │ │ ├── FileInput.spec.ts
│ │ │ ├── FileInput.tsx
│ │ │ └── FileInputNative.tsx
│ │ ├── FileUploadDropZone
│ │ │ ├── FileUploadDropZone.md
│ │ │ ├── FileUploadDropZone.module.scss
│ │ │ ├── FileUploadDropZone.spec.ts
│ │ │ ├── FileUploadDropZone.tsx
│ │ │ └── FileUploadDropZoneNative.tsx
│ │ ├── FlowLayout
│ │ │ ├── FlowLayout.md
│ │ │ ├── FlowLayout.module.scss
│ │ │ ├── FlowLayout.spec.ts
│ │ │ ├── FlowLayout.spec.ts-snapshots
│ │ │ │ └── Edge-cases-boxShadow-is-not-clipped-1-non-smoke-darwin.png
│ │ │ ├── FlowLayout.tsx
│ │ │ └── FlowLayoutNative.tsx
│ │ ├── Footer
│ │ │ ├── Footer.md
│ │ │ ├── Footer.module.scss
│ │ │ ├── Footer.spec.ts
│ │ │ ├── Footer.tsx
│ │ │ └── FooterNative.tsx
│ │ ├── Form
│ │ │ ├── Form.md
│ │ │ ├── Form.module.scss
│ │ │ ├── Form.spec.ts
│ │ │ ├── Form.tsx
│ │ │ ├── formActions.ts
│ │ │ ├── FormContext.ts
│ │ │ └── FormNative.tsx
│ │ ├── FormItem
│ │ │ ├── FormItem.md
│ │ │ ├── FormItem.module.scss
│ │ │ ├── FormItem.spec.ts
│ │ │ ├── FormItem.tsx
│ │ │ ├── FormItemNative.tsx
│ │ │ ├── HelperText.module.scss
│ │ │ ├── HelperText.tsx
│ │ │ ├── ItemWithLabel.tsx
│ │ │ └── Validations.ts
│ │ ├── FormSection
│ │ │ ├── FormSection.md
│ │ │ ├── FormSection.ts
│ │ │ └── FormSection.xmlui
│ │ ├── Fragment
│ │ │ ├── Fragment.spec.ts
│ │ │ └── Fragment.tsx
│ │ ├── Heading
│ │ │ ├── abstractions.ts
│ │ │ ├── H1.md
│ │ │ ├── H1.spec.ts
│ │ │ ├── H2.md
│ │ │ ├── H2.spec.ts
│ │ │ ├── H3.md
│ │ │ ├── H3.spec.ts
│ │ │ ├── H4.md
│ │ │ ├── H4.spec.ts
│ │ │ ├── H5.md
│ │ │ ├── H5.spec.ts
│ │ │ ├── H6.md
│ │ │ ├── H6.spec.ts
│ │ │ ├── Heading.md
│ │ │ ├── Heading.module.scss
│ │ │ ├── Heading.spec.ts
│ │ │ ├── Heading.tsx
│ │ │ └── HeadingNative.tsx
│ │ ├── HoverCard
│ │ │ ├── HoverCard.tsx
│ │ │ └── HovercardNative.tsx
│ │ ├── HtmlTags
│ │ │ ├── HtmlTags.module.scss
│ │ │ ├── HtmlTags.spec.ts
│ │ │ └── HtmlTags.tsx
│ │ ├── Icon
│ │ │ ├── AdmonitionDanger.tsx
│ │ │ ├── AdmonitionInfo.tsx
│ │ │ ├── AdmonitionNote.tsx
│ │ │ ├── AdmonitionTip.tsx
│ │ │ ├── AdmonitionWarning.tsx
│ │ │ ├── ApiIcon.tsx
│ │ │ ├── ArrowDropDown.module.scss
│ │ │ ├── ArrowDropDown.tsx
│ │ │ ├── ArrowDropUp.module.scss
│ │ │ ├── ArrowDropUp.tsx
│ │ │ ├── ArrowLeft.module.scss
│ │ │ ├── ArrowLeft.tsx
│ │ │ ├── ArrowRight.module.scss
│ │ │ ├── ArrowRight.tsx
│ │ │ ├── Attach.tsx
│ │ │ ├── Binding.module.scss
│ │ │ ├── Binding.tsx
│ │ │ ├── BoardIcon.tsx
│ │ │ ├── BoxIcon.tsx
│ │ │ ├── CheckIcon.tsx
│ │ │ ├── ChevronDownIcon.tsx
│ │ │ ├── ChevronLeft.tsx
│ │ │ ├── ChevronRight.tsx
│ │ │ ├── ChevronUpIcon.tsx
│ │ │ ├── CodeFileIcon.tsx
│ │ │ ├── CodeSandbox.tsx
│ │ │ ├── CompactListIcon.tsx
│ │ │ ├── ContentCopyIcon.tsx
│ │ │ ├── DarkToLightIcon.tsx
│ │ │ ├── DatabaseIcon.module.scss
│ │ │ ├── DatabaseIcon.tsx
│ │ │ ├── DocFileIcon.tsx
│ │ │ ├── DocIcon.tsx
│ │ │ ├── DotMenuHorizontalIcon.tsx
│ │ │ ├── DotMenuIcon.tsx
│ │ │ ├── EmailIcon.tsx
│ │ │ ├── EmptyFolderIcon.tsx
│ │ │ ├── ErrorIcon.tsx
│ │ │ ├── ExpressionIcon.tsx
│ │ │ ├── FillPlusCricleIcon.tsx
│ │ │ ├── FilterIcon.tsx
│ │ │ ├── FolderIcon.tsx
│ │ │ ├── GlobeIcon.tsx
│ │ │ ├── HomeIcon.tsx
│ │ │ ├── HyperLinkIcon.tsx
│ │ │ ├── Icon.md
│ │ │ ├── Icon.module.scss
│ │ │ ├── Icon.spec.ts
│ │ │ ├── Icon.tsx
│ │ │ ├── IconNative.tsx
│ │ │ ├── ImageFileIcon.tsx
│ │ │ ├── Inspect.tsx
│ │ │ ├── LightToDark.tsx
│ │ │ ├── LinkIcon.tsx
│ │ │ ├── ListIcon.tsx
│ │ │ ├── LooseListIcon.tsx
│ │ │ ├── MoonIcon.tsx
│ │ │ ├── MoreOptionsIcon.tsx
│ │ │ ├── NoSortIcon.tsx
│ │ │ ├── PDFIcon.tsx
│ │ │ ├── PenIcon.tsx
│ │ │ ├── PhoneIcon.tsx
│ │ │ ├── PhotoIcon.tsx
│ │ │ ├── PlusIcon.tsx
│ │ │ ├── SearchIcon.tsx
│ │ │ ├── ShareIcon.tsx
│ │ │ ├── SortAscendingIcon.tsx
│ │ │ ├── SortDescendingIcon.tsx
│ │ │ ├── StarsIcon.tsx
│ │ │ ├── SunIcon.tsx
│ │ │ ├── svg
│ │ │ │ ├── admonition_danger.svg
│ │ │ │ ├── admonition_info.svg
│ │ │ │ ├── admonition_note.svg
│ │ │ │ ├── admonition_tip.svg
│ │ │ │ ├── admonition_warning.svg
│ │ │ │ ├── api.svg
│ │ │ │ ├── arrow-dropdown.svg
│ │ │ │ ├── arrow-left.svg
│ │ │ │ ├── arrow-right.svg
│ │ │ │ ├── arrow-up.svg
│ │ │ │ ├── attach.svg
│ │ │ │ ├── binding.svg
│ │ │ │ ├── box.svg
│ │ │ │ ├── bulb.svg
│ │ │ │ ├── code-file.svg
│ │ │ │ ├── code-sandbox.svg
│ │ │ │ ├── dark_to_light.svg
│ │ │ │ ├── database.svg
│ │ │ │ ├── doc.svg
│ │ │ │ ├── empty-folder.svg
│ │ │ │ ├── expression.svg
│ │ │ │ ├── eye-closed.svg
│ │ │ │ ├── eye-dark.svg
│ │ │ │ ├── eye.svg
│ │ │ │ ├── file-text.svg
│ │ │ │ ├── filter.svg
│ │ │ │ ├── folder.svg
│ │ │ │ ├── img.svg
│ │ │ │ ├── inspect.svg
│ │ │ │ ├── light_to_dark.svg
│ │ │ │ ├── moon.svg
│ │ │ │ ├── pdf.svg
│ │ │ │ ├── photo.svg
│ │ │ │ ├── share.svg
│ │ │ │ ├── stars.svg
│ │ │ │ ├── sun.svg
│ │ │ │ ├── trending-down.svg
│ │ │ │ ├── trending-level.svg
│ │ │ │ ├── trending-up.svg
│ │ │ │ ├── txt.svg
│ │ │ │ ├── unknown-file.svg
│ │ │ │ ├── unlink.svg
│ │ │ │ └── xls.svg
│ │ │ ├── TableDeleteColumnIcon.tsx
│ │ │ ├── TableDeleteRowIcon.tsx
│ │ │ ├── TableInsertColumnIcon.tsx
│ │ │ ├── TableInsertRowIcon.tsx
│ │ │ ├── TrashIcon.tsx
│ │ │ ├── TrendingDownIcon.tsx
│ │ │ ├── TrendingLevelIcon.tsx
│ │ │ ├── TrendingUpIcon.tsx
│ │ │ ├── TxtIcon.tsx
│ │ │ ├── UnknownFileIcon.tsx
│ │ │ ├── UnlinkIcon.tsx
│ │ │ ├── UserIcon.tsx
│ │ │ ├── WarningIcon.tsx
│ │ │ └── XlsIcon.tsx
│ │ ├── IconProvider.tsx
│ │ ├── IconRegistryContext.tsx
│ │ ├── IFrame
│ │ │ ├── IFrame.md
│ │ │ ├── IFrame.module.scss
│ │ │ ├── IFrame.spec.ts
│ │ │ ├── IFrame.tsx
│ │ │ └── IFrameNative.tsx
│ │ ├── Image
│ │ │ ├── Image.md
│ │ │ ├── Image.module.scss
│ │ │ ├── Image.spec.ts
│ │ │ ├── Image.tsx
│ │ │ └── ImageNative.tsx
│ │ ├── Input
│ │ │ ├── index.ts
│ │ │ ├── InputAdornment.module.scss
│ │ │ ├── InputAdornment.tsx
│ │ │ ├── InputDivider.module.scss
│ │ │ ├── InputDivider.tsx
│ │ │ ├── InputLabel.module.scss
│ │ │ ├── InputLabel.tsx
│ │ │ ├── PartialInput.module.scss
│ │ │ └── PartialInput.tsx
│ │ ├── InspectButton
│ │ │ ├── InspectButton.module.scss
│ │ │ └── InspectButton.tsx
│ │ ├── Items
│ │ │ ├── Items.md
│ │ │ ├── Items.spec.ts
│ │ │ ├── Items.tsx
│ │ │ └── ItemsNative.tsx
│ │ ├── Link
│ │ │ ├── Link.md
│ │ │ ├── Link.module.scss
│ │ │ ├── Link.spec.ts
│ │ │ ├── Link.tsx
│ │ │ └── LinkNative.tsx
│ │ ├── List
│ │ │ ├── doc-resources
│ │ │ │ └── list-component-data.js
│ │ │ ├── List.md
│ │ │ ├── List.module.scss
│ │ │ ├── List.spec.ts
│ │ │ ├── List.tsx
│ │ │ └── ListNative.tsx
│ │ ├── Logo
│ │ │ ├── doc-resources
│ │ │ │ └── xmlui-logo.svg
│ │ │ ├── Logo.md
│ │ │ ├── Logo.tsx
│ │ │ └── LogoNative.tsx
│ │ ├── Markdown
│ │ │ ├── CodeText.module.scss
│ │ │ ├── CodeText.tsx
│ │ │ ├── Markdown.md
│ │ │ ├── Markdown.module.scss
│ │ │ ├── Markdown.spec.ts
│ │ │ ├── Markdown.tsx
│ │ │ ├── MarkdownNative.tsx
│ │ │ ├── parse-binding-expr.ts
│ │ │ └── utils.ts
│ │ ├── metadata-helpers.ts
│ │ ├── ModalDialog
│ │ │ ├── ConfirmationModalContextProvider.tsx
│ │ │ ├── Dialog.module.scss
│ │ │ ├── Dialog.tsx
│ │ │ ├── ModalDialog.md
│ │ │ ├── ModalDialog.module.scss
│ │ │ ├── ModalDialog.spec.ts
│ │ │ ├── ModalDialog.tsx
│ │ │ ├── ModalDialogNative.tsx
│ │ │ └── ModalVisibilityContext.tsx
│ │ ├── NavGroup
│ │ │ ├── NavGroup.md
│ │ │ ├── NavGroup.module.scss
│ │ │ ├── NavGroup.spec.ts
│ │ │ ├── NavGroup.tsx
│ │ │ ├── NavGroupContext.ts
│ │ │ └── NavGroupNative.tsx
│ │ ├── NavLink
│ │ │ ├── NavLink.md
│ │ │ ├── NavLink.module.scss
│ │ │ ├── NavLink.spec.ts
│ │ │ ├── NavLink.tsx
│ │ │ └── NavLinkNative.tsx
│ │ ├── NavPanel
│ │ │ ├── NavPanel.md
│ │ │ ├── NavPanel.module.scss
│ │ │ ├── NavPanel.spec.ts
│ │ │ ├── NavPanel.tsx
│ │ │ └── NavPanelNative.tsx
│ │ ├── NestedApp
│ │ │ ├── AppWithCodeView.module.scss
│ │ │ ├── AppWithCodeView.tsx
│ │ │ ├── AppWithCodeViewNative.tsx
│ │ │ ├── defaultProps.tsx
│ │ │ ├── logo.svg
│ │ │ ├── NestedApp.module.scss
│ │ │ ├── NestedApp.tsx
│ │ │ ├── NestedAppNative.tsx
│ │ │ ├── Tooltip.module.scss
│ │ │ ├── Tooltip.tsx
│ │ │ └── utils.ts
│ │ ├── NoResult
│ │ │ ├── NoResult.md
│ │ │ ├── NoResult.module.scss
│ │ │ ├── NoResult.spec.ts
│ │ │ ├── NoResult.tsx
│ │ │ └── NoResultNative.tsx
│ │ ├── NumberBox
│ │ │ ├── numberbox-abstractions.ts
│ │ │ ├── NumberBox.md
│ │ │ ├── NumberBox.module.scss
│ │ │ ├── NumberBox.spec.ts
│ │ │ ├── NumberBox.tsx
│ │ │ └── NumberBoxNative.tsx
│ │ ├── Option
│ │ │ ├── Option.md
│ │ │ ├── Option.spec.ts
│ │ │ ├── Option.tsx
│ │ │ ├── OptionNative.tsx
│ │ │ └── OptionTypeProvider.tsx
│ │ ├── PageMetaTitle
│ │ │ ├── PageMetaTilteNative.tsx
│ │ │ ├── PageMetaTitle.md
│ │ │ ├── PageMetaTitle.spec.ts
│ │ │ └── PageMetaTitle.tsx
│ │ ├── Pages
│ │ │ ├── Page.md
│ │ │ ├── Pages.md
│ │ │ ├── Pages.module.scss
│ │ │ ├── Pages.tsx
│ │ │ └── PagesNative.tsx
│ │ ├── Pagination
│ │ │ ├── Pagination.md
│ │ │ ├── Pagination.module.scss
│ │ │ ├── Pagination.spec.ts
│ │ │ ├── Pagination.tsx
│ │ │ └── PaginationNative.tsx
│ │ ├── PositionedContainer
│ │ │ ├── PositionedContainer.module.scss
│ │ │ ├── PositionedContainer.tsx
│ │ │ └── PositionedContainerNative.tsx
│ │ ├── ProfileMenu
│ │ │ ├── ProfileMenu.module.scss
│ │ │ └── ProfileMenu.tsx
│ │ ├── ProgressBar
│ │ │ ├── ProgressBar.md
│ │ │ ├── ProgressBar.module.scss
│ │ │ ├── ProgressBar.spec.ts
│ │ │ ├── ProgressBar.tsx
│ │ │ └── ProgressBarNative.tsx
│ │ ├── Queue
│ │ │ ├── Queue.md
│ │ │ ├── Queue.spec.ts
│ │ │ ├── Queue.tsx
│ │ │ ├── queueActions.ts
│ │ │ └── QueueNative.tsx
│ │ ├── RadioGroup
│ │ │ ├── RadioGroup.md
│ │ │ ├── RadioGroup.module.scss
│ │ │ ├── RadioGroup.spec.ts
│ │ │ ├── RadioGroup.tsx
│ │ │ ├── RadioGroupNative.tsx
│ │ │ ├── RadioItem.tsx
│ │ │ └── RadioItemNative.tsx
│ │ ├── RealTimeAdapter
│ │ │ ├── RealTimeAdapter.tsx
│ │ │ └── RealTimeAdapterNative.tsx
│ │ ├── Redirect
│ │ │ ├── Redirect.md
│ │ │ ├── Redirect.spec.ts
│ │ │ └── Redirect.tsx
│ │ ├── ResponsiveBar
│ │ │ ├── README.md
│ │ │ ├── ResponsiveBar.md
│ │ │ ├── ResponsiveBar.module.scss
│ │ │ ├── ResponsiveBar.spec.ts
│ │ │ ├── ResponsiveBar.tsx
│ │ │ └── ResponsiveBarNative.tsx
│ │ ├── Select
│ │ │ ├── HiddenOption.tsx
│ │ │ ├── OptionContext.ts
│ │ │ ├── Select.md
│ │ │ ├── Select.module.scss
│ │ │ ├── Select.spec.ts
│ │ │ ├── Select.tsx
│ │ │ ├── SelectContext.tsx
│ │ │ └── SelectNative.tsx
│ │ ├── SelectionStore
│ │ │ ├── SelectionStore.md
│ │ │ ├── SelectionStore.tsx
│ │ │ └── SelectionStoreNative.tsx
│ │ ├── Slider
│ │ │ ├── Slider.md
│ │ │ ├── Slider.module.scss
│ │ │ ├── Slider.spec.ts
│ │ │ ├── Slider.tsx
│ │ │ └── SliderNative.tsx
│ │ ├── Slot
│ │ │ ├── Slot.md
│ │ │ ├── Slot.spec.ts
│ │ │ └── Slot.ts
│ │ ├── SlotItem.tsx
│ │ ├── SpaceFiller
│ │ │ ├── SpaceFiller.md
│ │ │ ├── SpaceFiller.module.scss
│ │ │ ├── SpaceFiller.spec.ts
│ │ │ ├── SpaceFiller.tsx
│ │ │ └── SpaceFillerNative.tsx
│ │ ├── Spinner
│ │ │ ├── Spinner.md
│ │ │ ├── Spinner.module.scss
│ │ │ ├── Spinner.spec.ts
│ │ │ ├── Spinner.tsx
│ │ │ └── SpinnerNative.tsx
│ │ ├── Splitter
│ │ │ ├── HSplitter.md
│ │ │ ├── HSplitter.spec.ts
│ │ │ ├── Splitter.md
│ │ │ ├── Splitter.module.scss
│ │ │ ├── Splitter.spec.ts
│ │ │ ├── Splitter.tsx
│ │ │ ├── SplitterNative.tsx
│ │ │ ├── utils.ts
│ │ │ ├── VSplitter.md
│ │ │ └── VSplitter.spec.ts
│ │ ├── Stack
│ │ │ ├── CHStack.md
│ │ │ ├── CHStack.spec.ts
│ │ │ ├── CVStack.md
│ │ │ ├── CVStack.spec.ts
│ │ │ ├── HStack.md
│ │ │ ├── HStack.spec.ts
│ │ │ ├── Stack.md
│ │ │ ├── Stack.module.scss
│ │ │ ├── Stack.spec.ts
│ │ │ ├── Stack.tsx
│ │ │ ├── StackNative.tsx
│ │ │ ├── VStack.md
│ │ │ └── VStack.spec.ts
│ │ ├── StickyBox
│ │ │ ├── StickyBox.md
│ │ │ ├── StickyBox.module.scss
│ │ │ ├── StickyBox.tsx
│ │ │ └── StickyBoxNative.tsx
│ │ ├── Switch
│ │ │ ├── Switch.md
│ │ │ ├── Switch.spec.ts
│ │ │ └── Switch.tsx
│ │ ├── Table
│ │ │ ├── doc-resources
│ │ │ │ └── list-component-data.js
│ │ │ ├── react-table-config.d.ts
│ │ │ ├── Table.md
│ │ │ ├── Table.module.scss
│ │ │ ├── Table.spec.ts
│ │ │ ├── Table.tsx
│ │ │ ├── TableNative.tsx
│ │ │ └── useRowSelection.tsx
│ │ ├── TableOfContents
│ │ │ ├── TableOfContents.module.scss
│ │ │ ├── TableOfContents.spec.ts
│ │ │ ├── TableOfContents.tsx
│ │ │ └── TableOfContentsNative.tsx
│ │ ├── Tabs
│ │ │ ├── TabContext.tsx
│ │ │ ├── TabItem.md
│ │ │ ├── TabItem.tsx
│ │ │ ├── TabItemNative.tsx
│ │ │ ├── Tabs.md
│ │ │ ├── Tabs.module.scss
│ │ │ ├── Tabs.spec.ts
│ │ │ ├── Tabs.tsx
│ │ │ └── TabsNative.tsx
│ │ ├── Text
│ │ │ ├── Text.md
│ │ │ ├── Text.module.scss
│ │ │ ├── Text.spec.ts
│ │ │ ├── Text.tsx
│ │ │ └── TextNative.tsx
│ │ ├── TextArea
│ │ │ ├── TextArea.md
│ │ │ ├── TextArea.module.scss
│ │ │ ├── TextArea.spec.ts
│ │ │ ├── TextArea.tsx
│ │ │ ├── TextAreaNative.tsx
│ │ │ ├── TextAreaResizable.tsx
│ │ │ └── useComposedRef.ts
│ │ ├── TextBox
│ │ │ ├── TextBox.md
│ │ │ ├── TextBox.module.scss
│ │ │ ├── TextBox.spec.ts
│ │ │ ├── TextBox.tsx
│ │ │ └── TextBoxNative.tsx
│ │ ├── Theme
│ │ │ ├── NotificationToast.tsx
│ │ │ ├── Theme.md
│ │ │ ├── Theme.module.scss
│ │ │ ├── Theme.spec.ts
│ │ │ ├── Theme.tsx
│ │ │ └── ThemeNative.tsx
│ │ ├── TimeInput
│ │ │ ├── TimeInput.md
│ │ │ ├── TimeInput.module.scss
│ │ │ ├── TimeInput.spec.ts
│ │ │ ├── TimeInput.tsx
│ │ │ ├── TimeInputNative.tsx
│ │ │ └── utils.ts
│ │ ├── Timer
│ │ │ ├── Timer.md
│ │ │ ├── Timer.spec.ts
│ │ │ ├── Timer.tsx
│ │ │ └── TimerNative.tsx
│ │ ├── Toggle
│ │ │ ├── Toggle.module.scss
│ │ │ └── Toggle.tsx
│ │ ├── ToneChangerButton
│ │ │ ├── ToneChangerButton.md
│ │ │ ├── ToneChangerButton.spec.ts
│ │ │ └── ToneChangerButton.tsx
│ │ ├── ToneSwitch
│ │ │ ├── ToneSwitch.md
│ │ │ ├── ToneSwitch.module.scss
│ │ │ ├── ToneSwitch.spec.ts
│ │ │ ├── ToneSwitch.tsx
│ │ │ └── ToneSwitchNative.tsx
│ │ ├── Tooltip
│ │ │ ├── Tooltip.md
│ │ │ ├── Tooltip.module.scss
│ │ │ ├── Tooltip.spec.ts
│ │ │ ├── Tooltip.tsx
│ │ │ └── TooltipNative.tsx
│ │ ├── Tree
│ │ │ ├── testData.ts
│ │ │ ├── Tree-dynamic.spec.ts
│ │ │ ├── Tree-icons.spec.ts
│ │ │ ├── Tree.md
│ │ │ ├── Tree.spec.ts
│ │ │ ├── TreeComponent.module.scss
│ │ │ ├── TreeComponent.tsx
│ │ │ └── TreeNative.tsx
│ │ ├── TreeDisplay
│ │ │ ├── TreeDisplay.md
│ │ │ ├── TreeDisplay.module.scss
│ │ │ ├── TreeDisplay.tsx
│ │ │ └── TreeDisplayNative.tsx
│ │ ├── ValidationSummary
│ │ │ ├── ValidationSummary.module.scss
│ │ │ └── ValidationSummary.tsx
│ │ └── VisuallyHidden.tsx
│ ├── components-core
│ │ ├── abstractions
│ │ │ ├── ComponentRenderer.ts
│ │ │ ├── LoaderRenderer.ts
│ │ │ ├── standalone.ts
│ │ │ └── treeAbstractions.ts
│ │ ├── action
│ │ │ ├── actions.ts
│ │ │ ├── APICall.tsx
│ │ │ ├── FileDownloadAction.tsx
│ │ │ ├── FileUploadAction.tsx
│ │ │ ├── NavigateAction.tsx
│ │ │ └── TimedAction.tsx
│ │ ├── ApiBoundComponent.tsx
│ │ ├── appContext
│ │ │ ├── date-functions.ts
│ │ │ ├── math-function.ts
│ │ │ └── misc-utils.ts
│ │ ├── AppContext.tsx
│ │ ├── behaviors
│ │ │ ├── Behavior.tsx
│ │ │ └── CoreBehaviors.tsx
│ │ ├── component-hooks.ts
│ │ ├── ComponentDecorator.tsx
│ │ ├── ComponentViewer.tsx
│ │ ├── CompoundComponent.tsx
│ │ ├── constants.ts
│ │ ├── DebugViewProvider.tsx
│ │ ├── descriptorHelper.ts
│ │ ├── devtools
│ │ │ ├── InspectorDialog.module.scss
│ │ │ ├── InspectorDialog.tsx
│ │ │ └── InspectorDialogVisibilityContext.tsx
│ │ ├── EngineError.ts
│ │ ├── event-handlers.ts
│ │ ├── InspectorButton.module.scss
│ │ ├── InspectorContext.tsx
│ │ ├── interception
│ │ │ ├── abstractions.ts
│ │ │ ├── ApiInterceptor.ts
│ │ │ ├── ApiInterceptorProvider.tsx
│ │ │ ├── apiInterceptorWorker.ts
│ │ │ ├── Backend.ts
│ │ │ ├── Errors.ts
│ │ │ ├── IndexedDb.ts
│ │ │ ├── initMock.ts
│ │ │ ├── InMemoryDb.ts
│ │ │ ├── ReadonlyCollection.ts
│ │ │ └── useApiInterceptorContext.tsx
│ │ ├── loader
│ │ │ ├── ApiLoader.tsx
│ │ │ ├── DataLoader.tsx
│ │ │ ├── ExternalDataLoader.tsx
│ │ │ ├── Loader.tsx
│ │ │ ├── MockLoaderRenderer.tsx
│ │ │ └── PageableLoader.tsx
│ │ ├── LoaderComponent.tsx
│ │ ├── markup-check.ts
│ │ ├── parts.ts
│ │ ├── renderers.ts
│ │ ├── rendering
│ │ │ ├── AppContent.tsx
│ │ │ ├── AppRoot.tsx
│ │ │ ├── AppWrapper.tsx
│ │ │ ├── buildProxy.ts
│ │ │ ├── collectFnVarDeps.ts
│ │ │ ├── ComponentAdapter.tsx
│ │ │ ├── ComponentWrapper.tsx
│ │ │ ├── Container.tsx
│ │ │ ├── containers.ts
│ │ │ ├── ContainerWrapper.tsx
│ │ │ ├── ErrorBoundary.module.scss
│ │ │ ├── ErrorBoundary.tsx
│ │ │ ├── InvalidComponent.module.scss
│ │ │ ├── InvalidComponent.tsx
│ │ │ ├── nodeUtils.ts
│ │ │ ├── reducer.ts
│ │ │ ├── renderChild.tsx
│ │ │ ├── StandaloneComponent.tsx
│ │ │ ├── StateContainer.tsx
│ │ │ ├── UnknownComponent.module.scss
│ │ │ ├── UnknownComponent.tsx
│ │ │ └── valueExtractor.ts
│ │ ├── reportEngineError.ts
│ │ ├── RestApiProxy.ts
│ │ ├── script-runner
│ │ │ ├── asyncProxy.ts
│ │ │ ├── AttributeValueParser.ts
│ │ │ ├── bannedFunctions.ts
│ │ │ ├── BindingTreeEvaluationContext.ts
│ │ │ ├── eval-tree-async.ts
│ │ │ ├── eval-tree-common.ts
│ │ │ ├── eval-tree-sync.ts
│ │ │ ├── ParameterParser.ts
│ │ │ ├── process-statement-async.ts
│ │ │ ├── process-statement-common.ts
│ │ │ ├── process-statement-sync.ts
│ │ │ ├── ScriptingSourceTree.ts
│ │ │ ├── simplify-expression.ts
│ │ │ ├── statement-queue.ts
│ │ │ └── visitors.ts
│ │ ├── StandaloneApp.tsx
│ │ ├── StandaloneExtensionManager.ts
│ │ ├── TableOfContentsContext.tsx
│ │ ├── theming
│ │ │ ├── _themes.scss
│ │ │ ├── component-layout-resolver.ts
│ │ │ ├── extendThemeUtils.ts
│ │ │ ├── hvar.ts
│ │ │ ├── layout-resolver.ts
│ │ │ ├── parse-layout-props.ts
│ │ │ ├── StyleContext.tsx
│ │ │ ├── StyleRegistry.ts
│ │ │ ├── ThemeContext.tsx
│ │ │ ├── ThemeProvider.tsx
│ │ │ ├── themes
│ │ │ │ ├── base-utils.ts
│ │ │ │ ├── palette.ts
│ │ │ │ ├── root.ts
│ │ │ │ ├── solid.ts
│ │ │ │ ├── theme-colors.ts
│ │ │ │ └── xmlui.ts
│ │ │ ├── themeVars.module.scss
│ │ │ ├── themeVars.ts
│ │ │ ├── transformThemeVars.ts
│ │ │ └── utils.ts
│ │ ├── utils
│ │ │ ├── actionUtils.ts
│ │ │ ├── audio-utils.ts
│ │ │ ├── base64-utils.ts
│ │ │ ├── compound-utils.ts
│ │ │ ├── css-utils.ts
│ │ │ ├── DataLoaderQueryKeyGenerator.ts
│ │ │ ├── date-utils.ts
│ │ │ ├── extractParam.ts
│ │ │ ├── hooks.tsx
│ │ │ ├── LruCache.ts
│ │ │ ├── mergeProps.ts
│ │ │ ├── misc.ts
│ │ │ ├── request-params.ts
│ │ │ ├── statementUtils.ts
│ │ │ └── treeUtils.ts
│ │ └── xmlui-parser.ts
│ ├── index-standalone.ts
│ ├── index.scss
│ ├── index.ts
│ ├── language-server
│ │ ├── server-common.ts
│ │ ├── server-web-worker.ts
│ │ ├── server.ts
│ │ ├── services
│ │ │ ├── common
│ │ │ │ ├── docs-generation.ts
│ │ │ │ ├── lsp-utils.ts
│ │ │ │ ├── metadata-utils.ts
│ │ │ │ └── syntax-node-utilities.ts
│ │ │ ├── completion.ts
│ │ │ ├── diagnostic.ts
│ │ │ ├── format.ts
│ │ │ └── hover.ts
│ │ └── xmlui-metadata-generated.js
│ ├── logging
│ │ ├── LoggerContext.tsx
│ │ ├── LoggerInitializer.tsx
│ │ ├── LoggerService.ts
│ │ └── xmlui.ts
│ ├── logo.svg
│ ├── parsers
│ │ ├── common
│ │ │ ├── GenericToken.ts
│ │ │ ├── InputStream.ts
│ │ │ └── utils.ts
│ │ ├── scripting
│ │ │ ├── code-behind-collect.ts
│ │ │ ├── Lexer.ts
│ │ │ ├── modules.ts
│ │ │ ├── Parser.ts
│ │ │ ├── ParserError.ts
│ │ │ ├── ScriptingNodeTypes.ts
│ │ │ ├── TokenTrait.ts
│ │ │ ├── TokenType.ts
│ │ │ └── tree-visitor.ts
│ │ ├── style-parser
│ │ │ ├── errors.ts
│ │ │ ├── source-tree.ts
│ │ │ ├── StyleInputStream.ts
│ │ │ ├── StyleLexer.ts
│ │ │ ├── StyleParser.ts
│ │ │ └── tokens.ts
│ │ └── xmlui-parser
│ │ ├── CharacterCodes.ts
│ │ ├── diagnostics.ts
│ │ ├── fileExtensions.ts
│ │ ├── index.ts
│ │ ├── lint.ts
│ │ ├── parser.ts
│ │ ├── ParserError.ts
│ │ ├── scanner.ts
│ │ ├── syntax-kind.ts
│ │ ├── syntax-node.ts
│ │ ├── transform.ts
│ │ ├── utils.ts
│ │ ├── xmlui-serializer.ts
│ │ └── xmlui-tree.ts
│ ├── react-app-env.d.ts
│ ├── syntax
│ │ ├── monaco
│ │ │ ├── grammar.monacoLanguage.ts
│ │ │ ├── index.ts
│ │ │ ├── xmlui-dark.ts
│ │ │ ├── xmlui-light.ts
│ │ │ └── xmluiscript.monacoLanguage.ts
│ │ └── textMate
│ │ ├── index.ts
│ │ ├── xmlui-dark.json
│ │ ├── xmlui-light.json
│ │ ├── xmlui.json
│ │ └── xmlui.tmLanguage.json
│ ├── testing
│ │ ├── assertions.ts
│ │ ├── component-test-helpers.ts
│ │ ├── ComponentDrivers.ts
│ │ ├── drivers
│ │ │ ├── DateInputDriver.ts
│ │ │ ├── index.ts
│ │ │ ├── ModalDialogDriver.ts
│ │ │ ├── NumberBoxDriver.ts
│ │ │ ├── TextBoxDriver.ts
│ │ │ ├── TimeInputDriver.ts
│ │ │ ├── TimerDriver.ts
│ │ │ └── TreeDriver.ts
│ │ ├── fixtures.ts
│ │ ├── index.ts
│ │ ├── infrastructure
│ │ │ ├── index.html
│ │ │ ├── main.tsx
│ │ │ ├── public
│ │ │ │ ├── mockServiceWorker.js
│ │ │ │ ├── resources
│ │ │ │ │ ├── bell.svg
│ │ │ │ │ ├── box.svg
│ │ │ │ │ ├── doc.svg
│ │ │ │ │ ├── eye.svg
│ │ │ │ │ ├── flower-640x480.jpg
│ │ │ │ │ ├── sun.svg
│ │ │ │ │ ├── test-image-100x100.jpg
│ │ │ │ │ └── txt.svg
│ │ │ │ └── serve.json
│ │ │ └── TestBed.tsx
│ │ └── themed-app-test-helpers.ts
│ └── vite-env.d.ts
├── tests
│ ├── components
│ │ ├── CodeBlock
│ │ │ └── hightlight-code.test.ts
│ │ ├── playground-pattern.test.ts
│ │ └── Tree
│ │ └── Tree-states.test.ts
│ ├── components-core
│ │ ├── abstractions
│ │ │ └── treeAbstractions.test.ts
│ │ ├── container
│ │ │ └── buildProxy.test.ts
│ │ ├── interception
│ │ │ ├── orderBy.test.ts
│ │ │ ├── ReadOnlyCollection.test.ts
│ │ │ └── request-param-converter.test.ts
│ │ ├── scripts-runner
│ │ │ ├── AttributeValueParser.test.ts
│ │ │ ├── eval-tree-arrow-async.test.ts
│ │ │ ├── eval-tree-arrow.test.ts
│ │ │ ├── eval-tree-func-decl-async.test.ts
│ │ │ ├── eval-tree-func-decl.test.ts
│ │ │ ├── eval-tree-pre-post.test.ts
│ │ │ ├── eval-tree-regression.test.ts
│ │ │ ├── eval-tree.test.ts
│ │ │ ├── function-proxy.test.ts
│ │ │ ├── parser-regression.test.ts
│ │ │ ├── process-event.test.ts
│ │ │ ├── process-function.test.ts
│ │ │ ├── process-implicit-context.test.ts
│ │ │ ├── process-statement-asgn.test.ts
│ │ │ ├── process-statement-destruct.test.ts
│ │ │ ├── process-statement-regs.test.ts
│ │ │ ├── process-statement-sync.test.ts
│ │ │ ├── process-statement.test.ts
│ │ │ ├── process-switch-sync.test.ts
│ │ │ ├── process-switch.test.ts
│ │ │ ├── process-try-sync.test.ts
│ │ │ ├── process-try.test.ts
│ │ │ └── test-helpers.ts
│ │ ├── test-metadata-handler.ts
│ │ ├── theming
│ │ │ ├── border-segments.test.ts
│ │ │ ├── component-layout.resolver.test.ts
│ │ │ ├── layout-property-parser.test.ts
│ │ │ ├── layout-resolver.test.ts
│ │ │ ├── layout-resolver2.test.ts
│ │ │ ├── layout-vp-override.test.ts
│ │ │ └── padding-segments.test.ts
│ │ └── utils
│ │ ├── date-utils.test.ts
│ │ ├── format-human-elapsed-time.test.ts
│ │ └── LruCache.test.ts
│ ├── language-server
│ │ ├── completion.test.ts
│ │ ├── format.test.ts
│ │ ├── hover.test.ts
│ │ └── mockData.ts
│ └── parsers
│ ├── common
│ │ └── input-stream.test.ts
│ ├── markdown
│ │ └── parse-binding-expression.test.ts
│ ├── parameter-parser.test.ts
│ ├── paremeter-parser.test.ts
│ ├── scripting
│ │ ├── eval-tree-arrow.test.ts
│ │ ├── eval-tree-pre-post.test.ts
│ │ ├── eval-tree.test.ts
│ │ ├── function-proxy.test.ts
│ │ ├── lexer-literals.test.ts
│ │ ├── lexer-misc.test.ts
│ │ ├── module-parse.test.ts
│ │ ├── parser-arrow.test.ts
│ │ ├── parser-assignments.test.ts
│ │ ├── parser-binary.test.ts
│ │ ├── parser-destructuring.test.ts
│ │ ├── parser-errors.test.ts
│ │ ├── parser-expressions.test.ts
│ │ ├── parser-function.test.ts
│ │ ├── parser-literals.test.ts
│ │ ├── parser-primary.test.ts
│ │ ├── parser-regex.test.ts
│ │ ├── parser-statements.test.ts
│ │ ├── parser-unary.test.ts
│ │ ├── process-event.test.ts
│ │ ├── process-implicit-context.test.ts
│ │ ├── process-statement-asgn.test.ts
│ │ ├── process-statement-destruct.test.ts
│ │ ├── process-statement-regs.test.ts
│ │ ├── process-statement-sync.test.ts
│ │ ├── process-statement.test.ts
│ │ ├── process-switch-sync.test.ts
│ │ ├── process-switch.test.ts
│ │ ├── process-try-sync.test.ts
│ │ ├── process-try.test.ts
│ │ ├── simplify-expression.test.ts
│ │ ├── statement-hooks.test.ts
│ │ └── test-helpers.ts
│ ├── style-parser
│ │ ├── generateHvarChain.test.ts
│ │ ├── parseHVar.test.ts
│ │ ├── parser.test.ts
│ │ └── tokens.test.ts
│ └── xmlui
│ ├── lint.test.ts
│ ├── parser.test.ts
│ ├── scanner.test.ts
│ ├── transform.attr.test.ts
│ ├── transform.circular.test.ts
│ ├── transform.element.test.ts
│ ├── transform.errors.test.ts
│ ├── transform.escape.test.ts
│ ├── transform.regression.test.ts
│ ├── transform.script.test.ts
│ ├── transform.test.ts
│ └── xmlui.ts
├── tests-e2e
│ ├── api-bound-component-regression.spec.ts
│ ├── api-call-as-extracted-component.spec.ts
│ ├── assign-to-object-or-array-regression.spec.ts
│ ├── binding-regression.spec.ts
│ ├── children-as-template-context-vars.spec.ts
│ ├── compound-component.spec.ts
│ ├── context-vars-regression.spec.ts
│ ├── data-bindings.spec.ts
│ ├── datasource-and-api-usage-in-var.spec.ts
│ ├── datasource-direct-binding.spec.ts
│ ├── datasource-onLoaded-regression.spec.ts
│ ├── modify-array-item-regression.spec.ts
│ ├── namespaces.spec.ts
│ ├── push-to-array-regression.spec.ts
│ ├── screen-breakpoints.spec.ts
│ ├── scripting.spec.ts
│ ├── state-scope-in-pages.spec.ts
│ └── state-var-scopes.spec.ts
├── tsconfig.bin.json
├── tsconfig.json
├── tsconfig.node.json
├── vite.config.ts
└── vitest.config.ts
```
# Files
--------------------------------------------------------------------------------
/xmlui/src/components/APICall/APICall.spec.ts:
--------------------------------------------------------------------------------
```typescript
import { expect, test } from "../../testing/fixtures";
import type { ApiInterceptorDefinition } from "../../components-core/interception/abstractions";
// Test data constants for API mocking
const basicApiInterceptor: ApiInterceptorDefinition = {
operations: {
"get-test": {
url: "/api/test",
method: "get",
handler: `console.log('GET!!!'); return { message: "GET success", id: 1 };`,
},
"post-test": {
url: "/api/test/1",
method: "post",
handler: `return { message: "POST success", id: 2, data: $requestBody };`,
},
"put-test": {
url: "/api/test/1",
method: "put",
handler: `return { message: "PUT success", id: 1, data: $requestBody };`,
},
"delete-test": {
url: "/api/test/1",
method: "delete",
handler: `return { message: "DELETE success", deleted: true };`,
},
"query-params-test": {
url: "/api/search",
method: "get",
handler: `return { query: $queryParams, results: ["item1", "item2"] };`,
},
"headers-test": {
url: "/api/headers",
method: "get",
handler: `console.log('hd', $requestHeaders); return { headers: $requestHeaders };`,
},
"error-test": {
url: "/api/error",
method: "post",
handler: `throw Errors.HttpError(400, { message: "Bad request", details: "Invalid data" });`,
},
"slow-test": {
url: "/api/slow",
method: "get",
handler: `
await new Promise(resolve => setTimeout(resolve, 100));
return { message: "Slow response" };
`,
},
},
};
const confirmationInterceptor: ApiInterceptorDefinition = {
operations: {
"confirm-test": {
url: "/api/confirm",
method: "post",
handler: `return { message: "Confirmed action", timestamp: Date.now() };`,
},
},
};
// =============================================================================
// BASIC FUNCTIONALITY TESTS
// =============================================================================
test.describe("Basic Functionality", () => {
test("component renders and initializes correctly", async ({ initTestBed, page }) => {
await initTestBed(`<APICall id="test" url="/api/test" method="get" />`, {
apiInterceptor: basicApiInterceptor,
});
// APICall is non-visual, so we check for proper registration by checking if it exists in context
const component = page.getByTestId("test-id-component");
expect(await component.count()).toBe(0); // Non-visual component
});
test("component executes with basic properties", async ({ initTestBed, createButtonDriver }) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall id="api" url="/api/test" method="get" onSuccess="arg => testState = arg.message" />
<Button testId="trigger" onClick="api.execute()" label="Execute" />
</Fragment>
`,
{
apiInterceptor: basicApiInterceptor,
},
);
const button = await createButtonDriver("trigger");
await button.click();
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual("GET success");
});
// =============================================================================
// HTTP METHOD TESTS
// =============================================================================
test.describe("HTTP method property", () => {
const methods = ["get", "post", "put", "delete"];
methods.forEach((method) => {
test(`executes ${method.toUpperCase()} request correctly`, async ({
initTestBed,
createButtonDriver,
}) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall
id="api"
url="/api/test${method === "get" ? "" : "/1"}"
method="${method}"
${method !== "get" ? `body='{{ "test": "data" }}'` : ""}
onSuccess="result => testState = result.message"
/>
<Button testId="trigger" onClick="api.execute()" label="Execute" />
</Fragment>
`,
{
apiInterceptor: basicApiInterceptor,
},
);
const button = await createButtonDriver("trigger");
await button.click();
await expect
.poll(testStateDriver.testState, { timeout: 2000 })
.toEqual(`${method.toUpperCase()} success`);
});
});
test("supports additional HTTP methods like PATCH", async ({
initTestBed,
createButtonDriver,
}) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall
id="api"
url="/api/test/1"
method="patch"
body='{{ "test": "data" }}'
onSuccess="() => testState = 'patch-success'"
/>
<Button testId="trigger" onClick="api.execute()" label="Execute" />
</Fragment>
`,
{
apiInterceptor: {
operations: {
"real-patch": {
url: "/api/test/1",
method: "patch",
handler: `return { message: "PATCH success" };`,
},
},
},
},
);
const button = await createButtonDriver("trigger");
await button.click();
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual("patch-success");
});
test("defaults to GET method when not specified", async ({
initTestBed,
createButtonDriver,
}) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall id="api" url="/api/test" onSuccess="result => testState = result.message" />
<Button testId="trigger" onClick="api.execute()" label="Execute" />
</Fragment>
`,
{
apiInterceptor: basicApiInterceptor,
},
);
const button = await createButtonDriver("trigger");
await button.click();
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual("GET success");
});
test("handles invalid method gracefully", async ({ initTestBed, createButtonDriver }) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall id="api" url="/api/test" method="invalid" onError="() => testState = 'error'" />
<Button testId="trigger" onClick="api.execute()" label="Execute" />
</Fragment>
`,
{
apiInterceptor: basicApiInterceptor,
},
);
const button = await createButtonDriver("trigger");
await button.click();
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual("error");
});
});
// =============================================================================
// URL PROPERTY TESTS
// =============================================================================
test.describe("url property", () => {
test("handles absolute URLs", async ({ initTestBed, createButtonDriver }) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall id="api" url="/api/test" onSuccess="() => testState = 'success'" />
<Button testId="trigger" onClick="api.execute()" label="Execute" />
</Fragment>
`,
{
apiInterceptor: basicApiInterceptor,
},
);
const button = await createButtonDriver("trigger");
await button.click();
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual("success");
});
test("handles relative URLs", async ({ initTestBed, createButtonDriver }) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall id="api" url="api/test" onSuccess="() => testState = 'success'" />
<Button testId="trigger" onClick="api.execute()" label="Execute" />
</Fragment>
`,
{
apiInterceptor: {
operations: {
"relative-test": {
url: "**/api/test",
method: "get",
handler: `return { success: true };`,
},
},
},
},
);
const button = await createButtonDriver("trigger");
await button.click();
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual("success");
});
test("handles URL with special characters", async ({ initTestBed, createButtonDriver }) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall id="api" url="/api/test?q=hello%20world&filter=a%26b" onSuccess="() => testState = 'success'" />
<Button testId="trigger" onClick="api.execute()" label="Execute" />
</Fragment>
`,
{
apiInterceptor: {
operations: {
"special-chars": {
url: "**/api/test**",
method: "get",
handler: `return { success: true };`,
},
},
},
},
);
const button = await createButtonDriver("trigger");
await button.click();
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual("success");
});
});
// =============================================================================
// BODY PROPERTY TESTS
// =============================================================================
test.describe("body property", () => {
test("sends JSON body correctly", async ({ initTestBed, createButtonDriver }) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall
id="api"
url="/api/test/1"
method="post"
body="{{ name: 'John', age: 30 }}"
onSuccess="result => testState = result.data.name"
/>
<Button testId="trigger" onClick="api.execute()" label="Execute" />
</Fragment>
`,
{
apiInterceptor: basicApiInterceptor,
},
);
const button = await createButtonDriver("trigger");
await button.click();
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual("John");
});
test("handles empty body", async ({ initTestBed, createButtonDriver }) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall id="api" url="/api/test/1" method="post" body="" onSuccess="() => testState = 'success'" />
<Button testId="trigger" onClick="api.execute()" label="Execute" />
</Fragment>
`,
{
apiInterceptor: basicApiInterceptor,
},
);
const button = await createButtonDriver("trigger");
await button.click();
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual("success");
});
test("handles complex nested objects in body", async ({ initTestBed, createButtonDriver }) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall
id="api"
url="/api/test/1"
method="post"
body="{{ user: { profile: { name: 'Jane', settings: { theme: 'dark' } } }, items: [1, 2, 3] }}"
onSuccess="result => testState = result.data.user.profile.name"
/>
<Button testId="trigger" onClick="api.execute()" label="Execute" />
</Fragment>
`,
{
apiInterceptor: basicApiInterceptor,
},
);
const button = await createButtonDriver("trigger");
await button.click();
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual("Jane");
});
});
// =============================================================================
// RAW BODY PROPERTY TESTS
// =============================================================================
test.describe("rawBody property", () => {
test("sends raw string body", async ({ initTestBed, createButtonDriver }) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall
id="api"
url="/api/test"
method="post"
rawBody="plain text content"
onSuccess="() => testState = 'success'"
/>
<Button testId="trigger" onClick="api.execute()" label="Execute" />
</Fragment>
`,
{
apiInterceptor: {
operations: {
"raw-body": {
url: "/api/test",
method: "post",
handler: `return { received: $requestBody };`,
},
},
},
},
);
const button = await createButtonDriver("trigger");
await button.click();
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual("success");
});
test("rawBody takes precedence over body", async ({ initTestBed, createButtonDriver }) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall
id="api"
url="/api/test"
method="post"
body="{{ name: 'John' }}"
rawBody="raw content"
onSuccess="() => testState = 'success'"
/>
<Button testId="trigger" onClick="api.execute()" label="Execute" />
</Fragment>
`,
{
apiInterceptor: {
operations: {
"precedence-test": {
url: "/api/test",
method: "post",
handler: `return { received: $requestBody };`,
},
},
},
},
);
const button = await createButtonDriver("trigger");
await button.click();
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual("success");
});
});
// =============================================================================
// QUERY PARAMS PROPERTY TESTS
// =============================================================================
test.describe("queryParams property", () => {
test("sends query parameters correctly", async ({ initTestBed, createButtonDriver }) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall
id="api"
url="/api/search"
queryParams="{{ q: 'test', limit: 10, active: true }}"
onSuccess="result => testState = result.query.q"
/>
<Button testId="trigger" onClick="api.execute()" label="Execute" />
</Fragment>
`,
{
apiInterceptor: basicApiInterceptor,
},
);
const button = await createButtonDriver("trigger");
await button.click();
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual("test");
});
test("handles empty query parameters", async ({ initTestBed, createButtonDriver }) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall id="api" url="/api/search" queryParams="{{}}" onSuccess="() => testState = 'success'" />
<Button testId="trigger" onClick="api.execute()" label="Execute" />
</Fragment>
`,
{
apiInterceptor: basicApiInterceptor,
},
);
const button = await createButtonDriver("trigger");
await button.click();
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual("success");
});
test("handles special characters in query parameters", async ({
initTestBed,
createButtonDriver,
}) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall
id="api"
url="/api/search"
queryParams="{{ q: 'hello world', special: 'a&b=c' }}"
onSuccess="result => testState = result.query.q"
/>
<Button testId="trigger" onClick="api.execute()" label="Execute" />
</Fragment>
`,
{
apiInterceptor: basicApiInterceptor,
},
);
const button = await createButtonDriver("trigger");
await button.click();
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual("hello world");
});
});
// =============================================================================
// HEADERS PROPERTY TESTS
// =============================================================================
test.describe("headers property", () => {
test("sends custom headers correctly", async ({ initTestBed, createButtonDriver }) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall
id="api"
url="/api/headers"
headers="{{ 'X-Custom-Header': 'test-value', 'Authorization': 'Bearer token123' }}"
onSuccess="result => testState = result.headers['x-custom-header']"
/>
<Button testId="trigger" onClick="api.execute()" label="Execute" />
</Fragment>
`,
{
apiInterceptor: basicApiInterceptor,
},
);
const button = await createButtonDriver("trigger");
await button.click();
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual("test-value");
});
test("handles empty headers", async ({ initTestBed, createButtonDriver }) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall id="api" url="/api/headers" headers="{{}}" onSuccess="() => testState = 'success'" />
<Button testId="trigger" onClick="api.execute()" label="Execute" />
</Fragment>
`,
{
apiInterceptor: basicApiInterceptor,
},
);
const button = await createButtonDriver("trigger");
await button.click();
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual("success");
});
});
// =============================================================================
// CONFIRMATION DIALOG TESTS
// =============================================================================
test.describe("confirmation dialog properties", () => {
test("shows confirmation dialog with custom title and message", async ({
initTestBed,
createButtonDriver,
page,
}) => {
await initTestBed(
`
<Fragment>
<APICall
id="api"
url="/api/confirm"
method="post"
confirmTitle="Custom Title"
confirmMessage="Are you sure you want to proceed?"
confirmButtonLabel="Yes, Continue"
/>
<Button testId="trigger" onClick="api.execute()" label="Execute" />
</Fragment>
`,
{
apiInterceptor: confirmationInterceptor,
},
);
const button = await createButtonDriver("trigger");
await button.click();
// Check for confirmation dialog
await expect(page.getByText("Custom Title")).toBeVisible();
await expect(page.getByText("Are you sure you want to proceed?")).toBeVisible();
await expect(page.getByText("Yes, Continue")).toBeVisible();
});
test("API call proceeds when confirmation is accepted", async ({
initTestBed,
createButtonDriver,
page,
}) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall
id="api"
url="/api/confirm"
method="post"
confirmTitle="Confirm"
confirmMessage="Proceed?"
onSuccess="() => testState = 'confirmed'"
/>
<Button testId="trigger" onClick="api.execute()" label="Execute" />
</Fragment>
`,
{
apiInterceptor: confirmationInterceptor,
},
);
const button = await createButtonDriver("trigger");
await button.click();
// Accept confirmation
await page.getByRole("button", { name: /yes/i }).click();
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual("confirmed");
});
test("API call is cancelled when confirmation is rejected", async ({
initTestBed,
createButtonDriver,
page,
}) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall
id="api"
url="/api/confirm"
method="post"
confirmTitle="Confirm"
confirmMessage="Proceed?"
onSuccess="() => testState = 'confirmed'"
onError="() => testState = 'error'"
/>
<Button testId="trigger" onClick="api.execute()" label="Execute" />
</Fragment>
`,
{
apiInterceptor: confirmationInterceptor,
},
);
const button = await createButtonDriver("trigger");
await button.click();
// Reject confirmation
await page.getByRole("button", { name: /cancel|no/i }).click();
// Should not execute API call
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual(null);
});
});
// =============================================================================
// NOTIFICATION MESSAGE TESTS
// =============================================================================
test.describe("notification message properties", () => {
test("shows progress notification during API call", async ({
initTestBed,
createButtonDriver,
page,
}) => {
await initTestBed(
`
<Fragment>
<APICall
id="api"
url="/api/slow"
inProgressNotificationMessage="Processing your request..."
/>
<Button testId="trigger" onClick="api.execute()" label="Execute" />
</Fragment>
`,
{
apiInterceptor: basicApiInterceptor,
},
);
const button = await createButtonDriver("trigger");
await button.click();
// Check for progress notification
await expect(page.getByText("Processing your request...")).toBeVisible();
});
test("shows success notification with result data", async ({
initTestBed,
createButtonDriver,
page,
}) => {
await initTestBed(
`
<Fragment>
<APICall
id="api"
url="/api/test"
completedNotificationMessage="Success: {$result.message}"
/>
<Button testId="trigger" onClick="api.execute()" label="Execute" />
</Fragment>
`,
{
apiInterceptor: basicApiInterceptor,
},
);
const button = await createButtonDriver("trigger");
await button.click();
// Check for success notification
await expect(page.getByText("Success: GET success")).toBeVisible();
});
test("shows error notification with error details", async ({
initTestBed,
createButtonDriver,
page,
}) => {
await initTestBed(
`
<Fragment>
<APICall
id="api"
url="/api/error"
method="post"
errorNotificationMessage="Error {$error.statusCode}: {$error.details.message}"
/>
<Button testId="trigger" onClick="api.execute()" label="Execute" />
</Fragment>
`,
{
apiInterceptor: basicApiInterceptor,
},
);
const button = await createButtonDriver("trigger");
await button.click();
// Check for error notification
await expect(page.getByText("Error 400: Bad request")).toBeVisible();
});
});
// =============================================================================
// EXECUTE METHOD TESTS
// =============================================================================
test.describe("execute method", () => {
test("triggers API call", async ({ initTestBed, createButtonDriver }) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall id="api" url="/api/test" onSuccess="() => testState = 'executed'" />
<Button testId="trigger" onClick="api.execute()" label="Execute" />
</Fragment>
`,
{
apiInterceptor: basicApiInterceptor,
},
);
const button = await createButtonDriver("trigger");
await button.click();
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual("executed");
});
test("accepts parameters", async ({ initTestBed, createButtonDriver }) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall
id="api"
url="/api/test/1"
method="post"
body="{$param}"
onSuccess="result => testState = result.data.name"
/>
<Button testId="trigger" onClick="api.execute({ name: 'John', age: 30 })" label="Execute" />
</Fragment>
`,
{
apiInterceptor: basicApiInterceptor,
},
);
const button = await createButtonDriver("trigger");
await button.click();
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual("John");
});
test("provides access to multiple parameters", async ({ initTestBed, createButtonDriver }) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall
id="api"
url="/api/test/1"
method="post"
body="{{ first: $params[0], second: $params[1], third: $params[2] }}"
onSuccess="result => testState = result.data.first + '-' + result.data.second + '-' + result.data.third"
/>
<Button testId="trigger" onClick="api.execute('param1', 'param2', 'param3')" label="Execute" />
</Fragment>
`,
{
apiInterceptor: basicApiInterceptor,
},
);
const button = await createButtonDriver("trigger");
await button.click();
await expect
.poll(testStateDriver.testState, { timeout: 2000 })
.toEqual("param1-param2-param3");
});
test("can be called multiple times", async ({ initTestBed, createButtonDriver }) => {
const { testStateDriver } = await initTestBed(
`
<Fragment var.callCount="{0}">
<Button testId="trigger" label="Execute {callCount}" >
<event name="click">
<APICall
url="/api/test"
onSuccess="console.log('before', callCount); callCount++; console.log('after', callCount); testState = callCount;"
/>
</event>
</Button>
</Fragment>
`,
{
apiInterceptor: basicApiInterceptor,
},
);
const button = await createButtonDriver("trigger");
await button.click();
await new Promise((resolve) => setTimeout(resolve, 100)); // Wait for async execution
//await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual(1);
await button.click();
//await expect.poll(testStateDriver.testState).toEqual(2);
await button.click();
//await expect.poll(testStateDriver.testState).toEqual(3);
});
});
// =============================================================================
// CONTEXT VARIABLE TESTS
// =============================================================================
test.describe("context variables", () => {
test("$param provides access to first parameter", async ({
initTestBed,
createButtonDriver,
}) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall
id="api"
url="/api/test/1"
method="post"
body="{$param}"
onSuccess="result => testState = result.data.message"
/>
<Button testId="trigger" onClick="api.execute({ message: 'hello' })" label="Execute" />
</Fragment>
`,
{
apiInterceptor: basicApiInterceptor,
},
);
const button = await createButtonDriver("trigger");
await button.click();
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual("hello");
});
test("$params provides access to all parameters", async ({
initTestBed,
createButtonDriver,
}) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall
id="api"
url="/api/test/1"
method="post"
body="{{ all: $params }}"
onSuccess="result => testState = result.data.all.length"
/>
<Button testId="trigger" onClick="api.execute('a', 'b', 'c')" label="Execute" />
</Fragment>
`,
{
apiInterceptor: basicApiInterceptor,
},
);
const button = await createButtonDriver("trigger");
await button.click();
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual(3);
});
test("$result provides access to response data", async ({
initTestBed,
createButtonDriver,
}) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall
id="api"
url="/api/test"
onSuccess="result => testState = result.id + ' - ' + result.message"
/>
<Button testId="trigger" onClick="api.execute()" label="Execute" />
</Fragment>
`,
{
apiInterceptor: basicApiInterceptor,
},
);
const button = await createButtonDriver("trigger");
await button.click();
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual("1 - GET success");
});
test("$error provides access to error information", async ({
initTestBed,
createButtonDriver,
}) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall
id="api"
url="/api/error"
method="post"
onError="error => testState = error.statusCode + ' - ' + error.details.message"
/>
<Button testId="trigger" onClick="api.execute()" label="Execute" />
</Fragment>
`,
{
apiInterceptor: basicApiInterceptor,
},
);
const button = await createButtonDriver("trigger");
await button.click();
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual("400 - Bad request");
});
});
});
// =============================================================================
// OTHER EDGE CASE TESTS
// =============================================================================
test.describe("Other Edge Cases", () => {
test("handles null and undefined parameters gracefully", async ({
initTestBed,
createButtonDriver,
}) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall
id="api"
url="/api/test/1"
method="post"
body="{$param}"
onSuccess="() => testState = 'success'"
onError="() => testState = 'error'"
/>
<Button testId="trigger" onClick="api.execute(null)" label="Execute" />
</Fragment>
`,
{
apiInterceptor: basicApiInterceptor,
},
);
const button = await createButtonDriver("trigger");
await button.click();
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual("success");
});
test("handles undefined URL gracefully", async ({ initTestBed, createButtonDriver }) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall id="api" onError="() => testState = 'error'" />
<Button testId="trigger" onClick="api.execute()" label="Execute" />
</Fragment>
`,
{
apiInterceptor: basicApiInterceptor,
},
);
const button = await createButtonDriver("trigger");
await button.click();
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual("error");
});
test("handles malformed JSON in body gracefully", async ({ initTestBed, createButtonDriver }) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall
id="api"
url="/api/test"
method="post"
body="{ invalid json }"
onSuccess="() => testState = 'success'"
onError="() => testState = 'error'"
/>
<Button testId="trigger" onClick="api.execute()" label="Execute" />
</Fragment>
`,
{
apiInterceptor: basicApiInterceptor,
},
);
const button = await createButtonDriver("trigger");
await button.click();
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual("error");
});
test("handles very large request payloads", async ({ initTestBed, createButtonDriver }) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall
id="api"
url="/api/test/1"
method="post"
body="{$param}"
onSuccess="() => testState = 'success'"
/>
<Button testId="trigger" onClick="api.execute({ data: 'x'.repeat(10000) })" label="Execute" />
</Fragment>
`,
{
apiInterceptor: basicApiInterceptor,
},
);
const button = await createButtonDriver("trigger");
await button.click();
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual("success");
});
test("handles special Unicode characters in data", async ({
initTestBed,
createButtonDriver,
}) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall
id="api"
url="/api/test/1"
method="post"
body="{$param}"
onSuccess="result => testState = result.data.emoji"
/>
<Button testId="trigger" onClick="api.execute({ emoji: '👨👩👧👦🚀', chinese: '你好世界' })" label="Execute" />
</Fragment>
`,
{
apiInterceptor: basicApiInterceptor,
},
);
const button = await createButtonDriver("trigger");
await button.click();
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual("👨👩👧👦🚀");
});
test("handles rapid successive API calls", async ({ page, initTestBed, createButtonDriver }) => {
const { testStateDriver } = await initTestBed(
`
<Fragment>
<APICall
id="api"
url="/api/test"
onSuccess="testState ??= 0; testState++;"
/>
<Button testId="trigger" onClick="api.execute()" label="Execute" />
</Fragment>
`,
{
apiInterceptor: basicApiInterceptor,
},
);
const button = await createButtonDriver("trigger");
// Rapidly click multiple times
await button.click();
await page.waitForTimeout(100);
await button.click();
await page.waitForTimeout(100);
await button.click();
await page.waitForTimeout(100);
// Should handle all calls
await expect.poll(testStateDriver.testState, { timeout: 5000 }).toEqual(3);
});
test("handles component cleanup correctly", async ({ initTestBed, createButtonDriver }) => {
const { testStateDriver } = await initTestBed(
`
<Fragment var.showApi="true">
<Fragment if="showApi">
<APICall id="api" url="/api/test" onSuccess="() => testState = 'success'" />
</Fragment>
<Button testId="trigger" onClick="api.execute()" label="Execute" />
<Button testId="hide" onClick="showApi = false" label="Hide" />
</Fragment>
`,
{
apiInterceptor: basicApiInterceptor,
},
);
const executeButton = await createButtonDriver("trigger");
const hideButton = await createButtonDriver("hide");
// Execute API call first
await executeButton.click();
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual("success");
// Hide the component
await hideButton.click();
// Try to execute again (should not crash)
try {
await executeButton.click();
} catch (error) {
// This is expected as the component is no longer available
}
});
test("handles when condition preventing execution", async ({
initTestBed,
createButtonDriver,
}) => {
const { testStateDriver } = await initTestBed(
`
<Fragment var.allowExecution="false">
<APICall
id="api"
url="/api/test"
when="allowExecution"
onSuccess="() => testState = 'success'"
onError="() => testState = 'error'"
/>
<Button testId="trigger" onClick="api.execute()" label="Execute" />
<Button testId="allow" onClick="allowExecution = true" label="Allow" />
</Fragment>
`,
{
apiInterceptor: basicApiInterceptor,
},
);
const executeButton = await createButtonDriver("trigger");
const allowButton = await createButtonDriver("allow");
// Try to execute when not allowed
await executeButton.click();
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual(null);
// Allow execution and try again
await allowButton.click();
await executeButton.click();
await expect.poll(testStateDriver.testState, { timeout: 2000 }).toEqual("success");
});
});
```
--------------------------------------------------------------------------------
/xmlui/src/components/TimeInput/TimeInputNative.tsx:
--------------------------------------------------------------------------------
```typescript
import { type CSSProperties } from "react";
import {
forwardRef,
useCallback,
useEffect,
useMemo,
useRef,
useState,
} from "react";
import classnames from "classnames";
import styles from "./TimeInput.module.scss";
import { PartialInput } from "../Input/PartialInput";
import { InputDivider } from "../Input/InputDivider";
import type { RegisterComponentApiFn, UpdateStateFn } from "../../abstractions/RendererDefs";
import { useEvent } from "../../components-core/utils/misc";
import type { ValidationStatus } from "../abstractions";
import { Adornment } from "../Input/InputAdornment";
import Icon from "../Icon/IconNative";
// Import utilities and types from merged utils file
import {
getHours,
getMinutes,
getSeconds,
convert24to12,
getAmPmLabels,
safeMax,
safeMin,
type AmPmType,
} from "./utils";
// Component part names
const PART_HOUR = "hour";
const PART_MINUTE = "minute";
const PART_SECOND = "second";
const PART_AMPM = "ampm";
const PART_CLEAR_BUTTON = "clearButton";
// Browser compatibility checks
// Time format configuration flags
export type TimeInputConfig = {
hour24: boolean;
seconds: boolean;
};
type Props = {
id?: string;
initialValue?: string;
value?: string;
enabled?: boolean;
updateState?: UpdateStateFn;
style?: CSSProperties;
className?: string;
onDidChange?: (newValue: string | null) => void;
onFocus?: (ev: React.FocusEvent<HTMLDivElement>) => void;
onBlur?: (ev: React.FocusEvent<HTMLDivElement>) => void;
onInvalidChange?: () => void;
validationStatus?: ValidationStatus;
registerComponentApi?: RegisterComponentApiFn;
hour24?: boolean;
seconds?: boolean;
minTime?: string;
maxTime?: string;
clearable?: boolean;
clearIcon?: string;
clearToInitialValue?: boolean;
required?: boolean;
startText?: string;
startIcon?: string;
endText?: string;
endIcon?: string;
gap?: string;
readOnly?: boolean;
autoFocus?: boolean;
emptyCharacter?: string;
};
export const defaultProps = {
enabled: true,
validationStatus: "none" as ValidationStatus,
hour24: true,
seconds: false,
clearable: false,
clearToInitialValue: true,
required: false,
readOnly: false,
autoFocus: false,
emptyCharacter: "-",
};
export const TimeInputNative = forwardRef<HTMLDivElement, Props>(function TimeInputNative(
{
id,
initialValue,
value: controlledValue,
enabled = defaultProps.enabled,
updateState,
style,
className,
onDidChange,
onFocus,
onBlur,
onInvalidChange,
validationStatus = defaultProps.validationStatus,
registerComponentApi,
hour24 = defaultProps.hour24,
seconds = defaultProps.seconds,
minTime,
maxTime,
clearable = defaultProps.clearable,
clearIcon,
clearToInitialValue = defaultProps.clearToInitialValue,
required = defaultProps.required,
startText,
startIcon,
endText,
endIcon,
gap,
readOnly = defaultProps.readOnly,
autoFocus = defaultProps.autoFocus,
emptyCharacter = defaultProps.emptyCharacter,
...rest
},
ref,
) {
const timeInputRef = useRef<HTMLDivElement>(null);
// Refs for auto-tabbing between inputs
const hourInputRef = useRef<HTMLInputElement>(null);
const minuteInputRef = useRef<HTMLInputElement>(null);
const secondInputRef = useRef<HTMLInputElement>(null);
const amPmButtonRef = useRef<HTMLButtonElement>(null);
// Process emptyCharacter according to requirements
const processedEmptyCharacter = useMemo(() => {
if (!emptyCharacter || emptyCharacter.length === 0) {
return "-";
}
if (emptyCharacter.length > 1) {
return emptyCharacter.charAt(0);
}
return emptyCharacter;
}, [emptyCharacter]);
// Stabilize initialValue to prevent unnecessary re-renders
const stableInitialValue = useMemo(() => {
return initialValue;
}, [initialValue]);
// Local state management - sync with value prop (like TextBox and NumberBox)
const [localValue, setLocalValue] = useState<string | null>(() => {
const initial = controlledValue || stableInitialValue || null;
return initial;
});
// Parse current value into individual components
const [amPm, setAmPm] = useState<AmPmType | null>(null);
const [hour, setHour] = useState<string | null>(null);
const [minute, setMinute] = useState<string | null>(null);
const [second, setSecond] = useState<string | null>(null);
// Track whether the component currently has focus
const [componentHasFocus, setComponentHasFocus] = useState(false);
// State to track invalid status for visual feedback
const [isHourCurrentlyInvalid, setIsHourCurrentlyInvalid] = useState(false);
const [isMinuteCurrentlyInvalid, setIsMinuteCurrentlyInvalid] = useState(false);
const [isSecondCurrentlyInvalid, setIsSecondCurrentlyInvalid] = useState(false);
useEffect(() => {
// Initialize XMLUI state with initial value on first mount
if (updateState && stableInitialValue !== undefined && controlledValue === undefined) {
updateState({ value: stableInitialValue }, { initial: true });
return; // Don't sync on this first run, let the state update trigger a re-render
}
// Sync with controlled value - always sync when controlledValue changes
const newLocalValue = controlledValue || null;
setLocalValue(newLocalValue);
}, [controlledValue, stableInitialValue, updateState]);
// Determine what components to show based on flags
const is12HourFormat = !hour24;
const showSeconds = seconds;
const showLeadingZeros = hour24; // Always show leading zeros in 24-hour format
// Parse value into individual components
useEffect(() => {
if (localValue) {
const {
amPm: parsedAmPm,
hour: hourStr,
minute: minuteStr,
second: secondStr,
} = parseTimeString(localValue, is12HourFormat);
setAmPm(parsedAmPm);
setHour(hourStr);
setMinute(minuteStr);
setSecond(secondStr);
} else {
setAmPm(null);
setHour(null);
setMinute(null);
setSecond(null);
}
}, [localValue, is12HourFormat]);
// Event handlers
const handleChange = useEvent((newValue: string | null) => {
// Update local state immediately for immediate UI feedback
setLocalValue(newValue);
// Also update the XMLUI state
if (updateState) {
updateState({ value: newValue });
}
onDidChange?.(newValue);
});
// Helper function to format the complete time value
const formatTimeValue = useCallback(
(
h: string | null,
m: string | null,
s: string | null,
ap: AmPmType | null,
is12Hour: boolean,
): string | null => {
if (!h || !m) {
return null;
}
let formattedTime = "";
if (is12Hour) {
// 12-hour format
const hour12 = h.padStart(2, "0");
const minute12 = m.padStart(2, "0");
formattedTime = `${hour12}:${minute12}`;
if (s && showSeconds) {
formattedTime += `:${s.padStart(2, "0")}`;
}
if (ap) {
formattedTime += ` ${ap}`;
}
} else {
// 24-hour format
const hour24 = h.padStart(2, "0");
const minute24 = m.padStart(2, "0");
formattedTime = `${hour24}:${minute24}`;
if (s && showSeconds) {
formattedTime += `:${s.padStart(2, "0")}`;
}
}
return formattedTime;
},
[showSeconds],
);
// Generic handlers for input change and blur
const createInputChangeHandler = useCallback(
(
field: "hour" | "minute" | "second",
setValue: (value: string) => void,
setInvalid: (invalid: boolean) => void,
validateFn: (value: string) => boolean,
) =>
(event: React.ChangeEvent<HTMLInputElement>) => {
const newValue = event.target.value;
setValue(newValue);
// Update invalid state immediately for visual feedback
const isInvalid = validateFn(newValue);
setInvalid(isInvalid);
// Fire invalidTime event if the value is invalid
if (isInvalid) {
onInvalidChange?.();
}
// Don't format/normalize during typing - only on blur
},
[onInvalidChange],
);
const createInputBlurHandler = useCallback(
(
field: "hour" | "minute" | "second",
setValue: (value: string) => void,
setInvalid: (invalid: boolean) => void,
normalizeFn: (value: string) => string | null,
) =>
(event: React.FocusEvent<HTMLInputElement>) => {
const currentValue = event.target.value;
const normalizedValue = normalizeFn(currentValue);
// Check if the current value was invalid (needed normalization or couldn't be normalized)
const wasInvalid =
currentValue !== "" && (normalizedValue === null || normalizedValue !== currentValue);
if (normalizedValue !== null && normalizedValue !== currentValue) {
setValue(normalizedValue);
setInvalid(false); // Clear invalid state after normalization
// Always call handleChange to update the time value
const timeValues = { hour, minute, second };
timeValues[field] = normalizedValue;
const timeString = formatTimeValue(
timeValues.hour,
timeValues.minute,
timeValues.second,
amPm,
is12HourFormat,
);
handleChange(timeString);
} else if (normalizedValue === null && currentValue !== "") {
// Reset to previous valid value or clear
setValue("");
setInvalid(false); // Clear invalid state
// Always call handleChange to update the time value (likely to null)
const timeValues = { hour, minute, second };
timeValues[field] = "";
const timeString = formatTimeValue(
timeValues.hour,
timeValues.minute,
timeValues.second,
amPm,
is12HourFormat,
);
handleChange(timeString);
} else if (normalizedValue !== null) {
// Value didn't need normalization, but still update the complete time
const timeValues = { hour, minute, second };
timeValues[field] = normalizedValue;
const timeString = formatTimeValue(
timeValues.hour,
timeValues.minute,
timeValues.second,
amPm,
is12HourFormat,
);
handleChange(timeString);
}
},
[hour, minute, second, formatTimeValue, amPm, is12HourFormat, handleChange],
);
// Handle changes from individual inputs
const handleHourChange = useMemo(
() =>
createInputChangeHandler("hour", setHour, setIsHourCurrentlyInvalid, (value) =>
isHourInvalid(value, !is12HourFormat),
),
[createInputChangeHandler, is12HourFormat],
);
const handleHourBlur = useMemo(
() =>
createInputBlurHandler("hour", setHour, setIsHourCurrentlyInvalid, (value) =>
normalizeHour(value, !is12HourFormat),
),
[createInputBlurHandler, is12HourFormat],
);
const handleMinuteChange = useMemo(
() =>
createInputChangeHandler(
"minute",
setMinute,
setIsMinuteCurrentlyInvalid,
isMinuteOrSecondInvalid,
),
[createInputChangeHandler],
);
const handleMinuteBlur = useMemo(
() =>
createInputBlurHandler(
"minute",
setMinute,
setIsMinuteCurrentlyInvalid,
normalizeMinuteOrSecond,
),
[createInputBlurHandler],
);
const handleSecondChange = useMemo(
() =>
createInputChangeHandler(
"second",
setSecond,
setIsSecondCurrentlyInvalid,
isMinuteOrSecondInvalid,
),
[createInputChangeHandler],
);
const handleSecondBlur = useMemo(
() =>
createInputBlurHandler(
"second",
setSecond,
setIsSecondCurrentlyInvalid,
normalizeMinuteOrSecond,
),
[createInputBlurHandler],
);
const handleAmPmToggle = useCallback(() => {
const newAmPm: AmPmType = amPm === "am" ? "pm" : "am";
setAmPm(newAmPm);
// Always call handleChange to update the time value
const timeString = formatTimeValue(hour, minute, second, newAmPm, is12HourFormat);
handleChange(timeString);
}, [amPm, formatTimeValue, hour, minute, second, is12HourFormat, handleChange]);
const handleAmPmSet = useCallback(
(targetAmPm: AmPmType) => {
if (amPm === targetAmPm) return; // No change needed
setAmPm(targetAmPm);
// Always call handleChange to update the time value
const timeString = formatTimeValue(hour, minute, second, targetAmPm, is12HourFormat);
handleChange(timeString);
},
[amPm, formatTimeValue, hour, minute, second, is12HourFormat, handleChange],
);
// Focus method
const focus = useCallback(() => {
const input = timeInputRef.current?.querySelector(
'input[type="time"], input[name*="hour"], input[name*="minute"]',
) as HTMLInputElement;
input?.focus();
}, []);
// Custom focus handler that fires gotFocus when component gains focus
const handleComponentFocus = useCallback(
(event: React.FocusEvent<HTMLDivElement>) => {
// If component didn't have focus before, fire gotFocus
if (!componentHasFocus) {
setComponentHasFocus(true);
onFocus?.(event);
}
},
[componentHasFocus, onFocus],
);
// Custom blur handler that only fires lostFocus when focus leaves the entire component
const handleComponentBlur = useCallback(
(event: React.FocusEvent<HTMLDivElement>) => {
// Check if the new focus target is still within this TimeInput component
const relatedTarget = event.relatedTarget as HTMLElement;
const currentTarget = event.currentTarget;
// If there's no related target, or the related target is not within this component, fire lostFocus
if (!relatedTarget || !currentTarget.contains(relatedTarget)) {
setComponentHasFocus(false);
onBlur?.(event);
}
},
[onBlur],
);
// Arrow key navigation handler
const createArrowKeyHandler = useCallback(() => {
return (event: React.KeyboardEvent<HTMLInputElement | HTMLButtonElement>) => {
const { key } = event;
if (key === "ArrowRight") {
event.preventDefault();
const currentTarget = event.target as HTMLInputElement | HTMLButtonElement;
// Determine next input based on current input
if (currentTarget === hourInputRef.current && minuteInputRef.current) {
minuteInputRef.current.focus();
minuteInputRef.current.select();
} else if (currentTarget === minuteInputRef.current) {
if (showSeconds && secondInputRef.current) {
secondInputRef.current.focus();
secondInputRef.current.select();
} else if (!showSeconds && is12HourFormat && amPmButtonRef.current) {
amPmButtonRef.current.focus();
}
} else if (
currentTarget === secondInputRef.current &&
is12HourFormat &&
amPmButtonRef.current
) {
amPmButtonRef.current.focus();
}
} else if (key === "ArrowLeft") {
event.preventDefault();
const currentTarget = event.target as HTMLInputElement | HTMLButtonElement;
// Determine previous input based on current input
if (currentTarget === minuteInputRef.current && hourInputRef.current) {
hourInputRef.current.focus();
hourInputRef.current.select();
} else if (currentTarget === secondInputRef.current && minuteInputRef.current) {
minuteInputRef.current.focus();
minuteInputRef.current.select();
} else if (currentTarget === amPmButtonRef.current) {
if (showSeconds && secondInputRef.current) {
secondInputRef.current.focus();
secondInputRef.current.select();
} else if (!showSeconds && minuteInputRef.current) {
minuteInputRef.current.focus();
minuteInputRef.current.select();
}
}
}
};
}, [showSeconds, is12HourFormat]);
// Create the arrow key handler instance
const handleArrowKeys = createArrowKeyHandler();
const clear = useCallback(() => {
// Reset to initial value if provided, otherwise null
let valueToReset = clearToInitialValue
? stableInitialValue !== undefined
? stableInitialValue
: null
: null;
if (valueToReset) {
const {
amPm: amPmValue,
hour: hourStr,
minute: minuteStr,
second: secondStr,
} = parseTimeString(String(valueToReset), is12HourFormat);
setHour(hourStr);
setMinute(minuteStr);
setSecond(secondStr);
setAmPm(amPmValue);
} else {
// Clear all fields
setHour(null);
setMinute(null);
setSecond(null);
setAmPm(null);
}
handleChange(valueToReset);
// Focus the component after clearing
setTimeout(() => {
focus();
}, 0);
}, [clearToInitialValue, stableInitialValue, handleChange, is12HourFormat, focus]);
function stopPropagation(event: React.FocusEvent) {
event.stopPropagation();
}
const setValue = useEvent((newValue: string | null) => {
handleChange(newValue);
});
// Function to get ISO formatted time value (HH:MM:SS in 24-hour format)
const getIsoValue = useCallback((): string | null => {
if (!hour || !minute) {
return null;
}
// Convert to 24-hour format if currently in 12-hour format
let hour24: number;
if (is12HourFormat && amPm) {
const hourInt = parseInt(hour, 10);
if (amPm === "am") {
hour24 = hourInt === 12 ? 0 : hourInt;
} else {
// pm
hour24 = hourInt === 12 ? 12 : hourInt + 12;
}
} else {
hour24 = parseInt(hour, 10);
}
// Format as ISO time string (HH:MM:SS)
const h24 = hour24.toString().padStart(2, "0");
const m24 = minute.padStart(2, "0");
const s24 = (second || "00").padStart(2, "0");
return `${h24}:${m24}:${s24}`;
}, [hour, minute, second, amPm, is12HourFormat]);
// Component API registration
useEffect(() => {
if (registerComponentApi) {
registerComponentApi({
focus,
setValue,
isoValue: getIsoValue,
});
}
}, [registerComponentApi, focus, setValue, getIsoValue]);
// Custom clear icon
const clearIconElement = useMemo(() => {
if (clearIcon === null || clearIcon === "null") return null;
if (clearIcon) return <Icon name={clearIcon} />;
// Default clear icon
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width={19}
height={19}
viewBox="0 0 19 19"
stroke="currentColor"
strokeWidth={2}
aria-hidden="true"
className={classnames(styles.clearButtonIcon, styles.buttonIcon)}
>
<line x1="4" x2="15" y1="4" y2="15" />
<line x1="15" x2="4" y1="4" y2="15" />
</svg>
);
}, [clearIcon]);
// Adornments
const startAdornment = useMemo(() => {
if (startIcon || startText) {
return <Adornment iconName={startIcon} text={startText} className={styles.adornment} />;
}
return null;
}, [startIcon, startText]);
const endAdornment = useMemo(() => {
if (endIcon || endText) {
return <Adornment iconName={endIcon} text={endText} className={styles.adornment} />;
}
return null;
}, [endIcon, endText]);
const timeInputComponent = (
<div
ref={timeInputRef}
className={classnames(
styles.timeInputWrapper,
{
[styles.error]: validationStatus === "error",
[styles.warning]: validationStatus === "warning",
[styles.valid]: validationStatus === "valid",
[styles.disabled]: !enabled,
[styles.readOnly]: readOnly,
},
className,
)}
style={{ ...style, gap }}
onFocusCapture={handleComponentFocus}
onBlur={handleComponentBlur}
data-validation-status={validationStatus}
{...rest}
>
{startAdornment}
<div className={styles.wrapper}>
<div className={styles.inputGroup}>
{/* Hour input */}
<HourInput
id={id}
amPm={amPm}
autoFocus={autoFocus}
disabled={!enabled}
inputRef={hourInputRef}
nextInputRef={minuteInputRef}
maxTime={maxTime}
minTime={minTime}
onChange={handleHourChange}
onBlur={handleHourBlur}
onKeyDown={handleArrowKeys}
readOnly={readOnly}
required={required}
value={hour}
isInvalid={isHourCurrentlyInvalid}
is24Hour={!is12HourFormat}
emptyCharacter={processedEmptyCharacter}
/>
<InputDivider separator=":" />
{/* Minute input */}
<MinuteInput
disabled={!enabled}
hour={hour}
inputRef={minuteInputRef}
nextInputRef={showSeconds ? secondInputRef : undefined}
nextButtonRef={showSeconds ? undefined : is12HourFormat ? amPmButtonRef : undefined}
maxTime={maxTime}
minTime={minTime}
onChange={handleMinuteChange}
onBlur={handleMinuteBlur}
onKeyDown={handleArrowKeys}
readOnly={readOnly}
required={required}
showLeadingZeros={showLeadingZeros}
value={minute}
isInvalid={isMinuteCurrentlyInvalid}
emptyCharacter={processedEmptyCharacter}
/>
{/* Second input (if needed) */}
{showSeconds && (
<>
<InputDivider separator=":" className={styles.divider} />
<SecondInput
disabled={!enabled}
hour={hour}
inputRef={secondInputRef}
nextButtonRef={is12HourFormat ? amPmButtonRef : undefined}
maxTime={maxTime}
minTime={minTime}
minute={minute}
onChange={handleSecondChange}
onBlur={handleSecondBlur}
onKeyDown={handleArrowKeys}
readOnly={readOnly}
required={required}
showLeadingZeros={showLeadingZeros}
value={second}
isInvalid={isSecondCurrentlyInvalid}
emptyCharacter={processedEmptyCharacter}
/>
</>
)}
{/* AM/PM selector (if 12-hour format) */}
{is12HourFormat && (
<AmPmButton
className="timeinput"
disabled={!enabled}
buttonRef={amPmButtonRef}
maxTime={maxTime}
minTime={minTime}
onClick={handleAmPmToggle}
onAmPmSet={handleAmPmSet}
onKeyDown={handleArrowKeys}
value={amPm}
/>
)}
</div>
{clearable && (
<button
data-part-id={PART_CLEAR_BUTTON}
className={classnames(styles.clearButton, styles.button)}
disabled={!enabled}
onClick={clear}
onFocus={stopPropagation}
type="button"
>
{clearIconElement}
</button>
)}
</div>
{endAdornment}
</div>
);
return timeInputComponent;
});
// AmPm component types and implementation
type AmPmProps = {
ariaLabel?: string;
autoFocus?: boolean;
className: string;
disabled?: boolean;
locale?: string;
maxTime?: string;
minTime?: string;
onClick?: () => void;
onAmPmSet?: (amPm: AmPmType) => void;
onKeyDown?: (event: React.KeyboardEvent<HTMLButtonElement>) => void;
buttonRef?: React.RefObject<HTMLButtonElement | null>;
required?: boolean;
value?: string | null;
};
function AmPmButton({
ariaLabel,
autoFocus,
className,
disabled,
locale,
maxTime,
minTime,
onClick,
onAmPmSet,
onKeyDown,
buttonRef,
value,
}: AmPmProps): React.ReactElement {
const amDisabled = minTime ? convert24to12(getHours(minTime))[1] === "pm" : false;
const pmDisabled = maxTime ? convert24to12(getHours(maxTime))[1] === "am" : false;
const [amLabel, pmLabel] = getAmPmLabels(locale);
// Determine if the button should be disabled based on time constraints
const isDisabled = disabled || (value === "am" && pmDisabled) || (value === "pm" && amDisabled);
const handleKeyDown = useCallback(
(event: React.KeyboardEvent<HTMLButtonElement>) => {
// First call the external key handler (for arrow navigation)
if (onKeyDown) {
onKeyDown(event);
}
// If the event was handled (preventDefault called), don't process further
if (event.defaultPrevented || disabled) return;
const key = event.key.toLowerCase();
// Handle 'a' or 'A' to set AM
if (key === "a" && !amDisabled && value !== "am" && onAmPmSet) {
event.preventDefault();
onAmPmSet("am");
}
// Handle 'p' or 'P' to set PM
else if (key === "p" && !pmDisabled && value !== "pm" && onAmPmSet) {
event.preventDefault();
onAmPmSet("pm");
}
},
[onKeyDown, disabled, onAmPmSet, value, amDisabled, pmDisabled],
);
return (
<button
type="button"
data-part-id={PART_AMPM}
aria-label={ariaLabel || "Toggle AM/PM (Press A for AM, P for PM)"}
autoFocus={autoFocus}
className={classnames(styles.amPmButton, styles.button, className)}
disabled={isDisabled}
onClick={onClick}
onKeyDown={handleKeyDown}
ref={buttonRef as React.RefObject<HTMLButtonElement>}
>
<span className={styles.amPmValue}>
{value ? (value === "am" ? amLabel : pmLabel) : "--"}
</span>
</button>
);
}
// HourInput component (unified for both 12-hour and 24-hour formats)
// Generic input properties used by time input components
type TimeInputElementProps = {
ariaLabel?: string;
autoFocus?: boolean;
disabled?: boolean;
inputRef?: React.RefObject<HTMLInputElement | null>;
nextInputRef?: React.RefObject<HTMLInputElement | null>;
nextButtonRef?: React.RefObject<HTMLButtonElement | null>;
onChange?: (event: React.ChangeEvent<HTMLInputElement> & { target: HTMLInputElement }) => void;
onBlur?: (event: React.FocusEvent<HTMLInputElement> & { target: HTMLInputElement }) => void;
onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement> & { target: HTMLInputElement }) => void;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
step?: number;
};
// HourInput component
type HourInputProps = {
id?: string;
amPm?: AmPmType | null;
maxTime?: string;
minTime?: string;
value?: string | null;
isInvalid?: boolean;
is24Hour?: boolean; // true for 24-hour format, false for 12-hour format
emptyCharacter?: string;
} & Omit<TimeInputElementProps, "max" | "min" | "name" | "nameForClass" | "value">;
function HourInput({
id,
amPm,
maxTime,
minTime,
value,
isInvalid = false,
is24Hour = false,
emptyCharacter = "-",
...otherProps
}: HourInputProps): React.ReactElement {
// Calculate min/max based on format
const { minHour, maxHour } = (() => {
if (is24Hour) {
// 24-hour format: 0-23
return {
maxHour: safeMin(23, maxTime && getHours(maxTime)),
minHour: safeMax(0, minTime && getHours(minTime)),
};
} else {
// 12-hour format: 1-12
const maxHour = safeMin(
12,
maxTime &&
(() => {
const [maxHourResult, maxAmPm] = convert24to12(getHours(maxTime));
if (maxAmPm !== amPm) {
// pm is always after am, so we should ignore validation
return null;
}
return maxHourResult;
})(),
);
const minHour = safeMax(
1,
minTime &&
(() => {
const [minHourResult, minAmPm] = convert24to12(getHours(minTime));
if (
// pm is always after am, so we should ignore validation
minAmPm !== amPm ||
// If minHour is 12 am/pm, user should be able to enter 12, 1, ..., 11.
minHourResult === 12
) {
return null;
}
return minHourResult;
})(),
);
return { maxHour, minHour };
}
})();
// Always show the raw value during typing, no conversion
// This allows users to see invalid input like "23" before it gets normalized on blur
const displayValue = value || "";
return (
<PartialInput
id={id}
data-part-id={PART_HOUR}
value={displayValue}
emptyCharacter={emptyCharacter}
placeholderLength={2}
max={maxHour}
min={minHour}
maxLength={2}
validateFn={(val) => isHourInvalid(val, is24Hour)}
onChange={otherProps.onChange}
onBlur={(direction, event) => {
// PartialInput provides direction, but the current onBlur expects just the event
if (otherProps.onBlur) {
otherProps.onBlur(event);
}
}}
onKeyDown={otherProps.onKeyDown}
className={classnames(styles.input, styles.hour)}
invalidClassName={styles.invalid}
disabled={otherProps.disabled}
readOnly={otherProps.readOnly}
required={otherProps.required}
autoFocus={otherProps.autoFocus}
inputRef={otherProps.inputRef}
nextInputRef={otherProps.nextInputRef}
nextButtonRef={otherProps.nextButtonRef}
name={is24Hour ? "hour24" : "hour12"}
ariaLabel={otherProps.ariaLabel}
isInvalid={isInvalid}
/>
);
}
// MinuteInput component
type MinuteInputProps = {
hour?: string | null;
maxTime?: string;
minTime?: string;
showLeadingZeros?: boolean;
value?: string | null;
isInvalid?: boolean;
emptyCharacter?: string;
} & Omit<TimeInputElementProps, "max" | "min" | "name" | "value">;
function MinuteInput({
hour,
maxTime,
minTime,
showLeadingZeros = true,
value,
isInvalid = false,
emptyCharacter = "-",
...otherProps
}: MinuteInputProps): React.ReactElement {
function isSameHour(date: string | Date) {
return hour === getHours(date).toString();
}
const maxMinute = safeMin(59, maxTime && isSameHour(maxTime) && getMinutes(maxTime));
const minMinute = safeMax(0, minTime && isSameHour(minTime) && getMinutes(minTime));
return (
<PartialInput
data-part-id={PART_MINUTE}
max={maxMinute}
min={minMinute}
name="minute"
value={value}
validateFn={isMinuteOrSecondInvalid}
emptyCharacter={emptyCharacter}
placeholderLength={2}
maxLength={2}
onChange={otherProps.onChange}
onBlur={(direction, event) => {
// PartialInput provides direction, but the current onBlur expects just the event
if (otherProps.onBlur) {
otherProps.onBlur(event);
}
}}
onKeyDown={otherProps.onKeyDown}
className={classnames(styles.input, styles.minute)}
invalidClassName={styles.invalid}
disabled={otherProps.disabled}
readOnly={otherProps.readOnly}
required={otherProps.required}
autoFocus={otherProps.autoFocus}
inputRef={otherProps.inputRef}
nextInputRef={otherProps.nextInputRef}
nextButtonRef={otherProps.nextButtonRef}
ariaLabel={otherProps.ariaLabel}
isInvalid={isInvalid}
/>
);
}
// SecondInput component
type SecondInputProps = {
hour?: string | null;
maxTime?: string;
minTime?: string;
minute?: string | null;
showLeadingZeros?: boolean;
value?: string | null;
isInvalid?: boolean;
emptyCharacter?: string;
} & Omit<TimeInputElementProps, "max" | "min" | "name" | "value">;
function SecondInput({
hour,
maxTime,
minTime,
minute,
showLeadingZeros = true,
value,
isInvalid = false,
emptyCharacter = "-",
...otherProps
}: SecondInputProps): React.ReactElement {
function isSameMinute(date: string | Date) {
return hour === getHours(date).toString() && minute === getMinutes(date).toString();
}
const maxSecond = safeMin(59, maxTime && isSameMinute(maxTime) && getSeconds(maxTime));
const minSecond = safeMax(0, minTime && isSameMinute(minTime) && getSeconds(minTime));
return (
<PartialInput
data-part-id={PART_SECOND}
max={maxSecond}
min={minSecond}
name="second"
value={value}
validateFn={isMinuteOrSecondInvalid}
emptyCharacter={emptyCharacter}
placeholderLength={2}
maxLength={2}
onChange={otherProps.onChange}
onBlur={(direction, event) => {
// PartialInput provides direction, but the current onBlur expects just the event
if (otherProps.onBlur) {
otherProps.onBlur(event);
}
}}
onKeyDown={otherProps.onKeyDown}
className={classnames(styles.input, styles.second)}
invalidClassName={styles.invalid}
disabled={otherProps.disabled}
readOnly={otherProps.readOnly}
required={otherProps.required}
autoFocus={otherProps.autoFocus}
inputRef={otherProps.inputRef}
nextInputRef={otherProps.nextInputRef}
nextButtonRef={otherProps.nextButtonRef}
ariaLabel={otherProps.ariaLabel}
isInvalid={isInvalid}
/>
);
}
// Utility function to parse time string into components
function parseTimeString(timeValue: any, targetIs12Hour: boolean = false) {
// Handle non-string values gracefully
if (timeValue == null || timeValue === undefined) {
return {
amPm: null,
hour: "",
minute: "",
second: "",
};
}
// If not a string, return empty values for type safety
if (typeof timeValue !== "string") {
return {
amPm: null,
hour: "",
minute: "",
second: "",
};
}
const timeString = timeValue;
const normalizedTimeString = timeString.toLowerCase();
// Check if the time string contains AM/PM
const hasAmPm = normalizedTimeString.includes("am") || normalizedTimeString.includes("pm");
const isAmPmPm = normalizedTimeString.includes("pm");
// Extract just the time part (remove AM/PM suffix)
const timePart = normalizedTimeString.replace(/\s*(am|pm)\s*$/i, "").trim();
let parsedHour = getHours(timePart);
let parsedMinute = getMinutes(timePart);
let parsedSecond = getSeconds(timePart);
// If parsing with the current format fails (all zeros), try ISO time format
if (
parsedHour === 0 &&
parsedMinute === 0 &&
parsedSecond === 0 &&
timePart !== "00:00:00" &&
timePart !== "00:00"
) {
try {
// Try parsing as ISO time format using Date constructor
const isoDate = new Date(`1970-01-01T${timePart}`);
if (!isNaN(isoDate.getTime())) {
parsedHour = isoDate.getHours();
parsedMinute = isoDate.getMinutes();
parsedSecond = isoDate.getSeconds();
}
} catch {
// If ISO parsing fails, keep the original parsed values (zeros)
}
}
// Set AM/PM based on the actual string content or convert from 24-hour
let amPmValue: AmPmType | null = null;
let displayHour = parsedHour;
if (hasAmPm) {
// String already has AM/PM, use the hour as-is (should be 1-12)
amPmValue = isAmPmPm ? "pm" : "am";
} else {
// If no AM/PM in string, derive it from 24-hour format
const [hour12, amPm12] = convert24to12(parsedHour);
amPmValue = amPm12;
// If target format is 12-hour, convert the hour value
if (targetIs12Hour) {
displayHour = hour12;
}
}
// Format hour value appropriately
const hourStr = displayHour.toString().padStart(2, "0");
const minuteStr = parsedMinute.toString().padStart(2, "0");
const secondStr = parsedSecond.toString().padStart(2, "0");
return {
amPm: amPmValue,
hour: hourStr,
minute: minuteStr,
second: secondStr,
};
}
// Normalize the hour value based on 12/24 hour format
function normalizeHour(value: string | null, is24Hour: boolean): string | null {
if (!value || value === "") return null;
const num = parseInt(value, 10);
if (isNaN(num)) return null;
if (is24Hour) {
// 24-hour format: 0-23
if (num >= 0 && num <= 23) {
return num.toString().padStart(2, "0");
} else {
// For out-of-range values, use value % 10
const corrected = num % 10;
return corrected.toString().padStart(2, "0");
}
} else {
// 12-hour format: 1-12
if (num >= 1 && num <= 12) {
return num.toString().padStart(2, "0");
} else if (num === 0) {
return "12"; // 0 becomes 12 in 12-hour format
} else {
// For out-of-range values, use value % 10, but ensure it's 1-12
let corrected = num % 10;
if (corrected === 0) corrected = 12; // 0 becomes 12 in 12-hour format
return corrected.toString().padStart(2, "0");
}
}
}
// Normalize the minute or second value
function normalizeMinuteOrSecond(value: string | null): string | null {
if (!value || value === "") return null;
const num = parseInt(value, 10);
if (isNaN(num)) return null;
if (num >= 0 && num <= 59) {
return num.toString().padStart(2, "0");
} else {
// For out-of-range values, use value % 10
const corrected = num % 10;
return corrected.toString().padStart(2, "0");
}
}
// Helper functions to check if values are currently invalid (need normalization)
function isHourInvalid(value: string | null, is24Hour: boolean): boolean {
if (!value || value === "") return false;
const num = parseInt(value, 10);
if (isNaN(num)) {
return true;
}
const invalid = is24Hour ? num < 0 || num > 23 : num < 1 || num > 12;
return invalid;
}
function isMinuteOrSecondInvalid(value: string | null): boolean {
if (!value || value === "") return false;
const num = parseInt(value, 10);
if (isNaN(num)) {
return true;
}
const invalid = num < 0 || num > 59;
return invalid;
}
```