@quilted/create 0.2.21 → 0.2.23
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/CHANGELOG.md +12 -0
- package/build/esm/node_modules/.pnpm/@nodelib_fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/index.mjs +3 -3
- package/build/esm/node_modules/.pnpm/@nodelib_fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/async.mjs +1 -1
- package/build/esm/node_modules/.pnpm/@nodelib_fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/sync.mjs +1 -1
- package/build/esm/node_modules/.pnpm/@nodelib_fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/settings.mjs +1 -1
- package/build/esm/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/index.mjs +3 -3
- package/build/esm/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/async.mjs +1 -1
- package/build/esm/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/sync.mjs +1 -1
- package/build/esm/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/settings.mjs +1 -1
- package/build/esnext/app.esnext +2 -4
- package/build/esnext/module.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.esnext +2 -4
- package/build/esnext/node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/expand.esnext +3 -6
- package/build/esnext/node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/parse.esnext +4 -8
- package/build/esnext/node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/utils.esnext +8 -16
- package/build/esnext/node_modules/.pnpm/common-tags@1.8.2/node_modules/common-tags/es/TemplateTag/TemplateTag.esnext +3 -6
- package/build/esnext/node_modules/.pnpm/fastq@1.13.0/node_modules/fastq/queue.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/fill-range@7.0.1/node_modules/fill-range/index.esnext +12 -24
- package/build/esnext/node_modules/.pnpm/is-extglob@2.1.1/node_modules/is-extglob/index.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/kleur@3.0.3/node_modules/kleur/index.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/micromatch@4.0.5/node_modules/micromatch/index.esnext +6 -12
- package/build/esnext/node_modules/.pnpm/minimatch@5.1.0/node_modules/minimatch/minimatch.esnext +19 -38
- package/build/esnext/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/parse.esnext +8 -16
- package/build/esnext/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.esnext +3 -6
- package/build/esnext/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/scan.esnext +3 -6
- package/build/esnext/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/utils.esnext +2 -4
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/datepart.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/day.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/hours.esnext +2 -4
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/index.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/meridiem.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/milliseconds.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/minutes.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/month.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/seconds.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/year.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/autocomplete.esnext +16 -30
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/autocompleteMultiselect.esnext +6 -12
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/confirm.esnext +4 -8
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/date.esnext +9 -18
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/index.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/multiselect.esnext +8 -13
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/number.esnext +11 -22
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/prompt.esnext +4 -8
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/select.esnext +10 -17
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/text.esnext +9 -18
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/toggle.esnext +7 -14
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/index.esnext +15 -30
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/prompts.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/action.esnext +24 -48
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/clear.esnext +13 -26
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/entriesToDisplay.esnext +2 -4
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/figures.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/index.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/lines.esnext +2 -4
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/strip.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/style.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/wrap.esnext +3 -6
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/index.esnext +2 -4
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/datepart.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/day.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/hours.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/index.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/meridiem.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/milliseconds.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/minutes.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/month.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/seconds.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/year.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/autocomplete.esnext +11 -22
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/autocompleteMultiselect.esnext +6 -12
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/confirm.esnext +4 -8
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/date.esnext +8 -16
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/index.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/multiselect.esnext +4 -8
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/number.esnext +10 -20
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/prompt.esnext +4 -8
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/select.esnext +5 -10
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/text.esnext +8 -16
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/toggle.esnext +7 -14
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/index.esnext +4 -8
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/prompts.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/action.esnext +24 -48
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/clear.esnext +2 -4
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/entriesToDisplay.esnext +2 -4
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/figures.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/index.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/lines.esnext +2 -4
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/strip.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/style.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/wrap.esnext +2 -4
- package/build/esnext/node_modules/.pnpm/run-parallel@1.2.0/node_modules/run-parallel/index.esnext +3 -6
- package/build/esnext/node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.esnext +6 -12
- package/build/esnext/node_modules/.pnpm/to-regex-range@5.0.1/node_modules/to-regex-range/index.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/compose/resolve-flow-collection.esnext +11 -12
- package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/parse/lexer.esnext +17 -18
- package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/parse/parser.esnext +9 -10
- package/build/esnext/package.esnext +7 -14
- package/build/esnext/server.esnext +1 -2
- package/build/esnext/shared/prompts.esnext +3 -6
- package/build/esnext/shared.esnext +3 -6
- package/package.json +1 -1
- package/templates/app-basic/features/start/Start/Start.test.tsx +1 -1
- package/templates/app-basic/foundation/html/HTML.test.tsx +4 -4
- package/templates/app-basic/package.json +1 -1
- package/templates/app-basic/shared/context.ts +2 -5
- package/templates/app-basic/tests/render/render.tsx +12 -11
- package/templates/app-basic/tests/render/types.ts +11 -0
- package/templates/app-basic/tests/render.ts +1 -1
- package/templates/app-empty/package.json +1 -1
- package/templates/app-empty/tsconfig.json +2 -1
- package/templates/app-graphql/features/start/Start/Start.test.tsx +1 -1
- package/templates/app-graphql/foundation/html/HTML.test.tsx +4 -4
- package/templates/app-graphql/package.json +2 -2
- package/templates/app-graphql/shared/context.ts +2 -5
- package/templates/app-graphql/tests/render/render.tsx +22 -14
- package/templates/app-graphql/tests/render/types.ts +11 -0
- package/templates/app-graphql/tests/render.ts +1 -1
- package/templates/app-graphql/tsconfig.json +2 -1
- package/templates/app-trpc/features/start/Start/Start.test.tsx +1 -1
- package/templates/app-trpc/foundation/html/HTML.test.tsx +4 -4
- package/templates/app-trpc/package.json +2 -2
- package/templates/app-trpc/shared/context.ts +2 -5
- package/templates/app-trpc/tests/render/render.tsx +23 -15
- package/templates/app-trpc/tests/render/types.ts +11 -0
- package/templates/app-trpc/tests/render.ts +1 -1
- package/templates/app-trpc/tsconfig.json +2 -1
- package/templates/workspace/package.json +2 -2
package/build/esnext/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/parse.esnext
CHANGED
|
@@ -143,8 +143,7 @@ const parse = (input, options) => {
|
|
|
143
143
|
if (extglobs.length && tok.type !== "paren") {
|
|
144
144
|
extglobs[extglobs.length - 1].inner += tok.value;
|
|
145
145
|
}
|
|
146
|
-
if (tok.value || tok.output)
|
|
147
|
-
append(tok);
|
|
146
|
+
if (tok.value || tok.output) append(tok);
|
|
148
147
|
if (prev && prev.type === "text" && tok.type === "text") {
|
|
149
148
|
prev.value += tok.value;
|
|
150
149
|
prev.output = (prev.output || "") + tok.value;
|
|
@@ -459,8 +458,7 @@ const parse = (input, options) => {
|
|
|
459
458
|
}
|
|
460
459
|
if (value === ".") {
|
|
461
460
|
if (state.braces > 0 && prev.type === "dot") {
|
|
462
|
-
if (prev.value === ".")
|
|
463
|
-
prev.output = DOT_LITERAL;
|
|
461
|
+
if (prev.value === ".") prev.output = DOT_LITERAL;
|
|
464
462
|
const brace = braces[braces.length - 1];
|
|
465
463
|
prev.type = "dots";
|
|
466
464
|
prev.output += value;
|
|
@@ -675,20 +673,17 @@ const parse = (input, options) => {
|
|
|
675
673
|
push(token);
|
|
676
674
|
}
|
|
677
675
|
while (state.brackets > 0) {
|
|
678
|
-
if (opts.strictBrackets === true)
|
|
679
|
-
throw new SyntaxError(syntaxError("closing", "]"));
|
|
676
|
+
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]"));
|
|
680
677
|
state.output = utils.escapeLast(state.output, "[");
|
|
681
678
|
decrement("brackets");
|
|
682
679
|
}
|
|
683
680
|
while (state.parens > 0) {
|
|
684
|
-
if (opts.strictBrackets === true)
|
|
685
|
-
throw new SyntaxError(syntaxError("closing", ")"));
|
|
681
|
+
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", ")"));
|
|
686
682
|
state.output = utils.escapeLast(state.output, "(");
|
|
687
683
|
decrement("parens");
|
|
688
684
|
}
|
|
689
685
|
while (state.braces > 0) {
|
|
690
|
-
if (opts.strictBrackets === true)
|
|
691
|
-
throw new SyntaxError(syntaxError("closing", "}"));
|
|
686
|
+
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "}"));
|
|
692
687
|
state.output = utils.escapeLast(state.output, "{");
|
|
693
688
|
decrement("braces");
|
|
694
689
|
}
|
|
@@ -735,8 +730,7 @@ parse.fastpaths = (input, options) => {
|
|
|
735
730
|
star = `(${star})`;
|
|
736
731
|
}
|
|
737
732
|
const globstar = (opts2) => {
|
|
738
|
-
if (opts2.noglobstar === true)
|
|
739
|
-
return star;
|
|
733
|
+
if (opts2.noglobstar === true) return star;
|
|
740
734
|
return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
741
735
|
};
|
|
742
736
|
const create = (str) => {
|
|
@@ -759,11 +753,9 @@ parse.fastpaths = (input, options) => {
|
|
|
759
753
|
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
760
754
|
default: {
|
|
761
755
|
const match = /^(.*?)\.(\w+)$/.exec(str);
|
|
762
|
-
if (!match)
|
|
763
|
-
return;
|
|
756
|
+
if (!match) return;
|
|
764
757
|
const source2 = create(match[1]);
|
|
765
|
-
if (!source2)
|
|
766
|
-
return;
|
|
758
|
+
if (!source2) return;
|
|
767
759
|
return source2 + DOT_LITERAL + match[2];
|
|
768
760
|
}
|
|
769
761
|
}
|
package/build/esnext/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.esnext
CHANGED
|
@@ -17,8 +17,7 @@ const picomatch = (glob, options, returnState = false) => {
|
|
|
17
17
|
const arrayMatcher = (str) => {
|
|
18
18
|
for (const isMatch of fns) {
|
|
19
19
|
const state2 = isMatch(str);
|
|
20
|
-
if (state2)
|
|
21
|
-
return state2;
|
|
20
|
+
if (state2) return state2;
|
|
22
21
|
}
|
|
23
22
|
return false;
|
|
24
23
|
};
|
|
@@ -95,8 +94,7 @@ picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) =
|
|
|
95
94
|
};
|
|
96
95
|
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
97
96
|
picomatch.parse = (pattern, options) => {
|
|
98
|
-
if (Array.isArray(pattern))
|
|
99
|
-
return pattern.map((p) => picomatch.parse(p, options));
|
|
97
|
+
if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options));
|
|
100
98
|
return parse(pattern, { ...options, fastpaths: false });
|
|
101
99
|
};
|
|
102
100
|
picomatch.scan = (input, options) => scan(input, options);
|
|
@@ -135,8 +133,7 @@ picomatch.toRegex = (source, options) => {
|
|
|
135
133
|
const opts = options || {};
|
|
136
134
|
return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
|
|
137
135
|
} catch (err) {
|
|
138
|
-
if (options && options.debug === true)
|
|
139
|
-
throw err;
|
|
136
|
+
if (options && options.debug === true) throw err;
|
|
140
137
|
return /$^/;
|
|
141
138
|
}
|
|
142
139
|
};
|
package/build/esnext/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/scan.esnext
CHANGED
|
@@ -134,8 +134,7 @@ const scan = (input, options) => {
|
|
|
134
134
|
slashes.push(index);
|
|
135
135
|
tokens.push(token);
|
|
136
136
|
token = { value: "", depth: 0, isGlob: false };
|
|
137
|
-
if (finished === true)
|
|
138
|
-
continue;
|
|
137
|
+
if (finished === true) continue;
|
|
139
138
|
if (prev === CHAR_DOT && index === start + 1) {
|
|
140
139
|
start += 2;
|
|
141
140
|
continue;
|
|
@@ -171,8 +170,7 @@ const scan = (input, options) => {
|
|
|
171
170
|
}
|
|
172
171
|
}
|
|
173
172
|
if (code === CHAR_ASTERISK) {
|
|
174
|
-
if (prev === CHAR_ASTERISK)
|
|
175
|
-
isGlobstar = token.isGlobstar = true;
|
|
173
|
+
if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
|
|
176
174
|
isGlob = token.isGlob = true;
|
|
177
175
|
finished = true;
|
|
178
176
|
if (scanToEnd === true) {
|
|
@@ -265,8 +263,7 @@ const scan = (input, options) => {
|
|
|
265
263
|
}
|
|
266
264
|
}
|
|
267
265
|
if (opts.unescape === true) {
|
|
268
|
-
if (glob)
|
|
269
|
-
glob = utils.removeBackslashes(glob);
|
|
266
|
+
if (glob) glob = utils.removeBackslashes(glob);
|
|
270
267
|
if (base && backslashes === true) {
|
|
271
268
|
base = utils.removeBackslashes(base);
|
|
272
269
|
}
|
package/build/esnext/node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/utils.esnext
CHANGED
|
@@ -36,10 +36,8 @@ import { c as constants } from './constants.esnext';
|
|
|
36
36
|
};
|
|
37
37
|
exports.escapeLast = (input, char, lastIdx) => {
|
|
38
38
|
const idx = input.lastIndexOf(char, lastIdx);
|
|
39
|
-
if (idx === -1)
|
|
40
|
-
|
|
41
|
-
if (input[idx - 1] === "\\")
|
|
42
|
-
return exports.escapeLast(input, char, idx - 1);
|
|
39
|
+
if (idx === -1) return input;
|
|
40
|
+
if (input[idx - 1] === "\\") return exports.escapeLast(input, char, idx - 1);
|
|
43
41
|
return `${input.slice(0, idx)}\\${input.slice(idx)}`;
|
|
44
42
|
};
|
|
45
43
|
exports.removePrefix = (input, state = {}) => {
|
package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/day.esnext
CHANGED
|
@@ -3,8 +3,7 @@ import { __require as requireDatepart } from './datepart.esnext';
|
|
|
3
3
|
var day;
|
|
4
4
|
var hasRequiredDay;
|
|
5
5
|
function requireDay() {
|
|
6
|
-
if (hasRequiredDay)
|
|
7
|
-
return day;
|
|
6
|
+
if (hasRequiredDay) return day;
|
|
8
7
|
hasRequiredDay = 1;
|
|
9
8
|
const DatePart = requireDatepart();
|
|
10
9
|
const pos = (n) => {
|
|
@@ -3,8 +3,7 @@ import { __require as requireDatepart } from './datepart.esnext';
|
|
|
3
3
|
var hours;
|
|
4
4
|
var hasRequiredHours;
|
|
5
5
|
function requireHours() {
|
|
6
|
-
if (hasRequiredHours)
|
|
7
|
-
return hours;
|
|
6
|
+
if (hasRequiredHours) return hours;
|
|
8
7
|
hasRequiredHours = 1;
|
|
9
8
|
const DatePart = requireDatepart();
|
|
10
9
|
class Hours extends DatePart {
|
|
@@ -22,8 +21,7 @@ function requireHours() {
|
|
|
22
21
|
}
|
|
23
22
|
toString() {
|
|
24
23
|
let hours2 = this.date.getHours();
|
|
25
|
-
if (/h/.test(this.token))
|
|
26
|
-
hours2 = hours2 % 12 || 12;
|
|
24
|
+
if (/h/.test(this.token)) hours2 = hours2 % 12 || 12;
|
|
27
25
|
return this.token.length > 1 ? String(hours2).padStart(2, "0") : hours2;
|
|
28
26
|
}
|
|
29
27
|
}
|
|
@@ -11,8 +11,7 @@ import { __require as requireYear } from './year.esnext';
|
|
|
11
11
|
var dateparts;
|
|
12
12
|
var hasRequiredDateparts;
|
|
13
13
|
function requireDateparts() {
|
|
14
|
-
if (hasRequiredDateparts)
|
|
15
|
-
return dateparts;
|
|
14
|
+
if (hasRequiredDateparts) return dateparts;
|
|
16
15
|
hasRequiredDateparts = 1;
|
|
17
16
|
dateparts = {
|
|
18
17
|
DatePart: requireDatepart(),
|
|
@@ -3,8 +3,7 @@ import { __require as requireDatepart } from './datepart.esnext';
|
|
|
3
3
|
var meridiem;
|
|
4
4
|
var hasRequiredMeridiem;
|
|
5
5
|
function requireMeridiem() {
|
|
6
|
-
if (hasRequiredMeridiem)
|
|
7
|
-
return meridiem;
|
|
6
|
+
if (hasRequiredMeridiem) return meridiem;
|
|
8
7
|
hasRequiredMeridiem = 1;
|
|
9
8
|
const DatePart = requireDatepart();
|
|
10
9
|
class Meridiem extends DatePart {
|
|
@@ -3,8 +3,7 @@ import { __require as requireDatepart } from './datepart.esnext';
|
|
|
3
3
|
var milliseconds;
|
|
4
4
|
var hasRequiredMilliseconds;
|
|
5
5
|
function requireMilliseconds() {
|
|
6
|
-
if (hasRequiredMilliseconds)
|
|
7
|
-
return milliseconds;
|
|
6
|
+
if (hasRequiredMilliseconds) return milliseconds;
|
|
8
7
|
hasRequiredMilliseconds = 1;
|
|
9
8
|
const DatePart = requireDatepart();
|
|
10
9
|
class Milliseconds extends DatePart {
|
|
@@ -3,8 +3,7 @@ import { __require as requireDatepart } from './datepart.esnext';
|
|
|
3
3
|
var minutes;
|
|
4
4
|
var hasRequiredMinutes;
|
|
5
5
|
function requireMinutes() {
|
|
6
|
-
if (hasRequiredMinutes)
|
|
7
|
-
return minutes;
|
|
6
|
+
if (hasRequiredMinutes) return minutes;
|
|
8
7
|
hasRequiredMinutes = 1;
|
|
9
8
|
const DatePart = requireDatepart();
|
|
10
9
|
class Minutes extends DatePart {
|
|
@@ -3,8 +3,7 @@ import { __require as requireDatepart } from './datepart.esnext';
|
|
|
3
3
|
var month;
|
|
4
4
|
var hasRequiredMonth;
|
|
5
5
|
function requireMonth() {
|
|
6
|
-
if (hasRequiredMonth)
|
|
7
|
-
return month;
|
|
6
|
+
if (hasRequiredMonth) return month;
|
|
8
7
|
hasRequiredMonth = 1;
|
|
9
8
|
const DatePart = requireDatepart();
|
|
10
9
|
class Month extends DatePart {
|
|
@@ -3,8 +3,7 @@ import { __require as requireDatepart } from './datepart.esnext';
|
|
|
3
3
|
var seconds;
|
|
4
4
|
var hasRequiredSeconds;
|
|
5
5
|
function requireSeconds() {
|
|
6
|
-
if (hasRequiredSeconds)
|
|
7
|
-
return seconds;
|
|
6
|
+
if (hasRequiredSeconds) return seconds;
|
|
8
7
|
hasRequiredSeconds = 1;
|
|
9
8
|
const DatePart = requireDatepart();
|
|
10
9
|
class Seconds extends DatePart {
|
|
@@ -3,8 +3,7 @@ import { __require as requireDatepart } from './datepart.esnext';
|
|
|
3
3
|
var year;
|
|
4
4
|
var hasRequiredYear;
|
|
5
5
|
function requireYear() {
|
|
6
|
-
if (hasRequiredYear)
|
|
7
|
-
return year;
|
|
6
|
+
if (hasRequiredYear) return year;
|
|
8
7
|
hasRequiredYear = 1;
|
|
9
8
|
const DatePart = requireDatepart();
|
|
10
9
|
class Year extends DatePart {
|
|
@@ -6,8 +6,7 @@ import { __require as requireUtil } from '../util/index.esnext';
|
|
|
6
6
|
var autocomplete;
|
|
7
7
|
var hasRequiredAutocomplete;
|
|
8
8
|
function requireAutocomplete() {
|
|
9
|
-
if (hasRequiredAutocomplete)
|
|
10
|
-
return autocomplete;
|
|
9
|
+
if (hasRequiredAutocomplete) return autocomplete;
|
|
11
10
|
hasRequiredAutocomplete = 1;
|
|
12
11
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
13
12
|
try {
|
|
@@ -78,22 +77,18 @@ function requireAutocomplete() {
|
|
|
78
77
|
}
|
|
79
78
|
get fallback() {
|
|
80
79
|
let choice;
|
|
81
|
-
if (typeof this._fb === "number")
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
title: this._fb
|
|
86
|
-
};
|
|
80
|
+
if (typeof this._fb === "number") choice = this.choices[this._fb];
|
|
81
|
+
else if (typeof this._fb === "string") choice = {
|
|
82
|
+
title: this._fb
|
|
83
|
+
};
|
|
87
84
|
return choice || this._fb || {
|
|
88
85
|
title: this.i18n.noMatches
|
|
89
86
|
};
|
|
90
87
|
}
|
|
91
88
|
moveSelect(i) {
|
|
92
89
|
this.select = i;
|
|
93
|
-
if (this.suggestions.length > 0)
|
|
94
|
-
|
|
95
|
-
else
|
|
96
|
-
this.value = this.fallback.value;
|
|
90
|
+
if (this.suggestions.length > 0) this.value = getVal(this.suggestions, i);
|
|
91
|
+
else this.value = this.fallback.value;
|
|
97
92
|
this.fire();
|
|
98
93
|
}
|
|
99
94
|
complete(cb) {
|
|
@@ -101,8 +96,7 @@ function requireAutocomplete() {
|
|
|
101
96
|
return _asyncToGenerator(function* () {
|
|
102
97
|
const p = _this.completing = _this.suggest(_this.input, _this.choices);
|
|
103
98
|
const suggestions = yield p;
|
|
104
|
-
if (_this.completing !== p)
|
|
105
|
-
return;
|
|
99
|
+
if (_this.completing !== p) return;
|
|
106
100
|
_this.suggestions = suggestions.map((s, i, arr) => ({
|
|
107
101
|
title: getTitle(arr, i),
|
|
108
102
|
value: getVal(arr, i),
|
|
@@ -159,8 +153,7 @@ function requireAutocomplete() {
|
|
|
159
153
|
this.render();
|
|
160
154
|
}
|
|
161
155
|
delete() {
|
|
162
|
-
if (this.cursor === 0)
|
|
163
|
-
return this.bell();
|
|
156
|
+
if (this.cursor === 0) return this.bell();
|
|
164
157
|
let s1 = this.input.slice(0, this.cursor - 1);
|
|
165
158
|
let s2 = this.input.slice(this.cursor);
|
|
166
159
|
this.input = `${s1}${s2}`;
|
|
@@ -169,8 +162,7 @@ function requireAutocomplete() {
|
|
|
169
162
|
this.render();
|
|
170
163
|
}
|
|
171
164
|
deleteForward() {
|
|
172
|
-
if (this.cursor * this.scale >= this.rendered.length)
|
|
173
|
-
return this.bell();
|
|
165
|
+
if (this.cursor * this.scale >= this.rendered.length) return this.bell();
|
|
174
166
|
let s1 = this.input.slice(0, this.cursor);
|
|
175
167
|
let s2 = this.input.slice(this.cursor + 1);
|
|
176
168
|
this.input = `${s1}${s2}`;
|
|
@@ -204,8 +196,7 @@ function requireAutocomplete() {
|
|
|
204
196
|
next() {
|
|
205
197
|
if (this.select === this.suggestions.length - 1) {
|
|
206
198
|
this.moveSelect(0);
|
|
207
|
-
} else
|
|
208
|
-
this.moveSelect(this.select + 1);
|
|
199
|
+
} else this.moveSelect(this.select + 1);
|
|
209
200
|
this.render();
|
|
210
201
|
}
|
|
211
202
|
nextPage() {
|
|
@@ -217,14 +208,12 @@ function requireAutocomplete() {
|
|
|
217
208
|
this.render();
|
|
218
209
|
}
|
|
219
210
|
left() {
|
|
220
|
-
if (this.cursor <= 0)
|
|
221
|
-
return this.bell();
|
|
211
|
+
if (this.cursor <= 0) return this.bell();
|
|
222
212
|
this.cursor = this.cursor - 1;
|
|
223
213
|
this.render();
|
|
224
214
|
}
|
|
225
215
|
right() {
|
|
226
|
-
if (this.cursor * this.scale >= this.rendered.length)
|
|
227
|
-
return this.bell();
|
|
216
|
+
if (this.cursor * this.scale >= this.rendered.length) return this.bell();
|
|
228
217
|
this.cursor = this.cursor + 1;
|
|
229
218
|
this.render();
|
|
230
219
|
}
|
|
@@ -245,12 +234,9 @@ function requireAutocomplete() {
|
|
|
245
234
|
return prefix + " " + title + color.gray(desc || "");
|
|
246
235
|
}
|
|
247
236
|
render() {
|
|
248
|
-
if (this.closed)
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
this.out.write(cursor.hide);
|
|
252
|
-
else
|
|
253
|
-
this.out.write(clear(this.outputText, this.out.columns));
|
|
237
|
+
if (this.closed) return;
|
|
238
|
+
if (this.firstRender) this.out.write(cursor.hide);
|
|
239
|
+
else this.out.write(clear(this.outputText, this.out.columns));
|
|
254
240
|
super.render();
|
|
255
241
|
let _entriesToDisplay = entriesToDisplay(this.select, this.choices.length, this.limit), startIndex = _entriesToDisplay.startIndex, endIndex = _entriesToDisplay.endIndex;
|
|
256
242
|
this.outputText = [style.symbol(this.done, this.aborted, this.exited), color.bold(this.msg), style.delimiter(this.completing), this.done && this.suggestions[this.select] ? this.suggestions[this.select].title : this.rendered = this.transform.render(this.input)].join(" ");
|
|
@@ -6,8 +6,7 @@ import { __require as requireUtil } from '../util/index.esnext';
|
|
|
6
6
|
var autocompleteMultiselect;
|
|
7
7
|
var hasRequiredAutocompleteMultiselect;
|
|
8
8
|
function requireAutocompleteMultiselect() {
|
|
9
|
-
if (hasRequiredAutocompleteMultiselect)
|
|
10
|
-
return autocompleteMultiselect;
|
|
9
|
+
if (hasRequiredAutocompleteMultiselect) return autocompleteMultiselect;
|
|
11
10
|
hasRequiredAutocompleteMultiselect = 1;
|
|
12
11
|
const color = requireKleur();
|
|
13
12
|
const _require = requireSrc(), cursor = _require.cursor;
|
|
@@ -51,8 +50,7 @@ function requireAutocompleteMultiselect() {
|
|
|
51
50
|
this.render();
|
|
52
51
|
}
|
|
53
52
|
right() {
|
|
54
|
-
if (this.value.filter((e) => e.selected).length >= this.maxChoices)
|
|
55
|
-
return this.bell();
|
|
53
|
+
if (this.value.filter((e) => e.selected).length >= this.maxChoices) return this.bell();
|
|
56
54
|
this.filteredOptions[this.cursor].selected = true;
|
|
57
55
|
this.render();
|
|
58
56
|
}
|
|
@@ -129,10 +127,8 @@ Filtered results for: ${this.inputValue ? this.inputValue : color.gray("Enter so
|
|
|
129
127
|
}
|
|
130
128
|
renderOption(cursor2, v, i) {
|
|
131
129
|
let title;
|
|
132
|
-
if (v.disabled)
|
|
133
|
-
|
|
134
|
-
else
|
|
135
|
-
title = cursor2 === i ? color.cyan().underline(v.title) : v.title;
|
|
130
|
+
if (v.disabled) title = cursor2 === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);
|
|
131
|
+
else title = cursor2 === i ? color.cyan().underline(v.title) : v.title;
|
|
136
132
|
return (v.selected ? color.green(figures.radioOn) : figures.radioOff) + " " + title;
|
|
137
133
|
}
|
|
138
134
|
renderDoneOrInstructions() {
|
|
@@ -146,10 +142,8 @@ Filtered results for: ${this.inputValue ? this.inputValue : color.gray("Enter so
|
|
|
146
142
|
return output.join(" ");
|
|
147
143
|
}
|
|
148
144
|
render() {
|
|
149
|
-
if (this.closed)
|
|
150
|
-
|
|
151
|
-
if (this.firstRender)
|
|
152
|
-
this.out.write(cursor.hide);
|
|
145
|
+
if (this.closed) return;
|
|
146
|
+
if (this.firstRender) this.out.write(cursor.hide);
|
|
153
147
|
super.render();
|
|
154
148
|
let prompt = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.renderDoneOrInstructions()].join(" ");
|
|
155
149
|
if (this.showMinError) {
|
|
@@ -6,8 +6,7 @@ import { __require as requireSrc } from '../../../../../sisteransi@1.0.5/node_mo
|
|
|
6
6
|
var confirm;
|
|
7
7
|
var hasRequiredConfirm;
|
|
8
8
|
function requireConfirm() {
|
|
9
|
-
if (hasRequiredConfirm)
|
|
10
|
-
return confirm;
|
|
9
|
+
if (hasRequiredConfirm) return confirm;
|
|
11
10
|
hasRequiredConfirm = 1;
|
|
12
11
|
const color = requireKleur();
|
|
13
12
|
const Prompt = requirePrompt();
|
|
@@ -61,12 +60,9 @@ function requireConfirm() {
|
|
|
61
60
|
return this.bell();
|
|
62
61
|
}
|
|
63
62
|
render() {
|
|
64
|
-
if (this.closed)
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
this.out.write(cursor.hide);
|
|
68
|
-
else
|
|
69
|
-
this.out.write(clear(this.outputText, this.out.columns));
|
|
63
|
+
if (this.closed) return;
|
|
64
|
+
if (this.firstRender) this.out.write(cursor.hide);
|
|
65
|
+
else this.out.write(clear(this.outputText, this.out.columns));
|
|
70
66
|
super.render();
|
|
71
67
|
this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(this.done), this.done ? this.value ? this.yesMsg : this.noMsg : color.gray(this.initialValue ? this.yesOption : this.noOption)].join(" ");
|
|
72
68
|
this.out.write(erase.line + cursor.to(0) + this.outputText);
|
package/build/esnext/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/date.esnext
CHANGED
|
@@ -7,8 +7,7 @@ import { __require as requireDateparts } from '../dateparts/index.esnext';
|
|
|
7
7
|
var date;
|
|
8
8
|
var hasRequiredDate;
|
|
9
9
|
function requireDate() {
|
|
10
|
-
if (hasRequiredDate)
|
|
11
|
-
return date;
|
|
10
|
+
if (hasRequiredDate) return date;
|
|
12
11
|
hasRequiredDate = 1;
|
|
13
12
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
14
13
|
try {
|
|
@@ -93,8 +92,7 @@ function requireDate() {
|
|
|
93
92
|
return this._date;
|
|
94
93
|
}
|
|
95
94
|
set date(date2) {
|
|
96
|
-
if (date2)
|
|
97
|
-
this._date.setTime(date2.getTime());
|
|
95
|
+
if (date2) this._date.setTime(date2.getTime());
|
|
98
96
|
}
|
|
99
97
|
set mask(mask) {
|
|
100
98
|
let result;
|
|
@@ -110,10 +108,8 @@ function requireDate() {
|
|
|
110
108
|
}) : result[idx] || match);
|
|
111
109
|
}
|
|
112
110
|
let parts = this.parts.reduce((arr, i) => {
|
|
113
|
-
if (typeof i === "string" && typeof arr[arr.length - 1] === "string")
|
|
114
|
-
|
|
115
|
-
else
|
|
116
|
-
arr.push(i);
|
|
111
|
+
if (typeof i === "string" && typeof arr[arr.length - 1] === "string") arr[arr.length - 1] += i;
|
|
112
|
+
else arr.push(i);
|
|
117
113
|
return arr;
|
|
118
114
|
}, []);
|
|
119
115
|
this.parts.splice(0);
|
|
@@ -182,15 +178,13 @@ function requireDate() {
|
|
|
182
178
|
}
|
|
183
179
|
left() {
|
|
184
180
|
let prev = this.parts[this.cursor].prev();
|
|
185
|
-
if (prev == null)
|
|
186
|
-
return this.bell();
|
|
181
|
+
if (prev == null) return this.bell();
|
|
187
182
|
this.moveCursor(this.parts.indexOf(prev));
|
|
188
183
|
this.render();
|
|
189
184
|
}
|
|
190
185
|
right() {
|
|
191
186
|
let next = this.parts[this.cursor].next();
|
|
192
|
-
if (next == null)
|
|
193
|
-
return this.bell();
|
|
187
|
+
if (next == null) return this.bell();
|
|
194
188
|
this.moveCursor(this.parts.indexOf(next));
|
|
195
189
|
this.render();
|
|
196
190
|
}
|
|
@@ -207,12 +201,9 @@ function requireDate() {
|
|
|
207
201
|
}
|
|
208
202
|
}
|
|
209
203
|
render() {
|
|
210
|
-
if (this.closed)
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
this.out.write(cursor.hide);
|
|
214
|
-
else
|
|
215
|
-
this.out.write(clear(this.outputText, this.out.columns));
|
|
204
|
+
if (this.closed) return;
|
|
205
|
+
if (this.firstRender) this.out.write(cursor.hide);
|
|
206
|
+
else this.out.write(clear(this.outputText, this.out.columns));
|
|
216
207
|
super.render();
|
|
217
208
|
this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.parts.reduce((arr, p, idx) => arr.concat(idx === this.cursor && !this.done ? color.cyan().underline(p.toString()) : p), []).join("")].join(" ");
|
|
218
209
|
if (this.error) {
|
|
@@ -11,8 +11,7 @@ import { __require as requireConfirm } from './confirm.esnext';
|
|
|
11
11
|
var elements;
|
|
12
12
|
var hasRequiredElements;
|
|
13
13
|
function requireElements() {
|
|
14
|
-
if (hasRequiredElements)
|
|
15
|
-
return elements;
|
|
14
|
+
if (hasRequiredElements) return elements;
|
|
16
15
|
hasRequiredElements = 1;
|
|
17
16
|
elements = {
|
|
18
17
|
TextPrompt: requireText(),
|
|
@@ -6,8 +6,7 @@ import { __require as requireUtil } from '../util/index.esnext';
|
|
|
6
6
|
var multiselect;
|
|
7
7
|
var hasRequiredMultiselect;
|
|
8
8
|
function requireMultiselect() {
|
|
9
|
-
if (hasRequiredMultiselect)
|
|
10
|
-
return multiselect;
|
|
9
|
+
if (hasRequiredMultiselect) return multiselect;
|
|
11
10
|
hasRequiredMultiselect = 1;
|
|
12
11
|
const color = requireKleur();
|
|
13
12
|
const _require = requireSrc(), cursor = _require.cursor;
|
|
@@ -27,11 +26,10 @@ function requireMultiselect() {
|
|
|
27
26
|
this.instructions = opts.instructions;
|
|
28
27
|
this.optionsPerPage = opts.optionsPerPage || 10;
|
|
29
28
|
this.value = opts.choices.map((ch, idx) => {
|
|
30
|
-
if (typeof ch === "string")
|
|
31
|
-
ch
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
};
|
|
29
|
+
if (typeof ch === "string") ch = {
|
|
30
|
+
title: ch,
|
|
31
|
+
value: idx
|
|
32
|
+
};
|
|
35
33
|
return {
|
|
36
34
|
title: ch && (ch.title || ch.value || ch),
|
|
37
35
|
description: ch && ch.description,
|
|
@@ -111,8 +109,7 @@ function requireMultiselect() {
|
|
|
111
109
|
this.render();
|
|
112
110
|
}
|
|
113
111
|
right() {
|
|
114
|
-
if (this.value.filter((e) => e.selected).length >= this.maxChoices)
|
|
115
|
-
return this.bell();
|
|
112
|
+
if (this.value.filter((e) => e.selected).length >= this.maxChoices) return this.bell();
|
|
116
113
|
this.value[this.cursor].selected = true;
|
|
117
114
|
this.render();
|
|
118
115
|
}
|
|
@@ -215,10 +212,8 @@ Instructions:
|
|
|
215
212
|
return output.join(" ");
|
|
216
213
|
}
|
|
217
214
|
render() {
|
|
218
|
-
if (this.closed)
|
|
219
|
-
|
|
220
|
-
if (this.firstRender)
|
|
221
|
-
this.out.write(cursor.hide);
|
|
215
|
+
if (this.closed) return;
|
|
216
|
+
if (this.firstRender) this.out.write(cursor.hide);
|
|
222
217
|
super.render();
|
|
223
218
|
let prompt = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.renderDoneOrInstructions()].join(" ");
|
|
224
219
|
if (this.showMinError) {
|
|
@@ -6,8 +6,7 @@ import { __require as requireUtil } from '../util/index.esnext';
|
|
|
6
6
|
var number;
|
|
7
7
|
var hasRequiredNumber;
|
|
8
8
|
function requireNumber() {
|
|
9
|
-
if (hasRequiredNumber)
|
|
10
|
-
return number;
|
|
9
|
+
if (hasRequiredNumber) return number;
|
|
11
10
|
hasRequiredNumber = 1;
|
|
12
11
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
13
12
|
try {
|
|
@@ -146,8 +145,7 @@ function requireNumber() {
|
|
|
146
145
|
if (this.value === "") {
|
|
147
146
|
this.value = this.min - this.inc;
|
|
148
147
|
}
|
|
149
|
-
if (this.value >= this.max)
|
|
150
|
-
return this.bell();
|
|
148
|
+
if (this.value >= this.max) return this.bell();
|
|
151
149
|
this.value += this.inc;
|
|
152
150
|
this.color = `cyan`;
|
|
153
151
|
this.fire();
|
|
@@ -158,8 +156,7 @@ function requireNumber() {
|
|
|
158
156
|
if (this.value === "") {
|
|
159
157
|
this.value = this.min + this.inc;
|
|
160
158
|
}
|
|
161
|
-
if (this.value <= this.min)
|
|
162
|
-
return this.bell();
|
|
159
|
+
if (this.value <= this.min) return this.bell();
|
|
163
160
|
this.value -= this.inc;
|
|
164
161
|
this.color = `cyan`;
|
|
165
162
|
this.fire();
|
|
@@ -167,8 +164,7 @@ function requireNumber() {
|
|
|
167
164
|
}
|
|
168
165
|
delete() {
|
|
169
166
|
let val = this.value.toString();
|
|
170
|
-
if (val.length === 0)
|
|
171
|
-
return this.bell();
|
|
167
|
+
if (val.length === 0) return this.bell();
|
|
172
168
|
this.value = this.parse(val = val.slice(0, -1)) || ``;
|
|
173
169
|
if (this.value !== "" && this.value < this.min) {
|
|
174
170
|
this.value = this.min;
|
|
@@ -183,30 +179,23 @@ function requireNumber() {
|
|
|
183
179
|
this.render();
|
|
184
180
|
}
|
|
185
181
|
_(c, key) {
|
|
186
|
-
if (!this.valid(c))
|
|
187
|
-
return this.bell();
|
|
182
|
+
if (!this.valid(c)) return this.bell();
|
|
188
183
|
const now = Date.now();
|
|
189
|
-
if (now - this.lastHit > 1e3)
|
|
190
|
-
this.typed = ``;
|
|
184
|
+
if (now - this.lastHit > 1e3) this.typed = ``;
|
|
191
185
|
this.typed += c;
|
|
192
186
|
this.lastHit = now;
|
|
193
187
|
this.color = `cyan`;
|
|
194
|
-
if (c === `.`)
|
|
195
|
-
return this.fire();
|
|
188
|
+
if (c === `.`) return this.fire();
|
|
196
189
|
this.value = Math.min(this.parse(this.typed), this.max);
|
|
197
|
-
if (this.value > this.max)
|
|
198
|
-
|
|
199
|
-
if (this.value < this.min)
|
|
200
|
-
this.value = this.min;
|
|
190
|
+
if (this.value > this.max) this.value = this.max;
|
|
191
|
+
if (this.value < this.min) this.value = this.min;
|
|
201
192
|
this.fire();
|
|
202
193
|
this.render();
|
|
203
194
|
}
|
|
204
195
|
render() {
|
|
205
|
-
if (this.closed)
|
|
206
|
-
return;
|
|
196
|
+
if (this.closed) return;
|
|
207
197
|
if (!this.firstRender) {
|
|
208
|
-
if (this.outputError)
|
|
209
|
-
this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns));
|
|
198
|
+
if (this.outputError) this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns));
|
|
210
199
|
this.out.write(clear(this.outputText, this.out.columns));
|
|
211
200
|
}
|
|
212
201
|
super.render();
|