MCPcopy Create free account
hub / github.com/chhoumann/quickadd / renderDateAliases

Method renderDateAliases

src/quickAddSettingsTab.ts:422–450  ·  view source on GitHub ↗
(setting: Setting)

Source from the content-addressed store, hash-verified

420 }
421
422 private renderDateAliases(setting: Setting): void {
423 setting.settingEl.addClass("qa-date-alias-setting");
424 setting.controlEl.addClass("qa-date-alias-control");
425
426 let textAreaRef: TextAreaComponent | null = null;
427
428 setting.addTextArea((textArea) => {
429 textAreaRef = textArea;
430 textArea
431 .setPlaceholder("t = today\ntm = tomorrow\nyd = yesterday")
432 .setValue(
433 formatDateAliasLines(settingsStore.getState().dateAliases),
434 )
435 .onChange((value) => {
436 settingsStore.setState({
437 dateAliases: parseDateAliasLines(value),
438 });
439 });
440 textArea.inputEl.addClass("qa-date-alias-input");
441 });
442
443 setting.addButton((button) => {
444 button.setButtonText("Reset to defaults").onClick(() => {
445 settingsStore.setState({ dateAliases: DEFAULT_DATE_ALIASES });
446 textAreaRef?.setValue(formatDateAliasLines(DEFAULT_DATE_ALIASES));
447 });
448 button.buttonEl.addClass("qa-date-alias-reset");
449 });
450 }
451
452 private renderTemplateFolderPaths(setting: Setting): () => void {
453 // Let this row span the full pane (label/desc stacked above a full-width

Callers 1

inputGroupMethod · 0.95

Calls 10

formatDateAliasLinesFunction · 0.90
parseDateAliasLinesFunction · 0.90
addClassMethod · 0.45
addTextAreaMethod · 0.45
onChangeMethod · 0.45
setValueMethod · 0.45
setPlaceholderMethod · 0.45
addButtonMethod · 0.45
onClickMethod · 0.45
setButtonTextMethod · 0.45

Tested by

no test coverage detected