native-document 1.0.179 → 1.0.181
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "native-document",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.181",
|
|
4
4
|
"description": "A reactive JavaScript framework that preserves native DOM simplicity without sacrificing modern features",
|
|
5
5
|
"author": "AfroCodeur <https://github.com/afrocodeur>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -56,7 +56,7 @@ export interface FormControlInterface extends BaseComponent {
|
|
|
56
56
|
export declare function FormControl(props?: Record<string, unknown>): FormControlInterface;
|
|
57
57
|
export declare namespace FormControl {
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
function setDefaultErrorsMapper(mapper: (error: Error) => Record<string, string|[]>): void;
|
|
60
60
|
function use(template: (description: FormControlDescription, instance: FormControlInterface) => ValidChild): void;
|
|
61
61
|
function create(props?: Record<string, unknown>): FormControlInterface;
|
|
62
62
|
|
package/src/router/Router.js
CHANGED
|
@@ -71,6 +71,15 @@ export default function Router($options = {}) {
|
|
|
71
71
|
return this;
|
|
72
72
|
};
|
|
73
73
|
|
|
74
|
+
/**
|
|
75
|
+
* @param {Function} page
|
|
76
|
+
*/
|
|
77
|
+
this.notFound = function(page) {
|
|
78
|
+
this.add('{path}', page, {
|
|
79
|
+
with: { path: '(.*)' },
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
|
|
74
83
|
/**
|
|
75
84
|
* Groups routes under a common path prefix with shared options.
|
|
76
85
|
*
|
|
@@ -4,6 +4,8 @@ import {Dropdown} from '../../../../components/dropdown';
|
|
|
4
4
|
import {buildErrors} from '../helpers';
|
|
5
5
|
import DebugManager from '../../../../core/utils/debug-manager';
|
|
6
6
|
|
|
7
|
+
import './select-field.css';
|
|
8
|
+
|
|
7
9
|
export default function SelectFieldRender($desc, instance) {
|
|
8
10
|
const props = instance.getEditableProps();
|
|
9
11
|
|
|
@@ -123,10 +125,10 @@ const buildSelectedLabel = ($desc) => {
|
|
|
123
125
|
return $desc.placeholder || 'Select...';
|
|
124
126
|
}
|
|
125
127
|
|
|
126
|
-
const options =
|
|
128
|
+
const options = $desc.options;
|
|
127
129
|
|
|
128
130
|
if(!$desc.multiple || !Array.isArray(val)) {
|
|
129
|
-
const opt = options.find(o => (o.value ?? o)
|
|
131
|
+
const opt = options.find(o => (o.value ?? o) == val);
|
|
130
132
|
return opt?.label ?? opt ?? val;
|
|
131
133
|
}
|
|
132
134
|
|
package/types/router.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ export interface Router {
|
|
|
46
46
|
with?: Record<string, string>;
|
|
47
47
|
layout?: (children: ValidChild) => ValidChild ;
|
|
48
48
|
}): this;
|
|
49
|
+
notFound(page: (context: RouteContext) => HTMLElement | DocumentFragment): void;
|
|
49
50
|
|
|
50
51
|
group(suffix: string, options: { middlewares?: Function[]; name?: string; layout?: Function }, callback: () => void): this;
|
|
51
52
|
|