@theseam/ui-common 0.4.12 → 0.4.14
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/buttons/public-api.d.ts +1 -0
- package/buttons/testing/anchor-badge-button.harness.d.ts +16 -0
- package/buttons/testing/anchor-button.harness.d.ts +16 -0
- package/buttons/testing/badge-button.harness.d.ts +15 -0
- package/buttons/testing/base-badge-button.harness.d.ts +15 -0
- package/buttons/testing/base-button.harness.d.ts +19 -0
- package/buttons/testing/button.harness.d.ts +15 -0
- package/buttons/testing/index.d.ts +5 -0
- package/buttons/testing/toggle-button.harness.d.ts +21 -0
- package/checkbox/checkbox.component.d.ts +1 -1
- package/checkbox/checkbox.module.d.ts +2 -3
- package/datatable/datatable.module.d.ts +1 -1
- package/esm2020/buttons/button/button.component.mjs +2 -1
- package/esm2020/buttons/public-api.mjs +2 -1
- package/esm2020/buttons/testing/anchor-badge-button.harness.mjs +18 -0
- package/esm2020/buttons/testing/anchor-button.harness.mjs +18 -0
- package/esm2020/buttons/testing/badge-button.harness.mjs +14 -0
- package/esm2020/buttons/testing/base-badge-button.harness.mjs +29 -0
- package/esm2020/buttons/testing/base-button.harness.mjs +41 -0
- package/esm2020/buttons/testing/button.harness.mjs +16 -0
- package/esm2020/buttons/testing/index.mjs +6 -0
- package/esm2020/buttons/testing/toggle-button.harness.mjs +25 -0
- package/esm2020/checkbox/checkbox.component.mjs +8 -3
- package/esm2020/checkbox/checkbox.module.mjs +5 -12
- package/esm2020/datatable/datatable.module.mjs +5 -5
- package/esm2020/form-field/form-field.component.mjs +4 -4
- package/esm2020/framework/schema-form/index.mjs +2 -1
- package/esm2020/framework/schema-form/schema-form-framework.component.mjs +6 -3
- package/esm2020/framework/schema-form/schema-form-framework.mjs +62 -7
- package/esm2020/framework/schema-form/schema-form-widget.mjs +2 -0
- package/esm2020/framework/schema-form/schema-form.module.mjs +1 -8
- package/esm2020/framework/schema-form-controls/schema-form-checkbox/schema-form-checkbox.component.mjs +21 -11
- package/esm2020/framework/schema-form-controls/schema-form-divider/schema-form-divider.component.mjs +20 -0
- package/esm2020/framework/schema-form-controls/schema-form-input/schema-form-input.component.mjs +17 -8
- package/esm2020/framework/schema-form-controls/schema-form-number/schema-form-number.component.mjs +14 -5
- package/esm2020/framework/schema-form-controls/schema-form-select/schema-form-select.component.mjs +19 -9
- package/esm2020/framework/schema-form-controls/schema-form-submit/schema-form-submit.component.mjs +21 -13
- package/esm2020/framework/schema-form-controls/schema-form-submit-split/schema-form-submit-split.component.mjs +30 -18
- package/esm2020/framework/schema-form-controls/schema-form-tel/schema-form-tel.component.mjs +48 -0
- package/esm2020/framework/schema-form-controls/schema-form-tiled-select/schema-form-tiled-select.component.mjs +57 -0
- package/esm2020/google-maps/google-maps-places-autocomplete/google-maps-places-autocomplete.component.mjs +3 -3
- package/esm2020/menu/menu-item.component.mjs +3 -3
- package/esm2020/menu/public-api.mjs +5 -1
- package/esm2020/menu/testing/menu-footer.harness.mjs +28 -0
- package/esm2020/menu/testing/menu-header.harness.mjs +23 -0
- package/esm2020/menu/testing/menu-item.harness.mjs +59 -0
- package/esm2020/menu/testing/menu.harness.mjs +163 -0
- package/esm2020/menu/testing/utils.mjs +13 -0
- package/esm2020/services/preferences/preferences-accessor.mjs +1 -1
- package/esm2020/services/preferences/preferences-manager.service.mjs +1 -1
- package/esm2020/services/preferences/preferences-record.mjs +1 -1
- package/esm2020/services/preferences/preferences.models.mjs +1 -1
- package/esm2020/story-helpers/args-to-tpl.mjs +83 -0
- package/esm2020/story-helpers/public-api.mjs +2 -2
- package/esm2020/story-helpers/story-preferences-accessor.service.mjs +1 -1
- package/esm2020/tel-input/public-api.mjs +2 -1
- package/esm2020/tel-input/tel-input/tel-input.component.mjs +22 -10
- package/esm2020/tel-input/tel-input.directive.mjs +12 -13
- package/esm2020/tel-input/tel-input.module.mjs +10 -9
- package/esm2020/tel-input/testing/tel-input.harness.mjs +49 -0
- package/esm2020/testing/harnesses/ng-select-dropdown.harness.mjs +39 -0
- package/esm2020/testing/harnesses/ng-select-option.harness.mjs +26 -0
- package/esm2020/testing/harnesses/ng-select.harness.mjs +104 -0
- package/esm2020/testing/public-api.mjs +4 -1
- package/esm2020/tiled-select/components/tiled-select/tiled-select.component.mjs +1 -1
- package/esm2020/utils/geo-json/coerce-feature-collection.mjs +1 -1
- package/esm2020/utils/geo-json/is-feature-collection.validator.mjs +1 -1
- package/esm2020/utils/geo-json/is-only-geometry-types.mjs +1 -1
- package/esm2020/utils/geo-json/merge-polygons.mjs +1 -1
- package/esm2020/utils/geo-json/no-inner-rings.validator.mjs +1 -1
- package/esm2020/utils/geo-json/split-multi-polygons.mjs +1 -1
- package/esm2020/widget/preferences/widget-preferences.models.mjs +1 -1
- package/esm2020/widget/preferences/widget-preferences.service.mjs +1 -1
- package/esm2020/widget/preferences/widget-preferences.token.mjs +1 -1
- package/esm2020/widget/widget.models.mjs +1 -1
- package/fesm2015/theseam-ui-common-buttons.mjs +181 -3
- package/fesm2015/theseam-ui-common-buttons.mjs.map +1 -1
- package/fesm2015/theseam-ui-common-checkbox.mjs +12 -14
- package/fesm2015/theseam-ui-common-checkbox.mjs.map +1 -1
- package/fesm2015/theseam-ui-common-datatable.mjs +4 -4
- package/fesm2015/theseam-ui-common-datatable.mjs.map +1 -1
- package/fesm2015/theseam-ui-common-form-field.mjs +3 -3
- package/fesm2015/theseam-ui-common-form-field.mjs.map +1 -1
- package/fesm2015/theseam-ui-common-framework.mjs +248 -164
- package/fesm2015/theseam-ui-common-framework.mjs.map +1 -1
- package/fesm2015/theseam-ui-common-google-maps.mjs +2 -2
- package/fesm2015/theseam-ui-common-google-maps.mjs.map +1 -1
- package/fesm2015/theseam-ui-common-menu.mjs +331 -5
- package/fesm2015/theseam-ui-common-menu.mjs.map +1 -1
- package/fesm2015/theseam-ui-common-services.mjs.map +1 -1
- package/fesm2015/theseam-ui-common-story-helpers.mjs +86 -1
- package/fesm2015/theseam-ui-common-story-helpers.mjs.map +1 -1
- package/fesm2015/theseam-ui-common-tel-input.mjs +105 -29
- package/fesm2015/theseam-ui-common-tel-input.mjs.map +1 -1
- package/fesm2015/theseam-ui-common-testing.mjs +197 -1
- package/fesm2015/theseam-ui-common-testing.mjs.map +1 -1
- package/fesm2015/theseam-ui-common-tiled-select.mjs.map +1 -1
- package/fesm2015/theseam-ui-common-utils.mjs.map +1 -1
- package/fesm2015/theseam-ui-common-widget.mjs.map +1 -1
- package/fesm2020/theseam-ui-common-buttons.mjs +154 -2
- package/fesm2020/theseam-ui-common-buttons.mjs.map +1 -1
- package/fesm2020/theseam-ui-common-checkbox.mjs +12 -14
- package/fesm2020/theseam-ui-common-checkbox.mjs.map +1 -1
- package/fesm2020/theseam-ui-common-datatable.mjs +4 -4
- package/fesm2020/theseam-ui-common-datatable.mjs.map +1 -1
- package/fesm2020/theseam-ui-common-form-field.mjs +3 -3
- package/fesm2020/theseam-ui-common-form-field.mjs.map +1 -1
- package/fesm2020/theseam-ui-common-framework.mjs +236 -162
- package/fesm2020/theseam-ui-common-framework.mjs.map +1 -1
- package/fesm2020/theseam-ui-common-google-maps.mjs +2 -2
- package/fesm2020/theseam-ui-common-google-maps.mjs.map +1 -1
- package/fesm2020/theseam-ui-common-menu.mjs +277 -4
- package/fesm2020/theseam-ui-common-menu.mjs.map +1 -1
- package/fesm2020/theseam-ui-common-services.mjs.map +1 -1
- package/fesm2020/theseam-ui-common-story-helpers.mjs +84 -1
- package/fesm2020/theseam-ui-common-story-helpers.mjs.map +1 -1
- package/fesm2020/theseam-ui-common-tel-input.mjs +89 -29
- package/fesm2020/theseam-ui-common-tel-input.mjs.map +1 -1
- package/fesm2020/theseam-ui-common-testing.mjs +165 -1
- package/fesm2020/theseam-ui-common-testing.mjs.map +1 -1
- package/fesm2020/theseam-ui-common-tiled-select.mjs.map +1 -1
- package/fesm2020/theseam-ui-common-utils.mjs.map +1 -1
- package/fesm2020/theseam-ui-common-widget.mjs.map +1 -1
- package/framework/schema-form/index.d.ts +1 -0
- package/framework/schema-form/schema-form-framework.d.ts +12 -1
- package/framework/schema-form/schema-form-widget.d.ts +61 -0
- package/framework/schema-form/schema-form.module.d.ts +1 -2
- package/framework/schema-form-controls/schema-form-checkbox/schema-form-checkbox.component.d.ts +12 -11
- package/framework/schema-form-controls/schema-form-divider/schema-form-divider.component.d.ts +12 -0
- package/framework/schema-form-controls/schema-form-input/schema-form-input.component.d.ts +10 -9
- package/framework/schema-form-controls/schema-form-number/schema-form-number.component.d.ts +8 -7
- package/framework/schema-form-controls/schema-form-select/schema-form-select.component.d.ts +10 -9
- package/framework/schema-form-controls/schema-form-submit/schema-form-submit.component.d.ts +10 -9
- package/framework/schema-form-controls/schema-form-submit-split/schema-form-submit-split.component.d.ts +10 -9
- package/framework/schema-form-controls/schema-form-tel/schema-form-tel.component.d.ts +23 -0
- package/framework/schema-form-controls/schema-form-tiled-select/schema-form-tiled-select.component.d.ts +32 -0
- package/menu/menu-footer-action/menu-footer-action.component.d.ts +1 -1
- package/menu/public-api.d.ts +4 -0
- package/menu/testing/menu-footer.harness.d.ts +22 -0
- package/menu/testing/menu-header.harness.d.ts +18 -0
- package/menu/testing/menu-item.harness.d.ts +37 -0
- package/menu/testing/menu.harness.d.ts +74 -0
- package/menu/testing/utils.d.ts +5 -0
- package/package.json +1 -1
- package/story-helpers/args-to-tpl.d.ts +25 -0
- package/story-helpers/public-api.d.ts +1 -0
- package/tel-input/public-api.d.ts +1 -0
- package/tel-input/tel-input/tel-input.component.d.ts +2 -2
- package/tel-input/tel-input.directive.d.ts +1 -1
- package/tel-input/tel-input.module.d.ts +7 -7
- package/tel-input/testing/tel-input.harness.d.ts +19 -0
- package/testing/harnesses/ng-select-dropdown.harness.d.ts +23 -0
- package/testing/harnesses/ng-select-option.harness.d.ts +18 -0
- package/testing/harnesses/ng-select.harness.d.ts +50 -0
- package/testing/public-api.d.ts +3 -0
- package/tiled-select/components/tiled-select/tiled-select.component.d.ts +10 -10
- package/esm2020/framework/schema-form-controls/schema-form-controls.module.mjs +0 -79
- package/framework/schema-form-controls/schema-form-controls.module.d.ts +0 -20
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ThemeNames, OutlineThemeNames } from '@theseam/ui-common/models';
|
|
2
|
+
import { useStoryContext } from '@storybook/preview-api';
|
|
2
3
|
import * as i0 from '@angular/core';
|
|
3
4
|
import { Component, InjectionToken, Injectable, APP_INITIALIZER, NgModule, Injector, Input, ElementRef, APP_BOOTSTRAP_LISTENER } from '@angular/core';
|
|
4
5
|
import * as i1 from '@angular/router';
|
|
@@ -41,6 +42,90 @@ const buttonTypeArgType = {
|
|
|
41
42
|
description: `Button type.`
|
|
42
43
|
};
|
|
43
44
|
|
|
45
|
+
/**
|
|
46
|
+
* This is an attempt at simplifying the use of auto-generated args in stories
|
|
47
|
+
* defined with `template`, since Angular doesn't have a way to simply use a
|
|
48
|
+
* spread operator syntax.
|
|
49
|
+
*
|
|
50
|
+
* @experimental
|
|
51
|
+
*/
|
|
52
|
+
// export function argsToTplParts(args: any, argTypes: ArgTypes): ArgsTplParts {
|
|
53
|
+
// // console.log({ args, argTypes })
|
|
54
|
+
// const parts: ArgsTplParts = {
|
|
55
|
+
// actions: {},
|
|
56
|
+
// tplfragment: ''
|
|
57
|
+
// }
|
|
58
|
+
// Object.keys(argTypes).forEach(k => {
|
|
59
|
+
// // Inputs
|
|
60
|
+
// if (
|
|
61
|
+
// // Is in the inputs category
|
|
62
|
+
// argTypes[k].table.category === 'inputs' &&
|
|
63
|
+
// // Needs a control to be able to change from auto-generated args.
|
|
64
|
+
// argTypes[k]?.hasOwnProperty('control') &&
|
|
65
|
+
// // Assuming the arg might not be in props if there isn't an arg value.
|
|
66
|
+
// args.hasOwnProperty(k)
|
|
67
|
+
// ) {
|
|
68
|
+
// parts.tplfragment += `[${k}]="${k}" `
|
|
69
|
+
// }
|
|
70
|
+
// // Outputs
|
|
71
|
+
// if (
|
|
72
|
+
// // Is in the outputs category
|
|
73
|
+
// argTypes[k]?.table?.category === 'outputs'
|
|
74
|
+
// ) {
|
|
75
|
+
// // Without access to props, I don't know if I can get an action into the
|
|
76
|
+
// // template context like this.
|
|
77
|
+
// parts.tplfragment += `(${k})="${k}($event)" `
|
|
78
|
+
// parts.actions[k] = action(k)
|
|
79
|
+
// }
|
|
80
|
+
// })
|
|
81
|
+
// return parts
|
|
82
|
+
// }
|
|
83
|
+
function removeDuplicates(arr) {
|
|
84
|
+
const seen = {};
|
|
85
|
+
return arr.filter(item => {
|
|
86
|
+
if (!seen[item]) {
|
|
87
|
+
seen[item] = true;
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
return false;
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* This is an attempt at simplifying the use of auto-generated args in stories
|
|
95
|
+
* defined with `template`, since Angular doesn't have a way to simply use a
|
|
96
|
+
* spread operator syntax.
|
|
97
|
+
*
|
|
98
|
+
* @experimental
|
|
99
|
+
*/
|
|
100
|
+
function argsToTpl(options) {
|
|
101
|
+
var _a, _b, _c, _d;
|
|
102
|
+
const context = useStoryContext();
|
|
103
|
+
const exclude = [
|
|
104
|
+
...(((_b = (_a = context === null || context === void 0 ? void 0 : context.parameters) === null || _a === void 0 ? void 0 : _a.argsToTplOptions) === null || _b === void 0 ? void 0 : _b.exclude) || []),
|
|
105
|
+
...((options === null || options === void 0 ? void 0 : options.exclude) || []),
|
|
106
|
+
];
|
|
107
|
+
const alwaysBind = ((_d = (_c = context === null || context === void 0 ? void 0 : context.parameters) === null || _c === void 0 ? void 0 : _c.argsToTplOptions) === null || _d === void 0 ? void 0 : _d.alwaysBind) || [];
|
|
108
|
+
const props = removeDuplicates([
|
|
109
|
+
...alwaysBind,
|
|
110
|
+
...Object.keys(context.args),
|
|
111
|
+
]);
|
|
112
|
+
const parts = props
|
|
113
|
+
.filter(k => exclude.indexOf(k) === -1)
|
|
114
|
+
.map(k => {
|
|
115
|
+
var _a;
|
|
116
|
+
// Outputs
|
|
117
|
+
if (((_a = context.argTypes[k]) === null || _a === void 0 ? void 0 : _a.hasOwnProperty('action')) &&
|
|
118
|
+
(context.args.hasOwnProperty(k) || alwaysBind.indexOf(k) !== -1)) {
|
|
119
|
+
return `(${k})="${k}($event)"`;
|
|
120
|
+
}
|
|
121
|
+
// Inputs
|
|
122
|
+
if ((context.args.hasOwnProperty(k) || alwaysBind.indexOf(k) !== -1)) {
|
|
123
|
+
return `[${k}]="${k}"`;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
return parts.length > 0 ? parts.join(' ') : '';
|
|
127
|
+
}
|
|
128
|
+
|
|
44
129
|
class StoryEmptyComponent {
|
|
45
130
|
}
|
|
46
131
|
StoryEmptyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: StoryEmptyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -425,5 +510,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
425
510
|
* Generated bundle index. Do not edit.
|
|
426
511
|
*/
|
|
427
512
|
|
|
428
|
-
export { STORY_INITIAL_ROUTE_URL, StoryEmptyComponent, StoryEmptyWithRouteComponent, StoryHelperComponentsModule, StoryInitialRouteModule, StoryInitialRouteService, StoryModalContainerComponent, StoryPreferencesAccessorService, StoryToastrService, buttonTypeArgType, onStoryBootstrappedTrigger, routeButton, routesArgType, sizeArgType, storyInitialRouteFactory, themeArgType, themeWithOutlineArgType };
|
|
513
|
+
export { STORY_INITIAL_ROUTE_URL, StoryEmptyComponent, StoryEmptyWithRouteComponent, StoryHelperComponentsModule, StoryInitialRouteModule, StoryInitialRouteService, StoryModalContainerComponent, StoryPreferencesAccessorService, StoryToastrService, argsToTpl, buttonTypeArgType, onStoryBootstrappedTrigger, routeButton, routesArgType, sizeArgType, storyInitialRouteFactory, themeArgType, themeWithOutlineArgType };
|
|
429
514
|
//# sourceMappingURL=theseam-ui-common-story-helpers.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theseam-ui-common-story-helpers.mjs","sources":["../../../projects/ui-common/story-helpers/arg-type-helpers.ts","../../../projects/ui-common/story-helpers/story-empty.component.ts","../../../projects/ui-common/story-helpers/initial-route-factory.ts","../../../projects/ui-common/story-helpers/initial-route.service.ts","../../../projects/ui-common/story-helpers/story-initial-route.ts","../../../projects/ui-common/story-helpers/route-button.ts","../../../projects/ui-common/story-helpers/routes-arg-type.ts","../../../projects/ui-common/story-helpers/story-empty-with-route.component.ts","../../../projects/ui-common/story-helpers/story-modal-container.component.ts","../../../projects/ui-common/story-helpers/story-helper-components.module.ts","../../../projects/ui-common/story-helpers/story-toastr.service.ts","../../../projects/ui-common/story-helpers/on-story-bootstrapped-exec.ts","../../../projects/ui-common/story-helpers/on-story-bootstrapped-trigger.ts","../../../projects/ui-common/story-helpers/story-preferences-accessor.service.ts","../../../projects/ui-common/story-helpers/theseam-ui-common-story-helpers.ts"],"sourcesContent":["// import { ArgType } from '@storybook/addons'\n\nimport { OutlineThemeNames, ThemeNames } from '@theseam/ui-common/models'\n\ndeclare type ArgType = any\n\nexport const themeArgType: ArgType = {\n options: ThemeNames,\n control: {\n type: 'select',\n },\n description: `Theme style.`\n}\n\nexport const themeWithOutlineArgType: ArgType = {\n options: [ ...ThemeNames, ...OutlineThemeNames ],\n control: {\n type: 'select',\n },\n description: `Theme style.`\n}\n\nexport const sizeArgType: ArgType = {\n options: [ undefined, 'sm', 'lg' ],\n control: {\n type: 'select',\n },\n description: `Size.`\n}\n\nexport const buttonTypeArgType: ArgType = {\n options: [ 'button', 'submit' ],\n control: {\n type: 'select',\n },\n description: `Button type.`\n}\n","import { Component } from '@angular/core'\n\n@Component({ template: `` })\nexport class StoryEmptyComponent { }\n","import { StoryInitialRouteService } from './initial-route.service'\n\nexport function storyInitialRouteFactory(_storyInitialRouteService: StoryInitialRouteService) {\n return () => _storyInitialRouteService.setInitialRoute()\n}\n","import { Injectable, InjectionToken, Injector } from '@angular/core'\nimport { NavigationEnd, Router } from '@angular/router'\nimport { filter, take } from 'rxjs/operators'\n\nexport const STORY_INITIAL_ROUTE_URL = new InjectionToken<any>('STORY_INITIAL_ROUTE_URL')\n\n@Injectable()\nexport class StoryInitialRouteService {\n\n constructor(\n private _injector: Injector\n ) { }\n\n public setInitialRoute() {\n const _router = this._injector.get(Router)\n const url = this._injector.get(STORY_INITIAL_ROUTE_URL)\n if (_router.navigated) {\n _router.navigateByUrl(url)\n } else {\n _router.events.pipe(\n filter(e => e instanceof NavigationEnd),\n take(1)\n )\n .subscribe(() => { _router.navigateByUrl(url) })\n }\n }\n\n}\n","import { APP_INITIALIZER, ModuleWithProviders, NgModule } from '@angular/core'\n\nimport { storyInitialRouteFactory } from './initial-route-factory'\nimport { StoryInitialRouteService, STORY_INITIAL_ROUTE_URL } from './initial-route.service'\n\n@NgModule()\nexport class StoryInitialRouteModule {\n static forRoot(url: string): ModuleWithProviders<StoryInitialRouteModule> {\n return {\n ngModule: StoryInitialRouteModule,\n providers: [\n StoryInitialRouteService,\n {\n provide: APP_INITIALIZER,\n useFactory: storyInitialRouteFactory,\n deps: [ StoryInitialRouteService ],\n multi: true\n },\n { provide: STORY_INITIAL_ROUTE_URL, useValue: url }\n ]\n }\n }\n\n}\n","// import { button } from '@storybook/addon-knobs'\n\n/**\n * Until I find a way to avoid '@storybook/addon-knobs' from interfering with\n * NgZone I can't import it in the knob when built by ng-packagr.\n */\nexport function routeButton(buttonKnob: any, url: string) {\n return buttonKnob(url, () => {\n location.hash = `#${url}`\n return false\n })\n}\n","// import { ArgType } from '@storybook/addons'\n\ndeclare const __STORYBOOK_ADDONS: any\n\nfunction goToHashUrl(url: string): void { location.hash = `#${url}` }\n\n// __STORYBOOK_ADDONS.getChannel().on('custom/go-to-hash', (data: { hash: string }) => {\n\n// goToHashUrl(data.hash)\n// })\n\n// __STORYBOOK_ADDONS.getChannel().on('storyArgsUpdated', (data: { hash: string }) => {\n// console.log('storyArgsUpdated')\n// })\n\nexport function routesArgType(routes: string[])/*: ArgType*/ {\n return {\n options: routes,\n control: {\n type: 'select',\n // Runs in the 'manager', so I am emitting to a channel in the 'preview'.\n onChange: (e: any, a: any) => { __STORYBOOK_ADDONS.getChannel().emit('custom/go-to-hash', { hash: e }); return e }\n }\n }\n}\n","import { Component } from '@angular/core'\n\n@Component({ template: `<router-outlet></router-outlet>` })\nexport class StoryEmptyWithRouteComponent { }\n","import { Component, Injector, Input, OnDestroy } from '@angular/core'\nimport { combineLatest, Observable, of, ReplaySubject, Subject } from 'rxjs'\nimport { auditTime, map, startWith, takeUntil } from 'rxjs/operators'\n\nimport { ModalConfig, ModalRef, MODAL_DATA } from '@theseam/ui-common/modal'\nimport type { ComponentType } from '@theseam/ui-common/models'\n\nclass FakeModalRef<T, R = any> implements Partial<ModalRef<T, R>> {\n\n afterOpened() { return of(undefined) }\n\n close(dialogResult?: R): void { }\n\n}\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'story-modal-container-component',\n template: `\n <div class=\"cdk-overlay-container\">\n <div class=\"cdk-overlay-backdrop cdk-overlay-dark-backdrop cdk-overlay-backdrop-showing\"></div>\n <div class=\"cdk-global-overlay-wrapper\"\n dir=\"ltr\"\n style=\"justify-content: flex-start; align-items: center; pointer-events: auto\"\n seamOverlayScrollbar>\n <div class=\"seam-modal-container modal-dialog modal-dialog-centered {{ modalConfig ? modalConfig.modalSize : 'modal-lg' }}\"\n tabindex=\"-1\"\n [class.modal-lg]=\"!modalConfig\">\n <div class=\"modal-content\">\n <ng-container *ngIf=\"_outletData$ | async as outletData\">\n <ng-container *ngComponentOutlet=\"outletData.component; injector: outletData.injector;\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n </div>\n `,\n styles: [`\n .seam-modal-container[tabindex=\"-1\"]:focus {\n outline: 0 !important;\n }\n `]\n})\nexport class StoryModalContainerComponent<T, D = any> implements OnDestroy {\n\n private readonly _ngUnsubscribe = new Subject<void>()\n\n @Input() set component(c: ComponentType<T>) { this._component.next(c) }\n @Input() set data(d: D) { this._data.next(d) }\n\n @Input() modalConfig?: ModalConfig<D>\n\n _component = new ReplaySubject<ComponentType<T>>(1)\n _data = new ReplaySubject<D>(1)\n\n _outletData$: Observable<{ component: ComponentType<T>, injector: Injector } | null>\n\n constructor(\n private _injector: Injector\n ) {\n this._outletData$ = combineLatest([\n this._component.asObservable(),\n this._data.asObservable().pipe(startWith(undefined))\n ]).pipe(\n auditTime(0),\n map(([ component, data ]) => ({\n component,\n injector: this._createInjector(data)\n })),\n takeUntil(this._ngUnsubscribe)\n )\n }\n\n ngOnDestroy() {\n this._ngUnsubscribe.next(undefined)\n this._ngUnsubscribe.complete()\n }\n\n private _createInjector(data?: D): Injector {\n return Injector.create({\n providers: [\n { provide: ModalRef, useClass: FakeModalRef, deps: [] },\n { provide: MODAL_DATA, useValue: data }\n ],\n parent: this._injector\n })\n }\n\n}\n","import { CommonModule } from '@angular/common'\nimport { NgModule } from '@angular/core'\nimport { RouterModule } from '@angular/router'\n\nimport { TheSeamScrollbarModule } from '@theseam/ui-common/scrollbar'\n\nimport { StoryEmptyWithRouteComponent } from './story-empty-with-route.component'\nimport { StoryEmptyComponent } from './story-empty.component'\nimport { StoryModalContainerComponent } from './story-modal-container.component'\n\n@NgModule({\n declarations: [\n StoryEmptyComponent,\n StoryEmptyWithRouteComponent,\n StoryModalContainerComponent\n ],\n imports: [\n CommonModule,\n RouterModule,\n TheSeamScrollbarModule\n ],\n exports: [\n StoryEmptyComponent,\n StoryEmptyWithRouteComponent,\n StoryModalContainerComponent\n ]\n})\nexport class StoryHelperComponentsModule { }\n","import { Injectable } from '@angular/core'\n\nimport { ActiveToast, GlobalConfig, IndividualConfig, ToastContainerDirective } from 'ngx-toastr'\n\n@Injectable()\nexport class StoryToastrService {\n toastrConfig?: GlobalConfig\n currentlyActive = 0\n toasts: ActiveToast<any>[] = []\n overlayContainer?: ToastContainerDirective\n previousToastMessage: string | undefined\n\n /** show toast */\n show(\n message?: string,\n title?: string,\n override: Partial<IndividualConfig> = {},\n type = ''\n ) { }\n\n /** show successful toast */\n success(\n message?: string,\n title?: string,\n override: Partial<IndividualConfig> = {}\n ) { }\n\n /** show error toast */\n error(\n message?: string,\n title?: string,\n override: Partial<IndividualConfig> = {}\n ) { }\n\n /** show info toast */\n info(\n message?: string,\n title?: string,\n override: Partial<IndividualConfig> = {}\n ) { }\n\n /** show warning toast */\n warning(\n message?: string,\n title?: string,\n override: Partial<IndividualConfig> = {}\n ) { }\n\n /**\n * Remove all or a single toast by id\n */\n clear(toastId?: number) { }\n\n /**\n * Remove and destroy a single toast by id\n */\n remove(toastId: number) { }\n\n /**\n * Determines if toast message is already shown\n */\n findDuplicate(message: string, resetOnDuplicate: boolean, countDuplicates: boolean) { }\n\n}\n","import { APP_BOOTSTRAP_LISTENER, ComponentRef } from '@angular/core'\n// import { STORY } from '@storybook/angular/dist/ts3.9/client/preview/angular/app.token'\n// import { StoryFnAngularReturnType } from '@storybook/angular/dist/ts3.9/client/preview/types'\nimport { Observable } from 'rxjs'\nimport { first } from 'rxjs/operators'\n\n/**\n * Can be used to access a stories component after the story has been bootstrapped.\n *\n * Example:\n * ```ts\n * @Component({\n * selector: 'story-example',\n * template: `Touched: {{ exControl.touched }}`\n * })\n * class StoryExampleComponent {\n * exControl = new FormControl('')\n * }\n *\n * export const TouchExample2 = () => ({\n * moduleMetadata: {\n * declarations: [ StoryExampleComponent ],\n * providers: [ onStoryBootstrappedExec((c: StoryExampleComponent) => c.exControl.markAsTouched()) ]\n * },\n * props: { },\n * component: StoryExampleComponent\n * })\n * ```\n */\n// export function onStoryBootstrappedExec<T = any>(callback: (component: T) => void) {\n// function bootstrapped(componentRef: ComponentRef<any>) {\n// const data = componentRef.instance.target.injector.get(STORY, null) as Observable<StoryFnAngularReturnType> | null\n// if (!data) {\n// console.warn(`STORY provider not found.`)\n// return\n// }\n// data?.pipe(first()).subscribe(story => {\n// if (!story.component) {\n// console.warn(`'onStoryBootstrappedExec' only supported on stories that provide 'component' property.`)\n// return\n// }\n\n// let c = null\n// for (let i = 0; i < componentRef.instance.target.length; i++) {\n// const tmp = componentRef.instance.target._embeddedViews[i].nodes?.find((f: any) => f?.instance instanceof story.component)\n// const comp = tmp?.instance\n// if (comp) {\n// c = comp\n// break\n// }\n// }\n\n// if (!c) {\n// console.warn(`Story component instance not found.`)\n// return\n// }\n\n// if (c) {\n// callback(c)\n// }\n// })\n// }\n\n// return {\n// provide: APP_BOOTSTRAP_LISTENER,\n// useValue: bootstrapped,\n// multi: true\n// }\n// }\n","import { APP_BOOTSTRAP_LISTENER, ComponentRef, ElementRef } from '@angular/core'\n\n// TODO: Consider supporting a target selection function, so that complex\n// selections that can't be expressed by a simple selector can be used.\n\n/**\n * Can be used to trigger an event on a target element when the story component has been bootstrapped.\n *\n * Example:\n * ```\n * export const TouchExample1 = () => ({\n * moduleMetadata: {\n * providers: [ onStoryBootstrappedTrigger('input', 'blur') ]\n * },\n * props: { control: new FormControl('') },\n * template: `\n * <input type=\"text\" [formControl]=\"control\">\n * Touched: {{ control.touched }}\n * `\n * })\n * ```\n */\nexport function onStoryBootstrappedTrigger(targetSelector: string, eventName: string) {\n function bootstrapped(componentRef: ComponentRef<any>) {\n const elementRef = componentRef.injector.get(ElementRef, null)\n const target = elementRef?.nativeElement.querySelector(targetSelector)\n if (!target) {\n // eslint-disable-next-line no-console\n console.warn(`Unable to trigger event '${eventName}'. Target '${targetSelector}' not found.`)\n }\n\n const e = document.createEvent('HTMLEvents')\n e.initEvent('blur', false, true)\n target.dispatchEvent(e)\n }\n\n return {\n provide: APP_BOOTSTRAP_LISTENER,\n useValue: bootstrapped,\n multi: true\n }\n}\n","import { Injectable } from '@angular/core'\nimport { Observable, of } from 'rxjs'\n\nimport { TheSeamPreferencesAccessor } from '@theseam/ui-common/services'\n\nconst ACCESSOR_PREFIX = 'story-pref'\n\n@Injectable()\nexport class StoryPreferencesAccessorService implements TheSeamPreferencesAccessor {\n\n /**\n * Gets a preference.\n */\n public get(name: string): Observable<string> {\n console.log('get', name)\n return of(localStorage.getItem(`${ACCESSOR_PREFIX}-${name}`) || '{}')\n }\n\n /**\n * Update a preference.\n */\n public update(name: string, value: string): Observable<string> {\n // console.log('update', name)\n localStorage.setItem(`${ACCESSOR_PREFIX}-${name}`, value)\n return this.get(name)\n }\n\n /**\n * Delete a preference.\n */\n public delete(name: string): Observable<boolean> {\n localStorage.removeItem(`${ACCESSOR_PREFIX}-${name}`)\n return of(true)\n }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;AAAA;AAMa,MAAA,YAAY,GAAY;AACnC,IAAA,OAAO,EAAE,UAAU;AACnB,IAAA,OAAO,EAAE;AACP,QAAA,IAAI,EAAE,QAAQ;AACf,KAAA;AACD,IAAA,WAAW,EAAE,CAAc,YAAA,CAAA;EAC5B;AAEY,MAAA,uBAAuB,GAAY;AAC9C,IAAA,OAAO,EAAE,CAAE,GAAG,UAAU,EAAE,GAAG,iBAAiB,CAAE;AAChD,IAAA,OAAO,EAAE;AACP,QAAA,IAAI,EAAE,QAAQ;AACf,KAAA;AACD,IAAA,WAAW,EAAE,CAAc,YAAA,CAAA;EAC5B;AAEY,MAAA,WAAW,GAAY;AAClC,IAAA,OAAO,EAAE,CAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAE;AAClC,IAAA,OAAO,EAAE;AACP,QAAA,IAAI,EAAE,QAAQ;AACf,KAAA;AACD,IAAA,WAAW,EAAE,CAAO,KAAA,CAAA;EACrB;AAEY,MAAA,iBAAiB,GAAY;AACxC,IAAA,OAAO,EAAE,CAAE,QAAQ,EAAE,QAAQ,CAAE;AAC/B,IAAA,OAAO,EAAE;AACP,QAAA,IAAI,EAAE,QAAQ;AACf,KAAA;AACD,IAAA,WAAW,EAAE,CAAc,YAAA,CAAA;;;MChChB,mBAAmB,CAAA;;gHAAnB,mBAAmB,EAAA,IAAA,EAAA,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G,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;AACxB,QAAA,OAAO,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,CAAA,EAAG,eAAe,CAAA,CAAA,EAAI,IAAI,CAAE,CAAA,CAAC,IAAI,IAAI,CAAC,CAAA;KACtE;AAED;;AAEG;IACI,MAAM,CAAC,IAAY,EAAE,KAAa,EAAA;;QAEvC,YAAY,CAAC,OAAO,CAAC,CAAG,EAAA,eAAe,CAAI,CAAA,EAAA,IAAI,CAAE,CAAA,EAAE,KAAK,CAAC,CAAA;AACzD,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;KACtB;AAED;;AAEG;AACI,IAAA,MAAM,CAAC,IAAY,EAAA;QACxB,YAAY,CAAC,UAAU,CAAC,CAAA,EAAG,eAAe,CAAI,CAAA,EAAA,IAAI,CAAE,CAAA,CAAC,CAAA;AACrD,QAAA,OAAO,EAAE,CAAC,IAAI,CAAC,CAAA;KAChB;;4HAzBU,+BAA+B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;gIAA/B,+BAA+B,EAAA,CAAA,CAAA;2FAA/B,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAD3C,UAAU;;;ACPX;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"theseam-ui-common-story-helpers.mjs","sources":["../../../projects/ui-common/story-helpers/arg-type-helpers.ts","../../../projects/ui-common/story-helpers/args-to-tpl.ts","../../../projects/ui-common/story-helpers/story-empty.component.ts","../../../projects/ui-common/story-helpers/initial-route-factory.ts","../../../projects/ui-common/story-helpers/initial-route.service.ts","../../../projects/ui-common/story-helpers/story-initial-route.ts","../../../projects/ui-common/story-helpers/route-button.ts","../../../projects/ui-common/story-helpers/routes-arg-type.ts","../../../projects/ui-common/story-helpers/story-empty-with-route.component.ts","../../../projects/ui-common/story-helpers/story-modal-container.component.ts","../../../projects/ui-common/story-helpers/story-helper-components.module.ts","../../../projects/ui-common/story-helpers/story-toastr.service.ts","../../../projects/ui-common/story-helpers/on-story-bootstrapped-exec.ts","../../../projects/ui-common/story-helpers/on-story-bootstrapped-trigger.ts","../../../projects/ui-common/story-helpers/story-preferences-accessor.service.ts","../../../projects/ui-common/story-helpers/theseam-ui-common-story-helpers.ts"],"sourcesContent":["// import { ArgType } from '@storybook/addons'\n\nimport { OutlineThemeNames, ThemeNames } from '@theseam/ui-common/models'\n\ndeclare type ArgType = any\n\nexport const themeArgType: ArgType = {\n options: ThemeNames,\n control: {\n type: 'select',\n },\n description: `Theme style.`\n}\n\nexport const themeWithOutlineArgType: ArgType = {\n options: [ ...ThemeNames, ...OutlineThemeNames ],\n control: {\n type: 'select',\n },\n description: `Theme style.`\n}\n\nexport const sizeArgType: ArgType = {\n options: [ undefined, 'sm', 'lg' ],\n control: {\n type: 'select',\n },\n description: `Size.`\n}\n\nexport const buttonTypeArgType: ArgType = {\n options: [ 'button', 'submit' ],\n control: {\n type: 'select',\n },\n description: `Button type.`\n}\n","/* eslint-disable no-prototype-builtins */\nimport { action, HandlerFunction } from '@storybook/addon-actions'\nimport { AngularRenderer, ArgTypes } from '@storybook/angular'\nimport { useStoryContext } from '@storybook/preview-api'\n\nexport interface ArgsTplParts {\n actions: { [prop: string]: HandlerFunction }\n tplfragment: string\n}\n\n/**\n * This is an attempt at simplifying the use of auto-generated args in stories\n * defined with `template`, since Angular doesn't have a way to simply use a\n * spread operator syntax.\n *\n * @experimental\n */\n// export function argsToTplParts(args: any, argTypes: ArgTypes): ArgsTplParts {\n// // console.log({ args, argTypes })\n// const parts: ArgsTplParts = {\n// actions: {},\n// tplfragment: ''\n// }\n\n// Object.keys(argTypes).forEach(k => {\n// // Inputs\n// if (\n// // Is in the inputs category\n// argTypes[k].table.category === 'inputs' &&\n// // Needs a control to be able to change from auto-generated args.\n// argTypes[k]?.hasOwnProperty('control') &&\n// // Assuming the arg might not be in props if there isn't an arg value.\n// args.hasOwnProperty(k)\n// ) {\n// parts.tplfragment += `[${k}]=\"${k}\" `\n// }\n\n// // Outputs\n// if (\n// // Is in the outputs category\n// argTypes[k]?.table?.category === 'outputs'\n// ) {\n// // Without access to props, I don't know if I can get an action into the\n// // template context like this.\n// parts.tplfragment += `(${k})=\"${k}($event)\" `\n// parts.actions[k] = action(k)\n// }\n// })\n\n// return parts\n// }\n\nfunction removeDuplicates(arr: string[]) {\n const seen: { [k: string]: boolean } = {}\n return arr.filter(item => {\n if (!seen[item]) {\n seen[item] = true\n return true\n }\n return false\n })\n}\n\nexport interface ArgsTplOptions {\n /**\n * Properties to always bind to the template.\n */\n alwaysBind?: string[]\n /**\n * Properties to exclude from bidning to the template.\n */\n exclude?: string[]\n}\n\n/**\n * This is an attempt at simplifying the use of auto-generated args in stories\n * defined with `template`, since Angular doesn't have a way to simply use a\n * spread operator syntax.\n *\n * @experimental\n */\nexport function argsToTpl(options?: ArgsTplOptions) {\n const context = useStoryContext<AngularRenderer>()\n\n const exclude = [\n ...(context?.parameters?.argsToTplOptions?.exclude || []),\n ...(options?.exclude || []),\n ]\n\n const alwaysBind = context?.parameters?.argsToTplOptions?.alwaysBind || []\n\n const props = removeDuplicates([\n ...alwaysBind,\n ...Object.keys(context.args),\n ])\n\n const parts = props\n .filter(k => exclude.indexOf(k) === -1)\n .map(k => {\n // Outputs\n if (\n context.argTypes[k]?.hasOwnProperty('action') &&\n (context.args.hasOwnProperty(k) || alwaysBind.indexOf(k) !== -1)\n ) {\n return `(${k})=\"${k}($event)\"`\n }\n\n // Inputs\n if (\n (context.args.hasOwnProperty(k) || alwaysBind.indexOf(k) !== -1)\n ) {\n return `[${k}]=\"${k}\"`\n }\n })\n\n return parts.length > 0 ? parts.join(' ') : ''\n}\n","import { Component } from '@angular/core'\n\n@Component({ template: `` })\nexport class StoryEmptyComponent { }\n","import { StoryInitialRouteService } from './initial-route.service'\n\nexport function storyInitialRouteFactory(_storyInitialRouteService: StoryInitialRouteService) {\n return () => _storyInitialRouteService.setInitialRoute()\n}\n","import { Injectable, InjectionToken, Injector } from '@angular/core'\nimport { NavigationEnd, Router } from '@angular/router'\nimport { filter, take } from 'rxjs/operators'\n\nexport const STORY_INITIAL_ROUTE_URL = new InjectionToken<any>('STORY_INITIAL_ROUTE_URL')\n\n@Injectable()\nexport class StoryInitialRouteService {\n\n constructor(\n private _injector: Injector\n ) { }\n\n public setInitialRoute() {\n const _router = this._injector.get(Router)\n const url = this._injector.get(STORY_INITIAL_ROUTE_URL)\n if (_router.navigated) {\n _router.navigateByUrl(url)\n } else {\n _router.events.pipe(\n filter(e => e instanceof NavigationEnd),\n take(1)\n )\n .subscribe(() => { _router.navigateByUrl(url) })\n }\n }\n\n}\n","import { APP_INITIALIZER, ModuleWithProviders, NgModule } from '@angular/core'\n\nimport { storyInitialRouteFactory } from './initial-route-factory'\nimport { StoryInitialRouteService, STORY_INITIAL_ROUTE_URL } from './initial-route.service'\n\n@NgModule()\nexport class StoryInitialRouteModule {\n static forRoot(url: string): ModuleWithProviders<StoryInitialRouteModule> {\n return {\n ngModule: StoryInitialRouteModule,\n providers: [\n StoryInitialRouteService,\n {\n provide: APP_INITIALIZER,\n useFactory: storyInitialRouteFactory,\n deps: [ StoryInitialRouteService ],\n multi: true\n },\n { provide: STORY_INITIAL_ROUTE_URL, useValue: url }\n ]\n }\n }\n\n}\n","// import { button } from '@storybook/addon-knobs'\n\n/**\n * Until I find a way to avoid '@storybook/addon-knobs' from interfering with\n * NgZone I can't import it in the knob when built by ng-packagr.\n */\nexport function routeButton(buttonKnob: any, url: string) {\n return buttonKnob(url, () => {\n location.hash = `#${url}`\n return false\n })\n}\n","// import { ArgType } from '@storybook/addons'\n\ndeclare const __STORYBOOK_ADDONS: any\n\nfunction goToHashUrl(url: string): void { location.hash = `#${url}` }\n\n// __STORYBOOK_ADDONS.getChannel().on('custom/go-to-hash', (data: { hash: string }) => {\n\n// goToHashUrl(data.hash)\n// })\n\n// __STORYBOOK_ADDONS.getChannel().on('storyArgsUpdated', (data: { hash: string }) => {\n// console.log('storyArgsUpdated')\n// })\n\nexport function routesArgType(routes: string[])/*: ArgType*/ {\n return {\n options: routes,\n control: {\n type: 'select',\n // Runs in the 'manager', so I am emitting to a channel in the 'preview'.\n onChange: (e: any, a: any) => { __STORYBOOK_ADDONS.getChannel().emit('custom/go-to-hash', { hash: e }); return e }\n }\n }\n}\n","import { Component } from '@angular/core'\n\n@Component({ template: `<router-outlet></router-outlet>` })\nexport class StoryEmptyWithRouteComponent { }\n","import { Component, Injector, Input, OnDestroy } from '@angular/core'\nimport { combineLatest, Observable, of, ReplaySubject, Subject } from 'rxjs'\nimport { auditTime, map, startWith, takeUntil } from 'rxjs/operators'\n\nimport { ModalConfig, ModalRef, MODAL_DATA } from '@theseam/ui-common/modal'\nimport type { ComponentType } from '@theseam/ui-common/models'\n\nclass FakeModalRef<T, R = any> implements Partial<ModalRef<T, R>> {\n\n afterOpened() { return of(undefined) }\n\n close(dialogResult?: R): void { }\n\n}\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'story-modal-container-component',\n template: `\n <div class=\"cdk-overlay-container\">\n <div class=\"cdk-overlay-backdrop cdk-overlay-dark-backdrop cdk-overlay-backdrop-showing\"></div>\n <div class=\"cdk-global-overlay-wrapper\"\n dir=\"ltr\"\n style=\"justify-content: flex-start; align-items: center; pointer-events: auto\"\n seamOverlayScrollbar>\n <div class=\"seam-modal-container modal-dialog modal-dialog-centered {{ modalConfig ? modalConfig.modalSize : 'modal-lg' }}\"\n tabindex=\"-1\"\n [class.modal-lg]=\"!modalConfig\">\n <div class=\"modal-content\">\n <ng-container *ngIf=\"_outletData$ | async as outletData\">\n <ng-container *ngComponentOutlet=\"outletData.component; injector: outletData.injector;\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n </div>\n `,\n styles: [`\n .seam-modal-container[tabindex=\"-1\"]:focus {\n outline: 0 !important;\n }\n `]\n})\nexport class StoryModalContainerComponent<T, D = any> implements OnDestroy {\n\n private readonly _ngUnsubscribe = new Subject<void>()\n\n @Input() set component(c: ComponentType<T>) { this._component.next(c) }\n @Input() set data(d: D) { this._data.next(d) }\n\n @Input() modalConfig?: ModalConfig<D>\n\n _component = new ReplaySubject<ComponentType<T>>(1)\n _data = new ReplaySubject<D>(1)\n\n _outletData$: Observable<{ component: ComponentType<T>, injector: Injector } | null>\n\n constructor(\n private _injector: Injector\n ) {\n this._outletData$ = combineLatest([\n this._component.asObservable(),\n this._data.asObservable().pipe(startWith(undefined))\n ]).pipe(\n auditTime(0),\n map(([ component, data ]) => ({\n component,\n injector: this._createInjector(data)\n })),\n takeUntil(this._ngUnsubscribe)\n )\n }\n\n ngOnDestroy() {\n this._ngUnsubscribe.next(undefined)\n this._ngUnsubscribe.complete()\n }\n\n private _createInjector(data?: D): Injector {\n return Injector.create({\n providers: [\n { provide: ModalRef, useClass: FakeModalRef, deps: [] },\n { provide: MODAL_DATA, useValue: data }\n ],\n parent: this._injector\n })\n }\n\n}\n","import { CommonModule } from '@angular/common'\nimport { NgModule } from '@angular/core'\nimport { RouterModule } from '@angular/router'\n\nimport { TheSeamScrollbarModule } from '@theseam/ui-common/scrollbar'\n\nimport { StoryEmptyWithRouteComponent } from './story-empty-with-route.component'\nimport { StoryEmptyComponent } from './story-empty.component'\nimport { StoryModalContainerComponent } from './story-modal-container.component'\n\n@NgModule({\n declarations: [\n StoryEmptyComponent,\n StoryEmptyWithRouteComponent,\n StoryModalContainerComponent\n ],\n imports: [\n CommonModule,\n RouterModule,\n TheSeamScrollbarModule\n ],\n exports: [\n StoryEmptyComponent,\n StoryEmptyWithRouteComponent,\n StoryModalContainerComponent\n ]\n})\nexport class StoryHelperComponentsModule { }\n","import { Injectable } from '@angular/core'\n\nimport { ActiveToast, GlobalConfig, IndividualConfig, ToastContainerDirective } from 'ngx-toastr'\n\n@Injectable()\nexport class StoryToastrService {\n toastrConfig?: GlobalConfig\n currentlyActive = 0\n toasts: ActiveToast<any>[] = []\n overlayContainer?: ToastContainerDirective\n previousToastMessage: string | undefined\n\n /** show toast */\n show(\n message?: string,\n title?: string,\n override: Partial<IndividualConfig> = {},\n type = ''\n ) { }\n\n /** show successful toast */\n success(\n message?: string,\n title?: string,\n override: Partial<IndividualConfig> = {}\n ) { }\n\n /** show error toast */\n error(\n message?: string,\n title?: string,\n override: Partial<IndividualConfig> = {}\n ) { }\n\n /** show info toast */\n info(\n message?: string,\n title?: string,\n override: Partial<IndividualConfig> = {}\n ) { }\n\n /** show warning toast */\n warning(\n message?: string,\n title?: string,\n override: Partial<IndividualConfig> = {}\n ) { }\n\n /**\n * Remove all or a single toast by id\n */\n clear(toastId?: number) { }\n\n /**\n * Remove and destroy a single toast by id\n */\n remove(toastId: number) { }\n\n /**\n * Determines if toast message is already shown\n */\n findDuplicate(message: string, resetOnDuplicate: boolean, countDuplicates: boolean) { }\n\n}\n","import { APP_BOOTSTRAP_LISTENER, ComponentRef } from '@angular/core'\n// import { STORY } from '@storybook/angular/dist/ts3.9/client/preview/angular/app.token'\n// import { StoryFnAngularReturnType } from '@storybook/angular/dist/ts3.9/client/preview/types'\nimport { Observable } from 'rxjs'\nimport { first } from 'rxjs/operators'\n\n/**\n * Can be used to access a stories component after the story has been bootstrapped.\n *\n * Example:\n * ```ts\n * @Component({\n * selector: 'story-example',\n * template: `Touched: {{ exControl.touched }}`\n * })\n * class StoryExampleComponent {\n * exControl = new FormControl('')\n * }\n *\n * export const TouchExample2 = () => ({\n * moduleMetadata: {\n * declarations: [ StoryExampleComponent ],\n * providers: [ onStoryBootstrappedExec((c: StoryExampleComponent) => c.exControl.markAsTouched()) ]\n * },\n * props: { },\n * component: StoryExampleComponent\n * })\n * ```\n */\n// export function onStoryBootstrappedExec<T = any>(callback: (component: T) => void) {\n// function bootstrapped(componentRef: ComponentRef<any>) {\n// const data = componentRef.instance.target.injector.get(STORY, null) as Observable<StoryFnAngularReturnType> | null\n// if (!data) {\n// console.warn(`STORY provider not found.`)\n// return\n// }\n// data?.pipe(first()).subscribe(story => {\n// if (!story.component) {\n// console.warn(`'onStoryBootstrappedExec' only supported on stories that provide 'component' property.`)\n// return\n// }\n\n// let c = null\n// for (let i = 0; i < componentRef.instance.target.length; i++) {\n// const tmp = componentRef.instance.target._embeddedViews[i].nodes?.find((f: any) => f?.instance instanceof story.component)\n// const comp = tmp?.instance\n// if (comp) {\n// c = comp\n// break\n// }\n// }\n\n// if (!c) {\n// console.warn(`Story component instance not found.`)\n// return\n// }\n\n// if (c) {\n// callback(c)\n// }\n// })\n// }\n\n// return {\n// provide: APP_BOOTSTRAP_LISTENER,\n// useValue: bootstrapped,\n// multi: true\n// }\n// }\n","import { APP_BOOTSTRAP_LISTENER, ComponentRef, ElementRef } from '@angular/core'\n\n// TODO: Consider supporting a target selection function, so that complex\n// selections that can't be expressed by a simple selector can be used.\n\n/**\n * Can be used to trigger an event on a target element when the story component has been bootstrapped.\n *\n * Example:\n * ```\n * export const TouchExample1 = () => ({\n * moduleMetadata: {\n * providers: [ onStoryBootstrappedTrigger('input', 'blur') ]\n * },\n * props: { control: new FormControl('') },\n * template: `\n * <input type=\"text\" [formControl]=\"control\">\n * Touched: {{ control.touched }}\n * `\n * })\n * ```\n */\nexport function onStoryBootstrappedTrigger(targetSelector: string, eventName: string) {\n function bootstrapped(componentRef: ComponentRef<any>) {\n const elementRef = componentRef.injector.get(ElementRef, null)\n const target = elementRef?.nativeElement.querySelector(targetSelector)\n if (!target) {\n // eslint-disable-next-line no-console\n console.warn(`Unable to trigger event '${eventName}'. Target '${targetSelector}' not found.`)\n }\n\n const e = document.createEvent('HTMLEvents')\n e.initEvent('blur', false, true)\n target.dispatchEvent(e)\n }\n\n return {\n provide: APP_BOOTSTRAP_LISTENER,\n useValue: bootstrapped,\n multi: true\n }\n}\n","import { Injectable } from '@angular/core'\r\nimport { Observable, of } from 'rxjs'\r\n\r\nimport { TheSeamPreferencesAccessor } from '@theseam/ui-common/services'\r\n\r\nconst ACCESSOR_PREFIX = 'story-pref'\r\n\r\n@Injectable()\r\nexport class StoryPreferencesAccessorService implements TheSeamPreferencesAccessor {\r\n\r\n /**\r\n * Gets a preference.\r\n */\r\n public get(name: string): Observable<string> {\r\n console.log('get', name)\r\n return of(localStorage.getItem(`${ACCESSOR_PREFIX}-${name}`) || '{}')\r\n }\r\n\r\n /**\r\n * Update a preference.\r\n */\r\n public update(name: string, value: string): Observable<string> {\r\n // console.log('update', name)\r\n localStorage.setItem(`${ACCESSOR_PREFIX}-${name}`, value)\r\n return this.get(name)\r\n }\r\n\r\n /**\r\n * Delete a preference.\r\n */\r\n public delete(name: string): Observable<boolean> {\r\n localStorage.removeItem(`${ACCESSOR_PREFIX}-${name}`)\r\n return of(true)\r\n }\r\n\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;AAAA;AAMa,MAAA,YAAY,GAAY;AACnC,IAAA,OAAO,EAAE,UAAU;AACnB,IAAA,OAAO,EAAE;AACP,QAAA,IAAI,EAAE,QAAQ;AACf,KAAA;AACD,IAAA,WAAW,EAAE,CAAc,YAAA,CAAA;EAC5B;AAEY,MAAA,uBAAuB,GAAY;AAC9C,IAAA,OAAO,EAAE,CAAE,GAAG,UAAU,EAAE,GAAG,iBAAiB,CAAE;AAChD,IAAA,OAAO,EAAE;AACP,QAAA,IAAI,EAAE,QAAQ;AACf,KAAA;AACD,IAAA,WAAW,EAAE,CAAc,YAAA,CAAA;EAC5B;AAEY,MAAA,WAAW,GAAY;AAClC,IAAA,OAAO,EAAE,CAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAE;AAClC,IAAA,OAAO,EAAE;AACP,QAAA,IAAI,EAAE,QAAQ;AACf,KAAA;AACD,IAAA,WAAW,EAAE,CAAO,KAAA,CAAA;EACrB;AAEY,MAAA,iBAAiB,GAAY;AACxC,IAAA,OAAO,EAAE,CAAE,QAAQ,EAAE,QAAQ,CAAE;AAC/B,IAAA,OAAO,EAAE;AACP,QAAA,IAAI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AAY,EAAA;AACrB,QAAA,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;AACxB,QAAA,OAAO,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,CAAA,EAAG,eAAe,CAAA,CAAA,EAAI,IAAI,CAAE,CAAA,CAAC,IAAI,IAAI,CAAC,CAAA;KACtE;AAED;;AAEG;IACI,MAAM,CAAC,IAAY,EAAE,KAAa,EAAA;;QAEvC,YAAY,CAAC,OAAO,CAAC,CAAG,EAAA,eAAe,CAAI,CAAA,EAAA,IAAI,CAAE,CAAA,EAAE,KAAK,CAAC,CAAA;AACzD,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;KACtB;AAED;;AAEG;AACI,IAAA,MAAM,CAAC,IAAY,EAAA;QACxB,YAAY,CAAC,UAAU,CAAC,CAAA,EAAG,eAAe,CAAI,CAAA,EAAA,IAAI,CAAE,CAAA,CAAC,CAAA;AACrD,QAAA,OAAO,EAAE,CAAC,IAAI,CAAC,CAAA;KAChB;;4HAzBU,+BAA+B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;gIAA/B,+BAA+B,EAAA,CAAA,CAAA;2FAA/B,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAD3C,UAAU;;;ACPX;;AAEG;;;;"}
|
|
@@ -2,19 +2,20 @@ import { __decorate, __awaiter } from 'tslib';
|
|
|
2
2
|
import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
4
|
import { Directive, Optional, Inject, Self, HostBinding, Input, EventEmitter, InjectFlags, forwardRef, Component, ChangeDetectionStrategy, Output, ViewChild, HostListener, Pipe, NgModule } from '@angular/core';
|
|
5
|
-
import * as
|
|
5
|
+
import * as i3 from '@angular/forms';
|
|
6
6
|
import { UntypedFormControl, NgControl, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms';
|
|
7
7
|
import { Subject, merge, fromEvent, of, defer } from 'rxjs';
|
|
8
8
|
import { tap, last, switchMap, takeUntil, auditTime, map } from 'rxjs/operators';
|
|
9
9
|
import { InputBoolean } from '@theseam/ui-common/core';
|
|
10
|
-
import * as
|
|
10
|
+
import * as i4 from '@theseam/ui-common/form-field';
|
|
11
11
|
import { InputDirective, TheSeamFormFieldModule } from '@theseam/ui-common/form-field';
|
|
12
|
-
import * as
|
|
12
|
+
import * as i2 from '@angular/common';
|
|
13
13
|
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
14
14
|
import { waitOnConditionAsync, notNullOrUndefined, toggleAttribute, getAttribute, hasAttribute } from '@theseam/ui-common/utils';
|
|
15
15
|
import intlTelInput from 'intl-tel-input';
|
|
16
16
|
import * as i1 from '@theseam/ui-common/services';
|
|
17
17
|
import * as i1$1 from '@angular/cdk/a11y';
|
|
18
|
+
import { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
|
|
18
19
|
|
|
19
20
|
//
|
|
20
21
|
// NOTE: These types are mainly for providing types to 'intl-tel-input', because
|
|
@@ -270,7 +271,6 @@ function processCountryCodes(countries) {
|
|
|
270
271
|
|
|
271
272
|
class TheSeamTelInputDirective {
|
|
272
273
|
set value(v) {
|
|
273
|
-
// console.log('set value', v, this._instance)
|
|
274
274
|
this._value = v;
|
|
275
275
|
if (this._instance) {
|
|
276
276
|
this._instance.setNumber(notNullOrUndefined(v) ? v : '');
|
|
@@ -306,11 +306,10 @@ class TheSeamTelInputDirective {
|
|
|
306
306
|
};
|
|
307
307
|
}
|
|
308
308
|
ngOnInit() {
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
switchMap(() => {
|
|
309
|
+
var _a;
|
|
310
|
+
this._elementRef.nativeElement.value = this._ngControl ? this._ngControl.value : (_a = this.value) !== null && _a !== void 0 ? _a : '';
|
|
311
|
+
this._elementRef.nativeElement.setAttribute('instance-loading', '');
|
|
312
|
+
merge(this._assetLoader.loadStyleSheet(TEL_INPUT_STYLESHEET_PATH), this._assetLoader.loadStyle(TEL_INPUT_STYLES)).pipe(tap(v => this._loadedAssetRefs.push(v)), last(), switchMap(() => {
|
|
314
313
|
this._instance = IntlTelInputFn(this._elementRef.nativeElement, {
|
|
315
314
|
utilsScript: TEL_INPUT_UTILS_PATH,
|
|
316
315
|
preferredCountries: ['US'],
|
|
@@ -323,10 +322,11 @@ class TheSeamTelInputDirective {
|
|
|
323
322
|
// initialCountry: 'auto'
|
|
324
323
|
});
|
|
325
324
|
this._tryUpdateDropdownAttributes();
|
|
326
|
-
return this._instance.promise
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
325
|
+
return this._instance.promise.then(v => {
|
|
326
|
+
this._elementRef.nativeElement.removeAttribute('instance-loading');
|
|
327
|
+
return v;
|
|
328
|
+
});
|
|
329
|
+
}), tap(() => this._initDropdownListener()), tap(() => this.value = this._value), tap(this._formatIntlTelInput), switchMap(() => merge(fromEvent(this._elementRef.nativeElement, 'keyup'), fromEvent(this._elementRef.nativeElement, 'change'))), tap(this._formatIntlTelInput), takeUntil(this._ngUnsubscribe)).subscribe();
|
|
330
330
|
}
|
|
331
331
|
ngOnDestroy() {
|
|
332
332
|
var _a;
|
|
@@ -449,13 +449,14 @@ class TheSeamTelInputDirective {
|
|
|
449
449
|
return this._elementRef.nativeElement;
|
|
450
450
|
}
|
|
451
451
|
}
|
|
452
|
-
TheSeamTelInputDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: TheSeamTelInputDirective, deps: [{ token: i0.ElementRef }, { token: i1.AssetLoaderService }, { token: i0.NgZone }, { token: DOCUMENT, optional: true }, { token:
|
|
453
|
-
TheSeamTelInputDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.7", type: TheSeamTelInputDirective, selector: "input[seamTelInput]", inputs: { value: "value" }, host: { properties: { "attr.type": "this._attrType" } }, exportAs: ["seamTelInput"], ngImport: i0 });
|
|
452
|
+
TheSeamTelInputDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: TheSeamTelInputDirective, deps: [{ token: i0.ElementRef }, { token: i1.AssetLoaderService }, { token: i0.NgZone }, { token: DOCUMENT, optional: true }, { token: i3.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
453
|
+
TheSeamTelInputDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.7", type: TheSeamTelInputDirective, isStandalone: true, selector: "input[seamTelInput]", inputs: { value: "value" }, host: { properties: { "attr.type": "this._attrType" } }, exportAs: ["seamTelInput"], ngImport: i0 });
|
|
454
454
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: TheSeamTelInputDirective, decorators: [{
|
|
455
455
|
type: Directive,
|
|
456
456
|
args: [{
|
|
457
457
|
selector: 'input[seamTelInput]',
|
|
458
|
-
exportAs: 'seamTelInput'
|
|
458
|
+
exportAs: 'seamTelInput',
|
|
459
|
+
standalone: true,
|
|
459
460
|
}]
|
|
460
461
|
}], ctorParameters: function () {
|
|
461
462
|
return [{ type: i0.ElementRef }, { type: i1.AssetLoaderService }, { type: i0.NgZone }, { type: undefined, decorators: [{
|
|
@@ -463,7 +464,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
463
464
|
}, {
|
|
464
465
|
type: Inject,
|
|
465
466
|
args: [DOCUMENT]
|
|
466
|
-
}] }, { type:
|
|
467
|
+
}] }, { type: i3.NgControl, decorators: [{
|
|
467
468
|
type: Optional
|
|
468
469
|
}, {
|
|
469
470
|
type: Self
|
|
@@ -549,15 +550,19 @@ class TheSeamTelInputComponent {
|
|
|
549
550
|
}
|
|
550
551
|
/** @ignore */
|
|
551
552
|
ngOnInit() {
|
|
553
|
+
var _a;
|
|
552
554
|
this._focusMonitor.monitor(this._elementRef, true).pipe(takeUntil(this._ngUnsubscribe)).subscribe(origin => this._focusOrigin = origin);
|
|
553
555
|
this._control.valueChanges.pipe(takeUntil(this._ngUnsubscribe)).subscribe(v => {
|
|
554
556
|
var _a;
|
|
555
557
|
const value = (_a = this._telInputDirective) === null || _a === void 0 ? void 0 : _a.getFullNumber();
|
|
558
|
+
// console.log('valueChanges', v, value)
|
|
556
559
|
this.value = value;
|
|
557
560
|
if (this._controlValueAccessorChangeFn) {
|
|
558
561
|
this._controlValueAccessorChangeFn(value);
|
|
562
|
+
this.change.emit(value);
|
|
559
563
|
}
|
|
560
564
|
});
|
|
565
|
+
this._control.setValue((_a = this.value) !== null && _a !== void 0 ? _a : '');
|
|
561
566
|
}
|
|
562
567
|
/** @ignore */
|
|
563
568
|
ngOnDestroy() {
|
|
@@ -568,7 +573,11 @@ class TheSeamTelInputComponent {
|
|
|
568
573
|
// Implemented as part of ControlValueAccessor.
|
|
569
574
|
/** @ignore */
|
|
570
575
|
writeValue(value) {
|
|
576
|
+
// console.log('writeValue', value, this._telInputDirective?.getFullNumber(), this._control.value)
|
|
571
577
|
this.value = value;
|
|
578
|
+
if (this._control.value !== value) {
|
|
579
|
+
this._control.setValue(value);
|
|
580
|
+
}
|
|
572
581
|
if (this._telInputDirective) {
|
|
573
582
|
this._telInputDirective.value = value;
|
|
574
583
|
this._telInputDirective.updateValue();
|
|
@@ -604,11 +613,11 @@ class TheSeamTelInputComponent {
|
|
|
604
613
|
}
|
|
605
614
|
}
|
|
606
615
|
TheSeamTelInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: TheSeamTelInputComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.Injector }, { token: i0.ElementRef }, { token: i1$1.FocusMonitor }], target: i0.ɵɵFactoryTarget.Component });
|
|
607
|
-
TheSeamTelInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: TheSeamTelInputComponent, selector: "seam-tel-input", inputs: { required: "required", disabled: "disabled", tabIndex: "tabIndex", name: "name", value: "value" }, outputs: { change: "change" }, host: { listeners: { "focus": "_onFocus($event)" }, properties: { "attr.disabled": "this._attrDisabled", "attr.tabindex": "this._attrTabIndex" } }, providers: [{
|
|
616
|
+
TheSeamTelInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: TheSeamTelInputComponent, isStandalone: true, selector: "seam-tel-input", inputs: { required: "required", disabled: "disabled", tabIndex: "tabIndex", name: "name", value: "value" }, outputs: { change: "change" }, host: { listeners: { "focus": "_onFocus($event)" }, properties: { "attr.disabled": "this._attrDisabled", "attr.tabindex": "this._attrTabIndex" } }, providers: [{
|
|
608
617
|
provide: NG_VALUE_ACCESSOR,
|
|
609
618
|
useExisting: forwardRef(() => TheSeamTelInputComponent),
|
|
610
619
|
multi: true
|
|
611
|
-
}], viewQueries: [{ propertyName: "_telInputDirective", first: true, predicate: TheSeamTelInputDirective, descendants: true, static: true }, { propertyName: "_inputDirective", first: true, predicate: InputDirective, descendants: true, static: true }, { propertyName: "_inputElementRef", first: true, predicate: ["input"], descendants: true, static: true }], ngImport: i0, template: "<input seamTelInput seamInput\n [formControl]=\"_control\"\n [class.is-invalid]=\"_hasInvalidCss$ | async\"
|
|
620
|
+
}], viewQueries: [{ propertyName: "_telInputDirective", first: true, predicate: TheSeamTelInputDirective, descendants: true, static: true }, { propertyName: "_inputDirective", first: true, predicate: InputDirective, descendants: true, static: true }, { propertyName: "_inputElementRef", first: true, predicate: ["input"], descendants: true, static: true }], ngImport: i0, template: "<input seamTelInput seamInput\n [formControl]=\"_control\"\n [class.is-invalid]=\"_hasInvalidCss$ | async\"\n [required]=\"required\"/>\n", styles: [":host{display:block}:host[disabled] ::ng-deep .iti--allow-dropdown .iti__flag-container:hover{cursor:default}:host[disabled] ::ng-deep .iti--allow-dropdown .iti__flag-container:hover .iti__selected-flag{background-color:transparent}:host[disabled] ::ng-deep .iti--allow-dropdown .iti__arrow{display:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: TheSeamFormFieldModule }, { kind: "directive", type: i4.InputDirective, selector: "input[seamInput], textarea[seamInput], ng-select[seamInput], seam-checkbox[seamInput] [ngbRadioGroup], seam-tel-input[seamInput], quill-editor[seamInput], seam-google-maps[seamInput]", inputs: ["seamInputSize", "id", "type", "placeholder", "required", "disabled", "readonly"], exportAs: ["seamInput"] }, { kind: "directive", type: TheSeamTelInputDirective, selector: "input[seamTelInput]", inputs: ["value"], exportAs: ["seamTelInput"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
612
621
|
__decorate([
|
|
613
622
|
InputBoolean()
|
|
614
623
|
], TheSeamTelInputComponent.prototype, "required", void 0);
|
|
@@ -618,7 +627,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
618
627
|
provide: NG_VALUE_ACCESSOR,
|
|
619
628
|
useExisting: forwardRef(() => TheSeamTelInputComponent),
|
|
620
629
|
multi: true
|
|
621
|
-
}], changeDetection: ChangeDetectionStrategy.OnPush,
|
|
630
|
+
}], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
631
|
+
CommonModule,
|
|
632
|
+
ReactiveFormsModule,
|
|
633
|
+
TheSeamFormFieldModule,
|
|
634
|
+
TheSeamTelInputDirective,
|
|
635
|
+
], template: "<input seamTelInput seamInput\n [formControl]=\"_control\"\n [class.is-invalid]=\"_hasInvalidCss$ | async\"\n [required]=\"required\"/>\n", styles: [":host{display:block}:host[disabled] ::ng-deep .iti--allow-dropdown .iti__flag-container:hover{cursor:default}:host[disabled] ::ng-deep .iti--allow-dropdown .iti__flag-container:hover .iti__selected-flag{background-color:transparent}:host[disabled] ::ng-deep .iti--allow-dropdown .iti__arrow{display:none}\n"] }]
|
|
622
636
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.Injector }, { type: i0.ElementRef }, { type: i1$1.FocusMonitor }]; }, propDecorators: { required: [{
|
|
623
637
|
type: Input
|
|
624
638
|
}], disabled: [{
|
|
@@ -726,28 +740,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
726
740
|
class TheSeamTelInputModule {
|
|
727
741
|
}
|
|
728
742
|
TheSeamTelInputModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: TheSeamTelInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
729
|
-
TheSeamTelInputModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.7", ngImport: i0, type: TheSeamTelInputModule, declarations: [
|
|
730
|
-
TheSeamTelInputComponent,
|
|
731
|
-
TheSeamPhoneNumberPipe], imports: [CommonModule,
|
|
743
|
+
TheSeamTelInputModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.7", ngImport: i0, type: TheSeamTelInputModule, declarations: [TheSeamPhoneNumberPipe], imports: [CommonModule,
|
|
732
744
|
ReactiveFormsModule,
|
|
733
|
-
TheSeamFormFieldModule
|
|
745
|
+
TheSeamFormFieldModule,
|
|
746
|
+
TheSeamTelInputDirective,
|
|
747
|
+
TheSeamTelInputComponent], exports: [TheSeamTelInputDirective,
|
|
734
748
|
TheSeamTelInputComponent,
|
|
735
749
|
TheSeamPhoneNumberPipe] });
|
|
736
750
|
TheSeamTelInputModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: TheSeamTelInputModule, imports: [CommonModule,
|
|
737
751
|
ReactiveFormsModule,
|
|
738
|
-
TheSeamFormFieldModule
|
|
752
|
+
TheSeamFormFieldModule,
|
|
753
|
+
TheSeamTelInputComponent] });
|
|
739
754
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: TheSeamTelInputModule, decorators: [{
|
|
740
755
|
type: NgModule,
|
|
741
756
|
args: [{
|
|
742
757
|
declarations: [
|
|
743
|
-
TheSeamTelInputDirective,
|
|
744
|
-
TheSeamTelInputComponent,
|
|
745
758
|
TheSeamPhoneNumberPipe
|
|
746
759
|
],
|
|
747
760
|
imports: [
|
|
748
761
|
CommonModule,
|
|
749
762
|
ReactiveFormsModule,
|
|
750
|
-
TheSeamFormFieldModule
|
|
763
|
+
TheSeamFormFieldModule,
|
|
764
|
+
TheSeamTelInputDirective,
|
|
765
|
+
TheSeamTelInputComponent,
|
|
751
766
|
],
|
|
752
767
|
exports: [
|
|
753
768
|
TheSeamTelInputDirective,
|
|
@@ -757,9 +772,70 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
757
772
|
}]
|
|
758
773
|
}] });
|
|
759
774
|
|
|
775
|
+
class TheSeamTelInputHarness extends ComponentHarness {
|
|
776
|
+
constructor() {
|
|
777
|
+
super(...arguments);
|
|
778
|
+
this._input = this.locatorFor('input');
|
|
779
|
+
}
|
|
780
|
+
/** Creates a `HarnessPredicate` used to locate a particular `TheSeamTelInputHarness`. */
|
|
781
|
+
static with(options) {
|
|
782
|
+
return new HarnessPredicate(TheSeamTelInputHarness, options)
|
|
783
|
+
.addOption('field name', options.name, (harness, name) => HarnessPredicate.stringMatches(harness.getName(), name));
|
|
784
|
+
}
|
|
785
|
+
getName() {
|
|
786
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
787
|
+
return (yield this._input()).getAttribute('name');
|
|
788
|
+
});
|
|
789
|
+
}
|
|
790
|
+
getValue() {
|
|
791
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
792
|
+
return (yield this._input()).getProperty('value');
|
|
793
|
+
});
|
|
794
|
+
}
|
|
795
|
+
isDisabled() {
|
|
796
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
797
|
+
return (yield this._input()).getProperty('disabled');
|
|
798
|
+
});
|
|
799
|
+
}
|
|
800
|
+
isRequired() {
|
|
801
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
802
|
+
return (yield this._input()).getProperty('required');
|
|
803
|
+
});
|
|
804
|
+
}
|
|
805
|
+
click() {
|
|
806
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
807
|
+
return (yield this._input()).click();
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
setValue(value) {
|
|
811
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
812
|
+
yield this._waitOnInstance();
|
|
813
|
+
// TODO: Find out why setInputValue() doesn't update the FormControl.
|
|
814
|
+
// return (await this._input()).setInputValue(value)
|
|
815
|
+
yield (yield this._input()).click();
|
|
816
|
+
yield this._input().then(x => x.setInputValue(''));
|
|
817
|
+
return (yield this._input()).sendKeys(value);
|
|
818
|
+
});
|
|
819
|
+
}
|
|
820
|
+
_waitOnInstance() {
|
|
821
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
822
|
+
const input = document.querySelector('input');
|
|
823
|
+
const isInstanceReady = () => {
|
|
824
|
+
const instLoading = input === null || input === void 0 ? void 0 : input.getAttribute('instance-loading');
|
|
825
|
+
return instLoading === null;
|
|
826
|
+
};
|
|
827
|
+
if (isInstanceReady()) {
|
|
828
|
+
return true;
|
|
829
|
+
}
|
|
830
|
+
yield waitOnConditionAsync(isInstanceReady, 10000);
|
|
831
|
+
});
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
TheSeamTelInputHarness.hostSelector = 'seam-tel-input';
|
|
835
|
+
|
|
760
836
|
/**
|
|
761
837
|
* Generated bundle index. Do not edit.
|
|
762
838
|
*/
|
|
763
839
|
|
|
764
|
-
export { IntlTelInputFn, TEL_INPUT_ASSETS_PATH, TEL_INPUT_STYLES, TEL_INPUT_STYLESHEET_PATH, TEL_INPUT_UTILS_PATH, THESEAM_DEFAULT_PHONE_NUMBER_FORMAT, TelInputNumberFormatName, TheSeamPhoneNumberPipe, TheSeamTelInputComponent, TheSeamTelInputDirective, TheSeamTelInputModule, VALIDATOR_CODE_MESSAGES, addCountryCode, coercePhoneNumberFormat, getCountryCode, getDialCode, getIntlTelInputUtils, getValidationErrorMessage, globalIntlTelInputGlobals, globalIntlTelInputUtils, intlTelInputUtils, processCountryCodes, telInputValidator };
|
|
840
|
+
export { IntlTelInputFn, TEL_INPUT_ASSETS_PATH, TEL_INPUT_STYLES, TEL_INPUT_STYLESHEET_PATH, TEL_INPUT_UTILS_PATH, THESEAM_DEFAULT_PHONE_NUMBER_FORMAT, TelInputNumberFormatName, TheSeamPhoneNumberPipe, TheSeamTelInputComponent, TheSeamTelInputDirective, TheSeamTelInputHarness, TheSeamTelInputModule, VALIDATOR_CODE_MESSAGES, addCountryCode, coercePhoneNumberFormat, getCountryCode, getDialCode, getIntlTelInputUtils, getValidationErrorMessage, globalIntlTelInputGlobals, globalIntlTelInputUtils, intlTelInputUtils, processCountryCodes, telInputValidator };
|
|
765
841
|
//# sourceMappingURL=theseam-ui-common-tel-input.mjs.map
|