@3dsource/source-ui 2.0.0 → 2.1.0

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/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import { TemplateRef, ViewContainerRef, ElementRef, OnInit, OnDestroy, InjectionToken } from '@angular/core';
3
+ import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
3
4
  import { SourceButton } from '@3dsource/source-ui-native';
5
+ import { HttpClient } from '@angular/common/http';
4
6
  import * as _3dsource_source_ui from '@3dsource/source-ui';
5
7
  import { CdkOverlayOrigin, ConnectedPosition, OverlayRef, HorizontalConnectionPos, VerticalConnectionPos } from '@angular/cdk/overlay';
6
8
  import { SwiperOptions } from 'swiper/types';
@@ -11,14 +13,29 @@ declare const SourceModalSize: {
11
13
  };
12
14
  type SourceModalSizeKeys = (typeof SourceModalSize)[keyof typeof SourceModalSize];
13
15
 
16
+ declare const sourceModalIcon: {
17
+ name: string;
18
+ svg: string;
19
+ }[];
20
+
21
+ declare const SourceModalType: {
22
+ readonly DEFAULT: "default";
23
+ readonly INFO: "info";
24
+ readonly SUCCESS: "success";
25
+ readonly WARNING: "warning";
26
+ readonly ERROR: "error";
27
+ };
28
+ type SourceModalTypeKeys = (typeof SourceModalType)[keyof typeof SourceModalType];
29
+
14
30
  interface SourceModalData {
15
31
  headerTitle?: string;
16
32
  size?: SourceModalSizeKeys;
17
33
  backButton?: boolean;
34
+ type?: SourceModalTypeKeys;
18
35
  closeButton?: boolean;
19
36
  content?: string;
20
37
  componentData?: unknown;
21
- footerButtons?: DialogButtonsData;
38
+ footerButtons?: DialogButtonsData | DialogButtonsData[];
22
39
  testID?: string;
23
40
  [key: string]: unknown;
24
41
  }
@@ -32,12 +49,19 @@ type DialogButtonsData = DialogButtonData[];
32
49
  declare class SourceModalComponent {
33
50
  #private;
34
51
  readonly data: SourceModalData;
52
+ http: HttpClient;
53
+ sanitizer: DomSanitizer;
35
54
  size: _angular_core.WritableSignal<string>;
55
+ type: _angular_core.WritableSignal<SourceModalTypeKeys>;
36
56
  testID: _angular_core.WritableSignal<string>;
37
57
  stringContent: _angular_core.WritableSignal<string | null>;
38
58
  close(result?: any): void;
39
59
  goBack(): void;
60
+ isArrayOfArrays(footerButtons: DialogButtonsData | DialogButtonsData[]): footerButtons is DialogButtonsData[];
40
61
  getButtonConfig(externalConfig: Partial<SourceButton> | undefined): SourceButton;
62
+ getSingleButtonArray(footerButtons: DialogButtonsData | DialogButtonsData[]): DialogButtonsData;
63
+ getIconSvg(iconName: string): SafeHtml;
64
+ hasIcon(): boolean;
41
65
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SourceModalComponent, never>;
42
66
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<SourceModalComponent, "src-modal", never, {}, {}, never, never, true, never>;
43
67
  }
@@ -120,10 +144,11 @@ declare class SourceTabLineComponent {
120
144
  tabs: _angular_core.InputSignal<any[]>;
121
145
  label: _angular_core.InputSignal<string>;
122
146
  selectedIndex: _angular_core.InputSignal<number>;
147
+ tabStyle: _angular_core.InputSignal<string>;
123
148
  isCompact: _angular_core.InputSignal<boolean>;
124
- offsetBefore: _angular_core.InputSignal<number>;
125
- offsetAfter: _angular_core.InputSignal<number>;
126
- spaceBetween: _angular_core.InputSignal<number>;
149
+ offsetBefore: _angular_core.InputSignal<number | undefined>;
150
+ offsetAfter: _angular_core.InputSignal<number | undefined>;
151
+ spaceBetween: _angular_core.InputSignal<number | undefined>;
127
152
  isFullWidth: _angular_core.InputSignal<boolean>;
128
153
  isSwiper: _angular_core.InputSignal<boolean>;
129
154
  testID: _angular_core.InputSignal<string>;
@@ -137,9 +162,15 @@ declare class SourceTabLineComponent {
137
162
  _: _angular_core.EffectRef;
138
163
  selectTab(tabIndex: number): void;
139
164
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SourceTabLineComponent, never>;
140
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SourceTabLineComponent, "src-tab-line", never, { "tabs": { "alias": "tabs"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; "selectedIndex": { "alias": "selectedIndex"; "required": false; "isSignal": true; }; "isCompact": { "alias": "isCompact"; "required": false; "isSignal": true; }; "offsetBefore": { "alias": "offsetBefore"; "required": false; "isSignal": true; }; "offsetAfter": { "alias": "offsetAfter"; "required": false; "isSignal": true; }; "spaceBetween": { "alias": "spaceBetween"; "required": false; "isSignal": true; }; "isFullWidth": { "alias": "isFullWidth"; "required": false; "isSignal": true; }; "isSwiper": { "alias": "isSwiper"; "required": false; "isSignal": true; }; "testID": { "alias": "data-testid"; "required": false; "isSignal": true; }; }, { "onSelectTab": "onSelectTab"; }, never, never, true, never>;
165
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SourceTabLineComponent, "src-tab-line", never, { "tabs": { "alias": "tabs"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; "selectedIndex": { "alias": "selectedIndex"; "required": false; "isSignal": true; }; "tabStyle": { "alias": "tabStyle"; "required": false; "isSignal": true; }; "isCompact": { "alias": "isCompact"; "required": false; "isSignal": true; }; "offsetBefore": { "alias": "offsetBefore"; "required": false; "isSignal": true; }; "offsetAfter": { "alias": "offsetAfter"; "required": false; "isSignal": true; }; "spaceBetween": { "alias": "spaceBetween"; "required": false; "isSignal": true; }; "isFullWidth": { "alias": "isFullWidth"; "required": false; "isSignal": true; }; "isSwiper": { "alias": "isSwiper"; "required": false; "isSignal": true; }; "testID": { "alias": "data-testid"; "required": false; "isSignal": true; }; }, { "onSelectTab": "onSelectTab"; }, never, never, true, never>;
141
166
  }
142
167
 
168
+ declare const SourceTabStyle: {
169
+ DEFAULT: string;
170
+ BUTTON: string;
171
+ };
172
+ type SourceTabStyleKeys = (typeof SourceTabStyle)[keyof typeof SourceTabStyle];
173
+
143
174
  interface SourceTabData {
144
175
  title: string;
145
176
  data: any;
@@ -333,5 +364,5 @@ declare class SourceSliderGroupComponent implements OnInit {
333
364
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<SourceSliderGroupComponent, "src-slider-group", never, { "min": { "alias": "min"; "required": true; "isSignal": true; }; "max": { "alias": "max"; "required": true; "isSignal": true; }; "value": { "alias": "value"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "step": { "alias": "step"; "required": false; "isSignal": true; }; "units": { "alias": "units"; "required": false; "isSignal": true; }; "showTicks": { "alias": "showTicks"; "required": false; "isSignal": true; }; "showRange": { "alias": "showRange"; "required": false; "isSignal": true; }; "isDisabled": { "alias": "isDisabled"; "required": false; "isSignal": true; }; "testID": { "alias": "data-testid"; "required": false; "isSignal": true; }; }, { "groupValueChange": "groupValueChange"; }, never, never, true, never>;
334
365
  }
335
366
 
336
- export { ColorPaletteComponent, ColorSliderComponent, SOURCE_TOOLTIP_DATA, SourceColorPickerComponent, SourceColorPickerOrientation, SourceModalComponent, SourceModalSize, SourcePopoverComponent, SourcePopoverService, SourcePopoverTriggerComponent, SourceSliderGroupComponent, SourceTabComponent, SourceTabLineComponent, SourceTabsComponent, SourceTooltipComponent, SourceTooltipDirective, SourceTooltipPosition, defaultSourcePopoverConfig };
337
- export type { DialogButtonData, DialogButtonsData, SourceColorPickerOrientationKeys, SourceModalData, SourceModalSizeKeys, SourcePopoverData, SourceTabData, SourceTooltipData, SourceTooltipPositionKeys };
367
+ export { ColorPaletteComponent, ColorSliderComponent, SOURCE_TOOLTIP_DATA, SourceColorPickerComponent, SourceColorPickerOrientation, SourceModalComponent, SourceModalSize, SourceModalType, SourcePopoverComponent, SourcePopoverService, SourcePopoverTriggerComponent, SourceSliderGroupComponent, SourceTabComponent, SourceTabLineComponent, SourceTabStyle, SourceTabsComponent, SourceTooltipComponent, SourceTooltipDirective, SourceTooltipPosition, defaultSourcePopoverConfig, sourceModalIcon };
368
+ export type { DialogButtonData, DialogButtonsData, SourceColorPickerOrientationKeys, SourceModalData, SourceModalSizeKeys, SourceModalTypeKeys, SourcePopoverData, SourceTabData, SourceTabStyleKeys, SourceTooltipData, SourceTooltipPositionKeys };
package/index.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sources":["../../../projects/3dsource/source-ui/src/lib/components/source-modal/constants/sourceModalSize.const.ts","../../../projects/3dsource/source-ui/src/lib/components/source-modal/constants/sourceModalIcon.const.ts","../../../projects/3dsource/source-ui/src/lib/components/source-modal/constants/sourceModalType.const.ts","../../../projects/3dsource/source-ui/src/lib/components/source-modal/interfaces/sourceModalData.interface.ts","../../../projects/3dsource/source-ui/src/lib/components/source-modal/components/source-modal.component.ts","../../../projects/3dsource/source-ui/src/lib/components/source-popover/components/source-popover.component.ts","../../../projects/3dsource/source-ui/src/lib/components/source-popover/components/source-popover-trigger.component.ts","../../../projects/3dsource/source-ui/src/lib/components/source-popover/interfaces/sourcePopoverData.interface.ts","../../../projects/3dsource/source-ui/src/lib/components/source-popover/interfaces/defaultSourcePopover.config.ts","../../../projects/3dsource/source-ui/src/lib/components/source-popover/services/sourcePopover.service.ts","../../../projects/3dsource/source-ui/src/lib/components/source-tab-line/components/source-tab-line.component.ts","../../../projects/3dsource/source-ui/src/lib/components/source-tab-line/constants/sourceTabStyle.const.ts","../../../projects/3dsource/source-ui/src/lib/components/source-tabs/interfaces/sourceTabData.interface.ts","../../../projects/3dsource/source-ui/src/lib/components/source-tabs/components/source-tabs/source-tabs.component.ts","../../../projects/3dsource/source-ui/src/lib/components/source-tabs/components/source-tab/source-tab.component.ts","../../../projects/3dsource/source-ui/src/lib/components/source-tooltip/components/source-tooltip.component.ts","../../../projects/3dsource/source-ui/src/lib/components/source-tooltip/interfaces/source-tooltip.interface.ts","../../../projects/3dsource/source-ui/src/lib/components/source-tooltip/directives/source-tooltip.directive.ts","../../../projects/3dsource/source-ui/src/lib/components/source-tooltip/tokens/sourceTooltipDataToken.ts","../../../projects/3dsource/source-ui/src/lib/components/source-color-picker/interfaces/source-color-picker.interface.ts","../../../projects/3dsource/source-ui/src/lib/components/source-color-picker/components/container/source-color-picker.component.ts","../../../projects/3dsource/source-ui/src/lib/components/source-color-picker/components/color-slider/color-slider.component.ts","../../../projects/3dsource/source-ui/src/lib/components/source-color-picker/components/color-palette/color-palette.component.ts","../../../projects/3dsource/source-ui/src/lib/components/source-slider-group/components/source-slider-group.component.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":[],"mappings":";;;;;;;;;AAAA;;;;AAIM;;ACIN;;;;;ACRA;;;;;;;AAQM;;;;;;;;;;ACGJ;;AAGA;AACD;;AAGC;;;AAGD;AAEK;;ACCN;;AAcE;AACA;AACA;AACA;AACA;AAEA;AACA;AAKA;;;;;AAiCA;AAMA;;;AAMD;;AClFD;;;AAUE;AAKA;;;;;AAUD;;AChBD;;AASE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAiBA;AACA;AACA;AACA;AAIA;;;;AA6CD;;;ACvGC;;;;;;;;;;;;;;AAgBM;;AAED;;;;;AAKL;AACD;;AC3BD;;ACgBA;;;AASE;;;;;AAoGD;;AC9GD;AAUE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAOA;AAIA;AAGA;AAGA;AAEA;;;;AAoBD;;ACrFD;;;;AAIM;;;;;;ACAJ;AACD;;ACSD;AAQE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AAKD;;AC7BD;AAQE;;;AACD;;ACND;;AAWE;AAIA;;;AAGD;;AC1BD;;;;;;AAOM;;;;;;;AASL;;ACOD;AAIE;AACA;AACA;AACA;AACA;AACA;;;;;;;;AAWA;;;;;;AAyDA;AAaA;AAiBA;AAwBA;AASA;;;AAOD;;ACzKD;;ACHA;;;;AAKM;;ACWN;AASE;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;;;;;;;AAyBD;;AC1CD;;AAQE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AAC0C;AAC1C;AACA;AACA;AAEA;AAoBA;;;;;AAgCA;AAcA;AAmBA;AAcA;AASA;;;AAWD;;AC7ID;;AAQE;AAEA;AACA;AACA;AACA;AACA;;;;AAC0C;AAC1C;AACA;AACA;AAEA;AAYA;;;;;AAgCA;AASA;AAaA;AAeA;AASA;;;AAWD;;AC9HD;AASE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;;;;;;;AA8BD;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@3dsource/source-ui",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "A bunch of ui elements with angular",
5
5
  "keywords": [
6
6
  "3dsource",
File without changes
File without changes
@@ -178,9 +178,15 @@
178
178
  font-weight: 500;
179
179
  line-height: var(--src-text-lineHeight, var(--src-font-line-sm));
180
180
  letter-spacing: 0;
181
+
182
+ .mdc-text-field__input {
183
+ white-space: nowrap;
184
+ text-overflow: ellipsis;
185
+ }
181
186
  }
182
187
 
183
188
  .mat-mdc-form-field-infix {
189
+ width: auto;
184
190
  --mat-form-field-container-vertical-padding: var(
185
191
  --src-padding-xs,
186
192
  var(--src-space-2)
@@ -239,17 +245,31 @@
239
245
 
240
246
  // Slot for label inside form field
241
247
  .mat-mdc-form-field-text-prefix {
248
+ display: flex;
249
+ align-items: center;
242
250
  label {
243
251
  padding-right: var(--src-gap-md, 6px);
244
252
  white-space: nowrap;
253
+ display: flex;
254
+ color: var(--src-text-body-lable, #6b7280);
255
+
256
+ /* label/basic/base */
257
+ font-family: var(--src-font-family-header, Inter);
258
+ font-size: var(--src-text-fontSize, 12px);
259
+ font-style: normal;
260
+ font-weight: 500;
261
+ line-height: var(--src-text-lineHeight, 16px); /* 133.333% */
245
262
  }
246
263
  }
247
264
  // Slots for icons and buttons
248
-
265
+ .mat-mdc-form-field-flex {
266
+ align-items: center;
267
+ }
249
268
  .mat-mdc-form-field-has-icon-prefix,
250
269
  .mat-mdc-form-field-has-icon-suffix {
251
270
  .mat-mdc-form-field-flex {
252
271
  display: grid;
272
+ align-items: center;
253
273
  grid-template-columns: var(--formFieldWithIconsGrid);
254
274
  gap: 0;
255
275
  color: var(--src-icon-grey);
@@ -271,15 +291,15 @@
271
291
  justify-content: center;
272
292
  }
273
293
  }
274
-
275
- .mat-mdc-form-field-has-icon-prefix {
276
- --formFieldWithIconsGrid: auto minmax(0, 1fr);
277
- }
278
-
279
- .mat-mdc-form-field-has-icon-suffix {
280
- --formFieldWithIconsGrid: minmax(0, 1fr) auto;
281
- }
282
-
283
- .mat-mdc-form-field-has-icon-prefix.mat-mdc-form-field-has-icon-suffix {
284
- --formFieldWithIconsGrid: auto minmax(0, 1fr) auto;
294
+ // Align both prefix and suffix for textPrefix and icon slots
295
+ .mat-mdc-form-field-flex {
296
+ &:has([class*='-prefix']) {
297
+ --formFieldWithIconsGrid: auto minmax(0, 1fr);
298
+ }
299
+ &:has([class*='-suffix']) {
300
+ --formFieldWithIconsGrid: minmax(0, 1fr) auto;
301
+ }
302
+ &:has([class*='-prefix']):has([class*='-suffix']) {
303
+ --formFieldWithIconsGrid: auto minmax(0, 1fr) auto;
304
+ }
285
305
  }
File without changes
@@ -53,18 +53,39 @@
53
53
  #c5280c
54
54
  );
55
55
  }
56
- }
57
56
 
58
- .mat-mdc-select-trigger .mat-mdc-select-arrow-wrapper {
59
- height: initial;
57
+ .mat-mdc-select-trigger {
58
+ display: grid;
59
+ grid-template-columns: minmax(0, 1fr) auto;
60
+ .mat-mdc-select-arrow-wrapper {
61
+ height: initial;
62
+ }
63
+ }
60
64
  }
61
65
 
62
66
  // Custom additional styling for select panel
67
+
63
68
  .src-select-panel {
64
69
  height: 100%;
65
70
  display: flex;
66
71
  flex-direction: column;
67
72
  align-items: flex-start;
73
+
74
+ scrollbar-color: rgba(148, 163, 184, 0.16) transparent;
75
+ scrollbar-width: thin;
76
+
77
+ &::-webkit-scrollbar {
78
+ width: 4px;
79
+ }
80
+
81
+ &::-webkit-scrollbar-track {
82
+ background-color: transparent;
83
+ }
84
+
85
+ &::-webkit-scrollbar-thumb {
86
+ background-color: rgba(148, 163, 184, 0.16);
87
+ outline: none;
88
+ }
68
89
  }
69
90
  .src-select-panel__header,
70
91
  .src-panel__footer {
@@ -76,6 +97,7 @@
76
97
  max-height: 100%;
77
98
  width: 100%;
78
99
  overflow-y: auto;
100
+ scrollbar-gutter: stable;
79
101
  scrollbar-color: var(--src-color-border-strong)
80
102
  var(--src-color-border-default);
81
103
  scrollbar-width: thin;
File without changes
@@ -13,6 +13,7 @@
13
13
  track-outline-width: 1px,
14
14
  selected-track-outline-width: 0,
15
15
  disabled-unselected-track-outline-width: 0,
16
+
16
17
  track-outline-color: var(--src-border-input-basic, #d1d5db),
17
18
  handle-shape: var(--src-border-rounded-full, 9999px),
18
19
  track-shape: var(--src-border-rounded-full, 9999px),
@@ -43,7 +44,11 @@
43
44
  with-icon-handle-size: 20px,
44
45
  pressed-handle-size: 20px,
45
46
  selected-handle-size: 20px,
46
-
47
+ disabled-track-opacity: 1,
48
+ disabled-selected-handle-opacity: 1,
49
+ disabled-unselected-handle-opacity: 1,
50
+ disabled-unselected-icon-opacity: 1,
51
+ disabled-selected-icon-opacity: 1,
47
52
  selected-handle-color: var(--src-surface-container-main, #fff),
48
53
  selected-focus-handle-color: var(--src-surface-container-main, #fff),
49
54
  selected-hover-handle-color: var(--src-surface-container-main, #fff),
@@ -56,6 +61,8 @@
56
61
  --src-surface-bg,
57
62
  rgba(71, 85, 105, 0.24)
58
63
  ),
64
+ disabled-unselected-handle-color: var(--src-surface-container-main, #fff),
65
+ disabled-selected-handle-color: var(--src-surface-container-main, #fff),
59
66
  unselected-with-icon-handle-horizontal-margin: 0 2px,
60
67
  selected-with-icon-handle-horizontal-margin: 0 22px,
61
68
  handle-elevation-shadow: var(--matToggleShadow),
@@ -76,7 +83,7 @@
76
83
  font-weight: 500;
77
84
  }
78
85
  }
79
- .mat-internal-form-field {
86
+ .mdc-form-field.mat-internal-form-field {
80
87
  & > label {
81
88
  padding-left: var(--src-gap-lg, var(--src-space-3));
82
89
  }
@@ -103,3 +110,11 @@
103
110
  .mdc-switch__ripple::after {
104
111
  display: none !important;
105
112
  }
113
+
114
+ .mat-mdc-slide-toggle.src-toggle--size-sm {
115
+ --mat-slide-toggle-track-width: 36px;
116
+ --mat-slide-toggle-track-height: 20px;
117
+ --mat-slide-toggle-with-icon-handle-size: 16px;
118
+ --mat-slide-toggle-pressed-handle-size: 16px;
119
+ --mat-slide-toggle-selected-with-icon-handle-horizontal-margin: 0 18px;
120
+ }
File without changes
File without changes