zmp-ui
Version:
Zalo Mini App framework
89 lines (88 loc) • 2.61 kB
JavaScript
;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = exports.WithSuffixIcon = exports.WithStartAndEndDate = exports.WithHelperText = exports.WithErrorText = exports.WithDefaultValue = exports.WithCustomDisplayFormat = exports.WithCustomDateFormat = exports.WithCustomColumnsFormat = exports.Disabled = exports.Default = void 0;
var _react = _interopRequireDefault(require("react"));
var _ = _interopRequireDefault(require("."));
var meta = {
title: "Form/DatePicker",
component: _["default"],
tags: ["autodocs"],
argTypes: {}
};
var _default = exports["default"] = meta;
var label = "Ngày giao hàng";
var Default = exports.Default = {
name: "Mặc định",
args: {
label: label,
placeholder: "Chọn ngày giao hàng"
}
};
var WithHelperText = exports.WithHelperText = {
name: "Với văn bản trợ giúp",
args: {
label: label,
helperText: "Vui lòng chọn ngày giao hàng hợp lệ."
}
};
var WithErrorText = exports.WithErrorText = {
name: "Với văn bản lỗi",
args: {
label: label,
status: "error",
errorText: "Ngày giao hàng không hợp lệ."
}
};
var Disabled = exports.Disabled = {
name: "Bị vô hiệu hóa",
args: {
label: label,
disabled: true
}
};
var WithDefaultValue = exports.WithDefaultValue = {
name: "Với giá trị mặc định",
args: {
label: label,
defaultValue: new Date(2023, 0, 1)
}
};
var WithCustomDateFormat = exports.WithCustomDateFormat = {
name: "Với định dạng ngày tùy chỉnh",
args: {
label: label,
dateFormat: "MM/dd/yyyy"
}
};
var WithCustomColumnsFormat = exports.WithCustomColumnsFormat = {
name: "Với định dạng cột tùy chỉnh",
args: {
label: label,
columnsFormat: "YYYY-MM-DD"
}
};
var WithStartAndEndDate = exports.WithStartAndEndDate = {
name: "Với ngày bắt đầu và kết thúc",
args: {
label: label,
startDate: new Date(2023, 0, 1),
endDate: new Date(2023, 11, 31)
}
};
var WithCustomDisplayFormat = exports.WithCustomDisplayFormat = {
name: "Với định dạng hiển thị tùy chỉnh",
args: {
label: label,
formatPickedValueDisplay: function formatPickedValueDisplay(date) {
return "Ng\xE0y giao h\xE0ng: " + date.toLocaleDateString();
}
}
};
var WithSuffixIcon = exports.WithSuffixIcon = {
name: "Với biểu tượng đuôi tùy chỉnh",
args: {
label: label,
suffix: /*#__PURE__*/_react["default"].createElement("span", null, "\uD83D\uDCC5")
}
};