@antify/ui 1.0.4 → 1.2.0
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/dist/components/AntAccordion.vue +32 -7
- package/dist/components/AntAccordionItem.vue +48 -15
- package/dist/components/AntAlert.vue +8 -6
- package/dist/components/AntDropdown.vue +50 -36
- package/dist/components/AntIcon.vue +8 -6
- package/dist/components/AntKeycap.vue +22 -17
- package/dist/components/AntListGroup.vue +5 -3
- package/dist/components/AntModal.vue +17 -7
- package/dist/components/AntPopover.vue +118 -42
- package/dist/components/AntSkeleton.vue +1 -1
- package/dist/components/AntTooltip.vue +102 -76
- package/dist/components/__stories/AntAccordion.stories.d.ts +1 -0
- package/dist/components/__stories/AntAccordion.stories.js +73 -1
- package/dist/components/__stories/AntAccordion.stories.mjs +68 -0
- package/dist/components/__stories/AntDropdown.stories.js +27 -23
- package/dist/components/__stories/AntDropdown.stories.mjs +26 -22
- package/dist/components/__stories/AntKeycap.stories.js +13 -15
- package/dist/components/__stories/AntKeycap.stories.mjs +13 -13
- package/dist/components/__stories/AntListGroup.stories.js +1 -1
- package/dist/components/__stories/AntListGroup.stories.mjs +1 -1
- package/dist/components/__stories/AntModal.stories.js +2 -1
- package/dist/components/__stories/AntModal.stories.mjs +2 -1
- package/dist/components/__stories/AntPopover.stories.js +22 -21
- package/dist/components/__stories/AntPopover.stories.mjs +22 -20
- package/dist/components/__stories/AntTooltip.stories.d.ts +0 -10
- package/dist/components/__stories/AntTooltip.stories.js +32 -212
- package/dist/components/__stories/AntTooltip.stories.mjs +29 -193
- package/dist/components/__types/AntKeycap.types.d.ts +1 -0
- package/dist/components/__types/AntKeycap.types.js +1 -0
- package/dist/components/__types/AntKeycap.types.mjs +1 -0
- package/dist/components/buttons/AntButton.vue +41 -44
- package/dist/components/crud/AntCrud.vue +1 -1
- package/dist/components/crud/AntCrudDetailActions.vue +1 -0
- package/dist/components/crud/AntCrudTableFilter.vue +20 -18
- package/dist/components/forms/AntField.vue +7 -2
- package/dist/components/forms/__stories/AntField.stories.js +0 -16
- package/dist/components/forms/__stories/AntField.stories.mjs +2 -16
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.js +7 -7
- package/dist/components/index.mjs +2 -2
- package/dist/components/inputs/AntCheckbox.vue +25 -6
- package/dist/components/inputs/AntDateInput.vue +1 -1
- package/dist/components/inputs/AntRadio.vue +2 -1
- package/dist/components/inputs/AntSelect.vue +25 -22
- package/dist/components/inputs/AntSwitch.vue +2 -7
- package/dist/components/inputs/AntTagInput.vue +91 -114
- package/dist/components/inputs/AntTextarea.vue +7 -3
- package/dist/components/inputs/Elements/AntBaseInput.vue +2 -2
- package/dist/components/inputs/Elements/{AntDropDown.vue → AntSelectMenu.vue} +85 -40
- package/dist/components/inputs/Elements/__stories/AntBaseInput.stories.d.ts +0 -1
- package/dist/components/inputs/Elements/__stories/AntBaseInput.stories.js +1 -29
- package/dist/components/inputs/Elements/__stories/AntBaseInput.stories.mjs +0 -22
- package/dist/components/inputs/Elements/index.d.ts +2 -1
- package/dist/components/inputs/Elements/index.js +7 -0
- package/dist/components/inputs/Elements/index.mjs +3 -1
- package/dist/components/inputs/__stories/AntCheckbox.stories.d.ts +0 -1
- package/dist/components/inputs/__stories/AntCheckbox.stories.js +1 -43
- package/dist/components/inputs/__stories/AntCheckbox.stories.mjs +0 -35
- package/dist/components/inputs/__stories/AntCheckboxGroup.stories.d.ts +0 -1
- package/dist/components/inputs/__stories/AntCheckboxGroup.stories.js +1 -31
- package/dist/components/inputs/__stories/AntCheckboxGroup.stories.mjs +0 -28
- package/dist/components/inputs/__stories/AntDateInput.stories.d.ts +0 -1
- package/dist/components/inputs/__stories/AntDateInput.stories.js +1 -32
- package/dist/components/inputs/__stories/AntDateInput.stories.mjs +0 -28
- package/dist/components/inputs/__stories/AntNumberInput.stories.d.ts +0 -2
- package/dist/components/inputs/__stories/AntNumberInput.stories.js +1 -65
- package/dist/components/inputs/__stories/AntNumberInput.stories.mjs +1 -54
- package/dist/components/inputs/__stories/AntPasswordInput.stories.d.ts +0 -1
- package/dist/components/inputs/__stories/AntPasswordInput.stories.js +1 -35
- package/dist/components/inputs/__stories/AntPasswordInput.stories.mjs +0 -25
- package/dist/components/inputs/__stories/AntRadioGroup.stories.d.ts +0 -1
- package/dist/components/inputs/__stories/AntRadioGroup.stories.js +1 -47
- package/dist/components/inputs/__stories/AntRadioGroup.stories.mjs +0 -46
- package/dist/components/inputs/__stories/AntRangeSlider.stories.d.ts +0 -1
- package/dist/components/inputs/__stories/AntRangeSlider.stories.js +1 -33
- package/dist/components/inputs/__stories/AntRangeSlider.stories.mjs +1 -28
- package/dist/components/inputs/__stories/AntSelect.stories.d.ts +0 -1
- package/dist/components/inputs/__stories/AntSelect.stories.js +18 -46
- package/dist/components/inputs/__stories/AntSelect.stories.mjs +16 -47
- package/dist/components/inputs/__stories/AntSwitch.stories.d.ts +0 -1
- package/dist/components/inputs/__stories/AntSwitch.stories.js +1 -42
- package/dist/components/inputs/__stories/AntSwitch.stories.mjs +1 -37
- package/dist/components/inputs/__stories/AntSwitcher.stories.d.ts +0 -1
- package/dist/components/inputs/__stories/AntSwitcher.stories.js +1 -51
- package/dist/components/inputs/__stories/AntSwitcher.stories.mjs +1 -51
- package/dist/components/inputs/__stories/AntTagInput.stories.d.ts +0 -1
- package/dist/components/inputs/__stories/AntTagInput.stories.js +1 -35
- package/dist/components/inputs/__stories/AntTagInput.stories.mjs +0 -33
- package/dist/components/inputs/__stories/AntTextInput.stories.d.ts +0 -2
- package/dist/components/inputs/__stories/AntTextInput.stories.js +1 -107
- package/dist/components/inputs/__stories/AntTextInput.stories.mjs +0 -104
- package/dist/components/inputs/__stories/AntTextarea.stories.d.ts +0 -2
- package/dist/components/inputs/__stories/AntTextarea.stories.js +7 -66
- package/dist/components/inputs/__stories/AntTextarea.stories.mjs +6 -55
- package/dist/components/inputs/__stories/AntUnitInput.stories.d.ts +0 -2
- package/dist/components/inputs/__stories/AntUnitInput.stories.js +1 -61
- package/dist/components/inputs/__stories/AntUnitInput.stories.mjs +0 -53
- package/dist/components/table/AntTable.vue +17 -15
- package/dist/components/table/AntTd.vue +1 -2
- package/dist/components/table/__stories/AntTable.stories.js +7 -14
- package/dist/components/table/__stories/AntTable.stories.mjs +7 -15
- package/dist/components/tabs/AntTabItem.vue +16 -6
- package/dist/components/tabs/AntTabs.vue +8 -0
- package/dist/components/tabs/__types/AntTabItem.types.d.ts +1 -0
- package/package.json +2 -1
|
@@ -33,9 +33,16 @@ Object.defineProperty(exports, "AntInputLimiter", {
|
|
|
33
33
|
return _AntInputLimiter.default;
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
|
+
Object.defineProperty(exports, "AntSelectMenu", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _AntSelectMenu.default;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
36
42
|
var _AntBaseInput = _interopRequireDefault(require("./AntBaseInput.vue"));
|
|
37
43
|
var _AntField = _interopRequireDefault(require("../../forms/AntField.vue"));
|
|
38
44
|
var _AntInputDescription = _interopRequireDefault(require("./AntInputDescription.vue"));
|
|
39
45
|
var _AntInputLabel = _interopRequireDefault(require("./AntInputLabel.vue"));
|
|
40
46
|
var _AntInputLimiter = _interopRequireDefault(require("./AntInputLimiter.vue"));
|
|
47
|
+
var _AntSelectMenu = _interopRequireDefault(require("./AntSelectMenu.vue"));
|
|
41
48
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -3,10 +3,12 @@ import AntField from "../../forms/AntField.vue";
|
|
|
3
3
|
import AntInputDescription from "./AntInputDescription.vue";
|
|
4
4
|
import AntInputLabel from "./AntInputLabel.vue";
|
|
5
5
|
import AntInputLimiter from "./AntInputLimiter.vue";
|
|
6
|
+
import AntSelectMenu from "./AntSelectMenu.vue";
|
|
6
7
|
export {
|
|
7
8
|
AntBaseInput,
|
|
8
9
|
AntField,
|
|
9
10
|
AntInputDescription,
|
|
10
11
|
AntInputLabel,
|
|
11
|
-
AntInputLimiter
|
|
12
|
+
AntInputLimiter,
|
|
13
|
+
AntSelectMenu
|
|
12
14
|
};
|
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
module.exports = exports.
|
|
6
|
+
module.exports = exports.Summary = exports.Docs = void 0;
|
|
7
7
|
var _AntCheckbox = _interopRequireDefault(require("../AntCheckbox.vue"));
|
|
8
8
|
var _vue = require("vue");
|
|
9
9
|
var _enums = require("../../../enums");
|
|
10
|
-
var _validate = require("@antify/validate");
|
|
11
10
|
var _AntFormGroup = _interopRequireDefault(require("../../forms/AntFormGroup.vue"));
|
|
12
11
|
var _AntFormGroupLabel = _interopRequireDefault(require("../../forms/AntFormGroupLabel.vue"));
|
|
13
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -62,47 +61,6 @@ const Docs = exports.Docs = {
|
|
|
62
61
|
`
|
|
63
62
|
})
|
|
64
63
|
};
|
|
65
|
-
const WithValidator = exports.WithValidator = {
|
|
66
|
-
render: args => ({
|
|
67
|
-
components: {
|
|
68
|
-
AntCheckbox: _AntCheckbox.default
|
|
69
|
-
},
|
|
70
|
-
setup() {
|
|
71
|
-
const modelValue = (0, _vue.computed)({
|
|
72
|
-
get() {
|
|
73
|
-
return args.modelValue;
|
|
74
|
-
},
|
|
75
|
-
set(val) {
|
|
76
|
-
args.modelValue = val;
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
const validator = (0, _vue.ref)((0, _validate.useFieldValidator)(val => !val ? "Check this box!" : true));
|
|
80
|
-
return {
|
|
81
|
-
args,
|
|
82
|
-
modelValue,
|
|
83
|
-
validator,
|
|
84
|
-
InputState: _enums.InputState
|
|
85
|
-
};
|
|
86
|
-
},
|
|
87
|
-
template: `
|
|
88
|
-
<div class="m-2">
|
|
89
|
-
<AntCheckbox
|
|
90
|
-
v-bind="args"
|
|
91
|
-
v-model="modelValue"
|
|
92
|
-
:state="args.state ? args.state : (validator.hasErrors() ? InputState.danger : undefined)"
|
|
93
|
-
:messages="Array.isArray(args.messages) ? args.messages : validator.getErrors()"
|
|
94
|
-
@validate="(val) => validator.validate(val)"
|
|
95
|
-
>
|
|
96
|
-
Accept some kind of document before continuing
|
|
97
|
-
</AntCheckbox>
|
|
98
|
-
<span class="text-sm text-gray-500">Reactive value: {{ modelValue }}</span>
|
|
99
|
-
</div>
|
|
100
|
-
`
|
|
101
|
-
}),
|
|
102
|
-
args: {
|
|
103
|
-
modelValue: false
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
64
|
const Summary = exports.Summary = {
|
|
107
65
|
parameters: {
|
|
108
66
|
chromatic: {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import AntCheckbox from "../AntCheckbox.vue";
|
|
2
2
|
import { computed, ref } from "vue";
|
|
3
3
|
import { InputState, Size } from "../../../enums/index.mjs";
|
|
4
|
-
import { useFieldValidator } from "@antify/validate";
|
|
5
4
|
import AntFormGroup from "../../forms/AntFormGroup.vue";
|
|
6
5
|
import AntFormGroupLabel from "../../forms/AntFormGroupLabel.vue";
|
|
7
6
|
const meta = {
|
|
@@ -42,40 +41,6 @@ export const Docs = {
|
|
|
42
41
|
`
|
|
43
42
|
})
|
|
44
43
|
};
|
|
45
|
-
export const WithValidator = {
|
|
46
|
-
render: (args) => ({
|
|
47
|
-
components: { AntCheckbox },
|
|
48
|
-
setup() {
|
|
49
|
-
const modelValue = computed({
|
|
50
|
-
get() {
|
|
51
|
-
return args.modelValue;
|
|
52
|
-
},
|
|
53
|
-
set(val) {
|
|
54
|
-
args.modelValue = val;
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
const validator = ref(useFieldValidator((val) => !val ? "Check this box!" : true));
|
|
58
|
-
return { args, modelValue, validator, InputState };
|
|
59
|
-
},
|
|
60
|
-
template: `
|
|
61
|
-
<div class="m-2">
|
|
62
|
-
<AntCheckbox
|
|
63
|
-
v-bind="args"
|
|
64
|
-
v-model="modelValue"
|
|
65
|
-
:state="args.state ? args.state : (validator.hasErrors() ? InputState.danger : undefined)"
|
|
66
|
-
:messages="Array.isArray(args.messages) ? args.messages : validator.getErrors()"
|
|
67
|
-
@validate="(val) => validator.validate(val)"
|
|
68
|
-
>
|
|
69
|
-
Accept some kind of document before continuing
|
|
70
|
-
</AntCheckbox>
|
|
71
|
-
<span class="text-sm text-gray-500">Reactive value: {{ modelValue }}</span>
|
|
72
|
-
</div>
|
|
73
|
-
`
|
|
74
|
-
}),
|
|
75
|
-
args: {
|
|
76
|
-
modelValue: false
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
44
|
export const Summary = {
|
|
80
45
|
parameters: {
|
|
81
46
|
chromatic: { disableSnapshot: false }
|
|
@@ -3,12 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
module.exports = exports.
|
|
6
|
+
module.exports = exports.Docs = void 0;
|
|
7
7
|
var _AntCheckboxGroup = _interopRequireDefault(require("../AntCheckboxGroup.vue"));
|
|
8
|
-
var _vue = require("vue");
|
|
9
8
|
var _enums = require("../../../enums");
|
|
10
9
|
var _Direction = require("../../../enums/Direction.enum");
|
|
11
|
-
var _validate = require("@antify/validate");
|
|
12
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
11
|
const meta = {
|
|
14
12
|
title: "Inputs/Checkbox Group",
|
|
@@ -76,32 +74,4 @@ const Docs = exports.Docs = {
|
|
|
76
74
|
value: "checkbox-4"
|
|
77
75
|
}]
|
|
78
76
|
}
|
|
79
|
-
};
|
|
80
|
-
const WithValidator = exports.WithValidator = {
|
|
81
|
-
render: args => ({
|
|
82
|
-
components: {
|
|
83
|
-
AntCheckboxGroup: _AntCheckboxGroup.default
|
|
84
|
-
},
|
|
85
|
-
setup() {
|
|
86
|
-
const validator = (0, _vue.reactive)((0, _validate.useFieldValidator)(val => val.length >= 2 || "Select at least 2"));
|
|
87
|
-
return {
|
|
88
|
-
args,
|
|
89
|
-
validator,
|
|
90
|
-
InputState: _enums.InputState
|
|
91
|
-
};
|
|
92
|
-
},
|
|
93
|
-
template: `
|
|
94
|
-
<AntCheckboxGroup
|
|
95
|
-
v-bind="args"
|
|
96
|
-
v-model="args.modelValue"
|
|
97
|
-
:state="args.state ? args.state : (validator.hasErrors() ? InputState.danger : undefined)"
|
|
98
|
-
:messages="Array.isArray(args.messages) ? args.messages : validator.getErrors()"
|
|
99
|
-
@validate="(val) => validator.validate(val)"
|
|
100
|
-
/>
|
|
101
|
-
`
|
|
102
|
-
}),
|
|
103
|
-
args: {
|
|
104
|
-
...Docs.args,
|
|
105
|
-
modelValue: null
|
|
106
|
-
}
|
|
107
77
|
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import AntCheckboxGroup from "../AntCheckboxGroup.vue";
|
|
2
|
-
import { reactive } from "vue";
|
|
3
2
|
import { InputState, Size } from "../../../enums/index.mjs";
|
|
4
3
|
import { Direction } from "../../../enums/Direction.enum.mjs";
|
|
5
|
-
import { useFieldValidator } from "@antify/validate";
|
|
6
4
|
const meta = {
|
|
7
5
|
title: "Inputs/Checkbox Group",
|
|
8
6
|
component: AntCheckboxGroup,
|
|
@@ -56,29 +54,3 @@ export const Docs = {
|
|
|
56
54
|
}]
|
|
57
55
|
}
|
|
58
56
|
};
|
|
59
|
-
export const WithValidator = {
|
|
60
|
-
render: (args) => ({
|
|
61
|
-
components: { AntCheckboxGroup },
|
|
62
|
-
setup() {
|
|
63
|
-
const validator = reactive(useFieldValidator((val) => val.length >= 2 || "Select at least 2"));
|
|
64
|
-
return {
|
|
65
|
-
args,
|
|
66
|
-
validator,
|
|
67
|
-
InputState
|
|
68
|
-
};
|
|
69
|
-
},
|
|
70
|
-
template: `
|
|
71
|
-
<AntCheckboxGroup
|
|
72
|
-
v-bind="args"
|
|
73
|
-
v-model="args.modelValue"
|
|
74
|
-
:state="args.state ? args.state : (validator.hasErrors() ? InputState.danger : undefined)"
|
|
75
|
-
:messages="Array.isArray(args.messages) ? args.messages : validator.getErrors()"
|
|
76
|
-
@validate="(val) => validator.validate(val)"
|
|
77
|
-
/>
|
|
78
|
-
`
|
|
79
|
-
}),
|
|
80
|
-
args: {
|
|
81
|
-
...Docs.args,
|
|
82
|
-
modelValue: null
|
|
83
|
-
}
|
|
84
|
-
};
|
|
@@ -3,14 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
module.exports = exports.
|
|
6
|
+
module.exports = 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"));
|
|
10
10
|
var _enums = require("../../../enums");
|
|
11
11
|
var _AntDateInput2 = require("../__types/AntDateInput.types");
|
|
12
|
-
var _validate = require("@antify/validate");
|
|
13
|
-
var _vue = require("vue");
|
|
14
12
|
var _AntFormGroup = _interopRequireDefault(require("../../forms/AntFormGroup.vue"));
|
|
15
13
|
var _AntFormGroupLabel = _interopRequireDefault(require("../../forms/AntFormGroupLabel.vue"));
|
|
16
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -74,35 +72,6 @@ const Docs = exports.Docs = {
|
|
|
74
72
|
description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod"
|
|
75
73
|
}
|
|
76
74
|
};
|
|
77
|
-
const WithValidator = exports.WithValidator = {
|
|
78
|
-
render: args => ({
|
|
79
|
-
components: {
|
|
80
|
-
AntDateInput: _AntDateInput.default
|
|
81
|
-
},
|
|
82
|
-
setup() {
|
|
83
|
-
const validator = (0, _vue.reactive)((0, _validate.useFieldValidator)([_validate.isRequiredRule, val => typeof val !== "number" || val <= 8 || "Value should not be bigger than 8"]));
|
|
84
|
-
return {
|
|
85
|
-
args,
|
|
86
|
-
validator,
|
|
87
|
-
InputState: _enums.InputState
|
|
88
|
-
};
|
|
89
|
-
},
|
|
90
|
-
template: `
|
|
91
|
-
<AntDateInput
|
|
92
|
-
v-bind="args"
|
|
93
|
-
v-model="args.modelValue"
|
|
94
|
-
:state="args.state ? args.state : (validator.hasErrors() ? InputState.danger : undefined)"
|
|
95
|
-
:messages="Array.isArray(args.messages) ? args.messages : validator.getErrors()"
|
|
96
|
-
@validate="(val) => validator.validate(val)"
|
|
97
|
-
/>
|
|
98
|
-
`
|
|
99
|
-
}),
|
|
100
|
-
args: {
|
|
101
|
-
modelValue: null,
|
|
102
|
-
label: "Label",
|
|
103
|
-
description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod"
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
75
|
const Summary = exports.Summary = {
|
|
107
76
|
parameters: {
|
|
108
77
|
chromatic: {
|
|
@@ -3,8 +3,6 @@ import { Direction } from "../../../enums/Direction.enum.mjs";
|
|
|
3
3
|
import AntDateInput from "../AntDateInput.vue";
|
|
4
4
|
import { InputState } from "../../../enums/index.mjs";
|
|
5
5
|
import { AntDateInputTypes } from "../__types/AntDateInput.types.mjs";
|
|
6
|
-
import { isRequiredRule, useFieldValidator } from "@antify/validate";
|
|
7
|
-
import { reactive } from "vue";
|
|
8
6
|
import AntFormGroup from "../../forms/AntFormGroup.vue";
|
|
9
7
|
import AntFormGroupLabel from "../../forms/AntFormGroupLabel.vue";
|
|
10
8
|
const meta = {
|
|
@@ -49,32 +47,6 @@ export const Docs = {
|
|
|
49
47
|
description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod"
|
|
50
48
|
}
|
|
51
49
|
};
|
|
52
|
-
export const WithValidator = {
|
|
53
|
-
render: (args) => ({
|
|
54
|
-
components: { AntDateInput },
|
|
55
|
-
setup() {
|
|
56
|
-
const validator = reactive(useFieldValidator([
|
|
57
|
-
isRequiredRule,
|
|
58
|
-
(val) => typeof val !== "number" || val <= 8 || "Value should not be bigger than 8"
|
|
59
|
-
]));
|
|
60
|
-
return { args, validator, InputState };
|
|
61
|
-
},
|
|
62
|
-
template: `
|
|
63
|
-
<AntDateInput
|
|
64
|
-
v-bind="args"
|
|
65
|
-
v-model="args.modelValue"
|
|
66
|
-
:state="args.state ? args.state : (validator.hasErrors() ? InputState.danger : undefined)"
|
|
67
|
-
:messages="Array.isArray(args.messages) ? args.messages : validator.getErrors()"
|
|
68
|
-
@validate="(val) => validator.validate(val)"
|
|
69
|
-
/>
|
|
70
|
-
`
|
|
71
|
-
}),
|
|
72
|
-
args: {
|
|
73
|
-
modelValue: null,
|
|
74
|
-
label: "Label",
|
|
75
|
-
description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod"
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
50
|
export const Summary = {
|
|
79
51
|
parameters: {
|
|
80
52
|
chromatic: { disableSnapshot: false }
|
|
@@ -4,7 +4,5 @@ declare const meta: Meta<typeof AntNumberInput>;
|
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof AntNumberInput>;
|
|
6
6
|
export declare const Docs: Story;
|
|
7
|
-
export declare const withValidator: Story;
|
|
8
|
-
export declare const Limited: Story;
|
|
9
7
|
export declare const WithIndicators: Story;
|
|
10
8
|
export declare const Summary: Story;
|
|
@@ -3,20 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
6
|
+
module.exports = exports.WithIndicators = exports.Summary = exports.Docs = void 0;
|
|
7
7
|
var _Size = require("../../../enums/Size.enum");
|
|
8
8
|
var _AntNumberInput = _interopRequireDefault(require("../AntNumberInput.vue"));
|
|
9
9
|
var _State = require("../../../enums/State.enum");
|
|
10
|
-
var _validate = require("@antify/validate");
|
|
11
10
|
var _vue = require("vue");
|
|
12
11
|
var _AntFormGroup = _interopRequireDefault(require("../../forms/AntFormGroup.vue"));
|
|
13
12
|
var _AntFormGroupLabel = _interopRequireDefault(require("../../forms/AntFormGroupLabel.vue"));
|
|
14
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
14
|
const meta = {
|
|
16
|
-
components: {
|
|
17
|
-
AntFormGroupLabel: _AntFormGroupLabel.default,
|
|
18
|
-
AntFormGroup: _AntFormGroup.default
|
|
19
|
-
},
|
|
20
15
|
title: "Inputs/Number Input",
|
|
21
16
|
component: _AntNumberInput.default,
|
|
22
17
|
parameters: {
|
|
@@ -85,65 +80,6 @@ const Docs = exports.Docs = {
|
|
|
85
80
|
description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod"
|
|
86
81
|
}
|
|
87
82
|
};
|
|
88
|
-
const withValidator = exports.withValidator = {
|
|
89
|
-
render: args => ({
|
|
90
|
-
components: {
|
|
91
|
-
AntNumberInput: _AntNumberInput.default
|
|
92
|
-
},
|
|
93
|
-
setup() {
|
|
94
|
-
const validator = (0, _vue.reactive)((0, _validate.useFieldValidator)(_validate.isRequiredRule));
|
|
95
|
-
return {
|
|
96
|
-
args,
|
|
97
|
-
validator,
|
|
98
|
-
InputState: _State.InputState
|
|
99
|
-
};
|
|
100
|
-
},
|
|
101
|
-
template: `
|
|
102
|
-
<AntNumberInput
|
|
103
|
-
v-bind="args"
|
|
104
|
-
v-model="args.modelValue"
|
|
105
|
-
:state="args.state ? args.state : (validator.hasErrors() ? InputState.danger : undefined)"
|
|
106
|
-
:messages="Array.isArray(args.messages) ? args.messages : validator.getErrors()"
|
|
107
|
-
@validate="(val) => validator.validate(val)"
|
|
108
|
-
/>`
|
|
109
|
-
}),
|
|
110
|
-
args: {
|
|
111
|
-
modelValue: null,
|
|
112
|
-
steps: 1,
|
|
113
|
-
label: "Label",
|
|
114
|
-
description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod"
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
const Limited = exports.Limited = {
|
|
118
|
-
render: args => ({
|
|
119
|
-
components: {
|
|
120
|
-
AntNumberInput: _AntNumberInput.default
|
|
121
|
-
},
|
|
122
|
-
setup() {
|
|
123
|
-
const validator = (0, _vue.reactive)((0, _validate.useFieldValidator)([_validate.isRequiredRule, val => val <= 10 || "Value should not be bigger than 10", val => val <= 11 || "It should be really not bigger than 10!!!!"]));
|
|
124
|
-
return {
|
|
125
|
-
args,
|
|
126
|
-
validator,
|
|
127
|
-
InputState: _State.InputState
|
|
128
|
-
};
|
|
129
|
-
},
|
|
130
|
-
template: `
|
|
131
|
-
<AntNumberInput
|
|
132
|
-
v-bind="args"
|
|
133
|
-
v-model="args.modelValue"
|
|
134
|
-
:state="args.state ? args.state : (validator.hasErrors() ? InputState.danger : undefined)"
|
|
135
|
-
:messages="Array.isArray(args.messages) ? args.messages : validator.getErrors()"
|
|
136
|
-
@validate="(val) => validator.validate(val)"
|
|
137
|
-
/>`
|
|
138
|
-
}),
|
|
139
|
-
args: {
|
|
140
|
-
...Docs.args,
|
|
141
|
-
modelValue: 50,
|
|
142
|
-
limiter: true,
|
|
143
|
-
max: 10,
|
|
144
|
-
indicators: true
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
83
|
const WithIndicators = exports.WithIndicators = {
|
|
148
84
|
render: Docs.render,
|
|
149
85
|
args: {
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { Size } from "../../../enums/Size.enum.mjs";
|
|
2
2
|
import AntNumberInput from "../AntNumberInput.vue";
|
|
3
3
|
import { InputState } from "../../../enums/State.enum.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { reactive, ref } from "vue";
|
|
4
|
+
import { ref } from "vue";
|
|
6
5
|
import AntFormGroup from "../../forms/AntFormGroup.vue";
|
|
7
6
|
import AntFormGroupLabel from "../../forms/AntFormGroupLabel.vue";
|
|
8
7
|
const meta = {
|
|
9
|
-
components: { AntFormGroupLabel, AntFormGroup },
|
|
10
8
|
title: "Inputs/Number Input",
|
|
11
9
|
component: AntNumberInput,
|
|
12
10
|
parameters: { controls: { sort: "requiredFirst" } },
|
|
@@ -49,57 +47,6 @@ export const Docs = {
|
|
|
49
47
|
description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod"
|
|
50
48
|
}
|
|
51
49
|
};
|
|
52
|
-
export const withValidator = {
|
|
53
|
-
render: (args) => ({
|
|
54
|
-
components: { AntNumberInput },
|
|
55
|
-
setup() {
|
|
56
|
-
const validator = reactive(useFieldValidator(isRequiredRule));
|
|
57
|
-
return { args, validator, InputState };
|
|
58
|
-
},
|
|
59
|
-
template: `
|
|
60
|
-
<AntNumberInput
|
|
61
|
-
v-bind="args"
|
|
62
|
-
v-model="args.modelValue"
|
|
63
|
-
:state="args.state ? args.state : (validator.hasErrors() ? InputState.danger : undefined)"
|
|
64
|
-
:messages="Array.isArray(args.messages) ? args.messages : validator.getErrors()"
|
|
65
|
-
@validate="(val) => validator.validate(val)"
|
|
66
|
-
/>`
|
|
67
|
-
}),
|
|
68
|
-
args: {
|
|
69
|
-
modelValue: null,
|
|
70
|
-
steps: 1,
|
|
71
|
-
label: "Label",
|
|
72
|
-
description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod"
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
export const Limited = {
|
|
76
|
-
render: (args) => ({
|
|
77
|
-
components: { AntNumberInput },
|
|
78
|
-
setup() {
|
|
79
|
-
const validator = reactive(useFieldValidator([
|
|
80
|
-
isRequiredRule,
|
|
81
|
-
(val) => val <= 10 || "Value should not be bigger than 10",
|
|
82
|
-
(val) => val <= 11 || "It should be really not bigger than 10!!!!"
|
|
83
|
-
]));
|
|
84
|
-
return { args, validator, InputState };
|
|
85
|
-
},
|
|
86
|
-
template: `
|
|
87
|
-
<AntNumberInput
|
|
88
|
-
v-bind="args"
|
|
89
|
-
v-model="args.modelValue"
|
|
90
|
-
:state="args.state ? args.state : (validator.hasErrors() ? InputState.danger : undefined)"
|
|
91
|
-
:messages="Array.isArray(args.messages) ? args.messages : validator.getErrors()"
|
|
92
|
-
@validate="(val) => validator.validate(val)"
|
|
93
|
-
/>`
|
|
94
|
-
}),
|
|
95
|
-
args: {
|
|
96
|
-
...Docs.args,
|
|
97
|
-
modelValue: 50,
|
|
98
|
-
limiter: true,
|
|
99
|
-
max: 10,
|
|
100
|
-
indicators: true
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
50
|
export const WithIndicators = {
|
|
104
51
|
render: Docs.render,
|
|
105
52
|
args: {
|
|
@@ -3,20 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
module.exports = exports.
|
|
6
|
+
module.exports = exports.Summary = exports.Docs = void 0;
|
|
7
7
|
var _Size = require("../../../enums/Size.enum");
|
|
8
|
-
var _validate = require("@antify/validate");
|
|
9
8
|
var _enums = require("../../../enums");
|
|
10
|
-
var _vue = require("vue");
|
|
11
9
|
var _AntPasswordInput = _interopRequireDefault(require("../AntPasswordInput.vue"));
|
|
12
10
|
var _AntFormGroup = _interopRequireDefault(require("../../forms/AntFormGroup.vue"));
|
|
13
11
|
var _AntFormGroupLabel = _interopRequireDefault(require("../../forms/AntFormGroupLabel.vue"));
|
|
14
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
13
|
const meta = {
|
|
16
|
-
components: {
|
|
17
|
-
AntFormGroupLabel: _AntFormGroupLabel.default,
|
|
18
|
-
AntFormGroup: _AntFormGroup.default
|
|
19
|
-
},
|
|
20
14
|
title: "Inputs/Password Input",
|
|
21
15
|
component: _AntPasswordInput.default,
|
|
22
16
|
parameters: {
|
|
@@ -82,34 +76,6 @@ const Docs = exports.Docs = {
|
|
|
82
76
|
description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod"
|
|
83
77
|
}
|
|
84
78
|
};
|
|
85
|
-
const WithValidator = exports.WithValidator = {
|
|
86
|
-
render: args => ({
|
|
87
|
-
components: {
|
|
88
|
-
AntPasswordInput: _AntPasswordInput.default
|
|
89
|
-
},
|
|
90
|
-
setup() {
|
|
91
|
-
const validator = (0, _vue.reactive)((0, _validate.useFieldValidator)([_validate.isRequiredRule, _validate.notBlankRule]));
|
|
92
|
-
return {
|
|
93
|
-
args,
|
|
94
|
-
validator,
|
|
95
|
-
InputState: _enums.InputState
|
|
96
|
-
};
|
|
97
|
-
},
|
|
98
|
-
template: `
|
|
99
|
-
<AntPasswordInput
|
|
100
|
-
v-bind="args"
|
|
101
|
-
v-model="args.modelValue"
|
|
102
|
-
:state="args.state ? args.state : (validator.hasErrors() ? InputState.danger : undefined)"
|
|
103
|
-
:messages="Array.isArray(args.messages) ? args.messages : validator.getErrors()"
|
|
104
|
-
@validate="(val) => validator.validate(val)"
|
|
105
|
-
/>`
|
|
106
|
-
}),
|
|
107
|
-
args: {
|
|
108
|
-
modelValue: null,
|
|
109
|
-
label: "Label",
|
|
110
|
-
description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod"
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
79
|
const Summary = exports.Summary = {
|
|
114
80
|
parameters: {
|
|
115
81
|
chromatic: {
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { Size } from "../../../enums/Size.enum.mjs";
|
|
2
|
-
import { isRequiredRule, notBlankRule, useFieldValidator } from "@antify/validate";
|
|
3
2
|
import { InputState } from "../../../enums/index.mjs";
|
|
4
|
-
import { reactive } from "vue";
|
|
5
3
|
import AntPasswordInput from "../AntPasswordInput.vue";
|
|
6
4
|
import AntFormGroup from "../../forms/AntFormGroup.vue";
|
|
7
5
|
import AntFormGroupLabel from "../../forms/AntFormGroupLabel.vue";
|
|
8
6
|
const meta = {
|
|
9
|
-
components: { AntFormGroupLabel, AntFormGroup },
|
|
10
7
|
title: "Inputs/Password Input",
|
|
11
8
|
component: AntPasswordInput,
|
|
12
9
|
parameters: { controls: { sort: "requiredFirst" } },
|
|
@@ -48,28 +45,6 @@ export const Docs = {
|
|
|
48
45
|
description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod"
|
|
49
46
|
}
|
|
50
47
|
};
|
|
51
|
-
export const WithValidator = {
|
|
52
|
-
render: (args) => ({
|
|
53
|
-
components: { AntPasswordInput },
|
|
54
|
-
setup() {
|
|
55
|
-
const validator = reactive(useFieldValidator([isRequiredRule, notBlankRule]));
|
|
56
|
-
return { args, validator, InputState };
|
|
57
|
-
},
|
|
58
|
-
template: `
|
|
59
|
-
<AntPasswordInput
|
|
60
|
-
v-bind="args"
|
|
61
|
-
v-model="args.modelValue"
|
|
62
|
-
:state="args.state ? args.state : (validator.hasErrors() ? InputState.danger : undefined)"
|
|
63
|
-
:messages="Array.isArray(args.messages) ? args.messages : validator.getErrors()"
|
|
64
|
-
@validate="(val) => validator.validate(val)"
|
|
65
|
-
/>`
|
|
66
|
-
}),
|
|
67
|
-
args: {
|
|
68
|
-
modelValue: null,
|
|
69
|
-
label: "Label",
|
|
70
|
-
description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod"
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
48
|
export const Summary = {
|
|
74
49
|
parameters: {
|
|
75
50
|
chromatic: { disableSnapshot: false }
|