@six-group/ui-library 0.0.0-insider.db2b416 → 0.0.0-insider.e2aca06
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/cjs/{form-control-d369af14.js → form-control-9769b310.js} +10 -7
- package/dist/cjs/form-control-9769b310.js.map +1 -0
- package/dist/cjs/index-900437fc.js +214 -1
- package/dist/cjs/index-900437fc.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/six-checkbox.cjs.entry.js +8 -13
- package/dist/cjs/six-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/six-datepicker.cjs.entry.js +5 -8
- package/dist/cjs/six-datepicker.cjs.entry.js.map +1 -1
- package/dist/cjs/six-dropdown_2.cjs.entry.js +1 -1
- package/dist/cjs/six-dropdown_2.cjs.entry.js.map +1 -1
- package/dist/cjs/six-error.cjs.entry.js +21 -0
- package/dist/cjs/six-error.cjs.entry.js.map +1 -0
- package/dist/cjs/six-group-label.cjs.entry.js +2 -2
- package/dist/cjs/six-group-label.cjs.entry.js.map +1 -1
- package/dist/cjs/six-input.cjs.entry.js +6 -3
- package/dist/cjs/six-input.cjs.entry.js.map +1 -1
- package/dist/cjs/six-radio.cjs.entry.js +9 -17
- package/dist/cjs/six-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/six-range.cjs.entry.js +6 -3
- package/dist/cjs/six-range.cjs.entry.js.map +1 -1
- package/dist/cjs/six-select.cjs.entry.js +12 -8
- package/dist/cjs/six-select.cjs.entry.js.map +1 -1
- package/dist/cjs/six-sidebar.cjs.entry.js +1 -1
- package/dist/cjs/six-sidebar.cjs.entry.js.map +1 -1
- package/dist/cjs/six-switch.cjs.entry.js +25 -5
- package/dist/cjs/six-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/six-tag.cjs.entry.js +24 -2
- package/dist/cjs/six-tag.cjs.entry.js.map +1 -1
- package/dist/cjs/six-textarea.cjs.entry.js +6 -3
- package/dist/cjs/six-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/six-timepicker.cjs.entry.js +4 -9
- package/dist/cjs/six-timepicker.cjs.entry.js.map +1 -1
- package/dist/cjs/six-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/six-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/ui-library.cjs.js +2 -2
- package/dist/cjs/ui-library.cjs.js.map +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/six-checkbox/six-checkbox.css +1 -1
- package/dist/collection/components/six-checkbox/six-checkbox.js +27 -31
- package/dist/collection/components/six-checkbox/six-checkbox.js.map +1 -1
- package/dist/collection/components/six-checkbox/test/six-checkbox.spec.js +6 -2
- package/dist/collection/components/six-checkbox/test/six-checkbox.spec.js.map +1 -1
- package/dist/collection/components/six-datepicker/six-datepicker.js +25 -12
- package/dist/collection/components/six-datepicker/six-datepicker.js.map +1 -1
- package/dist/collection/components/six-datepicker/test/six-datepicker.spec.js +1 -1
- package/dist/collection/components/six-datepicker/test/six-datepicker.spec.js.map +1 -1
- package/dist/collection/components/six-dropdown/six-dropdown.css +2 -1
- package/dist/collection/components/six-error/six-error.css +5 -0
- package/dist/collection/components/six-error/six-error.js +25 -0
- package/dist/collection/components/six-error/six-error.js.map +1 -0
- package/dist/collection/components/six-group-label/six-group-label.css +1 -1
- package/dist/collection/components/six-group-label/test/six-group-label.spec.js +3 -1
- package/dist/collection/components/six-group-label/test/six-group-label.spec.js.map +1 -1
- package/dist/collection/components/six-input/six-input.css +2 -2
- package/dist/collection/components/six-input/six-input.js +27 -4
- package/dist/collection/components/six-input/six-input.js.map +1 -1
- package/dist/collection/components/six-input/test/six-input.spec.js +3 -1
- package/dist/collection/components/six-input/test/six-input.spec.js.map +1 -1
- package/dist/collection/components/six-radio/six-radio.js +9 -34
- package/dist/collection/components/six-radio/six-radio.js.map +1 -1
- package/dist/collection/components/six-range/six-range.css +1 -1
- package/dist/collection/components/six-range/six-range.js +24 -3
- package/dist/collection/components/six-range/six-range.js.map +1 -1
- package/dist/collection/components/six-range/test/six-range.spec.js +3 -1
- package/dist/collection/components/six-range/test/six-range.spec.js.map +1 -1
- package/dist/collection/components/six-select/six-select.css +7 -10
- package/dist/collection/components/six-select/six-select.js +30 -8
- package/dist/collection/components/six-select/six-select.js.map +1 -1
- package/dist/collection/components/six-select/test/six-select.spec.js +8 -4
- package/dist/collection/components/six-select/test/six-select.spec.js.map +1 -1
- package/dist/collection/components/six-sidebar/six-sidebar.css +1 -0
- package/dist/collection/components/six-switch/six-switch.css +1 -1
- package/dist/collection/components/six-switch/six-switch.js +48 -5
- package/dist/collection/components/six-switch/six-switch.js.map +1 -1
- package/dist/collection/components/six-switch/test/six-switch.spec.js +6 -2
- package/dist/collection/components/six-switch/test/six-switch.spec.js.map +1 -1
- package/dist/collection/components/six-tag/six-tag.css +6 -0
- package/dist/collection/components/six-tag/six-tag.js +23 -1
- package/dist/collection/components/six-tag/six-tag.js.map +1 -1
- package/dist/collection/components/six-tag/test/six-tag.spec.js +12 -0
- package/dist/collection/components/six-tag/test/six-tag.spec.js.map +1 -1
- package/dist/collection/components/six-textarea/six-textarea.css +1 -1
- package/dist/collection/components/six-textarea/six-textarea.js +25 -4
- package/dist/collection/components/six-textarea/six-textarea.js.map +1 -1
- package/dist/collection/components/six-textarea/test/six-textarea.spec.js +3 -1
- package/dist/collection/components/six-textarea/test/six-textarea.spec.js.map +1 -1
- package/dist/collection/components/six-timepicker/six-timepicker.js +24 -12
- package/dist/collection/components/six-timepicker/six-timepicker.js.map +1 -1
- package/dist/collection/components/six-timepicker/test/six-timepicker.spec.js +15 -15
- package/dist/collection/components/six-timepicker/test/six-timepicker.spec.js.map +1 -1
- package/dist/collection/components/six-tooltip/six-tooltip.css +1 -1
- package/dist/collection/components/six-tooltip/six-tooltip.js +1 -1
- package/dist/collection/components/six-tooltip/six-tooltip.js.map +1 -1
- package/dist/collection/functional-components/form-control/form-control.js +8 -6
- package/dist/collection/functional-components/form-control/form-control.js.map +1 -1
- package/dist/components/form-control.js +9 -6
- package/dist/components/form-control.js.map +1 -1
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/six-checkbox.js +17 -15
- package/dist/components/six-checkbox.js.map +1 -1
- package/dist/components/six-datepicker.js +13 -9
- package/dist/components/six-datepicker.js.map +1 -1
- package/dist/components/six-dropdown2.js +8 -2
- package/dist/components/six-dropdown2.js.map +1 -1
- package/dist/components/six-error.d.ts +11 -0
- package/dist/components/six-error.js +8 -0
- package/dist/components/six-error.js.map +1 -0
- package/dist/components/six-error2.js +32 -0
- package/dist/components/six-error2.js.map +1 -0
- package/dist/components/six-group-label.js +8 -2
- package/dist/components/six-group-label.js.map +1 -1
- package/dist/components/six-header.js +8 -2
- package/dist/components/six-header.js.map +1 -1
- package/dist/components/six-input2.js +14 -3
- package/dist/components/six-input2.js.map +1 -1
- package/dist/components/six-radio.js +10 -19
- package/dist/components/six-radio.js.map +1 -1
- package/dist/components/six-range.js +14 -3
- package/dist/components/six-range.js.map +1 -1
- package/dist/components/six-search-field.js +7 -1
- package/dist/components/six-search-field.js.map +1 -1
- package/dist/components/six-select.js +39 -21
- package/dist/components/six-select.js.map +1 -1
- package/dist/components/six-sidebar.js +1 -1
- package/dist/components/six-sidebar.js.map +1 -1
- package/dist/components/six-switch.js +33 -5
- package/dist/components/six-switch.js.map +1 -1
- package/dist/components/six-tag2.js +34 -6
- package/dist/components/six-tag2.js.map +1 -1
- package/dist/components/six-textarea.js +14 -3
- package/dist/components/six-textarea.js.map +1 -1
- package/dist/components/six-timepicker2.js +12 -10
- package/dist/components/six-timepicker2.js.map +1 -1
- package/dist/components/six-tooltip2.js +2 -2
- package/dist/components/six-tooltip2.js.map +1 -1
- package/dist/components.json +420 -93
- package/dist/esm/{form-control-32cb533f.js → form-control-b0febe88.js} +10 -7
- package/dist/esm/form-control-b0febe88.js.map +1 -0
- package/dist/esm/index-8a74f992.js +214 -1
- package/dist/esm/index-8a74f992.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/six-checkbox.entry.js +8 -13
- package/dist/esm/six-checkbox.entry.js.map +1 -1
- package/dist/esm/six-datepicker.entry.js +5 -8
- package/dist/esm/six-datepicker.entry.js.map +1 -1
- package/dist/esm/six-dropdown_2.entry.js +1 -1
- package/dist/esm/six-dropdown_2.entry.js.map +1 -1
- package/dist/esm/six-error.entry.js +17 -0
- package/dist/esm/six-error.entry.js.map +1 -0
- package/dist/esm/six-group-label.entry.js +2 -2
- package/dist/esm/six-group-label.entry.js.map +1 -1
- package/dist/esm/six-input.entry.js +6 -3
- package/dist/esm/six-input.entry.js.map +1 -1
- package/dist/esm/six-radio.entry.js +9 -17
- package/dist/esm/six-radio.entry.js.map +1 -1
- package/dist/esm/six-range.entry.js +6 -3
- package/dist/esm/six-range.entry.js.map +1 -1
- package/dist/esm/six-select.entry.js +12 -8
- package/dist/esm/six-select.entry.js.map +1 -1
- package/dist/esm/six-sidebar.entry.js +1 -1
- package/dist/esm/six-sidebar.entry.js.map +1 -1
- package/dist/esm/six-switch.entry.js +25 -5
- package/dist/esm/six-switch.entry.js.map +1 -1
- package/dist/esm/six-tag.entry.js +24 -2
- package/dist/esm/six-tag.entry.js.map +1 -1
- package/dist/esm/six-textarea.entry.js +6 -3
- package/dist/esm/six-textarea.entry.js.map +1 -1
- package/dist/esm/six-timepicker.entry.js +4 -9
- package/dist/esm/six-timepicker.entry.js.map +1 -1
- package/dist/esm/six-tooltip.entry.js +2 -2
- package/dist/esm/six-tooltip.entry.js.map +1 -1
- package/dist/esm/ui-library.js +2 -2
- package/dist/esm/ui-library.js.map +1 -1
- package/dist/types/components/six-checkbox/six-checkbox.d.ts +4 -5
- package/dist/types/components/six-datepicker/six-datepicker.d.ts +4 -2
- package/dist/types/components/six-error/six-error.d.ts +9 -0
- package/dist/types/components/six-input/six-input.d.ts +7 -2
- package/dist/types/components/six-radio/six-radio.d.ts +0 -5
- package/dist/types/components/six-range/six-range.d.ts +4 -1
- package/dist/types/components/six-select/six-select.d.ts +4 -1
- package/dist/types/components/six-switch/six-switch.d.ts +8 -1
- package/dist/types/components/six-tag/six-tag.d.ts +8 -0
- package/dist/types/components/six-textarea/six-textarea.d.ts +4 -1
- package/dist/types/components/six-timepicker/six-timepicker.d.ts +5 -2
- package/dist/types/components.d.ts +109 -24
- package/dist/types/functional-components/form-control/form-control.d.ts +6 -2
- package/dist/ui-library/{p-da19c7ce.entry.js → p-14c1ec31.entry.js} +2 -2
- package/dist/ui-library/p-14c1ec31.entry.js.map +1 -0
- package/dist/ui-library/p-25bb1752.entry.js +2 -0
- package/dist/ui-library/p-25bb1752.entry.js.map +1 -0
- package/dist/ui-library/p-264d4ea8.entry.js +2 -0
- package/dist/ui-library/p-264d4ea8.entry.js.map +1 -0
- package/dist/ui-library/p-2a141e10.entry.js +2 -0
- package/dist/ui-library/p-2a141e10.entry.js.map +1 -0
- package/dist/ui-library/p-4435ff73.entry.js +2 -0
- package/dist/ui-library/p-4435ff73.entry.js.map +1 -0
- package/dist/ui-library/p-538f3c50.entry.js +2 -0
- package/dist/ui-library/p-538f3c50.entry.js.map +1 -0
- package/dist/ui-library/p-6153045b.js.map +1 -1
- package/dist/ui-library/p-a457fee8.entry.js +2 -0
- package/dist/ui-library/p-a457fee8.entry.js.map +1 -0
- package/dist/ui-library/p-ab91c2a9.entry.js +2 -0
- package/dist/ui-library/p-ab91c2a9.entry.js.map +1 -0
- package/dist/ui-library/p-b57afbe4.entry.js +2 -0
- package/dist/ui-library/p-b57afbe4.entry.js.map +1 -0
- package/dist/ui-library/p-b6f47c9d.entry.js +2 -0
- package/dist/ui-library/p-b6f47c9d.entry.js.map +1 -0
- package/dist/ui-library/p-db34a6cc.entry.js +2 -0
- package/dist/ui-library/p-db34a6cc.entry.js.map +1 -0
- package/dist/ui-library/p-db936ad7.entry.js +2 -0
- package/dist/ui-library/{p-d367f4f9.entry.js.map → p-db936ad7.entry.js.map} +1 -1
- package/dist/ui-library/p-dc4f41d8.entry.js +2 -0
- package/dist/ui-library/p-dc4f41d8.entry.js.map +1 -0
- package/dist/ui-library/p-e5020f0d.js +2 -0
- package/dist/ui-library/p-e5020f0d.js.map +1 -0
- package/dist/ui-library/p-e775dcb4.entry.js +2 -0
- package/dist/ui-library/p-e775dcb4.entry.js.map +1 -0
- package/dist/ui-library/p-f1dc3a88.entry.js +2 -0
- package/dist/ui-library/p-f1dc3a88.entry.js.map +1 -0
- package/dist/ui-library/ui-library.esm.js +1 -1
- package/dist/ui-library/ui-library.esm.js.map +1 -1
- package/package.json +3 -3
- package/dist/cjs/form-control-d369af14.js.map +0 -1
- package/dist/esm/form-control-32cb533f.js.map +0 -1
- package/dist/ui-library/p-1730a174.entry.js +0 -2
- package/dist/ui-library/p-1730a174.entry.js.map +0 -1
- package/dist/ui-library/p-1d0bee53.entry.js +0 -2
- package/dist/ui-library/p-1d0bee53.entry.js.map +0 -1
- package/dist/ui-library/p-314b2096.entry.js +0 -2
- package/dist/ui-library/p-314b2096.entry.js.map +0 -1
- package/dist/ui-library/p-330a4988.entry.js +0 -2
- package/dist/ui-library/p-330a4988.entry.js.map +0 -1
- package/dist/ui-library/p-4abed9df.entry.js +0 -2
- package/dist/ui-library/p-4abed9df.entry.js.map +0 -1
- package/dist/ui-library/p-5d6b7353.entry.js +0 -2
- package/dist/ui-library/p-5d6b7353.entry.js.map +0 -1
- package/dist/ui-library/p-6eb24bcb.entry.js +0 -2
- package/dist/ui-library/p-6eb24bcb.entry.js.map +0 -1
- package/dist/ui-library/p-72254eef.entry.js +0 -2
- package/dist/ui-library/p-72254eef.entry.js.map +0 -1
- package/dist/ui-library/p-cf49252a.entry.js +0 -2
- package/dist/ui-library/p-cf49252a.entry.js.map +0 -1
- package/dist/ui-library/p-d367f4f9.entry.js +0 -2
- package/dist/ui-library/p-d42c2025.js +0 -2
- package/dist/ui-library/p-d42c2025.js.map +0 -1
- package/dist/ui-library/p-da19c7ce.entry.js.map +0 -1
- package/dist/ui-library/p-e0b13ad3.entry.js +0 -2
- package/dist/ui-library/p-e0b13ad3.entry.js.map +0 -1
- package/dist/ui-library/p-f1eb03ba.entry.js +0 -2
- package/dist/ui-library/p-f1eb03ba.entry.js.map +0 -1
- package/dist/ui-library/p-ff90ffd1.entry.js +0 -2
- package/dist/ui-library/p-ff90ffd1.entry.js.map +0 -1
- package/readme.md +0 -156
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as o,c as t,h as r,g as i}from"./p-6153045b.js";import{F as e}from"./p-d42c2025.js";import{h as a}from"./p-15559d38.js";import{E as s}from"./p-7d95def3.js";const l=':host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}.form-control .form-control__label{display:none}.form-control .form-control__help-text{display:none}.form-control .form-control__error-text{display:none}.form-control--has-label .form-control__label{display:inline-block;color:var(--six-input-label-color);font-weight:var(--six-font-weight-bold);margin-bottom:var(--six-spacing-x-small)}.form-control--has-label .form-control__label__required::after{color:var(--six-color-danger-800);content:"*"}.form-control--has-label.form-control--small .form-control__label{font-size:var(--six-input-label-font-size-small)}.form-control--has-label.form-control--medium .form-control__label{font-size:var(--six-input-label-font-size-medium)}.form-control--has-label.form-control--large .form-control_label{font-size:var(--six-input-label-font-size-large)}.form-control--has-help-text .form-control__help-text{display:block;color:var(--six-input-help-text-color);margin-top:var(--six-spacing-x-small)}.form-control--has-help-text .form-control__help-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-help-text.form-control--small .form-control__help-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-help-text.form-control--medium .form-control__help-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-help-text.form-control--large .form-control__help-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--has-error-text .form-control__error-text{display:block;color:var(--six-color-danger-800);margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text .form-control__error-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text.form-control--small .form-control__error-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-error-text.form-control--medium .form-control__error-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-error-text.form-control--large .form-control__error-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--disabled .form-control__help-text{color:var(--six-input-help-text-color-disabled)}.form-control--disabled .form-control__label{color:var(--six-input-label-color-disabled)}.form-control--invalid:not(.form-control--disabled) .form-control__label{color:var(--six-input-label-color)}:host{--thumb-size:14px;--tooltip-offset-y:10px;--track-color:var(--six-color-web-rock-900);--thumb-color:var(--six-color-web-rock-900);--track-height:3px;display:block}.range{position:relative}.range .range__control{-webkit-appearance:none;width:100%;height:var(--six-input-height-medium);background:transparent;line-height:var(--six-input-height-medium);vertical-align:middle}.range .range__control::-webkit-slider-runnable-track{width:100%;height:var(--track-height);border-radius:3px;border:none}.range .range__control::-webkit-slider-thumb{border:none;width:var(--thumb-size);height:var(--thumb-size);border-radius:50%;background-color:var(--thumb-color);-webkit-appearance:none;margin-top:calc(var(--thumb-size) / -2 + var(--track-height) / 2);transition:var(--six-transition-fast) border-color, var(--six-transition-fast) background-color, var(--six-transition-fast) color, var(--six-transition-fast) box-shadow, var(--six-transition-fast) transform;cursor:pointer}.range .range__control:not(:disabled)::-webkit-slider-thumb:hover{background-color:var(--thumb-color)}.range .range__control:not(:disabled):focus::-webkit-slider-thumb{background-color:var(--thumb-color)}.range .range__control:not(:disabled)::-webkit-slider-thumb:active{background-color:var(--thumb-color);cursor:grabbing}.range .range__control::-moz-focus-outer{border:0}.range .range__control::-moz-range-track{width:100%;height:var(--track-height);background-color:var(--six-progress-track-color);border-radius:3px;border:none}.range .range__control::-moz-range-progress{height:var(--track-height);border-radius:3px;background-color:var(--track-color);border:none}.range .range__control::-moz-range-thumb{border:none;height:var(--thumb-size);width:var(--thumb-size);border-radius:50%;background-color:var(--thumb-color);transition:var(--six-transition-fast) border-color, var(--six-transition-fast) background-color, var(--six-transition-fast) color, var(--six-transition-fast) box-shadow, var(--six-transition-fast) transform;cursor:pointer}.range .range__control:not(:disabled)::-moz-range-thumb:hover{background-color:var(--thumb-color)}.range .range__control:not(:disabled):focus::-moz-range-thumb{background-color:var(--thumb-color)}.range .range__control:not(:disabled)::-moz-range-thumb:active{background-color:var(--thumb-color);cursor:grabbing}.range .range__control:focus{outline:none}.range .range__control:disabled::-webkit-slider-thumb{cursor:not-allowed;color:var(--six-color-web-rock-300);border-color:var(--six-color-web-rock-300);background-color:var(--six-color-web-rock-300)}.range .range__control:disabled::-moz-range-thumb{cursor:not-allowed;color:var(--six-color-web-rock-300);border-color:var(--six-color-web-rock-300);background-color:var(--six-color-web-rock-300)}.range__tooltip{position:absolute;z-index:var(--six-z-index-tooltip);left:1px;border-radius:var(--six-border-radius-medium);background-color:var(--six-color-web-rock-900);font-family:var(--six-font-family);font-size:var(--six-tooltip-font-size);font-weight:var(--six-tooltip-font-weight);line-height:var(--six-tooltip-line-height);color:var(--six-color-white);opacity:0;padding:var(--six-spacing-xxx-small) var(--six-spacing-xx-small);transition:var(--six-transition-fast) opacity;pointer-events:none}.range__tooltip::after{content:"";position:absolute;width:0;height:0;left:50%;margin-left:calc(-1 * var(--six-tooltip-arrow-size))}.range--tooltip-visible .range__tooltip{opacity:1}.range--tooltip-top .range__tooltip{top:calc(-1 * var(--thumb-size) - var(--tooltip-offset-y))}.range--tooltip-top .range__tooltip::after{border-top:var(--six-tooltip-arrow-size) solid var(--six-color-web-rock-900);border-left:var(--six-tooltip-arrow-size) solid transparent;border-right:var(--six-tooltip-arrow-size) solid transparent;top:100%}.range--tooltip-bottom .range__tooltip{bottom:calc(-1 * var(--thumb-size) - var(--tooltip-offset-y))}.range--tooltip-bottom .range__tooltip::after{border-bottom:var(--six-tooltip-arrow-size) solid var(--six-color-web-rock-900);border-left:var(--six-tooltip-arrow-size) solid transparent;border-right:var(--six-tooltip-arrow-size) solid transparent;bottom:100%}';let n=0;const h=class{constructor(r){o(this,r);this.sixChange=t(this,"six-range-change",7);this.sixBlur=t(this,"six-range-blur",7);this.sixFocus=t(this,"six-range-focus",7);this.inputId=`input-${++n}`;this.labelId=`input-label-${n}`;this.helpTextId=`input-help-text-${n}`;this.errorTextId=`input-error-text-${n}`;this.eventListeners=new s;this.handleInput=()=>{if(this.nativeInput!=null){this.update(parseFloat(this.nativeInput.value))}requestAnimationFrame((()=>{this.sixChange.emit()}))};this.handleBlur=()=>{var o;this.hasFocus=false;this.hasTooltip=false;this.sixBlur.emit();if(this.nativeInput!=null){(o=this.resizeObserver)===null||o===void 0?void 0:o.unobserve(this.nativeInput)}};this.handleFocus=()=>{var o;this.hasFocus=true;this.hasTooltip=true;this.sixFocus.emit();if(this.nativeInput!=null){(o=this.resizeObserver)===null||o===void 0?void 0:o.observe(this.nativeInput)}};this.handleSlotChange=()=>{this.hasHelpTextSlot=a(this.host,"help-text");this.hasLabelSlot=a(this.host,"label")};this.handleTouchStart=()=>{this.setFocus()};this.hasFocus=false;this.hasHelpTextSlot=false;this.hasLabelSlot=false;this.hasTooltip=false;this.name="";this.value=0;this.required=false;this.helpText="";this.disabled=false;this.label="";this.errorText="";this.invalid=false;this.min=0;this.max=100;this.step=1;this.tooltip="top";this.tooltipFormatter=o=>o.toString()}handleLabelChange(){this.handleSlotChange()}handleValueChange(){this.update()}connectedCallback(){var o;(o=this.host.shadowRoot)===null||o===void 0?void 0:o.addEventListener("slotchange",this.handleSlotChange)}componentWillLoad(){this.update();this.handleSlotChange()}componentDidLoad(){const o=this.nativeInput;if(o==null){return}this.update();this.resizeObserver=new ResizeObserver((()=>this.update()))}disconnectedCallback(){var o;(o=this.host.shadowRoot)===null||o===void 0?void 0:o.removeEventListener("slotchange",this.handleSlotChange);this.eventListeners.removeAll()}async setFocus(o){var t;(t=this.nativeInput)===null||t===void 0?void 0:t.focus(o)}async removeFocus(){var o;(o=this.nativeInput)===null||o===void 0?void 0:o.blur()}syncTooltip(o,t,r){if(this.tooltip!=="none"&&this.nativeInput!=null&&this.output!=null){const i=Math.max(0,(r-o)/(t-o));const e=this.nativeInput.offsetWidth;const a=this.output.offsetWidth;const s=getComputedStyle(this.nativeInput).getPropertyValue("--thumb-size");const l=`calc(${e*i}px - calc(calc(${i} * ${s}) - calc(${s} / 2)))`;this.output.style.transform=`translateX(${l})`;this.output.style.marginLeft=`-${a/2}px`}}isFirefox(){return navigator.userAgent.toLowerCase().indexOf("firefox")>-1}update(o){var t,r;if(o!=null){this.value=o}const i=(t=Number(this.min))!==null&&t!==void 0?t:0;const e=(r=Number(this.max))!==null&&r!==void 0?r:0;let a;const s=parseFloat(this.value);if(isNaN(s)){a=this.getDefaultValue(i,e)}else{a=s}if(this.nativeInput!=null){this.nativeInput.value=a.toString();this.value=parseFloat(this.nativeInput.value)}else{this.value=a}this.calculateColorRunnableTrack(i,e,this.value);this.syncTooltip(i,e,this.value)}getDefaultValue(o,t){return t<o?o:o+(t-o)/2}calculateColorRunnableTrack(o,t,r){if(!this.isFirefox()&&this.nativeInput!=null){const i=Math.ceil((r-o)/(t-o)*100);this.nativeInput.style.background="-webkit-linear-gradient(left, var(--track-color) 0%, var(--track-color) "+i+"%, var(--six-color-web-rock-300) "+i+"%)"}}render(){return r(e,{inputId:this.inputId,label:this.label,labelId:this.labelId,hasLabelSlot:this.hasLabelSlot,helpTextId:this.helpTextId,helpText:this.helpText,hasHelpTextSlot:this.hasHelpTextSlot,size:"medium",errorTextId:this.errorTextId,errorText:this.errorText,disabled:this.disabled,required:this.required,displayError:this.invalid},r("div",{part:"base",class:{range:true,"range--disabled":this.disabled,"range--focused":this.hasFocus,"range--tooltip-visible":this.hasTooltip,"range--tooltip-top":this.tooltip==="top","range--tooltip-bottom":this.tooltip==="bottom"},onTouchStart:this.handleTouchStart},r("input",{part:"input",ref:o=>this.nativeInput=o,type:"range",class:"range__control",name:this.name,disabled:this.disabled,min:this.min,max:this.max,step:this.step,value:this.value,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur}),this.tooltip!=="none"&&r("output",{part:"tooltip",ref:o=>this.output=o,class:"range__tooltip"},this.tooltipFormatter(this.value))))}get host(){return i(this)}static get watchers(){return{label:["handleLabelChange"],errorText:["handleLabelChange"],helpText:["handleLabelChange"],value:["handleValueChange"],min:["handleValueChange"],max:["handleValueChange"]}}};h.style=l;export{h as six_range};
|
|
2
|
-
//# sourceMappingURL=p-ff90ffd1.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["sixRangeCss","id","SixRange","this","inputId","labelId","helpTextId","errorTextId","eventListeners","EventListeners","handleInput","nativeInput","update","parseFloat","value","requestAnimationFrame","sixChange","emit","handleBlur","hasFocus","hasTooltip","sixBlur","_a","resizeObserver","unobserve","handleFocus","sixFocus","observe","handleSlotChange","hasHelpTextSlot","hasSlot","host","hasLabelSlot","handleTouchStart","setFocus","toString","handleLabelChange","handleValueChange","connectedCallback","shadowRoot","addEventListener","componentWillLoad","componentDidLoad","ResizeObserver","disconnectedCallback","removeEventListener","removeAll","options","focus","removeFocus","blur","syncTooltip","min","max","tooltip","output","percent","Math","inputWidth","offsetWidth","tooltipWidth","thumbSize","getComputedStyle","getPropertyValue","x","style","transform","marginLeft","isFirefox","navigator","userAgent","toLowerCase","indexOf","updateValue","Number","_b","parsedValue","isNaN","getDefaultValue","calculateColorRunnableTrack","ceil","background","render","h","FormControl","label","helpText","size","errorText","disabled","required","displayError","invalid","part","class","range","onTouchStart","ref","el","type","name","step","onInput","onFocus","onBlur","tooltipFormatter"],"sources":["src/components/six-range/six-range.scss?tag=six-range&encapsulation=shadow","src/components/six-range/six-range.tsx"],"sourcesContent":["@import 'src/global/component';\n@import '../../functional-components/form-control/form-control';\n\n:host {\n --thumb-size: 14px;\n --tooltip-offset-y: 10px;\n --track-color: var(--six-color-web-rock-900);\n --thumb-color: var(--six-color-web-rock-900);\n --track-height: 3px;\n\n display: block;\n}\n\n.range {\n position: relative;\n\n .range__control {\n -webkit-appearance: none;\n width: 100%;\n height: var(--six-input-height-medium);\n background: transparent;\n line-height: var(--six-input-height-medium);\n vertical-align: middle;\n\n &::-webkit-slider-runnable-track {\n width: 100%;\n height: var(--track-height);\n border-radius: 3px;\n border: none;\n }\n\n &::-webkit-slider-thumb {\n border: none;\n width: var(--thumb-size);\n height: var(--thumb-size);\n border-radius: 50%;\n background-color: var(--thumb-color);\n -webkit-appearance: none;\n margin-top: calc(var(--thumb-size) / -2 + var(--track-height) / 2);\n transition: var(--six-transition-fast) border-color, var(--six-transition-fast) background-color,\n var(--six-transition-fast) color, var(--six-transition-fast) box-shadow, var(--six-transition-fast) transform;\n cursor: pointer;\n }\n\n &:not(:disabled)::-webkit-slider-thumb:hover {\n background-color: var(--thumb-color);\n }\n\n &:not(:disabled):focus::-webkit-slider-thumb {\n background-color: var(--thumb-color);\n }\n\n &:not(:disabled)::-webkit-slider-thumb:active {\n background-color: var(--thumb-color);\n cursor: grabbing;\n }\n\n // Firefox\n &::-moz-focus-outer {\n border: 0;\n }\n\n &::-moz-range-track {\n width: 100%;\n height: var(--track-height);\n background-color: var(--six-progress-track-color);\n border-radius: 3px;\n border: none;\n }\n\n &::-moz-range-progress {\n height: var(--track-height);\n border-radius: 3px;\n background-color: var(--track-color);\n border: none;\n }\n\n &::-moz-range-thumb {\n border: none;\n height: var(--thumb-size);\n width: var(--thumb-size);\n border-radius: 50%;\n background-color: var(--thumb-color);\n transition: var(--six-transition-fast) border-color, var(--six-transition-fast) background-color,\n var(--six-transition-fast) color, var(--six-transition-fast) box-shadow, var(--six-transition-fast) transform;\n cursor: pointer;\n }\n\n &:not(:disabled)::-moz-range-thumb:hover {\n background-color: var(--thumb-color);\n }\n\n &:not(:disabled):focus::-moz-range-thumb {\n background-color: var(--thumb-color);\n }\n\n &:not(:disabled)::-moz-range-thumb:active {\n background-color: var(--thumb-color);\n cursor: grabbing;\n }\n\n // States\n &:focus {\n outline: none;\n }\n\n &:disabled {\n &::-webkit-slider-thumb {\n cursor: not-allowed;\n color: var(--six-color-web-rock-300);\n border-color: var(--six-color-web-rock-300);\n background-color: var(--six-color-web-rock-300);\n }\n\n &::-moz-range-thumb {\n cursor: not-allowed;\n color: var(--six-color-web-rock-300);\n border-color: var(--six-color-web-rock-300);\n background-color: var(--six-color-web-rock-300);\n }\n }\n }\n}\n\n// Tooltip\n.range__tooltip {\n position: absolute;\n z-index: var(--six-z-index-tooltip);\n left: 1px;\n border-radius: var(--six-border-radius-medium);\n background-color: var(--six-color-web-rock-900);\n font-family: var(--six-font-family);\n font-size: var(--six-tooltip-font-size);\n font-weight: var(--six-tooltip-font-weight);\n line-height: var(--six-tooltip-line-height);\n color: var(--six-color-white);\n opacity: 0;\n padding: var(--six-spacing-xxx-small) var(--six-spacing-xx-small);\n transition: var(--six-transition-fast) opacity;\n pointer-events: none;\n\n &::after {\n content: '';\n position: absolute;\n width: 0;\n height: 0;\n left: 50%;\n margin-left: calc(-1 * var(--six-tooltip-arrow-size));\n }\n}\n\n.range--tooltip-visible .range__tooltip {\n opacity: 1;\n}\n\n// Tooltip on top\n.range--tooltip-top .range__tooltip {\n top: calc(-1 * var(--thumb-size) - var(--tooltip-offset-y));\n\n &::after {\n border-top: var(--six-tooltip-arrow-size) solid var(--six-color-web-rock-900);\n border-left: var(--six-tooltip-arrow-size) solid transparent;\n border-right: var(--six-tooltip-arrow-size) solid transparent;\n top: 100%;\n }\n}\n\n// Tooltip on bottom\n.range--tooltip-bottom .range__tooltip {\n bottom: calc(-1 * var(--thumb-size) - var(--tooltip-offset-y));\n\n &::after {\n border-bottom: var(--six-tooltip-arrow-size) solid var(--six-color-web-rock-900);\n border-left: var(--six-tooltip-arrow-size) solid transparent;\n border-right: var(--six-tooltip-arrow-size) solid transparent;\n bottom: 100%;\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport FormControl from '../../functional-components/form-control/form-control';\nimport { hasSlot } from '../../utils/slot';\nimport { EmptyPayload } from '../../utils/types';\nimport { EventListeners } from '../../utils/event-listeners';\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot label - The input's label. Alternatively, you can use the label prop.\n * @slot help-text - Help text that describes how to use the input. Alternatively, you can use the help-text prop.\n * @slot error-text - Error text that is shown for validation errors. Alternatively, you can use the error-text prop.\n *\n * @part base - The component's base wrapper.\n * @part input - The native range input.\n * @part tooltip - The range tooltip.\n */\n@Component({\n tag: 'six-range',\n styleUrl: 'six-range.scss',\n shadow: true,\n})\nexport class SixRange {\n private inputId = `input-${++id}`;\n private labelId = `input-label-${id}`;\n private helpTextId = `input-help-text-${id}`;\n private errorTextId = `input-error-text-${id}`;\n private eventListeners = new EventListeners();\n private resizeObserver?: ResizeObserver;\n\n private output?: HTMLElement;\n private nativeInput?: HTMLInputElement;\n\n @Element() host!: HTMLSixRangeElement;\n\n @State() hasFocus = false;\n @State() hasHelpTextSlot = false;\n @State() hasLabelSlot = false;\n @State() hasTooltip = false;\n\n /** The input's name attribute. */\n @Prop() name = '';\n\n /** The input's value attribute. */\n @Prop({ mutable: true }) value = 0;\n\n /** Set to true to show an asterisk beneath the label. */\n @Prop() required = false;\n\n /** The range's help text. Alternatively, you can use the help-text slot. */\n @Prop() helpText = '';\n\n /** Set to true to disable the input. */\n @Prop() disabled = false;\n\n /** The label text. */\n @Prop() label = '';\n\n /** The error message shown, if `invalid` is set to true. */\n @Prop() errorText = '';\n\n /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */\n @Prop({ reflect: true }) invalid = false;\n\n /** The input's min attribute. */\n @Prop() min = 0;\n\n /** The input's max attribute. */\n @Prop() max = 100;\n\n /** The input's step attribute. */\n @Prop() step = 1;\n\n /** The preferred placedment of the tooltip. */\n @Prop() tooltip: 'top' | 'bottom' | 'none' = 'top';\n\n /** A function used to format the tooltip's value. */\n @Prop() tooltipFormatter = (value: number) => value.toString();\n\n /** Emitted when the control's value changes. */\n @Event({ eventName: 'six-range-change' }) sixChange!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control loses focus. */\n @Event({ eventName: 'six-range-blur' }) sixBlur!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control gains focus. */\n @Event({ eventName: 'six-range-focus' }) sixFocus!: EventEmitter<EmptyPayload>;\n\n @Watch('label')\n @Watch('errorText')\n @Watch('helpText')\n handleLabelChange() {\n this.handleSlotChange();\n }\n\n @Watch('value')\n @Watch('min')\n @Watch('max')\n handleValueChange() {\n this.update();\n }\n\n connectedCallback() {\n this.host.shadowRoot?.addEventListener('slotchange', this.handleSlotChange);\n }\n\n componentWillLoad() {\n this.update();\n this.handleSlotChange();\n }\n\n componentDidLoad() {\n const nativeInput = this.nativeInput;\n if (nativeInput == null) {\n return;\n }\n this.update();\n this.resizeObserver = new ResizeObserver(() => this.update());\n }\n\n disconnectedCallback() {\n this.host.shadowRoot?.removeEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.removeAll();\n }\n\n /** Sets focus on the input. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.nativeInput?.focus(options);\n }\n\n /** Removes focus from the input. */\n @Method()\n async removeFocus() {\n this.nativeInput?.blur();\n }\n\n private handleInput = () => {\n if (this.nativeInput != null) {\n this.update(parseFloat(this.nativeInput.value));\n }\n requestAnimationFrame(() => {\n this.sixChange.emit();\n });\n };\n\n private handleBlur = () => {\n this.hasFocus = false;\n this.hasTooltip = false;\n this.sixBlur.emit();\n if (this.nativeInput != null) {\n this.resizeObserver?.unobserve(this.nativeInput);\n }\n };\n\n private handleFocus = () => {\n this.hasFocus = true;\n this.hasTooltip = true;\n this.sixFocus.emit();\n if (this.nativeInput != null) {\n this.resizeObserver?.observe(this.nativeInput);\n }\n };\n\n private handleSlotChange = () => {\n this.hasHelpTextSlot = hasSlot(this.host, 'help-text');\n this.hasLabelSlot = hasSlot(this.host, 'label');\n };\n\n private handleTouchStart = () => {\n this.setFocus();\n };\n\n private syncTooltip(min: number, max: number, value: number) {\n if (this.tooltip !== 'none' && this.nativeInput != null && this.output != null) {\n const percent = Math.max(0, (value - min) / (max - min));\n const inputWidth = this.nativeInput.offsetWidth;\n const tooltipWidth = this.output.offsetWidth;\n const thumbSize = getComputedStyle(this.nativeInput).getPropertyValue('--thumb-size');\n const x = `calc(${inputWidth * percent}px - calc(calc(${percent} * ${thumbSize}) - calc(${thumbSize} / 2)))`;\n this.output.style.transform = `translateX(${x})`;\n this.output.style.marginLeft = `-${tooltipWidth / 2}px`;\n }\n }\n\n private isFirefox() {\n return navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\n }\n\n private update(updateValue?: number) {\n if (updateValue != null) {\n this.value = updateValue;\n }\n\n const min = Number(this.min) ?? 0;\n const max = Number(this.max) ?? 0;\n let value;\n const parsedValue = parseFloat(this.value as never);\n if (isNaN(parsedValue)) {\n value = this.getDefaultValue(min, max);\n } else {\n value = parsedValue;\n }\n\n if (this.nativeInput != null) {\n // The value may have constraints, so we set the native control's\n // value and sync it back to ensure it adheres to min, max, and step\n // properly.\n this.nativeInput.value = value.toString();\n this.value = parseFloat(this.nativeInput.value);\n } else {\n this.value = value;\n }\n this.calculateColorRunnableTrack(min, max, this.value);\n this.syncTooltip(min, max, this.value);\n }\n\n /**\n * from https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/range#value\n */\n private getDefaultValue(min: number, max: number): number {\n return max < min ? min : min + (max - min) / 2;\n }\n\n /**\n * For Firefox this functionality is not needed because it is supported by standard CSS.\n */\n private calculateColorRunnableTrack(min: number, max: number, value: number) {\n if (!this.isFirefox() && this.nativeInput != null) {\n const percent = Math.ceil(((value - min) / (max - min)) * 100);\n this.nativeInput.style.background =\n '-webkit-linear-gradient(left, var(--track-color) 0%, var(--track-color) ' +\n percent +\n '%, var(--six-color-web-rock-300) ' +\n percent +\n '%)';\n }\n }\n\n render() {\n return (\n <FormControl\n inputId={this.inputId}\n label={this.label}\n labelId={this.labelId}\n hasLabelSlot={this.hasLabelSlot}\n helpTextId={this.helpTextId}\n helpText={this.helpText}\n hasHelpTextSlot={this.hasHelpTextSlot}\n size=\"medium\"\n errorTextId={this.errorTextId}\n errorText={this.errorText}\n disabled={this.disabled}\n required={this.required}\n displayError={this.invalid}\n >\n <div\n part=\"base\"\n class={{\n range: true,\n\n // States\n 'range--disabled': this.disabled,\n 'range--focused': this.hasFocus,\n 'range--tooltip-visible': this.hasTooltip,\n 'range--tooltip-top': this.tooltip === 'top',\n 'range--tooltip-bottom': this.tooltip === 'bottom',\n }}\n onTouchStart={this.handleTouchStart}\n >\n <input\n part=\"input\"\n ref={(el) => (this.nativeInput = el)}\n type=\"range\"\n class=\"range__control\"\n name={this.name}\n disabled={this.disabled}\n min={this.min}\n max={this.max}\n step={this.step}\n value={this.value}\n onInput={this.handleInput}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n />\n {this.tooltip !== 'none' && (\n <output part=\"tooltip\" ref={(el) => (this.output = el)} class=\"range__tooltip\">\n {this.tooltipFormatter(this.value)}\n </output>\n )}\n </div>\n </FormControl>\n );\n }\n}\n"],"mappings":"qKAAA,MAAMA,EAAc,29MCMpB,IAAIC,EAAK,E,MAqBIC,EAAQ,M,uJACXC,KAAAC,QAAU,WAAWH,IACrBE,KAAAE,QAAU,eAAeJ,IACzBE,KAAAG,WAAa,mBAAmBL,IAChCE,KAAAI,YAAc,oBAAoBN,IAClCE,KAAAK,eAAiB,IAAIC,EA8GrBN,KAAAO,YAAc,KACpB,GAAIP,KAAKQ,aAAe,KAAM,CAC5BR,KAAKS,OAAOC,WAAWV,KAAKQ,YAAYG,O,CAE1CC,uBAAsB,KACpBZ,KAAKa,UAAUC,MAAM,GACrB,EAGId,KAAAe,WAAa,K,MACnBf,KAAKgB,SAAW,MAChBhB,KAAKiB,WAAa,MAClBjB,KAAKkB,QAAQJ,OACb,GAAId,KAAKQ,aAAe,KAAM,EAC5BW,EAAAnB,KAAKoB,kBAAc,MAAAD,SAAA,SAAAA,EAAEE,UAAUrB,KAAKQ,Y,GAIhCR,KAAAsB,YAAc,K,MACpBtB,KAAKgB,SAAW,KAChBhB,KAAKiB,WA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@@ -1,156 +0,0 @@
|
|
|
1
|
-

|
|
2
|
-
|
|
3
|
-
# Six UI Components
|
|
4
|
-
|
|
5
|
-
This is the actual UI components library.
|
|
6
|
-
|
|
7
|
-
The Webcomponents in this library are built with Stencil.
|
|
8
|
-
|
|
9
|
-
## Stencil
|
|
10
|
-
|
|
11
|
-
Stencil is a compiler for building fast web apps using Web Components.
|
|
12
|
-
|
|
13
|
-
Stencil combines the best concepts of the most popular frontend frameworks into a compile-time rather than run-time tool. Stencil takes TypeScript, JSX, a tiny virtual DOM layer, efficient one-way data binding, an asynchronous rendering pipeline (similar to React Fiber), and lazy-loading out of the box, and generates 100% standards-based Web Components that run in any browser supporting the Custom Elements v1 spec.
|
|
14
|
-
|
|
15
|
-
Stencil components are just Web Components, so they work in any major framework or with no framework at all.
|
|
16
|
-
|
|
17
|
-
## Getting Started
|
|
18
|
-
|
|
19
|
-
To start building a new webcomponent using Stencil:
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
npm run generate six-name-of-new-component
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
This will create a new folder containing everything necessary for you to develop a new component
|
|
26
|
-
|
|
27
|
-
To run the unit tests for the components, run:
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
npm test
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
Need help? Check out our docs [here](https://stenciljs.com/docs/my-first-component).
|
|
34
|
-
|
|
35
|
-
## Testing
|
|
36
|
-
|
|
37
|
-
To run all unit and e2e tests simply execute
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
npm run teste2e
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
If you want to run a specific file, simply add the filename ad the end to the command above:
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
npm run test:2e components/six-button/test/six-button.e2e.ts
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
For debugging stencil provides the `--devtools` flag. This will slow down chrome and open the devtools automatically.
|
|
50
|
-
|
|
51
|
-
Simply add a `debugger;` statement in the code where you want the test to stop and run:
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
npm run test:debug components/six-button/test/six-button.e2e.ts
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
If you need evaluation at a certain breakpoint the easiest is to open the `ui-library` folder in vscode. The provided
|
|
58
|
-
`launch.json` automatically adds the correct runconfigurations to debug tests in vscode
|
|
59
|
-
|
|
60
|
-
If you want to do some more advanced debugging you can also use `page.evaluate`. Add the following in your code:
|
|
61
|
-
|
|
62
|
-
```javascript
|
|
63
|
-
await page.evaluate(() => {
|
|
64
|
-
console.log('this is some evaluation');
|
|
65
|
-
debugger;
|
|
66
|
-
});
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
and run the same command as above:
|
|
70
|
-
|
|
71
|
-
```bash
|
|
72
|
-
npm run test:debug components/six-button/test/six-button.e2e.ts
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
FYI: There seems to be some weird bug when using `page.evaluate` where the browser first stops in a ghost breakpoint and
|
|
76
|
-
you have to reload the browser (Ctrl + R) to get to your evaluation endpoint.
|
|
77
|
-
|
|
78
|
-
### Visual Diff Testing
|
|
79
|
-
|
|
80
|
-
The flag `--screenshot` allows to run visual diff e2e tests. When we run these tests we will make a screenshot of the
|
|
81
|
-
component and compare it with previous screenshots. You can find the screenshots in [this image folder](./screenshot/images).
|
|
82
|
-
|
|
83
|
-
When a screenshot test fails you can open the [compare.html](./screenshot/compare.html) which will present you what changed.
|
|
84
|
-
|
|
85
|
-
When you actually redesigned the component and expect the changes simply delete the old images.
|
|
86
|
-
|
|
87
|
-
The screenshot tests are not run in the build because the tests seem to always fail in the build and it's very hard to
|
|
88
|
-
figure out what exactly differs there. So if you want to validate the components are still working properly run it locally:
|
|
89
|
-
|
|
90
|
-
`npm run test:inclScrnsht`
|
|
91
|
-
|
|
92
|
-
## Adding documentation
|
|
93
|
-
|
|
94
|
-
To see the documentation for your component you need to do the following:
|
|
95
|
-
|
|
96
|
-
- add an `index.html` to your component folder
|
|
97
|
-
- the `index.html` should have the following structure, where a div with the `container` class surrounds all your examples.
|
|
98
|
-
And the code examples are wrapped in `<div class="container"></div>`:
|
|
99
|
-
`html
|
|
100
|
-
<!DOCTYPE html>
|
|
101
|
-
<html dir="ltr" lang="en">
|
|
102
|
-
<head>
|
|
103
|
-
<meta charset="utf-8"/>
|
|
104
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0"/>
|
|
105
|
-
<script type="module" src="/build/ui-library.esm.js"></script>
|
|
106
|
-
<script nomodule src="/build/ui-library.js"></script>
|
|
107
|
-
<link rel="stylesheet" href="/build/ui-library.css">
|
|
108
|
-
<title>MyComponent</title>
|
|
109
|
-
</head>
|
|
110
|
-
<body>
|
|
111
|
-
<div class="container">
|
|
112
|
-
<h1>MyComponent</h1>
|
|
113
|
-
<p>MyComponent is used for blablabla</p>
|
|
114
|
-
<section class="demo">
|
|
115
|
-
<my-component></my-component>
|
|
116
|
-
</section>
|
|
117
|
-
</div>
|
|
118
|
-
</body>
|
|
119
|
-
</html>
|
|
120
|
-
`
|
|
121
|
-
- additionally you need to have an `EXAMPLES` comment in your readme.md:
|
|
122
|
-
|
|
123
|
-
```
|
|
124
|
-
<!-- EXAMPLES -->
|
|
125
|
-
|
|
126
|
-
<!-- Auto Generated Below -->
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
### Prepare
|
|
130
|
-
|
|
131
|
-
Before creating a new version make sure that:
|
|
132
|
-
|
|
133
|
-
- you built the projects to be publish (dist folder should be updated)
|
|
134
|
-
- you updated [CHANGELOG.md](CHANGELOG.md)
|
|
135
|
-
- you know which version to update to
|
|
136
|
-
- our library follows [Semantic Versioning](https://semver.org/) so follow this guide to decide what kind of version update you will bring:
|
|
137
|
-
- <b>MAJOR</b> version when you make incompatible API changes
|
|
138
|
-
- <b>=></b> Users of the SIX Web Components Library must adapt their code to use the new version.
|
|
139
|
-
- <b>MINOR</b> version when you add functionality in a backwards compatible manner, and
|
|
140
|
-
- <b>=></b> Users of the SIX Web Component Library can use new features but must not adapt their existing code.
|
|
141
|
-
- <b>PATCH</b> version when you make backwards compatible bug fixes.
|
|
142
|
-
- <b>=></b> Users of the SIX Web Component Library get a bug fixed but must not adapt their existing code.
|
|
143
|
-
|
|
144
|
-
There are different ways how to create a new version:
|
|
145
|
-
|
|
146
|
-
- manually increase the version in the `package.json` and `package-lock.json`
|
|
147
|
-
- use `npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease [--preid=<prerelease-id>] | from-git]`
|
|
148
|
-
- [see here for more details](https://docs.npmjs.com/updating-your-published-package-version-number)
|
|
149
|
-
- [use lerna publish](https://lerna.js.org/)
|
|
150
|
-
|
|
151
|
-
No matter what kind of method you use to bump the version make sure that the different packages are in sync - always publish these together:
|
|
152
|
-
|
|
153
|
-
- ui-library
|
|
154
|
-
|
|
155
|
-
* ui-library-react
|
|
156
|
-
* ui-library-vue
|