diff --git a/panel/src/components/Forms/Input/RangeInput.vue b/panel/src/components/Forms/Input/RangeInput.vue index 9b475def45..17c12a1510 100644 --- a/panel/src/components/Forms/Input/RangeInput.vue +++ b/panel/src/components/Forms/Input/RangeInput.vue @@ -103,7 +103,10 @@ export default { : "–"; }, maxLength() { - return Math.floor(Math.abs(this.max)).toString().length; + return Math.max( + this.format(this.min).length, + this.format(this.max).length + ); }, position() { return this.value || this.value === 0 @@ -204,7 +207,7 @@ export default { .k-range-input-tooltip-text { font-family: var(--font-mono); width: calc(var(--digits) + var(--spacing-1) * 2); - text-align: center; + text-align: right; } .k-range-input[data-disabled="true"] { diff --git a/src/Cms/BlockConverter.php b/src/Cms/BlockConverter.php index ced1b0fae0..f8569b9983 100644 --- a/src/Cms/BlockConverter.php +++ b/src/Cms/BlockConverter.php @@ -25,8 +25,10 @@ public static function builderBlock(array $params): array return $params; } + $ignore = array_flip(['field', 'options', 'parent', 'siblings', 'params', '_key', '_uid']); + $params['content'] = array_diff_key($params, $ignore); $params['type'] = $params['_key']; - $params['content'] = $params; + unset($params['_uid']); return $params; diff --git a/src/Cms/Collection.php b/src/Cms/Collection.php index 71d653ec21..b7284a1bbb 100644 --- a/src/Cms/Collection.php +++ b/src/Cms/Collection.php @@ -38,6 +38,7 @@ class Collection extends BaseCollection /** * Creates a new Collection with the given objects * + * @param iterable $objects * @param object|null $parent Stores the parent object, * which is needed in some collections * to get the finder methods right @@ -88,7 +89,7 @@ public function __unset(string $id) * an entire second collection to the * current collection * - * @param static|TValue|array $object + * @param \Kirby\Cms\Collection|array|TValue $object * @return $this */ public function add($object): static diff --git a/src/Cms/Files.php b/src/Cms/Files.php index a0abf4c45f..2561dd325e 100644 --- a/src/Cms/Files.php +++ b/src/Cms/Files.php @@ -23,7 +23,8 @@ * @copyright Bastian Allgeier * @license https://getkirby.com/license * - * @extends \Kirby\Cms\Collection<\Kirby\Cms\File> + * @template TFile of \Kirby\Cms\File + * @extends \Kirby\Cms\Collection */ class Files extends Collection { @@ -44,7 +45,7 @@ class Files extends Collection * an entire second collection to the * current collection * - * @param static|\Kirby\Cms\File|string $object + * @param \Kirby\Cms\Files|TFile|string $object * @return $this * @throws \Kirby\Exception\InvalidArgumentException When no `File` or `Files` object or an ID of an existing file is passed */ @@ -155,6 +156,7 @@ public static function factory( /** * Finds a file by its filename * @internal Use `$files->find()` instead + * @return TFile|null */ public function findByKey(string $key): File|null { @@ -193,6 +195,7 @@ public function size(): int /** * Returns the collection sorted by * the sort number and the filename + * @return \Kirby\Cms\Files */ public function sorted(): static { diff --git a/src/Cms/Pages.php b/src/Cms/Pages.php index bbb1bbc70d..e69ac39f3b 100644 --- a/src/Cms/Pages.php +++ b/src/Cms/Pages.php @@ -24,7 +24,8 @@ * @copyright Bastian Allgeier * @license https://getkirby.com/license * - * @extends \Kirby\Cms\Collection<\Kirby\Cms\Page> + * @template TPage of \Kirby\Cms\Page + * @extends \Kirby\Cms\Collection */ class Pages extends Collection { @@ -55,7 +56,7 @@ class Pages extends Collection * an entire second collection to the * current collection * - * @param \Kirby\Cms\Pages|\Kirby\Cms\Page|string $object + * @param \Kirby\Cms\Pages|TPage|string $object * @return $this * @throws \Kirby\Exception\InvalidArgumentException When no `Page` or `Pages` object or an ID of an existing page is passed */ @@ -99,6 +100,7 @@ public function audio(): Files /** * Returns all children for each page in the array + * @return \Kirby\Cms\Pages */ public function children(): static { @@ -166,6 +168,7 @@ public function documents(): Files /** * Fetch all drafts for all pages in the collection + * @return \Kirby\Cms\Pages */ public function drafts(): static { @@ -231,6 +234,7 @@ public function files(): Files /** * Finds a page by its ID or URI * @internal Use `$pages->find()` instead + * @return TPage|null */ public function findByKey(string|null $key = null): Page|null { @@ -286,6 +290,7 @@ public function findByKey(string|null $key = null): Page|null /** * Finds a child or child of a child recursively + * @return TPage|null */ protected function findByKeyRecursive( string $id, @@ -326,6 +331,7 @@ protected function findByKeyRecursive( /** * Finds the currently open page + * @return TPage|null */ public function findOpen(): Page|null { @@ -335,6 +341,7 @@ public function findOpen(): Page|null /** * Custom getter that is able to find * extension pages + * @return TPage|null */ public function get(string $key, mixed $default = null): Page|null { @@ -392,6 +399,7 @@ public function index(bool $drafts = false): static /** * Returns all listed pages in the collection + * @return \Kirby\Cms\Pages */ public function listed(): static { @@ -400,6 +408,7 @@ public function listed(): static /** * Returns all unlisted pages in the collection + * @return \Kirby\Cms\Pages */ public function unlisted(): static { @@ -489,7 +498,10 @@ public function nums(): array return $this->pluck('num'); } - // Returns all listed and unlisted pages in the collection + /** + * Returns all listed and unlisted pages in the collection + * @return \Kirby\Cms\Pages + */ public function published(): static { return $this->filter('isDraft', '==', false); diff --git a/src/Cms/Users.php b/src/Cms/Users.php index c67d1fe11f..2f65192193 100644 --- a/src/Cms/Users.php +++ b/src/Cms/Users.php @@ -20,7 +20,8 @@ * @copyright Bastian Allgeier * @license https://getkirby.com/license * - * @extends \Kirby\Cms\Collection<\Kirby\Cms\User> + * @template TUser of \Kirby\Cms\User + * @extends \Kirby\Cms\Collection */ class Users extends Collection { @@ -41,7 +42,7 @@ public function create(array $data): User * an entire second collection to the * current collection * - * @param \Kirby\Cms\Users|\Kirby\Cms\User|string $object + * @param \Kirby\Cms\Users|TUser|string $object * @return $this * @throws \Kirby\Exception\InvalidArgumentException When no `User` or `Users` object or an ID of an existing user is passed */ @@ -109,6 +110,7 @@ public function files(): Files /** * Finds a user in the collection by ID or email address * @internal Use `$users->find()` instead + * @return TUser|null */ public function findByKey(string $key): User|null {