@webquark/browser 1.1.0 → 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-B6vl_1p5.js → action.props-CNe2JXR5.js} +1 -1
- package/dist/cjs/{field-B5nxD8Kc.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-BD6Jjssb.js → index-BN-WdOQM.js} +13 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/q-accordion.cjs.entry.js +1 -1
- 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 +2 -2
- package/dist/cjs/q-carousel.cjs.entry.js +1 -1
- package/dist/cjs/q-chip.cjs.entry.js +2 -2
- package/dist/cjs/q-control-group.cjs.entry.js +3 -3
- package/dist/cjs/q-conversation-bubble.cjs.entry.js +1 -1
- package/dist/cjs/q-data-table.cjs.entry.js +1 -1
- package/dist/cjs/q-dialog.cjs.entry.js +3 -3
- package/dist/cjs/q-divider.cjs.entry.js +3 -3
- package/dist/cjs/q-dropdown.cjs.entry.js +4 -4
- package/dist/cjs/q-form.cjs.entry.js +6 -6
- 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 +6 -6
- package/dist/cjs/q-link.cjs.entry.js +2 -2
- package/dist/cjs/q-map.cjs.entry.js +1 -1
- 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 +1 -1
- 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 +4 -4
- package/dist/cjs/q-reel.cjs.entry.js +23 -23
- package/dist/cjs/q-section.cjs.entry.js +2 -2
- package/dist/cjs/q-sidepanel.cjs.entry.js +4 -3
- package/dist/cjs/q-slider.cjs.entry.js +2 -2
- 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 +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 +5 -5
- 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 +6 -6
- package/dist/cjs/q-toolbar.cjs.entry.js +4 -4
- package/dist/cjs/syntax-content-BmSExDiW.js +910 -0
- package/dist/cjs/{tokens-Cd7g-VMz.js → tokens-BMrfol_M.js} +1 -1
- package/dist/cjs/webquark.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/actions/button/button.css +27 -9
- package/dist/collection/components/communication/alert/alert.css +4 -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/components/data-display/syntax-box/internals/{formatter.unit.test.js → 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/components/data-display/syntax-box/internals/{formatter.js → 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/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-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.js +2 -2
- 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/input/input.js +3 -3
- 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.js +1 -1
- package/dist/collection/components/inputs/textarea/textarea.js +2 -2
- package/dist/collection/components/inputs/toggle/toggle.js +3 -3
- package/dist/collection/components/layout/control-group/control-group.js +1 -1
- package/dist/collection/components/layout/divider/divider.js +1 -1
- 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/tokens.js +1 -1
- package/dist/collection/utils/form-control-validity.js +3 -3
- package/dist/components/index.js +1 -1
- package/dist/components/{p-CArIPzJU.js → p-B610wOGe.js} +1 -1
- package/dist/components/p-BGlbV43y.js +13 -0
- package/dist/components/{p-BZXIeEKC.js → p-BKWL9zOn.js} +1 -1
- package/dist/components/p-BxxU73QQ.js +1 -0
- package/dist/components/{p-kfrqZyfJ.js → p-CVEQfA-v.js} +1 -1
- package/dist/components/p-CpbWWDiY.js +1 -0
- package/dist/components/{p-BwPMm43W.js → p-D2fczi8m.js} +1 -1
- package/dist/components/{p-BGHNFaaC.js → p-D5vpGqZ9.js} +1 -1
- package/dist/components/p-DQIYo8zC.js +1 -0
- package/dist/components/{p-IwIJb0Mc.js → p-DX6PCIPS.js} +1 -1
- package/dist/components/{p-CpkX9YAW.js → p-DY9D4z7Z.js} +1 -1
- package/dist/{webquark/p-BDsIecIx.js → components/p-DbzjRzhu.js} +1 -1
- package/dist/components/{p-Bp6Xr92S.js → p-RX4DjgmV.js} +1 -1
- package/dist/components/{p-Bc2_QcLn.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.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-divider.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.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.js +1 -1
- 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-Di_LpF5H.js → action.props-CbSH7c-q.js} +1 -1
- package/dist/esm/{dom-CArIPzJU.js → dom-B610wOGe.js} +1 -1
- package/dist/esm/{field-C4Iilew6.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-DoGM9gsC.js → index-CIMzZPQO.js} +13 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/q-accordion.entry.js +1 -1
- 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 +2 -2
- package/dist/esm/q-chip.entry.js +2 -2
- package/dist/esm/q-control-group.entry.js +3 -3
- package/dist/esm/q-conversation-bubble.entry.js +1 -1
- package/dist/esm/q-data-table.entry.js +1 -1
- package/dist/esm/q-dialog.entry.js +4 -4
- package/dist/esm/q-divider.entry.js +3 -3
- package/dist/esm/q-dropdown.entry.js +4 -4
- package/dist/esm/q-form.entry.js +7 -7
- 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 +7 -7
- package/dist/esm/q-link.entry.js +2 -2
- package/dist/esm/q-map.entry.js +1 -1
- 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 +1 -1
- package/dist/esm/q-panel.entry.js +7 -7
- package/dist/esm/q-quantity-selector.entry.js +5 -5
- 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 +2 -2
- 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 +5 -5
- 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 +6 -6
- package/dist/esm/q-toolbar.entry.js +4 -4
- package/dist/esm/syntax-content-Cr9kSbmA.js +903 -0
- package/dist/esm/{tokens-BDsIecIx.js → tokens-DbzjRzhu.js} +1 -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/token-row.js +45 -74
- package/dist/playground/utils/color.js +14 -25
- 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/formatter.unit.test.d.ts +1 -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/components/data-display/syntax-box/internals/syntax.d.ts +1 -1
- 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/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 +201 -7
- package/dist/types/home/runner/work/WebQuark/WebQuark/.stencil/src/playground/components/theme-designer/token-row.d.ts +1 -1
- package/dist/types/home/runner/work/WebQuark/WebQuark/.stencil/src/playground/dom-factory.d.ts +1 -0
- package/dist/types/home/runner/work/WebQuark/WebQuark/.stencil/src/playground/utils/color.d.ts +2 -8
- package/dist/types/utils/form-control-validity.d.ts +2 -1
- package/dist/webquark/{p-846dc838.entry.js → p-014c2f4a.entry.js} +1 -1
- package/dist/webquark/{p-0182e114.entry.js → p-0389577c.entry.js} +1 -1
- package/dist/webquark/p-041e17c1.entry.js +1 -0
- package/dist/webquark/p-0479c571.entry.js +1 -0
- package/dist/webquark/{p-17b9713f.entry.js → p-0ebca9be.entry.js} +1 -1
- package/dist/webquark/{p-0a2c52de.entry.js → p-1bf375f7.entry.js} +2 -2
- package/dist/webquark/{p-e2721e77.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-f4d23ffe.entry.js → p-3a60086d.entry.js} +1 -1
- package/dist/webquark/{p-e723a7ae.entry.js → p-3ab798aa.entry.js} +1 -1
- package/dist/webquark/{p-15bad9ef.entry.js → p-3b580baf.entry.js} +1 -1
- package/dist/webquark/{p-4609c362.entry.js → p-3b65f787.entry.js} +1 -1
- package/dist/webquark/p-4bf610f8.entry.js +1 -0
- package/dist/webquark/{p-f51e1098.entry.js → p-4d30227e.entry.js} +1 -1
- package/dist/webquark/p-4de536ae.entry.js +1 -0
- package/dist/webquark/{p-3daafc56.entry.js → p-4e4d70c9.entry.js} +1 -1
- package/dist/webquark/p-4efeb7c9.entry.js +1 -0
- package/dist/webquark/{p-a314bc21.entry.js → p-51b3d71b.entry.js} +1 -1
- package/dist/webquark/p-778b6bbb.entry.js +1 -0
- package/dist/webquark/{p-a66550da.entry.js → p-7da78b2f.entry.js} +1 -1
- package/dist/webquark/{p-fe14f038.entry.js → p-7f8f986b.entry.js} +1 -1
- package/dist/webquark/{p-e0943d41.entry.js → p-8253c742.entry.js} +1 -1
- package/dist/webquark/{p-a2334abe.entry.js → p-9a1ddeb7.entry.js} +1 -1
- package/dist/webquark/{p-CArIPzJU.js → p-B610wOGe.js} +1 -1
- 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/webquark/{p-DDUED8LT.js → p-D8p28N9s.js} +1 -1
- package/dist/{components/p-BDsIecIx.js → webquark/p-DbzjRzhu.js} +1 -1
- package/dist/webquark/{p-BOdNg0jc.js → p-DeOEN0si.js} +1 -1
- package/dist/webquark/p-a2b1de23.entry.js +1 -0
- package/dist/webquark/{p-dbcf7592.entry.js → p-a55edc17.entry.js} +1 -1
- package/dist/webquark/p-a8808020.entry.js +1 -0
- package/dist/webquark/{p-9a76cd71.entry.js → p-b1084b3c.entry.js} +1 -1
- package/dist/webquark/{p-a2ff1b64.entry.js → p-b6c4dff4.entry.js} +1 -1
- package/dist/webquark/{p-b21ad707.entry.js → p-b962e950.entry.js} +1 -1
- package/dist/webquark/{p-5b584d3c.entry.js → p-bc369cd6.entry.js} +1 -1
- package/dist/webquark/p-c119a8ea.entry.js +1 -0
- package/dist/webquark/{p-85131314.entry.js → p-c6b77e9a.entry.js} +1 -1
- package/dist/webquark/{p-84b350a3.entry.js → p-ca1c03b4.entry.js} +1 -1
- package/dist/webquark/{p-b8fdef4f.entry.js → p-ce436162.entry.js} +1 -1
- package/dist/webquark/{p-86c05afd.entry.js → p-d0a47a7c.entry.js} +1 -1
- package/dist/webquark/{p-222405b8.entry.js → p-e1fbc8fc.entry.js} +1 -1
- package/dist/webquark/{p-44bbe12f.entry.js → p-e32833ce.entry.js} +1 -1
- package/dist/webquark/{p-d86bd51d.entry.js → p-e369a4aa.entry.js} +1 -1
- package/dist/webquark/p-e4430c61.entry.js +1 -0
- package/dist/webquark/{p-aa342e81.entry.js → p-e9c0052b.entry.js} +1 -1
- package/dist/webquark/{p-852e88ae.entry.js → p-f5c4ca18.entry.js} +1 -1
- package/dist/webquark/{p-d4788321.entry.js → p-f6683126.entry.js} +1 -1
- package/dist/webquark/{p-Dnz3WmdX.js → p-ojSDiptZ.js} +1 -1
- package/dist/webquark/webquark.css +1 -1
- package/dist/webquark/webquark.esm.js +1 -1
- package/package.json +5 -1
- 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-Bj2RJb2E.js +0 -1
- package/dist/components/p-D2nxHd1b.js +0 -1
- package/dist/components/p-x3C-wjU9.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/components/data-display/syntax-box/internals/formatter.d.ts +0 -15
- package/dist/webquark/p-048103e0.entry.js +0 -1
- package/dist/webquark/p-0baf478a.entry.js +0 -1
- package/dist/webquark/p-2eaa3a9f.entry.js +0 -1
- package/dist/webquark/p-65fe9cac.entry.js +0 -1
- package/dist/webquark/p-8c5b2706.entry.js +0 -1
- package/dist/webquark/p-923527f0.entry.js +0 -1
- package/dist/webquark/p-Bj2RJb2E.js +0 -1
- package/dist/webquark/p-DoGM9gsC.js +0 -3
- package/dist/webquark/p-a0d97367.entry.js +0 -1
- package/dist/webquark/p-a16bd8d5.entry.js +0 -13
- package/dist/webquark/p-a3e1096d.entry.js +0 -1
- package/dist/webquark/p-b1c771fb.entry.js +0 -1
- package/dist/webquark/p-b45ca926.entry.js +0 -1
- package/dist/webquark/p-eb800d1e.entry.js +0 -1
- /package/dist/{types/components/data-display/syntax-box/internals/formatter.unit.test.d.ts → collection/components/data-display/syntax-box/internals/formatters/formatter.types.js} +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { Braces, Check, Copy } from "@lucide/icons";
|
|
3
|
+
export function renderSyntaxActions(actions) {
|
|
4
|
+
return (h("div", { class: "panel-actions", ref: actions.ref }, h("slot", { name: "actions" }), actions.editable && actions.formatLabel && (h("q-button", { class: "format-btn", ariaLabel: actions.formatLabel, variant: "ghost", size: "sm", disabled: actions.disabled, onClick: actions.onFormat }, h("q-icon", { slot: "icon-left", definition: Braces, name: "braces", size: "sm" }), h("q-tooltip", { slot: "icon-left", position: "bottom", content: actions.formatLabel }))), actions.copyable && (h("q-button", { variant: "ghost", size: "sm", ariaLabel: actions.copyFeedback, disabled: actions.disabled, onClick: actions.onCopy }, h("q-icon", { slot: "icon-left", definition: actions.copied ? Check : Copy, name: actions.copied ? 'check' : 'copy', size: "sm" }), h("q-tooltip", { slot: "icon-left", position: "bottom", content: actions.copyFeedback })))));
|
|
5
|
+
}
|
|
6
|
+
export function renderSyntaxScroller(body, height, ref) {
|
|
7
|
+
return h("q-scrollable", { height: height, ref: ref }, body);
|
|
8
|
+
}
|
|
@@ -9,8 +9,8 @@ export const INVALID_JSON = [
|
|
|
9
9
|
['short Unicode escape', '"\\u123"'], ['raw string newline', '"keep\r\nline"'],
|
|
10
10
|
['BOM', '\ufeff{"a":1}'], ['whitespace only', ' \t\r\n '],
|
|
11
11
|
];
|
|
12
|
-
export const
|
|
13
|
-
['html', '<p>Hello <b>world</b> !</p>\r\n<pre> keep \t spaces\r\n</pre><!-- keep comment -->'],
|
|
12
|
+
export const NON_JSON_SOURCE = [
|
|
13
|
+
['html', '<p class="message">Hello <b>world</b> !</p>\r\n<pre> keep \t spaces\r\n</pre><!-- keep comment -->'],
|
|
14
14
|
['javascript', '// keep\r\nfunction f(){return\n"x";} const t = ` a ${1}\r\n b;{} `; /[{};]/.test(t);'],
|
|
15
15
|
['css', '/* keep */\r\n.a { content: " x; { y } "; --text: a b; }\r\n'],
|
|
16
16
|
];
|
|
@@ -4,8 +4,8 @@ import { page } from "vitest/browser";
|
|
|
4
4
|
import { defineCustomElements } from "../../../../../../packages/browser/components/dist/loader";
|
|
5
5
|
// @ts-ignore - real guide previews use the production theme.
|
|
6
6
|
import "../../../../../../packages/browser/components/dist/webquark/webquark.css";
|
|
7
|
-
import { INVALID_JSON, JSON_EXPECTED, JSON_SOURCE, jsonTokens,
|
|
8
|
-
import { MAX_JSON_FORMAT_DEPTH } from "../internals/
|
|
7
|
+
import { INVALID_JSON, JSON_EXPECTED, JSON_SOURCE, jsonTokens, NON_JSON_SOURCE } from "./format-fixtures";
|
|
8
|
+
import { MAX_JSON_FORMAT_DEPTH } from "../internals/formatters/json";
|
|
9
9
|
import { normalizeDomNewlines } from "./syntax-fixtures";
|
|
10
10
|
defineCustomElements();
|
|
11
11
|
afterEach(() => { document.body.replaceChildren(); document.body.style.margin = ''; vi.restoreAllMocks(); });
|
|
@@ -82,21 +82,15 @@ describe('built syntax-box explicit safe formatting', () => {
|
|
|
82
82
|
await exact(el, '{"valid":1}');
|
|
83
83
|
expect(el.shadowRoot.querySelector('.format-feedback')).toBeNull();
|
|
84
84
|
});
|
|
85
|
-
it.each(
|
|
85
|
+
it.each(NON_JSON_SOURCE)('offers an explicit %s Format action', async (language, source) => {
|
|
86
86
|
const { el } = await create({ language, code: source });
|
|
87
87
|
const observed = events(el);
|
|
88
88
|
const button = await action(el);
|
|
89
|
-
expect(button.disabled).toBe(
|
|
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));
|
|
89
|
+
expect(button.disabled).toBe(false);
|
|
99
90
|
expect(el.shadowRoot.querySelector('.format-feedback')).toBeNull();
|
|
91
|
+
button.click();
|
|
92
|
+
await vi.waitFor(() => expect(observed.map(event => event.type)).toEqual(['qInput', 'qChange']));
|
|
93
|
+
expect(el.code).not.toBe(source);
|
|
100
94
|
});
|
|
101
95
|
it('keeps over-depth JSON intact with bounded-format feedback', async () => {
|
|
102
96
|
const source = '['.repeat(MAX_JSON_FORMAT_DEPTH + 1) + '-0' + ']'.repeat(MAX_JSON_FORMAT_DEPTH + 1);
|
|
@@ -129,16 +123,22 @@ describe('built syntax-box explicit safe formatting', () => {
|
|
|
129
123
|
await exact(el, '{\n "10": 9007199254740993,\n "2": -0,\n "same": 1,\n "same": 2\n}');
|
|
130
124
|
await page.elementLocator(el).screenshot({ path: 'docs/components/assets/q-syntax-box-format-json.png' });
|
|
131
125
|
});
|
|
132
|
-
it('
|
|
126
|
+
it('formats a JavaScript template literal without losing its inner spaces', async () => {
|
|
133
127
|
await page.viewport(800, 700);
|
|
134
128
|
document.body.style.margin = '20px';
|
|
135
|
-
const { el } = await create({
|
|
129
|
+
const { el } = await create({
|
|
130
|
+
code: 'const message=`keep spaces; { braces }`',
|
|
131
|
+
language: 'javascript',
|
|
132
|
+
heading: 'Literal JavaScript',
|
|
133
|
+
ariaLabel: 'Literal JavaScript source',
|
|
134
|
+
height: '110px',
|
|
135
|
+
});
|
|
136
136
|
el.style.width = '560px';
|
|
137
|
-
|
|
138
|
-
await exact(el, 'const message = `keep spaces; { braces }
|
|
139
|
-
await page.elementLocator(el).screenshot({ path: 'docs/components/assets/q-syntax-box-format-
|
|
137
|
+
(await action(el)).click();
|
|
138
|
+
await exact(el, 'const message = `keep spaces; { braces }`;\n');
|
|
139
|
+
await page.elementLocator(el).screenshot({ path: 'docs/components/assets/q-syntax-box-format-javascript.png' });
|
|
140
140
|
});
|
|
141
|
-
it('
|
|
141
|
+
it('submits the original JavaScript until Format is used', async () => {
|
|
142
142
|
await page.viewport(800, 700);
|
|
143
143
|
document.body.style.margin = '20px';
|
|
144
144
|
const { el, form } = await create({ code: 'const ready = true;', language: 'javascript', height: '110px', name: 'template', required: true, ariaLabel: 'Template code' });
|
|
@@ -151,7 +151,7 @@ describe('built syntax-box explicit safe formatting', () => {
|
|
|
151
151
|
form.addEventListener('submit', event => { event.preventDefault(); output.textContent = String(new FormData(form).get('template')); });
|
|
152
152
|
submit.click();
|
|
153
153
|
expect(output.textContent).toBe('const ready = true;');
|
|
154
|
-
expect((await action(el)).disabled).toBe(
|
|
154
|
+
expect((await action(el)).disabled).toBe(false);
|
|
155
155
|
await page.elementLocator(form).screenshot({ path: 'docs/components/assets/q-syntax-box-submit-code.png' });
|
|
156
156
|
});
|
|
157
157
|
});
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
2
|
+
import { page, userEvent } from "vitest/browser";
|
|
3
|
+
// @ts-ignore - exercise the same generated component loader as an application.
|
|
4
|
+
import { defineCustomElements } from "../../../../../../packages/browser/components/dist/loader";
|
|
5
|
+
// @ts-ignore - visibility and focus need the component theme.
|
|
6
|
+
import "../../../../../../packages/browser/components/dist/webquark/webquark.css";
|
|
7
|
+
defineCustomElements();
|
|
8
|
+
afterEach(() => {
|
|
9
|
+
document.body.replaceChildren();
|
|
10
|
+
vi.restoreAllMocks();
|
|
11
|
+
});
|
|
12
|
+
async function mountBox(markup) {
|
|
13
|
+
document.body.innerHTML = markup;
|
|
14
|
+
const box = document.querySelector('q-syntax-box');
|
|
15
|
+
await box.componentOnReady();
|
|
16
|
+
await Promise.all(Array.from(box.querySelectorAll('q-syntax-view'), view => view.componentOnReady()));
|
|
17
|
+
return box;
|
|
18
|
+
}
|
|
19
|
+
const tab = (name, selected) => page.getByRole('tab', { name, exact: true, selected });
|
|
20
|
+
async function expectTabs(...labels) {
|
|
21
|
+
await vi.waitFor(() => {
|
|
22
|
+
expect(page.getByRole('tab').elements().map(element => element.textContent?.trim())).toEqual(labels);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
describe('q-syntax-box composed views', () => {
|
|
26
|
+
it('renders standalone content and a single child directly, then adds tabs for a second child', async () => {
|
|
27
|
+
await mountBox('<q-syntax-box heading="Source" code="standalone"></q-syntax-box>');
|
|
28
|
+
await expect.element(page.getByText('standalone', { exact: true })).toBeVisible();
|
|
29
|
+
await expectTabs();
|
|
30
|
+
const box = await mountBox(`
|
|
31
|
+
<form>
|
|
32
|
+
<q-syntax-box heading="Output">
|
|
33
|
+
<q-button slot="actions">Box action</q-button>
|
|
34
|
+
<q-syntax-view heading="Example HTML" view-key="html" code="first"></q-syntax-view>
|
|
35
|
+
</q-syntax-box>
|
|
36
|
+
</form>
|
|
37
|
+
`);
|
|
38
|
+
await expect.element(page.getByText('first', { exact: true })).toBeVisible();
|
|
39
|
+
await expectTabs();
|
|
40
|
+
const events = document.createElement('q-syntax-view');
|
|
41
|
+
events.heading = 'Events';
|
|
42
|
+
box.append(events);
|
|
43
|
+
await expectTabs('Example HTML', 'Events');
|
|
44
|
+
await expect.element(tab('Example HTML', true)).toBeVisible();
|
|
45
|
+
await tab('Events').click();
|
|
46
|
+
box.closest('form').reset();
|
|
47
|
+
await expectTabs('Example HTML', 'Events');
|
|
48
|
+
await expect.element(tab('Events', true)).toBeVisible();
|
|
49
|
+
events.remove();
|
|
50
|
+
await expect.element(page.getByText('first', { exact: true })).toBeVisible();
|
|
51
|
+
await expectTabs();
|
|
52
|
+
});
|
|
53
|
+
it.each(['code=""', 'value=""', 'editable'])('counts the explicitly empty parent %s, with ordinary and empty child views', async (parentSource) => {
|
|
54
|
+
await mountBox(`
|
|
55
|
+
<q-syntax-box heading="Parent" ${parentSource}>
|
|
56
|
+
<q-syntax-view heading="First" code="sample"></q-syntax-view>
|
|
57
|
+
<q-syntax-view heading="Second"></q-syntax-view>
|
|
58
|
+
</q-syntax-box>
|
|
59
|
+
`);
|
|
60
|
+
await expectTabs('Parent', 'First', 'Second');
|
|
61
|
+
await expect.element(tab('Parent', true)).toBeVisible();
|
|
62
|
+
});
|
|
63
|
+
it('keeps the edited field, caret and committed value across keyboard tab changes', async () => {
|
|
64
|
+
const box = await mountBox(`
|
|
65
|
+
<q-syntax-box variant="plain">
|
|
66
|
+
<q-syntax-view heading="Draft" editable code="initial"></q-syntax-view>
|
|
67
|
+
<q-syntax-view heading="Events">Recorded</q-syntax-view>
|
|
68
|
+
</q-syntax-box>
|
|
69
|
+
`);
|
|
70
|
+
const changes = vi.fn();
|
|
71
|
+
box.addEventListener('qChange', changes);
|
|
72
|
+
const field = page.getByRole('textbox', { name: 'Draft' });
|
|
73
|
+
await field.fill('edited draft');
|
|
74
|
+
const textarea = field.element();
|
|
75
|
+
textarea.setSelectionRange(2, 5);
|
|
76
|
+
await tab('Draft').click();
|
|
77
|
+
await userEvent.keyboard('{ArrowRight}');
|
|
78
|
+
await expect.element(tab('Events', true)).toBeVisible();
|
|
79
|
+
await expect.element(page.getByText('Recorded', { exact: true })).toBeVisible();
|
|
80
|
+
expect(field.elements()).toHaveLength(0);
|
|
81
|
+
expect(textarea.isConnected).toBe(true);
|
|
82
|
+
await userEvent.keyboard('{Home}');
|
|
83
|
+
await vi.waitFor(() => expect(tab('Draft').element().matches(':focus')).toBe(true));
|
|
84
|
+
await expect.element(field).toHaveValue('edited draft');
|
|
85
|
+
expect(field.element()).toBe(textarea);
|
|
86
|
+
expect([textarea.selectionStart, textarea.selectionEnd]).toEqual([2, 5]);
|
|
87
|
+
expect(changes.mock.calls.map(([event]) => event.detail)).toEqual(['edited draft']);
|
|
88
|
+
expect(box.code).toBeUndefined();
|
|
89
|
+
});
|
|
90
|
+
it('preserves view identity through duplicate labels, renames, reordering and removal', async () => {
|
|
91
|
+
const box = await mountBox(`
|
|
92
|
+
<q-syntax-box>
|
|
93
|
+
<q-syntax-view heading="Same" view-key="one" code="first body"></q-syntax-view>
|
|
94
|
+
<q-syntax-view heading="Same" view-key="two" code="second body"></q-syntax-view>
|
|
95
|
+
<q-syntax-view heading="Last" code="third body"></q-syntax-view>
|
|
96
|
+
</q-syntax-box>
|
|
97
|
+
`);
|
|
98
|
+
await expectTabs('Same', 'Same', 'Last');
|
|
99
|
+
await tab('Same').nth(1).click();
|
|
100
|
+
const [first, second, third] = Array.from(box.querySelectorAll('q-syntax-view'));
|
|
101
|
+
second.heading = 'Renamed';
|
|
102
|
+
box.prepend(third);
|
|
103
|
+
await expectTabs('Last', 'Same', 'Renamed');
|
|
104
|
+
await expect.element(tab('Renamed', true)).toBeVisible();
|
|
105
|
+
await expect.element(page.getByText('second body', { exact: true })).toBeVisible();
|
|
106
|
+
second.remove();
|
|
107
|
+
await expect.element(tab('Same', true)).toBeVisible();
|
|
108
|
+
await expect.element(page.getByText('first body', { exact: true })).toBeVisible();
|
|
109
|
+
first.remove();
|
|
110
|
+
await expectTabs();
|
|
111
|
+
await expect.element(page.getByText('third body', { exact: true })).toBeVisible();
|
|
112
|
+
});
|
|
113
|
+
it('keeps nested tab sets independent and associates each active tab with its named panel', async () => {
|
|
114
|
+
await mountBox(`
|
|
115
|
+
<q-syntax-box>
|
|
116
|
+
<q-syntax-view heading="Code" view-key="code" code="outer"></q-syntax-view>
|
|
117
|
+
<q-syntax-view heading="Nested" view-key="nested">
|
|
118
|
+
<q-syntax-box>
|
|
119
|
+
<q-syntax-view heading="Inner code" view-key="code" code="inner"></q-syntax-view>
|
|
120
|
+
<q-syntax-view heading="Inner events" view-key="events"></q-syntax-view>
|
|
121
|
+
</q-syntax-box>
|
|
122
|
+
</q-syntax-view>
|
|
123
|
+
</q-syntax-box>
|
|
124
|
+
`);
|
|
125
|
+
await expectTabs('Code', 'Nested');
|
|
126
|
+
await tab('Nested').click();
|
|
127
|
+
await tab('Inner events').click();
|
|
128
|
+
for (const name of ['Nested', 'Inner events']) {
|
|
129
|
+
await expect.element(tab(name, true)).toBeVisible();
|
|
130
|
+
const panel = page.getByRole('tabpanel', { name, exact: true });
|
|
131
|
+
await expect.element(panel).toBeVisible();
|
|
132
|
+
await vi.waitFor(() => {
|
|
133
|
+
const selectedTab = tab(name).element();
|
|
134
|
+
expect(selectedTab.ariaControlsElements).toContain(panel.element());
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
await tab('Code').click();
|
|
138
|
+
await expectTabs('Code', 'Nested');
|
|
139
|
+
await tab('Nested').click();
|
|
140
|
+
await expect.element(tab('Inner events', true)).toBeVisible();
|
|
141
|
+
});
|
|
142
|
+
it('keeps Copy data and delayed feedback on the originating view', async () => {
|
|
143
|
+
const box = await mountBox('<q-syntax-box heading="Source" copyable>own text<q-button slot="actions">Unrelated action</q-button><q-syntax-view heading="Other" copyable code="second source"></q-syntax-view></q-syntax-box>');
|
|
144
|
+
await expectTabs('Source', 'Other');
|
|
145
|
+
let finishCopy;
|
|
146
|
+
const pending = new Promise(resolve => { finishCopy = resolve; });
|
|
147
|
+
const clipboard = vi.spyOn(navigator.clipboard, 'writeText').mockReturnValue(pending);
|
|
148
|
+
await page.getByRole('button', { name: 'Copy', exact: true }).click();
|
|
149
|
+
expect(clipboard).toHaveBeenCalledWith('own text');
|
|
150
|
+
await tab('Other').click();
|
|
151
|
+
finishCopy();
|
|
152
|
+
await expect.element(page.getByRole('button', { name: 'Copy', exact: true })).toBeVisible();
|
|
153
|
+
await tab('Source').click();
|
|
154
|
+
await expect.element(page.getByRole('button', { name: 'Copied!', exact: true })).toBeVisible();
|
|
155
|
+
expect(box.querySelector('q-syntax-view').code).toBe('second source');
|
|
156
|
+
});
|
|
157
|
+
it('submits each named native form field once and resets the inactive editor', async () => {
|
|
158
|
+
const box = await mountBox(`
|
|
159
|
+
<form><fieldset><q-syntax-box name="container">
|
|
160
|
+
<q-syntax-view heading="One" view-key="first-tab" editable name="source" code="a"></q-syntax-view>
|
|
161
|
+
<q-syntax-view heading="Two" view-key="second-tab" editable name="source" code="b"></q-syntax-view>
|
|
162
|
+
<q-syntax-view heading="Disabled" editable disabled name="disabled" code="omit"></q-syntax-view>
|
|
163
|
+
</q-syntax-box></fieldset></form>
|
|
164
|
+
`);
|
|
165
|
+
const form = box.closest('form');
|
|
166
|
+
const [first, second] = Array.from(box.querySelectorAll('q-syntax-view'));
|
|
167
|
+
await expectTabs('One', 'Two', 'Disabled');
|
|
168
|
+
await page.getByRole('textbox', { name: 'One' }).fill('edited');
|
|
169
|
+
await tab('Two').click();
|
|
170
|
+
await page.getByRole('textbox', { name: 'Two' }).fill('also edited');
|
|
171
|
+
const data = new FormData(form);
|
|
172
|
+
expect(data.getAll('source')).toEqual(['edited', 'also edited']);
|
|
173
|
+
expect(data.has('container')).toBe(false);
|
|
174
|
+
expect(data.has('disabled')).toBe(false);
|
|
175
|
+
const fieldset = form.querySelector('fieldset');
|
|
176
|
+
fieldset.disabled = true;
|
|
177
|
+
expect(new FormData(form).has('source')).toBe(false);
|
|
178
|
+
fieldset.disabled = false;
|
|
179
|
+
expect(new FormData(form).getAll('source')).toEqual(['edited', 'also edited']);
|
|
180
|
+
form.reset();
|
|
181
|
+
await vi.waitFor(() => expect([first.code, second.code]).toEqual(['a', 'b']));
|
|
182
|
+
await expectTabs('One', 'Two', 'Disabled');
|
|
183
|
+
await expect.element(tab('Two', true)).toBeVisible();
|
|
184
|
+
});
|
|
185
|
+
it('uses view fields in q-form and reveals an inactive invalid editor only when reporting', async () => {
|
|
186
|
+
await mountBox(`
|
|
187
|
+
<q-form><q-syntax-box name="output">
|
|
188
|
+
<q-syntax-view heading="Draft" editable name="draft" code="initial"></q-syntax-view>
|
|
189
|
+
<q-syntax-view heading="Required" editable required name="source"></q-syntax-view>
|
|
190
|
+
</q-syntax-box></q-form>
|
|
191
|
+
`);
|
|
192
|
+
const form = document.querySelector('q-form');
|
|
193
|
+
await form.componentOnReady();
|
|
194
|
+
await expectTabs('Draft', 'Required');
|
|
195
|
+
expect(await form.getValues()).toEqual({ draft: 'initial', source: '' });
|
|
196
|
+
expect(await form.checkValidity()).toBe(false);
|
|
197
|
+
await expect.element(tab('Draft', true)).toBeVisible();
|
|
198
|
+
expect(await form.reportValidity()).toBe(false);
|
|
199
|
+
await expect.element(tab('Required', true)).toBeVisible();
|
|
200
|
+
await page.getByRole('textbox', { name: 'Required' }).fill('ready');
|
|
201
|
+
expect(await form.checkValidity()).toBe(true);
|
|
202
|
+
await form.resetForm();
|
|
203
|
+
expect(await form.getValues()).toEqual({ draft: 'initial', source: '' });
|
|
204
|
+
await expectTabs('Draft', 'Required');
|
|
205
|
+
});
|
|
206
|
+
it.each(['reportValidity', 'requestSubmit'])('reveals the invalid view during native %s', async (action) => {
|
|
207
|
+
const box = await mountBox(`
|
|
208
|
+
<form><q-syntax-box>
|
|
209
|
+
<q-syntax-view heading="Preview" code="source"></q-syntax-view>
|
|
210
|
+
<q-syntax-view heading="Editor" editable required name="source"></q-syntax-view>
|
|
211
|
+
</q-syntax-box></form>
|
|
212
|
+
`);
|
|
213
|
+
const form = box.closest('form');
|
|
214
|
+
await expectTabs('Preview', 'Editor');
|
|
215
|
+
expect(form.checkValidity()).toBe(false);
|
|
216
|
+
await expect.element(tab('Preview', true)).toBeVisible();
|
|
217
|
+
const submit = vi.fn((event) => event.preventDefault());
|
|
218
|
+
form.addEventListener('submit', submit);
|
|
219
|
+
if (action === 'reportValidity')
|
|
220
|
+
expect(form.reportValidity()).toBe(false);
|
|
221
|
+
else
|
|
222
|
+
form.requestSubmit();
|
|
223
|
+
await expect.element(tab('Editor', true)).toBeVisible();
|
|
224
|
+
const editor = page.getByRole('textbox', { name: 'Editor' });
|
|
225
|
+
await vi.waitFor(() => expect(editor.element().matches(':focus')).toBe(true));
|
|
226
|
+
expect(submit).not.toHaveBeenCalled();
|
|
227
|
+
});
|
|
228
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Host, Mixin, h } from "@stencil/core";
|
|
2
|
+
import { withSyntaxContent } from "../syntax-box/syntax-content";
|
|
3
|
+
import { syntaxOwner } from "../syntax-box/internals/views";
|
|
4
|
+
/**
|
|
5
|
+
* Displays one editable or read-only view, on its own or as a child of a Syntax Box.
|
|
6
|
+
* @slot - Read-only content when code is omitted.
|
|
7
|
+
* @slot actions - Actions for this view.
|
|
8
|
+
*/
|
|
9
|
+
export class QSyntaxView extends Mixin(withSyntaxContent) {
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
}
|
|
13
|
+
el;
|
|
14
|
+
internals;
|
|
15
|
+
/** Optional identity for preserving selection when replacing a view element. */
|
|
16
|
+
viewKey;
|
|
17
|
+
render() {
|
|
18
|
+
const owner = syntaxOwner(this.el);
|
|
19
|
+
const variant = owner?.variant ?? this.variant;
|
|
20
|
+
if (owner) {
|
|
21
|
+
return h(Host, { class: "embedded-view" }, variant === 'panel' && this.renderActions(), this.renderContent(variant));
|
|
22
|
+
}
|
|
23
|
+
return h(Host, null, h("div", { class: variant === 'panel' ? 'panel-container syntax-layout' : 'plain-container syntax-layout' }, variant === 'panel' && h("div", { class: "panel-header" }, h("span", null, this.heading)), variant === 'panel' && this.renderActions(), this.renderContent(variant)));
|
|
24
|
+
}
|
|
25
|
+
static get is() { return "q-syntax-view"; }
|
|
26
|
+
static get encapsulation() { return "shadow"; }
|
|
27
|
+
static get delegatesFocus() { return true; }
|
|
28
|
+
static get formAssociated() { return true; }
|
|
29
|
+
static get originalStyleUrls() {
|
|
30
|
+
return {
|
|
31
|
+
"$": ["../syntax-box/syntax-box.css"]
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
static get styleUrls() {
|
|
35
|
+
return {
|
|
36
|
+
"$": ["../syntax-box/syntax-box.css"]
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
static get properties() {
|
|
40
|
+
return {
|
|
41
|
+
"viewKey": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"mutable": false,
|
|
44
|
+
"complexType": {
|
|
45
|
+
"original": "string",
|
|
46
|
+
"resolved": "string",
|
|
47
|
+
"references": {}
|
|
48
|
+
},
|
|
49
|
+
"required": false,
|
|
50
|
+
"optional": true,
|
|
51
|
+
"docs": {
|
|
52
|
+
"tags": [],
|
|
53
|
+
"text": "Optional identity for preserving selection when replacing a view element."
|
|
54
|
+
},
|
|
55
|
+
"getter": false,
|
|
56
|
+
"setter": false,
|
|
57
|
+
"reflect": true,
|
|
58
|
+
"attribute": "view-key"
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
static get elementRef() { return "el"; }
|
|
63
|
+
static get attachInternalsMemberName() { return "internals"; }
|
|
64
|
+
}
|
|
@@ -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: '16a7d86040c706fa80c81771fbf47c53efbedd7e', 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: 'a5bae169f2613928be95ded5bef5644f3f382b6f', 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: 'd6812cba0645647a7bec4bdd645fe2702dbc9f3b', class: { 'step-item': true, [`orientation-${orientation}`]: true } }, h("div", { key: '21ba4a08e5f54511a57e2f197954a75b7ce99bdd', class: "step-line-container" }, h("div", { key: 'ceb41b031624ca88fb1dd3929aba178540f9b333', class: "step-badge", "aria-hidden": "true", part: "badge" }, h("slot", { key: '06ffa5adba0ece2374574ed9e570a48cba1f7609', name: "badge" }, h("div", { key: '5dc64cb8e275f601f620208af6b1ce077cfe0111', class: "badge-dot" }))), h("div", { key: '478699b043fdc4703c0ed8a4be134adfbbe400a4', class: "step-connector", part: "connector" })), h("div", { key: 'f7b639e73daf75240b5d9d842d388812b738f279', 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: '19e05789e710e014d128f8916e794fdead46c2b4', class: "step-title", part: "title" }, h("slot", { key: '8db9ab2894647d3ea040d710c436c7e6cfbc5420', name: "title" })), h("div", { key: 'bfa7dfe730a4a5ddbccdc236fc46d0597aadfdfe', class: "step-body", part: "body" }, h("slot", { key: '064fb46dfdb558b8dbce9519fdb51886fff5d405' })))));
|
|
40
40
|
}
|
|
41
41
|
static get is() { return "q-step-diagram-item"; }
|
|
42
42
|
static get encapsulation() { return "shadow"; }
|
|
@@ -741,12 +741,12 @@ export class QDropdown {
|
|
|
741
741
|
const displayLabel = selectedLabel || this.placeholder;
|
|
742
742
|
const hasSelection = selectedOption !== undefined || Boolean(this.externalSearch && this.selectedLabelCache?.value === this.value);
|
|
743
743
|
const ariaLabel = this.ariaLabel?.trim() || undefined;
|
|
744
|
-
return (h("div", { key: '
|
|
744
|
+
return (h("div", { key: 'e370fa24a234615e5ef77cb172709bfeb9d5e90d', style: feedbackStyle(this.reserveFeedback), class: {
|
|
745
745
|
'dropdown-wrapper': true,
|
|
746
746
|
'is-open': this.isOpen,
|
|
747
747
|
'is-disabled': this.isDisabled,
|
|
748
748
|
[`size-${this.size}`]: true
|
|
749
|
-
}, onKeyDown: this.handleKeyDown, onFocusout: this.handleFocusOut }, this.label && (h("label", { key: '
|
|
749
|
+
}, onKeyDown: this.handleKeyDown, onFocusout: this.handleFocusOut }, this.label && (h("label", { key: '4ada73143b430d0d9a2f854cd9c3c8e784753ff8', class: { 'dropdown-label': true, 'q-label-hidden': this.labelHidden }, htmlFor: "q-field", part: "label" }, this.label)), this.width === 'fit-options' && (h("span", { key: 'a409eeaa7ee55ea5ec01a138d9084f52930fc2fe', class: "fit-options-clip", "aria-hidden": "true" }, h("span", { key: '9e46b189537a80386e4bdf8dbf139239d364d859', class: "dropdown-trigger fit-options-measure", ref: el => (this.fitOptionsMeasure = el) }, h("span", { key: '48a1dea8e9a01b83faa0c90e8189e130f63080a5', class: "fit-options-labels" }, (allOptions.length ? allOptions.map(option => this.getOptionLabel(option)) : [selectedLabel || this.placeholder]).map(text => h("span", null, text))), h("span", { key: 'ed06556458c71d1669ad6d9c9ff2c5cbffdddb34', class: "chevron-icon" })))), this.multiple ? h("div", { class: "dropdown-trigger multiple-trigger", part: "trigger", ref: el => this.multipleFrame = el }, h("slot", { name: "icon-left", onSlotchange: this.measureMultipleLayout }), this.selectedValues.slice(0, this.visibleChips).map(value => h("q-chip", { key: value, size: "sm", removable: true, label: this.multipleLabels.get(value) ?? value, value: value, disabled: this.isDisabled, onQRemove: event => this.removeValue(value, event) })), this.visibleChips < this.selectedValues.length && h("button", { type: "button", class: "multiple-more", disabled: this.isDisabled, "aria-haspopup": "dialog", "aria-expanded": this.selectedPanel && this.isOpen ? 'true' : 'false', "aria-controls": this.selectedPanel && this.isOpen ? 'q-field-menu' : undefined, "aria-label": `${this.selectedValues.length - this.visibleChips} more selected options`, onClick: this.openSelectedPanel }, "+", this.selectedValues.length - this.visibleChips, " more"), h("input", { ref: el => this.triggerEl = el, id: "q-field", class: "multiple-input", type: "text", role: "combobox", autocomplete: "off", disabled: this.isDisabled, value: this.searchTerm, placeholder: this.selectedValues.length ? 'Search…' : this.placeholder, onClick: this.handleEditableClick, onInput: this.handleSearchInput, onFocus: this.handleFocus, onBlur: this.handleBlur, onCompositionstart: this.handleCompositionStart, onCompositionend: this.handleCompositionEnd, "aria-label": ariaLabel, "aria-autocomplete": "list", "aria-haspopup": "listbox", "aria-required": this.required ? 'true' : 'false', "aria-invalid": this.error || this.required && !this.getMultipleFormSelection().length ? 'true' : 'false', "aria-describedby": this.error || this.description ? 'q-field-error' : undefined, "aria-expanded": this.isOpen && !this.selectedPanel ? 'true' : 'false', "aria-controls": this.isOpen && !this.selectedPanel ? 'q-field-menu' : undefined, "aria-activedescendant": this.isOpen && !this.selectedPanel && this.focusedIndex >= 0 ? `q-field-item-${this.focusedIndex}` : undefined }), h("svg", { class: "chevron-icon", "aria-hidden": "true", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("polyline", { points: "6 9 12 15 18 9" })), h("span", { class: "multiple-measure", "aria-hidden": "true", inert: true, ref: el => this.chipMeasure = el }, this.selectedValues.map(value => h("q-chip", { key: value, size: "sm", removable: true, label: this.multipleLabels.get(value) ?? value })), h("button", { type: "button", class: "multiple-more", tabindex: -1 }, "+", this.selectedValues.length, " more"))) : this.editableSearch ? h("div", { class: { 'editable-trigger': true, 'has-leading-icon': Boolean(this.el.querySelector('[slot="icon-left"]')) } }, h("span", { class: "editable-leading" }, h("slot", { name: "icon-left", onSlotchange: this.observeFitOptions })), h("input", { ref: el => (this.triggerEl = el), id: "q-field", class: "dropdown-trigger dropdown-main-input", part: "trigger", type: "text", role: "combobox", autocomplete: "off", disabled: this.isDisabled, value: this.composing ? this.triggerEl?.value ?? selectedLabel : this.draftEdited ? this.searchTerm : selectedLabel, placeholder: this.placeholder, onClick: this.handleEditableClick, onFocus: this.handleFocus, onBlur: this.handleBlur, onInput: this.handleSearchInput, onCompositionstart: this.handleCompositionStart, onCompositionend: this.handleCompositionEnd, "aria-autocomplete": "list", "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("svg", { class: "chevron-icon", "aria-hidden": "true", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("polyline", { points: "6 9 12 15 18 9" }))) : h("button", { 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", { class: "trigger-content" }, h("slot", { name: "icon-left", onSlotchange: this.observeFitOptions }), h("span", { class: { 'trigger-text': true, 'is-placeholder': !hasSelection } }, displayLabel)), h("svg", { class: "chevron-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("polyline", { points: "6 9 12 15 18 9" }))), fieldFeedback('q-field-error', this.error, this.description), this.isOpen && (h("div", { key: '857a01352aa02d4699d344e22d1257f1759b3d8f', ref: (el) => (this.menuEl = el), id: "q-field-menu", class: "dropdown-menu", part: "menu", role: this.selectedPanel ? 'dialog' : 'listbox', popover: "manual", "aria-label": this.selectedPanel ? 'Selected options' : ariaLabel || this.label || 'Options', "aria-multiselectable": this.multiple && !this.selectedPanel ? 'true' : undefined }, this.selectedPanel ? h("div", { class: "selected-options" }, h("strong", null, "Selected options"), this.selectedValues.map(value => h("q-chip", { key: value, size: "sm", removable: true, label: this.multipleLabels.get(value) ?? value, value: value, disabled: this.isDisabled, onQRemove: event => this.removeValue(value, event) })), h("button", { type: "button", class: "multiple-more", onClick: () => { this.closeMenu(); focusWithoutScroll(this.triggerEl); } }, "Done")) : h(Fragment, null, this.searchable && !this.editableSearch && (h("div", { class: "dropdown-search-container" }, h("input", { ref: (el) => (this.searchInputEl = el), type: "text", class: "dropdown-search-input", placeholder: "Search...", value: this.searchTerm, onInput: this.handleSearchInput, onCompositionstart: this.handleCompositionStart, onCompositionend: this.handleCompositionEnd, "aria-label": ariaLabel || this.label || 'Search options', 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", { 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: {
|
|
750
750
|
'menu-item': true,
|
|
751
751
|
'is-selected': !this.multiple && option.value === this.value,
|
|
752
752
|
'is-focused': index === this.focusedIndex
|
|
@@ -294,11 +294,11 @@ export class QForm {
|
|
|
294
294
|
const hasHeaderContent = Boolean(this.label) || this.hasHeaderSlot;
|
|
295
295
|
const formLabelledBy = !this.ariaLabel && this.label && !this.hasHeaderSlot ? this.titleId : undefined;
|
|
296
296
|
const formAriaLabel = this.ariaLabel?.trim() || (this.label && this.hasHeaderSlot ? this.label : undefined);
|
|
297
|
-
return (h(Host, { key: '
|
|
297
|
+
return (h(Host, { key: 'caa88a8ae18c7b99a1e84be7ac1bda6f95e367f3', style: { ...controlScope(this.size), '--q-context-feedback-min': this.reserveFeedback === undefined ? '' : 'initial', '--_q-context-feedback-reserve': this.reserveFeedback === undefined ? '' : this.reserveFeedback ? '1' : '0' } }, h("div", { key: '1212c44b85f736017f148c012ff99187fd783577', class: "form-shell" }, h("div", { key: '5d75b2275a861b085b0c04aedbc770735a425c7f', class: { 'form-header': true, 'is-hidden': !hasHeaderContent, 'q-label-hidden': this.labelHidden }, part: "header" }, h("slot", { key: '3e6137b02e4ea8cd2a2aca93018e9d1c57cf61e8', name: "header", ref: (el) => (this.headerSlot = el), onSlotchange: this.handleHeaderSlotChange }, this.label && h("h2", { key: '6fe3cb07800b3f8be3dd4ab484450c14330ec23f', id: this.titleId, class: "form-title" }, this.label))), h("form", { key: 'ac15f87800972f62f6751d23bbc98919db96b798', ref: (el) => (this.formEl = el), action: this.action, method: this.method, autocomplete: this.autocomplete, enctype: this.enctype, target: this.target, noValidate: this.noValidate, "aria-labelledby": formLabelledBy, "aria-label": formAriaLabel, part: "form", onSubmit: this.handleSubmit, onClick: (ev) => {
|
|
298
298
|
const image = ev.target;
|
|
299
299
|
if (image instanceof HTMLInputElement && image.type === 'image' && image.getRootNode() === this.formEl?.getRootNode())
|
|
300
300
|
this.handleComposedClick(ev);
|
|
301
|
-
}, onReset: this.handleReset }, h("div", { key: '
|
|
301
|
+
}, onReset: this.handleReset }, h("div", { key: '89d410306a5538cbcb36b5ccc71fac0c99037169', class: "form-body", part: "body" }, h("slot", { key: '102763dc5d8eda81ac07c07fb4c977936b9611fb' })), h("div", { key: '3058cf8c1dbc4042698658406ad7db5abda19da6', class: { 'form-actions': true, 'is-hidden': !this.hasActionsSlot }, part: "actions" }, h("slot", { key: '8f304bcac91ab7f376396eff945e641b7fe838c7', name: "actions", ref: (el) => (this.actionsSlot = el), onSlotchange: this.handleActionsSlotChange }))))));
|
|
302
302
|
}
|
|
303
303
|
static get is() { return "q-form"; }
|
|
304
304
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { awaitFormField, FORM_FIELD_READY_TIMEOUT_MS, readFormField } from "../../../../utils/form-field-adapter";
|
|
2
2
|
import { isFieldDisabled } from "../../../../utils/form-field-state";
|
|
3
3
|
const skippedInputTypes = new Set(['button', 'checkbox', 'color', 'file', 'hidden', 'image', 'radio', 'range', 'reset', 'submit']);
|
|
4
|
-
const customFieldTags = new Set(['q-slider', 'q-input', 'q-textarea', 'q-dropdown', 'q-radio-group', 'q-toggle', 'q-syntax-box']);
|
|
4
|
+
const customFieldTags = new Set(['q-slider', 'q-input', 'q-textarea', 'q-dropdown', 'q-radio-group', 'q-toggle', 'q-syntax-box', 'q-syntax-view']);
|
|
5
5
|
const actionInputTypes = new Set(['button', 'image', 'reset', 'submit']);
|
|
6
6
|
function supported(element) {
|
|
7
7
|
const tag = element.tagName.toLowerCase();
|
|
@@ -115,7 +115,7 @@ export function getNamedControls(formEl, hostEl) {
|
|
|
115
115
|
return getFormControls(formEl, hostEl).filter(control => Boolean(control.getAttribute('name')));
|
|
116
116
|
}
|
|
117
117
|
export function shouldSkipControl(control, tagName = control.tagName.toLowerCase()) {
|
|
118
|
-
return tagName === 'q-syntax-box' && !control.editable;
|
|
118
|
+
return (tagName === 'q-syntax-box' || tagName === 'q-syntax-view') && !control.editable;
|
|
119
119
|
}
|
|
120
120
|
export function getControlFromEvent(ev, formEl, hostEl) {
|
|
121
121
|
const controls = getFocusableTextControls(formEl, hostEl);
|
|
@@ -300,16 +300,16 @@ export class QInput {
|
|
|
300
300
|
const isMinDisabled = hasNumericValue && this.min !== undefined && this.min !== null && numericValue <= this.min;
|
|
301
301
|
const isMaxDisabled = hasNumericValue && this.max !== undefined && this.max !== null && numericValue >= this.max;
|
|
302
302
|
const ariaLabel = this.ariaLabel?.trim() || undefined;
|
|
303
|
-
return (h("div", { key: '
|
|
303
|
+
return (h("div", { key: 'd7dd69ef5097648f591b91bc7111221d655c28e5', style: feedbackStyle(this.reserveFeedback), class: {
|
|
304
304
|
'input-wrapper': true,
|
|
305
305
|
'is-disabled': this.isDisabled,
|
|
306
306
|
'has-error': hasError,
|
|
307
307
|
[`size-${this.size}`]: true
|
|
308
|
-
} }, this.label && (h("label", { key: '
|
|
308
|
+
} }, this.label && (h("label", { key: '688e82d0a1c1dc5276b8aa83033fcaa2c4753dec', class: { 'input-label': true, 'q-label-hidden': this.labelHidden }, htmlFor: "q-field", part: "label" }, this.label)), h("div", { key: '04d6e3ef4715a0ab1688f92af3e6c52f0cf7bbdf', class: "input-control", part: "control" }, h("span", { key: '3a154ff6f6f35ab8613e08ed83c60bd726701bb9', class: "prefix-container", style: { display: this.hasPrefix ? 'flex' : 'none' }, part: "prefix" }, h("slot", { key: 'c2913eff9fabfe4da83feb6b0885a7702795da49', name: "prefix", onSlotchange: this.handlePrefixSlotChange })), h("input", { key: this.type, ref: (el) => (this.inputEl = el), id: "q-field", class: {
|
|
309
309
|
'input-box': true,
|
|
310
310
|
'has-prefix-padding': this.hasPrefix,
|
|
311
311
|
'has-suffix-padding': showSuffixContainer
|
|
312
|
-
}, type: inputType, name: this.name, value: this.value, placeholder: this.placeholder, disabled: this.isDisabled, required: this.required, min: this.min, max: this.max, step: this.step, onInput: this.handleInput, onChange: this.handleChange, onBlur: this.handleBlur, onFocus: this.handleFocus, onClick: this.handleClick, onKeyDown: this.handleKeyDown, role: this.type === 'number' ? 'spinbutton' : undefined, "aria-valuenow": hasNumericValue ? String(numericValue) : undefined, "aria-valuemin": this.type === 'number' && this.min !== undefined && this.min !== null ? String(this.min) : undefined, "aria-valuemax": this.type === 'number' && this.max !== undefined && this.max !== null ? String(this.max) : undefined, "aria-invalid": hasError ? 'true' : 'false', "aria-describedby": hasError || this.description ? 'q-field-error' : undefined, "aria-label": ariaLabel }), this.type === 'number' && !this.isDisabled && (h("div", { key: '
|
|
312
|
+
}, type: inputType, name: this.name, value: this.value, placeholder: this.placeholder, disabled: this.isDisabled, required: this.required, min: this.min, max: this.max, step: this.step, onInput: this.handleInput, onChange: this.handleChange, onBlur: this.handleBlur, onFocus: this.handleFocus, onClick: this.handleClick, onKeyDown: this.handleKeyDown, role: this.type === 'number' ? 'spinbutton' : undefined, "aria-valuenow": hasNumericValue ? String(numericValue) : undefined, "aria-valuemin": this.type === 'number' && this.min !== undefined && this.min !== null ? String(this.min) : undefined, "aria-valuemax": this.type === 'number' && this.max !== undefined && this.max !== null ? String(this.max) : undefined, "aria-invalid": hasError ? 'true' : 'false', "aria-describedby": hasError || this.description ? 'q-field-error' : undefined, "aria-label": ariaLabel }), this.type === 'number' && !this.isDisabled && (h("div", { key: 'ad959e78f209e71220aa64d2abb00ec5222b73fe', class: "input-spinners", part: "spinners" }, h("button", { key: '28152f46138eda374cc3bad4604d37009d4885d3', class: "spinner-btn spinner-up", type: "button", onClick: this.handleIncrement, disabled: isMaxDisabled, "aria-label": "Increase value" }, h("svg", { key: '1c625744091c344371e50fa8aff7e899d8cd9ad4', viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "aria-hidden": "true" }, h("path", { key: 'd9cf0598907d33c6cc6da8fb4ebd3b807f7bf9df', d: "M18 15l-6-6-6 6" }))), h("button", { key: '38ef449f0f90c62829953cbe9d45172ec3b2c63c', class: "spinner-btn spinner-down", type: "button", onClick: this.handleDecrement, disabled: isMinDisabled, "aria-label": "Decrease value" }, h("svg", { key: '3b21a79096f52ea52ff3c2923b85428f55d594eb', viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "aria-hidden": "true" }, h("path", { key: '4e168fb8c03baf45a8e03d6fc3a01f8c3b852d6d', d: "M6 9l6 6 6-6" }))))), h("span", { key: '7175a82cbf29704168baf007786040ccf61cdf5c', class: "suffix-container", style: { display: showSuffixContainer ? 'flex' : 'none' }, part: "suffix" }, showClearBtn && (h("button", { key: '85f4b3102f24b044b25c81cb8c1a0ea70febb9c9', class: "clear-btn", type: "button", onClick: this.handleClear, "aria-label": "Clear input" }, h("svg", { key: 'da9dfae9dfab998f855139c258588207ad9f18cc', viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("path", { key: 'bdf2c620673dc36845b16755812ce02d76332c00', d: "M18 6L6 18M6 6l12 12" })))), showPasswordToggle && (h("button", { key: '31787093d6093385441be9f1a0779f99596798fd', class: "password-toggle-btn", type: "button", onClick: this.handlePasswordToggle, "aria-label": this.passwordVisible ? 'Hide password' : 'Show password', "aria-pressed": this.passwordVisible ? 'true' : 'false' }, this.passwordVisible ? (h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "aria-hidden": "true" }, h("path", { d: "M3 3l18 18" }), h("path", { d: "M10.58 10.58A2 2 0 0 0 12 14a2 2 0 0 0 1.42-.58" }), h("path", { d: "M9.88 4.24A10.2 10.2 0 0 1 12 4c7 0 10 8 10 8a18.5 18.5 0 0 1-4.08 5.19" }), h("path", { d: "M6.61 6.61A18.5 18.5 0 0 0 2 12s3 8 10 8a10.7 10.7 0 0 0 5.39-1.61" }))) : (h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "aria-hidden": "true" }, h("path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" }), h("circle", { cx: "12", cy: "12", r: "3" }))))), h("span", { key: 'd318dd6f57197663bec5522110b63e4a36022d0d', style: { display: !showClearBtn && this.hasSuffix ? 'block' : 'none' } }, h("slot", { key: '4a9638be261e618a587f17f32318172e28d81d9e', name: "suffix", onSlotchange: this.handleSuffixSlotChange })))), fieldFeedback('q-field-error', displayError, this.description)));
|
|
313
313
|
}
|
|
314
314
|
static get is() { return "q-input"; }
|
|
315
315
|
static get encapsulation() { return "shadow"; }
|
|
@@ -111,15 +111,15 @@ export class QQuantitySelector {
|
|
|
111
111
|
const hasFiniteValue = Number.isFinite(this.value);
|
|
112
112
|
const isMinDisabled = hasFiniteValue && hasQuantityBound(this.min) && finiteValue <= this.min;
|
|
113
113
|
const isMaxDisabled = hasFiniteValue && hasQuantityBound(this.max) && finiteValue >= this.max;
|
|
114
|
-
const decBtn = (h("button", { key: '
|
|
115
|
-
const incBtn = (h("button", { key: '
|
|
114
|
+
const decBtn = (h("button", { key: 'aa96b2c4f1aa661fabfdc6ab1002fc189866cc7e', type: "button", class: "quantity-btn quantity-btn-decrement", onClick: this.decrement, disabled: isMinDisabled, "aria-label": "Decrement quantity" }, h("svg", { key: '18369c8ef4efcb475d8dfa2b045cba092308263f', viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "btn-icon", "aria-hidden": "true" }, h("line", { key: '0fbe71a23983e9d6c3538ab0f41f691f796636ca', x1: "5", y1: "12", x2: "19", y2: "12" }))));
|
|
115
|
+
const incBtn = (h("button", { key: 'a042fd3c6b660466a8a6e2537423732519c3e1d9', type: "button", class: "quantity-btn quantity-btn-increment", onClick: this.increment, disabled: isMaxDisabled, "aria-label": "Increment quantity" }, h("svg", { key: '34755b811d4c2d8145adf548d4bcabc964bcbc56', viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "btn-icon", "aria-hidden": "true" }, h("line", { key: '4f834bd44b324733ab329b0da87c3c8d9385ed86', x1: "12", y1: "5", x2: "12", y2: "19" }), h("line", { key: 'de6fe27d9ded26c146686854ff16b30b8f9493c9', x1: "5", y1: "12", x2: "19", y2: "12" }))));
|
|
116
116
|
const calculatedWidth = orientation === 'horizontal' ? this.getCalculatedWidth() : '100%';
|
|
117
|
-
return (h("div", { key: '
|
|
117
|
+
return (h("div", { key: 'e889c181210e3a74b46281cf1aa974a4a2a90b84', class: {
|
|
118
118
|
'quantity-selector': true,
|
|
119
119
|
[`size-${this.size}`]: true,
|
|
120
120
|
[`orientation-${orientation}`]: true,
|
|
121
121
|
[`variant-${orientation}`]: true,
|
|
122
|
-
}, onClick: this.handleClick }, orientation === 'vertical' ? incBtn : decBtn, h("input", { key: '
|
|
122
|
+
}, onClick: this.handleClick }, orientation === 'vertical' ? incBtn : decBtn, h("input", { key: '56640ca6165e5d2cd2cc22b5e52ee38d450dc46e', type: "text", class: "quantity-input", value: this.inputValue, onInput: this.handleInput, onBlur: this.handleBlur, onFocus: this.handleFocus, onChange: this.handleChange, onKeyDown: this.handleKeyDown, role: "spinbutton", "aria-valuenow": hasFiniteValue ? String(this.value) : undefined, "aria-valuemin": hasQuantityBound(this.min) ? String(this.min) : undefined, "aria-valuemax": hasQuantityBound(this.max) ? String(this.max) : undefined, "aria-label": "Quantity", style: { width: calculatedWidth }, part: "input" }), orientation === 'vertical' ? decBtn : incBtn));
|
|
123
123
|
}
|
|
124
124
|
static get is() { return "q-quantity-selector"; }
|
|
125
125
|
static get encapsulation() { return "shadow"; }
|