@simai-studio/view 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/README.md +5 -5
  2. package/dist/package-receipt.json +322 -81
  3. package/dist/set.json +35 -2
  4. package/dist/smart/rule.js +94 -0
  5. package/dist/smart/rule.js.gz +0 -0
  6. package/dist/smart/view/component.json +1 -1
  7. package/dist/smart/view/component.json.gz +0 -0
  8. package/dist/smart/view/js/view.js +1 -1
  9. package/dist/smart/view/js/view.js.gz +0 -0
  10. package/dist/smart/view/js/view.min.js +1 -1
  11. package/dist/smart/view/js/view.min.js.gz +0 -0
  12. package/dist/smart/view/smart.manifest.json +1 -1
  13. package/dist/smart/view/smart.manifest.json.gz +0 -0
  14. package/dist/smart/view/static/default/open-record.html +1 -1
  15. package/dist/smart/view/static/default/open-record.html.gz +0 -0
  16. package/dist/smart/view/static/default/reference.html +1 -1
  17. package/dist/smart/view/static/default/reference.html.gz +0 -0
  18. package/dist/smart/view-flow/component.json +620 -0
  19. package/dist/smart/view-flow/component.json.gz +0 -0
  20. package/dist/smart/view-flow/css/view-flow.css +570 -0
  21. package/dist/smart/view-flow/css/view-flow.css.gz +0 -0
  22. package/dist/smart/view-flow/css/view-flow.min.css +3 -0
  23. package/dist/smart/view-flow/css/view-flow.min.css.gz +0 -0
  24. package/dist/smart/view-flow/examples.json +452 -0
  25. package/dist/smart/view-flow/examples.json.gz +0 -0
  26. package/dist/smart/view-flow/js/view-flow.js +7406 -0
  27. package/dist/smart/view-flow/js/view-flow.js.gz +0 -0
  28. package/dist/smart/view-flow/js/view-flow.min.js +749 -0
  29. package/dist/smart/view-flow/js/view-flow.min.js.gz +0 -0
  30. package/dist/smart/view-flow/lang/en.json +24 -0
  31. package/dist/smart/view-flow/lang/en.json.gz +0 -0
  32. package/dist/smart/view-flow/lang/ru.json +24 -0
  33. package/dist/smart/view-flow/lang/ru.json.gz +0 -0
  34. package/dist/smart/view-flow/probe.json +149 -0
  35. package/dist/smart/view-flow/probe.json.gz +0 -0
  36. package/dist/smart/view-flow/smart.manifest.json +486 -0
  37. package/dist/smart/view-flow/smart.manifest.json.gz +0 -0
  38. package/dist/smart/view-flow/static/default/answered.html +57 -0
  39. package/dist/smart/view-flow/static/default/answered.html.gz +0 -0
  40. package/dist/smart/view-flow/static/default/ask.html +146 -0
  41. package/dist/smart/view-flow/static/default/ask.html.gz +0 -0
  42. package/dist/smart/view-flow/static/default/expired.html +16 -0
  43. package/dist/smart/view-flow/static/default/expired.html.gz +0 -0
  44. package/dist/smart/view-flow/static/default/groups.html +44 -0
  45. package/dist/smart/view-flow/static/default/groups.html.gz +0 -0
  46. package/dist/smart/view-flow/static/default/reference.html +72 -0
  47. package/dist/smart/view-flow/static/default/reference.html.gz +0 -0
  48. package/dist/smart/view-flow/static/default/untitled.html +41 -0
  49. package/dist/smart/view-flow/static/default/untitled.html.gz +0 -0
  50. package/dist/smart/view-flow/static/sheets.json +443 -0
  51. package/dist/smart/view-flow/static/sheets.json.gz +0 -0
  52. package/dist/smart/view-flow/template/default.css +180 -0
  53. package/dist/smart/view-flow/template/default.css.gz +0 -0
  54. package/dist/smart/view-flow/template/default.js +136 -0
  55. package/dist/smart/view-flow/template/default.js.gz +0 -0
  56. package/dist/smart/view-properties/component.json +8 -1
  57. package/dist/smart/view-properties/component.json.gz +0 -0
  58. package/dist/smart/view-properties/css/view-properties.css +367 -0
  59. package/dist/smart/view-properties/css/view-properties.css.gz +0 -0
  60. package/dist/smart/view-properties/css/view-properties.min.css +1 -0
  61. package/dist/smart/view-properties/css/view-properties.min.css.gz +0 -0
  62. package/dist/smart/view-properties/js/view-properties.js +1755 -169
  63. package/dist/smart/view-properties/js/view-properties.js.gz +0 -0
  64. package/dist/smart/view-properties/js/view-properties.min.js +491 -378
  65. package/dist/smart/view-properties/js/view-properties.min.js.gz +0 -0
  66. package/dist/smart/view-properties/smart.manifest.json +38 -3
  67. package/dist/smart/view-properties/smart.manifest.json.gz +0 -0
  68. package/dist/smart/view-properties/template/default.js +1 -77
  69. package/dist/smart/view-properties/template/default.js.gz +0 -0
  70. package/dist/smart/view-table/js/view-table.js +2 -0
  71. package/dist/smart/view-table/js/view-table.js.gz +0 -0
  72. package/dist/smart/view-table/js/view-table.min.js +2 -0
  73. package/dist/smart/view-table/js/view-table.min.js.gz +0 -0
  74. package/package.json +1 -1
@@ -0,0 +1,24 @@
1
+ {
2
+ "title": "Flow block",
3
+ "runtime": {
4
+ "accept-text": "Send",
5
+ "accepted-text": "Sent",
6
+ "accepting-text": "Sending…",
7
+ "block-label": "Properties",
8
+ "cancel-text": "Cancel",
9
+ "decline-text": "Cancel",
10
+ "declined-text": "Cancelled",
11
+ "declining-text": "Cancelling…",
12
+ "empty-text": "not filled in",
13
+ "expired-text": "The time to answer has passed",
14
+ "invalid-text": "Fill in the marked fields",
15
+ "required-text": "Fill in this field",
16
+ "submit-text": "Send",
17
+ "until-text": "Answer by {time}"
18
+ },
19
+ "events": {
20
+ "expired": {
21
+ "label": "Expired"
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "title": "Блок в потоке",
3
+ "runtime": {
4
+ "accept-text": "Отправить",
5
+ "accepted-text": "Отправлено",
6
+ "accepting-text": "Отправляем…",
7
+ "block-label": "Данные",
8
+ "cancel-text": "Отмена",
9
+ "decline-text": "Отмена",
10
+ "declined-text": "Отменено",
11
+ "declining-text": "Отменяем…",
12
+ "empty-text": "не заполнено",
13
+ "expired-text": "Время ответа истекло",
14
+ "invalid-text": "Заполните отмеченные поля",
15
+ "required-text": "Заполните поле",
16
+ "submit-text": "Отправить",
17
+ "until-text": "Ответить до {time}"
18
+ },
19
+ "events": {
20
+ "expired": {
21
+ "label": "Время истекло"
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,149 @@
1
+ {
2
+ "component": "sf-view-flow",
3
+ "probe": "sf-view-flow against component.json (standard simai.smart-component 1.4 §12, gate 20)",
4
+ "format": "stands/15-scenarios (A4 modal: a page, probes in steps); the runner is ui-source tests/browser/manifest-probes.browser.mjs, run for the package by scripts/run-manifest-probes.mjs",
5
+ "page": {
6
+ "lang": "ru",
7
+ "body": [
8
+ "<main>",
9
+ " <sf-view-flow id=\"b\" mode=\"edit\" heading=\"Новая командировка\" block-id=\"b1\" fields='[{\"key\": \"city\", \"label\": \"Город\", \"propertyType\": \"string\", \"width\": \"half\", \"required\": true, \"placeholder\": \"Куда\", \"value\": null}, {\"key\": \"from\", \"label\": \"Выезд\", \"propertyType\": \"date\", \"width\": \"half\", \"required\": true, \"value\": null}, {\"key\": \"nights\", \"label\": \"Ночей\", \"propertyType\": \"integer\", \"width\": \"half\", \"value\": 2}, {\"key\": \"goal\", \"label\": \"Цель поездки\", \"propertyType\": \"text\", \"width\": \"full\", \"placeholder\": \"Например, встреча с заказчиком\", \"value\": null}]'></sf-view-flow>",
10
+ " <sf-view-flow id=\"c\" mode=\"edit\" block-id=\"b2\" cancelable=\"false\" fields='[{\"key\": \"nights\", \"label\": \"Ночей\", \"propertyType\": \"integer\", \"width\": \"half\", \"value\": 2}]'></sf-view-flow>",
11
+ " <button id=\"page-send\" type=\"button\" data-sf-action=\"c.confirm\">Отправить</button>",
12
+ "</main>"
13
+ ]
14
+ },
15
+ "probes": [
16
+ {
17
+ "id": "p1-required-stops-send",
18
+ "title": "Send with the required fields empty sends nothing: each says «Заполните поле», the status line «Заполните отмеченные поля», and the block stays open",
19
+ "covers": "actions.confirm refused invalid, required, accessibility.name heading",
20
+ "steps": [
21
+ {
22
+ "script": "(document.activeElement?.blur?.(), true)",
23
+ "wait": 60,
24
+ "check": "document.querySelector('#b section').getAttribute('aria-labelledby') === document.querySelector('#b [role=heading]').id"
25
+ },
26
+ {
27
+ "action": {
28
+ "name": "confirm"
29
+ },
30
+ "target": "#b",
31
+ "wait": 120,
32
+ "expect": {
33
+ "returns": {
34
+ "outcome": "refused",
35
+ "reason": "invalid"
36
+ },
37
+ "events": [
38
+ {
39
+ "name": "sf-view-flow-answer",
40
+ "count": 0
41
+ }
42
+ ]
43
+ },
44
+ "check": "document.querySelector('#b').state === 'open' && document.querySelectorAll('#b .sf-view-flow__error').length === 2 && document.querySelector('#b .sf-view-flow__status span').textContent.trim() === 'Заполните отмеченные поля'"
45
+ }
46
+ ]
47
+ },
48
+ {
49
+ "id": "p2-cancel",
50
+ "title": "Cancel answers {id, accepted: false}; the block is pending, then declined when the host settles it, and shows only «Отменено»",
51
+ "covers": "actions.cancel, events.answer, actions.settle",
52
+ "steps": [
53
+ {
54
+ "action": {
55
+ "name": "cancel"
56
+ },
57
+ "target": "#b",
58
+ "expect": {
59
+ "returns": {
60
+ "outcome": "applied"
61
+ },
62
+ "events": [
63
+ {
64
+ "name": "sf-view-flow-answer",
65
+ "count": 1,
66
+ "detail": {
67
+ "id": "b1",
68
+ "accepted": false
69
+ }
70
+ }
71
+ ]
72
+ },
73
+ "check": "document.querySelector('#b').state === 'pending'"
74
+ },
75
+ {
76
+ "action": {
77
+ "name": "settle",
78
+ "with": {
79
+ "result": {
80
+ "answer": "applied"
81
+ }
82
+ }
83
+ },
84
+ "target": "#b",
85
+ "wait": 120,
86
+ "expect": {
87
+ "returns": {
88
+ "outcome": "applied"
89
+ }
90
+ },
91
+ "check": "document.querySelector('#b').state === 'declined' && !document.querySelector('#b .sf-view-flow__groups') && document.querySelector('#b .sf-view-flow__status span').textContent.trim() === 'Отменено'"
92
+ }
93
+ ]
94
+ },
95
+ {
96
+ "id": "p3-page-trigger-send",
97
+ "title": "a page button data-sf-action=\"c.confirm\" sends the untitled block with its values; without Cancel there is one answer; the block is named «Данные»",
98
+ "covers": "actions.confirm (§8 page trigger), cancelable false, accessibility.name runtime.block-label",
99
+ "steps": [
100
+ {
101
+ "script": "(document.activeElement?.blur?.(), true)",
102
+ "wait": 60,
103
+ "check": "document.querySelectorAll('#c sf-button').length === 1 && document.querySelector('#c section').getAttribute('aria-label') === 'Данные'"
104
+ },
105
+ {
106
+ "user": "click:#page-send",
107
+ "expect": {
108
+ "events": [
109
+ {
110
+ "name": "sf-view-flow-answer",
111
+ "count": 1,
112
+ "detail": {
113
+ "id": "b2",
114
+ "accepted": true,
115
+ "values": {
116
+ "nights": 2
117
+ }
118
+ }
119
+ }
120
+ ]
121
+ },
122
+ "check": "document.querySelector('#c').state === 'pending'"
123
+ }
124
+ ]
125
+ },
126
+ {
127
+ "id": "p4-expired",
128
+ "title": "an open block past expires-at reads as expired, says sf-view-flow-expired once and offers no answer",
129
+ "covers": "events.expired (own verb)",
130
+ "steps": [
131
+ {
132
+ "script": "(document.querySelector('#c').state = 'open', document.querySelector('#c').setAttribute('expires-at', '2020-01-01T00:00:00Z'), true)",
133
+ "expect": {
134
+ "events": [
135
+ {
136
+ "name": "sf-view-flow-expired",
137
+ "count": 1,
138
+ "detail": {
139
+ "id": "b2"
140
+ }
141
+ }
142
+ ]
143
+ },
144
+ "check": "document.querySelector('#c').shownState === 'expired' && document.querySelector('#c .sf-view-flow__actions').hidden"
145
+ }
146
+ ]
147
+ }
148
+ ]
149
+ }