vueless 0.0.181 → 0.0.183

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.181",
3
+ "version": "0.0.183",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless Component Framework.",
6
6
  "homepage": "https://vueless.com",
@@ -3,8 +3,7 @@ export default /*tw*/ {
3
3
  base: `
4
4
  flex items-center justify-center
5
5
  text-base font-medium outline-none
6
- border border-solid
7
- transition duration-100 ease-in-out
6
+ border border-solid transition-all
8
7
  focus:ring-opacity-20 focus:ring-4 focus:ring-{color}-700
9
8
  focus-within:ring-opacity-20 focus-within:ring-4 focus-within:ring-{color}-700
10
9
  disabled:ring-0 disabled:cursor-no-drop
@@ -1,8 +1,7 @@
1
1
  export default /*tw*/ {
2
2
  wrapper: {
3
3
  base: `
4
- w-fit inline-flex rounded
5
- transition duration-100 ease-in-out
4
+ w-fit inline-flex rounded transition-all
6
5
  focus-within:ring-4 focus-within:ring-{color}-500 focus-within:ring-opacity-15 focus-visible:outline-none
7
6
  `,
8
7
  variants: {
@@ -29,9 +28,8 @@ export default /*tw*/ {
29
28
  },
30
29
  link: {
31
30
  base: `
32
- w-full inline-block !leading-none
31
+ w-full inline-block !leading-none transition-all
33
32
  text-{color}-500 decoration-{color}-500 underline-offset-4
34
- transition duration-100 ease-in-out
35
33
  hover:text-opacity-80
36
34
  active:text-opacity-70
37
35
  focus:ring-offset-0 focus:ring-0
@@ -20,7 +20,7 @@ export default /*tw*/ {
20
20
  lg: "text-base",
21
21
  },
22
22
  isOpened: {
23
- true: "h-full pt-3 opacity-100 transition-all duration-100 ease-in-out",
23
+ true: "h-full pt-3 opacity-100 transition-all",
24
24
  },
25
25
  },
26
26
  },
@@ -32,6 +32,7 @@ export default /*tw*/ {
32
32
  defaultVariants: {
33
33
  animationDuration: 200,
34
34
  labelKey: "label",
35
+ valueKey: "id",
35
36
  nesting: false,
36
37
  upperlined: false,
37
38
  },
@@ -12,7 +12,7 @@
12
12
  <draggable
13
13
  v-else
14
14
  :list="list"
15
- item-key="id"
15
+ :item-key="valueKey"
16
16
  :group="{ name: group }"
17
17
  handle=".icon-drag"
18
18
  :ghost-class="config.draggableGhost"
@@ -23,8 +23,8 @@
23
23
  @end="onDragEnd"
24
24
  >
25
25
  <template #item="{ element }">
26
- <div :id="element.id" :data-cy="`${dataCy}-item`" v-bind="itemWrapperAttrs">
27
- <div :data-cy="`${dataCy}-item-${element.id}`" v-bind="itemAttrs">
26
+ <div :id="element[valueKey]" :data-cy="`${dataCy}-item`" v-bind="itemWrapperAttrs">
27
+ <div :data-cy="`${dataCy}-item-${element[valueKey]}`" v-bind="itemAttrs">
28
28
  <UIcon internal :name="config.dragIconName" color="gray" v-bind="dragIconAttrs" />
29
29
 
30
30
  <div v-bind="labelAttrs(element.isActive)">
@@ -52,7 +52,7 @@
52
52
  :data-cy="`${dataCy}-delete`"
53
53
  :tooltip="currentLocale.delete"
54
54
  v-bind="deleteIconAttrs"
55
- @click="onClickDelete(element.id, element[labelKey])"
55
+ @click="onClickDelete(element[valueKey], element[labelKey])"
56
56
  />
57
57
 
58
58
  <UIcon
@@ -64,7 +64,7 @@
64
64
  :data-cy="`${dataCy}-edit`"
65
65
  :tooltip="currentLocale.edit"
66
66
  v-bind="editIconAttrs"
67
- @click="onClickEdit(element.id, element[labelKey])"
67
+ @click="onClickEdit(element[valueKey], element[labelKey])"
68
68
  />
69
69
  </template>
70
70
  </div>
@@ -141,6 +141,14 @@ const props = defineProps({
141
141
  default: UIService.get(defaultConfig, UDataListName).default.labelKey,
142
142
  },
143
143
 
144
+ /**
145
+ * Value key in the item object of options.
146
+ */
147
+ valueKey: {
148
+ type: String,
149
+ default: UIService.get(defaultConfig, UDataListName).default.valueKey,
150
+ },
151
+
144
152
  /**
145
153
  * Empty state title.
146
154
  */
@@ -245,12 +253,12 @@ function onDragEnd() {
245
253
  emit("dragSort", sortData);
246
254
  }
247
255
 
248
- function onClickEdit(id, label) {
249
- emit("clickEdit", id, label);
256
+ function onClickEdit(value, label) {
257
+ emit("clickEdit", value, label);
250
258
  }
251
259
 
252
- function onClickDelete(id, label) {
253
- emit("clickDelete", id, label);
260
+ function onClickDelete(value, label) {
261
+ emit("clickDelete", value, label);
254
262
  }
255
263
 
256
264
  function prepareSortData(list, parentId) {
@@ -260,7 +268,7 @@ function prepareSortData(list, parentId) {
260
268
  let hasItemChildren = item?.children?.length;
261
269
 
262
270
  if (hasItemChildren) {
263
- let childrenItem = prepareSortData(item.children, item.id);
271
+ let childrenItem = prepareSortData(item.children, item[props.valueKey]);
264
272
 
265
273
  childrenItem.forEach((item) => {
266
274
  sortData.push(item);
@@ -43,7 +43,7 @@ export default /*tw*/ {
43
43
  headerLoader: "absolute !top-auto",
44
44
  body: "group/body divide-none",
45
45
  bodyRow: "hover:bg-gray-50",
46
- bodyRowChecked: "bg-gray-100 transition duration-100",
46
+ bodyRowChecked: "bg-gray-100 transition-all",
47
47
  bodyRowBefore: "!p-0",
48
48
  bodyRowBeforeCell: "py-1",
49
49
  bodyRowAfter: "!p-0",
@@ -27,6 +27,8 @@ export default /*tw*/ {
27
27
  size: "md",
28
28
  weight: "medium",
29
29
  variant: "primary",
30
+ labelKey: "label",
31
+ valueKey: "id",
30
32
  listYPosition: "bottom",
31
33
  listXPosition: "left",
32
34
  noIcon: false,
@@ -132,7 +132,7 @@ const props = defineProps({
132
132
  */
133
133
  labelKey: {
134
134
  type: String,
135
- default: "label",
135
+ default: UIService.get(defaultConfig, UDropdownBadge).default.labelKey,
136
136
  },
137
137
 
138
138
  /**
@@ -140,7 +140,7 @@ const props = defineProps({
140
140
  */
141
141
  valueKey: {
142
142
  type: String,
143
- default: "id",
143
+ default: UIService.get(defaultConfig, UDropdownBadge).default.valueKey,
144
144
  },
145
145
 
146
146
  /**
@@ -26,6 +26,8 @@ export default /*tw*/ {
26
26
  color: "brand",
27
27
  size: "md",
28
28
  variant: "primary",
29
+ labelKey: "label",
30
+ valueKey: "id",
29
31
  listYPosition: "bottom",
30
32
  listXPosition: "left",
31
33
  filled: false,
@@ -167,7 +167,7 @@ const props = defineProps({
167
167
  */
168
168
  labelKey: {
169
169
  type: String,
170
- default: "label",
170
+ default: UIService.get(defaultConfig, UDropdownButton).default.labelKey,
171
171
  },
172
172
 
173
173
  /**
@@ -175,7 +175,7 @@ const props = defineProps({
175
175
  */
176
176
  valueKey: {
177
177
  type: String,
178
- default: "id",
178
+ default: UIService.get(defaultConfig, UDropdownButton).default.valueKey,
179
179
  },
180
180
 
181
181
  /**
@@ -26,6 +26,8 @@ export default /*tw*/ {
26
26
  defaultVariants: {
27
27
  color: "brand",
28
28
  size: "md",
29
+ labelKey: "label",
30
+ valueKey: "id",
29
31
  listYPosition: "bottom",
30
32
  listXPosition: "left",
31
33
  underlined: undefined,
@@ -68,6 +68,7 @@ import vClickOutside from "../directive.clickOutside";
68
68
  import { UDropdownLink } from "./constants";
69
69
  import defaultConfig from "./configs/default.config";
70
70
  import { useAttrs } from "./composables/attrs.composable";
71
+ import { UDropdownButton } from "../ui.dropdown-button/constants/index.js";
71
72
 
72
73
  /* Should be a string for correct web-types gen */
73
74
  defineOptions({ name: "UDropdownLink", inheritAttrs: false });
@@ -152,7 +153,7 @@ const props = defineProps({
152
153
  */
153
154
  labelKey: {
154
155
  type: String,
155
- default: "label",
156
+ default: UIService.get(defaultConfig, UDropdownButton).default.labelKey,
156
157
  },
157
158
 
158
159
  /**
@@ -160,7 +161,7 @@ const props = defineProps({
160
161
  */
161
162
  valueKey: {
162
163
  type: String,
163
- default: "id",
164
+ default: UIService.get(defaultConfig, UDropdownButton).default.valueKey,
164
165
  },
165
166
 
166
167
  /**
@@ -5,10 +5,7 @@ export default /*tw*/ {
5
5
  overflow-auto [-webkit-overflow-scrolling:touch]
6
6
  focus:outline-none
7
7
  `,
8
- list: `
9
- inline-block list-none align-top m-0 min-w-full p-0
10
- hover:transition hover:duration-100 hover:ease-in-out bg-white opacity-1
11
- `,
8
+ list: "inline-block list-none align-top m-0 min-w-full p-0 bg-white opacity-1 hover:transition-all",
12
9
  subGroupLabel: {
13
10
  base: "pointer-events-none bg-transparent !font-medium !leading-none !uppercase !text-gray-500/[85] pt-1",
14
11
  variants: {
@@ -66,6 +63,8 @@ export default /*tw*/ {
66
63
  },
67
64
  defaultVariants: {
68
65
  size: "md",
66
+ labelKey: "label",
67
+ valueKey: "id",
69
68
  optionHeight: 40,
70
69
  maxHeight: undefined,
71
70
  disabled: false,
@@ -127,7 +127,7 @@ const props = defineProps({
127
127
  */
128
128
  labelKey: {
129
129
  type: String,
130
- default: "label",
130
+ default: UIService.get(defaultConfig, UDropdownList).default.valueKey,
131
131
  },
132
132
 
133
133
  /**
@@ -135,7 +135,7 @@ const props = defineProps({
135
135
  */
136
136
  valueKey: {
137
137
  type: String,
138
- default: "id",
138
+ default: UIService.get(defaultConfig, UDropdownList).default.valueKey,
139
139
  },
140
140
 
141
141
  /**
@@ -20,9 +20,7 @@ export default /*tw*/ {
20
20
  icon: "",
21
21
  checkbox: {
22
22
  base: `
23
- transition duration-100 ease-in-out
24
- border border-solid rounded
25
- border-gray-300 bg-white
23
+ border border-solid rounded border-gray-300 bg-white hover:transition-all
26
24
  hover:border-gray-400
27
25
  focus:border-{color}-500 focus:ring-4 focus:ring-opacity-20 focus:ring-offset-0 focus:ring-{color}-500
28
26
  active:border-{color}-500 active:bg-{color}-500
@@ -8,8 +8,7 @@ export default /*tw*/ {
8
8
  passwordHiddenIconName: "visibility_off-fill",
9
9
  block: {
10
10
  base: `
11
- rounded-lg border border-solid border-gray-300 bg-white !opacity-100 relative flex
12
- transition duration-100 ease-in-out
11
+ rounded-lg border border-solid border-gray-300 bg-white !opacity-100 relative flex transition-all
13
12
  hover:border-gray-400 hover:focus-within:border-brand-500
14
13
  focus-within:border-brand-500 focus-within:ring-4 focus-within:ring-brand-600/[.15]
15
14
  `,
@@ -32,7 +31,7 @@ export default /*tw*/ {
32
31
  input: {
33
32
  base: `
34
33
  block w-full pb-2 px-4 font-normal leading-none text-gray-900 placeholder:font-normal placeholder-gray-400
35
- transition duration-100 ease-in-out bg-white border-none border-gray-300 rounded-lg shadow-none
34
+ transition-all bg-white border-none border-gray-300 rounded-lg shadow-none
36
35
  focus:outline-none focus:ring-0 disabled:opacity-50
37
36
  disabled:cursor-not-allowed disabled:text-gray-900 disabled:border-gray-100
38
37
  read-only:border-gray-300 read-only:ring-0
@@ -4,7 +4,7 @@ export default /*tw*/ {
4
4
  base: `
5
5
  pb-2 pt-2 flex flex-row-reverse justify-between w-full min-h-full box-border relative
6
6
  rounded-lg border border-gray-300 bg-white
7
- hover:border-gray-400 hover:transition hover:duration-100 hover:ease-in-out hover:focus-within:border-brand-500
7
+ hover:border-gray-400 hover:transition-all hover:focus-within:border-brand-500
8
8
  focus-within:border-brand-500 focus-within:ring-4 focus-within:ring-brand-600/[.15] focus-within:outline-none
9
9
  `,
10
10
  variants: {
@@ -63,10 +63,7 @@ export default /*tw*/ {
63
63
  removeItemIconName: "close_small",
64
64
  caretRemoveItem: "flex items-center",
65
65
  caretClearText: {
66
- base: `
67
- cursor-pointer flex items-center text-sm font-normal text-gray-400 hover:text-gray-500
68
- transition-all duration-100 ease-in-out
69
- `,
66
+ base: "cursor-pointer flex items-center text-sm font-normal text-gray-400 hover:text-gray-500 transition-all",
70
67
  compoundVariants: [
71
68
  { size: "sm", class: "text-sm" },
72
69
  { size: "md", class: "text-base" },
@@ -163,13 +163,13 @@
163
163
  ref="dropdownListRef"
164
164
  v-model="dropdownValue"
165
165
  :options="filteredOptions"
166
- :disabled
167
- :size
166
+ :disabled="disabled"
167
+ :size="size"
168
168
  :max-height="optimizedHeight"
169
169
  :option-height="optionHeight"
170
- :value-key
171
- :label-key
172
- :add-option
170
+ :value-key="valueKey"
171
+ :label-key="labelKey"
172
+ :add-option="addOption"
173
173
  tabindex="-1"
174
174
  v-bind="dropdownListAttrs"
175
175
  @focus="activate"
@@ -2,7 +2,7 @@ export default /*tw*/ {
2
2
  label: "flex items-start",
3
3
  wrapper: {
4
4
  base: `
5
- transition-all duration-300 ease-in-out
5
+ transition-all duration-300
6
6
  flex items-center p-0.5 relative rounded-3xl cursor-pointer
7
7
  ring-opacity-10 focus-within:ring-4
8
8
  `,
@@ -28,7 +28,7 @@ export default /*tw*/ {
28
28
  },
29
29
  input: "absolute size-0 opacity-0",
30
30
  circle: {
31
- base: "transition-all duration-300 ease-in-out rounded-full bg-white flex items-center justify-center",
31
+ base: "transition-all duration-300 rounded-full bg-white flex items-center justify-center",
32
32
  variants: {
33
33
  size: {
34
34
  sm: "size-4",
@@ -46,7 +46,7 @@ export default /*tw*/ {
46
46
  selectedIconName: "check",
47
47
  unselectedIconName: "close",
48
48
  toggleLabel: {
49
- base: "absolute text-center text-2xs font-medium uppercase text-white transition-all duration-300 ease-in-out ",
49
+ base: "absolute text-center text-2xs font-medium uppercase text-white transition-all duration-300",
50
50
  compoundVariants: [
51
51
  { toggleLabel: true, checked: true, class: "w-1/2 left-1" },
52
52
  { toggleLabel: true, checked: false, class: "w-1/2 right-1" },
@@ -4,7 +4,7 @@ export default /*tw*/ {
4
4
  rightSlot: "flex items-center justify-center h-full w-11 absolute right-0",
5
5
  textareaWrapper: {
6
6
  base: `
7
- transition duration-100 ease-in-out focus-within:outline-none
7
+ transition-all focus-within:outline-none
8
8
  rounded-lg border border-solid border-gray-300 ring-0 cursor-text bg-white pr-4
9
9
  hover:border-gray-400 pl-4 hover:focus-within:border-gray-500
10
10
  focus-within:border-gray-500 focus-within:ring-4 focus-within:ring-gray-600/[.15]
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.181",
4
+ "version": "0.0.183",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",
@@ -1590,6 +1590,15 @@
1590
1590
  },
1591
1591
  "default": "label"
1592
1592
  },
1593
+ {
1594
+ "name": "valueKey",
1595
+ "description": "Value key in the item object of options.",
1596
+ "value": {
1597
+ "kind": "expression",
1598
+ "type": "string"
1599
+ },
1600
+ "default": "id"
1601
+ },
1593
1602
  {
1594
1603
  "name": "emptyTitle",
1595
1604
  "description": "Empty state title.",
@@ -2300,7 +2309,7 @@
2300
2309
  "kind": "expression",
2301
2310
  "type": "string"
2302
2311
  },
2303
- "default": "\"label\""
2312
+ "default": "label"
2304
2313
  },
2305
2314
  {
2306
2315
  "name": "valueKey",
@@ -2309,7 +2318,7 @@
2309
2318
  "kind": "expression",
2310
2319
  "type": "string"
2311
2320
  },
2312
- "default": "\"id\""
2321
+ "default": "id"
2313
2322
  },
2314
2323
  {
2315
2324
  "name": "listYPosition",
@@ -2483,7 +2492,7 @@
2483
2492
  "kind": "expression",
2484
2493
  "type": "string"
2485
2494
  },
2486
- "default": "\"label\""
2495
+ "default": "label"
2487
2496
  },
2488
2497
  {
2489
2498
  "name": "valueKey",
@@ -2492,7 +2501,7 @@
2492
2501
  "kind": "expression",
2493
2502
  "type": "string"
2494
2503
  },
2495
- "default": "\"id\""
2504
+ "default": "id"
2496
2505
  },
2497
2506
  {
2498
2507
  "name": "listYPosition",
@@ -2694,7 +2703,7 @@
2694
2703
  "kind": "expression",
2695
2704
  "type": "string"
2696
2705
  },
2697
- "default": "\"label\""
2706
+ "default": "label"
2698
2707
  },
2699
2708
  {
2700
2709
  "name": "valueKey",
@@ -2703,7 +2712,7 @@
2703
2712
  "kind": "expression",
2704
2713
  "type": "string"
2705
2714
  },
2706
- "default": "\"id\""
2715
+ "default": "id"
2707
2716
  },
2708
2717
  {
2709
2718
  "name": "listYPosition",
@@ -2787,7 +2796,7 @@
2787
2796
  "kind": "expression",
2788
2797
  "type": "string"
2789
2798
  },
2790
- "default": "\"label\""
2799
+ "default": "label"
2791
2800
  },
2792
2801
  {
2793
2802
  "name": "valueKey",
@@ -2796,7 +2805,7 @@
2796
2805
  "kind": "expression",
2797
2806
  "type": "string"
2798
2807
  },
2799
- "default": "\"id\""
2808
+ "default": "id"
2800
2809
  },
2801
2810
  {
2802
2811
  "name": "groupLabel",