@yomotech/view-toolkit 1.0.74 → 1.0.76

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.
@@ -208,6 +208,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImpor
208
208
  args: [{ name: 'vlDesignText', standalone: true, pure: true }]
209
209
  }] });
210
210
 
211
+ // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-18
212
+ // - new: completeTimeText - a partly typed time is completed when the field is left ("20" -> "20:00")
211
213
  // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-17
212
214
  // - new: durationText - data type "duration": hours and minutes, the same in every language, never AM/PM; reads a
213
215
  // computed "8:45", a server's date-time ("…T04:55:00…" - the wall time), a Date and a number of minutes; HH:mm by
@@ -445,6 +447,33 @@ function shapeTimeText(text, twelveHours) {
445
447
  const time = digits.length <= 2 ? digits : `${digits.slice(0, 2)}:${digits.slice(2)}`;
446
448
  return twelveHours && meridiem && time ? `${time} ${meridiem}` : time;
447
449
  }
450
+ /**
451
+ * A time typed only partly, completed when the field is left: "20" -> "20:00", "8" -> "08:00", "830" -> "08:30",
452
+ * "20:" -> "20:00", "8:5" -> "08:05"; a 12-hour field keeps AM/PM as typed. Anything else comes back unchanged.
453
+ */
454
+ function completeTimeText(text, twelveHours) {
455
+ const raw = (text ?? '').trim();
456
+ const meridiem = typedMeridiem(raw);
457
+ const core = raw.replace(/\s*(a|p|am|pm)\s*$/i, '');
458
+ let hours, minutes;
459
+ let m = /^(\d{1,2}):?$/.exec(core);
460
+ if (m) {
461
+ hours = m[1];
462
+ minutes = '00';
463
+ }
464
+ else if ((m = /^(\d)(\d{2})$/.exec(core))) {
465
+ hours = m[1];
466
+ minutes = m[2];
467
+ }
468
+ else if ((m = /^(\d{1,2}):(\d)$/.exec(core))) {
469
+ hours = m[1];
470
+ minutes = '0' + m[2];
471
+ }
472
+ else
473
+ return text;
474
+ const time = `${hours.padStart(2, '0')}:${minutes}`;
475
+ return twelveHours ? shapeTimeText(meridiem ? `${time} ${meridiem}` : time, true) : time;
476
+ }
448
477
  /**
449
478
  * AM or PM as typed after the digits: the last "a" or "p" counts - "0430p", "4:30pm", and "04:30 AMP" (P typed after
450
479
  * the AM the field had added) are PM; "" when none. On a laptop PM could not be typed at all (2026-10-28).
@@ -2351,6 +2380,8 @@ function installOptionFullText() {
2351
2380
  }, true);
2352
2381
  }
2353
2382
 
2383
+ // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-18
2384
+ // - new: closing the keyboard completes a partly typed time ("20" -> "20:00", completeTimeText)
2354
2385
  // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-15
2355
2386
  // - change: the page background for keyboard and calendar is the page area's colour (.center-wrap), no longer that of
2356
2387
  // the element in the middle of the screen - a grey table cell made the keyboard grey on a white page (luv2shop)
@@ -2976,6 +3007,14 @@ class CustomKeyboardService {
2976
3007
  }
2977
3008
  const { blurTarget = true, restoreAccessoryBar = true, keepBottomArea = false } = option;
2978
3009
  const { target } = session;
3010
+ // a time typed only partly ("20") is completed before the field is left ("20:00") - it was emptied
3011
+ if (session.type === 'time') {
3012
+ const input = target;
3013
+ const done = typeof input?.value === 'string' && input.value.trim() ? completeTimeText(input.value, this.twelveHours(target)) : null;
3014
+ // through updateTarget: PrimeNG takes an input only after a keydown
3015
+ if (done && done !== input.value)
3016
+ this.updateTarget(target, done, done.length);
3017
+ }
2979
3018
  document.removeEventListener('pointerdown', this.documentPointerDownHandler, true);
2980
3019
  target.removeEventListener('blur', this.activeTargetBlurHandler);
2981
3020
  this.markActiveField(target, false);
@@ -5749,6 +5788,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImpor
5749
5788
  }]
5750
5789
  }], ctorParameters: () => [{ type: CustomKeyboardService }] });
5751
5790
 
5791
+ // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-18
5792
+ // - new: leaveTime - a partly typed time is completed when the field is left ("20" -> "20:00"); it was emptied
5752
5793
  // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-17
5753
5794
  // - new: data type "duration" - 24 hours in every language, shown as HH:mm (durationText)
5754
5795
  // Faramarz Yousefian and Agent Toni (Claude Opus 5.5) 2026-11-02
@@ -5854,6 +5895,19 @@ class DateTimeControl {
5854
5895
  this.target.value = base;
5855
5896
  this.changed.emit(base);
5856
5897
  }
5898
+ /** Leaving a time field typed only partly completes it ("20" -> "20:00") - it was emptied before. */
5899
+ leaveTime(event) {
5900
+ if (this.kind !== 'time')
5901
+ return;
5902
+ const input = event.target;
5903
+ if (!(input instanceof HTMLInputElement) || !input.value.trim())
5904
+ return;
5905
+ const done = completeTimeText(input.value, this.hourFormat() === '12');
5906
+ if (done === input.value)
5907
+ return;
5908
+ input.value = done;
5909
+ this.takeTypedTime(done);
5910
+ }
5857
5911
  /** In a 12-hour time field the arrow keys up / down switch AM <-> PM (as in usual time fields). */
5858
5912
  timeKey(event) {
5859
5913
  if (this.kind !== 'time' || this.hourFormat() !== '12' || (event.key !== 'ArrowUp' && event.key !== 'ArrowDown'))
@@ -5880,7 +5934,7 @@ class DateTimeControl {
5880
5934
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.2", ngImport: i0, type: DateTimeControl, deps: [], target: i0.ɵɵFactoryTarget.Component });
5881
5935
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.2", type: DateTimeControl, isStandalone: true, selector: "vl-datetime", inputs: { field: "field", target: "target", property: "property", kind: "kind", value: "value", readonly: "readonly", keyboard: "keyboard", saveTried: "saveTried", errorMessages: "errorMessages", translations: "translations", inputStyle: "inputStyle", inputClass: "inputClass" }, outputs: { changed: "changed", opened: "opened" }, viewQueries: [{ propertyName: "control", first: true, predicate: ["dt"], descendants: true }], ngImport: i0, template: `
5882
5936
  <ng-container *ngIf="!readonly; else shownText">
5883
- <div class="picker-field" (keydown)="timeKey($event)">
5937
+ <div class="picker-field" (keydown)="timeKey($event)" (focusout)="leaveTime($event)">
5884
5938
  <p-datepicker #dp #dt="ngModel" styleClass="custom-datepicker"
5885
5939
  [placeholder]="placeholder()" [name]="field?.scope?.reference"
5886
5940
  [required]="field?.option?.required === true" [disabled]="field?.option?.disabled"
@@ -5918,7 +5972,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.2", ngImpor
5918
5972
  type: Component,
5919
5973
  args: [{ selector: 'vl-datetime', standalone: true, imports: [FormsModule, NgIf, DatePickerModule, CustomKeyboardDirective], viewProviders: [{ provide: ControlContainer, useFactory: (form) => form, deps: [[new Optional(), new SkipSelf(), NgForm]] }], template: `
5920
5974
  <ng-container *ngIf="!readonly; else shownText">
5921
- <div class="picker-field" (keydown)="timeKey($event)">
5975
+ <div class="picker-field" (keydown)="timeKey($event)" (focusout)="leaveTime($event)">
5922
5976
  <p-datepicker #dp #dt="ngModel" styleClass="custom-datepicker"
5923
5977
  [placeholder]="placeholder()" [name]="field?.scope?.reference"
5924
5978
  [required]="field?.option?.required === true" [disabled]="field?.option?.disabled"
@@ -18293,5 +18347,5 @@ function termsUser(userInfo) {
18293
18347
  * Generated bundle index. Do not edit.
18294
18348
  */
18295
18349
 
18296
- export { ADDON_API_VERSION, ADDON_TEST_KIT, AddonCheckRefused, AddonHostService, AppVersionResetService, Autocomplete, BACKEND_PROXY_PREFIX, BackendCallService, CardComponent, CardDesigner, CheckboxControl, ConfigService, ControlComponent, Couchdb, CustomKeyboardComponent, CustomKeyboardDirective, CustomKeyboardService, DATA_KEY_ANSWER, DATA_KEY_NONE, DEFAULT_DATE_FORMAT, DESIGN_TEXTS, DateFormatPipe, DateHintPipe, DateRangeControl, DateTextPipe, DateTimeControl, DesignBarComponent, DesignFieldPipe, DesignTextPipe, DropMarkerComponent, DropdownControl, FormComponent, GRID_COLUMNS, GridComponent, HeaderMenuComponent, LogsComponent, MAX_FIELDS_PER_ROW, MAX_ROW_COLUMNS, MediaControl, MediaSourcePipe, MobileKeycloakService, MobileOidcService, MobileOktaService, ModelComponent, NetworkLogService, NotificationService, NumberControl, PLACEHOLDER_SOURCES, PageData, PaginationComponent, PasswordControl, PdfViewerComponent, PdfViewerService, PlaceholderPipe, READ_ATTEMPT_TIMEOUT, REQUEST_STAGES, RETRY_PAUSES, RETRY_STATUSES, RadioControl, RecordStore, RemoteListService, RequestService, RequestTimeoutError, RequestTimeoutService, RulesPipe, SEND_ERROR_KEY, SIDE_DOCK_CLASS, STORAGE_DATE_FORMAT, SectionDesigner, SideMenuComponent, SlideshowComponent, SwitchControl, TermsDialog, TextareaControl, Textbox, UtilityService, VL_MEDIA_RESOLVER, ViewToolkitModule, VisiblePipe, acceptedLocally, addButton, addCardButton, addSection, addonHostAllowed, addonImports, addonLimits, addonManifestProblem, addonRecords, applyLayoutDefaults, applyMapping, backendTermsState, backendUrl, blankComments, buildBackendCall, buttonLocked, bytesOfBase64, cardButton, checkCheckResult, checkHandler, checkRouteResult, checkTransformResult, clearHeader, cloneLayout, columnFromProperty, controlKind, controlProperty, currencyDigits, currentDateLanguage, dateDigitCount, dateInputPattern, dependsOnForm, designDropIds, designField, designText, designTexts, designerLinksOn, designerPlace, displayDateValue, displayNumber, dropCardProperty, dropGridProperty, dropObjectName, dropProperty, dropTypeAt, durationText, elementFromProperty, fieldFromProperty, fieldInnerLayoutStyle, fieldModel, fieldRules, fieldSpan, fillFromUser, fillPlaceholders, fixedTimeText, formValuesGiven, formatDate, formatDates, fromStorageValue, gridColumnCount, hasBackendCall, hasHeaderTarget, headerButton, inputFormatHint, insertField, isAddonCode, isAddonTestFile, isBrowserSource, isIsoDate, isNativeMobile, isNativePhone, isPropertyDrop, isSignedIn, isTarget, languageDatePattern, layoutPlaceholder, linkAddonModules, linkOfRecord, loadErrorOf, lockHint, lockReason, lockReasons, mappedValues, mediaKind, moveCardElement, moveColumn, moveField, moveSection, moveTreeNode, newButton, newSection, nextZoom, normalizeCard, normalizeCustomKeyboardType, normalizeSections, numberShape, numberStep, numberSuffix, parseAnswer, parseRecords, parseStorageDate, parseTimeText, perUserField, primeDatePattern, proxyFor, rebalanceRow, recordOf, recordsFrom, removeCardElement, removeColumn, removeField, removeHeaderElement, removeSection, removeTreeNode, renewSignIn, replaceCardElement, replaceColumn, replaceField, replaceSection, replaceTreeNode, requestDesignDelete, resizeColumn, resolveAddonPath, resolveCustomKeyboardType, resolvePlaceholder, resolveTemplate, routeOf, ruleMessage, runAddonTests, sampleRecords, sampleValue, sectionPlain, sectionSpan, sectionSticky, sectionTabletSpan, sectionVisible, sendErrorText, sendsForm, setDateLanguage, setInputHintLanguage, setProxyEnvironment, setSignInRenewal, setToolkitKeyboardOnWeb, shapeDateDigits, shapeTimeText, sideDockWidth, splitReference, stagedRead, stagedRequest, storageKeyOf, storageKind, storageValue, storedToTyped, styleParts, termsStamp, termsStorageKey, termsToConfirm, termsUrl, termsUser, testAction, testFieldKey, testFieldPath, testWrites, timeHourFormat, toggleMeridiem, toggleRecord, toolkitKeyboardActive, transformHandler, treeNode, treePaths, typedMeridiem, typedToStored, useDesignerLinks, useDraftSource, userRecord, usesTwelveHours, validTreePath, valueAt, visibleFields, whenOnline, withAppPagination, withUserRecord, withoutMarks, wrapperStyleOf };
18350
+ export { ADDON_API_VERSION, ADDON_TEST_KIT, AddonCheckRefused, AddonHostService, AppVersionResetService, Autocomplete, BACKEND_PROXY_PREFIX, BackendCallService, CardComponent, CardDesigner, CheckboxControl, ConfigService, ControlComponent, Couchdb, CustomKeyboardComponent, CustomKeyboardDirective, CustomKeyboardService, DATA_KEY_ANSWER, DATA_KEY_NONE, DEFAULT_DATE_FORMAT, DESIGN_TEXTS, DateFormatPipe, DateHintPipe, DateRangeControl, DateTextPipe, DateTimeControl, DesignBarComponent, DesignFieldPipe, DesignTextPipe, DropMarkerComponent, DropdownControl, FormComponent, GRID_COLUMNS, GridComponent, HeaderMenuComponent, LogsComponent, MAX_FIELDS_PER_ROW, MAX_ROW_COLUMNS, MediaControl, MediaSourcePipe, MobileKeycloakService, MobileOidcService, MobileOktaService, ModelComponent, NetworkLogService, NotificationService, NumberControl, PLACEHOLDER_SOURCES, PageData, PaginationComponent, PasswordControl, PdfViewerComponent, PdfViewerService, PlaceholderPipe, READ_ATTEMPT_TIMEOUT, REQUEST_STAGES, RETRY_PAUSES, RETRY_STATUSES, RadioControl, RecordStore, RemoteListService, RequestService, RequestTimeoutError, RequestTimeoutService, RulesPipe, SEND_ERROR_KEY, SIDE_DOCK_CLASS, STORAGE_DATE_FORMAT, SectionDesigner, SideMenuComponent, SlideshowComponent, SwitchControl, TermsDialog, TextareaControl, Textbox, UtilityService, VL_MEDIA_RESOLVER, ViewToolkitModule, VisiblePipe, acceptedLocally, addButton, addCardButton, addSection, addonHostAllowed, addonImports, addonLimits, addonManifestProblem, addonRecords, applyLayoutDefaults, applyMapping, backendTermsState, backendUrl, blankComments, buildBackendCall, buttonLocked, bytesOfBase64, cardButton, checkCheckResult, checkHandler, checkRouteResult, checkTransformResult, clearHeader, cloneLayout, columnFromProperty, completeTimeText, controlKind, controlProperty, currencyDigits, currentDateLanguage, dateDigitCount, dateInputPattern, dependsOnForm, designDropIds, designField, designText, designTexts, designerLinksOn, designerPlace, displayDateValue, displayNumber, dropCardProperty, dropGridProperty, dropObjectName, dropProperty, dropTypeAt, durationText, elementFromProperty, fieldFromProperty, fieldInnerLayoutStyle, fieldModel, fieldRules, fieldSpan, fillFromUser, fillPlaceholders, fixedTimeText, formValuesGiven, formatDate, formatDates, fromStorageValue, gridColumnCount, hasBackendCall, hasHeaderTarget, headerButton, inputFormatHint, insertField, isAddonCode, isAddonTestFile, isBrowserSource, isIsoDate, isNativeMobile, isNativePhone, isPropertyDrop, isSignedIn, isTarget, languageDatePattern, layoutPlaceholder, linkAddonModules, linkOfRecord, loadErrorOf, lockHint, lockReason, lockReasons, mappedValues, mediaKind, moveCardElement, moveColumn, moveField, moveSection, moveTreeNode, newButton, newSection, nextZoom, normalizeCard, normalizeCustomKeyboardType, normalizeSections, numberShape, numberStep, numberSuffix, parseAnswer, parseRecords, parseStorageDate, parseTimeText, perUserField, primeDatePattern, proxyFor, rebalanceRow, recordOf, recordsFrom, removeCardElement, removeColumn, removeField, removeHeaderElement, removeSection, removeTreeNode, renewSignIn, replaceCardElement, replaceColumn, replaceField, replaceSection, replaceTreeNode, requestDesignDelete, resizeColumn, resolveAddonPath, resolveCustomKeyboardType, resolvePlaceholder, resolveTemplate, routeOf, ruleMessage, runAddonTests, sampleRecords, sampleValue, sectionPlain, sectionSpan, sectionSticky, sectionTabletSpan, sectionVisible, sendErrorText, sendsForm, setDateLanguage, setInputHintLanguage, setProxyEnvironment, setSignInRenewal, setToolkitKeyboardOnWeb, shapeDateDigits, shapeTimeText, sideDockWidth, splitReference, stagedRead, stagedRequest, storageKeyOf, storageKind, storageValue, storedToTyped, styleParts, termsStamp, termsStorageKey, termsToConfirm, termsUrl, termsUser, testAction, testFieldKey, testFieldPath, testWrites, timeHourFormat, toggleMeridiem, toggleRecord, toolkitKeyboardActive, transformHandler, treeNode, treePaths, typedMeridiem, typedToStored, useDesignerLinks, useDraftSource, userRecord, usesTwelveHours, validTreePath, valueAt, visibleFields, whenOnline, withAppPagination, withUserRecord, withoutMarks, wrapperStyleOf };
18297
18351
  //# sourceMappingURL=yomotech-view-toolkit.mjs.map