@latitude-ui/widgets 0.0.21 → 0.0.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.
Files changed (74) hide show
  1. package/README.md +7 -7
  2. package/button/README.md +2 -2
  3. package/checkbox/README.md +3 -0
  4. package/fesm2022/latitude-widgets-button.mjs +96 -0
  5. package/fesm2022/latitude-widgets-button.mjs.map +1 -0
  6. package/fesm2022/{latitude-ui-widgets-checkbox.mjs → latitude-widgets-checkbox.mjs} +6 -6
  7. package/fesm2022/latitude-widgets-checkbox.mjs.map +1 -0
  8. package/fesm2022/{latitude-ui-widgets-icons.mjs → latitude-widgets-icon.mjs} +45 -49
  9. package/fesm2022/latitude-widgets-icon.mjs.map +1 -0
  10. package/fesm2022/{latitude-ui-widgets-input.mjs → latitude-widgets-input.mjs} +67 -109
  11. package/fesm2022/latitude-widgets-input.mjs.map +1 -0
  12. package/fesm2022/{latitude-ui-widgets-listbox.mjs → latitude-widgets-listbox.mjs} +25 -30
  13. package/fesm2022/latitude-widgets-listbox.mjs.map +1 -0
  14. package/fesm2022/{latitude-ui-widgets-select.mjs → latitude-widgets-select.mjs} +67 -73
  15. package/fesm2022/latitude-widgets-select.mjs.map +1 -0
  16. package/fesm2022/{latitude-ui-widgets-switch.mjs → latitude-widgets-switch.mjs} +5 -5
  17. package/fesm2022/latitude-widgets-switch.mjs.map +1 -0
  18. package/fesm2022/latitude-widgets-textbox-date.mjs +30 -0
  19. package/fesm2022/latitude-widgets-textbox-date.mjs.map +1 -0
  20. package/fesm2022/{latitude-ui-widgets-textbox-number.mjs → latitude-widgets-textbox-number.mjs} +50 -58
  21. package/fesm2022/latitude-widgets-textbox-number.mjs.map +1 -0
  22. package/fesm2022/{latitude-ui-widgets-textbox.mjs → latitude-widgets-textbox.mjs} +17 -17
  23. package/fesm2022/latitude-widgets-textbox.mjs.map +1 -0
  24. package/fesm2022/{latitude-ui-widgets.mjs → latitude-widgets.mjs} +1 -1
  25. package/fesm2022/latitude-widgets.mjs.map +1 -0
  26. package/icon/README.md +3 -0
  27. package/input/README.md +2 -2
  28. package/listbox/README.md +3 -0
  29. package/package.json +34 -54
  30. package/select/README.md +3 -0
  31. package/switch/README.md +3 -0
  32. package/textbox/README.md +3 -0
  33. package/textbox-date/README.md +3 -0
  34. package/textbox-number/README.md +3 -0
  35. package/types/latitude-widgets-button.d.ts +29 -0
  36. package/{checkbox/index.d.ts → types/latitude-widgets-checkbox.d.ts} +1 -1
  37. package/types/latitude-widgets-icon.d.ts +44 -0
  38. package/{input/index.d.ts → types/latitude-widgets-input.d.ts} +6 -32
  39. package/{listbox/index.d.ts → types/latitude-widgets-listbox.d.ts} +6 -8
  40. package/{select/index.d.ts → types/latitude-widgets-select.d.ts} +2 -4
  41. package/{switch/index.d.ts → types/latitude-widgets-switch.d.ts} +1 -1
  42. package/types/latitude-widgets-textbox-date.d.ts +9 -0
  43. package/{textbox-number/index.d.ts → types/latitude-widgets-textbox-number.d.ts} +11 -8
  44. package/{textbox/index.d.ts → types/latitude-widgets-textbox.d.ts} +6 -6
  45. package/button/index.d.ts +0 -19
  46. package/core/README.md +0 -3
  47. package/core/index.d.ts +0 -39
  48. package/fesm2022/latitude-ui-widgets-button.mjs +0 -51
  49. package/fesm2022/latitude-ui-widgets-button.mjs.map +0 -1
  50. package/fesm2022/latitude-ui-widgets-checkbox.mjs.map +0 -1
  51. package/fesm2022/latitude-ui-widgets-core.mjs +0 -116
  52. package/fesm2022/latitude-ui-widgets-core.mjs.map +0 -1
  53. package/fesm2022/latitude-ui-widgets-icons.mjs.map +0 -1
  54. package/fesm2022/latitude-ui-widgets-input.mjs.map +0 -1
  55. package/fesm2022/latitude-ui-widgets-listbox.mjs.map +0 -1
  56. package/fesm2022/latitude-ui-widgets-select.mjs.map +0 -1
  57. package/fesm2022/latitude-ui-widgets-switch.mjs.map +0 -1
  58. package/fesm2022/latitude-ui-widgets-textbox-number.mjs.map +0 -1
  59. package/fesm2022/latitude-ui-widgets-textbox.mjs.map +0 -1
  60. package/fesm2022/latitude-ui-widgets-toolbar.mjs +0 -20
  61. package/fesm2022/latitude-ui-widgets-toolbar.mjs.map +0 -1
  62. package/fesm2022/latitude-ui-widgets.mjs.map +0 -1
  63. package/icons/index.d.ts +0 -19
  64. package/styles/_colors.scss +0 -99
  65. package/styles/_defaults.scss +0 -135
  66. package/styles/_index.scss +0 -11
  67. package/styles/_typography.scss +0 -37
  68. package/styles/button/_index.scss +0 -199
  69. package/styles/forms/_index.scss +0 -888
  70. package/styles/icons/_index.scss +0 -34
  71. package/styles/list/_index.scss +0 -0
  72. package/styles/listbox/_index.scss +0 -30
  73. package/toolbar/index.d.ts +0 -8
  74. /package/{index.d.ts → types/latitude-widgets.d.ts} +0 -0
@@ -1,41 +1,23 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ChangeDetectionStrategy, ViewEncapsulation, Component, input, numberAttribute, computed, effect, forwardRef } from '@angular/core';
2
+ import { input, numberAttribute, computed, effect, forwardRef, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
3
3
  import { Maskito, maskitoInitialCalibrationPlugin } from '@maskito/core';
4
4
  import { maskitoNumberOptionsGenerator, maskitoStringifyNumber, maskitoParseNumber } from '@maskito/kit';
5
- import { BuildInInputValueAccessor } from '@latitude-ui/widgets/input';
6
- import { TextBoxDirective } from '@latitude-ui/widgets/textbox';
7
- import { ButtonComponent } from '@latitude-ui/widgets/button';
8
- import { IconComponent } from '@latitude-ui/widgets/icons';
5
+ import { BuildInInputValueAccessor } from '@latitude/widgets/input';
6
+ import { BuildInTextBoxComponent } from '@latitude/widgets/textbox';
7
+ import { ButtonComponent } from '@latitude/widgets/button';
8
+ import { IconComponent } from '@latitude/widgets/icon';
9
9
 
10
- class SpinnersComponent {
11
- textbox = inject(TextBoxNumberComponent);
12
- handleValueChanged(dir) {
13
- const value = (this.textbox.value() ?? 0) + (this.textbox.step() ?? 0) * (dir ? 1 : -1);
14
- if (value < this.textbox.minvalue() || value > this.textbox.maxvalue()) {
15
- return void 0;
16
- }
17
- const factor = Math.pow(10, this.textbox.decimals());
18
- this.textbox.writeValue(Math.round(value * factor) / factor);
19
- }
20
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: SpinnersComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
21
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.6", type: SpinnersComponent, isStandalone: true, selector: "lat-spinners", exportAs: ["latSpinners"], ngImport: i0, template: "<lat-button tabindex=\"-1\" variant=\"subtle\" [size]=\"textbox.size()\" [disabled]=\"textbox.disabled()\" (click)=\"handleValueChanged(true)\">\r\n <lat-icon name=\"chevron-up\" />\r\n</lat-button>\r\n<lat-button tabindex=\"-1\" variant=\"subtle\" [size]=\"textbox.size()\" [disabled]=\"textbox.disabled()\" (click)=\"handleValueChanged(false)\">\r\n <lat-icon name=\"chevron-down\" />\r\n</lat-button>\r\n", dependencies: [{ kind: "component", type: ButtonComponent, selector: "lat-button", inputs: ["size", "variant", "tabindex", "disabled"], exportAs: ["latButton"] }, { kind: "component", type: IconComponent, selector: "lat-icon", inputs: ["url", "name"], exportAs: ["latIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
22
- }
23
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: SpinnersComponent, decorators: [{
24
- type: Component,
25
- args: [{ exportAs: 'latSpinners', selector: 'lat-spinners', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [ButtonComponent, IconComponent], template: "<lat-button tabindex=\"-1\" variant=\"subtle\" [size]=\"textbox.size()\" [disabled]=\"textbox.disabled()\" (click)=\"handleValueChanged(true)\">\r\n <lat-icon name=\"chevron-up\" />\r\n</lat-button>\r\n<lat-button tabindex=\"-1\" variant=\"subtle\" [size]=\"textbox.size()\" [disabled]=\"textbox.disabled()\" (click)=\"handleValueChanged(false)\">\r\n <lat-icon name=\"chevron-down\" />\r\n</lat-button>\r\n" }]
26
- }] });
27
-
28
- class TextBoxNumberComponent extends TextBoxDirective {
29
- max = input(undefined, { transform: numberAttribute });
30
- min = input(undefined, { transform: numberAttribute });
31
- step = input(undefined, { transform: numberAttribute });
32
- decimals = input(2);
33
- decimalMode = input('not-zero');
34
- decimalSeparator = input(',');
35
- thousandSeparator = input('');
36
- maxvalue = computed(() => this.max() ?? Number.MAX_SAFE_INTEGER);
37
- minvalue = computed(() => this.min() ?? Number.MIN_SAFE_INTEGER);
38
- nowvalue = computed(() => this.value() || 0);
10
+ class TextboxNumberComponent extends BuildInTextBoxComponent {
11
+ max = input(undefined, { ...(ngDevMode ? { debugName: "max" } : {}), transform: numberAttribute });
12
+ min = input(undefined, { ...(ngDevMode ? { debugName: "min" } : {}), transform: numberAttribute });
13
+ step = input(undefined, { ...(ngDevMode ? { debugName: "step" } : {}), transform: numberAttribute });
14
+ decimals = input(2, ...(ngDevMode ? [{ debugName: "decimals" }] : []));
15
+ decimalSeparator = input(',', ...(ngDevMode ? [{ debugName: "decimalSeparator" }] : []));
16
+ decimalZeroPadding = input(false, ...(ngDevMode ? [{ debugName: "decimalZeroPadding" }] : []));
17
+ thousandSeparator = input('', ...(ngDevMode ? [{ debugName: "thousandSeparator" }] : []));
18
+ maxvalue = computed(() => this.parseNumber(this.max(), Number.MAX_SAFE_INTEGER), ...(ngDevMode ? [{ debugName: "maxvalue" }] : []));
19
+ minvalue = computed(() => this.parseNumber(this.min(), Number.MIN_SAFE_INTEGER), ...(ngDevMode ? [{ debugName: "minvalue" }] : []));
20
+ nowvalue = computed(() => this.value() || 0, ...(ngDevMode ? [{ debugName: "nowvalue" }] : []));
39
21
  maxlength = computed(() => {
40
22
  const { decimalSeparator, thousandSeparator } = this.maskitoNumberParams();
41
23
  const decimals = this.decimals();
@@ -43,19 +25,18 @@ class TextBoxNumberComponent extends TextBoxDirective {
43
25
  const precision = mantissa ? Math.min(decimals + 1, 20) : 0;
44
26
  const thousand = thousandSeparator.repeat(5).length;
45
27
  return 18 + precision + thousand;
46
- });
28
+ }, ...(ngDevMode ? [{ debugName: "maxlength" }] : []));
47
29
  maskitoNumberParams = computed(() => {
48
- const decimalMode = this.decimalMode();
49
30
  return {
50
31
  max: this.maxvalue(),
51
32
  min: this.minvalue(),
52
33
  minusSign: '-',
53
- precision: this.decimals(),
54
- decimalZeroPadding: decimalMode === 'always',
34
+ maximumFractionDigits: this.decimals(),
35
+ minimumFractionDigits: this.decimalZeroPadding() ? this.decimals() : 0,
55
36
  decimalSeparator: this.decimalSeparator(),
56
37
  thousandSeparator: this.thousandSeparator(),
57
38
  };
58
- });
39
+ }, ...(ngDevMode ? [{ debugName: "maskitoNumberParams" }] : []));
59
40
  constructor() {
60
41
  super();
61
42
  effect((onCleanup) => {
@@ -92,14 +73,13 @@ class TextBoxNumberComponent extends TextBoxDirective {
92
73
  }
93
74
  /** @internal */
94
75
  valueUnsettled(value) {
95
- return !!(value === '-' ||
96
- value.match(/^\s*([-+])?\d+\.$/) ||
97
- value.match(/^\s*([-+])?\d+\.[0-9]*0$/) ||
98
- value.match(/^\s*([-+])0+$/));
76
+ return !!(value === '-' || value.match(/^\s*([-+])?\d+\.$/) || value.match(/^\s*([-+])?\d+\.[0-9]*0$/) || value.match(/^\s*([-+])0+$/));
99
77
  }
100
- /** @internal */
101
- parseNumber(value) {
78
+ parseNumber(value, fallback = null) {
102
79
  let valueAsNumber = null;
80
+ if (value === null || value === undefined) {
81
+ return fallback;
82
+ }
103
83
  if (typeof value === 'number') {
104
84
  valueAsNumber = value;
105
85
  }
@@ -107,7 +87,7 @@ class TextBoxNumberComponent extends TextBoxDirective {
107
87
  valueAsNumber = Number.parseFloat(value);
108
88
  }
109
89
  if (Number.isNaN(value)) {
110
- return null;
90
+ return fallback;
111
91
  }
112
92
  return valueAsNumber;
113
93
  }
@@ -122,14 +102,26 @@ class TextBoxNumberComponent extends TextBoxDirective {
122
102
  if (value === null) {
123
103
  return this.writeValue(value);
124
104
  }
105
+ console.log(value);
106
+ console.log(this.minvalue());
107
+ console.log(this.maxvalue());
125
108
  if (value < this.minvalue() || value > this.maxvalue()) {
126
109
  return void 0;
127
110
  }
128
111
  this.writeValue(value);
129
112
  }
130
113
  /** @internal */
114
+ handleValueSpined(mul) {
115
+ const value = (this.value() ?? 0) + (this.step() ?? 0) * mul;
116
+ if (value < this.minvalue() || value > this.maxvalue()) {
117
+ return void 0;
118
+ }
119
+ const factor = Math.pow(10, this.decimals());
120
+ this.writeValue(Math.round(value * factor) / factor);
121
+ }
122
+ /** @internal */
131
123
  handleFocusEvent() {
132
- const value = maskitoParseNumber(this.valueAsString(), this.decimalSeparator());
124
+ const value = maskitoParseNumber(this.valueAsString(), this.maskitoNumberParams());
133
125
  if (Number.isNaN(value) && !this.readonly()) {
134
126
  this.valueAsString.set('');
135
127
  }
@@ -142,27 +134,27 @@ class TextBoxNumberComponent extends TextBoxDirective {
142
134
  this.valueAsString.update(() => this._valueStringify(this.value()));
143
135
  }
144
136
  }
145
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: TextBoxNumberComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
146
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.6", type: TextBoxNumberComponent, isStandalone: true, selector: "lat-textbox[type=\"number\"]", inputs: { max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, decimals: { classPropertyName: "decimals", publicName: "decimals", isSignal: true, isRequired: false, transformFunction: null }, decimalMode: { classPropertyName: "decimalMode", publicName: "decimalMode", isSignal: true, isRequired: false, transformFunction: null }, decimalSeparator: { classPropertyName: "decimalSeparator", publicName: "decimalSeparator", isSignal: true, isRequired: false, transformFunction: null }, thousandSeparator: { classPropertyName: "thousandSeparator", publicName: "thousandSeparator", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
137
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TextboxNumberComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
138
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: TextboxNumberComponent, isStandalone: true, selector: "lat-textbox[type=\"number\"]", inputs: { max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, decimals: { classPropertyName: "decimals", publicName: "decimals", isSignal: true, isRequired: false, transformFunction: null }, decimalSeparator: { classPropertyName: "decimalSeparator", publicName: "decimalSeparator", isSignal: true, isRequired: false, transformFunction: null }, decimalZeroPadding: { classPropertyName: "decimalZeroPadding", publicName: "decimalZeroPadding", isSignal: true, isRequired: false, transformFunction: null }, thousandSeparator: { classPropertyName: "thousandSeparator", publicName: "thousandSeparator", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
147
139
  {
148
140
  provide: BuildInInputValueAccessor,
149
- useExisting: forwardRef(() => TextBoxNumberComponent),
141
+ useExisting: forwardRef(() => TextboxNumberComponent),
150
142
  },
151
- ], exportAs: ["latTextBox"], usesInheritance: true, ngImport: i0, template: "<input\r\n #htmlInputElement\r\n type=\"text\"\r\n role=\"spinbutton\"\r\n autocomplete=\"off\"\r\n autocapitalize=\"off\"\r\n [value]='valueAsString()'\r\n [attr.id]=\"inputId()\"\r\n [attr.tabindex]=\"disabled() ? -1 : tabindex()\"\r\n [attr.disabled]=\"disabled() || undefined\"\r\n [attr.readonly]=\"readonly() || undefined\"\r\n [attr.required]=\"required() || undefined\"\r\n [attr.maxlength]=\"maxlength()\"\r\n [attr.placeholder]=\"placeholder()\"\r\n [attr.aria-invalid]=\"invalid() || undefined\"\r\n [attr.aria-valuemax]=\"maxvalue()\"\r\n [attr.aria-valuemin]=\"minvalue()\"\r\n [attr.aria-valuenow]=\"nowvalue()\"\r\n [attr.aria-disabled]=\"disabled() || undefined\"\r\n [attr.aria-readonly]=\"readonly() || undefined\"\r\n [attr.aria-required]=\"required() || undefined\"\r\n [attr.aria-labelledby]=\"labelId()\"\r\n (blur)=\"handleBlurEvent()\"\r\n (focus)=\"handleFocusEvent()\"\r\n (input)=\"handleValueChanged()\"\r\n/>\r\n\r\n@if (step() && !readonly()) {\r\n <lat-spinners />\r\n}\r\n", dependencies: [{ kind: "component", type: SpinnersComponent, selector: "lat-spinners", exportAs: ["latSpinners"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
143
+ ], exportAs: ["latTextBox"], usesInheritance: true, ngImport: i0, template: "<input\r\n #htmlInputElement\r\n type=\"text\"\r\n role=\"spinbutton\"\r\n autocomplete=\"off\"\r\n autocapitalize=\"off\"\r\n [value]='valueAsString()'\r\n [attr.id]=\"inputId()\"\r\n [attr.tabindex]=\"disabled() ? -1 : tabindex()\"\r\n [attr.disabled]=\"disabled() || undefined\"\r\n [attr.readonly]=\"readonly() || undefined\"\r\n [attr.required]=\"required() || undefined\"\r\n [attr.maxlength]=\"maxlength()\"\r\n [attr.placeholder]=\"placeholder()\"\r\n [attr.aria-invalid]=\"invalid() || undefined\"\r\n [attr.aria-valuemax]=\"maxvalue()\"\r\n [attr.aria-valuemin]=\"minvalue()\"\r\n [attr.aria-valuenow]=\"nowvalue()\"\r\n [attr.aria-disabled]=\"disabled() || undefined\"\r\n [attr.aria-readonly]=\"readonly() || undefined\"\r\n [attr.aria-required]=\"required() || undefined\"\r\n [attr.aria-labelledby]=\"labelId()\"\r\n (blur)=\"handleBlurEvent()\"\r\n (focus)=\"handleFocusEvent()\"\r\n (input)=\"handleValueChanged()\"\r\n/>\r\n\r\n@if (step() && !readonly()) {\r\n <section>\r\n <lat-button\r\n tabindex=\"-1\"\r\n variant=\"subtle\"\r\n [size]=\"size()\"\r\n [disabled]=\"disabled() || undefined\"\r\n (click)=\"handleValueSpined(1)\"\r\n >\r\n <lat-icon name=\"chevron-up\" />\r\n </lat-button>\r\n <lat-button\r\n tabindex=\"-1\"\r\n variant=\"subtle\"\r\n [size]=\"size()\"\r\n [disabled]=\"disabled() || undefined\"\r\n (click)=\"handleValueSpined(-1)\"\r\n >\r\n <lat-icon name=\"chevron-down\" />\r\n </lat-button>\r\n </section>\r\n}\r\n", dependencies: [{ kind: "component", type: ButtonComponent, selector: "lat-button", exportAs: ["latButton"] }, { kind: "component", type: IconComponent, selector: "lat-icon", inputs: ["url", "name"], exportAs: ["latIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
152
144
  }
153
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: TextBoxNumberComponent, decorators: [{
145
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TextboxNumberComponent, decorators: [{
154
146
  type: Component,
155
- args: [{ imports: [SpinnersComponent], exportAs: 'latTextBox', selector: 'lat-textbox[type="number"]', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
147
+ args: [{ imports: [ButtonComponent, IconComponent], exportAs: 'latTextBox', selector: 'lat-textbox[type="number"]', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
156
148
  {
157
149
  provide: BuildInInputValueAccessor,
158
- useExisting: forwardRef(() => TextBoxNumberComponent),
150
+ useExisting: forwardRef(() => TextboxNumberComponent),
159
151
  },
160
- ], template: "<input\r\n #htmlInputElement\r\n type=\"text\"\r\n role=\"spinbutton\"\r\n autocomplete=\"off\"\r\n autocapitalize=\"off\"\r\n [value]='valueAsString()'\r\n [attr.id]=\"inputId()\"\r\n [attr.tabindex]=\"disabled() ? -1 : tabindex()\"\r\n [attr.disabled]=\"disabled() || undefined\"\r\n [attr.readonly]=\"readonly() || undefined\"\r\n [attr.required]=\"required() || undefined\"\r\n [attr.maxlength]=\"maxlength()\"\r\n [attr.placeholder]=\"placeholder()\"\r\n [attr.aria-invalid]=\"invalid() || undefined\"\r\n [attr.aria-valuemax]=\"maxvalue()\"\r\n [attr.aria-valuemin]=\"minvalue()\"\r\n [attr.aria-valuenow]=\"nowvalue()\"\r\n [attr.aria-disabled]=\"disabled() || undefined\"\r\n [attr.aria-readonly]=\"readonly() || undefined\"\r\n [attr.aria-required]=\"required() || undefined\"\r\n [attr.aria-labelledby]=\"labelId()\"\r\n (blur)=\"handleBlurEvent()\"\r\n (focus)=\"handleFocusEvent()\"\r\n (input)=\"handleValueChanged()\"\r\n/>\r\n\r\n@if (step() && !readonly()) {\r\n <lat-spinners />\r\n}\r\n" }]
161
- }], ctorParameters: () => [] });
152
+ ], template: "<input\r\n #htmlInputElement\r\n type=\"text\"\r\n role=\"spinbutton\"\r\n autocomplete=\"off\"\r\n autocapitalize=\"off\"\r\n [value]='valueAsString()'\r\n [attr.id]=\"inputId()\"\r\n [attr.tabindex]=\"disabled() ? -1 : tabindex()\"\r\n [attr.disabled]=\"disabled() || undefined\"\r\n [attr.readonly]=\"readonly() || undefined\"\r\n [attr.required]=\"required() || undefined\"\r\n [attr.maxlength]=\"maxlength()\"\r\n [attr.placeholder]=\"placeholder()\"\r\n [attr.aria-invalid]=\"invalid() || undefined\"\r\n [attr.aria-valuemax]=\"maxvalue()\"\r\n [attr.aria-valuemin]=\"minvalue()\"\r\n [attr.aria-valuenow]=\"nowvalue()\"\r\n [attr.aria-disabled]=\"disabled() || undefined\"\r\n [attr.aria-readonly]=\"readonly() || undefined\"\r\n [attr.aria-required]=\"required() || undefined\"\r\n [attr.aria-labelledby]=\"labelId()\"\r\n (blur)=\"handleBlurEvent()\"\r\n (focus)=\"handleFocusEvent()\"\r\n (input)=\"handleValueChanged()\"\r\n/>\r\n\r\n@if (step() && !readonly()) {\r\n <section>\r\n <lat-button\r\n tabindex=\"-1\"\r\n variant=\"subtle\"\r\n [size]=\"size()\"\r\n [disabled]=\"disabled() || undefined\"\r\n (click)=\"handleValueSpined(1)\"\r\n >\r\n <lat-icon name=\"chevron-up\" />\r\n </lat-button>\r\n <lat-button\r\n tabindex=\"-1\"\r\n variant=\"subtle\"\r\n [size]=\"size()\"\r\n [disabled]=\"disabled() || undefined\"\r\n (click)=\"handleValueSpined(-1)\"\r\n >\r\n <lat-icon name=\"chevron-down\" />\r\n </lat-button>\r\n </section>\r\n}\r\n" }]
153
+ }], ctorParameters: () => [], propDecorators: { max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], decimals: [{ type: i0.Input, args: [{ isSignal: true, alias: "decimals", required: false }] }], decimalSeparator: [{ type: i0.Input, args: [{ isSignal: true, alias: "decimalSeparator", required: false }] }], decimalZeroPadding: [{ type: i0.Input, args: [{ isSignal: true, alias: "decimalZeroPadding", required: false }] }], thousandSeparator: [{ type: i0.Input, args: [{ isSignal: true, alias: "thousandSeparator", required: false }] }] } });
162
154
 
163
155
  /**
164
156
  * Generated bundle index. Do not edit.
165
157
  */
166
158
 
167
- export { TextBoxNumberComponent };
168
- //# sourceMappingURL=latitude-ui-widgets-textbox-number.mjs.map
159
+ export { TextboxNumberComponent };
160
+ //# sourceMappingURL=latitude-widgets-textbox-number.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"latitude-widgets-textbox-number.mjs","sources":["../../../../packages/widgets/textbox-number/lib/textbox-number.component.ts","../../../../packages/widgets/textbox-number/lib/textbox-number.component.html","../../../../packages/widgets/textbox-number/latitude-widgets-textbox-number.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n forwardRef,\n input,\n numberAttribute,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { Maskito, maskitoInitialCalibrationPlugin } from '@maskito/core';\nimport { maskitoNumberOptionsGenerator, maskitoParseNumber, maskitoStringifyNumber } from '@maskito/kit';\n\nimport { BuildInInputValueAccessor } from '@latitude/widgets/input';\nimport { BuildInTextBoxComponent } from '@latitude/widgets/textbox';\nimport { ButtonComponent } from '@latitude/widgets/button';\nimport { IconComponent } from '@latitude/widgets/icon';\n\n@Component({\n imports: [ButtonComponent, IconComponent],\n exportAs: 'latTextBox',\n selector: 'lat-textbox[type=\"number\"]',\n templateUrl: './textbox-number.component.html',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: BuildInInputValueAccessor,\n useExisting: forwardRef(() => TextboxNumberComponent),\n },\n ],\n})\nexport class TextboxNumberComponent extends BuildInTextBoxComponent<number> {\n public readonly max = input<number, unknown>(undefined, { transform: numberAttribute });\n public readonly min = input<number, unknown>(undefined, { transform: numberAttribute });\n public readonly step = input<number, unknown>(undefined, { transform: numberAttribute });\n public readonly decimals = input<number>(2);\n public readonly decimalSeparator = input<',' | '.'>(',');\n public readonly decimalZeroPadding = input<boolean>(false);\n public readonly thousandSeparator = input<string>('');\n\n public readonly maxvalue = computed(() => this.parseNumber(this.max(), Number.MAX_SAFE_INTEGER));\n public readonly minvalue = computed(() => this.parseNumber(this.min(), Number.MIN_SAFE_INTEGER));\n public readonly nowvalue = computed(() => this.value() || 0);\n\n readonly maxlength = computed(() => {\n const { decimalSeparator, thousandSeparator } = this.maskitoNumberParams();\n\n const decimals = this.decimals();\n\n const mantissa = decimals && this.valueAsString().includes(decimalSeparator);\n const precision = mantissa ? Math.min(decimals + 1, 20) : 0;\n const thousand = thousandSeparator.repeat(5).length;\n\n return 18 + precision + thousand;\n });\n\n readonly maskitoNumberParams = computed(() => {\n return {\n max: this.maxvalue(),\n min: this.minvalue(),\n minusSign: '-',\n maximumFractionDigits: this.decimals(),\n minimumFractionDigits: this.decimalZeroPadding() ? this.decimals() : 0,\n decimalSeparator: this.decimalSeparator(),\n thousandSeparator: this.thousandSeparator(),\n };\n });\n\n constructor() {\n super();\n\n effect((onCleanup) => {\n const el = this.el();\n const formatter = this.maskitoNumberParams();\n\n const { plugins, ...options } = maskitoNumberOptionsGenerator(formatter);\n\n const instance = new Maskito(el.nativeElement, {\n ...options,\n plugins: [\n ...plugins,\n maskitoInitialCalibrationPlugin(\n maskitoNumberOptionsGenerator({\n ...formatter,\n min: Number.MIN_SAFE_INTEGER,\n max: Number.MAX_SAFE_INTEGER,\n })\n ),\n ],\n });\n\n onCleanup(() => instance.destroy());\n });\n }\n\n /** @internal */\n protected override _valueStringify(valueAsString: unknown): string {\n const value = this.parseNumber(valueAsString);\n if (value === null) {\n return '';\n }\n\n return maskitoStringifyNumber(value, this.maskitoNumberParams());\n }\n\n /** @internal */\n protected valueSimplify(value: string): string {\n const decimalSeparator = new RegExp(this.decimalSeparator(), 'gi');\n const thousandSeparator = new RegExp(this.thousandSeparator(), 'gi');\n\n return value.replace(thousandSeparator, '').replace(decimalSeparator, '.');\n }\n\n /** @internal */\n protected valueUnsettled(value: string): boolean {\n return !!(value === '-' || value.match(/^\\s*([-+])?\\d+\\.$/) || value.match(/^\\s*([-+])?\\d+\\.[0-9]*0$/) || value.match(/^\\s*([-+])0+$/));\n }\n\n /** @internal */\n protected parseNumber(value: unknown): number | null;\n protected parseNumber<const T extends number | null>(value: unknown, fallback: T): number | T;\n protected parseNumber<const T extends number | null>(value: unknown, fallback: T | null = null): number | null | T {\n let valueAsNumber: number | null = null;\n\n if(value === null || value === undefined) {\n return fallback as T;\n }\n\n if (typeof value === 'number') {\n valueAsNumber = value;\n } else if (typeof value === 'string') {\n valueAsNumber = Number.parseFloat(value);\n }\n\n if (Number.isNaN(value)) {\n return fallback as T;\n }\n\n return valueAsNumber;\n }\n\n /** @internal */\n protected handleValueChanged(): void {\n const input = this.el();\n\n const valueAsString = this.valueSimplify(input.nativeElement.value);\n\n\n if (this.valueUnsettled(valueAsString)) {\n return this.valueAsString.update(() => input.nativeElement.value);\n }\n\n const value = this.parseNumber(valueAsString);\n\n if (value === null) {\n return this.writeValue(value);\n }\n console.log(value);\n console.log(this.minvalue());\n console.log(this.maxvalue());\n\n if (value < this.minvalue() || value > this.maxvalue()) {\n return void 0;\n }\n\n this.writeValue(value);\n }\n\n /** @internal */\n protected handleValueSpined(mul: 1 | -1): void {\n const value = (this.value() ?? 0) + (this.step() ?? 0) * mul;\n\n if (value < this.minvalue() || value > this.maxvalue()) {\n return void 0;\n }\n\n const factor = Math.pow(10, this.decimals());\n\n this.writeValue(Math.round(value * factor) / factor);\n }\n\n /** @internal */\n protected handleFocusEvent(): void {\n const value = maskitoParseNumber(this.valueAsString(), this.maskitoNumberParams());\n\n if (Number.isNaN(value) && !this.readonly()) {\n this.valueAsString.set('');\n }\n }\n\n /** @internal */\n protected handleBlurEvent(): void {\n this.markAsTouched();\n\n const valueAsString = this.valueSimplify(this.valueAsString());\n\n if (this.valueUnsettled(valueAsString)) {\n this.valueAsString.update(() => this._valueStringify(this.value()));\n }\n }\n}\n","<input\r\n #htmlInputElement\r\n type=\"text\"\r\n role=\"spinbutton\"\r\n autocomplete=\"off\"\r\n autocapitalize=\"off\"\r\n [value]='valueAsString()'\r\n [attr.id]=\"inputId()\"\r\n [attr.tabindex]=\"disabled() ? -1 : tabindex()\"\r\n [attr.disabled]=\"disabled() || undefined\"\r\n [attr.readonly]=\"readonly() || undefined\"\r\n [attr.required]=\"required() || undefined\"\r\n [attr.maxlength]=\"maxlength()\"\r\n [attr.placeholder]=\"placeholder()\"\r\n [attr.aria-invalid]=\"invalid() || undefined\"\r\n [attr.aria-valuemax]=\"maxvalue()\"\r\n [attr.aria-valuemin]=\"minvalue()\"\r\n [attr.aria-valuenow]=\"nowvalue()\"\r\n [attr.aria-disabled]=\"disabled() || undefined\"\r\n [attr.aria-readonly]=\"readonly() || undefined\"\r\n [attr.aria-required]=\"required() || undefined\"\r\n [attr.aria-labelledby]=\"labelId()\"\r\n (blur)=\"handleBlurEvent()\"\r\n (focus)=\"handleFocusEvent()\"\r\n (input)=\"handleValueChanged()\"\r\n/>\r\n\r\n@if (step() && !readonly()) {\r\n <section>\r\n <lat-button\r\n tabindex=\"-1\"\r\n variant=\"subtle\"\r\n [size]=\"size()\"\r\n [disabled]=\"disabled() || undefined\"\r\n (click)=\"handleValueSpined(1)\"\r\n >\r\n <lat-icon name=\"chevron-up\" />\r\n </lat-button>\r\n <lat-button\r\n tabindex=\"-1\"\r\n variant=\"subtle\"\r\n [size]=\"size()\"\r\n [disabled]=\"disabled() || undefined\"\r\n (click)=\"handleValueSpined(-1)\"\r\n >\r\n <lat-icon name=\"chevron-down\" />\r\n </lat-button>\r\n </section>\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAiCM,MAAO,sBAAuB,SAAQ,uBAA+B,CAAA;IACzD,GAAG,GAAG,KAAK,CAAkB,SAAS,gDAAI,SAAS,EAAE,eAAe,EAAA,CAAG;IACvE,GAAG,GAAG,KAAK,CAAkB,SAAS,gDAAI,SAAS,EAAE,eAAe,EAAA,CAAG;IACvE,IAAI,GAAG,KAAK,CAAkB,SAAS,iDAAI,SAAS,EAAE,eAAe,EAAA,CAAG;AACxE,IAAA,QAAQ,GAAG,KAAK,CAAS,CAAC,oDAAC;AAC3B,IAAA,gBAAgB,GAAG,KAAK,CAAY,GAAG,4DAAC;AACxC,IAAA,kBAAkB,GAAG,KAAK,CAAU,KAAK,8DAAC;AAC1C,IAAA,iBAAiB,GAAG,KAAK,CAAS,EAAE,6DAAC;IAErC,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,gBAAgB,CAAC,oDAAC;IAChF,QAAQ,GAAG,QAAQ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AAA,EAC/B,YAAY,EAAA,QAAA,EACZ,4BAA4B,EAAA,aAAA,EAEvB,iBAAiB,CAAC,IAAI,EAAA,eAAA,EACpB,uBAAuB,CAAC,MAAM,EAAA,SAAA,EACpC;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,yBAAyB;AAClC,4BAAA,WAAW,EAAE,UAAU,CAAC,4BAA4B,CAAC;AACtD,yBAAA;AACF,qBAAA,EAAA,QAAA,EAAA,6hDAAA,EAAA;;;AE/BH;;AAEG;;;;"}
@@ -1,8 +1,8 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { viewChild, ElementRef, Directive, input, numberAttribute, computed, forwardRef, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
3
- import { BuildInInputValueAccessor } from '@latitude-ui/widgets/input';
3
+ import { BuildInInputValueAccessor } from '@latitude/widgets/input';
4
4
 
5
- class TextBoxDirective extends BuildInInputValueAccessor {
5
+ class BuildInTextBoxComponent extends BuildInInputValueAccessor {
6
6
  el = viewChild.required('htmlInputElement', { read: (ElementRef) });
7
7
  blur() {
8
8
  this.el().nativeElement.blur();
@@ -10,21 +10,21 @@ class TextBoxDirective extends BuildInInputValueAccessor {
10
10
  focus() {
11
11
  this.el().nativeElement.focus();
12
12
  }
13
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: TextBoxDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
14
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "20.0.6", type: TextBoxDirective, isStandalone: true, viewQueries: [{ propertyName: "el", first: true, predicate: ["htmlInputElement"], descendants: true, read: ElementRef, isSignal: true }], usesInheritance: true, ngImport: i0 });
13
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: BuildInTextBoxComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive });
14
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.1.1", type: BuildInTextBoxComponent, isStandalone: true, viewQueries: [{ propertyName: "el", first: true, predicate: ["htmlInputElement"], descendants: true, read: ElementRef, isSignal: true }], usesInheritance: true, ngImport: i0 });
15
15
  }
16
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: TextBoxDirective, decorators: [{
16
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: BuildInTextBoxComponent, decorators: [{
17
17
  type: Directive
18
- }] });
18
+ }], propDecorators: { el: [{ type: i0.ViewChild, args: ['htmlInputElement', { ...{ read: (ElementRef) }, isSignal: true }] }] } });
19
19
 
20
- class TextBoxComponent extends TextBoxDirective {
21
- rows = input(undefined, { transform: numberAttribute });
22
- maxlength = input(undefined, { transform: numberAttribute });
23
- minlength = input(undefined, { transform: numberAttribute });
20
+ class TextBoxComponent extends BuildInTextBoxComponent {
21
+ rows = input(undefined, { ...(ngDevMode ? { debugName: "rows" } : {}), transform: numberAttribute });
22
+ maxlength = input(undefined, { ...(ngDevMode ? { debugName: "maxlength" } : {}), transform: numberAttribute });
23
+ minlength = input(undefined, { ...(ngDevMode ? { debugName: "minlength" } : {}), transform: numberAttribute });
24
24
  textarea = computed(() => {
25
25
  const rows = this.rows();
26
26
  return rows ? rows >= 2 : false;
27
- });
27
+ }, ...(ngDevMode ? [{ debugName: "textarea" }] : []));
28
28
  /** @internal */
29
29
  handleBlurEvent() {
30
30
  this.markAsTouched();
@@ -34,15 +34,15 @@ class TextBoxComponent extends TextBoxDirective {
34
34
  const { nativeElement } = this.el();
35
35
  this.writeValue(nativeElement.value);
36
36
  }
37
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: TextBoxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
38
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.6", type: TextBoxComponent, isStandalone: true, selector: "lat-textbox:not([type]), lat-textbox[type=\"text\"]", inputs: { rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, maxlength: { classPropertyName: "maxlength", publicName: "maxlength", isSignal: true, isRequired: false, transformFunction: null }, minlength: { classPropertyName: "minlength", publicName: "minlength", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
37
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TextBoxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
38
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: TextBoxComponent, isStandalone: true, selector: "lat-textbox:not([type]), lat-textbox[type=\"text\"]", inputs: { rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, maxlength: { classPropertyName: "maxlength", publicName: "maxlength", isSignal: true, isRequired: false, transformFunction: null }, minlength: { classPropertyName: "minlength", publicName: "minlength", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
39
39
  {
40
40
  provide: BuildInInputValueAccessor,
41
41
  useExisting: forwardRef(() => TextBoxComponent),
42
42
  },
43
43
  ], exportAs: ["latTextBox"], usesInheritance: true, ngImport: i0, template: "@if(textarea()) {\r\n <textarea\r\n #htmlInputElement\r\n role=\"textbox\"\r\n [value]='valueAsString()'\r\n [attr.id]=\"inputId()\"\r\n [attr.rows]=\"rows()\"\r\n [attr.tabindex]=\"disabled() ? -1 : tabindex()\"\r\n [attr.disabled]=\"disabled() || undefined\"\r\n [attr.readonly]=\"readonly() || undefined\"\r\n [attr.required]=\"required() || undefined\"\r\n [attr.maxlength]=\"maxlength()\"\r\n [attr.minlength]=\"minlength()\"\r\n [attr.placeholder]=\"placeholder()\"\r\n [attr.aria-invalid]=\"invalid() || undefined\"\r\n [attr.aria-disabled]=\"disabled() || undefined\"\r\n [attr.aria-readonly]=\"readonly() || undefined\"\r\n [attr.aria-required]=\"required() || undefined\"\r\n [attr.aria-labelledby]=\"labelId()\"\r\n [style.resize]=\"'none'\"\r\n [style.height]=\"'auto'\"\r\n (blur)=\"handleBlurEvent()\"\r\n (input)=\"handleValueChanged()\"\r\n ></textarea>\r\n} @else {\r\n <input\r\n #htmlInputElement\r\n type=\"text\"\r\n role=\"textbox\"\r\n [value]='valueAsString()'\r\n [attr.id]=\"inputId()\"\r\n [attr.tabindex]=\"disabled() ? -1 : tabindex()\"\r\n [attr.disabled]=\"disabled() || undefined\"\r\n [attr.readonly]=\"readonly() || undefined\"\r\n [attr.required]=\"required() || undefined\"\r\n [attr.maxlength]=\"maxlength()\"\r\n [attr.minlength]=\"minlength()\"\r\n [attr.placeholder]=\"placeholder()\"\r\n [attr.aria-invalid]=\"invalid() || undefined\"\r\n [attr.aria-disabled]=\"disabled() || undefined\"\r\n [attr.aria-readonly]=\"readonly() || undefined\"\r\n [attr.aria-required]=\"required() || undefined\"\r\n [attr.aria-labelledby]=\"labelId()\"\r\n (blur)=\"handleBlurEvent()\"\r\n (input)=\"handleValueChanged()\"\r\n />\r\n}\r\n", changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
44
44
  }
45
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: TextBoxComponent, decorators: [{
45
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TextBoxComponent, decorators: [{
46
46
  type: Component,
47
47
  args: [{ exportAs: 'latTextBox', selector: 'lat-textbox:not([type]), lat-textbox[type="text"]', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
48
48
  {
@@ -52,11 +52,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
52
52
  ], host: {
53
53
  // '[style.height]': 'textarea() ? "auto" : undefined'
54
54
  }, template: "@if(textarea()) {\r\n <textarea\r\n #htmlInputElement\r\n role=\"textbox\"\r\n [value]='valueAsString()'\r\n [attr.id]=\"inputId()\"\r\n [attr.rows]=\"rows()\"\r\n [attr.tabindex]=\"disabled() ? -1 : tabindex()\"\r\n [attr.disabled]=\"disabled() || undefined\"\r\n [attr.readonly]=\"readonly() || undefined\"\r\n [attr.required]=\"required() || undefined\"\r\n [attr.maxlength]=\"maxlength()\"\r\n [attr.minlength]=\"minlength()\"\r\n [attr.placeholder]=\"placeholder()\"\r\n [attr.aria-invalid]=\"invalid() || undefined\"\r\n [attr.aria-disabled]=\"disabled() || undefined\"\r\n [attr.aria-readonly]=\"readonly() || undefined\"\r\n [attr.aria-required]=\"required() || undefined\"\r\n [attr.aria-labelledby]=\"labelId()\"\r\n [style.resize]=\"'none'\"\r\n [style.height]=\"'auto'\"\r\n (blur)=\"handleBlurEvent()\"\r\n (input)=\"handleValueChanged()\"\r\n ></textarea>\r\n} @else {\r\n <input\r\n #htmlInputElement\r\n type=\"text\"\r\n role=\"textbox\"\r\n [value]='valueAsString()'\r\n [attr.id]=\"inputId()\"\r\n [attr.tabindex]=\"disabled() ? -1 : tabindex()\"\r\n [attr.disabled]=\"disabled() || undefined\"\r\n [attr.readonly]=\"readonly() || undefined\"\r\n [attr.required]=\"required() || undefined\"\r\n [attr.maxlength]=\"maxlength()\"\r\n [attr.minlength]=\"minlength()\"\r\n [attr.placeholder]=\"placeholder()\"\r\n [attr.aria-invalid]=\"invalid() || undefined\"\r\n [attr.aria-disabled]=\"disabled() || undefined\"\r\n [attr.aria-readonly]=\"readonly() || undefined\"\r\n [attr.aria-required]=\"required() || undefined\"\r\n [attr.aria-labelledby]=\"labelId()\"\r\n (blur)=\"handleBlurEvent()\"\r\n (input)=\"handleValueChanged()\"\r\n />\r\n}\r\n" }]
55
- }] });
55
+ }], propDecorators: { rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], maxlength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxlength", required: false }] }], minlength: [{ type: i0.Input, args: [{ isSignal: true, alias: "minlength", required: false }] }] } });
56
56
 
57
57
  /**
58
58
  * Generated bundle index. Do not edit.
59
59
  */
60
60
 
61
- export { TextBoxComponent, TextBoxDirective };
62
- //# sourceMappingURL=latitude-ui-widgets-textbox.mjs.map
61
+ export { BuildInTextBoxComponent, TextBoxComponent };
62
+ //# sourceMappingURL=latitude-widgets-textbox.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"latitude-widgets-textbox.mjs","sources":["../../../../packages/widgets/textbox/lib/textbox.directive.ts","../../../../packages/widgets/textbox/lib/textbox.component.ts","../../../../packages/widgets/textbox/lib/textbox.component.html","../../../../packages/widgets/textbox/latitude-widgets-textbox.ts"],"sourcesContent":["import { Directive, ElementRef, viewChild } from '@angular/core';\r\nimport { BuildInInputValueAccessor } from '@latitude/widgets/input';\r\n\r\n@Directive()\r\nexport class BuildInTextBoxComponent<T> extends BuildInInputValueAccessor<T> {\r\n public readonly el = viewChild.required('htmlInputElement', { read: ElementRef<HTMLInputElement> });\r\n\r\n public blur() {\r\n this.el().nativeElement.blur();\r\n }\r\n\r\n public focus() {\r\n this.el().nativeElement.focus();\r\n }\r\n\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n forwardRef,\r\n input,\r\n numberAttribute,\r\n ViewEncapsulation,\r\n} from '@angular/core';\r\nimport { BuildInInputValueAccessor } from '@latitude/widgets/input';\r\nimport { BuildInTextBoxComponent } from './textbox.directive';\r\n\r\n@Component({\r\n exportAs: 'latTextBox',\r\n selector: 'lat-textbox:not([type]), lat-textbox[type=\"text\"]',\r\n templateUrl: './textbox.component.html',\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n providers: [\r\n {\r\n provide: BuildInInputValueAccessor,\r\n useExisting: forwardRef(() => TextBoxComponent),\r\n },\r\n ],\r\n host: {\r\n // '[style.height]': 'textarea() ? \"auto\" : undefined'\r\n }\r\n})\r\nexport class TextBoxComponent extends BuildInTextBoxComponent<string> {\r\n public readonly rows = input<number, unknown>(undefined, { transform: numberAttribute });\r\n public readonly maxlength = input<number, unknown>(undefined, { transform: numberAttribute });\r\n public readonly minlength = input<number, unknown>(undefined, { transform: numberAttribute });\r\n\r\n public readonly textarea = computed(() => {\r\n const rows = this.rows();\r\n\r\n return rows ? rows >= 2 : false;\r\n });\r\n\r\n /** @internal */\r\n protected handleBlurEvent(): void {\r\n this.markAsTouched();\r\n }\r\n\r\n /** @internal */\r\n protected handleValueChanged(): void {\r\n const { nativeElement } = this.el();\r\n\r\n this.writeValue(nativeElement.value);\r\n }\r\n}\r\n","@if(textarea()) {\r\n <textarea\r\n #htmlInputElement\r\n role=\"textbox\"\r\n [value]='valueAsString()'\r\n [attr.id]=\"inputId()\"\r\n [attr.rows]=\"rows()\"\r\n [attr.tabindex]=\"disabled() ? -1 : tabindex()\"\r\n [attr.disabled]=\"disabled() || undefined\"\r\n [attr.readonly]=\"readonly() || undefined\"\r\n [attr.required]=\"required() || undefined\"\r\n [attr.maxlength]=\"maxlength()\"\r\n [attr.minlength]=\"minlength()\"\r\n [attr.placeholder]=\"placeholder()\"\r\n [attr.aria-invalid]=\"invalid() || undefined\"\r\n [attr.aria-disabled]=\"disabled() || undefined\"\r\n [attr.aria-readonly]=\"readonly() || undefined\"\r\n [attr.aria-required]=\"required() || undefined\"\r\n [attr.aria-labelledby]=\"labelId()\"\r\n [style.resize]=\"'none'\"\r\n [style.height]=\"'auto'\"\r\n (blur)=\"handleBlurEvent()\"\r\n (input)=\"handleValueChanged()\"\r\n ></textarea>\r\n} @else {\r\n <input\r\n #htmlInputElement\r\n type=\"text\"\r\n role=\"textbox\"\r\n [value]='valueAsString()'\r\n [attr.id]=\"inputId()\"\r\n [attr.tabindex]=\"disabled() ? -1 : tabindex()\"\r\n [attr.disabled]=\"disabled() || undefined\"\r\n [attr.readonly]=\"readonly() || undefined\"\r\n [attr.required]=\"required() || undefined\"\r\n [attr.maxlength]=\"maxlength()\"\r\n [attr.minlength]=\"minlength()\"\r\n [attr.placeholder]=\"placeholder()\"\r\n [attr.aria-invalid]=\"invalid() || undefined\"\r\n [attr.aria-disabled]=\"disabled() || undefined\"\r\n [attr.aria-readonly]=\"readonly() || undefined\"\r\n [attr.aria-required]=\"required() || undefined\"\r\n [attr.aria-labelledby]=\"labelId()\"\r\n (blur)=\"handleBlurEvent()\"\r\n (input)=\"handleValueChanged()\"\r\n />\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAIM,MAAO,uBAA2B,SAAQ,yBAA4B,CAAA;AAC1D,IAAA,EAAE,GAAG,SAAS,CAAC,QAAQ,CAAC,kBAAkB,EAAE,EAAE,IAAI,GAAE,UAA4B,CAAA,EAAE,CAAC;IAE5F,IAAI,GAAA;QACT,IAAI,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE;IAChC;IAEO,KAAK,GAAA;QACV,IAAI,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE;IACjC;uGATW,uBAAuB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAvB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,uBAAuB,iIACkC,UAAU,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FADnE,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBADnC;AAEyC,SAAA,CAAA,EAAA,cAAA,EAAA,EAAA,EAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,kBAAkB,OAAE,EAAE,IAAI,GAAE,UAA4B,CAAA,EAAE,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AA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,UAAA,EAAA,WAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,SAAA,EAVhB;AACT,YAAA;AACE,gBAAA,OAAO,EAAE,yBAAyB;AAClC,gBAAA,WAAW,EAAE,UAAU,CAAC,MAAM,gBAAgB,CAAC;AAChD,aAAA;AACF,SAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECvBH,2vDA+CA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FDnBa,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAhB5B,SAAS;+BACE,YAAY,EAAA,QAAA,EACZ,mDAAmD,EAAA,aAAA,EAE9C,iBAAiB,CAAC,IAAI,EAAA,eAAA,EACpB,uBAAuB,CAAC,MAAM,EAAA,SAAA,EACpC;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,yBAAyB;AAClC,4BAAA,WAAW,EAAE,UAAU,CAAC,sBAAsB,CAAC;AAChD,yBAAA;qBACF,EAAA,IAAA,EACK;;AAEL,qBAAA,EAAA,QAAA,EAAA,2vDAAA,EAAA;;;AE1BH;;AAEG;;;;"}
@@ -3,4 +3,4 @@ var publicApi = void 0;
3
3
  /**
4
4
  * Generated bundle index. Do not edit.
5
5
  */
6
- //# sourceMappingURL=latitude-ui-widgets.mjs.map
6
+ //# sourceMappingURL=latitude-widgets.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"latitude-widgets.mjs","sources":["../../../../packages/widgets/public-api.ts","../../../../packages/widgets/latitude-widgets.ts"],"sourcesContent":["export default void 0;\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAAA,gBAAe,KAAK,CAAC;;ACArB;;AAEG"}
package/icon/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # @latitude/widgets
2
+
3
+ Secondary entry point of `@latitude/widgets`. It can be used by importing from `@latitude/widgets/icon`.
package/input/README.md CHANGED
@@ -1,3 +1,3 @@
1
- # @latitude-ui/widgets/button
1
+ # @latitude/widgets
2
2
 
3
- Secondary entry point of `@latitude-ui/widgets`. It can be used by importing from `@latitude-ui/widgets/button`.
3
+ Secondary entry point of `@latitude/widgets`. It can be used by importing from `@latitude/widgets/input`.
@@ -0,0 +1,3 @@
1
+ # @latitude/widgets
2
+
3
+ Secondary entry point of `@latitude/widgets`. It can be used by importing from `@latitude/widgets/listbox`.
package/package.json CHANGED
@@ -1,84 +1,64 @@
1
1
  {
2
2
  "name": "@latitude-ui/widgets",
3
- "version": "0.0.21",
4
- "description": "UI Widgets",
5
- "private": false,
6
- "keywords": [
7
- "component",
8
- "directive"
9
- ],
10
- "homepage": "https://github.com/Toerodor/latitude",
11
- "repository": {
12
- "type": "git",
13
- "url": "git+https://github.com/Toerodor/latitude.git"
3
+ "version": "0.0.23",
4
+ "peerDependencies": {
5
+ "@angular/common": "^21.0.0",
6
+ "@angular/core": "^21.0.0",
7
+ "@maskito/core": "^5.0.0",
8
+ "@maskito/kit": "^5.0.0"
14
9
  },
15
- "license": "Apache-2.0",
10
+ "sideEffects": false,
11
+ "module": "fesm2022/latitude-widgets.mjs",
12
+ "typings": "types/latitude-widgets.d.ts",
16
13
  "exports": {
17
- "./styles": {
18
- "sass": "./styles/_index.scss"
19
- },
20
14
  "./package.json": {
21
15
  "default": "./package.json"
22
16
  },
23
17
  ".": {
24
- "types": "./index.d.ts",
25
- "default": "./fesm2022/latitude-ui-widgets.mjs"
18
+ "types": "./types/latitude-widgets.d.ts",
19
+ "default": "./fesm2022/latitude-widgets.mjs"
26
20
  },
27
21
  "./button": {
28
- "types": "./button/index.d.ts",
29
- "default": "./fesm2022/latitude-ui-widgets-button.mjs"
22
+ "types": "./types/latitude-widgets-button.d.ts",
23
+ "default": "./fesm2022/latitude-widgets-button.mjs"
30
24
  },
31
25
  "./checkbox": {
32
- "types": "./checkbox/index.d.ts",
33
- "default": "./fesm2022/latitude-ui-widgets-checkbox.mjs"
26
+ "types": "./types/latitude-widgets-checkbox.d.ts",
27
+ "default": "./fesm2022/latitude-widgets-checkbox.mjs"
34
28
  },
35
- "./core": {
36
- "types": "./core/index.d.ts",
37
- "default": "./fesm2022/latitude-ui-widgets-core.mjs"
38
- },
39
- "./icons": {
40
- "types": "./icons/index.d.ts",
41
- "default": "./fesm2022/latitude-ui-widgets-icons.mjs"
29
+ "./icon": {
30
+ "types": "./types/latitude-widgets-icon.d.ts",
31
+ "default": "./fesm2022/latitude-widgets-icon.mjs"
42
32
  },
43
33
  "./input": {
44
- "types": "./input/index.d.ts",
45
- "default": "./fesm2022/latitude-ui-widgets-input.mjs"
34
+ "types": "./types/latitude-widgets-input.d.ts",
35
+ "default": "./fesm2022/latitude-widgets-input.mjs"
46
36
  },
47
37
  "./listbox": {
48
- "types": "./listbox/index.d.ts",
49
- "default": "./fesm2022/latitude-ui-widgets-listbox.mjs"
38
+ "types": "./types/latitude-widgets-listbox.d.ts",
39
+ "default": "./fesm2022/latitude-widgets-listbox.mjs"
50
40
  },
51
41
  "./select": {
52
- "types": "./select/index.d.ts",
53
- "default": "./fesm2022/latitude-ui-widgets-select.mjs"
42
+ "types": "./types/latitude-widgets-select.d.ts",
43
+ "default": "./fesm2022/latitude-widgets-select.mjs"
54
44
  },
55
45
  "./switch": {
56
- "types": "./switch/index.d.ts",
57
- "default": "./fesm2022/latitude-ui-widgets-switch.mjs"
46
+ "types": "./types/latitude-widgets-switch.d.ts",
47
+ "default": "./fesm2022/latitude-widgets-switch.mjs"
58
48
  },
59
49
  "./textbox": {
60
- "types": "./textbox/index.d.ts",
61
- "default": "./fesm2022/latitude-ui-widgets-textbox.mjs"
50
+ "types": "./types/latitude-widgets-textbox.d.ts",
51
+ "default": "./fesm2022/latitude-widgets-textbox.mjs"
62
52
  },
63
- "./textbox-number": {
64
- "types": "./textbox-number/index.d.ts",
65
- "default": "./fesm2022/latitude-ui-widgets-textbox-number.mjs"
53
+ "./textbox-date": {
54
+ "types": "./types/latitude-widgets-textbox-date.d.ts",
55
+ "default": "./fesm2022/latitude-widgets-textbox-date.mjs"
66
56
  },
67
- "./toolbar": {
68
- "types": "./toolbar/index.d.ts",
69
- "default": "./fesm2022/latitude-ui-widgets-toolbar.mjs"
57
+ "./textbox-number": {
58
+ "types": "./types/latitude-widgets-textbox-number.d.ts",
59
+ "default": "./fesm2022/latitude-widgets-textbox-number.mjs"
70
60
  }
71
61
  },
72
- "peerDependencies": {
73
- "@latitude-ui/stdlib": "^0.0.1",
74
- "@angular/common": "^20.0.0",
75
- "@angular/core": "^20.0.0",
76
- "@maskito/core": "^3.9.0",
77
- "@maskito/kit": "^3.9.0"
78
- },
79
- "sideEffects": false,
80
- "module": "fesm2022/latitude-ui-widgets.mjs",
81
- "typings": "index.d.ts",
82
62
  "dependencies": {
83
63
  "tslib": "^2.3.0"
84
64
  }
@@ -0,0 +1,3 @@
1
+ # @latitude/widgets
2
+
3
+ Secondary entry point of `@latitude/widgets`. It can be used by importing from `@latitude/widgets/select`.
@@ -0,0 +1,3 @@
1
+ # @latitude/widgets
2
+
3
+ Secondary entry point of `@latitude/widgets`. It can be used by importing from `@latitude/widgets/switch`.
@@ -0,0 +1,3 @@
1
+ # @latitude/widgets
2
+
3
+ Secondary entry point of `@latitude/widgets`. It can be used by importing from `@latitude/widgets/textbox`.
@@ -0,0 +1,3 @@
1
+ # @latitude/widgets
2
+
3
+ Secondary entry point of `@latitude/widgets`. It can be used by importing from `@latitude/widgets/textbox-date`.
@@ -0,0 +1,3 @@
1
+ # @latitude/widgets
2
+
3
+ Secondary entry point of `@latitude/widgets`. It can be used by importing from `@latitude/widgets/textbox-number`.
@@ -0,0 +1,29 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { DestroyRef } from '@angular/core';
3
+
4
+ type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
5
+ type ButtonVariant = 'default' | 'action' | 'text' | 'subtle' | 'link';
6
+
7
+ declare class ButtonDirective {
8
+ readonly button: any;
9
+ readonly role: _angular_core.InputSignal<string>;
10
+ readonly size: _angular_core.InputSignal<ButtonSize>;
11
+ readonly variant: _angular_core.InputSignal<ButtonVariant>;
12
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
13
+ readonly tabindex: _angular_core.InputSignalWithTransform<number | undefined, unknown>;
14
+ readonly onlyicon: _angular_core.WritableSignal<boolean>;
15
+ constructor();
16
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ButtonDirective, never>;
17
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ButtonDirective, "a[lat-button],button[lat-button]", ["latButton"], { "role": { "alias": "role"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "tabindex": { "alias": "tabindex"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
18
+ }
19
+
20
+ declare class ButtonComponent extends ButtonDirective {
21
+ readonly destroyRef: DestroyRef;
22
+ constructor();
23
+ private _setUpClickListener;
24
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ButtonComponent, never>;
25
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ButtonComponent, "lat-button", ["latButton"], {}, {}, never, ["*"], true, never>;
26
+ }
27
+
28
+ export { ButtonComponent, ButtonDirective };
29
+ export type { ButtonSize, ButtonVariant };
@@ -1,4 +1,4 @@
1
- import { BuildInInputValueAccessor } from '@latitude-ui/widgets/input';
1
+ import { BuildInInputValueAccessor } from '@latitude/widgets/input';
2
2
  import * as i0 from '@angular/core';
3
3
 
4
4
  declare class CheckBoxComponent extends BuildInInputValueAccessor<boolean> {
@@ -0,0 +1,44 @@
1
+ import * as _latitude_widgets_icon from '@latitude/widgets/icon';
2
+ import * as i0 from '@angular/core';
3
+ import { Renderer2, Signal, Injector, InjectionToken } from '@angular/core';
4
+ import { Observable, Subscription } from 'rxjs';
5
+ import { HttpClient } from '@angular/common/http';
6
+
7
+ declare class IconService {
8
+ readonly http: HttpClient;
9
+ readonly rtree: Renderer2;
10
+ protected readonly icons: Map<string, SVGElement>;
11
+ protected readonly tasks: Map<string, Observable<SVGElement>>;
12
+ get(url: string): Observable<SVGElement>;
13
+ subscribe(url: Signal<string | undefined>, injector: Injector): Subscription;
14
+ protected normalize(text: string): SVGElement;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<IconService, never>;
16
+ static ɵprov: i0.ɵɵInjectableDeclaration<IconService>;
17
+ }
18
+
19
+ declare class IconComponent {
20
+ readonly injector: Injector;
21
+ readonly url: i0.InputSignal<string | undefined>;
22
+ readonly name: i0.InputSignal<string | undefined>;
23
+ readonly icon: i0.Signal<string>;
24
+ protected readonly iconService: IconService;
25
+ protected readonly iconResolver: _latitude_widgets_icon.ResolverFn;
26
+ constructor();
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<IconComponent, never>;
28
+ static ɵcmp: i0.ɵɵComponentDeclaration<IconComponent, "lat-icon", ["latIcon"], { "url": { "alias": "url"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
29
+ }
30
+
31
+ type ResolverFn = (icon: string) => string;
32
+ declare const ICON_ASSETS_PATH: InjectionToken<string>;
33
+ declare const ICON_RESOLVER: InjectionToken<ResolverFn>;
34
+ declare function provideIconAssetsPath(useFactory: () => string): {
35
+ provide: InjectionToken<string>;
36
+ useFactory: () => string;
37
+ };
38
+ declare function provideIconResolver(useFactory: () => ResolverFn): {
39
+ provide: InjectionToken<ResolverFn>;
40
+ useFactory: () => ResolverFn;
41
+ };
42
+
43
+ export { ICON_ASSETS_PATH, ICON_RESOLVER, IconComponent, IconService, provideIconAssetsPath, provideIconResolver };
44
+ export type { ResolverFn };