Skip to content
Open

Dev #37

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
['@vue/cli-plugin-babel/preset', {
targets: {
browsers: ['> 1%', 'not dead', 'not op_mini all']
}
}]
]
}
3,647 changes: 3,647 additions & 0 deletions bun.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cypress.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"baseUrl": "http://localhost:8081",
"baseUrl": "http://localhost:8080",
"projectId": "32fyob"
}
2 changes: 1 addition & 1 deletion dist/build.js

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions dist/build.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@

/*! -!../../node_modules/style-loader/dist/cjs.js!../../node_modules/css-loader/dist/cjs.js!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/sass-loader/dist/cjs.js!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DatePicker.vue?vue&type=style&index=0&lang=scss& */

/*! -!../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DatePicker.vue?vue&type=template&id=b50420d4& */
/*! -!../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DatePicker.vue?vue&type=template&id=5a07fa16& */

/*! -!../node_modules/babel-loader/lib/index.js!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=js& */

/*! -!../node_modules/style-loader/dist/cjs.js!../node_modules/css-loader/dist/cjs.js!../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../node_modules/sass-loader/dist/cjs.js!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=style&index=0&lang=scss& */

/*! -!../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=template&id=1ca67f6e& */
/*! -!../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=template&id=5efbd083& */

/*! ../../node_modules/css-loader/dist/runtime/api.js */

Expand Down Expand Up @@ -308,7 +308,7 @@

/*! ./App.vue?vue&type=style&index=0&lang=scss& */

/*! ./App.vue?vue&type=template&id=1ca67f6e& */
/*! ./App.vue?vue&type=template&id=5efbd083& */

/*! ./ArrowIcon.vue?vue&type=script&lang=js& */

Expand All @@ -334,7 +334,7 @@

/*! ./DatePicker.vue?vue&type=style&index=0&lang=scss& */

/*! ./DatePicker.vue?vue&type=template&id=b50420d4& */
/*! ./DatePicker.vue?vue&type=template&id=5a07fa16& */

/*! ./arrayLikeToArray.js */

Expand Down Expand Up @@ -491,7 +491,7 @@
\****************************************************/

/*!****************************************************!*\
!*** ./src/App.vue?vue&type=template&id=1ca67f6e& ***!
!*** ./src/App.vue?vue&type=template&id=5efbd083& ***!
\****************************************************/

/*!*****************************************************!*\
Expand Down Expand Up @@ -1047,7 +1047,7 @@
\**********************************************************************/

/*!**********************************************************************!*\
!*** ./src/components/DatePicker.vue?vue&type=template&id=b50420d4& ***!
!*** ./src/components/DatePicker.vue?vue&type=template&id=5a07fa16& ***!
\**********************************************************************/

/*!***********************************************************************!*\
Expand Down Expand Up @@ -1171,15 +1171,15 @@
\***************************************************************************************************************************************************************************************/

/*!*******************************************************************************************************************************************************************************************!*\
!*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/App.vue?vue&type=template&id=1ca67f6e& ***!
!*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/App.vue?vue&type=template&id=5efbd083& ***!
\*******************************************************************************************************************************************************************************************/

/*!********************************************************************************************************************************************************************************************!*\
!*** ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/utils/components/CalendarClockIcon.vue?vue&type=script&lang=js& ***!
\********************************************************************************************************************************************************************************************/

/*!*************************************************************************************************************************************************************************************************************!*\
!*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/DatePicker.vue?vue&type=template&id=b50420d4& ***!
!*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/DatePicker.vue?vue&type=template&id=5a07fa16& ***!
\*************************************************************************************************************************************************************************************************************/

/*!*****************************************************************************************************************************************************************************************************************************!*\
Expand Down
2 changes: 1 addition & 1 deletion dist/build.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/datepicker.common.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/datepicker.common.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

/*! -!../../node_modules/style-loader/dist/cjs.js!../../node_modules/css-loader/dist/cjs.js!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/sass-loader/dist/cjs.js!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DatePicker.vue?vue&type=style&index=0&lang=scss& */

/*! -!../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DatePicker.vue?vue&type=template&id=b50420d4& */
/*! -!../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DatePicker.vue?vue&type=template&id=5a07fa16& */

/*! ../../node_modules/css-loader/dist/runtime/api.js */

Expand Down Expand Up @@ -294,7 +294,7 @@

/*! ./DatePicker.vue?vue&type=style&index=0&lang=scss& */

/*! ./DatePicker.vue?vue&type=template&id=b50420d4& */
/*! ./DatePicker.vue?vue&type=template&id=5a07fa16& */

/*! ./arrayLikeToArray.js */

Expand Down Expand Up @@ -979,7 +979,7 @@
\**********************************************************************/

/*!**********************************************************************!*\
!*** ./src/components/DatePicker.vue?vue&type=template&id=b50420d4& ***!
!*** ./src/components/DatePicker.vue?vue&type=template&id=5a07fa16& ***!
\**********************************************************************/

/*!***********************************************************************!*\
Expand Down Expand Up @@ -1103,7 +1103,7 @@
\********************************************************************************************************************************************************************************************/

/*!*************************************************************************************************************************************************************************************************************!*\
!*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/DatePicker.vue?vue&type=template&id=b50420d4& ***!
!*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/DatePicker.vue?vue&type=template&id=5a07fa16& ***!
\*************************************************************************************************************************************************************************************************************/

/*!*****************************************************************************************************************************************************************************************************************************!*\
Expand Down
2 changes: 1 addition & 1 deletion dist/datepicker.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/datepicker.min.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

/*! -!../../node_modules/style-loader/dist/cjs.js!../../node_modules/css-loader/dist/cjs.js!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/sass-loader/dist/cjs.js!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DatePicker.vue?vue&type=style&index=0&lang=scss& */

/*! -!../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DatePicker.vue?vue&type=template&id=b50420d4& */
/*! -!../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DatePicker.vue?vue&type=template&id=5a07fa16& */

/*! ../../node_modules/css-loader/dist/runtime/api.js */

Expand Down Expand Up @@ -294,7 +294,7 @@

/*! ./DatePicker.vue?vue&type=style&index=0&lang=scss& */

/*! ./DatePicker.vue?vue&type=template&id=b50420d4& */
/*! ./DatePicker.vue?vue&type=template&id=5a07fa16& */

/*! ./arrayLikeToArray.js */

Expand Down Expand Up @@ -979,7 +979,7 @@
\**********************************************************************/

/*!**********************************************************************!*\
!*** ./src/components/DatePicker.vue?vue&type=template&id=b50420d4& ***!
!*** ./src/components/DatePicker.vue?vue&type=template&id=5a07fa16& ***!
\**********************************************************************/

/*!***********************************************************************!*\
Expand Down Expand Up @@ -1103,7 +1103,7 @@
\********************************************************************************************************************************************************************************************/

/*!*************************************************************************************************************************************************************************************************************!*\
!*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/DatePicker.vue?vue&type=template&id=b50420d4& ***!
!*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/DatePicker.vue?vue&type=template&id=5a07fa16& ***!
\*************************************************************************************************************************************************************************************************************/

/*!*****************************************************************************************************************************************************************************************************************************!*\
Expand Down
1 change: 1 addition & 0 deletions nuxt.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export default function (option) {
this.nuxt.hook("components:dirs", (dirs) => {
dirs.push({
path: join(__dirname, "src/components"),
pattern: "**/*.vue",
});
});
}
Expand Down
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@alireza-ab/vue-persian-datepicker",
"description": "A datepicker component for select persian date",
"version": "2.3.0",
"version": "2.3.2",
"main": "./dist/datepicker.common.js",
"unpkg": "./dist/datepicker.min.js",
"scripts": {
Expand Down Expand Up @@ -54,11 +54,13 @@
"author": "Alireza Alibeiki <[email protected]>",
"license": "MIT",
"dependencies": {
"@alireza-ab/persian-date": "^2.6.1"
"@alireza-ab/persian-date": "^2.6.2"
},
"devDependencies": {
"@babel/core": "^7.17.0",
"@vue/cli-plugin-babel": "^4.5.15",
"@vue/compat": "^3.1.0",
"@vue/compiler-sfc": "^3.1.0",
"@webpack-cli/serve": "^1.6.1",
"babel-loader": "^8.2.3",
"core-js": "^3.21.0",
Expand All @@ -71,16 +73,16 @@
"sass-loader": "^12.4.0",
"style-loader": "^3.3.1",
"terser-webpack-plugin": "^5.3.1",
"vue": "^2.6.14",
"vue-loader": "^15.9.8",
"vue-template-compiler": "^2.6.14",
"vue": "^3.1.0",
"vue-loader": "^16.0.0",
"webpack": "^5.68.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^3.11.2"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
"not dead",
"not op_mini all"
]
}
21 changes: 21 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<title>Vue Persian DatePicker</title>
<link href="https://cdn.jsdelivr.net/gh/rastikerdar/[email protected]/dist/font-face.css" rel="stylesheet" type="text/css" />
</head>
<body>
<noscript>
<strong
>We're sorry but this doesn't work properly without JavaScript enabled.
Please enable it to continue.</strong
>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
<script src="dist/build.js"></script>
</body>
</html>
7 changes: 4 additions & 3 deletions src/components/DatePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
ref="root"
>
<slot name="before">
<label v-if="label" :for="attrs.input.id" v-bind="attrs.label">
<label v-if="label" v-bind="attrs.label" :for="attrs.input.id">
{{ label }}
</label>
</slot>
Expand Down Expand Up @@ -41,11 +41,11 @@
</slot>
</div>
<input
v-bind="attrs.input"
type="text"
autocomplete="off"
ref="pdpInput"
v-model="displayValue"
v-bind="attrs.input"
v-on="$listeners"
@focus="showPicker('input')"
@keydown="selectWithArrow"
Expand Down Expand Up @@ -1523,6 +1523,7 @@
setDate(date) {
if (!date) return;
if (this.mode == "single" && typeof date === "string") date = [date];
this.selectedDates = [];
date.some((d, index) => {
d = this.core
.clone()
Expand All @@ -1546,5 +1547,5 @@
</script>

<style lang="scss">
@import "./assets/sass/app.scss";
@use "./assets/sass/app.scss";
</style>
2 changes: 1 addition & 1 deletion src/components/assets/sass/app.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "_variable";
@use "variable" as *;

@mixin little-flag {
&:after {
Expand Down
6 changes: 4 additions & 2 deletions test/props.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"clearable": true,
"type": "datetime"
"from": "1399",
"to": "1399/06/31",
"locale": "fa",
"disable": "1399/6/10"
}
12 changes: 1 addition & 11 deletions test/slots.json
Original file line number Diff line number Diff line change
@@ -1,11 +1 @@
{
"before": "<label>select date:</label>",
"after": "<small>Please select date.</small>",
"icon": "Date",
"right-arrow": "ماه قبل",
"left-arrow": "ماه بعد",
"footer": "تاریخ انتخابی:",
"clear": "بستن",
"up-arrow": "افزایش",
"down-arrow": "کاهش"
}
{}
17 changes: 9 additions & 8 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const path = require("path");
const webpack = require("webpack");
const VueLoaderPlugin = require("vue-loader/lib/plugin");
const { VueLoaderPlugin } = require("vue-loader");
const TerserPlugin = require("terser-webpack-plugin");

module.exports = {
Expand All @@ -26,13 +26,14 @@ module.exports = {
},
{
test: /\.vue$/,
loader: "vue-loader",
loader: 'vue-loader',
options: {
loaders: {
scss: ["style-loader", "css-loader", "sass-loader"],
sass: ["style-loader", "css-loader", "sass-loader?indentedSyntax"],
},
},
compilerOptions: {
compatConfig: {
MODE: 2
}
}
}
},
{
test: /\.js$/,
Expand All @@ -50,7 +51,7 @@ module.exports = {
},
resolve: {
alias: {
vue$: "vue/dist/vue.esm.js",
vue: '@vue/compat',
},
extensions: ["*", ".js", ".vue", ".json"],
},
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# yarn lockfile v1


"@alireza-ab/persian-date@^2.6.1":
version "2.6.1"
resolved "https://registry.yarnpkg.com/@alireza-ab/persian-date/-/persian-date-2.6.1.tgz#ea452fa87c3e4b38ac93c42834c6d0c18f088be0"
integrity sha512-yXQGTJ5v79IHmqphRAWlROR6N/T19cByIjWe60sI1H1QtW2dx5ctZ0BEUMk6973+oxVLa4sJ3y/O1kk7uqPhEg==
"@alireza-ab/persian-date@^2.6.2":
version "2.6.2"
resolved "https://registry.yarnpkg.com/@alireza-ab/persian-date/-/persian-date-2.6.2.tgz#03c968cc00a4976f83366ab1a0980698f0cc49bc"
integrity sha512-Xv7gi9z4a9Y+2C7iklVaOOAuWWPFUxJbvoDgOJFATNirTFvzWtiKWAwXY/rYfil4Z8TrPD2RSpvBQZ4PoemGrw==

"@ampproject/remapping@^2.0.0":
version "2.0.2"
Expand Down