vueless 0.0.406 → 0.0.408

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": "0.0.406",
3
+ "version": "0.0.408",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -53,7 +53,7 @@
53
53
  "@release-it/bumper": "^6.0.1",
54
54
  "@vitejs/plugin-vue": "^5.0.5",
55
55
  "@vue/eslint-config-prettier": "^9.0.0",
56
- "@vueless/plugin-vite": "^0.0.65",
56
+ "@vueless/plugin-vite": "^0.0.66",
57
57
  "@vueless/storybook": "^0.0.34",
58
58
  "@vueless/web-types": "^0.0.15",
59
59
  "autoprefixer": "^10.4.19",
@@ -145,7 +145,7 @@ const props = defineProps({
145
145
  },
146
146
 
147
147
  /**
148
- * Left side icon name.
148
+ * Left icon name.
149
149
  */
150
150
  leftIcon: {
151
151
  type: String,
@@ -153,7 +153,7 @@ const props = defineProps({
153
153
  },
154
154
 
155
155
  /**
156
- * Right side icon name.
156
+ * Right icon name.
157
157
  */
158
158
  rightIcon: {
159
159
  type: String,
@@ -195,7 +195,7 @@ const props = defineProps({
195
195
  },
196
196
 
197
197
  /**
198
- * Left side icon name.
198
+ * Left icon name.
199
199
  */
200
200
  leftIcon: {
201
201
  type: String,
@@ -203,7 +203,7 @@ const props = defineProps({
203
203
  },
204
204
 
205
205
  /**
206
- * Right side icon name.
206
+ * Right icon name.
207
207
  */
208
208
  rightIcon: {
209
209
  type: String,
@@ -273,7 +273,7 @@ const props = defineProps({
273
273
  },
274
274
 
275
275
  /**
276
- * Left side icon name.
276
+ * Left icon name.
277
277
  */
278
278
  leftIcon: {
279
279
  type: String,
@@ -281,7 +281,7 @@ const props = defineProps({
281
281
  },
282
282
 
283
283
  /**
284
- * Right side icon name.
284
+ * Right icon name.
285
285
  */
286
286
  rightIcon: {
287
287
  type: String,
@@ -11,7 +11,7 @@
11
11
  centred
12
12
  v-bind="inputLabelAttrs"
13
13
  >
14
- <label :for="elementId" v-bind="blockAttrs">
14
+ <label :for="elementId" v-bind="wrapperAttrs">
15
15
  <span v-if="hasSlotContent($slots['left'])" ref="leftSlotWrapperRef">
16
16
  <!-- @slot Use it to add something before the text. -->
17
17
  <slot name="left" />
@@ -20,7 +20,7 @@
20
20
  <span
21
21
  v-if="hasSlotContent($slots['left-icon']) || leftIcon"
22
22
  ref="leftSlotWrapperRef"
23
- v-bind="leftIconSlotAttrs"
23
+ v-bind="leftIconWrapperAttrs"
24
24
  >
25
25
  <!--
26
26
  @slot Use it to add icon before the text.
@@ -38,29 +38,27 @@
38
38
  </slot>
39
39
  </span>
40
40
 
41
- <span v-bind="inputWrapperAttrs">
42
- <input
43
- :id="elementId"
44
- ref="inputRef"
45
- v-model="inputValue"
46
- :placeholder="placeholder"
47
- :type="inputType"
48
- :readonly="readonly"
49
- :disabled="disabled"
50
- :maxlength="maxLength"
51
- :inputmode="inputmode"
52
- :data-test="dataTest"
53
- v-bind="inputAttrs"
54
- @focus="onFocus"
55
- @blur="onBlur"
56
- @input="onInput"
57
- @change="onChange"
58
- @mousedown="onMousedown"
59
- @click="onClick"
60
- />
61
- </span>
62
-
63
- <label v-if="isTypePassword" v-bind="rightIconSlotAttrs" :for="elementId">
41
+ <input
42
+ :id="elementId"
43
+ ref="inputRef"
44
+ v-model="inputValue"
45
+ :placeholder="placeholder"
46
+ :type="inputType"
47
+ :readonly="readonly"
48
+ :disabled="disabled"
49
+ :maxlength="maxLength"
50
+ :inputmode="inputmode"
51
+ :data-test="dataTest"
52
+ v-bind="inputAttrs"
53
+ @focus="onFocus"
54
+ @blur="onBlur"
55
+ @input="onInput"
56
+ @change="onChange"
57
+ @mousedown="onMousedown"
58
+ @click="onClick"
59
+ />
60
+
61
+ <label v-if="isTypePassword" v-bind="rightIconWrapperAttrs" :for="elementId">
64
62
  <UIcon
65
63
  v-if="isTypePassword"
66
64
  :name="
@@ -71,13 +69,13 @@
71
69
  color="gray"
72
70
  interactive
73
71
  internal
74
- :data-test="`${dataTest}-show-password`"
72
+ :data-test="`${dataTest}-password-icon`"
75
73
  v-bind="passwordIconAttrs"
76
74
  @click="onClickShowPassword"
77
75
  />
78
76
  </label>
79
77
 
80
- <span v-if="hasSlotContent($slots['right-icon']) || rightIcon" v-bind="rightIconSlotAttrs">
78
+ <span v-if="hasSlotContent($slots['right-icon']) || rightIcon" v-bind="rightIconWrapperAttrs">
81
79
  <!--
82
80
  @slot Use it to add icon after the text.
83
81
  @binding {string} icon-name
@@ -128,7 +126,7 @@ defineOptions({ inheritAttrs: false });
128
126
 
129
127
  const emit = defineEmits([
130
128
  /**
131
- * Triggers when the input value is updated.
129
+ * Triggers when the input value is changes.
132
130
  * @property {string} modelValue
133
131
  * @property {number} modelValue
134
132
  */
@@ -160,8 +158,9 @@ const emit = defineEmits([
160
158
  "blur",
161
159
 
162
160
  /**
163
- * Triggers when any validation rules are applied to input value.
164
- * @property {string} value
161
+ * Triggers when the input value is changes.
162
+ * @property {string} modelValue
163
+ * @property {number} modelValue
165
164
  */
166
165
  "input",
167
166
  ]);
@@ -226,7 +225,7 @@ const props = defineProps({
226
225
  },
227
226
 
228
227
  /**
229
- * Left side icon name.
228
+ * Left icon name.
230
229
  */
231
230
  leftIcon: {
232
231
  type: String,
@@ -234,7 +233,7 @@ const props = defineProps({
234
233
  },
235
234
 
236
235
  /**
237
- * Right side icon name.
236
+ * Right icon name.
238
237
  */
239
238
  rightIcon: {
240
239
  type: String,
@@ -250,8 +249,8 @@ const props = defineProps({
250
249
  },
251
250
 
252
251
  /**
253
- * Prevents input some characters (for ex. input numbers only).
254
- * You can use predefined values or your own RegExp.
252
+ * Prevents some characters from input.
253
+ * You can use predefined values or own RegExp.
255
254
  * @values symbol, string, stringAndNumber, number, integer
256
255
  */
257
256
  validationRule: {
@@ -261,7 +260,7 @@ const props = defineProps({
261
260
  },
262
261
 
263
262
  /**
264
- * Input type
263
+ * Input type.
265
264
  * @values text, number, tel, email, url, search, password
266
265
  */
267
266
  type: {
@@ -270,7 +269,7 @@ const props = defineProps({
270
269
  },
271
270
 
272
271
  /**
273
- * Set proper keyboard on mobile devices.
272
+ * Set specific keyboard for mobile devices.
274
273
  * @values text, decimal, numeric, tel, email, url, search, none
275
274
  */
276
275
  inputmode: {
@@ -279,7 +278,7 @@ const props = defineProps({
279
278
  },
280
279
 
281
280
  /**
282
- * Set input read-only.
281
+ * Make input read-only.
283
282
  */
284
283
  readonly: {
285
284
  type: Boolean,
@@ -354,14 +353,13 @@ const elementId = props.id || useId();
354
353
  const {
355
354
  config,
356
355
  inputAttrs,
357
- blockAttrs,
356
+ wrapperAttrs,
358
357
  inputLabelAttrs,
359
358
  passwordIconAttrs,
360
- leftIconSlotAttrs,
359
+ leftIconWrapperAttrs,
361
360
  leftIconAttrs,
362
- inputWrapperAttrs,
363
361
  rightIconAttrs,
364
- rightIconSlotAttrs,
362
+ rightIconWrapperAttrs,
365
363
  hasSlotContent,
366
364
  } = useAttrs(props, { isTypePassword, inputPasswordClasses });
367
365
 
@@ -438,9 +436,9 @@ function onClickShowPassword() {
438
436
  */
439
437
  function toggleReadonlyToPreventAutocomplete(toggleState) {
440
438
  if (props.noAutocomplete && !props.readonly) {
441
- const input = document.getElementById(elementId);
442
-
443
- toggleState ? input.setAttribute("readonly", "readonly") : input.removeAttribute("readonly");
439
+ toggleState
440
+ ? inputRef.value.setAttribute("readonly", "readonly")
441
+ : inputRef.value.removeAttribute("readonly");
444
442
  }
445
443
  }
446
444
 
@@ -1,15 +1,8 @@
1
1
  export default /*tw*/ {
2
2
  inputLabel: "{ULabel}",
3
- inputWrapper: "flex relative w-full",
4
- rightIconSlot: "flex items-center justify-end whitespace-nowrap pr-2 gap-1 rounded-dynamic rounded-l-none",
5
- leftIconSlot: "flex items-center justify-end whitespace-nowrap pl-2 gap-1 rounded-dynamic rounded-r-none",
6
- leftIcon: "{UIcon}",
7
- rightIcon: "{UIcon}",
8
- passwordIcon: "",
9
- block: {
3
+ wrapper: {
10
4
  base: `
11
- w-full bg-white !opacity-100 relative flex transition
12
- rounded-dynamic border border-solid border-gray-300
5
+ w-full bg-white relative flex border border-gray-300 rounded-dynamic transition
13
6
  hover:border-gray-400 hover:focus-within:border-brand-500 focus-within:border-brand-500
14
7
  focus-within:ring-dynamic focus-within:ring-offset-dynamic focus-within:ring-brand-700/15
15
8
  `,
@@ -26,6 +19,11 @@ export default /*tw*/ {
26
19
  },
27
20
  },
28
21
  },
22
+ rightIconWrapper: "flex items-center justify-end whitespace-nowrap pr-2 gap-1 rounded-dynamic rounded-l-none",
23
+ leftIconWrapper: "flex items-center justify-end whitespace-nowrap pl-2 gap-1 rounded-dynamic rounded-r-none",
24
+ leftIcon: "{UIcon}",
25
+ rightIcon: "{UIcon}",
26
+ passwordIcon: "{UIcon}",
29
27
  input: {
30
28
  base: `
31
29
  block w-full py-2 px-3 font-normal leading-none text-gray-900 bg-white
@@ -122,7 +122,7 @@ const props = defineProps({
122
122
  },
123
123
 
124
124
  /**
125
- * Left side icon name.
125
+ * Left icon name.
126
126
  */
127
127
  leftIcon: {
128
128
  type: String,
@@ -130,7 +130,7 @@ const props = defineProps({
130
130
  },
131
131
 
132
132
  /**
133
- * Right side icon name.
133
+ * Right icon name.
134
134
  */
135
135
  rightIcon: {
136
136
  type: String,
@@ -112,7 +112,7 @@ const props = defineProps({
112
112
  },
113
113
 
114
114
  /**
115
- * Left side icon name.
115
+ * Left icon name.
116
116
  */
117
117
  leftIcon: {
118
118
  type: String,
@@ -120,7 +120,7 @@ const props = defineProps({
120
120
  },
121
121
 
122
122
  /**
123
- * Right side icon name.
123
+ * Right icon name.
124
124
  */
125
125
  rightIcon: {
126
126
  type: String,
@@ -397,7 +397,7 @@ const props = defineProps({
397
397
  },
398
398
 
399
399
  /**
400
- * Left side icon name.
400
+ * Left icon name.
401
401
  */
402
402
  leftIcon: {
403
403
  type: String,
@@ -405,7 +405,7 @@ const props = defineProps({
405
405
  },
406
406
 
407
407
  /**
408
- * Right side icon name.
408
+ * Right icon name.
409
409
  */
410
410
  rightIcon: {
411
411
  type: String,
@@ -139,7 +139,7 @@ const props = defineProps({
139
139
  },
140
140
 
141
141
  /**
142
- * Left side icon name.
142
+ * Left icon name.
143
143
  */
144
144
  leftIcon: {
145
145
  type: String,
@@ -147,7 +147,7 @@ const props = defineProps({
147
147
  },
148
148
 
149
149
  /**
150
- * Right side icon name.
150
+ * Right icon name.
151
151
  */
152
152
  rightIcon: {
153
153
  type: String,
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.406",
4
+ "version": "0.0.408",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",
@@ -500,7 +500,7 @@
500
500
  },
501
501
  {
502
502
  "name": "leftIcon",
503
- "description": "Left side icon name.",
503
+ "description": "Left icon name.",
504
504
  "value": {
505
505
  "kind": "expression",
506
506
  "type": "string"
@@ -509,7 +509,7 @@
509
509
  },
510
510
  {
511
511
  "name": "rightIcon",
512
- "description": "Right side icon name.",
512
+ "description": "Right icon name.",
513
513
  "value": {
514
514
  "kind": "expression",
515
515
  "type": "string"
@@ -699,7 +699,7 @@
699
699
  },
700
700
  {
701
701
  "name": "leftIcon",
702
- "description": "Left side icon name.",
702
+ "description": "Left icon name.",
703
703
  "value": {
704
704
  "kind": "expression",
705
705
  "type": "string"
@@ -708,7 +708,7 @@
708
708
  },
709
709
  {
710
710
  "name": "rightIcon",
711
- "description": "Right side icon name.",
711
+ "description": "Right icon name.",
712
712
  "value": {
713
713
  "kind": "expression",
714
714
  "type": "string"
@@ -2434,7 +2434,7 @@
2434
2434
  },
2435
2435
  {
2436
2436
  "name": "leftIcon",
2437
- "description": "Left side icon name.",
2437
+ "description": "Left icon name.",
2438
2438
  "value": {
2439
2439
  "kind": "expression",
2440
2440
  "type": "string"
@@ -2443,7 +2443,7 @@
2443
2443
  },
2444
2444
  {
2445
2445
  "name": "rightIcon",
2446
- "description": "Right side icon name.",
2446
+ "description": "Right icon name.",
2447
2447
  "value": {
2448
2448
  "kind": "expression",
2449
2449
  "type": "string"
@@ -2637,7 +2637,7 @@
2637
2637
  },
2638
2638
  {
2639
2639
  "name": "leftIcon",
2640
- "description": "Left side icon name.",
2640
+ "description": "Left icon name.",
2641
2641
  "value": {
2642
2642
  "kind": "expression",
2643
2643
  "type": "string"
@@ -2646,7 +2646,7 @@
2646
2646
  },
2647
2647
  {
2648
2648
  "name": "rightIcon",
2649
- "description": "Right side icon name.",
2649
+ "description": "Right icon name.",
2650
2650
  "value": {
2651
2651
  "kind": "expression",
2652
2652
  "type": "string"
@@ -4406,7 +4406,7 @@
4406
4406
  },
4407
4407
  {
4408
4408
  "name": "leftIcon",
4409
- "description": "Left side icon name.",
4409
+ "description": "Left icon name.",
4410
4410
  "value": {
4411
4411
  "kind": "expression",
4412
4412
  "type": "string"
@@ -4415,7 +4415,7 @@
4415
4415
  },
4416
4416
  {
4417
4417
  "name": "rightIcon",
4418
- "description": "Right side icon name.",
4418
+ "description": "Right icon name.",
4419
4419
  "value": {
4420
4420
  "kind": "expression",
4421
4421
  "type": "string"
@@ -4433,7 +4433,7 @@
4433
4433
  },
4434
4434
  {
4435
4435
  "name": "validationRule",
4436
- "description": "Prevents input some characters (for ex. input numbers only).\nYou can use predefined values or your own RegExp.",
4436
+ "description": "Prevents some characters from input.\nYou can use predefined values or own RegExp.",
4437
4437
  "value": {
4438
4438
  "kind": "expression",
4439
4439
  "type": "'symbol' | 'string' | 'stringAndNumber' | 'number' | 'integer'"
@@ -4442,7 +4442,7 @@
4442
4442
  },
4443
4443
  {
4444
4444
  "name": "type",
4445
- "description": "Input type",
4445
+ "description": "Input type.",
4446
4446
  "value": {
4447
4447
  "kind": "expression",
4448
4448
  "type": "'text' | 'number' | 'tel' | 'email' | 'url' | 'search' | 'password'"
@@ -4451,7 +4451,7 @@
4451
4451
  },
4452
4452
  {
4453
4453
  "name": "inputmode",
4454
- "description": "Set proper keyboard on mobile devices.",
4454
+ "description": "Set specific keyboard for mobile devices.",
4455
4455
  "value": {
4456
4456
  "kind": "expression",
4457
4457
  "type": "'text' | 'decimal' | 'numeric' | 'tel' | 'email' | 'url' | 'search' | 'none'"
@@ -4460,7 +4460,7 @@
4460
4460
  },
4461
4461
  {
4462
4462
  "name": "readonly",
4463
- "description": "Set input read-only.",
4463
+ "description": "Make input read-only.",
4464
4464
  "value": {
4465
4465
  "kind": "expression",
4466
4466
  "type": "boolean"
@@ -4516,7 +4516,7 @@
4516
4516
  "events": [
4517
4517
  {
4518
4518
  "name": "update:modelValue",
4519
- "description": "Triggers when the input value is updated.",
4519
+ "description": "Triggers when the input value is changes.",
4520
4520
  "properties": [
4521
4521
  {
4522
4522
  "type": [
@@ -4554,13 +4554,19 @@
4554
4554
  },
4555
4555
  {
4556
4556
  "name": "input",
4557
- "description": "Triggers when any validation rules are applied to input value.",
4557
+ "description": "Triggers when the input value is changes.",
4558
4558
  "properties": [
4559
4559
  {
4560
4560
  "type": [
4561
4561
  "string"
4562
4562
  ],
4563
- "name": "value"
4563
+ "name": "modelValue"
4564
+ },
4565
+ {
4566
+ "type": [
4567
+ "number"
4568
+ ],
4569
+ "name": "modelValue"
4564
4570
  }
4565
4571
  ]
4566
4572
  }
@@ -4854,7 +4860,7 @@
4854
4860
  },
4855
4861
  {
4856
4862
  "name": "leftIcon",
4857
- "description": "Left side icon name.",
4863
+ "description": "Left icon name.",
4858
4864
  "value": {
4859
4865
  "kind": "expression",
4860
4866
  "type": "string"
@@ -4863,7 +4869,7 @@
4863
4869
  },
4864
4870
  {
4865
4871
  "name": "rightIcon",
4866
- "description": "Right side icon name.",
4872
+ "description": "Right icon name.",
4867
4873
  "value": {
4868
4874
  "kind": "expression",
4869
4875
  "type": "string"
@@ -5291,7 +5297,7 @@
5291
5297
  },
5292
5298
  {
5293
5299
  "name": "leftIcon",
5294
- "description": "Left side icon name.",
5300
+ "description": "Left icon name.",
5295
5301
  "value": {
5296
5302
  "kind": "expression",
5297
5303
  "type": "string"
@@ -5300,7 +5306,7 @@
5300
5306
  },
5301
5307
  {
5302
5308
  "name": "rightIcon",
5303
- "description": "Right side icon name.",
5309
+ "description": "Right icon name.",
5304
5310
  "value": {
5305
5311
  "kind": "expression",
5306
5312
  "type": "string"
@@ -7489,7 +7495,7 @@
7489
7495
  },
7490
7496
  {
7491
7497
  "name": "leftIcon",
7492
- "description": "Left side icon name.",
7498
+ "description": "Left icon name.",
7493
7499
  "value": {
7494
7500
  "kind": "expression",
7495
7501
  "type": "string"
@@ -7498,7 +7504,7 @@
7498
7504
  },
7499
7505
  {
7500
7506
  "name": "rightIcon",
7501
- "description": "Right side icon name.",
7507
+ "description": "Right icon name.",
7502
7508
  "value": {
7503
7509
  "kind": "expression",
7504
7510
  "type": "string"