@atscript/vue-aooth 0.1.75

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.
@@ -0,0 +1,25 @@
1
+ import * as vue from "vue";
2
+ import { TAsComponentProps } from "@atscript/vue-form";
3
+
4
+ //#region src/components/as-consent-array.vue.d.ts
5
+ /**
6
+ * Single pending consent descriptor — fed via `@ui.form.attr` / `@ui.form.fn.attr`
7
+ * on the consumer's `.as` schema.
8
+ *
9
+ * - `id` — value committed to the bound `string[]` when checked.
10
+ * - `text` — checkbox label.
11
+ * - `required` — non-empty string ⇒ mandatory consent; the string IS the
12
+ * surfaced error message. Empty/undefined ⇒ optional.
13
+ */
14
+ interface AsConsentArrayItem {
15
+ id: string;
16
+ text: string;
17
+ required?: string;
18
+ }
19
+ type __VLS_Props = TAsComponentProps<string[]> & {
20
+ pendingConsents?: AsConsentArrayItem[];
21
+ };
22
+ declare const __VLS_export: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
23
+ declare const _default: typeof __VLS_export;
24
+ //#endregion
25
+ export { AsConsentArrayItem, _default as default };
@@ -0,0 +1,25 @@
1
+ import * as vue from "vue";
2
+ import { TAsComponentProps } from "@atscript/vue-form";
3
+
4
+ //#region src/components/as-consent-array.vue.d.ts
5
+ /**
6
+ * Single pending consent descriptor — fed via `@ui.form.attr` / `@ui.form.fn.attr`
7
+ * on the consumer's `.as` schema.
8
+ *
9
+ * - `id` — value committed to the bound `string[]` when checked.
10
+ * - `text` — checkbox label.
11
+ * - `required` — non-empty string ⇒ mandatory consent; the string IS the
12
+ * surfaced error message. Empty/undefined ⇒ optional.
13
+ */
14
+ interface AsConsentArrayItem {
15
+ id: string;
16
+ text: string;
17
+ required?: string;
18
+ }
19
+ type __VLS_Props = TAsComponentProps<string[]> & {
20
+ pendingConsents?: AsConsentArrayItem[];
21
+ };
22
+ declare const __VLS_export: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
23
+ declare const _default: typeof __VLS_export;
24
+ //#endregion
25
+ export { AsConsentArrayItem, _default as default };
@@ -0,0 +1,2 @@
1
+ import { t as as_consent_array_default } from "./as-consent-array-C1GpSvgX.mjs";
2
+ export { as_consent_array_default as default };
@@ -0,0 +1,271 @@
1
+ let vue = require("vue");
2
+ let _atscript_vue_form = require("@atscript/vue-form");
3
+ let _atscript_ui_fns = require("@atscript/ui-fns");
4
+ //#region src/components/as-password-rules.vue?vue&type=script&setup=true&lang.ts
5
+ const _hoisted_1 = {
6
+ key: 0,
7
+ class: "as-password-rules-empty"
8
+ };
9
+ const _hoisted_2 = {
10
+ key: 1,
11
+ class: "as-password-rules-list"
12
+ };
13
+ const _hoisted_3 = ["data-passed"];
14
+ const _hoisted_4 = { class: "as-password-rules-text" };
15
+ //#endregion
16
+ //#region src/components/as-password-rules.vue
17
+ var as_password_rules_default = /* @__PURE__ */ (0, vue.defineComponent)({
18
+ __name: "as-password-rules",
19
+ props: {
20
+ onBlur: {
21
+ type: Function,
22
+ required: true
23
+ },
24
+ error: {
25
+ type: String,
26
+ required: false
27
+ },
28
+ model: {
29
+ type: Object,
30
+ required: true
31
+ },
32
+ value: {
33
+ type: null,
34
+ required: false
35
+ },
36
+ label: {
37
+ type: String,
38
+ required: false
39
+ },
40
+ description: {
41
+ type: String,
42
+ required: false
43
+ },
44
+ hint: {
45
+ type: String,
46
+ required: false
47
+ },
48
+ placeholder: {
49
+ type: String,
50
+ required: false
51
+ },
52
+ prefixIcon: {
53
+ type: String,
54
+ required: false
55
+ },
56
+ suffixIcon: {
57
+ type: String,
58
+ required: false
59
+ },
60
+ class: {
61
+ type: [Object, String],
62
+ required: false
63
+ },
64
+ style: {
65
+ type: [Object, String],
66
+ required: false
67
+ },
68
+ optional: {
69
+ type: Boolean,
70
+ required: false,
71
+ skipCheck: true
72
+ },
73
+ onToggleOptional: {
74
+ type: Function,
75
+ required: false
76
+ },
77
+ required: {
78
+ type: Boolean,
79
+ required: false,
80
+ skipCheck: true
81
+ },
82
+ readonly: {
83
+ type: Boolean,
84
+ required: false,
85
+ skipCheck: true
86
+ },
87
+ type: {
88
+ type: String,
89
+ required: true
90
+ },
91
+ formAction: {
92
+ type: Object,
93
+ required: false
94
+ },
95
+ name: {
96
+ type: String,
97
+ required: false
98
+ },
99
+ field: {
100
+ type: Object,
101
+ required: false
102
+ },
103
+ options: {
104
+ type: Array,
105
+ required: false
106
+ },
107
+ maxLength: {
108
+ type: Number,
109
+ required: false
110
+ },
111
+ autocomplete: {
112
+ type: String,
113
+ required: false
114
+ },
115
+ title: {
116
+ type: String,
117
+ required: false
118
+ },
119
+ level: {
120
+ type: Number,
121
+ required: false
122
+ },
123
+ onRemove: {
124
+ type: Function,
125
+ required: false
126
+ },
127
+ canRemove: {
128
+ type: Boolean,
129
+ required: false
130
+ },
131
+ removeLabel: {
132
+ type: String,
133
+ required: false
134
+ },
135
+ arrayIndex: {
136
+ type: Number,
137
+ required: false
138
+ },
139
+ path: {
140
+ type: String,
141
+ required: true
142
+ },
143
+ valueHelp: {
144
+ type: Object,
145
+ required: false
146
+ },
147
+ singularLabel: {
148
+ type: String,
149
+ required: false
150
+ },
151
+ inputId: {
152
+ type: String,
153
+ required: true
154
+ },
155
+ errorId: {
156
+ type: String,
157
+ required: true
158
+ },
159
+ descId: {
160
+ type: String,
161
+ required: true
162
+ },
163
+ ariaDescribedBy: {
164
+ type: String,
165
+ required: false
166
+ },
167
+ currencyCode: {
168
+ type: String,
169
+ required: false
170
+ },
171
+ unitCode: {
172
+ type: String,
173
+ required: false
174
+ },
175
+ precisionScale: {
176
+ type: Number,
177
+ required: false
178
+ },
179
+ prefix: {
180
+ type: String,
181
+ required: false
182
+ },
183
+ suffix: {
184
+ type: String,
185
+ required: false
186
+ },
187
+ scale: {
188
+ type: Number,
189
+ required: false
190
+ },
191
+ hasAdornment: {
192
+ type: Boolean,
193
+ required: false
194
+ },
195
+ disabled: {
196
+ type: Boolean,
197
+ required: false
198
+ },
199
+ hidden: {
200
+ type: Boolean,
201
+ required: false
202
+ },
203
+ policies: {
204
+ type: Array,
205
+ required: false
206
+ },
207
+ password: {
208
+ type: String,
209
+ required: false
210
+ }
211
+ },
212
+ setup(__props) {
213
+ const props = __props;
214
+ const warned = /* @__PURE__ */ new Set();
215
+ function evalRule(rule, password) {
216
+ try {
217
+ return !!(0, _atscript_ui_fns.compileFieldFn)(rule)({
218
+ v: password,
219
+ data: {},
220
+ context: {},
221
+ entry: void 0
222
+ });
223
+ } catch (err) {
224
+ if (!warned.has(rule)) {
225
+ warned.add(rule);
226
+ console.warn("[AsPasswordRules] failed to evaluate rule", {
227
+ rule,
228
+ error: err
229
+ });
230
+ }
231
+ return false;
232
+ }
233
+ }
234
+ const evaluated = (0, vue.computed)(() => {
235
+ const list = props.policies ?? [];
236
+ const password = props.password ?? "";
237
+ const hasPassword = password.length > 0;
238
+ const out = [];
239
+ for (const policy of list) out.push({
240
+ description: policy.description ?? "",
241
+ passed: hasPassword && evalRule(policy.rule, password)
242
+ });
243
+ return out;
244
+ });
245
+ return (_ctx, _cache) => {
246
+ return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_atscript_vue_form.AsFieldShell), (0, vue.mergeProps)(_ctx.$props, {
247
+ chromeless: true,
248
+ "field-class": "as-password-rules"
249
+ }), {
250
+ default: (0, vue.withCtx)(() => [evaluated.value.length === 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1, "No password rules")) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_2, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(evaluated.value, (policy, index) => {
251
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
252
+ key: index,
253
+ class: "as-password-rules-row",
254
+ "data-passed": policy.passed ? "true" : "false"
255
+ }, [_cache[0] || (_cache[0] = (0, vue.createElementVNode)("span", {
256
+ class: "as-password-rules-icon",
257
+ "aria-hidden": "true"
258
+ }, null, -1)), (0, vue.createElementVNode)("span", _hoisted_4, (0, vue.toDisplayString)(policy.description), 1)], 8, _hoisted_3);
259
+ }), 128))]))]),
260
+ _: 1
261
+ }, 16);
262
+ };
263
+ }
264
+ });
265
+ //#endregion
266
+ Object.defineProperty(exports, "as_password_rules_default", {
267
+ enumerable: true,
268
+ get: function() {
269
+ return as_password_rules_default;
270
+ }
271
+ });
@@ -0,0 +1,266 @@
1
+ import { Fragment, computed, createBlock, createElementBlock, createElementVNode, defineComponent, mergeProps, openBlock, renderList, toDisplayString, unref, withCtx } from "vue";
2
+ import { AsFieldShell } from "@atscript/vue-form";
3
+ import { compileFieldFn } from "@atscript/ui-fns";
4
+ //#region src/components/as-password-rules.vue?vue&type=script&setup=true&lang.ts
5
+ const _hoisted_1 = {
6
+ key: 0,
7
+ class: "as-password-rules-empty"
8
+ };
9
+ const _hoisted_2 = {
10
+ key: 1,
11
+ class: "as-password-rules-list"
12
+ };
13
+ const _hoisted_3 = ["data-passed"];
14
+ const _hoisted_4 = { class: "as-password-rules-text" };
15
+ //#endregion
16
+ //#region src/components/as-password-rules.vue
17
+ var as_password_rules_default = /* @__PURE__ */ defineComponent({
18
+ __name: "as-password-rules",
19
+ props: {
20
+ onBlur: {
21
+ type: Function,
22
+ required: true
23
+ },
24
+ error: {
25
+ type: String,
26
+ required: false
27
+ },
28
+ model: {
29
+ type: Object,
30
+ required: true
31
+ },
32
+ value: {
33
+ type: null,
34
+ required: false
35
+ },
36
+ label: {
37
+ type: String,
38
+ required: false
39
+ },
40
+ description: {
41
+ type: String,
42
+ required: false
43
+ },
44
+ hint: {
45
+ type: String,
46
+ required: false
47
+ },
48
+ placeholder: {
49
+ type: String,
50
+ required: false
51
+ },
52
+ prefixIcon: {
53
+ type: String,
54
+ required: false
55
+ },
56
+ suffixIcon: {
57
+ type: String,
58
+ required: false
59
+ },
60
+ class: {
61
+ type: [Object, String],
62
+ required: false
63
+ },
64
+ style: {
65
+ type: [Object, String],
66
+ required: false
67
+ },
68
+ optional: {
69
+ type: Boolean,
70
+ required: false,
71
+ skipCheck: true
72
+ },
73
+ onToggleOptional: {
74
+ type: Function,
75
+ required: false
76
+ },
77
+ required: {
78
+ type: Boolean,
79
+ required: false,
80
+ skipCheck: true
81
+ },
82
+ readonly: {
83
+ type: Boolean,
84
+ required: false,
85
+ skipCheck: true
86
+ },
87
+ type: {
88
+ type: String,
89
+ required: true
90
+ },
91
+ formAction: {
92
+ type: Object,
93
+ required: false
94
+ },
95
+ name: {
96
+ type: String,
97
+ required: false
98
+ },
99
+ field: {
100
+ type: Object,
101
+ required: false
102
+ },
103
+ options: {
104
+ type: Array,
105
+ required: false
106
+ },
107
+ maxLength: {
108
+ type: Number,
109
+ required: false
110
+ },
111
+ autocomplete: {
112
+ type: String,
113
+ required: false
114
+ },
115
+ title: {
116
+ type: String,
117
+ required: false
118
+ },
119
+ level: {
120
+ type: Number,
121
+ required: false
122
+ },
123
+ onRemove: {
124
+ type: Function,
125
+ required: false
126
+ },
127
+ canRemove: {
128
+ type: Boolean,
129
+ required: false
130
+ },
131
+ removeLabel: {
132
+ type: String,
133
+ required: false
134
+ },
135
+ arrayIndex: {
136
+ type: Number,
137
+ required: false
138
+ },
139
+ path: {
140
+ type: String,
141
+ required: true
142
+ },
143
+ valueHelp: {
144
+ type: Object,
145
+ required: false
146
+ },
147
+ singularLabel: {
148
+ type: String,
149
+ required: false
150
+ },
151
+ inputId: {
152
+ type: String,
153
+ required: true
154
+ },
155
+ errorId: {
156
+ type: String,
157
+ required: true
158
+ },
159
+ descId: {
160
+ type: String,
161
+ required: true
162
+ },
163
+ ariaDescribedBy: {
164
+ type: String,
165
+ required: false
166
+ },
167
+ currencyCode: {
168
+ type: String,
169
+ required: false
170
+ },
171
+ unitCode: {
172
+ type: String,
173
+ required: false
174
+ },
175
+ precisionScale: {
176
+ type: Number,
177
+ required: false
178
+ },
179
+ prefix: {
180
+ type: String,
181
+ required: false
182
+ },
183
+ suffix: {
184
+ type: String,
185
+ required: false
186
+ },
187
+ scale: {
188
+ type: Number,
189
+ required: false
190
+ },
191
+ hasAdornment: {
192
+ type: Boolean,
193
+ required: false
194
+ },
195
+ disabled: {
196
+ type: Boolean,
197
+ required: false
198
+ },
199
+ hidden: {
200
+ type: Boolean,
201
+ required: false
202
+ },
203
+ policies: {
204
+ type: Array,
205
+ required: false
206
+ },
207
+ password: {
208
+ type: String,
209
+ required: false
210
+ }
211
+ },
212
+ setup(__props) {
213
+ const props = __props;
214
+ const warned = /* @__PURE__ */ new Set();
215
+ function evalRule(rule, password) {
216
+ try {
217
+ return !!compileFieldFn(rule)({
218
+ v: password,
219
+ data: {},
220
+ context: {},
221
+ entry: void 0
222
+ });
223
+ } catch (err) {
224
+ if (!warned.has(rule)) {
225
+ warned.add(rule);
226
+ console.warn("[AsPasswordRules] failed to evaluate rule", {
227
+ rule,
228
+ error: err
229
+ });
230
+ }
231
+ return false;
232
+ }
233
+ }
234
+ const evaluated = computed(() => {
235
+ const list = props.policies ?? [];
236
+ const password = props.password ?? "";
237
+ const hasPassword = password.length > 0;
238
+ const out = [];
239
+ for (const policy of list) out.push({
240
+ description: policy.description ?? "",
241
+ passed: hasPassword && evalRule(policy.rule, password)
242
+ });
243
+ return out;
244
+ });
245
+ return (_ctx, _cache) => {
246
+ return openBlock(), createBlock(unref(AsFieldShell), mergeProps(_ctx.$props, {
247
+ chromeless: true,
248
+ "field-class": "as-password-rules"
249
+ }), {
250
+ default: withCtx(() => [evaluated.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_1, "No password rules")) : (openBlock(), createElementBlock("div", _hoisted_2, [(openBlock(true), createElementBlock(Fragment, null, renderList(evaluated.value, (policy, index) => {
251
+ return openBlock(), createElementBlock("div", {
252
+ key: index,
253
+ class: "as-password-rules-row",
254
+ "data-passed": policy.passed ? "true" : "false"
255
+ }, [_cache[0] || (_cache[0] = createElementVNode("span", {
256
+ class: "as-password-rules-icon",
257
+ "aria-hidden": "true"
258
+ }, null, -1)), createElementVNode("span", _hoisted_4, toDisplayString(policy.description), 1)], 8, _hoisted_3);
259
+ }), 128))]))]),
260
+ _: 1
261
+ }, 16);
262
+ };
263
+ }
264
+ });
265
+ //#endregion
266
+ export { as_password_rules_default as t };
@@ -0,0 +1,2 @@
1
+ const require_as_password_rules = require("./as-password-rules-DkFih-lL.cjs");
2
+ module.exports = require_as_password_rules.as_password_rules_default;
@@ -0,0 +1,27 @@
1
+ import * as vue from "vue";
2
+ import { TAsComponentProps } from "@atscript/vue-form";
3
+
4
+ //#region src/components/as-password-rules.vue.d.ts
5
+ /**
6
+ * One password-policy descriptor as sent by the aooth backend.
7
+ *
8
+ * - `rule` — serialized function literal (e.g. `"(p) => p.length >= 8"`).
9
+ * Compiled + cached via `compileFieldFn` from `@atscript/ui-fns`, which
10
+ * shares the same FNPool already used for `@ui.form.fn.*` annotations.
11
+ * - `description` — plain label shown to the user.
12
+ * - `errorMessage` — backend-supplied wording reserved for future
13
+ * "show on submit failure" surfacing; not rendered today.
14
+ */
15
+ interface AsPasswordRulesPolicy {
16
+ rule: string;
17
+ description?: string;
18
+ errorMessage?: string;
19
+ }
20
+ type __VLS_Props = TAsComponentProps & {
21
+ policies?: AsPasswordRulesPolicy[];
22
+ password?: string;
23
+ };
24
+ declare const __VLS_export: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
25
+ declare const _default: typeof __VLS_export;
26
+ //#endregion
27
+ export { AsPasswordRulesPolicy, _default as default };
@@ -0,0 +1,27 @@
1
+ import * as vue from "vue";
2
+ import { TAsComponentProps } from "@atscript/vue-form";
3
+
4
+ //#region src/components/as-password-rules.vue.d.ts
5
+ /**
6
+ * One password-policy descriptor as sent by the aooth backend.
7
+ *
8
+ * - `rule` — serialized function literal (e.g. `"(p) => p.length >= 8"`).
9
+ * Compiled + cached via `compileFieldFn` from `@atscript/ui-fns`, which
10
+ * shares the same FNPool already used for `@ui.form.fn.*` annotations.
11
+ * - `description` — plain label shown to the user.
12
+ * - `errorMessage` — backend-supplied wording reserved for future
13
+ * "show on submit failure" surfacing; not rendered today.
14
+ */
15
+ interface AsPasswordRulesPolicy {
16
+ rule: string;
17
+ description?: string;
18
+ errorMessage?: string;
19
+ }
20
+ type __VLS_Props = TAsComponentProps & {
21
+ policies?: AsPasswordRulesPolicy[];
22
+ password?: string;
23
+ };
24
+ declare const __VLS_export: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
25
+ declare const _default: typeof __VLS_export;
26
+ //#endregion
27
+ export { AsPasswordRulesPolicy, _default as default };
@@ -0,0 +1,2 @@
1
+ import { t as as_password_rules_default } from "./as-password-rules-f9ouYgev.mjs";
2
+ export { as_password_rules_default as default };
package/dist/index.cjs ADDED
@@ -0,0 +1,5 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_as_consent_array = require("./as-consent-array-B8gtVvew.cjs");
3
+ const require_as_password_rules = require("./as-password-rules-DkFih-lL.cjs");
4
+ exports.AsConsentArray = require_as_consent_array.as_consent_array_default;
5
+ exports.AsPasswordRules = require_as_password_rules.as_password_rules_default;
@@ -0,0 +1,3 @@
1
+ import _default from "./as-consent-array.cjs";
2
+ import _default$1 from "./as-password-rules.cjs";
3
+ export { _default as AsConsentArray, _default$1 as AsPasswordRules };
@@ -0,0 +1,3 @@
1
+ import _default from "./as-consent-array.mjs";
2
+ import _default$1 from "./as-password-rules.mjs";
3
+ export { _default as AsConsentArray, _default$1 as AsPasswordRules };
package/dist/index.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import { t as as_consent_array_default } from "./as-consent-array-C1GpSvgX.mjs";
2
+ import { t as as_password_rules_default } from "./as-password-rules-f9ouYgev.mjs";
3
+ export { as_consent_array_default as AsConsentArray, as_password_rules_default as AsPasswordRules };