vueless 0.0.604 → 0.0.605

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.
@@ -53,11 +53,12 @@ export default function useUI<T>(
53
53
  : (STRATEGY_TYPE.merge as Strategies);
54
54
 
55
55
  const firstClassKey = Object.keys(defaultConfig || {})[0];
56
- const propsConfig = props.config as ComponentConfig<T>;
57
56
  const config = ref({}) as Ref<ComponentConfig<T>>;
58
57
  const attrs = useAttrs();
59
58
 
60
59
  watchEffect(() => {
60
+ const propsConfig = props.config as ComponentConfig<T>;
61
+
61
62
  config.value = getMergedConfig({
62
63
  defaultConfig,
63
64
  globalConfig,
@@ -139,9 +140,7 @@ export default function useUI<T>(
139
140
  /* Delete value key to prevent v-model overwrite. */
140
141
  delete commonAttrs.value;
141
142
 
142
- watch(config, updateVuelessAttrs, { immediate: true });
143
- watch(props, updateVuelessAttrs);
144
- watch(classes, updateVuelessAttrs);
143
+ watch([config, props, classes], updateVuelessAttrs, { immediate: true });
145
144
 
146
145
  /**
147
146
  * Updating Vueless attributes.
@@ -177,6 +176,8 @@ export default function useUI<T>(
177
176
 
178
177
  if (extendsKeys.length) {
179
178
  extendsKeys.forEach((key) => {
179
+ if (key === configKey) return;
180
+
180
181
  extendsClasses = [
181
182
  ...extendsClasses,
182
183
  ...getExtendsClasses(key),
@@ -195,6 +196,7 @@ export default function useUI<T>(
195
196
  function getExtendsConfigAttr(configKey: string) {
196
197
  let extendsConfigAttr: NestedComponent = {};
197
198
 
199
+ const propsConfig = props.config as ComponentConfig<T>;
198
200
  const extendsKeys = getExtendsKeys(config.value[configKey]);
199
201
 
200
202
  if (extendsKeys.length) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.604",
3
+ "version": "0.0.605",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -119,9 +119,9 @@ const { buttonAttrs, loaderAttrs, leftIconAttrs, rightIconAttrs, centerIconAttrs
119
119
  <slot name="right" :icon-name="rightIcon">
120
120
  <UIcon
121
121
  v-if="rightIcon"
122
- internal
123
- color="inherit"
124
122
  :name="rightIcon"
123
+ color="inherit"
124
+ internal
125
125
  v-bind="rightIconAttrs"
126
126
  />
127
127
  </slot>
@@ -102,7 +102,7 @@ const { config, wrapperAttrs, dropdownBadgeAttrs, dropdownListAttrs, dropdownIco
102
102
  <slot :label="label" :opened="isShownOptions" />
103
103
  </template>
104
104
 
105
- <template #right="{ iconColor }">
105
+ <template #right="{ iconSize }">
106
106
  <!--
107
107
  @slot Use it to add something after the label.
108
108
  @binding {boolean} opened
@@ -111,8 +111,8 @@ const { config, wrapperAttrs, dropdownBadgeAttrs, dropdownListAttrs, dropdownIco
111
111
  <UIcon
112
112
  v-if="!noIcon"
113
113
  internal
114
- :color="iconColor"
115
- :size="size"
114
+ color="inherit"
115
+ :size="iconSize"
116
116
  :name="config.defaults.dropdownIcon"
117
117
  v-bind="dropdownIconAttrs"
118
118
  :data-test="`${dataTest}-dropdown`"
@@ -1,11 +1,10 @@
1
1
  export default /*tw*/ {
2
2
  wrapper: "relative inline-block",
3
3
  dropdownButton: {
4
- base: "{UButton}",
4
+ base: "{UButton} transition",
5
5
  variants: {
6
6
  opened: {
7
7
  true: "group ring-dynamic ring-offset-dynamic ring-{color}-700/15",
8
- false: "reactive-fix", // todo: remove it later
9
8
  },
10
9
  },
11
10
  compoundVariants: [{ opened: true, color: ["grayscale", "white"], class: "ring-gray-700/15" }],
@@ -63,7 +63,9 @@ const userFormatDate = ref("");
63
63
  const formattedDate = ref("");
64
64
  const customView = ref(View.Day);
65
65
 
66
- const datepickerInputRef = useTemplateRef<typeof UInput>("input");
66
+ type UInputRef = InstanceType<typeof UInput>;
67
+
68
+ const datepickerInputRef = useTemplateRef<UInputRef>("input");
67
69
  const wrapperRef = useTemplateRef<HTMLDivElement>("wrapper");
68
70
  const calendarRef = useTemplateRef<ComponentExposed<typeof UCalendar>>("calendar");
69
71
 
@@ -258,6 +260,7 @@ const mutatedProps = computed(() => ({
258
260
  const {
259
261
  config,
260
262
  wrapperAttrs,
263
+ rightIconAttrs,
261
264
  datepickerInputAttrs,
262
265
  datepickerInputActiveAttrs,
263
266
  datepickerCalendarAttrs,
@@ -318,7 +321,7 @@ watchEffect(() => {
318
321
  @binding {string} icon-size
319
322
  -->
320
323
  <slot name="right-icon" :icon-name="iconName" :icon-size="iconSize">
321
- <UIcon :name="iconName" :size="iconSize" color="gray" />
324
+ <UIcon :name="iconName" :size="iconSize" color="gray" v-bind="rightIconAttrs" />
322
325
  </slot>
323
326
  </template>
324
327
 
@@ -12,6 +12,7 @@ export default /*tw*/ {
12
12
  },
13
13
  },
14
14
  },
15
+ rightIcon: "{UIcon}",
15
16
  datepickerCalendar: {
16
17
  base: "{UCalendar} absolute mb-3 z-40",
17
18
  variants: {
@@ -543,6 +543,7 @@ const mutatedProps = computed(() => ({
543
543
  const {
544
544
  config,
545
545
  wrapperAttrs,
546
+ rightIconAttrs,
546
547
  datepickerCalendarAttrs,
547
548
  datepickerInputAttrs,
548
549
  menuAttrs,
@@ -551,7 +552,7 @@ const {
551
552
  shiftRangeButtonAttrs,
552
553
  rangeInputWrapperAttrs,
553
554
  rangeInputErrorAttrs,
554
- datepickerActiveInputAttrs,
555
+ datepickerInputActiveAttrs,
555
556
  rangeInputFirstAttrs,
556
557
  rangeInputLastAttrs,
557
558
  periodRowAttrs,
@@ -595,8 +596,9 @@ watchEffect(() => {
595
596
  readonly
596
597
  :left-icon="leftIcon"
597
598
  :right-icon="rightIcon || config.defaults.calendarIcon"
598
- v-bind="isShownMenu ? datepickerActiveInputAttrs : datepickerInputAttrs"
599
+ v-bind="isShownMenu ? datepickerInputActiveAttrs : datepickerInputAttrs"
599
600
  @focus="activate"
601
+ @keydown.esc="deactivate"
600
602
  >
601
603
  <template #left>
602
604
  <!-- @slot Use it to add something before the date. -->
@@ -608,14 +610,14 @@ watchEffect(() => {
608
610
  <slot name="left-icon" />
609
611
  </template>
610
612
 
611
- <template #right-icon>
613
+ <template #right-icon="{ iconName, iconSize }">
612
614
  <!--
613
615
  @slot Use it add an icon after the date.
614
616
  @binding {string} icon-name
615
617
  @binding {string} icon-size
616
618
  -->
617
- <slot name="right-icon" :icon-name="rightIcon" :icon-size="size">
618
- <UIcon :name="rightIcon" :size="size" color="gray" />
619
+ <slot name="right-icon" :icon-name="iconName" :icon-size="size">
620
+ <UIcon :name="iconName" :size="iconSize" color="gray" v-bind="rightIconAttrs" />
619
621
  </slot>
620
622
  </template>
621
623
 
@@ -12,6 +12,7 @@ export default /*tw*/ {
12
12
  },
13
13
  },
14
14
  },
15
+ rightIcon: "{UIcon}",
15
16
  buttonWrapper: {
16
17
  base: `
17
18
  flex rounded-dynamic max-md:justify-between
@@ -211,7 +212,6 @@ export default /*tw*/ {
211
212
  labelAlign: "topInside",
212
213
  openDirectionX: "auto",
213
214
  openDirectionY: "auto",
214
- timepicker: false,
215
215
  disabled: false,
216
216
  dateFormat: undefined,
217
217
  maxDate: undefined,
@@ -31,6 +31,7 @@ export default {
31
31
  title: "Form Inputs & Controls / Date Picker Range",
32
32
  component: UDatePickerRange,
33
33
  args: {
34
+ label: "Datepicker range",
34
35
  modelValue: {
35
36
  from: new Date(2022, 1, 14),
36
37
  to: new Date(2022, 2, 20),
@@ -41,15 +42,11 @@ export default {
41
42
  },
42
43
  parameters: {
43
44
  docs: {
45
+ ...getDocsDescription(UDatePickerRangeName),
44
46
  story: {
45
47
  height: "620px",
46
48
  },
47
49
  },
48
- parameters: {
49
- docs: {
50
- ...getDocsDescription(UDatePickerRangeName),
51
- },
52
- },
53
50
  },
54
51
  } as Meta;
55
52
 
@@ -124,11 +124,6 @@ export interface UDatePickerRangeProps<TModelValue> {
124
124
  */
125
125
  dateFormat?: string;
126
126
 
127
- /**
128
- * Same as date format, but used when timepicker is enabled.
129
- */
130
- dateTimeFormat?: string;
131
-
132
127
  /**
133
128
  * User-friendly date format (it will be shown in UI).
134
129
  */
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.604",
4
+ "version": "0.0.605",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",
@@ -3282,15 +3282,6 @@
3282
3282
  "type": "string"
3283
3283
  }
3284
3284
  },
3285
- {
3286
- "name": "dateTimeFormat",
3287
- "required": false,
3288
- "description": "Same as date format, but used when timepicker is enabled.",
3289
- "value": {
3290
- "kind": "expression",
3291
- "type": "string"
3292
- }
3293
- },
3294
3285
  {
3295
3286
  "name": "userDateFormat",
3296
3287
  "required": false,