@antify/ui 2.4.5 → 2.4.11

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.
Files changed (25) hide show
  1. package/dist/components/buttons/AntButton.vue +1 -1
  2. package/dist/components/inputs/AntColorInput/AntColorInput.stories.js +26 -20
  3. package/dist/components/inputs/AntColorInput/AntColorInput.stories.mjs +35 -20
  4. package/dist/components/inputs/AntColorInput/AntColorInput.vue +52 -30
  5. package/dist/components/inputs/AntColorInput/Color.vue +44 -12
  6. package/dist/components/inputs/AntColorInput/ColorSelection.vue +18 -1
  7. package/dist/components/inputs/AntImageInput.vue +91 -22
  8. package/dist/components/inputs/AntPasswordInput.vue +5 -0
  9. package/dist/components/inputs/AntSelect.vue +4 -3
  10. package/dist/components/inputs/AntTagInput.vue +6 -2
  11. package/dist/components/inputs/AntTextInput.vue +5 -0
  12. package/dist/components/inputs/Elements/AntSelectMenu.vue +15 -7
  13. package/dist/components/inputs/Elements/__stories/AntBaseInput.stories.d.ts +1 -0
  14. package/dist/components/inputs/Elements/__stories/AntBaseInput.stories.js +35 -1
  15. package/dist/components/inputs/Elements/__stories/AntBaseInput.stories.mjs +36 -0
  16. package/dist/components/inputs/__stories/AntPasswordInput.stories.d.ts +2 -1
  17. package/dist/components/inputs/__stories/AntPasswordInput.stories.js +36 -1
  18. package/dist/components/inputs/__stories/AntPasswordInput.stories.mjs +37 -0
  19. package/dist/components/inputs/__stories/AntSelect.stories.d.ts +1 -0
  20. package/dist/components/inputs/__stories/AntSelect.stories.js +47 -3
  21. package/dist/components/inputs/__stories/AntSelect.stories.mjs +48 -2
  22. package/dist/components/inputs/__stories/AntTextInput.stories.d.ts +2 -1
  23. package/dist/components/inputs/__stories/AntTextInput.stories.js +37 -1
  24. package/dist/components/inputs/__stories/AntTextInput.stories.mjs +38 -0
  25. package/package.json +1 -1
@@ -15,6 +15,8 @@ import {
15
15
  import {
16
16
  InputState
17
17
  } from "../../../enums/index.mjs";
18
+ import AntFormGroup from "../../forms/AntFormGroup.vue";
19
+ import AntFormGroupLabel from "../../forms/AntFormGroupLabel.vue";
18
20
  const meta = {
19
21
  title: "Inputs/Select",
20
22
  component: AntSelect,
@@ -91,6 +93,12 @@ const manySelectOptions = [
91
93
  label: `Option ${Number(key) + 1}`,
92
94
  value: Number(key) + 1
93
95
  }));
96
+ const longSelectOptions = [
97
+ ...Array(4).keys()
98
+ ].map((key) => ({
99
+ label: `Very Long Select Option Possibly Larger Than Container ${Number(key) + 1}`,
100
+ value: Number(key) + 1
101
+ }));
94
102
  export const Docs = {
95
103
  render: (args) => ({
96
104
  components: {
@@ -208,6 +216,25 @@ export const manyOptions = {
208
216
  options: manySelectOptions
209
217
  }
210
218
  };
219
+ export const longOptions = {
220
+ render: (args, ctx) => ({
221
+ // @ts-ignore
222
+ components: Docs.render(args, ctx).components,
223
+ // @ts-ignore
224
+ setup: Docs.render(args, ctx).setup,
225
+ template: `
226
+ <div class="flex justify-center overflow-y-auto h-[100vh] p-2.5 dashed">
227
+ <div class="flex flex-col gap-4 justify-center h-[250vh] max-w-[150px]">
228
+ <AntSelect v-bind="args" v-model="modelValue"/>
229
+ </div>
230
+ </div>
231
+ `
232
+ }),
233
+ args: {
234
+ ...Docs.args,
235
+ options: longSelectOptions
236
+ }
237
+ };
211
238
  export const nullable = {
212
239
  render: Docs.render,
213
240
  args: {
@@ -334,9 +361,18 @@ export const summary = {
334
361
  },
335
362
  render: (args, ctx) => ({
336
363
  // @ts-ignore
337
- components: Docs.render(args, ctx).components,
364
+ components: {
365
+ AntSelect,
366
+ AntFormGroup,
367
+ AntFormGroupLabel
368
+ },
338
369
  // @ts-ignore
339
- setup: Docs.render(args, ctx).setup,
370
+ setup() {
371
+ return {
372
+ ...Docs.render(args, ctx).setup(),
373
+ longSelectOptions
374
+ };
375
+ },
340
376
  template: `
341
377
  <div class="p-4 flex flex-col gap-2.5">
342
378
  <div class="flex w-2/5 gap-2.5">
@@ -407,6 +443,16 @@ export const summary = {
407
443
  <AntSelect v-bind="args" v-model="modelValue" size="sm" nullable state="warning"/>
408
444
  <AntSelect v-bind="args" v-model="modelValue" size="sm" nullable state="danger"/>
409
445
  </div>
446
+ <AntFormGroup>
447
+ <AntFormGroupLabel>Long Select Options</AntFormGroupLabel>
448
+ <div class="grid grid-cols-5 gap-2.5">
449
+ <AntSelect v-bind="args" v-model="modelValue" :options="longSelectOptions"/>
450
+ <AntSelect v-bind="args" v-model="modelValue" :options="longSelectOptions"/>
451
+ <AntSelect v-bind="args" v-model="modelValue" :options="longSelectOptions"/>
452
+ <AntSelect v-bind="args" v-model="modelValue" :options="longSelectOptions"/>
453
+ <AntSelect v-bind="args" v-model="modelValue" :options="longSelectOptions"/>
454
+ </div>
455
+ </AntFormGroup>
410
456
  </div>
411
457
  `
412
458
  }),
@@ -1,7 +1,8 @@
1
- import { type Meta, type StoryObj } from '@storybook/vue3';
1
+ import type { Meta, StoryObj } from '@storybook/vue3';
2
2
  import AntTextInput from '../AntTextInput.vue';
3
3
  declare const meta: Meta<typeof AntTextInput>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof AntTextInput>;
6
6
  export declare const Docs: Story;
7
+ export declare const Autofocus: Story;
7
8
  export declare const Summary: Story;
@@ -3,11 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- module.exports = exports.Summary = exports.Docs = void 0;
6
+ module.exports = exports.Summary = exports.Docs = exports.Autofocus = void 0;
7
7
  var _Size = require("../../../enums/Size.enum");
8
8
  var _AntTextInput = _interopRequireDefault(require("../AntTextInput.vue"));
9
9
  var _AntTextInput2 = require("../__types/AntTextInput.types");
10
10
  var _enums = require("../../../enums");
11
+ var _AntFormGroup = _interopRequireDefault(require("../../forms/AntFormGroup.vue"));
12
+ var _AntButton = _interopRequireDefault(require("../../buttons/AntButton.vue"));
13
+ var _vue = require("vue");
11
14
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
15
  const meta = {
13
16
  title: "Inputs/Text Input",
@@ -86,6 +89,39 @@ const Docs = exports.Docs = {
86
89
  description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod"
87
90
  }
88
91
  };
92
+ const Autofocus = exports.Autofocus = {
93
+ render: args => ({
94
+ components: {
95
+ AntTextInput: _AntTextInput.default,
96
+ AntFormGroup: _AntFormGroup.default,
97
+ AntButton: _AntButton.default
98
+ },
99
+ setup: () => {
100
+ const inputRef = (0, _vue.ref)(null);
101
+ return {
102
+ inputRef,
103
+ clickAutofocus: () => {
104
+ inputRef.value?.focus();
105
+ },
106
+ args
107
+ };
108
+ },
109
+ template: `
110
+ <AntFormGroup>
111
+ <AntButton @click="clickAutofocus">Focus element</AntButton>
112
+
113
+ <AntTextInput
114
+ v-model="args.modelValue"
115
+ v-bind="args"
116
+ v-model:input-ref="inputRef"
117
+ />
118
+ </AntFormGroup>
119
+ `
120
+ }),
121
+ args: {
122
+ ...Docs.args
123
+ }
124
+ };
89
125
  const Summary = exports.Summary = {
90
126
  parameters: {
91
127
  chromatic: {
@@ -8,6 +8,11 @@ import {
8
8
  import {
9
9
  InputState
10
10
  } from "../../../enums/index.mjs";
11
+ import AntFormGroup from "../../forms/AntFormGroup.vue";
12
+ import AntButton from "../../buttons/AntButton.vue";
13
+ import {
14
+ ref
15
+ } from "vue";
11
16
  const meta = {
12
17
  title: "Inputs/Text Input",
13
18
  component: AntTextInput,
@@ -85,6 +90,39 @@ export const Docs = {
85
90
  description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod"
86
91
  }
87
92
  };
93
+ export const Autofocus = {
94
+ render: (args) => ({
95
+ components: {
96
+ AntTextInput,
97
+ AntFormGroup,
98
+ AntButton
99
+ },
100
+ setup: () => {
101
+ const inputRef = ref(null);
102
+ return {
103
+ inputRef,
104
+ clickAutofocus: () => {
105
+ inputRef.value?.focus();
106
+ },
107
+ args
108
+ };
109
+ },
110
+ template: `
111
+ <AntFormGroup>
112
+ <AntButton @click="clickAutofocus">Focus element</AntButton>
113
+
114
+ <AntTextInput
115
+ v-model="args.modelValue"
116
+ v-bind="args"
117
+ v-model:input-ref="inputRef"
118
+ />
119
+ </AntFormGroup>
120
+ `
121
+ }),
122
+ args: {
123
+ ...Docs.args
124
+ }
125
+ };
88
126
  export const Summary = {
89
127
  parameters: {
90
128
  chromatic: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antify/ui",
3
- "version": "2.4.5",
3
+ "version": "2.4.11",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {