y-design-ssr 0.0.20 → 0.0.21

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/libs/checkbox.js CHANGED
@@ -142,16 +142,79 @@ function _unsupportedIterableToArray(o, minLen) {
142
142
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
143
143
  /* harmony export */ "a": function() { return /* binding */ CHECKBOX_KEY; }
144
144
  /* harmony export */ });
145
+ /* unused harmony export checkboxGroupProps */
145
146
  /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2526);
146
147
  /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_0__);
147
148
  /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1817);
148
149
  /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1__);
149
150
  /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1539);
150
151
  /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__);
152
+ /* harmony import */ var core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9653);
153
+ /* harmony import */ var core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_3__);
154
+
151
155
 
152
156
 
153
157
 
154
158
  var CHECKBOX_KEY = Symbol('checkbox');
159
+ var checkboxGroupProps = {
160
+ /**
161
+ * @ignore
162
+ */
163
+ modelValue: {
164
+ type: Array,
165
+ default: function _default() {
166
+ return [];
167
+ }
168
+ },
169
+
170
+ /**
171
+ * 最多选中数目
172
+ */
173
+ max: {
174
+ type: Number,
175
+ default: null
176
+ },
177
+
178
+ /**
179
+ * 最少选中数目
180
+ */
181
+ min: {
182
+ type: Number,
183
+ default: null
184
+ },
185
+
186
+ /**
187
+ * 禁用
188
+ */
189
+ disabled: {
190
+ type: Boolean,
191
+ default: null
192
+ },
193
+
194
+ /**
195
+ * 是否为方形
196
+ */
197
+ square: {
198
+ type: Boolean,
199
+ default: null
200
+ },
201
+
202
+ /**
203
+ * 选中颜色
204
+ */
205
+ checkedColor: {
206
+ type: String,
207
+ default: null
208
+ },
209
+
210
+ /**
211
+ * 水平排列
212
+ */
213
+ horizontal: {
214
+ type: Boolean,
215
+ default: false
216
+ }
217
+ };
155
218
 
156
219
  /***/ }),
157
220
 
@@ -299,6 +362,178 @@ var useFormItem = function useFormItem() {
299
362
 
300
363
 
301
364
 
365
+ /***/ }),
366
+
367
+ /***/ 874:
368
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
369
+
370
+ "use strict";
371
+
372
+ // EXPORTS
373
+ __webpack_require__.d(__webpack_exports__, {
374
+ "jQ": function() { return /* reexport */ useRelation; }
375
+ });
376
+
377
+ // UNUSED EXPORTS: filterChildren, setRelation, sortChildren
378
+
379
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.for-each.js
380
+ var web_dom_collections_for_each = __webpack_require__(4747);
381
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.sort.js
382
+ var es_array_sort = __webpack_require__(2707);
383
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.index-of.js
384
+ var es_array_index_of = __webpack_require__(2772);
385
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.splice.js
386
+ var es_array_splice = __webpack_require__(561);
387
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.keys.js
388
+ var es_object_keys = __webpack_require__(7941);
389
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.js
390
+ var es_symbol = __webpack_require__(2526);
391
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.filter.js
392
+ var es_array_filter = __webpack_require__(7327);
393
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.get-own-property-descriptor.js
394
+ var es_object_get_own_property_descriptor = __webpack_require__(5003);
395
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.get-own-property-descriptors.js
396
+ var es_object_get_own_property_descriptors = __webpack_require__(9337);
397
+ // EXTERNAL MODULE: external "vue"
398
+ var external_vue_ = __webpack_require__(4103);
399
+ ;// CONCATENATED MODULE: ./packages/context/relation/provide.ts
400
+
401
+
402
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
403
+
404
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
405
+
406
+
407
+
408
+
409
+
410
+
411
+
412
+
413
+
414
+
415
+
416
+ /*
417
+ * @Author: liuwentao
418
+ * @Date: 2021-05-12 16:55:52
419
+ * @LastEditors: ruan fei
420
+ * @LastEditTime: 2022-08-10 17:22:02
421
+ * @Description: provide
422
+ * @FilePath: /yui-vue/packages/context/relation/provide.ts
423
+ */
424
+
425
+ var filterChildren = function filterChildren(children) {
426
+ var vnodes = [];
427
+
428
+ var _filterChildren = function _filterChildren(childrens) {
429
+ if (Array.isArray(childrens)) {
430
+ childrens.forEach(function (child) {
431
+ if (isVNode(child)) {
432
+ var _child$component;
433
+
434
+ vnodes.push(child);
435
+
436
+ if ((_child$component = child.component) !== null && _child$component !== void 0 && _child$component.subTree) {
437
+ _filterChildren(child.component.subTree.children);
438
+ }
439
+
440
+ if (child.children) {
441
+ _filterChildren(child.children);
442
+ }
443
+ }
444
+ });
445
+ }
446
+ };
447
+
448
+ _filterChildren(children);
449
+
450
+ return vnodes;
451
+ };
452
+ var sortChildren = function sortChildren(childrens, instance) {
453
+ var vnodes = filterChildren(instance.subTree.children);
454
+ childrens.sort(function (a, b) {
455
+ return vnodes.indexOf(a.vnode) - vnodes.indexOf(b.vnode);
456
+ });
457
+ };
458
+ var setRelation = function setRelation(key) {
459
+ var instance = getCurrentInstance();
460
+ var childrens = reactive([]);
461
+
462
+ var initProvide = function initProvide(value) {
463
+ var addChild = function addChild(child) {
464
+ if (child.proxy) {
465
+ childrens.push(child);
466
+ instance && sortChildren(childrens, instance);
467
+ }
468
+ };
469
+
470
+ var removeChild = function removeChild(child) {
471
+ var index = childrens.indexOf(child);
472
+ childrens.splice(index, 1);
473
+ };
474
+
475
+ provide(key, _objectSpread({
476
+ addChild: addChild,
477
+ removeChild: removeChild,
478
+ childrens: childrens
479
+ }, value));
480
+ };
481
+
482
+ return {
483
+ childrens: childrens,
484
+ initProvide: initProvide
485
+ };
486
+ };
487
+ ;// CONCATENATED MODULE: ./packages/context/relation/inject.ts
488
+
489
+
490
+ /*
491
+ * @Author: liuwentao
492
+ * @Date: 2021-05-12 16:55:52
493
+ * @LastEditors: ruan fei
494
+ * @LastEditTime: 2022-08-10 17:05:05
495
+ * @Description: inject
496
+ * @FilePath: /yui-vue/packages/context/relation/inject.ts
497
+ */
498
+
499
+ var useRelation = function useRelation(key) {
500
+ var parent = (0,external_vue_.inject)(key, null);
501
+ var currentInstance = (0,external_vue_.getCurrentInstance)();
502
+
503
+ if (parent && currentInstance) {
504
+ var childrens = parent.childrens,
505
+ addChild = parent.addChild,
506
+ removeChild = parent.removeChild;
507
+ addChild(currentInstance);
508
+ (0,external_vue_.onUnmounted)(function () {
509
+ return removeChild(currentInstance);
510
+ });
511
+ var index = (0,external_vue_.computed)(function () {
512
+ return childrens.indexOf(currentInstance);
513
+ });
514
+ return {
515
+ index: index,
516
+ parent: parent
517
+ };
518
+ }
519
+
520
+ return {
521
+ parent: null,
522
+ index: (0,external_vue_.ref)(-1)
523
+ };
524
+ };
525
+ ;// CONCATENATED MODULE: ./packages/context/relation/index.ts
526
+ /*
527
+ * @Author: liuwentao
528
+ * @Date: 2021-05-12 17:07:50
529
+ * @LastEditors: liuwentao
530
+ * @LastEditTime: 2021-05-12 17:12:26
531
+ * @Description: relation enter
532
+ * @FilePath: /yui-vue/packages/hook/relation/index.ts
533
+ */
534
+
535
+
536
+
302
537
  /***/ }),
303
538
 
304
539
  /***/ 2519:
@@ -3267,6 +3502,46 @@ $({ target: 'Array', proto: true, forced: !STRICT_METHOD || CHROME_BUG }, {
3267
3502
  });
3268
3503
 
3269
3504
 
3505
+ /***/ }),
3506
+
3507
+ /***/ 2707:
3508
+ /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
3509
+
3510
+ "use strict";
3511
+
3512
+ var $ = __webpack_require__(2109);
3513
+ var aFunction = __webpack_require__(3099);
3514
+ var toObject = __webpack_require__(7908);
3515
+ var fails = __webpack_require__(7293);
3516
+ var arrayMethodIsStrict = __webpack_require__(9341);
3517
+
3518
+ var test = [];
3519
+ var nativeSort = test.sort;
3520
+
3521
+ // IE8-
3522
+ var FAILS_ON_UNDEFINED = fails(function () {
3523
+ test.sort(undefined);
3524
+ });
3525
+ // V8 bug
3526
+ var FAILS_ON_NULL = fails(function () {
3527
+ test.sort(null);
3528
+ });
3529
+ // Old WebKit
3530
+ var STRICT_METHOD = arrayMethodIsStrict('sort');
3531
+
3532
+ var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD;
3533
+
3534
+ // `Array.prototype.sort` method
3535
+ // https://tc39.es/ecma262/#sec-array.prototype.sort
3536
+ $({ target: 'Array', proto: true, forced: FORCED }, {
3537
+ sort: function sort(comparefn) {
3538
+ return comparefn === undefined
3539
+ ? nativeSort.call(toObject(this))
3540
+ : nativeSort.call(toObject(this), aFunction(comparefn));
3541
+ }
3542
+ });
3543
+
3544
+
3270
3545
  /***/ }),
3271
3546
 
3272
3547
  /***/ 561:
@@ -4372,6 +4647,8 @@ var filed = __webpack_require__(1225);
4372
4647
  var icon = __webpack_require__(2519);
4373
4648
  // EXTERNAL MODULE: ./packages/checkboxGroup/src/constants.ts
4374
4649
  var constants = __webpack_require__(9085);
4650
+ // EXTERNAL MODULE: ./packages/context/relation/index.ts + 2 modules
4651
+ var relation = __webpack_require__(874);
4375
4652
  ;// CONCATENATED MODULE: ./packages/checkbox/src/checkbox.tsx
4376
4653
 
4377
4654
 
@@ -4391,6 +4668,7 @@ var constants = __webpack_require__(9085);
4391
4668
 
4392
4669
 
4393
4670
 
4671
+
4394
4672
  var _createNamespace = (0,utils/* createNamespace */.do)('checkbox'),
4395
4673
  _createNamespace2 = (0,slicedToArray/* default */.Z)(_createNamespace, 2),
4396
4674
  checkbox_name = _createNamespace2[0],
@@ -4428,7 +4706,11 @@ var _createNamespace = (0,utils/* createNamespace */.do)('checkbox'),
4428
4706
  var slots = _ref.slots,
4429
4707
  emit = _ref.emit,
4430
4708
  expose = _ref.expose;
4431
- var parent = (0,external_vue_.inject)(constants/* CHECKBOX_KEY */.a, null);
4709
+
4710
+ var _useRelation = (0,relation/* useRelation */.jQ)(constants/* CHECKBOX_KEY */.a),
4711
+ parent = _useRelation.parent; // const parent = inject<CheckboxGroupProvide | null>(CHECKBOX_KEY, null)
4712
+
4713
+
4432
4714
  var formParent = parent === null ? (0,filed/* useFormItem */.A9)().parent : null;
4433
4715
 
4434
4716
  if (parent) {