@antify/ui 2.2.15 → 2.2.16

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.
@@ -45,6 +45,8 @@ const props = withDefaults(defineProps<{
45
45
  readonly?: boolean;
46
46
  skeleton?: boolean;
47
47
  messages?: string[];
48
+ min?: string;
49
+ max?: string;
48
50
  }>(), {
49
51
  state: InputState.base,
50
52
  type: AntDateInputTypes.date,
@@ -110,6 +112,8 @@ function onClickCalendar() {
110
112
  :disabled="disabled"
111
113
  :readonly="readonly"
112
114
  :show-icon="false"
115
+ :min="min"
116
+ :max="max"
113
117
  v-bind="$attrs"
114
118
  @validate="val => $emit('validate', val)"
115
119
  >
@@ -59,6 +59,8 @@ const props = withDefaults(defineProps<{
59
59
  iconLeft?: IconDefinition;
60
60
  nullable?: boolean;
61
61
  inputRef?: null | HTMLInputElement;
62
+ min?: string;
63
+ max?: string;
62
64
  }>(), {
63
65
  state: InputState.base,
64
66
  disabled: false,
@@ -257,6 +259,8 @@ function onClickClearIcon() {
257
259
  :disabled="disabled || skeleton"
258
260
  :readonly="readonly"
259
261
  :tabindex="hasInputState ? -1 : 0"
262
+ :min="min"
263
+ :max="max"
260
264
  title=""
261
265
  v-bind="$attrs"
262
266
  @blur="onBlur"
@@ -4,4 +4,5 @@ declare const meta: Meta<typeof AntDateInput>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof AntDateInput>;
6
6
  export declare const Docs: Story;
7
+ export declare const WithDateLimits: Story;
7
8
  export declare const Summary: Story;
@@ -3,7 +3,7 @@
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.WithDateLimits = exports.Summary = exports.Docs = void 0;
7
7
  var _Size = require("../../../enums/Size.enum");
8
8
  var _Direction = require("../../../enums/Direction.enum");
9
9
  var _AntDateInput = _interopRequireDefault(require("../AntDateInput.vue"));
@@ -72,6 +72,46 @@ const Docs = exports.Docs = {
72
72
  description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod"
73
73
  }
74
74
  };
75
+ const WithDateLimits = exports.WithDateLimits = {
76
+ render: args => ({
77
+ components: {
78
+ AntDateInput: _AntDateInput.default
79
+ },
80
+ setup() {
81
+ const today = /* @__PURE__ */new Date();
82
+ const year = today.getFullYear();
83
+ const month = String(today.getMonth() + 1).padStart(2, "0");
84
+ const day = String(today.getDate()).padStart(2, "0");
85
+ const min = "2024-01-01";
86
+ const max = `${year}-${month}-${day}`;
87
+ return {
88
+ args,
89
+ min,
90
+ max
91
+ };
92
+ },
93
+ template: `
94
+ <div class="flex flex-col gap-4">
95
+ <ul class="text-sm text-base-500">
96
+ <li>Min-Date: <span class="font-bold">{{ min }}</span></li>
97
+ <li>Max-Date: <span class="font-bold">{{ max }}</span></li>
98
+ </ul>
99
+
100
+ <AntDateInput
101
+ v-bind="args"
102
+ v-model="args.modelValue"
103
+ :min="min"
104
+ :max="max"
105
+ />
106
+ </div>
107
+ `
108
+ }),
109
+ args: {
110
+ modelValue: null,
111
+ label: "Label",
112
+ description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod"
113
+ }
114
+ };
75
115
  const Summary = exports.Summary = {
76
116
  parameters: {
77
117
  chromatic: {
@@ -73,6 +73,46 @@ export const Docs = {
73
73
  description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod"
74
74
  }
75
75
  };
76
+ export const WithDateLimits = {
77
+ render: (args) => ({
78
+ components: {
79
+ AntDateInput
80
+ },
81
+ setup() {
82
+ const today = /* @__PURE__ */ new Date();
83
+ const year = today.getFullYear();
84
+ const month = String(today.getMonth() + 1).padStart(2, "0");
85
+ const day = String(today.getDate()).padStart(2, "0");
86
+ const min = "2024-01-01";
87
+ const max = `${year}-${month}-${day}`;
88
+ return {
89
+ args,
90
+ min,
91
+ max
92
+ };
93
+ },
94
+ template: `
95
+ <div class="flex flex-col gap-4">
96
+ <ul class="text-sm text-base-500">
97
+ <li>Min-Date: <span class="font-bold">{{ min }}</span></li>
98
+ <li>Max-Date: <span class="font-bold">{{ max }}</span></li>
99
+ </ul>
100
+
101
+ <AntDateInput
102
+ v-bind="args"
103
+ v-model="args.modelValue"
104
+ :min="min"
105
+ :max="max"
106
+ />
107
+ </div>
108
+ `
109
+ }),
110
+ args: {
111
+ modelValue: null,
112
+ label: "Label",
113
+ description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod"
114
+ }
115
+ };
76
116
  export const Summary = {
77
117
  parameters: {
78
118
  chromatic: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antify/ui",
3
- "version": "2.2.15",
3
+ "version": "2.2.16",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {