@webquark/browser 1.1.0-dev.9 → 1.1.1-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{action.props-N0urQtdP.js → action.props-CNe2JXR5.js} +1 -1
- package/dist/cjs/{dom-Dk77oFF6.js → dom-BYrqRYna.js} +1 -1
- package/dist/cjs/{field-CsrQGhG-.js → field-BRAR56Ex.js} +1 -1
- package/dist/cjs/{form-control-validity-D1ukC0_e.js → form-control-validity-BkilGb3E.js} +3 -3
- package/dist/cjs/{index-DWXhKHCB.js → index-BN-WdOQM.js} +17 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/q-accordion.cjs.entry.js +2 -2
- package/dist/cjs/q-alert.cjs.entry.js +2 -2
- 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_3.cjs.entry.js +907 -0
- package/dist/cjs/q-card.cjs.entry.js +3 -3
- package/dist/cjs/q-carousel.cjs.entry.js +120 -18
- package/dist/cjs/q-chip.cjs.entry.js +2 -2
- package/dist/cjs/q-control-group.cjs.entry.js +64 -0
- package/dist/cjs/q-conversation-bubble.cjs.entry.js +1 -1
- package/dist/cjs/q-data-table.cjs.entry.js +4 -4
- package/dist/cjs/q-dialog.cjs.entry.js +4 -4
- package/dist/cjs/q-divider.cjs.entry.js +26 -0
- package/dist/cjs/q-dropdown.cjs.entry.js +320 -104
- package/dist/cjs/q-form.cjs.entry.js +17 -7
- package/dist/cjs/q-grid.cjs.entry.js +3 -3
- package/dist/cjs/q-icon.cjs.entry.js +1 -1
- package/dist/cjs/q-image-comparison.cjs.entry.js +2 -2
- package/dist/cjs/q-inline.cjs.entry.js +3 -3
- package/dist/cjs/q-input_2.cjs.entry.js +10 -8
- package/dist/cjs/q-link.cjs.entry.js +2 -2
- package/dist/cjs/q-map.cjs.entry.js +2 -2
- package/dist/cjs/q-media.cjs.entry.js +2 -2
- 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 +7 -7
- package/dist/cjs/q-quantity-selector.cjs.entry.js +6 -6
- package/dist/cjs/q-radio-group.cjs.entry.js +4 -4
- package/dist/cjs/q-reel.cjs.entry.js +24 -24
- package/dist/cjs/q-section.cjs.entry.js +2 -2
- package/dist/cjs/q-sidepanel.cjs.entry.js +5 -4
- package/dist/cjs/q-slider.cjs.entry.js +122 -0
- 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 +4 -4
- package/dist/cjs/q-syntax-box.cjs.entry.js +180 -719
- package/dist/cjs/q-syntax-view.cjs.entry.js +65 -0
- package/dist/cjs/q-tabs.cjs.entry.js +2 -2
- package/dist/cjs/q-textarea.cjs.entry.js +8 -6
- 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 +7 -7
- package/dist/cjs/q-toolbar.cjs.entry.js +4 -4
- package/dist/cjs/syntax-content-BmSExDiW.js +910 -0
- package/dist/cjs/{tokens-RMRaIOqv.js → tokens-BMrfol_M.js} +4 -1
- package/dist/cjs/webquark.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +6 -1
- package/dist/collection/components/actions/button/button.css +49 -9
- package/dist/collection/components/actions/button/{button.utils.unit.test.js → test/button.utils.unit.test.js} +1 -1
- package/dist/collection/components/communication/alert/alert.css +4 -1
- package/dist/collection/components/content/carousel/carousel.css +7 -0
- package/dist/collection/components/content/carousel/carousel.js +256 -10
- package/dist/collection/components/content/carousel/internals/autoplay.js +31 -6
- package/dist/collection/components/content/carousel/test/transitions.cmp.test.js +122 -0
- package/dist/collection/components/data-display/accordion/accordion.js +1 -1
- package/dist/collection/components/data-display/data-table/data-table.js +3 -3
- package/dist/collection/components/data-display/map/map.js +1 -1
- package/dist/collection/components/data-display/map/test/map.cmp.test.js +1 -1
- package/dist/collection/components/data-display/pagination/pagination.js +1 -1
- package/dist/collection/components/data-display/syntax-box/internals/formatters/css.js +4 -0
- package/dist/collection/components/data-display/syntax-box/internals/formatters/formatter.js +20 -0
- package/dist/collection/{utils → components/data-display/syntax-box/internals/formatters}/formatter.unit.test.js +38 -11
- package/dist/collection/components/data-display/syntax-box/internals/formatters/html.js +4 -0
- package/dist/collection/components/data-display/syntax-box/internals/formatters/javascript.js +4 -0
- package/dist/collection/{utils/formatter.js → components/data-display/syntax-box/internals/formatters/json.js} +2 -20
- package/dist/collection/components/data-display/syntax-box/internals/formatters/languages.js +15 -0
- package/dist/collection/components/data-display/syntax-box/internals/formatters/util/prettier.js +17 -0
- package/dist/collection/{utils → components/data-display/syntax-box/internals}/syntax.unit.test.js +1 -1
- package/dist/collection/components/data-display/syntax-box/internals/views.js +29 -0
- package/dist/collection/components/data-display/syntax-box/internals/views.unit.test.js +19 -0
- package/dist/collection/components/data-display/syntax-box/syntax-box.css +107 -36
- package/dist/collection/components/data-display/syntax-box/syntax-box.js +179 -637
- package/dist/collection/components/data-display/syntax-box/syntax-content.js +748 -0
- package/dist/collection/components/data-display/syntax-box/syntax-ui.js +8 -0
- package/dist/collection/components/data-display/syntax-box/test/format-fixtures.js +2 -2
- package/dist/collection/components/data-display/syntax-box/test/syntax-box.cmp.test.js +1 -1
- package/dist/collection/components/data-display/syntax-box/test/syntax-format.cmp.test.js +20 -20
- package/dist/collection/components/data-display/syntax-box/test/syntax-views.cmp.test.js +228 -0
- package/dist/collection/components/data-display/syntax-view/syntax-view.js +64 -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.css +148 -0
- package/dist/collection/components/inputs/dropdown/dropdown.js +422 -104
- package/dist/collection/components/inputs/dropdown/test/dropdown.cmp.test.js +28 -0
- package/dist/collection/components/inputs/dropdown/test/fit-options.cmp.test.js +120 -0
- package/dist/collection/components/inputs/dropdown/test/multiple.cmp.test.js +124 -0
- package/dist/collection/components/inputs/dropdown/test/search-mode.cmp.test.js +186 -0
- package/dist/collection/components/inputs/form/form.js +2 -2
- package/dist/collection/components/inputs/form/internals/controls.js +2 -2
- package/dist/collection/components/inputs/form/internals/field-state.js +6 -1
- package/dist/collection/components/inputs/form/internals/values.js +5 -0
- package/dist/collection/components/inputs/form/test/form-submit.cmp.test.js +14 -8
- package/dist/collection/components/inputs/input/input.css +42 -0
- package/dist/collection/components/inputs/input/input.js +31 -3
- package/dist/collection/components/inputs/quantity-selector/quantity-selector.css +22 -0
- package/dist/collection/components/inputs/quantity-selector/quantity-selector.js +4 -4
- package/dist/collection/components/inputs/radio-group/radio-group.js +2 -2
- package/dist/collection/components/inputs/slider/slider.css +44 -0
- package/dist/collection/components/inputs/slider/slider.js +383 -0
- package/dist/collection/components/inputs/slider/test/slider.cmp.test.js +45 -0
- package/dist/collection/components/inputs/textarea/textarea.css +20 -0
- package/dist/collection/components/inputs/textarea/textarea.js +30 -2
- package/dist/collection/components/inputs/toggle/test/toggle-layout.cmp.test.js +69 -0
- package/dist/collection/components/inputs/toggle/toggle.css +27 -0
- package/dist/collection/components/inputs/toggle/toggle.js +3 -3
- package/dist/collection/components/layout/control-group/control-group.css +108 -0
- package/dist/collection/components/layout/control-group/control-group.js +142 -0
- package/dist/collection/components/layout/control-group/test/control-group.cmp.test.js +163 -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.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/nav-items.js +2 -2
- package/dist/collection/components/layout/sidepanel/sidepanel.js +3 -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/image-comparison/image-comparison.js +1 -1
- package/dist/collection/components/media/media/media.js +1 -1
- package/dist/collection/components/media/reel/reel.js +23 -23
- package/dist/collection/components/media/reel/test/focus.cmp.test.js +33 -0
- 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/tooltip.js +2 -2
- package/dist/collection/theme/test/input-width.cmp.test.js +117 -0
- package/dist/collection/theme/test/presets.unit.test.js +58 -0
- package/dist/collection/theme/tokens.js +4 -1
- package/dist/collection/utils/dom.js +1 -1
- package/dist/collection/utils/form-control-validity.js +3 -3
- package/dist/components/index.js +1 -1
- package/dist/components/p-B610wOGe.js +1 -0
- package/dist/components/p-BGlbV43y.js +13 -0
- package/dist/components/{p-Dfp_If-_.js → p-BKWL9zOn.js} +1 -1
- package/dist/components/p-BxxU73QQ.js +1 -0
- package/dist/components/{p-Cg0Mv7Vb.js → p-CVEQfA-v.js} +1 -1
- package/dist/components/p-CpbWWDiY.js +1 -0
- package/dist/{webquark/p-Dhsn99q4.js → components/p-D2fczi8m.js} +1 -1
- package/dist/components/{p-6PPZ2sIO.js → p-D5vpGqZ9.js} +1 -1
- package/dist/components/p-DQIYo8zC.js +1 -0
- package/dist/components/p-DX6PCIPS.js +1 -0
- package/dist/components/p-DY9D4z7Z.js +1 -0
- package/dist/components/p-DbzjRzhu.js +1 -0
- package/dist/components/{p-DQhiqYeq.js → p-DkanItP3.js} +1 -1
- package/dist/components/{p-CKuPOxKN.js → p-RX4DjgmV.js} +1 -1
- package/dist/components/{p-DlIn_ZWk.js → p-Ts5oOvg8.js} +1 -1
- package/dist/components/p-u1Qz6OcP.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-control-group.d.ts +11 -0
- package/dist/components/q-control-group.js +1 -0
- 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-divider.d.ts +11 -0
- package/dist/components/q-divider.js +1 -0
- 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.js +1 -1
- 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 +2 -2
- package/dist/components/q-slider.d.ts +11 -0
- package/dist/components/q-slider.js +1 -0
- 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 +1 -13
- package/dist/components/q-syntax-view.d.ts +11 -0
- package/dist/components/q-syntax-view.js +1 -0
- 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-CpnGza8z.js → action.props-CbSH7c-q.js} +1 -1
- package/dist/esm/{dom-ByfrUWx1.js → dom-B610wOGe.js} +2 -2
- package/dist/esm/{field-zfD6OQ02.js → field-D5xUxo11.js} +1 -1
- package/dist/esm/{form-control-validity-Bj2RJb2E.js → form-control-validity-BxxU73QQ.js} +3 -3
- package/dist/esm/{form-submit-action-CoEIvDqE.js → form-submit-action-BjjfVWyu.js} +1 -1
- package/dist/esm/{index-B5ElFlHv.js → index-CIMzZPQO.js} +16 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/q-accordion.entry.js +2 -2
- package/dist/esm/q-alert.entry.js +2 -2
- package/dist/esm/q-avatar.entry.js +2 -2
- package/dist/esm/q-banner.entry.js +1 -1
- package/dist/esm/q-button_3.entry.js +903 -0
- package/dist/esm/q-card.entry.js +3 -3
- package/dist/esm/q-carousel.entry.js +120 -18
- package/dist/esm/q-chip.entry.js +2 -2
- package/dist/esm/q-control-group.entry.js +62 -0
- package/dist/esm/q-conversation-bubble.entry.js +1 -1
- package/dist/esm/q-data-table.entry.js +4 -4
- package/dist/esm/q-dialog.entry.js +4 -4
- package/dist/esm/q-divider.entry.js +24 -0
- package/dist/esm/q-dropdown.entry.js +320 -104
- package/dist/esm/q-form.entry.js +18 -8
- package/dist/esm/q-grid.entry.js +3 -3
- package/dist/esm/q-icon.entry.js +1 -1
- package/dist/esm/q-image-comparison.entry.js +2 -2
- package/dist/esm/q-inline.entry.js +3 -3
- package/dist/esm/q-input_2.entry.js +10 -8
- package/dist/esm/q-link.entry.js +2 -2
- package/dist/esm/q-map.entry.js +2 -2
- package/dist/esm/q-media.entry.js +2 -2
- 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 +7 -7
- package/dist/esm/q-quantity-selector.entry.js +6 -6
- package/dist/esm/q-radio-group.entry.js +4 -4
- package/dist/esm/q-reel.entry.js +24 -24
- package/dist/esm/q-section.entry.js +2 -2
- package/dist/esm/q-sidepanel.entry.js +5 -4
- package/dist/esm/q-slider.entry.js +120 -0
- 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 +4 -4
- package/dist/esm/q-syntax-box.entry.js +180 -719
- package/dist/esm/q-syntax-view.entry.js +63 -0
- package/dist/esm/q-tabs.entry.js +2 -2
- package/dist/esm/q-textarea.entry.js +8 -6
- 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 +7 -7
- package/dist/esm/q-toolbar.entry.js +4 -4
- package/dist/esm/syntax-content-Cr9kSbmA.js +903 -0
- package/dist/esm/{tokens-B4Mg1xEw.js → tokens-DbzjRzhu.js} +4 -1
- package/dist/esm/webquark.js +3 -3
- package/dist/formatters/prettier/LICENSE +7 -0
- package/dist/formatters/prettier/THIRD-PARTY-NOTICES.md +7941 -0
- package/dist/formatters/prettier/html-fragment.mjs +1 -0
- package/dist/formatters/prettier/html-fragment.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/angular.mjs +1 -0
- package/dist/formatters/prettier/languages/angular.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/css.mjs +1 -0
- package/dist/formatters/prettier/languages/css.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/flow.mjs +1 -0
- package/dist/formatters/prettier/languages/flow.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/graphql.mjs +1 -0
- package/dist/formatters/prettier/languages/graphql.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/handlebars.mjs +1 -0
- package/dist/formatters/prettier/languages/handlebars.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/html.mjs +1 -0
- package/dist/formatters/prettier/languages/html.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/javascript.mjs +1 -0
- package/dist/formatters/prettier/languages/javascript.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/json-stringify.mjs +1 -0
- package/dist/formatters/prettier/languages/json-stringify.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/json.mjs +1 -0
- package/dist/formatters/prettier/languages/json.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/json5.mjs +1 -0
- package/dist/formatters/prettier/languages/json5.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/jsonc.mjs +1 -0
- package/dist/formatters/prettier/languages/jsonc.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/jsx.mjs +1 -0
- package/dist/formatters/prettier/languages/jsx.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/less.mjs +1 -0
- package/dist/formatters/prettier/languages/less.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/lwc.mjs +1 -0
- package/dist/formatters/prettier/languages/lwc.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/markdown.mjs +1 -0
- package/dist/formatters/prettier/languages/markdown.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/mdx.mjs +1 -0
- package/dist/formatters/prettier/languages/mdx.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/mjml.mjs +1 -0
- package/dist/formatters/prettier/languages/mjml.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/postcss.mjs +1 -0
- package/dist/formatters/prettier/languages/postcss.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/scss.mjs +1 -0
- package/dist/formatters/prettier/languages/scss.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/tsx.mjs +1 -0
- package/dist/formatters/prettier/languages/tsx.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/typescript.mjs +1 -0
- package/dist/formatters/prettier/languages/typescript.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/vue.mjs +1 -0
- package/dist/formatters/prettier/languages/vue.mjs.gz +0 -0
- package/dist/formatters/prettier/languages/yaml.mjs +1 -0
- package/dist/formatters/prettier/languages/yaml.mjs.gz +0 -0
- package/dist/formatters/prettier/manifest.json +87 -0
- package/dist/formatters/prettier/plugins/acorn.mjs +17 -0
- package/dist/formatters/prettier/plugins/acorn.mjs.gz +0 -0
- package/dist/formatters/prettier/plugins/angular.mjs +7 -0
- package/dist/formatters/prettier/plugins/angular.mjs.gz +0 -0
- package/dist/formatters/prettier/plugins/babel.mjs +16 -0
- package/dist/formatters/prettier/plugins/babel.mjs.gz +0 -0
- package/dist/formatters/prettier/plugins/estree.mjs +44 -0
- package/dist/formatters/prettier/plugins/estree.mjs.gz +0 -0
- package/dist/formatters/prettier/plugins/flow.mjs +7 -0
- package/dist/formatters/prettier/plugins/flow.mjs.gz +0 -0
- package/dist/formatters/prettier/plugins/glimmer.mjs +37 -0
- package/dist/formatters/prettier/plugins/glimmer.mjs.gz +0 -0
- package/dist/formatters/prettier/plugins/graphql.mjs +17 -0
- package/dist/formatters/prettier/plugins/graphql.mjs.gz +0 -0
- package/dist/formatters/prettier/plugins/html.mjs +25 -0
- package/dist/formatters/prettier/plugins/html.mjs.gz +0 -0
- package/dist/formatters/prettier/plugins/markdown.mjs +70 -0
- package/dist/formatters/prettier/plugins/markdown.mjs.gz +0 -0
- package/dist/formatters/prettier/plugins/meriyah.mjs +9 -0
- package/dist/formatters/prettier/plugins/meriyah.mjs.gz +0 -0
- package/dist/formatters/prettier/plugins/postcss.mjs +62 -0
- package/dist/formatters/prettier/plugins/postcss.mjs.gz +0 -0
- package/dist/formatters/prettier/plugins/typescript.mjs +22 -0
- package/dist/formatters/prettier/plugins/typescript.mjs.gz +0 -0
- package/dist/formatters/prettier/plugins/yaml.mjs +150 -0
- package/dist/formatters/prettier/plugins/yaml.mjs.gz +0 -0
- package/dist/formatters/prettier/runtime.d.mts +2 -0
- package/dist/formatters/prettier/runtime.mjs +1 -0
- package/dist/formatters/prettier/runtime.mjs.gz +0 -0
- package/dist/formatters/prettier/standalone.mjs +29 -0
- package/dist/formatters/prettier/standalone.mjs.gz +0 -0
- package/dist/playground/components/theme-designer/dimension-tokens.js +9 -0
- package/dist/playground/components/theme-designer/token-row.js +60 -0
- package/dist/playground/dom-factory.js +76 -0
- package/dist/playground/utils/color.js +15 -0
- package/dist/playground/utils/dom.js +38 -0
- package/dist/playground/utils/index.js +2 -0
- package/dist/types/components/content/carousel/carousel.d.ts +23 -2
- package/dist/types/components/content/carousel/carousel.types.d.ts +6 -0
- package/dist/types/components/content/carousel/internals/autoplay.d.ts +5 -0
- package/dist/types/components/data-display/syntax-box/internals/formatters/css.d.ts +1 -0
- package/dist/types/components/data-display/syntax-box/internals/formatters/formatter.d.ts +10 -0
- package/dist/types/components/data-display/syntax-box/internals/formatters/formatter.types.d.ts +4 -0
- package/dist/types/components/data-display/syntax-box/internals/formatters/html.d.ts +1 -0
- package/dist/types/components/data-display/syntax-box/internals/formatters/javascript.d.ts +1 -0
- package/dist/types/components/data-display/syntax-box/internals/formatters/json.d.ts +6 -0
- package/dist/types/components/data-display/syntax-box/internals/formatters/languages.d.ts +27 -0
- package/dist/types/components/data-display/syntax-box/internals/formatters/util/prettier.d.ts +3 -0
- package/dist/types/{utils → components/data-display/syntax-box/internals}/syntax.d.ts +1 -1
- 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/views.d.ts +11 -0
- package/dist/types/components/data-display/syntax-box/internals/views.unit.test.d.ts +1 -0
- package/dist/types/components/data-display/syntax-box/syntax-box.d.ts +66 -63
- package/dist/types/components/data-display/syntax-box/syntax-box.types.d.ts +1 -1
- package/dist/types/components/data-display/syntax-box/syntax-content.d.ts +41 -0
- package/dist/types/components/data-display/syntax-box/syntax-ui.d.ts +15 -0
- package/dist/types/components/data-display/syntax-box/test/format-fixtures.d.ts +1 -1
- package/dist/types/components/data-display/syntax-box/test/syntax-views.cmp.test.d.ts +1 -0
- package/dist/types/components/data-display/syntax-view/syntax-view.d.ts +48 -0
- package/dist/types/components/inputs/dropdown/dropdown.d.ts +45 -1
- package/dist/types/components/inputs/dropdown/test/fit-options.cmp.test.d.ts +3 -0
- package/dist/types/components/inputs/dropdown/test/multiple.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/internals/field-state.d.ts +1 -1
- package/dist/types/components/inputs/input/input.d.ts +3 -0
- package/dist/types/components/inputs/slider/slider.d.ts +45 -0
- package/dist/types/components/inputs/slider/test/slider.cmp.test.d.ts +1 -0
- package/dist/types/components/inputs/textarea/textarea.d.ts +3 -1
- package/dist/types/components/inputs/toggle/test/toggle-layout.cmp.test.d.ts +1 -0
- package/dist/types/components/layout/control-group/control-group.d.ts +20 -0
- package/dist/types/components/layout/control-group/test/control-group.cmp.test.d.ts +7 -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/sidepanel/sidepanel.d.ts +2 -0
- package/dist/types/components/layout/sidepanel/sidepanel.types.d.ts +1 -0
- package/dist/types/components/media/reel/reel.d.ts +3 -3
- package/dist/types/components/media/reel/test/focus.cmp.test.d.ts +1 -0
- package/dist/types/components.d.ts +591 -13
- 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 +13 -0
- package/dist/types/home/runner/work/WebQuark/WebQuark/.stencil/src/playground/utils/color.d.ts +2 -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 +2 -2
- package/dist/types/theme/test/input-width.cmp.test.d.ts +3 -0
- package/dist/types/theme/test/presets.unit.test.d.ts +1 -0
- package/dist/types/theme/tokens.d.ts +9 -0
- package/dist/types/utils/form-control-validity.d.ts +2 -1
- package/dist/types/utils/form-field-adapter.d.ts +3 -3
- package/dist/webquark/p-014c2f4a.entry.js +1 -0
- package/dist/webquark/p-0389577c.entry.js +1 -0
- package/dist/webquark/p-041e17c1.entry.js +1 -0
- package/dist/webquark/p-0479c571.entry.js +1 -0
- package/dist/webquark/p-0ebca9be.entry.js +1 -0
- package/dist/webquark/{p-fe8c634a.entry.js → p-1bf375f7.entry.js} +2 -2
- package/dist/webquark/{p-6bfffa79.entry.js → p-20dc3ab5.entry.js} +1 -1
- package/dist/webquark/p-28d3348f.entry.js +1 -0
- package/dist/webquark/p-35c177d3.entry.js +1 -0
- package/dist/webquark/{p-99d785ca.entry.js → p-3a60086d.entry.js} +1 -1
- package/dist/webquark/{p-3bc4629c.entry.js → p-3ab798aa.entry.js} +1 -1
- package/dist/webquark/{p-9e78b796.entry.js → p-3b580baf.entry.js} +1 -1
- package/dist/webquark/{p-888e46a8.entry.js → p-3b65f787.entry.js} +1 -1
- package/dist/webquark/p-4bf610f8.entry.js +1 -0
- package/dist/webquark/{p-4d61b70d.entry.js → p-4d30227e.entry.js} +1 -1
- package/dist/webquark/{p-70d9ffde.entry.js → p-4de536ae.entry.js} +1 -1
- package/dist/webquark/{p-90b0858c.entry.js → p-4e4d70c9.entry.js} +1 -1
- package/dist/webquark/p-4efeb7c9.entry.js +1 -0
- package/dist/webquark/{p-dd115868.entry.js → p-51b3d71b.entry.js} +1 -1
- package/dist/webquark/p-778b6bbb.entry.js +1 -0
- package/dist/webquark/{p-f63b7214.entry.js → p-7da78b2f.entry.js} +1 -1
- package/dist/webquark/{p-9ff7e5a4.entry.js → p-7f8f986b.entry.js} +1 -1
- package/dist/webquark/p-8253c742.entry.js +1 -0
- package/dist/webquark/{p-059daa8a.entry.js → p-9a1ddeb7.entry.js} +1 -1
- package/dist/webquark/p-B610wOGe.js +1 -0
- package/dist/webquark/p-BxxU73QQ.js +1 -0
- package/dist/webquark/p-CIMzZPQO.js +3 -0
- package/dist/webquark/p-CfR85WgM.js +13 -0
- package/dist/{components/p-BofcK-7Z.js → webquark/p-D8p28N9s.js} +1 -1
- package/dist/webquark/p-DbzjRzhu.js +1 -0
- package/dist/webquark/{p-BOdNg0jc.js → p-DeOEN0si.js} +1 -1
- package/dist/webquark/{p-d0fbd2b1.entry.js → p-a2b1de23.entry.js} +1 -1
- package/dist/webquark/{p-48fb5228.entry.js → p-a55edc17.entry.js} +1 -1
- package/dist/webquark/p-a8808020.entry.js +1 -0
- package/dist/webquark/{p-f4f97e74.entry.js → p-b1084b3c.entry.js} +1 -1
- package/dist/webquark/{p-36118d90.entry.js → p-b6c4dff4.entry.js} +1 -1
- package/dist/webquark/p-b962e950.entry.js +1 -0
- package/dist/webquark/{p-023f8437.entry.js → p-bc369cd6.entry.js} +1 -1
- package/dist/webquark/p-c119a8ea.entry.js +1 -0
- package/dist/webquark/p-c6b77e9a.entry.js +1 -0
- package/dist/webquark/{p-030ecde3.entry.js → p-ca1c03b4.entry.js} +1 -1
- package/dist/webquark/{p-8ece2c62.entry.js → p-ce436162.entry.js} +1 -1
- package/dist/webquark/{p-0aa74ad6.entry.js → p-d0a47a7c.entry.js} +1 -1
- package/dist/webquark/{p-fec6fe0a.entry.js → p-e1fbc8fc.entry.js} +1 -1
- package/dist/webquark/{p-09cca7b9.entry.js → p-e32833ce.entry.js} +1 -1
- package/dist/webquark/p-e369a4aa.entry.js +1 -0
- package/dist/webquark/p-e4430c61.entry.js +1 -0
- package/dist/webquark/{p-f9ad63ff.entry.js → p-e9c0052b.entry.js} +1 -1
- package/dist/webquark/{p-f1bac94c.entry.js → p-f5c4ca18.entry.js} +1 -1
- package/dist/webquark/{p-64096386.entry.js → p-f6683126.entry.js} +1 -1
- package/dist/webquark/{p-DWO-pleQ.js → p-ojSDiptZ.js} +1 -1
- package/dist/webquark/webquark.css +1 -1
- package/dist/webquark/webquark.esm.js +1 -1
- package/package.json +6 -2
- package/dist/cjs/q-button_2.cjs.entry.js +0 -462
- package/dist/cjs/q-scrollable.cjs.entry.js +0 -449
- package/dist/components/p-B4Mg1xEw.js +0 -1
- package/dist/components/p-BH4gQWub.js +0 -1
- package/dist/components/p-Bj2RJb2E.js +0 -1
- package/dist/components/p-ByfrUWx1.js +0 -1
- package/dist/components/p-CN1ut2Lb.js +0 -1
- package/dist/components/p-ye27qtRo.js +0 -1
- package/dist/esm/q-button_2.entry.js +0 -459
- package/dist/esm/q-scrollable.entry.js +0 -447
- package/dist/types/utils/formatter.d.ts +0 -15
- package/dist/webquark/p-04c8cb9e.entry.js +0 -1
- package/dist/webquark/p-0ae43d6c.entry.js +0 -1
- package/dist/webquark/p-0c3aac3f.entry.js +0 -1
- package/dist/webquark/p-144ef339.entry.js +0 -1
- package/dist/webquark/p-296fbdb1.entry.js +0 -1
- package/dist/webquark/p-5f232b44.entry.js +0 -13
- package/dist/webquark/p-6e28cfe2.entry.js +0 -1
- package/dist/webquark/p-91fff6b6.entry.js +0 -1
- package/dist/webquark/p-923dac41.entry.js +0 -1
- package/dist/webquark/p-97a89cae.entry.js +0 -1
- package/dist/webquark/p-B4Mg1xEw.js +0 -1
- package/dist/webquark/p-B5ElFlHv.js +0 -3
- package/dist/webquark/p-Bj2RJb2E.js +0 -1
- package/dist/webquark/p-ByfrUWx1.js +0 -1
- package/dist/webquark/p-c523ec6f.entry.js +0 -1
- package/dist/webquark/p-d0253d64.entry.js +0 -1
- package/dist/webquark/p-f98f9439.entry.js +0 -1
- package/dist/webquark/p-fe200f68.entry.js +0 -1
- /package/dist/{types/components/actions/button/button.utils.unit.test.d.ts → collection/components/data-display/syntax-box/internals/formatters/formatter.types.js} +0 -0
- /package/dist/collection/{utils → components/data-display/syntax-box/internals}/syntax.js +0 -0
- /package/dist/types/{utils/formatter.unit.test.d.ts → components/actions/button/test/button.utils.unit.test.d.ts} +0 -0
- /package/dist/types/{utils/syntax.unit.test.d.ts → components/data-display/syntax-box/internals/formatters/formatter.unit.test.d.ts} +0 -0
|
@@ -20,6 +20,8 @@ export class QTextarea {
|
|
|
20
20
|
/** Supporting text, replaced by an active error. */
|
|
21
21
|
description;
|
|
22
22
|
size = 'inherit';
|
|
23
|
+
/** Opt-in horizontal width; independent of size. Omitted uses the existing full-width layout. */
|
|
24
|
+
width;
|
|
23
25
|
/** Keep the label accessible without displaying it. */
|
|
24
26
|
labelHidden = false;
|
|
25
27
|
/** Omitted inherits the enclosing form; false cancels reservation. */
|
|
@@ -232,12 +234,12 @@ export class QTextarea {
|
|
|
232
234
|
const hasError = !!(this.error || this.errorMessage);
|
|
233
235
|
const displayError = this.error || this.errorMessage;
|
|
234
236
|
const ariaLabel = this.ariaLabel?.trim() || (!this.label && this.placeholder ? this.placeholder : undefined);
|
|
235
|
-
return (h("div", { key: '
|
|
237
|
+
return (h("div", { key: '2dfa875d382d3377f6a4c797095d1ad79c6e7d8f', style: feedbackStyle(this.reserveFeedback), class: {
|
|
236
238
|
'textarea-wrapper': true,
|
|
237
239
|
'is-disabled': this.isDisabled,
|
|
238
240
|
'has-error': hasError,
|
|
239
241
|
[`size-${this.size}`]: true
|
|
240
|
-
} }, h("span", { key: '
|
|
242
|
+
} }, h("span", { key: 'e574e56178594b74ea708bed0938820983fd0ca7', class: "textarea-size-probe", "aria-hidden": "true", ref: el => (this.sizeProbeEl = el) }, "M"), this.label && (h("label", { key: '93230c095b18c8c6f9debcdc770bb682e058345b', class: { 'textarea-label': true, 'q-label-hidden': this.labelHidden }, htmlFor: "q-field", part: "label" }, this.label)), h("textarea", { key: '6f4cbb31421179e1d4939152f829abf94c5818ea', ref: (el) => (this.textareaEl = el), id: "q-field", class: {
|
|
241
243
|
'textarea-box': true,
|
|
242
244
|
'resize-manual': this.activeResizeMode === 'manual'
|
|
243
245
|
}, part: "textarea", value: this.value, name: this.name, placeholder: this.placeholder, rows: this.rows, disabled: this.isDisabled, required: this.required, onInput: this.handleInput, onChange: this.handleChange, onBlur: this.handleBlur, onFocus: this.handleFocus, onClick: this.handleClick, "aria-invalid": hasError ? 'true' : 'false', "aria-describedby": hasError || this.description ? 'q-field-error' : undefined, "aria-label": ariaLabel }), fieldFeedback('q-field-error', displayError, this.description)));
|
|
@@ -383,6 +385,32 @@ export class QTextarea {
|
|
|
383
385
|
"attribute": "size",
|
|
384
386
|
"defaultValue": "'inherit'"
|
|
385
387
|
},
|
|
388
|
+
"width": {
|
|
389
|
+
"type": "string",
|
|
390
|
+
"mutable": false,
|
|
391
|
+
"complexType": {
|
|
392
|
+
"original": "QInputWidth",
|
|
393
|
+
"resolved": "\"full\" | \"lg\" | \"md\" | \"sm\" | \"xl\" | \"xs\" | \"xxl\"",
|
|
394
|
+
"references": {
|
|
395
|
+
"QInputWidth": {
|
|
396
|
+
"location": "import",
|
|
397
|
+
"path": "../../../theme/tokens",
|
|
398
|
+
"id": "../../../src/browser/theme/tokens.ts::QInputWidth",
|
|
399
|
+
"referenceLocation": "QInputWidth"
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
"required": false,
|
|
404
|
+
"optional": true,
|
|
405
|
+
"docs": {
|
|
406
|
+
"tags": [],
|
|
407
|
+
"text": "Opt-in horizontal width; independent of size. Omitted uses the existing full-width layout."
|
|
408
|
+
},
|
|
409
|
+
"getter": false,
|
|
410
|
+
"setter": false,
|
|
411
|
+
"reflect": true,
|
|
412
|
+
"attribute": "width"
|
|
413
|
+
},
|
|
386
414
|
"labelHidden": {
|
|
387
415
|
"type": "boolean",
|
|
388
416
|
"mutable": false,
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { afterEach, expect, it } from "vitest";
|
|
2
|
+
import "../../../../../../packages/browser/components/dist/components/q-toggle.js";
|
|
3
|
+
import tokens from "../../../../theme/tokens.css?raw";
|
|
4
|
+
import presets from "../../../../theme/token-presets.css?raw";
|
|
5
|
+
const frame = async () => { await new Promise(requestAnimationFrame); await new Promise(requestAnimationFrame); };
|
|
6
|
+
async function fixture(markup) {
|
|
7
|
+
document.body.innerHTML = `<style>${tokens}\n${presets}</style>${markup}`;
|
|
8
|
+
await customElements.whenDefined('q-toggle');
|
|
9
|
+
await frame();
|
|
10
|
+
return document.querySelector('q-toggle');
|
|
11
|
+
}
|
|
12
|
+
const part = (element, name) => element.shadowRoot.querySelector(`[part~="${name}"]`);
|
|
13
|
+
afterEach(() => document.body.replaceChildren());
|
|
14
|
+
it.each(['ltr', 'rtl'])('places switches after their label at the trailing edge in %s', async (direction) => {
|
|
15
|
+
const element = await fixture(`<q-toggle dir="${direction}" style="width:320px" label="Required before checkout"></q-toggle>`);
|
|
16
|
+
const control = part(element, 'control').getBoundingClientRect();
|
|
17
|
+
const label = part(element, 'label').getBoundingClientRect();
|
|
18
|
+
const host = element.getBoundingClientRect();
|
|
19
|
+
if (direction === 'ltr') {
|
|
20
|
+
expect(label.right).toBeLessThan(control.left);
|
|
21
|
+
expect(control.right).toBe(host.right);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
expect(control.right).toBeLessThan(label.left);
|
|
25
|
+
expect(control.left).toBe(host.left);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
it.each(['ltr', 'rtl'])('keeps checkboxes before their label in %s', async (direction) => {
|
|
29
|
+
const element = await fixture(`<q-toggle type="checkbox" dir="${direction}" style="width:320px" label="Visit slot"></q-toggle>`);
|
|
30
|
+
const control = part(element, 'control').getBoundingClientRect();
|
|
31
|
+
const label = part(element, 'label').getBoundingClientRect();
|
|
32
|
+
if (direction === 'ltr')
|
|
33
|
+
expect(control.right).toBeLessThan(label.left);
|
|
34
|
+
else
|
|
35
|
+
expect(label.right).toBeLessThan(control.left);
|
|
36
|
+
});
|
|
37
|
+
it('supports slotted and hidden labels, long text, errors and a control-first part override', async () => {
|
|
38
|
+
const element = await fixture('<q-toggle style="width:160px" error="Review this setting"><span>Long setting label that wraps across multiple lines</span></q-toggle>');
|
|
39
|
+
expect(part(element, 'control').getBoundingClientRect().right).toBe(element.getBoundingClientRect().right);
|
|
40
|
+
expect(part(element, 'label').getBoundingClientRect().height).toBeGreaterThan(20);
|
|
41
|
+
expect(part(element, 'error-msg').getBoundingClientRect().top).toBeGreaterThanOrEqual(part(element, 'label').getBoundingClientRect().bottom);
|
|
42
|
+
element.labelHidden = true;
|
|
43
|
+
await frame();
|
|
44
|
+
expect(part(element, 'label').classList.contains('q-label-hidden')).toBe(true);
|
|
45
|
+
expect(part(element, 'control').getBoundingClientRect().right).toBe(element.getBoundingClientRect().right);
|
|
46
|
+
element.labelHidden = false;
|
|
47
|
+
const override = document.createElement('style');
|
|
48
|
+
override.textContent = 'q-toggle::part(control) { order: 0; margin-inline-start: 0; }';
|
|
49
|
+
document.body.append(override);
|
|
50
|
+
await frame();
|
|
51
|
+
expect(part(element, 'control').getBoundingClientRect().right).toBeLessThan(part(element, 'label').getBoundingClientRect().left);
|
|
52
|
+
});
|
|
53
|
+
it('preserves label click, keyboard activation, disabled semantics and form value', async () => {
|
|
54
|
+
const element = await fixture('<form><q-toggle name="required" label="Required before checkout"></q-toggle></form>');
|
|
55
|
+
part(element, 'label').click();
|
|
56
|
+
await frame();
|
|
57
|
+
expect(element.checked).toBe(true);
|
|
58
|
+
expect(new FormData(document.querySelector('form')).get('required')).toBe('true');
|
|
59
|
+
const wrapper = element.shadowRoot.querySelector('[role="switch"]');
|
|
60
|
+
wrapper.dispatchEvent(new KeyboardEvent('keydown', { key: ' ', bubbles: true }));
|
|
61
|
+
await frame();
|
|
62
|
+
expect(element.checked).toBe(false);
|
|
63
|
+
element.disabled = true;
|
|
64
|
+
await frame();
|
|
65
|
+
expect(wrapper.getAttribute('aria-disabled')).toBe('true');
|
|
66
|
+
expect(wrapper.tabIndex).toBe(-1);
|
|
67
|
+
part(element, 'label').click();
|
|
68
|
+
expect(element.checked).toBe(false);
|
|
69
|
+
});
|
|
@@ -88,6 +88,7 @@
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
.toggle-control {
|
|
91
|
+
flex-shrink: 0;
|
|
91
92
|
display: flex;
|
|
92
93
|
align-items: center;
|
|
93
94
|
justify-content: center;
|
|
@@ -250,3 +251,29 @@
|
|
|
250
251
|
.switch-thumb { width: var(--_q-thumb-size); height: var(--_q-thumb-size); }
|
|
251
252
|
.type-switch.is-checked .switch-thumb { transform: translate(calc(var(--_q-switch-width) - var(--_q-thumb-size) - 6px), -50%); }
|
|
252
253
|
.checkbox-box { width: var(--q-toggle-checkbox-size, var(--q-toggle-box-size, var(--_q-control-icon))); height: var(--q-toggle-checkbox-size, var(--q-toggle-box-size, var(--_q-control-icon))); }
|
|
254
|
+
|
|
255
|
+
/* Switch settings read label-first; checkbox choices retain control-first order. */
|
|
256
|
+
.type-switch .toggle-control { order: 1; margin-inline-start: auto; }
|
|
257
|
+
.toggle-label-text { min-width: 0; overflow-wrap: anywhere; }
|
|
258
|
+
|
|
259
|
+
/* Shared opt-in presentation; standalone surfaces retain their existing rules. */
|
|
260
|
+
:host([data-q-control-group]) :is(.input-control, .dropdown-trigger, .quantity-selector, .btn, .toggle-wrapper) {
|
|
261
|
+
border-start-start-radius: var(--_q-group-start-start, 0px);
|
|
262
|
+
border-start-end-radius: var(--_q-group-start-end, 0px);
|
|
263
|
+
border-end-start-radius: var(--_q-group-end-start, 0px);
|
|
264
|
+
border-end-end-radius: var(--_q-group-end-end, 0px);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
:host([data-q-control-group]) .toggle-wrapper {
|
|
268
|
+
box-sizing: border-box;
|
|
269
|
+
min-height: var(--_q-control-height);
|
|
270
|
+
padding-inline: var(--_q-control-padding);
|
|
271
|
+
border: var(--q-border, 1px solid var(--q-border-color, #4b5563));
|
|
272
|
+
background: var(--q-bg-field, var(--q-bg-surface-3, #22304d));
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
:host([data-q-control-group]) :is(.btn, .toggle-wrapper, .quantity-selector) {
|
|
276
|
+
width: 100%;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
|
|
@@ -191,7 +191,7 @@ export class QToggle {
|
|
|
191
191
|
const hasLabel = this.label !== undefined && this.label !== '';
|
|
192
192
|
const showLabel = hasLabel || this.hasDefaultSlot;
|
|
193
193
|
const hasError = !!this.error;
|
|
194
|
-
return (h("div", { key: '
|
|
194
|
+
return (h("div", { key: 'd48179acd7944770d0ae2609ef5cc0cbb552d061', class: "toggle-container", style: feedbackStyle(this.reserveFeedback) }, h("div", { key: '4835a9b82e93ab6c60c78dd2d647f9aaa5cbeb00', ref: el => (this.controlEl = el), class: {
|
|
195
195
|
'toggle-wrapper': true,
|
|
196
196
|
'is-checked': this.checked,
|
|
197
197
|
'is-disabled': this.isDisabled,
|
|
@@ -199,11 +199,11 @@ export class QToggle {
|
|
|
199
199
|
'has-error': hasError,
|
|
200
200
|
[`type-${this.type}`]: true,
|
|
201
201
|
[`size-${this.size}`]: true,
|
|
202
|
-
}, role: this.type === 'switch' ? 'switch' : 'checkbox', "aria-checked": this.checked ? 'true' : 'false', "aria-disabled": this.isDisabled ? 'true' : 'false', "aria-required": this.required ? 'true' : 'false', "aria-invalid": hasError ? 'true' : 'false', "aria-describedby": hasError || this.description ? 'toggle-error-msg' : undefined, tabindex: this.isDisabled ? -1 : 0, onClick: this.handleClick, onKeyDown: this.handleKeyDown, onFocus: this.handleFocus, onBlur: this.handleBlur }, h("div", { key: '
|
|
202
|
+
}, role: this.type === 'switch' ? 'switch' : 'checkbox', "aria-checked": this.checked ? 'true' : 'false', "aria-disabled": this.isDisabled ? 'true' : 'false', "aria-required": this.required ? 'true' : 'false', "aria-invalid": hasError ? 'true' : 'false', "aria-describedby": hasError || this.description ? 'toggle-error-msg' : undefined, tabindex: this.isDisabled ? -1 : 0, onClick: this.handleClick, onKeyDown: this.handleKeyDown, onFocus: this.handleFocus, onBlur: this.handleBlur }, h("div", { key: '18f5a731fd6200ab4363f68e2ef3971e9d9bb807', class: "toggle-control", part: "control" }, this.type === 'switch' ? (h("div", { class: "switch-track", part: "track" }, h("div", { class: "switch-thumb", part: "thumb" }))) : (h("div", { class: "checkbox-box", part: "box" }, h("span", { class: { 'icon-wrap': true, 'is-hidden': !this.checked }, part: "icon-checked" }, h("slot", { name: "checked-icon", onSlotchange: this.handleSlotChange }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "3", "stroke-linecap": "round", "stroke-linejoin": "round", class: "default-check-icon", "aria-hidden": "true" }, h("polyline", { points: "20 6 9 17 4 12" })))), h("span", { class: { 'icon-wrap': true, 'is-hidden': this.checked }, part: "icon-unchecked" }, h("slot", { name: "unchecked-icon", onSlotchange: this.handleSlotChange }))))), h("span", { key: '52b2da5760ba5b4ace0f3ed33e70897cf1688b13', class: {
|
|
203
203
|
'toggle-label-text': true,
|
|
204
204
|
'q-label-hidden': this.labelHidden,
|
|
205
205
|
'is-hidden': !showLabel
|
|
206
|
-
}, part: "label" }, h("slot", { key: '
|
|
206
|
+
}, part: "label" }, h("slot", { key: 'ab52ad9602e9fd1a8779a9e02d46d99716ae3324', onSlotchange: this.handleSlotChange }, this.label))), fieldFeedback('toggle-error-msg', this.error, this.description)));
|
|
207
207
|
}
|
|
208
208
|
static get is() { return "q-toggle"; }
|
|
209
209
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/* Generated by scripts/generate-theme.ts. */
|
|
2
|
+
:host {
|
|
3
|
+
min-width: 0;
|
|
4
|
+
--_q-control-height: var(--q-context-control-height, calc(var(--_q-context-size-sm, 0) * var(--q-control-height-sm, 1.75rem) + var(--_q-context-size-md, 1) * var(--q-control-height-md, 2.25rem) + var(--_q-context-size-lg, 0) * var(--q-control-height-lg, 2.75rem)));
|
|
5
|
+
--_q-control-font: var(--q-context-control-font, calc(var(--_q-context-size-sm, 0) * var(--q-control-font-sm, 0.75rem) + var(--_q-context-size-md, 1) * var(--q-control-font-md, 0.875rem) + var(--_q-context-size-lg, 0) * var(--q-control-font-lg, 1rem)));
|
|
6
|
+
--_q-control-line: var(--q-context-control-line, calc(var(--_q-context-size-sm, 0) * var(--q-control-line-sm, 1rem) + var(--_q-context-size-md, 1) * var(--q-control-line-md, 1.25rem) + var(--_q-context-size-lg, 0) * var(--q-control-line-lg, 1.5rem)));
|
|
7
|
+
--_q-control-padding: var(--q-context-control-padding, calc(var(--_q-context-size-sm, 0) * var(--q-control-padding-sm, 0.5rem) + var(--_q-context-size-md, 1) * var(--q-control-padding-md, 0.75rem) + var(--_q-context-size-lg, 0) * var(--q-control-padding-lg, 1rem)));
|
|
8
|
+
--_q-control-icon: var(--q-context-control-icon, calc(var(--_q-context-size-sm, 0) * var(--q-control-icon-sm, 0.875rem) + var(--_q-context-size-md, 1) * var(--q-control-icon-md, 1rem) + var(--_q-context-size-lg, 0) * var(--q-control-icon-lg, 1.25rem)));
|
|
9
|
+
--_q-control-radius: var(--q-context-control-radius, calc(var(--_q-context-size-sm, 0) * var(--q-control-radius-sm, 0.34375rem) + var(--_q-context-size-md, 1) * var(--q-control-radius-md, 0.4375rem) + var(--_q-context-size-lg, 0) * var(--q-control-radius-lg, 0.53125rem)));
|
|
10
|
+
}
|
|
11
|
+
.size-sm {
|
|
12
|
+
--_q-control-height: var(--q-control-height-sm, 1.75rem);
|
|
13
|
+
--_q-control-font: var(--q-control-font-sm, 0.75rem);
|
|
14
|
+
--_q-control-line: var(--q-control-line-sm, 1rem);
|
|
15
|
+
--_q-control-padding: var(--q-control-padding-sm, 0.5rem);
|
|
16
|
+
--_q-control-icon: var(--q-control-icon-sm, 0.875rem);
|
|
17
|
+
--_q-control-radius: var(--q-control-radius-sm, 0.34375rem);
|
|
18
|
+
}
|
|
19
|
+
.size-md {
|
|
20
|
+
--_q-control-height: var(--q-control-height-md, 2.25rem);
|
|
21
|
+
--_q-control-font: var(--q-control-font-md, 0.875rem);
|
|
22
|
+
--_q-control-line: var(--q-control-line-md, 1.25rem);
|
|
23
|
+
--_q-control-padding: var(--q-control-padding-md, 0.75rem);
|
|
24
|
+
--_q-control-icon: var(--q-control-icon-md, 1rem);
|
|
25
|
+
--_q-control-radius: var(--q-control-radius-md, 0.4375rem);
|
|
26
|
+
}
|
|
27
|
+
.size-lg {
|
|
28
|
+
--_q-control-height: var(--q-control-height-lg, 2.75rem);
|
|
29
|
+
--_q-control-font: var(--q-control-font-lg, 1rem);
|
|
30
|
+
--_q-control-line: var(--q-control-line-lg, 1.5rem);
|
|
31
|
+
--_q-control-padding: var(--q-control-padding-lg, 1rem);
|
|
32
|
+
--_q-control-icon: var(--q-control-icon-lg, 1.25rem);
|
|
33
|
+
--_q-control-radius: var(--q-control-radius-lg, 0.53125rem);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
:host {
|
|
38
|
+
display: block;
|
|
39
|
+
min-width: 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
[part='group'] {
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: start;
|
|
45
|
+
isolation: isolate;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
::slotted([hidden]) { display: none !important; }
|
|
49
|
+
|
|
50
|
+
::slotted([data-q-control-group]) {
|
|
51
|
+
min-width: 0;
|
|
52
|
+
--_q-group-start-start: 0px;
|
|
53
|
+
--_q-group-start-end: 0px;
|
|
54
|
+
--_q-group-end-start: 0px;
|
|
55
|
+
--_q-group-end-end: 0px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
::slotted([data-q-control-group='first']),
|
|
59
|
+
::slotted([data-q-control-group='only']) {
|
|
60
|
+
--_q-group-start-start: var(--q-control-group-radius, var(--_q-control-radius));
|
|
61
|
+
--_q-group-end-start: var(--q-control-group-radius, var(--_q-control-radius));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
::slotted([data-q-control-group='last']),
|
|
65
|
+
::slotted([data-q-control-group='only']) {
|
|
66
|
+
--_q-group-start-end: var(--q-control-group-radius, var(--_q-control-radius));
|
|
67
|
+
--_q-group-end-end: var(--q-control-group-radius, var(--_q-control-radius));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
::slotted([data-q-control-group='middle']),
|
|
71
|
+
::slotted([data-q-control-group='last']) { margin-inline-start: -1px; }
|
|
72
|
+
|
|
73
|
+
::slotted(q-input:not([width])),
|
|
74
|
+
::slotted(q-dropdown:not([width])),
|
|
75
|
+
::slotted(q-dropdown[width="fit-options"]) { flex: 0 1 auto; }
|
|
76
|
+
|
|
77
|
+
::slotted(q-input[width]:not([width="full"])),
|
|
78
|
+
::slotted(q-dropdown[width]:not([width="full"]):not([width="fit-options"])),
|
|
79
|
+
::slotted(q-toggle),
|
|
80
|
+
::slotted(q-button),
|
|
81
|
+
::slotted(q-quantity-selector) { flex: 0 0 auto; }
|
|
82
|
+
|
|
83
|
+
::slotted(:focus-within) { position: relative; z-index: 1; }
|
|
84
|
+
|
|
85
|
+
:host([orientation='vertical']) [part='group'] { flex-direction: column; align-items: stretch; }
|
|
86
|
+
|
|
87
|
+
:host([orientation='vertical']) ::slotted([data-q-control-group]) {
|
|
88
|
+
--_q-group-start-start: 0px;
|
|
89
|
+
--_q-group-start-end: 0px;
|
|
90
|
+
--_q-group-end-start: 0px;
|
|
91
|
+
--_q-group-end-end: 0px;
|
|
92
|
+
margin-inline-start: 0;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
:host([orientation='vertical']) ::slotted([data-q-control-group='first']),
|
|
96
|
+
:host([orientation='vertical']) ::slotted([data-q-control-group='only']) {
|
|
97
|
+
--_q-group-start-start: var(--q-control-group-radius, var(--_q-control-radius));
|
|
98
|
+
--_q-group-start-end: var(--q-control-group-radius, var(--_q-control-radius));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
:host([orientation='vertical']) ::slotted([data-q-control-group='last']),
|
|
102
|
+
:host([orientation='vertical']) ::slotted([data-q-control-group='only']) {
|
|
103
|
+
--_q-group-end-start: var(--q-control-group-radius, var(--_q-control-radius));
|
|
104
|
+
--_q-group-end-end: var(--q-control-group-radius, var(--_q-control-radius));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
:host([orientation='vertical']) ::slotted([data-q-control-group='middle']),
|
|
108
|
+
:host([orientation='vertical']) ::slotted([data-q-control-group='last']) { margin-block-start: -1px; }
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { controlScope } from "../../../theme/tokens";
|
|
3
|
+
const supportedControls = new Set(['Q-INPUT', 'Q-DROPDOWN', 'Q-TOGGLE', 'Q-QUANTITY-SELECTOR', 'Q-BUTTON']);
|
|
4
|
+
const marker = 'data-q-control-group';
|
|
5
|
+
const ownership = new WeakMap();
|
|
6
|
+
/**
|
|
7
|
+
* Visually joined controls with consumer-owned values and interactions.
|
|
8
|
+
* @slot - Direct input, dropdown, toggle, quantity selector or button children.
|
|
9
|
+
* @part group - Layout container; each child retains its own control surface.
|
|
10
|
+
*/
|
|
11
|
+
export class QControlGroup {
|
|
12
|
+
el;
|
|
13
|
+
size = 'inherit';
|
|
14
|
+
orientation = 'horizontal';
|
|
15
|
+
/** Name of the group; each child still needs its own accessible name. */
|
|
16
|
+
ariaLabel = null;
|
|
17
|
+
observer;
|
|
18
|
+
managedChildren = new Set();
|
|
19
|
+
connectedCallback() {
|
|
20
|
+
this.observer = new MutationObserver(() => this.updateChildren());
|
|
21
|
+
this.observer.observe(this.el, { childList: true, subtree: true, attributes: true, attributeFilter: ['hidden', 'slot'] });
|
|
22
|
+
this.updateChildren();
|
|
23
|
+
}
|
|
24
|
+
disconnectedCallback() {
|
|
25
|
+
this.observer?.disconnect();
|
|
26
|
+
for (const child of this.managedChildren)
|
|
27
|
+
this.restoreChild(child);
|
|
28
|
+
}
|
|
29
|
+
restoreChild(child) {
|
|
30
|
+
const previous = ownership.get(child);
|
|
31
|
+
if (previous?.owner === this.el) {
|
|
32
|
+
if (previous.original === null)
|
|
33
|
+
child.removeAttribute(marker);
|
|
34
|
+
else
|
|
35
|
+
child.setAttribute(marker, previous.original);
|
|
36
|
+
ownership.delete(child);
|
|
37
|
+
}
|
|
38
|
+
this.managedChildren.delete(child);
|
|
39
|
+
}
|
|
40
|
+
updateChildren = () => {
|
|
41
|
+
const controls = Array.from(this.el.children).filter((child) => child instanceof HTMLElement && supportedControls.has(child.tagName) && !child.hidden && !child.slot);
|
|
42
|
+
for (const child of this.managedChildren) {
|
|
43
|
+
if (!controls.includes(child))
|
|
44
|
+
this.restoreChild(child);
|
|
45
|
+
}
|
|
46
|
+
controls.forEach((child, index) => {
|
|
47
|
+
if (!this.managedChildren.has(child)) {
|
|
48
|
+
const previous = ownership.get(child);
|
|
49
|
+
ownership.set(child, { owner: this.el, original: previous ? previous.original : child.getAttribute(marker) });
|
|
50
|
+
this.managedChildren.add(child);
|
|
51
|
+
}
|
|
52
|
+
child.setAttribute(marker, controls.length === 1 ? 'only' : index === 0 ? 'first' : index === controls.length - 1 ? 'last' : 'middle');
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
render() {
|
|
56
|
+
return (h(Host, { key: '9e724cedca3d8b30f842a8cf0818d1386ec073b8', style: controlScope(this.size) }, h("div", { key: 'a76241b0076ed5d373df7560f8980eef2a3a9efb', part: "group", role: "group", "aria-label": this.ariaLabel || undefined }, h("slot", { key: 'db65f42834a6841c2c33a081a88a4b0c417d9e85', onSlotchange: this.updateChildren }))));
|
|
57
|
+
}
|
|
58
|
+
static get is() { return "q-control-group"; }
|
|
59
|
+
static get encapsulation() { return "shadow"; }
|
|
60
|
+
static get originalStyleUrls() {
|
|
61
|
+
return {
|
|
62
|
+
"$": ["control-group.css"]
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
static get styleUrls() {
|
|
66
|
+
return {
|
|
67
|
+
"$": ["control-group.css"]
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
static get properties() {
|
|
71
|
+
return {
|
|
72
|
+
"size": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"mutable": false,
|
|
75
|
+
"complexType": {
|
|
76
|
+
"original": "QControlSize",
|
|
77
|
+
"resolved": "\"inherit\" | \"lg\" | \"md\" | \"sm\"",
|
|
78
|
+
"references": {
|
|
79
|
+
"QControlSize": {
|
|
80
|
+
"location": "import",
|
|
81
|
+
"path": "../../../theme/tokens",
|
|
82
|
+
"id": "../../../src/browser/theme/tokens.ts::QControlSize",
|
|
83
|
+
"referenceLocation": "QControlSize"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"required": false,
|
|
88
|
+
"optional": false,
|
|
89
|
+
"docs": {
|
|
90
|
+
"tags": [],
|
|
91
|
+
"text": ""
|
|
92
|
+
},
|
|
93
|
+
"getter": false,
|
|
94
|
+
"setter": false,
|
|
95
|
+
"reflect": false,
|
|
96
|
+
"attribute": "size",
|
|
97
|
+
"defaultValue": "'inherit'"
|
|
98
|
+
},
|
|
99
|
+
"orientation": {
|
|
100
|
+
"type": "string",
|
|
101
|
+
"mutable": false,
|
|
102
|
+
"complexType": {
|
|
103
|
+
"original": "'horizontal' | 'vertical'",
|
|
104
|
+
"resolved": "\"horizontal\" | \"vertical\"",
|
|
105
|
+
"references": {}
|
|
106
|
+
},
|
|
107
|
+
"required": false,
|
|
108
|
+
"optional": false,
|
|
109
|
+
"docs": {
|
|
110
|
+
"tags": [],
|
|
111
|
+
"text": ""
|
|
112
|
+
},
|
|
113
|
+
"getter": false,
|
|
114
|
+
"setter": false,
|
|
115
|
+
"reflect": true,
|
|
116
|
+
"attribute": "orientation",
|
|
117
|
+
"defaultValue": "'horizontal'"
|
|
118
|
+
},
|
|
119
|
+
"ariaLabel": {
|
|
120
|
+
"type": "string",
|
|
121
|
+
"mutable": false,
|
|
122
|
+
"complexType": {
|
|
123
|
+
"original": "string | null",
|
|
124
|
+
"resolved": "string",
|
|
125
|
+
"references": {}
|
|
126
|
+
},
|
|
127
|
+
"required": false,
|
|
128
|
+
"optional": false,
|
|
129
|
+
"docs": {
|
|
130
|
+
"tags": [],
|
|
131
|
+
"text": "Name of the group; each child still needs its own accessible name."
|
|
132
|
+
},
|
|
133
|
+
"getter": false,
|
|
134
|
+
"setter": false,
|
|
135
|
+
"reflect": false,
|
|
136
|
+
"attribute": "aria-label",
|
|
137
|
+
"defaultValue": "null"
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
static get elementRef() { return "el"; }
|
|
142
|
+
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { afterEach, describe, expect, it } from "vitest";
|
|
2
|
+
import "../../../../../../packages/browser/components/dist/components/q-control-group.js";
|
|
3
|
+
import "../../../../../../packages/browser/components/dist/components/q-input.js";
|
|
4
|
+
import "../../../../../../packages/browser/components/dist/components/q-dropdown.js";
|
|
5
|
+
import "../../../../../../packages/browser/components/dist/components/q-toggle.js";
|
|
6
|
+
import "../../../../../../packages/browser/components/dist/components/q-quantity-selector.js";
|
|
7
|
+
import "../../../../../../packages/browser/components/dist/components/q-button.js";
|
|
8
|
+
import "../../../../../../packages/browser/components/dist/components/q-form.js";
|
|
9
|
+
import tokens from "../../../../theme/tokens.css?raw";
|
|
10
|
+
import presets from "../../../../theme/token-presets.css?raw";
|
|
11
|
+
const frame = async () => { await new Promise(requestAnimationFrame); await new Promise(requestAnimationFrame); };
|
|
12
|
+
const element = (id) => document.getElementById(id);
|
|
13
|
+
const surface = (id) => element(id).shadowRoot.querySelector('.input-control,.dropdown-trigger,.toggle-wrapper,.quantity-selector,.btn');
|
|
14
|
+
const height = (id) => Math.round(surface(id).getBoundingClientRect().height);
|
|
15
|
+
async function fixture(html) {
|
|
16
|
+
document.body.innerHTML = `<style>${tokens}\n${presets}</style>${html}`;
|
|
17
|
+
await Promise.all(['q-control-group', 'q-input', 'q-dropdown', 'q-toggle', 'q-quantity-selector', 'q-button', 'q-form'].map(tag => customElements.whenDefined(tag)));
|
|
18
|
+
await frame();
|
|
19
|
+
}
|
|
20
|
+
afterEach(() => { document.body.innerHTML = ''; });
|
|
21
|
+
describe('q-control-group', () => {
|
|
22
|
+
it('joins all five controls without changing standalone geometry or child values', async () => {
|
|
23
|
+
await fixture(`<q-input id="standalone" label="Outside" label-hidden value="original"></q-input>
|
|
24
|
+
<q-control-group aria-label="Mixed controls" id="group">
|
|
25
|
+
<q-toggle id="toggle" label="Enabled" checked></q-toggle>
|
|
26
|
+
<q-input id="amount" label="Amount" label-hidden type="number" value="5" width="xs"></q-input>
|
|
27
|
+
<q-dropdown id="unit" label="Unit" label-hidden options='["Minutes","Hours"]' value="Minutes"></q-dropdown>
|
|
28
|
+
<q-quantity-selector id="quantity" value="2"></q-quantity-selector>
|
|
29
|
+
<q-button id="button">Apply</q-button>
|
|
30
|
+
</q-control-group>`);
|
|
31
|
+
for (const id of ['toggle', 'amount', 'unit', 'quantity', 'button'])
|
|
32
|
+
expect(height(id)).toBe(height('standalone'));
|
|
33
|
+
expect(element('standalone').hasAttribute('data-q-control-group')).toBe(false);
|
|
34
|
+
expect(getComputedStyle(surface('standalone')).borderStartStartRadius).not.toBe('0px');
|
|
35
|
+
expect(getComputedStyle(surface('amount')).borderStartStartRadius).toBe('0px');
|
|
36
|
+
expect(element('amount').value).toBe('5');
|
|
37
|
+
expect(element('toggle').checked).toBe(true);
|
|
38
|
+
expect(element('group').shadowRoot.querySelector('[role="group"]').getAttribute('aria-label')).toBe('Mixed controls');
|
|
39
|
+
expect(element('group').tabIndex).toBe(-1);
|
|
40
|
+
});
|
|
41
|
+
it('tracks hidden, repeated and moved children and restores standalone styling', async () => {
|
|
42
|
+
await fixture('<q-control-group id="a"><q-input id="one"></q-input><q-input id="two"></q-input><q-button id="three">Save</q-button></q-control-group><q-control-group id="b"></q-control-group>');
|
|
43
|
+
const originalRadius = getComputedStyle(surface('one')).borderStartStartRadius;
|
|
44
|
+
element('one').hidden = true;
|
|
45
|
+
await frame();
|
|
46
|
+
expect(element('one').hasAttribute('data-q-control-group')).toBe(false);
|
|
47
|
+
expect(element('two').getAttribute('data-q-control-group')).toBe('first');
|
|
48
|
+
element('b').append(element('two'));
|
|
49
|
+
await frame();
|
|
50
|
+
expect(element('two').getAttribute('data-q-control-group')).toBe('only');
|
|
51
|
+
document.body.append(element('two'));
|
|
52
|
+
await frame();
|
|
53
|
+
expect(element('two').hasAttribute('data-q-control-group')).toBe(false);
|
|
54
|
+
expect(getComputedStyle(surface('two')).borderStartStartRadius).toBe(originalRadius);
|
|
55
|
+
element('one').hidden = false;
|
|
56
|
+
element('a').prepend(element('three'));
|
|
57
|
+
await frame();
|
|
58
|
+
expect(element('three').getAttribute('data-q-control-group')).toBe('first');
|
|
59
|
+
expect(element('one').getAttribute('data-q-control-group')).toBe('last');
|
|
60
|
+
});
|
|
61
|
+
it('inherits changing preset, size and palette scopes without leaking outside', async () => {
|
|
62
|
+
await fixture(`<q-form size="sm"><div id="scope" data-wq-preset="comfortable" style="--q-border-color:rgb(120, 10, 30)">
|
|
63
|
+
<q-input id="outside" label-hidden label="Outside"></q-input>
|
|
64
|
+
<q-control-group id="group"><q-input id="inside" label-hidden label="Inside"></q-input><q-button id="large" size="lg">Save</q-button></q-control-group>
|
|
65
|
+
<div data-wq-preset="compact"><q-control-group><q-input id="nested" label-hidden label="Nested"></q-input></q-control-group></div>
|
|
66
|
+
</div></q-form>`);
|
|
67
|
+
expect(height('inside')).toBe(height('outside'));
|
|
68
|
+
expect(height('inside')).toBe(36);
|
|
69
|
+
expect(height('nested')).toBe(28);
|
|
70
|
+
expect(height('large')).toBe(52);
|
|
71
|
+
element('scope').dataset.wqPreset = 'compact';
|
|
72
|
+
element('scope').style.setProperty('--q-border-color', 'rgb(10, 90, 40)');
|
|
73
|
+
await frame();
|
|
74
|
+
expect(height('inside')).toBe(height('outside'));
|
|
75
|
+
expect(height('inside')).toBe(28);
|
|
76
|
+
await expect.poll(() => height('large')).toBe(44);
|
|
77
|
+
expect(getComputedStyle(surface('inside')).borderColor).toBe(getComputedStyle(surface('outside')).borderColor);
|
|
78
|
+
element('group').setAttribute('size', 'lg');
|
|
79
|
+
await frame();
|
|
80
|
+
await expect.poll(() => height('inside')).toBe(44);
|
|
81
|
+
expect(height('outside')).toBe(28);
|
|
82
|
+
});
|
|
83
|
+
it('preserves form values, reset, validation and events', async () => {
|
|
84
|
+
await fixture(`<form id="form"><q-control-group>
|
|
85
|
+
<q-input id="input" name="amount" label="Amount" label-hidden value="5" required></q-input>
|
|
86
|
+
<q-toggle id="enabled" name="enabled" label="Enabled" checked></q-toggle>
|
|
87
|
+
<q-dropdown id="unit" name="unit" label="Unit" label-hidden options='["Minutes","Hours"]' value="Minutes"></q-dropdown>
|
|
88
|
+
</q-control-group></form>`);
|
|
89
|
+
const form = element('form');
|
|
90
|
+
expect(new FormData(form).get('amount')).toBe('5');
|
|
91
|
+
expect(new FormData(form).get('unit')).toBe('Minutes');
|
|
92
|
+
const input = element('input');
|
|
93
|
+
input.value = '';
|
|
94
|
+
await frame();
|
|
95
|
+
expect(await input.checkValidity()).toBe(false);
|
|
96
|
+
form.reset();
|
|
97
|
+
await frame();
|
|
98
|
+
expect(input.value).toBe('5');
|
|
99
|
+
let changes = 0;
|
|
100
|
+
element('enabled').addEventListener('qChange', () => changes++);
|
|
101
|
+
surface('enabled').click();
|
|
102
|
+
await frame();
|
|
103
|
+
expect(changes).toBe(1);
|
|
104
|
+
expect(new FormData(form).has('enabled')).toBe(false);
|
|
105
|
+
});
|
|
106
|
+
it('keeps explicit host and preset widths without growing them into spare space', async () => {
|
|
107
|
+
await fixture('<q-control-group style="width:600px"><q-input id="fixed" style="width:120px" label-hidden label="Code"></q-input><q-button>Find</q-button></q-control-group><q-control-group style="width:600px"><q-input id="small" width="xs" label-hidden label="Amount"></q-input><q-dropdown label-hidden label="Unit"></q-dropdown></q-control-group>');
|
|
108
|
+
expect(element('fixed').getBoundingClientRect().width).toBe(120);
|
|
109
|
+
expect(element('small').getBoundingClientRect().width).toBe(80);
|
|
110
|
+
});
|
|
111
|
+
it('preserves child appearance and actions across light and dark themes', async () => {
|
|
112
|
+
await fixture(`<div id="theme" data-theme="light">
|
|
113
|
+
<q-control-group><q-input id="input" label="Amount" label-hidden type="number" value="5"></q-input><q-dropdown id="dropdown" label="Supplier" label-hidden searchable options='["Acme","Example"]'></q-dropdown><q-button id="action">Use supplier</q-button></q-control-group>
|
|
114
|
+
<q-input id="standalone" label="Amount" label-hidden type="number" value="5"></q-input></div>`);
|
|
115
|
+
for (const theme of ['light', 'dark']) {
|
|
116
|
+
element('theme').dataset.theme = theme;
|
|
117
|
+
await frame();
|
|
118
|
+
await expect.poll(() => getComputedStyle(surface('input')).backgroundColor).toBe(getComputedStyle(surface('standalone')).backgroundColor);
|
|
119
|
+
expect(height('input')).toBe(height('standalone'));
|
|
120
|
+
}
|
|
121
|
+
element('input').shadowRoot.querySelector('[aria-label="Increase value"]').click();
|
|
122
|
+
await frame();
|
|
123
|
+
expect(element('input').value).toBe('6');
|
|
124
|
+
let actions = 0;
|
|
125
|
+
element('action').addEventListener('qClick', () => actions++);
|
|
126
|
+
surface('action').click();
|
|
127
|
+
expect(actions).toBe(1);
|
|
128
|
+
element('action').disabled = true;
|
|
129
|
+
await frame();
|
|
130
|
+
surface('action').click();
|
|
131
|
+
expect(actions).toBe(1);
|
|
132
|
+
surface('dropdown').click();
|
|
133
|
+
await frame();
|
|
134
|
+
const option = element('dropdown').shadowRoot.querySelector('[role="option"]');
|
|
135
|
+
option.click();
|
|
136
|
+
await frame();
|
|
137
|
+
expect(element('dropdown').value).toBe('Acme');
|
|
138
|
+
});
|
|
139
|
+
it('preserves q-form discovery, reset and disabled fields through the slot', async () => {
|
|
140
|
+
await fixture('<q-form id="form"><q-control-group><q-input id="input" label="Amount" label-hidden name="amount" value="5"></q-input><q-input name="ignored" disabled value="hidden"></q-input></q-control-group></q-form>');
|
|
141
|
+
const form = element('form');
|
|
142
|
+
expect(await form.getValues()).toEqual({ amount: '5' });
|
|
143
|
+
await form.setValues({ amount: '10' });
|
|
144
|
+
expect(element('input').value).toBe('10');
|
|
145
|
+
await form.resetForm();
|
|
146
|
+
expect(await form.getValues()).toEqual({ amount: '5' });
|
|
147
|
+
});
|
|
148
|
+
it('keeps focus and dropdown menus outside the shared outline in RTL and vertical layouts', async () => {
|
|
149
|
+
await fixture(`<q-control-group id="group" dir="rtl" style="width:300px"><q-input id="input" label="Amount" label-hidden></q-input>
|
|
150
|
+
<q-dropdown id="dropdown" label="Unit" label-hidden options='["Minutes","Hours"]'></q-dropdown></q-control-group>`);
|
|
151
|
+
expect(getComputedStyle(surface('input')).borderTopRightRadius).not.toBe('0px');
|
|
152
|
+
await element('input').focusElement();
|
|
153
|
+
expect(element('input').shadowRoot.activeElement?.tagName).toBe('INPUT');
|
|
154
|
+
surface('dropdown').click();
|
|
155
|
+
await frame();
|
|
156
|
+
const menu = element('dropdown').shadowRoot.querySelector('[role="listbox"]');
|
|
157
|
+
expect(menu.getBoundingClientRect().height).toBeGreaterThan(0);
|
|
158
|
+
expect(getComputedStyle(element('group').shadowRoot.querySelector('[part="group"]')).overflow).toBe('visible');
|
|
159
|
+
element('group').setAttribute('orientation', 'vertical');
|
|
160
|
+
await frame();
|
|
161
|
+
expect(surface('dropdown').getBoundingClientRect().top).toBeGreaterThan(surface('input').getBoundingClientRect().top);
|
|
162
|
+
});
|
|
163
|
+
});
|