@wlcm/angular 19.2.5 → 22.0.1
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/README.md +37 -0
- package/button/fesm2022/wlcm-angular-button.mjs +25 -31
- package/button/fesm2022/wlcm-angular-button.mjs.map +1 -1
- package/button/package.json +25 -0
- package/button/types/wlcm-angular-button.d.ts +28 -0
- package/core/fesm2022/wlcm-angular-core.mjs +76 -92
- package/core/fesm2022/wlcm-angular-core.mjs.map +1 -1
- package/core/package.json +26 -0
- package/core/types/wlcm-angular-core.d.ts +102 -0
- package/datepicker/fesm2022/wlcm-angular-datepicker.mjs +341 -497
- package/datepicker/fesm2022/wlcm-angular-datepicker.mjs.map +1 -1
- package/datepicker/package.json +33 -0
- package/datepicker/types/wlcm-angular-datepicker.d.ts +285 -0
- package/filters/fesm2022/wlcm-angular-filters.mjs +32 -38
- package/filters/fesm2022/wlcm-angular-filters.mjs.map +1 -1
- package/filters/package.json +25 -0
- package/filters/types/wlcm-angular-filters.d.ts +81 -0
- package/forms/fesm2022/wlcm-angular-forms.mjs +378 -405
- package/forms/fesm2022/wlcm-angular-forms.mjs.map +1 -1
- package/forms/package.json +31 -0
- package/forms/types/wlcm-angular-forms.d.ts +365 -0
- package/package.json +27 -46
- package/phone-input/fesm2022/wlcm-angular-phone-input.mjs +66 -84
- package/phone-input/fesm2022/wlcm-angular-phone-input.mjs.map +1 -1
- package/phone-input/package.json +32 -0
- package/phone-input/types/wlcm-angular-phone-input.d.ts +81 -0
- package/search-field/fesm2022/wlcm-angular-search-field.mjs +25 -30
- package/search-field/fesm2022/wlcm-angular-search-field.mjs.map +1 -1
- package/search-field/package.json +28 -0
- package/search-field/types/wlcm-angular-search-field.d.ts +24 -0
- package/stepper/fesm2022/wlcm-angular-stepper.mjs +171 -294
- package/stepper/fesm2022/wlcm-angular-stepper.mjs.map +1 -1
- package/stepper/package.json +24 -0
- package/stepper/types/wlcm-angular-stepper.d.ts +114 -0
- package/styles/components/button/index.scss +25 -82
- package/styles/components/calendar/_calendar-header.scss +3 -6
- package/styles/components/calendar/_calendar.scss +10 -13
- package/styles/components/common/index.scss +4 -7
- package/styles/components/datepicker/_datepicker-input-container.scss +0 -3
- package/styles/components/datepicker/_datepicker-panel.scss +2 -5
- package/styles/components/datepicker/_datepicker-trigger.scss +0 -3
- package/styles/components/datepicker/date-range-picker/_date-range-picker-body.scss +10 -5
- package/styles/components/datepicker/date-range-picker/_date-range-picker-input.scss +4 -7
- package/styles/components/datepicker/date-range-picker/_date-range-picker-panel.scss +2 -5
- package/styles/components/forms/_autocomplete.scss +0 -3
- package/styles/components/forms/_checkbox-group.scss +0 -3
- package/styles/components/forms/_checkbox.scss +6 -8
- package/styles/components/forms/_error.scss +2 -13
- package/styles/components/forms/_form-field.scss +9 -10
- package/styles/components/forms/_label.scss +2 -11
- package/styles/components/forms/_radio.scss +13 -12
- package/styles/components/forms/_select.scss +5 -8
- package/styles/components/forms/partials/_dropdown-panel.scss +4 -6
- package/styles/components/loader/_loader.scss +5 -9
- package/styles/components/phone-input/_country-code-select.scss +0 -5
- package/styles/components/phone-input/_phone-input-container.scss +1 -6
- package/styles/components/search-field/index.scss +0 -4
- package/styles/components/stepper/_step-header.scss +8 -11
- package/styles/components/stepper/_step.scss +0 -5
- package/styles/components/stepper/_stepper-header.scss +0 -5
- package/styles/components/stepper/_stepper.scss +0 -4
- package/styles/components/table/_table-head-data.scss +6 -9
- package/styles/components/table/_table-head.scss +0 -5
- package/styles/components/table/_table-row-data.scss +2 -7
- package/styles/components/table/_table-row.scss +0 -5
- package/styles/components/table/_table.scss +0 -5
- package/styles/core/_all-theme.scss +8 -3
- package/styles/core/_tokens.scss +41 -0
- package/styles/core/_utils.scss +11 -44
- package/styles/wlcm.scss +1 -3
- package/table/fesm2022/wlcm-angular-table.mjs +130 -160
- package/table/fesm2022/wlcm-angular-table.mjs.map +1 -1
- package/table/package.json +27 -0
- package/table/types/wlcm-angular-table.d.ts +115 -0
- package/button/index.d.ts +0 -2
- package/button/lib/button.module.d.ts +0 -7
- package/button/lib/components/button/button.component.d.ts +0 -19
- package/button/lib/models/button.models.d.ts +0 -4
- package/core/index.d.ts +0 -11
- package/core/lib/components/default-loader/default-loader.component.d.ts +0 -5
- package/core/lib/components/icons/calendar-icon/calendar-icon.component.d.ts +0 -5
- package/core/lib/components/icons/chevron-down-icon/chevron-down-icon.component.d.ts +0 -5
- package/core/lib/components/icons/close-icon/close-icon.component.d.ts +0 -5
- package/core/lib/components/icons/search-icon/search-icon.component.d.ts +0 -5
- package/core/lib/components/loader/loader.component.d.ts +0 -11
- package/core/lib/constants/_index.d.ts +0 -2
- package/core/lib/constants/http.constants.d.ts +0 -2
- package/core/lib/constants/icon.contants.d.ts +0 -4
- package/core/lib/constants/loader.constants.d.ts +0 -2
- package/core/lib/directives/_index.d.ts +0 -1
- package/core/lib/directives/icon.directive.d.ts +0 -15
- package/core/lib/models/_index.d.ts +0 -2
- package/core/lib/models/icon.models.d.ts +0 -9
- package/core/lib/models/option.models.d.ts +0 -14
- package/core/lib/services/scroll-detection.api.d.ts +0 -10
- package/core/lib/utils/paginated-data-emulator.utils.d.ts +0 -9
- package/core/lib/utils/stream.utils.d.ts +0 -6
- package/datepicker/index.d.ts +0 -17
- package/datepicker/lib/components/calendar-header/calendar-header.component.d.ts +0 -24
- package/datepicker/lib/components/range/date-range-calendar-header/date-range-calendar-header.component.d.ts +0 -24
- package/datepicker/lib/components/range/date-range-picker-bottom-panel/date-range-picker-bottom-panel.component.d.ts +0 -8
- package/datepicker/lib/components/range/date-range-picker-input/date-range-picker-input.component.d.ts +0 -36
- package/datepicker/lib/components/range/double-calendar-range-picker/double-calendar-range-picker.component.d.ts +0 -35
- package/datepicker/lib/components/range/single-calendar-range-picker/single-calendar-range-picker.component.d.ts +0 -27
- package/datepicker/lib/components/single/datepicker-input-container/datepicker-input-container.component.d.ts +0 -30
- package/datepicker/lib/components/single/datepicker-panel/datepicker-panel.component.d.ts +0 -17
- package/datepicker/lib/constants/datepicker.constants.d.ts +0 -7
- package/datepicker/lib/constants/range/date-range-picker.constants.d.ts +0 -4
- package/datepicker/lib/constants/range/date-range-selection-model.constants.d.ts +0 -4
- package/datepicker/lib/constants/range/date-range-trigger-selection-model.constants.d.ts +0 -4
- package/datepicker/lib/datepicker.module.d.ts +0 -12
- package/datepicker/lib/directives/calendar.directive.d.ts +0 -5
- package/datepicker/lib/directives/datepicker-input.base.d.ts +0 -33
- package/datepicker/lib/directives/datepicker-trigger.base.d.ts +0 -33
- package/datepicker/lib/directives/ragne/date-range-picker-input-end.directive.d.ts +0 -20
- package/datepicker/lib/directives/ragne/date-range-picker-input-start.directive.d.ts +0 -20
- package/datepicker/lib/directives/ragne/date-range-picker-input.base.d.ts +0 -23
- package/datepicker/lib/directives/ragne/left-calendar.directive.d.ts +0 -17
- package/datepicker/lib/directives/ragne/right-calendar.directive.d.ts +0 -20
- package/datepicker/lib/directives/single/datepicker-input.directive.d.ts +0 -21
- package/datepicker/lib/models/date-picker.models.d.ts +0 -18
- package/datepicker/lib/models/range/data-range-calendar.models.d.ts +0 -25
- package/datepicker/lib/models/range/date-range-picker.models.d.ts +0 -18
- package/datepicker/lib/models/range/date-range-validation.models.d.ts +0 -3
- package/datepicker/lib/utils/range/date-range-input.validators.d.ts +0 -2
- package/datepicker/lib/utils/range/date-range-picker-errors.d.ts +0 -4
- package/filters/index.d.ts +0 -5
- package/filters/lib/components/filters-group/filters-group.component.d.ts +0 -6
- package/filters/lib/constants/filter.constants.d.ts +0 -3
- package/filters/lib/constants/index.d.ts +0 -1
- package/filters/lib/directives/filter.directive.d.ts +0 -5
- package/filters/lib/directives/index.d.ts +0 -1
- package/filters/lib/filters.module.d.ts +0 -9
- package/filters/lib/models/array-filter.models.d.ts +0 -19
- package/filters/lib/models/filter.models.d.ts +0 -19
- package/filters/lib/models/filters-group.models.d.ts +0 -22
- package/filters/lib/models/index.d.ts +0 -3
- package/forms/index.d.ts +0 -12
- package/forms/lib/forms/components/autocomplete/autocomplete.component.d.ts +0 -76
- package/forms/lib/forms/components/checkbox/checkbox.component.d.ts +0 -28
- package/forms/lib/forms/components/checkbox-group/checkbox-group.component.d.ts +0 -25
- package/forms/lib/forms/components/error/error.component.d.ts +0 -5
- package/forms/lib/forms/components/form-field/form-field.component.d.ts +0 -34
- package/forms/lib/forms/components/index.d.ts +0 -8
- package/forms/lib/forms/components/label/label.component.d.ts +0 -7
- package/forms/lib/forms/components/partials/autocomplete-suffix/autocomplete-suffix.component.d.ts +0 -10
- package/forms/lib/forms/components/partials/index.d.ts +0 -1
- package/forms/lib/forms/components/select/select.component.d.ts +0 -90
- package/forms/lib/forms/constants/form-elements.constants.d.ts +0 -6
- package/forms/lib/forms/constants/form-errors.constants.d.ts +0 -4
- package/forms/lib/forms/constants/form-field.constants.d.ts +0 -1
- package/forms/lib/forms/constants/form-state-handlers.constants.d.ts +0 -6
- package/forms/lib/forms/constants/index.d.ts +0 -5
- package/forms/lib/forms/constants/select.constants.d.ts +0 -3
- package/forms/lib/forms/directives/autocomplete.directive.d.ts +0 -16
- package/forms/lib/forms/directives/form-field-custom-container.directive.d.ts +0 -8
- package/forms/lib/forms/directives/form-field-hint.directive.d.ts +0 -5
- package/forms/lib/forms/directives/form-field-prefix.directive.d.ts +0 -6
- package/forms/lib/forms/directives/form-field-suffix.directive.d.ts +0 -5
- package/forms/lib/forms/directives/input.directive.d.ts +0 -14
- package/forms/lib/forms/directives/select-input-binder.directive.d.ts +0 -5
- package/forms/lib/forms/forms.module.d.ts +0 -19
- package/forms/lib/forms/models/_index.d.ts +0 -5
- package/forms/lib/forms/models/autocomplete.models.d.ts +0 -9
- package/forms/lib/forms/models/form-errors.models.d.ts +0 -5
- package/forms/lib/forms/models/form.models.d.ts +0 -11
- package/forms/lib/forms/models/input.models.d.ts +0 -13
- package/forms/lib/forms/models/select.models.d.ts +0 -9
- package/forms/lib/forms/pipes/errors-mapper.pipe.d.ts +0 -17
- package/forms/lib/forms/services/form-state-handler.service.d.ts +0 -10
- package/forms/lib/forms/services/index.d.ts +0 -2
- package/forms/lib/forms/services/places.api.d.ts +0 -11
- package/phone-input/index.d.ts +0 -4
- package/phone-input/lib/components/country-code-select/country-code-select.component.d.ts +0 -15
- package/phone-input/lib/components/phone-input-container/phone-input-container.component.d.ts +0 -30
- package/phone-input/lib/constants/country-code-options.constants.d.ts +0 -3
- package/phone-input/lib/constants/phone-adapter.constants.d.ts +0 -3
- package/phone-input/lib/directives/phone-input.directive.d.ts +0 -36
- package/phone-input/lib/models/country-code.models.d.ts +0 -7
- package/phone-input/lib/models/phone-adapter.models.d.ts +0 -10
- package/phone-input/lib/models/phone.models.d.ts +0 -3
- package/phone-input/lib/phone-input.module.d.ts +0 -9
- package/phone-input/lib/pipes/phone-code.pipe.d.ts +0 -8
- package/search-field/index.d.ts +0 -2
- package/search-field/lib/components/search-field/search-field.component.d.ts +0 -16
- package/search-field/lib/search-field.module.d.ts +0 -8
- package/stepper/index.d.ts +0 -10
- package/stepper/lib/components/step/step.component.d.ts +0 -16
- package/stepper/lib/components/step-header/step-header.component.d.ts +0 -20
- package/stepper/lib/components/stepper/stepper.component.d.ts +0 -6
- package/stepper/lib/components/stepper-header/stepper-header.component.d.ts +0 -8
- package/stepper/lib/constants/step.constants.d.ts +0 -4
- package/stepper/lib/constants/stepper.stepper.d.ts +0 -3
- package/stepper/lib/directives/load-on-active-step.directive.d.ts +0 -13
- package/stepper/lib/models/step.models.d.ts +0 -43
- package/stepper/lib/models/stepper.models.d.ts +0 -44
- package/stepper/lib/stepper.module.d.ts +0 -12
- package/styles/core/_core.scss +0 -10
- package/table/index.d.ts +0 -9
- package/table/lib/components/table/table.component.d.ts +0 -24
- package/table/lib/components/table-head/table-head.component.d.ts +0 -8
- package/table/lib/components/table-head-actions/table-head-actions.component.d.ts +0 -12
- package/table/lib/components/table-head-data/table-head-data.component.d.ts +0 -5
- package/table/lib/components/table-row/table-row.component.d.ts +0 -23
- package/table/lib/components/table-row-actions/table-row-actions.component.d.ts +0 -5
- package/table/lib/components/table-row-data/table-row-data.component.d.ts +0 -5
- package/table/lib/components/table-row-spacer/table-row-spacer.component.d.ts +0 -5
- package/table/lib/constants/table-row.constants.d.ts +0 -3
- package/table/lib/constants/table.constants.d.ts +0 -3
- package/table/lib/directives/scrollable-table-container.directive.d.ts +0 -13
- package/table/lib/models/table-config-manager.models.d.ts +0 -12
- package/table/lib/models/table-row.models.d.ts +0 -10
- package/table/lib/models/table-selection-model.d.ts +0 -25
- package/table/lib/models/table.models.d.ts +0 -4
- package/table/lib/pipes/table-row-injector.pipe.d.ts +0 -9
- package/table/lib/table.module.d.ts +0 -13
- package/table/lib/utils/table-errors.utils.d.ts +0 -3
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
@use '
|
|
2
|
-
@use 'utils' as utils;
|
|
1
|
+
@use 'tokens' as tokens;
|
|
3
2
|
@use '../components/common/index' as common;
|
|
4
3
|
@use '../components/forms/index' as forms;
|
|
5
4
|
@use '../components/button/index' as button;
|
|
@@ -11,7 +10,13 @@
|
|
|
11
10
|
@use '../components/loader/index' as loader;
|
|
12
11
|
@use '../components/table/index' as table;
|
|
13
12
|
|
|
14
|
-
@mixin
|
|
13
|
+
@mixin theme($theme-config) {
|
|
14
|
+
// Emit the `--wlcm-*` token contract; `emit-tokens` owns its own selectors
|
|
15
|
+
// (`:root` for light, plus `prefers-color-scheme` / `[data-theme]` blocks for
|
|
16
|
+
// dark) so component styles below can consume the `--wlcm-*` / `--mat-sys-*`
|
|
17
|
+
// `var()` references directly under either scheme.
|
|
18
|
+
@include tokens.emit-tokens($theme-config);
|
|
19
|
+
|
|
15
20
|
@include common.theme($theme-config);
|
|
16
21
|
@include forms.theme($theme-config);
|
|
17
22
|
@include button.theme($theme-config);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use 'utils' as utils;
|
|
3
|
+
|
|
4
|
+
// Default numeric weights applied when the consumer does NOT pass a named
|
|
5
|
+
// family for a tier. Named WLCM fonts (e.g. `Montserrat-Bold`) are registered
|
|
6
|
+
// via `@font-face` at `font-weight: normal` — the weight lives in the file — so
|
|
7
|
+
// whenever a family is present we pin the weight to `normal` to avoid faux-bold.
|
|
8
|
+
$default-weights: (
|
|
9
|
+
bold: 700,
|
|
10
|
+
medium: 500,
|
|
11
|
+
regular: 400,
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
// prettier-ignore
|
|
15
|
+
@mixin emit-tokens($theme-config) {
|
|
16
|
+
$typography: map-get($theme_config, typography) or ();
|
|
17
|
+
|
|
18
|
+
// Typography is scheme-independent.
|
|
19
|
+
//
|
|
20
|
+
// For each tier we emit a `--wlcm-<tier>-font-family` and a paired
|
|
21
|
+
// `--wlcm-<tier>-font-weight`. If the consumer supplied a named family, the
|
|
22
|
+
// family carries the weight so the weight token is `normal`; otherwise the
|
|
23
|
+
// family token is empty (so `font-family` inherits) and the weight token holds
|
|
24
|
+
// the real numeric weight. `utils.font()` consumes both.
|
|
25
|
+
@include emit-font-tier(bold, $typography);
|
|
26
|
+
@include emit-font-tier(medium, $typography);
|
|
27
|
+
@include emit-font-tier(regular, $typography);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// prettier-ignore
|
|
31
|
+
@mixin emit-font-tier($tier, $typography) {
|
|
32
|
+
$family: map-get($typography, #{$tier}-font-family);
|
|
33
|
+
|
|
34
|
+
@if $family {
|
|
35
|
+
--wlcm-#{$tier}-font-family: #{$family};
|
|
36
|
+
--wlcm-#{$tier}-font-weight: normal;
|
|
37
|
+
} @else {
|
|
38
|
+
--wlcm-#{$tier}-font-family: ;
|
|
39
|
+
--wlcm-#{$tier}-font-weight: #{map-get($default-weights, $tier)};
|
|
40
|
+
}
|
|
41
|
+
}
|
package/styles/core/_utils.scss
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
2
|
|
|
3
|
-
@function get-color-config($theme-config) {
|
|
4
|
-
@return map-get($theme_config, color);
|
|
5
|
-
}
|
|
6
|
-
|
|
7
3
|
@function get-specific-color-config($theme-config) {
|
|
8
4
|
@return map-get($theme_config, specific-color);
|
|
9
5
|
}
|
|
@@ -12,44 +8,15 @@
|
|
|
12
8
|
@return map-get($theme_config, typography);
|
|
13
9
|
}
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
@
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
@function using-theme($theme-config) {
|
|
28
|
-
$color-config: get-color-config($theme_config);
|
|
29
|
-
|
|
30
|
-
$specific-color-config: get-specific-color-config($theme_config);
|
|
31
|
-
|
|
32
|
-
$typography-config: get-typography-config($theme_config);
|
|
33
|
-
|
|
34
|
-
@return (
|
|
35
|
-
// Color
|
|
36
|
-
primary-color: map-get($color-config, primary),
|
|
37
|
-
accent-color: map-get($color-config, accent),
|
|
38
|
-
warn-color: map-get($color-config, warn),
|
|
39
|
-
// Specific Color
|
|
40
|
-
text-black-color: map-get($specific-color-config, text-black-color),
|
|
41
|
-
field-outline-color: map-get($specific-color-config, field-outline-color),
|
|
42
|
-
focus-field-outline-color:
|
|
43
|
-
map-get($specific-color-config, focus-field-outline-color),
|
|
44
|
-
hover-field-outline-color:
|
|
45
|
-
map-get($specific-color-config, hover-field-outline-color),
|
|
46
|
-
selected-option-color:
|
|
47
|
-
map-get($specific-color-config, selected-option-color),
|
|
48
|
-
field-text-color: map-get($specific-color-config, field-text-color),
|
|
49
|
-
placeholder-color: map-get($specific-color-config, placeholder-color),
|
|
50
|
-
// Typography
|
|
51
|
-
bold-font-family: get-bold-typography($typography-config),
|
|
52
|
-
medium-font-family: get-medium-typography($typography-config),
|
|
53
|
-
regular-font-family: get-regular-typography($typography-config)
|
|
54
|
-
);
|
|
11
|
+
// Applies a named font tier (`bold` | `medium` | `regular`).
|
|
12
|
+
//
|
|
13
|
+
// Components consume `--wlcm-*` tokens directly rather than going through a
|
|
14
|
+
// theme map. Each tier resolves to a family/weight pair emitted by
|
|
15
|
+
// `tokens.emit-tokens()`: when the consumer supplied a named family the weight
|
|
16
|
+
// is `normal` (the font file carries the weight — avoids faux-bold); when no
|
|
17
|
+
// family was supplied the family is empty (so `font-family` inherits) and the
|
|
18
|
+
// weight token holds the real numeric weight.
|
|
19
|
+
@mixin font($tier) {
|
|
20
|
+
font-family: var(--wlcm-#{$tier}-font-family);
|
|
21
|
+
font-weight: var(--wlcm-#{$tier}-font-weight);
|
|
55
22
|
}
|
package/styles/wlcm.scss
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, InjectionToken, inject, Injector, Pipe, input,
|
|
3
|
-
import * as
|
|
2
|
+
import { signal, ChangeDetectionStrategy, Component, InjectionToken, inject, Injector, Pipe, input, DestroyRef, Inject, output, ElementRef, Directive, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
|
-
import {
|
|
6
|
-
import { BehaviorSubject, map, switchMap, takeUntil, skip, filter,
|
|
7
|
-
import
|
|
8
|
-
import { toObservable } from '@angular/core/rxjs-interop';
|
|
9
|
-
import { RxLet } from '@rx-angular/template/let';
|
|
10
|
-
import * as i2 from '@wlcm/angular/forms';
|
|
5
|
+
import { toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
|
+
import { BehaviorSubject, map, switchMap, takeUntil, skip, filter, fromEvent, debounceTime } from 'rxjs';
|
|
7
|
+
import * as i1$1 from '@wlcm/angular/forms';
|
|
11
8
|
import { WlcmFormsModule } from '@wlcm/angular/forms';
|
|
12
|
-
import * as
|
|
9
|
+
import * as i2 from '@angular/forms';
|
|
13
10
|
import { FormControl, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
14
11
|
|
|
15
12
|
class WlcmTableSelectionModel {
|
|
@@ -64,25 +61,27 @@ class TableConfigManager {
|
|
|
64
61
|
class DefaultTableConfigManager extends TableConfigManager {
|
|
65
62
|
constructor() {
|
|
66
63
|
super(...arguments);
|
|
67
|
-
this.#selectable
|
|
68
|
-
|
|
64
|
+
this.#selectable = signal(false, /* @ts-ignore */
|
|
65
|
+
...(ngDevMode ? [{ debugName: "#selectable" }] : /* istanbul ignore next */ []));
|
|
66
|
+
this.selectableSignal = this.#selectable.asReadonly();
|
|
67
|
+
this.selectable$ = toObservable(this.#selectable);
|
|
69
68
|
}
|
|
70
|
-
#selectable
|
|
69
|
+
#selectable;
|
|
71
70
|
get selectable() {
|
|
72
|
-
return this.#selectable
|
|
71
|
+
return this.#selectable();
|
|
73
72
|
}
|
|
74
73
|
set selectable(value) {
|
|
75
|
-
this.#selectable
|
|
74
|
+
this.#selectable.set(value);
|
|
76
75
|
}
|
|
77
76
|
}
|
|
78
77
|
|
|
79
78
|
class WlcmTableRowSpacerComponent {
|
|
80
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
81
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
79
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmTableRowSpacerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
80
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.5", type: WlcmTableRowSpacerComponent, isStandalone: true, selector: "wlcm-table-row-spacer", host: { classAttribute: "wlcm-table-row-spacer" }, ngImport: i0, template: "", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
82
81
|
}
|
|
83
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
82
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmTableRowSpacerComponent, decorators: [{
|
|
84
83
|
type: Component,
|
|
85
|
-
args: [{ selector: 'wlcm-table-row-spacer', host: { class: 'wlcm-table-row-spacer' },
|
|
84
|
+
args: [{ selector: 'wlcm-table-row-spacer', host: { class: 'wlcm-table-row-spacer' }, changeDetection: ChangeDetectionStrategy.OnPush, template: "" }]
|
|
86
85
|
}] });
|
|
87
86
|
|
|
88
87
|
const WLCM_TABLE_ROW_CONTEXT = new InjectionToken('WLCM_TABLE_ROW_CONTEXT');
|
|
@@ -97,14 +96,13 @@ class WlcmTableRowInjectorPipe {
|
|
|
97
96
|
parent: this.injector,
|
|
98
97
|
});
|
|
99
98
|
}
|
|
100
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
101
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
99
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmTableRowInjectorPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
100
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.0.5", ngImport: i0, type: WlcmTableRowInjectorPipe, isStandalone: true, name: "wlcmTableRowInjector" }); }
|
|
102
101
|
}
|
|
103
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
102
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmTableRowInjectorPipe, decorators: [{
|
|
104
103
|
type: Pipe,
|
|
105
104
|
args: [{
|
|
106
105
|
name: 'wlcmTableRowInjector',
|
|
107
|
-
standalone: true,
|
|
108
106
|
}]
|
|
109
107
|
}] });
|
|
110
108
|
|
|
@@ -118,24 +116,32 @@ const WLCM_TABLE_CONFIG = new InjectionToken('WLCM_TABLE_CONFIG', {
|
|
|
118
116
|
factory: () => ({ selectable: false }),
|
|
119
117
|
});
|
|
120
118
|
|
|
121
|
-
|
|
119
|
+
class WlcmTableComponent {
|
|
122
120
|
#streamOfRows$;
|
|
123
|
-
constructor(
|
|
124
|
-
this.
|
|
125
|
-
|
|
126
|
-
this.
|
|
127
|
-
|
|
128
|
-
this.
|
|
129
|
-
|
|
130
|
-
this.isRowSelectable = input(() => true
|
|
131
|
-
|
|
132
|
-
this.
|
|
133
|
-
|
|
121
|
+
constructor() {
|
|
122
|
+
this.rows = input([], /* @ts-ignore */
|
|
123
|
+
...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
|
|
124
|
+
this.headTemplate = input(/* @ts-ignore */
|
|
125
|
+
...(ngDevMode ? [undefined, { debugName: "headTemplate" }] : /* istanbul ignore next */ []));
|
|
126
|
+
this.rowTemplate = input.required(/* @ts-ignore */
|
|
127
|
+
...(ngDevMode ? [{ debugName: "rowTemplate" }] : /* istanbul ignore next */ []));
|
|
128
|
+
this.isRowSelectable = input(() => true, /* @ts-ignore */
|
|
129
|
+
...(ngDevMode ? [{ debugName: "isRowSelectable" }] : /* istanbul ignore next */ []));
|
|
130
|
+
this.selectId = input(/* @ts-ignore */
|
|
131
|
+
...(ngDevMode ? [undefined, { debugName: "selectId" }] : /* istanbul ignore next */ []));
|
|
132
|
+
this.trackBy = input((_, row) => row, /* @ts-ignore */
|
|
133
|
+
...(ngDevMode ? [{ debugName: "trackBy" }] : /* istanbul ignore next */ []));
|
|
134
|
+
this.selectable = input(/* @ts-ignore */
|
|
135
|
+
...(ngDevMode ? [undefined, { debugName: "selectable" }] : /* istanbul ignore next */ []));
|
|
134
136
|
this.injector = inject(Injector);
|
|
137
|
+
this.selectionModel = inject(WlcmTableSelectionModel);
|
|
138
|
+
this.config = inject(WLCM_TABLE_CONFIG);
|
|
139
|
+
this.configManager = inject(TableConfigManager);
|
|
140
|
+
this.destroyRef = inject(DestroyRef);
|
|
135
141
|
this.#streamOfRows$ = toObservable(this.rows);
|
|
136
|
-
this.configManager.selectable = config.selectable;
|
|
142
|
+
this.configManager.selectable = this.config.selectable;
|
|
137
143
|
toObservable(this.selectable)
|
|
138
|
-
.pipe(
|
|
144
|
+
.pipe(takeUntilDestroyed())
|
|
139
145
|
.subscribe((value) => {
|
|
140
146
|
if (value === undefined)
|
|
141
147
|
return;
|
|
@@ -148,7 +154,7 @@ let WlcmTableComponent = class WlcmTableComponent {
|
|
|
148
154
|
WlcmTableErrorsUtils.throwNoSelectIdError();
|
|
149
155
|
}
|
|
150
156
|
this.#streamOfRows$
|
|
151
|
-
.pipe(
|
|
157
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
152
158
|
.pipe(switchMap((rows) => this.configManager.selectable$.pipe(map(() => rows))))
|
|
153
159
|
.subscribe((rows) => {
|
|
154
160
|
if (!this.configManager.selectable) {
|
|
@@ -158,31 +164,25 @@ let WlcmTableComponent = class WlcmTableComponent {
|
|
|
158
164
|
this.selectionModel.updateCollection(rows.filter(this.isRowSelectable()).map(this.selectId()));
|
|
159
165
|
});
|
|
160
166
|
}
|
|
161
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
162
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
167
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
168
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: WlcmTableComponent, isStandalone: true, selector: "wlcm-table", inputs: { rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, headTemplate: { classPropertyName: "headTemplate", publicName: "headTemplate", isSignal: true, isRequired: false, transformFunction: null }, rowTemplate: { classPropertyName: "rowTemplate", publicName: "rowTemplate", isSignal: true, isRequired: true, transformFunction: null }, isRowSelectable: { classPropertyName: "isRowSelectable", publicName: "isRowSelectable", isSignal: true, isRequired: false, transformFunction: null }, selectId: { classPropertyName: "selectId", publicName: "selectId", isSignal: true, isRequired: false, transformFunction: null }, trackBy: { classPropertyName: "trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "wlcm-table" }, providers: [
|
|
163
169
|
{ provide: TableConfigManager, useClass: DefaultTableConfigManager },
|
|
164
170
|
{ provide: WlcmTableSelectionModel, useClass: DefaultWlcmTableSelectionModel },
|
|
165
|
-
], ngImport: i0, template: "@if (headTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"headTemplate()!; injector: injector\"\n ></ng-container>\n}\n\n<tbody>\n
|
|
166
|
-
}
|
|
167
|
-
WlcmTableComponent
|
|
168
|
-
UntilDestroy(),
|
|
169
|
-
__metadata("design:paramtypes", [WlcmTableSelectionModel, Object, TableConfigManager])
|
|
170
|
-
], WlcmTableComponent);
|
|
171
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmTableComponent, decorators: [{
|
|
171
|
+
], ngImport: i0, template: "@if (headTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"headTemplate()!; injector: injector\"\n ></ng-container>\n}\n\n<tbody>\n @for (\n row of rows(); track trackBy()(index,\n row); let index = $index; let first = $first; let last = $last) {\n @if ((first && headTemplate()) || !first) {\n <wlcm-table-row-spacer></wlcm-table-row-spacer>\n }\n @let context =\n {\n $implicit: row,\n selectId: selectId(),\n isRowSelectable: isRowSelectable(),\n index: index,\n first: first,\n last: last,\n };\n <ng-container>\n <ng-container\n *ngTemplateOutlet=\"\n rowTemplate();\n context: context;\n injector: context | wlcmTableRowInjector\n \"\n >\n </ng-container>\n </ng-container>\n }\n</tbody>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: WlcmTableRowSpacerComponent, selector: "wlcm-table-row-spacer" }, { kind: "pipe", type: WlcmTableRowInjectorPipe, name: "wlcmTableRowInjector" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
172
|
+
}
|
|
173
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmTableComponent, decorators: [{
|
|
172
174
|
type: Component,
|
|
173
|
-
args: [{ selector: 'wlcm-table', host: { class: 'wlcm-table' },
|
|
175
|
+
args: [{ selector: 'wlcm-table', host: { class: 'wlcm-table' }, imports: [CommonModule, WlcmTableRowInjectorPipe, WlcmTableRowSpacerComponent], providers: [
|
|
174
176
|
{ provide: TableConfigManager, useClass: DefaultTableConfigManager },
|
|
175
177
|
{ provide: WlcmTableSelectionModel, useClass: DefaultWlcmTableSelectionModel },
|
|
176
|
-
], template: "@if (headTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"headTemplate()!; injector: injector\"\n ></ng-container>\n}\n\n<tbody>\n
|
|
177
|
-
}], ctorParameters: () => [{ type:
|
|
178
|
-
type: Inject,
|
|
179
|
-
args: [WLCM_TABLE_CONFIG]
|
|
180
|
-
}] }, { type: TableConfigManager }] });
|
|
178
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (headTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"headTemplate()!; injector: injector\"\n ></ng-container>\n}\n\n<tbody>\n @for (\n row of rows(); track trackBy()(index,\n row); let index = $index; let first = $first; let last = $last) {\n @if ((first && headTemplate()) || !first) {\n <wlcm-table-row-spacer></wlcm-table-row-spacer>\n }\n @let context =\n {\n $implicit: row,\n selectId: selectId(),\n isRowSelectable: isRowSelectable(),\n index: index,\n first: first,\n last: last,\n };\n <ng-container>\n <ng-container\n *ngTemplateOutlet=\"\n rowTemplate();\n context: context;\n injector: context | wlcmTableRowInjector\n \"\n >\n </ng-container>\n </ng-container>\n }\n</tbody>\n" }]
|
|
179
|
+
}], ctorParameters: () => [], propDecorators: { rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], headTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "headTemplate", required: false }] }], rowTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowTemplate", required: true }] }], isRowSelectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "isRowSelectable", required: false }] }], selectId: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectId", required: false }] }], trackBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "trackBy", required: false }] }], selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }] } });
|
|
181
180
|
|
|
182
|
-
|
|
183
|
-
constructor(
|
|
184
|
-
this.selectionModel = selectionModel;
|
|
181
|
+
class WlcmTableHeadActionsComponent {
|
|
182
|
+
constructor() {
|
|
185
183
|
this.control = new FormControl(false);
|
|
184
|
+
this.selectionModel = inject(WlcmTableSelectionModel);
|
|
185
|
+
this.destroyRef = inject(DestroyRef);
|
|
186
186
|
this.handleSelectionChange();
|
|
187
187
|
}
|
|
188
188
|
toggle(isChecked) {
|
|
@@ -193,73 +193,59 @@ let WlcmTableHeadActionsComponent = class WlcmTableHeadActionsComponent {
|
|
|
193
193
|
}
|
|
194
194
|
handleSelectionChange() {
|
|
195
195
|
this.selectionModel.allSelected
|
|
196
|
-
.pipe(
|
|
196
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
197
197
|
.subscribe((isSelected) => this.control.setValue(isSelected));
|
|
198
198
|
}
|
|
199
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
200
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
201
|
-
}
|
|
202
|
-
WlcmTableHeadActionsComponent
|
|
203
|
-
UntilDestroy(),
|
|
204
|
-
__metadata("design:paramtypes", [WlcmTableSelectionModel])
|
|
205
|
-
], WlcmTableHeadActionsComponent);
|
|
206
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmTableHeadActionsComponent, decorators: [{
|
|
199
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmTableHeadActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
200
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.5", type: WlcmTableHeadActionsComponent, isStandalone: true, selector: "wlcm-table-head-actions", host: { classAttribute: "wlcm-table-head-actions" }, ngImport: i0, template: "<wlcm-checkbox\n [formControl]=\"control\"\n (changed)=\"toggle($event)\"\n></wlcm-checkbox>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: WlcmFormsModule }, { kind: "component", type: i1$1.WlcmCheckboxComponent, selector: "wlcm-checkbox", inputs: ["value"], outputs: ["changed"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
201
|
+
}
|
|
202
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmTableHeadActionsComponent, decorators: [{
|
|
207
203
|
type: Component,
|
|
208
|
-
args: [{ selector: 'wlcm-table-head-actions', host: { class: 'wlcm-table-head-actions' },
|
|
209
|
-
}], ctorParameters: () => [
|
|
204
|
+
args: [{ selector: 'wlcm-table-head-actions', host: { class: 'wlcm-table-head-actions' }, imports: [WlcmFormsModule, ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<wlcm-checkbox\n [formControl]=\"control\"\n (changed)=\"toggle($event)\"\n></wlcm-checkbox>\n" }]
|
|
205
|
+
}], ctorParameters: () => [] });
|
|
210
206
|
|
|
211
207
|
class WlcmTableHeadComponent {
|
|
212
|
-
constructor(
|
|
213
|
-
this.tableConfigManager =
|
|
208
|
+
constructor() {
|
|
209
|
+
this.tableConfigManager = inject(TableConfigManager);
|
|
214
210
|
}
|
|
215
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
216
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
211
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmTableHeadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
212
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: WlcmTableHeadComponent, isStandalone: true, selector: "wlcm-table-head", host: { classAttribute: "wlcm-table-head" }, ngImport: i0, template: "@if (tableConfigManager.selectable) {\n <wlcm-table-head-actions></wlcm-table-head-actions>\n}\n\n<ng-content select=\"wlcm-table-head-data\"></ng-content>\n", styles: [""], dependencies: [{ kind: "component", type: WlcmTableHeadActionsComponent, selector: "wlcm-table-head-actions" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
217
213
|
}
|
|
218
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
214
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmTableHeadComponent, decorators: [{
|
|
219
215
|
type: Component,
|
|
220
|
-
args: [{ selector: 'wlcm-table-head', host: { class: 'wlcm-table-head' },
|
|
221
|
-
}]
|
|
216
|
+
args: [{ selector: 'wlcm-table-head', host: { class: 'wlcm-table-head' }, imports: [WlcmTableHeadActionsComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (tableConfigManager.selectable) {\n <wlcm-table-head-actions></wlcm-table-head-actions>\n}\n\n<ng-content select=\"wlcm-table-head-data\"></ng-content>\n" }]
|
|
217
|
+
}] });
|
|
222
218
|
|
|
223
219
|
class WlcmTableHeadDataComponent {
|
|
224
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
225
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
220
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmTableHeadDataComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
221
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.5", type: WlcmTableHeadDataComponent, isStandalone: true, selector: "wlcm-table-head-data", host: { classAttribute: "wlcm-table-head-data" }, ngImport: i0, template: "<ng-content></ng-content>\n", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
226
222
|
}
|
|
227
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
223
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmTableHeadDataComponent, decorators: [{
|
|
228
224
|
type: Component,
|
|
229
|
-
args: [{ selector: 'wlcm-table-head-data', host: { class: 'wlcm-table-head-data' },
|
|
225
|
+
args: [{ selector: 'wlcm-table-head-data', host: { class: 'wlcm-table-head-data' }, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>\n" }]
|
|
230
226
|
}] });
|
|
231
227
|
|
|
232
228
|
class WlcmTableRowActionsComponent {
|
|
233
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
234
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
229
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmTableRowActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
230
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.5", type: WlcmTableRowActionsComponent, isStandalone: true, selector: "wlcm-table-row-actions", host: { classAttribute: "wlcm-table-row-actions" }, ngImport: i0, template: "<ng-content></ng-content>\n", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
235
231
|
}
|
|
236
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
232
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmTableRowActionsComponent, decorators: [{
|
|
237
233
|
type: Component,
|
|
238
|
-
args: [{ selector: 'wlcm-table-row-actions', host: { class: 'wlcm-table-row-actions' },
|
|
234
|
+
args: [{ selector: 'wlcm-table-row-actions', host: { class: 'wlcm-table-row-actions' }, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>\n" }]
|
|
239
235
|
}] });
|
|
240
236
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
return this.rowContext.first;
|
|
244
|
-
}
|
|
245
|
-
get last() {
|
|
246
|
-
return this.rowContext.last;
|
|
247
|
-
}
|
|
248
|
-
constructor(elementRef, tableConfigManager, selectionModel, rowContext) {
|
|
249
|
-
this.elementRef = elementRef;
|
|
250
|
-
this.tableConfigManager = tableConfigManager;
|
|
251
|
-
this.selectionModel = selectionModel;
|
|
237
|
+
class WlcmTableRowComponent {
|
|
238
|
+
constructor(rowContext) {
|
|
252
239
|
this.rowContext = rowContext;
|
|
253
|
-
this.isSelected = signal(false
|
|
254
|
-
|
|
255
|
-
this.
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
this.
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
this.isSelectable.update(() => value && this.rowContext.isRowSelectable(rowContext.$implicit));
|
|
240
|
+
this.isSelected = signal(false, /* @ts-ignore */
|
|
241
|
+
...(ngDevMode ? [{ debugName: "isSelected" }] : /* istanbul ignore next */ []));
|
|
242
|
+
this.isSelectable = signal(false, /* @ts-ignore */
|
|
243
|
+
...(ngDevMode ? [{ debugName: "isSelectable" }] : /* istanbul ignore next */ []));
|
|
244
|
+
this.destroyRef = inject(DestroyRef);
|
|
245
|
+
this.tableConfigManager = inject(TableConfigManager);
|
|
246
|
+
this.selectionModel = inject(WlcmTableSelectionModel);
|
|
247
|
+
this.tableConfigManager.selectable$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((value) => {
|
|
248
|
+
this.isSelectable.set(value && this.rowContext.isRowSelectable(this.rowContext.$implicit));
|
|
263
249
|
if (this.isSelectable()) {
|
|
264
250
|
this.rowId = this.rowContext.selectId(this.rowContext.$implicit);
|
|
265
251
|
this.handleSelectionChanges();
|
|
@@ -275,87 +261,69 @@ let WlcmTableRowComponent = class WlcmTableRowComponent {
|
|
|
275
261
|
}
|
|
276
262
|
handleSelectionChanges() {
|
|
277
263
|
this.selectionModel.selectionChanged
|
|
278
|
-
.pipe(
|
|
264
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
279
265
|
.pipe(takeUntil(this.tableConfigManager.selectable$.pipe(skip(1))))
|
|
280
266
|
.pipe(map((collection) => collection.has(this.rowId)))
|
|
281
267
|
.pipe(filter((isSelected) => isSelected !== this.isSelected()))
|
|
282
|
-
.
|
|
283
|
-
.subscribe((isSelected) => {
|
|
284
|
-
this.isSelected.set(isSelected);
|
|
285
|
-
isSelected ? this.markAsSelected() : this.markAsUnselected();
|
|
286
|
-
});
|
|
268
|
+
.subscribe((isSelected) => this.isSelected.set(isSelected));
|
|
287
269
|
}
|
|
288
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
289
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
290
|
-
}
|
|
291
|
-
WlcmTableRowComponent
|
|
292
|
-
UntilDestroy(),
|
|
293
|
-
__metadata("design:paramtypes", [ElementRef,
|
|
294
|
-
TableConfigManager,
|
|
295
|
-
WlcmTableSelectionModel, Object])
|
|
296
|
-
], WlcmTableRowComponent);
|
|
297
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmTableRowComponent, decorators: [{
|
|
270
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmTableRowComponent, deps: [{ token: WLCM_TABLE_ROW_CONTEXT }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
271
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: WlcmTableRowComponent, isStandalone: true, selector: "wlcm-table-row", host: { properties: { "class.wlcm-table-row-first": "rowContext.first", "class.wlcm-table-row-last": "rowContext.last", "class.wlcm-table-row-selected": "isSelected()" }, classAttribute: "wlcm-table-row" }, ngImport: i0, template: "@if (tableConfigManager.selectable) {\n <wlcm-table-row-actions>\n @if (isSelectable()) {\n <wlcm-checkbox\n [ngModel]=\"isSelected()\"\n (changed)=\"selectionChanged($event)\"\n ></wlcm-checkbox>\n }\n </wlcm-table-row-actions>\n}\n\n<ng-content select=\"wlcm-table-row-data\"></ng-content>\n", styles: [""], dependencies: [{ kind: "component", type: WlcmTableRowActionsComponent, selector: "wlcm-table-row-actions" }, { kind: "ngmodule", type: WlcmFormsModule }, { kind: "component", type: i1$1.WlcmCheckboxComponent, selector: "wlcm-checkbox", inputs: ["value"], outputs: ["changed"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
272
|
+
}
|
|
273
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmTableRowComponent, decorators: [{
|
|
298
274
|
type: Component,
|
|
299
|
-
args: [{ selector: 'wlcm-table-row', host: {
|
|
300
|
-
|
|
275
|
+
args: [{ selector: 'wlcm-table-row', host: {
|
|
276
|
+
class: 'wlcm-table-row',
|
|
277
|
+
'[class.wlcm-table-row-first]': 'rowContext.first',
|
|
278
|
+
'[class.wlcm-table-row-last]': 'rowContext.last',
|
|
279
|
+
'[class.wlcm-table-row-selected]': 'isSelected()',
|
|
280
|
+
}, imports: [WlcmTableRowActionsComponent, WlcmFormsModule, FormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (tableConfigManager.selectable) {\n <wlcm-table-row-actions>\n @if (isSelectable()) {\n <wlcm-checkbox\n [ngModel]=\"isSelected()\"\n (changed)=\"selectionChanged($event)\"\n ></wlcm-checkbox>\n }\n </wlcm-table-row-actions>\n}\n\n<ng-content select=\"wlcm-table-row-data\"></ng-content>\n" }]
|
|
281
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
301
282
|
type: Inject,
|
|
302
283
|
args: [WLCM_TABLE_ROW_CONTEXT]
|
|
303
|
-
}] }]
|
|
304
|
-
type: HostBinding,
|
|
305
|
-
args: ['class.wlcm-table-row-first']
|
|
306
|
-
}], last: [{
|
|
307
|
-
type: HostBinding,
|
|
308
|
-
args: ['class.wlcm-table-row-last']
|
|
309
|
-
}] } });
|
|
284
|
+
}] }] });
|
|
310
285
|
|
|
311
286
|
class WlcmTableRowDataComponent {
|
|
312
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
313
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
287
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmTableRowDataComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
288
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.5", type: WlcmTableRowDataComponent, isStandalone: true, selector: "wlcm-table-row-data", host: { classAttribute: "wlcm-table-row-data" }, ngImport: i0, template: "<ng-content></ng-content>\n", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
314
289
|
}
|
|
315
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
290
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmTableRowDataComponent, decorators: [{
|
|
316
291
|
type: Component,
|
|
317
|
-
args: [{ selector: 'wlcm-table-row-data', host: { class: 'wlcm-table-row-data' },
|
|
292
|
+
args: [{ selector: 'wlcm-table-row-data', host: { class: 'wlcm-table-row-data' }, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>\n" }]
|
|
318
293
|
}] });
|
|
319
294
|
|
|
320
|
-
|
|
321
|
-
constructor(
|
|
322
|
-
this.
|
|
323
|
-
|
|
324
|
-
this.scrollDownOffsetPercent = input(0.8);
|
|
295
|
+
class WlcmScrollableTableContainerDirective {
|
|
296
|
+
constructor() {
|
|
297
|
+
this.scrollDownOffsetPercent = input(0.8, /* @ts-ignore */
|
|
298
|
+
...(ngDevMode ? [{ debugName: "scrollDownOffsetPercent" }] : /* istanbul ignore next */ []));
|
|
325
299
|
this.scrolledDown = output();
|
|
300
|
+
this.elementRef = inject(ElementRef);
|
|
326
301
|
this.handleScrolling();
|
|
327
302
|
}
|
|
328
303
|
get element() {
|
|
329
304
|
return this.elementRef.nativeElement;
|
|
330
305
|
}
|
|
331
306
|
handleScrolling() {
|
|
332
|
-
this.
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
}
|
|
341
|
-
});
|
|
307
|
+
fromEvent(this.element, 'scroll', { passive: true })
|
|
308
|
+
.pipe(debounceTime(50))
|
|
309
|
+
.pipe(takeUntilDestroyed())
|
|
310
|
+
.subscribe(() => {
|
|
311
|
+
if (this.element.scrollHeight * this.scrollDownOffsetPercent() <=
|
|
312
|
+
this.element.scrollTop + this.element.clientHeight) {
|
|
313
|
+
this.scrolledDown.emit();
|
|
314
|
+
}
|
|
342
315
|
});
|
|
343
316
|
}
|
|
344
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
345
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
346
|
-
}
|
|
347
|
-
WlcmScrollableTableContainerDirective
|
|
348
|
-
UntilDestroy(),
|
|
349
|
-
__metadata("design:paramtypes", [NgZone, ElementRef])
|
|
350
|
-
], WlcmScrollableTableContainerDirective);
|
|
351
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmScrollableTableContainerDirective, decorators: [{
|
|
317
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmScrollableTableContainerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
318
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.5", type: WlcmScrollableTableContainerDirective, isStandalone: true, selector: "[wlcmScrollableTableContainer]", inputs: { scrollDownOffsetPercent: { classPropertyName: "scrollDownOffsetPercent", publicName: "scrollDownOffsetPercent", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { scrolledDown: "scrolledDown" }, host: { classAttribute: "wlcm-scrollable-table-container" }, ngImport: i0 }); }
|
|
319
|
+
}
|
|
320
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmScrollableTableContainerDirective, decorators: [{
|
|
352
321
|
type: Directive,
|
|
353
322
|
args: [{
|
|
354
323
|
selector: '[wlcmScrollableTableContainer]',
|
|
355
324
|
host: { class: 'wlcm-scrollable-table-container' },
|
|
356
|
-
standalone: true,
|
|
357
325
|
}]
|
|
358
|
-
}], ctorParameters: () => [{ type: i0.
|
|
326
|
+
}], ctorParameters: () => [], propDecorators: { scrollDownOffsetPercent: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollDownOffsetPercent", required: false }] }], scrolledDown: [{ type: i0.Output, args: ["scrolledDown"] }] } });
|
|
359
327
|
|
|
360
328
|
const publicComponents = [
|
|
361
329
|
WlcmTableComponent,
|
|
@@ -366,8 +334,8 @@ const publicComponents = [
|
|
|
366
334
|
];
|
|
367
335
|
const publicDirectives = [WlcmScrollableTableContainerDirective];
|
|
368
336
|
class WlcmTableModule {
|
|
369
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
370
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
337
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmTableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
338
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.5", ngImport: i0, type: WlcmTableModule, imports: [CommonModule, WlcmTableComponent,
|
|
371
339
|
WlcmTableHeadComponent,
|
|
372
340
|
WlcmTableHeadDataComponent,
|
|
373
341
|
WlcmTableRowDataComponent,
|
|
@@ -376,9 +344,11 @@ class WlcmTableModule {
|
|
|
376
344
|
WlcmTableHeadDataComponent,
|
|
377
345
|
WlcmTableRowDataComponent,
|
|
378
346
|
WlcmTableRowComponent, WlcmScrollableTableContainerDirective] }); }
|
|
379
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
347
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmTableModule, imports: [CommonModule, WlcmTableComponent,
|
|
348
|
+
WlcmTableHeadComponent,
|
|
349
|
+
WlcmTableRowComponent] }); }
|
|
380
350
|
}
|
|
381
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
351
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmTableModule, decorators: [{
|
|
382
352
|
type: NgModule,
|
|
383
353
|
args: [{
|
|
384
354
|
imports: [CommonModule, ...publicComponents, ...publicDirectives],
|