@cratis/scene.primereact 4.1.1 → 4.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  2. package/package.json +18 -17
  3. package/dist/esm/for_columnDefinitions/when_deriving_columns.d.ts +0 -2
  4. package/dist/esm/for_columnDefinitions/when_deriving_columns.d.ts.map +0 -1
  5. package/dist/esm/for_columnDefinitions/when_deriving_columns.js +0 -64
  6. package/dist/esm/for_columnDefinitions/when_deriving_columns.js.map +0 -1
  7. package/dist/esm/for_menuItems/when_converting_entries.d.ts +0 -2
  8. package/dist/esm/for_menuItems/when_converting_entries.d.ts.map +0 -1
  9. package/dist/esm/for_menuItems/when_converting_entries.js +0 -31
  10. package/dist/esm/for_menuItems/when_converting_entries.js.map +0 -1
  11. package/dist/esm/for_primeReactPackage/when_inspecting_the_manifest.d.ts +0 -2
  12. package/dist/esm/for_primeReactPackage/when_inspecting_the_manifest.d.ts.map +0 -1
  13. package/dist/esm/for_primeReactPackage/when_inspecting_the_manifest.js +0 -31
  14. package/dist/esm/for_primeReactPackage/when_inspecting_the_manifest.js.map +0 -1
  15. package/dist/esm/for_primeReactPackage/when_inspecting_the_registry.d.ts +0 -2
  16. package/dist/esm/for_primeReactPackage/when_inspecting_the_registry.d.ts.map +0 -1
  17. package/dist/esm/for_primeReactPackage/when_inspecting_the_registry.js +0 -25
  18. package/dist/esm/for_primeReactPackage/when_inspecting_the_registry.js.map +0 -1
  19. package/dist/esm/for_primeReactPackage/when_rendering_every_declared_component.d.ts +0 -2
  20. package/dist/esm/for_primeReactPackage/when_rendering_every_declared_component.d.ts.map +0 -1
  21. package/dist/esm/for_primeReactPackage/when_rendering_every_declared_component.js +0 -65
  22. package/dist/esm/for_primeReactPackage/when_rendering_every_declared_component.js.map +0 -1
  23. package/dist/esm/for_primeReactPackage/when_resolving_a_name_core_also_declares.d.ts +0 -2
  24. package/dist/esm/for_primeReactPackage/when_resolving_a_name_core_also_declares.d.ts.map +0 -1
  25. package/dist/esm/for_primeReactPackage/when_resolving_a_name_core_also_declares.js +0 -34
  26. package/dist/esm/for_primeReactPackage/when_resolving_a_name_core_also_declares.js.map +0 -1
  27. package/dist/esm/for_primeReactPackage/when_validating_the_bundle.d.ts +0 -2
  28. package/dist/esm/for_primeReactPackage/when_validating_the_bundle.d.ts.map +0 -1
  29. package/dist/esm/for_primeReactPackage/when_validating_the_bundle.js +0 -12
  30. package/dist/esm/for_primeReactPackage/when_validating_the_bundle.js.map +0 -1
  31. package/dist/esm/for_primeReactThemePreset/when_resolving_a_preset.d.ts +0 -2
  32. package/dist/esm/for_primeReactThemePreset/when_resolving_a_preset.d.ts.map +0 -1
  33. package/dist/esm/for_primeReactThemePreset/when_resolving_a_preset.js +0 -30
  34. package/dist/esm/for_primeReactThemePreset/when_resolving_a_preset.js.map +0 -1
  35. package/dist/esm/for_primeReactThemes/when_checking_attribution.d.ts +0 -2
  36. package/dist/esm/for_primeReactThemes/when_checking_attribution.d.ts.map +0 -1
  37. package/dist/esm/for_primeReactThemes/when_checking_attribution.js +0 -27
  38. package/dist/esm/for_primeReactThemes/when_checking_attribution.js.map +0 -1
  39. package/dist/esm/for_primeReactThemes/when_checking_compatibility.d.ts +0 -2
  40. package/dist/esm/for_primeReactThemes/when_checking_compatibility.d.ts.map +0 -1
  41. package/dist/esm/for_primeReactThemes/when_checking_compatibility.js +0 -18
  42. package/dist/esm/for_primeReactThemes/when_checking_compatibility.js.map +0 -1
  43. package/dist/esm/for_primeReactThemes/when_checking_the_token_vocabulary.d.ts +0 -2
  44. package/dist/esm/for_primeReactThemes/when_checking_the_token_vocabulary.d.ts.map +0 -1
  45. package/dist/esm/for_primeReactThemes/when_checking_the_token_vocabulary.js +0 -48
  46. package/dist/esm/for_primeReactThemes/when_checking_the_token_vocabulary.js.map +0 -1
  47. package/dist/esm/for_properties/when_reading_a_boolean_property.d.ts +0 -2
  48. package/dist/esm/for_properties/when_reading_a_boolean_property.d.ts.map +0 -1
  49. package/dist/esm/for_properties/when_reading_a_boolean_property.js +0 -26
  50. package/dist/esm/for_properties/when_reading_a_boolean_property.js.map +0 -1
  51. package/dist/esm/for_properties/when_reading_a_number_property.d.ts +0 -2
  52. package/dist/esm/for_properties/when_reading_a_number_property.d.ts.map +0 -1
  53. package/dist/esm/for_properties/when_reading_a_number_property.js +0 -29
  54. package/dist/esm/for_properties/when_reading_a_number_property.js.map +0 -1
  55. package/dist/esm/for_properties/when_reading_a_string_property.d.ts +0 -2
  56. package/dist/esm/for_properties/when_reading_a_string_property.d.ts.map +0 -1
  57. package/dist/esm/for_properties/when_reading_a_string_property.js +0 -23
  58. package/dist/esm/for_properties/when_reading_a_string_property.js.map +0 -1
  59. package/dist/esm/for_properties/when_reading_an_array_property.d.ts +0 -2
  60. package/dist/esm/for_properties/when_reading_an_array_property.d.ts.map +0 -1
  61. package/dist/esm/for_properties/when_reading_an_array_property.js +0 -32
  62. package/dist/esm/for_properties/when_reading_an_array_property.js.map +0 -1
  63. package/dist/esm/for_properties/when_reading_options.d.ts +0 -2
  64. package/dist/esm/for_properties/when_reading_options.d.ts.map +0 -1
  65. package/dist/esm/for_properties/when_reading_options.js +0 -37
  66. package/dist/esm/for_properties/when_reading_options.js.map +0 -1
  67. package/dist/esm/for_treeNodes/when_converting_entries.d.ts +0 -2
  68. package/dist/esm/for_treeNodes/when_converting_entries.d.ts.map +0 -1
  69. package/dist/esm/for_treeNodes/when_converting_entries.js +0 -33
  70. package/dist/esm/for_treeNodes/when_converting_entries.js.map +0 -1
  71. package/for_columnDefinitions/when_deriving_columns.ts +0 -80
  72. package/for_menuItems/when_converting_entries.ts +0 -40
  73. package/for_primeReactPackage/when_inspecting_the_manifest.ts +0 -41
  74. package/for_primeReactPackage/when_inspecting_the_registry.ts +0 -33
  75. package/for_primeReactPackage/when_rendering_every_declared_component.tsx +0 -111
  76. package/for_primeReactPackage/when_resolving_a_name_core_also_declares.ts +0 -45
  77. package/for_primeReactPackage/when_validating_the_bundle.ts +0 -17
  78. package/for_primeReactThemePreset/when_resolving_a_preset.ts +0 -49
  79. package/for_primeReactThemes/when_checking_attribution.ts +0 -46
  80. package/for_primeReactThemes/when_checking_compatibility.ts +0 -26
  81. package/for_primeReactThemes/when_checking_the_token_vocabulary.ts +0 -70
  82. package/for_properties/when_reading_a_boolean_property.ts +0 -35
  83. package/for_properties/when_reading_a_number_property.ts +0 -39
  84. package/for_properties/when_reading_a_string_property.ts +0 -31
  85. package/for_properties/when_reading_an_array_property.ts +0 -41
  86. package/for_properties/when_reading_options.ts +0 -50
  87. package/for_treeNodes/when_converting_entries.ts +0 -43
@@ -1 +0,0 @@
1
- {"version":3,"file":"when_checking_the_token_vocabulary.js","sourceRoot":"","sources":["../../../for_primeReactThemes/when_checking_the_token_vocabulary.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,QAAQ,CAAC,oCAAoC,EAAE,GAAG,EAAE;IAChD,MAAM,UAAU,GAAG;QACf,eAAe;QACf,uBAAuB;QACvB,oBAAoB;QACpB,cAAc;QACd,gBAAgB;QAChB,eAAe;QACf,iBAAiB;QACjB,YAAY;QACZ,iBAAiB;QACjB,sBAAsB;QACtB,iBAAiB;QACjB,sBAAsB;QACtB,YAAY;KACf,CAAC;IAEF,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;QACpD,MAAM,UAAU,GAAG,gBAAgB;aAC9B,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC,CAAC;aAClF,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAChC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CA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K,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;aAC3E,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC,CACnD,CAAC;QACF,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6DAA6D,EAAE,GAAG,EAAE;QACnE,gBAAgB,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,iBAAiB,CAAE,CAAC,MAAO,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IACzH,CAAC,CAAC,CAAC;IAOH,EAAE,CAAC,0EAA0E,EAAE,GAAG,EAAE;QAChF,gBAAgB,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,gBAAgB,CAAE,CAAC,MAAO,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IACxH,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=when_reading_a_boolean_property.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"when_reading_a_boolean_property.d.ts","sourceRoot":"","sources":["../../../for_properties/when_reading_a_boolean_property.ts"],"names":[],"mappings":""}
@@ -1,26 +0,0 @@
1
- import { booleanProperty } from '../properties';
2
- describe('when reading a boolean property', () => {
3
- const element = { id: 'element', properties: { disabled: true, visible: false, filter: 'yes' } };
4
- describe('and the property is present and a boolean', () => {
5
- it('should return true when it is true', () => {
6
- booleanProperty(element, 'disabled', false).should.be.true;
7
- });
8
- it('should return false when it is false rather than falling back', () => {
9
- booleanProperty(element, 'visible', true).should.be.false;
10
- });
11
- });
12
- describe('and the property is missing', () => {
13
- it('should return undefined when no fallback was given', () => {
14
- (booleanProperty(element, 'rounded') === undefined).should.be.true;
15
- });
16
- it('should return the fallback when one was given', () => {
17
- booleanProperty(element, 'rounded', true).should.be.true;
18
- });
19
- });
20
- describe('and the property is present but not a boolean', () => {
21
- it('should treat a truthy string like a missing property', () => {
22
- booleanProperty(element, 'filter', false).should.be.false;
23
- });
24
- });
25
- });
26
- //# sourceMappingURL=when_reading_a_boolean_property.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"when_reading_a_boolean_property.js","sourceRoot":"","sources":["../../../for_properties/when_reading_a_boolean_property.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,QAAQ,CAAC,iCAAiC,EAAE,GAAG,EAAE;IAC7C,MAAM,OAAO,GAAiB,EAAE,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;IAE/G,QAAQ,CAAC,2CAA2C,EAAE,GAAG,EAAE;QACvD,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;YAC1C,eAAe,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC;QAC/D,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,+DAA+D,EAAE,GAAG,EAAE;YACrE,eAAe,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC;QAC9D,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACzC,EAAE,CAAC,oDAAoD,EAAE,GAAG,EAAE;YAC1D,CAAC,eAAe,CAAC,OAAO,EAAE,SAAS,CAAC,KAAK,SAAS,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC;QACvE,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;YACrD,eAAe,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC;QAC7D,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,+CAA+C,EAAE,GAAG,EAAE;QAC3D,EAAE,CAAC,sDAAsD,EAAE,GAAG,EAAE;YAC5D,eAAe,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC;QAC9D,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=when_reading_a_number_property.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"when_reading_a_number_property.d.ts","sourceRoot":"","sources":["../../../for_properties/when_reading_a_number_property.ts"],"names":[],"mappings":""}
@@ -1,29 +0,0 @@
1
- import { numberProperty } from '../properties';
2
- describe('when reading a number property', () => {
3
- const element = { id: 'element', properties: { rows: 5, zero: 0, size: '12', broken: Number.NaN } };
4
- describe('and the property is present and a number', () => {
5
- it('should return it', () => {
6
- numberProperty(element, 'rows', 1).should.equal(5);
7
- });
8
- it('should return zero rather than falling back', () => {
9
- numberProperty(element, 'zero', 10).should.equal(0);
10
- });
11
- });
12
- describe('and the property is missing', () => {
13
- it('should return undefined when no fallback was given', () => {
14
- (numberProperty(element, 'columns') === undefined).should.be.true;
15
- });
16
- it('should return the fallback when one was given', () => {
17
- numberProperty(element, 'columns', 2).should.equal(2);
18
- });
19
- });
20
- describe('and the property is present but not a usable number', () => {
21
- it('should treat a numeric string like a missing property', () => {
22
- numberProperty(element, 'size', 16).should.equal(16);
23
- });
24
- it('should treat NaN like a missing property, because it is never a usable size', () => {
25
- numberProperty(element, 'broken', 16).should.equal(16);
26
- });
27
- });
28
- });
29
- //# sourceMappingURL=when_reading_a_number_property.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"when_reading_a_number_property.js","sourceRoot":"","sources":["../../../for_properties/when_reading_a_number_property.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,QAAQ,CAAC,gCAAgC,EAAE,GAAG,EAAE;IAC5C,MAAM,OAAO,GAAiB,EAAE,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,EAAE,EAAE,CAAC;IAElH,QAAQ,CAAC,0CAA0C,EAAE,GAAG,EAAE;QACtD,EAAE,CAAC,kBAAkB,EAAE,GAAG,EAAE;YACxB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;YACnD,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACzC,EAAE,CAAC,oDAAoD,EAAE,GAAG,EAAE;YAC1D,CAAC,cAAc,CAAC,OAAO,EAAE,SAAS,CAAC,KAAK,SAAS,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC;QACtE,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;YACrD,cAAc,CAAC,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,qDAAqD,EAAE,GAAG,EAAE;QACjE,EAAE,CAAC,uDAAuD,EAAE,GAAG,EAAE;YAC7D,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACzD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,6EAA6E,EAAE,GAAG,EAAE;YACnF,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC3D,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=when_reading_a_string_property.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"when_reading_a_string_property.d.ts","sourceRoot":"","sources":["../../../for_properties/when_reading_a_string_property.ts"],"names":[],"mappings":""}
@@ -1,23 +0,0 @@
1
- import { stringProperty } from '../properties';
2
- describe('when reading a string property', () => {
3
- const element = { id: 'element', properties: { label: 'Save', count: 3 } };
4
- describe('and the property is present and a string', () => {
5
- it('should return it', () => {
6
- stringProperty(element, 'label').should.equal('Save');
7
- });
8
- });
9
- describe('and the property is missing', () => {
10
- it('should return undefined when no fallback was given', () => {
11
- (stringProperty(element, 'placeholder') === undefined).should.be.true;
12
- });
13
- it('should return the fallback when one was given', () => {
14
- stringProperty(element, 'placeholder', 'Type here').should.equal('Type here');
15
- });
16
- });
17
- describe('and the property is present but not a string', () => {
18
- it('should treat it exactly like a missing one', () => {
19
- stringProperty(element, 'count', 'none').should.equal('none');
20
- });
21
- });
22
- });
23
- //# sourceMappingURL=when_reading_a_string_property.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"when_reading_a_string_property.js","sourceRoot":"","sources":["../../../for_properties/when_reading_a_string_property.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,QAAQ,CAAC,gCAAgC,EAAE,GAAG,EAAE;IAC5C,MAAM,OAAO,GAAiB,EAAE,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;IAEzF,QAAQ,CAAC,0CAA0C,EAAE,GAAG,EAAE;QACtD,EAAE,CAAC,kBAAkB,EAAE,GAAG,EAAE;YACxB,cAAc,CAAC,OAAO,EAAE,OAAO,CAAE,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC3D,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACzC,EAAE,CAAC,oDAAoD,EAAE,GAAG,EAAE;YAC1D,CAAC,cAAc,CAAC,OAAO,EAAE,aAAa,CAAC,KAAK,SAAS,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC;QAC1E,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;YACrD,cAAc,CAAC,OAAO,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAClF,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,8CAA8C,EAAE,GAAG,EAAE;QAC1D,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;YAClD,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAClE,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=when_reading_an_array_property.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"when_reading_an_array_property.d.ts","sourceRoot":"","sources":["../../../for_properties/when_reading_an_array_property.ts"],"names":[],"mappings":""}
@@ -1,32 +0,0 @@
1
- import { arrayProperty, recordArrayProperty, stringArrayProperty } from '../properties';
2
- describe('when reading an array property', () => {
3
- const element = {
4
- id: 'element',
5
- properties: {
6
- mixed: ['a', 2, { name: 'c' }, ['d'], undefined],
7
- notAnArray: 'a',
8
- },
9
- };
10
- describe('and the property is present and an array', () => {
11
- it('should return every entry untouched', () => {
12
- arrayProperty(element, 'mixed').should.have.lengthOf(5);
13
- });
14
- it('should keep only the strings when strings were asked for', () => {
15
- stringArrayProperty(element, 'mixed').should.deep.equal(['a']);
16
- });
17
- it('should keep only the objects when objects were asked for, excluding arrays', () => {
18
- recordArrayProperty(element, 'mixed').should.deep.equal([{ name: 'c' }]);
19
- });
20
- });
21
- describe('and the property is missing', () => {
22
- it('should return an empty array rather than undefined, because every caller maps over it', () => {
23
- arrayProperty(element, 'absent').should.deep.equal([]);
24
- });
25
- });
26
- describe('and the property is present but not an array', () => {
27
- it('should treat it exactly like a missing one', () => {
28
- arrayProperty(element, 'notAnArray').should.deep.equal([]);
29
- });
30
- });
31
- });
32
- //# sourceMappingURL=when_reading_an_array_property.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"when_reading_an_array_property.js","sourceRoot":"","sources":["../../../for_properties/when_reading_an_array_property.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAExF,QAAQ,CAAC,gCAAgC,EAAE,GAAG,EAAE;IAC5C,MAAM,OAAO,GAAiB;QAC1B,EAAE,EAAE,SAAS;QACb,UAAU,EAAE;YACR,KAAK,EAAE,CAAC,GAAG,EAAE,CAA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C,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=when_reading_options.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"when_reading_options.d.ts","sourceRoot":"","sources":["../../../for_properties/when_reading_options.ts"],"names":[],"mappings":""}
@@ -1,37 +0,0 @@
1
- import { optionsProperty } from '../properties';
2
- describe('when reading options', () => {
3
- describe('and the options are written as bare strings', () => {
4
- const element = { id: 'element', properties: { options: ['Draft', 'Published'] } };
5
- it('should use each string as both label and value', () => {
6
- optionsProperty(element, 'options').should.deep.equal([
7
- { label: 'Draft', value: 'Draft' },
8
- { label: 'Published', value: 'Published' },
9
- ]);
10
- });
11
- });
12
- describe('and the options are written as records', () => {
13
- const element = { id: 'element', properties: { options: [{ label: 'Draft', value: 'draft' }] } };
14
- it('should keep the label and value apart', () => {
15
- optionsProperty(element, 'options').should.deep.equal([{ label: 'Draft', value: 'draft' }]);
16
- });
17
- });
18
- describe('and a record carries only a label', () => {
19
- const element = { id: 'element', properties: { options: [{ label: 'Draft' }] } };
20
- it('should use the label as the value, which is what the shorthand means', () => {
21
- optionsProperty(element, 'options').should.deep.equal([{ label: 'Draft', value: 'Draft' }]);
22
- });
23
- });
24
- describe('and an entry carries no usable label', () => {
25
- const element = { id: 'element', properties: { options: [{ value: 'draft' }, 7, { label: 'Draft' }] } };
26
- it('should skip it rather than render a blank choice', () => {
27
- optionsProperty(element, 'options').should.deep.equal([{ label: 'Draft', value: 'Draft' }]);
28
- });
29
- });
30
- describe('and the property is missing', () => {
31
- const element = { id: 'element', properties: {} };
32
- it('should return no options', () => {
33
- optionsProperty(element, 'options').should.deep.equal([]);
34
- });
35
- });
36
- });
37
- //# sourceMappingURL=when_reading_options.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"when_reading_options.js","sourceRoot":"","sources":["../../../for_properties/when_reading_options.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,eA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AAC,sEAAsE,EAAE,GAAG,EAAE;YAC5E,eAAe,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;QAChG,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAClD,MAAM,OAAO,GAAiB,EAAE,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC;QAEtH,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;YACxD,eAAe,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;QAChG,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACzC,MAAM,OAAO,GAAiB,EAAE,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC;QAEhE,EAAE,CAAC,0BAA0B,EAAE,GAAG,EAAE;YAChC,eAAe,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC9D,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=when_converting_entries.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"when_converting_entries.d.ts","sourceRoot":"","sources":["../../../for_treeNodes/when_converting_entries.ts"],"names":[],"mappings":""}
@@ -1,33 +0,0 @@
1
- import { toTreeNodes } from '../treeNodes';
2
- describe('when converting entries', () => {
3
- describe('and no entry supplies a key', () => {
4
- const nodes = toTreeNodes([{ label: 'Documents', children: [{ label: 'Work' }, { label: 'Work' }] }]);
5
- it('should derive a key from the path', () => {
6
- nodes[0].key.should.equal('0');
7
- });
8
- it('should keep two identically labeled siblings apart, so expansion and selection track the right row', () => {
9
- nodes[0].children[0].key.should.equal('0-0');
10
- nodes[0].children[1].key.should.equal('0-1');
11
- });
12
- });
13
- describe('and an entry supplies its own key', () => {
14
- const nodes = toTreeNodes([{ key: 'docs', label: 'Documents', children: [{ label: 'Work' }] }]);
15
- it('should keep it', () => {
16
- nodes[0].key.should.equal('docs');
17
- });
18
- it('should build child keys from it', () => {
19
- nodes[0].children[0].key.should.equal('docs-0');
20
- });
21
- });
22
- describe('and an entry is a bare string', () => {
23
- it('should use it as the label', () => {
24
- toTreeNodes(['Documents'])[0].label.should.equal('Documents');
25
- });
26
- });
27
- describe('and an entry is neither a string nor a record', () => {
28
- it('should drop it', () => {
29
- toTreeNodes([7, ['nested'], 'Documents']).should.have.lengthOf(1);
30
- });
31
- });
32
- });
33
- //# sourceMappingURL=when_converting_entries.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"when_converting_entries.js","sourceRoot":"","sources":["../../../for_treeNodes/when_converting_entries.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACrC,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACzC,MAAM,KAAK,GAAG,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAEtG,EAAE,CAAC,mC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CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QACnE,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,+CAA+C,EAAE,GAAG,EAAE;QAC3D,EAAE,CAAC,gBAAgB,EAAE,GAAG,EAAE;YACtB,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QACtE,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,80 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
-
4
- import { ExternalComponent, HorizontalAlignment, VerticalAlignment, Visibility } from '@cratis/scene.model';
5
- import { columnDefinitions } from '../data';
6
-
7
- function table(properties: Record<string, unknown>, slots: ExternalComponent['slots'] = {}): ExternalComponent {
8
- return {
9
- id: 'table',
10
- name: 'table',
11
- properties,
12
- slots,
13
- componentName: 'PrimeReact:table',
14
- visibility: Visibility.Visible,
15
- isEnabled: true,
16
- opacity: 1,
17
- size: {},
18
- zIndex: 0,
19
- minimumSize: {},
20
- maximumSize: {},
21
- margin: { left: 0, top: 0, right: 0, bottom: 0 },
22
- horizontalAlignment: HorizontalAlignment.Stretch,
23
- verticalAlignment: VerticalAlignment.Stretch,
24
- };
25
- }
26
-
27
- const rows = [{ name: 'Ada', role: 'Engineer' }];
28
-
29
- describe('when deriving columns', () => {
30
- describe('and the table has nested column children', () => {
31
- const element = table({ columns: ['ignored'] }, { columns: [{ id: 'c1', properties: { field: 'name', header: 'Name', sortable: true } }] });
32
-
33
- it('should use them in preference to anything else, because they are the most explicit statement', () => {
34
- columnDefinitions(element, rows).should.deep.equal([{ field: 'name', header: 'Name', sortable: true }]);
35
- });
36
- });
37
-
38
- describe('and a nested column child gives no header', () => {
39
- const element = table({}, { columns: [{ id: 'c1', properties: { field: 'name' } }] });
40
-
41
- it('should label it with the field rather than leaving it blank', () => {
42
- columnDefinitions(element, rows).should.deep.equal([{ field: 'name', header: 'name', sortable: false }]);
43
- });
44
- });
45
-
46
- describe('and the table configures its columns as records', () => {
47
- const element = table({ columns: [{ field: 'role', header: 'Role' }] });
48
-
49
- it('should use them', () => {
50
- columnDefinitions(element, rows).should.deep.equal([{ field: 'role', header: 'Role', sortable: false }]);
51
- });
52
- });
53
-
54
- describe('and the table configures its columns as bare field names', () => {
55
- const element = table({ columns: ['role'] });
56
-
57
- it('should use each name as both field and header', () => {
58
- columnDefinitions(element, rows).should.deep.equal([{ field: 'role', header: 'role', sortable: false }]);
59
- });
60
- });
61
-
62
- describe('and the table configures no columns at all', () => {
63
- const element = table({});
64
-
65
- it('should infer them from the first row, so a table with data renders it', () => {
66
- columnDefinitions(element, rows).should.deep.equal([
67
- { field: 'name', header: 'name', sortable: false },
68
- { field: 'role', header: 'role', sortable: false },
69
- ]);
70
- });
71
- });
72
-
73
- describe('and the table has neither columns nor rows', () => {
74
- const element = table({});
75
-
76
- it('should derive no columns rather than throwing', () => {
77
- columnDefinitions(element, []).should.deep.equal([]);
78
- });
79
- });
80
- });
@@ -1,40 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
-
4
- import { MenuItem } from '../MenuItem';
5
- import { toMenuItems } from '../menuItems';
6
-
7
- describe('when converting entries', () => {
8
- describe('and an entry is a bare string', () => {
9
- it('should use it as the label', () => {
10
- toMenuItems(['File']).should.deep.equal([{ label: 'File' }]);
11
- });
12
- });
13
-
14
- describe('and an entry carries submenus', () => {
15
- const items = toMenuItems([{ label: 'File', icon: 'pi pi-file', items: [{ label: 'Open', items: ['Recent'] }] }]);
16
-
17
- it('should keep the label and icon', () => {
18
- items[0].label!.should.equal('File');
19
- items[0].icon!.should.equal('pi pi-file');
20
- });
21
-
22
- it('should follow the nesting to any depth, because a menubar and a tiered menu differ only in depth', () => {
23
- const submenu = items[0].items as MenuItem[];
24
- const nested = submenu[0].items as MenuItem[];
25
- nested[0].label!.should.equal('Recent');
26
- });
27
- });
28
-
29
- describe('and an entry is a separator', () => {
30
- it('should keep it even though it has no label', () => {
31
- toMenuItems([{ separator: true }]).should.deep.equal([{ separator: true }]);
32
- });
33
- });
34
-
35
- describe('and an entry has no usable label', () => {
36
- it('should drop it rather than render a blank command', () => {
37
- toMenuItems([{ icon: 'pi pi-file' }, 7, ['nested'], { label: 'File' }]).should.deep.equal([{ label: 'File' }]);
38
- });
39
- });
40
- });
@@ -1,41 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
-
4
- import { PackageKind } from '@cratis/scene.model';
5
- import { primeReactPackageManifest } from '../primeReactPackage';
6
-
7
- describe('when inspecting the manifest', () => {
8
- it('should be named the way a ui profile lists it', () => {
9
- primeReactPackageManifest.name.should.equal('PrimeReact');
10
- });
11
-
12
- it('should be a component library', () => {
13
- primeReactPackageManifest.kind.should.equal(PackageKind.ComponentLibrary);
14
- });
15
-
16
- it('should depend on Tailwind, because the wrappers lay themselves out with it', () => {
17
- primeReactPackageManifest.dependencies.should.deep.equal([{ name: 'Tailwind' }]);
18
- });
19
-
20
- it('should name the module a host imports it from', () => {
21
- primeReactPackageManifest.module!.should.equal('@cratis/scene.primereact');
22
- });
23
-
24
- it('should provide no layouts, which belong to a blueprint package', () => {
25
- primeReactPackageManifest.layouts.should.deep.equal([]);
26
- });
27
-
28
- it('should provide no screen templates, which belong to a blueprint package', () => {
29
- primeReactPackageManifest.screenTemplates.should.deep.equal([]);
30
- });
31
-
32
- it('should provide no dialog templates, which belong to a blueprint package', () => {
33
- primeReactPackageManifest.dialogTemplates.should.deep.equal([]);
34
- });
35
-
36
- it('should declare the names Screenplay screen directives compile to', () => {
37
- for (const name of ['table', 'column', 'title', 'field', 'section', 'summary', 'action']) {
38
- primeReactPackageManifest.components.should.contain(name);
39
- }
40
- });
41
- });
@@ -1,33 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
-
4
- import { componentRegistryKey } from '@cratis/scene.react';
5
- import { primeReactComponents } from '../primeReactComponents';
6
- import { primeReactPackageManifest } from '../primeReactPackage';
7
-
8
- describe('when inspecting the registry', () => {
9
- const keys = Object.keys(primeReactComponents);
10
-
11
- it('should register an implementation for every declared component name', () => {
12
- const missing = primeReactPackageManifest.components.filter((name) => primeReactComponents[componentRegistryKey('PrimeReact', name)] === undefined);
13
- missing.should.deep.equal([]);
14
- });
15
-
16
- it('should declare every registered component name', () => {
17
- const declared = new Set(primeReactPackageManifest.components);
18
- const undeclared = keys.filter((key) => !declared.has(key.slice('PrimeReact:'.length)));
19
- undeclared.should.deep.equal([]);
20
- });
21
-
22
- it('should qualify every registry key with the package name', () => {
23
- keys.filter((key) => !key.startsWith('PrimeReact:')).should.deep.equal([]);
24
- });
25
-
26
- it('should declare every component name exactly once', () => {
27
- primeReactPackageManifest.components.should.have.lengthOf(new Set(primeReactPackageManifest.components).size);
28
- });
29
-
30
- it('should name every component in lowerCamelCase', () => {
31
- primeReactPackageManifest.components.filter((name) => !/^[a-z][a-zA-Z]*$/.test(name)).should.deep.equal([]);
32
- });
33
- });
@@ -1,111 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
-
4
- import { render } from '@testing-library/react';
5
- import { PrimeReactProvider } from '@primereact/core';
6
- import { SceneElementView } from '@cratis/scene.react';
7
- import { primeReactComponents } from '../primeReactComponents';
8
- import { primeReactPackageManifest } from '../primeReactPackage';
9
- import { sceneComponent } from '../storyElements';
10
-
11
- /**
12
- * The end-to-end check the registry spec cannot make.
13
- *
14
- * `validatePackageBundle` proves the manifest and the registry agree on *names*. This proves the names
15
- * actually reach a component: each declared name is put through the real `SceneElementView`, the real
16
- * renderer and the real registry, and must not come out as the `UnresolvedComponent` placeholder. A
17
- * misspelled registry key passes every name-level check and only fails here.
18
- *
19
- * Each element is rendered with almost nothing configured, which is the second thing this specifies: a
20
- * component whose data has not been authored yet is an ordinary state on a screen under construction, and
21
- * it must render empty rather than take the whole screen down with it. This is how PrimeReact's
22
- * OrganizationChart was found to throw on an empty node list.
23
- *
24
- * The `PrimeReactProvider` is not decoration and is new with PrimeReact 11. Every v11 component and
25
- * headless hook bottoms out in `useBase` -> `usePrimeReact()`, which *throws* when the context is absent
26
- * rather than falling back to a default configuration - so on v11 this spec fails at `render` for every
27
- * adapter that touches a PrimeReact component, with an error about the provider rather than about the
28
- * component. The provider is deliberately given no preset: what is being specified here is that the names
29
- * resolve and the components survive being unconfigured, not how they look.
30
- */
31
- describe('when rendering every declared component', () => {
32
- let unresolved: string[];
33
- let threw: string[];
34
-
35
- beforeEach(() => {
36
- // jsdom implements neither `ResizeObserver` nor `IntersectionObserver`. PrimeReact 11's ScrollArea
37
- // and Carousel observe their own box to size a scrollbar thumb and a page, and the Carousel watches
38
- // its slides to know which page is on screen. As with `matchMedia` below, these fill an environment
39
- // gap rather than papering over a defect - every real browser has had both for years, and a
40
- // component is entitled to assume them.
41
- //
42
- // Both stubs observe nothing, which is the right answer here rather than a shortcut: jsdom has no
43
- // layout to report, and this spec renders each component once and never resizes or scrolls it.
44
- // Casting through `unknown` avoids spelling out `root`, `rootMargin`, `thresholds` and
45
- // `takeRecords` to satisfy the real DOM interface, none of which the components read.
46
- const observerStub = class {
47
- observe(): void {
48
- return undefined;
49
- }
50
- unobserve(): void {
51
- return undefined;
52
- }
53
- disconnect(): void {
54
- return undefined;
55
- }
56
- };
57
-
58
- if (window.ResizeObserver === undefined) {
59
- window.ResizeObserver = observerStub as unknown as typeof ResizeObserver;
60
- globalThis.ResizeObserver = window.ResizeObserver;
61
- }
62
-
63
- if (window.IntersectionObserver === undefined) {
64
- window.IntersectionObserver = observerStub as unknown as typeof IntersectionObserver;
65
- globalThis.IntersectionObserver = window.IntersectionObserver;
66
- }
67
-
68
- // jsdom implements no `matchMedia`, and PrimeReact's PickList calls it to pick a responsive
69
- // layout. This fills the environment gap rather than papering over a defect - a real browser
70
- // has always had it.
71
- if (window.matchMedia === undefined) {
72
- window.matchMedia = (query: string) =>
73
- ({
74
- matches: false,
75
- media: query,
76
- onchange: undefined,
77
- addListener: () => undefined,
78
- removeListener: () => undefined,
79
- addEventListener: () => undefined,
80
- removeEventListener: () => undefined,
81
- dispatchEvent: () => false,
82
- }) as unknown as MediaQueryList;
83
- }
84
-
85
- unresolved = [];
86
- threw = [];
87
-
88
- for (const name of primeReactPackageManifest.components) {
89
- const element = sceneComponent(`element-${name}`, name, { text: name, label: name, value: name });
90
- try {
91
- const { container, unmount } = render(
92
- <PrimeReactProvider>
93
- <SceneElementView element={element} registry={primeReactComponents} resolveBinding={() => undefined} />
94
- </PrimeReactProvider>
95
- );
96
- if (container.querySelector('[data-scene-unresolved-component]') !== null) unresolved.push(name);
97
- unmount();
98
- } catch (error) {
99
- threw.push(`${name}: ${(error as Error).message.split('\n')[0]}`);
100
- }
101
- }
102
- });
103
-
104
- it('should resolve every declared name to a real component', () => {
105
- unresolved.should.deep.equal([]);
106
- });
107
-
108
- it('should render every declared component with nothing configured, rather than throwing', () => {
109
- threw.should.deep.equal([]);
110
- });
111
- });
@@ -1,45 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
-
4
- import { PackageCatalog, resolveComponentName } from '@cratis/scene.engine';
5
- import { UiProfile } from '@cratis/scene.model';
6
- import { corePackageManifest } from '@cratis/scene.react';
7
- import { primeReactPackageManifest } from '../primeReactPackage';
8
-
9
- describe('when resolving a name core also declares', () => {
10
- const profile: UiProfile = { name: 'web', targetPlatform: 'web', packages: ['core', 'PrimeReact'] };
11
- const catalog: PackageCatalog = {
12
- core: corePackageManifest.components,
13
- PrimeReact: primeReactPackageManifest.components,
14
- };
15
-
16
- for (const name of ['text', 'button', 'card']) {
17
- describe(`and the name is '${name}'`, () => {
18
- const resolution = resolveComponentName(name, profile, catalog);
19
-
20
- it('should resolve it', () => {
21
- (resolution !== undefined).should.be.true;
22
- });
23
-
24
- it('should resolve to PrimeReact', () => {
25
- resolution!.package.should.equal('PrimeReact');
26
- });
27
-
28
- it('should record that core was shadowed', () => {
29
- resolution!.shadows.should.deep.equal(['core']);
30
- });
31
- });
32
- }
33
-
34
- describe('and the name is only declared by PrimeReact', () => {
35
- const resolution = resolveComponentName('dataTable', profile, catalog);
36
-
37
- it('should resolve to PrimeReact', () => {
38
- resolution!.package.should.equal('PrimeReact');
39
- });
40
-
41
- it('should shadow nothing', () => {
42
- resolution!.shadows.should.deep.equal([]);
43
- });
44
- });
45
- });