ngx-tethys 22.0.2 → 22.0.3
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/CHANGELOG.md +37 -0
- package/button/styles/button-group.scss +25 -18
- package/button/styles/button.scss +3 -1
- package/button/styles/mixin.scss +7 -2
- package/button/styles/theme.scss +3 -1
- package/cascader/styles/cascader.scss +5 -0
- package/date-picker/styles/index.scss +5 -0
- package/date-picker/styles/picker.scss +5 -0
- package/fesm2022/ngx-tethys-action.mjs +13 -4
- package/fesm2022/ngx-tethys-action.mjs.map +1 -1
- package/fesm2022/ngx-tethys-alert.mjs +2 -2
- package/fesm2022/ngx-tethys-alert.mjs.map +1 -1
- package/fesm2022/ngx-tethys-arrow-switcher.mjs +17 -6
- package/fesm2022/ngx-tethys-arrow-switcher.mjs.map +1 -1
- package/fesm2022/ngx-tethys-autocomplete.mjs +11 -3
- package/fesm2022/ngx-tethys-autocomplete.mjs.map +1 -1
- package/fesm2022/ngx-tethys-badge.mjs +17 -5
- package/fesm2022/ngx-tethys-badge.mjs.map +1 -1
- package/fesm2022/ngx-tethys-breadcrumb.mjs +1 -1
- package/fesm2022/ngx-tethys-breadcrumb.mjs.map +1 -1
- package/fesm2022/ngx-tethys-button.mjs +39 -21
- package/fesm2022/ngx-tethys-button.mjs.map +1 -1
- package/fesm2022/ngx-tethys-card.mjs +1 -3
- package/fesm2022/ngx-tethys-card.mjs.map +1 -1
- package/fesm2022/ngx-tethys-cascader.mjs +36 -28
- package/fesm2022/ngx-tethys-cascader.mjs.map +1 -1
- package/fesm2022/ngx-tethys-collapse.mjs +2 -2
- package/fesm2022/ngx-tethys-collapse.mjs.map +1 -1
- package/fesm2022/ngx-tethys-color-picker.mjs +1 -1
- package/fesm2022/ngx-tethys-color-picker.mjs.map +1 -1
- package/fesm2022/ngx-tethys-core.mjs.map +1 -1
- package/fesm2022/ngx-tethys-date-picker.mjs +30 -18
- package/fesm2022/ngx-tethys-date-picker.mjs.map +1 -1
- package/fesm2022/ngx-tethys-date-range.mjs +2 -2
- package/fesm2022/ngx-tethys-date-range.mjs.map +1 -1
- package/fesm2022/ngx-tethys-dialog.mjs +193 -195
- package/fesm2022/ngx-tethys-dialog.mjs.map +1 -1
- package/fesm2022/ngx-tethys-divider.mjs +18 -7
- package/fesm2022/ngx-tethys-divider.mjs.map +1 -1
- package/fesm2022/ngx-tethys-dropdown.mjs +16 -5
- package/fesm2022/ngx-tethys-dropdown.mjs.map +1 -1
- package/fesm2022/ngx-tethys-form.mjs +447 -101
- package/fesm2022/ngx-tethys-form.mjs.map +1 -1
- package/fesm2022/ngx-tethys-image.mjs +1 -1
- package/fesm2022/ngx-tethys-image.mjs.map +1 -1
- package/fesm2022/ngx-tethys-input-number.mjs +10 -4
- package/fesm2022/ngx-tethys-input-number.mjs.map +1 -1
- package/fesm2022/ngx-tethys-input.mjs +54 -13
- package/fesm2022/ngx-tethys-input.mjs.map +1 -1
- package/fesm2022/ngx-tethys-layout.mjs.map +1 -1
- package/fesm2022/ngx-tethys-mention.mjs.map +1 -1
- package/fesm2022/ngx-tethys-menu.mjs +36 -6
- package/fesm2022/ngx-tethys-menu.mjs.map +1 -1
- package/fesm2022/ngx-tethys-message.mjs.map +1 -1
- package/fesm2022/ngx-tethys-native-table.mjs +26 -11
- package/fesm2022/ngx-tethys-native-table.mjs.map +1 -1
- package/fesm2022/ngx-tethys-nav.mjs +4 -2
- package/fesm2022/ngx-tethys-nav.mjs.map +1 -1
- package/fesm2022/ngx-tethys-notify.mjs +1 -1
- package/fesm2022/ngx-tethys-notify.mjs.map +1 -1
- package/fesm2022/ngx-tethys-pagination.mjs +1 -1
- package/fesm2022/ngx-tethys-pagination.mjs.map +1 -1
- package/fesm2022/ngx-tethys-popover.mjs.map +1 -1
- package/fesm2022/ngx-tethys-progress.mjs +81 -55
- package/fesm2022/ngx-tethys-progress.mjs.map +1 -1
- package/fesm2022/ngx-tethys-property-operation.mjs +32 -24
- package/fesm2022/ngx-tethys-property-operation.mjs.map +1 -1
- package/fesm2022/ngx-tethys-property.mjs.map +1 -1
- package/fesm2022/ngx-tethys-radio.mjs +1 -0
- package/fesm2022/ngx-tethys-radio.mjs.map +1 -1
- package/fesm2022/ngx-tethys-segment.mjs +0 -1
- package/fesm2022/ngx-tethys-segment.mjs.map +1 -1
- package/fesm2022/ngx-tethys-select.mjs +27 -9
- package/fesm2022/ngx-tethys-select.mjs.map +1 -1
- package/fesm2022/ngx-tethys-shared.mjs +16 -7
- package/fesm2022/ngx-tethys-shared.mjs.map +1 -1
- package/fesm2022/ngx-tethys-slide.mjs +1 -1
- package/fesm2022/ngx-tethys-slide.mjs.map +1 -1
- package/fesm2022/ngx-tethys-slider.mjs +38 -13
- package/fesm2022/ngx-tethys-slider.mjs.map +1 -1
- package/fesm2022/ngx-tethys-space.mjs.map +1 -1
- package/fesm2022/ngx-tethys-statistic.mjs +20 -10
- package/fesm2022/ngx-tethys-statistic.mjs.map +1 -1
- package/fesm2022/ngx-tethys-stepper.mjs +1 -1
- package/fesm2022/ngx-tethys-stepper.mjs.map +1 -1
- package/fesm2022/ngx-tethys-strength.mjs +9 -1
- package/fesm2022/ngx-tethys-strength.mjs.map +1 -1
- package/fesm2022/ngx-tethys-switch.mjs +20 -11
- package/fesm2022/ngx-tethys-switch.mjs.map +1 -1
- package/fesm2022/ngx-tethys-table.mjs +28 -17
- package/fesm2022/ngx-tethys-table.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tabs.mjs +2 -2
- package/fesm2022/ngx-tethys-tabs.mjs.map +1 -1
- package/fesm2022/ngx-tethys-time-picker.mjs +10 -4
- package/fesm2022/ngx-tethys-time-picker.mjs.map +1 -1
- package/fesm2022/ngx-tethys-timeline.mjs +2 -8
- package/fesm2022/ngx-tethys-timeline.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tree-select.mjs +11 -6
- package/fesm2022/ngx-tethys-tree-select.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tree.mjs.map +1 -1
- package/fesm2022/ngx-tethys-typography.mjs +0 -1
- package/fesm2022/ngx-tethys-typography.mjs.map +1 -1
- package/fesm2022/ngx-tethys.mjs +1 -1
- package/fesm2022/ngx-tethys.mjs.map +1 -1
- package/form/styles/forms.scss +1 -0
- package/form/styles/mixin.scss +37 -0
- package/form/styles/theme.scss +1 -0
- package/input/styles/input.scss +28 -19
- package/input-number/styles/input-number.scss +22 -3
- package/menu/examples/variant/variant.component.scss +21 -0
- package/package.json +1 -1
- package/schematics/ng-update/update-22/badge-dot-hollow-migration.spec.js +4 -4
- package/schematics/ng-update/update-22/button-appearance-migration.js +2 -0
- package/schematics/ng-update/update-22/button-appearance-migration.spec.js +0 -4
- package/schematics/ng-update/update-22/button-group-appearance-migration.d.ts +6 -0
- package/schematics/ng-update/update-22/button-group-appearance-migration.js +157 -0
- package/schematics/ng-update/update-22/button-group-appearance-migration.spec.d.ts +1 -0
- package/schematics/ng-update/update-22/button-group-appearance-migration.spec.js +56 -0
- package/schematics/ng-update/update-22/class-name-migration.spec.js +135 -0
- package/schematics/ng-update/update-22/divider-deeper-migration.js +12 -5
- package/schematics/ng-update/update-22/divider-deeper-migration.spec.js +9 -1
- package/schematics/ng-update/update-22/index.js +9 -1
- package/schematics/ng-update/update-22/index.spec.js +581 -3
- package/schematics/ng-update/update-22/input-search-appearance-migration.d.ts +6 -0
- package/schematics/ng-update/update-22/input-search-appearance-migration.js +94 -0
- package/schematics/ng-update/update-22/input-search-appearance-migration.spec.d.ts +1 -0
- package/schematics/ng-update/update-22/input-search-appearance-migration.spec.js +41 -0
- package/schematics/ng-update/update-22/menu-theme-migration.d.ts +14 -0
- package/schematics/ng-update/update-22/menu-theme-migration.js +108 -0
- package/schematics/ng-update/update-22/menu-theme-migration.spec.d.ts +1 -0
- package/schematics/ng-update/update-22/menu-theme-migration.spec.js +42 -0
- package/schematics/ng-update/update-22/select-borderless-migration.d.ts +6 -0
- package/schematics/ng-update/update-22/select-borderless-migration.js +111 -0
- package/schematics/ng-update/update-22/select-borderless-migration.spec.d.ts +1 -0
- package/schematics/ng-update/update-22/select-borderless-migration.spec.js +49 -0
- package/schematics/ng-update/update-22/update-data.js +102 -1
- package/schematics/version.d.ts +1 -1
- package/schematics/version.js +1 -1
- package/select/styles/custom-select.scss +5 -0
- package/select/styles/theme.scss +10 -0
- package/shared/select/select-control/select-control.scss +4 -3
- package/time-picker/styles/time-picker.scss +11 -2
- package/types/ngx-tethys-action.d.ts +14 -5
- package/types/ngx-tethys-alert.d.ts +2 -2
- package/types/ngx-tethys-arrow-switcher.d.ts +16 -5
- package/types/ngx-tethys-autocomplete.d.ts +8 -2
- package/types/ngx-tethys-badge.d.ts +14 -4
- package/types/ngx-tethys-button.d.ts +28 -9
- package/types/ngx-tethys-card.d.ts +3 -6
- package/types/ngx-tethys-cascader.d.ts +9 -3
- package/types/ngx-tethys-collapse.d.ts +3 -3
- package/types/ngx-tethys-core.d.ts +2 -1
- package/types/ngx-tethys-date-picker.d.ts +15 -3
- package/types/ngx-tethys-dialog.d.ts +1 -3
- package/types/ngx-tethys-divider.d.ts +20 -9
- package/types/ngx-tethys-dropdown.d.ts +16 -5
- package/types/ngx-tethys-form.d.ts +198 -55
- package/types/ngx-tethys-input-number.d.ts +8 -2
- package/types/ngx-tethys-input.d.ts +39 -8
- package/types/ngx-tethys-menu.d.ts +16 -4
- package/types/ngx-tethys-native-table.d.ts +21 -6
- package/types/ngx-tethys-nav.d.ts +2 -0
- package/types/ngx-tethys-progress.d.ts +42 -18
- package/types/ngx-tethys-property-operation.d.ts +6 -0
- package/types/ngx-tethys-segment.d.ts +0 -1
- package/types/ngx-tethys-select.d.ts +23 -5
- package/types/ngx-tethys-shared.d.ts +12 -3
- package/types/ngx-tethys-slider.d.ts +22 -8
- package/types/ngx-tethys-space.d.ts +3 -1
- package/types/ngx-tethys-statistic.d.ts +23 -9
- package/types/ngx-tethys-stepper.d.ts +1 -1
- package/types/ngx-tethys-strength.d.ts +5 -0
- package/types/ngx-tethys-switch.d.ts +15 -4
- package/types/ngx-tethys-table.d.ts +24 -8
- package/types/ngx-tethys-tabs.d.ts +3 -3
- package/types/ngx-tethys-time-picker.d.ts +8 -2
- package/types/ngx-tethys-timeline.d.ts +13 -14
- package/types/ngx-tethys-tree-select.d.ts +8 -3
- package/types/ngx-tethys-typography.d.ts +0 -1
- /package/action/examples/{type/type.component.scss → color/color.component.scss} +0 -0
- /package/badge/examples/{type/type.component.scss → color/color.component.scss} +0 -0
|
@@ -271,6 +271,72 @@ export class ButtonDemoComponent {
|
|
|
271
271
|
expect(content).toContain('thyColor="default"');
|
|
272
272
|
expect(content).not.toMatch(/<thy-button[^>]*thyType/);
|
|
273
273
|
});
|
|
274
|
+
it('should migrate legacy thyTheme to thyVariant for thy-menu', async () => {
|
|
275
|
+
const factory = (0, testing_2.createTestWorkspaceFactory)(schematicRunner);
|
|
276
|
+
await factory.create();
|
|
277
|
+
await factory.addApplication({ name: 'update-22-test' });
|
|
278
|
+
const testTree = factory.addNewFile('/projects/update-22-test/src/app/menu-demo.component.ts', `
|
|
279
|
+
import { Component } from '@angular/core';
|
|
280
|
+
import { ThyMenuModule } from 'ngx-tethys/menu';
|
|
281
|
+
|
|
282
|
+
@Component({
|
|
283
|
+
selector: 'app-menu-demo',
|
|
284
|
+
template: \`
|
|
285
|
+
<thy-menu thyTheme="compact"></thy-menu>
|
|
286
|
+
<thy-menu thyTheme="loose"></thy-menu>
|
|
287
|
+
<thy-menu thyTheme="dark"></thy-menu>
|
|
288
|
+
<thy-alert thyTheme="naked" thyMessage="message"></thy-alert>
|
|
289
|
+
\`,
|
|
290
|
+
imports: [ThyMenuModule]
|
|
291
|
+
})
|
|
292
|
+
export class MenuDemoComponent {}
|
|
293
|
+
`);
|
|
294
|
+
workspaceTree = await schematicRunner.runSchematic('migration-v22', undefined, testTree);
|
|
295
|
+
const content = workspaceTree.readContent('/projects/update-22-test/src/app/menu-demo.component.ts');
|
|
296
|
+
expect(content).toContain('<thy-menu></thy-menu>');
|
|
297
|
+
expect(content).toContain('thyVariant="loose"');
|
|
298
|
+
expect(content).toContain('thyTheme="dark"');
|
|
299
|
+
expect(content).toContain('thyAppearance="naked"');
|
|
300
|
+
expect(content).not.toMatch(/<thy-menu[^>]*thyTheme="(?:compact|loose)"/);
|
|
301
|
+
});
|
|
302
|
+
it('should migrate thyType to thyAppearance for thy-button-group', async () => {
|
|
303
|
+
const factory = (0, testing_2.createTestWorkspaceFactory)(schematicRunner);
|
|
304
|
+
await factory.create();
|
|
305
|
+
await factory.addApplication({ name: 'update-22-test' });
|
|
306
|
+
const testTree = factory.addNewFile('/projects/update-22-test/src/app/button-group-demo.component.ts', `
|
|
307
|
+
import { Component } from '@angular/core';
|
|
308
|
+
import { ThyButtonModule } from 'ngx-tethys/button';
|
|
309
|
+
|
|
310
|
+
@Component({
|
|
311
|
+
selector: 'app-button-group-demo',
|
|
312
|
+
template: \`
|
|
313
|
+
<thy-button-group thyType="outline-default">
|
|
314
|
+
<button thyButton>Left</button>
|
|
315
|
+
<button thyButton>Right</button>
|
|
316
|
+
</thy-button-group>
|
|
317
|
+
<thy-button-group thyType="primary">
|
|
318
|
+
<button thyButton>New</button>
|
|
319
|
+
<button thyButton>More</button>
|
|
320
|
+
</thy-button-group>
|
|
321
|
+
<thy-button-group [thyType]="type">
|
|
322
|
+
<button thyButton>Dynamic</button>
|
|
323
|
+
</thy-button-group>
|
|
324
|
+
\`,
|
|
325
|
+
imports: [ThyButtonModule]
|
|
326
|
+
})
|
|
327
|
+
export class ButtonGroupDemoComponent {
|
|
328
|
+
type = 'outline-default';
|
|
329
|
+
}
|
|
330
|
+
`);
|
|
331
|
+
workspaceTree = await schematicRunner.runSchematic('migration-v22', undefined, testTree);
|
|
332
|
+
const content = workspaceTree.readContent('/projects/update-22-test/src/app/button-group-demo.component.ts');
|
|
333
|
+
expect(content).toContain('thyAppearance="outline"');
|
|
334
|
+
expect(content).toContain('thyAppearance="fill"');
|
|
335
|
+
expect(content).toContain('thyButton="primary"');
|
|
336
|
+
expect(content).toContain('[thyType]="type"');
|
|
337
|
+
expect(content).not.toMatch(/thy-button-group[^>]*thyType="outline-default"/);
|
|
338
|
+
expect(content).not.toMatch(/thy-button-group[^>]*thyType="primary"/);
|
|
339
|
+
});
|
|
274
340
|
it('should migrate thyTheme to thyAppearance and thyType to thyColor for thy-alert', async () => {
|
|
275
341
|
const factory = (0, testing_2.createTestWorkspaceFactory)(schematicRunner);
|
|
276
342
|
await factory.create();
|
|
@@ -295,6 +361,438 @@ export class AlertDemoComponent {}
|
|
|
295
361
|
expect(content).not.toContain('thyTheme');
|
|
296
362
|
expect(content).not.toMatch(/<thy-alert[^>]*thyType/);
|
|
297
363
|
});
|
|
364
|
+
it('should migrate thyType to thyColor for thy-slider', async () => {
|
|
365
|
+
const factory = (0, testing_2.createTestWorkspaceFactory)(schematicRunner);
|
|
366
|
+
await factory.create();
|
|
367
|
+
await factory.addApplication({ name: 'update-22-test' });
|
|
368
|
+
const testTree = factory.addNewFile('/projects/update-22-test/src/app/slider-demo.component.ts', `
|
|
369
|
+
import { Component } from '@angular/core';
|
|
370
|
+
import { ThySliderModule } from 'ngx-tethys/slider';
|
|
371
|
+
|
|
372
|
+
@Component({
|
|
373
|
+
selector: 'app-slider-demo',
|
|
374
|
+
template: \`
|
|
375
|
+
<thy-slider thyType="warning" [(ngModel)]="value"></thy-slider>
|
|
376
|
+
<thy-slider [thyType]="typeValue"></thy-slider>
|
|
377
|
+
\`,
|
|
378
|
+
imports: [ThySliderModule]
|
|
379
|
+
})
|
|
380
|
+
export class SliderDemoComponent {
|
|
381
|
+
value = 0;
|
|
382
|
+
typeValue = 'success';
|
|
383
|
+
}
|
|
384
|
+
`);
|
|
385
|
+
workspaceTree = await schematicRunner.runSchematic('migration-v22', undefined, testTree);
|
|
386
|
+
const content = workspaceTree.readContent('/projects/update-22-test/src/app/slider-demo.component.ts');
|
|
387
|
+
expect(content).toContain('<thy-slider thyColor="warning" [(ngModel)]="value"></thy-slider>');
|
|
388
|
+
expect(content).toContain('<thy-slider [thyColor]="typeValue"></thy-slider>');
|
|
389
|
+
expect(content).not.toMatch(/thy-slider[^>]*thyType/);
|
|
390
|
+
});
|
|
391
|
+
it('should migrate thyType to thyColor for thy-switch', async () => {
|
|
392
|
+
const factory = (0, testing_2.createTestWorkspaceFactory)(schematicRunner);
|
|
393
|
+
await factory.create();
|
|
394
|
+
await factory.addApplication({ name: 'update-22-test' });
|
|
395
|
+
const testTree = factory.addNewFile('/projects/update-22-test/src/app/switch-demo.component.ts', `
|
|
396
|
+
import { Component } from '@angular/core';
|
|
397
|
+
import { ThySwitchModule } from 'ngx-tethys/switch';
|
|
398
|
+
|
|
399
|
+
@Component({
|
|
400
|
+
selector: 'app-switch-demo',
|
|
401
|
+
template: \`
|
|
402
|
+
<thy-switch thyType="info"></thy-switch>
|
|
403
|
+
<thy-switch [thyType]="type"></thy-switch>
|
|
404
|
+
<thy-button thyType="primary">Ok</thy-button>
|
|
405
|
+
\`,
|
|
406
|
+
imports: [ThySwitchModule]
|
|
407
|
+
})
|
|
408
|
+
export class SwitchDemoComponent {
|
|
409
|
+
type = 'danger';
|
|
410
|
+
}
|
|
411
|
+
`);
|
|
412
|
+
workspaceTree = await schematicRunner.runSchematic('migration-v22', undefined, testTree);
|
|
413
|
+
const content = workspaceTree.readContent('/projects/update-22-test/src/app/switch-demo.component.ts');
|
|
414
|
+
expect(content).toContain('thyColor="info"');
|
|
415
|
+
expect(content).toContain('[thyColor]="type"');
|
|
416
|
+
expect(content).toContain('thyColor="primary"');
|
|
417
|
+
expect(content).not.toMatch(/<thy-switch[^>]*thyType/);
|
|
418
|
+
expect(content).not.toMatch(/<thy-switch[^>]*\[thyType\]/);
|
|
419
|
+
});
|
|
420
|
+
it('should migrate thyType to thyColor for thy-badge and thyBadge', async () => {
|
|
421
|
+
const factory = (0, testing_2.createTestWorkspaceFactory)(schematicRunner);
|
|
422
|
+
await factory.create();
|
|
423
|
+
await factory.addApplication({ name: 'update-22-test' });
|
|
424
|
+
const testTree = factory.addNewFile('/projects/update-22-test/src/app/badge-color-demo.component.ts', `
|
|
425
|
+
import { Component } from '@angular/core';
|
|
426
|
+
import { ThyBadgeModule } from 'ngx-tethys/badge';
|
|
427
|
+
|
|
428
|
+
@Component({
|
|
429
|
+
selector: 'app-badge-color-demo',
|
|
430
|
+
template: \`
|
|
431
|
+
<thy-badge thyType="primary" [thyCount]="5"></thy-badge>
|
|
432
|
+
<thy-badge [thyType]="type" [thyCount]="5"></thy-badge>
|
|
433
|
+
<span thyBadge thyType="success" [thyCount]="5"></span>
|
|
434
|
+
\`,
|
|
435
|
+
imports: [ThyBadgeModule]
|
|
436
|
+
})
|
|
437
|
+
export class BadgeColorDemoComponent {
|
|
438
|
+
type = 'danger';
|
|
439
|
+
}
|
|
440
|
+
`);
|
|
441
|
+
workspaceTree = await schematicRunner.runSchematic('migration-v22', undefined, testTree);
|
|
442
|
+
const content = workspaceTree.readContent('/projects/update-22-test/src/app/badge-color-demo.component.ts');
|
|
443
|
+
expect(content).toContain('thyColor="primary"');
|
|
444
|
+
expect(content).toContain('[thyColor]="type"');
|
|
445
|
+
expect(content).toContain('thyColor="success"');
|
|
446
|
+
expect(content).not.toMatch(/<thy-badge[^>]*thyType/);
|
|
447
|
+
expect(content).not.toMatch(/<thy-badge[^>]*\[thyType\]/);
|
|
448
|
+
expect(content).not.toMatch(/thyBadge[^>]*thyType/);
|
|
449
|
+
});
|
|
450
|
+
it('should migrate thyTheme/thyVariant transparent to thyAppearance ghost for thy-input-search', async () => {
|
|
451
|
+
const factory = (0, testing_2.createTestWorkspaceFactory)(schematicRunner);
|
|
452
|
+
await factory.create();
|
|
453
|
+
await factory.addApplication({ name: 'update-22-test' });
|
|
454
|
+
const testTree = factory.addNewFile('/projects/update-22-test/src/app/input-search-demo.component.ts', `
|
|
455
|
+
import { Component } from '@angular/core';
|
|
456
|
+
import { ThyInputModule } from 'ngx-tethys/input';
|
|
457
|
+
|
|
458
|
+
@Component({
|
|
459
|
+
selector: 'app-input-search-demo',
|
|
460
|
+
template: \`
|
|
461
|
+
<thy-input-search thyTheme="ellipse"></thy-input-search>
|
|
462
|
+
<thy-input-search thyTheme="transparent"></thy-input-search>
|
|
463
|
+
<thy-input-search thyVariant="transparent"></thy-input-search>
|
|
464
|
+
<thy-input-search [thyTheme]="'transparent'"></thy-input-search>
|
|
465
|
+
<thy-input-search [thyTheme]="theme"></thy-input-search>
|
|
466
|
+
<thy-table thyTheme="bordered"></thy-table>
|
|
467
|
+
\`,
|
|
468
|
+
imports: [ThyInputModule]
|
|
469
|
+
})
|
|
470
|
+
export class InputSearchDemoComponent {
|
|
471
|
+
theme = 'ellipse';
|
|
472
|
+
}
|
|
473
|
+
`);
|
|
474
|
+
workspaceTree = await schematicRunner.runSchematic('migration-v22', undefined, testTree);
|
|
475
|
+
const content = workspaceTree.readContent('/projects/update-22-test/src/app/input-search-demo.component.ts');
|
|
476
|
+
expect(content).toContain('thyVariant="ellipse"');
|
|
477
|
+
expect(content).toContain('thyAppearance="ghost"');
|
|
478
|
+
expect(content).toContain(`[thyAppearance]="'ghost'"`);
|
|
479
|
+
expect(content).toContain('[thyVariant]="theme"');
|
|
480
|
+
expect(content).toContain('<thy-table thyAppearance="bordered"></thy-table>');
|
|
481
|
+
expect(content).not.toMatch(/<thy-input-search[^>]*thyTheme/);
|
|
482
|
+
expect(content).not.toMatch(/<thy-input-search[^>]*\[thyTheme\]/);
|
|
483
|
+
expect(content).not.toMatch(/<thy-input-search[^>]*(thyTheme|thyVariant)="transparent"/);
|
|
484
|
+
expect(content).not.toMatch(/<thy-input-search[^>]*\[(thyTheme|thyVariant)\]="'transparent'"/);
|
|
485
|
+
});
|
|
486
|
+
it('should migrate thyBorderless to thyAppearance ghost for thy-select', async () => {
|
|
487
|
+
const factory = (0, testing_2.createTestWorkspaceFactory)(schematicRunner);
|
|
488
|
+
await factory.create();
|
|
489
|
+
await factory.addApplication({ name: 'update-22-test' });
|
|
490
|
+
const testTree = factory.addNewFile('/projects/update-22-test/src/app/select-borderless-demo.component.ts', `
|
|
491
|
+
import { Component } from '@angular/core';
|
|
492
|
+
import { ThySelectModule } from 'ngx-tethys/select';
|
|
493
|
+
|
|
494
|
+
@Component({
|
|
495
|
+
selector: 'app-select-borderless-demo',
|
|
496
|
+
template: \`
|
|
497
|
+
<thy-select thyBorderless></thy-select>
|
|
498
|
+
<thy-select thyBorderless="true"></thy-select>
|
|
499
|
+
<thy-select [thyBorderless]="true"></thy-select>
|
|
500
|
+
<thy-select thyBorderless="false"></thy-select>
|
|
501
|
+
<thy-select [thyBorderless]="false"></thy-select>
|
|
502
|
+
<thy-select thyAppearance="subtle" thyBorderless></thy-select>
|
|
503
|
+
<thy-select [thyBorderless]="borderless"></thy-select>
|
|
504
|
+
<thy-custom-select thyBorderless></thy-custom-select>
|
|
505
|
+
<div thySelectControl thyBorderless></div>
|
|
506
|
+
\`,
|
|
507
|
+
imports: [ThySelectModule]
|
|
508
|
+
})
|
|
509
|
+
export class SelectBorderlessDemoComponent {
|
|
510
|
+
borderless = true;
|
|
511
|
+
}
|
|
512
|
+
`);
|
|
513
|
+
workspaceTree = await schematicRunner.runSchematic('migration-v22', undefined, testTree);
|
|
514
|
+
const content = workspaceTree.readContent('/projects/update-22-test/src/app/select-borderless-demo.component.ts');
|
|
515
|
+
expect(content).toContain('thyAppearance="ghost"');
|
|
516
|
+
expect(content).toContain('thyAppearance="subtle"');
|
|
517
|
+
expect(content).toContain('[thyBorderless]="borderless"');
|
|
518
|
+
expect(content.match(/thyBorderless/g)?.length).toBe(1);
|
|
519
|
+
expect(content).not.toMatch(/thyBorderless="true"/);
|
|
520
|
+
expect(content).not.toMatch(/thyBorderless="false"/);
|
|
521
|
+
expect(content).not.toMatch(/\[thyBorderless\]="true"/);
|
|
522
|
+
expect(content).not.toMatch(/\[thyBorderless\]="false"/);
|
|
523
|
+
expect(content).toMatch(/<thy-custom-select[^>]*thyAppearance="ghost"/);
|
|
524
|
+
expect(content).toMatch(/<div thySelectControl[^>]*thyAppearance="ghost"/);
|
|
525
|
+
});
|
|
526
|
+
it('should migrate ThyInputSearchTheme to ThyInputSearchVariant', async () => {
|
|
527
|
+
const factory = (0, testing_2.createTestWorkspaceFactory)(schematicRunner);
|
|
528
|
+
await factory.create();
|
|
529
|
+
await factory.addApplication({ name: 'update-22-test' });
|
|
530
|
+
const testTree = factory.addNewFile('/projects/update-22-test/src/app/input-search-theme-demo.component.ts', `
|
|
531
|
+
import { Component } from '@angular/core';
|
|
532
|
+
import { ThyInputSearchTheme } from 'ngx-tethys/input';
|
|
533
|
+
|
|
534
|
+
@Component({
|
|
535
|
+
selector: 'app-input-search-theme-demo',
|
|
536
|
+
template: ''
|
|
537
|
+
})
|
|
538
|
+
export class InputSearchThemeDemoComponent {
|
|
539
|
+
variant: ThyInputSearchTheme = 'ellipse';
|
|
540
|
+
}
|
|
541
|
+
`);
|
|
542
|
+
workspaceTree = await schematicRunner.runSchematic('migration-v22', undefined, testTree);
|
|
543
|
+
const content = workspaceTree.readContent('/projects/update-22-test/src/app/input-search-theme-demo.component.ts');
|
|
544
|
+
expect(content).toContain("import { ThyInputSearchVariant } from 'ngx-tethys/input';");
|
|
545
|
+
expect(content).toContain("variant: ThyInputSearchVariant = 'ellipse';");
|
|
546
|
+
expect(content).not.toContain('ThyInputSearchTheme');
|
|
547
|
+
});
|
|
548
|
+
it('should migrate thyType to thyColor for thyDropdownMenuItem', async () => {
|
|
549
|
+
const factory = (0, testing_2.createTestWorkspaceFactory)(schematicRunner);
|
|
550
|
+
await factory.create();
|
|
551
|
+
await factory.addApplication({ name: 'update-22-test' });
|
|
552
|
+
const testTree = factory.addNewFile('/projects/update-22-test/src/app/dropdown-menu-item-demo.component.ts', `
|
|
553
|
+
import { Component } from '@angular/core';
|
|
554
|
+
import { ThyDropdownModule } from 'ngx-tethys/dropdown';
|
|
555
|
+
|
|
556
|
+
@Component({
|
|
557
|
+
selector: 'app-dropdown-menu-item-demo',
|
|
558
|
+
template: \`
|
|
559
|
+
<a thyDropdownMenuItem thyType="danger">Delete</a>
|
|
560
|
+
<a thyDropdownMenuItem [thyType]="type">New</a>
|
|
561
|
+
<thy-table-column thyType="checkbox"></thy-table-column>
|
|
562
|
+
\`,
|
|
563
|
+
imports: [ThyDropdownModule]
|
|
564
|
+
})
|
|
565
|
+
export class DropdownMenuItemDemoComponent {
|
|
566
|
+
type = 'success';
|
|
567
|
+
}
|
|
568
|
+
`);
|
|
569
|
+
workspaceTree = await schematicRunner.runSchematic('migration-v22', undefined, testTree);
|
|
570
|
+
const content = workspaceTree.readContent('/projects/update-22-test/src/app/dropdown-menu-item-demo.component.ts');
|
|
571
|
+
expect(content).toContain('<a thyDropdownMenuItem thyColor="danger">Delete</a>');
|
|
572
|
+
expect(content).toContain('<a thyDropdownMenuItem [thyColor]="type">New</a>');
|
|
573
|
+
expect(content).toContain('<thy-table-column thyType="checkbox"></thy-table-column>');
|
|
574
|
+
expect(content).not.toMatch(/thyDropdownMenuItem[^>]*\bthyType\b/);
|
|
575
|
+
expect(content).not.toMatch(/thyDropdownMenuItem[^>]*\[thyType\]/);
|
|
576
|
+
});
|
|
577
|
+
it('should migrate thyTheme to thyVariant for thy-arrow-switcher', async () => {
|
|
578
|
+
const factory = (0, testing_2.createTestWorkspaceFactory)(schematicRunner);
|
|
579
|
+
await factory.create();
|
|
580
|
+
await factory.addApplication({ name: 'update-22-test' });
|
|
581
|
+
const testTree = factory.addNewFile('/projects/update-22-test/src/app/arrow-switcher-demo.component.ts', `
|
|
582
|
+
import { Component } from '@angular/core';
|
|
583
|
+
import { ThyArrowSwitcherModule } from 'ngx-tethys/arrow-switcher';
|
|
584
|
+
|
|
585
|
+
@Component({
|
|
586
|
+
selector: 'app-arrow-switcher-demo',
|
|
587
|
+
template: \`
|
|
588
|
+
<thy-arrow-switcher thyTheme="lite" [thyTotal]="10"></thy-arrow-switcher>
|
|
589
|
+
<thy-arrow-switcher [thyTheme]="theme" [thyTotal]="10"></thy-arrow-switcher>
|
|
590
|
+
<thy-menu thyTheme="dark"></thy-menu>
|
|
591
|
+
\`,
|
|
592
|
+
imports: [ThyArrowSwitcherModule]
|
|
593
|
+
})
|
|
594
|
+
export class ArrowSwitcherDemoComponent {
|
|
595
|
+
theme = 'lite';
|
|
596
|
+
}
|
|
597
|
+
`);
|
|
598
|
+
workspaceTree = await schematicRunner.runSchematic('migration-v22', undefined, testTree);
|
|
599
|
+
const content = workspaceTree.readContent('/projects/update-22-test/src/app/arrow-switcher-demo.component.ts');
|
|
600
|
+
expect(content).toContain('<thy-arrow-switcher thyVariant="lite" [thyTotal]="10"></thy-arrow-switcher>');
|
|
601
|
+
expect(content).toContain('<thy-arrow-switcher [thyVariant]="theme" [thyTotal]="10"></thy-arrow-switcher>');
|
|
602
|
+
expect(content).toContain('<thy-menu thyTheme="dark"></thy-menu>');
|
|
603
|
+
expect(content).not.toMatch(/<thy-arrow-switcher[^>]*thyTheme/);
|
|
604
|
+
expect(content).not.toMatch(/<thy-arrow-switcher[^>]*\[thyTheme\]/);
|
|
605
|
+
});
|
|
606
|
+
it('should migrate ThyArrowSwitcherTheme to ThyArrowSwitcherVariant', async () => {
|
|
607
|
+
const factory = (0, testing_2.createTestWorkspaceFactory)(schematicRunner);
|
|
608
|
+
await factory.create();
|
|
609
|
+
await factory.addApplication({ name: 'update-22-test' });
|
|
610
|
+
const testTree = factory.addNewFile('/projects/update-22-test/src/app/arrow-switcher-theme-demo.component.ts', `
|
|
611
|
+
import { Component } from '@angular/core';
|
|
612
|
+
import { ThyArrowSwitcherTheme } from 'ngx-tethys/arrow-switcher';
|
|
613
|
+
|
|
614
|
+
@Component({
|
|
615
|
+
selector: 'app-arrow-switcher-theme-demo',
|
|
616
|
+
template: ''
|
|
617
|
+
})
|
|
618
|
+
export class ArrowSwitcherThemeDemoComponent {
|
|
619
|
+
variant: ThyArrowSwitcherTheme = 'lite';
|
|
620
|
+
}
|
|
621
|
+
`);
|
|
622
|
+
workspaceTree = await schematicRunner.runSchematic('migration-v22', undefined, testTree);
|
|
623
|
+
const content = workspaceTree.readContent('/projects/update-22-test/src/app/arrow-switcher-theme-demo.component.ts');
|
|
624
|
+
expect(content).toContain("import { ThyArrowSwitcherVariant } from 'ngx-tethys/arrow-switcher';");
|
|
625
|
+
expect(content).toContain("variant: ThyArrowSwitcherVariant = 'lite';");
|
|
626
|
+
expect(content).not.toContain('ThyArrowSwitcherTheme');
|
|
627
|
+
});
|
|
628
|
+
it('should migrate thyType to thyColor for thyAction and thy-action', async () => {
|
|
629
|
+
const factory = (0, testing_2.createTestWorkspaceFactory)(schematicRunner);
|
|
630
|
+
await factory.create();
|
|
631
|
+
await factory.addApplication({ name: 'update-22-test' });
|
|
632
|
+
const testTree = factory.addNewFile('/projects/update-22-test/src/app/action-color-demo.component.ts', `
|
|
633
|
+
import { Component } from '@angular/core';
|
|
634
|
+
import { ThyActionModule } from 'ngx-tethys/action';
|
|
635
|
+
|
|
636
|
+
@Component({
|
|
637
|
+
selector: 'app-action-color-demo',
|
|
638
|
+
template: \`
|
|
639
|
+
<a thyAction thyType="danger" thyIcon="inbox"></a>
|
|
640
|
+
<a thyAction [thyType]="type" thyIcon="inbox"></a>
|
|
641
|
+
<thy-action thyType="success" thyIcon="inbox"></thy-action>
|
|
642
|
+
<thy-table-column thyType="checkbox"></thy-table-column>
|
|
643
|
+
\`,
|
|
644
|
+
imports: [ThyActionModule]
|
|
645
|
+
})
|
|
646
|
+
export class ActionColorDemoComponent {
|
|
647
|
+
type = 'warning';
|
|
648
|
+
}
|
|
649
|
+
`);
|
|
650
|
+
workspaceTree = await schematicRunner.runSchematic('migration-v22', undefined, testTree);
|
|
651
|
+
const content = workspaceTree.readContent('/projects/update-22-test/src/app/action-color-demo.component.ts');
|
|
652
|
+
expect(content).toContain('<a thyAction thyColor="danger" thyIcon="inbox"></a>');
|
|
653
|
+
expect(content).toContain('<a thyAction [thyColor]="type" thyIcon="inbox"></a>');
|
|
654
|
+
expect(content).toContain('<thy-action thyColor="success" thyIcon="inbox"></thy-action>');
|
|
655
|
+
expect(content).toContain('<thy-table-column thyType="checkbox"></thy-table-column>');
|
|
656
|
+
expect(content).not.toMatch(/thyAction[^>]*\bthyType\b/);
|
|
657
|
+
expect(content).not.toMatch(/thyAction[^>]*\[thyType\]/);
|
|
658
|
+
expect(content).not.toMatch(/<thy-action[^>]*thyType/);
|
|
659
|
+
});
|
|
660
|
+
it('should migrate ThyActionType to ThyActionColor', async () => {
|
|
661
|
+
const factory = (0, testing_2.createTestWorkspaceFactory)(schematicRunner);
|
|
662
|
+
await factory.create();
|
|
663
|
+
await factory.addApplication({ name: 'update-22-test' });
|
|
664
|
+
const testTree = factory.addNewFile('/projects/update-22-test/src/app/action-type-demo.component.ts', `
|
|
665
|
+
import { Component } from '@angular/core';
|
|
666
|
+
import { ThyActionType } from 'ngx-tethys/action';
|
|
667
|
+
|
|
668
|
+
@Component({
|
|
669
|
+
selector: 'app-action-type-demo',
|
|
670
|
+
template: ''
|
|
671
|
+
})
|
|
672
|
+
export class ActionTypeDemoComponent {
|
|
673
|
+
color: ThyActionType = 'danger';
|
|
674
|
+
}
|
|
675
|
+
`);
|
|
676
|
+
workspaceTree = await schematicRunner.runSchematic('migration-v22', undefined, testTree);
|
|
677
|
+
const content = workspaceTree.readContent('/projects/update-22-test/src/app/action-type-demo.component.ts');
|
|
678
|
+
expect(content).toContain("import { ThyActionColor } from 'ngx-tethys/action';");
|
|
679
|
+
expect(content).toContain("color: ThyActionColor = 'danger';");
|
|
680
|
+
expect(content).not.toContain('ThyActionType');
|
|
681
|
+
});
|
|
682
|
+
it('should migrate thyType to thyColor for thy-progress', async () => {
|
|
683
|
+
const factory = (0, testing_2.createTestWorkspaceFactory)(schematicRunner);
|
|
684
|
+
await factory.create();
|
|
685
|
+
await factory.addApplication({ name: 'update-22-test' });
|
|
686
|
+
const testTree = factory.addNewFile('/projects/update-22-test/src/app/progress-demo.component.ts', `
|
|
687
|
+
import { Component } from '@angular/core';
|
|
688
|
+
import { ThyProgressModule } from 'ngx-tethys/progress';
|
|
689
|
+
|
|
690
|
+
@Component({
|
|
691
|
+
selector: 'app-progress-demo',
|
|
692
|
+
template: \`
|
|
693
|
+
<thy-progress thyType="success" [thyValue]="20"></thy-progress>
|
|
694
|
+
<thy-progress [thyType]="type" [thyValue]="20"></thy-progress>
|
|
695
|
+
<thy-progress-circle thyType="warning" [thyValue]="20"></thy-progress-circle>
|
|
696
|
+
<thy-progress-bar thyType="info" [thyValue]="20"></thy-progress-bar>
|
|
697
|
+
<thy-button thyType="primary">Ok</thy-button>
|
|
698
|
+
\`,
|
|
699
|
+
imports: [ThyProgressModule]
|
|
700
|
+
})
|
|
701
|
+
export class ProgressDemoComponent {
|
|
702
|
+
type = 'danger';
|
|
703
|
+
}
|
|
704
|
+
`);
|
|
705
|
+
workspaceTree = await schematicRunner.runSchematic('migration-v22', undefined, testTree);
|
|
706
|
+
const content = workspaceTree.readContent('/projects/update-22-test/src/app/progress-demo.component.ts');
|
|
707
|
+
expect(content).toContain('<thy-progress thyColor="success" [thyValue]="20"></thy-progress>');
|
|
708
|
+
expect(content).toContain('<thy-progress [thyColor]="type" [thyValue]="20"></thy-progress>');
|
|
709
|
+
expect(content).toContain('<thy-progress-circle thyType="warning" [thyValue]="20"></thy-progress-circle>');
|
|
710
|
+
expect(content).toContain('<thy-progress-bar thyType="info" [thyValue]="20"></thy-progress-bar>');
|
|
711
|
+
expect(content).toContain('thyColor="primary"');
|
|
712
|
+
expect(content).not.toMatch(/<thy-progress(?!-)[^>]*\bthyType\b/);
|
|
713
|
+
expect(content).not.toMatch(/<thy-progress(?!-)[^>]*\[thyType\]/);
|
|
714
|
+
});
|
|
715
|
+
it('should migrate thyTheme to thyAppearance for thy-table, thy-native-table and thy-table-skeleton', async () => {
|
|
716
|
+
const factory = (0, testing_2.createTestWorkspaceFactory)(schematicRunner);
|
|
717
|
+
await factory.create();
|
|
718
|
+
await factory.addApplication({ name: 'update-22-test' });
|
|
719
|
+
const testTree = factory.addNewFile('/projects/update-22-test/src/app/table-appearance-demo.component.ts', `
|
|
720
|
+
import { Component } from '@angular/core';
|
|
721
|
+
|
|
722
|
+
@Component({
|
|
723
|
+
selector: 'app-table-appearance-demo',
|
|
724
|
+
template: \`
|
|
725
|
+
<thy-native-table thyTheme="bordered"></thy-native-table>
|
|
726
|
+
<thy-native-table [thyTheme]="theme"></thy-native-table>
|
|
727
|
+
<thy-table-skeleton thyTheme="boxed"></thy-table-skeleton>
|
|
728
|
+
<thy-table-skeleton [thyTheme]="theme"></thy-table-skeleton>
|
|
729
|
+
<thy-table thyTheme="bordered"></thy-table>
|
|
730
|
+
<thy-menu thyTheme="loose"></thy-menu>
|
|
731
|
+
\`
|
|
732
|
+
})
|
|
733
|
+
export class TableAppearanceDemoComponent {
|
|
734
|
+
theme = 'default';
|
|
735
|
+
}
|
|
736
|
+
`);
|
|
737
|
+
workspaceTree = await schematicRunner.runSchematic('migration-v22', undefined, testTree);
|
|
738
|
+
const content = workspaceTree.readContent('/projects/update-22-test/src/app/table-appearance-demo.component.ts');
|
|
739
|
+
expect(content).toContain('thyAppearance="bordered"');
|
|
740
|
+
expect(content).toContain('<thy-native-table [thyAppearance]="theme"></thy-native-table>');
|
|
741
|
+
expect(content).toContain('<thy-table-skeleton thyAppearance="boxed"></thy-table-skeleton>');
|
|
742
|
+
expect(content).toContain('<thy-table-skeleton [thyAppearance]="theme"></thy-table-skeleton>');
|
|
743
|
+
expect(content).toContain('<thy-table thyAppearance="bordered"></thy-table>');
|
|
744
|
+
expect(content).toContain('<thy-menu thyVariant="loose"></thy-menu>');
|
|
745
|
+
expect(content).not.toMatch(/<thy-menu[^>]*thyTheme="loose"/);
|
|
746
|
+
expect(content).not.toMatch(/<thy-native-table[^>]*thyTheme/);
|
|
747
|
+
expect(content).not.toMatch(/<thy-native-table[^>]*\[thyTheme\]/);
|
|
748
|
+
expect(content).not.toMatch(/<thy-table-skeleton[^>]*thyTheme/);
|
|
749
|
+
expect(content).not.toMatch(/<thy-table-skeleton[^>]*\[thyTheme\]/);
|
|
750
|
+
expect(content).not.toMatch(/<thy-table[^>]*thyTheme/);
|
|
751
|
+
});
|
|
752
|
+
it('should migrate ThyNativeTableTheme to ThyNativeTableAppearance', async () => {
|
|
753
|
+
const factory = (0, testing_2.createTestWorkspaceFactory)(schematicRunner);
|
|
754
|
+
await factory.create();
|
|
755
|
+
await factory.addApplication({ name: 'update-22-test' });
|
|
756
|
+
const testTree = factory.addNewFile('/projects/update-22-test/src/app/native-table-theme-demo.component.ts', `
|
|
757
|
+
import { Component } from '@angular/core';
|
|
758
|
+
import { ThyNativeTableTheme } from 'ngx-tethys/native-table';
|
|
759
|
+
|
|
760
|
+
@Component({
|
|
761
|
+
selector: 'app-native-table-theme-demo',
|
|
762
|
+
template: ''
|
|
763
|
+
})
|
|
764
|
+
export class NativeTableThemeDemoComponent {
|
|
765
|
+
appearance: ThyNativeTableTheme = 'bordered';
|
|
766
|
+
}
|
|
767
|
+
`);
|
|
768
|
+
workspaceTree = await schematicRunner.runSchematic('migration-v22', undefined, testTree);
|
|
769
|
+
const content = workspaceTree.readContent('/projects/update-22-test/src/app/native-table-theme-demo.component.ts');
|
|
770
|
+
expect(content).toContain("import { ThyNativeTableAppearance } from 'ngx-tethys/native-table';");
|
|
771
|
+
expect(content).toContain("appearance: ThyNativeTableAppearance = 'bordered';");
|
|
772
|
+
expect(content).not.toContain('ThyNativeTableTheme');
|
|
773
|
+
});
|
|
774
|
+
it('should migrate ThyTableTheme to ThyTableAppearance', async () => {
|
|
775
|
+
const factory = (0, testing_2.createTestWorkspaceFactory)(schematicRunner);
|
|
776
|
+
await factory.create();
|
|
777
|
+
await factory.addApplication({ name: 'update-22-test' });
|
|
778
|
+
const testTree = factory.addNewFile('/projects/update-22-test/src/app/table-theme-demo.component.ts', `
|
|
779
|
+
import { Component } from '@angular/core';
|
|
780
|
+
import { ThyTableTheme } from 'ngx-tethys/table';
|
|
781
|
+
|
|
782
|
+
@Component({
|
|
783
|
+
selector: 'app-table-theme-demo',
|
|
784
|
+
template: ''
|
|
785
|
+
})
|
|
786
|
+
export class TableThemeDemoComponent {
|
|
787
|
+
appearance: ThyTableTheme = 'bordered';
|
|
788
|
+
}
|
|
789
|
+
`);
|
|
790
|
+
workspaceTree = await schematicRunner.runSchematic('migration-v22', undefined, testTree);
|
|
791
|
+
const content = workspaceTree.readContent('/projects/update-22-test/src/app/table-theme-demo.component.ts');
|
|
792
|
+
expect(content).toContain("import { ThyTableAppearance } from 'ngx-tethys/table';");
|
|
793
|
+
expect(content).toContain("appearance: ThyTableAppearance = 'bordered';");
|
|
794
|
+
expect(content).not.toContain('ThyTableTheme');
|
|
795
|
+
});
|
|
298
796
|
it('should migrate thyContext to thyContent for thy-badge', async () => {
|
|
299
797
|
const factory = (0, testing_2.createTestWorkspaceFactory)(schematicRunner);
|
|
300
798
|
await factory.create();
|
|
@@ -353,7 +851,7 @@ import { ThyBadgeModule } from 'ngx-tethys/badge';
|
|
|
353
851
|
selector: 'app-badge-demo',
|
|
354
852
|
template: \`
|
|
355
853
|
<thy-badge thyIsDot="true" thySize="sm"></thy-badge>
|
|
356
|
-
<thy-badge thyIsHollow="true"
|
|
854
|
+
<thy-badge thyIsHollow="true" thyColor="primary"></thy-badge>
|
|
357
855
|
<span thyBadge thyIsDot="true"></span>
|
|
358
856
|
\`,
|
|
359
857
|
imports: [ThyBadgeModule]
|
|
@@ -365,7 +863,7 @@ export class BadgeDemoComponent {}
|
|
|
365
863
|
expect(content).not.toContain('thyIsDot');
|
|
366
864
|
expect(content).not.toContain('thyIsHollow');
|
|
367
865
|
expect(content).toContain('<thy-badge thySize="sm"></thy-badge>');
|
|
368
|
-
expect(content).toContain('<thy-badge
|
|
866
|
+
expect(content).toContain('<thy-badge thyColor="primary"></thy-badge>');
|
|
369
867
|
expect(content).toContain('<span thyBadge></span>');
|
|
370
868
|
});
|
|
371
869
|
it('should migrate thyTheme weak-fill to thyAppearance subtle for thyTag', async () => {
|
|
@@ -1027,7 +1525,58 @@ export class DividerDemoComponent {}
|
|
|
1027
1525
|
workspaceTree = await schematicRunner.runSchematic('migration-v22', undefined, testTree);
|
|
1028
1526
|
const content = workspaceTree.readContent('/projects/update-22-test/src/app/divider-demo.component.ts');
|
|
1029
1527
|
expect(content).toContain('thyColor="light"');
|
|
1528
|
+
expect(content).toContain(`[thyAppearance]="'solid'"`);
|
|
1030
1529
|
expect(content).not.toContain('thyDeeper');
|
|
1530
|
+
expect(content).not.toMatch(/thy-divider[^>]*thyStyle/);
|
|
1531
|
+
});
|
|
1532
|
+
it('should migrate thyStyle to thyAppearance for thy-divider', async () => {
|
|
1533
|
+
const factory = (0, testing_2.createTestWorkspaceFactory)(schematicRunner);
|
|
1534
|
+
await factory.create();
|
|
1535
|
+
await factory.addApplication({ name: 'update-22-test' });
|
|
1536
|
+
const testTree = factory.addNewFile('/projects/update-22-test/src/app/divider-style-demo.component.ts', `
|
|
1537
|
+
import { Component } from '@angular/core';
|
|
1538
|
+
import { ThyDividerModule } from 'ngx-tethys/divider';
|
|
1539
|
+
|
|
1540
|
+
@Component({
|
|
1541
|
+
selector: 'app-divider-style-demo',
|
|
1542
|
+
template: \`
|
|
1543
|
+
<thy-divider thyStyle="dashed"></thy-divider>
|
|
1544
|
+
<thy-divider [thyStyle]="'solid'"></thy-divider>
|
|
1545
|
+
\`,
|
|
1546
|
+
imports: [ThyDividerModule]
|
|
1547
|
+
})
|
|
1548
|
+
export class DividerStyleDemoComponent {}
|
|
1549
|
+
`);
|
|
1550
|
+
workspaceTree = await schematicRunner.runSchematic('migration-v22', undefined, testTree);
|
|
1551
|
+
const content = workspaceTree.readContent('/projects/update-22-test/src/app/divider-style-demo.component.ts');
|
|
1552
|
+
expect(content).toContain('thyAppearance="dashed"');
|
|
1553
|
+
expect(content).toContain(`[thyAppearance]="'solid'"`);
|
|
1554
|
+
expect(content).not.toMatch(/thy-divider[^>]*thyStyle/);
|
|
1555
|
+
});
|
|
1556
|
+
it('should migrate thyColor default to lighter for thy-divider', async () => {
|
|
1557
|
+
const factory = (0, testing_2.createTestWorkspaceFactory)(schematicRunner);
|
|
1558
|
+
await factory.create();
|
|
1559
|
+
await factory.addApplication({ name: 'update-22-test' });
|
|
1560
|
+
const testTree = factory.addNewFile('/projects/update-22-test/src/app/divider-color-demo.component.ts', `
|
|
1561
|
+
import { Component } from '@angular/core';
|
|
1562
|
+
import { ThyDividerModule } from 'ngx-tethys/divider';
|
|
1563
|
+
|
|
1564
|
+
@Component({
|
|
1565
|
+
selector: 'app-divider-color-demo',
|
|
1566
|
+
template: \`
|
|
1567
|
+
<thy-divider thyColor="default"></thy-divider>
|
|
1568
|
+
<thy-divider [thyColor]="'default'"></thy-divider>
|
|
1569
|
+
\`,
|
|
1570
|
+
imports: [ThyDividerModule]
|
|
1571
|
+
})
|
|
1572
|
+
export class DividerColorDemoComponent {}
|
|
1573
|
+
`);
|
|
1574
|
+
workspaceTree = await schematicRunner.runSchematic('migration-v22', undefined, testTree);
|
|
1575
|
+
const content = workspaceTree.readContent('/projects/update-22-test/src/app/divider-color-demo.component.ts');
|
|
1576
|
+
expect(content).toContain('thyColor="lighter"');
|
|
1577
|
+
expect(content).toContain(`[thyColor]="'lighter'"`);
|
|
1578
|
+
expect(content).not.toContain('thyColor="default"');
|
|
1579
|
+
expect(content).not.toContain(`[thyColor]="'default'"`);
|
|
1031
1580
|
});
|
|
1032
1581
|
it('should migrate bound thyDeeper to thyColor for thy-divider', async () => {
|
|
1033
1582
|
const factory = (0, testing_2.createTestWorkspaceFactory)(schematicRunner);
|
|
@@ -1050,7 +1599,7 @@ export class DividerDemoComponent {
|
|
|
1050
1599
|
`);
|
|
1051
1600
|
workspaceTree = await schematicRunner.runSchematic('migration-v22', undefined, testTree);
|
|
1052
1601
|
const content = workspaceTree.readContent('/projects/update-22-test/src/app/divider-demo.component.ts');
|
|
1053
|
-
expect(content).toContain(`[thyColor]="isDeeper ? 'light' : '
|
|
1602
|
+
expect(content).toContain(`[thyColor]="isDeeper ? 'light' : 'lighter'"`);
|
|
1054
1603
|
expect(content).not.toContain('thyDeeper');
|
|
1055
1604
|
});
|
|
1056
1605
|
it('should remove thyDeeper when thyColor already exists on thy-divider', async () => {
|
|
@@ -1181,4 +1730,33 @@ export class ComboDemoComponent {}
|
|
|
1181
1730
|
expect(content).toContain('thyAppearance="outline"');
|
|
1182
1731
|
expect(content).not.toContain('outline-primary');
|
|
1183
1732
|
});
|
|
1733
|
+
it('should migrate thyShape to thyAppearance for thy-statistic', async () => {
|
|
1734
|
+
const factory = (0, testing_2.createTestWorkspaceFactory)(schematicRunner);
|
|
1735
|
+
await factory.create();
|
|
1736
|
+
await factory.addApplication({ name: 'update-22-test' });
|
|
1737
|
+
const testTree = factory.addNewFile('/projects/update-22-test/src/app/statistic-demo.component.ts', `
|
|
1738
|
+
import { Component } from '@angular/core';
|
|
1739
|
+
import { ThyStatisticModule } from 'ngx-tethys/statistic';
|
|
1740
|
+
|
|
1741
|
+
@Component({
|
|
1742
|
+
selector: 'app-statistic-demo',
|
|
1743
|
+
template: \`
|
|
1744
|
+
<thy-statistic thyShape="card" [thyValue]="20"></thy-statistic>
|
|
1745
|
+
<thy-statistic [thyShape]="shape" [thyValue]="20"></thy-statistic>
|
|
1746
|
+
<thy-tag thyShape="pill">Tag</thy-tag>
|
|
1747
|
+
\`,
|
|
1748
|
+
imports: [ThyStatisticModule]
|
|
1749
|
+
})
|
|
1750
|
+
export class StatisticDemoComponent {
|
|
1751
|
+
shape = 'card';
|
|
1752
|
+
}
|
|
1753
|
+
`);
|
|
1754
|
+
workspaceTree = await schematicRunner.runSchematic('migration-v22', undefined, testTree);
|
|
1755
|
+
const content = workspaceTree.readContent('/projects/update-22-test/src/app/statistic-demo.component.ts');
|
|
1756
|
+
expect(content).toContain('<thy-statistic thyAppearance="card" [thyValue]="20"></thy-statistic>');
|
|
1757
|
+
expect(content).toContain('<thy-statistic [thyAppearance]="shape" [thyValue]="20"></thy-statistic>');
|
|
1758
|
+
expect(content).toContain('<thy-tag thyShape="pill">Tag</thy-tag>');
|
|
1759
|
+
expect(content).not.toMatch(/<thy-statistic[^>]*thyShape/);
|
|
1760
|
+
expect(content).not.toMatch(/<thy-statistic[^>]*\[thyShape\]/);
|
|
1761
|
+
});
|
|
1184
1762
|
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Migration, ResolvedResource, UpgradeData } from '@angular/cdk/schematics';
|
|
2
|
+
export declare function migrateInputSearchTransparent(content: string, filePath?: string): string;
|
|
3
|
+
export declare class InputSearchAppearanceMigration extends Migration<UpgradeData> {
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
visitTemplate(template: ResolvedResource): void;
|
|
6
|
+
}
|