vueless 1.0.2-beta.19 → 1.0.2-beta.20

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "1.0.2-beta.19",
3
+ "version": "1.0.2-beta.20",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -766,6 +766,7 @@ defineExpose({
766
766
  * Applies: `class`, `config`, redefined default `props` and dev `vl-...` attributes.
767
767
  */
768
768
  const {
769
+ getDataTest,
769
770
  config,
770
771
  wrapperAttrs,
771
772
  navigationAttrs,
@@ -782,8 +783,14 @@ const {
782
783
  </script>
783
784
 
784
785
  <template>
785
- <div ref="wrapper" :tabindex="tabindex" v-bind="wrapperAttrs" @keydown="onKeydown">
786
- <div v-bind="navigationAttrs">
786
+ <div
787
+ ref="wrapper"
788
+ :tabindex="tabindex"
789
+ v-bind="wrapperAttrs"
790
+ :data-test="getDataTest()"
791
+ @keydown="onKeydown"
792
+ >
793
+ <div v-bind="navigationAttrs" :data-test="getDataTest('navigation')">
787
794
  <UButton
788
795
  v-if="range"
789
796
  square
@@ -792,6 +799,7 @@ const {
792
799
  variant="ghost"
793
800
  :icon="config.defaults.prevYearIcon"
794
801
  v-bind="nextPrevButtonAttrs"
802
+ :data-test="getDataTest('prev-year')"
795
803
  @mousedown.prevent.capture
796
804
  @click="onClickPrevYearButton"
797
805
  />
@@ -803,6 +811,7 @@ const {
803
811
  variant="ghost"
804
812
  :icon="config.defaults.prevIcon"
805
813
  v-bind="nextPrevButtonAttrs"
814
+ :data-test="getDataTest('prev')"
806
815
  @mousedown.prevent.capture
807
816
  @click="onClickPrevButton"
808
817
  />
@@ -814,6 +823,7 @@ const {
814
823
  variant="ghost"
815
824
  :label="currentViewLabel"
816
825
  v-bind="viewSwitchButtonAttrs"
826
+ :data-test="getDataTest('view-switch')"
817
827
  @mousedown.prevent.capture
818
828
  @click="onClickViewSwitch"
819
829
  />
@@ -825,6 +835,7 @@ const {
825
835
  variant="ghost"
826
836
  :icon="config.defaults.nextIcon"
827
837
  v-bind="nextPrevButtonAttrs"
838
+ :data-test="getDataTest('next')"
828
839
  @mousedown.prevent.capture
829
840
  @click="onClickNextButton"
830
841
  />
@@ -837,6 +848,7 @@ const {
837
848
  variant="ghost"
838
849
  :icon="config.defaults.nextYearIcon"
839
850
  v-bind="nextPrevButtonAttrs"
851
+ :data-test="getDataTest('next-year')"
840
852
  @mousedown.prevent.capture
841
853
  @click="onClickNextYearButton"
842
854
  />
@@ -855,6 +867,7 @@ const {
855
867
  :date-format="actualDateFormat"
856
868
  :locale="locale"
857
869
  :config="config"
870
+ :data-test="getDataTest('day-view')"
858
871
  @input="onInputDate"
859
872
  />
860
873
 
@@ -870,6 +883,7 @@ const {
870
883
  :date-format="actualDateFormat"
871
884
  :locale="locale"
872
885
  :config="config"
886
+ :data-test="getDataTest('month-view')"
873
887
  @input="onInput"
874
888
  />
875
889
 
@@ -885,10 +899,11 @@ const {
885
899
  :date-format="actualDateFormat"
886
900
  :locale="locale"
887
901
  :config="config"
902
+ :data-test="getDataTest('year-view')"
888
903
  @input="onInput"
889
904
  />
890
905
 
891
- <div v-if="isTimepickerEnabled" v-bind="timepickerAttrs">
906
+ <div v-if="isTimepickerEnabled" v-bind="timepickerAttrs" :data-test="getDataTest('timepicker')">
892
907
  <span v-bind="timepickerLabelAttrs" v-text="localeMessages.timeLabel" />
893
908
 
894
909
  <div v-bind="timepickerInputWrapperAttrs">
@@ -897,6 +912,7 @@ const {
897
912
  placeholder="00"
898
913
  type="text"
899
914
  v-bind="timepickerInputHoursAttrs"
915
+ :data-test="getDataTest('timepicker-hours')"
900
916
  @input.prevent="onTimeInput($event as InputEvent, InputType.Hours)"
901
917
  @click.prevent="onClickTimeInput"
902
918
  @focus.prevent="onFocusTimeInput"
@@ -908,6 +924,7 @@ const {
908
924
  placeholder="00"
909
925
  type="text"
910
926
  v-bind="timepickerInputMinutesAttrs"
927
+ :data-test="getDataTest('timepicker-minutes')"
911
928
  @input.prevent="onTimeInput($event as InputEvent, InputType.Minutes)"
912
929
  @click.prevent="onClickTimeInput"
913
930
  @focus.prevent="onFocusTimeInput"
@@ -919,6 +936,7 @@ const {
919
936
  placeholder="00"
920
937
  type="text"
921
938
  v-bind="timepickerInputSecondsAttrs"
939
+ :data-test="getDataTest('timepicker-seconds')"
922
940
  @input.prevent="onTimeInput($event as InputEvent, InputType.Seconds)"
923
941
  @click.prevent="onClickTimeInput"
924
942
  @focus.prevent="onFocusTimeInput"
@@ -932,6 +950,7 @@ const {
932
950
  color="grayscale"
933
951
  variant="soft"
934
952
  v-bind="timepickerSubmitButtonAttrs"
953
+ :data-test="getDataTest('timepicker-submit')"
935
954
  @click="onClickSubmit"
936
955
  >
937
956
  {{ localeMessages.okLabel }}
@@ -57,11 +57,11 @@ defineExpose({
57
57
  * Get element / nested component attributes for each config token ✨
58
58
  * Applies: `class`, `config`, redefined default `props` and dev `vl-...` attributes.
59
59
  */
60
- const { listAttrs, colorButtonAttrs, circleAttrs } = useUI<Config>(defaultConfig);
60
+ const { getDataTest, listAttrs, colorButtonAttrs, circleAttrs } = useUI<Config>(defaultConfig);
61
61
  </script>
62
62
 
63
63
  <template>
64
- <div :id="elementId" ref="list" v-bind="listAttrs">
64
+ <div :id="elementId" ref="list" v-bind="listAttrs" :data-test="getDataTest()">
65
65
  <UButton
66
66
  v-for="(colorClass, color) in colors"
67
67
  :key="color"
@@ -71,9 +71,10 @@ const { listAttrs, colorButtonAttrs, circleAttrs } = useUI<Config>(defaultConfig
71
71
  color="grayscale"
72
72
  :variant="selectedItem === color ? 'soft' : 'ghost'"
73
73
  v-bind="colorButtonAttrs"
74
+ :data-test="getDataTest(`button-${color}`)"
74
75
  @click="onClickColor(color)"
75
76
  >
76
- <div :class="colorClass" v-bind="circleAttrs" />
77
+ <div :class="colorClass" v-bind="circleAttrs" :data-test="getDataTest(`circle-${color}`)" />
77
78
  </UButton>
78
79
  </div>
79
80
  </template>
@@ -255,6 +255,7 @@ const mutatedProps = computed(() => ({
255
255
  }));
256
256
 
257
257
  const {
258
+ getDataTest,
258
259
  config,
259
260
  wrapperAttrs,
260
261
  rightIconAttrs,
@@ -278,7 +279,7 @@ watchEffect(() => {
278
279
  </script>
279
280
 
280
281
  <template>
281
- <div v-bind="wrapperAttrs" ref="wrapper">
282
+ <div v-bind="wrapperAttrs" ref="wrapper" :data-test="getDataTest()">
282
283
  <UInput
283
284
  :id="elementId"
284
285
  :key="String(userFormatDate)"
@@ -295,6 +296,7 @@ watchEffect(() => {
295
296
  :right-icon="rightIcon || config.defaults.calendarIcon"
296
297
  no-autocomplete
297
298
  v-bind="isShownCalendar ? datepickerInputActiveAttrs : datepickerInputAttrs"
299
+ :data-test="getDataTest('input')"
298
300
  @input="onTextInput"
299
301
  @focus="activate"
300
302
  @copy="onCopy"
@@ -337,6 +339,7 @@ watchEffect(() => {
337
339
  :max-date="maxDate"
338
340
  :min-date="minDate"
339
341
  v-bind="datepickerCalendarAttrs"
342
+ :data-test="getDataTest('calendar')"
340
343
  @keydown.esc="deactivate"
341
344
  @user-date-change="onUserFormatDateChange"
342
345
  @input="onInput"
@@ -565,6 +565,7 @@ const mutatedProps = computed(() => ({
565
565
  }));
566
566
 
567
567
  const {
568
+ getDataTest,
568
569
  config,
569
570
  wrapperAttrs,
570
571
  rightIconAttrs,
@@ -610,7 +611,7 @@ watchEffect(() => {
610
611
  </script>
611
612
 
612
613
  <template>
613
- <div v-bind="wrapperAttrs" ref="wrapper">
614
+ <div v-bind="wrapperAttrs" ref="wrapper" :data-test="getDataTest()">
614
615
  <UInput
615
616
  v-if="isVariant.input"
616
617
  :id="elementId"
@@ -628,6 +629,7 @@ watchEffect(() => {
628
629
  no-autocomplete
629
630
  readonly
630
631
  v-bind="isShownMenu ? datepickerInputActiveAttrs : datepickerInputAttrs"
632
+ :data-test="getDataTest('input')"
631
633
  @focus="activate"
632
634
  @keydown.esc="deactivate"
633
635
  >
@@ -659,6 +661,7 @@ watchEffect(() => {
659
661
  variant="soft"
660
662
  :icon="config.defaults.prevIcon"
661
663
  v-bind="rangeButtonShiftAttrs"
664
+ :data-test="getDataTest('button-prev')"
662
665
  @click="onClickShiftRange(ShiftAction.Prev)"
663
666
  />
664
667
 
@@ -671,6 +674,7 @@ watchEffect(() => {
671
674
  :label="userFormatDate"
672
675
  variant="soft"
673
676
  v-bind="rangeButtonSelectAttrs"
677
+ :data-test="getDataTest('button')"
674
678
  @click="activate"
675
679
  />
676
680
 
@@ -682,6 +686,7 @@ watchEffect(() => {
682
686
  variant="soft"
683
687
  :icon="config.defaults.nextIcon"
684
688
  v-bind="rangeButtonShiftAttrs"
689
+ :data-test="getDataTest('button-next')"
685
690
  @click="onClickShiftRange(ShiftAction.Next)"
686
691
  />
687
692
  </div>
@@ -693,6 +698,7 @@ watchEffect(() => {
693
698
  v-click-outside="[deactivate, clickOutsideOptions]"
694
699
  tabindex="-1"
695
700
  v-bind="menuAttrs"
701
+ :data-test="getDataTest('menu')"
696
702
  @keydown.esc="deactivate"
697
703
  >
698
704
  <UDatePickerRangePeriodMenu
@@ -708,6 +714,7 @@ watchEffect(() => {
708
714
  :min-date="minDate"
709
715
  :max-date="maxDate"
710
716
  :attrs="rangePeriodMenuAttrs as unknown as UDatePickerRangePeriodMenuAttrs"
717
+ :data-test="getDataTest('period-menu')"
711
718
  @toggle-menu="isShownMenu = !isShownMenu"
712
719
  @close-menu="isShownMenu = false"
713
720
  @click-prev="onClickShiftDatesList(ShiftAction.Prev)"
@@ -730,9 +737,14 @@ watchEffect(() => {
730
737
  :date-format="dateFormat"
731
738
  :config="config"
732
739
  :attrs="rangeInputsAttrs as unknown as UDatePickerRangeInputsAttrs"
740
+ :data-test="getDataTest('range-inputs')"
733
741
  />
734
742
 
735
- <div v-if="inputRangeToError || inputRangeFromError" v-bind="rangeInputErrorAttrs">
743
+ <div
744
+ v-if="inputRangeToError || inputRangeFromError"
745
+ v-bind="rangeInputErrorAttrs"
746
+ :data-test="getDataTest('error')"
747
+ >
736
748
  {{ inputRangeToError || inputRangeFromError }}
737
749
  </div>
738
750
 
@@ -745,6 +757,7 @@ watchEffect(() => {
745
757
  :date-format="dateFormat"
746
758
  v-bind="datepickerCalendarAttrs as KeyAttrsWithConfig<UCalendarConfig>"
747
759
  range
760
+ :data-test="getDataTest('calendar')"
748
761
  @input="onInputCalendar"
749
762
  />
750
763
  </div>