@ship-ui/core 0.17.21 → 0.17.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/bin/mcp/index.js CHANGED
@@ -4,25 +4,43 @@ var __getProtoOf = Object.getPrototypeOf;
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ function __accessProp(key) {
8
+ return this[key];
9
+ }
10
+ var __toESMCache_node;
11
+ var __toESMCache_esm;
7
12
  var __toESM = (mod, isNodeMode, target) => {
13
+ var canCache = mod != null && typeof mod === "object";
14
+ if (canCache) {
15
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
16
+ var cached = cache.get(mod);
17
+ if (cached)
18
+ return cached;
19
+ }
8
20
  target = mod != null ? __create(__getProtoOf(mod)) : {};
9
21
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
10
22
  for (let key of __getOwnPropNames(mod))
11
23
  if (!__hasOwnProp.call(to, key))
12
24
  __defProp(to, key, {
13
- get: () => mod[key],
25
+ get: __accessProp.bind(mod, key),
14
26
  enumerable: true
15
27
  });
28
+ if (canCache)
29
+ cache.set(mod, to);
16
30
  return to;
17
31
  };
18
32
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
33
+ var __returnValue = (v) => v;
34
+ function __exportSetter(name, newValue) {
35
+ this[name] = __returnValue.bind(null, newValue);
36
+ }
19
37
  var __export = (target, all) => {
20
38
  for (var name in all)
21
39
  __defProp(target, name, {
22
40
  get: all[name],
23
41
  enumerable: true,
24
42
  configurable: true,
25
- set: (newValue) => all[name] = () => newValue
43
+ set: __exportSetter.bind(all, name)
26
44
  });
27
45
  };
28
46
 
@@ -2285,7 +2285,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
2285
2285
 
2286
2286
  class ShipDatepicker {
2287
2287
  constructor() {
2288
- this.#INIT_DATE = this.#getUTCDate(new Date());
2288
+ this.#INIT_DATE = new Date(new Date().setHours(0, 0, 0, 0));
2289
2289
  this.date = model(null, ...(ngDevMode ? [{ debugName: "date" }] : []));
2290
2290
  this.endDate = model(null, ...(ngDevMode ? [{ debugName: "endDate" }] : []));
2291
2291
  this.asRange = input(false, ...(ngDevMode ? [{ debugName: "asRange" }] : []));
@@ -2351,26 +2351,25 @@ class ShipDatepicker {
2351
2351
  });
2352
2352
  }
2353
2353
  #generateMonthDates(date, startOfWeek) {
2354
- const year = date.getUTCFullYear();
2355
- const month = date.getUTCMonth();
2356
- const firstDay = new Date(Date.UTC(year, month)).getUTCDay();
2357
- const daysInMonth = 32 - new Date(Date.UTC(year, month, 32)).getUTCDate();
2354
+ const year = date.getFullYear();
2355
+ const month = date.getMonth();
2356
+ const firstDay = new Date(year, month, 1).getDay();
2357
+ const daysInMonth = new Date(year, month + 1, 0).getDate();
2358
2358
  const dates = [];
2359
2359
  let offset = firstDay - startOfWeek;
2360
2360
  if (offset < 0) {
2361
2361
  offset += 7;
2362
2362
  }
2363
- const lastDayOfPrevMonth = new Date(Date.UTC(year, month, 0)).getUTCDate();
2363
+ const lastDayOfPrevMonth = new Date(year, month, 0).getDate();
2364
2364
  for (let i = offset - 1; i >= 0; i--) {
2365
- const prevMonthDate = new Date(Date.UTC(year, month - 1, lastDayOfPrevMonth - i));
2366
- dates.push(prevMonthDate);
2365
+ dates.push(new Date(year, month - 1, lastDayOfPrevMonth - i, 0, 0, 0, 0));
2367
2366
  }
2368
2367
  for (let i = 1; i <= daysInMonth; i++) {
2369
- dates.push(new Date(Date.UTC(year, month, i)));
2368
+ dates.push(new Date(year, month, i, 0, 0, 0, 0));
2370
2369
  }
2371
2370
  let nextMonthDay = 1;
2372
2371
  while (dates.length % 7 !== 0) {
2373
- dates.push(new Date(Date.UTC(year, month + 1, nextMonthDay++)));
2372
+ dates.push(new Date(year, month + 1, nextMonthDay++, 0, 0, 0, 0));
2374
2373
  }
2375
2374
  return dates;
2376
2375
  }
@@ -2392,11 +2391,11 @@ class ShipDatepicker {
2392
2391
  }
2393
2392
  setDate(newDate, selectedElement) {
2394
2393
  const createDateWithExistingTime = (newDate, existingDate) => {
2395
- const hours = existingDate?.getUTCHours() ?? 0;
2396
- const minutes = existingDate?.getUTCMinutes() ?? 0;
2397
- const seconds = existingDate?.getUTCSeconds() ?? 0;
2398
- const milliseconds = existingDate?.getUTCMilliseconds() ?? 0;
2399
- return this.#getUTCDate(new Date(Date.UTC(newDate.getUTCFullYear(), newDate.getUTCMonth(), newDate.getUTCDate(), hours, minutes, seconds, milliseconds)));
2394
+ const hours = existingDate?.getHours() ?? 0;
2395
+ const minutes = existingDate?.getMinutes() ?? 0;
2396
+ const seconds = existingDate?.getSeconds() ?? 0;
2397
+ const milliseconds = existingDate?.getMilliseconds() ?? 0;
2398
+ return new Date(newDate.getFullYear(), newDate.getMonth(), newDate.getDate(), hours, minutes, seconds, milliseconds);
2400
2399
  };
2401
2400
  if (!this.asRange()) {
2402
2401
  this.date.set(createDateWithExistingTime(newDate, this.date()));
@@ -2433,10 +2432,10 @@ class ShipDatepicker {
2433
2432
  if (startDate === null)
2434
2433
  return null;
2435
2434
  const startOfDay = (date) => {
2436
- return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), 0, 0, 0, 0));
2435
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0, 0);
2437
2436
  };
2438
2437
  const endOfDay = (date) => {
2439
- return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), 23, 59, 59, 999));
2438
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59, 999);
2440
2439
  };
2441
2440
  const currentDate = startOfDay(date);
2442
2441
  const rangeStart = startOfDay(startDate);
@@ -2457,7 +2456,7 @@ class ShipDatepicker {
2457
2456
  }
2458
2457
  if (currentDate >= rangeStart && currentDate <= rangeEnd) {
2459
2458
  classes.push('sel');
2460
- const dayOfWeek = currentDate.getUTCDay();
2459
+ const dayOfWeek = currentDate.getDay();
2461
2460
  const startOfWeek = this.startOfWeek();
2462
2461
  if (dayOfWeek === startOfWeek) {
2463
2462
  classes.push('week-start');
@@ -2468,11 +2467,11 @@ class ShipDatepicker {
2468
2467
  }
2469
2468
  }
2470
2469
  const nextDate = new Date(currentDate);
2471
- nextDate.setUTCDate(currentDate.getUTCDate() + 1);
2470
+ nextDate.setDate(currentDate.getDate() + 1);
2472
2471
  const prevDate = new Date(currentDate);
2473
- prevDate.setUTCDate(currentDate.getUTCDate() - 1);
2474
- const isFirstOfMonth = currentDate.getUTCDate() === 1;
2475
- const isLastOfMonth = nextDate.getUTCMonth() !== currentDate.getUTCMonth();
2472
+ prevDate.setDate(currentDate.getDate() - 1);
2473
+ const isFirstOfMonth = currentDate.getDate() === 1;
2474
+ const isLastOfMonth = nextDate.getMonth() !== currentDate.getMonth();
2476
2475
  if (isFirstOfMonth) {
2477
2476
  classes.push('month-start');
2478
2477
  }
@@ -2505,11 +2504,6 @@ class ShipDatepicker {
2505
2504
  const offsetDate = this.getOffsetDate(monthOffset);
2506
2505
  return date.getMonth() === offsetDate.getMonth();
2507
2506
  }
2508
- #getUTCDate(date) {
2509
- const offsetMinutes = date.getTimezoneOffset();
2510
- const timeDiffMillis = offsetMinutes * 60 * 1000;
2511
- return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()) + timeDiffMillis);
2512
- }
2513
2507
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: ShipDatepicker, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2514
2508
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.5", type: ShipDatepicker, isStandalone: true, selector: "sh-datepicker", inputs: { date: { classPropertyName: "date", publicName: "date", isSignal: true, isRequired: false, transformFunction: null }, endDate: { classPropertyName: "endDate", publicName: "endDate", isSignal: true, isRequired: false, transformFunction: null }, asRange: { classPropertyName: "asRange", publicName: "asRange", isSignal: true, isRequired: false, transformFunction: null }, monthsToShow: { classPropertyName: "monthsToShow", publicName: "monthsToShow", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, startOfWeek: { classPropertyName: "startOfWeek", publicName: "startOfWeek", isSignal: true, isRequired: false, transformFunction: null }, weekdayLabels: { classPropertyName: "weekdayLabels", publicName: "weekdayLabels", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { date: "dateChange", endDate: "endDateChange" }, host: { properties: { "class.as-range": "asRange()", "class": "\"columns-\" + monthsToShow()", "class.disabled": "disabled()" } }, viewQueries: [{ propertyName: "daysRef", first: true, predicate: ["daysRef"], descendants: true, isSignal: true }], ngImport: i0, template: `
2515
2509
  <header>
@@ -2916,32 +2910,31 @@ class ShipFormFieldPopover {
2916
2910
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.5", type: ShipFormFieldPopover, isStandalone: true, selector: "sh-form-field-popover", inputs: { isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isOpen: "isOpenChange", closed: "closed" }, host: { listeners: { "click": "onClick()" } }, ngImport: i0, template: `
2917
2911
  <ng-content select="label"></ng-content>
2918
2912
 
2919
- <div class="input-wrap">
2920
- <div class="prefix">
2921
- <ng-content select="[prefix]"></ng-content>
2922
- <ng-content select="[textPrefix]"></ng-content>
2923
- </div>
2924
-
2925
- <div class="prefix-space"></div>
2913
+ <sh-popover
2914
+ [(isOpen)]="isOpen"
2915
+ (closed)="close()"
2916
+ [options]="{
2917
+ closeOnButton: false,
2918
+ closeOnEsc: true,
2919
+ }">
2920
+ <div trigger class="input-wrap">
2921
+ <div class="prefix">
2922
+ <ng-content select="[prefix]"></ng-content>
2923
+ <ng-content select="[textPrefix]"></ng-content>
2924
+ </div>
2926
2925
 
2927
- <sh-popover
2928
- [(isOpen)]="isOpen"
2929
- (closed)="close()"
2930
- [options]="{
2931
- closeOnButton: false,
2932
- closeOnEsc: true,
2933
- }">
2934
- <ng-content trigger select="input"></ng-content>
2926
+ <div class="prefix-space"></div>
2935
2927
 
2936
- <ng-content select="[popoverContent]"></ng-content>
2937
- </sh-popover>
2928
+ <ng-content select="input"></ng-content>
2938
2929
 
2939
- <ng-content select="textarea"></ng-content>
2930
+ <ng-content select="textarea"></ng-content>
2940
2931
 
2941
- <ng-content select="[textSuffix]"></ng-content>
2942
- <div class="suffix-space"></div>
2943
- <ng-content select="[suffix]"></ng-content>
2944
- </div>
2932
+ <ng-content select="[textSuffix]"></ng-content>
2933
+ <div class="suffix-space"></div>
2934
+ <ng-content select="[suffix]"></ng-content>
2935
+ </div>
2936
+ <ng-content select="[popoverContent]"></ng-content>
2937
+ </sh-popover>
2945
2938
 
2946
2939
  <div class="helpers">
2947
2940
  <div class="error-wrap">
@@ -2962,32 +2955,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
2962
2955
  template: `
2963
2956
  <ng-content select="label"></ng-content>
2964
2957
 
2965
- <div class="input-wrap">
2966
- <div class="prefix">
2967
- <ng-content select="[prefix]"></ng-content>
2968
- <ng-content select="[textPrefix]"></ng-content>
2969
- </div>
2970
-
2971
- <div class="prefix-space"></div>
2958
+ <sh-popover
2959
+ [(isOpen)]="isOpen"
2960
+ (closed)="close()"
2961
+ [options]="{
2962
+ closeOnButton: false,
2963
+ closeOnEsc: true,
2964
+ }">
2965
+ <div trigger class="input-wrap">
2966
+ <div class="prefix">
2967
+ <ng-content select="[prefix]"></ng-content>
2968
+ <ng-content select="[textPrefix]"></ng-content>
2969
+ </div>
2972
2970
 
2973
- <sh-popover
2974
- [(isOpen)]="isOpen"
2975
- (closed)="close()"
2976
- [options]="{
2977
- closeOnButton: false,
2978
- closeOnEsc: true,
2979
- }">
2980
- <ng-content trigger select="input"></ng-content>
2971
+ <div class="prefix-space"></div>
2981
2972
 
2982
- <ng-content select="[popoverContent]"></ng-content>
2983
- </sh-popover>
2973
+ <ng-content select="input"></ng-content>
2984
2974
 
2985
- <ng-content select="textarea"></ng-content>
2975
+ <ng-content select="textarea"></ng-content>
2986
2976
 
2987
- <ng-content select="[textSuffix]"></ng-content>
2988
- <div class="suffix-space"></div>
2989
- <ng-content select="[suffix]"></ng-content>
2990
- </div>
2977
+ <ng-content select="[textSuffix]"></ng-content>
2978
+ <div class="suffix-space"></div>
2979
+ <ng-content select="[suffix]"></ng-content>
2980
+ </div>
2981
+ <ng-content select="[popoverContent]"></ng-content>
2982
+ </sh-popover>
2991
2983
 
2992
2984
  <div class="helpers">
2993
2985
  <div class="error-wrap">
@@ -3057,7 +3049,7 @@ class ShipDatepickerInput {
3057
3049
  return;
3058
3050
  this.#createCustomInputEventListener(input);
3059
3051
  input.addEventListener('inputValueChanged', (event) => {
3060
- this.internalDate.set(event.detail.value ? this.#getUTCDate(new Date(event.detail.value)) : null);
3052
+ this.internalDate.set(event.detail.value ? new Date(event.detail.value) : null);
3061
3053
  });
3062
3054
  input.addEventListener('focus', () => {
3063
3055
  this.isOpen.set(true);
@@ -3066,7 +3058,7 @@ class ShipDatepickerInput {
3066
3058
  this.#inputRef.set(input);
3067
3059
  input.autocomplete = 'off';
3068
3060
  if (typeof input.value === 'string') {
3069
- this.internalDate.set(input.value ? this.#getUTCDate(new Date(input.value)) : null);
3061
+ this.internalDate.set(input.value ? new Date(input.value) : null);
3070
3062
  }
3071
3063
  }, ...(ngDevMode ? [{ debugName: "#inputRefEffect" }] : []));
3072
3064
  }
@@ -3108,11 +3100,6 @@ class ShipDatepickerInput {
3108
3100
  });
3109
3101
  return input;
3110
3102
  }
3111
- #getUTCDate(date) {
3112
- const offsetMinutes = date.getTimezoneOffset();
3113
- const timeDiffMillis = offsetMinutes * 60 * 1000;
3114
- return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()) + timeDiffMillis);
3115
- }
3116
3103
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: ShipDatepickerInput, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3117
3104
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.5", type: ShipDatepickerInput, isStandalone: true, selector: "sh-datepicker-input", inputs: { masking: { classPropertyName: "masking", publicName: "masking", isSignal: true, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "closed", isOpen: "isOpenChange" }, providers: [DatePipe], queries: [{ propertyName: "ngModels", first: true, predicate: NgModel, descendants: true, isSignal: true }], ngImport: i0, template: `
3118
3105
  <sh-form-field-popover (closed)="close()" [(isOpen)]="isOpen">