@webquark/browser 1.1.0-dev.11 → 1.1.0-dev.13
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-DmLaQuU2.js → action.props-B6vl_1p5.js} +1 -1
- package/dist/cjs/{dom-Dk77oFF6.js → dom-BYrqRYna.js} +1 -1
- package/dist/cjs/{field-CEZ9NsWK.js → field-B5nxD8Kc.js} +1 -1
- package/dist/cjs/{index-CMAcJ6t1.js → index-BD6Jjssb.js} +4 -0
- 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 +1 -1
- package/dist/cjs/q-avatar.cjs.entry.js +2 -2
- package/dist/cjs/q-banner.cjs.entry.js +1 -1
- package/dist/cjs/q-button_2.cjs.entry.js +5 -5
- package/dist/cjs/q-card.cjs.entry.js +2 -2
- 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 +2 -2
- package/dist/cjs/q-dropdown.cjs.entry.js +218 -21
- package/dist/cjs/q-form.cjs.entry.js +15 -5
- package/dist/cjs/q-grid.cjs.entry.js +2 -2
- 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 +2 -2
- package/dist/cjs/q-input_2.cjs.entry.js +7 -7
- 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 +6 -6
- 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 +4 -4
- package/dist/cjs/q-scrollable.cjs.entry.js +4 -4
- package/dist/cjs/q-section.cjs.entry.js +2 -2
- package/dist/cjs/q-sidepanel.cjs.entry.js +2 -2
- package/dist/cjs/q-slider.cjs.entry.js +122 -0
- package/dist/cjs/q-stack.cjs.entry.js +2 -2
- 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 +1 -1
- package/dist/cjs/q-tabs.cjs.entry.js +2 -2
- package/dist/cjs/q-textarea.cjs.entry.js +4 -4
- 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 +3 -3
- package/dist/cjs/webquark.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/actions/button/button.css +22 -0
- 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/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 +115 -0
- package/dist/collection/components/inputs/dropdown/dropdown.js +274 -23
- 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/form/form.js +2 -2
- package/dist/collection/components/inputs/form/internals/controls.js +1 -1
- 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/input/input.css +22 -0
- package/dist/collection/components/inputs/input/input.js +3 -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.js +2 -2
- package/dist/collection/components/inputs/toggle/toggle.css +22 -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.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/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 +2 -2
- package/dist/collection/components/media/thumbnail/thumbnail.js +2 -2
- package/dist/collection/components/overlays/dialog/dialog.js +2 -2
- package/dist/collection/components/overlays/tooltip/tooltip.js +2 -2
- package/dist/collection/utils/dom.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-iXEnb5d5.js → p-BGHNFaaC.js} +1 -1
- package/dist/components/{p--r63tfQH.js → p-BZXIeEKC.js} +1 -1
- package/dist/components/{p-DbI_F3z0.js → p-Bc2_QcLn.js} +1 -1
- package/dist/components/{p-DBbiaYqQ.js → p-Bp6Xr92S.js} +1 -1
- package/dist/components/{p-CSucjZb7.js → p-BwPMm43W.js} +1 -1
- package/dist/components/p-CArIPzJU.js +1 -0
- package/dist/components/p-CpkX9YAW.js +1 -0
- package/dist/components/{p-CLErjC1f.js → p-D2nxHd1b.js} +1 -1
- package/dist/components/{p-DQhiqYeq.js → p-DkanItP3.js} +1 -1
- package/dist/components/p-IwIJb0Mc.js +1 -0
- package/dist/components/{p-0feRVg70.js → p-kfrqZyfJ.js} +1 -1
- package/dist/components/{p-CYG3Oakz.js → p-x3C-wjU9.js} +1 -1
- 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.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 +1 -1
- 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 +2 -2
- 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-DhnvhbLl.js → action.props-Di_LpF5H.js} +1 -1
- package/dist/esm/{dom-ByfrUWx1.js → dom-CArIPzJU.js} +1 -1
- package/dist/esm/{field-u-k7C7Rf.js → field-C4Iilew6.js} +1 -1
- package/dist/esm/{index-DaJmsCb7.js → index-DoGM9gsC.js} +4 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/q-accordion.entry.js +2 -2
- package/dist/esm/q-alert.entry.js +1 -1
- package/dist/esm/q-avatar.entry.js +2 -2
- package/dist/esm/q-banner.entry.js +1 -1
- package/dist/esm/q-button_2.entry.js +5 -5
- package/dist/esm/q-card.entry.js +2 -2
- 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 +2 -2
- package/dist/esm/q-dropdown.entry.js +218 -21
- package/dist/esm/q-form.entry.js +15 -5
- package/dist/esm/q-grid.entry.js +2 -2
- 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 +2 -2
- 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 +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 +6 -6
- 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 +4 -4
- package/dist/esm/q-scrollable.entry.js +4 -4
- package/dist/esm/q-section.entry.js +2 -2
- package/dist/esm/q-sidepanel.entry.js +2 -2
- package/dist/esm/q-slider.entry.js +120 -0
- package/dist/esm/q-stack.entry.js +2 -2
- 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 +1 -1
- package/dist/esm/q-tabs.entry.js +2 -2
- package/dist/esm/q-textarea.entry.js +4 -4
- 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 +3 -3
- package/dist/esm/webquark.js +3 -3
- 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/inputs/dropdown/dropdown.d.ts +29 -2
- 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/form/internals/field-state.d.ts +1 -1
- 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/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.d.ts +284 -9
- package/dist/types/index.d.ts +1 -1
- package/dist/types/utils/form-field-adapter.d.ts +3 -3
- package/dist/webquark/{p-b8f4994a.entry.js → p-0182e114.entry.js} +1 -1
- package/dist/webquark/{p-4d611b93.entry.js → p-048103e0.entry.js} +1 -1
- package/dist/webquark/{p-a30d212f.entry.js → p-0a2c52de.entry.js} +1 -1
- package/dist/webquark/p-0baf478a.entry.js +1 -0
- package/dist/webquark/{p-5d6fb0d1.entry.js → p-15bad9ef.entry.js} +1 -1
- package/dist/webquark/p-17b9713f.entry.js +1 -0
- package/dist/webquark/{p-32055acd.entry.js → p-222405b8.entry.js} +1 -1
- package/dist/webquark/{p-7723e966.entry.js → p-2eaa3a9f.entry.js} +1 -1
- package/dist/webquark/{p-e7384b6e.entry.js → p-3daafc56.entry.js} +1 -1
- package/dist/webquark/{p-220ec9cf.entry.js → p-44bbe12f.entry.js} +1 -1
- package/dist/webquark/{p-dee50f0a.entry.js → p-4609c362.entry.js} +1 -1
- package/dist/webquark/{p-0f04ceab.entry.js → p-5b584d3c.entry.js} +1 -1
- package/dist/webquark/p-65fe9cac.entry.js +1 -0
- package/dist/webquark/{p-1e8797d1.entry.js → p-846dc838.entry.js} +1 -1
- package/dist/webquark/{p-d2c4696f.entry.js → p-84b350a3.entry.js} +1 -1
- package/dist/webquark/p-85131314.entry.js +1 -0
- package/dist/webquark/{p-a87f0bde.entry.js → p-852e88ae.entry.js} +1 -1
- package/dist/webquark/{p-596737cc.entry.js → p-86c05afd.entry.js} +1 -1
- package/dist/webquark/p-8c5b2706.entry.js +1 -0
- package/dist/webquark/p-923527f0.entry.js +1 -0
- package/dist/webquark/{p-687be7d4.entry.js → p-9a76cd71.entry.js} +1 -1
- package/dist/webquark/p-CArIPzJU.js +1 -0
- package/dist/webquark/{p-BuctNczf.js → p-DDUED8LT.js} +1 -1
- package/dist/webquark/{p-Bk4FnOfb.js → p-Dnz3WmdX.js} +1 -1
- package/dist/webquark/{p-DaJmsCb7.js → p-DoGM9gsC.js} +1 -1
- package/dist/webquark/p-a0d97367.entry.js +1 -0
- package/dist/webquark/{p-3af50215.entry.js → p-a16bd8d5.entry.js} +2 -2
- package/dist/webquark/{p-6d2d016a.entry.js → p-a2334abe.entry.js} +1 -1
- package/dist/webquark/{p-5cccb6bc.entry.js → p-a2ff1b64.entry.js} +1 -1
- package/dist/webquark/{p-a199de7d.entry.js → p-a314bc21.entry.js} +1 -1
- package/dist/webquark/p-a3e1096d.entry.js +1 -0
- package/dist/webquark/{p-b9c8c081.entry.js → p-a66550da.entry.js} +1 -1
- package/dist/webquark/{p-b75ec829.entry.js → p-aa342e81.entry.js} +1 -1
- package/dist/webquark/{p-c662904e.entry.js → p-b1c771fb.entry.js} +1 -1
- package/dist/webquark/p-b21ad707.entry.js +1 -0
- package/dist/webquark/p-b45ca926.entry.js +1 -0
- package/dist/webquark/{p-e3c18c0e.entry.js → p-b8fdef4f.entry.js} +1 -1
- package/dist/webquark/{p-78c56cd3.entry.js → p-d4788321.entry.js} +1 -1
- package/dist/webquark/{p-191a7063.entry.js → p-d86bd51d.entry.js} +1 -1
- package/dist/webquark/{p-b82aaf4c.entry.js → p-dbcf7592.entry.js} +1 -1
- package/dist/webquark/p-e0943d41.entry.js +1 -0
- package/dist/webquark/{p-41deb44c.entry.js → p-e2721e77.entry.js} +1 -1
- package/dist/webquark/{p-ddeb2d4c.entry.js → p-e723a7ae.entry.js} +1 -1
- package/dist/webquark/p-eb800d1e.entry.js +1 -0
- package/dist/webquark/{p-fbd1cbbe.entry.js → p-f4d23ffe.entry.js} +1 -1
- package/dist/webquark/{p-cab898c2.entry.js → p-f51e1098.entry.js} +1 -1
- package/dist/webquark/{p-44eda084.entry.js → p-fe14f038.entry.js} +1 -1
- package/dist/webquark/webquark.esm.js +1 -1
- package/package.json +2 -2
- package/dist/components/p-ByfrUWx1.js +0 -1
- package/dist/components/p-cSh-5xis.js +0 -1
- package/dist/webquark/p-10dc5cce.entry.js +0 -1
- package/dist/webquark/p-2291095e.entry.js +0 -1
- package/dist/webquark/p-473a1810.entry.js +0 -1
- package/dist/webquark/p-4cf40080.entry.js +0 -1
- package/dist/webquark/p-6a5033da.entry.js +0 -1
- package/dist/webquark/p-70e3a23a.entry.js +0 -1
- package/dist/webquark/p-8a0733a1.entry.js +0 -1
- package/dist/webquark/p-ByfrUWx1.js +0 -1
- package/dist/webquark/p-bf568cda.entry.js +0 -1
- package/dist/webquark/p-f63fd66f.entry.js +0 -1
- package/dist/webquark/p-f95aeb8d.entry.js +0 -1
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { isFieldDisabled } from "../../../utils/form-field-state";
|
|
3
|
+
import { registerFormField } from "../../../utils/form-field-adapter";
|
|
4
|
+
/**
|
|
5
|
+
* Single-value range input with a themed track, glowing thumb and optional value badge.
|
|
6
|
+
* @part label - Label and value row.
|
|
7
|
+
* @part value - Current-value badge.
|
|
8
|
+
* @part input - Native range control.
|
|
9
|
+
*/
|
|
10
|
+
export class QSlider {
|
|
11
|
+
el;
|
|
12
|
+
/** Current value. Defaults to the minimum when omitted. */
|
|
13
|
+
value;
|
|
14
|
+
label;
|
|
15
|
+
/** Suffix for the displayed value, such as px or %. */
|
|
16
|
+
suffix = '';
|
|
17
|
+
showValue = true;
|
|
18
|
+
disabled = false;
|
|
19
|
+
min = 0;
|
|
20
|
+
max = 100;
|
|
21
|
+
step = 1;
|
|
22
|
+
name;
|
|
23
|
+
ariaLabel = null;
|
|
24
|
+
internals;
|
|
25
|
+
/** Numeric value emitted continuously while dragging or using the keyboard. */
|
|
26
|
+
qInput;
|
|
27
|
+
/** Numeric value emitted when the interaction is committed. */
|
|
28
|
+
qChange;
|
|
29
|
+
fieldDisabled = false;
|
|
30
|
+
inputEl;
|
|
31
|
+
initialValue;
|
|
32
|
+
componentWillLoad() {
|
|
33
|
+
this.initialValue = this.value;
|
|
34
|
+
this.normalize();
|
|
35
|
+
}
|
|
36
|
+
constraintsChanged() { this.normalize(); }
|
|
37
|
+
disabledChanged() { this.syncForm(); }
|
|
38
|
+
get lower() { return Number.isFinite(this.min) ? this.min : 0; }
|
|
39
|
+
get upper() { return Math.max(this.lower, Number.isFinite(this.max) ? this.max : 100); }
|
|
40
|
+
get increment() { return Number.isFinite(this.step) && this.step > 0 ? this.step : 1; }
|
|
41
|
+
normalize() {
|
|
42
|
+
const candidate = Number.isFinite(this.value) ? this.value : this.lower;
|
|
43
|
+
const steps = Math.round((Math.min(this.upper, Math.max(this.lower, candidate)) - this.lower) / this.increment);
|
|
44
|
+
const lastStep = Math.floor((this.upper - this.lower) / this.increment + 1e-10);
|
|
45
|
+
const next = Number((this.lower + Math.min(steps, lastStep) * this.increment).toPrecision(12));
|
|
46
|
+
if (this.value !== next)
|
|
47
|
+
this.value = next;
|
|
48
|
+
this.syncForm();
|
|
49
|
+
}
|
|
50
|
+
syncForm() {
|
|
51
|
+
this.fieldDisabled = isFieldDisabled(this.el, this.disabled);
|
|
52
|
+
this.internals?.setFormValue?.(this.fieldDisabled ? null : String(this.value ?? this.lower));
|
|
53
|
+
}
|
|
54
|
+
componentDidLoad() {
|
|
55
|
+
registerFormField(this.el, {
|
|
56
|
+
kind: 'text',
|
|
57
|
+
owner: () => this.internals?.form ?? null,
|
|
58
|
+
active: () => true,
|
|
59
|
+
value: () => String(this.value),
|
|
60
|
+
assign: value => { this.value = Number(value); this.normalize(); },
|
|
61
|
+
reconcile: () => this.normalize(),
|
|
62
|
+
reset: () => this.formResetCallback(),
|
|
63
|
+
validate: () => true,
|
|
64
|
+
});
|
|
65
|
+
this.syncForm();
|
|
66
|
+
}
|
|
67
|
+
formDisabledCallback() { this.syncForm(); }
|
|
68
|
+
formResetCallback() { this.value = this.initialValue; this.normalize(); }
|
|
69
|
+
formStateRestoreCallback(state) {
|
|
70
|
+
if (typeof state === 'string') {
|
|
71
|
+
this.value = Number(state);
|
|
72
|
+
this.normalize();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
async focusElement() { this.inputEl?.focus(); }
|
|
76
|
+
onValue(event, committed) {
|
|
77
|
+
if (this.fieldDisabled)
|
|
78
|
+
return;
|
|
79
|
+
this.value = event.target.valueAsNumber;
|
|
80
|
+
this.normalize();
|
|
81
|
+
if (committed)
|
|
82
|
+
this.qChange.emit(this.value);
|
|
83
|
+
else
|
|
84
|
+
this.qInput.emit(this.value);
|
|
85
|
+
}
|
|
86
|
+
render() {
|
|
87
|
+
return (h("div", { key: 'c7f0371d801a02a000d92dc92df3c1bf228fc842', class: "field" }, (this.label || this.showValue) && h("div", { key: 'e33ce30e1a32013e46c670ca7c605a8a001d2ff7', class: "label-row", part: "label" }, this.label && h("label", { key: '0bb615df1af862b010c5d18a96e5cfc3eaffab61', htmlFor: "range" }, this.label), this.showValue && h("span", { key: 'f49a2cf0661d9dd9dcc79e97a061f09940970dbc', class: "badge", part: "value", "aria-hidden": "true" }, this.value, this.suffix)), h("input", { key: '878163075048af3984bdf655f29558293532c004', ref: el => this.inputEl = el, id: "range", part: "input", type: "range", min: this.lower, max: this.upper, step: this.increment, value: this.value, disabled: this.fieldDisabled, "aria-label": this.ariaLabel || (!this.label ? 'Value' : undefined), "aria-valuetext": this.suffix ? `${this.value}${this.suffix}` : undefined, onInput: event => this.onValue(event, false), onChange: event => this.onValue(event, true) })));
|
|
88
|
+
}
|
|
89
|
+
static get is() { return "q-slider"; }
|
|
90
|
+
static get encapsulation() { return "shadow"; }
|
|
91
|
+
static get delegatesFocus() { return true; }
|
|
92
|
+
static get formAssociated() { return true; }
|
|
93
|
+
static get originalStyleUrls() {
|
|
94
|
+
return {
|
|
95
|
+
"$": ["slider.css"]
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
static get styleUrls() {
|
|
99
|
+
return {
|
|
100
|
+
"$": ["slider.css"]
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
static get properties() {
|
|
104
|
+
return {
|
|
105
|
+
"value": {
|
|
106
|
+
"type": "number",
|
|
107
|
+
"mutable": true,
|
|
108
|
+
"complexType": {
|
|
109
|
+
"original": "number",
|
|
110
|
+
"resolved": "number",
|
|
111
|
+
"references": {}
|
|
112
|
+
},
|
|
113
|
+
"required": false,
|
|
114
|
+
"optional": true,
|
|
115
|
+
"docs": {
|
|
116
|
+
"tags": [],
|
|
117
|
+
"text": "Current value. Defaults to the minimum when omitted."
|
|
118
|
+
},
|
|
119
|
+
"getter": false,
|
|
120
|
+
"setter": false,
|
|
121
|
+
"reflect": false,
|
|
122
|
+
"attribute": "value"
|
|
123
|
+
},
|
|
124
|
+
"label": {
|
|
125
|
+
"type": "string",
|
|
126
|
+
"mutable": false,
|
|
127
|
+
"complexType": {
|
|
128
|
+
"original": "string",
|
|
129
|
+
"resolved": "string",
|
|
130
|
+
"references": {}
|
|
131
|
+
},
|
|
132
|
+
"required": false,
|
|
133
|
+
"optional": true,
|
|
134
|
+
"docs": {
|
|
135
|
+
"tags": [],
|
|
136
|
+
"text": ""
|
|
137
|
+
},
|
|
138
|
+
"getter": false,
|
|
139
|
+
"setter": false,
|
|
140
|
+
"reflect": false,
|
|
141
|
+
"attribute": "label"
|
|
142
|
+
},
|
|
143
|
+
"suffix": {
|
|
144
|
+
"type": "string",
|
|
145
|
+
"mutable": false,
|
|
146
|
+
"complexType": {
|
|
147
|
+
"original": "string",
|
|
148
|
+
"resolved": "string",
|
|
149
|
+
"references": {}
|
|
150
|
+
},
|
|
151
|
+
"required": false,
|
|
152
|
+
"optional": false,
|
|
153
|
+
"docs": {
|
|
154
|
+
"tags": [],
|
|
155
|
+
"text": "Suffix for the displayed value, such as px or %."
|
|
156
|
+
},
|
|
157
|
+
"getter": false,
|
|
158
|
+
"setter": false,
|
|
159
|
+
"reflect": false,
|
|
160
|
+
"attribute": "suffix",
|
|
161
|
+
"defaultValue": "''"
|
|
162
|
+
},
|
|
163
|
+
"showValue": {
|
|
164
|
+
"type": "boolean",
|
|
165
|
+
"mutable": false,
|
|
166
|
+
"complexType": {
|
|
167
|
+
"original": "boolean",
|
|
168
|
+
"resolved": "boolean",
|
|
169
|
+
"references": {}
|
|
170
|
+
},
|
|
171
|
+
"required": false,
|
|
172
|
+
"optional": false,
|
|
173
|
+
"docs": {
|
|
174
|
+
"tags": [],
|
|
175
|
+
"text": ""
|
|
176
|
+
},
|
|
177
|
+
"getter": false,
|
|
178
|
+
"setter": false,
|
|
179
|
+
"reflect": false,
|
|
180
|
+
"attribute": "show-value",
|
|
181
|
+
"defaultValue": "true"
|
|
182
|
+
},
|
|
183
|
+
"disabled": {
|
|
184
|
+
"type": "boolean",
|
|
185
|
+
"mutable": false,
|
|
186
|
+
"complexType": {
|
|
187
|
+
"original": "boolean",
|
|
188
|
+
"resolved": "boolean",
|
|
189
|
+
"references": {}
|
|
190
|
+
},
|
|
191
|
+
"required": false,
|
|
192
|
+
"optional": false,
|
|
193
|
+
"docs": {
|
|
194
|
+
"tags": [],
|
|
195
|
+
"text": ""
|
|
196
|
+
},
|
|
197
|
+
"getter": false,
|
|
198
|
+
"setter": false,
|
|
199
|
+
"reflect": true,
|
|
200
|
+
"attribute": "disabled",
|
|
201
|
+
"defaultValue": "false"
|
|
202
|
+
},
|
|
203
|
+
"min": {
|
|
204
|
+
"type": "number",
|
|
205
|
+
"mutable": false,
|
|
206
|
+
"complexType": {
|
|
207
|
+
"original": "number",
|
|
208
|
+
"resolved": "number",
|
|
209
|
+
"references": {}
|
|
210
|
+
},
|
|
211
|
+
"required": false,
|
|
212
|
+
"optional": false,
|
|
213
|
+
"docs": {
|
|
214
|
+
"tags": [],
|
|
215
|
+
"text": ""
|
|
216
|
+
},
|
|
217
|
+
"getter": false,
|
|
218
|
+
"setter": false,
|
|
219
|
+
"reflect": false,
|
|
220
|
+
"attribute": "min",
|
|
221
|
+
"defaultValue": "0"
|
|
222
|
+
},
|
|
223
|
+
"max": {
|
|
224
|
+
"type": "number",
|
|
225
|
+
"mutable": false,
|
|
226
|
+
"complexType": {
|
|
227
|
+
"original": "number",
|
|
228
|
+
"resolved": "number",
|
|
229
|
+
"references": {}
|
|
230
|
+
},
|
|
231
|
+
"required": false,
|
|
232
|
+
"optional": false,
|
|
233
|
+
"docs": {
|
|
234
|
+
"tags": [],
|
|
235
|
+
"text": ""
|
|
236
|
+
},
|
|
237
|
+
"getter": false,
|
|
238
|
+
"setter": false,
|
|
239
|
+
"reflect": false,
|
|
240
|
+
"attribute": "max",
|
|
241
|
+
"defaultValue": "100"
|
|
242
|
+
},
|
|
243
|
+
"step": {
|
|
244
|
+
"type": "number",
|
|
245
|
+
"mutable": false,
|
|
246
|
+
"complexType": {
|
|
247
|
+
"original": "number",
|
|
248
|
+
"resolved": "number",
|
|
249
|
+
"references": {}
|
|
250
|
+
},
|
|
251
|
+
"required": false,
|
|
252
|
+
"optional": false,
|
|
253
|
+
"docs": {
|
|
254
|
+
"tags": [],
|
|
255
|
+
"text": ""
|
|
256
|
+
},
|
|
257
|
+
"getter": false,
|
|
258
|
+
"setter": false,
|
|
259
|
+
"reflect": false,
|
|
260
|
+
"attribute": "step",
|
|
261
|
+
"defaultValue": "1"
|
|
262
|
+
},
|
|
263
|
+
"name": {
|
|
264
|
+
"type": "string",
|
|
265
|
+
"mutable": false,
|
|
266
|
+
"complexType": {
|
|
267
|
+
"original": "string",
|
|
268
|
+
"resolved": "string",
|
|
269
|
+
"references": {}
|
|
270
|
+
},
|
|
271
|
+
"required": false,
|
|
272
|
+
"optional": true,
|
|
273
|
+
"docs": {
|
|
274
|
+
"tags": [],
|
|
275
|
+
"text": ""
|
|
276
|
+
},
|
|
277
|
+
"getter": false,
|
|
278
|
+
"setter": false,
|
|
279
|
+
"reflect": true,
|
|
280
|
+
"attribute": "name"
|
|
281
|
+
},
|
|
282
|
+
"ariaLabel": {
|
|
283
|
+
"type": "string",
|
|
284
|
+
"mutable": false,
|
|
285
|
+
"complexType": {
|
|
286
|
+
"original": "string | null",
|
|
287
|
+
"resolved": "string",
|
|
288
|
+
"references": {}
|
|
289
|
+
},
|
|
290
|
+
"required": false,
|
|
291
|
+
"optional": false,
|
|
292
|
+
"docs": {
|
|
293
|
+
"tags": [],
|
|
294
|
+
"text": ""
|
|
295
|
+
},
|
|
296
|
+
"getter": false,
|
|
297
|
+
"setter": false,
|
|
298
|
+
"reflect": false,
|
|
299
|
+
"attribute": "aria-label",
|
|
300
|
+
"defaultValue": "null"
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
static get states() {
|
|
305
|
+
return {
|
|
306
|
+
"fieldDisabled": {}
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
static get events() {
|
|
310
|
+
return [{
|
|
311
|
+
"method": "qInput",
|
|
312
|
+
"name": "qInput",
|
|
313
|
+
"bubbles": true,
|
|
314
|
+
"cancelable": true,
|
|
315
|
+
"composed": true,
|
|
316
|
+
"docs": {
|
|
317
|
+
"tags": [],
|
|
318
|
+
"text": "Numeric value emitted continuously while dragging or using the keyboard."
|
|
319
|
+
},
|
|
320
|
+
"complexType": {
|
|
321
|
+
"original": "number",
|
|
322
|
+
"resolved": "number",
|
|
323
|
+
"references": {}
|
|
324
|
+
}
|
|
325
|
+
}, {
|
|
326
|
+
"method": "qChange",
|
|
327
|
+
"name": "qChange",
|
|
328
|
+
"bubbles": true,
|
|
329
|
+
"cancelable": true,
|
|
330
|
+
"composed": true,
|
|
331
|
+
"docs": {
|
|
332
|
+
"tags": [],
|
|
333
|
+
"text": "Numeric value emitted when the interaction is committed."
|
|
334
|
+
},
|
|
335
|
+
"complexType": {
|
|
336
|
+
"original": "number",
|
|
337
|
+
"resolved": "number",
|
|
338
|
+
"references": {}
|
|
339
|
+
}
|
|
340
|
+
}];
|
|
341
|
+
}
|
|
342
|
+
static get methods() {
|
|
343
|
+
return {
|
|
344
|
+
"focusElement": {
|
|
345
|
+
"complexType": {
|
|
346
|
+
"signature": "() => Promise<void>",
|
|
347
|
+
"parameters": [],
|
|
348
|
+
"references": {
|
|
349
|
+
"Promise": {
|
|
350
|
+
"location": "global",
|
|
351
|
+
"id": "global::Promise"
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
"return": "Promise<void>"
|
|
355
|
+
},
|
|
356
|
+
"docs": {
|
|
357
|
+
"text": "",
|
|
358
|
+
"tags": []
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
static get elementRef() { return "el"; }
|
|
364
|
+
static get watchers() {
|
|
365
|
+
return [{
|
|
366
|
+
"propName": "value",
|
|
367
|
+
"methodName": "constraintsChanged"
|
|
368
|
+
}, {
|
|
369
|
+
"propName": "min",
|
|
370
|
+
"methodName": "constraintsChanged"
|
|
371
|
+
}, {
|
|
372
|
+
"propName": "max",
|
|
373
|
+
"methodName": "constraintsChanged"
|
|
374
|
+
}, {
|
|
375
|
+
"propName": "step",
|
|
376
|
+
"methodName": "constraintsChanged"
|
|
377
|
+
}, {
|
|
378
|
+
"propName": "disabled",
|
|
379
|
+
"methodName": "disabledChanged"
|
|
380
|
+
}];
|
|
381
|
+
}
|
|
382
|
+
static get attachInternalsMemberName() { return "internals"; }
|
|
383
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { afterEach, beforeAll, expect, it } from "vitest";
|
|
2
|
+
import { userEvent } from "vitest/browser";
|
|
3
|
+
// @ts-ignore
|
|
4
|
+
import { defineCustomElements } from "../../../../../../packages/browser/components/dist/loader";
|
|
5
|
+
defineCustomElements();
|
|
6
|
+
beforeAll(async () => { await customElements.whenDefined('q-slider'); });
|
|
7
|
+
afterEach(() => document.body.replaceChildren());
|
|
8
|
+
const settle = () => new Promise(resolve => setTimeout(resolve, 30));
|
|
9
|
+
it('supports keyboard, form submission, reset and disabled fieldsets', async () => {
|
|
10
|
+
const form = document.createElement('form');
|
|
11
|
+
form.innerHTML = '<fieldset><q-slider name="gap" label="Gap" min="4" max="40" value="16" suffix="px"></q-slider></fieldset>';
|
|
12
|
+
document.body.append(form);
|
|
13
|
+
const slider = form.querySelector('q-slider');
|
|
14
|
+
await slider.componentOnReady();
|
|
15
|
+
const input = slider.shadowRoot.querySelector('input');
|
|
16
|
+
await userEvent.click(input);
|
|
17
|
+
await userEvent.keyboard('{Home}');
|
|
18
|
+
await settle();
|
|
19
|
+
expect(slider.value).toBe(4);
|
|
20
|
+
await userEvent.keyboard('{ArrowRight}');
|
|
21
|
+
await settle();
|
|
22
|
+
expect(slider.value).toBe(5);
|
|
23
|
+
expect(new FormData(form).get('gap')).toBe('5');
|
|
24
|
+
form.reset();
|
|
25
|
+
await settle();
|
|
26
|
+
expect(slider.value).toBe(16);
|
|
27
|
+
form.querySelector('fieldset').disabled = true;
|
|
28
|
+
await settle();
|
|
29
|
+
expect(input.disabled).toBe(true);
|
|
30
|
+
expect(new FormData(form).has('gap')).toBe(false);
|
|
31
|
+
});
|
|
32
|
+
it('participates in q-form values and theme overrides', async () => {
|
|
33
|
+
const form = document.createElement('q-form');
|
|
34
|
+
form.innerHTML = '<q-slider name="columns" label="Columns" min="1" max="10" value="3"></q-slider>';
|
|
35
|
+
document.body.append(form);
|
|
36
|
+
await form.componentOnReady();
|
|
37
|
+
const slider = form.querySelector('q-slider');
|
|
38
|
+
await slider.componentOnReady();
|
|
39
|
+
await form.setValues({ columns: '7' });
|
|
40
|
+
await settle();
|
|
41
|
+
expect(slider.value).toBe(7);
|
|
42
|
+
expect((await form.getValues()).columns).toBe('7');
|
|
43
|
+
slider.style.setProperty('--q-slider-track-color', 'rgb(10, 20, 30)');
|
|
44
|
+
expect(getComputedStyle(slider.shadowRoot.querySelector('input')).backgroundColor).toBe('rgb(10, 20, 30)');
|
|
45
|
+
});
|
|
@@ -234,12 +234,12 @@ export class QTextarea {
|
|
|
234
234
|
const hasError = !!(this.error || this.errorMessage);
|
|
235
235
|
const displayError = this.error || this.errorMessage;
|
|
236
236
|
const ariaLabel = this.ariaLabel?.trim() || (!this.label && this.placeholder ? this.placeholder : undefined);
|
|
237
|
-
return (h("div", { key: '
|
|
237
|
+
return (h("div", { key: 'b1dd4435db3190f58fd4bff45cb6b5bcc7eec0cf', style: feedbackStyle(this.reserveFeedback), class: {
|
|
238
238
|
'textarea-wrapper': true,
|
|
239
239
|
'is-disabled': this.isDisabled,
|
|
240
240
|
'has-error': hasError,
|
|
241
241
|
[`size-${this.size}`]: true
|
|
242
|
-
} }, h("span", { key: '
|
|
242
|
+
} }, h("span", { key: '6633f6aea71a4eada7ae9c8d0c785bc165b5a186', class: "textarea-size-probe", "aria-hidden": "true", ref: el => (this.sizeProbeEl = el) }, "M"), this.label && (h("label", { key: '19985e8ee5ab662ab1f5edc30d605d1fecf51dac', class: { 'textarea-label': true, 'q-label-hidden': this.labelHidden }, htmlFor: "q-field", part: "label" }, this.label)), h("textarea", { key: '2e3f0c3830078b5405d82b178293ca9036664458', ref: (el) => (this.textareaEl = el), id: "q-field", class: {
|
|
243
243
|
'textarea-box': true,
|
|
244
244
|
'resize-manual': this.activeResizeMode === 'manual'
|
|
245
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)));
|
|
@@ -255,3 +255,25 @@
|
|
|
255
255
|
/* Switch settings read label-first; checkbox choices retain control-first order. */
|
|
256
256
|
.type-switch .toggle-control { order: 1; margin-inline-start: auto; }
|
|
257
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: '499ad05de934991e437c25dca47b2ab3f8528e83', class: "toggle-container", style: feedbackStyle(this.reserveFeedback) }, h("div", { key: 'dc6d9613fdb146314da88e7d089f280182e2b0f1', 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: 'aec7c564a38545398b53d7b11edac6d615068efe', 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: 'fbdd90cb7acd529717d07fd739299af8506ac678', 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: '3d0d6200605b69297c0d6bea7bb6e00747d0e8b6', 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; }
|