@antify/ui 3.1.11 → 3.1.13

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.
@@ -93,6 +93,7 @@ onMounted(() => {
93
93
  <div
94
94
  v-if="showDropdown"
95
95
  ref="floating"
96
+ data-e2e="dropdown-menu"
96
97
  :class="_dropdownClasses"
97
98
  :style="floatingStyles"
98
99
  >
@@ -197,6 +197,7 @@ watch(_modelValue, () => {
197
197
  emit('validate', props.modelValue);
198
198
  }
199
199
  });
200
+ watch(() => props.options, () => getActuallySelectedItems());
200
201
 
201
202
  function onBlur(e: FocusEvent) {
202
203
  emit('validate', props.modelValue);
@@ -8,6 +8,7 @@ var _Size = require("../../../enums/Size.enum");
8
8
  var _AntMultiSelect = _interopRequireDefault(require("../AntMultiSelect.vue"));
9
9
  var _AntFormGroup = _interopRequireDefault(require("../../forms/AntFormGroup.vue"));
10
10
  var _AntFormGroupLabel = _interopRequireDefault(require("../../forms/AntFormGroupLabel.vue"));
11
+ var _AntButton = _interopRequireDefault(require("../../AntButton.vue"));
11
12
  var _vue = require("vue");
12
13
  var _enums = require("../../../enums");
13
14
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -79,7 +80,7 @@ const meta = {
79
80
  }
80
81
  };
81
82
  module.exports = meta;
82
- const options = [{
83
+ const options1 = [{
83
84
  label: "Option 1",
84
85
  value: "1"
85
86
  }, {
@@ -88,7 +89,8 @@ const options = [{
88
89
  }, {
89
90
  label: "Option 3",
90
91
  value: "3"
91
- }, {
92
+ }];
93
+ const options2 = [{
92
94
  label: "Option 4",
93
95
  value: "4"
94
96
  }, {
@@ -97,82 +99,49 @@ const options = [{
97
99
  }, {
98
100
  label: "Option 6",
99
101
  value: "6"
100
- }, {
101
- label: "Option 7",
102
- value: "7"
103
- }, {
104
- label: "Option 8",
105
- value: "8"
106
- }, {
107
- label: "Option 9",
108
- value: "9"
109
- }, {
110
- label: "Option 10",
111
- value: "10"
112
- }, {
113
- label: "Option 11",
114
- value: "11"
115
- }, {
116
- label: "Option 12",
117
- value: "12"
118
- }, {
119
- label: "Option 13",
120
- value: "13"
121
- }, {
122
- label: "Option 14",
123
- value: "14"
124
- }, {
125
- label: "Option 15",
126
- value: "15"
127
- }, {
128
- label: "Option 16",
129
- value: "16"
130
- }, {
131
- label: "Option 17",
132
- value: "17"
133
- }, {
134
- label: "Option 18",
135
- value: "18"
136
- }, {
137
- label: "Option 19",
138
- value: "19"
139
- }, {
140
- label: "Option 20",
141
- value: "20"
142
- }, {
143
- label: "Option 21",
144
- value: "21"
145
- }, {
146
- label: "Option 22",
147
- value: "22"
148
- }, {
149
- label: "Option 23",
150
- value: "23"
151
- }, {
152
- label: "Option 24",
153
- value: "24"
154
102
  }];
155
103
  const Docs = exports.Docs = {
156
104
  render: args => ({
157
105
  components: {
158
- AntMultiSelect: _AntMultiSelect.default
106
+ AntMultiSelect: _AntMultiSelect.default,
107
+ AntButton: _AntButton.default
159
108
  },
160
109
  setup() {
161
- const value = (0, _vue.ref)(["26", "2"]);
110
+ const value = (0, _vue.ref)(["26", "3"]);
111
+ const currentOptions = (0, _vue.ref)(options1);
112
+ const selectOptions = number => currentOptions.value = number === 1 ? options1 : options2;
162
113
  return {
163
114
  args,
164
- value
115
+ value,
116
+ State: _enums.State,
117
+ currentOptions,
118
+ selectOptions
165
119
  };
166
120
  },
167
121
  template: `
168
- <div class="flex flex-col justify-center">
169
- <AntMultiSelect v-bind="args" v-model="value"/>
122
+ <div class="flex flex-col justify-center gap-2.5">
123
+ <div class="flex gap-2.5">
124
+ <AntButton
125
+ :state="currentOptions[0].value === '1' ? State.primary : State.base"
126
+ :filled="currentOptions[0].value === '1'"
127
+ @click="selectOptions(1)"
128
+ >
129
+ Options 1
130
+ </AntButton>
131
+ <AntButton
132
+ :state="currentOptions[0].value === '4' ? State.primary : State.base"
133
+ :filled="currentOptions[0].value === '4'"
134
+ @click="selectOptions()"
135
+ >
136
+ Options 2
137
+ </AntButton>
138
+ </div>
139
+ <AntMultiSelect v-bind="args" v-model="value" :options="currentOptions"/>
170
140
  </div>
171
141
  `
172
142
  }),
173
143
  args: {
174
144
  label: "Label",
175
- options,
176
145
  description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod",
177
146
  nullable: true
178
147
  }
@@ -243,6 +212,6 @@ const Summary = exports.Summary = {
243
212
  }),
244
213
  args: {
245
214
  placeholder: "Placeholder",
246
- options
215
+ options: options1
247
216
  }
248
217
  };
@@ -4,13 +4,15 @@ import {
4
4
  import AntMultiSelect from "../AntMultiSelect.vue";
5
5
  import AntFormGroup from "../../forms/AntFormGroup.vue";
6
6
  import AntFormGroupLabel from "../../forms/AntFormGroupLabel.vue";
7
+ import AntButton from "../../AntButton.vue";
7
8
  import {
8
9
  ref
9
10
  } from "vue";
10
11
  import {
11
12
  Direction,
12
13
  Grouped,
13
- InputState
14
+ InputState,
15
+ State
14
16
  } from "../../../enums/index.mjs";
15
17
  const meta = {
16
18
  computed: {
@@ -80,7 +82,7 @@ const meta = {
80
82
  }
81
83
  };
82
84
  export default meta;
83
- const options = [
85
+ const options1 = [
84
86
  {
85
87
  label: "Option 1",
86
88
  value: "1"
@@ -92,7 +94,9 @@ const options = [
92
94
  {
93
95
  label: "Option 3",
94
96
  value: "3"
95
- },
97
+ }
98
+ ];
99
+ const options2 = [
96
100
  {
97
101
  label: "Option 4",
98
102
  value: "4"
@@ -104,104 +108,53 @@ const options = [
104
108
  {
105
109
  label: "Option 6",
106
110
  value: "6"
107
- },
108
- {
109
- label: "Option 7",
110
- value: "7"
111
- },
112
- {
113
- label: "Option 8",
114
- value: "8"
115
- },
116
- {
117
- label: "Option 9",
118
- value: "9"
119
- },
120
- {
121
- label: "Option 10",
122
- value: "10"
123
- },
124
- {
125
- label: "Option 11",
126
- value: "11"
127
- },
128
- {
129
- label: "Option 12",
130
- value: "12"
131
- },
132
- {
133
- label: "Option 13",
134
- value: "13"
135
- },
136
- {
137
- label: "Option 14",
138
- value: "14"
139
- },
140
- {
141
- label: "Option 15",
142
- value: "15"
143
- },
144
- {
145
- label: "Option 16",
146
- value: "16"
147
- },
148
- {
149
- label: "Option 17",
150
- value: "17"
151
- },
152
- {
153
- label: "Option 18",
154
- value: "18"
155
- },
156
- {
157
- label: "Option 19",
158
- value: "19"
159
- },
160
- {
161
- label: "Option 20",
162
- value: "20"
163
- },
164
- {
165
- label: "Option 21",
166
- value: "21"
167
- },
168
- {
169
- label: "Option 22",
170
- value: "22"
171
- },
172
- {
173
- label: "Option 23",
174
- value: "23"
175
- },
176
- {
177
- label: "Option 24",
178
- value: "24"
179
111
  }
180
112
  ];
181
113
  export const Docs = {
182
114
  render: (args) => ({
183
115
  components: {
184
- AntMultiSelect
116
+ AntMultiSelect,
117
+ AntButton
185
118
  },
186
119
  setup() {
187
120
  const value = ref([
188
121
  "26",
189
- "2"
122
+ "3"
190
123
  ]);
124
+ const currentOptions = ref(options1);
125
+ const selectOptions = (number) => currentOptions.value = number === 1 ? options1 : options2;
191
126
  return {
192
127
  args,
193
- value
128
+ value,
129
+ State,
130
+ currentOptions,
131
+ selectOptions
194
132
  };
195
133
  },
196
134
  template: `
197
- <div class="flex flex-col justify-center">
198
- <AntMultiSelect v-bind="args" v-model="value"/>
135
+ <div class="flex flex-col justify-center gap-2.5">
136
+ <div class="flex gap-2.5">
137
+ <AntButton
138
+ :state="currentOptions[0].value === '1' ? State.primary : State.base"
139
+ :filled="currentOptions[0].value === '1'"
140
+ @click="selectOptions(1)"
141
+ >
142
+ Options 1
143
+ </AntButton>
144
+ <AntButton
145
+ :state="currentOptions[0].value === '4' ? State.primary : State.base"
146
+ :filled="currentOptions[0].value === '4'"
147
+ @click="selectOptions()"
148
+ >
149
+ Options 2
150
+ </AntButton>
151
+ </div>
152
+ <AntMultiSelect v-bind="args" v-model="value" :options="currentOptions"/>
199
153
  </div>
200
154
  `
201
155
  }),
202
156
  args: {
203
157
  label: "Label",
204
- options,
205
158
  description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod",
206
159
  nullable: true
207
160
  }
@@ -276,6 +229,6 @@ export const Summary = {
276
229
  }),
277
230
  args: {
278
231
  placeholder: "Placeholder",
279
- options
232
+ options: options1
280
233
  }
281
234
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antify/ui",
3
- "version": "3.1.11",
3
+ "version": "3.1.13",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {