@webquark/browser 0.0.0-stage → 1.1.0-dev.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +12 -2
- package/dist/cjs/Leaflet.GoogleMutant-i4bYl6qy.js +768 -0
- package/dist/cjs/action.props-DmLaQuU2.js +35 -0
- package/dist/cjs/chevron-up-D4t2OSHA.js +30 -0
- package/dist/cjs/collection-identity-CV5HLD9Z.js +141 -0
- package/dist/cjs/data-table-cell-8uUCk2Qz.js +51 -0
- package/dist/cjs/dom-Dk77oFF6.js +247 -0
- package/dist/cjs/field-CEZ9NsWK.js +14 -0
- package/dist/cjs/form-control-validity-D1ukC0_e.js +49 -0
- package/dist/cjs/form-field-adapter-D0CJ6poh.js +51 -0
- package/dist/cjs/form-field-state-P63wN30v.js +51 -0
- package/dist/cjs/form-submit-action-C6c4aq6C.js +227 -0
- package/dist/cjs/image-crop-BZD5Cxd7.js +53 -0
- package/dist/cjs/index-CMAcJ6t1.js +1869 -0
- package/dist/cjs/index.cjs.js +34 -0
- package/dist/cjs/leaflet-maplibre-gl-JIaCQ-7v.js +1025 -0
- package/dist/cjs/leaflet-src-mrRg-Srs.js +14551 -0
- package/dist/cjs/loader.cjs.js +12 -0
- package/dist/cjs/map.types-BWymIRql.js +24 -0
- package/dist/cjs/q-accordion.cjs.entry.js +18 -0
- package/dist/cjs/q-alert.cjs.entry.js +52 -0
- package/dist/cjs/q-avatar.cjs.entry.js +101 -0
- package/dist/cjs/q-banner.cjs.entry.js +19 -0
- package/dist/cjs/q-button_2.cjs.entry.js +462 -0
- package/dist/cjs/q-card.cjs.entry.js +88 -0
- package/dist/cjs/q-carousel.cjs.entry.js +718 -0
- package/dist/cjs/q-chip.cjs.entry.js +124 -0
- package/dist/cjs/q-conversation-bubble.cjs.entry.js +70 -0
- package/dist/cjs/q-data-table.cjs.entry.js +611 -0
- package/dist/cjs/q-dialog.cjs.entry.js +271 -0
- package/dist/cjs/q-divider.cjs.entry.js +26 -0
- package/dist/cjs/q-dropdown.cjs.entry.js +718 -0
- package/dist/cjs/q-form.cjs.entry.js +1002 -0
- package/dist/cjs/q-grid.cjs.entry.js +24 -0
- package/dist/cjs/q-icon.cjs.entry.js +439 -0
- package/dist/cjs/q-image-comparison.cjs.entry.js +201 -0
- package/dist/cjs/q-inline.cjs.entry.js +22 -0
- package/dist/cjs/q-input_2.cjs.entry.js +440 -0
- package/dist/cjs/q-link.cjs.entry.js +80 -0
- package/dist/cjs/q-map.cjs.entry.js +3509 -0
- package/dist/cjs/q-media.cjs.entry.js +21 -0
- package/dist/cjs/q-navbar.cjs.entry.js +415 -0
- package/dist/cjs/q-pagination.cjs.entry.js +68 -0
- package/dist/cjs/q-panel.cjs.entry.js +76 -0
- package/dist/cjs/q-quantity-selector.cjs.entry.js +204 -0
- package/dist/cjs/q-radio-group.cjs.entry.js +261 -0
- package/dist/cjs/q-reel.cjs.entry.js +170 -0
- package/dist/cjs/q-scrollable.cjs.entry.js +449 -0
- package/dist/cjs/q-section.cjs.entry.js +20 -0
- package/dist/cjs/q-sidepanel.cjs.entry.js +793 -0
- package/dist/cjs/q-stack.cjs.entry.js +20 -0
- package/dist/cjs/q-step-diagram-item.cjs.entry.js +45 -0
- package/dist/cjs/q-step-diagram.cjs.entry.js +56 -0
- package/dist/cjs/q-syntax-box.cjs.entry.js +782 -0
- package/dist/cjs/q-tabs.cjs.entry.js +155 -0
- package/dist/cjs/q-textarea.cjs.entry.js +297 -0
- package/dist/cjs/q-thumbnail.cjs.entry.js +51 -0
- package/dist/cjs/q-toast.cjs.entry.js +400 -0
- package/dist/cjs/q-toggle.cjs.entry.js +233 -0
- package/dist/cjs/q-toolbar.cjs.entry.js +33 -0
- package/dist/cjs/registry-CzkkkaZO.js +323 -0
- package/dist/cjs/toast-controller-CIXagxbV.js +111 -0
- package/dist/cjs/tokens-Cd7g-VMz.js +960 -0
- package/dist/cjs/utils-DGQOjEwT.js +33 -0
- package/dist/cjs/webquark.cjs.js +24 -0
- package/dist/collection/assets/icons/braces.svg +14 -0
- package/dist/collection/assets/icons/check.svg +1 -0
- package/dist/collection/assets/icons/chevron-down.svg +1 -0
- package/dist/collection/assets/icons/chevron-left.svg +1 -0
- package/dist/collection/assets/icons/chevron-right.svg +1 -0
- package/dist/collection/assets/icons/chevron-up.svg +1 -0
- package/dist/collection/assets/icons/copy.svg +4 -0
- package/dist/collection/assets/icons/eye-off.svg +1 -0
- package/dist/collection/assets/icons/eye.svg +1 -0
- package/dist/collection/assets/icons/minus.svg +1 -0
- package/dist/collection/assets/icons/play.svg +1 -0
- package/dist/collection/assets/icons/plus.svg +1 -0
- package/dist/collection/assets/icons/search.svg +1 -0
- package/dist/collection/assets/icons/spinner.svg +1 -0
- package/dist/collection/assets/icons/trash-2.svg +1 -0
- package/dist/collection/assets/icons/x.svg +1 -0
- package/dist/collection/collection-manifest.json +57 -0
- package/dist/collection/components/actions/action.props.js +130 -0
- package/dist/collection/components/actions/button/button.css +242 -0
- package/dist/collection/components/actions/button/button.js +748 -0
- package/dist/collection/components/actions/button/button.types.js +1 -0
- package/dist/collection/components/actions/button/button.utils.js +9 -0
- package/dist/collection/components/actions/button/test/button-slots.cmp.test.js +70 -0
- package/dist/collection/components/actions/button/test/button.utils.unit.test.js +44 -0
- package/dist/collection/components/actions/link/link.css +102 -0
- package/dist/collection/components/actions/link/link.js +316 -0
- package/dist/collection/components/actions/link/link.types.js +1 -0
- package/dist/collection/components/communication/alert/alert.css +118 -0
- package/dist/collection/components/communication/alert/alert.js +208 -0
- package/dist/collection/components/communication/alert/alert.types.js +1 -0
- package/dist/collection/components/communication/conversation-bubble/conversation-bubble.css +154 -0
- package/dist/collection/components/communication/conversation-bubble/conversation-bubble.js +207 -0
- package/dist/collection/components/communication/conversation-bubble/conversation-bubble.types.js +1 -0
- package/dist/collection/components/communication/toast/internals/icons.js +25 -0
- package/dist/collection/components/communication/toast/internals/queue.js +64 -0
- package/dist/collection/components/communication/toast/internals/timers.js +75 -0
- package/dist/collection/components/communication/toast/test/toast.cmp.test.js +38 -0
- package/dist/collection/components/communication/toast/test/toast.unit.test.js +104 -0
- package/dist/collection/components/communication/toast/toast-controller.js +105 -0
- package/dist/collection/components/communication/toast/toast.css +141 -0
- package/dist/collection/components/communication/toast/toast.js +556 -0
- package/dist/collection/components/communication/toast/toast.types.js +1 -0
- package/dist/collection/components/content/banner/banner.css +1 -0
- package/dist/collection/components/content/banner/banner.js +84 -0
- package/dist/collection/components/content/banner/banner.types.js +1 -0
- package/dist/collection/components/content/card/card.css +105 -0
- package/dist/collection/components/content/card/card.js +308 -0
- package/dist/collection/components/content/card/card.types.js +1 -0
- package/dist/collection/components/content/card/card.utils.js +15 -0
- package/dist/collection/components/content/carousel/carousel.css +254 -0
- package/dist/collection/components/content/carousel/carousel.js +956 -0
- package/dist/collection/components/content/carousel/carousel.types.js +1 -0
- package/dist/collection/components/content/carousel/carousel.utils.js +1 -0
- package/dist/collection/components/content/carousel/internals/autoplay.js +64 -0
- package/dist/collection/components/content/carousel/internals/metrics.js +59 -0
- package/dist/collection/components/content/carousel/internals/slide-state.js +50 -0
- package/dist/collection/components/content/carousel/test/transitions.cmp.test.js +328 -0
- package/dist/collection/components/data-display/accordion/accordion.css +1 -0
- package/dist/collection/components/data-display/accordion/accordion.js +54 -0
- package/dist/collection/components/data-display/accordion/accordion.types.js +1 -0
- package/dist/collection/components/data-display/chip/chip.css +219 -0
- package/dist/collection/components/data-display/chip/chip.js +381 -0
- package/dist/collection/components/data-display/chip/chip.types.js +1 -0
- package/dist/collection/components/data-display/data-table/data-table-cell.js +44 -0
- package/dist/collection/components/data-display/data-table/data-table.css +429 -0
- package/dist/collection/components/data-display/data-table/data-table.js +862 -0
- package/dist/collection/components/data-display/data-table/data-table.types.js +1 -0
- package/dist/collection/components/data-display/data-table/internals/data-access.js +43 -0
- package/dist/collection/components/data-display/data-table/internals/render-row-actions.js +22 -0
- package/dist/collection/components/data-display/data-table/internals/render-sort-indicator.js +5 -0
- package/dist/collection/components/data-display/data-table/internals/render-table-body.js +59 -0
- package/dist/collection/components/data-display/data-table/internals/render-table-head.js +42 -0
- package/dist/collection/components/data-display/data-table/internals/render-toolbar.js +6 -0
- package/dist/collection/components/data-display/data-table/internals/row-events.js +27 -0
- package/dist/collection/components/data-display/data-table/internals/selection.js +31 -0
- package/dist/collection/components/data-display/data-table/internals/sort.js +57 -0
- package/dist/collection/components/data-display/data-table/internals/table-model.js +92 -0
- package/dist/collection/components/data-display/data-table/test/row-gutter.cmp.test.js +104 -0
- package/dist/collection/components/data-display/data-table/test/two-line-rows.cmp.test.js +164 -0
- package/dist/collection/components/data-display/map/internals/base-layer.js +140 -0
- package/dist/collection/components/data-display/map/internals/bounds.js +66 -0
- package/dist/collection/components/data-display/map/internals/buffered-tile-layer.js +128 -0
- package/dist/collection/components/data-display/map/internals/cluster-collision.js +73 -0
- package/dist/collection/components/data-display/map/internals/google-maps.js +117 -0
- package/dist/collection/components/data-display/map/internals/google-mutant.js +51 -0
- package/dist/collection/components/data-display/map/internals/maplibre.js +50 -0
- package/dist/collection/components/data-display/map/internals/marker-cluster-index.js +136 -0
- package/dist/collection/components/data-display/map/internals/marker-controller.js +425 -0
- package/dist/collection/components/data-display/map/internals/marker-presentation.js +266 -0
- package/dist/collection/components/data-display/map/internals/marker-visibility.js +158 -0
- package/dist/collection/components/data-display/map/internals/markers.js +191 -0
- package/dist/collection/components/data-display/map/internals/tile-layer-readiness.js +67 -0
- package/dist/collection/components/data-display/map/internals/tile-preload-buffer.js +8 -0
- package/dist/collection/components/data-display/map/internals/vector-padding.js +8 -0
- package/dist/collection/components/data-display/map/map.css +742 -0
- package/dist/collection/components/data-display/map/map.js +1595 -0
- package/dist/collection/components/data-display/map/map.types.js +12 -0
- package/dist/collection/components/data-display/map/test/map.cmp.test.js +961 -0
- package/dist/collection/components/data-display/pagination/pagination.css +81 -0
- package/dist/collection/components/data-display/pagination/pagination.js +240 -0
- package/dist/collection/components/data-display/pagination/test/pagination.cmp.test.js +57 -0
- package/dist/collection/components/data-display/syntax-box/internals/clipboard.js +9 -0
- package/dist/collection/components/data-display/syntax-box/internals/editor-key-action.js +14 -0
- package/dist/collection/components/data-display/syntax-box/internals/formatter.js +156 -0
- package/dist/collection/components/data-display/syntax-box/internals/formatter.unit.test.js +71 -0
- package/dist/collection/components/data-display/syntax-box/internals/syntax.js +239 -0
- package/dist/collection/components/data-display/syntax-box/internals/syntax.unit.test.js +134 -0
- package/dist/collection/components/data-display/syntax-box/internals/value-sync.js +10 -0
- package/dist/collection/components/data-display/syntax-box/internals/value-sync.unit.test.js +25 -0
- package/dist/collection/components/data-display/syntax-box/syntax-box.css +209 -0
- package/dist/collection/components/data-display/syntax-box/syntax-box.js +678 -0
- package/dist/collection/components/data-display/syntax-box/syntax-box.types.js +1 -0
- package/dist/collection/components/data-display/syntax-box/syntax-box.utils.js +1 -0
- package/dist/collection/components/data-display/syntax-box/test/format-fixtures.js +20 -0
- package/dist/collection/components/data-display/syntax-box/test/syntax-box.cmp.test.js +241 -0
- package/dist/collection/components/data-display/syntax-box/test/syntax-fixtures.js +14 -0
- package/dist/collection/components/data-display/syntax-box/test/syntax-format.cmp.test.js +157 -0
- package/dist/collection/components/indicators/progress/progress.css +223 -0
- package/dist/collection/components/indicators/progress/progress.js +275 -0
- package/dist/collection/components/indicators/progress/progress.types.js +1 -0
- package/dist/collection/components/indicators/step-diagram/step-diagram.css +21 -0
- package/dist/collection/components/indicators/step-diagram/step-diagram.js +143 -0
- package/dist/collection/components/indicators/step-diagram/step-diagram.types.js +1 -0
- package/dist/collection/components/indicators/step-diagram-item/step-diagram-item.css +252 -0
- package/dist/collection/components/indicators/step-diagram-item/step-diagram-item.js +185 -0
- package/dist/collection/components/indicators/step-diagram-item/step-diagram-item.types.js +1 -0
- package/dist/collection/components/indicators/step-diagram-item/step-diagram-item.utils.js +3 -0
- package/dist/collection/components/inputs/dropdown/dropdown.css +420 -0
- package/dist/collection/components/inputs/dropdown/dropdown.js +1303 -0
- package/dist/collection/components/inputs/dropdown/dropdown.types.js +1 -0
- package/dist/collection/components/inputs/dropdown/internals/options.js +30 -0
- package/dist/collection/components/inputs/dropdown/internals/position.js +35 -0
- package/dist/collection/components/inputs/dropdown/test/dropdown.cmp.test.js +90 -0
- package/dist/collection/components/inputs/dropdown/test/search-mode.cmp.test.js +186 -0
- package/dist/collection/components/inputs/form/form.css +85 -0
- package/dist/collection/components/inputs/form/form.js +808 -0
- package/dist/collection/components/inputs/form/form.types.js +1 -0
- package/dist/collection/components/inputs/form/internals/controls.js +173 -0
- package/dist/collection/components/inputs/form/internals/enter-behavior.js +25 -0
- package/dist/collection/components/inputs/form/internals/field-state.js +129 -0
- package/dist/collection/components/inputs/form/internals/reset.js +50 -0
- package/dist/collection/components/inputs/form/internals/submission.js +140 -0
- package/dist/collection/components/inputs/form/internals/values.js +199 -0
- package/dist/collection/components/inputs/form/internals/values.unit.test.js +59 -0
- package/dist/collection/components/inputs/form/test/form-reset-state.cmp.test.js +559 -0
- package/dist/collection/components/inputs/form/test/form-submit-transport.cmp.test.js +352 -0
- package/dist/collection/components/inputs/form/test/form-submit.cmp.test.js +444 -0
- package/dist/collection/components/inputs/form/test/form-values.cmp.test.js +440 -0
- package/dist/collection/components/inputs/form/test/form.cmp.test.js +157 -0
- package/dist/collection/components/inputs/input/input.css +313 -0
- package/dist/collection/components/inputs/input/input.js +935 -0
- package/dist/collection/components/inputs/input/input.types.js +1 -0
- package/dist/collection/components/inputs/input/input.utils.js +3 -0
- package/dist/collection/components/inputs/quantity-selector/internals/number-value.js +64 -0
- package/dist/collection/components/inputs/quantity-selector/quantity-selector.css +171 -0
- package/dist/collection/components/inputs/quantity-selector/quantity-selector.js +390 -0
- package/dist/collection/components/inputs/quantity-selector/quantity-selector.types.js +1 -0
- package/dist/collection/components/inputs/radio-group/radio-group.css +224 -0
- package/dist/collection/components/inputs/radio-group/radio-group.js +668 -0
- package/dist/collection/components/inputs/radio-group/radio-group.types.js +1 -0
- package/dist/collection/components/inputs/radio-group/radio-group.utils.js +18 -0
- package/dist/collection/components/inputs/textarea/textarea.css +192 -0
- package/dist/collection/components/inputs/textarea/textarea.js +827 -0
- package/dist/collection/components/inputs/textarea/textarea.types.js +1 -0
- package/dist/collection/components/inputs/toggle/test/toggle-layout.cmp.test.js +69 -0
- package/dist/collection/components/inputs/toggle/toggle.css +257 -0
- package/dist/collection/components/inputs/toggle/toggle.js +610 -0
- package/dist/collection/components/inputs/toggle/toggle.types.js +1 -0
- package/dist/collection/components/inputs/toggle/toggle.utils.js +3 -0
- package/dist/collection/components/layout/divider/divider.css +40 -0
- package/dist/collection/components/layout/divider/divider.js +121 -0
- package/dist/collection/components/layout/divider/test/divider.cmp.test.js +105 -0
- package/dist/collection/components/layout/grid/grid.css +11 -0
- package/dist/collection/components/layout/grid/grid.js +152 -0
- package/dist/collection/components/layout/inline/inline.css +4 -0
- package/dist/collection/components/layout/inline/inline.js +118 -0
- package/dist/collection/components/layout/navbar/navbar.css +584 -0
- package/dist/collection/components/layout/navbar/navbar.js +848 -0
- package/dist/collection/components/layout/navbar/navbar.types.js +1 -0
- package/dist/collection/components/layout/navbar/navbar.utils.js +13 -0
- package/dist/collection/components/layout/navbar/test/navbar.cmp.test.js +369 -0
- package/dist/collection/components/layout/panel/panel.css +114 -0
- package/dist/collection/components/layout/panel/panel.js +394 -0
- package/dist/collection/components/layout/panel/panel.types.js +1 -0
- package/dist/collection/components/layout/scrollable/internals/metrics.js +61 -0
- package/dist/collection/components/layout/scrollable/internals/native-scrollbar.js +41 -0
- package/dist/collection/components/layout/scrollable/scrollable.css +123 -0
- package/dist/collection/components/layout/scrollable/scrollable.js +565 -0
- package/dist/collection/components/layout/scrollable/scrollable.types.js +1 -0
- package/dist/collection/components/layout/section/section.css +1 -0
- package/dist/collection/components/layout/section/section.js +98 -0
- package/dist/collection/components/layout/section/section.types.js +1 -0
- package/dist/collection/components/layout/sidepanel/internals/drawer.js +98 -0
- package/dist/collection/components/layout/sidepanel/internals/groups.js +56 -0
- package/dist/collection/components/layout/sidepanel/internals/nav-items.js +30 -0
- package/dist/collection/components/layout/sidepanel/sidepanel.css +1035 -0
- package/dist/collection/components/layout/sidepanel/sidepanel.js +1001 -0
- package/dist/collection/components/layout/sidepanel/sidepanel.types.js +1 -0
- package/dist/collection/components/layout/sidepanel/sidepanel.utils.js +17 -0
- package/dist/collection/components/layout/sidepanel/test/nav-drawer-transitions.cmp.test.js +120 -0
- package/dist/collection/components/layout/sidepanel/test/panel-transitions.cmp.test.js +180 -0
- package/dist/collection/components/layout/stack/stack.css +4 -0
- package/dist/collection/components/layout/stack/stack.js +76 -0
- package/dist/collection/components/layout/tabs/tabs.css +248 -0
- package/dist/collection/components/layout/tabs/tabs.js +322 -0
- package/dist/collection/components/layout/tabs/tabs.types.js +1 -0
- package/dist/collection/components/layout/tabs/tabs.utils.js +31 -0
- package/dist/collection/components/layout/tabs/test/tabs.cmp.test.js +165 -0
- package/dist/collection/components/layout/toolbar/toolbar.css +168 -0
- package/dist/collection/components/layout/toolbar/toolbar.js +251 -0
- package/dist/collection/components/layout/toolbar/toolbar.types.js +1 -0
- package/dist/collection/components/media/avatar/avatar.css +71 -0
- package/dist/collection/components/media/avatar/avatar.js +302 -0
- package/dist/collection/components/media/avatar/avatar.types.js +1 -0
- package/dist/collection/components/media/icon/icon.css +42 -0
- package/dist/collection/components/media/icon/icon.js +510 -0
- package/dist/collection/components/media/icon/icon.types.js +1 -0
- package/dist/collection/components/media/icon/internals/constants.js +3 -0
- package/dist/collection/components/media/icon/internals/fetch-icon.js +47 -0
- package/dist/collection/components/media/icon/internals/fetch-icon.unit.test.js +51 -0
- package/dist/collection/components/media/icon/internals/policy.js +184 -0
- package/dist/collection/components/media/icon/internals/policy.unit.test.js +65 -0
- package/dist/collection/components/media/icon/internals/registry-lucide.unit.test.js +78 -0
- package/dist/collection/components/media/icon/internals/registry.js +122 -0
- package/dist/collection/components/media/icon/internals/registry.unit.test.js +42 -0
- package/dist/collection/components/media/icon/internals/render-definition.js +24 -0
- package/dist/collection/components/media/icon/internals/sanitize-svg.js +86 -0
- package/dist/collection/components/media/icon/internals/size.js +12 -0
- package/dist/collection/components/media/icon/internals/url.js +52 -0
- package/dist/collection/components/media/icon/internals/url.unit.test.js +34 -0
- package/dist/collection/components/media/icon/test/icon-fixtures.js +47 -0
- package/dist/collection/components/media/icon/test/icon.cmp.test.js +223 -0
- package/dist/collection/components/media/image-comparison/image-comparison.css +124 -0
- package/dist/collection/components/media/image-comparison/image-comparison.js +468 -0
- package/dist/collection/components/media/image-comparison/test/image-comparison.cmp.test.js +234 -0
- package/dist/collection/components/media/media/media.css +1 -0
- package/dist/collection/components/media/media/media.js +125 -0
- package/dist/collection/components/media/media/media.types.js +1 -0
- package/dist/collection/components/media/reel/reel.css +193 -0
- package/dist/collection/components/media/reel/reel.js +279 -0
- package/dist/collection/components/media/reel/reel.types.js +1 -0
- package/dist/collection/components/media/thumbnail/thumbnail.css +111 -0
- package/dist/collection/components/media/thumbnail/thumbnail.js +184 -0
- package/dist/collection/components/media/thumbnail/thumbnail.types.js +1 -0
- package/dist/collection/components/overlays/dialog/dialog.css +264 -0
- package/dist/collection/components/overlays/dialog/dialog.js +743 -0
- package/dist/collection/components/overlays/dialog/dialog.types.js +1 -0
- package/dist/collection/components/overlays/dialog/internals/backdrop.js +9 -0
- package/dist/collection/components/overlays/dialog/internals/lifecycle.js +53 -0
- package/dist/collection/components/overlays/tooltip/internals/aria.js +27 -0
- package/dist/collection/components/overlays/tooltip/internals/positioning.js +84 -0
- package/dist/collection/components/overlays/tooltip/internals/scroll-listeners.js +18 -0
- package/dist/collection/components/overlays/tooltip/tooltip.css +69 -0
- package/dist/collection/components/overlays/tooltip/tooltip.js +196 -0
- package/dist/collection/components/overlays/tooltip/tooltip.types.js +1 -0
- package/dist/collection/components/shared/field.js +8 -0
- package/dist/collection/components/shared/test/orientation.cmp.test.js +36 -0
- package/dist/collection/index.js +16 -0
- package/dist/collection/native-content.css +24 -0
- package/dist/collection/theme/test/foundation.cmp.test.js +353 -0
- package/dist/collection/theme/test/input-width.cmp.test.js +117 -0
- package/dist/collection/theme/test/presets.cmp.test.js +129 -0
- package/dist/collection/theme/test/presets.unit.test.js +58 -0
- package/dist/collection/theme/tokens.js +963 -0
- package/dist/collection/utils/collection-identity.js +136 -0
- package/dist/collection/utils/collection-identity.unit.test.js +107 -0
- package/dist/collection/utils/dom.js +236 -0
- package/dist/collection/utils/form-control-validity.js +44 -0
- package/dist/collection/utils/form-field-adapter.js +44 -0
- package/dist/collection/utils/form-field-state.js +45 -0
- package/dist/collection/utils/form-reset-action.js +60 -0
- package/dist/collection/utils/form-submit-action.js +151 -0
- package/dist/collection/utils/form-submit-action.unit.test.js +15 -0
- package/dist/collection/utils/image-crop.js +47 -0
- package/dist/collection/utils/image-crop.unit.test.js +57 -0
- package/dist/collection/utils/math.js +19 -0
- package/dist/collection/utils/utils.js +28 -0
- package/dist/collection/utils/utils.unit.test.js +16 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.js +1 -0
- package/dist/components/p--r63tfQH.js +1 -0
- package/dist/components/p-0feRVg70.js +1 -0
- package/dist/components/p-BDsIecIx.js +1 -0
- package/dist/components/p-BIIQL66b.js +1 -0
- package/dist/components/p-BJiYCN3i.js +1 -0
- package/dist/components/p-BOdNg0jc.js +1 -0
- package/dist/components/p-BcL0NVv0.js +1 -0
- package/dist/components/p-Bj2RJb2E.js +1 -0
- package/dist/components/p-ByfrUWx1.js +1 -0
- package/dist/components/p-CGZPmEUB.js +1 -0
- package/dist/components/p-CGml_DQ8.js +1 -0
- package/dist/components/p-CLErjC1f.js +1 -0
- package/dist/components/p-CSucjZb7.js +1 -0
- package/dist/components/p-CYG3Oakz.js +1 -0
- package/dist/components/p-C_RztzNv.js +5 -0
- package/dist/components/p-CoIMrUb3.js +1 -0
- package/dist/components/p-CpI3m4_T.js +1 -0
- package/dist/components/p-DBbiaYqQ.js +1 -0
- package/dist/components/p-DKrPmn2y.js +13 -0
- package/dist/components/p-DQhiqYeq.js +1 -0
- package/dist/components/p-DYMWBqU1.js +5 -0
- package/dist/components/p-DbI_F3z0.js +1 -0
- package/dist/components/p-DstNl_WY.js +1 -0
- package/dist/components/p-DuX-9GOi.js +1 -0
- package/dist/components/p-SzKf4WZF.js +1 -0
- package/dist/components/p-cSh-5xis.js +1 -0
- package/dist/components/p-iXEnb5d5.js +1 -0
- package/dist/components/q-accordion.d.ts +11 -0
- package/dist/components/q-accordion.js +1 -0
- package/dist/components/q-alert.d.ts +11 -0
- package/dist/components/q-alert.js +1 -0
- package/dist/components/q-avatar.d.ts +11 -0
- package/dist/components/q-avatar.js +1 -0
- package/dist/components/q-banner.d.ts +11 -0
- package/dist/components/q-banner.js +1 -0
- package/dist/components/q-button.d.ts +11 -0
- package/dist/components/q-button.js +1 -0
- package/dist/components/q-card.d.ts +11 -0
- package/dist/components/q-card.js +1 -0
- package/dist/components/q-carousel.d.ts +11 -0
- package/dist/components/q-carousel.js +1 -0
- package/dist/components/q-chip.d.ts +11 -0
- package/dist/components/q-chip.js +1 -0
- package/dist/components/q-conversation-bubble.d.ts +11 -0
- package/dist/components/q-conversation-bubble.js +1 -0
- package/dist/components/q-data-table.d.ts +11 -0
- package/dist/components/q-data-table.js +1 -0
- package/dist/components/q-dialog.d.ts +11 -0
- package/dist/components/q-dialog.js +1 -0
- package/dist/components/q-divider.d.ts +11 -0
- package/dist/components/q-divider.js +1 -0
- package/dist/components/q-dropdown.d.ts +11 -0
- package/dist/components/q-dropdown.js +1 -0
- package/dist/components/q-form.d.ts +11 -0
- package/dist/components/q-form.js +1 -0
- package/dist/components/q-grid.d.ts +11 -0
- package/dist/components/q-grid.js +1 -0
- package/dist/components/q-icon.d.ts +11 -0
- package/dist/components/q-icon.js +1 -0
- package/dist/components/q-image-comparison.d.ts +11 -0
- package/dist/components/q-image-comparison.js +1 -0
- package/dist/components/q-inline.d.ts +11 -0
- package/dist/components/q-inline.js +1 -0
- package/dist/components/q-input.d.ts +11 -0
- package/dist/components/q-input.js +1 -0
- package/dist/components/q-link.d.ts +11 -0
- package/dist/components/q-link.js +1 -0
- package/dist/components/q-map.d.ts +11 -0
- package/dist/components/q-map.js +1 -0
- package/dist/components/q-media.d.ts +11 -0
- package/dist/components/q-media.js +1 -0
- package/dist/components/q-navbar.d.ts +11 -0
- package/dist/components/q-navbar.js +1 -0
- package/dist/components/q-pagination.d.ts +11 -0
- package/dist/components/q-pagination.js +1 -0
- package/dist/components/q-panel.d.ts +11 -0
- package/dist/components/q-panel.js +1 -0
- package/dist/components/q-progress.d.ts +11 -0
- package/dist/components/q-progress.js +1 -0
- package/dist/components/q-quantity-selector.d.ts +11 -0
- package/dist/components/q-quantity-selector.js +1 -0
- package/dist/components/q-radio-group.d.ts +11 -0
- package/dist/components/q-radio-group.js +1 -0
- package/dist/components/q-reel.d.ts +11 -0
- package/dist/components/q-reel.js +1 -0
- package/dist/components/q-scrollable.d.ts +11 -0
- package/dist/components/q-scrollable.js +1 -0
- package/dist/components/q-section.d.ts +11 -0
- package/dist/components/q-section.js +1 -0
- package/dist/components/q-sidepanel.d.ts +11 -0
- package/dist/components/q-sidepanel.js +13 -0
- package/dist/components/q-stack.d.ts +11 -0
- package/dist/components/q-stack.js +1 -0
- package/dist/components/q-step-diagram-item.d.ts +11 -0
- package/dist/components/q-step-diagram-item.js +1 -0
- package/dist/components/q-step-diagram.d.ts +11 -0
- package/dist/components/q-step-diagram.js +1 -0
- package/dist/components/q-syntax-box.d.ts +11 -0
- package/dist/components/q-syntax-box.js +13 -0
- package/dist/components/q-tabs.d.ts +11 -0
- package/dist/components/q-tabs.js +1 -0
- package/dist/components/q-textarea.d.ts +11 -0
- package/dist/components/q-textarea.js +1 -0
- package/dist/components/q-thumbnail.d.ts +11 -0
- package/dist/components/q-thumbnail.js +1 -0
- package/dist/components/q-toast.d.ts +11 -0
- package/dist/components/q-toast.js +1 -0
- package/dist/components/q-toggle.d.ts +11 -0
- package/dist/components/q-toggle.js +1 -0
- package/dist/components/q-toolbar.d.ts +11 -0
- package/dist/components/q-toolbar.js +1 -0
- package/dist/components/q-tooltip.d.ts +11 -0
- package/dist/components/q-tooltip.js +1 -0
- package/dist/esm/Leaflet.GoogleMutant-MpxOb4Jm.js +766 -0
- package/dist/esm/action.props-DhnvhbLl.js +32 -0
- package/dist/esm/chevron-up-DKrPmn2y.js +27 -0
- package/dist/esm/collection-identity-CGZPmEUB.js +138 -0
- package/dist/esm/data-table-cell-SzKf4WZF.js +46 -0
- package/dist/esm/dom-ByfrUWx1.js +238 -0
- package/dist/esm/field-u-k7C7Rf.js +11 -0
- package/dist/esm/form-control-validity-Bj2RJb2E.js +46 -0
- package/dist/esm/form-field-adapter-CGml_DQ8.js +46 -0
- package/dist/esm/form-field-state-DstNl_WY.js +47 -0
- package/dist/esm/form-submit-action-CoEIvDqE.js +213 -0
- package/dist/esm/image-crop-BcL0NVv0.js +49 -0
- package/dist/esm/index-DaJmsCb7.js +1858 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/leaflet-maplibre-gl-BvKlNmWf.js +1020 -0
- package/dist/esm/leaflet-src-DYMWBqU1.js +14547 -0
- package/dist/esm/loader.js +10 -0
- package/dist/esm/map.types-CoIMrUb3.js +14 -0
- package/dist/esm/q-accordion.entry.js +16 -0
- package/dist/esm/q-alert.entry.js +50 -0
- package/dist/esm/q-avatar.entry.js +99 -0
- package/dist/esm/q-banner.entry.js +17 -0
- package/dist/esm/q-button_2.entry.js +459 -0
- package/dist/esm/q-card.entry.js +86 -0
- package/dist/esm/q-carousel.entry.js +716 -0
- package/dist/esm/q-chip.entry.js +122 -0
- package/dist/esm/q-conversation-bubble.entry.js +68 -0
- package/dist/esm/q-data-table.entry.js +609 -0
- package/dist/esm/q-dialog.entry.js +269 -0
- package/dist/esm/q-divider.entry.js +24 -0
- package/dist/esm/q-dropdown.entry.js +716 -0
- package/dist/esm/q-form.entry.js +1000 -0
- package/dist/esm/q-grid.entry.js +22 -0
- package/dist/esm/q-icon.entry.js +437 -0
- package/dist/esm/q-image-comparison.entry.js +199 -0
- package/dist/esm/q-inline.entry.js +20 -0
- package/dist/esm/q-input_2.entry.js +437 -0
- package/dist/esm/q-link.entry.js +78 -0
- package/dist/esm/q-map.entry.js +3507 -0
- package/dist/esm/q-media.entry.js +19 -0
- package/dist/esm/q-navbar.entry.js +413 -0
- package/dist/esm/q-pagination.entry.js +66 -0
- package/dist/esm/q-panel.entry.js +74 -0
- package/dist/esm/q-quantity-selector.entry.js +202 -0
- package/dist/esm/q-radio-group.entry.js +259 -0
- package/dist/esm/q-reel.entry.js +168 -0
- package/dist/esm/q-scrollable.entry.js +447 -0
- package/dist/esm/q-section.entry.js +18 -0
- package/dist/esm/q-sidepanel.entry.js +791 -0
- package/dist/esm/q-stack.entry.js +18 -0
- package/dist/esm/q-step-diagram-item.entry.js +43 -0
- package/dist/esm/q-step-diagram.entry.js +54 -0
- package/dist/esm/q-syntax-box.entry.js +780 -0
- package/dist/esm/q-tabs.entry.js +153 -0
- package/dist/esm/q-textarea.entry.js +295 -0
- package/dist/esm/q-thumbnail.entry.js +49 -0
- package/dist/esm/q-toast.entry.js +398 -0
- package/dist/esm/q-toggle.entry.js +231 -0
- package/dist/esm/q-toolbar.entry.js +31 -0
- package/dist/esm/registry-CpI3m4_T.js +308 -0
- package/dist/esm/toast-controller-BIIQL66b.js +107 -0
- package/dist/esm/tokens-BDsIecIx.js +956 -0
- package/dist/esm/utils-BJiYCN3i.js +30 -0
- package/dist/esm/webquark.js +20 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/loader/cdn.js +1 -0
- package/dist/loader/index.cjs.js +1 -0
- package/dist/loader/index.d.ts +24 -0
- package/dist/loader/index.es2017.js +1 -0
- package/dist/loader/index.js +2 -0
- package/dist/playground/components/theme-designer/dimension-tokens.js +9 -0
- package/dist/playground/components/theme-designer/token-row.js +89 -0
- package/dist/playground/dom-factory.js +76 -0
- package/dist/playground/utils/color.js +26 -0
- package/dist/playground/utils/dom.js +38 -0
- package/dist/playground/utils/index.js +2 -0
- package/dist/types/components/actions/action.props.d.ts +19 -0
- package/dist/types/components/actions/button/button.d.ts +87 -0
- package/dist/types/components/actions/button/button.types.d.ts +6 -0
- package/dist/types/components/actions/button/button.utils.d.ts +8 -0
- package/dist/types/components/actions/button/test/button-slots.cmp.test.d.ts +1 -0
- package/dist/types/components/actions/button/test/button.utils.unit.test.d.ts +1 -0
- package/dist/types/components/actions/link/link.d.ts +43 -0
- package/dist/types/components/actions/link/link.types.d.ts +3 -0
- package/dist/types/components/communication/alert/alert.d.ts +32 -0
- package/dist/types/components/communication/alert/alert.types.d.ts +2 -0
- package/dist/types/components/communication/conversation-bubble/conversation-bubble.d.ts +38 -0
- package/dist/types/components/communication/conversation-bubble/conversation-bubble.types.d.ts +1 -0
- package/dist/types/components/communication/toast/internals/icons.d.ts +2 -0
- package/dist/types/components/communication/toast/internals/queue.d.ts +19 -0
- package/dist/types/components/communication/toast/internals/timers.d.ts +12 -0
- package/dist/types/components/communication/toast/test/toast.cmp.test.d.ts +2 -0
- package/dist/types/components/communication/toast/test/toast.unit.test.d.ts +1 -0
- package/dist/types/components/communication/toast/toast-controller.d.ts +9 -0
- package/dist/types/components/communication/toast/toast.d.ts +44 -0
- package/dist/types/components/communication/toast/toast.types.d.ts +30 -0
- package/dist/types/components/content/banner/banner.d.ts +12 -0
- package/dist/types/components/content/banner/banner.types.d.ts +2 -0
- package/dist/types/components/content/card/card.d.ts +35 -0
- package/dist/types/components/content/card/card.types.d.ts +1 -0
- package/dist/types/components/content/card/card.utils.d.ts +5 -0
- package/dist/types/components/content/carousel/carousel.d.ts +123 -0
- package/dist/types/components/content/carousel/carousel.types.d.ts +10 -0
- package/dist/types/components/content/carousel/carousel.utils.d.ts +1 -0
- package/dist/types/components/content/carousel/internals/autoplay.d.ts +22 -0
- package/dist/types/components/content/carousel/internals/metrics.d.ts +23 -0
- package/dist/types/components/content/carousel/internals/slide-state.d.ts +8 -0
- package/dist/types/components/content/carousel/test/transitions.cmp.test.d.ts +1 -0
- package/dist/types/components/data-display/accordion/accordion.d.ts +9 -0
- package/dist/types/components/data-display/accordion/accordion.types.d.ts +1 -0
- package/dist/types/components/data-display/chip/chip.d.ts +55 -0
- package/dist/types/components/data-display/chip/chip.types.d.ts +13 -0
- package/dist/types/components/data-display/data-table/data-table-cell.d.ts +7 -0
- package/dist/types/components/data-display/data-table/data-table.d.ts +95 -0
- package/dist/types/components/data-display/data-table/data-table.types.d.ts +56 -0
- package/dist/types/components/data-display/data-table/internals/data-access.d.ts +9 -0
- package/dist/types/components/data-display/data-table/internals/render-row-actions.d.ts +9 -0
- package/dist/types/components/data-display/data-table/internals/render-sort-indicator.d.ts +5 -0
- package/dist/types/components/data-display/data-table/internals/render-table-body.d.ts +13 -0
- package/dist/types/components/data-display/data-table/internals/render-table-head.d.ts +8 -0
- package/dist/types/components/data-display/data-table/internals/render-toolbar.d.ts +9 -0
- package/dist/types/components/data-display/data-table/internals/row-events.d.ts +1 -0
- package/dist/types/components/data-display/data-table/internals/selection.d.ts +10 -0
- package/dist/types/components/data-display/data-table/internals/sort.d.ts +3 -0
- package/dist/types/components/data-display/data-table/internals/table-model.d.ts +56 -0
- package/dist/types/components/data-display/data-table/test/row-gutter.cmp.test.d.ts +1 -0
- package/dist/types/components/data-display/data-table/test/two-line-rows.cmp.test.d.ts +1 -0
- package/dist/types/components/data-display/map/internals/base-layer.d.ts +63 -0
- package/dist/types/components/data-display/map/internals/bounds.d.ts +23 -0
- package/dist/types/components/data-display/map/internals/buffered-tile-layer.d.ts +10 -0
- package/dist/types/components/data-display/map/internals/cluster-collision.d.ts +15 -0
- package/dist/types/components/data-display/map/internals/google-maps.d.ts +9 -0
- package/dist/types/components/data-display/map/internals/google-mutant-module.d.ts +11 -0
- package/dist/types/components/data-display/map/internals/google-mutant.d.ts +18 -0
- package/dist/types/components/data-display/map/internals/maplibre.d.ts +14 -0
- package/dist/types/components/data-display/map/internals/marker-cluster-index.d.ts +36 -0
- package/dist/types/components/data-display/map/internals/marker-controller.d.ts +57 -0
- package/dist/types/components/data-display/map/internals/marker-presentation.d.ts +8 -0
- package/dist/types/components/data-display/map/internals/marker-visibility.d.ts +10 -0
- package/dist/types/components/data-display/map/internals/markers.d.ts +4 -0
- package/dist/types/components/data-display/map/internals/tile-layer-readiness.d.ts +11 -0
- package/dist/types/components/data-display/map/internals/tile-preload-buffer.d.ts +4 -0
- package/dist/types/components/data-display/map/internals/vector-padding.d.ts +4 -0
- package/dist/types/components/data-display/map/map.d.ts +175 -0
- package/dist/types/components/data-display/map/map.types.d.ts +132 -0
- package/dist/types/components/data-display/map/test/map.cmp.test.d.ts +1 -0
- package/dist/types/components/data-display/pagination/pagination.d.ts +33 -0
- package/dist/types/components/data-display/pagination/test/pagination.cmp.test.d.ts +2 -0
- package/dist/types/components/data-display/syntax-box/internals/clipboard.d.ts +2 -0
- package/dist/types/components/data-display/syntax-box/internals/editor-key-action.d.ts +12 -0
- package/dist/types/components/data-display/syntax-box/internals/formatter.d.ts +15 -0
- package/dist/types/components/data-display/syntax-box/internals/formatter.unit.test.d.ts +1 -0
- package/dist/types/components/data-display/syntax-box/internals/syntax.d.ts +13 -0
- package/dist/types/components/data-display/syntax-box/internals/syntax.unit.test.d.ts +1 -0
- package/dist/types/components/data-display/syntax-box/internals/value-sync.d.ts +15 -0
- package/dist/types/components/data-display/syntax-box/internals/value-sync.unit.test.d.ts +1 -0
- package/dist/types/components/data-display/syntax-box/syntax-box.d.ts +72 -0
- package/dist/types/components/data-display/syntax-box/syntax-box.types.d.ts +2 -0
- package/dist/types/components/data-display/syntax-box/syntax-box.utils.d.ts +1 -0
- package/dist/types/components/data-display/syntax-box/test/format-fixtures.d.ts +6 -0
- package/dist/types/components/data-display/syntax-box/test/syntax-box.cmp.test.d.ts +1 -0
- package/dist/types/components/data-display/syntax-box/test/syntax-fixtures.d.ts +9 -0
- package/dist/types/components/data-display/syntax-box/test/syntax-format.cmp.test.d.ts +1 -0
- package/dist/types/components/indicators/progress/progress.d.ts +30 -0
- package/dist/types/components/indicators/progress/progress.types.d.ts +3 -0
- package/dist/types/components/indicators/step-diagram/step-diagram.d.ts +19 -0
- package/dist/types/components/indicators/step-diagram/step-diagram.types.d.ts +3 -0
- package/dist/types/components/indicators/step-diagram-item/step-diagram-item.d.ts +26 -0
- package/dist/types/components/indicators/step-diagram-item/step-diagram-item.types.d.ts +5 -0
- package/dist/types/components/indicators/step-diagram-item/step-diagram-item.utils.d.ts +1 -0
- package/dist/types/components/inputs/dropdown/dropdown.d.ts +125 -0
- package/dist/types/components/inputs/dropdown/dropdown.types.d.ts +9 -0
- package/dist/types/components/inputs/dropdown/internals/options.d.ts +6 -0
- package/dist/types/components/inputs/dropdown/internals/position.d.ts +26 -0
- package/dist/types/components/inputs/dropdown/test/dropdown.cmp.test.d.ts +1 -0
- package/dist/types/components/inputs/dropdown/test/search-mode.cmp.test.d.ts +1 -0
- package/dist/types/components/inputs/form/form.d.ts +80 -0
- package/dist/types/components/inputs/form/form.types.d.ts +40 -0
- package/dist/types/components/inputs/form/internals/controls.d.ts +8 -0
- package/dist/types/components/inputs/form/internals/enter-behavior.d.ts +2 -0
- package/dist/types/components/inputs/form/internals/field-state.d.ts +19 -0
- package/dist/types/components/inputs/form/internals/reset.d.ts +3 -0
- package/dist/types/components/inputs/form/internals/submission.d.ts +17 -0
- package/dist/types/components/inputs/form/internals/values.d.ts +10 -0
- package/dist/types/components/inputs/form/internals/values.unit.test.d.ts +1 -0
- package/dist/types/components/inputs/form/test/form-reset-state.cmp.test.d.ts +1 -0
- package/dist/types/components/inputs/form/test/form-submit-transport.cmp.test.d.ts +1 -0
- package/dist/types/components/inputs/form/test/form-submit.cmp.test.d.ts +1 -0
- package/dist/types/components/inputs/form/test/form-values.cmp.test.d.ts +1 -0
- package/dist/types/components/inputs/form/test/form.cmp.test.d.ts +4 -0
- package/dist/types/components/inputs/input/input.d.ts +92 -0
- package/dist/types/components/inputs/input/input.types.d.ts +3 -0
- package/dist/types/components/inputs/input/input.utils.d.ts +1 -0
- package/dist/types/components/inputs/quantity-selector/internals/number-value.d.ts +13 -0
- package/dist/types/components/inputs/quantity-selector/quantity-selector.d.ts +37 -0
- package/dist/types/components/inputs/quantity-selector/quantity-selector.types.d.ts +3 -0
- package/dist/types/components/inputs/radio-group/radio-group.d.ts +70 -0
- package/dist/types/components/inputs/radio-group/radio-group.types.d.ts +12 -0
- package/dist/types/components/inputs/radio-group/radio-group.utils.d.ts +2 -0
- package/dist/types/components/inputs/textarea/textarea.d.ts +81 -0
- package/dist/types/components/inputs/textarea/textarea.types.d.ts +1 -0
- package/dist/types/components/inputs/toggle/test/toggle-layout.cmp.test.d.ts +1 -0
- package/dist/types/components/inputs/toggle/toggle.d.ts +67 -0
- package/dist/types/components/inputs/toggle/toggle.types.d.ts +3 -0
- package/dist/types/components/inputs/toggle/toggle.utils.d.ts +1 -0
- package/dist/types/components/layout/divider/divider.d.ts +15 -0
- package/dist/types/components/layout/divider/test/divider.cmp.test.d.ts +1 -0
- package/dist/types/components/layout/grid/grid.d.ts +13 -0
- package/dist/types/components/layout/inline/inline.d.ts +12 -0
- package/dist/types/components/layout/navbar/navbar.d.ts +94 -0
- package/dist/types/components/layout/navbar/navbar.types.d.ts +33 -0
- package/dist/types/components/layout/navbar/navbar.utils.d.ts +2 -0
- package/dist/types/components/layout/navbar/test/navbar.cmp.test.d.ts +1 -0
- package/dist/types/components/layout/panel/panel.d.ts +41 -0
- package/dist/types/components/layout/panel/panel.types.d.ts +3 -0
- package/dist/types/components/layout/scrollable/internals/metrics.d.ts +26 -0
- package/dist/types/components/layout/scrollable/internals/native-scrollbar.d.ts +4 -0
- package/dist/types/components/layout/scrollable/scrollable.d.ts +67 -0
- package/dist/types/components/layout/scrollable/scrollable.types.d.ts +6 -0
- package/dist/types/components/layout/section/section.d.ts +13 -0
- package/dist/types/components/layout/section/section.types.d.ts +1 -0
- package/dist/types/components/layout/sidepanel/internals/drawer.d.ts +2 -0
- package/dist/types/components/layout/sidepanel/internals/groups.d.ts +7 -0
- package/dist/types/components/layout/sidepanel/internals/nav-items.d.ts +2 -0
- package/dist/types/components/layout/sidepanel/sidepanel.d.ts +110 -0
- package/dist/types/components/layout/sidepanel/sidepanel.types.d.ts +43 -0
- package/dist/types/components/layout/sidepanel/sidepanel.utils.d.ts +2 -0
- package/dist/types/components/layout/sidepanel/test/nav-drawer-transitions.cmp.test.d.ts +1 -0
- package/dist/types/components/layout/sidepanel/test/panel-transitions.cmp.test.d.ts +1 -0
- package/dist/types/components/layout/stack/stack.d.ts +10 -0
- package/dist/types/components/layout/tabs/tabs.d.ts +29 -0
- package/dist/types/components/layout/tabs/tabs.types.d.ts +14 -0
- package/dist/types/components/layout/tabs/tabs.utils.d.ts +4 -0
- package/dist/types/components/layout/tabs/test/tabs.cmp.test.d.ts +1 -0
- package/dist/types/components/layout/toolbar/toolbar.d.ts +27 -0
- package/dist/types/components/layout/toolbar/toolbar.types.d.ts +1 -0
- package/dist/types/components/media/avatar/avatar.d.ts +37 -0
- package/dist/types/components/media/avatar/avatar.types.d.ts +2 -0
- package/dist/types/components/media/icon/icon.d.ts +48 -0
- package/dist/types/components/media/icon/icon.types.d.ts +30 -0
- package/dist/types/components/media/icon/internals/constants.d.ts +3 -0
- package/dist/types/components/media/icon/internals/fetch-icon.d.ts +1 -0
- package/dist/types/components/media/icon/internals/fetch-icon.unit.test.d.ts +1 -0
- package/dist/types/components/media/icon/internals/policy.d.ts +19 -0
- package/dist/types/components/media/icon/internals/policy.unit.test.d.ts +1 -0
- package/dist/types/components/media/icon/internals/registry-lucide.unit.test.d.ts +1 -0
- package/dist/types/components/media/icon/internals/registry.d.ts +11 -0
- package/dist/types/components/media/icon/internals/registry.unit.test.d.ts +1 -0
- package/dist/types/components/media/icon/internals/render-definition.d.ts +2 -0
- package/dist/types/components/media/icon/internals/sanitize-svg.d.ts +2 -0
- package/dist/types/components/media/icon/internals/size.d.ts +2 -0
- package/dist/types/components/media/icon/internals/url.d.ts +11 -0
- package/dist/types/components/media/icon/internals/url.unit.test.d.ts +1 -0
- package/dist/types/components/media/icon/test/icon-fixtures.d.ts +4 -0
- package/dist/types/components/media/icon/test/icon.cmp.test.d.ts +1 -0
- package/dist/types/components/media/image-comparison/image-comparison.d.ts +63 -0
- package/dist/types/components/media/image-comparison/test/image-comparison.cmp.test.d.ts +1 -0
- package/dist/types/components/media/media/media.d.ts +13 -0
- package/dist/types/components/media/media/media.types.d.ts +2 -0
- package/dist/types/components/media/reel/reel.d.ts +34 -0
- package/dist/types/components/media/reel/reel.types.d.ts +3 -0
- package/dist/types/components/media/thumbnail/thumbnail.d.ts +21 -0
- package/dist/types/components/media/thumbnail/thumbnail.types.d.ts +7 -0
- package/dist/types/components/overlays/dialog/dialog.d.ts +83 -0
- package/dist/types/components/overlays/dialog/dialog.types.d.ts +1 -0
- package/dist/types/components/overlays/dialog/internals/backdrop.d.ts +2 -0
- package/dist/types/components/overlays/dialog/internals/lifecycle.d.ts +21 -0
- package/dist/types/components/overlays/tooltip/internals/aria.d.ts +13 -0
- package/dist/types/components/overlays/tooltip/internals/positioning.d.ts +7 -0
- package/dist/types/components/overlays/tooltip/internals/scroll-listeners.d.ts +2 -0
- package/dist/types/components/overlays/tooltip/tooltip.d.ts +33 -0
- package/dist/types/components/overlays/tooltip/tooltip.types.d.ts +1 -0
- package/dist/types/components/shared/field.d.ts +3 -0
- package/dist/types/components/shared/test/orientation.cmp.test.d.ts +1 -0
- package/dist/types/components.d.ts +6156 -0
- package/dist/types/declarations.d.ts +14 -0
- package/dist/types/home/runner/work/WebQuark/WebQuark/.stencil/src/playground/components/theme-designer/dimension-tokens.d.ts +3 -0
- package/dist/types/home/runner/work/WebQuark/WebQuark/.stencil/src/playground/components/theme-designer/token-row.d.ts +14 -0
- package/dist/types/home/runner/work/WebQuark/WebQuark/.stencil/src/playground/dom-factory.d.ts +12 -0
- package/dist/types/home/runner/work/WebQuark/WebQuark/.stencil/src/playground/utils/color.d.ts +8 -0
- package/dist/types/home/runner/work/WebQuark/WebQuark/.stencil/src/playground/utils/dom.d.ts +15 -0
- package/dist/types/home/runner/work/WebQuark/WebQuark/.stencil/src/playground/utils/index.d.ts +2 -0
- package/dist/types/index.d.ts +31 -0
- package/dist/types/stencil-public-runtime.d.ts +1879 -0
- package/dist/types/theme/test/assets.d.ts +4 -0
- package/dist/types/theme/test/foundation.cmp.test.d.ts +16 -0
- package/dist/types/theme/test/input-width.cmp.test.d.ts +3 -0
- package/dist/types/theme/test/presets.cmp.test.d.ts +7 -0
- package/dist/types/theme/test/presets.unit.test.d.ts +1 -0
- package/dist/types/theme/tokens.d.ts +150 -0
- package/dist/types/utils/collection-identity.d.ts +55 -0
- package/dist/types/utils/collection-identity.unit.test.d.ts +1 -0
- package/dist/types/utils/dom.d.ts +68 -0
- package/dist/types/utils/form-control-validity.d.ts +14 -0
- package/dist/types/utils/form-field-adapter.d.ts +17 -0
- package/dist/types/utils/form-field-state.d.ts +4 -0
- package/dist/types/utils/form-reset-action.d.ts +5 -0
- package/dist/types/utils/form-submit-action.d.ts +17 -0
- package/dist/types/utils/form-submit-action.unit.test.d.ts +1 -0
- package/dist/types/utils/image-crop.d.ts +30 -0
- package/dist/types/utils/image-crop.unit.test.d.ts +1 -0
- package/dist/types/utils/math.d.ts +10 -0
- package/dist/types/utils/utils.d.ts +11 -0
- package/dist/types/utils/utils.unit.test.d.ts +1 -0
- package/dist/webquark/index.esm.js +1 -0
- package/dist/webquark/native-content.css +24 -0
- package/dist/webquark/p-0f04ceab.entry.js +1 -0
- package/dist/webquark/p-10dc5cce.entry.js +1 -0
- package/dist/webquark/p-191a7063.entry.js +1 -0
- package/dist/webquark/p-1e8797d1.entry.js +1 -0
- package/dist/webquark/p-220ec9cf.entry.js +1 -0
- package/dist/webquark/p-2291095e.entry.js +1 -0
- package/dist/webquark/p-32055acd.entry.js +1 -0
- package/dist/webquark/p-3af50215.entry.js +13 -0
- package/dist/webquark/p-41deb44c.entry.js +1 -0
- package/dist/webquark/p-44eda084.entry.js +1 -0
- package/dist/webquark/p-473a1810.entry.js +1 -0
- package/dist/webquark/p-4cf40080.entry.js +1 -0
- package/dist/webquark/p-4d611b93.entry.js +1 -0
- package/dist/webquark/p-596737cc.entry.js +1 -0
- package/dist/webquark/p-5cccb6bc.entry.js +1 -0
- package/dist/webquark/p-5d6fb0d1.entry.js +1 -0
- package/dist/webquark/p-687be7d4.entry.js +1 -0
- package/dist/webquark/p-6a5033da.entry.js +1 -0
- package/dist/webquark/p-6d2d016a.entry.js +1 -0
- package/dist/webquark/p-70e3a23a.entry.js +1 -0
- package/dist/webquark/p-7723e966.entry.js +1 -0
- package/dist/webquark/p-78c56cd3.entry.js +1 -0
- package/dist/webquark/p-8a0733a1.entry.js +1 -0
- package/dist/webquark/p-BDsIecIx.js +1 -0
- package/dist/webquark/p-BIIQL66b.js +1 -0
- package/dist/webquark/p-BJiYCN3i.js +1 -0
- package/dist/webquark/p-BOdNg0jc.js +1 -0
- package/dist/webquark/p-BcL0NVv0.js +1 -0
- package/dist/webquark/p-Bj2RJb2E.js +1 -0
- package/dist/webquark/p-Bk4FnOfb.js +1 -0
- package/dist/webquark/p-BuctNczf.js +1 -0
- package/dist/webquark/p-ByfrUWx1.js +1 -0
- package/dist/webquark/p-CGZPmEUB.js +1 -0
- package/dist/webquark/p-CGml_DQ8.js +1 -0
- package/dist/webquark/p-C_RztzNv.js +5 -0
- package/dist/webquark/p-CoIMrUb3.js +1 -0
- package/dist/webquark/p-CpI3m4_T.js +1 -0
- package/dist/webquark/p-DKrPmn2y.js +13 -0
- package/dist/webquark/p-DYMWBqU1.js +5 -0
- package/dist/webquark/p-DaJmsCb7.js +3 -0
- package/dist/webquark/p-DstNl_WY.js +1 -0
- package/dist/webquark/p-DuX-9GOi.js +1 -0
- package/dist/webquark/p-SzKf4WZF.js +1 -0
- package/dist/webquark/p-a199de7d.entry.js +1 -0
- package/dist/webquark/p-a30d212f.entry.js +13 -0
- package/dist/webquark/p-a87f0bde.entry.js +1 -0
- package/dist/webquark/p-b75ec829.entry.js +1 -0
- package/dist/webquark/p-b82aaf4c.entry.js +1 -0
- package/dist/webquark/p-b8f4994a.entry.js +1 -0
- package/dist/webquark/p-b9c8c081.entry.js +1 -0
- package/dist/webquark/p-bf568cda.entry.js +1 -0
- package/dist/webquark/p-c662904e.entry.js +1 -0
- package/dist/webquark/p-cab898c2.entry.js +1 -0
- package/dist/webquark/p-d2c4696f.entry.js +1 -0
- package/dist/webquark/p-ddeb2d4c.entry.js +1 -0
- package/dist/webquark/p-dee50f0a.entry.js +1 -0
- package/dist/webquark/p-e3c18c0e.entry.js +1 -0
- package/dist/webquark/p-e7384b6e.entry.js +1 -0
- package/dist/webquark/p-f63fd66f.entry.js +1 -0
- package/dist/webquark/p-f95aeb8d.entry.js +1 -0
- package/dist/webquark/p-fbd1cbbe.entry.js +1 -0
- package/dist/webquark/webquark.css +1 -0
- package/dist/webquark/webquark.esm.js +1 -0
- package/package.json +78 -4
|
@@ -0,0 +1,1002 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-CMAcJ6t1.js');
|
|
4
|
+
var tokens = require('./tokens-Cd7g-VMz.js');
|
|
5
|
+
var formFieldAdapter = require('./form-field-adapter-D0CJ6poh.js');
|
|
6
|
+
var formFieldState = require('./form-field-state-P63wN30v.js');
|
|
7
|
+
var formSubmitAction = require('./form-submit-action-C6c4aq6C.js');
|
|
8
|
+
|
|
9
|
+
const skippedInputTypes = new Set(['button', 'checkbox', 'color', 'file', 'hidden', 'image', 'radio', 'range', 'reset', 'submit']);
|
|
10
|
+
const customFieldTags = new Set(['q-input', 'q-textarea', 'q-dropdown', 'q-radio-group', 'q-toggle', 'q-syntax-box']);
|
|
11
|
+
const actionInputTypes = new Set(['button', 'image', 'reset', 'submit']);
|
|
12
|
+
function supported(element) {
|
|
13
|
+
const tag = element.tagName.toLowerCase();
|
|
14
|
+
if (tag === 'input')
|
|
15
|
+
return !actionInputTypes.has(element.type);
|
|
16
|
+
return tag === 'textarea' || tag === 'select' || customFieldTags.has(tag);
|
|
17
|
+
}
|
|
18
|
+
function nearestForm(control) {
|
|
19
|
+
for (let parent = control.parentElement; parent; parent = parent.parentElement) {
|
|
20
|
+
if (parent.tagName === 'FORM' || parent.tagName === 'Q-FORM')
|
|
21
|
+
return parent;
|
|
22
|
+
}
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
/** Named form controls can shadow form.elements; use the native getter. */
|
|
26
|
+
function nativeMembers(formEl) {
|
|
27
|
+
if (!formEl)
|
|
28
|
+
return [];
|
|
29
|
+
const prototype = formEl.ownerDocument.defaultView?.HTMLFormElement?.prototype;
|
|
30
|
+
const getter = prototype && Object.getOwnPropertyDescriptor(prototype, 'elements')?.get;
|
|
31
|
+
const elements = getter ? getter.call(formEl) : formEl.elements;
|
|
32
|
+
return elements ? Array.from(elements) : [];
|
|
33
|
+
}
|
|
34
|
+
function candidates(formEl, hostEl) {
|
|
35
|
+
const found = new Set();
|
|
36
|
+
hostEl.querySelectorAll('*').forEach(element => {
|
|
37
|
+
if (supported(element))
|
|
38
|
+
found.add(element);
|
|
39
|
+
});
|
|
40
|
+
nativeMembers(formEl).forEach(element => {
|
|
41
|
+
if (supported(element))
|
|
42
|
+
found.add(element);
|
|
43
|
+
});
|
|
44
|
+
return Array.from(found).sort((left, right) => {
|
|
45
|
+
const position = left.compareDocumentPosition(right);
|
|
46
|
+
if (position & Node.DOCUMENT_POSITION_DISCONNECTED)
|
|
47
|
+
return 0;
|
|
48
|
+
return position & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : position & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function owned(control, formEl, hostEl) {
|
|
52
|
+
const custom = formFieldAdapter.readFormField(control);
|
|
53
|
+
if (customFieldTags.has(control.tagName.toLowerCase()) && !custom)
|
|
54
|
+
return false;
|
|
55
|
+
const owner = custom ? custom.owner() : control.form;
|
|
56
|
+
if (owner)
|
|
57
|
+
return owner === formEl;
|
|
58
|
+
if (control.hasAttribute('form'))
|
|
59
|
+
return false;
|
|
60
|
+
return nearestForm(control) === hostEl;
|
|
61
|
+
}
|
|
62
|
+
/** Light DOM and actual native association only; never inspect consumer shadow roots. */
|
|
63
|
+
function getFormControls(formEl, hostEl) {
|
|
64
|
+
return candidates(formEl, hostEl).filter(control => owned(control, formEl, hostEl));
|
|
65
|
+
}
|
|
66
|
+
async function awaitFormControls(formEl, hostEl, signal) {
|
|
67
|
+
const deadline = Date.now() + formFieldAdapter.FORM_FIELD_READY_TIMEOUT_MS;
|
|
68
|
+
const possiblyOwned = (control) => {
|
|
69
|
+
if (formFieldAdapter.readFormField(control))
|
|
70
|
+
return owned(control, formEl, hostEl);
|
|
71
|
+
if (nativeMembers(formEl).includes(control))
|
|
72
|
+
return true;
|
|
73
|
+
return !control.hasAttribute('form') && nearestForm(control) === hostEl;
|
|
74
|
+
};
|
|
75
|
+
while (true) {
|
|
76
|
+
if (signal?.aborted)
|
|
77
|
+
return;
|
|
78
|
+
const pending = candidates(formEl, hostEl).filter(control => control.isConnected && customFieldTags.has(control.tagName.toLowerCase()) &&
|
|
79
|
+
possiblyOwned(control) && !formFieldAdapter.readFormField(control));
|
|
80
|
+
if (!pending.length)
|
|
81
|
+
return;
|
|
82
|
+
const remaining = deadline - Date.now();
|
|
83
|
+
if (remaining <= 0) {
|
|
84
|
+
const error = new Error(`Form fields did not become ready within ${formFieldAdapter.FORM_FIELD_READY_TIMEOUT_MS}ms.`);
|
|
85
|
+
error.name = 'TimeoutError';
|
|
86
|
+
throw error;
|
|
87
|
+
}
|
|
88
|
+
const batch = new AbortController();
|
|
89
|
+
const abort = () => batch.abort();
|
|
90
|
+
signal?.addEventListener('abort', abort, { once: true });
|
|
91
|
+
try {
|
|
92
|
+
await Promise.all(pending.map(async (control) => {
|
|
93
|
+
const canceled = new AbortController();
|
|
94
|
+
const stop = () => canceled.abort();
|
|
95
|
+
const observer = new MutationObserver(() => {
|
|
96
|
+
if (!control.isConnected || !possiblyOwned(control))
|
|
97
|
+
stop();
|
|
98
|
+
});
|
|
99
|
+
batch.signal.addEventListener('abort', stop, { once: true });
|
|
100
|
+
const roots = new Set([hostEl.getRootNode(), formEl?.getRootNode()].filter(Boolean));
|
|
101
|
+
try {
|
|
102
|
+
for (const root of roots)
|
|
103
|
+
observer.observe(root, { childList: true, subtree: true, attributes: true, attributeFilter: ['form', 'id'] });
|
|
104
|
+
if (!control.isConnected || !possiblyOwned(control))
|
|
105
|
+
stop();
|
|
106
|
+
await formFieldAdapter.awaitFormField(control, canceled.signal, remaining);
|
|
107
|
+
}
|
|
108
|
+
finally {
|
|
109
|
+
observer.disconnect();
|
|
110
|
+
batch.signal.removeEventListener('abort', stop);
|
|
111
|
+
}
|
|
112
|
+
}));
|
|
113
|
+
}
|
|
114
|
+
finally {
|
|
115
|
+
signal?.removeEventListener('abort', abort);
|
|
116
|
+
batch.abort();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
function shouldSkipControl(control, tagName = control.tagName.toLowerCase()) {
|
|
121
|
+
return tagName === 'q-syntax-box' && !control.editable;
|
|
122
|
+
}
|
|
123
|
+
function getControlFromEvent(ev, formEl, hostEl) {
|
|
124
|
+
const controls = getFocusableTextControls(formEl, hostEl);
|
|
125
|
+
const path = ev.composedPath();
|
|
126
|
+
const pathControl = controls.find((control) => path.includes(control));
|
|
127
|
+
if (pathControl)
|
|
128
|
+
return pathControl;
|
|
129
|
+
const target = ev.target;
|
|
130
|
+
if (target instanceof HTMLElement) {
|
|
131
|
+
const targetControl = controls.find((control) => controlContainsTarget(control, target));
|
|
132
|
+
if (targetControl)
|
|
133
|
+
return targetControl;
|
|
134
|
+
}
|
|
135
|
+
return undefined;
|
|
136
|
+
}
|
|
137
|
+
function focusAdjacentControl(current, formEl, hostEl, direction) {
|
|
138
|
+
const controls = getFocusableTextControls(formEl, hostEl);
|
|
139
|
+
const currentIndex = controls.indexOf(current);
|
|
140
|
+
if (currentIndex < 0)
|
|
141
|
+
return false;
|
|
142
|
+
const nextControl = controls[currentIndex + direction];
|
|
143
|
+
if (!nextControl)
|
|
144
|
+
return false;
|
|
145
|
+
if (typeof nextControl.focusElement === 'function') {
|
|
146
|
+
void nextControl.focusElement();
|
|
147
|
+
return true;
|
|
148
|
+
}
|
|
149
|
+
nextControl.focus();
|
|
150
|
+
return true;
|
|
151
|
+
}
|
|
152
|
+
function getFocusableTextControls(formEl, hostEl) {
|
|
153
|
+
return getFormControls(formEl, hostEl).filter((control) => isFocusableTextControl(control));
|
|
154
|
+
}
|
|
155
|
+
function isFocusableTextControl(control) {
|
|
156
|
+
const tagName = control.tagName.toLowerCase();
|
|
157
|
+
if (formFieldState.isFieldDisabled(control, Boolean(control.disabled)) || control.closest('[hidden],[inert],[aria-hidden="true"]'))
|
|
158
|
+
return false;
|
|
159
|
+
const style = control.ownerDocument.defaultView?.getComputedStyle(control);
|
|
160
|
+
if (style?.display === 'none' || style?.visibility === 'hidden' || style?.visibility === 'collapse')
|
|
161
|
+
return false;
|
|
162
|
+
// Stencil's mock DOM has no layout geometry; real browsers also exclude hidden ancestors.
|
|
163
|
+
if (typeof control.getClientRects === 'function' && !control.getClientRects().length)
|
|
164
|
+
return false;
|
|
165
|
+
if (shouldSkipControl(control, tagName))
|
|
166
|
+
return false;
|
|
167
|
+
if (tagName === 'q-input')
|
|
168
|
+
return !skippedInputTypes.has(control.type ?? 'text');
|
|
169
|
+
if (control instanceof HTMLInputElement) {
|
|
170
|
+
return !skippedInputTypes.has(control.type);
|
|
171
|
+
}
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
function controlContainsTarget(control, target) {
|
|
175
|
+
return control === target || control.contains(target) || Boolean(control.shadowRoot?.contains(target));
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function handleEnterBehavior({ ev, enterBehavior, formEl, hostEl, requestSubmit }) {
|
|
179
|
+
if (ev.key !== 'Enter' || ev.defaultPrevented || ev.ctrlKey || ev.altKey || ev.metaKey || ev.isComposing || ev.keyCode === 229)
|
|
180
|
+
return false;
|
|
181
|
+
if (ev.composedPath().some(target => target instanceof HTMLElement && target !== hostEl &&
|
|
182
|
+
(target.isContentEditable || ['A', 'BUTTON', 'SELECT', 'TEXTAREA'].includes(target.tagName))))
|
|
183
|
+
return false;
|
|
184
|
+
const current = getControlFromEvent(ev, formEl, hostEl);
|
|
185
|
+
if (!current)
|
|
186
|
+
return false;
|
|
187
|
+
ev.preventDefault();
|
|
188
|
+
if (enterBehavior === 'none')
|
|
189
|
+
return true;
|
|
190
|
+
if (enterBehavior === 'focus-next' && focusAdjacentControl(current, formEl, hostEl, ev.shiftKey ? -1 : 1))
|
|
191
|
+
return true;
|
|
192
|
+
if (enterBehavior === 'focus-next' && ev.shiftKey)
|
|
193
|
+
return true;
|
|
194
|
+
const action = formSubmitAction.defaultSubmitAction(formEl, hostEl);
|
|
195
|
+
if (action)
|
|
196
|
+
formSubmitAction.activateSubmitAction(action);
|
|
197
|
+
else
|
|
198
|
+
requestSubmit();
|
|
199
|
+
return true;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/** Radio exclusivity belongs to the native owner, tree and name, not q-form. */
|
|
203
|
+
function nativeRadioGroups(fields) {
|
|
204
|
+
const result = [];
|
|
205
|
+
for (const field of fields) {
|
|
206
|
+
const input = field.control;
|
|
207
|
+
const owner = input.form || null;
|
|
208
|
+
const root = input.getRootNode();
|
|
209
|
+
let group = result.find(candidate => candidate.owner === owner && candidate.root === root && candidate.name === field.name);
|
|
210
|
+
if (!group) {
|
|
211
|
+
group = { owner, root, name: field.name, fields: [] };
|
|
212
|
+
result.push(group);
|
|
213
|
+
}
|
|
214
|
+
group.fields.push(field);
|
|
215
|
+
}
|
|
216
|
+
return result.map(group => group.fields);
|
|
217
|
+
}
|
|
218
|
+
function effectiveDisabled(control) {
|
|
219
|
+
return Boolean(control.disabled || control.matches(':disabled'));
|
|
220
|
+
}
|
|
221
|
+
function enabledOption(option) {
|
|
222
|
+
return !option.disabled && !(option.parentElement?.tagName === 'OPTGROUP' && option.parentElement.disabled);
|
|
223
|
+
}
|
|
224
|
+
function nativeDatalistParticipation(control) {
|
|
225
|
+
if (!control.closest('datalist'))
|
|
226
|
+
return true;
|
|
227
|
+
try {
|
|
228
|
+
const document = control.ownerDocument;
|
|
229
|
+
const form = document.createElement('form');
|
|
230
|
+
const list = document.createElement('datalist');
|
|
231
|
+
const input = document.createElement('input');
|
|
232
|
+
input.name = '_q_datalist_probe';
|
|
233
|
+
input.value = '1';
|
|
234
|
+
list.append(input);
|
|
235
|
+
form.append(list);
|
|
236
|
+
return new FormData(form).has(input.name);
|
|
237
|
+
}
|
|
238
|
+
catch {
|
|
239
|
+
return false;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
/** Let the browser serialize a detached native copy; never move consumer fields. */
|
|
243
|
+
function nativeTextEntries(control, fallback) {
|
|
244
|
+
try {
|
|
245
|
+
const form = control.ownerDocument.createElement('form');
|
|
246
|
+
const clone = control.cloneNode(false);
|
|
247
|
+
clone.removeAttribute('form');
|
|
248
|
+
clone.value = control.value;
|
|
249
|
+
if (control.tagName === 'INPUT')
|
|
250
|
+
clone.checked = control.checked;
|
|
251
|
+
clone.dir = control.matches(':dir(rtl)') ? 'rtl' : 'ltr';
|
|
252
|
+
form.append(clone);
|
|
253
|
+
const entries = [];
|
|
254
|
+
new FormData(form).forEach((value, name) => entries.push([name, value]));
|
|
255
|
+
return entries;
|
|
256
|
+
}
|
|
257
|
+
catch {
|
|
258
|
+
// Mock/non-browser DOMs cannot construct FormData from a native form.
|
|
259
|
+
return fallback;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
function snapshotField(control) {
|
|
263
|
+
const custom = formFieldAdapter.readFormField(control);
|
|
264
|
+
custom?.reconcile();
|
|
265
|
+
const name = control.getAttribute('name') ?? '';
|
|
266
|
+
const disabled = effectiveDisabled(control);
|
|
267
|
+
const active = (custom?.active() ?? true) && nativeDatalistParticipation(control);
|
|
268
|
+
const state = { control, name, kind: custom?.kind ?? 'text', disabled, active, entries: [], model: null, custom };
|
|
269
|
+
if (custom) {
|
|
270
|
+
state.model = custom.value();
|
|
271
|
+
if (name && active && !disabled && state.model !== null && (state.kind !== 'toggle' || state.model === true)) {
|
|
272
|
+
state.entries.push([name, String(state.model)]);
|
|
273
|
+
}
|
|
274
|
+
return state;
|
|
275
|
+
}
|
|
276
|
+
if (control.tagName === 'INPUT') {
|
|
277
|
+
const input = control;
|
|
278
|
+
if (input.type === 'checkbox' || input.type === 'radio') {
|
|
279
|
+
state.kind = input.type;
|
|
280
|
+
state.model = input.checked ? input.value : null;
|
|
281
|
+
}
|
|
282
|
+
else if (input.type === 'file') {
|
|
283
|
+
state.kind = 'file';
|
|
284
|
+
if (name && active && !disabled) {
|
|
285
|
+
const files = Array.from(input.files ?? []);
|
|
286
|
+
const FileConstructor = input.ownerDocument.defaultView?.File ?? File;
|
|
287
|
+
const values = files.length ? files : [new FileConstructor([], '', { type: 'application/octet-stream' })];
|
|
288
|
+
state.entries = values.map(file => [name, file]);
|
|
289
|
+
}
|
|
290
|
+
return state;
|
|
291
|
+
}
|
|
292
|
+
else {
|
|
293
|
+
state.model = input.value;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
else if (control.tagName === 'SELECT') {
|
|
297
|
+
const select = control;
|
|
298
|
+
state.kind = select.multiple ? 'multiselect' : 'selection';
|
|
299
|
+
const options = Array.from(select.selectedOptions).filter(enabledOption);
|
|
300
|
+
state.model = options[0]?.value ?? null;
|
|
301
|
+
if (name && active && !disabled)
|
|
302
|
+
state.entries = options.map(option => [name, option.value]);
|
|
303
|
+
return state;
|
|
304
|
+
}
|
|
305
|
+
else {
|
|
306
|
+
state.model = control.value;
|
|
307
|
+
}
|
|
308
|
+
if (name && active && !disabled && state.model !== null) {
|
|
309
|
+
state.entries.push([name, String(state.model)]);
|
|
310
|
+
const dirname = control.getAttribute('dirname');
|
|
311
|
+
const input = control;
|
|
312
|
+
const supportsDirection = control.tagName === 'TEXTAREA' || ['hidden', 'text', 'search', 'tel', 'url', 'email', 'password'].includes(input.type);
|
|
313
|
+
if (dirname && supportsDirection)
|
|
314
|
+
state.entries.push([dirname, control.matches(':dir(rtl)') ? 'rtl' : 'ltr']);
|
|
315
|
+
state.entries = nativeTextEntries(control, state.entries);
|
|
316
|
+
}
|
|
317
|
+
return state;
|
|
318
|
+
}
|
|
319
|
+
function validateField(control, report) {
|
|
320
|
+
const custom = formFieldAdapter.readFormField(control);
|
|
321
|
+
custom?.reconcile();
|
|
322
|
+
if (effectiveDisabled(control) || (custom && !custom.active()))
|
|
323
|
+
return true;
|
|
324
|
+
if (custom)
|
|
325
|
+
return custom.validate(report);
|
|
326
|
+
const native = control;
|
|
327
|
+
const validate = report ? native.reportValidity : native.checkValidity;
|
|
328
|
+
return typeof validate === 'function' ? validate.call(native) : true;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
function collectionStates(formEl, hostEl) {
|
|
332
|
+
return getFormControls(formEl, hostEl).map(snapshotField).filter(field => field.active && field.name);
|
|
333
|
+
}
|
|
334
|
+
/** Assignment uses owned names, independent of successful-entry participation. */
|
|
335
|
+
function assignmentStates(formEl, hostEl) {
|
|
336
|
+
return getFormControls(formEl, hostEl)
|
|
337
|
+
.filter(control => Boolean(control.getAttribute('name')) && !shouldSkipControl(control))
|
|
338
|
+
.map(snapshotField);
|
|
339
|
+
}
|
|
340
|
+
function groups(fields) {
|
|
341
|
+
const result = new Map();
|
|
342
|
+
for (const field of fields) {
|
|
343
|
+
const group = result.get(field.name) ?? [];
|
|
344
|
+
group.push(field);
|
|
345
|
+
result.set(field.name, group);
|
|
346
|
+
}
|
|
347
|
+
return result;
|
|
348
|
+
}
|
|
349
|
+
function formDataFrom(fields) {
|
|
350
|
+
const data = new FormData();
|
|
351
|
+
for (const field of fields) {
|
|
352
|
+
for (const [name, value] of field.entries)
|
|
353
|
+
data.append(name, value);
|
|
354
|
+
}
|
|
355
|
+
return data;
|
|
356
|
+
}
|
|
357
|
+
function collectValues(formEl, hostEl, formData) {
|
|
358
|
+
const fields = collectionStates(formEl, hostEl);
|
|
359
|
+
const data = formDataFrom(fields);
|
|
360
|
+
return projectValues(fields, data);
|
|
361
|
+
}
|
|
362
|
+
function collectFormState(formEl, hostEl, extraFields = []) {
|
|
363
|
+
const fields = [...collectionStates(formEl, hostEl), ...extraFields].sort((a, b) => {
|
|
364
|
+
const position = a.control.compareDocumentPosition(b.control);
|
|
365
|
+
return position & Node.DOCUMENT_POSITION_DISCONNECTED ? 0 : position & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : position & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
366
|
+
});
|
|
367
|
+
const formData = formDataFrom(fields);
|
|
368
|
+
return { values: projectValues(fields, formData), formData };
|
|
369
|
+
}
|
|
370
|
+
function projectValues(fields, data) {
|
|
371
|
+
const values = {};
|
|
372
|
+
const entries = new Map();
|
|
373
|
+
data.forEach((value, name) => {
|
|
374
|
+
const group = entries.get(name) ?? [];
|
|
375
|
+
group.push(value);
|
|
376
|
+
entries.set(name, group);
|
|
377
|
+
});
|
|
378
|
+
const put = (name, value) => Object.defineProperty(values, name, { value, enumerable: true, writable: true, configurable: true });
|
|
379
|
+
const fieldGroups = groups(fields);
|
|
380
|
+
for (const [name, group] of fieldGroups) {
|
|
381
|
+
const eligible = group.filter(field => !field.disabled);
|
|
382
|
+
if (!eligible.length)
|
|
383
|
+
continue;
|
|
384
|
+
if (group.every(field => field.kind === 'toggle')) {
|
|
385
|
+
const booleans = eligible.map(field => Boolean(field.model));
|
|
386
|
+
put(name, group.length === 1 ? booleans[0] : booleans);
|
|
387
|
+
entries.delete(name);
|
|
388
|
+
continue;
|
|
389
|
+
}
|
|
390
|
+
const successful = entries.get(name) ?? [];
|
|
391
|
+
const radios = group.every(field => field.kind === 'radio');
|
|
392
|
+
const arrayShape = group.some(field => field.kind === 'multiselect' || (field.kind === 'file' && field.control.multiple)) ||
|
|
393
|
+
(radios ? nativeRadioGroups(group).length > 1 : group.length > 1);
|
|
394
|
+
const emptyArray = group.every(field => field.kind === 'checkbox' || field.kind === 'multiselect');
|
|
395
|
+
if (successful.length || (arrayShape && emptyArray))
|
|
396
|
+
put(name, arrayShape ? successful : successful.length > 1 ? successful : successful[0]);
|
|
397
|
+
entries.delete(name);
|
|
398
|
+
}
|
|
399
|
+
// Includes native dirname and, later, the submission transaction's extra entries.
|
|
400
|
+
for (const [name, successful] of entries)
|
|
401
|
+
put(name, successful.length > 1 ? successful : successful[0]);
|
|
402
|
+
return values;
|
|
403
|
+
}
|
|
404
|
+
function fail(name, reason) {
|
|
405
|
+
throw new TypeError(`Cannot assign form field "${name}": ${reason}`);
|
|
406
|
+
}
|
|
407
|
+
function textValue(value, name) {
|
|
408
|
+
if (value === null)
|
|
409
|
+
return '';
|
|
410
|
+
if (typeof value === 'string' || typeof value === 'boolean')
|
|
411
|
+
return String(value);
|
|
412
|
+
if (typeof value === 'number' && Number.isFinite(value))
|
|
413
|
+
return String(value);
|
|
414
|
+
return fail(name, 'expected text, a finite number, Boolean or null');
|
|
415
|
+
}
|
|
416
|
+
function identity(value, name) {
|
|
417
|
+
if (typeof value === 'string')
|
|
418
|
+
return value;
|
|
419
|
+
if (value === null)
|
|
420
|
+
return null;
|
|
421
|
+
return fail(name, 'expected an option identity string or null');
|
|
422
|
+
}
|
|
423
|
+
function identities(value, name) {
|
|
424
|
+
if (value === null)
|
|
425
|
+
return [];
|
|
426
|
+
if (typeof value === 'string')
|
|
427
|
+
return [value];
|
|
428
|
+
if (Array.isArray(value) && value.every(item => typeof item === 'string'))
|
|
429
|
+
return value;
|
|
430
|
+
return fail(name, 'expected option identity strings or null');
|
|
431
|
+
}
|
|
432
|
+
function toBoolean(value, name) {
|
|
433
|
+
if (typeof value === 'boolean')
|
|
434
|
+
return value;
|
|
435
|
+
if (typeof value === 'number' && Number.isFinite(value))
|
|
436
|
+
return value !== 0;
|
|
437
|
+
if (typeof value === 'string')
|
|
438
|
+
return ['true', '1', 'on', 'yes'].includes(value.toLowerCase());
|
|
439
|
+
if (value === null)
|
|
440
|
+
return false;
|
|
441
|
+
return fail(name, 'expected a Boolean-compatible scalar');
|
|
442
|
+
}
|
|
443
|
+
function assignScalar(field, value) {
|
|
444
|
+
return () => {
|
|
445
|
+
if (field.custom) {
|
|
446
|
+
field.custom.assign(value);
|
|
447
|
+
field.custom.reconcile();
|
|
448
|
+
}
|
|
449
|
+
else {
|
|
450
|
+
field.control.value = String(value);
|
|
451
|
+
}
|
|
452
|
+
};
|
|
453
|
+
}
|
|
454
|
+
function prepareGroup(name, fields, value) {
|
|
455
|
+
const kinds = new Set(fields.map(field => field.kind));
|
|
456
|
+
const scalarGroup = fields.every(field => field.kind === 'text' || field.kind === 'selection');
|
|
457
|
+
if (kinds.size > 1 && !scalarGroup)
|
|
458
|
+
return fail(name, 'mixed control kinds have an ambiguous assignment shape');
|
|
459
|
+
const kind = fields[0].kind;
|
|
460
|
+
if (kind === 'file') {
|
|
461
|
+
if (value !== null && value !== '' && !(Array.isArray(value) && value.length === 0))
|
|
462
|
+
return fail(name, 'file controls support clearing only');
|
|
463
|
+
return fields.map(field => () => { field.control.value = ''; });
|
|
464
|
+
}
|
|
465
|
+
if (kind === 'radio') {
|
|
466
|
+
const radioGroups = nativeRadioGroups(fields);
|
|
467
|
+
if (Array.isArray(value) && radioGroups.length === 1)
|
|
468
|
+
return fail(name, 'a lone native radio group takes one identity');
|
|
469
|
+
const positional = Array.isArray(value) ? value : radioGroups.map(() => value);
|
|
470
|
+
if (positional.length !== radioGroups.length)
|
|
471
|
+
return fail(name, 'radio array length must match the native group count');
|
|
472
|
+
return radioGroups.flatMap((group, index) => {
|
|
473
|
+
const selected = identity(positional[index], name);
|
|
474
|
+
const match = group.find(field => field.control.value === selected);
|
|
475
|
+
return group.map(field => () => { field.control.checked = field === match; });
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
if (kind === 'checkbox') {
|
|
479
|
+
if (fields.length === 1 && typeof value === 'boolean')
|
|
480
|
+
return [() => { fields[0].control.checked = value; }];
|
|
481
|
+
const selected = identities(value, name);
|
|
482
|
+
return fields.map(field => () => { const input = field.control; input.checked = selected.includes(input.value); });
|
|
483
|
+
}
|
|
484
|
+
if (kind === 'multiselect') {
|
|
485
|
+
if (fields.length !== 1)
|
|
486
|
+
return fail(name, 'repeated multiselect containers have an ambiguous assignment shape');
|
|
487
|
+
const selected = identities(value, name);
|
|
488
|
+
const select = fields[0].control;
|
|
489
|
+
return [() => { Array.from(select.options).forEach(option => { option.selected = selected.includes(option.value); }); }];
|
|
490
|
+
}
|
|
491
|
+
if (kind === 'toggle') {
|
|
492
|
+
if (fields.length === 1) {
|
|
493
|
+
if (Array.isArray(value))
|
|
494
|
+
return fail(name, 'a lone toggle takes one scalar');
|
|
495
|
+
return [assignScalar(fields[0], toBoolean(value, name))];
|
|
496
|
+
}
|
|
497
|
+
if (!Array.isArray(value) || value.length !== fields.length || !value.every(item => typeof item === 'boolean')) {
|
|
498
|
+
return fail(name, 'repeated toggles take one Boolean per owned toggle');
|
|
499
|
+
}
|
|
500
|
+
return fields.map((field, index) => assignScalar(field, value[index]));
|
|
501
|
+
}
|
|
502
|
+
if (kind === 'selection' && fields.length === 1 && Array.isArray(value))
|
|
503
|
+
return fail(name, 'a lone selection takes one identity string or null');
|
|
504
|
+
const positional = Array.isArray(value) ? value : fields.map(() => value);
|
|
505
|
+
if (positional.length !== fields.length)
|
|
506
|
+
return fail(name, 'positional array length must match the owned field count');
|
|
507
|
+
return fields.map((field, index) => {
|
|
508
|
+
const item = positional[index];
|
|
509
|
+
const next = field.kind === 'selection' ? identity(item, name) ?? '' : textValue(item, name);
|
|
510
|
+
return assignScalar(field, next);
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
/** Validate the entire partial update before mutating any control. */
|
|
514
|
+
function applyValues(formEl, hostEl, values) {
|
|
515
|
+
const owned = groups(assignmentStates(formEl, hostEl));
|
|
516
|
+
const assignments = [];
|
|
517
|
+
for (const [name, value] of Object.entries(values)) {
|
|
518
|
+
const fields = owned.get(name);
|
|
519
|
+
if (fields?.length)
|
|
520
|
+
assignments.push(...prepareGroup(name, fields, value));
|
|
521
|
+
}
|
|
522
|
+
for (const apply of assignments)
|
|
523
|
+
apply();
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
function resetNative(control) {
|
|
527
|
+
const native = control;
|
|
528
|
+
const clone = native.cloneNode(true);
|
|
529
|
+
clone.removeAttribute('form');
|
|
530
|
+
const form = native.ownerDocument.createElement('form');
|
|
531
|
+
form.append(clone);
|
|
532
|
+
native.ownerDocument.defaultView.HTMLFormElement.prototype.reset.call(form);
|
|
533
|
+
if (native.tagName === 'SELECT') {
|
|
534
|
+
const source = clone;
|
|
535
|
+
const select = native;
|
|
536
|
+
if (select.multiple) {
|
|
537
|
+
Array.from(select.options).forEach((option, index) => {
|
|
538
|
+
option.selected = source.options[index].selected;
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
else {
|
|
542
|
+
select.selectedIndex = source.selectedIndex;
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
else if (native.tagName === 'INPUT' && ['checkbox', 'radio'].includes(native.type)) {
|
|
546
|
+
native.checked = clone.checked;
|
|
547
|
+
}
|
|
548
|
+
else {
|
|
549
|
+
native.value = clone.value;
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
/** Native reset already handles natively owned fields. Reset only logical fields. */
|
|
553
|
+
function resetLogicalControls(formEl, hostEl) {
|
|
554
|
+
for (const control of getFormControls(formEl, hostEl)) {
|
|
555
|
+
if (shouldSkipControl(control))
|
|
556
|
+
continue;
|
|
557
|
+
const custom = formFieldAdapter.readFormField(control);
|
|
558
|
+
const owner = custom?.owner() ?? control.form;
|
|
559
|
+
if (owner)
|
|
560
|
+
continue;
|
|
561
|
+
if (custom) {
|
|
562
|
+
custom.reset();
|
|
563
|
+
}
|
|
564
|
+
else {
|
|
565
|
+
resetNative(control);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
function reconcileControls(formEl, hostEl) {
|
|
570
|
+
for (const control of getFormControls(formEl, hostEl)) {
|
|
571
|
+
formFieldAdapter.readFormField(control)?.reconcile();
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
/** Suppress navigation now; distinguish later per-event cancellation until dispatch ends. */
|
|
576
|
+
function cancelSubmitAndAwaitDispatch(event) {
|
|
577
|
+
const alreadyCanceled = event.defaultPrevented;
|
|
578
|
+
const preventDefault = event.preventDefault;
|
|
579
|
+
preventDefault.call(event);
|
|
580
|
+
if (alreadyCanceled)
|
|
581
|
+
return Promise.resolve(true);
|
|
582
|
+
const ownPrevent = Object.getOwnPropertyDescriptor(event, 'preventDefault');
|
|
583
|
+
const ownReturn = Object.getOwnPropertyDescriptor(event, 'returnValue');
|
|
584
|
+
let prototype = event;
|
|
585
|
+
let returnValue;
|
|
586
|
+
while (prototype && !returnValue) {
|
|
587
|
+
returnValue = Object.getOwnPropertyDescriptor(prototype, 'returnValue');
|
|
588
|
+
prototype = Object.getPrototypeOf(prototype);
|
|
589
|
+
}
|
|
590
|
+
let canceled = false;
|
|
591
|
+
const restore = () => {
|
|
592
|
+
if (ownPrevent)
|
|
593
|
+
Object.defineProperty(event, 'preventDefault', ownPrevent);
|
|
594
|
+
else
|
|
595
|
+
delete event.preventDefault;
|
|
596
|
+
if (ownReturn)
|
|
597
|
+
Object.defineProperty(event, 'returnValue', ownReturn);
|
|
598
|
+
else
|
|
599
|
+
delete event.returnValue;
|
|
600
|
+
};
|
|
601
|
+
try {
|
|
602
|
+
Object.defineProperty(event, 'preventDefault', {
|
|
603
|
+
configurable: true,
|
|
604
|
+
writable: true,
|
|
605
|
+
value: function () {
|
|
606
|
+
if (this === event && event.cancelable)
|
|
607
|
+
canceled = true;
|
|
608
|
+
return preventDefault.call(this);
|
|
609
|
+
},
|
|
610
|
+
});
|
|
611
|
+
if (returnValue?.get && returnValue.set)
|
|
612
|
+
Object.defineProperty(event, 'returnValue', {
|
|
613
|
+
configurable: true,
|
|
614
|
+
get: function () { return returnValue.get.call(this); },
|
|
615
|
+
set: function (value) {
|
|
616
|
+
if (this === event && !value && event.cancelable)
|
|
617
|
+
canceled = true;
|
|
618
|
+
returnValue.set.call(this, value);
|
|
619
|
+
},
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
catch (error) {
|
|
623
|
+
restore();
|
|
624
|
+
return Promise.reject(error);
|
|
625
|
+
}
|
|
626
|
+
// A trusted native callback can run microtasks before later submit listeners.
|
|
627
|
+
// A task boundary waits for the entire dispatch, then restores both descriptors.
|
|
628
|
+
return new Promise((resolve, reject) => setTimeout(() => {
|
|
629
|
+
try {
|
|
630
|
+
restore();
|
|
631
|
+
resolve(canceled);
|
|
632
|
+
}
|
|
633
|
+
catch (error) {
|
|
634
|
+
reject(error);
|
|
635
|
+
}
|
|
636
|
+
}, 0));
|
|
637
|
+
}
|
|
638
|
+
function submitterFields({ submitter, coordinates = [0, 0] }) {
|
|
639
|
+
if (!submitter)
|
|
640
|
+
return [];
|
|
641
|
+
const name = formSubmitAction.submitAttribute(submitter, 'name', 'name') ?? '';
|
|
642
|
+
const image = submitter.type === 'image';
|
|
643
|
+
const value = formSubmitAction.submitAttribute(submitter, 'value', 'value') ?? '';
|
|
644
|
+
const entries = image ? [[name ? `${name}.x` : 'x', String(coordinates[0])], [name ? `${name}.y` : 'y', String(coordinates[1])]] : name ? [[name, value]] : [];
|
|
645
|
+
return entries.map(([key, entry]) => ({ control: submitter, name: key, kind: 'text', disabled: false, active: true, entries: [[key, entry]], model: entry }));
|
|
646
|
+
}
|
|
647
|
+
function submissionSettings(base, submitter) {
|
|
648
|
+
if (!submitter)
|
|
649
|
+
return { ...base };
|
|
650
|
+
return {
|
|
651
|
+
action: formSubmitAction.submitAttribute(submitter, 'formAction', 'formaction') ?? base.action,
|
|
652
|
+
method: formSubmitAction.submitAttribute(submitter, 'formMethod', 'formmethod') ?? base.method,
|
|
653
|
+
enctype: formSubmitAction.submitAttribute(submitter, 'formEnctype', 'formenctype') ?? base.enctype,
|
|
654
|
+
target: formSubmitAction.submitAttribute(submitter, 'formTarget', 'formtarget') ?? base.target,
|
|
655
|
+
};
|
|
656
|
+
}
|
|
657
|
+
/** Use native attribute normalization, including invalid/empty override defaults. */
|
|
658
|
+
function normalizedMethod(form, method) {
|
|
659
|
+
const probe = form.ownerDocument.createElement('form');
|
|
660
|
+
probe.setAttribute('method', method);
|
|
661
|
+
return probe.method;
|
|
662
|
+
}
|
|
663
|
+
function closeSubmissionDialog(host, activation) {
|
|
664
|
+
const view = host.ownerDocument.defaultView;
|
|
665
|
+
let node = host;
|
|
666
|
+
while (node) {
|
|
667
|
+
if (node instanceof view.HTMLDialogElement) {
|
|
668
|
+
const submitter = activation.submitter;
|
|
669
|
+
const value = submitter && submitter.type === 'image' ? (activation.coordinates ?? [0, 0]).join(',') : submitter ? formSubmitAction.submitAttribute(submitter, 'value', 'value') ?? '' : '';
|
|
670
|
+
view.HTMLDialogElement.prototype.close.call(node, value);
|
|
671
|
+
return;
|
|
672
|
+
}
|
|
673
|
+
node = node.parentNode ?? (node instanceof view.ShadowRoot ? node.host : null);
|
|
674
|
+
}
|
|
675
|
+
throw new view.DOMException('method="dialog" requires an actual native dialog ancestor.', 'NotSupportedError');
|
|
676
|
+
}
|
|
677
|
+
/** Scoped replacement of the native entry list; later formdata listeners remain native. */
|
|
678
|
+
function deliverForm(form, data, settings) {
|
|
679
|
+
const saved = ['action', 'method', 'enctype', 'target'].map(name => [name, form.getAttribute(name)]);
|
|
680
|
+
const root = form.getRootNode();
|
|
681
|
+
let consumed = false;
|
|
682
|
+
const replace = (event) => {
|
|
683
|
+
if (event.target !== form || consumed)
|
|
684
|
+
return;
|
|
685
|
+
consumed = true;
|
|
686
|
+
const entries = event.formData;
|
|
687
|
+
const names = new Set();
|
|
688
|
+
entries.forEach((_value, name) => names.add(name));
|
|
689
|
+
for (const name of names)
|
|
690
|
+
entries.delete(name);
|
|
691
|
+
data.forEach((value, name) => entries.append(name, value));
|
|
692
|
+
};
|
|
693
|
+
root.addEventListener('formdata', replace, true);
|
|
694
|
+
try {
|
|
695
|
+
for (const [name] of saved) {
|
|
696
|
+
const value = settings[name];
|
|
697
|
+
if (value === undefined)
|
|
698
|
+
form.removeAttribute(name);
|
|
699
|
+
else
|
|
700
|
+
form.setAttribute(name, value);
|
|
701
|
+
}
|
|
702
|
+
form.ownerDocument.defaultView.HTMLFormElement.prototype.submit.call(form);
|
|
703
|
+
}
|
|
704
|
+
finally {
|
|
705
|
+
root.removeEventListener('formdata', replace, true);
|
|
706
|
+
for (const [name, value] of saved) {
|
|
707
|
+
if (value === null)
|
|
708
|
+
form.removeAttribute(name);
|
|
709
|
+
else
|
|
710
|
+
form.setAttribute(name, value);
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
const formCss = () => `:host{display:block;box-sizing:border-box}.form-shell{display:flex;flex-direction:column;gap:var(--q-form-gap, var(--q-space-xl, 1.5rem));width:100%;color:var(--q-form-fg, var(--q-fg-base, #172033));font-family:var(--q-font-family, inherit)}.form-header.is-hidden,.form-actions.is-hidden{display:none}.form-title{margin:0;color:var(--q-form-title-color, var(--q-fg-base, #172033));font-size:var(--q-form-title-size, var(--q-font-size-lg, 1rem));font-weight:var(--q-font-weight-bold, 600);line-height:1.3}form{display:flex;flex-direction:column;gap:var(--q-form-gap, var(--q-space-xl, 1.5rem));width:100%;margin:0}.form-body{display:flex;flex-direction:column;gap:var(--q-form-field-gap, 12px);min-width:0}.form-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:var(--q-form-action-gap, var(--q-space-sm, .5rem));padding-top:var(--q-form-actions-padding-top, 4px)}:host{min-width:0}.q-label-hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip-path:inset(50%);white-space:nowrap;border:0 !important}.q-field-feedback{display:block;min-block-size:var(--_q-feedback-min, var(--q-context-feedback-min, 0px));font-family:var(--q-font-family, inherit);font-size:var(--q-field-feedback-font, var(--q-field-text-size, .75rem));font-weight:400;line-height:var(--q-field-text-line, 1rem);color:var(--q-fg-muted, #9ca3af);overflow-wrap:anywhere;margin:min(var(--q-space-xs, .25rem), var(--_q-feedback-min, var(--q-context-feedback-min, 0px))) 0 0}.q-field-feedback:not(:empty){margin-top:var(--q-space-xs, .25rem)}.q-field-feedback.error-msg{color:var(--_q-field-error-color, var(--q-color-danger, #f87171))}[part='label']:not(.q-label-hidden){font-family:var(--q-font-family, inherit);font-size:var(--q-field-label-font, var(--q-field-text-size, .75rem));font-weight:600;line-height:var(--q-field-text-line, 1rem);margin-bottom:var(--q-space-xs, .25rem);overflow-wrap:anywhere}`;
|
|
716
|
+
|
|
717
|
+
let formIds = 0;
|
|
718
|
+
const QForm = class {
|
|
719
|
+
constructor(hostRef) {
|
|
720
|
+
index.registerInstance(this, hostRef);
|
|
721
|
+
this.qSubmit = index.createEvent(this, "qSubmit");
|
|
722
|
+
this.qReset = index.createEvent(this, "qReset");
|
|
723
|
+
}
|
|
724
|
+
get el() { return index.getElement(this); }
|
|
725
|
+
/** Names the native form when no custom header is slotted. */
|
|
726
|
+
label;
|
|
727
|
+
size = 'inherit';
|
|
728
|
+
reserveFeedback;
|
|
729
|
+
labelHidden = false;
|
|
730
|
+
/** Prevents the native submit event's default navigation. */
|
|
731
|
+
preventDefault = true;
|
|
732
|
+
/** Controls how Enter behaves inside text-like controls. */
|
|
733
|
+
enterBehavior = 'submit';
|
|
734
|
+
noValidate = false;
|
|
735
|
+
action;
|
|
736
|
+
method = 'post';
|
|
737
|
+
autocomplete = 'on';
|
|
738
|
+
enctype = 'application/x-www-form-urlencoded';
|
|
739
|
+
target;
|
|
740
|
+
/** Names the native form without requiring a visible heading. */
|
|
741
|
+
ariaLabel = null;
|
|
742
|
+
/** Emitted after a valid submit with collected values and FormData. */
|
|
743
|
+
qSubmit;
|
|
744
|
+
qReset;
|
|
745
|
+
// ========================= [2] INTERNAL STATE & REFS =========================
|
|
746
|
+
hasHeaderSlot = false;
|
|
747
|
+
hasActionsSlot = false;
|
|
748
|
+
formEl;
|
|
749
|
+
headerSlot;
|
|
750
|
+
actionsSlot;
|
|
751
|
+
titleId = `q-form-title-${++formIds}`;
|
|
752
|
+
resetTask;
|
|
753
|
+
resetRequest;
|
|
754
|
+
submitTask;
|
|
755
|
+
submitGeneration = 0;
|
|
756
|
+
submitAbort;
|
|
757
|
+
// ========================= [3] LIFECYCLE & WATCHERS ==========================
|
|
758
|
+
componentDidLoad() {
|
|
759
|
+
this.updateHeaderSlotState();
|
|
760
|
+
this.updateActionsSlotState();
|
|
761
|
+
}
|
|
762
|
+
disconnectedCallback() {
|
|
763
|
+
this.submitGeneration++;
|
|
764
|
+
this.submitAbort?.abort();
|
|
765
|
+
}
|
|
766
|
+
// ============================ [4] EXPOSED METHODS ============================
|
|
767
|
+
/** Returns values collected from named native and WebQuark form controls. */
|
|
768
|
+
async getValues() {
|
|
769
|
+
await awaitFormControls(this.formEl, this.el);
|
|
770
|
+
await formSubmitAction.awaitResetActions(this.el);
|
|
771
|
+
await (this.resetRequest ?? this.resetTask);
|
|
772
|
+
return collectValues(this.formEl, this.el);
|
|
773
|
+
}
|
|
774
|
+
/** Applies values to matching named native and WebQuark form controls. */
|
|
775
|
+
async setValues(values) {
|
|
776
|
+
await awaitFormControls(this.formEl, this.el);
|
|
777
|
+
await formSubmitAction.awaitResetActions(this.el);
|
|
778
|
+
await (this.resetRequest ?? this.resetTask);
|
|
779
|
+
applyValues(this.formEl, this.el, values);
|
|
780
|
+
}
|
|
781
|
+
/** Resets the native form and associated controls. */
|
|
782
|
+
async resetForm() {
|
|
783
|
+
if (this.resetRequest)
|
|
784
|
+
return this.resetRequest;
|
|
785
|
+
if (this.resetTask)
|
|
786
|
+
return this.resetTask;
|
|
787
|
+
const request = this.performReset();
|
|
788
|
+
this.resetRequest = request;
|
|
789
|
+
try {
|
|
790
|
+
await request;
|
|
791
|
+
}
|
|
792
|
+
finally {
|
|
793
|
+
if (this.resetRequest === request)
|
|
794
|
+
this.resetRequest = undefined;
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
/** Checks current owned fields without displaying validation messages. */
|
|
798
|
+
async checkValidity() {
|
|
799
|
+
return this.reportControlValidity(false);
|
|
800
|
+
}
|
|
801
|
+
/** Reports current owned field constraints and returns aggregate validity. */
|
|
802
|
+
async reportValidity() {
|
|
803
|
+
return this.reportControlValidity(true);
|
|
804
|
+
}
|
|
805
|
+
/** Requests native form submission, falling back to dispatching a submit event. */
|
|
806
|
+
async submitForm() {
|
|
807
|
+
if (!this.submitTask)
|
|
808
|
+
this.requestSubmit();
|
|
809
|
+
await this.submitTask;
|
|
810
|
+
}
|
|
811
|
+
// =================== [5] EVENT HANDLERS & INTERNAL METHODS ===================
|
|
812
|
+
async performReset() {
|
|
813
|
+
await awaitFormControls(this.formEl, this.el);
|
|
814
|
+
if (this.resetTask)
|
|
815
|
+
return this.resetTask;
|
|
816
|
+
if (!this.formEl)
|
|
817
|
+
return;
|
|
818
|
+
reconcileControls(this.formEl, this.el);
|
|
819
|
+
const nativeReset = this.formEl.ownerDocument.defaultView.HTMLFormElement.prototype.reset;
|
|
820
|
+
nativeReset.call(this.formEl);
|
|
821
|
+
await this.resetTask;
|
|
822
|
+
}
|
|
823
|
+
handleComposedClick(ev) {
|
|
824
|
+
const action = ev.composedPath().find(target => target instanceof HTMLButtonElement || target instanceof HTMLInputElement);
|
|
825
|
+
// Read native image offsetX/Y inside its own shadow tree. Outside that tree
|
|
826
|
+
// the click is retargeted to q-form and offsets are relative to the host.
|
|
827
|
+
if (action?.getRootNode() === this.formEl?.getRootNode() && ev.currentTarget === this.el)
|
|
828
|
+
return;
|
|
829
|
+
if (action?.type === 'reset') {
|
|
830
|
+
if (!action.form && !action.hasAttribute('form'))
|
|
831
|
+
formSubmitAction.scheduleResetAction(action, ev);
|
|
832
|
+
return;
|
|
833
|
+
}
|
|
834
|
+
// q-button owns its bridge, including cancellation of qClick and late click listeners.
|
|
835
|
+
if (action && !ev.composedPath().some(target => target instanceof HTMLElement && target.tagName === 'Q-BUTTON'))
|
|
836
|
+
formSubmitAction.scheduleSubmitAction(action, ev);
|
|
837
|
+
}
|
|
838
|
+
handleKeyDown(ev) {
|
|
839
|
+
handleEnterBehavior({
|
|
840
|
+
ev,
|
|
841
|
+
enterBehavior: this.enterBehavior,
|
|
842
|
+
formEl: this.formEl,
|
|
843
|
+
hostEl: this.el,
|
|
844
|
+
requestSubmit: () => this.requestSubmit(),
|
|
845
|
+
});
|
|
846
|
+
}
|
|
847
|
+
requestSubmit() {
|
|
848
|
+
if (this.formEl)
|
|
849
|
+
formSubmitAction.dispatchFormSubmit(this.formEl);
|
|
850
|
+
}
|
|
851
|
+
handleHeaderSlotChange = () => {
|
|
852
|
+
this.updateHeaderSlotState();
|
|
853
|
+
};
|
|
854
|
+
handleActionsSlotChange = () => {
|
|
855
|
+
this.updateActionsSlotState();
|
|
856
|
+
};
|
|
857
|
+
updateHeaderSlotState() {
|
|
858
|
+
this.hasHeaderSlot = this.slotHasAssignedContent(this.headerSlot);
|
|
859
|
+
}
|
|
860
|
+
updateActionsSlotState() {
|
|
861
|
+
this.hasActionsSlot = this.slotHasAssignedContent(this.actionsSlot);
|
|
862
|
+
}
|
|
863
|
+
slotHasAssignedContent(slot) {
|
|
864
|
+
if (!slot)
|
|
865
|
+
return false;
|
|
866
|
+
return slot.assignedNodes({ flatten: true }).some(node => {
|
|
867
|
+
if (node.nodeType === Node.ELEMENT_NODE)
|
|
868
|
+
return true;
|
|
869
|
+
if (node.nodeType === Node.TEXT_NODE)
|
|
870
|
+
return Boolean(node.textContent?.trim());
|
|
871
|
+
return false;
|
|
872
|
+
});
|
|
873
|
+
}
|
|
874
|
+
handleSubmit = (ev) => {
|
|
875
|
+
if (ev.target !== this.formEl)
|
|
876
|
+
return;
|
|
877
|
+
if (ev.defaultPrevented || this.submitTask || !this.formEl) {
|
|
878
|
+
ev.preventDefault();
|
|
879
|
+
return;
|
|
880
|
+
}
|
|
881
|
+
// Cancels synchronously and observes later native submit listener calls.
|
|
882
|
+
const dispatch = cancelSubmitAndAwaitDispatch(ev);
|
|
883
|
+
const form = this.formEl;
|
|
884
|
+
const generation = this.submitGeneration;
|
|
885
|
+
const activation = formSubmitAction.readSubmitActivation(ev);
|
|
886
|
+
const abort = new AbortController();
|
|
887
|
+
this.submitAbort = abort;
|
|
888
|
+
formSubmitAction.setFormSubmitting(form, true);
|
|
889
|
+
const task = this.processSubmit(ev, form, generation, activation, abort.signal, dispatch);
|
|
890
|
+
this.submitTask = task;
|
|
891
|
+
void task.catch(error => console.error(error));
|
|
892
|
+
void task.finally(() => {
|
|
893
|
+
if (this.submitTask === task)
|
|
894
|
+
this.submitTask = undefined;
|
|
895
|
+
if (this.submitAbort === abort)
|
|
896
|
+
this.submitAbort = undefined;
|
|
897
|
+
formSubmitAction.setFormSubmitting(form, false);
|
|
898
|
+
}).catch(() => { });
|
|
899
|
+
};
|
|
900
|
+
currentSubmission(form, generation, activation) {
|
|
901
|
+
if (!this.el.isConnected || this.formEl !== form || this.submitGeneration !== generation)
|
|
902
|
+
return false;
|
|
903
|
+
const submitter = activation.submitter;
|
|
904
|
+
return !submitter || (submitter.isConnected && formSubmitAction.isSubmitAction(submitter) && [form, this.el].includes(formSubmitAction.submitOwner(submitter)));
|
|
905
|
+
}
|
|
906
|
+
async processSubmit(ev, form, generation, activation, signal, dispatch) {
|
|
907
|
+
if (await dispatch)
|
|
908
|
+
return;
|
|
909
|
+
await awaitFormControls(form, this.el, signal);
|
|
910
|
+
await formSubmitAction.awaitResetActions(this.el);
|
|
911
|
+
await (this.resetRequest ?? this.resetTask);
|
|
912
|
+
if (!this.currentSubmission(form, generation, activation))
|
|
913
|
+
return;
|
|
914
|
+
reconcileControls(form, this.el);
|
|
915
|
+
if (!this.noValidate && !formSubmitAction.submitterNoValidate(activation.submitter)) {
|
|
916
|
+
for (const control of getFormControls(form, this.el))
|
|
917
|
+
if (!validateField(control, true))
|
|
918
|
+
return;
|
|
919
|
+
}
|
|
920
|
+
if (!this.currentSubmission(form, generation, activation))
|
|
921
|
+
return;
|
|
922
|
+
const { values, formData } = collectFormState(form, this.el, submitterFields(activation));
|
|
923
|
+
const settings = submissionSettings({ action: this.action, method: this.method, enctype: this.enctype, target: this.target }, activation.submitter);
|
|
924
|
+
const emitted = this.qSubmit.emit({ values, formData, form, originalEvent: ev, submitter: activation.submitter });
|
|
925
|
+
if (emitted.defaultPrevented || this.preventDefault || !this.currentSubmission(form, generation, activation))
|
|
926
|
+
return;
|
|
927
|
+
if (normalizedMethod(form, settings.method) === 'dialog')
|
|
928
|
+
closeSubmissionDialog(this.el, activation);
|
|
929
|
+
else
|
|
930
|
+
deliverForm(form, formData, settings);
|
|
931
|
+
}
|
|
932
|
+
async reportControlValidity(report = true) {
|
|
933
|
+
await awaitFormControls(this.formEl, this.el);
|
|
934
|
+
await formSubmitAction.awaitResetActions(this.el);
|
|
935
|
+
await (this.resetRequest ?? this.resetTask);
|
|
936
|
+
if (this.formEl)
|
|
937
|
+
reconcileControls(this.formEl, this.el);
|
|
938
|
+
for (const control of getFormControls(this.formEl, this.el)) {
|
|
939
|
+
if (!validateField(control, report))
|
|
940
|
+
return false;
|
|
941
|
+
}
|
|
942
|
+
return true;
|
|
943
|
+
}
|
|
944
|
+
handleReset = (ev) => {
|
|
945
|
+
if (!this.formEl)
|
|
946
|
+
return;
|
|
947
|
+
if (this.resetTask) {
|
|
948
|
+
ev.preventDefault();
|
|
949
|
+
return;
|
|
950
|
+
}
|
|
951
|
+
const form = this.formEl;
|
|
952
|
+
let complete;
|
|
953
|
+
let fail;
|
|
954
|
+
const task = new Promise((resolve, reject) => {
|
|
955
|
+
complete = resolve;
|
|
956
|
+
fail = reject;
|
|
957
|
+
});
|
|
958
|
+
this.resetTask = task;
|
|
959
|
+
const emitted = this.qReset.emit({
|
|
960
|
+
form: this.formEl,
|
|
961
|
+
originalEvent: ev,
|
|
962
|
+
});
|
|
963
|
+
if (emitted.defaultPrevented)
|
|
964
|
+
ev.preventDefault();
|
|
965
|
+
// Native reset dispatch can flush microtasks before later listeners run.
|
|
966
|
+
// Preserve resetTask while waiting for their final cancellation decision.
|
|
967
|
+
setTimeout(async () => {
|
|
968
|
+
try {
|
|
969
|
+
if (!ev.defaultPrevented && this.el.isConnected) {
|
|
970
|
+
await awaitFormControls(form, this.el);
|
|
971
|
+
if (!ev.defaultPrevented && this.el.isConnected && this.formEl === form) {
|
|
972
|
+
resetLogicalControls(form, this.el);
|
|
973
|
+
reconcileControls(form, this.el);
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
complete();
|
|
977
|
+
}
|
|
978
|
+
catch (error) {
|
|
979
|
+
fail(error);
|
|
980
|
+
}
|
|
981
|
+
finally {
|
|
982
|
+
if (this.resetTask === task)
|
|
983
|
+
this.resetTask = undefined;
|
|
984
|
+
}
|
|
985
|
+
}, 0);
|
|
986
|
+
void task.catch(error => console.error(error));
|
|
987
|
+
};
|
|
988
|
+
// ===================== [6] RENDER (Visual Template Only) =====================
|
|
989
|
+
render() {
|
|
990
|
+
const hasHeaderContent = Boolean(this.label) || this.hasHeaderSlot;
|
|
991
|
+
const formLabelledBy = !this.ariaLabel && this.label && !this.hasHeaderSlot ? this.titleId : undefined;
|
|
992
|
+
const formAriaLabel = this.ariaLabel?.trim() || (this.label && this.hasHeaderSlot ? this.label : undefined);
|
|
993
|
+
return (index.h(index.Host, { key: '9eeca5dbe6783954ba5915ae2cbed2da36c23cb5', style: { ...tokens.controlScope(this.size), '--q-context-feedback-min': this.reserveFeedback === undefined ? '' : 'initial', '--_q-context-feedback-reserve': this.reserveFeedback === undefined ? '' : this.reserveFeedback ? '1' : '0' } }, index.h("div", { key: '2c80bf5712898a180d193a530beb6f208f0d2702', class: "form-shell" }, index.h("div", { key: 'a45188e5b3df0fa0b37400feacd95edfbe1110c4', class: { 'form-header': true, 'is-hidden': !hasHeaderContent, 'q-label-hidden': this.labelHidden }, part: "header" }, index.h("slot", { key: '4855d5fffa98f1f4dc39878f063f3323216c17d5', name: "header", ref: (el) => (this.headerSlot = el), onSlotchange: this.handleHeaderSlotChange }, this.label && index.h("h2", { key: '6482a98a6a0a99a7311a01f1b43b99b011d022d8', id: this.titleId, class: "form-title" }, this.label))), index.h("form", { key: '1f4b42eec4b633eaa3de7225c3b5bf918ad71079', ref: (el) => (this.formEl = el), action: this.action, method: this.method, autocomplete: this.autocomplete, enctype: this.enctype, target: this.target, noValidate: this.noValidate, "aria-labelledby": formLabelledBy, "aria-label": formAriaLabel, part: "form", onSubmit: this.handleSubmit, onClick: (ev) => {
|
|
994
|
+
const image = ev.target;
|
|
995
|
+
if (image instanceof HTMLInputElement && image.type === 'image' && image.getRootNode() === this.formEl?.getRootNode())
|
|
996
|
+
this.handleComposedClick(ev);
|
|
997
|
+
}, onReset: this.handleReset }, index.h("div", { key: '347a28b99b61212aaa644aa3db1fbde51c93d819', class: "form-body", part: "body" }, index.h("slot", { key: '334454b4bfc0e2a51d745991bcdc73549e4ca5a4' })), index.h("div", { key: '1f45d5c6aa912456169d75a54598c141f5543952', class: { 'form-actions': true, 'is-hidden': !this.hasActionsSlot }, part: "actions" }, index.h("slot", { key: 'd6102796fdb4d53ef3c21f60fd595120ef403cc9', name: "actions", ref: (el) => (this.actionsSlot = el), onSlotchange: this.handleActionsSlotChange }))))));
|
|
998
|
+
}
|
|
999
|
+
};
|
|
1000
|
+
QForm.style = formCss();
|
|
1001
|
+
|
|
1002
|
+
exports.q_form = QForm;
|