pseudo-dom 0.14.0 → 0.15.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.
package/README.md CHANGED
@@ -54,7 +54,10 @@ else, document fragments insert their children instead of themselves, and a node
54
54
 
55
55
  **Attribute helpers** work like the DOM's: `getAttributeNames`, `hasAttributes`, `toggleAttribute(name, [force])`.
56
56
  `localName` matches `tagName` and `prefix` is always `null` (there's no real namespace parsing);
57
- `getElementsByTagNameNS` behaves exactly like `getElementsByTagName`, ignoring the namespace.
57
+ `getElementsByTagNameNS` behaves exactly like `getElementsByTagName`, ignoring the namespace. All 37 `aria*`
58
+ reflected properties (`ariaLabel`, `ariaExpanded`, `ariaValueNow`, ...) are real too - each just reads/writes its
59
+ matching `aria-*` attribute (`ariaLabel` <-> `aria-label`; the mapping isn't camelCase-to-kebab-case, so
60
+ `ariaColCount` <-> `aria-colcount`, not `aria-col-count`).
58
61
 
59
62
  **`style`** is a real, live `CSSStyleDeclaration`:
60
63
 
@@ -168,7 +171,6 @@ it) - useful for watching pseudo-dom-driven code run, or checking a final result
168
171
 
169
172
  ## Not implemented yet
170
173
 
171
- - The `aria*` reflected properties
172
174
  - The `Attr`-node / namespaced attribute methods (`getAttributeNode`, `getAttributeNS`, ...)
173
175
  ## Modules
174
176
 
@@ -2975,6 +2977,8 @@ Simulate the behaviour of the Element Class when there is no DOM available.
2975
2977
  * [.requestFullscreen()](#ElementService+requestFullscreen) ⇒ <code>Promise.&lt;void&gt;</code>
2976
2978
  * [.requestPointerLock()](#ElementService+requestPointerLock) ⇒ <code>Promise.&lt;void&gt;</code>
2977
2979
  * [.attachShadow(options)](#ElementService+attachShadow) ⇒ <code>PseudoShadowRoot</code>
2980
+ * [.getAriaAttribute(attributeName)](#ElementService+getAriaAttribute) ⇒ <code>string</code>
2981
+ * [.setAriaAttribute(attributeName, value)](#ElementService+setAriaAttribute) ⇒ <code>undefined</code>
2978
2982
 
2979
2983
  <a name="new_ElementService_new"></a>
2980
2984
 
@@ -3419,6 +3423,29 @@ Attach a shadow tree to this element and return its ShadowRoot. Throws when it a
3419
3423
  | --- | --- |
3420
3424
  | options | <code>Object</code> |
3421
3425
 
3426
+ <a name="ElementService+getAriaAttribute"></a>
3427
+
3428
+ ### elementService.getAriaAttribute(attributeName) ⇒ <code>string</code>
3429
+ Read one of the aria-* reflected properties (see the individual aria* getters/setters below).
3430
+
3431
+ **Kind**: instance method of [<code>ElementService</code>](#ElementService)
3432
+
3433
+ | Param | Type | Description |
3434
+ | --- | --- | --- |
3435
+ | attributeName | <code>string</code> | A real aria-* attribute name (aria-label, ...) |
3436
+
3437
+ <a name="ElementService+setAriaAttribute"></a>
3438
+
3439
+ ### elementService.setAriaAttribute(attributeName, value) ⇒ <code>undefined</code>
3440
+ Write one of the aria-* reflected properties.
3441
+
3442
+ **Kind**: instance method of [<code>ElementService</code>](#ElementService)
3443
+
3444
+ | Param | Type | Description |
3445
+ | --- | --- | --- |
3446
+ | attributeName | <code>string</code> | A real aria-* attribute name (aria-label, ...) |
3447
+ | value | <code>string</code> | |
3448
+
3422
3449
  <a name="DocumentService"></a>
3423
3450
 
3424
3451
  ## DocumentService ⇐ [<code>NodeService</code>](#NodeService)
@@ -2795,6 +2795,321 @@
2795
2795
  get shadowRoot () {
2796
2796
  return this.shadowRootInstance && this.shadowRootInstance.mode === 'open' ? this.shadowRootInstance : null
2797
2797
  }
2798
+
2799
+ /**
2800
+ * Read one of the aria-* reflected properties (see the individual aria* getters/setters below).
2801
+ * @param {string} attributeName A real aria-* attribute name (aria-label, ...)
2802
+ * @returns {string}
2803
+ */
2804
+ getAriaAttribute (attributeName) {
2805
+ return this.getAttribute(attributeName) || ''
2806
+ }
2807
+
2808
+ /**
2809
+ * Write one of the aria-* reflected properties.
2810
+ * @param {string} attributeName A real aria-* attribute name (aria-label, ...)
2811
+ * @param {string} value
2812
+ * @returns {undefined}
2813
+ */
2814
+ setAriaAttribute (attributeName, value) {
2815
+ this.setAttribute(attributeName, value)
2816
+ }
2817
+
2818
+ get ariaAtomic () {
2819
+ return this.getAriaAttribute('aria-atomic')
2820
+ }
2821
+
2822
+ set ariaAtomic (value) {
2823
+ this.setAriaAttribute('aria-atomic', value)
2824
+ }
2825
+
2826
+ get ariaAutoComplete () {
2827
+ return this.getAriaAttribute('aria-autocomplete')
2828
+ }
2829
+
2830
+ set ariaAutoComplete (value) {
2831
+ this.setAriaAttribute('aria-autocomplete', value)
2832
+ }
2833
+
2834
+ get ariaBusy () {
2835
+ return this.getAriaAttribute('aria-busy')
2836
+ }
2837
+
2838
+ set ariaBusy (value) {
2839
+ this.setAriaAttribute('aria-busy', value)
2840
+ }
2841
+
2842
+ get ariaChecked () {
2843
+ return this.getAriaAttribute('aria-checked')
2844
+ }
2845
+
2846
+ set ariaChecked (value) {
2847
+ this.setAriaAttribute('aria-checked', value)
2848
+ }
2849
+
2850
+ get ariaColCount () {
2851
+ return this.getAriaAttribute('aria-colcount')
2852
+ }
2853
+
2854
+ set ariaColCount (value) {
2855
+ this.setAriaAttribute('aria-colcount', value)
2856
+ }
2857
+
2858
+ get ariaColIndex () {
2859
+ return this.getAriaAttribute('aria-colindex')
2860
+ }
2861
+
2862
+ set ariaColIndex (value) {
2863
+ this.setAriaAttribute('aria-colindex', value)
2864
+ }
2865
+
2866
+ get ariaColSpan () {
2867
+ return this.getAriaAttribute('aria-colspan')
2868
+ }
2869
+
2870
+ set ariaColSpan (value) {
2871
+ this.setAriaAttribute('aria-colspan', value)
2872
+ }
2873
+
2874
+ get ariaCurrent () {
2875
+ return this.getAriaAttribute('aria-current')
2876
+ }
2877
+
2878
+ set ariaCurrent (value) {
2879
+ this.setAriaAttribute('aria-current', value)
2880
+ }
2881
+
2882
+ get ariaDescription () {
2883
+ return this.getAriaAttribute('aria-description')
2884
+ }
2885
+
2886
+ set ariaDescription (value) {
2887
+ this.setAriaAttribute('aria-description', value)
2888
+ }
2889
+
2890
+ get ariaDisabled () {
2891
+ return this.getAriaAttribute('aria-disabled')
2892
+ }
2893
+
2894
+ set ariaDisabled (value) {
2895
+ this.setAriaAttribute('aria-disabled', value)
2896
+ }
2897
+
2898
+ get ariaExpanded () {
2899
+ return this.getAriaAttribute('aria-expanded')
2900
+ }
2901
+
2902
+ set ariaExpanded (value) {
2903
+ this.setAriaAttribute('aria-expanded', value)
2904
+ }
2905
+
2906
+ get ariaHasPopup () {
2907
+ return this.getAriaAttribute('aria-haspopup')
2908
+ }
2909
+
2910
+ set ariaHasPopup (value) {
2911
+ this.setAriaAttribute('aria-haspopup', value)
2912
+ }
2913
+
2914
+ get ariaHidden () {
2915
+ return this.getAriaAttribute('aria-hidden')
2916
+ }
2917
+
2918
+ set ariaHidden (value) {
2919
+ this.setAriaAttribute('aria-hidden', value)
2920
+ }
2921
+
2922
+ get ariaKeyShortcuts () {
2923
+ return this.getAriaAttribute('aria-keyshortcuts')
2924
+ }
2925
+
2926
+ set ariaKeyShortcuts (value) {
2927
+ this.setAriaAttribute('aria-keyshortcuts', value)
2928
+ }
2929
+
2930
+ get ariaLabel () {
2931
+ return this.getAriaAttribute('aria-label')
2932
+ }
2933
+
2934
+ set ariaLabel (value) {
2935
+ this.setAriaAttribute('aria-label', value)
2936
+ }
2937
+
2938
+ get ariaLevel () {
2939
+ return this.getAriaAttribute('aria-level')
2940
+ }
2941
+
2942
+ set ariaLevel (value) {
2943
+ this.setAriaAttribute('aria-level', value)
2944
+ }
2945
+
2946
+ get ariaLive () {
2947
+ return this.getAriaAttribute('aria-live')
2948
+ }
2949
+
2950
+ set ariaLive (value) {
2951
+ this.setAriaAttribute('aria-live', value)
2952
+ }
2953
+
2954
+ get ariaModal () {
2955
+ return this.getAriaAttribute('aria-modal')
2956
+ }
2957
+
2958
+ set ariaModal (value) {
2959
+ this.setAriaAttribute('aria-modal', value)
2960
+ }
2961
+
2962
+ get ariaMultiline () {
2963
+ return this.getAriaAttribute('aria-multiline')
2964
+ }
2965
+
2966
+ set ariaMultiline (value) {
2967
+ this.setAriaAttribute('aria-multiline', value)
2968
+ }
2969
+
2970
+ get ariaMultiSelectable () {
2971
+ return this.getAriaAttribute('aria-multiselectable')
2972
+ }
2973
+
2974
+ set ariaMultiSelectable (value) {
2975
+ this.setAriaAttribute('aria-multiselectable', value)
2976
+ }
2977
+
2978
+ get ariaOrientation () {
2979
+ return this.getAriaAttribute('aria-orientation')
2980
+ }
2981
+
2982
+ set ariaOrientation (value) {
2983
+ this.setAriaAttribute('aria-orientation', value)
2984
+ }
2985
+
2986
+ get ariaPlaceholder () {
2987
+ return this.getAriaAttribute('aria-placeholder')
2988
+ }
2989
+
2990
+ set ariaPlaceholder (value) {
2991
+ this.setAriaAttribute('aria-placeholder', value)
2992
+ }
2993
+
2994
+ get ariaPosInSet () {
2995
+ return this.getAriaAttribute('aria-posinset')
2996
+ }
2997
+
2998
+ set ariaPosInSet (value) {
2999
+ this.setAriaAttribute('aria-posinset', value)
3000
+ }
3001
+
3002
+ get ariaPressed () {
3003
+ return this.getAriaAttribute('aria-pressed')
3004
+ }
3005
+
3006
+ set ariaPressed (value) {
3007
+ this.setAriaAttribute('aria-pressed', value)
3008
+ }
3009
+
3010
+ get ariaReadOnly () {
3011
+ return this.getAriaAttribute('aria-readonly')
3012
+ }
3013
+
3014
+ set ariaReadOnly (value) {
3015
+ this.setAriaAttribute('aria-readonly', value)
3016
+ }
3017
+
3018
+ get ariaRequired () {
3019
+ return this.getAriaAttribute('aria-required')
3020
+ }
3021
+
3022
+ set ariaRequired (value) {
3023
+ this.setAriaAttribute('aria-required', value)
3024
+ }
3025
+
3026
+ get ariaRoleDescription () {
3027
+ return this.getAriaAttribute('aria-roledescription')
3028
+ }
3029
+
3030
+ set ariaRoleDescription (value) {
3031
+ this.setAriaAttribute('aria-roledescription', value)
3032
+ }
3033
+
3034
+ get ariaRowCount () {
3035
+ return this.getAriaAttribute('aria-rowcount')
3036
+ }
3037
+
3038
+ set ariaRowCount (value) {
3039
+ this.setAriaAttribute('aria-rowcount', value)
3040
+ }
3041
+
3042
+ get ariaRowIndex () {
3043
+ return this.getAriaAttribute('aria-rowindex')
3044
+ }
3045
+
3046
+ set ariaRowIndex (value) {
3047
+ this.setAriaAttribute('aria-rowindex', value)
3048
+ }
3049
+
3050
+ get ariaRowSpan () {
3051
+ return this.getAriaAttribute('aria-rowspan')
3052
+ }
3053
+
3054
+ set ariaRowSpan (value) {
3055
+ this.setAriaAttribute('aria-rowspan', value)
3056
+ }
3057
+
3058
+ get ariaSelected () {
3059
+ return this.getAriaAttribute('aria-selected')
3060
+ }
3061
+
3062
+ set ariaSelected (value) {
3063
+ this.setAriaAttribute('aria-selected', value)
3064
+ }
3065
+
3066
+ get ariaSetSize () {
3067
+ return this.getAriaAttribute('aria-setsize')
3068
+ }
3069
+
3070
+ set ariaSetSize (value) {
3071
+ this.setAriaAttribute('aria-setsize', value)
3072
+ }
3073
+
3074
+ get ariaSort () {
3075
+ return this.getAriaAttribute('aria-sort')
3076
+ }
3077
+
3078
+ set ariaSort (value) {
3079
+ this.setAriaAttribute('aria-sort', value)
3080
+ }
3081
+
3082
+ get ariaValueMax () {
3083
+ return this.getAriaAttribute('aria-valuemax')
3084
+ }
3085
+
3086
+ set ariaValueMax (value) {
3087
+ this.setAriaAttribute('aria-valuemax', value)
3088
+ }
3089
+
3090
+ get ariaValueMin () {
3091
+ return this.getAriaAttribute('aria-valuemin')
3092
+ }
3093
+
3094
+ set ariaValueMin (value) {
3095
+ this.setAriaAttribute('aria-valuemin', value)
3096
+ }
3097
+
3098
+ get ariaValueNow () {
3099
+ return this.getAriaAttribute('aria-valuenow')
3100
+ }
3101
+
3102
+ set ariaValueNow (value) {
3103
+ this.setAriaAttribute('aria-valuenow', value)
3104
+ }
3105
+
3106
+ get ariaValueText () {
3107
+ return this.getAriaAttribute('aria-valuetext')
3108
+ }
3109
+
3110
+ set ariaValueText (value) {
3111
+ this.setAriaAttribute('aria-valuetext', value)
3112
+ }
2798
3113
  }
2799
3114
  exports.ElementService = ElementService
2800
3115
  }, { '../factories/createEvent': 5, '../factories/query': 14, '../factories/serializeHTML': 15, '../functions/getParentNodesFromAttribute': 19, './AttrService': 22, './DOMTokenListService': 25, './HTMLCollectionService': 32, './NamedNodeMapService': 37, './NodeService': 38, './ShadowRootService': 40, 'core-js/modules/esnext.iterator.constructor.js': 193, 'core-js/modules/esnext.iterator.every.js': 194, 'core-js/modules/esnext.iterator.find.js': 196, 'core-js/modules/esnext.iterator.for-each.js': 197, 'core-js/modules/esnext.iterator.map.js': 198, 'core-js/modules/esnext.iterator.some.js': 200, 'core-js/modules/esnext.set.add-all.js': 214, 'core-js/modules/esnext.set.delete-all.js': 215, 'core-js/modules/esnext.set.difference.js': 216, 'core-js/modules/esnext.set.every.js': 217, 'core-js/modules/esnext.set.filter.js': 218, 'core-js/modules/esnext.set.find.js': 219, 'core-js/modules/esnext.set.intersection.js': 220, 'core-js/modules/esnext.set.is-disjoint-from.js': 221, 'core-js/modules/esnext.set.is-subset-of.js': 222, 'core-js/modules/esnext.set.is-superset-of.js': 223, 'core-js/modules/esnext.set.join.js': 224, 'core-js/modules/esnext.set.map.js': 225, 'core-js/modules/esnext.set.reduce.js': 226, 'core-js/modules/esnext.set.some.js': 227, 'core-js/modules/esnext.set.symmetric-difference.js': 228, 'core-js/modules/esnext.set.union.js': 229, 'si-funciona/dist/helpers/objects/cloneObject': 263, 'si-funciona/dist/helpers/objects/isEqual': 265 }],