@ember-eui/flatpickr 13.0.5 → 14.1.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/declarations/components/eui-flatpickr.d.ts +50 -2
- package/declarations/components/eui-flatpickr.d.ts.map +1 -1
- package/dist/-private/random-id.js +1 -0
- package/dist/-private/random-id.js.map +1 -1
- package/dist/components/eui-flatpickr.js +171 -4
- package/dist/components/eui-flatpickr.js.map +1 -1
- package/package.json +62 -37
- /package/{addon-main.js → addon-main.cjs} +0 -0
|
@@ -1,5 +1,53 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* EUI text field wired to flatpickr (https://flatpickr.js.org): a date,
|
|
3
|
+
* time, date range or multiple dates picker. Load flatpickr's styles once,
|
|
4
|
+
* e.g. `import 'flatpickr/dist/flatpickr.css'` in `app/app.js`.
|
|
5
|
+
*
|
|
6
|
+
* Arguments:
|
|
7
|
+
* - `@date` (required): the selected date(s): a `Date`, a string in
|
|
8
|
+
* `@dateFormat`, an array for ranges / multiple dates, or `null`.
|
|
9
|
+
* - `@onChange` (required, or `null`): called with
|
|
10
|
+
* `(selectedDates: Date[], dateStr: string, instance)`; update `@date`.
|
|
11
|
+
* - `@onOpen`, `@onClose`, `@onReady`: flatpickr's hooks, same arguments.
|
|
12
|
+
* - `@locale`: a flatpickr locale object, or a key such as `'es'` (loaded
|
|
13
|
+
* lazily). Changing it recreates the picker.
|
|
14
|
+
* - `@disabled`: disables the input.
|
|
15
|
+
* - `@clear`: shows a clear button (while there is a `@date`) calling
|
|
16
|
+
* `@clear(null)`.
|
|
17
|
+
* - `@ariaLabel`: accessible label of the input.
|
|
18
|
+
* - Any other flatpickr option is passed through, e.g. `@mode` (`'single'`,
|
|
19
|
+
* `'multiple'`, `'range'`), `@enableTime`, `@noCalendar`, `@dateFormat`,
|
|
20
|
+
* `@altInput` / `@altFormat` / `@altInputClass`, `@minDate`, `@maxDate`,
|
|
21
|
+
* `@inline`, `@weekNumbers`. `@minDate`, `@maxDate`, `@altFormat`,
|
|
22
|
+
* `@altInputClass` and `@date` also update a rendered picker.
|
|
23
|
+
* - EuiFieldText's args style the input: `@icon` (defaults to
|
|
24
|
+
* `'calendar'`), `@fullWidth`, `@compressed`, `@isInvalid`,
|
|
25
|
+
* `@isLoading`, `@readOnly`, `@controlOnly`, `@inputRef`, `@id`, plus the
|
|
26
|
+
* `<:prepend>` / `<:append>` blocks.
|
|
27
|
+
*
|
|
28
|
+
* `@wrap` is not supported.
|
|
29
|
+
*
|
|
30
|
+
* The flatpickr lifecycle below used to come from extending ember-flatpickr's
|
|
31
|
+
* component; it is inlined (same arguments and behavior) because
|
|
32
|
+
* ember-flatpickr still depends on v1 addons (@ember/render-modifiers 3,
|
|
33
|
+
* @ember/test-waiters 3), which break Vite apps.
|
|
34
|
+
*/
|
|
35
|
+
export default class EuiFlatpickrComponent extends Component<any> {
|
|
36
|
+
constructor(owner: import("@ember/owner").default, args: any);
|
|
37
|
+
flatpickrRef: any;
|
|
2
38
|
onClear(): void;
|
|
39
|
+
onInsert(element: any): void;
|
|
40
|
+
onWillDestroy(): void;
|
|
41
|
+
setupFlatpickr(element: any): void;
|
|
42
|
+
setFlatpickrOptions(element: any): Promise<void>;
|
|
43
|
+
setDisabled(disabled: any): void;
|
|
44
|
+
onAltFormatUpdated(): void;
|
|
45
|
+
onAltInputClassUpdated(): void;
|
|
46
|
+
onDateUpdated(): void;
|
|
47
|
+
onDisabledUpdated(): void;
|
|
48
|
+
onLocaleUpdated(element: any): void;
|
|
49
|
+
onMaxDateUpdated(): void;
|
|
50
|
+
onMinDateUpdated(): void;
|
|
3
51
|
}
|
|
4
|
-
import
|
|
52
|
+
import Component from '@glimmer/component';
|
|
5
53
|
//# sourceMappingURL=eui-flatpickr.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eui-flatpickr.d.ts","sourceRoot":"","sources":["../../src/components/eui-flatpickr.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"eui-flatpickr.d.ts","sourceRoot":"","sources":["../../src/components/eui-flatpickr.js"],"names":[],"mappings":"AAiCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH;;IACE,kBAAa;IAEb,gBAGC;IAED,6BAGC;IAED,sBAGC;IAED,mCAiBC;IAED,iDAiCC;IAED,iCAcC;IAED,2BAGC;IAED,+BAYC;IAED,sBAKC;IAED,0BAKC;IAED,oCAIC;IAED,yBAGC;IAED,yBAGC;CAqCF;sBA/OqB,oBAAoB"}
|
|
@@ -6,6 +6,7 @@ var randomId = helper(randomId$1);
|
|
|
6
6
|
// https://github.com/emberjs/ember.js/blob/master/packages/@ember/-internals/glimmer/lib/helpers/unique-id.ts
|
|
7
7
|
function randomId$1() {
|
|
8
8
|
//@ts-expect-error
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands -- ember's own trick
|
|
9
10
|
return ([3e7] + -1e3 + -4e3 + -2e3 + -1e11).replace(/[0-3]/g, a => (a * 4 ^ Math.random() * 16 >> (a & 2)).toString(16));
|
|
10
11
|
}
|
|
11
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"random-id.js","sources":["../../src/-private/random-id.ts"],"sourcesContent":["import { helper } from '@ember/component/helper';\n\nexport default helper<{\n Args: {\n Positional: [];\n };\n Return: string;\n}>(randomId);\n\n// Copy-pasted from the ember-source implementation:\n// https://github.com/emberjs/ember.js/blob/master/packages/@ember/-internals/glimmer/lib/helpers/unique-id.ts\nfunction randomId() {\n //@ts-expect-error\n return ([3e7] + -1e3 + -4e3 + -2e3 + -1e11).replace(/[0-3]/g, (a) =>\n ((a * 4) ^ ((Math.random() * 16) >> (a & 2))).toString(16)\n );\n}\n"],"names":["helper","randomId","replace","a","Math","random","toString"],"mappings":";;AAEA,eAAeA,MAAM,CAKlBC,UAAQ,CAAC;;AAEZ;AACA;AACA,SAASA,UAAQA,GAAG;AAClB;EACA,OAAO,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,EAAEC,OAAO,CAAC,QAAQ,EAAGC,CAAC,IAC9D,CAAEA,CAAC,GAAG,CAAC,GAAMC,IAAI,CAACC,MAAM,EAAE,GAAG,EAAE,KAAMF,CAAC,GAAG,CAAC,CAAE,EAAEG,QAAQ,CAAC,EAAE,CAC3D,CAAC;AACH
|
|
1
|
+
{"version":3,"file":"random-id.js","sources":["../../src/-private/random-id.ts"],"sourcesContent":["import { helper } from '@ember/component/helper';\n\nexport default helper<{\n Args: {\n Positional: [];\n };\n Return: string;\n}>(randomId);\n\n// Copy-pasted from the ember-source implementation:\n// https://github.com/emberjs/ember.js/blob/master/packages/@ember/-internals/glimmer/lib/helpers/unique-id.ts\nfunction randomId() {\n //@ts-expect-error\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands -- ember's own trick\n return ([3e7] + -1e3 + -4e3 + -2e3 + -1e11).replace(/[0-3]/g, (a) =>\n ((a * 4) ^ ((Math.random() * 16) >> (a & 2))).toString(16)\n );\n}\n"],"names":["helper","randomId","replace","a","Math","random","toString"],"mappings":";;AAEA,eAAeA,MAAM,CAKlBC,UAAQ,CAAC;;AAEZ;AACA;AACA,SAASA,UAAQA,GAAG;AAClB;AACA;EACA,OAAO,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,EAAEC,OAAO,CAAC,QAAQ,EAAGC,CAAC,IAC9D,CAAEA,CAAC,GAAG,CAAC,GAAMC,IAAI,CAACC,MAAM,EAAE,GAAG,EAAE,KAAMF,CAAC,GAAG,CAAC,CAAE,EAAEG,QAAQ,CAAC,EAAE,CAC3D,CAAC;AACH;;"}
|
|
@@ -1,25 +1,192 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { assert } from '@ember/debug';
|
|
1
3
|
import { action } from '@ember/object';
|
|
4
|
+
import { getOwner } from '@ember/owner';
|
|
2
5
|
import didInsert from '@ember/render-modifiers/modifiers/did-insert';
|
|
3
6
|
import didUpdate from '@ember/render-modifiers/modifiers/did-update';
|
|
4
7
|
import willDestroy from '@ember/render-modifiers/modifiers/will-destroy';
|
|
8
|
+
import { scheduleOnce } from '@ember/runloop';
|
|
9
|
+
import { waitForPromise } from '@ember/test-waiters';
|
|
5
10
|
import { EuiFieldText } from '@ember-eui/core/components';
|
|
6
11
|
import { argOrDefault } from '@ember-eui/core/helpers';
|
|
7
|
-
import
|
|
12
|
+
import flatpickr from 'flatpickr';
|
|
8
13
|
import { not, and } from 'ember-truth-helpers';
|
|
9
14
|
import randomId from '../-private/random-id.js';
|
|
10
15
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
11
16
|
import { setComponentTemplate } from '@ember/component';
|
|
12
|
-
import { n } from 'decorator-transforms/runtime';
|
|
17
|
+
import { n } from 'decorator-transforms/runtime-esm';
|
|
13
18
|
|
|
14
|
-
|
|
19
|
+
async function loadLocale(key) {
|
|
20
|
+
const module = await import('flatpickr/dist/l10n/index.js');
|
|
21
|
+
const locales = module.default?.default ?? module.default ?? module;
|
|
22
|
+
return locales[key] ?? key;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* EUI text field wired to flatpickr (https://flatpickr.js.org): a date,
|
|
26
|
+
* time, date range or multiple dates picker. Load flatpickr's styles once,
|
|
27
|
+
* e.g. `import 'flatpickr/dist/flatpickr.css'` in `app/app.js`.
|
|
28
|
+
*
|
|
29
|
+
* Arguments:
|
|
30
|
+
* - `@date` (required): the selected date(s): a `Date`, a string in
|
|
31
|
+
* `@dateFormat`, an array for ranges / multiple dates, or `null`.
|
|
32
|
+
* - `@onChange` (required, or `null`): called with
|
|
33
|
+
* `(selectedDates: Date[], dateStr: string, instance)`; update `@date`.
|
|
34
|
+
* - `@onOpen`, `@onClose`, `@onReady`: flatpickr's hooks, same arguments.
|
|
35
|
+
* - `@locale`: a flatpickr locale object, or a key such as `'es'` (loaded
|
|
36
|
+
* lazily). Changing it recreates the picker.
|
|
37
|
+
* - `@disabled`: disables the input.
|
|
38
|
+
* - `@clear`: shows a clear button (while there is a `@date`) calling
|
|
39
|
+
* `@clear(null)`.
|
|
40
|
+
* - `@ariaLabel`: accessible label of the input.
|
|
41
|
+
* - Any other flatpickr option is passed through, e.g. `@mode` (`'single'`,
|
|
42
|
+
* `'multiple'`, `'range'`), `@enableTime`, `@noCalendar`, `@dateFormat`,
|
|
43
|
+
* `@altInput` / `@altFormat` / `@altInputClass`, `@minDate`, `@maxDate`,
|
|
44
|
+
* `@inline`, `@weekNumbers`. `@minDate`, `@maxDate`, `@altFormat`,
|
|
45
|
+
* `@altInputClass` and `@date` also update a rendered picker.
|
|
46
|
+
* - EuiFieldText's args style the input: `@icon` (defaults to
|
|
47
|
+
* `'calendar'`), `@fullWidth`, `@compressed`, `@isInvalid`,
|
|
48
|
+
* `@isLoading`, `@readOnly`, `@controlOnly`, `@inputRef`, `@id`, plus the
|
|
49
|
+
* `<:prepend>` / `<:append>` blocks.
|
|
50
|
+
*
|
|
51
|
+
* `@wrap` is not supported.
|
|
52
|
+
*
|
|
53
|
+
* The flatpickr lifecycle below used to come from extending ember-flatpickr's
|
|
54
|
+
* component; it is inlined (same arguments and behavior) because
|
|
55
|
+
* ember-flatpickr still depends on v1 addons (@ember/render-modifiers 3,
|
|
56
|
+
* @ember/test-waiters 3), which break Vite apps.
|
|
57
|
+
*/
|
|
58
|
+
class EuiFlatpickrComponent extends Component {
|
|
59
|
+
flatpickrRef;
|
|
15
60
|
onClear() {
|
|
16
61
|
this.args.clear(null);
|
|
17
62
|
}
|
|
18
63
|
static {
|
|
19
64
|
n(this.prototype, "onClear", [action]);
|
|
20
65
|
}
|
|
66
|
+
onInsert(element) {
|
|
67
|
+
this.setupFlatpickr(element);
|
|
68
|
+
}
|
|
69
|
+
static {
|
|
70
|
+
n(this.prototype, "onInsert", [action]);
|
|
71
|
+
}
|
|
72
|
+
onWillDestroy() {
|
|
73
|
+
this.flatpickrRef?.destroy();
|
|
74
|
+
}
|
|
75
|
+
static {
|
|
76
|
+
n(this.prototype, "onWillDestroy", [action]);
|
|
77
|
+
}
|
|
78
|
+
setupFlatpickr(element) {
|
|
79
|
+
const {
|
|
80
|
+
date,
|
|
81
|
+
onChange,
|
|
82
|
+
wrap
|
|
83
|
+
} = this.args;
|
|
84
|
+
assert('<EuiFlatpickr> requires a `date` to be passed as the value for flatpickr.', date !== undefined);
|
|
85
|
+
assert('<EuiFlatpickr> requires an `onChange` action or null for no action.', onChange !== undefined);
|
|
86
|
+
assert('<EuiFlatpickr> does not support the wrap option.', wrap !== true);
|
|
87
|
+
scheduleOnce('afterRender', this, this.setFlatpickrOptions, element);
|
|
88
|
+
}
|
|
89
|
+
async setFlatpickrOptions(element) {
|
|
90
|
+
const fastboot = getOwner(this)?.lookup('service:fastboot');
|
|
91
|
+
if (fastboot?.isFastBoot) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const {
|
|
95
|
+
date,
|
|
96
|
+
disabled = false,
|
|
97
|
+
onChange,
|
|
98
|
+
onReady,
|
|
99
|
+
onOpen,
|
|
100
|
+
onClose,
|
|
101
|
+
...rest
|
|
102
|
+
} = this.args;
|
|
103
|
+
const config = Object.fromEntries(Object.entries(rest).filter(entry => entry[1] !== undefined));
|
|
104
|
+
if (typeof config.locale === 'string' && config.locale !== 'en') {
|
|
105
|
+
config.locale = await waitForPromise(loadLocale(config.locale));
|
|
106
|
+
}
|
|
107
|
+
this.flatpickrRef = flatpickr(element, {
|
|
108
|
+
onChange,
|
|
109
|
+
onClose,
|
|
110
|
+
onOpen,
|
|
111
|
+
onReady,
|
|
112
|
+
...config,
|
|
113
|
+
defaultDate: date
|
|
114
|
+
});
|
|
115
|
+
this.setDisabled(disabled);
|
|
116
|
+
}
|
|
117
|
+
setDisabled(disabled) {
|
|
118
|
+
if (!this.flatpickrRef) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const {
|
|
122
|
+
altInput,
|
|
123
|
+
element
|
|
124
|
+
} = this.flatpickrRef;
|
|
125
|
+
if (altInput && element?.nextSibling) {
|
|
126
|
+
// with `altInput`, `element` is the hidden input holding the value and
|
|
127
|
+
// the next sibling is the visible input the user interacts with
|
|
128
|
+
element.nextSibling.disabled = disabled;
|
|
129
|
+
} else {
|
|
130
|
+
element.disabled = disabled;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
onAltFormatUpdated() {
|
|
134
|
+
this.flatpickrRef?.set('altFormat', this.args.altFormat);
|
|
135
|
+
}
|
|
136
|
+
static {
|
|
137
|
+
n(this.prototype, "onAltFormatUpdated", [action]);
|
|
138
|
+
}
|
|
139
|
+
onAltInputClassUpdated() {
|
|
140
|
+
const {
|
|
141
|
+
altInputClass
|
|
142
|
+
} = this.args;
|
|
143
|
+
this.flatpickrRef?.set('altInputClass', altInputClass || '');
|
|
144
|
+
// https://github.com/flatpickr/flatpickr/issues/861
|
|
145
|
+
const altInput = this.flatpickrRef?.altInput;
|
|
146
|
+
if (altInput) {
|
|
147
|
+
altInput.className = altInputClass || '';
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
static {
|
|
151
|
+
n(this.prototype, "onAltInputClassUpdated", [action]);
|
|
152
|
+
}
|
|
153
|
+
onDateUpdated() {
|
|
154
|
+
if (typeof this.args.date !== 'undefined') {
|
|
155
|
+
this.flatpickrRef?.setDate(this.args.date);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
static {
|
|
159
|
+
n(this.prototype, "onDateUpdated", [action]);
|
|
160
|
+
}
|
|
161
|
+
onDisabledUpdated() {
|
|
162
|
+
if (typeof this.args.disabled !== 'undefined') {
|
|
163
|
+
this.setDisabled(this.args.disabled);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
static {
|
|
167
|
+
n(this.prototype, "onDisabledUpdated", [action]);
|
|
168
|
+
}
|
|
169
|
+
onLocaleUpdated(element) {
|
|
170
|
+
this.flatpickrRef?.destroy();
|
|
171
|
+
this.setupFlatpickr(element);
|
|
172
|
+
}
|
|
173
|
+
static {
|
|
174
|
+
n(this.prototype, "onLocaleUpdated", [action]);
|
|
175
|
+
}
|
|
176
|
+
onMaxDateUpdated() {
|
|
177
|
+
this.flatpickrRef?.set('maxDate', this.args.maxDate);
|
|
178
|
+
}
|
|
179
|
+
static {
|
|
180
|
+
n(this.prototype, "onMaxDateUpdated", [action]);
|
|
181
|
+
}
|
|
182
|
+
onMinDateUpdated() {
|
|
183
|
+
this.flatpickrRef?.set('minDate', this.args.minDate);
|
|
184
|
+
}
|
|
185
|
+
static {
|
|
186
|
+
n(this.prototype, "onMinDateUpdated", [action]);
|
|
187
|
+
}
|
|
21
188
|
static {
|
|
22
|
-
setComponentTemplate(precompileTemplate("
|
|
189
|
+
setComponentTemplate(precompileTemplate("{{#let (and (not (argOrDefault @isFakePrependBlock false)) (has-block \"prepend\")) (and (not (argOrDefault @isFakeAppendBlock false)) (has-block \"append\")) (argOrDefault @id (randomId)) as |hasPrepend hasAppend inputId|}}\n <EuiFieldText aria-label={{@ariaLabel}} @icon={{if @icon @icon \"calendar\"}} @fullWidth={{@fullWidth}} @isLoading={{@isLoading}} @readOnly={{@readOnly}} @inputRef={{@inputRef}} @controlOnly={{@controlOnly}} @compressed={{@compressed}} @id={{inputId}} @isFakePrependBlock={{not hasPrepend}} @isFakeAppendBlock={{not hasAppend}} @disabled={{@disabled}} @isInvalid={{@isInvalid}} @clear={{if (and @clear @date (not @isDisabled) (not @disabled)) this.onClear}} {{didInsert this.onInsert}} {{willDestroy this.onWillDestroy}} {{didUpdate this.onAltFormatUpdated @altFormat}} {{didUpdate this.onAltInputClassUpdated @altInputClass}} {{didUpdate this.onDateUpdated @date}} {{didUpdate this.onDisabledUpdated @disabled}} {{didUpdate this.onLocaleUpdated @locale}} {{didUpdate this.onMaxDateUpdated @maxDate}} {{didUpdate this.onMinDateUpdated @minDate}} ...attributes>\n <:prepend as |classes finalId|>\n {{yield classes finalId to=\"prepend\"}}\n </:prepend>\n <:append as |classes finalId|>\n {{yield classes finalId to=\"append\"}}\n </:append>\n </EuiFieldText>\n{{/let}}", {
|
|
23
190
|
strictMode: true,
|
|
24
191
|
scope: () => ({
|
|
25
192
|
and,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eui-flatpickr.js","sources":["../../src/components/eui-flatpickr.gjs"],"sourcesContent":["import { action } from '@ember/object';\nimport didInsert from '@ember/render-modifiers/modifiers/did-insert';\nimport didUpdate from '@ember/render-modifiers/modifiers/did-update';\nimport willDestroy from '@ember/render-modifiers/modifiers/will-destroy';\nimport { EuiFieldText } from '@ember-eui/core/components';\nimport { argOrDefault } from '@ember-eui/core/helpers';\n\nimport EmberFlatpickr from 'ember-flatpickr/components/ember-flatpickr';\nimport { and, not } from 'ember-truth-helpers';\n\nimport randomId from '../-private/random-id.ts';\n\nexport default class EuiFlatpickrComponent extends EmberFlatpickr {\n @action\n onClear() {\n this.args.clear(null);\n }\n\n <template>\n {{#let\n (and (not (argOrDefault @isFakePrependBlock false)) (has-block \"prepend\"))\n (and (not (argOrDefault @isFakeAppendBlock false)) (has-block \"append\"))\n (argOrDefault @id (randomId))\n as |hasPrepend hasAppend inputId|\n }}\n <EuiFieldText\n aria-label={{@ariaLabel}}\n @icon={{if @icon @icon \"calendar\"}}\n @fullWidth={{@fullWidth}}\n @isLoading={{@isLoading}}\n @readOnly={{@readOnly}}\n @inputRef={{@inputRef}}\n @controlOnly={{@controlOnly}}\n @compressed={{@compressed}}\n @id={{inputId}}\n @isFakePrependBlock={{not hasPrepend}}\n @isFakeAppendBlock={{not hasAppend}}\n @disabled={{@disabled}}\n @isInvalid={{@isInvalid}}\n @clear={{if\n (and @clear @date (not @isDisabled) (not @disabled))\n this.onClear\n }}\n {{didInsert this.onInsert}}\n {{willDestroy this.onWillDestroy}}\n {{didUpdate this.onAltFormatUpdated @altFormat}}\n {{didUpdate this.onAltInputClassUpdated @altInputClass}}\n {{didUpdate this.onDateUpdated @date}}\n {{didUpdate this.onDisabledUpdated @disabled}}\n {{didUpdate this.onLocaleUpdated @locale}}\n {{didUpdate this.onMaxDateUpdated @maxDate}}\n {{didUpdate this.onMinDateUpdated @minDate}}\n ...attributes\n >\n <:prepend as |classes finalId|>\n {{yield classes finalId to=\"prepend\"}}\n </:prepend>\n <:append as |classes finalId|>\n {{yield classes finalId to=\"append\"}}\n </:append>\n </EuiFieldText>\n {{/let}}\n </template>\n}\n"],"names":["EuiFlatpickrComponent","EmberFlatpickr","onClear","args","clear","n","prototype","action","setComponentTemplate","precompileTemplate","strictMode","scope","and","not","argOrDefault","randomId","EuiFieldText","didInsert","willDestroy","didUpdate"],"mappings":";;;;;;;;;;;;;AAYe,MAAMA,qBAA8B,SAAAC,cAAA,CAAA;AAEjDC,EAAAA,OAAUA,GAAA;AACR,IAAA,IAAI,CAACC,IAAI,CAACC,KAAK,CAAC,IAAA,CAAA;AAClB;AAAA,EAAA;IAAAC,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,SAAA,EAAA,CAHCC,MAAA,CAAA,CAAA;AAAA;AAKD,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CA4CA,s1CAAA,EAAA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,GAAA;QAAAC,GAAA;QAAAC,YAAA;QAAAC,QAAA;QAAAC,YAAA;QAAAC,SAAA;QAAAC,WAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
1
|
+
{"version":3,"file":"eui-flatpickr.js","sources":["../../src/components/eui-flatpickr.gjs"],"sourcesContent":["import Component from '@glimmer/component';\nimport { assert } from '@ember/debug';\nimport { action } from '@ember/object';\nimport { getOwner } from '@ember/owner';\nimport didInsert from '@ember/render-modifiers/modifiers/did-insert';\nimport didUpdate from '@ember/render-modifiers/modifiers/did-update';\nimport willDestroy from '@ember/render-modifiers/modifiers/will-destroy';\nimport { scheduleOnce } from '@ember/runloop';\nimport { waitForPromise } from '@ember/test-waiters';\nimport { EuiFieldText } from '@ember-eui/core/components';\nimport { argOrDefault } from '@ember-eui/core/helpers';\n\nimport flatpickr from 'flatpickr';\nimport { and, not } from 'ember-truth-helpers';\n\nimport randomId from '../-private/random-id.ts';\n\n/**\n * Resolves a locale key (\"es\", \"ru\", ...) to flatpickr's locale object.\n *\n * A template-literal import (`flatpickr/dist/l10n/${key}.js`) can't be\n * resolved by bundlers (Vite/Rollup keep it as a bare runtime specifier), so\n * load flatpickr's locale index instead: a static import that bundlers split\n * into a lazy chunk, fetched only when a non-English string locale is used.\n * Unknown keys fall back to the key itself (flatpickr then uses English).\n */\nasync function loadLocale(key) {\n const module = await import('flatpickr/dist/l10n/index.js');\n const locales = module.default?.default ?? module.default ?? module;\n\n return locales[key] ?? key;\n}\n\n/**\n * EUI text field wired to flatpickr (https://flatpickr.js.org): a date,\n * time, date range or multiple dates picker. Load flatpickr's styles once,\n * e.g. `import 'flatpickr/dist/flatpickr.css'` in `app/app.js`.\n *\n * Arguments:\n * - `@date` (required): the selected date(s): a `Date`, a string in\n * `@dateFormat`, an array for ranges / multiple dates, or `null`.\n * - `@onChange` (required, or `null`): called with\n * `(selectedDates: Date[], dateStr: string, instance)`; update `@date`.\n * - `@onOpen`, `@onClose`, `@onReady`: flatpickr's hooks, same arguments.\n * - `@locale`: a flatpickr locale object, or a key such as `'es'` (loaded\n * lazily). Changing it recreates the picker.\n * - `@disabled`: disables the input.\n * - `@clear`: shows a clear button (while there is a `@date`) calling\n * `@clear(null)`.\n * - `@ariaLabel`: accessible label of the input.\n * - Any other flatpickr option is passed through, e.g. `@mode` (`'single'`,\n * `'multiple'`, `'range'`), `@enableTime`, `@noCalendar`, `@dateFormat`,\n * `@altInput` / `@altFormat` / `@altInputClass`, `@minDate`, `@maxDate`,\n * `@inline`, `@weekNumbers`. `@minDate`, `@maxDate`, `@altFormat`,\n * `@altInputClass` and `@date` also update a rendered picker.\n * - EuiFieldText's args style the input: `@icon` (defaults to\n * `'calendar'`), `@fullWidth`, `@compressed`, `@isInvalid`,\n * `@isLoading`, `@readOnly`, `@controlOnly`, `@inputRef`, `@id`, plus the\n * `<:prepend>` / `<:append>` blocks.\n *\n * `@wrap` is not supported.\n *\n * The flatpickr lifecycle below used to come from extending ember-flatpickr's\n * component; it is inlined (same arguments and behavior) because\n * ember-flatpickr still depends on v1 addons (@ember/render-modifiers 3,\n * @ember/test-waiters 3), which break Vite apps.\n */\nexport default class EuiFlatpickrComponent extends Component {\n flatpickrRef;\n\n @action\n onClear() {\n this.args.clear(null);\n }\n\n @action\n onInsert(element) {\n this.setupFlatpickr(element);\n }\n\n @action\n onWillDestroy() {\n this.flatpickrRef?.destroy();\n }\n\n setupFlatpickr(element) {\n const { date, onChange, wrap } = this.args;\n\n assert(\n '<EuiFlatpickr> requires a `date` to be passed as the value for flatpickr.',\n date !== undefined\n );\n assert(\n '<EuiFlatpickr> requires an `onChange` action or null for no action.',\n onChange !== undefined\n );\n assert(\n '<EuiFlatpickr> does not support the wrap option.',\n wrap !== true\n );\n\n scheduleOnce('afterRender', this, this.setFlatpickrOptions, element);\n }\n\n async setFlatpickrOptions(element) {\n const fastboot = getOwner(this)?.lookup('service:fastboot');\n\n if (fastboot?.isFastBoot) {\n return;\n }\n\n const {\n date,\n disabled = false,\n onChange,\n onReady,\n onOpen,\n onClose,\n ...rest\n } = this.args;\n const config = Object.fromEntries(\n Object.entries(rest).filter((entry) => entry[1] !== undefined)\n );\n\n if (typeof config.locale === 'string' && config.locale !== 'en') {\n config.locale = await waitForPromise(loadLocale(config.locale));\n }\n\n this.flatpickrRef = flatpickr(element, {\n onChange,\n onClose,\n onOpen,\n onReady,\n ...config,\n defaultDate: date,\n });\n this.setDisabled(disabled);\n }\n\n setDisabled(disabled) {\n if (!this.flatpickrRef) {\n return;\n }\n\n const { altInput, element } = this.flatpickrRef;\n\n if (altInput && element?.nextSibling) {\n // with `altInput`, `element` is the hidden input holding the value and\n // the next sibling is the visible input the user interacts with\n element.nextSibling.disabled = disabled;\n } else {\n element.disabled = disabled;\n }\n }\n\n @action\n onAltFormatUpdated() {\n this.flatpickrRef?.set('altFormat', this.args.altFormat);\n }\n\n @action\n onAltInputClassUpdated() {\n const { altInputClass } = this.args;\n\n this.flatpickrRef?.set('altInputClass', altInputClass || '');\n\n // https://github.com/flatpickr/flatpickr/issues/861\n const altInput = this.flatpickrRef?.altInput;\n\n if (altInput) {\n altInput.className = altInputClass || '';\n }\n }\n\n @action\n onDateUpdated() {\n if (typeof this.args.date !== 'undefined') {\n this.flatpickrRef?.setDate(this.args.date);\n }\n }\n\n @action\n onDisabledUpdated() {\n if (typeof this.args.disabled !== 'undefined') {\n this.setDisabled(this.args.disabled);\n }\n }\n\n @action\n onLocaleUpdated(element) {\n this.flatpickrRef?.destroy();\n this.setupFlatpickr(element);\n }\n\n @action\n onMaxDateUpdated() {\n this.flatpickrRef?.set('maxDate', this.args.maxDate);\n }\n\n @action\n onMinDateUpdated() {\n this.flatpickrRef?.set('minDate', this.args.minDate);\n }\n\n <template>\n {{#let\n (and (not (argOrDefault @isFakePrependBlock false)) (has-block \"prepend\"))\n (and (not (argOrDefault @isFakeAppendBlock false)) (has-block \"append\"))\n (argOrDefault @id (randomId))\n as |hasPrepend hasAppend inputId|\n }}\n <EuiFieldText\n aria-label={{@ariaLabel}}\n @icon={{if @icon @icon \"calendar\"}}\n @fullWidth={{@fullWidth}}\n @isLoading={{@isLoading}}\n @readOnly={{@readOnly}}\n @inputRef={{@inputRef}}\n @controlOnly={{@controlOnly}}\n @compressed={{@compressed}}\n @id={{inputId}}\n @isFakePrependBlock={{not hasPrepend}}\n @isFakeAppendBlock={{not hasAppend}}\n @disabled={{@disabled}}\n @isInvalid={{@isInvalid}}\n @clear={{if\n (and @clear @date (not @isDisabled) (not @disabled))\n this.onClear\n }}\n {{didInsert this.onInsert}}\n {{willDestroy this.onWillDestroy}}\n {{didUpdate this.onAltFormatUpdated @altFormat}}\n {{didUpdate this.onAltInputClassUpdated @altInputClass}}\n {{didUpdate this.onDateUpdated @date}}\n {{didUpdate this.onDisabledUpdated @disabled}}\n {{didUpdate this.onLocaleUpdated @locale}}\n {{didUpdate this.onMaxDateUpdated @maxDate}}\n {{didUpdate this.onMinDateUpdated @minDate}}\n ...attributes\n >\n <:prepend as |classes finalId|>\n {{yield classes finalId to=\"prepend\"}}\n </:prepend>\n <:append as |classes finalId|>\n {{yield classes finalId to=\"append\"}}\n </:append>\n </EuiFieldText>\n {{/let}}\n </template>\n}\n"],"names":["loadLocale","key","module","locales","default","EuiFlatpickrComponent","Component","flatpickrRef","onClear","args","clear","n","prototype","action","onInsert","element","setupFlatpickr","onWillDestroy","destroy","date","onChange","wrap","assert","undefined","scheduleOnce","setFlatpickrOptions","fastboot","getOwner","lookup","isFastBoot","disabled","onReady","onOpen","onClose","rest","config","Object","fromEntries","entries","filter","entry","locale","waitForPromise","flatpickr","defaultDate","setDisabled","altInput","nextSibling","onAltFormatUpdated","set","altFormat","onAltInputClassUpdated","altInputClass","className","onDateUpdated","setDate","onDisabledUpdated","onLocaleUpdated","onMaxDateUpdated","maxDate","onMinDateUpdated","minDate","setComponentTemplate","precompileTemplate","strictMode","scope","and","not","argOrDefault","randomId","EuiFieldText","didInsert","willDestroy","didUpdate"],"mappings":";;;;;;;;;;;;;;;;;;AA0BA,eAAeA,WAAWC,GAAG,EAAA;AAC3B,EAAA,MAAMC,MAAA,GAAS,MAAM,OAAO,8BAAA,CAAA;AAC5B,EAAA,MAAMC,UAAUD,MAAA,CAAOE,OAAO,EAAEA,OAAA,IAAWF,MAAA,CAAOE,OAAO,IAAIF,MAAA;AAE7D,EAAA,OAAOC,OAAO,CAACF,GAAA,CAAI,IAAIA,GAAA;AACzB;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCe,MAAMI,qBAAA,SAA8BC,SAAA,CAAA;EACjDC,YAAA;AAGAC,EAAAA,OAAAA,GAA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OAAA,CAAA;AACtB,EAAA;AAAA,EAAA;IAAAJ,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,iBAAA,EAAA,CAJCC,MAAA,CAAA,CAAA;AAAA;AAOD6C,EAAAA,gBAAAA,GAAmB;AACjB,IAAA,IAAI,CAACnD,YAAY,EAAE0C,GAAA,CAAI,WAAW,IAAI,CAACxC,IAAI,CAACkD,OAAO,CAAA;AACrD,EAAA;AAAA,EAAA;IAAAhD,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,kBAAA,EAAA,CAHCC,MAAA,CAAA,CAAA;AAAA;AAMD+C,EAAAA,gBAAAA,GAAmB;AACjB,IAAA,IAAI,CAACrD,YAAY,EAAE0C,GAAA,CAAI,WAAW,IAAI,CAACxC,IAAI,CAACoD,OAAO,CAAA;AACrD,EAAA;AAAA,EAAA;IAAAlD,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,kBAAA,EAAA,CAHCC,MAAA,CAAA,CAAA;AAAA;AAKD,EAAA;IAAAiD,oBAAA,CAAAC,kBAAA,CAAA,wyCAAA,EA4CA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,GAAA;QAAAC,GAAA;QAAAC,YAAA;QAAAC,QAAA;QAAAC,YAAA;QAAAC,SAAA;QAAAC,WAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
|
package/package.json
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ember-eui/flatpickr",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "14.1.0",
|
|
4
|
+
"description": "flatpickr date picker for @ember-eui/core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon",
|
|
7
|
-
"ember-
|
|
8
|
-
"
|
|
7
|
+
"@ember-eui",
|
|
8
|
+
"flatpickr"
|
|
9
9
|
],
|
|
10
|
-
"repository":
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/prysmex/ember-eui"
|
|
13
|
+
},
|
|
11
14
|
"license": "MIT",
|
|
12
15
|
"author": "Alberto Cantu <betocantu93@gmail.com> (https://betocantu93.com)",
|
|
13
16
|
"directories": {
|
|
14
17
|
"doc": "doc",
|
|
15
18
|
"test": "tests"
|
|
16
19
|
},
|
|
20
|
+
"imports": {
|
|
21
|
+
"#src/*": "./src/*"
|
|
22
|
+
},
|
|
17
23
|
"exports": {
|
|
18
24
|
".": {
|
|
19
25
|
"types": "./declarations/index.d.ts",
|
|
@@ -23,45 +29,49 @@
|
|
|
23
29
|
"types": "./declarations/*.d.ts",
|
|
24
30
|
"default": "./dist/*.js"
|
|
25
31
|
},
|
|
26
|
-
"./addon-main.js": "./addon-main.
|
|
32
|
+
"./addon-main.js": "./addon-main.cjs"
|
|
27
33
|
},
|
|
28
34
|
"files": [
|
|
29
|
-
"addon-main.
|
|
35
|
+
"addon-main.cjs",
|
|
30
36
|
"declarations",
|
|
31
37
|
"dist"
|
|
32
38
|
],
|
|
33
39
|
"dependencies": {
|
|
34
40
|
"@babel/core": "^7.26.7",
|
|
35
|
-
"@
|
|
36
|
-
"@ember/
|
|
37
|
-
"@embroider/
|
|
38
|
-
"ember-
|
|
39
|
-
"
|
|
40
|
-
"ember-flatpickr": "^8.0.1",
|
|
41
|
+
"@ember/render-modifiers": "^4.0.0",
|
|
42
|
+
"@ember/test-waiters": "^4.1.1",
|
|
43
|
+
"@embroider/addon-shim": "^1.10.3",
|
|
44
|
+
"@nullvoxpopuli/ember-composable-helpers": "^5.3.2",
|
|
45
|
+
"decorator-transforms": "^2.3.0",
|
|
41
46
|
"ember-modifier": "^4.2.0",
|
|
42
47
|
"ember-style-modifier": "^4.4.0",
|
|
43
|
-
"ember-
|
|
44
|
-
"decorator-transforms": "^2.3.0",
|
|
45
|
-
"ember-truth-helpers": "^4.0.3"
|
|
48
|
+
"ember-truth-helpers": "^5.0.0"
|
|
46
49
|
},
|
|
47
50
|
"peerDependencies": {
|
|
48
|
-
"@ember-eui/core": "^
|
|
51
|
+
"@ember-eui/core": "^14.0.0",
|
|
49
52
|
"@glimmer/component": "^2.0.0",
|
|
50
|
-
"ember-source": ">= 4.
|
|
53
|
+
"ember-source": ">= 4.12.0",
|
|
54
|
+
"flatpickr": "^4.6.13"
|
|
51
55
|
},
|
|
52
56
|
"devDependencies": {
|
|
53
57
|
"@babel/core": "^7.26.0",
|
|
54
|
-
"@babel/eslint-parser": "^7.
|
|
58
|
+
"@babel/eslint-parser": "^7.29.7",
|
|
55
59
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
56
60
|
"@babel/plugin-proposal-decorators": "^7.25.9",
|
|
57
61
|
"@babel/plugin-transform-class-static-block": "^7.20.0",
|
|
58
62
|
"@babel/plugin-transform-typescript": "^7.12.13",
|
|
59
63
|
"@babel/preset-typescript": "^7.18.6",
|
|
64
|
+
"@ember-eui/core": "14.1.0",
|
|
60
65
|
"@ember/optional-features": "^2.2.0",
|
|
61
|
-
"@ember/test-helpers": "^5.1
|
|
62
|
-
"@
|
|
66
|
+
"@ember/test-helpers": "^5.2.1",
|
|
67
|
+
"@ember/test-waiters": "^4.1.1",
|
|
68
|
+
"@embroider/addon-dev": "8.4.0",
|
|
69
|
+
"@embroider/compat": "^4.1.0",
|
|
70
|
+
"@embroider/core": "^4.1.0",
|
|
71
|
+
"@embroider/macros": "^1.20.1",
|
|
63
72
|
"@embroider/test-setup": "^4.0.0",
|
|
64
|
-
"@
|
|
73
|
+
"@embroider/vite": "^1.1.5",
|
|
74
|
+
"@eslint/js": "^9.39.5",
|
|
65
75
|
"@glimmer/component": "^2.0.0",
|
|
66
76
|
"@glint/core": "1.5.2",
|
|
67
77
|
"@glint/environment-ember-loose": "1.5.2",
|
|
@@ -92,27 +102,41 @@
|
|
|
92
102
|
"@types/ember__template": "^4.0.2",
|
|
93
103
|
"@types/ember__test": "^4.0.2",
|
|
94
104
|
"@types/ember__utils": "^4.0.3",
|
|
95
|
-
"
|
|
105
|
+
"@types/qunit": "^2.19.12",
|
|
106
|
+
"@typescript-eslint/parser": "^8.70.0",
|
|
107
|
+
"babel-plugin-ember-template-compilation": "^4.0.0",
|
|
96
108
|
"concurrently": "^9.1.2",
|
|
109
|
+
"ember-basic-dropdown": "^9.0.0",
|
|
97
110
|
"ember-cli": "~6.2.0",
|
|
98
111
|
"ember-cli-clean-css": "^3.0.0",
|
|
99
|
-
"ember-
|
|
112
|
+
"ember-concurrency": "^5.1.0",
|
|
113
|
+
"ember-focus-trap": "^1.1.0",
|
|
114
|
+
"ember-keyboard": "^9.0.4",
|
|
115
|
+
"ember-power-select": "^9.0.2",
|
|
116
|
+
"ember-qunit": "^9.0.2",
|
|
117
|
+
"ember-source": "~6.12.0",
|
|
118
|
+
"ember-strict-application-resolver": "^0.1.1",
|
|
100
119
|
"ember-template-lint": "^6.1.0",
|
|
101
|
-
"eslint": "^9.
|
|
102
|
-
"eslint-config-prettier": "^
|
|
103
|
-
"eslint-plugin-ember": "^12.5
|
|
104
|
-
"eslint-plugin-
|
|
105
|
-
"
|
|
106
|
-
"
|
|
120
|
+
"eslint": "^9.39.5",
|
|
121
|
+
"eslint-config-prettier": "^10.1.8",
|
|
122
|
+
"eslint-plugin-ember": "^12.7.5",
|
|
123
|
+
"eslint-plugin-import": "^2.32.0",
|
|
124
|
+
"eslint-plugin-n": "^17.24.0",
|
|
125
|
+
"flatpickr": "^4.6.13",
|
|
126
|
+
"globals": "^16.5.0",
|
|
107
127
|
"prettier-plugin-ember-template-tag": "^2.0.4",
|
|
128
|
+
"qunit": "^2.24.1",
|
|
129
|
+
"qunit-dom": "^3.4.0",
|
|
108
130
|
"rollup": "^4.6.0",
|
|
109
131
|
"rollup-plugin-copy": "^3.5.0",
|
|
110
132
|
"stylelint": "^16.14.1",
|
|
111
133
|
"stylelint-config-standard": "^36.0.1",
|
|
112
134
|
"stylelint-prettier": "^5.0.3",
|
|
135
|
+
"testem": "^3.15.1",
|
|
113
136
|
"typescript": "^5.3.3",
|
|
114
|
-
"
|
|
115
|
-
"
|
|
137
|
+
"typescript-eslint": "^8.70.0",
|
|
138
|
+
"vite": "^7.1.9",
|
|
139
|
+
"webpack": "^5.97.1"
|
|
116
140
|
},
|
|
117
141
|
"engines": {
|
|
118
142
|
"node": ">= 18"
|
|
@@ -126,7 +150,7 @@
|
|
|
126
150
|
"ember-addon": {
|
|
127
151
|
"version": 2,
|
|
128
152
|
"type": "addon",
|
|
129
|
-
"main": "addon-main.
|
|
153
|
+
"main": "addon-main.cjs",
|
|
130
154
|
"app-js": {
|
|
131
155
|
"./components/eui-flatpickr.js": "./dist/_app_/components/eui-flatpickr.js"
|
|
132
156
|
}
|
|
@@ -139,14 +163,15 @@
|
|
|
139
163
|
"build:js": "rollup --config",
|
|
140
164
|
"build:types": "glint --declaration",
|
|
141
165
|
"lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\" --prefixColors auto",
|
|
142
|
-
"lint:css": "stylelint \"**/*.css\"",
|
|
166
|
+
"lint:css": "stylelint \"**/*.css\" --allow-empty-input",
|
|
143
167
|
"lint:css:fix": "concurrently \"npm:lint:css -- --fix\"",
|
|
144
168
|
"lint:fix": "concurrently \"npm:lint:*:fix\" --names \"fix:\" --prefixColors auto",
|
|
145
|
-
"lint:js": "eslint .
|
|
169
|
+
"lint:js": "eslint .",
|
|
146
170
|
"lint:js:fix": "eslint . --fix",
|
|
147
|
-
"_syncPnpm": "pnpm sync-dependencies-meta-injected",
|
|
148
171
|
"start": "concurrently 'npm:start:*'",
|
|
149
172
|
"start:js": "rollup --config --watch",
|
|
150
|
-
"start:types": "glint --build --watch"
|
|
173
|
+
"start:types": "glint --build --watch",
|
|
174
|
+
"test:dev": "vite dev",
|
|
175
|
+
"test": "node ../../scripts/sync-injected.mjs && vite build --mode=development --out-dir dist-tests && testem --file testem.cjs ci --port 0"
|
|
151
176
|
}
|
|
152
177
|
}
|
|
File without changes
|