@ship-ui/core 0.13.27 → 0.13.29

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.
@@ -33,6 +33,7 @@ const run = async (PROJECT_SRC, LIB_ICONS, PROJECT_PUBLIC, GLYPH_MAP, TARGET_FON
33
33
  }
34
34
 
35
35
  const tsFiles = await glob('**/*.ts', { cwd: PROJECT_SRC });
36
+
36
37
  for (const file of tsFiles) {
37
38
  const fileText = await fs.readFile(join(PROJECT_SRC, file), 'utf8');
38
39
  const matches = Array.from(fileText.matchAll(regex2), (m) => m[1]);
@@ -50,7 +51,8 @@ const run = async (PROJECT_SRC, LIB_ICONS, PROJECT_PUBLIC, GLYPH_MAP, TARGET_FON
50
51
  const thin = icon.endsWith('-thin');
51
52
  const light = icon.endsWith('-light');
52
53
  const fill = icon.endsWith('-fill');
53
- const regular = !bold && !thin && !light && !fill;
54
+ const duotone = icon.endsWith('-duotone');
55
+ const regular = !bold && !thin && !light && !fill && !duotone;
54
56
  const glyph = GLYPH_MAP[icon];
55
57
 
56
58
  if (!glyph) {
@@ -78,6 +80,10 @@ const run = async (PROJECT_SRC, LIB_ICONS, PROJECT_PUBLIC, GLYPH_MAP, TARGET_FON
78
80
  acc['regular'].push([icon, '']);
79
81
  acc['regular'].push(glyph);
80
82
  }
83
+ if (duotone) {
84
+ acc['duotone'].push([icon, '']);
85
+ acc['duotone'].push(glyph);
86
+ }
81
87
 
82
88
  return acc;
83
89
  },
@@ -87,6 +93,7 @@ const run = async (PROJECT_SRC, LIB_ICONS, PROJECT_PUBLIC, GLYPH_MAP, TARGET_FON
87
93
  light: [],
88
94
  fill: [],
89
95
  regular: [],
96
+ duotone: [],
90
97
  text: [],
91
98
  }
92
99
  );
@@ -239,7 +246,7 @@ const textMateSnippet = async (GLYPH_MAP) => {
239
246
  const iconsSnippetContent = `
240
247
  {
241
248
  "Phosphor icons": {
242
- "prefix": ["pp:icon"],
249
+ "prefix": ["shicon:"],
243
250
  "scope": "javascript,typescript,html",
244
251
  "body": "\${1|${Object.keys(GLYPH_MAP).join(',')}|}",
245
252
  "description": "Add a phosphor icon"
@@ -285,9 +292,11 @@ export const main = async (values) => {
285
292
  fontVariant,
286
293
  'selection.json'
287
294
  );
295
+
288
296
  const selectionJson = JSON.parse(await fs.readFile(selectionJsonFullPath, 'utf8'));
297
+ const unicodeObj = getUnicodeObject(selectionJson.icons, fontVariant === 'duotone');
289
298
 
290
- return getUnicodeObject(selectionJson.icons);
299
+ return unicodeObj;
291
300
  })
292
301
  );
293
302
 
@@ -60,7 +60,8 @@ const run = async (
60
60
  const thin = icon.endsWith('-thin');
61
61
  const light = icon.endsWith('-light');
62
62
  const fill = icon.endsWith('-fill');
63
- const regular = !bold && !thin && !light && !fill;
63
+ const duotone = icon.endsWith('-duotone');
64
+ const regular = !bold && !thin && !light && !fill && !duotone;
64
65
  const glyph = GLYPH_MAP[icon];
65
66
 
66
67
  if (!glyph) {
@@ -88,6 +89,10 @@ const run = async (
88
89
  acc['regular'].push([icon, '']);
89
90
  acc['regular'].push(glyph);
90
91
  }
92
+ if (duotone) {
93
+ acc['duotone'].push([icon, '']);
94
+ acc['duotone'].push(glyph);
95
+ }
91
96
 
92
97
  return acc;
93
98
  },
@@ -97,6 +102,7 @@ const run = async (
97
102
  light: [],
98
103
  fill: [],
99
104
  regular: [],
105
+ duotone: [],
100
106
  text: [],
101
107
  } as {
102
108
  [key: string]: [string, string][];
@@ -259,7 +265,7 @@ const textMateSnippet = async (GLYPH_MAP: Record<string, [string, string]>) => {
259
265
  const iconsSnippetContent = `
260
266
  {
261
267
  "Phosphor icons": {
262
- "prefix": ["pp:icon"],
268
+ "prefix": ["shicon:"],
263
269
  "scope": "javascript,typescript,html",
264
270
  "body": "\${1|${Object.keys(GLYPH_MAP).join(',')}|}",
265
271
  "description": "Add a phosphor icon"
@@ -298,11 +304,11 @@ export const main = async (values: InputArguments) => {
298
304
  fontVariant,
299
305
  'selection.json'
300
306
  );
307
+
301
308
  const selectionJson = await Bun.file(selectionJsonFullPath).json();
309
+ const unicodeObj = getUnicodeObject(selectionJson.icons, fontVariant === 'duotone');
302
310
 
303
- // return createCodepointObject(selectionJson.icons);
304
- // return createNameCodeObject(selectionJson.icons);
305
- return getUnicodeObject(selectionJson.icons);
311
+ return unicodeObj;
306
312
  })
307
313
  );
308
314
 
@@ -12,7 +12,7 @@ export function createNameCodeObject(jsonData) {
12
12
  return nameCodeObject;
13
13
  }
14
14
 
15
- export const getUnicodeObject = (jsonData) => {
15
+ export const getUnicodeObject = (jsonData, isDuotone) => {
16
16
  const nameCodeObject = {};
17
17
 
18
18
  for (let i = 0; i < jsonData.length; i++) {
@@ -24,7 +24,9 @@ export const getUnicodeObject = (jsonData) => {
24
24
  console.warn(`Invalid codepoint 0x${hexCode} for ligature ${item.properties.ligatures}`);
25
25
  continue;
26
26
  }
27
- nameCodeObject[item.properties.ligatures] = [glyph, 'U+' + hexCode];
27
+
28
+ const glyphName = isDuotone ? item.properties.name : item.properties.ligatures;
29
+ nameCodeObject[glyphName] = [glyph, 'U+' + hexCode];
28
30
  }
29
31
 
30
32
  return nameCodeObject;
@@ -12,7 +12,7 @@ export function createNameCodeObject(jsonData: Item[]): Record<string, string> {
12
12
  return nameCodeObject;
13
13
  }
14
14
 
15
- export const getUnicodeObject = (jsonData: Item[]): Record<string, [string, string]> => {
15
+ export const getUnicodeObject = (jsonData: Item[], isDuotone = false): Record<string, [string, string]> => {
16
16
  const nameCodeObject: Record<string, [string, string]> = {};
17
17
 
18
18
  for (let i = 0; i < jsonData.length; i++) {
@@ -24,7 +24,9 @@ export const getUnicodeObject = (jsonData: Item[]): Record<string, [string, stri
24
24
  console.warn(`Invalid codepoint 0x${hexCode} for ligature ${item.properties.ligatures}`);
25
25
  continue;
26
26
  }
27
- nameCodeObject[item.properties.ligatures] = [glyph, 'U+' + hexCode];
27
+
28
+ const glyphName = isDuotone ? item.properties.name : item.properties.ligatures;
29
+ nameCodeObject[glyphName] = [glyph, 'U+' + hexCode];
28
30
  }
29
31
 
30
32
  return nameCodeObject;
@@ -3,7 +3,7 @@ import { inject, ElementRef, Renderer2, ChangeDetectionStrategy, Component, inpu
3
3
  import { DatePipe, NgTemplateOutlet } from '@angular/common';
4
4
  import { SIGNAL } from '@angular/core/primitives/signals';
5
5
 
6
- const iconTypes = ['bold', 'thin', 'light', 'fill'];
6
+ const iconTypes = ['bold', 'thin', 'light', 'fill', 'duotone'];
7
7
  class ShipIconComponent {
8
8
  #selfRef = inject(ElementRef);
9
9
  #renderer = inject(Renderer2);
@@ -1977,6 +1977,38 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
1977
1977
  }]
1978
1978
  }] });
1979
1979
 
1980
+ class ShipEventCardComponent {
1981
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ShipEventCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1982
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: ShipEventCardComponent, isStandalone: true, selector: "sh-event-card", ngImport: i0, template: `
1983
+ <div class="content">
1984
+ <ng-content />
1985
+ </div>
1986
+
1987
+ <div class="actions">
1988
+ <ng-content select="[actions]" />
1989
+ <ng-content select="button" />
1990
+ </div>
1991
+ `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1992
+ }
1993
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ShipEventCardComponent, decorators: [{
1994
+ type: Component,
1995
+ args: [{
1996
+ selector: 'sh-event-card',
1997
+ imports: [],
1998
+ template: `
1999
+ <div class="content">
2000
+ <ng-content />
2001
+ </div>
2002
+
2003
+ <div class="actions">
2004
+ <ng-content select="[actions]" />
2005
+ <ng-content select="button" />
2006
+ </div>
2007
+ `,
2008
+ changeDetection: ChangeDetectionStrategy.OnPush,
2009
+ }]
2010
+ }] });
2011
+
1980
2012
  class ShipFormFieldComponent {
1981
2013
  #selfRef = inject(ElementRef);
1982
2014
  onClick() {
@@ -3966,7 +3998,7 @@ class ShipSidenavComponent {
3966
3998
  return dragPosition;
3967
3999
  }, ...(ngDevMode ? [{ debugName: "dragActualPositionX" }] : []));
3968
4000
  this.draggingStyle = computed(() => {
3969
- if (!this.isOverlay())
4001
+ if (!this.isOverlay() || this.disableDrag())
3970
4002
  return null;
3971
4003
  if (this.isDragging()) {
3972
4004
  return `translateX(${this.dragActualPositionX()}px)`;
@@ -3974,7 +4006,7 @@ class ShipSidenavComponent {
3974
4006
  return this.isOpen() ? `translateX(${this.openWidth}px)` : `translateX(0px)`;
3975
4007
  }, ...(ngDevMode ? [{ debugName: "draggingStyle" }] : []));
3976
4008
  this.draggingEffect = effect(() => {
3977
- if (typeof document === 'undefined')
4009
+ if (typeof document === 'undefined' || this.disableDrag())
3978
4010
  return;
3979
4011
  if (this.isDragging()) {
3980
4012
  document.body.classList.add('dragging');
@@ -4049,7 +4081,7 @@ class ShipSidenavComponent {
4049
4081
  }
4050
4082
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ShipSidenavComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4051
4083
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: ShipSidenavComponent, isStandalone: true, selector: "sh-sidenav", inputs: { disableDrag: { classPropertyName: "disableDrag", publicName: "disableDrag", isSignal: true, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isOpen: "isOpenChange" }, host: { properties: { "class.open": "isOpen()", "class.closed": "!isOpen()", "class.is-dragging": "isDragging()" } }, viewQueries: [{ propertyName: "dragImageElement", first: true, predicate: ["dragImageElement"], descendants: true, isSignal: true }], ngImport: i0, template: `
4052
- @if (isOverlay()) {
4084
+ @if (isOverlay() && !disableDrag()) {
4053
4085
  <div #dragImageElement class="drag-image"></div>
4054
4086
  }
4055
4087
 
@@ -4061,7 +4093,7 @@ class ShipSidenavComponent {
4061
4093
  <ng-content select="[sidenav]"></ng-content>
4062
4094
  </div>
4063
4095
 
4064
- <div class="main-wrap" [style.transform]="draggingStyle()">
4096
+ <div class="main-wrap" [style.transform]="!disableDrag() && draggingStyle()">
4065
4097
  @if (isOverlay() && !disableDrag()) {
4066
4098
  <div
4067
4099
  class="dragable"
@@ -4090,7 +4122,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
4090
4122
  args: [{
4091
4123
  selector: 'sh-sidenav',
4092
4124
  template: `
4093
- @if (isOverlay()) {
4125
+ @if (isOverlay() && !disableDrag()) {
4094
4126
  <div #dragImageElement class="drag-image"></div>
4095
4127
  }
4096
4128
 
@@ -4102,7 +4134,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
4102
4134
  <ng-content select="[sidenav]"></ng-content>
4103
4135
  </div>
4104
4136
 
4105
- <div class="main-wrap" [style.transform]="draggingStyle()">
4137
+ <div class="main-wrap" [style.transform]="!disableDrag() && draggingStyle()">
4106
4138
  @if (isOverlay() && !disableDrag()) {
4107
4139
  <div
4108
4140
  class="dragable"
@@ -5533,5 +5565,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
5533
5565
  * Generated bundle index. Do not edit.
5534
5566
  */
5535
5567
 
5536
- export { GridSortableDirective, SHIP_CONFIG, ShipAlertComponent, ShipAlertContainerComponent, ShipAlertModule, ShipAlertService, ShipButtonComponent, ShipButtonGroupComponent, ShipCardComponent, ShipCheckboxComponent, ShipChipComponent, ShipColorPickerComponent, ShipDatepickerComponent, ShipDatepickerInputComponent, ShipDaterangeInputComponent, ShipDialogComponent, ShipDialogService, ShipDividerComponent, ShipFileDragDropDirective, ShipFileUploadComponent, ShipFormFieldComponent, ShipIconComponent, ShipListComponent, ShipMenuComponent, ShipPopoverComponent, ShipPreventWheelDirective, ShipProgressBarComponent, ShipRadioComponent, ShipRangeSliderComponent, ShipResizeDirective, ShipSelectComponent, ShipSidenavComponent, ShipSortDirective, ShipSortableComponent, ShipSortableDirective, ShipSpinnerComponent, ShipStepperComponent, ShipStickyColumnsDirective, ShipStickyRowsDirective, ShipTableComponent, ShipTabsComponent, ShipToggleCardComponent, ShipToggleComponent, ShipTooltipComponent, ShipTooltipDirective, ShipTooltipWrapper, ShipVirtualScrollComponent, moveIndex, watchHostClass };
5568
+ export { GridSortableDirective, SHIP_CONFIG, ShipAlertComponent, ShipAlertContainerComponent, ShipAlertModule, ShipAlertService, ShipButtonComponent, ShipButtonGroupComponent, ShipCardComponent, ShipCheckboxComponent, ShipChipComponent, ShipColorPickerComponent, ShipDatepickerComponent, ShipDatepickerInputComponent, ShipDaterangeInputComponent, ShipDialogComponent, ShipDialogService, ShipDividerComponent, ShipEventCardComponent, ShipFileDragDropDirective, ShipFileUploadComponent, ShipFormFieldComponent, ShipIconComponent, ShipListComponent, ShipMenuComponent, ShipPopoverComponent, ShipPreventWheelDirective, ShipProgressBarComponent, ShipRadioComponent, ShipRangeSliderComponent, ShipResizeDirective, ShipSelectComponent, ShipSidenavComponent, ShipSortDirective, ShipSortableComponent, ShipSortableDirective, ShipSpinnerComponent, ShipStepperComponent, ShipStickyColumnsDirective, ShipStickyRowsDirective, ShipTableComponent, ShipTabsComponent, ShipToggleCardComponent, ShipToggleComponent, ShipTooltipComponent, ShipTooltipDirective, ShipTooltipWrapper, ShipVirtualScrollComponent, moveIndex, watchHostClass };
5537
5569
  //# sourceMappingURL=ship-ui-core.mjs.map