@ember-eui/flatpickr 4.3.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/LICENSE.md ADDED
@@ -0,0 +1,9 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # flatpickr
2
+
3
+ [Short description of the addon.]
4
+
5
+ ## Compatibility
6
+
7
+ - Ember.js v3.24 or above
8
+ - Ember CLI v3.24 or above
9
+ - Node.js v12 or above
10
+
11
+ ## Installation
12
+
13
+ ```
14
+ ember install @ember-eui/flatpickr
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ [Longer description of how to use the addon in apps.]
20
+
21
+ ## Contributing
22
+
23
+ See the [Contributing](CONTRIBUTING.md) guide for details.
24
+
25
+ ## License
26
+
27
+ This project is licensed under the [MIT License](LICENSE.md).
@@ -0,0 +1,39 @@
1
+ {{#let
2
+ (and (not (arg-or-default @isFakePrependBlock false)) (has-block "prepend"))
3
+ (and (not (arg-or-default @isFakeAppendBlock false)) (has-block "append"))
4
+ (arg-or-default @id (unique-id))
5
+ as |hasPrepend hasAppend inputId|
6
+ }}
7
+ <EuiFieldText
8
+ aria-label={{@ariaLabel}}
9
+ @icon={{if @icon @icon "calendar"}}
10
+ @fullWidth={{@fullWidth}}
11
+ @isLoading={{@isLoading}}
12
+ @readOnly={{@readOnly}}
13
+ @inputRef={{@inputRef}}
14
+ @controlOnly={{@controlOnly}}
15
+ @compressed={{@compressed}}
16
+ @id={{inputId}}
17
+ @isFakePrependBlock={{hasPrepend}}
18
+ @isFakeAppendBlock={{hasAppend}}
19
+ @disabled={{@disabled}}
20
+ @isInvalid={{@isInvalid}}
21
+ ...attributes
22
+ {{did-insert this.onInsert}}
23
+ {{will-destroy this.onWillDestroy}}
24
+ {{did-update this.onAltFormatUpdated @altFormat}}
25
+ {{did-update this.onAltInputClassUpdated @altInputClass}}
26
+ {{did-update this.onDateUpdated @date}}
27
+ {{did-update this.onDisabledUpdated @disabled}}
28
+ {{did-update this.onLocaleUpdated @locale}}
29
+ {{did-update this.onMaxDateUpdated @maxDate}}
30
+ {{did-update this.onMinDateUpdated @minDate}}
31
+ >
32
+ <:prepend as |classes|>
33
+ {{yield classes to="prepend"}}
34
+ </:prepend>
35
+ <:append as |classes|>
36
+ {{yield classes to="append"}}
37
+ </:append>
38
+ </EuiFieldText>
39
+ {{/let}}
@@ -0,0 +1,3 @@
1
+ import EmberFlatpickr from 'ember-flatpickr/components/ember-flatpickr';
2
+
3
+ export default class EuiFlatpickrComponent extends EmberFlatpickr {}
@@ -0,0 +1 @@
1
+ export { default } from '@ember-eui/flatpickr/components/eui-flatpickr';
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ module.exports = function (/* environment, appConfig */) {
4
+ return {};
5
+ };
@@ -0,0 +1,62 @@
1
+ # Demo
2
+
3
+ ```hbs template
4
+ <EuiFlatpickr
5
+ @date={{this.date}}
6
+ {{! Required Option }}
7
+ @onChange={{this.setDate}}
8
+ @mode='range'
9
+ placeholder='Choose a Date'
10
+ @allowInput={{false}}
11
+ @altFormat='Y-m-d'
12
+ @altInput={{true}}
13
+ {{! Make sure to add these classes if you want to use altInput=true }}
14
+ @altInputClass='euiFieldText--withIcon euiFieldText--inGroup euiFieldText'
15
+ @clickOpens={{true}}
16
+ @dateFormat='M/D/Y'
17
+ @defaultDate={{this.date}}
18
+ @defaultHour={{12}}
19
+ @defaultMinute={{0}}
20
+ @disable={{this.datesToDisable}}
21
+ @disableMobile={{false}}
22
+ @enable={{this.datesToEnable}}
23
+ @enableSeconds={{false}}
24
+ @enableTime={{true}}
25
+ @hourIncrement={{1}}
26
+ @inline={{false}}
27
+ @locale='ru'
28
+ @maxDate={{this.maxDate}}
29
+ @minDate={{this.minDate}}
30
+ @minuteIncrement={{5}}
31
+ @mode='single'
32
+ @nextArrow='>'
33
+ @noCalendar={{false}}
34
+ {{! Required Option }}
35
+ @onClose={{this.onClose}}
36
+ @onOpen={{this.onOpen}}
37
+ @onReady={{this.onReady}}
38
+ {{! Can be used to easily store a reference to the flatpickr input. }}
39
+ @parseDate={{false}}
40
+ @prevArrow='<'
41
+ @shorthandCurrentMonth={{false}}
42
+ @static={{false}}
43
+ @time_24hr={{false}}
44
+ @weekNumbers={{false}}
45
+ />
46
+ {{this.date}}
47
+ ```
48
+
49
+ ```js component
50
+ import Component from '@glimmer/component';
51
+ import { action } from '@ember/object';
52
+ import { tracked } from '@glimmer/tracking';
53
+
54
+ export default class Hoool extends Component {
55
+ @tracked date = new Date();
56
+
57
+ @action
58
+ setDate(date) {
59
+ this.date = date;
60
+ }
61
+ }
62
+ ```
@@ -0,0 +1 @@
1
+ # Usage
@@ -0,0 +1,7 @@
1
+ # Installation
2
+
3
+ `ember-flatpickr` for `@ember-eui/core`
4
+
5
+ We use ember-flatpickr, so any ember-cli-build options from it are available.
6
+
7
+ 2. `ember install @ember-eui/flatpickr`
package/index.js ADDED
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ name: require('./package').name,
5
+ };
package/package.json ADDED
@@ -0,0 +1,121 @@
1
+ {
2
+ "name": "@ember-eui/flatpickr",
3
+ "version": "4.3.0",
4
+ "description": "ember-flatpickr integration with @ember-eui/core",
5
+ "keywords": [
6
+ "ember-addon",
7
+ "ember-flatpickr",
8
+ "@ember-eui"
9
+ ],
10
+ "repository": "https://github.com/prysmex/ember-eui",
11
+ "license": "MIT",
12
+ "author": "Alberto Cantu <betocantu93@gmail.com> (https://betocantu93.com)",
13
+ "directories": {
14
+ "doc": "doc",
15
+ "test": "tests"
16
+ },
17
+ "scripts": {
18
+ "build": "ember build --environment=production",
19
+ "lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
20
+ "lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
21
+ "lint:hbs": "ember-template-lint .",
22
+ "lint:hbs:fix": "ember-template-lint . --fix",
23
+ "lint:js": "eslint . --cache",
24
+ "lint:js:fix": "eslint . --fix",
25
+ "start": "ember serve",
26
+ "test": "npm-run-all lint test:*",
27
+ "test:ember": "ember test",
28
+ "test:ember-compatibility": "ember try:each",
29
+ "prepack": "ember ts:precompile",
30
+ "postpack": "ember ts:clean"
31
+ },
32
+ "dependencies": {
33
+ "@ember-eui/core": "^4.3.0",
34
+ "@types/ember": "^3.16.4",
35
+ "ember-auto-import": "^2.4.0",
36
+ "ember-cli-babel": "^7.26.11",
37
+ "ember-cli-htmlbars": "^6.0.1",
38
+ "ember-cli-typescript": "4.2.1",
39
+ "ember-flatpickr": "^3.2.2",
40
+ "ember-named-blocks-polyfill": "^0.2.3",
41
+ "ember-svg-jar": "^2.3.4"
42
+ },
43
+ "devDependencies": {
44
+ "@ember/optional-features": "^2.0.0",
45
+ "@ember/render-modifiers": "^2.0.4",
46
+ "@ember/test-helpers": "^2.6.0",
47
+ "@embroider/test-setup": "^1.0.0",
48
+ "@glimmer/component": "^1.0.4",
49
+ "@glimmer/tracking": "^1.0.4",
50
+ "@types/ember-qunit": "^5.0.0",
51
+ "@types/ember-resolver": "^5.0.11",
52
+ "@types/ember__application": "^4.0.0",
53
+ "@types/ember__array": "^4.0.1",
54
+ "@types/ember__component": "^4.0.4",
55
+ "@types/ember__controller": "^4.0.0",
56
+ "@types/ember__debug": "^4.0.0",
57
+ "@types/ember__engine": "^4.0.0",
58
+ "@types/ember__error": "^4.0.0",
59
+ "@types/ember__object": "^4.0.0",
60
+ "@types/ember__polyfills": "^4.0.0",
61
+ "@types/ember__routing": "^4.0.3",
62
+ "@types/ember__runloop": "^4.0.0",
63
+ "@types/ember__service": "^4.0.0",
64
+ "@types/ember__string": "^3.0.9",
65
+ "@types/ember__template": "^4.0.0",
66
+ "@types/ember__test": "^4.0.0",
67
+ "@types/ember__test-helpers": "^2.6.1",
68
+ "@types/ember__utils": "^4.0.0",
69
+ "@types/htmlbars-inline-precompile": "^3.0.0",
70
+ "@types/qunit": "^2.11.3",
71
+ "@types/rsvp": "^4.0.4",
72
+ "babel-eslint": "^8.0.0",
73
+ "broccoli-asset-rev": "^3.0.0",
74
+ "ember-cli": "~4.1.1",
75
+ "ember-cli-dependency-checker": "^3.2.0",
76
+ "ember-cli-inject-live-reload": "^2.1.0",
77
+ "ember-cli-sri": "^2.1.1",
78
+ "ember-cli-terser": "^4.0.2",
79
+ "ember-cli-typescript-blueprints": "^3.0.0",
80
+ "ember-composable-helpers": "^4.4.1",
81
+ "ember-disable-prototype-extensions": "^1.1.3",
82
+ "ember-export-application-global": "^2.0.1",
83
+ "ember-load-initializers": "^2.1.2",
84
+ "ember-page-title": "^7.0.0",
85
+ "ember-qunit": "^5.1.5",
86
+ "ember-resolver": "^8.0.3",
87
+ "ember-source": "~4.1.0",
88
+ "ember-source-channel-url": "^3.0.0",
89
+ "ember-template-lint": "^3.15.0",
90
+ "ember-try": "^2.0.0",
91
+ "eslint": "^7.32.0",
92
+ "eslint-config-prettier": "^8.3.0",
93
+ "eslint-plugin-ember": "^10.5.8",
94
+ "eslint-plugin-node": "^11.1.0",
95
+ "eslint-plugin-prettier": "^4.0.0",
96
+ "eslint-plugin-qunit": "^7.2.0",
97
+ "loader.js": "^4.7.0",
98
+ "npm-run-all": "^4.1.5",
99
+ "prettier": "^2.5.1",
100
+ "qunit": "^2.17.2",
101
+ "qunit-dom": "^2.0.0",
102
+ "typescript": "^4.5.5",
103
+ "webpack": "^5.65.0"
104
+ },
105
+ "engines": {
106
+ "node": "12.* || 14.* || >= 16"
107
+ },
108
+ "publishConfig": {
109
+ "access": "public"
110
+ },
111
+ "ember": {
112
+ "edition": "octane"
113
+ },
114
+ "ember-addon": {
115
+ "configPath": "tests/dummy/config"
116
+ },
117
+ "volta": {
118
+ "extends": "../../package.json"
119
+ },
120
+ "gitHead": "e9f6c51ed07476be91669d606ad4d45fa3575eb2"
121
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "baseUrl": ".",
5
+ "paths": {
6
+ "dummy/tests/*": [
7
+ "tests/*"
8
+ ],
9
+ "@glimmer/tracking": [
10
+ "../../node_modules/ember-cached-decorator-polyfill",
11
+ "../../node_modules/@glimmer/tracking/dist/types"
12
+ ],
13
+ "dummy/*": [
14
+ "tests/dummy/app/*",
15
+ "app/*"
16
+ ],
17
+ "flatpickr": [
18
+ "addon"
19
+ ],
20
+ "flatpickr/*": [
21
+ "addon/*"
22
+ ],
23
+ "flatpickr/test-support": [
24
+ "addon-test-support"
25
+ ],
26
+ "flatpickr/test-support/*": [
27
+ "addon-test-support/*"
28
+ ],
29
+ "*": [
30
+ "types/*"
31
+ ]
32
+ },
33
+ "experimentalDecorators": true
34
+ },
35
+ "include": [
36
+ "app/**/*",
37
+ "addon/**/*",
38
+ "tests/**/*",
39
+ "types/**/*",
40
+ "test-support/**/*",
41
+ "addon-test-support/**/*"
42
+ ]
43
+ }
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,6 @@
1
+ // Types for compiled templates
2
+ declare module '@ember-eui/flatpickr/templates/*' {
3
+ import { TemplateFactory } from 'htmlbars-inline-precompile';
4
+ const tmpl: TemplateFactory;
5
+ export default tmpl;
6
+ }