@webquark/core 1.1.0-dev.7 → 1.1.0-dev.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/cjs/{action.props-B87W5tRu.js → action.props-N0urQtdP.js} +1 -1
- package/dist/cjs/{chevron-up-Dysp_9UJ.js → chevron-up-D4t2OSHA.js} +2 -2
- package/dist/cjs/{data-table-cell-BAv6IIYx.js → data-table-cell-8uUCk2Qz.js} +5 -0
- package/dist/cjs/{field-CbUc_AWx.js → field-CsrQGhG-.js} +1 -1
- 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-D_tObBJa.js → index-DWXhKHCB.js} +25 -26
- package/dist/cjs/index.cjs.js +8 -3
- package/dist/cjs/leaflet-maplibre-gl-JIaCQ-7v.js +1025 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{map.types-DNrz8rJh.js → map.types-BWymIRql.js} +1 -1
- package/dist/cjs/q-accordion.cjs.entry.js +2 -2
- package/dist/cjs/q-alert.cjs.entry.js +1 -1
- package/dist/cjs/q-avatar.cjs.entry.js +2 -2
- package/dist/cjs/q-banner.cjs.entry.js +1 -1
- package/dist/cjs/q-button_2.cjs.entry.js +111 -24
- package/dist/cjs/q-card.cjs.entry.js +2 -2
- package/dist/cjs/q-carousel.cjs.entry.js +400 -13
- package/dist/cjs/q-chip.cjs.entry.js +2 -2
- package/dist/cjs/q-conversation-bubble.cjs.entry.js +1 -1
- package/dist/cjs/q-data-table.cjs.entry.js +73 -11
- package/dist/cjs/q-dialog.cjs.entry.js +3 -3
- package/dist/cjs/q-dropdown.cjs.entry.js +64 -11
- package/dist/cjs/q-form.cjs.entry.js +774 -287
- package/dist/cjs/q-grid.cjs.entry.js +3 -3
- package/dist/cjs/q-icon.cjs.entry.js +143 -89
- package/dist/cjs/q-image-comparison.cjs.entry.js +201 -0
- package/dist/cjs/q-inline.cjs.entry.js +3 -3
- package/dist/cjs/q-input_2.cjs.entry.js +90 -22
- package/dist/cjs/q-link.cjs.entry.js +2 -2
- package/dist/cjs/q-map.cjs.entry.js +119 -22
- package/dist/cjs/q-media.cjs.entry.js +3 -3
- package/dist/cjs/q-navbar.cjs.entry.js +3 -3
- package/dist/cjs/q-pagination.cjs.entry.js +2 -2
- package/dist/cjs/q-panel.cjs.entry.js +6 -6
- package/dist/cjs/q-quantity-selector.cjs.entry.js +5 -5
- package/dist/cjs/q-radio-group.cjs.entry.js +48 -11
- package/dist/cjs/q-reel.cjs.entry.js +3 -3
- package/dist/cjs/q-scrollable.cjs.entry.js +4 -4
- package/dist/cjs/q-section.cjs.entry.js +2 -2
- package/dist/cjs/q-sidepanel.cjs.entry.js +145 -25
- package/dist/cjs/q-stack.cjs.entry.js +3 -3
- package/dist/cjs/q-step-diagram-item.cjs.entry.js +2 -2
- package/dist/cjs/q-step-diagram.cjs.entry.js +3 -3
- package/dist/cjs/q-syntax-box.cjs.entry.js +418 -301
- package/dist/cjs/q-tabs.cjs.entry.js +2 -2
- package/dist/cjs/q-textarea.cjs.entry.js +66 -21
- package/dist/cjs/q-thumbnail.cjs.entry.js +3 -3
- package/dist/cjs/q-toast.cjs.entry.js +1 -1
- package/dist/cjs/q-toggle.cjs.entry.js +58 -12
- package/dist/cjs/q-toolbar.cjs.entry.js +4 -4
- package/dist/cjs/registry-C3IYlNMp.js +323 -0
- package/dist/cjs/{tokens-DDfS79n9.js → tokens-RMRaIOqv.js} +12 -3
- package/dist/cjs/webquark.cjs.js +3 -3
- package/dist/collection/assets/icons/spinner.svg +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/actions/button/button.js +250 -14
- package/dist/collection/components/actions/button/test/button-slots.cmp.test.js +70 -0
- package/dist/collection/components/content/carousel/carousel.css +91 -5
- package/dist/collection/components/content/carousel/carousel.js +511 -20
- package/dist/collection/components/content/carousel/internals/autoplay.js +64 -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.js +1 -1
- package/dist/collection/components/data-display/data-table/data-table-cell.js +4 -0
- package/dist/collection/components/data-display/data-table/data-table.css +73 -0
- package/dist/collection/components/data-display/data-table/data-table.js +117 -3
- package/dist/collection/components/data-display/data-table/internals/render-table-body.js +15 -3
- package/dist/collection/components/data-display/data-table/internals/render-table-head.js +1 -1
- package/dist/collection/components/data-display/data-table/internals/table-model.js +9 -1
- 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/marker-presentation.js +51 -2
- package/dist/collection/components/data-display/map/internals/markers.js +16 -1
- package/dist/collection/components/data-display/map/map.css +31 -0
- package/dist/collection/components/data-display/map/map.js +96 -15
- package/dist/collection/components/data-display/map/map.types.js +1 -1
- package/dist/collection/components/data-display/map/test/map.cmp.test.js +187 -0
- package/dist/collection/components/data-display/pagination/pagination.js +1 -1
- package/dist/collection/components/data-display/syntax-box/internals/value-sync.js +6 -23
- 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 +7 -0
- package/dist/collection/components/data-display/syntax-box/syntax-box.js +78 -23
- 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/step-diagram/step-diagram.js +2 -2
- package/dist/collection/components/indicators/step-diagram-item/step-diagram-item.js +1 -1
- package/dist/collection/components/inputs/dropdown/dropdown.js +64 -10
- package/dist/collection/components/inputs/form/form.js +203 -100
- package/dist/collection/components/inputs/form/internals/controls.js +121 -27
- package/dist/collection/components/inputs/form/internals/enter-behavior.js +14 -25
- 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 +176 -153
- 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 +438 -0
- package/dist/collection/components/inputs/form/test/form-values.cmp.test.js +440 -0
- package/dist/collection/components/inputs/input/input.js +91 -20
- package/dist/collection/components/inputs/quantity-selector/quantity-selector.js +4 -4
- package/dist/collection/components/inputs/radio-group/radio-group.js +51 -9
- package/dist/collection/components/inputs/textarea/textarea.js +70 -18
- package/dist/collection/components/inputs/toggle/toggle.js +57 -10
- package/dist/collection/components/layout/grid/grid.js +1 -1
- package/dist/collection/components/layout/inline/inline.js +1 -1
- package/dist/collection/components/layout/navbar/navbar.js +2 -2
- package/dist/collection/components/layout/panel/panel.js +4 -4
- package/dist/collection/components/layout/scrollable/scrollable.js +3 -3
- package/dist/collection/components/layout/section/section.js +1 -1
- package/dist/collection/components/layout/sidepanel/internals/drawer.js +42 -4
- package/dist/collection/components/layout/sidepanel/sidepanel.css +145 -14
- package/dist/collection/components/layout/sidepanel/sidepanel.js +99 -10
- 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.js +1 -1
- package/dist/collection/components/layout/tabs/tabs.js +1 -1
- package/dist/collection/components/layout/toolbar/toolbar.js +2 -2
- package/dist/collection/components/media/avatar/avatar.js +1 -1
- package/dist/collection/components/media/icon/internals/fetch-icon.js +33 -4
- 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 +33 -82
- package/dist/collection/components/media/icon/internals/sanitize-svg.js +80 -57
- package/dist/collection/components/media/icon/internals/url.js +31 -27
- 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.js +22 -22
- package/dist/collection/components/media/reel/reel.js +2 -2
- package/dist/collection/components/media/thumbnail/thumbnail.js +2 -2
- package/dist/collection/components/overlays/dialog/dialog.js +2 -2
- package/dist/collection/components/overlays/tooltip/internals/positioning.js +20 -5
- package/dist/collection/components/overlays/tooltip/tooltip.css +5 -1
- package/dist/collection/components/overlays/tooltip/tooltip.js +9 -3
- package/dist/collection/index.js +2 -1
- package/dist/collection/playground/assets/comparison-after.svg +1 -0
- package/dist/collection/playground/assets/comparison-before.svg +1 -0
- package/dist/collection/playground/playground.bundled.js +16 -7
- package/dist/collection/theme/test/foundation.cmp.test.js +6 -0
- package/dist/collection/theme/tokens.js +12 -3
- 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/formatter.js +137 -158
- package/dist/collection/utils/formatter.unit.test.js +69 -51
- package/dist/collection/utils/image-crop.js +47 -0
- package/dist/collection/utils/image-crop.unit.test.js +57 -0
- package/dist/collection/utils/syntax.js +210 -81
- package/dist/collection/utils/syntax.unit.test.js +134 -0
- package/dist/components/index.js +1 -1
- package/dist/components/{p-CtUn83Rs.js → p-6PPZ2sIO.js} +1 -1
- package/dist/{webquark/p-CyPFM3XV.js → components/p-B4Mg1xEw.js} +1 -1
- package/dist/components/{p-BeFSyZjp.js → p-BH4gQWub.js} +1 -1
- package/dist/components/p-BOdNg0jc.js +1 -0
- package/dist/components/p-BcL0NVv0.js +1 -0
- package/dist/{playground/build/p-CGcC-mvi.js → components/p-BofcK-7Z.js} +1 -1
- package/dist/components/p-C6vxokHH.js +1 -0
- package/dist/components/p-CGml_DQ8.js +1 -0
- package/dist/components/{p-CuJIyOwp.js → p-CKuPOxKN.js} +1 -1
- package/dist/components/p-CN1ut2Lb.js +1 -0
- package/dist/components/p-C_RztzNv.js +5 -0
- package/dist/components/p-CoIMrUb3.js +1 -0
- package/dist/components/{p-g9vOVxQ4.js → p-DKrPmn2y.js} +2 -2
- package/dist/components/p-DT6k8Yhx.js +1 -0
- package/dist/components/p-Dfp_If-_.js +1 -0
- package/dist/components/p-DstNl_WY.js +1 -0
- package/dist/components/p-GHhpSfZU.js +1 -0
- package/dist/components/p-SzKf4WZF.js +1 -0
- package/dist/components/p-ye27qtRo.js +1 -0
- package/dist/components/q-accordion.js +1 -1
- package/dist/components/q-alert.js +1 -1
- package/dist/components/q-avatar.js +1 -1
- package/dist/components/q-banner.js +1 -1
- package/dist/components/q-button.js +1 -1
- package/dist/components/q-card.js +1 -1
- package/dist/components/q-carousel.js +1 -1
- package/dist/components/q-chip.js +1 -1
- package/dist/components/q-conversation-bubble.js +1 -1
- package/dist/components/q-data-table.js +1 -1
- package/dist/components/q-dialog.js +1 -1
- package/dist/components/q-dropdown.js +1 -1
- package/dist/components/q-form.js +1 -1
- package/dist/components/q-grid.js +1 -1
- package/dist/components/q-icon.js +1 -1
- package/dist/components/q-image-comparison.d.ts +11 -0
- package/dist/components/q-image-comparison.js +1 -0
- package/dist/components/q-inline.js +1 -1
- package/dist/components/q-input.js +1 -1
- package/dist/components/q-link.js +1 -1
- package/dist/components/q-map.js +1 -1
- package/dist/components/q-media.js +1 -1
- package/dist/components/q-navbar.js +1 -1
- package/dist/components/q-pagination.js +1 -1
- package/dist/components/q-panel.js +1 -1
- package/dist/components/q-progress.js +1 -1
- package/dist/components/q-quantity-selector.js +1 -1
- package/dist/components/q-radio-group.js +1 -1
- package/dist/components/q-reel.js +1 -1
- package/dist/components/q-scrollable.js +1 -1
- package/dist/components/q-section.js +1 -1
- package/dist/components/q-sidepanel.js +5 -5
- package/dist/components/q-stack.js +1 -1
- package/dist/components/q-step-diagram-item.js +1 -1
- package/dist/components/q-step-diagram.js +1 -1
- package/dist/components/q-syntax-box.js +5 -5
- package/dist/components/q-tabs.js +1 -1
- package/dist/components/q-textarea.js +1 -1
- package/dist/components/q-thumbnail.js +1 -1
- package/dist/components/q-toast.js +1 -1
- package/dist/components/q-toggle.js +1 -1
- package/dist/components/q-toolbar.js +1 -1
- package/dist/components/q-tooltip.js +1 -1
- package/dist/esm/{action.props-BypnAgOy.js → action.props-CpnGza8z.js} +1 -1
- package/dist/esm/{chevron-up-g9vOVxQ4.js → chevron-up-DKrPmn2y.js} +2 -2
- package/dist/esm/{data-table-cell-DmqVhVoj.js → data-table-cell-SzKf4WZF.js} +5 -1
- package/dist/esm/{field-dFy4PXKT.js → field-zfD6OQ02.js} +1 -1
- 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-tSny_c7b.js → index-B5ElFlHv.js} +25 -26
- package/dist/esm/index.js +4 -3
- package/dist/esm/leaflet-maplibre-gl-BvKlNmWf.js +1020 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{map.types-WJHaLJS_.js → map.types-CoIMrUb3.js} +1 -1
- package/dist/esm/q-accordion.entry.js +2 -2
- package/dist/esm/q-alert.entry.js +1 -1
- package/dist/esm/q-avatar.entry.js +2 -2
- package/dist/esm/q-banner.entry.js +1 -1
- package/dist/esm/q-button_2.entry.js +111 -24
- package/dist/esm/q-card.entry.js +2 -2
- package/dist/esm/q-carousel.entry.js +400 -13
- package/dist/esm/q-chip.entry.js +2 -2
- package/dist/esm/q-conversation-bubble.entry.js +1 -1
- package/dist/esm/q-data-table.entry.js +73 -11
- package/dist/esm/q-dialog.entry.js +3 -3
- package/dist/esm/q-dropdown.entry.js +64 -11
- package/dist/esm/q-form.entry.js +774 -287
- package/dist/esm/q-grid.entry.js +3 -3
- package/dist/esm/q-icon.entry.js +143 -89
- package/dist/esm/q-image-comparison.entry.js +199 -0
- package/dist/esm/q-inline.entry.js +3 -3
- package/dist/esm/q-input_2.entry.js +90 -22
- package/dist/esm/q-link.entry.js +2 -2
- package/dist/esm/q-map.entry.js +119 -22
- package/dist/esm/q-media.entry.js +3 -3
- package/dist/esm/q-navbar.entry.js +3 -3
- package/dist/esm/q-pagination.entry.js +2 -2
- package/dist/esm/q-panel.entry.js +6 -6
- package/dist/esm/q-quantity-selector.entry.js +5 -5
- package/dist/esm/q-radio-group.entry.js +48 -11
- package/dist/esm/q-reel.entry.js +3 -3
- package/dist/esm/q-scrollable.entry.js +4 -4
- package/dist/esm/q-section.entry.js +2 -2
- package/dist/esm/q-sidepanel.entry.js +146 -26
- package/dist/esm/q-stack.entry.js +3 -3
- package/dist/esm/q-step-diagram-item.entry.js +2 -2
- package/dist/esm/q-step-diagram.entry.js +3 -3
- package/dist/esm/q-syntax-box.entry.js +418 -301
- package/dist/esm/q-tabs.entry.js +2 -2
- package/dist/esm/q-textarea.entry.js +66 -21
- package/dist/esm/q-thumbnail.entry.js +3 -3
- package/dist/esm/q-toast.entry.js +1 -1
- package/dist/esm/q-toggle.entry.js +58 -12
- package/dist/esm/q-toolbar.entry.js +4 -4
- package/dist/esm/registry-GHhpSfZU.js +308 -0
- package/dist/esm/{tokens-CyPFM3XV.js → tokens-B4Mg1xEw.js} +12 -3
- package/dist/esm/webquark.js +4 -4
- package/dist/playground/assets/comparison-after.svg +1 -0
- package/dist/playground/assets/comparison-before.svg +1 -0
- package/dist/playground/assets/icons/check-preview.png +0 -0
- package/dist/playground/assets/icons/spinner.svg +1 -1
- package/dist/playground/build/index.esm.js +1 -1
- package/dist/playground/build/{p-781d3459.entry.js → p-023f8437.entry.js} +1 -1
- package/dist/playground/build/{p-ca240b8b.entry.js → p-030ecde3.entry.js} +1 -1
- package/dist/playground/build/p-04c8cb9e.entry.js +1 -0
- package/dist/playground/build/{p-81f64d6f.entry.js → p-059daa8a.entry.js} +1 -1
- package/dist/playground/build/{p-964d27e0.entry.js → p-09cca7b9.entry.js} +1 -1
- package/dist/playground/build/p-0aa74ad6.entry.js +1 -0
- package/dist/playground/build/p-0ae43d6c.entry.js +1 -0
- package/dist/playground/build/p-0c3aac3f.entry.js +1 -0
- package/dist/playground/build/p-144ef339.entry.js +1 -0
- package/dist/playground/build/p-1d1f7bc3.entry.js +1 -0
- package/dist/playground/build/p-296fbdb1.entry.js +1 -0
- package/dist/playground/build/p-36118d90.entry.js +1 -0
- package/dist/playground/build/{p-82810ead.entry.js → p-3bc4629c.entry.js} +1 -1
- package/dist/playground/build/{p-25c3b776.entry.js → p-48fb5228.entry.js} +1 -1
- package/dist/playground/build/{p-b4dfadea.entry.js → p-4d61b70d.entry.js} +1 -1
- package/dist/playground/build/p-5f232b44.entry.js +13 -0
- package/dist/playground/build/{p-b9e83fa3.entry.js → p-64096386.entry.js} +1 -1
- package/dist/playground/build/{p-e6603d17.entry.js → p-6bfffa79.entry.js} +1 -1
- package/dist/{webquark/p-fed7219c.entry.js → playground/build/p-6e28cfe2.entry.js} +1 -1
- package/dist/playground/build/{p-e1c8a9aa.entry.js → p-70d9ffde.entry.js} +1 -1
- package/dist/{webquark/p-d0c55860.entry.js → playground/build/p-8ece2c62.entry.js} +1 -1
- package/dist/playground/build/p-90b0858c.entry.js +1 -0
- package/dist/playground/build/p-91fff6b6.entry.js +1 -0
- package/dist/playground/build/p-923dac41.entry.js +1 -0
- package/dist/playground/build/p-97a89cae.entry.js +1 -0
- package/dist/playground/build/{p-362c5608.entry.js → p-99d785ca.entry.js} +1 -1
- package/dist/playground/build/{p-5453eac7.entry.js → p-9e78b796.entry.js} +1 -1
- package/dist/playground/build/{p-b08d0ed8.entry.js → p-9ff7e5a4.entry.js} +1 -1
- package/dist/{components/p-CyPFM3XV.js → playground/build/p-B4Mg1xEw.js} +1 -1
- package/dist/playground/build/p-B5ElFlHv.js +3 -0
- package/dist/playground/build/p-BOdNg0jc.js +1 -0
- package/dist/playground/build/p-BcL0NVv0.js +1 -0
- package/dist/playground/build/p-CGml_DQ8.js +1 -0
- package/dist/playground/build/p-C_RztzNv.js +5 -0
- package/dist/playground/build/p-CoIMrUb3.js +1 -0
- package/dist/{webquark/p-g9vOVxQ4.js → playground/build/p-DKrPmn2y.js} +2 -2
- package/dist/playground/build/p-DWO-pleQ.js +1 -0
- package/dist/{components/p-COMoSatC.js → playground/build/p-Dhsn99q4.js} +1 -1
- package/dist/playground/build/p-DstNl_WY.js +1 -0
- package/dist/playground/build/p-GHhpSfZU.js +1 -0
- package/dist/playground/build/p-SzKf4WZF.js +1 -0
- package/dist/playground/build/p-c523ec6f.entry.js +1 -0
- package/dist/playground/build/p-d0253d64.entry.js +1 -0
- package/dist/playground/build/p-d0fbd2b1.entry.js +1 -0
- package/dist/{webquark/p-9b4271ea.entry.js → playground/build/p-dd115868.entry.js} +1 -1
- package/dist/playground/build/{p-5eeb922e.entry.js → p-f1bac94c.entry.js} +1 -1
- package/dist/playground/build/{p-17011e71.entry.js → p-f4f97e74.entry.js} +1 -1
- package/dist/playground/build/p-f63b7214.entry.js +1 -0
- package/dist/{webquark/p-9227780b.entry.js → playground/build/p-f98f9439.entry.js} +1 -1
- package/dist/playground/build/{p-ae4e5ec4.entry.js → p-f9ad63ff.entry.js} +1 -1
- package/dist/playground/build/p-fe200f68.entry.js +1 -0
- package/dist/playground/build/p-fe8c634a.entry.js +13 -0
- package/dist/{webquark/p-151a555e.entry.js → playground/build/p-fec6fe0a.entry.js} +1 -1
- package/dist/playground/build/webquark.css +1 -1
- package/dist/playground/build/webquark.esm.js +1 -1
- package/dist/playground/playground/components.manifest.json +1 -0
- package/dist/playground/playground/specs/q-carousel.sandbox.json +15 -0
- package/dist/playground/playground/specs/q-data-table.sandbox.json +24 -0
- package/dist/playground/playground/specs/q-icon.sandbox.json +17 -1
- package/dist/playground/playground/specs/q-image-comparison.sandbox.json +24 -0
- package/dist/playground/playground/specs/q-syntax-box.sandbox.json +68 -24
- package/dist/playground/playground.js +16 -7
- package/dist/types/components/actions/button/button.d.ts +26 -0
- package/dist/types/components/actions/button/test/button-slots.cmp.test.d.ts +1 -0
- package/dist/types/components/content/carousel/carousel.d.ts +71 -4
- package/dist/types/components/content/carousel/carousel.types.d.ts +5 -0
- package/dist/types/components/content/carousel/internals/autoplay.d.ts +22 -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/data-table/data-table-cell.d.ts +2 -0
- package/dist/types/components/data-display/data-table/data-table.d.ts +18 -1
- package/dist/types/components/data-display/data-table/data-table.types.d.ts +3 -0
- package/dist/types/components/data-display/data-table/internals/render-table-body.d.ts +1 -0
- package/dist/types/components/data-display/data-table/internals/table-model.d.ts +5 -1
- 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/map.d.ts +7 -3
- package/dist/types/components/data-display/map/map.types.d.ts +11 -1
- package/dist/types/components/data-display/syntax-box/internals/value-sync.d.ts +1 -4
- 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 +9 -3
- 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/inputs/dropdown/dropdown.d.ts +5 -0
- package/dist/types/components/inputs/form/form.d.ts +12 -7
- package/dist/types/components/inputs/form/form.types.d.ts +2 -0
- package/dist/types/components/inputs/form/internals/controls.d.ts +3 -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 +6 -1
- 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/input/input.d.ts +7 -1
- package/dist/types/components/inputs/radio-group/radio-group.d.ts +4 -0
- package/dist/types/components/inputs/textarea/textarea.d.ts +6 -1
- package/dist/types/components/inputs/toggle/toggle.d.ts +5 -0
- package/dist/types/components/layout/sidepanel/sidepanel.d.ts +9 -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/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/sanitize-svg.d.ts +1 -1
- 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 +1 -1
- package/dist/types/components/overlays/tooltip/internals/positioning.d.ts +1 -1
- package/dist/types/components/overlays/tooltip/tooltip.d.ts +5 -0
- package/dist/types/components.d.ts +436 -23
- package/dist/types/index.d.ts +6 -3
- 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/formatter.d.ts +10 -19
- 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/syntax.d.ts +11 -7
- package/dist/types/utils/syntax.unit.test.d.ts +1 -0
- package/dist/webquark/index.esm.js +1 -1
- package/dist/webquark/{p-781d3459.entry.js → p-023f8437.entry.js} +1 -1
- package/dist/webquark/{p-ca240b8b.entry.js → p-030ecde3.entry.js} +1 -1
- package/dist/webquark/p-04c8cb9e.entry.js +1 -0
- package/dist/webquark/{p-81f64d6f.entry.js → p-059daa8a.entry.js} +1 -1
- package/dist/webquark/{p-964d27e0.entry.js → p-09cca7b9.entry.js} +1 -1
- package/dist/webquark/p-0aa74ad6.entry.js +1 -0
- package/dist/webquark/p-0ae43d6c.entry.js +1 -0
- package/dist/webquark/p-0c3aac3f.entry.js +1 -0
- package/dist/webquark/p-144ef339.entry.js +1 -0
- package/dist/webquark/p-1d1f7bc3.entry.js +1 -0
- package/dist/webquark/p-296fbdb1.entry.js +1 -0
- package/dist/webquark/p-36118d90.entry.js +1 -0
- package/dist/webquark/{p-82810ead.entry.js → p-3bc4629c.entry.js} +1 -1
- package/dist/webquark/{p-25c3b776.entry.js → p-48fb5228.entry.js} +1 -1
- package/dist/webquark/{p-b4dfadea.entry.js → p-4d61b70d.entry.js} +1 -1
- package/dist/webquark/p-5f232b44.entry.js +13 -0
- package/dist/webquark/{p-b9e83fa3.entry.js → p-64096386.entry.js} +1 -1
- package/dist/webquark/{p-e6603d17.entry.js → p-6bfffa79.entry.js} +1 -1
- package/dist/{playground/build/p-fed7219c.entry.js → webquark/p-6e28cfe2.entry.js} +1 -1
- package/dist/webquark/{p-e1c8a9aa.entry.js → p-70d9ffde.entry.js} +1 -1
- package/dist/{playground/build/p-d0c55860.entry.js → webquark/p-8ece2c62.entry.js} +1 -1
- package/dist/webquark/p-90b0858c.entry.js +1 -0
- package/dist/webquark/p-91fff6b6.entry.js +1 -0
- package/dist/webquark/p-923dac41.entry.js +1 -0
- package/dist/webquark/p-97a89cae.entry.js +1 -0
- package/dist/webquark/{p-362c5608.entry.js → p-99d785ca.entry.js} +1 -1
- package/dist/webquark/{p-5453eac7.entry.js → p-9e78b796.entry.js} +1 -1
- package/dist/webquark/{p-b08d0ed8.entry.js → p-9ff7e5a4.entry.js} +1 -1
- package/dist/{playground/build/p-CyPFM3XV.js → webquark/p-B4Mg1xEw.js} +1 -1
- package/dist/webquark/p-B5ElFlHv.js +3 -0
- package/dist/webquark/p-BOdNg0jc.js +1 -0
- package/dist/webquark/p-BcL0NVv0.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/{playground/build/p-g9vOVxQ4.js → webquark/p-DKrPmn2y.js} +2 -2
- package/dist/webquark/p-DWO-pleQ.js +1 -0
- package/dist/webquark/{p-CGcC-mvi.js → p-Dhsn99q4.js} +1 -1
- package/dist/webquark/p-DstNl_WY.js +1 -0
- package/dist/webquark/p-GHhpSfZU.js +1 -0
- package/dist/webquark/p-SzKf4WZF.js +1 -0
- package/dist/webquark/p-c523ec6f.entry.js +1 -0
- package/dist/webquark/p-d0253d64.entry.js +1 -0
- package/dist/webquark/p-d0fbd2b1.entry.js +1 -0
- package/dist/{playground/build/p-9b4271ea.entry.js → webquark/p-dd115868.entry.js} +1 -1
- package/dist/webquark/{p-5eeb922e.entry.js → p-f1bac94c.entry.js} +1 -1
- package/dist/webquark/{p-17011e71.entry.js → p-f4f97e74.entry.js} +1 -1
- package/dist/webquark/p-f63b7214.entry.js +1 -0
- package/dist/{playground/build/p-9227780b.entry.js → webquark/p-f98f9439.entry.js} +1 -1
- package/dist/webquark/{p-ae4e5ec4.entry.js → p-f9ad63ff.entry.js} +1 -1
- package/dist/webquark/p-fe200f68.entry.js +1 -0
- package/dist/webquark/p-fe8c634a.entry.js +13 -0
- package/dist/{playground/build/p-151a555e.entry.js → webquark/p-fec6fe0a.entry.js} +1 -1
- package/dist/webquark/webquark.css +1 -1
- package/dist/webquark/webquark.esm.js +1 -1
- package/package.json +16 -19
- package/scripts/webquark-serve.js +9 -7
- package/scripts/wq-switch/README.md +113 -109
- package/scripts/wq-switch/dist/index.js +106 -82
- package/scripts/wq-switch/dist/setup.js +80 -60
- package/dist/cjs/leaflet-maplibre-gl-BJKExsns.js +0 -1031
- package/dist/cjs/registry-BhkCNgxt.js +0 -179
- package/dist/components/p-2_cpBb8_.js +0 -1
- package/dist/components/p-BfZVatS6.js +0 -1
- package/dist/components/p-BvBRW3dl.js +0 -1
- package/dist/components/p-CFuqfXuv.js +0 -9
- package/dist/components/p-Cn_ChUpc.js +0 -1
- package/dist/components/p-DmqVhVoj.js +0 -1
- package/dist/components/p-DwnH6_NQ.js +0 -1
- package/dist/components/p-WJHaLJS_.js +0 -1
- package/dist/components/p-_X1v1o3K.js +0 -1
- package/dist/esm/leaflet-maplibre-gl-BVDAAs7w.js +0 -1026
- package/dist/esm/registry-BvBRW3dl.js +0 -173
- package/dist/playground/build/p-04799ed0.entry.js +0 -1
- package/dist/playground/build/p-0610d5b2.entry.js +0 -1
- package/dist/playground/build/p-160cb4e4.entry.js +0 -1
- package/dist/playground/build/p-1cf51c80.entry.js +0 -1
- package/dist/playground/build/p-3d674223.entry.js +0 -1
- package/dist/playground/build/p-4fff116c.entry.js +0 -1
- package/dist/playground/build/p-675d0d03.entry.js +0 -13
- package/dist/playground/build/p-70c4f92f.entry.js +0 -1
- package/dist/playground/build/p-72dc1231.entry.js +0 -1
- package/dist/playground/build/p-736b1c8c.entry.js +0 -1
- package/dist/playground/build/p-96922229.entry.js +0 -1
- package/dist/playground/build/p-BLvl8YLq.js +0 -1
- package/dist/playground/build/p-BvBRW3dl.js +0 -1
- package/dist/playground/build/p-CFuqfXuv.js +0 -9
- package/dist/playground/build/p-DmqVhVoj.js +0 -1
- package/dist/playground/build/p-WJHaLJS_.js +0 -1
- package/dist/playground/build/p-b7ac65c6.entry.js +0 -1
- package/dist/playground/build/p-bba3c7b4.entry.js +0 -1
- package/dist/playground/build/p-bf47c46a.entry.js +0 -13
- package/dist/playground/build/p-c448b4ce.entry.js +0 -1
- package/dist/playground/build/p-cb5ebd01.entry.js +0 -1
- package/dist/playground/build/p-e762a4b7.entry.js +0 -1
- package/dist/playground/build/p-fb76473e.entry.js +0 -1
- package/dist/playground/build/p-tSny_c7b.js +0 -3
- package/dist/webquark/p-04799ed0.entry.js +0 -1
- package/dist/webquark/p-0610d5b2.entry.js +0 -1
- package/dist/webquark/p-160cb4e4.entry.js +0 -1
- package/dist/webquark/p-1cf51c80.entry.js +0 -1
- package/dist/webquark/p-3d674223.entry.js +0 -1
- package/dist/webquark/p-4fff116c.entry.js +0 -1
- package/dist/webquark/p-675d0d03.entry.js +0 -13
- package/dist/webquark/p-70c4f92f.entry.js +0 -1
- package/dist/webquark/p-72dc1231.entry.js +0 -1
- package/dist/webquark/p-736b1c8c.entry.js +0 -1
- package/dist/webquark/p-96922229.entry.js +0 -1
- package/dist/webquark/p-BLvl8YLq.js +0 -1
- package/dist/webquark/p-BvBRW3dl.js +0 -1
- package/dist/webquark/p-CFuqfXuv.js +0 -9
- package/dist/webquark/p-DmqVhVoj.js +0 -1
- package/dist/webquark/p-WJHaLJS_.js +0 -1
- package/dist/webquark/p-b7ac65c6.entry.js +0 -1
- package/dist/webquark/p-bba3c7b4.entry.js +0 -1
- package/dist/webquark/p-bf47c46a.entry.js +0 -13
- package/dist/webquark/p-c448b4ce.entry.js +0 -1
- package/dist/webquark/p-cb5ebd01.entry.js +0 -1
- package/dist/webquark/p-e762a4b7.entry.js +0 -1
- package/dist/webquark/p-fb76473e.entry.js +0 -1
- package/dist/webquark/p-tSny_c7b.js +0 -3
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
2
|
+
import { page } from "vitest/browser";
|
|
3
|
+
// @ts-ignore - verify freshly built consumer output.
|
|
4
|
+
import { defineCustomElements } from "../../../../../dist/loader";
|
|
5
|
+
// @ts-ignore - real guide previews use the production theme.
|
|
6
|
+
import "../../../../../dist/webquark/webquark.css";
|
|
7
|
+
import { INVALID_JSON, JSON_EXPECTED, JSON_SOURCE, jsonTokens, UNSUPPORTED_SOURCE } from "./format-fixtures";
|
|
8
|
+
import { MAX_JSON_FORMAT_DEPTH } from "../../../../utils/formatter";
|
|
9
|
+
import { normalizeDomNewlines } from "./syntax-fixtures";
|
|
10
|
+
defineCustomElements();
|
|
11
|
+
afterEach(() => { document.body.replaceChildren(); document.body.style.margin = ''; vi.restoreAllMocks(); });
|
|
12
|
+
async function create(props = {}) {
|
|
13
|
+
const form = document.createElement('form');
|
|
14
|
+
const el = document.createElement('q-syntax-box');
|
|
15
|
+
Object.assign(el, { editable: true, language: 'json', height: '220px', ...props });
|
|
16
|
+
form.append(el);
|
|
17
|
+
document.body.append(form);
|
|
18
|
+
await el.componentOnReady();
|
|
19
|
+
return { el, form };
|
|
20
|
+
}
|
|
21
|
+
async function exact(el, source) {
|
|
22
|
+
await vi.waitFor(() => {
|
|
23
|
+
expect(el.code).toBe(source);
|
|
24
|
+
expect(el.value).toBe(source);
|
|
25
|
+
expect(el.shadowRoot.querySelector('textarea').value).toBe(normalizeDomNewlines(source));
|
|
26
|
+
expect(normalizeDomNewlines(el.shadowRoot.querySelector('code').textContent)).toBe(normalizeDomNewlines(source));
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function events(el) {
|
|
30
|
+
const observed = [];
|
|
31
|
+
for (const type of ['qInput', 'qChange'])
|
|
32
|
+
el.addEventListener(type, event => {
|
|
33
|
+
observed.push({ type, detail: event.detail, code: el.code, value: el.value });
|
|
34
|
+
});
|
|
35
|
+
return observed;
|
|
36
|
+
}
|
|
37
|
+
async function action(el) {
|
|
38
|
+
const button = el.shadowRoot.querySelector('.format-btn');
|
|
39
|
+
await button.componentOnReady();
|
|
40
|
+
return button;
|
|
41
|
+
}
|
|
42
|
+
describe('built syntax-box explicit safe formatting', () => {
|
|
43
|
+
it('formats only on explicit JSON action, preserving tokens/aliases/event order/copy/reset', async () => {
|
|
44
|
+
const { el, form } = await create({ value: JSON_SOURCE, copyable: true, name: 'source' });
|
|
45
|
+
const observed = events(el);
|
|
46
|
+
const textarea = el.shadowRoot.querySelector('textarea');
|
|
47
|
+
await exact(el, JSON_SOURCE);
|
|
48
|
+
textarea.focus();
|
|
49
|
+
textarea.blur();
|
|
50
|
+
await exact(el, JSON_SOURCE);
|
|
51
|
+
expect(observed).toEqual([]);
|
|
52
|
+
const button = await action(el);
|
|
53
|
+
expect(button.disabled).toBe(false);
|
|
54
|
+
button.click();
|
|
55
|
+
await exact(el, JSON_EXPECTED);
|
|
56
|
+
expect(jsonTokens(el.code)).toEqual(jsonTokens(JSON_SOURCE));
|
|
57
|
+
expect(observed).toEqual(['qInput', 'qChange'].map(type => ({ type, detail: JSON_EXPECTED, code: JSON_EXPECTED, value: JSON_EXPECTED })));
|
|
58
|
+
expect(new FormData(form).get('source')).toBe(JSON_EXPECTED);
|
|
59
|
+
const write = vi.spyOn(navigator.clipboard, 'writeText').mockResolvedValue(undefined);
|
|
60
|
+
el.shadowRoot.querySelectorAll('q-button')[1].click();
|
|
61
|
+
await vi.waitFor(() => expect(write).toHaveBeenCalledWith(JSON_EXPECTED));
|
|
62
|
+
form.reset();
|
|
63
|
+
await exact(el, JSON_SOURCE);
|
|
64
|
+
expect(observed.length).toBe(2);
|
|
65
|
+
el.code = '{"other":-0}';
|
|
66
|
+
await exact(el, '{"other":-0}');
|
|
67
|
+
expect(observed.length).toBe(2);
|
|
68
|
+
el.value = JSON_EXPECTED;
|
|
69
|
+
await exact(el, JSON_EXPECTED);
|
|
70
|
+
button.click();
|
|
71
|
+
await exact(el, JSON_EXPECTED);
|
|
72
|
+
expect(observed.map(event => event.type)).toEqual(['qInput', 'qChange', 'qInput', 'qChange']);
|
|
73
|
+
});
|
|
74
|
+
it.each(INVALID_JSON)('preserves %s with visible feedback and existing explicit JSON events', async (_case, source) => {
|
|
75
|
+
const { el } = await create({ code: source });
|
|
76
|
+
const observed = events(el);
|
|
77
|
+
(await action(el)).click();
|
|
78
|
+
await exact(el, source);
|
|
79
|
+
await vi.waitFor(() => expect(el.shadowRoot.querySelector('.format-feedback').textContent).toBe('Invalid JSON; source unchanged.'));
|
|
80
|
+
expect(observed.map(event => [event.type, event.detail])).toEqual([['qInput', source], ['qChange', source]]);
|
|
81
|
+
el.value = '{"valid":1}';
|
|
82
|
+
await exact(el, '{"valid":1}');
|
|
83
|
+
expect(el.shadowRoot.querySelector('.format-feedback')).toBeNull();
|
|
84
|
+
});
|
|
85
|
+
it.each(UNSUPPORTED_SOURCE)('makes %s Format visibly unavailable without altering comments/literals/events', async (language, source) => {
|
|
86
|
+
const { el } = await create({ language, code: source });
|
|
87
|
+
const observed = events(el);
|
|
88
|
+
const button = await action(el);
|
|
89
|
+
expect(button.disabled).toBe(true);
|
|
90
|
+
expect(button.shadowRoot.querySelector('button').disabled).toBe(true);
|
|
91
|
+
expect(el.shadowRoot.querySelector('.format-feedback').textContent).toBe('Formatting is available for JSON only.');
|
|
92
|
+
button.click();
|
|
93
|
+
await exact(el, source);
|
|
94
|
+
expect(observed).toEqual([]);
|
|
95
|
+
el.language = 'json';
|
|
96
|
+
el.value = '{"next":1}';
|
|
97
|
+
await exact(el, '{"next":1}');
|
|
98
|
+
await vi.waitFor(() => expect(button.disabled).toBe(false));
|
|
99
|
+
expect(el.shadowRoot.querySelector('.format-feedback')).toBeNull();
|
|
100
|
+
});
|
|
101
|
+
it('keeps over-depth JSON intact with bounded-format feedback', async () => {
|
|
102
|
+
const source = '['.repeat(MAX_JSON_FORMAT_DEPTH + 1) + '-0' + ']'.repeat(MAX_JSON_FORMAT_DEPTH + 1);
|
|
103
|
+
const { el } = await create({ code: source });
|
|
104
|
+
(await action(el)).click();
|
|
105
|
+
await exact(el, source);
|
|
106
|
+
await vi.waitFor(() => expect(el.shadowRoot.querySelector('.format-feedback').textContent).toBe('JSON formatting limit reached; source unchanged.'));
|
|
107
|
+
});
|
|
108
|
+
it('keeps empty/disabled actions quiet and the plain variant without a Format action', async () => {
|
|
109
|
+
const { el } = await create();
|
|
110
|
+
const observed = events(el);
|
|
111
|
+
(await action(el)).click();
|
|
112
|
+
await exact(el, '');
|
|
113
|
+
expect(observed).toEqual([]);
|
|
114
|
+
el.code = JSON_SOURCE;
|
|
115
|
+
el.disabled = true;
|
|
116
|
+
await exact(el, JSON_SOURCE);
|
|
117
|
+
(await action(el)).click();
|
|
118
|
+
await exact(el, JSON_SOURCE);
|
|
119
|
+
expect(observed).toEqual([]);
|
|
120
|
+
el.variant = 'plain';
|
|
121
|
+
await vi.waitFor(() => expect(el.shadowRoot.querySelector('.format-btn')).toBeNull());
|
|
122
|
+
});
|
|
123
|
+
it('captures the runnable explicit JSON guide example after real formatting', async () => {
|
|
124
|
+
await page.viewport(800, 700);
|
|
125
|
+
document.body.style.margin = '20px';
|
|
126
|
+
const { el } = await create({ code: '{"10":9007199254740993,"2":-0,"same":1,"same":2}', heading: 'Exact JSON tokens', height: '190px' });
|
|
127
|
+
el.style.width = '560px';
|
|
128
|
+
(await action(el)).click();
|
|
129
|
+
await exact(el, '{\n "10": 9007199254740993,\n "2": -0,\n "same": 1,\n "same": 2\n}');
|
|
130
|
+
await page.elementLocator(el).screenshot({ path: 'docs/components/assets/q-syntax-box-format-json.png' });
|
|
131
|
+
});
|
|
132
|
+
it('captures the runnable unsupported-format guide example', async () => {
|
|
133
|
+
await page.viewport(800, 700);
|
|
134
|
+
document.body.style.margin = '20px';
|
|
135
|
+
const { el } = await create({ code: 'const message = `keep spaces; { braces }`;', language: 'javascript', heading: 'Literal JavaScript', height: '110px' });
|
|
136
|
+
el.style.width = '560px';
|
|
137
|
+
expect((await action(el)).disabled).toBe(true);
|
|
138
|
+
await exact(el, 'const message = `keep spaces; { braces }`;');
|
|
139
|
+
await page.elementLocator(el).screenshot({ path: 'docs/components/assets/q-syntax-box-format-unsupported.png' });
|
|
140
|
+
});
|
|
141
|
+
it('refreshes the submitted-code example with current unavailable JavaScript formatting', async () => {
|
|
142
|
+
await page.viewport(800, 700);
|
|
143
|
+
document.body.style.margin = '20px';
|
|
144
|
+
const { el, form } = await create({ code: 'const ready = true;', language: 'javascript', height: '110px', name: 'template', required: true, ariaLabel: 'Template code' });
|
|
145
|
+
form.style.width = '560px';
|
|
146
|
+
const submit = document.createElement('button');
|
|
147
|
+
submit.type = 'submit';
|
|
148
|
+
submit.textContent = 'Read form data';
|
|
149
|
+
const output = document.createElement('output');
|
|
150
|
+
form.append(submit, output);
|
|
151
|
+
form.addEventListener('submit', event => { event.preventDefault(); output.textContent = String(new FormData(form).get('template')); });
|
|
152
|
+
submit.click();
|
|
153
|
+
expect(output.textContent).toBe('const ready = true;');
|
|
154
|
+
expect((await action(el)).disabled).toBe(true);
|
|
155
|
+
await page.elementLocator(form).screenshot({ path: 'docs/components/assets/q-syntax-box-submit-code.png' });
|
|
156
|
+
});
|
|
157
|
+
});
|
|
@@ -32,11 +32,11 @@ export class QStepDiagram {
|
|
|
32
32
|
// ===================== [6] RENDER (Visual Template Only) =====================
|
|
33
33
|
render() {
|
|
34
34
|
const orientation = this.orientation ?? this.layout;
|
|
35
|
-
return (h("div", { key: '
|
|
35
|
+
return (h("div", { key: '8a5da6e14ff6dc3d908dd8952b08108d003901e9', class: {
|
|
36
36
|
'step-diagram': true,
|
|
37
37
|
[`orientation-${orientation}`]: true,
|
|
38
38
|
[`layout-${orientation}`]: true,
|
|
39
|
-
}, role: "list", "aria-label": this.ariaLabel }, h("slot", { key: '
|
|
39
|
+
}, role: "list", "aria-label": this.ariaLabel }, h("slot", { key: '7bd0969adf19ece9c3a8f60cbe64b93fa627b363', onSlotchange: this.handleSlotChange })));
|
|
40
40
|
}
|
|
41
41
|
static get is() { return "q-step-diagram"; }
|
|
42
42
|
static get encapsulation() { return "shadow"; }
|
|
@@ -36,7 +36,7 @@ export class QStepDiagramItem {
|
|
|
36
36
|
// ===================== [6] RENDER (Visual Template Only) =====================
|
|
37
37
|
render() {
|
|
38
38
|
const orientation = this.orientation ?? this.layout;
|
|
39
|
-
return (h("div", { key: '
|
|
39
|
+
return (h("div", { key: '2283c7ad484a5449de7074e618aad691e2277627', class: { 'step-item': true, [`orientation-${orientation}`]: true } }, h("div", { key: '463c520fef67e7a214ba968174d4791488d90016', class: "step-line-container" }, h("div", { key: '1ac40b5c49bdcc3e5dc5bb6f5481592c5cf21b8f', class: "step-badge", "aria-hidden": "true", part: "badge" }, h("slot", { key: 'ffef5d1c9335f87a0c033b3fc4923d151e4ea377', name: "badge" }, h("div", { key: '7a2d9f322f650c42614d1ca1775eed20e0ff5fd2', class: "badge-dot" }))), h("div", { key: '7f8c4c2feb18c795e4ce4fa36c0266f0721859a8', class: "step-connector", part: "connector" })), h("div", { key: '79b906b1edda9ee114b59447bfb9ef8e23b635b8', class: "step-content", onClick: this.handleTrigger, onKeyDown: this.handleKeyDown, tabindex: "0", role: "button", part: "content", "aria-current": this.status === 'active' ? 'step' : undefined, "aria-disabled": this.status === 'pending' ? 'true' : undefined }, h("div", { key: 'e9c4009533ace6c3c3f1a850ee8d7e584746e33d', class: "step-title", part: "title" }, h("slot", { key: 'd101f24344900ff70dc31f6022ec9280382b32b7', name: "title" })), h("div", { key: '393c58f0d835afea839e1fac8a6bef4bdf82d696', class: "step-body", part: "body" }, h("slot", { key: '2454d6b561fbb94961d025b3ce37fc3067e20ecc' })))));
|
|
40
40
|
}
|
|
41
41
|
static get is() { return "q-step-diagram-item"; }
|
|
42
42
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { isFieldDisabled, syncFieldHost } from "../../../utils/form-field-state";
|
|
2
|
+
import { registerFormField } from "../../../utils/form-field-adapter";
|
|
1
3
|
import { fieldFeedback, feedbackStyle } from "../../shared/field";
|
|
2
4
|
import { h } from "@stencil/core";
|
|
3
5
|
import { identifyItems } from "../../../utils/collection-identity";
|
|
@@ -63,6 +65,10 @@ export class QDropdown {
|
|
|
63
65
|
/** Emitted before the trigger toggles the menu. */
|
|
64
66
|
qClick;
|
|
65
67
|
// ========================= [2] INTERNAL STATE & REFS =========================
|
|
68
|
+
disabledState = false;
|
|
69
|
+
get isDisabled() {
|
|
70
|
+
return isFieldDisabled(this.el, this.disabled);
|
|
71
|
+
}
|
|
66
72
|
triggerEl;
|
|
67
73
|
searchInputEl;
|
|
68
74
|
menuEl;
|
|
@@ -77,6 +83,23 @@ export class QDropdown {
|
|
|
77
83
|
this.clearScrollLoading();
|
|
78
84
|
this.stopFloatingUpdates();
|
|
79
85
|
}
|
|
86
|
+
formDisabledCallback() {
|
|
87
|
+
this.syncValidity();
|
|
88
|
+
}
|
|
89
|
+
componentDidLoad() {
|
|
90
|
+
registerFormField(this.el, {
|
|
91
|
+
kind: 'selection',
|
|
92
|
+
owner: () => this.internals?.form ?? null,
|
|
93
|
+
active: () => true,
|
|
94
|
+
value: () => this.getFormSelection(),
|
|
95
|
+
assign: value => { this.value = value; },
|
|
96
|
+
reconcile: () => {
|
|
97
|
+
this.syncValidity();
|
|
98
|
+
},
|
|
99
|
+
reset: () => this.formResetCallback(),
|
|
100
|
+
validate: report => report ? this.internals?.reportValidity?.() ?? true : this.internals?.checkValidity?.() ?? true,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
80
103
|
componentDidRender() {
|
|
81
104
|
this.syncValidity();
|
|
82
105
|
if (this.isOpen) {
|
|
@@ -92,14 +115,27 @@ export class QDropdown {
|
|
|
92
115
|
this.syncValidity();
|
|
93
116
|
}
|
|
94
117
|
syncValidity() {
|
|
118
|
+
const disabled = syncFieldHost(this.el, this.disabled, this.name, this.required);
|
|
119
|
+
if (this.disabledState !== disabled)
|
|
120
|
+
this.disabledState = disabled;
|
|
121
|
+
if (this.triggerEl)
|
|
122
|
+
this.triggerEl.disabled = disabled;
|
|
123
|
+
if (this.searchInputEl)
|
|
124
|
+
this.searchInputEl.disabled = disabled;
|
|
125
|
+
if (disabled && this.isOpen) {
|
|
126
|
+
this.isOpen = false;
|
|
127
|
+
this.stopFloatingUpdates();
|
|
128
|
+
}
|
|
129
|
+
const selected = this.getFormSelection();
|
|
130
|
+
this.internals?.setFormValue?.(disabled ? null : selected);
|
|
95
131
|
if (typeof this.internals?.setValidity !== 'function')
|
|
96
132
|
return;
|
|
97
|
-
const message = this.
|
|
133
|
+
const message = this.isDisabled ? '' : this.error?.trim() || (this.required && (!this.value || selected === null) ? 'Please select an option.' : '');
|
|
98
134
|
this.internals.setValidity(message ? this.error?.trim() ? { customError: true } : { valueMissing: true } : {}, message, this.triggerEl);
|
|
99
135
|
}
|
|
100
136
|
async checkValidity() {
|
|
101
137
|
this.syncValidity();
|
|
102
|
-
return this.
|
|
138
|
+
return this.isDisabled || !(this.error?.trim() || (this.required && (!this.value || this.getFormSelection() === null)));
|
|
103
139
|
}
|
|
104
140
|
async reportValidity() {
|
|
105
141
|
const valid = await this.checkValidity();
|
|
@@ -113,6 +149,7 @@ export class QDropdown {
|
|
|
113
149
|
this.triggerEl?.focus();
|
|
114
150
|
}
|
|
115
151
|
watchOptions() {
|
|
152
|
+
this.syncValidity();
|
|
116
153
|
if (this.externalSearch) {
|
|
117
154
|
this.isScrollingLoading = false;
|
|
118
155
|
}
|
|
@@ -140,6 +177,12 @@ export class QDropdown {
|
|
|
140
177
|
this.syncValidity();
|
|
141
178
|
}
|
|
142
179
|
// =================== [5] EVENT HANDLERS & INTERNAL METHODS ===================
|
|
180
|
+
getFormSelection() {
|
|
181
|
+
const selected = getSelectedOption(getDropdownOptions(this.options), this.value);
|
|
182
|
+
if (selected && selected.disabled !== true)
|
|
183
|
+
return selected.value;
|
|
184
|
+
return this.externalSearch && !selected && this.value ? this.value : null;
|
|
185
|
+
}
|
|
143
186
|
clearScrollLoading() {
|
|
144
187
|
this.isScrollingLoading = false;
|
|
145
188
|
if (this.scrollTimeout !== null) {
|
|
@@ -169,7 +212,7 @@ export class QDropdown {
|
|
|
169
212
|
return getVisibleOptions(this.getFilteredOptions(), this.visibleCount);
|
|
170
213
|
}
|
|
171
214
|
toggleMenu = () => {
|
|
172
|
-
if (this.
|
|
215
|
+
if (this.isDisabled)
|
|
173
216
|
return;
|
|
174
217
|
this.isOpen = !this.isOpen;
|
|
175
218
|
this.clearScrollLoading();
|
|
@@ -194,6 +237,8 @@ export class QDropdown {
|
|
|
194
237
|
}
|
|
195
238
|
};
|
|
196
239
|
handleSelect = (option) => {
|
|
240
|
+
if (this.isDisabled)
|
|
241
|
+
return;
|
|
197
242
|
this.value = option.value;
|
|
198
243
|
this.isOpen = false;
|
|
199
244
|
this.focusedIndex = -1;
|
|
@@ -210,12 +255,14 @@ export class QDropdown {
|
|
|
210
255
|
this.qBlur.emit(ev);
|
|
211
256
|
};
|
|
212
257
|
handleTriggerClick = (ev) => {
|
|
213
|
-
if (this.
|
|
258
|
+
if (this.isDisabled)
|
|
214
259
|
return;
|
|
215
260
|
this.qClick.emit(ev);
|
|
216
261
|
this.toggleMenu();
|
|
217
262
|
};
|
|
218
263
|
handleSearchInput = (ev) => {
|
|
264
|
+
if (this.isDisabled)
|
|
265
|
+
return;
|
|
219
266
|
const target = ev.target;
|
|
220
267
|
this.searchTerm = target.value || '';
|
|
221
268
|
this.focusedIndex = -1;
|
|
@@ -357,7 +404,7 @@ export class QDropdown {
|
|
|
357
404
|
menu.style.visibility = 'visible';
|
|
358
405
|
}
|
|
359
406
|
handleKeyDown = (ev) => {
|
|
360
|
-
if (this.
|
|
407
|
+
if (this.isDisabled)
|
|
361
408
|
return;
|
|
362
409
|
const target = ev.target;
|
|
363
410
|
const isInput = target && target.tagName && target.tagName.toLowerCase() === 'input';
|
|
@@ -491,16 +538,16 @@ export class QDropdown {
|
|
|
491
538
|
const displayLabel = selectedOption && selectedLabel ? selectedLabel : this.placeholder;
|
|
492
539
|
const hasSelection = selectedOption !== undefined;
|
|
493
540
|
const ariaLabel = this.ariaLabel?.trim() || undefined;
|
|
494
|
-
return (h("div", { key: '
|
|
541
|
+
return (h("div", { key: '1294d517bf3a3094421034b04c22ee248cfd0730', style: feedbackStyle(this.reserveFeedback), class: {
|
|
495
542
|
'dropdown-wrapper': true,
|
|
496
543
|
'is-open': this.isOpen,
|
|
497
|
-
'is-disabled': this.
|
|
544
|
+
'is-disabled': this.isDisabled,
|
|
498
545
|
[`size-${this.size}`]: true
|
|
499
|
-
}, onKeyDown: this.handleKeyDown }, this.label && (h("label", { key: '
|
|
546
|
+
}, onKeyDown: this.handleKeyDown }, this.label && (h("label", { key: '6e9b7ea8d8272669c307d3f00975cd2fb3a91db1', class: { 'dropdown-label': true, 'q-label-hidden': this.labelHidden }, htmlFor: "q-field", part: "label" }, this.label)), h("button", { key: 'ece6703623acdfc325f01a068e5dd0e85a85263e', ref: (el) => (this.triggerEl = el), id: "q-field", class: "dropdown-trigger", part: "trigger", type: "button", disabled: this.isDisabled, onClick: this.handleTriggerClick, onFocus: this.handleFocus, onBlur: this.handleBlur, "aria-haspopup": "listbox", "aria-required": this.required ? 'true' : 'false', "aria-invalid": this.error || (this.required && !this.value) ? 'true' : 'false', "aria-describedby": this.error || this.description ? 'q-field-error' : undefined, "aria-label": ariaLabel, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-controls": this.isOpen ? 'q-field-menu' : undefined, "aria-activedescendant": this.isOpen && this.focusedIndex >= 0 ? `q-field-item-${this.focusedIndex}` : undefined }, h("span", { key: 'a3c6a847dc3f04cdcc57c5222b70b0fe18d4d91b', class: "trigger-content" }, h("slot", { key: 'dce0925e5e0c11579e8e8e6a0c8b12555949ce06', name: "icon-left" }), h("span", { key: '60af77209db71dcc5fa49552ea098754e1c56699', class: { 'trigger-text': true, 'is-placeholder': !hasSelection } }, displayLabel)), h("svg", { key: '083f67294926fe7e9cac6f061015b0f99187a14c', class: "chevron-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("polyline", { key: 'fc000f99b853cec98b05baf545d7d9deb58f903c', points: "6 9 12 15 18 9" }))), fieldFeedback('q-field-error', this.error, this.description), this.isOpen && (h("div", { key: '3fcf4fa46a7192bd5102218b86622ff68cfcf21e', ref: (el) => (this.menuEl = el), id: "q-field-menu", class: "dropdown-menu", part: "menu", role: "listbox", popover: "manual", "aria-label": ariaLabel || this.label || 'Options' }, this.searchable && (h("div", { key: '6da89836381e1fd4fdaa51567ef76efd115d82ab', class: "dropdown-search-container" }, h("input", { key: '65b9ddc1dd4a3d431e7550cba6c1cdebdbb2481a', ref: (el) => (this.searchInputEl = el), type: "text", class: "dropdown-search-input", placeholder: "Search...", value: this.searchTerm, onInput: this.handleSearchInput, role: "combobox", "aria-autocomplete": "list", "aria-controls": "q-field-menu", "aria-expanded": this.isOpen ? 'true' : 'false', "aria-activedescendant": this.focusedIndex >= 0 ? `q-field-item-${this.focusedIndex}` : undefined }))), h("ul", { key: '6a0f2ed2711cbfd82ed61fd20ff9e19fc8563c3f', ref: (el) => (this.itemsListEl = el), class: "dropdown-items-list", onScroll: this.handleScroll }, opts.length === 0 && !this.loading ? (h("li", { class: "menu-item is-empty" }, "No matches found")) : (identifiedOptions.map(({ item: option, index, key }) => (h("li", { key: key, id: `q-field-item-${index}`, class: {
|
|
500
547
|
'menu-item': true,
|
|
501
548
|
'is-selected': option.value === this.value,
|
|
502
549
|
'is-focused': index === this.focusedIndex
|
|
503
|
-
}, tabindex: -1, part: `item ${option.value === this.value ? 'selected-item' : ''} ${index === this.focusedIndex ? 'focused-item' : ''}`, role: "option", "aria-selected": option.value === this.value ? 'true' : 'false', onClick: () => this.handleSelect(option) }, this.getOptionLabel(option))))), (this.loading || this.isScrollingLoading) && (h("li", { key: '
|
|
550
|
+
}, tabindex: -1, part: `item ${option.value === this.value ? 'selected-item' : ''} ${index === this.focusedIndex ? 'focused-item' : ''}`, role: "option", "aria-selected": option.value === this.value ? 'true' : 'false', onClick: () => this.handleSelect(option) }, this.getOptionLabel(option))))), (this.loading || this.isScrollingLoading) && (h("li", { key: 'd79cc4772b8d99a809627de29ccd6da3fbbf2f01', class: "menu-item is-loading-more" }, h("span", { key: '2eea8fb3a471c7aeea5a7cb9e1d7c0be62b4ff5b', class: "spinner-circle" }), h("span", { key: '364f7e446f1f7b6ddad5087480f2ce4e88843ed6' }, "Loading..."))))))));
|
|
504
551
|
}
|
|
505
552
|
static get is() { return "q-dropdown"; }
|
|
506
553
|
static get encapsulation() { return "shadow"; }
|
|
@@ -922,7 +969,8 @@ export class QDropdown {
|
|
|
922
969
|
"focusedIndex": {},
|
|
923
970
|
"searchTerm": {},
|
|
924
971
|
"visibleCount": {},
|
|
925
|
-
"isScrollingLoading": {}
|
|
972
|
+
"isScrollingLoading": {},
|
|
973
|
+
"disabledState": {}
|
|
926
974
|
};
|
|
927
975
|
}
|
|
928
976
|
static get events() {
|
|
@@ -1115,6 +1163,12 @@ export class QDropdown {
|
|
|
1115
1163
|
return [{
|
|
1116
1164
|
"propName": "value",
|
|
1117
1165
|
"methodName": "watchValue"
|
|
1166
|
+
}, {
|
|
1167
|
+
"propName": "name",
|
|
1168
|
+
"methodName": "syncValidity"
|
|
1169
|
+
}, {
|
|
1170
|
+
"propName": "externalSearch",
|
|
1171
|
+
"methodName": "syncValidity"
|
|
1118
1172
|
}, {
|
|
1119
1173
|
"propName": "required",
|
|
1120
1174
|
"methodName": "syncValidity"
|